|
|
|
@ -231,21 +231,25 @@ double checkRectSimilarity(Size sz, std::vector<Rect>& ob1, std::vector<Rect>& o |
|
|
|
|
return final_test_result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void showDiff(const Mat& gold, const Mat& actual, double eps) |
|
|
|
|
void showDiff(const Mat& gold, const Mat& actual, double eps, bool alwaysShow) |
|
|
|
|
{ |
|
|
|
|
Mat diff; |
|
|
|
|
absdiff(gold, actual, diff); |
|
|
|
|
diff.convertTo(diff, CV_32F); |
|
|
|
|
threshold(diff, diff, eps, 255.0, cv::THRESH_BINARY); |
|
|
|
|
|
|
|
|
|
namedWindow("gold", WINDOW_NORMAL); |
|
|
|
|
namedWindow("actual", WINDOW_NORMAL); |
|
|
|
|
namedWindow("diff", WINDOW_NORMAL); |
|
|
|
|
if (alwaysShow || cv::countNonZero(diff.reshape(1)) > 0) |
|
|
|
|
{ |
|
|
|
|
namedWindow("gold", WINDOW_NORMAL); |
|
|
|
|
namedWindow("actual", WINDOW_NORMAL); |
|
|
|
|
namedWindow("diff", WINDOW_NORMAL); |
|
|
|
|
|
|
|
|
|
imshow("gold", gold); |
|
|
|
|
imshow("actual", actual); |
|
|
|
|
imshow("diff", diff); |
|
|
|
|
imshow("gold", gold); |
|
|
|
|
imshow("actual", actual); |
|
|
|
|
imshow("diff", diff); |
|
|
|
|
|
|
|
|
|
waitKey(); |
|
|
|
|
waitKey(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} // namespace cvtest
|
|
|
|
|