The matte (logical) operator '> =' in OpenCV 2.3

I am running demo code from OpenCV 2.3, distribans.cpp, and there is a line of code that I hardly understand what this means:

Mat edge = gray >= edgeThresh, dist, labels, dist8u; 

It is used as a threshold operation, but I do not know how this works or even for its name and google.

thanks

+4
source share
1 answer

operator >= overload for cv :: Mat displays the operation for calling cv::compare with the corresponding comparison key.

The cv::compare function returns a mask ( cv::Mat depth CV_8U ), where all elements that satisfy the condition (if the element from gray has a value not less than edgeThresh in your case) are set to 0xFF , and the rest of the elements are zero.

+6
source

Source: https://habr.com/ru/post/1402389/


All Articles