I run a demo code from OpenCV 2.3, distrans.cpp and there is a line of code I barely figure out what it means:
Mat edge = gray >= edgeThresh, dist, labels, dist8u;
It is used like a thresholding operation but I don’t know how it works or even to name & google it.
Thanks
operator >=overload for cv::Mat maps the operation to call tocv::comparewith the relevant comparison key.The
cv::comparefunction returns a mask (cv::MatofCV_8Udepth) where all elements satisfying the condition (if element ofgrayhas a value not less thanedgeThreshin your case) are set to0xFFand the other elements are zero.