What does "greater-than-equal" mark means in OpenCV mat class?

I got an OpenCV pHash code from following url: https://gist.github.com/msly/bb0bff63914d54fed88f

And i want to port the code to Java.

But really what does

Mat mask = (dst >= imageMean[0]);

and

mask.at<uchar>(i, j) == 0 ? (hash[i*mask.cols + j] = '0') : 
(hash[i*mask.cols + j] = '1');

mean? Is there some java wrapper method for ">=", and the "at<uchar>"?

I found the up ">=" mask as

Core.compare(Mat, Scalar, Core.CMP_GE)

But while imageMean is Scalar in java, what's the imageMean[0] mean in C++ code?

Answers


Mat mask = (dst >= imageMean[0]);

is a MatExpr.

Basically it is a element-wise comparison with respect to the scalar and giving out a matrix with 255 if the condition is satisfied and 0 if it is not.


Need Your Help

How to reshape data to long format?

r reshape

I have a .csv file like this: