mirror of
https://github.com/opencv/opencv.git
synced 2025-01-18 06:03:15 +08:00
performance test for INTER_AREA resize has been added.
This commit is contained in:
parent
aa8fbc26da
commit
83390ea4e1
@ -86,8 +86,9 @@ INSTANTIATE_TEST_CASE_P(ImgProc, Resize, testing::Combine(
|
||||
testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4),
|
||||
MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4),
|
||||
MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
|
||||
testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC)),
|
||||
testing::Values(Scale(0.5), Scale(2.0))));
|
||||
testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR),
|
||||
Interpolation(cv::INTER_CUBIC), Interpolation(cv::INTER_AREA)),
|
||||
testing::Values(Scale(0.5), Scale(0.3)/*, Scale(2.0)*/)));
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// WarpAffine
|
||||
|
@ -7,7 +7,7 @@ using perf::MatType;
|
||||
using perf::MatDepth;
|
||||
|
||||
CV_ENUM(BorderMode, cv::BORDER_REFLECT101, cv::BORDER_REPLICATE, cv::BORDER_CONSTANT, cv::BORDER_REFLECT, cv::BORDER_WRAP)
|
||||
CV_ENUM(Interpolation, cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_CUBIC)
|
||||
CV_ENUM(Interpolation, cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_CUBIC, cv::INTER_AREA)
|
||||
CV_ENUM(NormType, cv::NORM_INF, cv::NORM_L1, cv::NORM_L2, cv::NORM_HAMMING)
|
||||
|
||||
struct CvtColorInfo
|
||||
|
@ -76,8 +76,9 @@ INSTANTIATE_TEST_CASE_P(ImgProc, Resize, testing::Combine(
|
||||
testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4),
|
||||
MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4),
|
||||
MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
|
||||
testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC)),
|
||||
testing::Values(Scale(0.5), Scale(2.0))));
|
||||
testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR),
|
||||
Interpolation(cv::INTER_CUBIC), Interpolation(cv::INTER_AREA)),
|
||||
testing::Values(Scale(0.5), Scale(0.3)/*, Scale(2.0)*/)));
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// WarpAffine
|
||||
|
@ -7,7 +7,7 @@ using perf::MatType;
|
||||
using perf::MatDepth;
|
||||
|
||||
CV_ENUM(BorderMode, cv::BORDER_REFLECT101, cv::BORDER_REPLICATE, cv::BORDER_CONSTANT, cv::BORDER_REFLECT, cv::BORDER_WRAP)
|
||||
CV_ENUM(Interpolation, cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_CUBIC)
|
||||
CV_ENUM(Interpolation, cv::INTER_NEAREST, cv::INTER_LINEAR, cv::INTER_CUBIC, cv::INTER_AREA)
|
||||
CV_ENUM(NormType, cv::NORM_INF, cv::NORM_L1, cv::NORM_L2, cv::NORM_HAMMING)
|
||||
|
||||
struct CvtColorInfo
|
||||
|
@ -105,6 +105,8 @@ namespace cv { namespace gpu { namespace device
|
||||
AreaFilter< BorderReader< PtrStep<T>, BrdConstant<T> > > filteredSrc(brdSrc, fx, fy);
|
||||
resize_area<<<grid, block, 0, stream>>>(filteredSrc, fx, fy, dst);
|
||||
cudaSafeCall( cudaGetLastError() );
|
||||
if (stream == 0)
|
||||
cudaSafeCall( cudaDeviceSynchronize() );
|
||||
}
|
||||
};
|
||||
|
||||
@ -120,6 +122,8 @@ namespace cv { namespace gpu { namespace device
|
||||
IntegerAreaFilter< BorderReader< PtrStep<T>, BrdConstant<T> > > filteredSrc(brdSrc, fx, fy);
|
||||
resize_area<<<grid, block, 0, stream>>>(filteredSrc, fx, fy, dst);
|
||||
cudaSafeCall( cudaGetLastError() );
|
||||
if (stream == 0)
|
||||
cudaSafeCall( cudaDeviceSynchronize() );
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -198,7 +198,7 @@ INSTANTIATE_TEST_CASE_P(GPU_ImgProc, ResizeArea, testing::Combine(
|
||||
ALL_DEVICES,
|
||||
DIFFERENT_SIZES,
|
||||
testing::Values(MatType(CV_8UC3), MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4), MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),
|
||||
testing::Values(/*0.3,*/0.5),
|
||||
testing::Values(0.3, 0.5),
|
||||
testing::Values(Interpolation(cv::INTER_AREA)),
|
||||
WHOLE_SUBMAT));
|
||||
|
||||
|
@ -1495,8 +1495,6 @@ TEST(Imgproc_resize_area, regression)
|
||||
cv::Mat expected(5,5,CV_16UC1, expected_data);
|
||||
|
||||
cv::resize(src, actual, cv::Size(), 0.3, 0.3, INTER_AREA);
|
||||
std::cout << actual << std::endl;
|
||||
std::cout << expected << std::endl;
|
||||
|
||||
ASSERT_EQ(actual.type(), expected.type());
|
||||
ASSERT_EQ(actual.size(), expected.size());
|
||||
|
Loading…
Reference in New Issue
Block a user