|
41 | 41 | //M*/ |
42 | 42 |
|
43 | 43 | #include "test_precomp.hpp" |
| 44 | +#include "opencv2/core/matx.hpp" |
| 45 | +#include "nppdefs.h" |
44 | 46 |
|
45 | 47 | #ifdef HAVE_CUDA |
46 | 48 |
|
@@ -178,5 +180,29 @@ INSTANTIATE_TEST_CASE_P(CUDA_Warping, Remap, testing::Combine( |
178 | 180 | WHOLE_SUBMAT)); |
179 | 181 |
|
180 | 182 |
|
| 183 | +class RemapOutOfScope : public Remap {}; |
| 184 | +CUDA_TEST_P(RemapOutOfScope, Regression_18224) |
| 185 | +{ |
| 186 | + cv::Mat src = randomMat(size, type); |
| 187 | + cv::cuda::GpuMat dst = createMat(xmap.size(), type, useRoi); |
| 188 | + randu(xmap, NPP_MAX_32S, NPP_MAXABS_32F); |
| 189 | + randu(ymap, NPP_MAX_32S, NPP_MAXABS_32F); |
| 190 | + |
| 191 | + cv::cuda::remap(loadMat(src, useRoi), dst, loadMat(xmap, useRoi), loadMat(ymap, useRoi), interpolation, borderType, 0.); |
| 192 | + |
| 193 | + cv::Mat dst_gold; |
| 194 | + remapGold(src, xmap, ymap, dst_gold, interpolation, borderType, 0.); |
| 195 | + |
| 196 | + EXPECT_MAT_NEAR(dst_gold, dst, src.depth() == CV_32F ? 1e-3 : 1.0); |
| 197 | +} |
| 198 | + |
| 199 | +INSTANTIATE_TEST_CASE_P(CUDA_Warping, RemapOutOfScope, testing::Combine( |
| 200 | + ALL_DEVICES, |
| 201 | + DIFFERENT_SIZES, |
| 202 | + testing::Values(MatType(CV_8UC1), MatType(CV_8UC3), MatType(CV_8UC4), MatType(CV_32FC1), MatType(CV_32FC3), MatType(CV_32FC4)), |
| 203 | + testing::Values(Interpolation(cv::INTER_NEAREST), Interpolation(cv::INTER_LINEAR)), |
| 204 | + testing::Values(BorderType(cv::BORDER_CONSTANT)), |
| 205 | + WHOLE_SUBMAT)); |
| 206 | + |
181 | 207 | }} // namespace |
182 | 208 | #endif // HAVE_CUDA |
0 commit comments