Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You are correct, the bitwise comparisons return the same size and type as the input Mat. So the output is one channel of binary results per channel of input.

The method you describe is indeed one way of checking.

If all you are checking is whether they are exactly identical, it maybe faster to use

cv::Scalar sum = cv::sum(result);
if(sum(0) + sum(1) + sum(2) == 0)//For a 3 channel image
{//Then Identical}