pub struct SURF_CUDA { /* private fields */ }
Expand description
Class used for extracting Speeded Up Robust Features (SURF) from an image. :
The class SURF_CUDA implements Speeded Up Robust Features descriptor. There is a fast multi-scale Hessian keypoint detector that can be used to find the keypoints (which is the default option). But the descriptors can also be computed for the user-specified keypoints. Only 8-bit grayscale images are supported.
The class SURF_CUDA can store results in the GPU and CPU memory. It provides functions to convert
results between CPU and GPU version ( uploadKeypoints, downloadKeypoints, downloadDescriptors ). The
format of CPU results is the same as SURF results. GPU results are stored in GpuMat. The keypoints
matrix is matrix with the CV_32FC1 type.
- keypoints.ptr<float>(X_ROW)[i] contains x coordinate of the i-th feature.
- keypoints.ptr<float>(Y_ROW)[i] contains y coordinate of the i-th feature.
- keypoints.ptr<float>(LAPLACIAN_ROW)[i] contains the laplacian sign of the i-th feature.
- keypoints.ptr<float>(OCTAVE_ROW)[i] contains the octave of the i-th feature.
- keypoints.ptr<float>(SIZE_ROW)[i] contains the size of the i-th feature.
- keypoints.ptr<float>(ANGLE_ROW)[i] contain orientation of the i-th feature.
- keypoints.ptr<float>(HESSIAN_ROW)[i] contains the response of the i-th feature.
The descriptors matrix is matrix with the
CV_32FC1 type.
The class SURF_CUDA uses some buffers and provides access to it. All buffers can be safely released between function calls.
§See also
SURF
Note:
- An example for using the SURF keypoint matcher on GPU can be found at opencv_source_code/samples/gpu/surf_keypoint_matcher.cpp
Implementations§
Source§impl SURF_CUDA
impl SURF_CUDA
Sourcepub fn new(
_hessian_threshold: f64,
_n_octaves: i32,
_n_octave_layers: i32,
_extended: bool,
_keypoints_ratio: f32,
_upright: bool,
) -> Result<SURF_CUDA>
pub fn new( _hessian_threshold: f64, _n_octaves: i32, _n_octave_layers: i32, _extended: bool, _keypoints_ratio: f32, _upright: bool, ) -> Result<SURF_CUDA>
the full constructor taking all the necessary parameters
§C++ default parameters
- _n_octaves: 4
- _n_octave_layers: 2
- _extended: false
- _keypoints_ratio: 0.01f
- _upright: false
Sourcepub fn new_def(_hessian_threshold: f64) -> Result<SURF_CUDA>
pub fn new_def(_hessian_threshold: f64) -> Result<SURF_CUDA>
the full constructor taking all the necessary parameters
§Note
This alternative version of [new] function uses the following default values for its arguments:
- _n_octaves: 4
- _n_octave_layers: 2
- _extended: false
- _keypoints_ratio: 0.01f
- _upright: false
Sourcepub fn create(
_hessian_threshold: f64,
_n_octaves: i32,
_n_octave_layers: i32,
_extended: bool,
_keypoints_ratio: f32,
_upright: bool,
) -> Result<Ptr<SURF_CUDA>>
pub fn create( _hessian_threshold: f64, _n_octaves: i32, _n_octave_layers: i32, _extended: bool, _keypoints_ratio: f32, _upright: bool, ) -> Result<Ptr<SURF_CUDA>>
§Parameters
- _hessianThreshold: Threshold for hessian keypoint detector used in SURF.
- _nOctaves: Number of pyramid octaves the keypoint detector will use.
- _nOctaveLayers: Number of octave layers within each octave.
- _extended: Extended descriptor flag (true - use extended 128-element descriptors; false - use 64-element descriptors).
- _keypointsRatio: Limits a maximum number of features
- _upright: Up-right or rotated features flag (true - do not compute orientation of features; false - compute orientation).
§C++ default parameters
- _n_octaves: 4
- _n_octave_layers: 2
- _extended: false
- _keypoints_ratio: 0.01f
- _upright: false
Sourcepub fn create_def(_hessian_threshold: f64) -> Result<Ptr<SURF_CUDA>>
pub fn create_def(_hessian_threshold: f64) -> Result<Ptr<SURF_CUDA>>
§Parameters
- _hessianThreshold: Threshold for hessian keypoint detector used in SURF.
- _nOctaves: Number of pyramid octaves the keypoint detector will use.
- _nOctaveLayers: Number of octave layers within each octave.
- _extended: Extended descriptor flag (true - use extended 128-element descriptors; false - use 64-element descriptors).
- _keypointsRatio: Limits a maximum number of features
- _upright: Up-right or rotated features flag (true - do not compute orientation of features; false - compute orientation).
§Note
This alternative version of SURF_CUDA::create function uses the following default values for its arguments:
- _n_octaves: 4
- _n_octave_layers: 2
- _extended: false
- _keypoints_ratio: 0.01f
- _upright: false
Trait Implementations§
Source§impl Boxed for SURF_CUDA
impl Boxed for SURF_CUDA
Source§unsafe fn from_raw(ptr: <SURF_CUDA as OpenCVFromExtern>::ExternReceive) -> Self
unsafe fn from_raw(ptr: <SURF_CUDA as OpenCVFromExtern>::ExternReceive) -> Self
Source§fn into_raw(self) -> <SURF_CUDA as OpenCVTypeExternContainer>::ExternSendMut
fn into_raw(self) -> <SURF_CUDA as OpenCVTypeExternContainer>::ExternSendMut
Source§fn as_raw(&self) -> <SURF_CUDA as OpenCVTypeExternContainer>::ExternSend
fn as_raw(&self) -> <SURF_CUDA as OpenCVTypeExternContainer>::ExternSend
Source§fn as_raw_mut(
&mut self,
) -> <SURF_CUDA as OpenCVTypeExternContainer>::ExternSendMut
fn as_raw_mut( &mut self, ) -> <SURF_CUDA as OpenCVTypeExternContainer>::ExternSendMut
Source§impl SURF_CUDATrait for SURF_CUDA
impl SURF_CUDATrait for SURF_CUDA
fn as_raw_mut_SURF_CUDA(&mut self) -> *mut c_void
fn set_hessian_threshold(&mut self, val: f64)
fn set_n_octaves(&mut self, val: i32)
fn set_n_octave_layers(&mut self, val: i32)
fn set_extended(&mut self, val: bool)
fn set_upright(&mut self, val: bool)
Source§fn set_keypoints_ratio(&mut self, val: f32)
fn set_keypoints_ratio(&mut self, val: f32)
fn set_sum(&mut self, val: GpuMat)
fn set_mask1(&mut self, val: GpuMat)
fn set_mask_sum(&mut self, val: GpuMat)
fn set_det(&mut self, val: GpuMat)
fn set_trace(&mut self, val: GpuMat)
fn set_max_pos_buffer(&mut self, val: GpuMat)
Source§fn upload_keypoints(
&mut self,
keypoints: &Vector<KeyPoint>,
keypoints_gpu: &mut impl GpuMatTrait,
) -> Result<()>
fn upload_keypoints( &mut self, keypoints: &Vector<KeyPoint>, keypoints_gpu: &mut impl GpuMatTrait, ) -> Result<()>
Source§fn download_keypoints(
&mut self,
keypoints_gpu: &impl GpuMatTraitConst,
keypoints: &mut Vector<KeyPoint>,
) -> Result<()>
fn download_keypoints( &mut self, keypoints_gpu: &impl GpuMatTraitConst, keypoints: &mut Vector<KeyPoint>, ) -> Result<()>
Source§fn download_descriptors(
&mut self,
descriptors_gpu: &impl GpuMatTraitConst,
descriptors: &mut Vector<f32>,
) -> Result<()>
fn download_descriptors( &mut self, descriptors_gpu: &impl GpuMatTraitConst, descriptors: &mut Vector<f32>, ) -> Result<()>
Source§fn apply(
&mut self,
img: &impl GpuMatTraitConst,
mask: &impl GpuMatTraitConst,
keypoints: &mut impl GpuMatTrait,
) -> Result<()>
fn apply( &mut self, img: &impl GpuMatTraitConst, mask: &impl GpuMatTraitConst, keypoints: &mut impl GpuMatTrait, ) -> Result<()>
Source§fn apply_1(
&mut self,
img: &impl GpuMatTraitConst,
mask: &impl GpuMatTraitConst,
keypoints: &mut impl GpuMatTrait,
descriptors: &mut impl GpuMatTrait,
use_provided_keypoints: bool,
) -> Result<()>
fn apply_1( &mut self, img: &impl GpuMatTraitConst, mask: &impl GpuMatTraitConst, keypoints: &mut impl GpuMatTrait, descriptors: &mut impl GpuMatTrait, use_provided_keypoints: bool, ) -> Result<()>
Source§fn apply_def(
&mut self,
img: &impl GpuMatTraitConst,
mask: &impl GpuMatTraitConst,
keypoints: &mut impl GpuMatTrait,
descriptors: &mut impl GpuMatTrait,
) -> Result<()>
fn apply_def( &mut self, img: &impl GpuMatTraitConst, mask: &impl GpuMatTraitConst, keypoints: &mut impl GpuMatTrait, descriptors: &mut impl GpuMatTrait, ) -> Result<()>
Source§fn detect(
&mut self,
img: &impl GpuMatTraitConst,
mask: &impl GpuMatTraitConst,
keypoints: &mut impl GpuMatTrait,
) -> Result<()>
fn detect( &mut self, img: &impl GpuMatTraitConst, mask: &impl GpuMatTraitConst, keypoints: &mut impl GpuMatTrait, ) -> Result<()>
fn apply_2( &mut self, img: &impl GpuMatTraitConst, mask: &impl GpuMatTraitConst, keypoints: &mut Vector<KeyPoint>, ) -> Result<()>
Source§fn apply_3(
&mut self,
img: &impl GpuMatTraitConst,
mask: &impl GpuMatTraitConst,
keypoints: &mut Vector<KeyPoint>,
descriptors: &mut impl GpuMatTrait,
use_provided_keypoints: bool,
) -> Result<()>
fn apply_3( &mut self, img: &impl GpuMatTraitConst, mask: &impl GpuMatTraitConst, keypoints: &mut Vector<KeyPoint>, descriptors: &mut impl GpuMatTrait, use_provided_keypoints: bool, ) -> Result<()>
Source§fn apply_def_1(
&mut self,
img: &impl GpuMatTraitConst,
mask: &impl GpuMatTraitConst,
keypoints: &mut Vector<KeyPoint>,
descriptors: &mut impl GpuMatTrait,
) -> Result<()>
fn apply_def_1( &mut self, img: &impl GpuMatTraitConst, mask: &impl GpuMatTraitConst, keypoints: &mut Vector<KeyPoint>, descriptors: &mut impl GpuMatTrait, ) -> Result<()>
Source§fn detect_with_descriptors(
&mut self,
img: &impl GpuMatTraitConst,
mask: &impl GpuMatTraitConst,
keypoints: &mut impl GpuMatTrait,
descriptors: &mut impl GpuMatTrait,
use_provided_keypoints: bool,
) -> Result<()>
fn detect_with_descriptors( &mut self, img: &impl GpuMatTraitConst, mask: &impl GpuMatTraitConst, keypoints: &mut impl GpuMatTrait, descriptors: &mut impl GpuMatTrait, use_provided_keypoints: bool, ) -> Result<()>
Source§fn detect_with_descriptors_def(
&mut self,
img: &impl GpuMatTraitConst,
mask: &impl GpuMatTraitConst,
keypoints: &mut impl GpuMatTrait,
descriptors: &mut impl GpuMatTrait,
) -> Result<()>
fn detect_with_descriptors_def( &mut self, img: &impl GpuMatTraitConst, mask: &impl GpuMatTraitConst, keypoints: &mut impl GpuMatTrait, descriptors: &mut impl GpuMatTrait, ) -> Result<()>
Source§fn apply_4(
&mut self,
img: &impl GpuMatTraitConst,
mask: &impl GpuMatTraitConst,
keypoints: &mut Vector<KeyPoint>,
descriptors: &mut Vector<f32>,
use_provided_keypoints: bool,
) -> Result<()>
fn apply_4( &mut self, img: &impl GpuMatTraitConst, mask: &impl GpuMatTraitConst, keypoints: &mut Vector<KeyPoint>, descriptors: &mut Vector<f32>, use_provided_keypoints: bool, ) -> Result<()>
Source§fn apply_def_2(
&mut self,
img: &impl GpuMatTraitConst,
mask: &impl GpuMatTraitConst,
keypoints: &mut Vector<KeyPoint>,
descriptors: &mut Vector<f32>,
) -> Result<()>
fn apply_def_2( &mut self, img: &impl GpuMatTraitConst, mask: &impl GpuMatTraitConst, keypoints: &mut Vector<KeyPoint>, descriptors: &mut Vector<f32>, ) -> Result<()>
fn release_memory(&mut self) -> Result<()>
Source§impl SURF_CUDATraitConst for SURF_CUDA
impl SURF_CUDATraitConst for SURF_CUDA
fn as_raw_SURF_CUDA(&self) -> *const c_void
fn hessian_threshold(&self) -> f64
fn n_octaves(&self) -> i32
fn n_octave_layers(&self) -> i32
fn extended(&self) -> bool
fn upright(&self) -> bool
Source§fn keypoints_ratio(&self) -> f32
fn keypoints_ratio(&self) -> f32
fn sum(&self) -> GpuMat
fn mask1(&self) -> GpuMat
fn mask_sum(&self) -> GpuMat
fn det(&self) -> GpuMat
fn trace(&self) -> GpuMat
fn max_pos_buffer(&self) -> GpuMat
Source§fn descriptor_size(&self) -> Result<i32>
fn descriptor_size(&self) -> Result<i32>
Source§fn default_norm(&self) -> Result<i32>
fn default_norm(&self) -> Result<i32>
impl Send for SURF_CUDA
Auto Trait Implementations§
impl Freeze for SURF_CUDA
impl RefUnwindSafe for SURF_CUDA
impl !Sync for SURF_CUDA
impl Unpin for SURF_CUDA
impl UnwindSafe for SURF_CUDA
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
impl<Mat> ModifyInplace for Matwhere
Mat: Boxed,
Source§unsafe fn modify_inplace<Res>(
&mut self,
f: impl FnOnce(&Mat, &mut Mat) -> Res,
) -> Res
unsafe fn modify_inplace<Res>( &mut self, f: impl FnOnce(&Mat, &mut Mat) -> Res, ) -> Res
Mat
or another similar object. By passing
a mutable reference to the Mat
to this function your closure will get called with the read reference and a write references
to the same Mat
. This is unsafe in a general case as it leads to having non-exclusive mutable access to the internal data,
but it can be useful for some performance sensitive operations. One example of an OpenCV function that allows such in-place
modification is imgproc::threshold
. Read more