#![allow(
unused_parens,
clippy::excessive_precision,
clippy::missing_safety_doc,
clippy::not_unsafe_ptr_arg_deref,
clippy::should_implement_trait,
clippy::too_many_arguments,
clippy::unused_unit,
)]
use crate::{mod_prelude::*, core, sys, types};
pub mod prelude {
pub use { super::KeyPointsFilterTrait, super::Feature2DTrait, super::AffineFeature, super::SIFTTrait, super::BRISKTrait, super::ORB, super::MSER, super::FastFeatureDetector, super::AgastFeatureDetector, super::GFTTDetector, super::SimpleBlobDetectorTrait, super::KAZE, super::AKAZE, super::DescriptorMatcher, super::BFMatcherTrait, super::FlannBasedMatcherTrait, super::BOWTrainer, super::BOWKMeansTrainerTrait, super::BOWImgDescriptorExtractorTrait };
}
pub const AgastFeatureDetector_NONMAX_SUPPRESSION: i32 = 10001;
pub const AgastFeatureDetector_THRESHOLD: i32 = 10000;
pub const DrawMatchesFlags_DEFAULT: i32 = 0;
pub const DrawMatchesFlags_DRAW_OVER_OUTIMG: i32 = 1;
pub const DrawMatchesFlags_DRAW_RICH_KEYPOINTS: i32 = 4;
pub const DrawMatchesFlags_NOT_DRAW_SINGLE_POINTS: i32 = 2;
pub const FastFeatureDetector_FAST_N: i32 = 10002;
pub const FastFeatureDetector_NONMAX_SUPPRESSION: i32 = 10001;
pub const FastFeatureDetector_THRESHOLD: i32 = 10000;
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum AKAZE_DescriptorType {
DESCRIPTOR_KAZE_UPRIGHT = 2,
DESCRIPTOR_KAZE = 3,
DESCRIPTOR_MLDB_UPRIGHT = 4,
DESCRIPTOR_MLDB = 5,
}
opencv_type_enum! { crate::features2d::AKAZE_DescriptorType }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum AgastFeatureDetector_DetectorType {
AGAST_5_8 = 0,
AGAST_7_12d = 1,
AGAST_7_12s = 2,
OAST_9_16 = 3,
}
opencv_type_enum! { crate::features2d::AgastFeatureDetector_DetectorType }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum DescriptorMatcher_MatcherType {
FLANNBASED = 1,
BRUTEFORCE = 2,
BRUTEFORCE_L1 = 3,
BRUTEFORCE_HAMMING = 4,
BRUTEFORCE_HAMMINGLUT = 5,
BRUTEFORCE_SL2 = 6,
}
opencv_type_enum! { crate::features2d::DescriptorMatcher_MatcherType }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum DrawMatchesFlags {
DEFAULT = 0,
DRAW_OVER_OUTIMG = 1,
NOT_DRAW_SINGLE_POINTS = 2,
DRAW_RICH_KEYPOINTS = 4,
}
opencv_type_enum! { crate::features2d::DrawMatchesFlags }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum FastFeatureDetector_DetectorType {
TYPE_5_8 = 0,
TYPE_7_12 = 1,
TYPE_9_16 = 2,
}
opencv_type_enum! { crate::features2d::FastFeatureDetector_DetectorType }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum KAZE_DiffusivityType {
DIFF_PM_G1 = 0,
DIFF_PM_G2 = 1,
DIFF_WEICKERT = 2,
DIFF_CHARBONNIER = 3,
}
opencv_type_enum! { crate::features2d::KAZE_DiffusivityType }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum ORB_ScoreType {
HARRIS_SCORE = 0,
FAST_SCORE = 1,
}
opencv_type_enum! { crate::features2d::ORB_ScoreType }
pub type AffineDescriptorExtractor = dyn crate::features2d::AffineFeature;
pub type AffineFeatureDetector = dyn crate::features2d::AffineFeature;
pub type DescriptorExtractor = crate::features2d::Feature2D;
pub type FeatureDetector = crate::features2d::Feature2D;
pub type SiftDescriptorExtractor = crate::features2d::SIFT;
pub type SiftFeatureDetector = crate::features2d::SIFT;
pub fn AGAST(image: &dyn core::ToInputArray, keypoints: &mut core::Vector::<core::KeyPoint>, threshold: i32, nonmax_suppression: bool) -> Result<()> {
input_array_arg!(image);
unsafe { sys::cv_AGAST_const__InputArrayR_vector_KeyPoint_R_int_bool(image.as_raw__InputArray(), keypoints.as_raw_mut_VectorOfKeyPoint(), threshold, nonmax_suppression) }.into_result()
}
pub fn AGAST_with_type(image: &dyn core::ToInputArray, keypoints: &mut core::Vector::<core::KeyPoint>, threshold: i32, nonmax_suppression: bool, typ: crate::features2d::AgastFeatureDetector_DetectorType) -> Result<()> {
input_array_arg!(image);
unsafe { sys::cv_AGAST_const__InputArrayR_vector_KeyPoint_R_int_bool_DetectorType(image.as_raw__InputArray(), keypoints.as_raw_mut_VectorOfKeyPoint(), threshold, nonmax_suppression, typ) }.into_result()
}
pub fn FAST(image: &dyn core::ToInputArray, keypoints: &mut core::Vector::<core::KeyPoint>, threshold: i32, nonmax_suppression: bool) -> Result<()> {
input_array_arg!(image);
unsafe { sys::cv_FAST_const__InputArrayR_vector_KeyPoint_R_int_bool(image.as_raw__InputArray(), keypoints.as_raw_mut_VectorOfKeyPoint(), threshold, nonmax_suppression) }.into_result()
}
pub fn FAST_with_type(image: &dyn core::ToInputArray, keypoints: &mut core::Vector::<core::KeyPoint>, threshold: i32, nonmax_suppression: bool, typ: crate::features2d::FastFeatureDetector_DetectorType) -> Result<()> {
input_array_arg!(image);
unsafe { sys::cv_FAST_const__InputArrayR_vector_KeyPoint_R_int_bool_DetectorType(image.as_raw__InputArray(), keypoints.as_raw_mut_VectorOfKeyPoint(), threshold, nonmax_suppression, typ) }.into_result()
}
pub fn compute_recall_precision_curve(matches1to2: &core::Vector::<core::Vector::<core::DMatch>>, correct_matches1to2_mask: &core::Vector::<core::Vector::<u8>>, recall_precision_curve: &mut core::Vector::<core::Point2f>) -> Result<()> {
unsafe { sys::cv_computeRecallPrecisionCurve_const_vector_vector_DMatch__R_const_vector_vector_unsigned_char__R_vector_Point2f_R(matches1to2.as_raw_VectorOfVectorOfDMatch(), correct_matches1to2_mask.as_raw_VectorOfVectorOfu8(), recall_precision_curve.as_raw_mut_VectorOfPoint2f()) }.into_result()
}
pub fn draw_keypoints(image: &dyn core::ToInputArray, keypoints: &core::Vector::<core::KeyPoint>, out_image: &mut dyn core::ToInputOutputArray, color: core::Scalar, flags: crate::features2d::DrawMatchesFlags) -> Result<()> {
input_array_arg!(image);
input_output_array_arg!(out_image);
unsafe { sys::cv_drawKeypoints_const__InputArrayR_const_vector_KeyPoint_R_const__InputOutputArrayR_const_ScalarR_DrawMatchesFlags(image.as_raw__InputArray(), keypoints.as_raw_VectorOfKeyPoint(), out_image.as_raw__InputOutputArray(), &color, flags) }.into_result()
}
pub fn draw_matches(img1: &dyn core::ToInputArray, keypoints1: &core::Vector::<core::KeyPoint>, img2: &dyn core::ToInputArray, keypoints2: &core::Vector::<core::KeyPoint>, matches1to2: &core::Vector::<core::DMatch>, out_img: &mut dyn core::ToInputOutputArray, match_color: core::Scalar, single_point_color: core::Scalar, matches_mask: &core::Vector::<i8>, flags: crate::features2d::DrawMatchesFlags) -> Result<()> {
input_array_arg!(img1);
input_array_arg!(img2);
input_output_array_arg!(out_img);
unsafe { sys::cv_drawMatches_const__InputArrayR_const_vector_KeyPoint_R_const__InputArrayR_const_vector_KeyPoint_R_const_vector_DMatch_R_const__InputOutputArrayR_const_ScalarR_const_ScalarR_const_vector_char_R_DrawMatchesFlags(img1.as_raw__InputArray(), keypoints1.as_raw_VectorOfKeyPoint(), img2.as_raw__InputArray(), keypoints2.as_raw_VectorOfKeyPoint(), matches1to2.as_raw_VectorOfDMatch(), out_img.as_raw__InputOutputArray(), &match_color, &single_point_color, matches_mask.as_raw_VectorOfi8(), flags) }.into_result()
}
pub fn draw_matches_knn(img1: &dyn core::ToInputArray, keypoints1: &core::Vector::<core::KeyPoint>, img2: &dyn core::ToInputArray, keypoints2: &core::Vector::<core::KeyPoint>, matches1to2: &core::Vector::<core::Vector::<core::DMatch>>, out_img: &mut dyn core::ToInputOutputArray, match_color: core::Scalar, single_point_color: core::Scalar, matches_mask: &core::Vector::<core::Vector::<i8>>, flags: crate::features2d::DrawMatchesFlags) -> Result<()> {
input_array_arg!(img1);
input_array_arg!(img2);
input_output_array_arg!(out_img);
unsafe { sys::cv_drawMatches_const__InputArrayR_const_vector_KeyPoint_R_const__InputArrayR_const_vector_KeyPoint_R_const_vector_vector_DMatch__R_const__InputOutputArrayR_const_ScalarR_const_ScalarR_const_vector_vector_char__R_DrawMatchesFlags(img1.as_raw__InputArray(), keypoints1.as_raw_VectorOfKeyPoint(), img2.as_raw__InputArray(), keypoints2.as_raw_VectorOfKeyPoint(), matches1to2.as_raw_VectorOfVectorOfDMatch(), out_img.as_raw__InputOutputArray(), &match_color, &single_point_color, matches_mask.as_raw_VectorOfVectorOfi8(), flags) }.into_result()
}
pub fn evaluate_feature_detector(img1: &core::Mat, img2: &core::Mat, h1to2: &core::Mat, keypoints1: &mut core::Vector::<core::KeyPoint>, keypoints2: &mut core::Vector::<core::KeyPoint>, repeatability: &mut f32, corresp_count: &mut i32, fdetector: &core::Ptr::<crate::features2d::Feature2D>) -> Result<()> {
unsafe { sys::cv_evaluateFeatureDetector_const_MatR_const_MatR_const_MatR_vector_KeyPoint_X_vector_KeyPoint_X_floatR_intR_const_Ptr_Feature2D_R(img1.as_raw_Mat(), img2.as_raw_Mat(), h1to2.as_raw_Mat(), keypoints1.as_raw_mut_VectorOfKeyPoint(), keypoints2.as_raw_mut_VectorOfKeyPoint(), repeatability, corresp_count, fdetector.as_raw_PtrOfFeature2D()) }.into_result()
}
pub fn get_nearest_point(recall_precision_curve: &core::Vector::<core::Point2f>, l_precision: f32) -> Result<i32> {
unsafe { sys::cv_getNearestPoint_const_vector_Point2f_R_float(recall_precision_curve.as_raw_VectorOfPoint2f(), l_precision) }.into_result()
}
pub fn get_recall(recall_precision_curve: &core::Vector::<core::Point2f>, l_precision: f32) -> Result<f32> {
unsafe { sys::cv_getRecall_const_vector_Point2f_R_float(recall_precision_curve.as_raw_VectorOfPoint2f(), l_precision) }.into_result()
}
pub trait AKAZE: crate::features2d::Feature2DTrait {
fn as_raw_AKAZE(&self) -> *const c_void;
fn as_raw_mut_AKAZE(&mut self) -> *mut c_void;
fn set_descriptor_type(&mut self, dtype: crate::features2d::AKAZE_DescriptorType) -> Result<()> {
unsafe { sys::cv_AKAZE_setDescriptorType_DescriptorType(self.as_raw_mut_AKAZE(), dtype) }.into_result()
}
fn get_descriptor_type(&self) -> Result<crate::features2d::AKAZE_DescriptorType> {
unsafe { sys::cv_AKAZE_getDescriptorType_const(self.as_raw_AKAZE()) }.into_result()
}
fn set_descriptor_size(&mut self, dsize: i32) -> Result<()> {
unsafe { sys::cv_AKAZE_setDescriptorSize_int(self.as_raw_mut_AKAZE(), dsize) }.into_result()
}
fn get_descriptor_size(&self) -> Result<i32> {
unsafe { sys::cv_AKAZE_getDescriptorSize_const(self.as_raw_AKAZE()) }.into_result()
}
fn set_descriptor_channels(&mut self, dch: i32) -> Result<()> {
unsafe { sys::cv_AKAZE_setDescriptorChannels_int(self.as_raw_mut_AKAZE(), dch) }.into_result()
}
fn get_descriptor_channels(&self) -> Result<i32> {
unsafe { sys::cv_AKAZE_getDescriptorChannels_const(self.as_raw_AKAZE()) }.into_result()
}
fn set_threshold(&mut self, threshold: f64) -> Result<()> {
unsafe { sys::cv_AKAZE_setThreshold_double(self.as_raw_mut_AKAZE(), threshold) }.into_result()
}
fn get_threshold(&self) -> Result<f64> {
unsafe { sys::cv_AKAZE_getThreshold_const(self.as_raw_AKAZE()) }.into_result()
}
fn set_n_octaves(&mut self, octaves: i32) -> Result<()> {
unsafe { sys::cv_AKAZE_setNOctaves_int(self.as_raw_mut_AKAZE(), octaves) }.into_result()
}
fn get_n_octaves(&self) -> Result<i32> {
unsafe { sys::cv_AKAZE_getNOctaves_const(self.as_raw_AKAZE()) }.into_result()
}
fn set_n_octave_layers(&mut self, octave_layers: i32) -> Result<()> {
unsafe { sys::cv_AKAZE_setNOctaveLayers_int(self.as_raw_mut_AKAZE(), octave_layers) }.into_result()
}
fn get_n_octave_layers(&self) -> Result<i32> {
unsafe { sys::cv_AKAZE_getNOctaveLayers_const(self.as_raw_AKAZE()) }.into_result()
}
fn set_diffusivity(&mut self, diff: crate::features2d::KAZE_DiffusivityType) -> Result<()> {
unsafe { sys::cv_AKAZE_setDiffusivity_DiffusivityType(self.as_raw_mut_AKAZE(), diff) }.into_result()
}
fn get_diffusivity(&self) -> Result<crate::features2d::KAZE_DiffusivityType> {
unsafe { sys::cv_AKAZE_getDiffusivity_const(self.as_raw_AKAZE()) }.into_result()
}
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_AKAZE_getDefaultName_const(self.as_raw_AKAZE()) }.into_result().map(|r| unsafe { String::opencv_from_extern(r) } )
}
}
impl dyn AKAZE + '_ {
pub fn create(descriptor_type: crate::features2d::AKAZE_DescriptorType, descriptor_size: i32, descriptor_channels: i32, threshold: f32, n_octaves: i32, n_octave_layers: i32, diffusivity: crate::features2d::KAZE_DiffusivityType) -> Result<core::Ptr::<dyn crate::features2d::AKAZE>> {
unsafe { sys::cv_AKAZE_create_DescriptorType_int_int_float_int_int_DiffusivityType(descriptor_type, descriptor_size, descriptor_channels, threshold, n_octaves, n_octave_layers, diffusivity) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::features2d::AKAZE>::opencv_from_extern(r) } )
}
}
pub trait AffineFeature: crate::features2d::Feature2DTrait {
fn as_raw_AffineFeature(&self) -> *const c_void;
fn as_raw_mut_AffineFeature(&mut self) -> *mut c_void;
fn set_view_params(&mut self, tilts: &core::Vector::<f32>, rolls: &core::Vector::<f32>) -> Result<()> {
unsafe { sys::cv_AffineFeature_setViewParams_const_vector_float_R_const_vector_float_R(self.as_raw_mut_AffineFeature(), tilts.as_raw_VectorOff32(), rolls.as_raw_VectorOff32()) }.into_result()
}
fn get_view_params(&self, tilts: &mut core::Vector::<f32>, rolls: &mut core::Vector::<f32>) -> Result<()> {
unsafe { sys::cv_AffineFeature_getViewParams_const_vector_float_R_vector_float_R(self.as_raw_AffineFeature(), tilts.as_raw_mut_VectorOff32(), rolls.as_raw_mut_VectorOff32()) }.into_result()
}
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_AffineFeature_getDefaultName_const(self.as_raw_AffineFeature()) }.into_result().map(|r| unsafe { String::opencv_from_extern(r) } )
}
}
impl dyn AffineFeature + '_ {
pub fn create(backend: &core::Ptr::<crate::features2d::Feature2D>, max_tilt: i32, min_tilt: i32, tilt_step: f32, rotate_step_base: f32) -> Result<core::Ptr::<dyn crate::features2d::AffineFeature>> {
unsafe { sys::cv_AffineFeature_create_const_Ptr_Feature2D_R_int_int_float_float(backend.as_raw_PtrOfFeature2D(), max_tilt, min_tilt, tilt_step, rotate_step_base) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::features2d::AffineFeature>::opencv_from_extern(r) } )
}
}
pub trait AgastFeatureDetector: crate::features2d::Feature2DTrait {
fn as_raw_AgastFeatureDetector(&self) -> *const c_void;
fn as_raw_mut_AgastFeatureDetector(&mut self) -> *mut c_void;
fn set_threshold(&mut self, threshold: i32) -> Result<()> {
unsafe { sys::cv_AgastFeatureDetector_setThreshold_int(self.as_raw_mut_AgastFeatureDetector(), threshold) }.into_result()
}
fn get_threshold(&self) -> Result<i32> {
unsafe { sys::cv_AgastFeatureDetector_getThreshold_const(self.as_raw_AgastFeatureDetector()) }.into_result()
}
fn set_nonmax_suppression(&mut self, f: bool) -> Result<()> {
unsafe { sys::cv_AgastFeatureDetector_setNonmaxSuppression_bool(self.as_raw_mut_AgastFeatureDetector(), f) }.into_result()
}
fn get_nonmax_suppression(&self) -> Result<bool> {
unsafe { sys::cv_AgastFeatureDetector_getNonmaxSuppression_const(self.as_raw_AgastFeatureDetector()) }.into_result()
}
fn set_type(&mut self, typ: crate::features2d::AgastFeatureDetector_DetectorType) -> Result<()> {
unsafe { sys::cv_AgastFeatureDetector_setType_DetectorType(self.as_raw_mut_AgastFeatureDetector(), typ) }.into_result()
}
fn get_type(&self) -> Result<crate::features2d::AgastFeatureDetector_DetectorType> {
unsafe { sys::cv_AgastFeatureDetector_getType_const(self.as_raw_AgastFeatureDetector()) }.into_result()
}
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_AgastFeatureDetector_getDefaultName_const(self.as_raw_AgastFeatureDetector()) }.into_result().map(|r| unsafe { String::opencv_from_extern(r) } )
}
}
impl dyn AgastFeatureDetector + '_ {
pub fn create(threshold: i32, nonmax_suppression: bool, typ: crate::features2d::AgastFeatureDetector_DetectorType) -> Result<core::Ptr::<dyn crate::features2d::AgastFeatureDetector>> {
unsafe { sys::cv_AgastFeatureDetector_create_int_bool_DetectorType(threshold, nonmax_suppression, typ) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::features2d::AgastFeatureDetector>::opencv_from_extern(r) } )
}
}
pub trait BFMatcherTrait: crate::features2d::DescriptorMatcher {
fn as_raw_BFMatcher(&self) -> *const c_void;
fn as_raw_mut_BFMatcher(&mut self) -> *mut c_void;
fn is_mask_supported(&self) -> Result<bool> {
unsafe { sys::cv_BFMatcher_isMaskSupported_const(self.as_raw_BFMatcher()) }.into_result()
}
fn clone(&self, empty_train_data: bool) -> Result<core::Ptr::<dyn crate::features2d::DescriptorMatcher>> {
unsafe { sys::cv_BFMatcher_clone_const_bool(self.as_raw_BFMatcher(), empty_train_data) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::features2d::DescriptorMatcher>::opencv_from_extern(r) } )
}
}
pub struct BFMatcher {
ptr: *mut c_void
}
opencv_type_boxed! { BFMatcher }
impl Drop for BFMatcher {
fn drop(&mut self) {
extern "C" { fn cv_BFMatcher_delete(instance: *mut c_void); }
unsafe { cv_BFMatcher_delete(self.as_raw_mut_BFMatcher()) };
}
}
impl BFMatcher {
#[inline] pub fn as_raw_BFMatcher(&self) -> *const c_void { self.as_raw() }
#[inline] pub fn as_raw_mut_BFMatcher(&mut self) -> *mut c_void { self.as_raw_mut() }
}
unsafe impl Send for BFMatcher {}
impl core::AlgorithmTrait for BFMatcher {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::features2d::BFMatcherTrait for BFMatcher {
#[inline] fn as_raw_BFMatcher(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_BFMatcher(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::features2d::DescriptorMatcher for BFMatcher {
#[inline] fn as_raw_DescriptorMatcher(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_DescriptorMatcher(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl BFMatcher {
pub fn new(norm_type: i32, cross_check: bool) -> Result<crate::features2d::BFMatcher> {
unsafe { sys::cv_BFMatcher_BFMatcher_int_bool(norm_type, cross_check) }.into_result().map(|r| unsafe { crate::features2d::BFMatcher::opencv_from_extern(r) } )
}
pub fn create(norm_type: i32, cross_check: bool) -> Result<core::Ptr::<crate::features2d::BFMatcher>> {
unsafe { sys::cv_BFMatcher_create_int_bool(norm_type, cross_check) }.into_result().map(|r| unsafe { core::Ptr::<crate::features2d::BFMatcher>::opencv_from_extern(r) } )
}
}
pub trait BOWImgDescriptorExtractorTrait {
fn as_raw_BOWImgDescriptorExtractor(&self) -> *const c_void;
fn as_raw_mut_BOWImgDescriptorExtractor(&mut self) -> *mut c_void;
fn set_vocabulary(&mut self, vocabulary: &core::Mat) -> Result<()> {
unsafe { sys::cv_BOWImgDescriptorExtractor_setVocabulary_const_MatR(self.as_raw_mut_BOWImgDescriptorExtractor(), vocabulary.as_raw_Mat()) }.into_result()
}
fn get_vocabulary(&self) -> Result<core::Mat> {
unsafe { sys::cv_BOWImgDescriptorExtractor_getVocabulary_const(self.as_raw_BOWImgDescriptorExtractor()) }.into_result().map(|r| unsafe { core::Mat::opencv_from_extern(r) } )
}
fn compute_desc(&mut self, image: &dyn core::ToInputArray, keypoints: &mut core::Vector::<core::KeyPoint>, img_descriptor: &mut dyn core::ToOutputArray, point_idxs_of_clusters: &mut core::Vector::<core::Vector::<i32>>, descriptors: &mut core::Mat) -> Result<()> {
input_array_arg!(image);
output_array_arg!(img_descriptor);
unsafe { sys::cv_BOWImgDescriptorExtractor_compute_const__InputArrayR_vector_KeyPoint_R_const__OutputArrayR_vector_vector_int__X_MatX(self.as_raw_mut_BOWImgDescriptorExtractor(), image.as_raw__InputArray(), keypoints.as_raw_mut_VectorOfKeyPoint(), img_descriptor.as_raw__OutputArray(), point_idxs_of_clusters.as_raw_mut_VectorOfVectorOfi32(), descriptors.as_raw_mut_Mat()) }.into_result()
}
fn compute(&mut self, keypoint_descriptors: &dyn core::ToInputArray, img_descriptor: &mut dyn core::ToOutputArray, point_idxs_of_clusters: &mut core::Vector::<core::Vector::<i32>>) -> Result<()> {
input_array_arg!(keypoint_descriptors);
output_array_arg!(img_descriptor);
unsafe { sys::cv_BOWImgDescriptorExtractor_compute_const__InputArrayR_const__OutputArrayR_vector_vector_int__X(self.as_raw_mut_BOWImgDescriptorExtractor(), keypoint_descriptors.as_raw__InputArray(), img_descriptor.as_raw__OutputArray(), point_idxs_of_clusters.as_raw_mut_VectorOfVectorOfi32()) }.into_result()
}
fn compute2(&mut self, image: &core::Mat, keypoints: &mut core::Vector::<core::KeyPoint>, img_descriptor: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_BOWImgDescriptorExtractor_compute2_const_MatR_vector_KeyPoint_R_MatR(self.as_raw_mut_BOWImgDescriptorExtractor(), image.as_raw_Mat(), keypoints.as_raw_mut_VectorOfKeyPoint(), img_descriptor.as_raw_mut_Mat()) }.into_result()
}
fn descriptor_size(&self) -> Result<i32> {
unsafe { sys::cv_BOWImgDescriptorExtractor_descriptorSize_const(self.as_raw_BOWImgDescriptorExtractor()) }.into_result()
}
fn descriptor_type(&self) -> Result<i32> {
unsafe { sys::cv_BOWImgDescriptorExtractor_descriptorType_const(self.as_raw_BOWImgDescriptorExtractor()) }.into_result()
}
}
pub struct BOWImgDescriptorExtractor {
ptr: *mut c_void
}
opencv_type_boxed! { BOWImgDescriptorExtractor }
impl Drop for BOWImgDescriptorExtractor {
fn drop(&mut self) {
extern "C" { fn cv_BOWImgDescriptorExtractor_delete(instance: *mut c_void); }
unsafe { cv_BOWImgDescriptorExtractor_delete(self.as_raw_mut_BOWImgDescriptorExtractor()) };
}
}
impl BOWImgDescriptorExtractor {
#[inline] pub fn as_raw_BOWImgDescriptorExtractor(&self) -> *const c_void { self.as_raw() }
#[inline] pub fn as_raw_mut_BOWImgDescriptorExtractor(&mut self) -> *mut c_void { self.as_raw_mut() }
}
unsafe impl Send for BOWImgDescriptorExtractor {}
impl crate::features2d::BOWImgDescriptorExtractorTrait for BOWImgDescriptorExtractor {
#[inline] fn as_raw_BOWImgDescriptorExtractor(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_BOWImgDescriptorExtractor(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl BOWImgDescriptorExtractor {
pub fn new(dextractor: &core::Ptr::<crate::features2d::Feature2D>, dmatcher: &core::Ptr::<dyn crate::features2d::DescriptorMatcher>) -> Result<crate::features2d::BOWImgDescriptorExtractor> {
unsafe { sys::cv_BOWImgDescriptorExtractor_BOWImgDescriptorExtractor_const_Ptr_Feature2D_R_const_Ptr_DescriptorMatcher_R(dextractor.as_raw_PtrOfFeature2D(), dmatcher.as_raw_PtrOfDescriptorMatcher()) }.into_result().map(|r| unsafe { crate::features2d::BOWImgDescriptorExtractor::opencv_from_extern(r) } )
}
pub fn new_1(dmatcher: &core::Ptr::<dyn crate::features2d::DescriptorMatcher>) -> Result<crate::features2d::BOWImgDescriptorExtractor> {
unsafe { sys::cv_BOWImgDescriptorExtractor_BOWImgDescriptorExtractor_const_Ptr_DescriptorMatcher_R(dmatcher.as_raw_PtrOfDescriptorMatcher()) }.into_result().map(|r| unsafe { crate::features2d::BOWImgDescriptorExtractor::opencv_from_extern(r) } )
}
}
pub trait BOWKMeansTrainerTrait: crate::features2d::BOWTrainer {
fn as_raw_BOWKMeansTrainer(&self) -> *const c_void;
fn as_raw_mut_BOWKMeansTrainer(&mut self) -> *mut c_void;
fn cluster(&self) -> Result<core::Mat> {
unsafe { sys::cv_BOWKMeansTrainer_cluster_const(self.as_raw_BOWKMeansTrainer()) }.into_result().map(|r| unsafe { core::Mat::opencv_from_extern(r) } )
}
fn cluster_1(&self, descriptors: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_BOWKMeansTrainer_cluster_const_const_MatR(self.as_raw_BOWKMeansTrainer(), descriptors.as_raw_Mat()) }.into_result().map(|r| unsafe { core::Mat::opencv_from_extern(r) } )
}
}
pub struct BOWKMeansTrainer {
ptr: *mut c_void
}
opencv_type_boxed! { BOWKMeansTrainer }
impl Drop for BOWKMeansTrainer {
fn drop(&mut self) {
extern "C" { fn cv_BOWKMeansTrainer_delete(instance: *mut c_void); }
unsafe { cv_BOWKMeansTrainer_delete(self.as_raw_mut_BOWKMeansTrainer()) };
}
}
impl BOWKMeansTrainer {
#[inline] pub fn as_raw_BOWKMeansTrainer(&self) -> *const c_void { self.as_raw() }
#[inline] pub fn as_raw_mut_BOWKMeansTrainer(&mut self) -> *mut c_void { self.as_raw_mut() }
}
unsafe impl Send for BOWKMeansTrainer {}
impl crate::features2d::BOWKMeansTrainerTrait for BOWKMeansTrainer {
#[inline] fn as_raw_BOWKMeansTrainer(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_BOWKMeansTrainer(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::features2d::BOWTrainer for BOWKMeansTrainer {
#[inline] fn as_raw_BOWTrainer(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_BOWTrainer(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl BOWKMeansTrainer {
pub fn new(cluster_count: i32, termcrit: core::TermCriteria, attempts: i32, flags: i32) -> Result<crate::features2d::BOWKMeansTrainer> {
unsafe { sys::cv_BOWKMeansTrainer_BOWKMeansTrainer_int_const_TermCriteriaR_int_int(cluster_count, &termcrit, attempts, flags) }.into_result().map(|r| unsafe { crate::features2d::BOWKMeansTrainer::opencv_from_extern(r) } )
}
}
pub trait BOWTrainer {
fn as_raw_BOWTrainer(&self) -> *const c_void;
fn as_raw_mut_BOWTrainer(&mut self) -> *mut c_void;
fn add(&mut self, descriptors: &core::Mat) -> Result<()> {
unsafe { sys::cv_BOWTrainer_add_const_MatR(self.as_raw_mut_BOWTrainer(), descriptors.as_raw_Mat()) }.into_result()
}
fn get_descriptors(&self) -> Result<core::Vector::<core::Mat>> {
unsafe { sys::cv_BOWTrainer_getDescriptors_const(self.as_raw_BOWTrainer()) }.into_result().map(|r| unsafe { core::Vector::<core::Mat>::opencv_from_extern(r) } )
}
fn descriptors_count(&self) -> Result<i32> {
unsafe { sys::cv_BOWTrainer_descriptorsCount_const(self.as_raw_BOWTrainer()) }.into_result()
}
fn clear(&mut self) -> Result<()> {
unsafe { sys::cv_BOWTrainer_clear(self.as_raw_mut_BOWTrainer()) }.into_result()
}
fn cluster(&self) -> Result<core::Mat> {
unsafe { sys::cv_BOWTrainer_cluster_const(self.as_raw_BOWTrainer()) }.into_result().map(|r| unsafe { core::Mat::opencv_from_extern(r) } )
}
fn cluster_with_descriptors(&self, descriptors: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_BOWTrainer_cluster_const_const_MatR(self.as_raw_BOWTrainer(), descriptors.as_raw_Mat()) }.into_result().map(|r| unsafe { core::Mat::opencv_from_extern(r) } )
}
}
pub trait BRISKTrait: crate::features2d::Feature2DTrait {
fn as_raw_BRISK(&self) -> *const c_void;
fn as_raw_mut_BRISK(&mut self) -> *mut c_void;
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_BRISK_getDefaultName_const(self.as_raw_BRISK()) }.into_result().map(|r| unsafe { String::opencv_from_extern(r) } )
}
fn set_threshold(&mut self, threshold: i32) -> Result<()> {
unsafe { sys::cv_BRISK_setThreshold_int(self.as_raw_mut_BRISK(), threshold) }.into_result()
}
fn get_threshold(&self) -> Result<i32> {
unsafe { sys::cv_BRISK_getThreshold_const(self.as_raw_BRISK()) }.into_result()
}
fn set_octaves(&mut self, octaves: i32) -> Result<()> {
unsafe { sys::cv_BRISK_setOctaves_int(self.as_raw_mut_BRISK(), octaves) }.into_result()
}
fn get_octaves(&self) -> Result<i32> {
unsafe { sys::cv_BRISK_getOctaves_const(self.as_raw_BRISK()) }.into_result()
}
}
pub struct BRISK {
ptr: *mut c_void
}
opencv_type_boxed! { BRISK }
impl Drop for BRISK {
fn drop(&mut self) {
extern "C" { fn cv_BRISK_delete(instance: *mut c_void); }
unsafe { cv_BRISK_delete(self.as_raw_mut_BRISK()) };
}
}
impl BRISK {
#[inline] pub fn as_raw_BRISK(&self) -> *const c_void { self.as_raw() }
#[inline] pub fn as_raw_mut_BRISK(&mut self) -> *mut c_void { self.as_raw_mut() }
}
unsafe impl Send for BRISK {}
impl core::AlgorithmTrait for BRISK {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::features2d::BRISKTrait for BRISK {
#[inline] fn as_raw_BRISK(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_BRISK(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::features2d::Feature2DTrait for BRISK {
#[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl BRISK {
pub fn create(thresh: i32, octaves: i32, pattern_scale: f32) -> Result<core::Ptr::<crate::features2d::BRISK>> {
unsafe { sys::cv_BRISK_create_int_int_float(thresh, octaves, pattern_scale) }.into_result().map(|r| unsafe { core::Ptr::<crate::features2d::BRISK>::opencv_from_extern(r) } )
}
pub fn create_with_pattern(radius_list: &core::Vector::<f32>, number_list: &core::Vector::<i32>, d_max: f32, d_min: f32, index_change: &core::Vector::<i32>) -> Result<core::Ptr::<crate::features2d::BRISK>> {
unsafe { sys::cv_BRISK_create_const_vector_float_R_const_vector_int_R_float_float_const_vector_int_R(radius_list.as_raw_VectorOff32(), number_list.as_raw_VectorOfi32(), d_max, d_min, index_change.as_raw_VectorOfi32()) }.into_result().map(|r| unsafe { core::Ptr::<crate::features2d::BRISK>::opencv_from_extern(r) } )
}
pub fn create_with_pattern_threshold_octaves(thresh: i32, octaves: i32, radius_list: &core::Vector::<f32>, number_list: &core::Vector::<i32>, d_max: f32, d_min: f32, index_change: &core::Vector::<i32>) -> Result<core::Ptr::<crate::features2d::BRISK>> {
unsafe { sys::cv_BRISK_create_int_int_const_vector_float_R_const_vector_int_R_float_float_const_vector_int_R(thresh, octaves, radius_list.as_raw_VectorOff32(), number_list.as_raw_VectorOfi32(), d_max, d_min, index_change.as_raw_VectorOfi32()) }.into_result().map(|r| unsafe { core::Ptr::<crate::features2d::BRISK>::opencv_from_extern(r) } )
}
}
pub trait DescriptorMatcher: core::AlgorithmTrait {
fn as_raw_DescriptorMatcher(&self) -> *const c_void;
fn as_raw_mut_DescriptorMatcher(&mut self) -> *mut c_void;
fn add(&mut self, descriptors: &dyn core::ToInputArray) -> Result<()> {
input_array_arg!(descriptors);
unsafe { sys::cv_DescriptorMatcher_add_const__InputArrayR(self.as_raw_mut_DescriptorMatcher(), descriptors.as_raw__InputArray()) }.into_result()
}
fn get_train_descriptors(&self) -> Result<core::Vector::<core::Mat>> {
unsafe { sys::cv_DescriptorMatcher_getTrainDescriptors_const(self.as_raw_DescriptorMatcher()) }.into_result().map(|r| unsafe { core::Vector::<core::Mat>::opencv_from_extern(r) } )
}
fn clear(&mut self) -> Result<()> {
unsafe { sys::cv_DescriptorMatcher_clear(self.as_raw_mut_DescriptorMatcher()) }.into_result()
}
fn empty(&self) -> Result<bool> {
unsafe { sys::cv_DescriptorMatcher_empty_const(self.as_raw_DescriptorMatcher()) }.into_result()
}
fn is_mask_supported(&self) -> Result<bool> {
unsafe { sys::cv_DescriptorMatcher_isMaskSupported_const(self.as_raw_DescriptorMatcher()) }.into_result()
}
fn train(&mut self) -> Result<()> {
unsafe { sys::cv_DescriptorMatcher_train(self.as_raw_mut_DescriptorMatcher()) }.into_result()
}
fn train_match(&self, query_descriptors: &dyn core::ToInputArray, train_descriptors: &dyn core::ToInputArray, matches: &mut core::Vector::<core::DMatch>, mask: &dyn core::ToInputArray) -> Result<()> {
input_array_arg!(query_descriptors);
input_array_arg!(train_descriptors);
input_array_arg!(mask);
unsafe { sys::cv_DescriptorMatcher_match_const_const__InputArrayR_const__InputArrayR_vector_DMatch_R_const__InputArrayR(self.as_raw_DescriptorMatcher(), query_descriptors.as_raw__InputArray(), train_descriptors.as_raw__InputArray(), matches.as_raw_mut_VectorOfDMatch(), mask.as_raw__InputArray()) }.into_result()
}
fn knn_train_match(&self, query_descriptors: &dyn core::ToInputArray, train_descriptors: &dyn core::ToInputArray, matches: &mut core::Vector::<core::Vector::<core::DMatch>>, k: i32, mask: &dyn core::ToInputArray, compact_result: bool) -> Result<()> {
input_array_arg!(query_descriptors);
input_array_arg!(train_descriptors);
input_array_arg!(mask);
unsafe { sys::cv_DescriptorMatcher_knnMatch_const_const__InputArrayR_const__InputArrayR_vector_vector_DMatch__R_int_const__InputArrayR_bool(self.as_raw_DescriptorMatcher(), query_descriptors.as_raw__InputArray(), train_descriptors.as_raw__InputArray(), matches.as_raw_mut_VectorOfVectorOfDMatch(), k, mask.as_raw__InputArray(), compact_result) }.into_result()
}
fn radius_train_match(&self, query_descriptors: &dyn core::ToInputArray, train_descriptors: &dyn core::ToInputArray, matches: &mut core::Vector::<core::Vector::<core::DMatch>>, max_distance: f32, mask: &dyn core::ToInputArray, compact_result: bool) -> Result<()> {
input_array_arg!(query_descriptors);
input_array_arg!(train_descriptors);
input_array_arg!(mask);
unsafe { sys::cv_DescriptorMatcher_radiusMatch_const_const__InputArrayR_const__InputArrayR_vector_vector_DMatch__R_float_const__InputArrayR_bool(self.as_raw_DescriptorMatcher(), query_descriptors.as_raw__InputArray(), train_descriptors.as_raw__InputArray(), matches.as_raw_mut_VectorOfVectorOfDMatch(), max_distance, mask.as_raw__InputArray(), compact_result) }.into_result()
}
fn match_(&mut self, query_descriptors: &dyn core::ToInputArray, matches: &mut core::Vector::<core::DMatch>, masks: &dyn core::ToInputArray) -> Result<()> {
input_array_arg!(query_descriptors);
input_array_arg!(masks);
unsafe { sys::cv_DescriptorMatcher_match_const__InputArrayR_vector_DMatch_R_const__InputArrayR(self.as_raw_mut_DescriptorMatcher(), query_descriptors.as_raw__InputArray(), matches.as_raw_mut_VectorOfDMatch(), masks.as_raw__InputArray()) }.into_result()
}
fn knn_match(&mut self, query_descriptors: &dyn core::ToInputArray, matches: &mut core::Vector::<core::Vector::<core::DMatch>>, k: i32, masks: &dyn core::ToInputArray, compact_result: bool) -> Result<()> {
input_array_arg!(query_descriptors);
input_array_arg!(masks);
unsafe { sys::cv_DescriptorMatcher_knnMatch_const__InputArrayR_vector_vector_DMatch__R_int_const__InputArrayR_bool(self.as_raw_mut_DescriptorMatcher(), query_descriptors.as_raw__InputArray(), matches.as_raw_mut_VectorOfVectorOfDMatch(), k, masks.as_raw__InputArray(), compact_result) }.into_result()
}
fn radius_match(&mut self, query_descriptors: &dyn core::ToInputArray, matches: &mut core::Vector::<core::Vector::<core::DMatch>>, max_distance: f32, masks: &dyn core::ToInputArray, compact_result: bool) -> Result<()> {
input_array_arg!(query_descriptors);
input_array_arg!(masks);
unsafe { sys::cv_DescriptorMatcher_radiusMatch_const__InputArrayR_vector_vector_DMatch__R_float_const__InputArrayR_bool(self.as_raw_mut_DescriptorMatcher(), query_descriptors.as_raw__InputArray(), matches.as_raw_mut_VectorOfVectorOfDMatch(), max_distance, masks.as_raw__InputArray(), compact_result) }.into_result()
}
fn write(&self, file_name: &str) -> Result<()> {
extern_container_arg!(file_name);
unsafe { sys::cv_DescriptorMatcher_write_const_const_StringR(self.as_raw_DescriptorMatcher(), file_name.opencv_as_extern()) }.into_result()
}
fn read(&mut self, file_name: &str) -> Result<()> {
extern_container_arg!(file_name);
unsafe { sys::cv_DescriptorMatcher_read_const_StringR(self.as_raw_mut_DescriptorMatcher(), file_name.opencv_as_extern()) }.into_result()
}
fn read_1(&mut self, unnamed: &core::FileNode) -> Result<()> {
unsafe { sys::cv_DescriptorMatcher_read_const_FileNodeR(self.as_raw_mut_DescriptorMatcher(), unnamed.as_raw_FileNode()) }.into_result()
}
fn write_1(&self, unnamed: &mut core::FileStorage) -> Result<()> {
unsafe { sys::cv_DescriptorMatcher_write_const_FileStorageR(self.as_raw_DescriptorMatcher(), unnamed.as_raw_mut_FileStorage()) }.into_result()
}
fn clone(&self, empty_train_data: bool) -> Result<core::Ptr::<dyn crate::features2d::DescriptorMatcher>> {
unsafe { sys::cv_DescriptorMatcher_clone_const_bool(self.as_raw_DescriptorMatcher(), empty_train_data) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::features2d::DescriptorMatcher>::opencv_from_extern(r) } )
}
fn write_2(&self, fs: &core::Ptr::<core::FileStorage>, name: &str) -> Result<()> {
extern_container_arg!(name);
unsafe { sys::cv_DescriptorMatcher_write_const_const_Ptr_FileStorage_R_const_StringR(self.as_raw_DescriptorMatcher(), fs.as_raw_PtrOfFileStorage(), name.opencv_as_extern()) }.into_result()
}
}
impl dyn DescriptorMatcher + '_ {
pub fn create(descriptor_matcher_type: &str) -> Result<core::Ptr::<dyn crate::features2d::DescriptorMatcher>> {
extern_container_arg!(descriptor_matcher_type);
unsafe { sys::cv_DescriptorMatcher_create_const_StringR(descriptor_matcher_type.opencv_as_extern()) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::features2d::DescriptorMatcher>::opencv_from_extern(r) } )
}
pub fn create_with_matcher_type(matcher_type: crate::features2d::DescriptorMatcher_MatcherType) -> Result<core::Ptr::<dyn crate::features2d::DescriptorMatcher>> {
unsafe { sys::cv_DescriptorMatcher_create_const_MatcherTypeR(&matcher_type) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::features2d::DescriptorMatcher>::opencv_from_extern(r) } )
}
}
pub trait FastFeatureDetector: crate::features2d::Feature2DTrait {
fn as_raw_FastFeatureDetector(&self) -> *const c_void;
fn as_raw_mut_FastFeatureDetector(&mut self) -> *mut c_void;
fn set_threshold(&mut self, threshold: i32) -> Result<()> {
unsafe { sys::cv_FastFeatureDetector_setThreshold_int(self.as_raw_mut_FastFeatureDetector(), threshold) }.into_result()
}
fn get_threshold(&self) -> Result<i32> {
unsafe { sys::cv_FastFeatureDetector_getThreshold_const(self.as_raw_FastFeatureDetector()) }.into_result()
}
fn set_nonmax_suppression(&mut self, f: bool) -> Result<()> {
unsafe { sys::cv_FastFeatureDetector_setNonmaxSuppression_bool(self.as_raw_mut_FastFeatureDetector(), f) }.into_result()
}
fn get_nonmax_suppression(&self) -> Result<bool> {
unsafe { sys::cv_FastFeatureDetector_getNonmaxSuppression_const(self.as_raw_FastFeatureDetector()) }.into_result()
}
fn set_type(&mut self, typ: crate::features2d::FastFeatureDetector_DetectorType) -> Result<()> {
unsafe { sys::cv_FastFeatureDetector_setType_DetectorType(self.as_raw_mut_FastFeatureDetector(), typ) }.into_result()
}
fn get_type(&self) -> Result<crate::features2d::FastFeatureDetector_DetectorType> {
unsafe { sys::cv_FastFeatureDetector_getType_const(self.as_raw_FastFeatureDetector()) }.into_result()
}
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_FastFeatureDetector_getDefaultName_const(self.as_raw_FastFeatureDetector()) }.into_result().map(|r| unsafe { String::opencv_from_extern(r) } )
}
}
impl dyn FastFeatureDetector + '_ {
pub fn create(threshold: i32, nonmax_suppression: bool, typ: crate::features2d::FastFeatureDetector_DetectorType) -> Result<core::Ptr::<dyn crate::features2d::FastFeatureDetector>> {
unsafe { sys::cv_FastFeatureDetector_create_int_bool_DetectorType(threshold, nonmax_suppression, typ) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::features2d::FastFeatureDetector>::opencv_from_extern(r) } )
}
}
pub trait Feature2DTrait: core::AlgorithmTrait {
fn as_raw_Feature2D(&self) -> *const c_void;
fn as_raw_mut_Feature2D(&mut self) -> *mut c_void;
fn detect(&mut self, image: &dyn core::ToInputArray, keypoints: &mut core::Vector::<core::KeyPoint>, mask: &dyn core::ToInputArray) -> Result<()> {
input_array_arg!(image);
input_array_arg!(mask);
unsafe { sys::cv_Feature2D_detect_const__InputArrayR_vector_KeyPoint_R_const__InputArrayR(self.as_raw_mut_Feature2D(), image.as_raw__InputArray(), keypoints.as_raw_mut_VectorOfKeyPoint(), mask.as_raw__InputArray()) }.into_result()
}
fn detect_multiple(&mut self, images: &dyn core::ToInputArray, keypoints: &mut core::Vector::<core::Vector::<core::KeyPoint>>, masks: &dyn core::ToInputArray) -> Result<()> {
input_array_arg!(images);
input_array_arg!(masks);
unsafe { sys::cv_Feature2D_detect_const__InputArrayR_vector_vector_KeyPoint__R_const__InputArrayR(self.as_raw_mut_Feature2D(), images.as_raw__InputArray(), keypoints.as_raw_mut_VectorOfVectorOfKeyPoint(), masks.as_raw__InputArray()) }.into_result()
}
fn compute(&mut self, image: &dyn core::ToInputArray, keypoints: &mut core::Vector::<core::KeyPoint>, descriptors: &mut dyn core::ToOutputArray) -> Result<()> {
input_array_arg!(image);
output_array_arg!(descriptors);
unsafe { sys::cv_Feature2D_compute_const__InputArrayR_vector_KeyPoint_R_const__OutputArrayR(self.as_raw_mut_Feature2D(), image.as_raw__InputArray(), keypoints.as_raw_mut_VectorOfKeyPoint(), descriptors.as_raw__OutputArray()) }.into_result()
}
fn compute_multiple(&mut self, images: &dyn core::ToInputArray, keypoints: &mut core::Vector::<core::Vector::<core::KeyPoint>>, descriptors: &mut dyn core::ToOutputArray) -> Result<()> {
input_array_arg!(images);
output_array_arg!(descriptors);
unsafe { sys::cv_Feature2D_compute_const__InputArrayR_vector_vector_KeyPoint__R_const__OutputArrayR(self.as_raw_mut_Feature2D(), images.as_raw__InputArray(), keypoints.as_raw_mut_VectorOfVectorOfKeyPoint(), descriptors.as_raw__OutputArray()) }.into_result()
}
fn detect_and_compute(&mut self, image: &dyn core::ToInputArray, mask: &dyn core::ToInputArray, keypoints: &mut core::Vector::<core::KeyPoint>, descriptors: &mut dyn core::ToOutputArray, use_provided_keypoints: bool) -> Result<()> {
input_array_arg!(image);
input_array_arg!(mask);
output_array_arg!(descriptors);
unsafe { sys::cv_Feature2D_detectAndCompute_const__InputArrayR_const__InputArrayR_vector_KeyPoint_R_const__OutputArrayR_bool(self.as_raw_mut_Feature2D(), image.as_raw__InputArray(), mask.as_raw__InputArray(), keypoints.as_raw_mut_VectorOfKeyPoint(), descriptors.as_raw__OutputArray(), use_provided_keypoints) }.into_result()
}
fn descriptor_size(&self) -> Result<i32> {
unsafe { sys::cv_Feature2D_descriptorSize_const(self.as_raw_Feature2D()) }.into_result()
}
fn descriptor_type(&self) -> Result<i32> {
unsafe { sys::cv_Feature2D_descriptorType_const(self.as_raw_Feature2D()) }.into_result()
}
fn default_norm(&self) -> Result<i32> {
unsafe { sys::cv_Feature2D_defaultNorm_const(self.as_raw_Feature2D()) }.into_result()
}
fn write(&self, file_name: &str) -> Result<()> {
extern_container_arg!(file_name);
unsafe { sys::cv_Feature2D_write_const_const_StringR(self.as_raw_Feature2D(), file_name.opencv_as_extern()) }.into_result()
}
fn read(&mut self, file_name: &str) -> Result<()> {
extern_container_arg!(file_name);
unsafe { sys::cv_Feature2D_read_const_StringR(self.as_raw_mut_Feature2D(), file_name.opencv_as_extern()) }.into_result()
}
fn write_1(&self, unnamed: &mut core::FileStorage) -> Result<()> {
unsafe { sys::cv_Feature2D_write_const_FileStorageR(self.as_raw_Feature2D(), unnamed.as_raw_mut_FileStorage()) }.into_result()
}
fn read_1(&mut self, unnamed: &core::FileNode) -> Result<()> {
unsafe { sys::cv_Feature2D_read_const_FileNodeR(self.as_raw_mut_Feature2D(), unnamed.as_raw_FileNode()) }.into_result()
}
fn empty(&self) -> Result<bool> {
unsafe { sys::cv_Feature2D_empty_const(self.as_raw_Feature2D()) }.into_result()
}
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_Feature2D_getDefaultName_const(self.as_raw_Feature2D()) }.into_result().map(|r| unsafe { String::opencv_from_extern(r) } )
}
fn write_2(&self, fs: &core::Ptr::<core::FileStorage>, name: &str) -> Result<()> {
extern_container_arg!(name);
unsafe { sys::cv_Feature2D_write_const_const_Ptr_FileStorage_R_const_StringR(self.as_raw_Feature2D(), fs.as_raw_PtrOfFileStorage(), name.opencv_as_extern()) }.into_result()
}
}
pub struct Feature2D {
ptr: *mut c_void
}
opencv_type_boxed! { Feature2D }
impl Drop for Feature2D {
fn drop(&mut self) {
extern "C" { fn cv_Feature2D_delete(instance: *mut c_void); }
unsafe { cv_Feature2D_delete(self.as_raw_mut_Feature2D()) };
}
}
impl Feature2D {
#[inline] pub fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() }
#[inline] pub fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() }
}
unsafe impl Send for Feature2D {}
impl core::AlgorithmTrait for Feature2D {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::features2d::Feature2DTrait for Feature2D {
#[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl Feature2D {
}
pub trait FlannBasedMatcherTrait: crate::features2d::DescriptorMatcher {
fn as_raw_FlannBasedMatcher(&self) -> *const c_void;
fn as_raw_mut_FlannBasedMatcher(&mut self) -> *mut c_void;
fn add(&mut self, descriptors: &dyn core::ToInputArray) -> Result<()> {
input_array_arg!(descriptors);
unsafe { sys::cv_FlannBasedMatcher_add_const__InputArrayR(self.as_raw_mut_FlannBasedMatcher(), descriptors.as_raw__InputArray()) }.into_result()
}
fn clear(&mut self) -> Result<()> {
unsafe { sys::cv_FlannBasedMatcher_clear(self.as_raw_mut_FlannBasedMatcher()) }.into_result()
}
fn read(&mut self, unnamed: &core::FileNode) -> Result<()> {
unsafe { sys::cv_FlannBasedMatcher_read_const_FileNodeR(self.as_raw_mut_FlannBasedMatcher(), unnamed.as_raw_FileNode()) }.into_result()
}
fn write(&self, unnamed: &mut core::FileStorage) -> Result<()> {
unsafe { sys::cv_FlannBasedMatcher_write_const_FileStorageR(self.as_raw_FlannBasedMatcher(), unnamed.as_raw_mut_FileStorage()) }.into_result()
}
fn train(&mut self) -> Result<()> {
unsafe { sys::cv_FlannBasedMatcher_train(self.as_raw_mut_FlannBasedMatcher()) }.into_result()
}
fn is_mask_supported(&self) -> Result<bool> {
unsafe { sys::cv_FlannBasedMatcher_isMaskSupported_const(self.as_raw_FlannBasedMatcher()) }.into_result()
}
fn clone(&self, empty_train_data: bool) -> Result<core::Ptr::<dyn crate::features2d::DescriptorMatcher>> {
unsafe { sys::cv_FlannBasedMatcher_clone_const_bool(self.as_raw_FlannBasedMatcher(), empty_train_data) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::features2d::DescriptorMatcher>::opencv_from_extern(r) } )
}
}
pub struct FlannBasedMatcher {
ptr: *mut c_void
}
opencv_type_boxed! { FlannBasedMatcher }
impl Drop for FlannBasedMatcher {
fn drop(&mut self) {
extern "C" { fn cv_FlannBasedMatcher_delete(instance: *mut c_void); }
unsafe { cv_FlannBasedMatcher_delete(self.as_raw_mut_FlannBasedMatcher()) };
}
}
impl FlannBasedMatcher {
#[inline] pub fn as_raw_FlannBasedMatcher(&self) -> *const c_void { self.as_raw() }
#[inline] pub fn as_raw_mut_FlannBasedMatcher(&mut self) -> *mut c_void { self.as_raw_mut() }
}
unsafe impl Send for FlannBasedMatcher {}
impl core::AlgorithmTrait for FlannBasedMatcher {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::features2d::DescriptorMatcher for FlannBasedMatcher {
#[inline] fn as_raw_DescriptorMatcher(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_DescriptorMatcher(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::features2d::FlannBasedMatcherTrait for FlannBasedMatcher {
#[inline] fn as_raw_FlannBasedMatcher(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_FlannBasedMatcher(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl FlannBasedMatcher {
pub fn new(index_params: &core::Ptr::<crate::flann::IndexParams>, search_params: &core::Ptr::<crate::flann::SearchParams>) -> Result<crate::features2d::FlannBasedMatcher> {
unsafe { sys::cv_FlannBasedMatcher_FlannBasedMatcher_const_Ptr_IndexParams_R_const_Ptr_SearchParams_R(index_params.as_raw_PtrOfIndexParams(), search_params.as_raw_PtrOfSearchParams()) }.into_result().map(|r| unsafe { crate::features2d::FlannBasedMatcher::opencv_from_extern(r) } )
}
pub fn create() -> Result<core::Ptr::<crate::features2d::FlannBasedMatcher>> {
unsafe { sys::cv_FlannBasedMatcher_create() }.into_result().map(|r| unsafe { core::Ptr::<crate::features2d::FlannBasedMatcher>::opencv_from_extern(r) } )
}
}
pub trait GFTTDetector: crate::features2d::Feature2DTrait {
fn as_raw_GFTTDetector(&self) -> *const c_void;
fn as_raw_mut_GFTTDetector(&mut self) -> *mut c_void;
fn set_max_features(&mut self, max_features: i32) -> Result<()> {
unsafe { sys::cv_GFTTDetector_setMaxFeatures_int(self.as_raw_mut_GFTTDetector(), max_features) }.into_result()
}
fn get_max_features(&self) -> Result<i32> {
unsafe { sys::cv_GFTTDetector_getMaxFeatures_const(self.as_raw_GFTTDetector()) }.into_result()
}
fn set_quality_level(&mut self, qlevel: f64) -> Result<()> {
unsafe { sys::cv_GFTTDetector_setQualityLevel_double(self.as_raw_mut_GFTTDetector(), qlevel) }.into_result()
}
fn get_quality_level(&self) -> Result<f64> {
unsafe { sys::cv_GFTTDetector_getQualityLevel_const(self.as_raw_GFTTDetector()) }.into_result()
}
fn set_min_distance(&mut self, min_distance: f64) -> Result<()> {
unsafe { sys::cv_GFTTDetector_setMinDistance_double(self.as_raw_mut_GFTTDetector(), min_distance) }.into_result()
}
fn get_min_distance(&self) -> Result<f64> {
unsafe { sys::cv_GFTTDetector_getMinDistance_const(self.as_raw_GFTTDetector()) }.into_result()
}
fn set_block_size(&mut self, block_size: i32) -> Result<()> {
unsafe { sys::cv_GFTTDetector_setBlockSize_int(self.as_raw_mut_GFTTDetector(), block_size) }.into_result()
}
fn get_block_size(&self) -> Result<i32> {
unsafe { sys::cv_GFTTDetector_getBlockSize_const(self.as_raw_GFTTDetector()) }.into_result()
}
fn set_harris_detector(&mut self, val: bool) -> Result<()> {
unsafe { sys::cv_GFTTDetector_setHarrisDetector_bool(self.as_raw_mut_GFTTDetector(), val) }.into_result()
}
fn get_harris_detector(&self) -> Result<bool> {
unsafe { sys::cv_GFTTDetector_getHarrisDetector_const(self.as_raw_GFTTDetector()) }.into_result()
}
fn set_k(&mut self, k: f64) -> Result<()> {
unsafe { sys::cv_GFTTDetector_setK_double(self.as_raw_mut_GFTTDetector(), k) }.into_result()
}
fn get_k(&self) -> Result<f64> {
unsafe { sys::cv_GFTTDetector_getK_const(self.as_raw_GFTTDetector()) }.into_result()
}
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_GFTTDetector_getDefaultName_const(self.as_raw_GFTTDetector()) }.into_result().map(|r| unsafe { String::opencv_from_extern(r) } )
}
}
impl dyn GFTTDetector + '_ {
pub fn create(max_corners: i32, quality_level: f64, min_distance: f64, block_size: i32, use_harris_detector: bool, k: f64) -> Result<core::Ptr::<dyn crate::features2d::GFTTDetector>> {
unsafe { sys::cv_GFTTDetector_create_int_double_double_int_bool_double(max_corners, quality_level, min_distance, block_size, use_harris_detector, k) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::features2d::GFTTDetector>::opencv_from_extern(r) } )
}
pub fn create_with_gradient(max_corners: i32, quality_level: f64, min_distance: f64, block_size: i32, gradiant_size: i32, use_harris_detector: bool, k: f64) -> Result<core::Ptr::<dyn crate::features2d::GFTTDetector>> {
unsafe { sys::cv_GFTTDetector_create_int_double_double_int_int_bool_double(max_corners, quality_level, min_distance, block_size, gradiant_size, use_harris_detector, k) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::features2d::GFTTDetector>::opencv_from_extern(r) } )
}
}
pub trait KAZE: crate::features2d::Feature2DTrait {
fn as_raw_KAZE(&self) -> *const c_void;
fn as_raw_mut_KAZE(&mut self) -> *mut c_void;
fn set_extended(&mut self, extended: bool) -> Result<()> {
unsafe { sys::cv_KAZE_setExtended_bool(self.as_raw_mut_KAZE(), extended) }.into_result()
}
fn get_extended(&self) -> Result<bool> {
unsafe { sys::cv_KAZE_getExtended_const(self.as_raw_KAZE()) }.into_result()
}
fn set_upright(&mut self, upright: bool) -> Result<()> {
unsafe { sys::cv_KAZE_setUpright_bool(self.as_raw_mut_KAZE(), upright) }.into_result()
}
fn get_upright(&self) -> Result<bool> {
unsafe { sys::cv_KAZE_getUpright_const(self.as_raw_KAZE()) }.into_result()
}
fn set_threshold(&mut self, threshold: f64) -> Result<()> {
unsafe { sys::cv_KAZE_setThreshold_double(self.as_raw_mut_KAZE(), threshold) }.into_result()
}
fn get_threshold(&self) -> Result<f64> {
unsafe { sys::cv_KAZE_getThreshold_const(self.as_raw_KAZE()) }.into_result()
}
fn set_n_octaves(&mut self, octaves: i32) -> Result<()> {
unsafe { sys::cv_KAZE_setNOctaves_int(self.as_raw_mut_KAZE(), octaves) }.into_result()
}
fn get_n_octaves(&self) -> Result<i32> {
unsafe { sys::cv_KAZE_getNOctaves_const(self.as_raw_KAZE()) }.into_result()
}
fn set_n_octave_layers(&mut self, octave_layers: i32) -> Result<()> {
unsafe { sys::cv_KAZE_setNOctaveLayers_int(self.as_raw_mut_KAZE(), octave_layers) }.into_result()
}
fn get_n_octave_layers(&self) -> Result<i32> {
unsafe { sys::cv_KAZE_getNOctaveLayers_const(self.as_raw_KAZE()) }.into_result()
}
fn set_diffusivity(&mut self, diff: crate::features2d::KAZE_DiffusivityType) -> Result<()> {
unsafe { sys::cv_KAZE_setDiffusivity_DiffusivityType(self.as_raw_mut_KAZE(), diff) }.into_result()
}
fn get_diffusivity(&self) -> Result<crate::features2d::KAZE_DiffusivityType> {
unsafe { sys::cv_KAZE_getDiffusivity_const(self.as_raw_KAZE()) }.into_result()
}
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_KAZE_getDefaultName_const(self.as_raw_KAZE()) }.into_result().map(|r| unsafe { String::opencv_from_extern(r) } )
}
}
impl dyn KAZE + '_ {
pub fn create(extended: bool, upright: bool, threshold: f32, n_octaves: i32, n_octave_layers: i32, diffusivity: crate::features2d::KAZE_DiffusivityType) -> Result<core::Ptr::<dyn crate::features2d::KAZE>> {
unsafe { sys::cv_KAZE_create_bool_bool_float_int_int_DiffusivityType(extended, upright, threshold, n_octaves, n_octave_layers, diffusivity) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::features2d::KAZE>::opencv_from_extern(r) } )
}
}
pub trait KeyPointsFilterTrait {
fn as_raw_KeyPointsFilter(&self) -> *const c_void;
fn as_raw_mut_KeyPointsFilter(&mut self) -> *mut c_void;
}
pub struct KeyPointsFilter {
ptr: *mut c_void
}
opencv_type_boxed! { KeyPointsFilter }
impl Drop for KeyPointsFilter {
fn drop(&mut self) {
extern "C" { fn cv_KeyPointsFilter_delete(instance: *mut c_void); }
unsafe { cv_KeyPointsFilter_delete(self.as_raw_mut_KeyPointsFilter()) };
}
}
impl KeyPointsFilter {
#[inline] pub fn as_raw_KeyPointsFilter(&self) -> *const c_void { self.as_raw() }
#[inline] pub fn as_raw_mut_KeyPointsFilter(&mut self) -> *mut c_void { self.as_raw_mut() }
}
unsafe impl Send for KeyPointsFilter {}
impl crate::features2d::KeyPointsFilterTrait for KeyPointsFilter {
#[inline] fn as_raw_KeyPointsFilter(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_KeyPointsFilter(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl KeyPointsFilter {
pub fn default() -> Result<crate::features2d::KeyPointsFilter> {
unsafe { sys::cv_KeyPointsFilter_KeyPointsFilter() }.into_result().map(|r| unsafe { crate::features2d::KeyPointsFilter::opencv_from_extern(r) } )
}
pub fn run_by_image_border(keypoints: &mut core::Vector::<core::KeyPoint>, image_size: core::Size, border_size: i32) -> Result<()> {
unsafe { sys::cv_KeyPointsFilter_runByImageBorder_vector_KeyPoint_R_Size_int(keypoints.as_raw_mut_VectorOfKeyPoint(), image_size.opencv_as_extern(), border_size) }.into_result()
}
pub fn run_by_keypoint_size(keypoints: &mut core::Vector::<core::KeyPoint>, min_size: f32, max_size: f32) -> Result<()> {
unsafe { sys::cv_KeyPointsFilter_runByKeypointSize_vector_KeyPoint_R_float_float(keypoints.as_raw_mut_VectorOfKeyPoint(), min_size, max_size) }.into_result()
}
pub fn run_by_pixels_mask(keypoints: &mut core::Vector::<core::KeyPoint>, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_KeyPointsFilter_runByPixelsMask_vector_KeyPoint_R_const_MatR(keypoints.as_raw_mut_VectorOfKeyPoint(), mask.as_raw_Mat()) }.into_result()
}
pub fn remove_duplicated(keypoints: &mut core::Vector::<core::KeyPoint>) -> Result<()> {
unsafe { sys::cv_KeyPointsFilter_removeDuplicated_vector_KeyPoint_R(keypoints.as_raw_mut_VectorOfKeyPoint()) }.into_result()
}
pub fn remove_duplicated_sorted(keypoints: &mut core::Vector::<core::KeyPoint>) -> Result<()> {
unsafe { sys::cv_KeyPointsFilter_removeDuplicatedSorted_vector_KeyPoint_R(keypoints.as_raw_mut_VectorOfKeyPoint()) }.into_result()
}
pub fn retain_best(keypoints: &mut core::Vector::<core::KeyPoint>, npoints: i32) -> Result<()> {
unsafe { sys::cv_KeyPointsFilter_retainBest_vector_KeyPoint_R_int(keypoints.as_raw_mut_VectorOfKeyPoint(), npoints) }.into_result()
}
}
pub trait MSER: crate::features2d::Feature2DTrait {
fn as_raw_MSER(&self) -> *const c_void;
fn as_raw_mut_MSER(&mut self) -> *mut c_void;
fn detect_regions(&mut self, image: &dyn core::ToInputArray, msers: &mut core::Vector::<core::Vector::<core::Point>>, bboxes: &mut core::Vector::<core::Rect>) -> Result<()> {
input_array_arg!(image);
unsafe { sys::cv_MSER_detectRegions_const__InputArrayR_vector_vector_Point__R_vector_Rect_R(self.as_raw_mut_MSER(), image.as_raw__InputArray(), msers.as_raw_mut_VectorOfVectorOfPoint(), bboxes.as_raw_mut_VectorOfRect()) }.into_result()
}
fn set_delta(&mut self, delta: i32) -> Result<()> {
unsafe { sys::cv_MSER_setDelta_int(self.as_raw_mut_MSER(), delta) }.into_result()
}
fn get_delta(&self) -> Result<i32> {
unsafe { sys::cv_MSER_getDelta_const(self.as_raw_MSER()) }.into_result()
}
fn set_min_area(&mut self, min_area: i32) -> Result<()> {
unsafe { sys::cv_MSER_setMinArea_int(self.as_raw_mut_MSER(), min_area) }.into_result()
}
fn get_min_area(&self) -> Result<i32> {
unsafe { sys::cv_MSER_getMinArea_const(self.as_raw_MSER()) }.into_result()
}
fn set_max_area(&mut self, max_area: i32) -> Result<()> {
unsafe { sys::cv_MSER_setMaxArea_int(self.as_raw_mut_MSER(), max_area) }.into_result()
}
fn get_max_area(&self) -> Result<i32> {
unsafe { sys::cv_MSER_getMaxArea_const(self.as_raw_MSER()) }.into_result()
}
fn set_pass2_only(&mut self, f: bool) -> Result<()> {
unsafe { sys::cv_MSER_setPass2Only_bool(self.as_raw_mut_MSER(), f) }.into_result()
}
fn get_pass2_only(&self) -> Result<bool> {
unsafe { sys::cv_MSER_getPass2Only_const(self.as_raw_MSER()) }.into_result()
}
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_MSER_getDefaultName_const(self.as_raw_MSER()) }.into_result().map(|r| unsafe { String::opencv_from_extern(r) } )
}
}
impl dyn MSER + '_ {
pub fn create(_delta: i32, _min_area: i32, _max_area: i32, _max_variation: f64, _min_diversity: f64, _max_evolution: i32, _area_threshold: f64, _min_margin: f64, _edge_blur_size: i32) -> Result<core::Ptr::<dyn crate::features2d::MSER>> {
unsafe { sys::cv_MSER_create_int_int_int_double_double_int_double_double_int(_delta, _min_area, _max_area, _max_variation, _min_diversity, _max_evolution, _area_threshold, _min_margin, _edge_blur_size) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::features2d::MSER>::opencv_from_extern(r) } )
}
}
pub trait ORB: crate::features2d::Feature2DTrait {
fn as_raw_ORB(&self) -> *const c_void;
fn as_raw_mut_ORB(&mut self) -> *mut c_void;
fn set_max_features(&mut self, max_features: i32) -> Result<()> {
unsafe { sys::cv_ORB_setMaxFeatures_int(self.as_raw_mut_ORB(), max_features) }.into_result()
}
fn get_max_features(&self) -> Result<i32> {
unsafe { sys::cv_ORB_getMaxFeatures_const(self.as_raw_ORB()) }.into_result()
}
fn set_scale_factor(&mut self, scale_factor: f64) -> Result<()> {
unsafe { sys::cv_ORB_setScaleFactor_double(self.as_raw_mut_ORB(), scale_factor) }.into_result()
}
fn get_scale_factor(&self) -> Result<f64> {
unsafe { sys::cv_ORB_getScaleFactor_const(self.as_raw_ORB()) }.into_result()
}
fn set_n_levels(&mut self, nlevels: i32) -> Result<()> {
unsafe { sys::cv_ORB_setNLevels_int(self.as_raw_mut_ORB(), nlevels) }.into_result()
}
fn get_n_levels(&self) -> Result<i32> {
unsafe { sys::cv_ORB_getNLevels_const(self.as_raw_ORB()) }.into_result()
}
fn set_edge_threshold(&mut self, edge_threshold: i32) -> Result<()> {
unsafe { sys::cv_ORB_setEdgeThreshold_int(self.as_raw_mut_ORB(), edge_threshold) }.into_result()
}
fn get_edge_threshold(&self) -> Result<i32> {
unsafe { sys::cv_ORB_getEdgeThreshold_const(self.as_raw_ORB()) }.into_result()
}
fn set_first_level(&mut self, first_level: i32) -> Result<()> {
unsafe { sys::cv_ORB_setFirstLevel_int(self.as_raw_mut_ORB(), first_level) }.into_result()
}
fn get_first_level(&self) -> Result<i32> {
unsafe { sys::cv_ORB_getFirstLevel_const(self.as_raw_ORB()) }.into_result()
}
fn set_wta_k(&mut self, wta_k: i32) -> Result<()> {
unsafe { sys::cv_ORB_setWTA_K_int(self.as_raw_mut_ORB(), wta_k) }.into_result()
}
fn get_wta_k(&self) -> Result<i32> {
unsafe { sys::cv_ORB_getWTA_K_const(self.as_raw_ORB()) }.into_result()
}
fn set_score_type(&mut self, score_type: crate::features2d::ORB_ScoreType) -> Result<()> {
unsafe { sys::cv_ORB_setScoreType_ScoreType(self.as_raw_mut_ORB(), score_type) }.into_result()
}
fn get_score_type(&self) -> Result<crate::features2d::ORB_ScoreType> {
unsafe { sys::cv_ORB_getScoreType_const(self.as_raw_ORB()) }.into_result()
}
fn set_patch_size(&mut self, patch_size: i32) -> Result<()> {
unsafe { sys::cv_ORB_setPatchSize_int(self.as_raw_mut_ORB(), patch_size) }.into_result()
}
fn get_patch_size(&self) -> Result<i32> {
unsafe { sys::cv_ORB_getPatchSize_const(self.as_raw_ORB()) }.into_result()
}
fn set_fast_threshold(&mut self, fast_threshold: i32) -> Result<()> {
unsafe { sys::cv_ORB_setFastThreshold_int(self.as_raw_mut_ORB(), fast_threshold) }.into_result()
}
fn get_fast_threshold(&self) -> Result<i32> {
unsafe { sys::cv_ORB_getFastThreshold_const(self.as_raw_ORB()) }.into_result()
}
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_ORB_getDefaultName_const(self.as_raw_ORB()) }.into_result().map(|r| unsafe { String::opencv_from_extern(r) } )
}
}
impl dyn ORB + '_ {
pub const kBytes: i32 = 32;
pub fn create(nfeatures: i32, scale_factor: f32, nlevels: i32, edge_threshold: i32, first_level: i32, wta_k: i32, score_type: crate::features2d::ORB_ScoreType, patch_size: i32, fast_threshold: i32) -> Result<core::Ptr::<dyn crate::features2d::ORB>> {
unsafe { sys::cv_ORB_create_int_float_int_int_int_int_ScoreType_int_int(nfeatures, scale_factor, nlevels, edge_threshold, first_level, wta_k, score_type, patch_size, fast_threshold) }.into_result().map(|r| unsafe { core::Ptr::<dyn crate::features2d::ORB>::opencv_from_extern(r) } )
}
}
pub trait SIFTTrait: crate::features2d::Feature2DTrait {
fn as_raw_SIFT(&self) -> *const c_void;
fn as_raw_mut_SIFT(&mut self) -> *mut c_void;
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_SIFT_getDefaultName_const(self.as_raw_SIFT()) }.into_result().map(|r| unsafe { String::opencv_from_extern(r) } )
}
}
pub struct SIFT {
ptr: *mut c_void
}
opencv_type_boxed! { SIFT }
impl Drop for SIFT {
fn drop(&mut self) {
extern "C" { fn cv_SIFT_delete(instance: *mut c_void); }
unsafe { cv_SIFT_delete(self.as_raw_mut_SIFT()) };
}
}
impl SIFT {
#[inline] pub fn as_raw_SIFT(&self) -> *const c_void { self.as_raw() }
#[inline] pub fn as_raw_mut_SIFT(&mut self) -> *mut c_void { self.as_raw_mut() }
}
unsafe impl Send for SIFT {}
impl core::AlgorithmTrait for SIFT {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::features2d::Feature2DTrait for SIFT {
#[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::features2d::SIFTTrait for SIFT {
#[inline] fn as_raw_SIFT(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_SIFT(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl SIFT {
pub fn create(nfeatures: i32, n_octave_layers: i32, contrast_threshold: f64, edge_threshold: f64, sigma: f64) -> Result<core::Ptr::<crate::features2d::SIFT>> {
unsafe { sys::cv_SIFT_create_int_int_double_double_double(nfeatures, n_octave_layers, contrast_threshold, edge_threshold, sigma) }.into_result().map(|r| unsafe { core::Ptr::<crate::features2d::SIFT>::opencv_from_extern(r) } )
}
pub fn create_1(nfeatures: i32, n_octave_layers: i32, contrast_threshold: f64, edge_threshold: f64, sigma: f64, descriptor_type: i32) -> Result<core::Ptr::<crate::features2d::SIFT>> {
unsafe { sys::cv_SIFT_create_int_int_double_double_double_int(nfeatures, n_octave_layers, contrast_threshold, edge_threshold, sigma, descriptor_type) }.into_result().map(|r| unsafe { core::Ptr::<crate::features2d::SIFT>::opencv_from_extern(r) } )
}
}
pub trait SimpleBlobDetectorTrait: crate::features2d::Feature2DTrait {
fn as_raw_SimpleBlobDetector(&self) -> *const c_void;
fn as_raw_mut_SimpleBlobDetector(&mut self) -> *mut c_void;
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_SimpleBlobDetector_getDefaultName_const(self.as_raw_SimpleBlobDetector()) }.into_result().map(|r| unsafe { String::opencv_from_extern(r) } )
}
}
pub struct SimpleBlobDetector {
ptr: *mut c_void
}
opencv_type_boxed! { SimpleBlobDetector }
impl Drop for SimpleBlobDetector {
fn drop(&mut self) {
extern "C" { fn cv_SimpleBlobDetector_delete(instance: *mut c_void); }
unsafe { cv_SimpleBlobDetector_delete(self.as_raw_mut_SimpleBlobDetector()) };
}
}
impl SimpleBlobDetector {
#[inline] pub fn as_raw_SimpleBlobDetector(&self) -> *const c_void { self.as_raw() }
#[inline] pub fn as_raw_mut_SimpleBlobDetector(&mut self) -> *mut c_void { self.as_raw_mut() }
}
unsafe impl Send for SimpleBlobDetector {}
impl core::AlgorithmTrait for SimpleBlobDetector {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::features2d::Feature2DTrait for SimpleBlobDetector {
#[inline] fn as_raw_Feature2D(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_Feature2D(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::features2d::SimpleBlobDetectorTrait for SimpleBlobDetector {
#[inline] fn as_raw_SimpleBlobDetector(&self) -> *const c_void { self.as_raw() }
#[inline] fn as_raw_mut_SimpleBlobDetector(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl SimpleBlobDetector {
pub fn create(parameters: crate::features2d::SimpleBlobDetector_Params) -> Result<core::Ptr::<crate::features2d::SimpleBlobDetector>> {
unsafe { sys::cv_SimpleBlobDetector_create_const_ParamsR(¶meters) }.into_result().map(|r| unsafe { core::Ptr::<crate::features2d::SimpleBlobDetector>::opencv_from_extern(r) } )
}
}
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct SimpleBlobDetector_Params {
pub threshold_step: f32,
pub min_threshold: f32,
pub max_threshold: f32,
pub min_repeatability: size_t,
pub min_dist_between_blobs: f32,
pub filter_by_color: bool,
pub blob_color: u8,
pub filter_by_area: bool,
pub min_area: f32,
pub max_area: f32,
pub filter_by_circularity: bool,
pub min_circularity: f32,
pub max_circularity: f32,
pub filter_by_inertia: bool,
pub min_inertia_ratio: f32,
pub max_inertia_ratio: f32,
pub filter_by_convexity: bool,
pub min_convexity: f32,
pub max_convexity: f32,
}
opencv_type_simple! { crate::features2d::SimpleBlobDetector_Params }
impl SimpleBlobDetector_Params {
pub fn default() -> Result<crate::features2d::SimpleBlobDetector_Params> {
unsafe { sys::cv_SimpleBlobDetector_Params_Params() }.into_result()
}
pub fn read(self, fn_: &core::FileNode) -> Result<()> {
unsafe { sys::cv_SimpleBlobDetector_Params_read_const_FileNodeR(self.opencv_as_extern(), fn_.as_raw_FileNode()) }.into_result()
}
pub fn write(self, fs: &mut core::FileStorage) -> Result<()> {
unsafe { sys::cv_SimpleBlobDetector_Params_write_const_FileStorageR(self.opencv_as_extern(), fs.as_raw_mut_FileStorage()) }.into_result()
}
}
pub use crate::manual::features2d::*;