OpenCV 4.5.3(日本語機械翻訳)
xfeatures2d/cuda.hpp
1 /*M///////////////////////////////////////////////////////////////////////////////////////
2 //
3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
4 //
5 // By downloading, copying, installing or using the software you agree to this license.
6 // If you do not agree to this license, do not download, install,
7 // copy or use the software.
8 //
9 //
10 // License Agreement
11 // For Open Source Computer Vision Library
12 //
13 // Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
14 // Copyright (C) 2009, Willow Garage Inc., all rights reserved.
15 // Third party copyrights are property of their respective owners.
16 //
17 // Redistribution and use in source and binary forms, with or without modification,
18 // are permitted provided that the following conditions are met:
19 //
20 // * Redistribution's of source code must retain the above copyright notice,
21 // this list of conditions and the following disclaimer.
22 //
23 // * Redistribution's in binary form must reproduce the above copyright notice,
24 // this list of conditions and the following disclaimer in the documentation
25 // and/or other materials provided with the distribution.
26 //
27 // * The name of the copyright holders may not be used to endorse or promote products
28 // derived from this software without specific prior written permission.
29 //
30 // This software is provided by the copyright holders and contributors "as is" and
31 // any express or implied warranties, including, but not limited to, the implied
32 // warranties of merchantability and fitness for a particular purpose are disclaimed.
33 // In no event shall the Intel Corporation or contributors be liable for any direct,
34 // indirect, incidental, special, exemplary, or consequential damages
35 // (including, but not limited to, procurement of substitute goods or services;
36 // loss of use, data, or profits; or business interruption) however caused
37 // and on any theory of liability, whether in contract, strict liability,
38 // or tort (including negligence or otherwise) arising in any way out of
39 // the use of this software, even if advised of the possibility of such damage.
40 //
41 //M*/
42
43 #ifndef __OPENCV_XFEATURES2D_CUDA_HPP__
44 #define __OPENCV_XFEATURES2D_CUDA_HPP__
45
46 #include "opencv2/core/cuda.hpp"
47
48 namespace cv { namespace cuda {
49
52
86 class CV_EXPORTS_W SURF_CUDA
87{
88 public:
89 enum KeypointLayout
90 {
91 X_ROW = 0,
92 Y_ROW,
93 LAPLACIAN_ROW,
94 OCTAVE_ROW,
95 SIZE_ROW,
96 ANGLE_ROW,
97 HESSIAN_ROW,
98 ROWS_COUNT
99 };
100
104 explicit SURF_CUDA(double _hessianThreshold, int _nOctaves=4,
105 int _nOctaveLayers=2, bool _extended=false, float _keypointsRatio=0.01f, bool _upright = false);
106
117 CV_WRAP static Ptr<SURF_CUDA> create(double _hessianThreshold, int _nOctaves = 4,
118 int _nOctaveLayers = 2, bool _extended = false, float _keypointsRatio = 0.01f, bool _upright = false);
119
121 CV_WRAP int descriptorSize() const;
123 CV_WRAP int defaultNorm() const;
124
126 void uploadKeypoints(const std::vector<KeyPoint>& keypoints, GpuMat& keypointsGPU);
128 CV_WRAP void downloadKeypoints(const GpuMat& keypointsGPU, CV_OUT std::vector<KeyPoint>& keypoints);
129
131 void downloadDescriptors(const GpuMat& descriptorsGPU, std::vector<float>& descriptors);
132
143 void operator()(const GpuMat& img, const GpuMat& mask, GpuMat& keypoints);
146 void operator()(const GpuMat& img, const GpuMat& mask, GpuMat& keypoints, GpuMat& descriptors,
147 bool useProvidedKeypoints = false);
148
155 CV_WRAP inline void detect(const GpuMat& img, const GpuMat& mask, CV_OUT GpuMat& keypoints) {
156 (*this)(img, mask, keypoints);
157 }
158
159 void operator()(const GpuMat& img, const GpuMat& mask, std::vector<KeyPoint>& keypoints);
160 void operator()(const GpuMat& img, const GpuMat& mask, std::vector<KeyPoint>& keypoints, GpuMat& descriptors,
161 bool useProvidedKeypoints = false);
162
171 CV_WRAP inline void detectWithDescriptors(const GpuMat& img, const GpuMat& mask, CV_OUT GpuMat& keypoints, CV_OUT GpuMat& descriptors,
172 bool useProvidedKeypoints = false) {
173 (*this)(img, mask, keypoints, descriptors, useProvidedKeypoints);
174 }
175
176 void operator()(const GpuMat& img, const GpuMat& mask, std::vector<KeyPoint>& keypoints, std::vector<float>& descriptors,
177 bool useProvidedKeypoints = false);
178
179 void releaseMemory();
180
181 // SURF parameters
182 CV_PROP double hessianThreshold;
183 CV_PROP int nOctaves;
184 CV_PROP int nOctaveLayers;
185 CV_PROP bool extended;
186 CV_PROP bool upright;
187
189 CV_PROP float keypointsRatio;
190
191 GpuMat sum, mask1, maskSum;
192
193 GpuMat det, trace;
194
195 GpuMat maxPosBuffer;
196};
197
199
200}} // namespace cv { namespace cuda {
201
202 #endif // __OPENCV_XFEATURES2D_CUDA_HPP__
Base storage class for GPU memory with reference counting.
Definition: core/cuda.hpp:106
Class used for extracting Speeded Up Robust Features (SURF) from an image. :
Definition: xfeatures2d/cuda.hpp:87
SURF_CUDA(double _hessianThreshold, int _nOctaves=4, int _nOctaveLayers=2, bool _extended=false, float _keypointsRatio=0.01f, bool _upright=false)
the full constructor taking all the necessary parameters
void operator()(const GpuMat &img, const GpuMat &mask, GpuMat &keypoints)
void operator()(const GpuMat &img, const GpuMat &mask, GpuMat &keypoints, GpuMat &descriptors, bool useProvidedKeypoints=false)
void downloadDescriptors(const GpuMat &descriptorsGPU, std::vector< float > &descriptors)
download descriptors from device to host memory
SURF_CUDA()
the default constructor
void uploadKeypoints(const std::vector< KeyPoint > &keypoints, GpuMat &keypointsGPU)
upload host keypoints to device memory
CV_EXPORTS_W Scalar trace(InputArray mtx)
Returns the trace of a matrix.
cv
"black box" representation of the file storage associated with a file on disk.
Definition: aruco.hpp:75
Definition: cvstd_wrapper.hpp:74