vendor: OpenCV 5.0.0 snapshot at 755e50675d97db9b7d449d8bd6b09888646f6c6e
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
// This file is part of OpenCV project.
|
||||
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
||||
// of this distribution and at http://opencv.org/license.html.
|
||||
#include "test_precomp.hpp"
|
||||
|
||||
namespace opencv_test { namespace {
|
||||
|
||||
TEST(ximgproc_niBlackThreshold, sauvola)
|
||||
{
|
||||
Mat src = (Mat_<uchar>(3, 3) << 1, 1, 1, 2, 2, 2, 3, 3, 3);
|
||||
Mat dst;
|
||||
cv::ximgproc::niBlackThreshold(src, dst, 255, THRESH_BINARY, 3, 1, BINARIZATION_SAUVOLA, 1);
|
||||
|
||||
EXPECT_EQ(CV_8U, dst.type());
|
||||
EXPECT_EQ(3, dst.rows);
|
||||
EXPECT_EQ(3, dst.cols);
|
||||
|
||||
EXPECT_EQ(0, dst.at<uchar>(0, 0));
|
||||
EXPECT_EQ(0, dst.at<uchar>(0, 1));
|
||||
EXPECT_EQ(0, dst.at<uchar>(0, 2));
|
||||
EXPECT_EQ(0, dst.at<uchar>(1, 0));
|
||||
EXPECT_EQ(0, dst.at<uchar>(1, 1));
|
||||
EXPECT_EQ(0, dst.at<uchar>(1, 2));
|
||||
EXPECT_EQ(255, dst.at<uchar>(2, 0));
|
||||
EXPECT_EQ(255, dst.at<uchar>(2, 1));
|
||||
EXPECT_EQ(255, dst.at<uchar>(2, 2));
|
||||
}
|
||||
|
||||
}} // namespace
|
||||
Reference in New Issue
Block a user