MCPcopy Create free account
hub / github.com/PRiME-project/PRiMEStereoMatch / preprocess

Method preprocess

DE_APP/src/CVC.cpp:87–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void CVC::preprocess(const Mat& Img, Mat& GrdX)
88{
89 Mat Gray;
90 cvtColor(Img, Gray, CV_RGB2GRAY );
91
92 //Sobel filter to compute X gradient
93 //32 bit float data
94 if(Img.type() == CV_32FC3)
95 {
96 Sobel(Gray, GrdX, CV_32F, 1, 0, 1 );
97 GrdX += 0.5;
98 }
99 //8 bit unsigned char data
100 else if(Img.type() == CV_8UC3)
101 {
102 Sobel(Gray, GrdX, CV_8U, 1, 0, 1);
103 //GrdX += 128;
104 }
105 else{
106 printf("CVC: Error - Unrecognised data type in processing! (preprocess)\n");
107 exit(1);
108 }
109 return;
110}
111
112void CVC::buildCV_left(const Mat& lImg, const Mat& rImg, const Mat& lGrdX, const Mat& rGrdX, const int d, Mat& costVol)
113{

Callers 4

CostConst_CPUMethod · 0.45
CostFilterMethod · 0.45
CostFilter_CPUMethod · 0.45
CostFilter_GPUMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected