-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
38 lines (32 loc) · 957 Bytes
/
Copy pathmain.cpp
File metadata and controls
38 lines (32 loc) · 957 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
35
36
37
38
#include "RectifiedDisparity.h"
#include "cuda_test.h"
using namespace std;
using namespace cv;
char img1[] = "im2.png";
char img2[] = "im6.png";
char data_dir[] = "/playpen/teddy";
char filename1[30];
char filename2[30];
int main()
{
sprintf(filename1, "%s/%s",data_dir, img1);
sprintf(filename2, "%s/%s",data_dir, img2);
// getchar();
// printf("width: %d; height: %d; step: %d\n", img1.cols,img1.rows,(int)img1.step);
// for(int i = 0; i < img1.rows; i++){
// for(int j = 0; j < img1.cols; j++){
// img1.data[i*img1.step + j] = 0;
// }
// }
Disparity d = Disparity();
if(!d.ReadImagePair(filename1, filename2)){
return 1;
}
Mat dis = d.FindDisparity(true,false,ZNCC);
Mat img1 = imread(filename1, CV_LOAD_IMAGE_GRAYSCALE);
imwrite("disparity_left.jpg",dis);
namedWindow("Test Window", WINDOW_AUTOSIZE );
imshow("Test Window",dis);
waitKey(0);
return 0;
}