mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
minor stitching optimization (improve buffer reuse)
This commit is contained in:
@@ -59,6 +59,7 @@ void cv::gpu::SURF_GPU::operator()(const GpuMat&, const GpuMat&, GpuMat&, GpuMat
|
||||
void cv::gpu::SURF_GPU::operator()(const GpuMat&, const GpuMat&, vector<KeyPoint>&) { throw_nogpu(); }
|
||||
void cv::gpu::SURF_GPU::operator()(const GpuMat&, const GpuMat&, vector<KeyPoint>&, GpuMat&, bool) { throw_nogpu(); }
|
||||
void cv::gpu::SURF_GPU::operator()(const GpuMat&, const GpuMat&, vector<KeyPoint>&, vector<float>&, bool) { throw_nogpu(); }
|
||||
void cv::gpu::SURF_GPU::releaseMemory() { throw_nogpu(); }
|
||||
|
||||
#else /* !defined (HAVE_CUDA) */
|
||||
|
||||
@@ -201,7 +202,7 @@ namespace
|
||||
const int nFeatures = keypoints.cols;
|
||||
if (nFeatures > 0)
|
||||
{
|
||||
descriptors.create(nFeatures, descriptorSize, CV_32F);
|
||||
ensureSizeIsEnough(nFeatures, descriptorSize, CV_32F, descriptors);
|
||||
compute_descriptors_gpu(descriptors, keypoints.ptr<float>(SURF_GPU::SF_X), keypoints.ptr<float>(SURF_GPU::SF_Y),
|
||||
keypoints.ptr<float>(SURF_GPU::SF_SIZE), keypoints.ptr<float>(SURF_GPU::SF_DIR), nFeatures);
|
||||
}
|
||||
@@ -431,4 +432,15 @@ void cv::gpu::SURF_GPU::operator()(const GpuMat& img, const GpuMat& mask, vector
|
||||
downloadDescriptors(descriptorsGPU, descriptors);
|
||||
}
|
||||
|
||||
void cv::gpu::SURF_GPU::releaseMemory()
|
||||
{
|
||||
sum.release();
|
||||
mask1.release();
|
||||
maskSum.release();
|
||||
intBuffer.release();
|
||||
det.release();
|
||||
trace.release();
|
||||
maxPosBuffer.release();
|
||||
}
|
||||
|
||||
#endif /* !defined (HAVE_CUDA) */
|
||||
|
||||
Reference in New Issue
Block a user