Ask Your Question

Revision history [back]

Yes 0.911 becomes 1 and 0.66 becomes 1 too

You should use :

 testMat.convertTo(convertedMat, CV_8U,255,0);

 cv::threshold(convertedMat, convertedMat, 255*minDbl, 1., CV_THRESH_TOZERO);

Loops now use opencv function instead of for

testMat.rowRange(0,5)= above;
testMat.rowRange(5,testMat.rows)= below;

Yes 0.911 becomes 1 and 0.66 becomes 1 too

You should use :

 testMat.convertTo(convertedMat, CV_8U,255,0);

 cv::threshold(convertedMat, convertedMat, 255*minDbl, 1., CV_THRESH_TOZERO);

Loops now use opencv function instead of for

testMat.rowRange(0,5)= testMat.rowRange(Range(0,5))= above;
testMat.rowRange(5,testMat.rows)= testMat.rowRange(Range(5,testMat.rows))= below;

Yes 0.911 becomes 1 and 0.66 becomes 1 too

You should use :

 testMat.convertTo(convertedMat, CV_8U,255,0);

 cv::threshold(convertedMat, convertedMat, 255*minDbl, 1., CV_THRESH_TOZERO);

Loops now use opencv function instead of for

testMat.rowRange(Range(0,5))= above;
testMat.rowRange(Range(5,testMat.rows))= testMat.rowRange(5,testMat.rows)= below;