{\r
static T getValue(const cv::Mat& src, float y, float x, int c, int border_type, cv::Scalar borderVal = cv::Scalar())\r
{\r
- return readVal<T>(src, cvRound(y), cvRound(x), c, border_type, borderVal);\r
+ return readVal<T>(src, int(y), int(x), c, border_type, borderVal);\r
}\r
};\r
\r
\r
\r
/////////////////\r
-PARAM_TEST_CASE(ResizeArea, cv::gpu::DeviceInfo, cv::Size, MatType, double, Interpolation, UseRoi)\r
+PARAM_TEST_CASE(ResizeSameAsHost, cv::gpu::DeviceInfo, cv::Size, MatType, double, Interpolation, UseRoi)\r
{\r
cv::gpu::DeviceInfo devInfo;\r
cv::Size size;\r
}\r
};\r
\r
+// downscaling only: used for classifiers\r
+TEST_P(ResizeSameAsHost, Accuracy)\r
+{\r
+ cv::Mat src = randomMat(size, type);\r
+\r
+ cv::gpu::GpuMat dst = createMat(cv::Size(cv::saturate_cast<int>(src.cols * coeff), cv::saturate_cast<int>(src.rows * coeff)), type, useRoi);\r
+ cv::gpu::resize(loadMat(src, useRoi), dst, cv::Size(), coeff, coeff, interpolation);\r
+\r
+ cv::Mat dst_gold;\r
+ cv::resize(src, dst_gold, cv::Size(), coeff, coeff, interpolation);\r
+\r
+ EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-2 : 1.0);\r
+}\r
+\r
+INSTANTIATE_TEST_CASE_P(GPU_ImgProc, ResizeSameAsHost, testing::Combine(\r
+ ALL_DEVICES,\r
+ DIFFERENT_SIZES,\r
+ testing::Values(MatType(CV_8UC3), MatType(CV_16UC1), MatType(CV_16UC3), MatType(CV_16UC4), MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)),\r
+ testing::Values(0.3, 0.5),\r
+ testing::Values(Interpolation(cv::INTER_AREA), Interpolation(cv::INTER_NEAREST)), //, Interpolation(cv::INTER_LINEAR), Interpolation(cv::INTER_CUBIC)\r
+ WHOLE_SUBMAT));\r
+\r
///////////////////////////////////////////////////////////////////\r
// Test NPP\r
\r