Commit 5fa6d70a authored by Andrey Pavlenko's avatar Andrey Pavlenko Committed by OpenCV Buildbot

Merge pull request #1695 from ilya-lavrenov:ocl_showDiff

parents 529f086b eb2f8a29
...@@ -231,12 +231,15 @@ double checkRectSimilarity(Size sz, std::vector<Rect>& ob1, std::vector<Rect>& o ...@@ -231,12 +231,15 @@ double checkRectSimilarity(Size sz, std::vector<Rect>& ob1, std::vector<Rect>& o
return final_test_result; 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; Mat diff;
absdiff(gold, actual, diff); absdiff(gold, actual, diff);
diff.convertTo(diff, CV_32F);
threshold(diff, diff, eps, 255.0, cv::THRESH_BINARY); threshold(diff, diff, eps, 255.0, cv::THRESH_BINARY);
if (alwaysShow || cv::countNonZero(diff.reshape(1)) > 0)
{
namedWindow("gold", WINDOW_NORMAL); namedWindow("gold", WINDOW_NORMAL);
namedWindow("actual", WINDOW_NORMAL); namedWindow("actual", WINDOW_NORMAL);
namedWindow("diff", WINDOW_NORMAL); namedWindow("diff", WINDOW_NORMAL);
...@@ -246,6 +249,7 @@ void showDiff(const Mat& gold, const Mat& actual, double eps) ...@@ -246,6 +249,7 @@ void showDiff(const Mat& gold, const Mat& actual, double eps)
imshow("diff", diff); imshow("diff", diff);
waitKey(); waitKey();
}
} }
} // namespace cvtest } // namespace cvtest
...@@ -52,7 +52,7 @@ extern int LOOP_TIMES; ...@@ -52,7 +52,7 @@ extern int LOOP_TIMES;
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 createMat_ocl(cv::RNG& rng, Size size, int type, bool useRoi);
cv::ocl::oclMat loadMat_ocl(cv::RNG& rng, const Mat& m, bool useRoi); cv::ocl::oclMat loadMat_ocl(cv::RNG& rng, const Mat& m, bool useRoi);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment