MatExpr operator == (const Mat& a, const Mat& b)
conflicts often in container classes comparing a matrix to be the same instance. Mat itself is a kind of shared pointer class and it should compare the pointers of the data, so

Mat m1 = Mat(1,1, CV_8U)
Mat m2 = m1;
if (m1==m2) { // same instance of data}

This will be used for Instance in QList<Mat>.indexOf(m1) etc.
Let cv::approxPolyDP work with Point2d for large value data.