\cvdefCpp{bool DeviceInfo::has(GpuFeature feature);}
\begin{description}
-\cvarg{feature}{Feature to be checked. See \hyperref[cpp.gpu.GpuFeature]{gpu::GpuFeature}.}
+\cvarg{feature}{Feature to be checked. See \hyperref[cpp.gpu.GpuFeature]{cv::gpu::GpuFeature}.}
\end{description}
The following method checks whether the module was built with the support of the given feature:
\cvdefCpp{static bool builtWith(GpuFeature feature);}
\begin{description}
-\cvarg{feature}{Feature to be checked. See \hyperref[cpp.gpu.GpuFeature]{gpu::GpuFeature}.}
+\cvarg{feature}{Feature to be checked. See \hyperref[cpp.gpu.GpuFeature]{cv::gpu::GpuFeature}.}
\end{description}
There are a set of methods for checking whether the module contains intermediate (PTX) or binary GPU code for the given architecture(s):
}\r
\r
\r
-//TEST(integral)\r
-//{\r
-// Mat src, sum;\r
-// gpu::GpuMat d_src, d_sum, d_buf;\r
-//\r
-// int size = 4000;\r
-//\r
-// gen(src, size, size, CV_8U, 0, 256);\r
-// sum.create(size + 1, size + 1, CV_32S);\r
-//\r
-// d_src = src;\r
-// d_sum.create(size + 1, size + 1, CV_32S);\r
-//\r
-// for (int i = 0; i < 5; ++i)\r
-// {\r
-// SUBTEST << "size " << size << ", 8U";\r
-//\r
-// CPU_ON;\r
-// integral(src, sum);\r
-// CPU_OFF;\r
-//\r
-// GPU_ON;\r
-// gpu::integralBuffered(d_src, d_sum, d_buf);\r
-// GPU_OFF;\r
-// }\r
-//}\r
+TEST(integral)\r
+{\r
+ Mat src, sum;\r
+ gpu::GpuMat d_src, d_sum, d_buf;\r
+\r
+ int size = 4000;\r
+\r
+ gen(src, size, size, CV_8U, 0, 256);\r
+ sum.create(size + 1, size + 1, CV_32S);\r
+\r
+ d_src = src;\r
+ d_sum.create(size + 1, size + 1, CV_32S);\r
+\r
+ for (int i = 0; i < 5; ++i)\r
+ {\r
+ SUBTEST << "size " << size << ", 8U";\r
+\r
+ CPU_ON;\r
+ integral(src, sum);\r
+ CPU_OFF;\r
+\r
+ GPU_ON;\r
+ gpu::integralBuffered(d_src, d_sum, d_buf);\r
+ GPU_OFF;\r
+ }\r
+}\r
\r
\r
TEST(norm)\r
\r
cv::swap(src, dst);\r
d_src.swap(d_dst);\r
+}\r
+\r
+\r
+TEST(erode)\r
+{\r
+ Mat src, dst, ker;\r
+ gpu::GpuMat d_src, d_dst;\r
+\r
+ for (int size = 2000; size <= 4000; size += 1000)\r
+ {\r
+ SUBTEST << "size " << size;\r
+\r
+ gen(src, size, size, CV_8UC4, Scalar::all(0), Scalar::all(256));\r
+ ker = getStructuringElement(MORPH_RECT, Size(3, 3));\r
+ dst.create(src.size(), src.type());\r
+\r
+ CPU_ON;\r
+ erode(src, dst, ker);\r
+ CPU_OFF;\r
+\r
+ d_src = src;\r
+ d_dst.create(d_src.size(), d_src.type());\r
+\r
+ GPU_ON;\r
+ gpu::erode(d_src, d_dst, ker);\r
+ GPU_OFF;\r
+ }\r
}
\ No newline at end of file