Skip to content

Commit 98db804

Browse files
whizzzkidalalek
authored andcommitted
Merge pull request opencv#9210 from whizzzkid/fixing-cuda
Fixing explicitly call download method for cuda::GpuMat object
1 parent a5b5684 commit 98db804

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

modules/stitching/src/matchers.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ using namespace cv::cuda;
5151
using xfeatures2d::SURF;
5252
#endif
5353

54+
#ifdef HAVE_OPENCV_CUDAIMGPROC
55+
# include "opencv2/cudaimgproc.hpp"
56+
#endif
57+
5458
namespace {
5559

5660
struct DistIdxPair
@@ -583,7 +587,12 @@ void SurfFeaturesFinderGpu::find(InputArray image, ImageFeatures &features)
583587
image_.upload(image);
584588

585589
ensureSizeIsEnough(image.size(), CV_8UC1, gray_image_);
590+
591+
#ifdef HAVE_OPENCV_CUDAIMGPROC
592+
cv::cuda::cvtColor(image_, gray_image_, COLOR_BGR2GRAY);
593+
#else
586594
cvtColor(image_, gray_image_, COLOR_BGR2GRAY);
595+
#endif
587596

588597
surf_.nOctaves = num_octaves_;
589598
surf_.nOctaveLayers = num_layers_;

0 commit comments

Comments
 (0)