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
namespace cvtest {
-void showDiff(const Mat& gold, const Mat& actual, double eps);
+void showDiff(const Mat& gold, const Mat& actual, double eps, bool alwaysShow = false);
cv::ocl::oclMat createMat_ocl(cv::RNG& rng, Size size, int type, bool useRoi);
cv::ocl::oclMat loadMat_ocl(cv::RNG& rng, const Mat& m, bool useRoi);