-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbp.h
More file actions
34 lines (28 loc) · 742 Bytes
/
bp.h
File metadata and controls
34 lines (28 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef BP_H
#define BP_H
#include <opencv2/opencv.hpp>
#include <vector>
using namespace cv;
using namespace std;
class BP
{
private:
int height;
int width;
int disp;
int iter;
Mat leftImg;
Mat rightImg;
Mat smoothCostMat;
vector<vector<Mat>> msg;
vector<vector<Mat>> obs;
public:
BP(Mat &leftImg, Mat &rightImg, const int disp, const float smoothLambda, const float costLambda, int iter);
~BP();
float calculateDataCost(cv::Mat &leftPaddingImg, cv::Mat &rightPaddingImg, const int h, const int w, const int d);
void beliefPropagate(bool visualize);
Mat maxProduct(vector<vector<Mat>> &msgCopy, int h, int w, int dir);
Mat getDispMap();
Mat do_match();
};
#endif // BP_H