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

Function lrCheck

DE_APP/src/PP.cpp:17–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15PP::~PP(void) {}
16
17void lrCheck(Mat& lDis, Mat& rDis, Mat& lValid, Mat& rValid)
18{
19 int hei = lDis.rows;
20 int wid = lDis.cols;
21 lValid = Scalar(0); //memset( lValid, 0, imgSize * sizeof( int ) );
22 rValid = Scalar(0); //memset( rValid, 0, imgSize * sizeof( int ) );
23 for( int y = 0; y < hei; y ++ ) {
24 uchar* lDisData = ( uchar* ) lDis.ptr<uchar>( y );
25 uchar* rDisData = ( uchar* ) rDis.ptr<uchar>( y );
26 uchar* lValidData = ( uchar* ) lValid.ptr<uchar>( y );
27 uchar* rValidData = ( uchar* ) rValid.ptr<uchar>( y );
28 for( int x = 0; x < wid; x ++ ) {
29 // check left image
30 int lDep = lDisData[ x ];
31 // assert( ( x - lDep ) >= 0 && ( x - lDep ) < wid );
32 int rLoc = ( x - lDep + wid ) % wid;
33 int rDep = rDisData[ rLoc ];
34 // disparity should not be zero
35 if( lDep == rDep && lDep >= 2 ) {
36 lValidData[x] = 1;
37 }
38 // check right image
39 rDep = rDisData[ x ];
40 // assert( ( x + rDep ) >= 0 && ( x + rDep ) < wid );
41 int lLoc = ( x + rDep + wid ) % wid;
42 lDep = lDisData[ lLoc ];
43 // disparity should not be zero
44 if( rDep == lDep && rDep >= 2 ) {
45 rValidData[x] = 1;
46 }
47 }
48 }
49 return;
50}
51
52void fillInv(Mat& lDis, Mat& rDis, Mat& lValid, Mat& rValid)
53{

Callers 1

processDMMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected