resize area with block scan
authorMarina Kolpakova <no@email>
Mon, 18 Jun 2012 09:00:36 +0000 (09:00 +0000)
committerMarina Kolpakova <no@email>
Mon, 18 Jun 2012 09:00:36 +0000 (09:00 +0000)
modules/gpu/src/cuda/resize.cu
modules/gpu/src/resize.cpp
modules/gpu/test/test_resize.cpp

index d3083b3..b84b29f 100644 (file)
@@ -620,7 +620,6 @@ namespace cv { namespace gpu { namespace device
         {\r
             (void)interpolation;\r
 \r
-            //TODO: add assert to picture size\r
             int iscale_x = round(fx);\r
             int iscale_y = round(fy);\r
 \r
@@ -641,8 +640,8 @@ namespace cv { namespace gpu { namespace device
             thred_lines = divUp(src.rows, threads);\r
             blocks = dst.cols * thred_lines;\r
 \r
-            printf("device code executed for Y coordinate with:\nwarps %d, threads %d, thred_lines %d, blocks %d\n",\r
-                   warps, threads, thred_lines, blocks);\r
+            printf("device code executed for Y coordinate with:\nsize %d warps %d, threads %d, thred_lines %d, blocks %d\n",\r
+                   dst.rows, warps, threads, thred_lines, blocks);\r
 \r
             resise_scan_fast_y<T, smem_type><<<blocks, threads, warps * 32 * sizeof(smem_type)>>>\r
                     (buffer, dst, iscale_x, iscale_y, thred_lines);\r
index 51d2e49..ff41818 100644 (file)
@@ -94,6 +94,7 @@ void cv::gpu::resize(const GpuMat& src, GpuMat& dst, GpuMat& buffer, Size dsize,
     CV_Assert(interpolation == INTER_AREA);\r
     CV_Assert( (fx < 1.0) && (fy < 1.0));\r
     CV_Assert(!(dsize == Size()) || (fx > 0 && fy > 0));\r
+    CV_Assert(src.cols >= 128 && src.rows >= 128);\r
 \r
     if (dsize == Size())\r
         dsize = Size(saturate_cast<int>(src.cols * fx), saturate_cast<int>(src.rows * fy));\r
index e819d1c..5e03786 100644 (file)
@@ -201,13 +201,13 @@ TEST_P(ResizeArea, Accuracy)
    cv::Mat gpu;\r
    dst.download(gpu);\r
 \r
-   // std::cout << src\r
+   std::cout //<< src\r
    // << std::endl << std::endl\r
    // << gpu_buff\r
    // << std::endl << std::endl\r
-   // << gpu\r
-   // << std::endl << std::endl\r
-   // << dst_cpu<<  std::endl;\r
+   << gpu\r
+   << std::endl << std::endl\r
+   << dst_cpu<<  std::endl;\r
 \r
 \r
     EXPECT_MAT_NEAR(dst_cpu, dst, src.depth() == CV_32F ? 1e-2 : 1.0);\r
@@ -215,9 +215,9 @@ TEST_P(ResizeArea, Accuracy)
 \r
 INSTANTIATE_TEST_CASE_P(GPU_ImgProc, ResizeArea, testing::Combine(\r
     ALL_DEVICES,\r
-    testing::Values(cv::Size(512, 256)),//DIFFERENT_SIZES,\r
+    testing::Values(cv::Size(640, 10 *  128)),//DIFFERENT_SIZES,\r
     testing::Values(MatType(CV_8UC1)/*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.5),\r
+    testing::Values(0.1),\r
     testing::Values(Interpolation(cv::INTER_AREA)),\r
     WHOLE_SUBMAT));\r
 \r