I have two instances of cv::Mat : m1 and m2. They are of the same numeric type and sizes. Is there any function in OpenCV that returns whether the matrices are identical (ha
For multichannel images, you could use cv::Mat::reshape to create a single channel image without any extra overhead.
An update of Antonio's answer would be
bool areEqual(const cv::Mat& a, const cv::Mat& b) { cv::Mat temp; cv::bitwise_xor(a,b,temp); return !(cv::countNonZero(temp.reshape(1))); }