Mat (logic) operator '>=' in OpenCV 2.3

后端 未结 1 794
天命终不由人
天命终不由人 2020-12-19 15:35

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         


        
相关标签:
1条回答
  • 2020-12-19 15:59

    operator >= overload for cv::Mat maps the operation to call to cv::compare with the relevant comparison key.

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

    0 讨论(0)
提交回复
热议问题