pub mod objdetect {
use crate::{mod_prelude::*, core, sys, types};
pub mod prelude {
pub use { super::DictionaryTraitConst, super::DictionaryTrait, super::BoardTraitConst, super::BoardTrait, super::GridBoardTraitConst, super::GridBoardTrait, super::CharucoBoardTraitConst, super::CharucoBoardTrait, super::DetectorParametersTraitConst, super::DetectorParametersTrait, super::ArucoDetectorTraitConst, super::ArucoDetectorTrait, super::GraphicalCodeDetectorTraitConst, super::GraphicalCodeDetectorTrait, super::SimilarRectsTraitConst, super::SimilarRectsTrait, super::BaseCascadeClassifier_MaskGeneratorTraitConst, super::BaseCascadeClassifier_MaskGeneratorTrait, super::BaseCascadeClassifierTraitConst, super::BaseCascadeClassifierTrait, super::CascadeClassifierTraitConst, super::CascadeClassifierTrait, super::DetectionROITraitConst, super::DetectionROITrait, super::HOGDescriptorTraitConst, super::HOGDescriptorTrait, super::QRCodeEncoderTraitConst, super::QRCodeEncoderTrait, super::QRCodeDetectorTraitConst, super::QRCodeDetectorTrait, super::QRCodeDetectorArucoTraitConst, super::QRCodeDetectorArucoTrait, super::DetectionBasedTracker_ParametersTraitConst, super::DetectionBasedTracker_ParametersTrait, super::DetectionBasedTracker_IDetectorTraitConst, super::DetectionBasedTracker_IDetectorTrait, super::DetectionBasedTracker_ExtObjectTraitConst, super::DetectionBasedTracker_ExtObjectTrait, super::DetectionBasedTrackerTraitConst, super::DetectionBasedTrackerTrait, super::FaceDetectorYNTraitConst, super::FaceDetectorYNTrait, super::FaceRecognizerSFTraitConst, super::FaceRecognizerSFTrait, super::CharucoParametersTraitConst, super::CharucoParametersTrait, super::CharucoDetectorTraitConst, super::CharucoDetectorTrait, super::BarcodeDetectorTraitConst, super::BarcodeDetectorTrait };
}
pub const CASCADE_DO_CANNY_PRUNING: i32 = 1;
pub const CASCADE_DO_ROUGH_SEARCH: i32 = 8;
pub const CASCADE_FIND_BIGGEST_OBJECT: i32 = 4;
pub const CASCADE_SCALE_IMAGE: i32 = 2;
pub const CORNER_REFINE_APRILTAG: i32 = 3;
pub const CORNER_REFINE_CONTOUR: i32 = 2;
pub const CORNER_REFINE_NONE: i32 = 0;
pub const CORNER_REFINE_SUBPIX: i32 = 1;
pub const DICT_4X4_100: i32 = 1;
pub const DICT_4X4_1000: i32 = 3;
pub const DICT_4X4_250: i32 = 2;
pub const DICT_4X4_50: i32 = 0;
pub const DICT_5X5_100: i32 = 5;
pub const DICT_5X5_1000: i32 = 7;
pub const DICT_5X5_250: i32 = 6;
pub const DICT_5X5_50: i32 = 4;
pub const DICT_6X6_100: i32 = 9;
pub const DICT_6X6_1000: i32 = 11;
pub const DICT_6X6_250: i32 = 10;
pub const DICT_6X6_50: i32 = 8;
pub const DICT_7X7_100: i32 = 13;
pub const DICT_7X7_1000: i32 = 15;
pub const DICT_7X7_250: i32 = 14;
pub const DICT_7X7_50: i32 = 12;
pub const DICT_APRILTAG_16h5: i32 = 17;
pub const DICT_APRILTAG_25h9: i32 = 18;
pub const DICT_APRILTAG_36h10: i32 = 19;
pub const DICT_APRILTAG_36h11: i32 = 20;
pub const DICT_ARUCO_MIP_36h12: i32 = 21;
pub const DICT_ARUCO_ORIGINAL: i32 = 16;
pub const DetectionBasedTracker_DETECTED: i32 = 1;
pub const DetectionBasedTracker_DETECTED_NOT_SHOWN_YET: i32 = 0;
pub const DetectionBasedTracker_DETECTED_TEMPORARY_LOST: i32 = 2;
pub const DetectionBasedTracker_WRONG_OBJECT: i32 = 3;
pub const FaceRecognizerSF_FR_COSINE: i32 = 0;
pub const FaceRecognizerSF_FR_NORM_L2: i32 = 1;
pub const HOGDescriptor_DEFAULT_NLEVELS: i32 = 64;
pub const HOGDescriptor_DESCR_FORMAT_COL_BY_COL: i32 = 0;
pub const HOGDescriptor_DESCR_FORMAT_ROW_BY_ROW: i32 = 1;
pub const HOGDescriptor_L2Hys: i32 = 0;
pub const QRCodeEncoder_CORRECT_LEVEL_H: i32 = 3;
pub const QRCodeEncoder_CORRECT_LEVEL_L: i32 = 0;
pub const QRCodeEncoder_CORRECT_LEVEL_M: i32 = 1;
pub const QRCodeEncoder_CORRECT_LEVEL_Q: i32 = 2;
pub const QRCodeEncoder_ECI_UTF8: i32 = 26;
pub const QRCodeEncoder_MODE_ALPHANUMERIC: i32 = 2;
pub const QRCodeEncoder_MODE_AUTO: i32 = -1;
pub const QRCodeEncoder_MODE_BYTE: i32 = 4;
pub const QRCodeEncoder_MODE_ECI: i32 = 7;
pub const QRCodeEncoder_MODE_KANJI: i32 = 8;
pub const QRCodeEncoder_MODE_NUMERIC: i32 = 1;
pub const QRCodeEncoder_MODE_STRUCTURED_APPEND: i32 = 3;
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum CornerRefineMethod {
CORNER_REFINE_NONE = 0,
CORNER_REFINE_SUBPIX = 1,
CORNER_REFINE_CONTOUR = 2,
CORNER_REFINE_APRILTAG = 3,
}
opencv_type_enum! { crate::objdetect::CornerRefineMethod }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum DetectionBasedTracker_ObjectStatus {
DETECTED_NOT_SHOWN_YET = 0,
DETECTED = 1,
DETECTED_TEMPORARY_LOST = 2,
WRONG_OBJECT = 3,
}
opencv_type_enum! { crate::objdetect::DetectionBasedTracker_ObjectStatus }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum FaceRecognizerSF_DisType {
FR_COSINE = 0,
FR_NORM_L2 = 1,
}
opencv_type_enum! { crate::objdetect::FaceRecognizerSF_DisType }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum HOGDescriptor_DescriptorStorageFormat {
DESCR_FORMAT_COL_BY_COL = 0,
DESCR_FORMAT_ROW_BY_ROW = 1,
}
opencv_type_enum! { crate::objdetect::HOGDescriptor_DescriptorStorageFormat }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum HOGDescriptor_HistogramNormType {
L2Hys = 0,
}
opencv_type_enum! { crate::objdetect::HOGDescriptor_HistogramNormType }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum PredefinedDictionaryType {
DICT_4X4_50 = 0,
DICT_4X4_100 = 1,
DICT_4X4_250 = 2,
DICT_4X4_1000 = 3,
DICT_5X5_50 = 4,
DICT_5X5_100 = 5,
DICT_5X5_250 = 6,
DICT_5X5_1000 = 7,
DICT_6X6_50 = 8,
DICT_6X6_100 = 9,
DICT_6X6_250 = 10,
DICT_6X6_1000 = 11,
DICT_7X7_50 = 12,
DICT_7X7_100 = 13,
DICT_7X7_250 = 14,
DICT_7X7_1000 = 15,
DICT_ARUCO_ORIGINAL = 16,
DICT_APRILTAG_16h5 = 17,
DICT_APRILTAG_25h9 = 18,
DICT_APRILTAG_36h10 = 19,
DICT_APRILTAG_36h11 = 20,
DICT_ARUCO_MIP_36h12 = 21,
}
opencv_type_enum! { crate::objdetect::PredefinedDictionaryType }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum QRCodeEncoder_CorrectionLevel {
CORRECT_LEVEL_L = 0,
CORRECT_LEVEL_M = 1,
CORRECT_LEVEL_Q = 2,
CORRECT_LEVEL_H = 3,
}
opencv_type_enum! { crate::objdetect::QRCodeEncoder_CorrectionLevel }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum QRCodeEncoder_ECIEncodings {
ECI_UTF8 = 26,
}
opencv_type_enum! { crate::objdetect::QRCodeEncoder_ECIEncodings }
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum QRCodeEncoder_EncodeMode {
MODE_AUTO = -1,
MODE_NUMERIC = 1,
MODE_ALPHANUMERIC = 2,
MODE_BYTE = 4,
MODE_ECI = 7,
MODE_KANJI = 8,
MODE_STRUCTURED_APPEND = 3,
}
opencv_type_enum! { crate::objdetect::QRCodeEncoder_EncodeMode }
pub type DetectionBasedTracker_Object = core::Tuple<(core::Rect, i32)>;
#[inline]
pub fn draw_detected_corners_charuco_def(image: &mut impl core::ToInputOutputArray, charuco_corners: &impl core::ToInputArray) -> Result<()> {
input_output_array_arg!(image);
input_array_arg!(charuco_corners);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_drawDetectedCornersCharuco_const__InputOutputArrayR_const__InputArrayR(image.as_raw__InputOutputArray(), charuco_corners.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn draw_detected_corners_charuco(image: &mut impl core::ToInputOutputArray, charuco_corners: &impl core::ToInputArray, charuco_ids: &impl core::ToInputArray, corner_color: core::Scalar) -> Result<()> {
input_output_array_arg!(image);
input_array_arg!(charuco_corners);
input_array_arg!(charuco_ids);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_drawDetectedCornersCharuco_const__InputOutputArrayR_const__InputArrayR_const__InputArrayR_Scalar(image.as_raw__InputOutputArray(), charuco_corners.as_raw__InputArray(), charuco_ids.as_raw__InputArray(), corner_color.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn draw_detected_diamonds_def(image: &mut impl core::ToInputOutputArray, diamond_corners: &impl core::ToInputArray) -> Result<()> {
input_output_array_arg!(image);
input_array_arg!(diamond_corners);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_drawDetectedDiamonds_const__InputOutputArrayR_const__InputArrayR(image.as_raw__InputOutputArray(), diamond_corners.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn draw_detected_diamonds(image: &mut impl core::ToInputOutputArray, diamond_corners: &impl core::ToInputArray, diamond_ids: &impl core::ToInputArray, border_color: core::Scalar) -> Result<()> {
input_output_array_arg!(image);
input_array_arg!(diamond_corners);
input_array_arg!(diamond_ids);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_drawDetectedDiamonds_const__InputOutputArrayR_const__InputArrayR_const__InputArrayR_Scalar(image.as_raw__InputOutputArray(), diamond_corners.as_raw__InputArray(), diamond_ids.as_raw__InputArray(), border_color.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn draw_detected_markers_def(image: &mut impl core::ToInputOutputArray, corners: &impl core::ToInputArray) -> Result<()> {
input_output_array_arg!(image);
input_array_arg!(corners);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_drawDetectedMarkers_const__InputOutputArrayR_const__InputArrayR(image.as_raw__InputOutputArray(), corners.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn draw_detected_markers(image: &mut impl core::ToInputOutputArray, corners: &impl core::ToInputArray, ids: &impl core::ToInputArray, border_color: core::Scalar) -> Result<()> {
input_output_array_arg!(image);
input_array_arg!(corners);
input_array_arg!(ids);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_drawDetectedMarkers_const__InputOutputArrayR_const__InputArrayR_const__InputArrayR_Scalar(image.as_raw__InputOutputArray(), corners.as_raw__InputArray(), ids.as_raw__InputArray(), border_color.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn extend_dictionary_def(n_markers: i32, marker_size: i32) -> Result<crate::objdetect::Dictionary> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_extendDictionary_int_int(n_markers, marker_size, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::Dictionary::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn extend_dictionary(n_markers: i32, marker_size: i32, base_dictionary: &crate::objdetect::Dictionary, random_seed: i32) -> Result<crate::objdetect::Dictionary> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_extendDictionary_int_int_const_DictionaryR_int(n_markers, marker_size, base_dictionary.as_raw_Dictionary(), random_seed, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::Dictionary::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn generate_image_marker_def(dictionary: &crate::objdetect::Dictionary, id: i32, side_pixels: i32, img: &mut impl core::ToOutputArray) -> Result<()> {
output_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_generateImageMarker_const_DictionaryR_int_int_const__OutputArrayR(dictionary.as_raw_Dictionary(), id, side_pixels, img.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn generate_image_marker(dictionary: &crate::objdetect::Dictionary, id: i32, side_pixels: i32, img: &mut impl core::ToOutputArray, border_bits: i32) -> Result<()> {
output_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_generateImageMarker_const_DictionaryR_int_int_const__OutputArrayR_int(dictionary.as_raw_Dictionary(), id, side_pixels, img.as_raw__OutputArray(), border_bits, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn get_predefined_dictionary(name: crate::objdetect::PredefinedDictionaryType) -> Result<crate::objdetect::Dictionary> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_getPredefinedDictionary_PredefinedDictionaryType(name, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::Dictionary::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn get_predefined_dictionary_i32(dict: i32) -> Result<crate::objdetect::Dictionary> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_getPredefinedDictionary_int(dict, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::Dictionary::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn create_face_detection_mask_generator() -> Result<core::Ptr<crate::objdetect::BaseCascadeClassifier_MaskGenerator>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_createFaceDetectionMaskGenerator(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<crate::objdetect::BaseCascadeClassifier_MaskGenerator>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn group_rectangles_meanshift_def(rect_list: &mut core::Vector<core::Rect>, found_weights: &mut core::Vector<f64>, found_scales: &mut core::Vector<f64>) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_groupRectangles_meanshift_vectorLRectGR_vectorLdoubleGR_vectorLdoubleGR(rect_list.as_raw_mut_VectorOfRect(), found_weights.as_raw_mut_VectorOff64(), found_scales.as_raw_mut_VectorOff64(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn group_rectangles_meanshift(rect_list: &mut core::Vector<core::Rect>, found_weights: &mut core::Vector<f64>, found_scales: &mut core::Vector<f64>, detect_threshold: f64, win_det_size: core::Size) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_groupRectangles_meanshift_vectorLRectGR_vectorLdoubleGR_vectorLdoubleGR_double_Size(rect_list.as_raw_mut_VectorOfRect(), found_weights.as_raw_mut_VectorOff64(), found_scales.as_raw_mut_VectorOff64(), detect_threshold, win_det_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn group_rectangles_def(rect_list: &mut core::Vector<core::Rect>, group_threshold: i32) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_groupRectangles_vectorLRectGR_int(rect_list.as_raw_mut_VectorOfRect(), group_threshold, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn group_rectangles(rect_list: &mut core::Vector<core::Rect>, group_threshold: i32, eps: f64) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_groupRectangles_vectorLRectGR_int_double(rect_list.as_raw_mut_VectorOfRect(), group_threshold, eps, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn group_rectangles_levelweights(rect_list: &mut core::Vector<core::Rect>, group_threshold: i32, eps: f64, weights: &mut core::Vector<i32>, level_weights: &mut core::Vector<f64>) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_groupRectangles_vectorLRectGR_int_double_vectorLintGX_vectorLdoubleGX(rect_list.as_raw_mut_VectorOfRect(), group_threshold, eps, weights.as_raw_mut_VectorOfi32(), level_weights.as_raw_mut_VectorOff64(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn group_rectangles_weights_def(rect_list: &mut core::Vector<core::Rect>, weights: &mut core::Vector<i32>, group_threshold: i32) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_groupRectangles_vectorLRectGR_vectorLintGR_int(rect_list.as_raw_mut_VectorOfRect(), weights.as_raw_mut_VectorOfi32(), group_threshold, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn group_rectangles_weights(rect_list: &mut core::Vector<core::Rect>, weights: &mut core::Vector<i32>, group_threshold: i32, eps: f64) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_groupRectangles_vectorLRectGR_vectorLintGR_int_double(rect_list.as_raw_mut_VectorOfRect(), weights.as_raw_mut_VectorOfi32(), group_threshold, eps, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn group_rectangles_levels_def(rect_list: &mut core::Vector<core::Rect>, reject_levels: &mut core::Vector<i32>, level_weights: &mut core::Vector<f64>, group_threshold: i32) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_groupRectangles_vectorLRectGR_vectorLintGR_vectorLdoubleGR_int(rect_list.as_raw_mut_VectorOfRect(), reject_levels.as_raw_mut_VectorOfi32(), level_weights.as_raw_mut_VectorOff64(), group_threshold, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn group_rectangles_levels(rect_list: &mut core::Vector<core::Rect>, reject_levels: &mut core::Vector<i32>, level_weights: &mut core::Vector<f64>, group_threshold: i32, eps: f64) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_groupRectangles_vectorLRectGR_vectorLintGR_vectorLdoubleGR_int_double(rect_list.as_raw_mut_VectorOfRect(), reject_levels.as_raw_mut_VectorOfi32(), level_weights.as_raw_mut_VectorOff64(), group_threshold, eps, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
pub trait BaseCascadeClassifierTraitConst: core::AlgorithmTraitConst {
fn as_raw_BaseCascadeClassifier(&self) -> *const c_void;
#[inline]
fn empty(&self) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_BaseCascadeClassifier_empty_const(self.as_raw_BaseCascadeClassifier(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn is_old_format_cascade(&self) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_BaseCascadeClassifier_isOldFormatCascade_const(self.as_raw_BaseCascadeClassifier(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_original_window_size(&self) -> Result<core::Size> {
return_send!(via ocvrs_return);
unsafe { sys::cv_BaseCascadeClassifier_getOriginalWindowSize_const(self.as_raw_BaseCascadeClassifier(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_feature_type(&self) -> Result<i32> {
return_send!(via ocvrs_return);
unsafe { sys::cv_BaseCascadeClassifier_getFeatureType_const(self.as_raw_BaseCascadeClassifier(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait BaseCascadeClassifierTrait: core::AlgorithmTrait + crate::objdetect::BaseCascadeClassifierTraitConst {
fn as_raw_mut_BaseCascadeClassifier(&mut self) -> *mut c_void;
#[inline]
fn load(&mut self, filename: &str) -> Result<bool> {
extern_container_arg!(filename);
return_send!(via ocvrs_return);
unsafe { sys::cv_BaseCascadeClassifier_load_const_StringR(self.as_raw_mut_BaseCascadeClassifier(), filename.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_multi_scale(&mut self, image: &impl core::ToInputArray, objects: &mut core::Vector<core::Rect>, scale_factor: f64, min_neighbors: i32, flags: i32, min_size: core::Size, max_size: core::Size) -> Result<()> {
input_array_arg!(image);
return_send!(via ocvrs_return);
unsafe { sys::cv_BaseCascadeClassifier_detectMultiScale_const__InputArrayR_vectorLRectGR_double_int_int_Size_Size(self.as_raw_mut_BaseCascadeClassifier(), image.as_raw__InputArray(), objects.as_raw_mut_VectorOfRect(), scale_factor, min_neighbors, flags, min_size.opencv_as_extern(), max_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_multi_scale_num(&mut self, image: &impl core::ToInputArray, objects: &mut core::Vector<core::Rect>, num_detections: &mut core::Vector<i32>, scale_factor: f64, min_neighbors: i32, flags: i32, min_size: core::Size, max_size: core::Size) -> Result<()> {
input_array_arg!(image);
return_send!(via ocvrs_return);
unsafe { sys::cv_BaseCascadeClassifier_detectMultiScale_const__InputArrayR_vectorLRectGR_vectorLintGR_double_int_int_Size_Size(self.as_raw_mut_BaseCascadeClassifier(), image.as_raw__InputArray(), objects.as_raw_mut_VectorOfRect(), num_detections.as_raw_mut_VectorOfi32(), scale_factor, min_neighbors, flags, min_size.opencv_as_extern(), max_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_multi_scale_levels(&mut self, image: &impl core::ToInputArray, objects: &mut core::Vector<core::Rect>, reject_levels: &mut core::Vector<i32>, level_weights: &mut core::Vector<f64>, scale_factor: f64, min_neighbors: i32, flags: i32, min_size: core::Size, max_size: core::Size, output_reject_levels: bool) -> Result<()> {
input_array_arg!(image);
return_send!(via ocvrs_return);
unsafe { sys::cv_BaseCascadeClassifier_detectMultiScale_const__InputArrayR_vectorLRectGR_vectorLintGR_vectorLdoubleGR_double_int_int_Size_Size_bool(self.as_raw_mut_BaseCascadeClassifier(), image.as_raw__InputArray(), objects.as_raw_mut_VectorOfRect(), reject_levels.as_raw_mut_VectorOfi32(), level_weights.as_raw_mut_VectorOff64(), scale_factor, min_neighbors, flags, min_size.opencv_as_extern(), max_size.opencv_as_extern(), output_reject_levels, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_old_cascade(&mut self) -> Result<*mut c_void> {
return_send!(via ocvrs_return);
unsafe { sys::cv_BaseCascadeClassifier_getOldCascade(self.as_raw_mut_BaseCascadeClassifier(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_mask_generator(&mut self, mask_generator: &core::Ptr<crate::objdetect::BaseCascadeClassifier_MaskGenerator>) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_BaseCascadeClassifier_setMaskGenerator_const_PtrLMaskGeneratorGR(self.as_raw_mut_BaseCascadeClassifier(), mask_generator.as_raw_PtrOfBaseCascadeClassifier_MaskGenerator(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_mask_generator(&mut self) -> Result<core::Ptr<crate::objdetect::BaseCascadeClassifier_MaskGenerator>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_BaseCascadeClassifier_getMaskGenerator(self.as_raw_mut_BaseCascadeClassifier(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<crate::objdetect::BaseCascadeClassifier_MaskGenerator>::opencv_from_extern(ret) };
Ok(ret)
}
}
pub struct BaseCascadeClassifier {
ptr: *mut c_void
}
opencv_type_boxed! { BaseCascadeClassifier }
impl Drop for BaseCascadeClassifier {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_BaseCascadeClassifier_delete(self.as_raw_mut_BaseCascadeClassifier()) };
}
}
unsafe impl Send for BaseCascadeClassifier {}
impl core::AlgorithmTraitConst for BaseCascadeClassifier {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
}
impl core::AlgorithmTrait for BaseCascadeClassifier {
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::objdetect::BaseCascadeClassifierTraitConst for BaseCascadeClassifier {
#[inline] fn as_raw_BaseCascadeClassifier(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::BaseCascadeClassifierTrait for BaseCascadeClassifier {
#[inline] fn as_raw_mut_BaseCascadeClassifier(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl BaseCascadeClassifier {
}
boxed_cast_base! { BaseCascadeClassifier, core::Algorithm, cv_BaseCascadeClassifier_to_Algorithm }
impl std::fmt::Debug for BaseCascadeClassifier {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("BaseCascadeClassifier")
.finish()
}
}
pub trait BaseCascadeClassifier_MaskGeneratorTraitConst {
fn as_raw_BaseCascadeClassifier_MaskGenerator(&self) -> *const c_void;
}
pub trait BaseCascadeClassifier_MaskGeneratorTrait: crate::objdetect::BaseCascadeClassifier_MaskGeneratorTraitConst {
fn as_raw_mut_BaseCascadeClassifier_MaskGenerator(&mut self) -> *mut c_void;
#[inline]
fn generate_mask(&mut self, src: &core::Mat) -> Result<core::Mat> {
return_send!(via ocvrs_return);
unsafe { sys::cv_BaseCascadeClassifier_MaskGenerator_generateMask_const_MatR(self.as_raw_mut_BaseCascadeClassifier_MaskGenerator(), src.as_raw_Mat(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Mat::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn initialize_mask(&mut self, unnamed: &core::Mat) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_BaseCascadeClassifier_MaskGenerator_initializeMask_const_MatR(self.as_raw_mut_BaseCascadeClassifier_MaskGenerator(), unnamed.as_raw_Mat(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct BaseCascadeClassifier_MaskGenerator {
ptr: *mut c_void
}
opencv_type_boxed! { BaseCascadeClassifier_MaskGenerator }
impl Drop for BaseCascadeClassifier_MaskGenerator {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_BaseCascadeClassifier_MaskGenerator_delete(self.as_raw_mut_BaseCascadeClassifier_MaskGenerator()) };
}
}
unsafe impl Send for BaseCascadeClassifier_MaskGenerator {}
impl crate::objdetect::BaseCascadeClassifier_MaskGeneratorTraitConst for BaseCascadeClassifier_MaskGenerator {
#[inline] fn as_raw_BaseCascadeClassifier_MaskGenerator(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::BaseCascadeClassifier_MaskGeneratorTrait for BaseCascadeClassifier_MaskGenerator {
#[inline] fn as_raw_mut_BaseCascadeClassifier_MaskGenerator(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl BaseCascadeClassifier_MaskGenerator {
}
impl std::fmt::Debug for BaseCascadeClassifier_MaskGenerator {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("BaseCascadeClassifier_MaskGenerator")
.finish()
}
}
pub trait CascadeClassifierTraitConst {
fn as_raw_CascadeClassifier(&self) -> *const c_void;
#[inline]
fn empty(&self) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_empty_const(self.as_raw_CascadeClassifier(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn is_old_format_cascade(&self) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_isOldFormatCascade_const(self.as_raw_CascadeClassifier(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_original_window_size(&self) -> Result<core::Size> {
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_getOriginalWindowSize_const(self.as_raw_CascadeClassifier(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_feature_type(&self) -> Result<i32> {
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_getFeatureType_const(self.as_raw_CascadeClassifier(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait CascadeClassifierTrait: crate::objdetect::CascadeClassifierTraitConst {
fn as_raw_mut_CascadeClassifier(&mut self) -> *mut c_void;
#[inline]
fn cc(&mut self) -> core::Ptr<crate::objdetect::BaseCascadeClassifier> {
let ret = unsafe { sys::cv_CascadeClassifier_propCc(self.as_raw_mut_CascadeClassifier()) };
let ret = unsafe { core::Ptr::<crate::objdetect::BaseCascadeClassifier>::opencv_from_extern(ret) };
ret
}
#[inline]
fn set_cc(&mut self, val: core::Ptr<crate::objdetect::BaseCascadeClassifier>) {
let ret = unsafe { sys::cv_CascadeClassifier_propCc_const_PtrLBaseCascadeClassifierG(self.as_raw_mut_CascadeClassifier(), val.as_raw_PtrOfBaseCascadeClassifier()) };
ret
}
#[inline]
fn load(&mut self, filename: &str) -> Result<bool> {
extern_container_arg!(filename);
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_load_const_StringR(self.as_raw_mut_CascadeClassifier(), filename.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn read(&mut self, node: &core::FileNode) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_read_const_FileNodeR(self.as_raw_mut_CascadeClassifier(), node.as_raw_FileNode(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_multi_scale(&mut self, image: &impl core::ToInputArray, objects: &mut core::Vector<core::Rect>, scale_factor: f64, min_neighbors: i32, flags: i32, min_size: core::Size, max_size: core::Size) -> Result<()> {
input_array_arg!(image);
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_detectMultiScale_const__InputArrayR_vectorLRectGR_double_int_int_Size_Size(self.as_raw_mut_CascadeClassifier(), image.as_raw__InputArray(), objects.as_raw_mut_VectorOfRect(), scale_factor, min_neighbors, flags, min_size.opencv_as_extern(), max_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_multi_scale_def(&mut self, image: &impl core::ToInputArray, objects: &mut core::Vector<core::Rect>) -> Result<()> {
input_array_arg!(image);
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_detectMultiScale_const__InputArrayR_vectorLRectGR(self.as_raw_mut_CascadeClassifier(), image.as_raw__InputArray(), objects.as_raw_mut_VectorOfRect(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_multi_scale2(&mut self, image: &impl core::ToInputArray, objects: &mut core::Vector<core::Rect>, num_detections: &mut core::Vector<i32>, scale_factor: f64, min_neighbors: i32, flags: i32, min_size: core::Size, max_size: core::Size) -> Result<()> {
input_array_arg!(image);
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_detectMultiScale_const__InputArrayR_vectorLRectGR_vectorLintGR_double_int_int_Size_Size(self.as_raw_mut_CascadeClassifier(), image.as_raw__InputArray(), objects.as_raw_mut_VectorOfRect(), num_detections.as_raw_mut_VectorOfi32(), scale_factor, min_neighbors, flags, min_size.opencv_as_extern(), max_size.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_multi_scale2_def(&mut self, image: &impl core::ToInputArray, objects: &mut core::Vector<core::Rect>, num_detections: &mut core::Vector<i32>) -> Result<()> {
input_array_arg!(image);
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_detectMultiScale_const__InputArrayR_vectorLRectGR_vectorLintGR(self.as_raw_mut_CascadeClassifier(), image.as_raw__InputArray(), objects.as_raw_mut_VectorOfRect(), num_detections.as_raw_mut_VectorOfi32(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_multi_scale3(&mut self, image: &impl core::ToInputArray, objects: &mut core::Vector<core::Rect>, reject_levels: &mut core::Vector<i32>, level_weights: &mut core::Vector<f64>, scale_factor: f64, min_neighbors: i32, flags: i32, min_size: core::Size, max_size: core::Size, output_reject_levels: bool) -> Result<()> {
input_array_arg!(image);
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_detectMultiScale_const__InputArrayR_vectorLRectGR_vectorLintGR_vectorLdoubleGR_double_int_int_Size_Size_bool(self.as_raw_mut_CascadeClassifier(), image.as_raw__InputArray(), objects.as_raw_mut_VectorOfRect(), reject_levels.as_raw_mut_VectorOfi32(), level_weights.as_raw_mut_VectorOff64(), scale_factor, min_neighbors, flags, min_size.opencv_as_extern(), max_size.opencv_as_extern(), output_reject_levels, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_multi_scale3_def(&mut self, image: &impl core::ToInputArray, objects: &mut core::Vector<core::Rect>, reject_levels: &mut core::Vector<i32>, level_weights: &mut core::Vector<f64>) -> Result<()> {
input_array_arg!(image);
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_detectMultiScale_const__InputArrayR_vectorLRectGR_vectorLintGR_vectorLdoubleGR(self.as_raw_mut_CascadeClassifier(), image.as_raw__InputArray(), objects.as_raw_mut_VectorOfRect(), reject_levels.as_raw_mut_VectorOfi32(), level_weights.as_raw_mut_VectorOff64(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_old_cascade(&mut self) -> Result<*mut c_void> {
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_getOldCascade(self.as_raw_mut_CascadeClassifier(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_mask_generator(&mut self, mask_generator: &core::Ptr<crate::objdetect::BaseCascadeClassifier_MaskGenerator>) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_setMaskGenerator_const_PtrLMaskGeneratorGR(self.as_raw_mut_CascadeClassifier(), mask_generator.as_raw_PtrOfBaseCascadeClassifier_MaskGenerator(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_mask_generator(&mut self) -> Result<core::Ptr<crate::objdetect::BaseCascadeClassifier_MaskGenerator>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_getMaskGenerator(self.as_raw_mut_CascadeClassifier(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<crate::objdetect::BaseCascadeClassifier_MaskGenerator>::opencv_from_extern(ret) };
Ok(ret)
}
}
pub struct CascadeClassifier {
ptr: *mut c_void
}
opencv_type_boxed! { CascadeClassifier }
impl Drop for CascadeClassifier {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_CascadeClassifier_delete(self.as_raw_mut_CascadeClassifier()) };
}
}
unsafe impl Send for CascadeClassifier {}
impl crate::objdetect::CascadeClassifierTraitConst for CascadeClassifier {
#[inline] fn as_raw_CascadeClassifier(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::CascadeClassifierTrait for CascadeClassifier {
#[inline] fn as_raw_mut_CascadeClassifier(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl CascadeClassifier {
#[inline]
pub fn default() -> Result<crate::objdetect::CascadeClassifier> {
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_CascadeClassifier(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::CascadeClassifier::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn new(filename: &str) -> Result<crate::objdetect::CascadeClassifier> {
extern_container_arg!(filename);
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_CascadeClassifier_const_StringR(filename.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::CascadeClassifier::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn convert(oldcascade: &str, newcascade: &str) -> Result<bool> {
extern_container_arg!(oldcascade);
extern_container_arg!(newcascade);
return_send!(via ocvrs_return);
unsafe { sys::cv_CascadeClassifier_convert_const_StringR_const_StringR(oldcascade.opencv_as_extern(), newcascade.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
impl std::fmt::Debug for CascadeClassifier {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CascadeClassifier")
.finish()
}
}
pub trait DetectionBasedTrackerTraitConst {
fn as_raw_DetectionBasedTracker(&self) -> *const c_void;
#[inline]
fn get_parameters(&self) -> Result<crate::objdetect::DetectionBasedTracker_Parameters> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_getParameters_const(self.as_raw_DetectionBasedTracker(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::DetectionBasedTracker_Parameters::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn get_objects(&self, result: &mut core::Vector<core::Rect>) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_getObjects_const_vectorLRectGR(self.as_raw_DetectionBasedTracker(), result.as_raw_mut_VectorOfRect(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_objects_1(&self, result: &mut core::Vector<crate::objdetect::DetectionBasedTracker_Object>) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_getObjects_const_vectorLObjectGR(self.as_raw_DetectionBasedTracker(), result.as_raw_mut_VectorOfDetectionBasedTracker_Object(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_objects_2(&self, result: &mut core::Vector<crate::objdetect::DetectionBasedTracker_ExtObject>) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_getObjects_const_vectorLExtObjectGR(self.as_raw_DetectionBasedTracker(), result.as_raw_mut_VectorOfDetectionBasedTracker_ExtObject(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait DetectionBasedTrackerTrait: crate::objdetect::DetectionBasedTrackerTraitConst {
fn as_raw_mut_DetectionBasedTracker(&mut self) -> *mut c_void;
#[inline]
fn run(&mut self) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_run(self.as_raw_mut_DetectionBasedTracker(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn stop(&mut self) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_stop(self.as_raw_mut_DetectionBasedTracker(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn reset_tracking(&mut self) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_resetTracking(self.as_raw_mut_DetectionBasedTracker(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn process(&mut self, image_gray: &core::Mat) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_process_const_MatR(self.as_raw_mut_DetectionBasedTracker(), image_gray.as_raw_Mat(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_parameters(&mut self, params: &crate::objdetect::DetectionBasedTracker_Parameters) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_setParameters_const_ParametersR(self.as_raw_mut_DetectionBasedTracker(), params.as_raw_DetectionBasedTracker_Parameters(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn add_object(&mut self, location: core::Rect) -> Result<i32> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_addObject_const_RectR(self.as_raw_mut_DetectionBasedTracker(), &location, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct DetectionBasedTracker {
ptr: *mut c_void
}
opencv_type_boxed! { DetectionBasedTracker }
impl Drop for DetectionBasedTracker {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_DetectionBasedTracker_delete(self.as_raw_mut_DetectionBasedTracker()) };
}
}
unsafe impl Send for DetectionBasedTracker {}
impl crate::objdetect::DetectionBasedTrackerTraitConst for DetectionBasedTracker {
#[inline] fn as_raw_DetectionBasedTracker(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::DetectionBasedTrackerTrait for DetectionBasedTracker {
#[inline] fn as_raw_mut_DetectionBasedTracker(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl DetectionBasedTracker {
#[inline]
pub fn new(mut main_detector: core::Ptr<crate::objdetect::DetectionBasedTracker_IDetector>, mut tracking_detector: core::Ptr<crate::objdetect::DetectionBasedTracker_IDetector>, params: &crate::objdetect::DetectionBasedTracker_Parameters) -> Result<crate::objdetect::DetectionBasedTracker> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_DetectionBasedTracker_PtrLIDetectorG_PtrLIDetectorG_const_ParametersR(main_detector.as_raw_mut_PtrOfDetectionBasedTracker_IDetector(), tracking_detector.as_raw_mut_PtrOfDetectionBasedTracker_IDetector(), params.as_raw_DetectionBasedTracker_Parameters(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::DetectionBasedTracker::opencv_from_extern(ret) };
Ok(ret)
}
}
impl std::fmt::Debug for DetectionBasedTracker {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("DetectionBasedTracker")
.finish()
}
}
pub trait DetectionBasedTracker_ExtObjectTraitConst {
fn as_raw_DetectionBasedTracker_ExtObject(&self) -> *const c_void;
#[inline]
fn id(&self) -> i32 {
let ret = unsafe { sys::cv_DetectionBasedTracker_ExtObject_propId_const(self.as_raw_DetectionBasedTracker_ExtObject()) };
ret
}
#[inline]
fn location(&self) -> core::Rect {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_ExtObject_propLocation_const(self.as_raw_DetectionBasedTracker_ExtObject(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
ret
}
#[inline]
fn status(&self) -> crate::objdetect::DetectionBasedTracker_ObjectStatus {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_ExtObject_propStatus_const(self.as_raw_DetectionBasedTracker_ExtObject(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
ret
}
}
pub trait DetectionBasedTracker_ExtObjectTrait: crate::objdetect::DetectionBasedTracker_ExtObjectTraitConst {
fn as_raw_mut_DetectionBasedTracker_ExtObject(&mut self) -> *mut c_void;
#[inline]
fn set_id(&mut self, val: i32) {
let ret = unsafe { sys::cv_DetectionBasedTracker_ExtObject_propId_const_int(self.as_raw_mut_DetectionBasedTracker_ExtObject(), val) };
ret
}
#[inline]
fn set_location(&mut self, val: core::Rect) {
let ret = unsafe { sys::cv_DetectionBasedTracker_ExtObject_propLocation_const_Rect(self.as_raw_mut_DetectionBasedTracker_ExtObject(), val.opencv_as_extern()) };
ret
}
#[inline]
fn set_status(&mut self, val: crate::objdetect::DetectionBasedTracker_ObjectStatus) {
let ret = unsafe { sys::cv_DetectionBasedTracker_ExtObject_propStatus_const_ObjectStatus(self.as_raw_mut_DetectionBasedTracker_ExtObject(), val) };
ret
}
}
pub struct DetectionBasedTracker_ExtObject {
ptr: *mut c_void
}
opencv_type_boxed! { DetectionBasedTracker_ExtObject }
impl Drop for DetectionBasedTracker_ExtObject {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_DetectionBasedTracker_ExtObject_delete(self.as_raw_mut_DetectionBasedTracker_ExtObject()) };
}
}
unsafe impl Send for DetectionBasedTracker_ExtObject {}
impl crate::objdetect::DetectionBasedTracker_ExtObjectTraitConst for DetectionBasedTracker_ExtObject {
#[inline] fn as_raw_DetectionBasedTracker_ExtObject(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::DetectionBasedTracker_ExtObjectTrait for DetectionBasedTracker_ExtObject {
#[inline] fn as_raw_mut_DetectionBasedTracker_ExtObject(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl DetectionBasedTracker_ExtObject {
#[inline]
pub fn new(_id: i32, _location: core::Rect, _status: crate::objdetect::DetectionBasedTracker_ObjectStatus) -> Result<crate::objdetect::DetectionBasedTracker_ExtObject> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_ExtObject_ExtObject_int_Rect_ObjectStatus(_id, _location.opencv_as_extern(), _status, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::DetectionBasedTracker_ExtObject::opencv_from_extern(ret) };
Ok(ret)
}
}
impl Clone for DetectionBasedTracker_ExtObject {
#[inline]
fn clone(&self) -> Self {
unsafe { Self::from_raw(sys::cv_DetectionBasedTracker_ExtObject_implicitClone_const(self.as_raw_DetectionBasedTracker_ExtObject())) }
}
}
impl std::fmt::Debug for DetectionBasedTracker_ExtObject {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("DetectionBasedTracker_ExtObject")
.field("id", &crate::objdetect::DetectionBasedTracker_ExtObjectTraitConst::id(self))
.field("location", &crate::objdetect::DetectionBasedTracker_ExtObjectTraitConst::location(self))
.field("status", &crate::objdetect::DetectionBasedTracker_ExtObjectTraitConst::status(self))
.finish()
}
}
pub trait DetectionBasedTracker_IDetectorTraitConst {
fn as_raw_DetectionBasedTracker_IDetector(&self) -> *const c_void;
#[inline]
fn get_min_object_size(&self) -> Result<core::Size> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_IDetector_getMinObjectSize_const(self.as_raw_DetectionBasedTracker_IDetector(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_max_object_size(&self) -> Result<core::Size> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_IDetector_getMaxObjectSize_const(self.as_raw_DetectionBasedTracker_IDetector(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait DetectionBasedTracker_IDetectorTrait: crate::objdetect::DetectionBasedTracker_IDetectorTraitConst {
fn as_raw_mut_DetectionBasedTracker_IDetector(&mut self) -> *mut c_void;
#[inline]
fn detect(&mut self, image: &core::Mat, objects: &mut core::Vector<core::Rect>) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_IDetector_detect_const_MatR_vectorLRectGR(self.as_raw_mut_DetectionBasedTracker_IDetector(), image.as_raw_Mat(), objects.as_raw_mut_VectorOfRect(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_min_object_size(&mut self, min: core::Size) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_IDetector_setMinObjectSize_const_SizeR(self.as_raw_mut_DetectionBasedTracker_IDetector(), &min, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_max_object_size(&mut self, max: core::Size) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_IDetector_setMaxObjectSize_const_SizeR(self.as_raw_mut_DetectionBasedTracker_IDetector(), &max, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_scale_factor(&mut self) -> Result<f32> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_IDetector_getScaleFactor(self.as_raw_mut_DetectionBasedTracker_IDetector(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_scale_factor(&mut self, value: f32) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_IDetector_setScaleFactor_float(self.as_raw_mut_DetectionBasedTracker_IDetector(), value, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_min_neighbours(&mut self) -> Result<i32> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_IDetector_getMinNeighbours(self.as_raw_mut_DetectionBasedTracker_IDetector(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_min_neighbours(&mut self, value: i32) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_IDetector_setMinNeighbours_int(self.as_raw_mut_DetectionBasedTracker_IDetector(), value, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct DetectionBasedTracker_IDetector {
ptr: *mut c_void
}
opencv_type_boxed! { DetectionBasedTracker_IDetector }
impl Drop for DetectionBasedTracker_IDetector {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_DetectionBasedTracker_IDetector_delete(self.as_raw_mut_DetectionBasedTracker_IDetector()) };
}
}
unsafe impl Send for DetectionBasedTracker_IDetector {}
impl crate::objdetect::DetectionBasedTracker_IDetectorTraitConst for DetectionBasedTracker_IDetector {
#[inline] fn as_raw_DetectionBasedTracker_IDetector(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::DetectionBasedTracker_IDetectorTrait for DetectionBasedTracker_IDetector {
#[inline] fn as_raw_mut_DetectionBasedTracker_IDetector(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl DetectionBasedTracker_IDetector {
}
impl std::fmt::Debug for DetectionBasedTracker_IDetector {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("DetectionBasedTracker_IDetector")
.finish()
}
}
pub trait DetectionBasedTracker_ParametersTraitConst {
fn as_raw_DetectionBasedTracker_Parameters(&self) -> *const c_void;
#[inline]
fn max_track_lifetime(&self) -> i32 {
let ret = unsafe { sys::cv_DetectionBasedTracker_Parameters_propMaxTrackLifetime_const(self.as_raw_DetectionBasedTracker_Parameters()) };
ret
}
#[inline]
fn min_detection_period(&self) -> i32 {
let ret = unsafe { sys::cv_DetectionBasedTracker_Parameters_propMinDetectionPeriod_const(self.as_raw_DetectionBasedTracker_Parameters()) };
ret
}
}
pub trait DetectionBasedTracker_ParametersTrait: crate::objdetect::DetectionBasedTracker_ParametersTraitConst {
fn as_raw_mut_DetectionBasedTracker_Parameters(&mut self) -> *mut c_void;
#[inline]
fn set_max_track_lifetime(&mut self, val: i32) {
let ret = unsafe { sys::cv_DetectionBasedTracker_Parameters_propMaxTrackLifetime_const_int(self.as_raw_mut_DetectionBasedTracker_Parameters(), val) };
ret
}
#[inline]
fn set_min_detection_period(&mut self, val: i32) {
let ret = unsafe { sys::cv_DetectionBasedTracker_Parameters_propMinDetectionPeriod_const_int(self.as_raw_mut_DetectionBasedTracker_Parameters(), val) };
ret
}
}
pub struct DetectionBasedTracker_Parameters {
ptr: *mut c_void
}
opencv_type_boxed! { DetectionBasedTracker_Parameters }
impl Drop for DetectionBasedTracker_Parameters {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_DetectionBasedTracker_Parameters_delete(self.as_raw_mut_DetectionBasedTracker_Parameters()) };
}
}
unsafe impl Send for DetectionBasedTracker_Parameters {}
impl crate::objdetect::DetectionBasedTracker_ParametersTraitConst for DetectionBasedTracker_Parameters {
#[inline] fn as_raw_DetectionBasedTracker_Parameters(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::DetectionBasedTracker_ParametersTrait for DetectionBasedTracker_Parameters {
#[inline] fn as_raw_mut_DetectionBasedTracker_Parameters(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl DetectionBasedTracker_Parameters {
#[inline]
pub fn default() -> Result<crate::objdetect::DetectionBasedTracker_Parameters> {
return_send!(via ocvrs_return);
unsafe { sys::cv_DetectionBasedTracker_Parameters_Parameters(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::DetectionBasedTracker_Parameters::opencv_from_extern(ret) };
Ok(ret)
}
}
impl std::fmt::Debug for DetectionBasedTracker_Parameters {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("DetectionBasedTracker_Parameters")
.field("max_track_lifetime", &crate::objdetect::DetectionBasedTracker_ParametersTraitConst::max_track_lifetime(self))
.field("min_detection_period", &crate::objdetect::DetectionBasedTracker_ParametersTraitConst::min_detection_period(self))
.finish()
}
}
pub trait DetectionROITraitConst {
fn as_raw_DetectionROI(&self) -> *const c_void;
#[inline]
fn scale(&self) -> f64 {
let ret = unsafe { sys::cv_DetectionROI_propScale_const(self.as_raw_DetectionROI()) };
ret
}
#[inline]
fn locations(&self) -> core::Vector<core::Point> {
let ret = unsafe { sys::cv_DetectionROI_propLocations_const(self.as_raw_DetectionROI()) };
let ret = unsafe { core::Vector::<core::Point>::opencv_from_extern(ret) };
ret
}
#[inline]
fn confidences(&self) -> core::Vector<f64> {
let ret = unsafe { sys::cv_DetectionROI_propConfidences_const(self.as_raw_DetectionROI()) };
let ret = unsafe { core::Vector::<f64>::opencv_from_extern(ret) };
ret
}
}
pub trait DetectionROITrait: crate::objdetect::DetectionROITraitConst {
fn as_raw_mut_DetectionROI(&mut self) -> *mut c_void;
#[inline]
fn set_scale(&mut self, val: f64) {
let ret = unsafe { sys::cv_DetectionROI_propScale_const_double(self.as_raw_mut_DetectionROI(), val) };
ret
}
#[inline]
fn set_locations(&mut self, val: core::Vector<core::Point>) {
let ret = unsafe { sys::cv_DetectionROI_propLocations_const_vectorLPointG(self.as_raw_mut_DetectionROI(), val.as_raw_VectorOfPoint()) };
ret
}
#[inline]
fn set_confidences(&mut self, val: core::Vector<f64>) {
let ret = unsafe { sys::cv_DetectionROI_propConfidences_const_vectorLdoubleG(self.as_raw_mut_DetectionROI(), val.as_raw_VectorOff64()) };
ret
}
}
pub struct DetectionROI {
ptr: *mut c_void
}
opencv_type_boxed! { DetectionROI }
impl Drop for DetectionROI {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_DetectionROI_delete(self.as_raw_mut_DetectionROI()) };
}
}
unsafe impl Send for DetectionROI {}
impl crate::objdetect::DetectionROITraitConst for DetectionROI {
#[inline] fn as_raw_DetectionROI(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::DetectionROITrait for DetectionROI {
#[inline] fn as_raw_mut_DetectionROI(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl DetectionROI {
}
impl std::fmt::Debug for DetectionROI {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("DetectionROI")
.field("scale", &crate::objdetect::DetectionROITraitConst::scale(self))
.field("locations", &crate::objdetect::DetectionROITraitConst::locations(self))
.field("confidences", &crate::objdetect::DetectionROITraitConst::confidences(self))
.finish()
}
}
pub trait FaceDetectorYNTraitConst {
fn as_raw_FaceDetectorYN(&self) -> *const c_void;
}
pub trait FaceDetectorYNTrait: crate::objdetect::FaceDetectorYNTraitConst {
fn as_raw_mut_FaceDetectorYN(&mut self) -> *mut c_void;
#[inline]
fn set_input_size(&mut self, input_size: core::Size) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceDetectorYN_setInputSize_const_SizeR(self.as_raw_mut_FaceDetectorYN(), &input_size, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_input_size(&mut self) -> Result<core::Size> {
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceDetectorYN_getInputSize(self.as_raw_mut_FaceDetectorYN(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_score_threshold(&mut self, score_threshold: f32) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceDetectorYN_setScoreThreshold_float(self.as_raw_mut_FaceDetectorYN(), score_threshold, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_score_threshold(&mut self) -> Result<f32> {
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceDetectorYN_getScoreThreshold(self.as_raw_mut_FaceDetectorYN(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_nms_threshold(&mut self, nms_threshold: f32) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceDetectorYN_setNMSThreshold_float(self.as_raw_mut_FaceDetectorYN(), nms_threshold, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_nms_threshold(&mut self) -> Result<f32> {
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceDetectorYN_getNMSThreshold(self.as_raw_mut_FaceDetectorYN(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_top_k(&mut self, top_k: i32) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceDetectorYN_setTopK_int(self.as_raw_mut_FaceDetectorYN(), top_k, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_top_k(&mut self) -> Result<i32> {
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceDetectorYN_getTopK(self.as_raw_mut_FaceDetectorYN(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect(&mut self, image: &impl core::ToInputArray, faces: &mut impl core::ToOutputArray) -> Result<i32> {
input_array_arg!(image);
output_array_arg!(faces);
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceDetectorYN_detect_const__InputArrayR_const__OutputArrayR(self.as_raw_mut_FaceDetectorYN(), image.as_raw__InputArray(), faces.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct FaceDetectorYN {
ptr: *mut c_void
}
opencv_type_boxed! { FaceDetectorYN }
impl Drop for FaceDetectorYN {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_FaceDetectorYN_delete(self.as_raw_mut_FaceDetectorYN()) };
}
}
unsafe impl Send for FaceDetectorYN {}
impl crate::objdetect::FaceDetectorYNTraitConst for FaceDetectorYN {
#[inline] fn as_raw_FaceDetectorYN(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::FaceDetectorYNTrait for FaceDetectorYN {
#[inline] fn as_raw_mut_FaceDetectorYN(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl FaceDetectorYN {
#[inline]
pub fn create(model: &str, config: &str, input_size: core::Size, score_threshold: f32, nms_threshold: f32, top_k: i32, backend_id: i32, target_id: i32) -> Result<core::Ptr<crate::objdetect::FaceDetectorYN>> {
extern_container_arg!(model);
extern_container_arg!(config);
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceDetectorYN_create_const_StringR_const_StringR_const_SizeR_float_float_int_int_int(model.opencv_as_extern(), config.opencv_as_extern(), &input_size, score_threshold, nms_threshold, top_k, backend_id, target_id, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<crate::objdetect::FaceDetectorYN>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn create_def(model: &str, config: &str, input_size: core::Size) -> Result<core::Ptr<crate::objdetect::FaceDetectorYN>> {
extern_container_arg!(model);
extern_container_arg!(config);
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceDetectorYN_create_const_StringR_const_StringR_const_SizeR(model.opencv_as_extern(), config.opencv_as_extern(), &input_size, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<crate::objdetect::FaceDetectorYN>::opencv_from_extern(ret) };
Ok(ret)
}
}
impl std::fmt::Debug for FaceDetectorYN {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("FaceDetectorYN")
.finish()
}
}
pub trait FaceRecognizerSFTraitConst {
fn as_raw_FaceRecognizerSF(&self) -> *const c_void;
#[inline]
fn align_crop(&self, src_img: &impl core::ToInputArray, face_box: &impl core::ToInputArray, aligned_img: &mut impl core::ToOutputArray) -> Result<()> {
input_array_arg!(src_img);
input_array_arg!(face_box);
output_array_arg!(aligned_img);
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceRecognizerSF_alignCrop_const_const__InputArrayR_const__InputArrayR_const__OutputArrayR(self.as_raw_FaceRecognizerSF(), src_img.as_raw__InputArray(), face_box.as_raw__InputArray(), aligned_img.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn match_(&self, face_feature1: &impl core::ToInputArray, face_feature2: &impl core::ToInputArray, dis_type: i32) -> Result<f64> {
input_array_arg!(face_feature1);
input_array_arg!(face_feature2);
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceRecognizerSF_match_const_const__InputArrayR_const__InputArrayR_int(self.as_raw_FaceRecognizerSF(), face_feature1.as_raw__InputArray(), face_feature2.as_raw__InputArray(), dis_type, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn match__def(&self, face_feature1: &impl core::ToInputArray, face_feature2: &impl core::ToInputArray) -> Result<f64> {
input_array_arg!(face_feature1);
input_array_arg!(face_feature2);
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceRecognizerSF_match_const_const__InputArrayR_const__InputArrayR(self.as_raw_FaceRecognizerSF(), face_feature1.as_raw__InputArray(), face_feature2.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait FaceRecognizerSFTrait: crate::objdetect::FaceRecognizerSFTraitConst {
fn as_raw_mut_FaceRecognizerSF(&mut self) -> *mut c_void;
#[inline]
fn feature(&mut self, aligned_img: &impl core::ToInputArray, face_feature: &mut impl core::ToOutputArray) -> Result<()> {
input_array_arg!(aligned_img);
output_array_arg!(face_feature);
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceRecognizerSF_feature_const__InputArrayR_const__OutputArrayR(self.as_raw_mut_FaceRecognizerSF(), aligned_img.as_raw__InputArray(), face_feature.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct FaceRecognizerSF {
ptr: *mut c_void
}
opencv_type_boxed! { FaceRecognizerSF }
impl Drop for FaceRecognizerSF {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_FaceRecognizerSF_delete(self.as_raw_mut_FaceRecognizerSF()) };
}
}
unsafe impl Send for FaceRecognizerSF {}
impl crate::objdetect::FaceRecognizerSFTraitConst for FaceRecognizerSF {
#[inline] fn as_raw_FaceRecognizerSF(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::FaceRecognizerSFTrait for FaceRecognizerSF {
#[inline] fn as_raw_mut_FaceRecognizerSF(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl FaceRecognizerSF {
#[inline]
pub fn create(model: &str, config: &str, backend_id: i32, target_id: i32) -> Result<core::Ptr<crate::objdetect::FaceRecognizerSF>> {
extern_container_arg!(model);
extern_container_arg!(config);
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceRecognizerSF_create_const_StringR_const_StringR_int_int(model.opencv_as_extern(), config.opencv_as_extern(), backend_id, target_id, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<crate::objdetect::FaceRecognizerSF>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn create_def(model: &str, config: &str) -> Result<core::Ptr<crate::objdetect::FaceRecognizerSF>> {
extern_container_arg!(model);
extern_container_arg!(config);
return_send!(via ocvrs_return);
unsafe { sys::cv_FaceRecognizerSF_create_const_StringR_const_StringR(model.opencv_as_extern(), config.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<crate::objdetect::FaceRecognizerSF>::opencv_from_extern(ret) };
Ok(ret)
}
}
impl std::fmt::Debug for FaceRecognizerSF {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("FaceRecognizerSF")
.finish()
}
}
pub trait GraphicalCodeDetectorTraitConst {
fn as_raw_GraphicalCodeDetector(&self) -> *const c_void;
#[inline]
fn detect(&self, img: &impl core::ToInputArray, points: &mut impl core::ToOutputArray) -> Result<bool> {
input_array_arg!(img);
output_array_arg!(points);
return_send!(via ocvrs_return);
unsafe { sys::cv_GraphicalCodeDetector_detect_const_const__InputArrayR_const__OutputArrayR(self.as_raw_GraphicalCodeDetector(), img.as_raw__InputArray(), points.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn decode(&self, img: &impl core::ToInputArray, points: &impl core::ToInputArray, straight_code: &mut impl core::ToOutputArray) -> Result<Vec<u8>> {
input_array_arg!(img);
input_array_arg!(points);
output_array_arg!(straight_code);
return_send!(via ocvrs_return);
unsafe { sys::cv_GraphicalCodeDetector_decode_const_const__InputArrayR_const__InputArrayR_const__OutputArrayR(self.as_raw_GraphicalCodeDetector(), img.as_raw__InputArray(), points.as_raw__InputArray(), straight_code.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { Vec::<u8>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn decode_def(&self, img: &impl core::ToInputArray, points: &impl core::ToInputArray) -> Result<Vec<u8>> {
input_array_arg!(img);
input_array_arg!(points);
return_send!(via ocvrs_return);
unsafe { sys::cv_GraphicalCodeDetector_decode_const_const__InputArrayR_const__InputArrayR(self.as_raw_GraphicalCodeDetector(), img.as_raw__InputArray(), points.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { Vec::<u8>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn detect_and_decode(&self, img: &impl core::ToInputArray, points: &mut impl core::ToOutputArray, straight_code: &mut impl core::ToOutputArray) -> Result<Vec<u8>> {
input_array_arg!(img);
output_array_arg!(points);
output_array_arg!(straight_code);
return_send!(via ocvrs_return);
unsafe { sys::cv_GraphicalCodeDetector_detectAndDecode_const_const__InputArrayR_const__OutputArrayR_const__OutputArrayR(self.as_raw_GraphicalCodeDetector(), img.as_raw__InputArray(), points.as_raw__OutputArray(), straight_code.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { Vec::<u8>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn detect_and_decode_def(&self, img: &impl core::ToInputArray) -> Result<Vec<u8>> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_GraphicalCodeDetector_detectAndDecode_const_const__InputArrayR(self.as_raw_GraphicalCodeDetector(), img.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { Vec::<u8>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn detect_multi(&self, img: &impl core::ToInputArray, points: &mut impl core::ToOutputArray) -> Result<bool> {
input_array_arg!(img);
output_array_arg!(points);
return_send!(via ocvrs_return);
unsafe { sys::cv_GraphicalCodeDetector_detectMulti_const_const__InputArrayR_const__OutputArrayR(self.as_raw_GraphicalCodeDetector(), img.as_raw__InputArray(), points.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn decode_multi(&self, img: &impl core::ToInputArray, points: &impl core::ToInputArray, decoded_info: &mut core::Vector<String>, straight_code: &mut impl core::ToOutputArray) -> Result<bool> {
input_array_arg!(img);
input_array_arg!(points);
output_array_arg!(straight_code);
return_send!(via ocvrs_return);
unsafe { sys::cv_GraphicalCodeDetector_decodeMulti_const_const__InputArrayR_const__InputArrayR_vectorLstringGR_const__OutputArrayR(self.as_raw_GraphicalCodeDetector(), img.as_raw__InputArray(), points.as_raw__InputArray(), decoded_info.as_raw_mut_VectorOfString(), straight_code.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn decode_multi_def(&self, img: &impl core::ToInputArray, points: &impl core::ToInputArray, decoded_info: &mut core::Vector<String>) -> Result<bool> {
input_array_arg!(img);
input_array_arg!(points);
return_send!(via ocvrs_return);
unsafe { sys::cv_GraphicalCodeDetector_decodeMulti_const_const__InputArrayR_const__InputArrayR_vectorLstringGR(self.as_raw_GraphicalCodeDetector(), img.as_raw__InputArray(), points.as_raw__InputArray(), decoded_info.as_raw_mut_VectorOfString(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_and_decode_multi(&self, img: &impl core::ToInputArray, decoded_info: &mut core::Vector<String>, points: &mut impl core::ToOutputArray, straight_code: &mut impl core::ToOutputArray) -> Result<bool> {
input_array_arg!(img);
output_array_arg!(points);
output_array_arg!(straight_code);
return_send!(via ocvrs_return);
unsafe { sys::cv_GraphicalCodeDetector_detectAndDecodeMulti_const_const__InputArrayR_vectorLstringGR_const__OutputArrayR_const__OutputArrayR(self.as_raw_GraphicalCodeDetector(), img.as_raw__InputArray(), decoded_info.as_raw_mut_VectorOfString(), points.as_raw__OutputArray(), straight_code.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_and_decode_multi_def(&self, img: &impl core::ToInputArray, decoded_info: &mut core::Vector<String>) -> Result<bool> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_GraphicalCodeDetector_detectAndDecodeMulti_const_const__InputArrayR_vectorLstringGR(self.as_raw_GraphicalCodeDetector(), img.as_raw__InputArray(), decoded_info.as_raw_mut_VectorOfString(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait GraphicalCodeDetectorTrait: crate::objdetect::GraphicalCodeDetectorTraitConst {
fn as_raw_mut_GraphicalCodeDetector(&mut self) -> *mut c_void;
#[inline]
fn set(&mut self, unnamed: &crate::objdetect::GraphicalCodeDetector) {
let ret = unsafe { sys::cv_GraphicalCodeDetector_operatorST_const_GraphicalCodeDetectorR(self.as_raw_mut_GraphicalCodeDetector(), unnamed.as_raw_GraphicalCodeDetector()) };
ret
}
#[inline]
fn set_1(&mut self, mut unnamed: crate::objdetect::GraphicalCodeDetector) {
let ret = unsafe { sys::cv_GraphicalCodeDetector_operatorST_GraphicalCodeDetectorRR(self.as_raw_mut_GraphicalCodeDetector(), unnamed.as_raw_mut_GraphicalCodeDetector()) };
ret
}
}
pub struct GraphicalCodeDetector {
ptr: *mut c_void
}
opencv_type_boxed! { GraphicalCodeDetector }
impl Drop for GraphicalCodeDetector {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_GraphicalCodeDetector_delete(self.as_raw_mut_GraphicalCodeDetector()) };
}
}
unsafe impl Send for GraphicalCodeDetector {}
impl crate::objdetect::GraphicalCodeDetectorTraitConst for GraphicalCodeDetector {
#[inline] fn as_raw_GraphicalCodeDetector(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::GraphicalCodeDetectorTrait for GraphicalCodeDetector {
#[inline] fn as_raw_mut_GraphicalCodeDetector(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl GraphicalCodeDetector {
#[inline]
pub fn default() -> Result<crate::objdetect::GraphicalCodeDetector> {
return_send!(via ocvrs_return);
unsafe { sys::cv_GraphicalCodeDetector_GraphicalCodeDetector(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::GraphicalCodeDetector::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn copy(unnamed: &crate::objdetect::GraphicalCodeDetector) -> crate::objdetect::GraphicalCodeDetector {
let ret = unsafe { sys::cv_GraphicalCodeDetector_GraphicalCodeDetector_const_GraphicalCodeDetectorR(unnamed.as_raw_GraphicalCodeDetector()) };
let ret = unsafe { crate::objdetect::GraphicalCodeDetector::opencv_from_extern(ret) };
ret
}
#[inline]
pub fn copy_mut(mut unnamed: crate::objdetect::GraphicalCodeDetector) -> crate::objdetect::GraphicalCodeDetector {
let ret = unsafe { sys::cv_GraphicalCodeDetector_GraphicalCodeDetector_GraphicalCodeDetectorRR(unnamed.as_raw_mut_GraphicalCodeDetector()) };
let ret = unsafe { crate::objdetect::GraphicalCodeDetector::opencv_from_extern(ret) };
ret
}
}
impl Clone for GraphicalCodeDetector {
#[inline]
fn clone(&self) -> Self {
unsafe { Self::from_raw(sys::cv_GraphicalCodeDetector_implicitClone_const(self.as_raw_GraphicalCodeDetector())) }
}
}
impl std::fmt::Debug for GraphicalCodeDetector {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("GraphicalCodeDetector")
.finish()
}
}
pub trait HOGDescriptorTraitConst {
fn as_raw_HOGDescriptor(&self) -> *const c_void;
#[inline]
fn win_size(&self) -> core::Size {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_propWinSize_const(self.as_raw_HOGDescriptor(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
ret
}
#[inline]
fn block_size(&self) -> core::Size {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_propBlockSize_const(self.as_raw_HOGDescriptor(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
ret
}
#[inline]
fn block_stride(&self) -> core::Size {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_propBlockStride_const(self.as_raw_HOGDescriptor(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
ret
}
#[inline]
fn cell_size(&self) -> core::Size {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_propCellSize_const(self.as_raw_HOGDescriptor(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
ret
}
#[inline]
fn nbins(&self) -> i32 {
let ret = unsafe { sys::cv_HOGDescriptor_propNbins_const(self.as_raw_HOGDescriptor()) };
ret
}
#[inline]
fn deriv_aperture(&self) -> i32 {
let ret = unsafe { sys::cv_HOGDescriptor_propDerivAperture_const(self.as_raw_HOGDescriptor()) };
ret
}
#[inline]
fn win_sigma(&self) -> f64 {
let ret = unsafe { sys::cv_HOGDescriptor_propWinSigma_const(self.as_raw_HOGDescriptor()) };
ret
}
#[inline]
fn histogram_norm_type(&self) -> crate::objdetect::HOGDescriptor_HistogramNormType {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_propHistogramNormType_const(self.as_raw_HOGDescriptor(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
ret
}
#[inline]
fn l2_hys_threshold(&self) -> f64 {
let ret = unsafe { sys::cv_HOGDescriptor_propL2HysThreshold_const(self.as_raw_HOGDescriptor()) };
ret
}
#[inline]
fn gamma_correction(&self) -> bool {
let ret = unsafe { sys::cv_HOGDescriptor_propGammaCorrection_const(self.as_raw_HOGDescriptor()) };
ret
}
#[inline]
fn svm_detector(&self) -> core::Vector<f32> {
let ret = unsafe { sys::cv_HOGDescriptor_propSvmDetector_const(self.as_raw_HOGDescriptor()) };
let ret = unsafe { core::Vector::<f32>::opencv_from_extern(ret) };
ret
}
#[inline]
fn ocl_svm_detector(&self) -> core::UMat {
let ret = unsafe { sys::cv_HOGDescriptor_propOclSvmDetector_const(self.as_raw_HOGDescriptor()) };
let ret = unsafe { core::UMat::opencv_from_extern(ret) };
ret
}
#[inline]
fn free_coef(&self) -> f32 {
let ret = unsafe { sys::cv_HOGDescriptor_propFree_coef_const(self.as_raw_HOGDescriptor()) };
ret
}
#[inline]
fn nlevels(&self) -> i32 {
let ret = unsafe { sys::cv_HOGDescriptor_propNlevels_const(self.as_raw_HOGDescriptor()) };
ret
}
#[inline]
fn signed_gradient(&self) -> bool {
let ret = unsafe { sys::cv_HOGDescriptor_propSignedGradient_const(self.as_raw_HOGDescriptor()) };
ret
}
#[inline]
fn get_descriptor_size(&self) -> Result<size_t> {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_getDescriptorSize_const(self.as_raw_HOGDescriptor(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn check_detector_size(&self) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_checkDetectorSize_const(self.as_raw_HOGDescriptor(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_win_sigma(&self) -> Result<f64> {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_getWinSigma_const(self.as_raw_HOGDescriptor(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn write(&self, fs: &mut core::FileStorage, objname: &str) -> Result<()> {
extern_container_arg!(objname);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_write_const_FileStorageR_const_StringR(self.as_raw_HOGDescriptor(), fs.as_raw_mut_FileStorage(), objname.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn save(&self, filename: &str, objname: &str) -> Result<()> {
extern_container_arg!(filename);
extern_container_arg!(objname);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_save_const_const_StringR_const_StringR(self.as_raw_HOGDescriptor(), filename.opencv_as_extern(), objname.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn save_def(&self, filename: &str) -> Result<()> {
extern_container_arg!(filename);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_save_const_const_StringR(self.as_raw_HOGDescriptor(), filename.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn copy_to(&self, c: &mut crate::objdetect::HOGDescriptor) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_copyTo_const_HOGDescriptorR(self.as_raw_HOGDescriptor(), c.as_raw_mut_HOGDescriptor(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn compute(&self, img: &impl core::ToInputArray, descriptors: &mut core::Vector<f32>, win_stride: core::Size, padding: core::Size, locations: &core::Vector<core::Point>) -> Result<()> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_compute_const_const__InputArrayR_vectorLfloatGR_Size_Size_const_vectorLPointGR(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), descriptors.as_raw_mut_VectorOff32(), win_stride.opencv_as_extern(), padding.opencv_as_extern(), locations.as_raw_VectorOfPoint(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn compute_def(&self, img: &impl core::ToInputArray, descriptors: &mut core::Vector<f32>) -> Result<()> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_compute_const_const__InputArrayR_vectorLfloatGR(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), descriptors.as_raw_mut_VectorOff32(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_weights(&self, img: &impl core::ToInputArray, found_locations: &mut core::Vector<core::Point>, weights: &mut core::Vector<f64>, hit_threshold: f64, win_stride: core::Size, padding: core::Size, search_locations: &core::Vector<core::Point>) -> Result<()> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_detect_const_const__InputArrayR_vectorLPointGR_vectorLdoubleGR_double_Size_Size_const_vectorLPointGR(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfPoint(), weights.as_raw_mut_VectorOff64(), hit_threshold, win_stride.opencv_as_extern(), padding.opencv_as_extern(), search_locations.as_raw_VectorOfPoint(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_weights_def(&self, img: &impl core::ToInputArray, found_locations: &mut core::Vector<core::Point>, weights: &mut core::Vector<f64>) -> Result<()> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_detect_const_const__InputArrayR_vectorLPointGR_vectorLdoubleGR(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfPoint(), weights.as_raw_mut_VectorOff64(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect(&self, img: &impl core::ToInputArray, found_locations: &mut core::Vector<core::Point>, hit_threshold: f64, win_stride: core::Size, padding: core::Size, search_locations: &core::Vector<core::Point>) -> Result<()> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_detect_const_const__InputArrayR_vectorLPointGR_double_Size_Size_const_vectorLPointGR(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfPoint(), hit_threshold, win_stride.opencv_as_extern(), padding.opencv_as_extern(), search_locations.as_raw_VectorOfPoint(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_def(&self, img: &impl core::ToInputArray, found_locations: &mut core::Vector<core::Point>) -> Result<()> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_detect_const_const__InputArrayR_vectorLPointGR(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfPoint(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_multi_scale_weights(&self, img: &impl core::ToInputArray, found_locations: &mut core::Vector<core::Rect>, found_weights: &mut core::Vector<f64>, hit_threshold: f64, win_stride: core::Size, padding: core::Size, scale: f64, group_threshold: f64, use_meanshift_grouping: bool) -> Result<()> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_detectMultiScale_const_const__InputArrayR_vectorLRectGR_vectorLdoubleGR_double_Size_Size_double_double_bool(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfRect(), found_weights.as_raw_mut_VectorOff64(), hit_threshold, win_stride.opencv_as_extern(), padding.opencv_as_extern(), scale, group_threshold, use_meanshift_grouping, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_multi_scale_weights_def(&self, img: &impl core::ToInputArray, found_locations: &mut core::Vector<core::Rect>, found_weights: &mut core::Vector<f64>) -> Result<()> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_detectMultiScale_const_const__InputArrayR_vectorLRectGR_vectorLdoubleGR(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfRect(), found_weights.as_raw_mut_VectorOff64(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_multi_scale(&self, img: &impl core::ToInputArray, found_locations: &mut core::Vector<core::Rect>, hit_threshold: f64, win_stride: core::Size, padding: core::Size, scale: f64, group_threshold: f64, use_meanshift_grouping: bool) -> Result<()> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_detectMultiScale_const_const__InputArrayR_vectorLRectGR_double_Size_Size_double_double_bool(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfRect(), hit_threshold, win_stride.opencv_as_extern(), padding.opencv_as_extern(), scale, group_threshold, use_meanshift_grouping, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_multi_scale_def(&self, img: &impl core::ToInputArray, found_locations: &mut core::Vector<core::Rect>) -> Result<()> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_detectMultiScale_const_const__InputArrayR_vectorLRectGR(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfRect(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn compute_gradient(&self, img: &impl core::ToInputArray, grad: &mut impl core::ToInputOutputArray, angle_ofs: &mut impl core::ToInputOutputArray, padding_tl: core::Size, padding_br: core::Size) -> Result<()> {
input_array_arg!(img);
input_output_array_arg!(grad);
input_output_array_arg!(angle_ofs);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_computeGradient_const_const__InputArrayR_const__InputOutputArrayR_const__InputOutputArrayR_Size_Size(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), grad.as_raw__InputOutputArray(), angle_ofs.as_raw__InputOutputArray(), padding_tl.opencv_as_extern(), padding_br.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn compute_gradient_def(&self, img: &impl core::ToInputArray, grad: &mut impl core::ToInputOutputArray, angle_ofs: &mut impl core::ToInputOutputArray) -> Result<()> {
input_array_arg!(img);
input_output_array_arg!(grad);
input_output_array_arg!(angle_ofs);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_computeGradient_const_const__InputArrayR_const__InputOutputArrayR_const__InputOutputArrayR(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), grad.as_raw__InputOutputArray(), angle_ofs.as_raw__InputOutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_roi(&self, img: &impl core::ToInputArray, locations: &core::Vector<core::Point>, found_locations: &mut core::Vector<core::Point>, confidences: &mut core::Vector<f64>, hit_threshold: f64, win_stride: core::Size, padding: core::Size) -> Result<()> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_detectROI_const_const__InputArrayR_const_vectorLPointGR_vectorLPointGR_vectorLdoubleGR_double_Size_Size(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), locations.as_raw_VectorOfPoint(), found_locations.as_raw_mut_VectorOfPoint(), confidences.as_raw_mut_VectorOff64(), hit_threshold, win_stride.opencv_as_extern(), padding.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_roi_def(&self, img: &impl core::ToInputArray, locations: &core::Vector<core::Point>, found_locations: &mut core::Vector<core::Point>, confidences: &mut core::Vector<f64>) -> Result<()> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_detectROI_const_const__InputArrayR_const_vectorLPointGR_vectorLPointGR_vectorLdoubleGR(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), locations.as_raw_VectorOfPoint(), found_locations.as_raw_mut_VectorOfPoint(), confidences.as_raw_mut_VectorOff64(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_multi_scale_roi(&self, img: &impl core::ToInputArray, found_locations: &mut core::Vector<core::Rect>, locations: &mut core::Vector<crate::objdetect::DetectionROI>, hit_threshold: f64, group_threshold: i32) -> Result<()> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_detectMultiScaleROI_const_const__InputArrayR_vectorLRectGR_vectorLDetectionROIGR_double_int(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfRect(), locations.as_raw_mut_VectorOfDetectionROI(), hit_threshold, group_threshold, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_multi_scale_roi_def(&self, img: &impl core::ToInputArray, found_locations: &mut core::Vector<core::Rect>, locations: &mut core::Vector<crate::objdetect::DetectionROI>) -> Result<()> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_detectMultiScaleROI_const_const__InputArrayR_vectorLRectGR_vectorLDetectionROIGR(self.as_raw_HOGDescriptor(), img.as_raw__InputArray(), found_locations.as_raw_mut_VectorOfRect(), locations.as_raw_mut_VectorOfDetectionROI(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn group_rectangles(&self, rect_list: &mut core::Vector<core::Rect>, weights: &mut core::Vector<f64>, group_threshold: i32, eps: f64) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_groupRectangles_const_vectorLRectGR_vectorLdoubleGR_int_double(self.as_raw_HOGDescriptor(), rect_list.as_raw_mut_VectorOfRect(), weights.as_raw_mut_VectorOff64(), group_threshold, eps, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait HOGDescriptorTrait: crate::objdetect::HOGDescriptorTraitConst {
fn as_raw_mut_HOGDescriptor(&mut self) -> *mut c_void;
#[inline]
fn set_win_size(&mut self, val: core::Size) {
let ret = unsafe { sys::cv_HOGDescriptor_propWinSize_const_Size(self.as_raw_mut_HOGDescriptor(), val.opencv_as_extern()) };
ret
}
#[inline]
fn set_block_size(&mut self, val: core::Size) {
let ret = unsafe { sys::cv_HOGDescriptor_propBlockSize_const_Size(self.as_raw_mut_HOGDescriptor(), val.opencv_as_extern()) };
ret
}
#[inline]
fn set_block_stride(&mut self, val: core::Size) {
let ret = unsafe { sys::cv_HOGDescriptor_propBlockStride_const_Size(self.as_raw_mut_HOGDescriptor(), val.opencv_as_extern()) };
ret
}
#[inline]
fn set_cell_size(&mut self, val: core::Size) {
let ret = unsafe { sys::cv_HOGDescriptor_propCellSize_const_Size(self.as_raw_mut_HOGDescriptor(), val.opencv_as_extern()) };
ret
}
#[inline]
fn set_nbins(&mut self, val: i32) {
let ret = unsafe { sys::cv_HOGDescriptor_propNbins_const_int(self.as_raw_mut_HOGDescriptor(), val) };
ret
}
#[inline]
fn set_deriv_aperture(&mut self, val: i32) {
let ret = unsafe { sys::cv_HOGDescriptor_propDerivAperture_const_int(self.as_raw_mut_HOGDescriptor(), val) };
ret
}
#[inline]
fn set_win_sigma(&mut self, val: f64) {
let ret = unsafe { sys::cv_HOGDescriptor_propWinSigma_const_double(self.as_raw_mut_HOGDescriptor(), val) };
ret
}
#[inline]
fn set_histogram_norm_type(&mut self, val: crate::objdetect::HOGDescriptor_HistogramNormType) {
let ret = unsafe { sys::cv_HOGDescriptor_propHistogramNormType_const_HistogramNormType(self.as_raw_mut_HOGDescriptor(), val) };
ret
}
#[inline]
fn set_l2_hys_threshold(&mut self, val: f64) {
let ret = unsafe { sys::cv_HOGDescriptor_propL2HysThreshold_const_double(self.as_raw_mut_HOGDescriptor(), val) };
ret
}
#[inline]
fn set_gamma_correction(&mut self, val: bool) {
let ret = unsafe { sys::cv_HOGDescriptor_propGammaCorrection_const_bool(self.as_raw_mut_HOGDescriptor(), val) };
ret
}
#[inline]
fn set_svm_detector_vec(&mut self, val: core::Vector<f32>) {
let ret = unsafe { sys::cv_HOGDescriptor_propSvmDetector_const_vectorLfloatG(self.as_raw_mut_HOGDescriptor(), val.as_raw_VectorOff32()) };
ret
}
#[inline]
fn set_ocl_svm_detector(&mut self, val: core::UMat) {
let ret = unsafe { sys::cv_HOGDescriptor_propOclSvmDetector_const_UMat(self.as_raw_mut_HOGDescriptor(), val.as_raw_UMat()) };
ret
}
#[inline]
fn set_free_coef(&mut self, val: f32) {
let ret = unsafe { sys::cv_HOGDescriptor_propFree_coef_const_float(self.as_raw_mut_HOGDescriptor(), val) };
ret
}
#[inline]
fn set_nlevels(&mut self, val: i32) {
let ret = unsafe { sys::cv_HOGDescriptor_propNlevels_const_int(self.as_raw_mut_HOGDescriptor(), val) };
ret
}
#[inline]
fn set_signed_gradient(&mut self, val: bool) {
let ret = unsafe { sys::cv_HOGDescriptor_propSignedGradient_const_bool(self.as_raw_mut_HOGDescriptor(), val) };
ret
}
#[inline]
fn set_svm_detector(&mut self, svmdetector: &impl core::ToInputArray) -> Result<()> {
input_array_arg!(svmdetector);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_setSVMDetector_const__InputArrayR(self.as_raw_mut_HOGDescriptor(), svmdetector.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn read(&mut self, fn_: &mut core::FileNode) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_read_FileNodeR(self.as_raw_mut_HOGDescriptor(), fn_.as_raw_mut_FileNode(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn load(&mut self, filename: &str, objname: &str) -> Result<bool> {
extern_container_arg!(filename);
extern_container_arg!(objname);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_load_const_StringR_const_StringR(self.as_raw_mut_HOGDescriptor(), filename.opencv_as_extern(), objname.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn load_def(&mut self, filename: &str) -> Result<bool> {
extern_container_arg!(filename);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_load_const_StringR(self.as_raw_mut_HOGDescriptor(), filename.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct HOGDescriptor {
ptr: *mut c_void
}
opencv_type_boxed! { HOGDescriptor }
impl Drop for HOGDescriptor {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_HOGDescriptor_delete(self.as_raw_mut_HOGDescriptor()) };
}
}
unsafe impl Send for HOGDescriptor {}
impl crate::objdetect::HOGDescriptorTraitConst for HOGDescriptor {
#[inline] fn as_raw_HOGDescriptor(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::HOGDescriptorTrait for HOGDescriptor {
#[inline] fn as_raw_mut_HOGDescriptor(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl HOGDescriptor {
#[inline]
pub fn default() -> Result<crate::objdetect::HOGDescriptor> {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_HOGDescriptor(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::HOGDescriptor::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn new(_win_size: core::Size, _block_size: core::Size, _block_stride: core::Size, _cell_size: core::Size, _nbins: i32, _deriv_aperture: i32, _win_sigma: f64, _histogram_norm_type: crate::objdetect::HOGDescriptor_HistogramNormType, _l2_hys_threshold: f64, _gamma_correction: bool, _nlevels: i32, _signed_gradient: bool) -> Result<crate::objdetect::HOGDescriptor> {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_HOGDescriptor_Size_Size_Size_Size_int_int_double_HistogramNormType_double_bool_int_bool(_win_size.opencv_as_extern(), _block_size.opencv_as_extern(), _block_stride.opencv_as_extern(), _cell_size.opencv_as_extern(), _nbins, _deriv_aperture, _win_sigma, _histogram_norm_type, _l2_hys_threshold, _gamma_correction, _nlevels, _signed_gradient, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::HOGDescriptor::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn new_def(_win_size: core::Size, _block_size: core::Size, _block_stride: core::Size, _cell_size: core::Size, _nbins: i32) -> Result<crate::objdetect::HOGDescriptor> {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_HOGDescriptor_Size_Size_Size_Size_int(_win_size.opencv_as_extern(), _block_size.opencv_as_extern(), _block_stride.opencv_as_extern(), _cell_size.opencv_as_extern(), _nbins, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::HOGDescriptor::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn new_from_file(filename: &str) -> Result<crate::objdetect::HOGDescriptor> {
extern_container_arg!(filename);
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_HOGDescriptor_const_StringR(filename.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::HOGDescriptor::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn copy(d: &crate::objdetect::HOGDescriptor) -> Result<crate::objdetect::HOGDescriptor> {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_HOGDescriptor_const_HOGDescriptorR(d.as_raw_HOGDescriptor(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::HOGDescriptor::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn get_default_people_detector() -> Result<core::Vector<f32>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_getDefaultPeopleDetector(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Vector::<f32>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn get_daimler_people_detector() -> Result<core::Vector<f32>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_HOGDescriptor_getDaimlerPeopleDetector(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Vector::<f32>::opencv_from_extern(ret) };
Ok(ret)
}
}
impl std::fmt::Debug for HOGDescriptor {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("HOGDescriptor")
.field("win_size", &crate::objdetect::HOGDescriptorTraitConst::win_size(self))
.field("block_size", &crate::objdetect::HOGDescriptorTraitConst::block_size(self))
.field("block_stride", &crate::objdetect::HOGDescriptorTraitConst::block_stride(self))
.field("cell_size", &crate::objdetect::HOGDescriptorTraitConst::cell_size(self))
.field("nbins", &crate::objdetect::HOGDescriptorTraitConst::nbins(self))
.field("deriv_aperture", &crate::objdetect::HOGDescriptorTraitConst::deriv_aperture(self))
.field("win_sigma", &crate::objdetect::HOGDescriptorTraitConst::win_sigma(self))
.field("histogram_norm_type", &crate::objdetect::HOGDescriptorTraitConst::histogram_norm_type(self))
.field("l2_hys_threshold", &crate::objdetect::HOGDescriptorTraitConst::l2_hys_threshold(self))
.field("gamma_correction", &crate::objdetect::HOGDescriptorTraitConst::gamma_correction(self))
.field("svm_detector", &crate::objdetect::HOGDescriptorTraitConst::svm_detector(self))
.field("ocl_svm_detector", &crate::objdetect::HOGDescriptorTraitConst::ocl_svm_detector(self))
.field("free_coef", &crate::objdetect::HOGDescriptorTraitConst::free_coef(self))
.field("nlevels", &crate::objdetect::HOGDescriptorTraitConst::nlevels(self))
.field("signed_gradient", &crate::objdetect::HOGDescriptorTraitConst::signed_gradient(self))
.finish()
}
}
pub trait QRCodeDetectorTraitConst: crate::objdetect::GraphicalCodeDetectorTraitConst {
fn as_raw_QRCodeDetector(&self) -> *const c_void;
}
pub trait QRCodeDetectorTrait: crate::objdetect::GraphicalCodeDetectorTrait + crate::objdetect::QRCodeDetectorTraitConst {
fn as_raw_mut_QRCodeDetector(&mut self) -> *mut c_void;
#[inline]
fn set_eps_x(&mut self, eps_x: f64) -> Result<crate::objdetect::QRCodeDetector> {
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeDetector_setEpsX_double(self.as_raw_mut_QRCodeDetector(), eps_x, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::QRCodeDetector::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn set_eps_y(&mut self, eps_y: f64) -> Result<crate::objdetect::QRCodeDetector> {
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeDetector_setEpsY_double(self.as_raw_mut_QRCodeDetector(), eps_y, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::QRCodeDetector::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn set_use_alignment_markers(&mut self, use_alignment_markers: bool) -> Result<crate::objdetect::QRCodeDetector> {
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeDetector_setUseAlignmentMarkers_bool(self.as_raw_mut_QRCodeDetector(), use_alignment_markers, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::QRCodeDetector::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn decode_curved(&mut self, img: &impl core::ToInputArray, points: &impl core::ToInputArray, straight_qrcode: &mut impl core::ToOutputArray) -> Result<Vec<u8>> {
input_array_arg!(img);
input_array_arg!(points);
output_array_arg!(straight_qrcode);
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeDetector_decodeCurved_const__InputArrayR_const__InputArrayR_const__OutputArrayR(self.as_raw_mut_QRCodeDetector(), img.as_raw__InputArray(), points.as_raw__InputArray(), straight_qrcode.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { Vec::<u8>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn decode_curved_def(&mut self, img: &impl core::ToInputArray, points: &impl core::ToInputArray) -> Result<Vec<u8>> {
input_array_arg!(img);
input_array_arg!(points);
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeDetector_decodeCurved_const__InputArrayR_const__InputArrayR(self.as_raw_mut_QRCodeDetector(), img.as_raw__InputArray(), points.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { Vec::<u8>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn detect_and_decode_curved(&mut self, img: &impl core::ToInputArray, points: &mut impl core::ToOutputArray, straight_qrcode: &mut impl core::ToOutputArray) -> Result<Vec<u8>> {
input_array_arg!(img);
output_array_arg!(points);
output_array_arg!(straight_qrcode);
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeDetector_detectAndDecodeCurved_const__InputArrayR_const__OutputArrayR_const__OutputArrayR(self.as_raw_mut_QRCodeDetector(), img.as_raw__InputArray(), points.as_raw__OutputArray(), straight_qrcode.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { Vec::<u8>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn detect_and_decode_curved_def(&mut self, img: &impl core::ToInputArray) -> Result<Vec<u8>> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeDetector_detectAndDecodeCurved_const__InputArrayR(self.as_raw_mut_QRCodeDetector(), img.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { Vec::<u8>::opencv_from_extern(ret) };
Ok(ret)
}
}
pub struct QRCodeDetector {
ptr: *mut c_void
}
opencv_type_boxed! { QRCodeDetector }
impl Drop for QRCodeDetector {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_QRCodeDetector_delete(self.as_raw_mut_QRCodeDetector()) };
}
}
unsafe impl Send for QRCodeDetector {}
impl crate::objdetect::GraphicalCodeDetectorTraitConst for QRCodeDetector {
#[inline] fn as_raw_GraphicalCodeDetector(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::GraphicalCodeDetectorTrait for QRCodeDetector {
#[inline] fn as_raw_mut_GraphicalCodeDetector(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::objdetect::QRCodeDetectorTraitConst for QRCodeDetector {
#[inline] fn as_raw_QRCodeDetector(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::QRCodeDetectorTrait for QRCodeDetector {
#[inline] fn as_raw_mut_QRCodeDetector(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl QRCodeDetector {
#[inline]
pub fn default() -> Result<crate::objdetect::QRCodeDetector> {
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeDetector_QRCodeDetector(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::QRCodeDetector::opencv_from_extern(ret) };
Ok(ret)
}
}
impl Clone for QRCodeDetector {
#[inline]
fn clone(&self) -> Self {
unsafe { Self::from_raw(sys::cv_QRCodeDetector_implicitClone_const(self.as_raw_QRCodeDetector())) }
}
}
boxed_cast_base! { QRCodeDetector, crate::objdetect::GraphicalCodeDetector, cv_QRCodeDetector_to_GraphicalCodeDetector }
impl std::fmt::Debug for QRCodeDetector {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("QRCodeDetector")
.finish()
}
}
pub trait QRCodeDetectorArucoTraitConst: crate::objdetect::GraphicalCodeDetectorTraitConst {
fn as_raw_QRCodeDetectorAruco(&self) -> *const c_void;
#[inline]
fn get_detector_parameters(&self) -> Result<crate::objdetect::QRCodeDetectorAruco_Params> {
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeDetectorAruco_getDetectorParameters_const(self.as_raw_QRCodeDetectorAruco(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait QRCodeDetectorArucoTrait: crate::objdetect::GraphicalCodeDetectorTrait + crate::objdetect::QRCodeDetectorArucoTraitConst {
fn as_raw_mut_QRCodeDetectorAruco(&mut self) -> *mut c_void;
#[inline]
fn set_detector_parameters(&mut self, params: crate::objdetect::QRCodeDetectorAruco_Params) -> Result<crate::objdetect::QRCodeDetectorAruco> {
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeDetectorAruco_setDetectorParameters_const_ParamsR(self.as_raw_mut_QRCodeDetectorAruco(), ¶ms, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::QRCodeDetectorAruco::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn get_aruco_parameters(&mut self) -> Result<crate::objdetect::DetectorParameters> {
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeDetectorAruco_getArucoParameters(self.as_raw_mut_QRCodeDetectorAruco(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::DetectorParameters::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn set_aruco_parameters(&mut self, params: &crate::objdetect::DetectorParameters) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeDetectorAruco_setArucoParameters_const_DetectorParametersR(self.as_raw_mut_QRCodeDetectorAruco(), params.as_raw_DetectorParameters(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct QRCodeDetectorAruco {
ptr: *mut c_void
}
opencv_type_boxed! { QRCodeDetectorAruco }
impl Drop for QRCodeDetectorAruco {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_QRCodeDetectorAruco_delete(self.as_raw_mut_QRCodeDetectorAruco()) };
}
}
unsafe impl Send for QRCodeDetectorAruco {}
impl crate::objdetect::GraphicalCodeDetectorTraitConst for QRCodeDetectorAruco {
#[inline] fn as_raw_GraphicalCodeDetector(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::GraphicalCodeDetectorTrait for QRCodeDetectorAruco {
#[inline] fn as_raw_mut_GraphicalCodeDetector(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::objdetect::QRCodeDetectorArucoTraitConst for QRCodeDetectorAruco {
#[inline] fn as_raw_QRCodeDetectorAruco(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::QRCodeDetectorArucoTrait for QRCodeDetectorAruco {
#[inline] fn as_raw_mut_QRCodeDetectorAruco(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl QRCodeDetectorAruco {
#[inline]
pub fn default() -> Result<crate::objdetect::QRCodeDetectorAruco> {
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeDetectorAruco_QRCodeDetectorAruco(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::QRCodeDetectorAruco::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn new(params: crate::objdetect::QRCodeDetectorAruco_Params) -> Result<crate::objdetect::QRCodeDetectorAruco> {
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeDetectorAruco_QRCodeDetectorAruco_const_ParamsR(¶ms, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::QRCodeDetectorAruco::opencv_from_extern(ret) };
Ok(ret)
}
}
impl Clone for QRCodeDetectorAruco {
#[inline]
fn clone(&self) -> Self {
unsafe { Self::from_raw(sys::cv_QRCodeDetectorAruco_implicitClone_const(self.as_raw_QRCodeDetectorAruco())) }
}
}
boxed_cast_base! { QRCodeDetectorAruco, crate::objdetect::GraphicalCodeDetector, cv_QRCodeDetectorAruco_to_GraphicalCodeDetector }
impl std::fmt::Debug for QRCodeDetectorAruco {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("QRCodeDetectorAruco")
.finish()
}
}
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct QRCodeDetectorAruco_Params {
pub min_module_size_in_pyramid: f32,
pub max_rotation: f32,
pub max_module_size_mismatch: f32,
pub max_timing_pattern_mismatch: f32,
pub max_penalties: f32,
pub max_colors_mismatch: f32,
pub scale_timing_pattern_score: f32,
}
opencv_type_simple! { crate::objdetect::QRCodeDetectorAruco_Params }
impl QRCodeDetectorAruco_Params {
#[inline]
pub fn default() -> Result<crate::objdetect::QRCodeDetectorAruco_Params> {
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeDetectorAruco_Params_Params(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait QRCodeEncoderTraitConst {
fn as_raw_QRCodeEncoder(&self) -> *const c_void;
}
pub trait QRCodeEncoderTrait: crate::objdetect::QRCodeEncoderTraitConst {
fn as_raw_mut_QRCodeEncoder(&mut self) -> *mut c_void;
#[inline]
fn encode(&mut self, encoded_info: &str, qrcode: &mut impl core::ToOutputArray) -> Result<()> {
extern_container_arg!(encoded_info);
output_array_arg!(qrcode);
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeEncoder_encode_const_StringR_const__OutputArrayR(self.as_raw_mut_QRCodeEncoder(), encoded_info.opencv_as_extern(), qrcode.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn encode_structured_append(&mut self, encoded_info: &str, qrcodes: &mut impl core::ToOutputArray) -> Result<()> {
extern_container_arg!(encoded_info);
output_array_arg!(qrcodes);
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeEncoder_encodeStructuredAppend_const_StringR_const__OutputArrayR(self.as_raw_mut_QRCodeEncoder(), encoded_info.opencv_as_extern(), qrcodes.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct QRCodeEncoder {
ptr: *mut c_void
}
opencv_type_boxed! { QRCodeEncoder }
impl Drop for QRCodeEncoder {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_QRCodeEncoder_delete(self.as_raw_mut_QRCodeEncoder()) };
}
}
unsafe impl Send for QRCodeEncoder {}
impl crate::objdetect::QRCodeEncoderTraitConst for QRCodeEncoder {
#[inline] fn as_raw_QRCodeEncoder(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::QRCodeEncoderTrait for QRCodeEncoder {
#[inline] fn as_raw_mut_QRCodeEncoder(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl QRCodeEncoder {
#[inline]
pub fn create(parameters: crate::objdetect::QRCodeEncoder_Params) -> Result<core::Ptr<crate::objdetect::QRCodeEncoder>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeEncoder_create_const_ParamsR(¶meters, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<crate::objdetect::QRCodeEncoder>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn create_def() -> Result<core::Ptr<crate::objdetect::QRCodeEncoder>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeEncoder_create(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Ptr::<crate::objdetect::QRCodeEncoder>::opencv_from_extern(ret) };
Ok(ret)
}
}
impl std::fmt::Debug for QRCodeEncoder {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("QRCodeEncoder")
.finish()
}
}
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct QRCodeEncoder_Params {
pub version: i32,
pub correction_level: crate::objdetect::QRCodeEncoder_CorrectionLevel,
pub mode: crate::objdetect::QRCodeEncoder_EncodeMode,
pub structure_number: i32,
}
opencv_type_simple! { crate::objdetect::QRCodeEncoder_Params }
impl QRCodeEncoder_Params {
#[inline]
pub fn default() -> Result<crate::objdetect::QRCodeEncoder_Params> {
return_send!(via ocvrs_return);
unsafe { sys::cv_QRCodeEncoder_Params_Params(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait SimilarRectsTraitConst {
fn as_raw_SimilarRects(&self) -> *const c_void;
#[inline]
fn eps(&self) -> f64 {
let ret = unsafe { sys::cv_SimilarRects_propEps_const(self.as_raw_SimilarRects()) };
ret
}
#[inline]
fn apply(&self, r1: core::Rect, r2: core::Rect) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_SimilarRects_operator___const_const_RectR_const_RectR(self.as_raw_SimilarRects(), &r1, &r2, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait SimilarRectsTrait: crate::objdetect::SimilarRectsTraitConst {
fn as_raw_mut_SimilarRects(&mut self) -> *mut c_void;
#[inline]
fn set_eps(&mut self, val: f64) {
let ret = unsafe { sys::cv_SimilarRects_propEps_const_double(self.as_raw_mut_SimilarRects(), val) };
ret
}
}
pub struct SimilarRects {
ptr: *mut c_void
}
opencv_type_boxed! { SimilarRects }
impl Drop for SimilarRects {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_SimilarRects_delete(self.as_raw_mut_SimilarRects()) };
}
}
unsafe impl Send for SimilarRects {}
impl crate::objdetect::SimilarRectsTraitConst for SimilarRects {
#[inline] fn as_raw_SimilarRects(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::SimilarRectsTrait for SimilarRects {
#[inline] fn as_raw_mut_SimilarRects(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl SimilarRects {
#[inline]
pub fn new(_eps: f64) -> Result<crate::objdetect::SimilarRects> {
return_send!(via ocvrs_return);
unsafe { sys::cv_SimilarRects_SimilarRects_double(_eps, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::SimilarRects::opencv_from_extern(ret) };
Ok(ret)
}
}
impl std::fmt::Debug for SimilarRects {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("SimilarRects")
.field("eps", &crate::objdetect::SimilarRectsTraitConst::eps(self))
.finish()
}
}
pub trait ArucoDetectorTraitConst: core::AlgorithmTraitConst {
fn as_raw_ArucoDetector(&self) -> *const c_void;
#[inline]
fn detect_markers(&self, image: &impl core::ToInputArray, corners: &mut impl core::ToOutputArray, ids: &mut impl core::ToOutputArray, rejected_img_points: &mut impl core::ToOutputArray) -> Result<()> {
input_array_arg!(image);
output_array_arg!(corners);
output_array_arg!(ids);
output_array_arg!(rejected_img_points);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_ArucoDetector_detectMarkers_const_const__InputArrayR_const__OutputArrayR_const__OutputArrayR_const__OutputArrayR(self.as_raw_ArucoDetector(), image.as_raw__InputArray(), corners.as_raw__OutputArray(), ids.as_raw__OutputArray(), rejected_img_points.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_markers_def(&self, image: &impl core::ToInputArray, corners: &mut impl core::ToOutputArray, ids: &mut impl core::ToOutputArray) -> Result<()> {
input_array_arg!(image);
output_array_arg!(corners);
output_array_arg!(ids);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_ArucoDetector_detectMarkers_const_const__InputArrayR_const__OutputArrayR_const__OutputArrayR(self.as_raw_ArucoDetector(), image.as_raw__InputArray(), corners.as_raw__OutputArray(), ids.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn refine_detected_markers(&self, image: &impl core::ToInputArray, board: &crate::objdetect::Board, detected_corners: &mut impl core::ToInputOutputArray, detected_ids: &mut impl core::ToInputOutputArray, rejected_corners: &mut impl core::ToInputOutputArray, camera_matrix: &impl core::ToInputArray, dist_coeffs: &impl core::ToInputArray, recovered_idxs: &mut impl core::ToOutputArray) -> Result<()> {
input_array_arg!(image);
input_output_array_arg!(detected_corners);
input_output_array_arg!(detected_ids);
input_output_array_arg!(rejected_corners);
input_array_arg!(camera_matrix);
input_array_arg!(dist_coeffs);
output_array_arg!(recovered_idxs);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_ArucoDetector_refineDetectedMarkers_const_const__InputArrayR_const_BoardR_const__InputOutputArrayR_const__InputOutputArrayR_const__InputOutputArrayR_const__InputArrayR_const__InputArrayR_const__OutputArrayR(self.as_raw_ArucoDetector(), image.as_raw__InputArray(), board.as_raw_Board(), detected_corners.as_raw__InputOutputArray(), detected_ids.as_raw__InputOutputArray(), rejected_corners.as_raw__InputOutputArray(), camera_matrix.as_raw__InputArray(), dist_coeffs.as_raw__InputArray(), recovered_idxs.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn refine_detected_markers_def(&self, image: &impl core::ToInputArray, board: &crate::objdetect::Board, detected_corners: &mut impl core::ToInputOutputArray, detected_ids: &mut impl core::ToInputOutputArray, rejected_corners: &mut impl core::ToInputOutputArray) -> Result<()> {
input_array_arg!(image);
input_output_array_arg!(detected_corners);
input_output_array_arg!(detected_ids);
input_output_array_arg!(rejected_corners);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_ArucoDetector_refineDetectedMarkers_const_const__InputArrayR_const_BoardR_const__InputOutputArrayR_const__InputOutputArrayR_const__InputOutputArrayR(self.as_raw_ArucoDetector(), image.as_raw__InputArray(), board.as_raw_Board(), detected_corners.as_raw__InputOutputArray(), detected_ids.as_raw__InputOutputArray(), rejected_corners.as_raw__InputOutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_dictionary(&self) -> Result<crate::objdetect::Dictionary> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_ArucoDetector_getDictionary_const(self.as_raw_ArucoDetector(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::Dictionary::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn get_detector_parameters(&self) -> Result<crate::objdetect::DetectorParameters> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_ArucoDetector_getDetectorParameters_const(self.as_raw_ArucoDetector(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::DetectorParameters::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn get_refine_parameters(&self) -> Result<crate::objdetect::RefineParameters> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_ArucoDetector_getRefineParameters_const(self.as_raw_ArucoDetector(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn write(&self, fs: &mut core::FileStorage) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_ArucoDetector_write_const_FileStorageR(self.as_raw_ArucoDetector(), fs.as_raw_mut_FileStorage(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait ArucoDetectorTrait: core::AlgorithmTrait + crate::objdetect::ArucoDetectorTraitConst {
fn as_raw_mut_ArucoDetector(&mut self) -> *mut c_void;
#[inline]
fn set_dictionary(&mut self, dictionary: &crate::objdetect::Dictionary) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_ArucoDetector_setDictionary_const_DictionaryR(self.as_raw_mut_ArucoDetector(), dictionary.as_raw_Dictionary(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_detector_parameters(&mut self, detector_parameters: &crate::objdetect::DetectorParameters) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_ArucoDetector_setDetectorParameters_const_DetectorParametersR(self.as_raw_mut_ArucoDetector(), detector_parameters.as_raw_DetectorParameters(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_refine_parameters(&mut self, refine_parameters: crate::objdetect::RefineParameters) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_ArucoDetector_setRefineParameters_const_RefineParametersR(self.as_raw_mut_ArucoDetector(), &refine_parameters, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn write_1(&mut self, fs: &mut core::FileStorage, name: &str) -> Result<()> {
extern_container_arg!(name);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_ArucoDetector_write_FileStorageR_const_StringR(self.as_raw_mut_ArucoDetector(), fs.as_raw_mut_FileStorage(), name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn read(&mut self, fn_: &core::FileNode) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_ArucoDetector_read_const_FileNodeR(self.as_raw_mut_ArucoDetector(), fn_.as_raw_FileNode(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct ArucoDetector {
ptr: *mut c_void
}
opencv_type_boxed! { ArucoDetector }
impl Drop for ArucoDetector {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_aruco_ArucoDetector_delete(self.as_raw_mut_ArucoDetector()) };
}
}
unsafe impl Send for ArucoDetector {}
impl core::AlgorithmTraitConst for ArucoDetector {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
}
impl core::AlgorithmTrait for ArucoDetector {
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::objdetect::ArucoDetectorTraitConst for ArucoDetector {
#[inline] fn as_raw_ArucoDetector(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::ArucoDetectorTrait for ArucoDetector {
#[inline] fn as_raw_mut_ArucoDetector(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl ArucoDetector {
#[inline]
pub fn new(dictionary: &crate::objdetect::Dictionary, detector_params: &crate::objdetect::DetectorParameters, refine_params: crate::objdetect::RefineParameters) -> Result<crate::objdetect::ArucoDetector> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_ArucoDetector_ArucoDetector_const_DictionaryR_const_DetectorParametersR_const_RefineParametersR(dictionary.as_raw_Dictionary(), detector_params.as_raw_DetectorParameters(), &refine_params, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::ArucoDetector::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn new_def() -> Result<crate::objdetect::ArucoDetector> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_ArucoDetector_ArucoDetector(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::ArucoDetector::opencv_from_extern(ret) };
Ok(ret)
}
}
boxed_cast_base! { ArucoDetector, core::Algorithm, cv_aruco_ArucoDetector_to_Algorithm }
impl std::fmt::Debug for ArucoDetector {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("ArucoDetector")
.finish()
}
}
pub trait BoardTraitConst {
fn as_raw_Board(&self) -> *const c_void;
#[inline]
fn get_dictionary(&self) -> Result<crate::objdetect::Dictionary> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Board_getDictionary_const(self.as_raw_Board(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::Dictionary::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn get_obj_points(&self) -> Result<core::Vector<core::Vector<core::Point3f>>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Board_getObjPoints_const(self.as_raw_Board(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Vector::<core::Vector<core::Point3f>>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn get_ids(&self) -> Result<core::Vector<i32>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Board_getIds_const(self.as_raw_Board(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Vector::<i32>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn get_right_bottom_corner(&self) -> Result<core::Point3f> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Board_getRightBottomCorner_const(self.as_raw_Board(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn match_image_points(&self, detected_corners: &impl core::ToInputArray, detected_ids: &impl core::ToInputArray, obj_points: &mut impl core::ToOutputArray, img_points: &mut impl core::ToOutputArray) -> Result<()> {
input_array_arg!(detected_corners);
input_array_arg!(detected_ids);
output_array_arg!(obj_points);
output_array_arg!(img_points);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Board_matchImagePoints_const_const__InputArrayR_const__InputArrayR_const__OutputArrayR_const__OutputArrayR(self.as_raw_Board(), detected_corners.as_raw__InputArray(), detected_ids.as_raw__InputArray(), obj_points.as_raw__OutputArray(), img_points.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn generate_image(&self, out_size: core::Size, img: &mut impl core::ToOutputArray, margin_size: i32, border_bits: i32) -> Result<()> {
output_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Board_generateImage_const_Size_const__OutputArrayR_int_int(self.as_raw_Board(), out_size.opencv_as_extern(), img.as_raw__OutputArray(), margin_size, border_bits, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn generate_image_def(&self, out_size: core::Size, img: &mut impl core::ToOutputArray) -> Result<()> {
output_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Board_generateImage_const_Size_const__OutputArrayR(self.as_raw_Board(), out_size.opencv_as_extern(), img.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait BoardTrait: crate::objdetect::BoardTraitConst {
fn as_raw_mut_Board(&mut self) -> *mut c_void;
}
pub struct Board {
ptr: *mut c_void
}
opencv_type_boxed! { Board }
impl Drop for Board {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_aruco_Board_delete(self.as_raw_mut_Board()) };
}
}
unsafe impl Send for Board {}
impl crate::objdetect::BoardTraitConst for Board {
#[inline] fn as_raw_Board(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::BoardTrait for Board {
#[inline] fn as_raw_mut_Board(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl Board {
#[inline]
pub fn new(obj_points: &impl core::ToInputArray, dictionary: &crate::objdetect::Dictionary, ids: &impl core::ToInputArray) -> Result<crate::objdetect::Board> {
input_array_arg!(obj_points);
input_array_arg!(ids);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Board_Board_const__InputArrayR_const_DictionaryR_const__InputArrayR(obj_points.as_raw__InputArray(), dictionary.as_raw_Dictionary(), ids.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::Board::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn default() -> Result<crate::objdetect::Board> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Board_Board(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::Board::opencv_from_extern(ret) };
Ok(ret)
}
}
impl Clone for Board {
#[inline]
fn clone(&self) -> Self {
unsafe { Self::from_raw(sys::cv_aruco_Board_implicitClone_const(self.as_raw_Board())) }
}
}
impl std::fmt::Debug for Board {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("Board")
.finish()
}
}
pub trait CharucoBoardTraitConst: crate::objdetect::BoardTraitConst {
fn as_raw_CharucoBoard(&self) -> *const c_void;
#[inline]
fn get_legacy_pattern(&self) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoBoard_getLegacyPattern_const(self.as_raw_CharucoBoard(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_chessboard_size(&self) -> Result<core::Size> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoBoard_getChessboardSize_const(self.as_raw_CharucoBoard(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_square_length(&self) -> Result<f32> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoBoard_getSquareLength_const(self.as_raw_CharucoBoard(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_marker_length(&self) -> Result<f32> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoBoard_getMarkerLength_const(self.as_raw_CharucoBoard(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_chessboard_corners(&self) -> Result<core::Vector<core::Point3f>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoBoard_getChessboardCorners_const(self.as_raw_CharucoBoard(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Vector::<core::Point3f>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn get_nearest_marker_idx(&self) -> Result<core::Vector<core::Vector<i32>>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoBoard_getNearestMarkerIdx_const(self.as_raw_CharucoBoard(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Vector::<core::Vector<i32>>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn get_nearest_marker_corners(&self) -> Result<core::Vector<core::Vector<i32>>> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoBoard_getNearestMarkerCorners_const(self.as_raw_CharucoBoard(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Vector::<core::Vector<i32>>::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn check_charuco_corners_collinear(&self, charuco_ids: &impl core::ToInputArray) -> Result<bool> {
input_array_arg!(charuco_ids);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoBoard_checkCharucoCornersCollinear_const_const__InputArrayR(self.as_raw_CharucoBoard(), charuco_ids.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait CharucoBoardTrait: crate::objdetect::BoardTrait + crate::objdetect::CharucoBoardTraitConst {
fn as_raw_mut_CharucoBoard(&mut self) -> *mut c_void;
#[inline]
fn set_legacy_pattern(&mut self, legacy_pattern: bool) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoBoard_setLegacyPattern_bool(self.as_raw_mut_CharucoBoard(), legacy_pattern, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct CharucoBoard {
ptr: *mut c_void
}
opencv_type_boxed! { CharucoBoard }
impl Drop for CharucoBoard {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_aruco_CharucoBoard_delete(self.as_raw_mut_CharucoBoard()) };
}
}
unsafe impl Send for CharucoBoard {}
impl crate::objdetect::BoardTraitConst for CharucoBoard {
#[inline] fn as_raw_Board(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::BoardTrait for CharucoBoard {
#[inline] fn as_raw_mut_Board(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::objdetect::CharucoBoardTraitConst for CharucoBoard {
#[inline] fn as_raw_CharucoBoard(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::CharucoBoardTrait for CharucoBoard {
#[inline] fn as_raw_mut_CharucoBoard(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl CharucoBoard {
#[inline]
pub fn new(size: core::Size, square_length: f32, marker_length: f32, dictionary: &crate::objdetect::Dictionary, ids: &impl core::ToInputArray) -> Result<crate::objdetect::CharucoBoard> {
input_array_arg!(ids);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoBoard_CharucoBoard_const_SizeR_float_float_const_DictionaryR_const__InputArrayR(&size, square_length, marker_length, dictionary.as_raw_Dictionary(), ids.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::CharucoBoard::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn new_def(size: core::Size, square_length: f32, marker_length: f32, dictionary: &crate::objdetect::Dictionary) -> Result<crate::objdetect::CharucoBoard> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoBoard_CharucoBoard_const_SizeR_float_float_const_DictionaryR(&size, square_length, marker_length, dictionary.as_raw_Dictionary(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::CharucoBoard::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn default() -> Result<crate::objdetect::CharucoBoard> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoBoard_CharucoBoard(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::CharucoBoard::opencv_from_extern(ret) };
Ok(ret)
}
}
impl Clone for CharucoBoard {
#[inline]
fn clone(&self) -> Self {
unsafe { Self::from_raw(sys::cv_aruco_CharucoBoard_implicitClone_const(self.as_raw_CharucoBoard())) }
}
}
boxed_cast_base! { CharucoBoard, crate::objdetect::Board, cv_aruco_CharucoBoard_to_Board }
impl std::fmt::Debug for CharucoBoard {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CharucoBoard")
.finish()
}
}
pub trait CharucoDetectorTraitConst: core::AlgorithmTraitConst {
fn as_raw_CharucoDetector(&self) -> *const c_void;
#[inline]
fn get_board(&self) -> Result<crate::objdetect::CharucoBoard> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoDetector_getBoard_const(self.as_raw_CharucoDetector(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::CharucoBoard::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn get_charuco_parameters(&self) -> Result<crate::objdetect::CharucoParameters> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoDetector_getCharucoParameters_const(self.as_raw_CharucoDetector(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::CharucoParameters::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn get_detector_parameters(&self) -> Result<crate::objdetect::DetectorParameters> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoDetector_getDetectorParameters_const(self.as_raw_CharucoDetector(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::DetectorParameters::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
fn get_refine_parameters(&self) -> Result<crate::objdetect::RefineParameters> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoDetector_getRefineParameters_const(self.as_raw_CharucoDetector(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_board(&self, image: &impl core::ToInputArray, charuco_corners: &mut impl core::ToOutputArray, charuco_ids: &mut impl core::ToOutputArray, marker_corners: &mut impl core::ToInputOutputArray, marker_ids: &mut impl core::ToInputOutputArray) -> Result<()> {
input_array_arg!(image);
output_array_arg!(charuco_corners);
output_array_arg!(charuco_ids);
input_output_array_arg!(marker_corners);
input_output_array_arg!(marker_ids);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoDetector_detectBoard_const_const__InputArrayR_const__OutputArrayR_const__OutputArrayR_const__InputOutputArrayR_const__InputOutputArrayR(self.as_raw_CharucoDetector(), image.as_raw__InputArray(), charuco_corners.as_raw__OutputArray(), charuco_ids.as_raw__OutputArray(), marker_corners.as_raw__InputOutputArray(), marker_ids.as_raw__InputOutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_board_def(&self, image: &impl core::ToInputArray, charuco_corners: &mut impl core::ToOutputArray, charuco_ids: &mut impl core::ToOutputArray) -> Result<()> {
input_array_arg!(image);
output_array_arg!(charuco_corners);
output_array_arg!(charuco_ids);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoDetector_detectBoard_const_const__InputArrayR_const__OutputArrayR_const__OutputArrayR(self.as_raw_CharucoDetector(), image.as_raw__InputArray(), charuco_corners.as_raw__OutputArray(), charuco_ids.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_diamonds(&self, image: &impl core::ToInputArray, diamond_corners: &mut impl core::ToOutputArray, diamond_ids: &mut impl core::ToOutputArray, marker_corners: &mut impl core::ToInputOutputArray, marker_ids: &mut impl core::ToInputOutputArray) -> Result<()> {
input_array_arg!(image);
output_array_arg!(diamond_corners);
output_array_arg!(diamond_ids);
input_output_array_arg!(marker_corners);
input_output_array_arg!(marker_ids);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoDetector_detectDiamonds_const_const__InputArrayR_const__OutputArrayR_const__OutputArrayR_const__InputOutputArrayR_const__InputOutputArrayR(self.as_raw_CharucoDetector(), image.as_raw__InputArray(), diamond_corners.as_raw__OutputArray(), diamond_ids.as_raw__OutputArray(), marker_corners.as_raw__InputOutputArray(), marker_ids.as_raw__InputOutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_diamonds_def(&self, image: &impl core::ToInputArray, diamond_corners: &mut impl core::ToOutputArray, diamond_ids: &mut impl core::ToOutputArray) -> Result<()> {
input_array_arg!(image);
output_array_arg!(diamond_corners);
output_array_arg!(diamond_ids);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoDetector_detectDiamonds_const_const__InputArrayR_const__OutputArrayR_const__OutputArrayR(self.as_raw_CharucoDetector(), image.as_raw__InputArray(), diamond_corners.as_raw__OutputArray(), diamond_ids.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait CharucoDetectorTrait: core::AlgorithmTrait + crate::objdetect::CharucoDetectorTraitConst {
fn as_raw_mut_CharucoDetector(&mut self) -> *mut c_void;
#[inline]
fn set_board(&mut self, board: &crate::objdetect::CharucoBoard) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoDetector_setBoard_const_CharucoBoardR(self.as_raw_mut_CharucoDetector(), board.as_raw_CharucoBoard(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_charuco_parameters(&mut self, charuco_parameters: &mut crate::objdetect::CharucoParameters) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoDetector_setCharucoParameters_CharucoParametersR(self.as_raw_mut_CharucoDetector(), charuco_parameters.as_raw_mut_CharucoParameters(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_detector_parameters(&mut self, detector_parameters: &crate::objdetect::DetectorParameters) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoDetector_setDetectorParameters_const_DetectorParametersR(self.as_raw_mut_CharucoDetector(), detector_parameters.as_raw_DetectorParameters(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn set_refine_parameters(&mut self, refine_parameters: crate::objdetect::RefineParameters) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoDetector_setRefineParameters_const_RefineParametersR(self.as_raw_mut_CharucoDetector(), &refine_parameters, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct CharucoDetector {
ptr: *mut c_void
}
opencv_type_boxed! { CharucoDetector }
impl Drop for CharucoDetector {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_aruco_CharucoDetector_delete(self.as_raw_mut_CharucoDetector()) };
}
}
unsafe impl Send for CharucoDetector {}
impl core::AlgorithmTraitConst for CharucoDetector {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.as_raw() }
}
impl core::AlgorithmTrait for CharucoDetector {
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::objdetect::CharucoDetectorTraitConst for CharucoDetector {
#[inline] fn as_raw_CharucoDetector(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::CharucoDetectorTrait for CharucoDetector {
#[inline] fn as_raw_mut_CharucoDetector(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl CharucoDetector {
#[inline]
pub fn new(board: &crate::objdetect::CharucoBoard, charuco_params: &crate::objdetect::CharucoParameters, detector_params: &crate::objdetect::DetectorParameters, refine_params: crate::objdetect::RefineParameters) -> Result<crate::objdetect::CharucoDetector> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoDetector_CharucoDetector_const_CharucoBoardR_const_CharucoParametersR_const_DetectorParametersR_const_RefineParametersR(board.as_raw_CharucoBoard(), charuco_params.as_raw_CharucoParameters(), detector_params.as_raw_DetectorParameters(), &refine_params, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::CharucoDetector::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn new_def(board: &crate::objdetect::CharucoBoard) -> Result<crate::objdetect::CharucoDetector> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoDetector_CharucoDetector_const_CharucoBoardR(board.as_raw_CharucoBoard(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::CharucoDetector::opencv_from_extern(ret) };
Ok(ret)
}
}
boxed_cast_base! { CharucoDetector, core::Algorithm, cv_aruco_CharucoDetector_to_Algorithm }
impl std::fmt::Debug for CharucoDetector {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CharucoDetector")
.finish()
}
}
pub trait CharucoParametersTraitConst {
fn as_raw_CharucoParameters(&self) -> *const c_void;
#[inline]
fn camera_matrix(&self) -> core::Mat {
let ret = unsafe { sys::cv_aruco_CharucoParameters_propCameraMatrix_const(self.as_raw_CharucoParameters()) };
let ret = unsafe { core::Mat::opencv_from_extern(ret) };
ret
}
#[inline]
fn dist_coeffs(&self) -> core::Mat {
let ret = unsafe { sys::cv_aruco_CharucoParameters_propDistCoeffs_const(self.as_raw_CharucoParameters()) };
let ret = unsafe { core::Mat::opencv_from_extern(ret) };
ret
}
#[inline]
fn min_markers(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_CharucoParameters_propMinMarkers_const(self.as_raw_CharucoParameters()) };
ret
}
#[inline]
fn try_refine_markers(&self) -> bool {
let ret = unsafe { sys::cv_aruco_CharucoParameters_propTryRefineMarkers_const(self.as_raw_CharucoParameters()) };
ret
}
}
pub trait CharucoParametersTrait: crate::objdetect::CharucoParametersTraitConst {
fn as_raw_mut_CharucoParameters(&mut self) -> *mut c_void;
#[inline]
fn set_camera_matrix(&mut self, val: core::Mat) {
let ret = unsafe { sys::cv_aruco_CharucoParameters_propCameraMatrix_const_Mat(self.as_raw_mut_CharucoParameters(), val.as_raw_Mat()) };
ret
}
#[inline]
fn set_dist_coeffs(&mut self, val: core::Mat) {
let ret = unsafe { sys::cv_aruco_CharucoParameters_propDistCoeffs_const_Mat(self.as_raw_mut_CharucoParameters(), val.as_raw_Mat()) };
ret
}
#[inline]
fn set_min_markers(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_CharucoParameters_propMinMarkers_const_int(self.as_raw_mut_CharucoParameters(), val) };
ret
}
#[inline]
fn set_try_refine_markers(&mut self, val: bool) {
let ret = unsafe { sys::cv_aruco_CharucoParameters_propTryRefineMarkers_const_bool(self.as_raw_mut_CharucoParameters(), val) };
ret
}
}
pub struct CharucoParameters {
ptr: *mut c_void
}
opencv_type_boxed! { CharucoParameters }
impl Drop for CharucoParameters {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_aruco_CharucoParameters_delete(self.as_raw_mut_CharucoParameters()) };
}
}
unsafe impl Send for CharucoParameters {}
impl crate::objdetect::CharucoParametersTraitConst for CharucoParameters {
#[inline] fn as_raw_CharucoParameters(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::CharucoParametersTrait for CharucoParameters {
#[inline] fn as_raw_mut_CharucoParameters(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl CharucoParameters {
#[inline]
pub fn default() -> Result<crate::objdetect::CharucoParameters> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_CharucoParameters_CharucoParameters(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::CharucoParameters::opencv_from_extern(ret) };
Ok(ret)
}
}
impl Clone for CharucoParameters {
#[inline]
fn clone(&self) -> Self {
unsafe { Self::from_raw(sys::cv_aruco_CharucoParameters_implicitClone_const(self.as_raw_CharucoParameters())) }
}
}
impl std::fmt::Debug for CharucoParameters {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("CharucoParameters")
.field("camera_matrix", &crate::objdetect::CharucoParametersTraitConst::camera_matrix(self))
.field("dist_coeffs", &crate::objdetect::CharucoParametersTraitConst::dist_coeffs(self))
.field("min_markers", &crate::objdetect::CharucoParametersTraitConst::min_markers(self))
.field("try_refine_markers", &crate::objdetect::CharucoParametersTraitConst::try_refine_markers(self))
.finish()
}
}
pub trait DetectorParametersTraitConst {
fn as_raw_DetectorParameters(&self) -> *const c_void;
#[inline]
fn adaptive_thresh_win_size_min(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAdaptiveThreshWinSizeMin_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn adaptive_thresh_win_size_max(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAdaptiveThreshWinSizeMax_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn adaptive_thresh_win_size_step(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAdaptiveThreshWinSizeStep_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn adaptive_thresh_constant(&self) -> f64 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAdaptiveThreshConstant_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn min_marker_perimeter_rate(&self) -> f64 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMinMarkerPerimeterRate_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn max_marker_perimeter_rate(&self) -> f64 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMaxMarkerPerimeterRate_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn polygonal_approx_accuracy_rate(&self) -> f64 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propPolygonalApproxAccuracyRate_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn min_corner_distance_rate(&self) -> f64 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMinCornerDistanceRate_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn min_distance_to_border(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMinDistanceToBorder_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn min_marker_distance_rate(&self) -> f64 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMinMarkerDistanceRate_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn corner_refinement_method(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propCornerRefinementMethod_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn corner_refinement_win_size(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propCornerRefinementWinSize_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn corner_refinement_max_iterations(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propCornerRefinementMaxIterations_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn corner_refinement_min_accuracy(&self) -> f64 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propCornerRefinementMinAccuracy_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn marker_border_bits(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMarkerBorderBits_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn perspective_remove_pixel_per_cell(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propPerspectiveRemovePixelPerCell_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn perspective_remove_ignored_margin_per_cell(&self) -> f64 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propPerspectiveRemoveIgnoredMarginPerCell_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn max_erroneous_bits_in_border_rate(&self) -> f64 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMaxErroneousBitsInBorderRate_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn min_otsu_std_dev(&self) -> f64 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMinOtsuStdDev_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn error_correction_rate(&self) -> f64 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propErrorCorrectionRate_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn april_tag_quad_decimate(&self) -> f32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagQuadDecimate_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn april_tag_quad_sigma(&self) -> f32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagQuadSigma_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn april_tag_min_cluster_pixels(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagMinClusterPixels_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn april_tag_max_nmaxima(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagMaxNmaxima_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn april_tag_critical_rad(&self) -> f32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagCriticalRad_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn april_tag_max_line_fit_mse(&self) -> f32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagMaxLineFitMse_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn april_tag_min_white_black_diff(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagMinWhiteBlackDiff_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn april_tag_deglitch(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagDeglitch_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn detect_inverted_marker(&self) -> bool {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propDetectInvertedMarker_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn use_aruco3_detection(&self) -> bool {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propUseAruco3Detection_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn min_side_length_canonical_img(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMinSideLengthCanonicalImg_const(self.as_raw_DetectorParameters()) };
ret
}
#[inline]
fn min_marker_length_ratio_original_img(&self) -> f32 {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMinMarkerLengthRatioOriginalImg_const(self.as_raw_DetectorParameters()) };
ret
}
}
pub trait DetectorParametersTrait: crate::objdetect::DetectorParametersTraitConst {
fn as_raw_mut_DetectorParameters(&mut self) -> *mut c_void;
#[inline]
fn set_adaptive_thresh_win_size_min(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAdaptiveThreshWinSizeMin_const_int(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_adaptive_thresh_win_size_max(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAdaptiveThreshWinSizeMax_const_int(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_adaptive_thresh_win_size_step(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAdaptiveThreshWinSizeStep_const_int(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_adaptive_thresh_constant(&mut self, val: f64) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAdaptiveThreshConstant_const_double(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_min_marker_perimeter_rate(&mut self, val: f64) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMinMarkerPerimeterRate_const_double(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_max_marker_perimeter_rate(&mut self, val: f64) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMaxMarkerPerimeterRate_const_double(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_polygonal_approx_accuracy_rate(&mut self, val: f64) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propPolygonalApproxAccuracyRate_const_double(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_min_corner_distance_rate(&mut self, val: f64) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMinCornerDistanceRate_const_double(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_min_distance_to_border(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMinDistanceToBorder_const_int(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_min_marker_distance_rate(&mut self, val: f64) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMinMarkerDistanceRate_const_double(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_corner_refinement_method(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propCornerRefinementMethod_const_int(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_corner_refinement_win_size(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propCornerRefinementWinSize_const_int(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_corner_refinement_max_iterations(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propCornerRefinementMaxIterations_const_int(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_corner_refinement_min_accuracy(&mut self, val: f64) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propCornerRefinementMinAccuracy_const_double(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_marker_border_bits(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMarkerBorderBits_const_int(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_perspective_remove_pixel_per_cell(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propPerspectiveRemovePixelPerCell_const_int(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_perspective_remove_ignored_margin_per_cell(&mut self, val: f64) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propPerspectiveRemoveIgnoredMarginPerCell_const_double(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_max_erroneous_bits_in_border_rate(&mut self, val: f64) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMaxErroneousBitsInBorderRate_const_double(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_min_otsu_std_dev(&mut self, val: f64) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMinOtsuStdDev_const_double(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_error_correction_rate(&mut self, val: f64) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propErrorCorrectionRate_const_double(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_april_tag_quad_decimate(&mut self, val: f32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagQuadDecimate_const_float(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_april_tag_quad_sigma(&mut self, val: f32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagQuadSigma_const_float(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_april_tag_min_cluster_pixels(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagMinClusterPixels_const_int(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_april_tag_max_nmaxima(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagMaxNmaxima_const_int(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_april_tag_critical_rad(&mut self, val: f32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagCriticalRad_const_float(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_april_tag_max_line_fit_mse(&mut self, val: f32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagMaxLineFitMse_const_float(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_april_tag_min_white_black_diff(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagMinWhiteBlackDiff_const_int(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_april_tag_deglitch(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propAprilTagDeglitch_const_int(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_detect_inverted_marker(&mut self, val: bool) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propDetectInvertedMarker_const_bool(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_use_aruco3_detection(&mut self, val: bool) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propUseAruco3Detection_const_bool(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_min_side_length_canonical_img(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMinSideLengthCanonicalImg_const_int(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn set_min_marker_length_ratio_original_img(&mut self, val: f32) {
let ret = unsafe { sys::cv_aruco_DetectorParameters_propMinMarkerLengthRatioOriginalImg_const_float(self.as_raw_mut_DetectorParameters(), val) };
ret
}
#[inline]
fn read_detector_parameters(&mut self, fn_: &core::FileNode) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_DetectorParameters_readDetectorParameters_const_FileNodeR(self.as_raw_mut_DetectorParameters(), fn_.as_raw_FileNode(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn write_detector_parameters(&mut self, fs: &mut core::FileStorage, name: &str) -> Result<bool> {
extern_container_arg!(name);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_DetectorParameters_writeDetectorParameters_FileStorageR_const_StringR(self.as_raw_mut_DetectorParameters(), fs.as_raw_mut_FileStorage(), name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn write_detector_parameters_def(&mut self, fs: &mut core::FileStorage) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_DetectorParameters_writeDetectorParameters_FileStorageR(self.as_raw_mut_DetectorParameters(), fs.as_raw_mut_FileStorage(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct DetectorParameters {
ptr: *mut c_void
}
opencv_type_boxed! { DetectorParameters }
impl Drop for DetectorParameters {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_aruco_DetectorParameters_delete(self.as_raw_mut_DetectorParameters()) };
}
}
unsafe impl Send for DetectorParameters {}
impl crate::objdetect::DetectorParametersTraitConst for DetectorParameters {
#[inline] fn as_raw_DetectorParameters(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::DetectorParametersTrait for DetectorParameters {
#[inline] fn as_raw_mut_DetectorParameters(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl DetectorParameters {
#[inline]
pub fn default() -> Result<crate::objdetect::DetectorParameters> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_DetectorParameters_DetectorParameters(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::DetectorParameters::opencv_from_extern(ret) };
Ok(ret)
}
}
impl Clone for DetectorParameters {
#[inline]
fn clone(&self) -> Self {
unsafe { Self::from_raw(sys::cv_aruco_DetectorParameters_implicitClone_const(self.as_raw_DetectorParameters())) }
}
}
impl std::fmt::Debug for DetectorParameters {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("DetectorParameters")
.field("adaptive_thresh_win_size_min", &crate::objdetect::DetectorParametersTraitConst::adaptive_thresh_win_size_min(self))
.field("adaptive_thresh_win_size_max", &crate::objdetect::DetectorParametersTraitConst::adaptive_thresh_win_size_max(self))
.field("adaptive_thresh_win_size_step", &crate::objdetect::DetectorParametersTraitConst::adaptive_thresh_win_size_step(self))
.field("adaptive_thresh_constant", &crate::objdetect::DetectorParametersTraitConst::adaptive_thresh_constant(self))
.field("min_marker_perimeter_rate", &crate::objdetect::DetectorParametersTraitConst::min_marker_perimeter_rate(self))
.field("max_marker_perimeter_rate", &crate::objdetect::DetectorParametersTraitConst::max_marker_perimeter_rate(self))
.field("polygonal_approx_accuracy_rate", &crate::objdetect::DetectorParametersTraitConst::polygonal_approx_accuracy_rate(self))
.field("min_corner_distance_rate", &crate::objdetect::DetectorParametersTraitConst::min_corner_distance_rate(self))
.field("min_distance_to_border", &crate::objdetect::DetectorParametersTraitConst::min_distance_to_border(self))
.field("min_marker_distance_rate", &crate::objdetect::DetectorParametersTraitConst::min_marker_distance_rate(self))
.field("corner_refinement_method", &crate::objdetect::DetectorParametersTraitConst::corner_refinement_method(self))
.field("corner_refinement_win_size", &crate::objdetect::DetectorParametersTraitConst::corner_refinement_win_size(self))
.field("corner_refinement_max_iterations", &crate::objdetect::DetectorParametersTraitConst::corner_refinement_max_iterations(self))
.field("corner_refinement_min_accuracy", &crate::objdetect::DetectorParametersTraitConst::corner_refinement_min_accuracy(self))
.field("marker_border_bits", &crate::objdetect::DetectorParametersTraitConst::marker_border_bits(self))
.field("perspective_remove_pixel_per_cell", &crate::objdetect::DetectorParametersTraitConst::perspective_remove_pixel_per_cell(self))
.field("perspective_remove_ignored_margin_per_cell", &crate::objdetect::DetectorParametersTraitConst::perspective_remove_ignored_margin_per_cell(self))
.field("max_erroneous_bits_in_border_rate", &crate::objdetect::DetectorParametersTraitConst::max_erroneous_bits_in_border_rate(self))
.field("min_otsu_std_dev", &crate::objdetect::DetectorParametersTraitConst::min_otsu_std_dev(self))
.field("error_correction_rate", &crate::objdetect::DetectorParametersTraitConst::error_correction_rate(self))
.field("april_tag_quad_decimate", &crate::objdetect::DetectorParametersTraitConst::april_tag_quad_decimate(self))
.field("april_tag_quad_sigma", &crate::objdetect::DetectorParametersTraitConst::april_tag_quad_sigma(self))
.field("april_tag_min_cluster_pixels", &crate::objdetect::DetectorParametersTraitConst::april_tag_min_cluster_pixels(self))
.field("april_tag_max_nmaxima", &crate::objdetect::DetectorParametersTraitConst::april_tag_max_nmaxima(self))
.field("april_tag_critical_rad", &crate::objdetect::DetectorParametersTraitConst::april_tag_critical_rad(self))
.field("april_tag_max_line_fit_mse", &crate::objdetect::DetectorParametersTraitConst::april_tag_max_line_fit_mse(self))
.field("april_tag_min_white_black_diff", &crate::objdetect::DetectorParametersTraitConst::april_tag_min_white_black_diff(self))
.field("april_tag_deglitch", &crate::objdetect::DetectorParametersTraitConst::april_tag_deglitch(self))
.field("detect_inverted_marker", &crate::objdetect::DetectorParametersTraitConst::detect_inverted_marker(self))
.field("use_aruco3_detection", &crate::objdetect::DetectorParametersTraitConst::use_aruco3_detection(self))
.field("min_side_length_canonical_img", &crate::objdetect::DetectorParametersTraitConst::min_side_length_canonical_img(self))
.field("min_marker_length_ratio_original_img", &crate::objdetect::DetectorParametersTraitConst::min_marker_length_ratio_original_img(self))
.finish()
}
}
pub trait DictionaryTraitConst {
fn as_raw_Dictionary(&self) -> *const c_void;
#[inline]
fn bytes_list(&self) -> core::Mat {
let ret = unsafe { sys::cv_aruco_Dictionary_propBytesList_const(self.as_raw_Dictionary()) };
let ret = unsafe { core::Mat::opencv_from_extern(ret) };
ret
}
#[inline]
fn marker_size(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_Dictionary_propMarkerSize_const(self.as_raw_Dictionary()) };
ret
}
#[inline]
fn max_correction_bits(&self) -> i32 {
let ret = unsafe { sys::cv_aruco_Dictionary_propMaxCorrectionBits_const(self.as_raw_Dictionary()) };
ret
}
#[inline]
fn identify(&self, only_bits: &core::Mat, idx: &mut i32, rotation: &mut i32, max_correction_rate: f64) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Dictionary_identify_const_const_MatR_intR_intR_double(self.as_raw_Dictionary(), only_bits.as_raw_Mat(), idx, rotation, max_correction_rate, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_distance_to_id(&self, bits: &impl core::ToInputArray, id: i32, all_rotations: bool) -> Result<i32> {
input_array_arg!(bits);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Dictionary_getDistanceToId_const_const__InputArrayR_int_bool(self.as_raw_Dictionary(), bits.as_raw__InputArray(), id, all_rotations, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_distance_to_id_def(&self, bits: &impl core::ToInputArray, id: i32) -> Result<i32> {
input_array_arg!(bits);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Dictionary_getDistanceToId_const_const__InputArrayR_int(self.as_raw_Dictionary(), bits.as_raw__InputArray(), id, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn generate_image_marker(&self, id: i32, side_pixels: i32, _img: &mut impl core::ToOutputArray, border_bits: i32) -> Result<()> {
output_array_arg!(_img);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Dictionary_generateImageMarker_const_int_int_const__OutputArrayR_int(self.as_raw_Dictionary(), id, side_pixels, _img.as_raw__OutputArray(), border_bits, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn generate_image_marker_def(&self, id: i32, side_pixels: i32, _img: &mut impl core::ToOutputArray) -> Result<()> {
output_array_arg!(_img);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Dictionary_generateImageMarker_const_int_int_const__OutputArrayR(self.as_raw_Dictionary(), id, side_pixels, _img.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait DictionaryTrait: crate::objdetect::DictionaryTraitConst {
fn as_raw_mut_Dictionary(&mut self) -> *mut c_void;
#[inline]
fn set_bytes_list(&mut self, val: core::Mat) {
let ret = unsafe { sys::cv_aruco_Dictionary_propBytesList_const_Mat(self.as_raw_mut_Dictionary(), val.as_raw_Mat()) };
ret
}
#[inline]
fn set_marker_size(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_Dictionary_propMarkerSize_const_int(self.as_raw_mut_Dictionary(), val) };
ret
}
#[inline]
fn set_max_correction_bits(&mut self, val: i32) {
let ret = unsafe { sys::cv_aruco_Dictionary_propMaxCorrectionBits_const_int(self.as_raw_mut_Dictionary(), val) };
ret
}
#[inline]
fn read_dictionary(&mut self, fn_: &core::FileNode) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Dictionary_readDictionary_const_FileNodeR(self.as_raw_mut_Dictionary(), fn_.as_raw_FileNode(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn write_dictionary(&mut self, fs: &mut core::FileStorage, name: &str) -> Result<()> {
extern_container_arg!(name);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Dictionary_writeDictionary_FileStorageR_const_StringR(self.as_raw_mut_Dictionary(), fs.as_raw_mut_FileStorage(), name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn write_dictionary_def(&mut self, fs: &mut core::FileStorage) -> Result<()> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Dictionary_writeDictionary_FileStorageR(self.as_raw_mut_Dictionary(), fs.as_raw_mut_FileStorage(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub struct Dictionary {
ptr: *mut c_void
}
opencv_type_boxed! { Dictionary }
impl Drop for Dictionary {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_aruco_Dictionary_delete(self.as_raw_mut_Dictionary()) };
}
}
unsafe impl Send for Dictionary {}
impl crate::objdetect::DictionaryTraitConst for Dictionary {
#[inline] fn as_raw_Dictionary(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::DictionaryTrait for Dictionary {
#[inline] fn as_raw_mut_Dictionary(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl Dictionary {
#[inline]
pub fn default() -> Result<crate::objdetect::Dictionary> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Dictionary_Dictionary(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::Dictionary::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn new(bytes_list: &core::Mat, _marker_size: i32, maxcorr: i32) -> Result<crate::objdetect::Dictionary> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Dictionary_Dictionary_const_MatR_int_int(bytes_list.as_raw_Mat(), _marker_size, maxcorr, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::Dictionary::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn new_def(bytes_list: &core::Mat, _marker_size: i32) -> Result<crate::objdetect::Dictionary> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Dictionary_Dictionary_const_MatR_int(bytes_list.as_raw_Mat(), _marker_size, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::Dictionary::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn get_byte_list_from_bits(bits: &core::Mat) -> Result<core::Mat> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Dictionary_getByteListFromBits_const_MatR(bits.as_raw_Mat(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Mat::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn get_bits_from_byte_list(byte_list: &core::Mat, marker_size: i32) -> Result<core::Mat> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_Dictionary_getBitsFromByteList_const_MatR_int(byte_list.as_raw_Mat(), marker_size, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { core::Mat::opencv_from_extern(ret) };
Ok(ret)
}
}
impl Clone for Dictionary {
#[inline]
fn clone(&self) -> Self {
unsafe { Self::from_raw(sys::cv_aruco_Dictionary_implicitClone_const(self.as_raw_Dictionary())) }
}
}
impl std::fmt::Debug for Dictionary {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("Dictionary")
.field("bytes_list", &crate::objdetect::DictionaryTraitConst::bytes_list(self))
.field("marker_size", &crate::objdetect::DictionaryTraitConst::marker_size(self))
.field("max_correction_bits", &crate::objdetect::DictionaryTraitConst::max_correction_bits(self))
.finish()
}
}
pub trait GridBoardTraitConst: crate::objdetect::BoardTraitConst {
fn as_raw_GridBoard(&self) -> *const c_void;
#[inline]
fn get_grid_size(&self) -> Result<core::Size> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_GridBoard_getGridSize_const(self.as_raw_GridBoard(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_marker_length(&self) -> Result<f32> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_GridBoard_getMarkerLength_const(self.as_raw_GridBoard(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn get_marker_separation(&self) -> Result<f32> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_GridBoard_getMarkerSeparation_const(self.as_raw_GridBoard(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait GridBoardTrait: crate::objdetect::BoardTrait + crate::objdetect::GridBoardTraitConst {
fn as_raw_mut_GridBoard(&mut self) -> *mut c_void;
}
pub struct GridBoard {
ptr: *mut c_void
}
opencv_type_boxed! { GridBoard }
impl Drop for GridBoard {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_aruco_GridBoard_delete(self.as_raw_mut_GridBoard()) };
}
}
unsafe impl Send for GridBoard {}
impl crate::objdetect::BoardTraitConst for GridBoard {
#[inline] fn as_raw_Board(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::BoardTrait for GridBoard {
#[inline] fn as_raw_mut_Board(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::objdetect::GridBoardTraitConst for GridBoard {
#[inline] fn as_raw_GridBoard(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::GridBoardTrait for GridBoard {
#[inline] fn as_raw_mut_GridBoard(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl GridBoard {
#[inline]
pub fn new(size: core::Size, marker_length: f32, marker_separation: f32, dictionary: &crate::objdetect::Dictionary, ids: &impl core::ToInputArray) -> Result<crate::objdetect::GridBoard> {
input_array_arg!(ids);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_GridBoard_GridBoard_const_SizeR_float_float_const_DictionaryR_const__InputArrayR(&size, marker_length, marker_separation, dictionary.as_raw_Dictionary(), ids.as_raw__InputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::GridBoard::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn new_def(size: core::Size, marker_length: f32, marker_separation: f32, dictionary: &crate::objdetect::Dictionary) -> Result<crate::objdetect::GridBoard> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_GridBoard_GridBoard_const_SizeR_float_float_const_DictionaryR(&size, marker_length, marker_separation, dictionary.as_raw_Dictionary(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::GridBoard::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn default() -> Result<crate::objdetect::GridBoard> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_GridBoard_GridBoard(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::GridBoard::opencv_from_extern(ret) };
Ok(ret)
}
}
impl Clone for GridBoard {
#[inline]
fn clone(&self) -> Self {
unsafe { Self::from_raw(sys::cv_aruco_GridBoard_implicitClone_const(self.as_raw_GridBoard())) }
}
}
boxed_cast_base! { GridBoard, crate::objdetect::Board, cv_aruco_GridBoard_to_Board }
impl std::fmt::Debug for GridBoard {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("GridBoard")
.finish()
}
}
#[repr(C)]
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct RefineParameters {
pub min_rep_distance: f32,
pub error_correction_rate: f32,
pub check_all_orders: bool,
}
opencv_type_simple! { crate::objdetect::RefineParameters }
impl RefineParameters {
#[inline]
pub fn new(min_rep_distance: f32, error_correction_rate: f32, check_all_orders: bool) -> Result<crate::objdetect::RefineParameters> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_RefineParameters_RefineParameters_float_float_bool(min_rep_distance, error_correction_rate, check_all_orders, ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn new_def() -> Result<crate::objdetect::RefineParameters> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_RefineParameters_RefineParameters(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn read_refine_parameters(self, fn_: &core::FileNode) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_RefineParameters_readRefineParameters_const_FileNodeR(self.opencv_as_extern(), fn_.as_raw_FileNode(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn write_refine_parameters(self, fs: &mut core::FileStorage, name: &str) -> Result<bool> {
extern_container_arg!(name);
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_RefineParameters_writeRefineParameters_FileStorageR_const_StringR(self.opencv_as_extern(), fs.as_raw_mut_FileStorage(), name.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
pub fn write_refine_parameters_def(self, fs: &mut core::FileStorage) -> Result<bool> {
return_send!(via ocvrs_return);
unsafe { sys::cv_aruco_RefineParameters_writeRefineParameters_FileStorageR(self.opencv_as_extern(), fs.as_raw_mut_FileStorage(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait BarcodeDetectorTraitConst: crate::objdetect::GraphicalCodeDetectorTraitConst {
fn as_raw_BarcodeDetector(&self) -> *const c_void;
#[inline]
fn decode_with_type(&self, img: &impl core::ToInputArray, points: &impl core::ToInputArray, decoded_info: &mut core::Vector<String>, decoded_type: &mut core::Vector<String>) -> Result<bool> {
input_array_arg!(img);
input_array_arg!(points);
return_send!(via ocvrs_return);
unsafe { sys::cv_barcode_BarcodeDetector_decodeWithType_const_const__InputArrayR_const__InputArrayR_vectorLstringGR_vectorLstringGR(self.as_raw_BarcodeDetector(), img.as_raw__InputArray(), points.as_raw__InputArray(), decoded_info.as_raw_mut_VectorOfString(), decoded_type.as_raw_mut_VectorOfString(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_and_decode_with_type(&self, img: &impl core::ToInputArray, decoded_info: &mut core::Vector<String>, decoded_type: &mut core::Vector<String>, points: &mut impl core::ToOutputArray) -> Result<bool> {
input_array_arg!(img);
output_array_arg!(points);
return_send!(via ocvrs_return);
unsafe { sys::cv_barcode_BarcodeDetector_detectAndDecodeWithType_const_const__InputArrayR_vectorLstringGR_vectorLstringGR_const__OutputArrayR(self.as_raw_BarcodeDetector(), img.as_raw__InputArray(), decoded_info.as_raw_mut_VectorOfString(), decoded_type.as_raw_mut_VectorOfString(), points.as_raw__OutputArray(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
#[inline]
fn detect_and_decode_with_type_def(&self, img: &impl core::ToInputArray, decoded_info: &mut core::Vector<String>, decoded_type: &mut core::Vector<String>) -> Result<bool> {
input_array_arg!(img);
return_send!(via ocvrs_return);
unsafe { sys::cv_barcode_BarcodeDetector_detectAndDecodeWithType_const_const__InputArrayR_vectorLstringGR_vectorLstringGR(self.as_raw_BarcodeDetector(), img.as_raw__InputArray(), decoded_info.as_raw_mut_VectorOfString(), decoded_type.as_raw_mut_VectorOfString(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
Ok(ret)
}
}
pub trait BarcodeDetectorTrait: crate::objdetect::BarcodeDetectorTraitConst + crate::objdetect::GraphicalCodeDetectorTrait {
fn as_raw_mut_BarcodeDetector(&mut self) -> *mut c_void;
}
pub struct BarcodeDetector {
ptr: *mut c_void
}
opencv_type_boxed! { BarcodeDetector }
impl Drop for BarcodeDetector {
#[inline]
fn drop(&mut self) {
unsafe { sys::cv_barcode_BarcodeDetector_delete(self.as_raw_mut_BarcodeDetector()) };
}
}
unsafe impl Send for BarcodeDetector {}
impl crate::objdetect::GraphicalCodeDetectorTraitConst for BarcodeDetector {
#[inline] fn as_raw_GraphicalCodeDetector(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::GraphicalCodeDetectorTrait for BarcodeDetector {
#[inline] fn as_raw_mut_GraphicalCodeDetector(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl crate::objdetect::BarcodeDetectorTraitConst for BarcodeDetector {
#[inline] fn as_raw_BarcodeDetector(&self) -> *const c_void { self.as_raw() }
}
impl crate::objdetect::BarcodeDetectorTrait for BarcodeDetector {
#[inline] fn as_raw_mut_BarcodeDetector(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl BarcodeDetector {
#[inline]
pub fn default() -> Result<crate::objdetect::BarcodeDetector> {
return_send!(via ocvrs_return);
unsafe { sys::cv_barcode_BarcodeDetector_BarcodeDetector(ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::BarcodeDetector::opencv_from_extern(ret) };
Ok(ret)
}
#[inline]
pub fn new(prototxt_path: &str, model_path: &str) -> Result<crate::objdetect::BarcodeDetector> {
extern_container_arg!(prototxt_path);
extern_container_arg!(model_path);
return_send!(via ocvrs_return);
unsafe { sys::cv_barcode_BarcodeDetector_BarcodeDetector_const_stringR_const_stringR(prototxt_path.opencv_as_extern(), model_path.opencv_as_extern(), ocvrs_return.as_mut_ptr()) };
return_receive!(unsafe ocvrs_return => ret);
let ret = ret.into_result()?;
let ret = unsafe { crate::objdetect::BarcodeDetector::opencv_from_extern(ret) };
Ok(ret)
}
}
impl Clone for BarcodeDetector {
#[inline]
fn clone(&self) -> Self {
unsafe { Self::from_raw(sys::cv_barcode_BarcodeDetector_implicitClone_const(self.as_raw_BarcodeDetector())) }
}
}
boxed_cast_base! { BarcodeDetector, crate::objdetect::GraphicalCodeDetector, cv_barcode_BarcodeDetector_to_GraphicalCodeDetector }
impl std::fmt::Debug for BarcodeDetector {
#[inline]
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.debug_struct("BarcodeDetector")
.finish()
}
}
}