endif()
set(the_description "GPU-accelerated Computer Vision")
-ocv_add_module(gpu opencv_imgproc opencv_calib3d opencv_objdetect)
+ocv_add_module(gpu opencv_imgproc opencv_calib3d opencv_objdetect opencv_video)
ocv_module_include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/cuda")
testing::Values(17, 21)\r
));\r
\r
+//////////////////////////////////////////////////////\r
+// PyrLKOpticalFlowDense\r
+\r
+GPU_PERF_TEST_1(PyrLKOpticalFlowDense, cv::gpu::DeviceInfo)\r
+{\r
+ cv::gpu::DeviceInfo devInfo = GetParam();\r
+\r
+ cv::gpu::setDevice(devInfo.deviceID());\r
+\r
+ cv::Mat frame0_host = readImage("gpu/perf/aloe.jpg", cv::IMREAD_GRAYSCALE);\r
+ cv::Mat frame1_host = readImage("gpu/perf/aloeR.jpg", cv::IMREAD_GRAYSCALE);\r
+\r
+ ASSERT_FALSE(frame0_host.empty());\r
+ ASSERT_FALSE(frame1_host.empty());\r
+\r
+ cv::gpu::GpuMat frame0(frame0_host);\r
+ cv::gpu::GpuMat frame1(frame1_host);\r
+ cv::gpu::GpuMat u; \r
+ cv::gpu::GpuMat v;\r
+\r
+ cv::gpu::PyrLKOpticalFlow pyrLK;\r
+\r
+ declare.time(10);\r
+\r
+ TEST_CYCLE()\r
+ {\r
+ pyrLK.dense(frame0, frame1, u, v);\r
+ }\r
+}\r
+\r
+INSTANTIATE_TEST_CASE_P(Video, PyrLKOpticalFlowDense, ALL_DEVICES);\r
+\r
#endif\r
\r
angle = atan2f(Y, X);\r
if (angle < 0)\r
- angle += 2.0f * CV_PI;\r
- angle *= 180.0f / CV_PI;\r
+ angle += 2.0f * CV_PI_F;\r
+ angle *= 180.0f / CV_PI_F;\r
}\r
}\r
s_X[tid] = X;\r
{\r
float kp_dir = atan2f(besty, bestx);\r
if (kp_dir < 0)\r
- kp_dir += 2.0f * CV_PI;\r
- kp_dir *= 180.0f / CV_PI;\r
+ kp_dir += 2.0f * CV_PI_F;\r
+ kp_dir *= 180.0f / CV_PI_F;\r
\r
featureDir[blockIdx.x] = kp_dir;\r
}\r
const float centerX = featureX[blockIdx.x];\r
const float centerY = featureY[blockIdx.x];\r
const float size = featureSize[blockIdx.x];\r
- const float descriptor_dir = featureDir[blockIdx.x] * (float)(CV_PI / 180);\r
+ const float descriptor_dir = featureDir[blockIdx.x] * (float)(CV_PI_F / 180.0f);\r
\r
/* The sampling intervals and wavelet sized for selecting an orientation\r
and building the keypoint descriptor are defined relative to 's' */\r
calc_dx_dy(sdx, sdy, featureX, featureY, featureSize, featureDir);\r
__syncthreads();\r
\r
+\r
const int tid = threadIdx.y * blockDim.x + threadIdx.x;\r
\r
if (tid < 25)\r