Trait opencv::hub_prelude::CUDA_DescriptorMatcher
source · [−]pub trait CUDA_DescriptorMatcher: AlgorithmTrait + CUDA_DescriptorMatcherConst {
Show 19 methods
fn as_raw_mut_CUDA_DescriptorMatcher(&mut self) -> *mut c_void;
fn add(&mut self, descriptors: &Vector<GpuMat>) -> Result<()> { ... }
fn clear(&mut self) -> Result<()> { ... }
fn train(&mut self) -> Result<()> { ... }
fn match_(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut Vector<DMatch>,
mask: &dyn ToInputArray
) -> Result<()> { ... }
fn match__1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut Vector<DMatch>,
masks: &Vector<GpuMat>
) -> Result<()> { ... }
fn match_async(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
mask: &dyn ToInputArray,
stream: &mut Stream
) -> Result<()> { ... }
fn match_async_1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
masks: &Vector<GpuMat>,
stream: &mut Stream
) -> Result<()> { ... }
fn match_convert(
&mut self,
gpu_matches: &dyn ToInputArray,
matches: &mut Vector<DMatch>
) -> Result<()> { ... }
fn knn_match(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
k: i32,
mask: &dyn ToInputArray,
compact_result: bool
) -> Result<()> { ... }
fn knn_match_1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
k: i32,
masks: &Vector<GpuMat>,
compact_result: bool
) -> Result<()> { ... }
fn knn_match_async(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
k: i32,
mask: &dyn ToInputArray,
stream: &mut Stream
) -> Result<()> { ... }
fn knn_match_async_1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
k: i32,
masks: &Vector<GpuMat>,
stream: &mut Stream
) -> Result<()> { ... }
fn knn_match_convert(
&mut self,
gpu_matches: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
compact_result: bool
) -> Result<()> { ... }
fn radius_match(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
max_distance: f32,
mask: &dyn ToInputArray,
compact_result: bool
) -> Result<()> { ... }
fn radius_match_1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
max_distance: f32,
masks: &Vector<GpuMat>,
compact_result: bool
) -> Result<()> { ... }
fn radius_match_async(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
max_distance: f32,
mask: &dyn ToInputArray,
stream: &mut Stream
) -> Result<()> { ... }
fn radius_match_async_1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
max_distance: f32,
masks: &Vector<GpuMat>,
stream: &mut Stream
) -> Result<()> { ... }
fn radius_match_convert(
&mut self,
gpu_matches: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
compact_result: bool
) -> Result<()> { ... }
}
Required Methods
fn as_raw_mut_CUDA_DescriptorMatcher(&mut self) -> *mut c_void
Provided Methods
sourcefn add(&mut self, descriptors: &Vector<GpuMat>) -> Result<()>
fn add(&mut self, descriptors: &Vector<GpuMat>) -> Result<()>
Adds descriptors to train a descriptor collection.
If the collection is not empty, the new descriptors are added to existing train descriptors.
Parameters
- descriptors: Descriptors to add. Each descriptors[i] is a set of descriptors from the same train image.
sourcefn train(&mut self) -> Result<()>
fn train(&mut self) -> Result<()>
Trains a descriptor matcher.
Trains a descriptor matcher (for example, the flann index). In all methods to match, the method train() is run every time before matching.
sourcefn match_(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut Vector<DMatch>,
mask: &dyn ToInputArray
) -> Result<()>
fn match_(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut Vector<DMatch>,
mask: &dyn ToInputArray
) -> Result<()>
Finds the best match for each descriptor from a query set (blocking version).
Parameters
- queryDescriptors: Query set of descriptors.
- trainDescriptors: Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
- matches: Matches. If a query descriptor is masked out in mask , no match is added for this descriptor. So, matches size may be smaller than the query descriptors count.
- mask: Mask specifying permissible matches between an input query and train matrices of descriptors.
In the first variant of this method, the train descriptors are passed as an input argument. In the second variant of the method, train descriptors collection that was set by DescriptorMatcher::add is used. Optional mask (or masks) can be passed to specify which query and training descriptors can be matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if mask.at<uchar>(i,j) is non-zero.
C++ default parameters
- mask: noArray()
sourcefn match__1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut Vector<DMatch>,
masks: &Vector<GpuMat>
) -> Result<()>
fn match__1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut Vector<DMatch>,
masks: &Vector<GpuMat>
) -> Result<()>
Finds the best match for each descriptor from a query set (blocking version).
Parameters
- queryDescriptors: Query set of descriptors.
- trainDescriptors: Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
- matches: Matches. If a query descriptor is masked out in mask , no match is added for this descriptor. So, matches size may be smaller than the query descriptors count.
- mask: Mask specifying permissible matches between an input query and train matrices of descriptors.
In the first variant of this method, the train descriptors are passed as an input argument. In the second variant of the method, train descriptors collection that was set by DescriptorMatcher::add is used. Optional mask (or masks) can be passed to specify which query and training descriptors can be matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if mask.at<uchar>(i,j) is non-zero.
Overloaded parameters
C++ default parameters
- masks: std::vector
()
sourcefn match_async(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
mask: &dyn ToInputArray,
stream: &mut Stream
) -> Result<()>
fn match_async(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
mask: &dyn ToInputArray,
stream: &mut Stream
) -> Result<()>
Finds the best match for each descriptor from a query set (asynchronous version).
Parameters
- queryDescriptors: Query set of descriptors.
- trainDescriptors: Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
- matches: Matches array stored in GPU memory. Internal representation is not defined. Use DescriptorMatcher::matchConvert method to retrieve results in standard representation.
- mask: Mask specifying permissible matches between an input query and train matrices of descriptors.
- stream: CUDA stream.
In the first variant of this method, the train descriptors are passed as an input argument. In the second variant of the method, train descriptors collection that was set by DescriptorMatcher::add is used. Optional mask (or masks) can be passed to specify which query and training descriptors can be matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if mask.at<uchar>(i,j) is non-zero.
C++ default parameters
- mask: noArray()
- stream: Stream::Null()
sourcefn match_async_1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
masks: &Vector<GpuMat>,
stream: &mut Stream
) -> Result<()>
fn match_async_1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
masks: &Vector<GpuMat>,
stream: &mut Stream
) -> Result<()>
Finds the best match for each descriptor from a query set (asynchronous version).
Parameters
- queryDescriptors: Query set of descriptors.
- trainDescriptors: Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
- matches: Matches array stored in GPU memory. Internal representation is not defined. Use DescriptorMatcher::matchConvert method to retrieve results in standard representation.
- mask: Mask specifying permissible matches between an input query and train matrices of descriptors.
- stream: CUDA stream.
In the first variant of this method, the train descriptors are passed as an input argument. In the second variant of the method, train descriptors collection that was set by DescriptorMatcher::add is used. Optional mask (or masks) can be passed to specify which query and training descriptors can be matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if mask.at<uchar>(i,j) is non-zero.
Overloaded parameters
C++ default parameters
- masks: std::vector
() - stream: Stream::Null()
sourcefn match_convert(
&mut self,
gpu_matches: &dyn ToInputArray,
matches: &mut Vector<DMatch>
) -> Result<()>
fn match_convert(
&mut self,
gpu_matches: &dyn ToInputArray,
matches: &mut Vector<DMatch>
) -> Result<()>
Converts matches array from internal representation to standard matches vector.
The method is supposed to be used with DescriptorMatcher::matchAsync to get final result. Call this method only after DescriptorMatcher::matchAsync is completed (ie. after synchronization).
Parameters
- gpu_matches: Matches, returned from DescriptorMatcher::matchAsync.
- matches: Vector of DMatch objects.
sourcefn knn_match(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
k: i32,
mask: &dyn ToInputArray,
compact_result: bool
) -> Result<()>
fn knn_match(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
k: i32,
mask: &dyn ToInputArray,
compact_result: bool
) -> Result<()>
Finds the k best matches for each descriptor from a query set (blocking version).
Parameters
- queryDescriptors: Query set of descriptors.
- trainDescriptors: Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
- matches: Matches. Each matches[i] is k or less matches for the same query descriptor.
- k: Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total.
- mask: Mask specifying permissible matches between an input query and train matrices of descriptors.
- compactResult: Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
These extended variants of DescriptorMatcher::match methods find several best matches for each query descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher::match for the details about query and train descriptors.
C++ default parameters
- mask: noArray()
- compact_result: false
sourcefn knn_match_1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
k: i32,
masks: &Vector<GpuMat>,
compact_result: bool
) -> Result<()>
fn knn_match_1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
k: i32,
masks: &Vector<GpuMat>,
compact_result: bool
) -> Result<()>
Finds the k best matches for each descriptor from a query set (blocking version).
Parameters
- queryDescriptors: Query set of descriptors.
- trainDescriptors: Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
- matches: Matches. Each matches[i] is k or less matches for the same query descriptor.
- k: Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total.
- mask: Mask specifying permissible matches between an input query and train matrices of descriptors.
- compactResult: Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
These extended variants of DescriptorMatcher::match methods find several best matches for each query descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher::match for the details about query and train descriptors.
Overloaded parameters
C++ default parameters
- masks: std::vector
() - compact_result: false
sourcefn knn_match_async(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
k: i32,
mask: &dyn ToInputArray,
stream: &mut Stream
) -> Result<()>
fn knn_match_async(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
k: i32,
mask: &dyn ToInputArray,
stream: &mut Stream
) -> Result<()>
Finds the k best matches for each descriptor from a query set (asynchronous version).
Parameters
- queryDescriptors: Query set of descriptors.
- trainDescriptors: Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
- matches: Matches array stored in GPU memory. Internal representation is not defined. Use DescriptorMatcher::knnMatchConvert method to retrieve results in standard representation.
- k: Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total.
- mask: Mask specifying permissible matches between an input query and train matrices of descriptors.
- stream: CUDA stream.
These extended variants of DescriptorMatcher::matchAsync methods find several best matches for each query descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher::matchAsync for the details about query and train descriptors.
C++ default parameters
- mask: noArray()
- stream: Stream::Null()
sourcefn knn_match_async_1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
k: i32,
masks: &Vector<GpuMat>,
stream: &mut Stream
) -> Result<()>
fn knn_match_async_1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
k: i32,
masks: &Vector<GpuMat>,
stream: &mut Stream
) -> Result<()>
Finds the k best matches for each descriptor from a query set (asynchronous version).
Parameters
- queryDescriptors: Query set of descriptors.
- trainDescriptors: Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
- matches: Matches array stored in GPU memory. Internal representation is not defined. Use DescriptorMatcher::knnMatchConvert method to retrieve results in standard representation.
- k: Count of best matches found per each query descriptor or less if a query descriptor has less than k possible matches in total.
- mask: Mask specifying permissible matches between an input query and train matrices of descriptors.
- stream: CUDA stream.
These extended variants of DescriptorMatcher::matchAsync methods find several best matches for each query descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher::matchAsync for the details about query and train descriptors.
Overloaded parameters
C++ default parameters
- masks: std::vector
() - stream: Stream::Null()
sourcefn knn_match_convert(
&mut self,
gpu_matches: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
compact_result: bool
) -> Result<()>
fn knn_match_convert(
&mut self,
gpu_matches: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
compact_result: bool
) -> Result<()>
Converts matches array from internal representation to standard matches vector.
The method is supposed to be used with DescriptorMatcher::knnMatchAsync to get final result. Call this method only after DescriptorMatcher::knnMatchAsync is completed (ie. after synchronization).
Parameters
- gpu_matches: Matches, returned from DescriptorMatcher::knnMatchAsync.
- matches: Vector of DMatch objects.
- compactResult: Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
C++ default parameters
- compact_result: false
sourcefn radius_match(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
max_distance: f32,
mask: &dyn ToInputArray,
compact_result: bool
) -> Result<()>
fn radius_match(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
max_distance: f32,
mask: &dyn ToInputArray,
compact_result: bool
) -> Result<()>
For each query descriptor, finds the training descriptors not farther than the specified distance (blocking version).
Parameters
- queryDescriptors: Query set of descriptors.
- trainDescriptors: Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
- matches: Found matches.
- maxDistance: Threshold for the distance between matched descriptors. Distance means here metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured in Pixels)!
- mask: Mask specifying permissible matches between an input query and train matrices of descriptors.
- compactResult: Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
For each query descriptor, the methods find such training descriptors that the distance between the query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are returned in the distance increasing order.
C++ default parameters
- mask: noArray()
- compact_result: false
sourcefn radius_match_1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
max_distance: f32,
masks: &Vector<GpuMat>,
compact_result: bool
) -> Result<()>
fn radius_match_1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
max_distance: f32,
masks: &Vector<GpuMat>,
compact_result: bool
) -> Result<()>
For each query descriptor, finds the training descriptors not farther than the specified distance (blocking version).
Parameters
- queryDescriptors: Query set of descriptors.
- trainDescriptors: Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
- matches: Found matches.
- maxDistance: Threshold for the distance between matched descriptors. Distance means here metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured in Pixels)!
- mask: Mask specifying permissible matches between an input query and train matrices of descriptors.
- compactResult: Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
For each query descriptor, the methods find such training descriptors that the distance between the query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are returned in the distance increasing order.
Overloaded parameters
C++ default parameters
- masks: std::vector
() - compact_result: false
sourcefn radius_match_async(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
max_distance: f32,
mask: &dyn ToInputArray,
stream: &mut Stream
) -> Result<()>
fn radius_match_async(
&mut self,
query_descriptors: &dyn ToInputArray,
train_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
max_distance: f32,
mask: &dyn ToInputArray,
stream: &mut Stream
) -> Result<()>
For each query descriptor, finds the training descriptors not farther than the specified distance (asynchronous version).
Parameters
- queryDescriptors: Query set of descriptors.
- trainDescriptors: Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
- matches: Matches array stored in GPU memory. Internal representation is not defined. Use DescriptorMatcher::radiusMatchConvert method to retrieve results in standard representation.
- maxDistance: Threshold for the distance between matched descriptors. Distance means here metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured in Pixels)!
- mask: Mask specifying permissible matches between an input query and train matrices of descriptors.
- stream: CUDA stream.
For each query descriptor, the methods find such training descriptors that the distance between the query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are returned in the distance increasing order.
C++ default parameters
- mask: noArray()
- stream: Stream::Null()
sourcefn radius_match_async_1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
max_distance: f32,
masks: &Vector<GpuMat>,
stream: &mut Stream
) -> Result<()>
fn radius_match_async_1(
&mut self,
query_descriptors: &dyn ToInputArray,
matches: &mut dyn ToOutputArray,
max_distance: f32,
masks: &Vector<GpuMat>,
stream: &mut Stream
) -> Result<()>
For each query descriptor, finds the training descriptors not farther than the specified distance (asynchronous version).
Parameters
- queryDescriptors: Query set of descriptors.
- trainDescriptors: Train set of descriptors. This set is not added to the train descriptors collection stored in the class object.
- matches: Matches array stored in GPU memory. Internal representation is not defined. Use DescriptorMatcher::radiusMatchConvert method to retrieve results in standard representation.
- maxDistance: Threshold for the distance between matched descriptors. Distance means here metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured in Pixels)!
- mask: Mask specifying permissible matches between an input query and train matrices of descriptors.
- stream: CUDA stream.
For each query descriptor, the methods find such training descriptors that the distance between the query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are returned in the distance increasing order.
Overloaded parameters
C++ default parameters
- masks: std::vector
() - stream: Stream::Null()
sourcefn radius_match_convert(
&mut self,
gpu_matches: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
compact_result: bool
) -> Result<()>
fn radius_match_convert(
&mut self,
gpu_matches: &dyn ToInputArray,
matches: &mut Vector<Vector<DMatch>>,
compact_result: bool
) -> Result<()>
Converts matches array from internal representation to standard matches vector.
The method is supposed to be used with DescriptorMatcher::radiusMatchAsync to get final result. Call this method only after DescriptorMatcher::radiusMatchAsync is completed (ie. after synchronization).
Parameters
- gpu_matches: Matches, returned from DescriptorMatcher::radiusMatchAsync.
- matches: Vector of DMatch objects.
- compactResult: Parameter used when the mask (or masks) is not empty. If compactResult is false, the matches vector has the same size as queryDescriptors rows. If compactResult is true, the matches vector does not contain matches for fully masked-out query descriptors.
C++ default parameters
- compact_result: false
Implementations
sourceimpl dyn CUDA_DescriptorMatcher + '_
impl dyn CUDA_DescriptorMatcher + '_
sourcepub fn create_bf_matcher(
norm_type: i32
) -> Result<Ptr<dyn CUDA_DescriptorMatcher>>
pub fn create_bf_matcher(
norm_type: i32
) -> Result<Ptr<dyn CUDA_DescriptorMatcher>>
Brute-force descriptor matcher.
For each descriptor in the first set, this matcher finds the closest descriptor in the second set by trying each one. This descriptor matcher supports masking permissible matches of descriptor sets.
Parameters
- normType: One of NORM_L1, NORM_L2, NORM_HAMMING. L1 and L2 norms are preferable choices for SIFT and SURF descriptors, NORM_HAMMING should be used with ORB, BRISK and BRIEF).
C++ default parameters
- norm_type: cv::NORM_L2