Skip to content

Instantly share code, notes, and snippets.

@komakai
Created September 17, 2023 08:43
Show Gist options
  • Save komakai/d1b1d14e876720cfe3584ffd195e6f21 to your computer and use it in GitHub Desktop.
Save komakai/d1b1d14e876720cfe3584ffd195e6f21 to your computer and use it in GitHub Desktop.
Compare OpenCV Mat
void compareMats(const Mat& a, const Mat& b) {
Mat diff = abs(a - b);
double maxVal;
Point maxLoc;
minMaxLoc( diff, nullptr, &maxVal, nullptr, &maxLoc );
if (maxVal > DBL_EPSILON) {
std::cout << "Max " << maxVal;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment