718c41634f
1.项目后端整体迁移至PaddleOCR-NCNN算法,已通过基本的兼容性测试 2.工程改为使用CMake组织,后续为了更好地兼容第三方库,不再提供QMake工程 3.重整权利声明文件,重整代码工程,确保最小化侵权风险 Log: 切换后端至PaddleOCR-NCNN,切换工程为CMake Change-Id: I4d5d2c5d37505a4a24b389b1a4c5d12f17bfa38c
52 lines
1.5 KiB
C++
52 lines
1.5 KiB
C++
// 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"
|
|
#include "test_common.hpp"
|
|
|
|
namespace opencv_test {
|
|
|
|
static
|
|
Mat generateTestImageBGR_()
|
|
{
|
|
Size sz(640, 480);
|
|
Mat result(sz, CV_8UC3, Scalar::all(0));
|
|
|
|
const string fname = cvtest::findDataFile("../cv/shared/baboon.png");
|
|
Mat image = imread(fname, IMREAD_COLOR);
|
|
CV_Assert(!image.empty());
|
|
CV_CheckEQ(image.size(), Size(512, 512), "");
|
|
Rect roi((640-512) / 2, 0, 512, 480);
|
|
image(Rect(0, 0, 512, 480)).copyTo(result(roi));
|
|
result(Rect(0, 0, 5, 5)).setTo(Scalar(0, 0, 255)); // R
|
|
result(Rect(5, 0, 5, 5)).setTo(Scalar(0, 255, 0)); // G
|
|
result(Rect(10, 0, 5, 5)).setTo(Scalar(255, 0, 0)); // B
|
|
result(Rect(0, 5, 5, 5)).setTo(Scalar(128, 128, 128)); // gray
|
|
//imshow("test_image", result); waitKey();
|
|
return result;
|
|
}
|
|
Mat generateTestImageBGR()
|
|
{
|
|
static Mat image = generateTestImageBGR_(); // initialize once
|
|
CV_Assert(!image.empty());
|
|
return image;
|
|
}
|
|
|
|
static
|
|
Mat generateTestImageGrayscale_()
|
|
{
|
|
Mat imageBGR = generateTestImageBGR();
|
|
CV_Assert(!imageBGR.empty());
|
|
|
|
Mat result;
|
|
cvtColor(imageBGR, result, COLOR_BGR2GRAY);
|
|
return result;
|
|
}
|
|
Mat generateTestImageGrayscale()
|
|
{
|
|
static Mat image = generateTestImageGrayscale_(); // initialize once
|
|
return image;
|
|
}
|
|
|
|
} // namespace
|