1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

fix CUDA build

CUDA implementation wants to convert std::vector<KeyPoint> <-> GpuMat.
There is no direct mapping from KeyPoint (mix of int/float fields)
into cv::Mat element type, so this conversion must be avoided.

Legacy mode is turned back for CUDA builds.
This commit is contained in:
Alexander Alekhin
2017-08-31 19:13:07 +03:00
parent 0451629e22
commit 164a41b399
3 changed files with 14 additions and 4 deletions
@@ -186,7 +186,7 @@ namespace
}
BufferPool pool(stream);
GpuMat objectsBuf = pool.getBuffer(1, maxNumObjects_, DataType<Rect>::type);
GpuMat objectsBuf = pool.getBuffer(1, maxNumObjects_, traits::Type<Rect>::value);
unsigned int numDetections;
ncvSafeCall( process(image, objectsBuf, ncvMinSize, numDetections) );
@@ -220,7 +220,7 @@ namespace
}
CV_Assert( gpu_objects.rows == 1 );
CV_Assert( gpu_objects.type() == DataType<Rect>::type );
CV_Assert( gpu_objects.type() == traits::Type<Rect>::value );
Rect* ptr = gpu_objects.ptr<Rect>();
objects.assign(ptr, ptr + gpu_objects.cols);
@@ -533,7 +533,7 @@ namespace
const float grouping_eps = 0.2f;
BufferPool pool(stream);
GpuMat objects = pool.getBuffer(1, maxNumObjects_, DataType<Rect>::type);
GpuMat objects = pool.getBuffer(1, maxNumObjects_, traits::Type<Rect>::value);
// used for debug
// candidates.setTo(cv::Scalar::all(0));
@@ -625,7 +625,7 @@ namespace
}
CV_Assert( gpu_objects.rows == 1 );
CV_Assert( gpu_objects.type() == DataType<Rect>::type );
CV_Assert( gpu_objects.type() == traits::Type<Rect>::value );
Rect* ptr = gpu_objects.ptr<Rect>();
objects.assign(ptr, ptr + gpu_objects.cols);