//! <script type="text/javascript" src="http://latex.codecogs.com/latexit.js"></script>
//! Core functionality
//!
//! # Core functionality
//! @{
//! Basic structures
//!
//! # Basic structures
//! C structures and operations
//!
//! # C structures and operations
//! @{
//! Connections with C++
//!
//! # Connections with C++
//! @}
//! Operations on arrays
//!
//! # Operations on arrays
//! XML/YAML Persistence
//!
//! # XML/YAML Persistence
//! Clustering
//!
//! # Clustering
//! Utility and system functions and macros
//!
//! # Utility and system functions and macros
//! @{
//! SSE utilities
//!
//! # SSE utilities
//! NEON utilities
//!
//! # NEON utilities
//! Softfloat support
//!
//! # Softfloat support
//! Utility functions for OpenCV samples
//!
//! # Utility functions for OpenCV samples
//! @}
//! OpenGL interoperability
//!
//! # OpenGL interoperability
//! Intel IPP Asynchronous C/C++ Converters
//!
//! # Intel IPP Asynchronous C/C++ Converters
//! Optimization Algorithms
//!
//! # Optimization Algorithms
//! DirectX interoperability
//!
//! # DirectX interoperability
//! Eigen support
//!
//! # Eigen support
//! OpenCL support
//!
//! # OpenCL support
//! Intel VA-API/OpenCL (CL-VA) interoperability
//!
//! # Intel VA-API/OpenCL (CL-VA) interoperability
//! Hardware Acceleration Layer
//!
//! # Hardware Acceleration Layer
//! @{
//! Functions
//!
//! # Functions
//! Interface
//!
//! # Interface
//! Universal intrinsics
//!
//! # Universal intrinsics
//! @{
//! Private implementation helpers
//!
//! # Private implementation helpers
//! @}
//! @}
//! @}
use std::os::raw::{c_char, c_void};
use libc::size_t;
use crate::{Error, Result, core, sys, types};
pub const ACCESS_FAST: i32 = 1<<26;
pub const ACCESS_MASK: i32 = 3<<24;
pub const ACCESS_READ: i32 = 1<<24;
pub const ACCESS_RW: i32 = 3<<24;
pub const ACCESS_WRITE: i32 = 1<<25;
pub const ADAPTIVE_THRESH_GAUSSIAN_C: i32 = 1;
pub const ADAPTIVE_THRESH_MEAN_C: i32 = 0;
pub const AKAZE_DESCRIPTOR_KAZE: i32 = 3;
pub const AKAZE_DESCRIPTOR_KAZE_UPRIGHT: i32 = 2;
pub const AKAZE_DESCRIPTOR_MLDB: i32 = 5;
pub const AKAZE_DESCRIPTOR_MLDB_UPRIGHT: i32 = 4;
pub const ANN_MLP_ANNEAL: i32 = 2;
pub const ANN_MLP_BACKPROP: i32 = 0;
pub const ANN_MLP_GAUSSIAN: i32 = 2;
pub const ANN_MLP_IDENTITY: i32 = 0;
pub const ANN_MLP_LEAKYRELU: i32 = 4;
pub const ANN_MLP_NO_INPUT_SCALE: i32 = 2;
pub const ANN_MLP_NO_OUTPUT_SCALE: i32 = 4;
pub const ANN_MLP_RELU: i32 = 3;
pub const ANN_MLP_RPROP: i32 = 1;
pub const ANN_MLP_SIGMOID_SYM: i32 = 1;
pub const ANN_MLP_UPDATE_WEIGHTS: i32 = 1;
pub const AgastFeatureDetector_AGAST_5_8: i32 = 0;
pub const AgastFeatureDetector_AGAST_7_12d: i32 = 1;
pub const AgastFeatureDetector_AGAST_7_12s: i32 = 2;
pub const AgastFeatureDetector_OAST_9_16: i32 = 3;
pub const BORDER_CONSTANT: i32 = 0;
pub const BORDER_DEFAULT: i32 = 4;
pub const BORDER_ISOLATED: i32 = 16;
pub const BORDER_REFLECT: i32 = 2;
pub const BORDER_REFLECT101: i32 = 4;
pub const BORDER_REFLECT_101: i32 = 4;
pub const BORDER_REPLICATE: i32 = 1;
pub const BORDER_TRANSPARENT: i32 = 5;
pub const BORDER_WRAP: i32 = 3;
pub const BadAlign: i32 = -21;
pub const BadAlphaChannel: i32 = -18;
pub const BadCOI: i32 = -24;
pub const BadCallBack: i32 = -22;
pub const BadDataPtr: i32 = -12;
pub const BadDepth: i32 = -17;
pub const BadImageSize: i32 = -10;
pub const BadModelOrChSeq: i32 = -14;
pub const BadNumChannel1U: i32 = -16;
pub const BadNumChannels: i32 = -15;
pub const BadOffset: i32 = -11;
pub const BadOrder: i32 = -19;
pub const BadOrigin: i32 = -20;
pub const BadROISize: i32 = -25;
pub const BadStep: i32 = -13;
pub const BadTileSize: i32 = -23;
pub const Boost_DISCRETE: i32 = 0;
pub const Boost_GENTLE: i32 = 3;
pub const Boost_LOGIT: i32 = 2;
pub const CALIB_CB_ADAPTIVE_THRESH: i32 = 1;
pub const CALIB_CB_ASYMMETRIC_GRID: i32 = 2;
pub const CALIB_CB_CLUSTERING: i32 = 4;
pub const CALIB_CB_FAST_CHECK: i32 = 8;
pub const CALIB_CB_FILTER_QUADS: i32 = 4;
pub const CALIB_CB_NORMALIZE_IMAGE: i32 = 2;
pub const CALIB_CB_SYMMETRIC_GRID: i32 = 1;
pub const CALIB_CHECK_COND: i32 = 1 << 2;
pub const CALIB_FIX_ASPECT_RATIO: i32 = 0x00002;
pub const CALIB_FIX_FOCAL_LENGTH: i32 = 0x00010;
pub const CALIB_FIX_INTRINSIC: i32 = 0x00100;
pub const CALIB_FIX_K1: i32 = 0x00020;
pub const CALIB_FIX_K2: i32 = 0x00040;
pub const CALIB_FIX_K3: i32 = 0x00080;
pub const CALIB_FIX_K4: i32 = 0x00800;
pub const CALIB_FIX_K5: i32 = 0x01000;
pub const CALIB_FIX_K6: i32 = 0x02000;
pub const CALIB_FIX_PRINCIPAL_POINT: i32 = 0x00004;
pub const CALIB_FIX_S1_S2_S3_S4: i32 = 0x10000;
pub const CALIB_FIX_SKEW: i32 = 1 << 3;
pub const CALIB_FIX_TANGENT_DIST: i32 = 0x200000;
pub const CALIB_FIX_TAUX_TAUY: i32 = 0x80000;
pub const CALIB_RATIONAL_MODEL: i32 = 0x04000;
pub const CALIB_RECOMPUTE_EXTRINSIC: i32 = 1 << 1;
pub const CALIB_SAME_FOCAL_LENGTH: i32 = 0x00200;
pub const CALIB_THIN_PRISM_MODEL: i32 = 0x08000;
pub const CALIB_TILTED_MODEL: i32 = 0x40000;
pub const CALIB_USE_EXTRINSIC_GUESS: i32 = (1 << 22);
pub const CALIB_USE_INTRINSIC_GUESS: i32 = 0x00001;
pub const CALIB_USE_LU: i32 = (1 << 17);
pub const CALIB_USE_QR: i32 = 0x100000;
pub const CALIB_ZERO_DISPARITY: i32 = 0x00400;
pub const CALIB_ZERO_TANGENT_DIST: i32 = 0x00008;
pub const CAP_ANDROID: i32 = 1000;
pub const CAP_ANY: i32 = 0;
pub const CAP_ARAVIS: i32 = 2100;
pub const CAP_AVFOUNDATION: i32 = 1200;
pub const CAP_CMU1394: i32 = 300;
pub const CAP_DC1394: i32 = 300;
pub const CAP_DSHOW: i32 = 700;
pub const CAP_FFMPEG: i32 = 1900;
pub const CAP_FIREWARE: i32 = 300;
pub const CAP_FIREWIRE: i32 = 300;
pub const CAP_GIGANETIX: i32 = 1300;
pub const CAP_GPHOTO2: i32 = 1700;
pub const CAP_GSTREAMER: i32 = 1800;
pub const CAP_IEEE1394: i32 = 300;
pub const CAP_IMAGES: i32 = 2000;
pub const CAP_INTELPERC: i32 = 1500;
pub const CAP_INTELPERC_DEPTH_GENERATOR: i32 = 1 << 29;
pub const CAP_INTELPERC_DEPTH_MAP: i32 = 0;
pub const CAP_INTELPERC_IMAGE: i32 = 3;
pub const CAP_INTELPERC_IMAGE_GENERATOR: i32 = 1 << 28;
pub const CAP_INTELPERC_IR_MAP: i32 = 2;
pub const CAP_INTELPERC_UVDEPTH_MAP: i32 = 1;
pub const CAP_INTEL_MFX: i32 = 2300;
pub const CAP_MODE_BGR: i32 = 0;
pub const CAP_MODE_GRAY: i32 = 2;
pub const CAP_MODE_RGB: i32 = 1;
pub const CAP_MODE_YUYV: i32 = 3;
pub const CAP_MSMF: i32 = 1400;
pub const CAP_OPENCV_MJPEG: i32 = 2200;
pub const CAP_OPENNI: i32 = 900;
pub const CAP_OPENNI2: i32 = 1600;
pub const CAP_OPENNI2_ASUS: i32 = 1610;
pub const CAP_OPENNI_ASUS: i32 = 910;
pub const CAP_OPENNI_BGR_IMAGE: i32 = 5;
pub const CAP_OPENNI_DEPTH_GENERATOR: i32 = 1 << 31;
pub const CAP_OPENNI_DEPTH_MAP: i32 = 0;
pub const CAP_OPENNI_DISPARITY_MAP: i32 = 2;
pub const CAP_OPENNI_DISPARITY_MAP_32F: i32 = 3;
pub const CAP_OPENNI_GRAY_IMAGE: i32 = 6;
pub const CAP_OPENNI_IMAGE_GENERATOR: i32 = 1 << 30;
pub const CAP_OPENNI_IR_GENERATOR: i32 = 1 << 29;
pub const CAP_OPENNI_IR_IMAGE: i32 = 7;
pub const CAP_OPENNI_POINT_CLOUD_MAP: i32 = 1;
pub const CAP_OPENNI_QVGA_30HZ: i32 = 3;
pub const CAP_OPENNI_QVGA_60HZ: i32 = 4;
pub const CAP_OPENNI_SXGA_15HZ: i32 = 1;
pub const CAP_OPENNI_SXGA_30HZ: i32 = 2;
pub const CAP_OPENNI_VALID_DEPTH_MASK: i32 = 4;
pub const CAP_OPENNI_VGA_30HZ: i32 = 0;
pub const CAP_PROP_APERTURE: i32 = 17008;
pub const CAP_PROP_AUTOFOCUS: i32 = 39;
pub const CAP_PROP_AUTO_EXPOSURE: i32 = 21;
pub const CAP_PROP_AUTO_WB: i32 = 44;
pub const CAP_PROP_BACKEND: i32 = 42;
pub const CAP_PROP_BACKLIGHT: i32 = 32;
pub const CAP_PROP_BRIGHTNESS: i32 = 10;
pub const CAP_PROP_BUFFERSIZE: i32 = 38;
pub const CAP_PROP_CHANNEL: i32 = 43;
pub const CAP_PROP_CONTRAST: i32 = 11;
pub const CAP_PROP_CONVERT_RGB: i32 = 16;
pub const CAP_PROP_DC1394_MAX: i32 = 31;
pub const CAP_PROP_DC1394_MODE_AUTO: i32 = -2;
pub const CAP_PROP_DC1394_MODE_MANUAL: i32 = -3;
pub const CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO: i32 = -1;
pub const CAP_PROP_DC1394_OFF: i32 = -4;
pub const CAP_PROP_EXPOSURE: i32 = 15;
pub const CAP_PROP_EXPOSUREPROGRAM: i32 = 17009;
pub const CAP_PROP_FOCUS: i32 = 28;
pub const CAP_PROP_FORMAT: i32 = 8;
pub const CAP_PROP_FOURCC: i32 = 6;
pub const CAP_PROP_FPS: i32 = 5;
pub const CAP_PROP_FRAME_COUNT: i32 = 7;
pub const CAP_PROP_FRAME_HEIGHT: i32 = 4;
pub const CAP_PROP_FRAME_WIDTH: i32 = 3;
pub const CAP_PROP_GAIN: i32 = 14;
pub const CAP_PROP_GAMMA: i32 = 22;
pub const CAP_PROP_GIGA_FRAME_HEIGH_MAX: i32 = 10004;
pub const CAP_PROP_GIGA_FRAME_OFFSET_X: i32 = 10001;
pub const CAP_PROP_GIGA_FRAME_OFFSET_Y: i32 = 10002;
pub const CAP_PROP_GIGA_FRAME_SENS_HEIGH: i32 = 10006;
pub const CAP_PROP_GIGA_FRAME_SENS_WIDTH: i32 = 10005;
pub const CAP_PROP_GIGA_FRAME_WIDTH_MAX: i32 = 10003;
pub const CAP_PROP_GPHOTO2_COLLECT_MSGS: i32 = 17005;
pub const CAP_PROP_GPHOTO2_FLUSH_MSGS: i32 = 17006;
pub const CAP_PROP_GPHOTO2_PREVIEW: i32 = 17001;
pub const CAP_PROP_GPHOTO2_RELOAD_CONFIG: i32 = 17003;
pub const CAP_PROP_GPHOTO2_RELOAD_ON_CHANGE: i32 = 17004;
pub const CAP_PROP_GPHOTO2_WIDGET_ENUMERATE: i32 = 17002;
pub const CAP_PROP_GSTREAMER_QUEUE_LENGTH: i32 = 200;
pub const CAP_PROP_GUID: i32 = 29;
pub const CAP_PROP_HUE: i32 = 13;
pub const CAP_PROP_IMAGES_BASE: i32 = 18000;
pub const CAP_PROP_IMAGES_LAST: i32 = 19000;
pub const CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD: i32 = 11005;
pub const CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ: i32 = 11006;
pub const CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT: i32 = 11007;
pub const CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE: i32 = 11003;
pub const CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE: i32 = 11004;
pub const CAP_PROP_INTELPERC_PROFILE_COUNT: i32 = 11001;
pub const CAP_PROP_INTELPERC_PROFILE_IDX: i32 = 11002;
pub const CAP_PROP_IOS_DEVICE_EXPOSURE: i32 = 9002;
pub const CAP_PROP_IOS_DEVICE_FLASH: i32 = 9003;
pub const CAP_PROP_IOS_DEVICE_FOCUS: i32 = 9001;
pub const CAP_PROP_IOS_DEVICE_TORCH: i32 = 9005;
pub const CAP_PROP_IOS_DEVICE_WHITEBALANCE: i32 = 9004;
pub const CAP_PROP_IRIS: i32 = 36;
pub const CAP_PROP_ISO_SPEED: i32 = 30;
pub const CAP_PROP_MODE: i32 = 9;
pub const CAP_PROP_MONOCHROME: i32 = 19;
pub const CAP_PROP_OPENNI2_MIRROR: i32 = 111;
pub const CAP_PROP_OPENNI2_SYNC: i32 = 110;
pub const CAP_PROP_OPENNI_APPROX_FRAME_SYNC: i32 = 105;
pub const CAP_PROP_OPENNI_BASELINE: i32 = 102;
pub const CAP_PROP_OPENNI_CIRCLE_BUFFER: i32 = 107;
pub const CAP_PROP_OPENNI_FOCAL_LENGTH: i32 = 103;
pub const CAP_PROP_OPENNI_FRAME_MAX_DEPTH: i32 = 101;
pub const CAP_PROP_OPENNI_GENERATOR_PRESENT: i32 = 109;
pub const CAP_PROP_OPENNI_MAX_BUFFER_SIZE: i32 = 106;
pub const CAP_PROP_OPENNI_MAX_TIME_DURATION: i32 = 108;
pub const CAP_PROP_OPENNI_OUTPUT_MODE: i32 = 100;
pub const CAP_PROP_OPENNI_REGISTRATION: i32 = 104;
pub const CAP_PROP_OPENNI_REGISTRATION_ON: i32 = 104;
pub const CAP_PROP_PAN: i32 = 33;
pub const CAP_PROP_POS_AVI_RATIO: i32 = 2;
pub const CAP_PROP_POS_FRAMES: i32 = 1;
pub const CAP_PROP_POS_MSEC: i32 = 0;
pub const CAP_PROP_PVAPI_BINNINGX: i32 = 304;
pub const CAP_PROP_PVAPI_BINNINGY: i32 = 305;
pub const CAP_PROP_PVAPI_DECIMATIONHORIZONTAL: i32 = 302;
pub const CAP_PROP_PVAPI_DECIMATIONVERTICAL: i32 = 303;
pub const CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE: i32 = 301;
pub const CAP_PROP_PVAPI_MULTICASTIP: i32 = 300;
pub const CAP_PROP_PVAPI_PIXELFORMAT: i32 = 306;
pub const CAP_PROP_RECTIFICATION: i32 = 18;
pub const CAP_PROP_ROLL: i32 = 35;
pub const CAP_PROP_SAR_DEN: i32 = 41;
pub const CAP_PROP_SAR_NUM: i32 = 40;
pub const CAP_PROP_SATURATION: i32 = 12;
pub const CAP_PROP_SETTINGS: i32 = 37;
pub const CAP_PROP_SHARPNESS: i32 = 20;
pub const CAP_PROP_SPEED: i32 = 17007;
pub const CAP_PROP_TEMPERATURE: i32 = 23;
pub const CAP_PROP_TILT: i32 = 34;
pub const CAP_PROP_TRIGGER: i32 = 24;
pub const CAP_PROP_TRIGGER_DELAY: i32 = 25;
pub const CAP_PROP_VIEWFINDER: i32 = 17010;
pub const CAP_PROP_WB_TEMPERATURE: i32 = 45;
pub const CAP_PROP_WHITE_BALANCE_BLUE_U: i32 = 17;
pub const CAP_PROP_WHITE_BALANCE_RED_V: i32 = 26;
pub const CAP_PROP_XI_ACQ_BUFFER_SIZE: i32 = 548;
pub const CAP_PROP_XI_ACQ_BUFFER_SIZE_UNIT: i32 = 549;
pub const CAP_PROP_XI_ACQ_FRAME_BURST_COUNT: i32 = 499;
pub const CAP_PROP_XI_ACQ_TIMING_MODE: i32 = 538;
pub const CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_COMMIT: i32 = 552;
pub const CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_SIZE: i32 = 550;
pub const CAP_PROP_XI_AEAG: i32 = 415;
pub const CAP_PROP_XI_AEAG_LEVEL: i32 = 419;
pub const CAP_PROP_XI_AEAG_ROI_HEIGHT: i32 = 442;
pub const CAP_PROP_XI_AEAG_ROI_OFFSET_X: i32 = 439;
pub const CAP_PROP_XI_AEAG_ROI_OFFSET_Y: i32 = 440;
pub const CAP_PROP_XI_AEAG_ROI_WIDTH: i32 = 441;
pub const CAP_PROP_XI_AE_MAX_LIMIT: i32 = 417;
pub const CAP_PROP_XI_AG_MAX_LIMIT: i32 = 418;
pub const CAP_PROP_XI_APPLY_CMS: i32 = 471;
pub const CAP_PROP_XI_AUTO_BANDWIDTH_CALCULATION: i32 = 573;
pub const CAP_PROP_XI_AUTO_WB: i32 = 414;
pub const CAP_PROP_XI_AVAILABLE_BANDWIDTH: i32 = 539;
pub const CAP_PROP_XI_BINNING_HORIZONTAL: i32 = 429;
pub const CAP_PROP_XI_BINNING_PATTERN: i32 = 430;
pub const CAP_PROP_XI_BINNING_SELECTOR: i32 = 427;
pub const CAP_PROP_XI_BINNING_VERTICAL: i32 = 428;
pub const CAP_PROP_XI_BPC: i32 = 445;
pub const CAP_PROP_XI_BUFFERS_QUEUE_SIZE: i32 = 551;
pub const CAP_PROP_XI_BUFFER_POLICY: i32 = 540;
pub const CAP_PROP_XI_CC_MATRIX_00: i32 = 479;
pub const CAP_PROP_XI_CC_MATRIX_01: i32 = 480;
pub const CAP_PROP_XI_CC_MATRIX_02: i32 = 481;
pub const CAP_PROP_XI_CC_MATRIX_03: i32 = 482;
pub const CAP_PROP_XI_CC_MATRIX_10: i32 = 483;
pub const CAP_PROP_XI_CC_MATRIX_11: i32 = 484;
pub const CAP_PROP_XI_CC_MATRIX_12: i32 = 485;
pub const CAP_PROP_XI_CC_MATRIX_13: i32 = 486;
pub const CAP_PROP_XI_CC_MATRIX_20: i32 = 487;
pub const CAP_PROP_XI_CC_MATRIX_21: i32 = 488;
pub const CAP_PROP_XI_CC_MATRIX_22: i32 = 489;
pub const CAP_PROP_XI_CC_MATRIX_23: i32 = 490;
pub const CAP_PROP_XI_CC_MATRIX_30: i32 = 491;
pub const CAP_PROP_XI_CC_MATRIX_31: i32 = 492;
pub const CAP_PROP_XI_CC_MATRIX_32: i32 = 493;
pub const CAP_PROP_XI_CC_MATRIX_33: i32 = 494;
pub const CAP_PROP_XI_CHIP_TEMP: i32 = 468;
pub const CAP_PROP_XI_CMS: i32 = 470;
pub const CAP_PROP_XI_COLOR_FILTER_ARRAY: i32 = 475;
pub const CAP_PROP_XI_COLUMN_FPN_CORRECTION: i32 = 555;
pub const CAP_PROP_XI_COOLING: i32 = 466;
pub const CAP_PROP_XI_COUNTER_SELECTOR: i32 = 536;
pub const CAP_PROP_XI_COUNTER_VALUE: i32 = 537;
pub const CAP_PROP_XI_DATA_FORMAT: i32 = 401;
pub const CAP_PROP_XI_DEBOUNCE_EN: i32 = 507;
pub const CAP_PROP_XI_DEBOUNCE_POL: i32 = 510;
pub const CAP_PROP_XI_DEBOUNCE_T0: i32 = 508;
pub const CAP_PROP_XI_DEBOUNCE_T1: i32 = 509;
pub const CAP_PROP_XI_DEBUG_LEVEL: i32 = 572;
pub const CAP_PROP_XI_DECIMATION_HORIZONTAL: i32 = 433;
pub const CAP_PROP_XI_DECIMATION_PATTERN: i32 = 434;
pub const CAP_PROP_XI_DECIMATION_SELECTOR: i32 = 431;
pub const CAP_PROP_XI_DECIMATION_VERTICAL: i32 = 432;
pub const CAP_PROP_XI_DEFAULT_CC_MATRIX: i32 = 495;
pub const CAP_PROP_XI_DEVICE_MODEL_ID: i32 = 521;
pub const CAP_PROP_XI_DEVICE_RESET: i32 = 554;
pub const CAP_PROP_XI_DEVICE_SN: i32 = 522;
pub const CAP_PROP_XI_DOWNSAMPLING: i32 = 400;
pub const CAP_PROP_XI_DOWNSAMPLING_TYPE: i32 = 426;
pub const CAP_PROP_XI_EXPOSURE: i32 = 421;
pub const CAP_PROP_XI_EXPOSURE_BURST_COUNT: i32 = 422;
pub const CAP_PROP_XI_EXP_PRIORITY: i32 = 416;
pub const CAP_PROP_XI_FFS_ACCESS_KEY: i32 = 583;
pub const CAP_PROP_XI_FFS_FILE_ID: i32 = 594;
pub const CAP_PROP_XI_FFS_FILE_SIZE: i32 = 580;
pub const CAP_PROP_XI_FRAMERATE: i32 = 535;
pub const CAP_PROP_XI_FREE_FFS_SIZE: i32 = 581;
pub const CAP_PROP_XI_GAIN: i32 = 424;
pub const CAP_PROP_XI_GAIN_SELECTOR: i32 = 423;
pub const CAP_PROP_XI_GAMMAC: i32 = 477;
pub const CAP_PROP_XI_GAMMAY: i32 = 476;
pub const CAP_PROP_XI_GPI_LEVEL: i32 = 408;
pub const CAP_PROP_XI_GPI_MODE: i32 = 407;
pub const CAP_PROP_XI_GPI_SELECTOR: i32 = 406;
pub const CAP_PROP_XI_GPO_MODE: i32 = 410;
pub const CAP_PROP_XI_GPO_SELECTOR: i32 = 409;
pub const CAP_PROP_XI_HDR: i32 = 559;
pub const CAP_PROP_XI_HDR_KNEEPOINT_COUNT: i32 = 560;
pub const CAP_PROP_XI_HDR_T1: i32 = 561;
pub const CAP_PROP_XI_HDR_T2: i32 = 562;
pub const CAP_PROP_XI_HEIGHT: i32 = 452;
pub const CAP_PROP_XI_HOUS_BACK_SIDE_TEMP: i32 = 590;
pub const CAP_PROP_XI_HOUS_TEMP: i32 = 469;
pub const CAP_PROP_XI_HW_REVISION: i32 = 571;
pub const CAP_PROP_XI_IMAGE_BLACK_LEVEL: i32 = 565;
pub const CAP_PROP_XI_IMAGE_DATA_BIT_DEPTH: i32 = 462;
pub const CAP_PROP_XI_IMAGE_DATA_FORMAT: i32 = 435;
pub const CAP_PROP_XI_IMAGE_DATA_FORMAT_RGB32_ALPHA: i32 = 529;
pub const CAP_PROP_XI_IMAGE_IS_COLOR: i32 = 474;
pub const CAP_PROP_XI_IMAGE_PAYLOAD_SIZE: i32 = 530;
pub const CAP_PROP_XI_IS_COOLED: i32 = 465;
pub const CAP_PROP_XI_IS_DEVICE_EXIST: i32 = 547;
pub const CAP_PROP_XI_KNEEPOINT1: i32 = 563;
pub const CAP_PROP_XI_KNEEPOINT2: i32 = 564;
pub const CAP_PROP_XI_LED_MODE: i32 = 412;
pub const CAP_PROP_XI_LED_SELECTOR: i32 = 411;
pub const CAP_PROP_XI_LENS_APERTURE_VALUE: i32 = 512;
pub const CAP_PROP_XI_LENS_FEATURE: i32 = 518;
pub const CAP_PROP_XI_LENS_FEATURE_SELECTOR: i32 = 517;
pub const CAP_PROP_XI_LENS_FOCAL_LENGTH: i32 = 516;
pub const CAP_PROP_XI_LENS_FOCUS_DISTANCE: i32 = 515;
pub const CAP_PROP_XI_LENS_FOCUS_MOVE: i32 = 514;
pub const CAP_PROP_XI_LENS_FOCUS_MOVEMENT_VALUE: i32 = 513;
pub const CAP_PROP_XI_LENS_MODE: i32 = 511;
pub const CAP_PROP_XI_LIMIT_BANDWIDTH: i32 = 459;
pub const CAP_PROP_XI_LUT_EN: i32 = 541;
pub const CAP_PROP_XI_LUT_INDEX: i32 = 542;
pub const CAP_PROP_XI_LUT_VALUE: i32 = 543;
pub const CAP_PROP_XI_MANUAL_WB: i32 = 413;
pub const CAP_PROP_XI_OFFSET_X: i32 = 402;
pub const CAP_PROP_XI_OFFSET_Y: i32 = 403;
pub const CAP_PROP_XI_OUTPUT_DATA_BIT_DEPTH: i32 = 461;
pub const CAP_PROP_XI_OUTPUT_DATA_PACKING: i32 = 463;
pub const CAP_PROP_XI_OUTPUT_DATA_PACKING_TYPE: i32 = 464;
pub const CAP_PROP_XI_RECENT_FRAME: i32 = 553;
pub const CAP_PROP_XI_REGION_MODE: i32 = 595;
pub const CAP_PROP_XI_REGION_SELECTOR: i32 = 589;
pub const CAP_PROP_XI_ROW_FPN_CORRECTION: i32 = 591;
pub const CAP_PROP_XI_SENSOR_BOARD_TEMP: i32 = 596;
pub const CAP_PROP_XI_SENSOR_CLOCK_FREQ_HZ: i32 = 532;
pub const CAP_PROP_XI_SENSOR_CLOCK_FREQ_INDEX: i32 = 533;
pub const CAP_PROP_XI_SENSOR_DATA_BIT_DEPTH: i32 = 460;
pub const CAP_PROP_XI_SENSOR_FEATURE_SELECTOR: i32 = 585;
pub const CAP_PROP_XI_SENSOR_FEATURE_VALUE: i32 = 586;
pub const CAP_PROP_XI_SENSOR_MODE: i32 = 558;
pub const CAP_PROP_XI_SENSOR_OUTPUT_CHANNEL_COUNT: i32 = 534;
pub const CAP_PROP_XI_SENSOR_TAPS: i32 = 437;
pub const CAP_PROP_XI_SHARPNESS: i32 = 478;
pub const CAP_PROP_XI_SHUTTER_TYPE: i32 = 436;
pub const CAP_PROP_XI_TARGET_TEMP: i32 = 467;
pub const CAP_PROP_XI_TEST_PATTERN: i32 = 588;
pub const CAP_PROP_XI_TEST_PATTERN_GENERATOR_SELECTOR: i32 = 587;
pub const CAP_PROP_XI_TIMEOUT: i32 = 420;
pub const CAP_PROP_XI_TRANSPORT_PIXEL_FORMAT: i32 = 531;
pub const CAP_PROP_XI_TRG_DELAY: i32 = 544;
pub const CAP_PROP_XI_TRG_SELECTOR: i32 = 498;
pub const CAP_PROP_XI_TRG_SOFTWARE: i32 = 405;
pub const CAP_PROP_XI_TRG_SOURCE: i32 = 404;
pub const CAP_PROP_XI_TS_RST_MODE: i32 = 545;
pub const CAP_PROP_XI_TS_RST_SOURCE: i32 = 546;
pub const CAP_PROP_XI_USED_FFS_SIZE: i32 = 582;
pub const CAP_PROP_XI_WB_KB: i32 = 450;
pub const CAP_PROP_XI_WB_KG: i32 = 449;
pub const CAP_PROP_XI_WB_KR: i32 = 448;
pub const CAP_PROP_XI_WIDTH: i32 = 451;
pub const CAP_PROP_ZOOM: i32 = 27;
pub const CAP_PVAPI: i32 = 800;
pub const CAP_PVAPI_DECIMATION_2OUTOF16: i32 = 8;
pub const CAP_PVAPI_DECIMATION_2OUTOF4: i32 = 2;
pub const CAP_PVAPI_DECIMATION_2OUTOF8: i32 = 4;
pub const CAP_PVAPI_DECIMATION_OFF: i32 = 1;
pub const CAP_PVAPI_FSTRIGMODE_FIXEDRATE: i32 = 3;
pub const CAP_PVAPI_FSTRIGMODE_FREERUN: i32 = 0;
pub const CAP_PVAPI_FSTRIGMODE_SOFTWARE: i32 = 4;
pub const CAP_PVAPI_FSTRIGMODE_SYNCIN1: i32 = 1;
pub const CAP_PVAPI_FSTRIGMODE_SYNCIN2: i32 = 2;
pub const CAP_PVAPI_PIXELFORMAT_BAYER16: i32 = 4;
pub const CAP_PVAPI_PIXELFORMAT_BAYER8: i32 = 3;
pub const CAP_PVAPI_PIXELFORMAT_BGR24: i32 = 6;
pub const CAP_PVAPI_PIXELFORMAT_BGRA32: i32 = 8;
pub const CAP_PVAPI_PIXELFORMAT_MONO16: i32 = 2;
pub const CAP_PVAPI_PIXELFORMAT_MONO8: i32 = 1;
pub const CAP_PVAPI_PIXELFORMAT_RGB24: i32 = 5;
pub const CAP_PVAPI_PIXELFORMAT_RGBA32: i32 = 7;
pub const CAP_QT: i32 = 500;
pub const CAP_UNICAP: i32 = 600;
pub const CAP_V4L: i32 = 200;
pub const CAP_V4L2: i32 = 200;
pub const CAP_VFW: i32 = 200;
pub const CAP_WINRT: i32 = 1410;
pub const CAP_XIAPI: i32 = 1100;
pub const CAP_XINE: i32 = 2400;
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 CCL_DEFAULT: i32 = -1;
pub const CCL_GRANA: i32 = 1;
pub const CCL_WU: i32 = 0;
pub const CC_STAT_AREA: i32 = 4;
pub const CC_STAT_HEIGHT: i32 = 3;
pub const CC_STAT_LEFT: i32 = 0;
pub const CC_STAT_MAX: i32 = 5;
pub const CC_STAT_TOP: i32 = 1;
pub const CC_STAT_WIDTH: i32 = 2;
pub const CHAIN_APPROX_NONE: i32 = 1;
pub const CHAIN_APPROX_SIMPLE: i32 = 2;
pub const CHAIN_APPROX_TC89_KCOS: i32 = 4;
pub const CHAIN_APPROX_TC89_L1: i32 = 3;
pub const CMP_EQ: i32 = 0;
pub const CMP_GE: i32 = 2;
pub const CMP_GT: i32 = 1;
pub const CMP_LE: i32 = 4;
pub const CMP_LT: i32 = 3;
pub const CMP_NE: i32 = 5;
pub const COLORMAP_AUTUMN: i32 = 0;
pub const COLORMAP_BONE: i32 = 1;
pub const COLORMAP_COOL: i32 = 8;
pub const COLORMAP_HOT: i32 = 11;
pub const COLORMAP_HSV: i32 = 9;
pub const COLORMAP_JET: i32 = 2;
pub const COLORMAP_OCEAN: i32 = 5;
pub const COLORMAP_PARULA: i32 = 12;
pub const COLORMAP_PINK: i32 = 10;
pub const COLORMAP_RAINBOW: i32 = 4;
pub const COLORMAP_SPRING: i32 = 7;
pub const COLORMAP_SUMMER: i32 = 6;
pub const COLORMAP_WINTER: i32 = 3;
pub const COLOR_BGR2BGR555: i32 = 22;
pub const COLOR_BGR2BGR565: i32 = 12;
pub const COLOR_BGR2BGRA: i32 = 0;
pub const COLOR_BGR2GRAY: i32 = 6;
pub const COLOR_BGR2HLS: i32 = 52;
pub const COLOR_BGR2HLS_FULL: i32 = 68;
pub const COLOR_BGR2HSV: i32 = 40;
pub const COLOR_BGR2HSV_FULL: i32 = 66;
pub const COLOR_BGR2Lab: i32 = 44;
pub const COLOR_BGR2Luv: i32 = 50;
pub const COLOR_BGR2RGB: i32 = 4;
pub const COLOR_BGR2RGBA: i32 = 2;
pub const COLOR_BGR2XYZ: i32 = 32;
pub const COLOR_BGR2YCrCb: i32 = 36;
pub const COLOR_BGR2YUV: i32 = 82;
pub const COLOR_BGR2YUV_I420: i32 = 128;
pub const COLOR_BGR2YUV_IYUV: i32 = 128;
pub const COLOR_BGR2YUV_YV12: i32 = 132;
pub const COLOR_BGR5552BGR: i32 = 24;
pub const COLOR_BGR5552BGRA: i32 = 28;
pub const COLOR_BGR5552GRAY: i32 = 31;
pub const COLOR_BGR5552RGB: i32 = 25;
pub const COLOR_BGR5552RGBA: i32 = 29;
pub const COLOR_BGR5652BGR: i32 = 14;
pub const COLOR_BGR5652BGRA: i32 = 18;
pub const COLOR_BGR5652GRAY: i32 = 21;
pub const COLOR_BGR5652RGB: i32 = 15;
pub const COLOR_BGR5652RGBA: i32 = 19;
pub const COLOR_BGRA2BGR: i32 = 1;
pub const COLOR_BGRA2BGR555: i32 = 26;
pub const COLOR_BGRA2BGR565: i32 = 16;
pub const COLOR_BGRA2GRAY: i32 = 10;
pub const COLOR_BGRA2RGB: i32 = 3;
pub const COLOR_BGRA2RGBA: i32 = 5;
pub const COLOR_BGRA2YUV_I420: i32 = 130;
pub const COLOR_BGRA2YUV_IYUV: i32 = 130;
pub const COLOR_BGRA2YUV_YV12: i32 = 134;
pub const COLOR_BayerBG2BGR: i32 = 46;
pub const COLOR_BayerBG2BGRA: i32 = 139;
pub const COLOR_BayerBG2BGR_EA: i32 = 135;
pub const COLOR_BayerBG2BGR_VNG: i32 = 62;
pub const COLOR_BayerBG2GRAY: i32 = 86;
pub const COLOR_BayerBG2RGB: i32 = 48;
pub const COLOR_BayerBG2RGBA: i32 = 141;
pub const COLOR_BayerBG2RGB_EA: i32 = 137;
pub const COLOR_BayerBG2RGB_VNG: i32 = 64;
pub const COLOR_BayerGB2BGR: i32 = 47;
pub const COLOR_BayerGB2BGRA: i32 = 140;
pub const COLOR_BayerGB2BGR_EA: i32 = 136;
pub const COLOR_BayerGB2BGR_VNG: i32 = 63;
pub const COLOR_BayerGB2GRAY: i32 = 87;
pub const COLOR_BayerGB2RGB: i32 = 49;
pub const COLOR_BayerGB2RGBA: i32 = 142;
pub const COLOR_BayerGB2RGB_EA: i32 = 138;
pub const COLOR_BayerGB2RGB_VNG: i32 = 65;
pub const COLOR_BayerGR2BGR: i32 = 49;
pub const COLOR_BayerGR2BGRA: i32 = 142;
pub const COLOR_BayerGR2BGR_EA: i32 = 138;
pub const COLOR_BayerGR2BGR_VNG: i32 = 65;
pub const COLOR_BayerGR2GRAY: i32 = 89;
pub const COLOR_BayerGR2RGB: i32 = 47;
pub const COLOR_BayerGR2RGBA: i32 = 140;
pub const COLOR_BayerGR2RGB_EA: i32 = 136;
pub const COLOR_BayerGR2RGB_VNG: i32 = 63;
pub const COLOR_BayerRG2BGR: i32 = 48;
pub const COLOR_BayerRG2BGRA: i32 = 141;
pub const COLOR_BayerRG2BGR_EA: i32 = 137;
pub const COLOR_BayerRG2BGR_VNG: i32 = 64;
pub const COLOR_BayerRG2GRAY: i32 = 88;
pub const COLOR_BayerRG2RGB: i32 = 46;
pub const COLOR_BayerRG2RGBA: i32 = 139;
pub const COLOR_BayerRG2RGB_EA: i32 = 135;
pub const COLOR_BayerRG2RGB_VNG: i32 = 62;
pub const COLOR_COLORCVT_MAX: i32 = 143;
pub const COLOR_GRAY2BGR: i32 = 8;
pub const COLOR_GRAY2BGR555: i32 = 30;
pub const COLOR_GRAY2BGR565: i32 = 20;
pub const COLOR_GRAY2BGRA: i32 = 9;
pub const COLOR_GRAY2RGB: i32 = 8;
pub const COLOR_GRAY2RGBA: i32 = 9;
pub const COLOR_HLS2BGR: i32 = 60;
pub const COLOR_HLS2BGR_FULL: i32 = 72;
pub const COLOR_HLS2RGB: i32 = 61;
pub const COLOR_HLS2RGB_FULL: i32 = 73;
pub const COLOR_HSV2BGR: i32 = 54;
pub const COLOR_HSV2BGR_FULL: i32 = 70;
pub const COLOR_HSV2RGB: i32 = 55;
pub const COLOR_HSV2RGB_FULL: i32 = 71;
pub const COLOR_LBGR2Lab: i32 = 74;
pub const COLOR_LBGR2Luv: i32 = 76;
pub const COLOR_LRGB2Lab: i32 = 75;
pub const COLOR_LRGB2Luv: i32 = 77;
pub const COLOR_Lab2BGR: i32 = 56;
pub const COLOR_Lab2LBGR: i32 = 78;
pub const COLOR_Lab2LRGB: i32 = 79;
pub const COLOR_Lab2RGB: i32 = 57;
pub const COLOR_Luv2BGR: i32 = 58;
pub const COLOR_Luv2LBGR: i32 = 80;
pub const COLOR_Luv2LRGB: i32 = 81;
pub const COLOR_Luv2RGB: i32 = 59;
pub const COLOR_RGB2BGR: i32 = 4;
pub const COLOR_RGB2BGR555: i32 = 23;
pub const COLOR_RGB2BGR565: i32 = 13;
pub const COLOR_RGB2BGRA: i32 = 2;
pub const COLOR_RGB2GRAY: i32 = 7;
pub const COLOR_RGB2HLS: i32 = 53;
pub const COLOR_RGB2HLS_FULL: i32 = 69;
pub const COLOR_RGB2HSV: i32 = 41;
pub const COLOR_RGB2HSV_FULL: i32 = 67;
pub const COLOR_RGB2Lab: i32 = 45;
pub const COLOR_RGB2Luv: i32 = 51;
pub const COLOR_RGB2RGBA: i32 = 0;
pub const COLOR_RGB2XYZ: i32 = 33;
pub const COLOR_RGB2YCrCb: i32 = 37;
pub const COLOR_RGB2YUV: i32 = 83;
pub const COLOR_RGB2YUV_I420: i32 = 127;
pub const COLOR_RGB2YUV_IYUV: i32 = 127;
pub const COLOR_RGB2YUV_YV12: i32 = 131;
pub const COLOR_RGBA2BGR: i32 = 3;
pub const COLOR_RGBA2BGR555: i32 = 27;
pub const COLOR_RGBA2BGR565: i32 = 17;
pub const COLOR_RGBA2BGRA: i32 = 5;
pub const COLOR_RGBA2GRAY: i32 = 11;
pub const COLOR_RGBA2RGB: i32 = 1;
pub const COLOR_RGBA2YUV_I420: i32 = 129;
pub const COLOR_RGBA2YUV_IYUV: i32 = 129;
pub const COLOR_RGBA2YUV_YV12: i32 = 133;
pub const COLOR_RGBA2mRGBA: i32 = 125;
pub const COLOR_XYZ2BGR: i32 = 34;
pub const COLOR_XYZ2RGB: i32 = 35;
pub const COLOR_YCrCb2BGR: i32 = 38;
pub const COLOR_YCrCb2RGB: i32 = 39;
pub const COLOR_YUV2BGR: i32 = 84;
pub const COLOR_YUV2BGRA_I420: i32 = 105;
pub const COLOR_YUV2BGRA_IYUV: i32 = 105;
pub const COLOR_YUV2BGRA_NV12: i32 = 95;
pub const COLOR_YUV2BGRA_NV21: i32 = 97;
pub const COLOR_YUV2BGRA_UYNV: i32 = 112;
pub const COLOR_YUV2BGRA_UYVY: i32 = 112;
pub const COLOR_YUV2BGRA_Y422: i32 = 112;
pub const COLOR_YUV2BGRA_YUNV: i32 = 120;
pub const COLOR_YUV2BGRA_YUY2: i32 = 120;
pub const COLOR_YUV2BGRA_YUYV: i32 = 120;
pub const COLOR_YUV2BGRA_YV12: i32 = 103;
pub const COLOR_YUV2BGRA_YVYU: i32 = 122;
pub const COLOR_YUV2BGR_I420: i32 = 101;
pub const COLOR_YUV2BGR_IYUV: i32 = 101;
pub const COLOR_YUV2BGR_NV12: i32 = 91;
pub const COLOR_YUV2BGR_NV21: i32 = 93;
pub const COLOR_YUV2BGR_UYNV: i32 = 108;
pub const COLOR_YUV2BGR_UYVY: i32 = 108;
pub const COLOR_YUV2BGR_Y422: i32 = 108;
pub const COLOR_YUV2BGR_YUNV: i32 = 116;
pub const COLOR_YUV2BGR_YUY2: i32 = 116;
pub const COLOR_YUV2BGR_YUYV: i32 = 116;
pub const COLOR_YUV2BGR_YV12: i32 = 99;
pub const COLOR_YUV2BGR_YVYU: i32 = 118;
pub const COLOR_YUV2GRAY_420: i32 = 106;
pub const COLOR_YUV2GRAY_I420: i32 = 106;
pub const COLOR_YUV2GRAY_IYUV: i32 = 106;
pub const COLOR_YUV2GRAY_NV12: i32 = 106;
pub const COLOR_YUV2GRAY_NV21: i32 = 106;
pub const COLOR_YUV2GRAY_UYNV: i32 = 123;
pub const COLOR_YUV2GRAY_UYVY: i32 = 123;
pub const COLOR_YUV2GRAY_Y422: i32 = 123;
pub const COLOR_YUV2GRAY_YUNV: i32 = 124;
pub const COLOR_YUV2GRAY_YUY2: i32 = 124;
pub const COLOR_YUV2GRAY_YUYV: i32 = 124;
pub const COLOR_YUV2GRAY_YV12: i32 = 106;
pub const COLOR_YUV2GRAY_YVYU: i32 = 124;
pub const COLOR_YUV2RGB: i32 = 85;
pub const COLOR_YUV2RGBA_I420: i32 = 104;
pub const COLOR_YUV2RGBA_IYUV: i32 = 104;
pub const COLOR_YUV2RGBA_NV12: i32 = 94;
pub const COLOR_YUV2RGBA_NV21: i32 = 96;
pub const COLOR_YUV2RGBA_UYNV: i32 = 111;
pub const COLOR_YUV2RGBA_UYVY: i32 = 111;
pub const COLOR_YUV2RGBA_Y422: i32 = 111;
pub const COLOR_YUV2RGBA_YUNV: i32 = 119;
pub const COLOR_YUV2RGBA_YUY2: i32 = 119;
pub const COLOR_YUV2RGBA_YUYV: i32 = 119;
pub const COLOR_YUV2RGBA_YV12: i32 = 102;
pub const COLOR_YUV2RGBA_YVYU: i32 = 121;
pub const COLOR_YUV2RGB_I420: i32 = 100;
pub const COLOR_YUV2RGB_IYUV: i32 = 100;
pub const COLOR_YUV2RGB_NV12: i32 = 90;
pub const COLOR_YUV2RGB_NV21: i32 = 92;
pub const COLOR_YUV2RGB_UYNV: i32 = 107;
pub const COLOR_YUV2RGB_UYVY: i32 = 107;
pub const COLOR_YUV2RGB_Y422: i32 = 107;
pub const COLOR_YUV2RGB_YUNV: i32 = 115;
pub const COLOR_YUV2RGB_YUY2: i32 = 115;
pub const COLOR_YUV2RGB_YUYV: i32 = 115;
pub const COLOR_YUV2RGB_YV12: i32 = 98;
pub const COLOR_YUV2RGB_YVYU: i32 = 117;
pub const COLOR_YUV420p2BGR: i32 = 99;
pub const COLOR_YUV420p2BGRA: i32 = 103;
pub const COLOR_YUV420p2GRAY: i32 = 106;
pub const COLOR_YUV420p2RGB: i32 = 98;
pub const COLOR_YUV420p2RGBA: i32 = 102;
pub const COLOR_YUV420sp2BGR: i32 = 93;
pub const COLOR_YUV420sp2BGRA: i32 = 97;
pub const COLOR_YUV420sp2GRAY: i32 = 106;
pub const COLOR_YUV420sp2RGB: i32 = 92;
pub const COLOR_YUV420sp2RGBA: i32 = 96;
pub const COLOR_mRGBA2RGBA: i32 = 126;
pub const COL_SAMPLE: i32 = 1;
pub const CONTOURS_MATCH_I1: i32 = 1;
pub const CONTOURS_MATCH_I2: i32 = 2;
pub const CONTOURS_MATCH_I3: i32 = 3;
pub const COVAR_COLS: i32 = 16;
pub const COVAR_NORMAL: i32 = 1;
pub const COVAR_ROWS: i32 = 8;
pub const COVAR_SCALE: i32 = 4;
pub const COVAR_SCRAMBLED: i32 = 0;
pub const COVAR_USE_AVG: i32 = 2;
pub const CPU_AVX: i32 = 10;
pub const CPU_AVX2: i32 = 11;
pub const CPU_AVX512_SKX: i32 = 256;
pub const CPU_AVX_512BW: i32 = 14;
pub const CPU_AVX_512CD: i32 = 15;
pub const CPU_AVX_512DQ: i32 = 16;
pub const CPU_AVX_512ER: i32 = 17;
pub const CPU_AVX_512F: i32 = 13;
pub const CPU_AVX_512IFMA: i32 = 18;
pub const CPU_AVX_512IFMA512: i32 = 18;
pub const CPU_AVX_512PF: i32 = 19;
pub const CPU_AVX_512VBMI: i32 = 20;
pub const CPU_AVX_512VL: i32 = 21;
pub const CPU_FMA3: i32 = 12;
pub const CPU_FP16: i32 = 9;
pub const CPU_MAX_FEATURE: i32 = 512;
pub const CPU_MMX: i32 = 1;
pub const CPU_NEON: i32 = 100;
pub const CPU_POPCNT: i32 = 8;
pub const CPU_SSE: i32 = 2;
pub const CPU_SSE2: i32 = 3;
pub const CPU_SSE3: i32 = 4;
pub const CPU_SSE4_1: i32 = 6;
pub const CPU_SSE4_2: i32 = 7;
pub const CPU_SSSE3: i32 = 5;
pub const CPU_VSX: i32 = 200;
pub const CPU_VSX3: i32 = 201;
pub const CV_16S: i32 = 3;
pub const CV_16U: i32 = 2;
pub const CV_32F: i32 = 5;
pub const CV_32S: i32 = 4;
pub const CV_64F: i32 = 6;
pub const CV_8S: i32 = 1;
pub const CV_8U: i32 = 0;
pub const CV_AA: i32 = 16;
pub const CV_ADAPTIVE_THRESH_GAUSSIAN_C: i32 = 1;
pub const CV_ADAPTIVE_THRESH_MEAN_C: i32 = 0;
pub const CV_AUTOSTEP: i32 = 0x7fffffff;
pub const CV_AUTO_STEP: i32 = 0x7fffffff;
pub const CV_BACK: i32 = 0;
pub const CV_BGR2BGR555: i32 = 22;
pub const CV_BGR2BGR565: i32 = 12;
pub const CV_BGR2BGRA: i32 = 0;
pub const CV_BGR2GRAY: i32 = 6;
pub const CV_BGR2HLS: i32 = 52;
pub const CV_BGR2HLS_FULL: i32 = 68;
pub const CV_BGR2HSV: i32 = 40;
pub const CV_BGR2HSV_FULL: i32 = 66;
pub const CV_BGR2Lab: i32 = 44;
pub const CV_BGR2Luv: i32 = 50;
pub const CV_BGR2RGB: i32 = 4;
pub const CV_BGR2RGBA: i32 = 2;
pub const CV_BGR2XYZ: i32 = 32;
pub const CV_BGR2YCrCb: i32 = 36;
pub const CV_BGR2YUV: i32 = 82;
pub const CV_BGR2YUV_I420: i32 = 128;
pub const CV_BGR2YUV_IYUV: i32 = 128;
pub const CV_BGR2YUV_YV12: i32 = 132;
pub const CV_BGR5552BGR: i32 = 24;
pub const CV_BGR5552BGRA: i32 = 28;
pub const CV_BGR5552GRAY: i32 = 31;
pub const CV_BGR5552RGB: i32 = 25;
pub const CV_BGR5552RGBA: i32 = 29;
pub const CV_BGR5652BGR: i32 = 14;
pub const CV_BGR5652BGRA: i32 = 18;
pub const CV_BGR5652GRAY: i32 = 21;
pub const CV_BGR5652RGB: i32 = 15;
pub const CV_BGR5652RGBA: i32 = 19;
pub const CV_BGRA2BGR: i32 = 1;
pub const CV_BGRA2BGR555: i32 = 26;
pub const CV_BGRA2BGR565: i32 = 16;
pub const CV_BGRA2GRAY: i32 = 10;
pub const CV_BGRA2RGB: i32 = 3;
pub const CV_BGRA2RGBA: i32 = 5;
pub const CV_BGRA2YUV_I420: i32 = 130;
pub const CV_BGRA2YUV_IYUV: i32 = 130;
pub const CV_BGRA2YUV_YV12: i32 = 134;
pub const CV_BILATERAL: i32 = 4;
pub const CV_BLUR: i32 = 1;
pub const CV_BLUR_NO_SCALE: i32 = 0;
pub const CV_BadAlign: i32 = -21;
pub const CV_BadAlphaChannel: i32 = -18;
pub const CV_BadCOI: i32 = -24;
pub const CV_BadCallBack: i32 = -22;
pub const CV_BadDataPtr: i32 = -12;
pub const CV_BadDepth: i32 = -17;
pub const CV_BadImageSize: i32 = -10;
pub const CV_BadModelOrChSeq: i32 = -14;
pub const CV_BadNumChannel1U: i32 = -16;
pub const CV_BadNumChannels: i32 = -15;
pub const CV_BadOffset: i32 = -11;
pub const CV_BadOrder: i32 = -19;
pub const CV_BadOrigin: i32 = -20;
pub const CV_BadROISize: i32 = -25;
pub const CV_BadStep: i32 = -13;
pub const CV_BadTileSize: i32 = -23;
pub const CV_BayerBG2BGR: i32 = 46;
pub const CV_BayerBG2BGRA: i32 = 139;
pub const CV_BayerBG2BGR_EA: i32 = 135;
pub const CV_BayerBG2BGR_VNG: i32 = 62;
pub const CV_BayerBG2GRAY: i32 = 86;
pub const CV_BayerBG2RGB: i32 = 48;
pub const CV_BayerBG2RGBA: i32 = 141;
pub const CV_BayerBG2RGB_EA: i32 = 137;
pub const CV_BayerBG2RGB_VNG: i32 = 64;
pub const CV_BayerGB2BGR: i32 = 47;
pub const CV_BayerGB2BGRA: i32 = 140;
pub const CV_BayerGB2BGR_EA: i32 = 136;
pub const CV_BayerGB2BGR_VNG: i32 = 63;
pub const CV_BayerGB2GRAY: i32 = 87;
pub const CV_BayerGB2RGB: i32 = 49;
pub const CV_BayerGB2RGBA: i32 = 142;
pub const CV_BayerGB2RGB_EA: i32 = 138;
pub const CV_BayerGB2RGB_VNG: i32 = 65;
pub const CV_BayerGR2BGR: i32 = 49;
pub const CV_BayerGR2BGRA: i32 = 142;
pub const CV_BayerGR2BGR_EA: i32 = 138;
pub const CV_BayerGR2BGR_VNG: i32 = 65;
pub const CV_BayerGR2GRAY: i32 = 89;
pub const CV_BayerGR2RGB: i32 = 47;
pub const CV_BayerGR2RGBA: i32 = 140;
pub const CV_BayerGR2RGB_EA: i32 = 136;
pub const CV_BayerGR2RGB_VNG: i32 = 63;
pub const CV_BayerRG2BGR: i32 = 48;
pub const CV_BayerRG2BGRA: i32 = 141;
pub const CV_BayerRG2BGR_EA: i32 = 137;
pub const CV_BayerRG2BGR_VNG: i32 = 64;
pub const CV_BayerRG2GRAY: i32 = 88;
pub const CV_BayerRG2RGB: i32 = 46;
pub const CV_BayerRG2RGBA: i32 = 139;
pub const CV_BayerRG2RGB_EA: i32 = 135;
pub const CV_BayerRG2RGB_VNG: i32 = 62;
pub const CV_C: i32 = 1;
pub const CV_CALIB_CB_ADAPTIVE_THRESH: i32 = 1;
pub const CV_CALIB_CB_FAST_CHECK: i32 = 8;
pub const CV_CALIB_CB_FILTER_QUADS: i32 = 4;
pub const CV_CALIB_CB_NORMALIZE_IMAGE: i32 = 2;
pub const CV_CALIB_FIX_ASPECT_RATIO: i32 = 2;
pub const CV_CALIB_FIX_FOCAL_LENGTH: i32 = 16;
pub const CV_CALIB_FIX_INTRINSIC: i32 = 256;
pub const CV_CALIB_FIX_K1: i32 = 32;
pub const CV_CALIB_FIX_K2: i32 = 64;
pub const CV_CALIB_FIX_K3: i32 = 128;
pub const CV_CALIB_FIX_K4: i32 = 2048;
pub const CV_CALIB_FIX_K5: i32 = 4096;
pub const CV_CALIB_FIX_K6: i32 = 8192;
pub const CV_CALIB_FIX_PRINCIPAL_POINT: i32 = 4;
pub const CV_CALIB_FIX_S1_S2_S3_S4: i32 = 65536;
pub const CV_CALIB_FIX_TANGENT_DIST: i32 = 2097152;
pub const CV_CALIB_FIX_TAUX_TAUY: i32 = 524288;
pub const CV_CALIB_NINTRINSIC: i32 = 18;
pub const CV_CALIB_RATIONAL_MODEL: i32 = 16384;
pub const CV_CALIB_SAME_FOCAL_LENGTH: i32 = 512;
pub const CV_CALIB_THIN_PRISM_MODEL: i32 = 32768;
pub const CV_CALIB_TILTED_MODEL: i32 = 262144;
pub const CV_CALIB_USE_INTRINSIC_GUESS: i32 = 1;
pub const CV_CALIB_ZERO_DISPARITY: i32 = 1024;
pub const CV_CALIB_ZERO_TANGENT_DIST: i32 = 8;
pub const CV_CANNY_L2_GRADIENT: i32 = (1 << 31);
pub const CV_CAP_ANDROID: i32 = 1000;
pub const CV_CAP_ANY: i32 = 0;
pub const CV_CAP_ARAVIS: i32 = 2100;
pub const CV_CAP_AVFOUNDATION: i32 = 1200;
pub const CV_CAP_CMU1394: i32 = 300;
pub const CV_CAP_DC1394: i32 = 300;
pub const CV_CAP_DSHOW: i32 = 700;
pub const CV_CAP_FFMPEG: i32 = 1900;
pub const CV_CAP_FIREWARE: i32 = 300;
pub const CV_CAP_FIREWIRE: i32 = 300;
pub const CV_CAP_GIGANETIX: i32 = 1300;
pub const CV_CAP_GPHOTO2: i32 = 1700;
pub const CV_CAP_GSTREAMER: i32 = 1800;
pub const CV_CAP_GSTREAMER_QUEUE_LENGTH: i32 = 200;
pub const CV_CAP_IEEE1394: i32 = 300;
pub const CV_CAP_IMAGES: i32 = 2000;
pub const CV_CAP_INTELPERC: i32 = 1500;
pub const CV_CAP_INTELPERC_DEPTH_GENERATOR: i32 = 1 << 29;
pub const CV_CAP_INTELPERC_DEPTH_MAP: i32 = 0;
pub const CV_CAP_INTELPERC_IMAGE: i32 = 3;
pub const CV_CAP_INTELPERC_IMAGE_GENERATOR: i32 = 1 << 28;
pub const CV_CAP_INTELPERC_IR_MAP: i32 = 2;
pub const CV_CAP_INTELPERC_UVDEPTH_MAP: i32 = 1;
pub const CV_CAP_MIL: i32 = 100;
pub const CV_CAP_MODE_BGR: i32 = 0;
pub const CV_CAP_MODE_GRAY: i32 = 2;
pub const CV_CAP_MODE_RGB: i32 = 1;
pub const CV_CAP_MODE_YUYV: i32 = 3;
pub const CV_CAP_MSMF: i32 = 1400;
pub const CV_CAP_OPENNI: i32 = 900;
pub const CV_CAP_OPENNI2: i32 = 1600;
pub const CV_CAP_OPENNI_ASUS: i32 = 910;
pub const CV_CAP_OPENNI_BGR_IMAGE: i32 = 5;
pub const CV_CAP_OPENNI_DEPTH_GENERATOR: i32 = 1 << 31;
pub const CV_CAP_OPENNI_DEPTH_MAP: i32 = 0;
pub const CV_CAP_OPENNI_DISPARITY_MAP: i32 = 2;
pub const CV_CAP_OPENNI_DISPARITY_MAP_32F: i32 = 3;
pub const CV_CAP_OPENNI_GRAY_IMAGE: i32 = 6;
pub const CV_CAP_OPENNI_IMAGE_GENERATOR: i32 = 1 << 30;
pub const CV_CAP_OPENNI_IR_GENERATOR: i32 = 1 << 29;
pub const CV_CAP_OPENNI_IR_IMAGE: i32 = 7;
pub const CV_CAP_OPENNI_POINT_CLOUD_MAP: i32 = 1;
pub const CV_CAP_OPENNI_QVGA_30HZ: i32 = 3;
pub const CV_CAP_OPENNI_QVGA_60HZ: i32 = 4;
pub const CV_CAP_OPENNI_SXGA_15HZ: i32 = 1;
pub const CV_CAP_OPENNI_SXGA_30HZ: i32 = 2;
pub const CV_CAP_OPENNI_VALID_DEPTH_MASK: i32 = 4;
pub const CV_CAP_OPENNI_VGA_30HZ: i32 = 0;
pub const CV_CAP_PROP_ANDROID_ANTIBANDING: i32 = 8004;
pub const CV_CAP_PROP_ANDROID_EXPOSE_LOCK: i32 = 8009;
pub const CV_CAP_PROP_ANDROID_FLASH_MODE: i32 = 8001;
pub const CV_CAP_PROP_ANDROID_FOCAL_LENGTH: i32 = 8005;
pub const CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_FAR: i32 = 8008;
pub const CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_NEAR: i32 = 8006;
pub const CV_CAP_PROP_ANDROID_FOCUS_DISTANCE_OPTIMAL: i32 = 8007;
pub const CV_CAP_PROP_ANDROID_FOCUS_MODE: i32 = 8002;
pub const CV_CAP_PROP_ANDROID_WHITEBALANCE_LOCK: i32 = 8010;
pub const CV_CAP_PROP_ANDROID_WHITE_BALANCE: i32 = 8003;
pub const CV_CAP_PROP_APERTURE: i32 = 17008;
pub const CV_CAP_PROP_AUTOFOCUS: i32 = 39;
pub const CV_CAP_PROP_AUTOGRAB: i32 = 1024;
pub const CV_CAP_PROP_AUTO_EXPOSURE: i32 = 21;
pub const CV_CAP_PROP_BACKLIGHT: i32 = 32;
pub const CV_CAP_PROP_BRIGHTNESS: i32 = 10;
pub const CV_CAP_PROP_BUFFERSIZE: i32 = 38;
pub const CV_CAP_PROP_CONTRAST: i32 = 11;
pub const CV_CAP_PROP_CONVERT_RGB: i32 = 16;
pub const CV_CAP_PROP_DC1394_MODE_AUTO: i32 = -2;
pub const CV_CAP_PROP_DC1394_MODE_MANUAL: i32 = -3;
pub const CV_CAP_PROP_DC1394_MODE_ONE_PUSH_AUTO: i32 = -1;
pub const CV_CAP_PROP_DC1394_OFF: i32 = -4;
pub const CV_CAP_PROP_EXPOSURE: i32 = 15;
pub const CV_CAP_PROP_EXPOSUREPROGRAM: i32 = 17009;
pub const CV_CAP_PROP_FOCUS: i32 = 28;
pub const CV_CAP_PROP_FORMAT: i32 = 8;
pub const CV_CAP_PROP_FOURCC: i32 = 6;
pub const CV_CAP_PROP_FPS: i32 = 5;
pub const CV_CAP_PROP_FRAME_COUNT: i32 = 7;
pub const CV_CAP_PROP_FRAME_HEIGHT: i32 = 4;
pub const CV_CAP_PROP_FRAME_WIDTH: i32 = 3;
pub const CV_CAP_PROP_GAIN: i32 = 14;
pub const CV_CAP_PROP_GAMMA: i32 = 22;
pub const CV_CAP_PROP_GIGA_FRAME_HEIGH_MAX: i32 = 10004;
pub const CV_CAP_PROP_GIGA_FRAME_OFFSET_X: i32 = 10001;
pub const CV_CAP_PROP_GIGA_FRAME_OFFSET_Y: i32 = 10002;
pub const CV_CAP_PROP_GIGA_FRAME_SENS_HEIGH: i32 = 10006;
pub const CV_CAP_PROP_GIGA_FRAME_SENS_WIDTH: i32 = 10005;
pub const CV_CAP_PROP_GIGA_FRAME_WIDTH_MAX: i32 = 10003;
pub const CV_CAP_PROP_GPHOTO2_COLLECT_MSGS: i32 = 17005;
pub const CV_CAP_PROP_GPHOTO2_FLUSH_MSGS: i32 = 17006;
pub const CV_CAP_PROP_GPHOTO2_PREVIEW: i32 = 17001;
pub const CV_CAP_PROP_GPHOTO2_RELOAD_CONFIG: i32 = 17003;
pub const CV_CAP_PROP_GPHOTO2_RELOAD_ON_CHANGE: i32 = 17004;
pub const CV_CAP_PROP_GPHOTO2_WIDGET_ENUMERATE: i32 = 17002;
pub const CV_CAP_PROP_GUID: i32 = 29;
pub const CV_CAP_PROP_HUE: i32 = 13;
pub const CV_CAP_PROP_INTELPERC_DEPTH_CONFIDENCE_THRESHOLD: i32 = 11005;
pub const CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_HORZ: i32 = 11006;
pub const CV_CAP_PROP_INTELPERC_DEPTH_FOCAL_LENGTH_VERT: i32 = 11007;
pub const CV_CAP_PROP_INTELPERC_DEPTH_LOW_CONFIDENCE_VALUE: i32 = 11003;
pub const CV_CAP_PROP_INTELPERC_DEPTH_SATURATION_VALUE: i32 = 11004;
pub const CV_CAP_PROP_INTELPERC_PROFILE_COUNT: i32 = 11001;
pub const CV_CAP_PROP_INTELPERC_PROFILE_IDX: i32 = 11002;
pub const CV_CAP_PROP_IOS_DEVICE_EXPOSURE: i32 = 9002;
pub const CV_CAP_PROP_IOS_DEVICE_FLASH: i32 = 9003;
pub const CV_CAP_PROP_IOS_DEVICE_FOCUS: i32 = 9001;
pub const CV_CAP_PROP_IOS_DEVICE_TORCH: i32 = 9005;
pub const CV_CAP_PROP_IOS_DEVICE_WHITEBALANCE: i32 = 9004;
pub const CV_CAP_PROP_IRIS: i32 = 36;
pub const CV_CAP_PROP_ISO_SPEED: i32 = 30;
pub const CV_CAP_PROP_MAX_DC1394: i32 = 31;
pub const CV_CAP_PROP_MODE: i32 = 9;
pub const CV_CAP_PROP_MONOCHROME: i32 = 19;
pub const CV_CAP_PROP_OPENNI2_MIRROR: i32 = 111;
pub const CV_CAP_PROP_OPENNI2_SYNC: i32 = 110;
pub const CV_CAP_PROP_OPENNI_APPROX_FRAME_SYNC: i32 = 105;
pub const CV_CAP_PROP_OPENNI_BASELINE: i32 = 102;
pub const CV_CAP_PROP_OPENNI_CIRCLE_BUFFER: i32 = 107;
pub const CV_CAP_PROP_OPENNI_FOCAL_LENGTH: i32 = 103;
pub const CV_CAP_PROP_OPENNI_FRAME_MAX_DEPTH: i32 = 101;
pub const CV_CAP_PROP_OPENNI_GENERATOR_PRESENT: i32 = 109;
pub const CV_CAP_PROP_OPENNI_MAX_BUFFER_SIZE: i32 = 106;
pub const CV_CAP_PROP_OPENNI_MAX_TIME_DURATION: i32 = 108;
pub const CV_CAP_PROP_OPENNI_OUTPUT_MODE: i32 = 100;
pub const CV_CAP_PROP_OPENNI_REGISTRATION: i32 = 104;
pub const CV_CAP_PROP_OPENNI_REGISTRATION_ON: i32 = 104;
pub const CV_CAP_PROP_PAN: i32 = 33;
pub const CV_CAP_PROP_POS_AVI_RATIO: i32 = 2;
pub const CV_CAP_PROP_POS_FRAMES: i32 = 1;
pub const CV_CAP_PROP_POS_MSEC: i32 = 0;
pub const CV_CAP_PROP_PREVIEW_FORMAT: i32 = 1026;
pub const CV_CAP_PROP_PVAPI_BINNINGX: i32 = 304;
pub const CV_CAP_PROP_PVAPI_BINNINGY: i32 = 305;
pub const CV_CAP_PROP_PVAPI_DECIMATIONHORIZONTAL: i32 = 302;
pub const CV_CAP_PROP_PVAPI_DECIMATIONVERTICAL: i32 = 303;
pub const CV_CAP_PROP_PVAPI_FRAMESTARTTRIGGERMODE: i32 = 301;
pub const CV_CAP_PROP_PVAPI_MULTICASTIP: i32 = 300;
pub const CV_CAP_PROP_PVAPI_PIXELFORMAT: i32 = 306;
pub const CV_CAP_PROP_RECTIFICATION: i32 = 18;
pub const CV_CAP_PROP_ROLL: i32 = 35;
pub const CV_CAP_PROP_SAR_DEN: i32 = 41;
pub const CV_CAP_PROP_SAR_NUM: i32 = 40;
pub const CV_CAP_PROP_SATURATION: i32 = 12;
pub const CV_CAP_PROP_SETTINGS: i32 = 37;
pub const CV_CAP_PROP_SHARPNESS: i32 = 20;
pub const CV_CAP_PROP_SPEED: i32 = 17007;
pub const CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING: i32 = 1025;
pub const CV_CAP_PROP_TEMPERATURE: i32 = 23;
pub const CV_CAP_PROP_TILT: i32 = 34;
pub const CV_CAP_PROP_TRIGGER: i32 = 24;
pub const CV_CAP_PROP_TRIGGER_DELAY: i32 = 25;
pub const CV_CAP_PROP_VIEWFINDER: i32 = 17010;
pub const CV_CAP_PROP_WHITE_BALANCE_BLUE_U: i32 = 17;
pub const CV_CAP_PROP_WHITE_BALANCE_RED_V: i32 = 26;
pub const CV_CAP_PROP_XI_ACQ_BUFFER_SIZE: i32 = 548;
pub const CV_CAP_PROP_XI_ACQ_BUFFER_SIZE_UNIT: i32 = 549;
pub const CV_CAP_PROP_XI_ACQ_FRAME_BURST_COUNT: i32 = 499;
pub const CV_CAP_PROP_XI_ACQ_TIMING_MODE: i32 = 538;
pub const CV_CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_COMMIT: i32 = 552;
pub const CV_CAP_PROP_XI_ACQ_TRANSPORT_BUFFER_SIZE: i32 = 550;
pub const CV_CAP_PROP_XI_AEAG: i32 = 415;
pub const CV_CAP_PROP_XI_AEAG_LEVEL: i32 = 419;
pub const CV_CAP_PROP_XI_AEAG_ROI_HEIGHT: i32 = 442;
pub const CV_CAP_PROP_XI_AEAG_ROI_OFFSET_X: i32 = 439;
pub const CV_CAP_PROP_XI_AEAG_ROI_OFFSET_Y: i32 = 440;
pub const CV_CAP_PROP_XI_AEAG_ROI_WIDTH: i32 = 441;
pub const CV_CAP_PROP_XI_AE_MAX_LIMIT: i32 = 417;
pub const CV_CAP_PROP_XI_AG_MAX_LIMIT: i32 = 418;
pub const CV_CAP_PROP_XI_APPLY_CMS: i32 = 471;
pub const CV_CAP_PROP_XI_AUTO_BANDWIDTH_CALCULATION: i32 = 573;
pub const CV_CAP_PROP_XI_AUTO_WB: i32 = 414;
pub const CV_CAP_PROP_XI_AVAILABLE_BANDWIDTH: i32 = 539;
pub const CV_CAP_PROP_XI_BINNING_HORIZONTAL: i32 = 429;
pub const CV_CAP_PROP_XI_BINNING_PATTERN: i32 = 430;
pub const CV_CAP_PROP_XI_BINNING_SELECTOR: i32 = 427;
pub const CV_CAP_PROP_XI_BINNING_VERTICAL: i32 = 428;
pub const CV_CAP_PROP_XI_BPC: i32 = 445;
pub const CV_CAP_PROP_XI_BUFFERS_QUEUE_SIZE: i32 = 551;
pub const CV_CAP_PROP_XI_BUFFER_POLICY: i32 = 540;
pub const CV_CAP_PROP_XI_CC_MATRIX_00: i32 = 479;
pub const CV_CAP_PROP_XI_CC_MATRIX_01: i32 = 480;
pub const CV_CAP_PROP_XI_CC_MATRIX_02: i32 = 481;
pub const CV_CAP_PROP_XI_CC_MATRIX_03: i32 = 482;
pub const CV_CAP_PROP_XI_CC_MATRIX_10: i32 = 483;
pub const CV_CAP_PROP_XI_CC_MATRIX_11: i32 = 484;
pub const CV_CAP_PROP_XI_CC_MATRIX_12: i32 = 485;
pub const CV_CAP_PROP_XI_CC_MATRIX_13: i32 = 486;
pub const CV_CAP_PROP_XI_CC_MATRIX_20: i32 = 487;
pub const CV_CAP_PROP_XI_CC_MATRIX_21: i32 = 488;
pub const CV_CAP_PROP_XI_CC_MATRIX_22: i32 = 489;
pub const CV_CAP_PROP_XI_CC_MATRIX_23: i32 = 490;
pub const CV_CAP_PROP_XI_CC_MATRIX_30: i32 = 491;
pub const CV_CAP_PROP_XI_CC_MATRIX_31: i32 = 492;
pub const CV_CAP_PROP_XI_CC_MATRIX_32: i32 = 493;
pub const CV_CAP_PROP_XI_CC_MATRIX_33: i32 = 494;
pub const CV_CAP_PROP_XI_CHIP_TEMP: i32 = 468;
pub const CV_CAP_PROP_XI_CMS: i32 = 470;
pub const CV_CAP_PROP_XI_COLOR_FILTER_ARRAY: i32 = 475;
pub const CV_CAP_PROP_XI_COLUMN_FPN_CORRECTION: i32 = 555;
pub const CV_CAP_PROP_XI_COOLING: i32 = 466;
pub const CV_CAP_PROP_XI_COUNTER_SELECTOR: i32 = 536;
pub const CV_CAP_PROP_XI_COUNTER_VALUE: i32 = 537;
pub const CV_CAP_PROP_XI_DATA_FORMAT: i32 = 401;
pub const CV_CAP_PROP_XI_DEBOUNCE_EN: i32 = 507;
pub const CV_CAP_PROP_XI_DEBOUNCE_POL: i32 = 510;
pub const CV_CAP_PROP_XI_DEBOUNCE_T0: i32 = 508;
pub const CV_CAP_PROP_XI_DEBOUNCE_T1: i32 = 509;
pub const CV_CAP_PROP_XI_DEBUG_LEVEL: i32 = 572;
pub const CV_CAP_PROP_XI_DECIMATION_HORIZONTAL: i32 = 433;
pub const CV_CAP_PROP_XI_DECIMATION_PATTERN: i32 = 434;
pub const CV_CAP_PROP_XI_DECIMATION_SELECTOR: i32 = 431;
pub const CV_CAP_PROP_XI_DECIMATION_VERTICAL: i32 = 432;
pub const CV_CAP_PROP_XI_DEFAULT_CC_MATRIX: i32 = 495;
pub const CV_CAP_PROP_XI_DEVICE_MODEL_ID: i32 = 521;
pub const CV_CAP_PROP_XI_DEVICE_RESET: i32 = 554;
pub const CV_CAP_PROP_XI_DEVICE_SN: i32 = 522;
pub const CV_CAP_PROP_XI_DOWNSAMPLING: i32 = 400;
pub const CV_CAP_PROP_XI_DOWNSAMPLING_TYPE: i32 = 426;
pub const CV_CAP_PROP_XI_EXPOSURE: i32 = 421;
pub const CV_CAP_PROP_XI_EXPOSURE_BURST_COUNT: i32 = 422;
pub const CV_CAP_PROP_XI_EXP_PRIORITY: i32 = 416;
pub const CV_CAP_PROP_XI_FFS_ACCESS_KEY: i32 = 583;
pub const CV_CAP_PROP_XI_FFS_FILE_ID: i32 = 594;
pub const CV_CAP_PROP_XI_FFS_FILE_SIZE: i32 = 580;
pub const CV_CAP_PROP_XI_FRAMERATE: i32 = 535;
pub const CV_CAP_PROP_XI_FREE_FFS_SIZE: i32 = 581;
pub const CV_CAP_PROP_XI_GAIN: i32 = 424;
pub const CV_CAP_PROP_XI_GAIN_SELECTOR: i32 = 423;
pub const CV_CAP_PROP_XI_GAMMAC: i32 = 477;
pub const CV_CAP_PROP_XI_GAMMAY: i32 = 476;
pub const CV_CAP_PROP_XI_GPI_LEVEL: i32 = 408;
pub const CV_CAP_PROP_XI_GPI_MODE: i32 = 407;
pub const CV_CAP_PROP_XI_GPI_SELECTOR: i32 = 406;
pub const CV_CAP_PROP_XI_GPO_MODE: i32 = 410;
pub const CV_CAP_PROP_XI_GPO_SELECTOR: i32 = 409;
pub const CV_CAP_PROP_XI_HDR: i32 = 559;
pub const CV_CAP_PROP_XI_HDR_KNEEPOINT_COUNT: i32 = 560;
pub const CV_CAP_PROP_XI_HDR_T1: i32 = 561;
pub const CV_CAP_PROP_XI_HDR_T2: i32 = 562;
pub const CV_CAP_PROP_XI_HEIGHT: i32 = 452;
pub const CV_CAP_PROP_XI_HOUS_BACK_SIDE_TEMP: i32 = 590;
pub const CV_CAP_PROP_XI_HOUS_TEMP: i32 = 469;
pub const CV_CAP_PROP_XI_HW_REVISION: i32 = 571;
pub const CV_CAP_PROP_XI_IMAGE_BLACK_LEVEL: i32 = 565;
pub const CV_CAP_PROP_XI_IMAGE_DATA_BIT_DEPTH: i32 = 462;
pub const CV_CAP_PROP_XI_IMAGE_DATA_FORMAT: i32 = 435;
pub const CV_CAP_PROP_XI_IMAGE_DATA_FORMAT_RGB32_ALPHA: i32 = 529;
pub const CV_CAP_PROP_XI_IMAGE_IS_COLOR: i32 = 474;
pub const CV_CAP_PROP_XI_IMAGE_PAYLOAD_SIZE: i32 = 530;
pub const CV_CAP_PROP_XI_IS_COOLED: i32 = 465;
pub const CV_CAP_PROP_XI_IS_DEVICE_EXIST: i32 = 547;
pub const CV_CAP_PROP_XI_KNEEPOINT1: i32 = 563;
pub const CV_CAP_PROP_XI_KNEEPOINT2: i32 = 564;
pub const CV_CAP_PROP_XI_LED_MODE: i32 = 412;
pub const CV_CAP_PROP_XI_LED_SELECTOR: i32 = 411;
pub const CV_CAP_PROP_XI_LENS_APERTURE_VALUE: i32 = 512;
pub const CV_CAP_PROP_XI_LENS_FEATURE: i32 = 518;
pub const CV_CAP_PROP_XI_LENS_FEATURE_SELECTOR: i32 = 517;
pub const CV_CAP_PROP_XI_LENS_FOCAL_LENGTH: i32 = 516;
pub const CV_CAP_PROP_XI_LENS_FOCUS_DISTANCE: i32 = 515;
pub const CV_CAP_PROP_XI_LENS_FOCUS_MOVE: i32 = 514;
pub const CV_CAP_PROP_XI_LENS_FOCUS_MOVEMENT_VALUE: i32 = 513;
pub const CV_CAP_PROP_XI_LENS_MODE: i32 = 511;
pub const CV_CAP_PROP_XI_LIMIT_BANDWIDTH: i32 = 459;
pub const CV_CAP_PROP_XI_LUT_EN: i32 = 541;
pub const CV_CAP_PROP_XI_LUT_INDEX: i32 = 542;
pub const CV_CAP_PROP_XI_LUT_VALUE: i32 = 543;
pub const CV_CAP_PROP_XI_MANUAL_WB: i32 = 413;
pub const CV_CAP_PROP_XI_OFFSET_X: i32 = 402;
pub const CV_CAP_PROP_XI_OFFSET_Y: i32 = 403;
pub const CV_CAP_PROP_XI_OUTPUT_DATA_BIT_DEPTH: i32 = 461;
pub const CV_CAP_PROP_XI_OUTPUT_DATA_PACKING: i32 = 463;
pub const CV_CAP_PROP_XI_OUTPUT_DATA_PACKING_TYPE: i32 = 464;
pub const CV_CAP_PROP_XI_RECENT_FRAME: i32 = 553;
pub const CV_CAP_PROP_XI_REGION_MODE: i32 = 595;
pub const CV_CAP_PROP_XI_REGION_SELECTOR: i32 = 589;
pub const CV_CAP_PROP_XI_ROW_FPN_CORRECTION: i32 = 591;
pub const CV_CAP_PROP_XI_SENSOR_BOARD_TEMP: i32 = 596;
pub const CV_CAP_PROP_XI_SENSOR_CLOCK_FREQ_HZ: i32 = 532;
pub const CV_CAP_PROP_XI_SENSOR_CLOCK_FREQ_INDEX: i32 = 533;
pub const CV_CAP_PROP_XI_SENSOR_DATA_BIT_DEPTH: i32 = 460;
pub const CV_CAP_PROP_XI_SENSOR_FEATURE_SELECTOR: i32 = 585;
pub const CV_CAP_PROP_XI_SENSOR_FEATURE_VALUE: i32 = 586;
pub const CV_CAP_PROP_XI_SENSOR_MODE: i32 = 558;
pub const CV_CAP_PROP_XI_SENSOR_OUTPUT_CHANNEL_COUNT: i32 = 534;
pub const CV_CAP_PROP_XI_SENSOR_TAPS: i32 = 437;
pub const CV_CAP_PROP_XI_SHARPNESS: i32 = 478;
pub const CV_CAP_PROP_XI_SHUTTER_TYPE: i32 = 436;
pub const CV_CAP_PROP_XI_TARGET_TEMP: i32 = 467;
pub const CV_CAP_PROP_XI_TEST_PATTERN: i32 = 588;
pub const CV_CAP_PROP_XI_TEST_PATTERN_GENERATOR_SELECTOR: i32 = 587;
pub const CV_CAP_PROP_XI_TIMEOUT: i32 = 420;
pub const CV_CAP_PROP_XI_TRANSPORT_PIXEL_FORMAT: i32 = 531;
pub const CV_CAP_PROP_XI_TRG_DELAY: i32 = 544;
pub const CV_CAP_PROP_XI_TRG_SELECTOR: i32 = 498;
pub const CV_CAP_PROP_XI_TRG_SOFTWARE: i32 = 405;
pub const CV_CAP_PROP_XI_TRG_SOURCE: i32 = 404;
pub const CV_CAP_PROP_XI_TS_RST_MODE: i32 = 545;
pub const CV_CAP_PROP_XI_TS_RST_SOURCE: i32 = 546;
pub const CV_CAP_PROP_XI_USED_FFS_SIZE: i32 = 582;
pub const CV_CAP_PROP_XI_WB_KB: i32 = 450;
pub const CV_CAP_PROP_XI_WB_KG: i32 = 449;
pub const CV_CAP_PROP_XI_WB_KR: i32 = 448;
pub const CV_CAP_PROP_XI_WIDTH: i32 = 451;
pub const CV_CAP_PROP_ZOOM: i32 = 27;
pub const CV_CAP_PVAPI: i32 = 800;
pub const CV_CAP_QT: i32 = 500;
pub const CV_CAP_STEREO: i32 = 400;
pub const CV_CAP_TYZX: i32 = 400;
pub const CV_CAP_UNICAP: i32 = 600;
pub const CV_CAP_V4L: i32 = 200;
pub const CV_CAP_V4L2: i32 = 200;
pub const CV_CAP_VFW: i32 = 200;
pub const CV_CAP_XIAPI: i32 = 1100;
pub const CV_CHAIN_APPROX_NONE: i32 = 1;
pub const CV_CHAIN_APPROX_SIMPLE: i32 = 2;
pub const CV_CHAIN_APPROX_TC89_KCOS: i32 = 4;
pub const CV_CHAIN_APPROX_TC89_L1: i32 = 3;
pub const CV_CHAIN_CODE: i32 = 0;
pub const CV_CHECKBOX: i32 = 1;
pub const CV_CHECK_QUIET: i32 = 2;
pub const CV_CHECK_RANGE: i32 = 1;
pub const CV_CHOLESKY: i32 = 3;
pub const CV_CLOCKWISE: i32 = 1;
pub const CV_CMP_EQ: i32 = 0;
pub const CV_CMP_GE: i32 = 2;
pub const CV_CMP_GT: i32 = 1;
pub const CV_CMP_LE: i32 = 4;
pub const CV_CMP_LT: i32 = 3;
pub const CV_CMP_NE: i32 = 5;
pub const CV_CN_MAX: i32 = 512;
pub const CV_CN_SHIFT: i32 = 3;
pub const CV_COLORCVT_MAX: i32 = 143;
pub const CV_COMP_BHATTACHARYYA: i32 = 3;
pub const CV_COMP_CHISQR: i32 = 1;
pub const CV_COMP_CHISQR_ALT: i32 = 4;
pub const CV_COMP_CORREL: i32 = 0;
pub const CV_COMP_HELLINGER: i32 = 3;
pub const CV_COMP_INTERSECT: i32 = 2;
pub const CV_COMP_KL_DIV: i32 = 5;
pub const CV_CONTOURS_MATCH_I1: i32 = 1;
pub const CV_CONTOURS_MATCH_I2: i32 = 2;
pub const CV_CONTOURS_MATCH_I3: i32 = 3;
pub const CV_COUNTER_CLOCKWISE: i32 = 2;
pub const CV_COVAR_COLS: i32 = 16;
pub const CV_COVAR_NORMAL: i32 = 1;
pub const CV_COVAR_ROWS: i32 = 8;
pub const CV_COVAR_SCALE: i32 = 4;
pub const CV_COVAR_SCRAMBLED: i32 = 0;
pub const CV_COVAR_USE_AVG: i32 = 2;
pub const CV_CPU_AVX: i32 = 10;
pub const CV_CPU_AVX2: i32 = 11;
pub const CV_CPU_AVX512_SKX: i32 = 256;
pub const CV_CPU_AVX_512BW: i32 = 14;
pub const CV_CPU_AVX_512CD: i32 = 15;
pub const CV_CPU_AVX_512DQ: i32 = 16;
pub const CV_CPU_AVX_512ER: i32 = 17;
pub const CV_CPU_AVX_512F: i32 = 13;
pub const CV_CPU_AVX_512IFMA: i32 = 18;
/// deprecated
pub const CV_CPU_AVX_512IFMA512: i32 = 18;
pub const CV_CPU_AVX_512PF: i32 = 19;
pub const CV_CPU_AVX_512VBMI: i32 = 20;
pub const CV_CPU_AVX_512VL: i32 = 21;
pub const CV_CPU_FMA3: i32 = 12;
pub const CV_CPU_FP16: i32 = 9;
pub const CV_CPU_MMX: i32 = 1;
pub const CV_CPU_NEON: i32 = 100;
pub const CV_CPU_NONE: i32 = 0;
pub const CV_CPU_POPCNT: i32 = 8;
pub const CV_CPU_SSE: i32 = 2;
pub const CV_CPU_SSE2: i32 = 3;
pub const CV_CPU_SSE3: i32 = 4;
pub const CV_CPU_SSE4_1: i32 = 6;
pub const CV_CPU_SSE4_2: i32 = 7;
pub const CV_CPU_SSSE3: i32 = 5;
pub const CV_CPU_VSX: i32 = 200;
pub const CV_CPU_VSX3: i32 = 201;
pub const CV_CVTIMG_FLIP: i32 = 1;
pub const CV_CVTIMG_SWAP_RB: i32 = 2;
pub const CV_DIFF: i32 = 16;
pub const CV_DIST_C: i32 = 3;
pub const CV_DIST_FAIR: i32 = 5;
pub const CV_DIST_HUBER: i32 = 7;
pub const CV_DIST_L1: i32 = 1;
pub const CV_DIST_L12: i32 = 4;
pub const CV_DIST_L2: i32 = 2;
pub const CV_DIST_LABEL_CCOMP: i32 = 0;
pub const CV_DIST_LABEL_PIXEL: i32 = 1;
pub const CV_DIST_MASK_3: i32 = 3;
pub const CV_DIST_MASK_5: i32 = 5;
pub const CV_DIST_MASK_PRECISE: i32 = 0;
pub const CV_DIST_USER: i32 = -1;
pub const CV_DIST_WELSCH: i32 = 6;
pub const CV_DLS: i32 = 3;
pub const CV_DXT_FORWARD: i32 = 0;
pub const CV_DXT_INVERSE: i32 = 1;
/// < conjugate the second argument of cvMulSpectrums
pub const CV_DXT_MUL_CONJ: i32 = 8;
/// < transform each row individually
pub const CV_DXT_ROWS: i32 = 4;
/// < divide result by size of array
pub const CV_DXT_SCALE: i32 = 2;
pub const CV_EPNP: i32 = 1;
pub const CV_EVENT_FLAG_ALTKEY: i32 = 32;
pub const CV_EVENT_FLAG_CTRLKEY: i32 = 8;
pub const CV_EVENT_FLAG_LBUTTON: i32 = 1;
pub const CV_EVENT_FLAG_MBUTTON: i32 = 4;
pub const CV_EVENT_FLAG_RBUTTON: i32 = 2;
pub const CV_EVENT_FLAG_SHIFTKEY: i32 = 16;
pub const CV_EVENT_LBUTTONDBLCLK: i32 = 7;
pub const CV_EVENT_LBUTTONDOWN: i32 = 1;
pub const CV_EVENT_LBUTTONUP: i32 = 4;
pub const CV_EVENT_MBUTTONDBLCLK: i32 = 9;
pub const CV_EVENT_MBUTTONDOWN: i32 = 3;
pub const CV_EVENT_MBUTTONUP: i32 = 6;
pub const CV_EVENT_MOUSEHWHEEL: i32 = 11;
pub const CV_EVENT_MOUSEMOVE: i32 = 0;
pub const CV_EVENT_MOUSEWHEEL: i32 = 10;
pub const CV_EVENT_RBUTTONDBLCLK: i32 = 8;
pub const CV_EVENT_RBUTTONDOWN: i32 = 2;
pub const CV_EVENT_RBUTTONUP: i32 = 5;
pub const CV_FILLED: i32 = -1;
pub const CV_FLOODFILL_FIXED_RANGE: i32 = (1 << 16);
pub const CV_FLOODFILL_MASK_ONLY: i32 = (1 << 17);
pub const CV_FM_7POINT: i32 = 1;
pub const CV_FM_8POINT: i32 = 2;
pub const CV_FM_LMEDS: i32 = 4;
pub const CV_FM_LMEDS_ONLY: i32 = 4;
pub const CV_FM_RANSAC: i32 = 8;
pub const CV_FM_RANSAC_ONLY: i32 = 8;
pub const CV_FONT_BLACK: i32 = 87;
pub const CV_FONT_BOLD: i32 = 75;
pub const CV_FONT_DEMIBOLD: i32 = 63;
pub const CV_FONT_HERSHEY_COMPLEX: i32 = 3;
pub const CV_FONT_HERSHEY_COMPLEX_SMALL: i32 = 5;
pub const CV_FONT_HERSHEY_DUPLEX: i32 = 2;
pub const CV_FONT_HERSHEY_PLAIN: i32 = 1;
pub const CV_FONT_HERSHEY_SCRIPT_COMPLEX: i32 = 7;
pub const CV_FONT_HERSHEY_SCRIPT_SIMPLEX: i32 = 6;
pub const CV_FONT_HERSHEY_SIMPLEX: i32 = 0;
pub const CV_FONT_HERSHEY_TRIPLEX: i32 = 4;
pub const CV_FONT_ITALIC: i32 = 16;
pub const CV_FONT_LIGHT: i32 = 25;
pub const CV_FONT_NORMAL: i32 = 50;
pub const CV_FONT_VECTOR0: i32 = 0;
pub const CV_FOURCC_PROMPT: i32 = -1;
pub const CV_FRONT: i32 = 1;
pub const CV_GAUSSIAN: i32 = 2;
pub const CV_GAUSSIAN_5x5: i32 = 7;
pub const CV_GEMM_A_T: i32 = 1;
pub const CV_GEMM_B_T: i32 = 2;
pub const CV_GEMM_C_T: i32 = 4;
pub const CV_GRAPH_ALL_ITEMS: i32 = -1;
pub const CV_GRAPH_ANY_EDGE: i32 = 30;
pub const CV_GRAPH_BACKTRACKING: i32 = 64;
pub const CV_GRAPH_BACK_EDGE: i32 = 4;
pub const CV_GRAPH_CROSS_EDGE: i32 = 16;
pub const CV_GRAPH_FORWARD_EDGE: i32 = 8;
pub const CV_GRAPH_FORWARD_EDGE_FLAG: i32 = (1 << 28);
pub const CV_GRAPH_ITEM_VISITED_FLAG: i32 = (1 << 30);
pub const CV_GRAPH_NEW_TREE: i32 = 32;
pub const CV_GRAPH_OVER: i32 = -1;
pub const CV_GRAPH_SEARCH_TREE_NODE_FLAG: i32 = (1 << 29);
pub const CV_GRAPH_TREE_EDGE: i32 = 2;
pub const CV_GRAPH_VERTEX: i32 = 1;
pub const CV_GRAY2BGR: i32 = 8;
pub const CV_GRAY2BGR555: i32 = 30;
pub const CV_GRAY2BGR565: i32 = 20;
pub const CV_GRAY2BGRA: i32 = 9;
pub const CV_GRAY2RGB: i32 = 8;
pub const CV_GRAY2RGBA: i32 = 9;
pub const CV_GUI_EXPANDED: i32 = 0x00000000;
pub const CV_GUI_NORMAL: i32 = 0x00000010;
pub const CV_GpuApiCallError: i32 = -217;
pub const CV_GpuNotSupported: i32 = -216;
pub const CV_HAAR_DO_CANNY_PRUNING: i32 = 1;
pub const CV_HAAR_DO_ROUGH_SEARCH: i32 = 8;
pub const CV_HAAR_FEATURE_MAX: i32 = 3;
pub const CV_HAAR_FIND_BIGGEST_OBJECT: i32 = 4;
pub const CV_HAAR_MAGIC_VAL: i32 = 0x42500000;
pub const CV_HAAR_SCALE_IMAGE: i32 = 2;
pub const CV_HAAR_STAGE_MAX: i32 = 1000;
pub const CV_HAL_ADAPTIVE_THRESH_GAUSSIAN_C: i32 = 1;
pub const CV_HAL_ADAPTIVE_THRESH_MEAN_C: i32 = 0;
pub const CV_HAL_BORDER_CONSTANT: i32 = 0;
pub const CV_HAL_BORDER_ISOLATED: i32 = 16;
pub const CV_HAL_BORDER_REFLECT: i32 = 2;
pub const CV_HAL_BORDER_REFLECT_101: i32 = 4;
pub const CV_HAL_BORDER_REPLICATE: i32 = 1;
pub const CV_HAL_BORDER_TRANSPARENT: i32 = 5;
pub const CV_HAL_BORDER_WRAP: i32 = 3;
pub const CV_HAL_CMP_EQ: i32 = 0;
pub const CV_HAL_CMP_GE: i32 = 2;
pub const CV_HAL_CMP_GT: i32 = 1;
pub const CV_HAL_CMP_LE: i32 = 4;
pub const CV_HAL_CMP_LT: i32 = 3;
pub const CV_HAL_CMP_NE: i32 = 5;
pub const CV_HAL_DFT_COMPLEX_OUTPUT: i32 = 16;
pub const CV_HAL_DFT_INVERSE: i32 = 1;
pub const CV_HAL_DFT_IS_CONTINUOUS: i32 = 512;
pub const CV_HAL_DFT_IS_INPLACE: i32 = 1024;
pub const CV_HAL_DFT_REAL_OUTPUT: i32 = 32;
pub const CV_HAL_DFT_ROWS: i32 = 4;
pub const CV_HAL_DFT_SCALE: i32 = 2;
pub const CV_HAL_DFT_STAGE_COLS: i32 = 128;
pub const CV_HAL_DFT_TWO_STAGE: i32 = 64;
pub const CV_HAL_ERROR_NOT_IMPLEMENTED: i32 = 1;
pub const CV_HAL_ERROR_OK: i32 = 0;
pub const CV_HAL_ERROR_UNKNOWN: i32 = -1;
pub const CV_HAL_GEMM_1_T: i32 = 1;
pub const CV_HAL_GEMM_2_T: i32 = 2;
pub const CV_HAL_GEMM_3_T: i32 = 4;
pub const CV_HAL_INTER_AREA: i32 = 3;
pub const CV_HAL_INTER_CUBIC: i32 = 2;
pub const CV_HAL_INTER_LANCZOS4: i32 = 4;
pub const CV_HAL_INTER_LINEAR: i32 = 1;
pub const CV_HAL_INTER_NEAREST: i32 = 0;
pub const CV_HAL_MORPH_DILATE: i32 = 1;
pub const CV_HAL_MORPH_ERODE: i32 = 0;
pub const CV_HAL_SVD_FULL_UV: i32 = 8;
pub const CV_HAL_SVD_MODIFY_A: i32 = 4;
pub const CV_HAL_SVD_NO_UV: i32 = 1;
pub const CV_HAL_SVD_SHORT_UV: i32 = 2;
pub const CV_HAL_THRESH_BINARY: i32 = 0;
pub const CV_HAL_THRESH_BINARY_INV: i32 = 1;
pub const CV_HAL_THRESH_MASK: i32 = 7;
pub const CV_HAL_THRESH_OTSU: i32 = 8;
pub const CV_HAL_THRESH_TOZERO: i32 = 3;
pub const CV_HAL_THRESH_TOZERO_INV: i32 = 4;
pub const CV_HAL_THRESH_TRIANGLE: i32 = 16;
pub const CV_HAL_THRESH_TRUNC: i32 = 2;
pub const CV_HAL_TYPE_5_8: i32 = 0;
pub const CV_HAL_TYPE_7_12: i32 = 1;
pub const CV_HAL_TYPE_9_16: i32 = 2;
pub const CV_HARDWARE_MAX_FEATURE: i32 = 512;
pub const CV_HIST_ARRAY: i32 = 0;
pub const CV_HIST_MAGIC_VAL: i32 = 0x42450000;
pub const CV_HIST_RANGES_FLAG: i32 = (1 << 11);
pub const CV_HIST_SPARSE: i32 = 1;
pub const CV_HIST_TREE: i32 = 1;
pub const CV_HIST_UNIFORM: i32 = 1;
pub const CV_HIST_UNIFORM_FLAG: i32 = (1 << 10);
pub const CV_HLS2BGR: i32 = 60;
pub const CV_HLS2BGR_FULL: i32 = 72;
pub const CV_HLS2RGB: i32 = 61;
pub const CV_HLS2RGB_FULL: i32 = 73;
pub const CV_HOUGH_GRADIENT: i32 = 3;
pub const CV_HOUGH_MULTI_SCALE: i32 = 2;
pub const CV_HOUGH_PROBABILISTIC: i32 = 1;
pub const CV_HOUGH_STANDARD: i32 = 0;
pub const CV_HSV2BGR: i32 = 54;
pub const CV_HSV2BGR_FULL: i32 = 70;
pub const CV_HSV2RGB: i32 = 55;
pub const CV_HSV2RGB_FULL: i32 = 71;
pub const CV_HeaderIsNull: i32 = -9;
pub const CV_IMWRITE_EXR_TYPE: i32 = 48;
pub const CV_IMWRITE_JPEG_CHROMA_QUALITY: i32 = 6;
pub const CV_IMWRITE_JPEG_LUMA_QUALITY: i32 = 5;
pub const CV_IMWRITE_JPEG_OPTIMIZE: i32 = 3;
pub const CV_IMWRITE_JPEG_PROGRESSIVE: i32 = 2;
pub const CV_IMWRITE_JPEG_QUALITY: i32 = 1;
pub const CV_IMWRITE_JPEG_RST_INTERVAL: i32 = 4;
pub const CV_IMWRITE_PAM_FORMAT_BLACKANDWHITE: i32 = 1;
pub const CV_IMWRITE_PAM_FORMAT_GRAYSCALE: i32 = 2;
pub const CV_IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA: i32 = 3;
pub const CV_IMWRITE_PAM_FORMAT_NULL: i32 = 0;
pub const CV_IMWRITE_PAM_FORMAT_RGB: i32 = 4;
pub const CV_IMWRITE_PAM_FORMAT_RGB_ALPHA: i32 = 5;
pub const CV_IMWRITE_PAM_TUPLETYPE: i32 = 128;
pub const CV_IMWRITE_PNG_BILEVEL: i32 = 18;
pub const CV_IMWRITE_PNG_COMPRESSION: i32 = 16;
pub const CV_IMWRITE_PNG_STRATEGY: i32 = 17;
pub const CV_IMWRITE_PNG_STRATEGY_DEFAULT: i32 = 0;
pub const CV_IMWRITE_PNG_STRATEGY_FILTERED: i32 = 1;
pub const CV_IMWRITE_PNG_STRATEGY_FIXED: i32 = 4;
pub const CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY: i32 = 2;
pub const CV_IMWRITE_PNG_STRATEGY_RLE: i32 = 3;
pub const CV_IMWRITE_PXM_BINARY: i32 = 32;
pub const CV_IMWRITE_WEBP_QUALITY: i32 = 64;
pub const CV_INPAINT_NS: i32 = 0;
pub const CV_INPAINT_TELEA: i32 = 1;
pub const CV_INTER_AREA: i32 = 3;
pub const CV_INTER_CUBIC: i32 = 2;
pub const CV_INTER_LANCZOS4: i32 = 4;
pub const CV_INTER_LINEAR: i32 = 1;
pub const CV_INTER_NN: i32 = 0;
pub const CV_ITERATIVE: i32 = 0;
pub const CV_KMEANS_USE_INITIAL_LABELS: i32 = 1;
pub const CV_L1: i32 = 2;
pub const CV_L2: i32 = 4;
pub const CV_LBGR2Lab: i32 = 74;
pub const CV_LBGR2Luv: i32 = 76;
pub const CV_LINK_RUNS: i32 = 5;
pub const CV_LKFLOW_GET_MIN_EIGENVALS: i32 = 8;
pub const CV_LKFLOW_INITIAL_GUESSES: i32 = 4;
pub const CV_LKFLOW_PYR_A_READY: i32 = 1;
pub const CV_LKFLOW_PYR_B_READY: i32 = 2;
pub const CV_LMEDS: i32 = 4;
pub const CV_LOAD_IMAGE_ANYCOLOR: i32 = 4;
pub const CV_LOAD_IMAGE_ANYDEPTH: i32 = 2;
pub const CV_LOAD_IMAGE_COLOR: i32 = 1;
pub const CV_LOAD_IMAGE_GRAYSCALE: i32 = 0;
pub const CV_LOAD_IMAGE_IGNORE_ORIENTATION: i32 = 128;
pub const CV_LOAD_IMAGE_UNCHANGED: i32 = -1;
/// !< Debug message. Disabled in the "Release" build.
pub const CV_LOG_LEVEL_DEBUG: i32 = 5;
/// !< Error message
pub const CV_LOG_LEVEL_ERROR: i32 = 2;
/// !< Fatal (critical) error (unrecoverable internal error)
pub const CV_LOG_LEVEL_FATAL: i32 = 1;
/// !< Info message
pub const CV_LOG_LEVEL_INFO: i32 = 4;
/// !< for using in setLogLevel() call
pub const CV_LOG_LEVEL_SILENT: i32 = 0;
/// !< Verbose (trace) messages. Requires verbosity level. Disabled in the "Release" build.
pub const CV_LOG_LEVEL_VERBOSE: i32 = 6;
/// !< Warning message
pub const CV_LOG_LEVEL_WARN: i32 = 3;
pub const CV_LRGB2Lab: i32 = 75;
pub const CV_LRGB2Luv: i32 = 77;
pub const CV_LU: i32 = 0;
pub const CV_Lab2BGR: i32 = 56;
pub const CV_Lab2LBGR: i32 = 78;
pub const CV_Lab2LRGB: i32 = 79;
pub const CV_Lab2RGB: i32 = 57;
pub const CV_Luv2BGR: i32 = 58;
pub const CV_Luv2LBGR: i32 = 80;
pub const CV_Luv2LRGB: i32 = 81;
pub const CV_Luv2RGB: i32 = 59;
pub const CV_MAGIC_MASK: i32 = 0xFFFF0000;
pub const CV_MAJOR_VERSION: i32 = 3;
pub const CV_MATND_MAGIC_VAL: i32 = 0x42430000;
pub const CV_MAT_CONT_FLAG_SHIFT: i32 = 14;
pub const CV_MAT_MAGIC_VAL: i32 = 0x42420000;
pub const CV_MAX_ARR: i32 = 10;
pub const CV_MAX_DIM: i32 = 32;
pub const CV_MAX_SOBEL_KSIZE: i32 = 7;
pub const CV_MEDIAN: i32 = 3;
pub const CV_MINMAX: i32 = 32;
pub const CV_MINOR_VERSION: i32 = 4;
pub const CV_MOP_BLACKHAT: i32 = 6;
pub const CV_MOP_CLOSE: i32 = 3;
pub const CV_MOP_DILATE: i32 = 1;
pub const CV_MOP_ERODE: i32 = 0;
pub const CV_MOP_GRADIENT: i32 = 4;
pub const CV_MOP_OPEN: i32 = 2;
pub const CV_MOP_TOPHAT: i32 = 5;
pub const CV_MaskIsTiled: i32 = -26;
pub const CV_NODE_EMPTY: i32 = 32;
pub const CV_NODE_FLOAT: i32 = 2;
/// <Used only for writing structures in YAML format.
pub const CV_NODE_FLOW: i32 = 8;
pub const CV_NODE_INT: i32 = 1;
pub const CV_NODE_INTEGER: i32 = 1;
pub const CV_NODE_MAP: i32 = 6;
pub const CV_NODE_NAMED: i32 = 64;
pub const CV_NODE_NONE: i32 = 0;
pub const CV_NODE_REAL: i32 = 2;
/// < not used
pub const CV_NODE_REF: i32 = 4;
pub const CV_NODE_SEQ: i32 = 5;
pub const CV_NODE_SEQ_SIMPLE: i32 = 256;
pub const CV_NODE_STR: i32 = 3;
pub const CV_NODE_STRING: i32 = 3;
pub const CV_NODE_TYPE_MASK: i32 = 7;
pub const CV_NODE_USER: i32 = 16;
pub const CV_NORMAL: i32 = 16;
pub const CV_NORM_MASK: i32 = 7;
pub const CV_NO_CN_CHECK: i32 = 2;
pub const CV_NO_DEPTH_CHECK: i32 = 1;
pub const CV_NO_SIZE_CHECK: i32 = 4;
pub const CV_OpenCLApiCallError: i32 = -220;
pub const CV_OpenCLDoubleNotSupported: i32 = -221;
pub const CV_OpenCLInitError: i32 = -222;
pub const CV_OpenCLNoAMDBlasFft: i32 = -223;
pub const CV_OpenGlApiCallError: i32 = -219;
pub const CV_OpenGlNotSupported: i32 = -218;
pub const CV_P3P: i32 = 2;
pub const CV_PCA_DATA_AS_COL: i32 = 1;
pub const CV_PCA_DATA_AS_ROW: i32 = 0;
pub const CV_PCA_USE_AVG: i32 = 2;
pub const CV_POLY_APPROX_DP: i32 = 0;
pub const CV_PUSH_BUTTON: i32 = 0;
pub const CV_QR: i32 = 4;
pub const CV_RADIOBOX: i32 = 2;
pub const CV_RAND_NORMAL: i32 = 1;
pub const CV_RAND_UNI: i32 = 0;
pub const CV_RANSAC: i32 = 8;
pub const CV_REDUCE_AVG: i32 = 1;
pub const CV_REDUCE_MAX: i32 = 2;
pub const CV_REDUCE_MIN: i32 = 3;
pub const CV_REDUCE_SUM: i32 = 0;
pub const CV_RELATIVE: i32 = 8;
pub const CV_RETR_CCOMP: i32 = 2;
pub const CV_RETR_EXTERNAL: i32 = 0;
pub const CV_RETR_FLOODFILL: i32 = 4;
pub const CV_RETR_LIST: i32 = 1;
pub const CV_RETR_TREE: i32 = 3;
pub const CV_RGB2BGR: i32 = 4;
pub const CV_RGB2BGR555: i32 = 23;
pub const CV_RGB2BGR565: i32 = 13;
pub const CV_RGB2BGRA: i32 = 2;
pub const CV_RGB2GRAY: i32 = 7;
pub const CV_RGB2HLS: i32 = 53;
pub const CV_RGB2HLS_FULL: i32 = 69;
pub const CV_RGB2HSV: i32 = 41;
pub const CV_RGB2HSV_FULL: i32 = 67;
pub const CV_RGB2Lab: i32 = 45;
pub const CV_RGB2Luv: i32 = 51;
pub const CV_RGB2RGBA: i32 = 0;
pub const CV_RGB2XYZ: i32 = 33;
pub const CV_RGB2YCrCb: i32 = 37;
pub const CV_RGB2YUV: i32 = 83;
pub const CV_RGB2YUV_I420: i32 = 127;
pub const CV_RGB2YUV_IYUV: i32 = 127;
pub const CV_RGB2YUV_YV12: i32 = 131;
pub const CV_RGBA2BGR: i32 = 3;
pub const CV_RGBA2BGR555: i32 = 27;
pub const CV_RGBA2BGR565: i32 = 17;
pub const CV_RGBA2BGRA: i32 = 5;
pub const CV_RGBA2GRAY: i32 = 11;
pub const CV_RGBA2RGB: i32 = 1;
pub const CV_RGBA2YUV_I420: i32 = 129;
pub const CV_RGBA2YUV_IYUV: i32 = 129;
pub const CV_RGBA2YUV_YV12: i32 = 133;
pub const CV_RGBA2mRGBA: i32 = 125;
pub const CV_SCHARR: i32 = -1;
pub const CV_SEQ_ELTYPE_BITS: i32 = 12;
/// < connected component
pub const CV_SEQ_ELTYPE_CONNECTED_COMP: i32 = 0;
pub const CV_SEQ_ELTYPE_GENERIC: i32 = 0;
/// < &next_o, &next_d, &vtx_o, &vtx_d
pub const CV_SEQ_ELTYPE_GRAPH_EDGE: i32 = 0;
/// < first_edge, &(x,y)
pub const CV_SEQ_ELTYPE_GRAPH_VERTEX: i32 = 0;
pub const CV_SEQ_ELTYPE_PPOINT: i32 = 7;
pub const CV_SEQ_ELTYPE_PTR: i32 = 7;
/// < vertex of the binary tree
pub const CV_SEQ_ELTYPE_TRIAN_ATR: i32 = 0;
pub const CV_SEQ_KIND_BITS: i32 = 2;
pub const CV_SEQ_MAGIC_VAL: i32 = 0x42990000;
pub const CV_SET_MAGIC_VAL: i32 = 0x42980000;
pub const CV_SHAPE_CROSS: i32 = 1;
pub const CV_SHAPE_CUSTOM: i32 = 100;
pub const CV_SHAPE_ELLIPSE: i32 = 2;
pub const CV_SHAPE_RECT: i32 = 0;
pub const CV_SORT_ASCENDING: i32 = 0;
pub const CV_SORT_DESCENDING: i32 = 16;
pub const CV_SORT_EVERY_COLUMN: i32 = 1;
pub const CV_SORT_EVERY_ROW: i32 = 0;
pub const CV_SPARSE_MAT_MAGIC_VAL: i32 = 0x42440000;
pub const CV_STEREO_BM_BASIC: i32 = 0;
pub const CV_STEREO_BM_FISH_EYE: i32 = 1;
pub const CV_STEREO_BM_NARROW: i32 = 2;
pub const CV_STEREO_BM_NORMALIZED_RESPONSE: i32 = 0;
pub const CV_STEREO_BM_XSOBEL: i32 = 1;
pub const CV_STORAGE_APPEND: i32 = 2;
pub const CV_STORAGE_BASE64: i32 = 64;
pub const CV_STORAGE_FORMAT_AUTO: i32 = 0;
pub const CV_STORAGE_FORMAT_JSON: i32 = 24;
pub const CV_STORAGE_FORMAT_MASK: i32 = (7<<3);
pub const CV_STORAGE_FORMAT_XML: i32 = 8;
pub const CV_STORAGE_FORMAT_YAML: i32 = 16;
pub const CV_STORAGE_MAGIC_VAL: i32 = 0x42890000;
pub const CV_STORAGE_MEMORY: i32 = 4;
pub const CV_STORAGE_READ: i32 = 0;
pub const CV_STORAGE_WRITE: i32 = 1;
pub const CV_STORAGE_WRITE_BINARY: i32 = 1;
pub const CV_STORAGE_WRITE_TEXT: i32 = 1;
pub const CV_STYLE_ITALIC: i32 = 1;
pub const CV_STYLE_NORMAL: i32 = 0;
pub const CV_STYLE_OBLIQUE: i32 = 2;
pub const CV_SUBMAT_FLAG_SHIFT: i32 = 15;
pub const CV_SUBMINOR_VERSION: i32 = 5;
pub const CV_SVD: i32 = 1;
pub const CV_SVD_MODIFY_A: i32 = 1;
pub const CV_SVD_SYM: i32 = 2;
pub const CV_SVD_U_T: i32 = 2;
pub const CV_SVD_V_T: i32 = 4;
pub const CV_TERMCRIT_EPS: i32 = 2;
pub const CV_TERMCRIT_ITER: i32 = 1;
pub const CV_TERMCRIT_NUMBER: i32 = 1;
pub const CV_THRESH_BINARY: i32 = 0;
pub const CV_THRESH_BINARY_INV: i32 = 1;
pub const CV_THRESH_MASK: i32 = 7;
pub const CV_THRESH_OTSU: i32 = 8;
pub const CV_THRESH_TOZERO: i32 = 3;
pub const CV_THRESH_TOZERO_INV: i32 = 4;
pub const CV_THRESH_TRIANGLE: i32 = 16;
pub const CV_THRESH_TRUNC: i32 = 2;
pub const CV_TM_CCOEFF: i32 = 4;
pub const CV_TM_CCOEFF_NORMED: i32 = 5;
pub const CV_TM_CCORR: i32 = 2;
pub const CV_TM_CCORR_NORMED: i32 = 3;
pub const CV_TM_SQDIFF: i32 = 0;
pub const CV_TM_SQDIFF_NORMED: i32 = 1;
pub const CV_TYPE_NAME_GRAPH: &'static str = "opencv-graph";
pub const CV_TYPE_NAME_HAAR: &'static str = "opencv-haar-classifier";
pub const CV_TYPE_NAME_MAT: &'static str = "opencv-matrix";
pub const CV_TYPE_NAME_MATND: &'static str = "opencv-nd-matrix";
pub const CV_TYPE_NAME_SEQ: &'static str = "opencv-sequence";
pub const CV_TYPE_NAME_SEQ_TREE: &'static str = "opencv-sequence-tree";
pub const CV_TYPE_NAME_SPARSE_MAT: &'static str = "opencv-sparse-matrix";
pub const CV_TYZX_COLOR: i32 = 402;
pub const CV_TYZX_LEFT: i32 = 400;
pub const CV_TYZX_RIGHT: i32 = 401;
pub const CV_TYZX_Z: i32 = 403;
pub const CV_USRTYPE1: i32 = 7;
pub const CV_VERSION_MAJOR: i32 = 3;
pub const CV_VERSION_MINOR: i32 = 4;
pub const CV_VERSION_REVISION: i32 = 5;
pub const CV_VERSION_STATUS: &'static str = "";
pub const CV_WARP_FILL_OUTLIERS: i32 = 8;
pub const CV_WARP_INVERSE_MAP: i32 = 16;
pub const CV_WINDOW_AUTOSIZE: i32 = 0x00000001;
pub const CV_WINDOW_FREERATIO: i32 = 0x00000100;
pub const CV_WINDOW_FULLSCREEN: i32 = 1;
pub const CV_WINDOW_KEEPRATIO: i32 = 0x00000000;
pub const CV_WINDOW_NORMAL: i32 = 0x00000000;
pub const CV_WINDOW_OPENGL: i32 = 0x00001000;
pub const CV_WND_PROP_ASPECTRATIO: i32 = 2;
pub const CV_WND_PROP_AUTOSIZE: i32 = 1;
pub const CV_WND_PROP_FULLSCREEN: i32 = 0;
pub const CV_WND_PROP_OPENGL: i32 = 3;
pub const CV_WND_PROP_VISIBLE: i32 = 4;
pub const CV_XYZ2BGR: i32 = 34;
pub const CV_XYZ2RGB: i32 = 35;
pub const CV_YCrCb2BGR: i32 = 38;
pub const CV_YCrCb2RGB: i32 = 39;
pub const CV_YUV2BGR: i32 = 84;
pub const CV_YUV2BGRA_I420: i32 = 105;
pub const CV_YUV2BGRA_IYUV: i32 = 105;
pub const CV_YUV2BGRA_NV12: i32 = 95;
pub const CV_YUV2BGRA_NV21: i32 = 97;
pub const CV_YUV2BGRA_UYNV: i32 = 112;
pub const CV_YUV2BGRA_UYVY: i32 = 112;
pub const CV_YUV2BGRA_Y422: i32 = 112;
pub const CV_YUV2BGRA_YUNV: i32 = 120;
pub const CV_YUV2BGRA_YUY2: i32 = 120;
pub const CV_YUV2BGRA_YUYV: i32 = 120;
pub const CV_YUV2BGRA_YV12: i32 = 103;
pub const CV_YUV2BGRA_YVYU: i32 = 122;
pub const CV_YUV2BGR_I420: i32 = 101;
pub const CV_YUV2BGR_IYUV: i32 = 101;
pub const CV_YUV2BGR_NV12: i32 = 91;
pub const CV_YUV2BGR_NV21: i32 = 93;
pub const CV_YUV2BGR_UYNV: i32 = 108;
pub const CV_YUV2BGR_UYVY: i32 = 108;
pub const CV_YUV2BGR_Y422: i32 = 108;
pub const CV_YUV2BGR_YUNV: i32 = 116;
pub const CV_YUV2BGR_YUY2: i32 = 116;
pub const CV_YUV2BGR_YUYV: i32 = 116;
pub const CV_YUV2BGR_YV12: i32 = 99;
pub const CV_YUV2BGR_YVYU: i32 = 118;
pub const CV_YUV2GRAY_420: i32 = 106;
pub const CV_YUV2GRAY_I420: i32 = 106;
pub const CV_YUV2GRAY_IYUV: i32 = 106;
pub const CV_YUV2GRAY_NV12: i32 = 106;
pub const CV_YUV2GRAY_NV21: i32 = 106;
pub const CV_YUV2GRAY_UYNV: i32 = 123;
pub const CV_YUV2GRAY_UYVY: i32 = 123;
pub const CV_YUV2GRAY_Y422: i32 = 123;
pub const CV_YUV2GRAY_YUNV: i32 = 124;
pub const CV_YUV2GRAY_YUY2: i32 = 124;
pub const CV_YUV2GRAY_YUYV: i32 = 124;
pub const CV_YUV2GRAY_YV12: i32 = 106;
pub const CV_YUV2GRAY_YVYU: i32 = 124;
pub const CV_YUV2RGB: i32 = 85;
pub const CV_YUV2RGBA_I420: i32 = 104;
pub const CV_YUV2RGBA_IYUV: i32 = 104;
pub const CV_YUV2RGBA_NV12: i32 = 94;
pub const CV_YUV2RGBA_NV21: i32 = 96;
pub const CV_YUV2RGBA_UYNV: i32 = 111;
pub const CV_YUV2RGBA_UYVY: i32 = 111;
pub const CV_YUV2RGBA_Y422: i32 = 111;
pub const CV_YUV2RGBA_YUNV: i32 = 119;
pub const CV_YUV2RGBA_YUY2: i32 = 119;
pub const CV_YUV2RGBA_YUYV: i32 = 119;
pub const CV_YUV2RGBA_YV12: i32 = 102;
pub const CV_YUV2RGBA_YVYU: i32 = 121;
pub const CV_YUV2RGB_I420: i32 = 100;
pub const CV_YUV2RGB_IYUV: i32 = 100;
pub const CV_YUV2RGB_NV12: i32 = 90;
pub const CV_YUV2RGB_NV21: i32 = 92;
pub const CV_YUV2RGB_UYNV: i32 = 107;
pub const CV_YUV2RGB_UYVY: i32 = 107;
pub const CV_YUV2RGB_Y422: i32 = 107;
pub const CV_YUV2RGB_YUNV: i32 = 115;
pub const CV_YUV2RGB_YUY2: i32 = 115;
pub const CV_YUV2RGB_YUYV: i32 = 115;
pub const CV_YUV2RGB_YV12: i32 = 98;
pub const CV_YUV2RGB_YVYU: i32 = 117;
pub const CV_YUV420p2BGR: i32 = 99;
pub const CV_YUV420p2BGRA: i32 = 103;
pub const CV_YUV420p2GRAY: i32 = 106;
pub const CV_YUV420p2RGB: i32 = 98;
pub const CV_YUV420p2RGBA: i32 = 102;
pub const CV_YUV420sp2BGR: i32 = 93;
pub const CV_YUV420sp2BGRA: i32 = 97;
pub const CV_YUV420sp2GRAY: i32 = 106;
pub const CV_YUV420sp2RGB: i32 = 92;
pub const CV_YUV420sp2RGBA: i32 = 96;
pub const CV_mRGBA2RGBA: i32 = 126;
pub const CirclesGridFinderParameters_ASYMMETRIC_GRID: i32 = 1;
pub const CirclesGridFinderParameters_SYMMETRIC_GRID: i32 = 0;
pub const CvLevMarq_CALC_J: i32 = 2;
pub const CvLevMarq_CHECK_ERR: i32 = 3;
pub const CvLevMarq_DONE: i32 = 0;
pub const CvLevMarq_STARTED: i32 = 1;
pub const DCT_INVERSE: i32 = 1;
pub const DCT_ROWS: i32 = 4;
pub const DECOMP_CHOLESKY: i32 = 3;
pub const DECOMP_EIG: i32 = 2;
pub const DECOMP_LU: i32 = 0;
pub const DECOMP_NORMAL: i32 = 16;
pub const DECOMP_QR: i32 = 4;
pub const DECOMP_SVD: i32 = 1;
pub const DFT_COMPLEX_INPUT: i32 = 64;
pub const DFT_COMPLEX_OUTPUT: i32 = 16;
pub const DFT_INVERSE: i32 = 1;
pub const DFT_REAL_OUTPUT: i32 = 32;
pub const DFT_ROWS: i32 = 4;
pub const DFT_SCALE: i32 = 2;
pub const DIST_C: i32 = 3;
pub const DIST_FAIR: i32 = 5;
pub const DIST_HUBER: i32 = 7;
pub const DIST_L1: i32 = 1;
pub const DIST_L12: i32 = 4;
pub const DIST_L2: i32 = 2;
pub const DIST_LABEL_CCOMP: i32 = 0;
pub const DIST_LABEL_PIXEL: i32 = 1;
pub const DIST_MASK_3: i32 = 3;
pub const DIST_MASK_5: i32 = 5;
pub const DIST_MASK_PRECISE: i32 = 0;
pub const DIST_USER: i32 = -1;
pub const DIST_WELSCH: i32 = 6;
pub const DNN_BACKEND_DEFAULT: i32 = 0;
pub const DNN_BACKEND_HALIDE: i32 = 1;
pub const DNN_BACKEND_INFERENCE_ENGINE: i32 = 2;
pub const DNN_BACKEND_OPENCV: i32 = 3;
pub const DNN_TARGET_CPU: i32 = 0;
pub const DNN_TARGET_FPGA: i32 = 4;
pub const DNN_TARGET_MYRIAD: i32 = 3;
pub const DNN_TARGET_OPENCL: i32 = 1;
pub const DNN_TARGET_OPENCL_FP16: i32 = 2;
pub const DTrees_PREDICT_AUTO: i32 = 0;
pub const DTrees_PREDICT_MASK: i32 = (3<<8);
pub const DTrees_PREDICT_MAX_VOTE: i32 = (2<<8);
pub const DTrees_PREDICT_SUM: i32 = (1<<8);
pub const DescriptorMatcher_BRUTEFORCE: i32 = 2;
pub const DescriptorMatcher_BRUTEFORCE_HAMMING: i32 = 4;
pub const DescriptorMatcher_BRUTEFORCE_HAMMINGLUT: i32 = 5;
pub const DescriptorMatcher_BRUTEFORCE_L1: i32 = 3;
pub const DescriptorMatcher_BRUTEFORCE_SL2: i32 = 6;
pub const DescriptorMatcher_FLANNBASED: i32 = 1;
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 DrawMatchesFlags_DEFAULT: i32 = 0;
pub const DrawMatchesFlags_DRAW_OVER_OUTIMG: i32 = 1;
pub const DrawMatchesFlags_DRAW_RICH_KEYPOINTS: i32 = 4;
pub const DrawMatchesFlags_NOT_DRAW_SINGLE_POINTS: i32 = 2;
pub const EM_COV_MAT_DEFAULT: i32 = 1;
pub const EM_COV_MAT_DIAGONAL: i32 = 1;
pub const EM_COV_MAT_GENERIC: i32 = 2;
pub const EM_COV_MAT_SPHERICAL: i32 = 0;
pub const EM_DEFAULT_MAX_ITERS: i32 = 100;
pub const EM_DEFAULT_NCLUSTERS: i32 = 5;
pub const EM_START_AUTO_STEP: i32 = 0;
pub const EM_START_E_STEP: i32 = 1;
pub const EM_START_M_STEP: i32 = 2;
pub const EVENT_FLAG_ALTKEY: i32 = 32;
pub const EVENT_FLAG_CTRLKEY: i32 = 8;
pub const EVENT_FLAG_LBUTTON: i32 = 1;
pub const EVENT_FLAG_MBUTTON: i32 = 4;
pub const EVENT_FLAG_RBUTTON: i32 = 2;
pub const EVENT_FLAG_SHIFTKEY: i32 = 16;
pub const EVENT_LBUTTONDBLCLK: i32 = 7;
pub const EVENT_LBUTTONDOWN: i32 = 1;
pub const EVENT_LBUTTONUP: i32 = 4;
pub const EVENT_MBUTTONDBLCLK: i32 = 9;
pub const EVENT_MBUTTONDOWN: i32 = 3;
pub const EVENT_MBUTTONUP: i32 = 6;
pub const EVENT_MOUSEHWHEEL: i32 = 11;
pub const EVENT_MOUSEMOVE: i32 = 0;
pub const EVENT_MOUSEWHEEL: i32 = 10;
pub const EVENT_RBUTTONDBLCLK: i32 = 8;
pub const EVENT_RBUTTONDOWN: i32 = 2;
pub const EVENT_RBUTTONUP: i32 = 5;
pub const FILLED: i32 = -1;
pub const FLAGS_EXPAND_SAME_NAMES: i32 = 0x02;
pub const FLAGS_MAPPING: i32 = 0x01;
pub const FLAGS_NONE: i32 = 0;
pub const FLOODFILL_FIXED_RANGE: i32 = 1 << 16;
pub const FLOODFILL_MASK_ONLY: i32 = 1 << 17;
pub const FM_7POINT: i32 = 1;
pub const FM_8POINT: i32 = 2;
pub const FM_LMEDS: i32 = 4;
pub const FM_RANSAC: i32 = 8;
pub const FONT_HERSHEY_COMPLEX: i32 = 3;
pub const FONT_HERSHEY_COMPLEX_SMALL: i32 = 5;
pub const FONT_HERSHEY_DUPLEX: i32 = 2;
pub const FONT_HERSHEY_PLAIN: i32 = 1;
pub const FONT_HERSHEY_SCRIPT_COMPLEX: i32 = 7;
pub const FONT_HERSHEY_SCRIPT_SIMPLEX: i32 = 6;
pub const FONT_HERSHEY_SIMPLEX: i32 = 0;
pub const FONT_HERSHEY_TRIPLEX: i32 = 4;
pub const FONT_ITALIC: i32 = 16;
pub const FastFeatureDetector_FAST_N: i32 = 10002;
pub const FastFeatureDetector_NONMAX_SUPPRESSION: i32 = 10001;
pub const FastFeatureDetector_THRESHOLD: i32 = 10000;
pub const FastFeatureDetector_TYPE_5_8: i32 = 0;
pub const FastFeatureDetector_TYPE_7_12: i32 = 1;
pub const FastFeatureDetector_TYPE_9_16: i32 = 2;
pub const Formatter_FMT_C: i32 = 5;
pub const Formatter_FMT_CSV: i32 = 2;
pub const Formatter_FMT_DEFAULT: i32 = 0;
pub const Formatter_FMT_MATLAB: i32 = 1;
pub const Formatter_FMT_NUMPY: i32 = 4;
pub const Formatter_FMT_PYTHON: i32 = 3;
pub const GC_BGD: i32 = 0;
pub const GC_EVAL: i32 = 2;
pub const GC_EVAL_FREEZE_MODEL: i32 = 3;
pub const GC_FGD: i32 = 1;
pub const GC_INIT_WITH_MASK: i32 = 1;
pub const GC_INIT_WITH_RECT: i32 = 0;
pub const GC_PR_BGD: i32 = 2;
pub const GC_PR_FGD: i32 = 3;
pub const GEMM_1_T: i32 = 1;
pub const GEMM_2_T: i32 = 2;
pub const GEMM_3_T: i32 = 4;
pub const GpuApiCallError: i32 = -217;
pub const GpuNotSupported: i32 = -216;
pub const HG_AUTOSIZE: i32 = 0x00000001;
pub const HISTCMP_BHATTACHARYYA: i32 = 3;
pub const HISTCMP_CHISQR: i32 = 1;
pub const HISTCMP_CHISQR_ALT: i32 = 4;
pub const HISTCMP_CORREL: i32 = 0;
pub const HISTCMP_HELLINGER: i32 = 3;
pub const HISTCMP_INTERSECT: i32 = 2;
pub const HISTCMP_KL_DIV: i32 = 5;
pub const HOGDescriptor_DEFAULT_NLEVELS: i32 = 64;
pub const HOGDescriptor_L2Hys: i32 = 0;
pub const HOUGH_GRADIENT: i32 = 3;
pub const HOUGH_MULTI_SCALE: i32 = 2;
pub const HOUGH_PROBABILISTIC: i32 = 1;
pub const HOUGH_STANDARD: i32 = 0;
pub const Hamming_normType: i32 = 6;
pub const HeaderIsNull: i32 = -9;
pub const IMPL_IPP: i32 = 0+1;
pub const IMPL_OPENCL: i32 = 0+2;
pub const IMPL_PLAIN: i32 = 0;
pub const IMREAD_ANYCOLOR: i32 = 4;
pub const IMREAD_ANYDEPTH: i32 = 2;
pub const IMREAD_COLOR: i32 = 1;
pub const IMREAD_GRAYSCALE: i32 = 0;
pub const IMREAD_IGNORE_ORIENTATION: i32 = 128;
pub const IMREAD_LOAD_GDAL: i32 = 8;
pub const IMREAD_REDUCED_COLOR_2: i32 = 17;
pub const IMREAD_REDUCED_COLOR_4: i32 = 33;
pub const IMREAD_REDUCED_COLOR_8: i32 = 65;
pub const IMREAD_REDUCED_GRAYSCALE_2: i32 = 16;
pub const IMREAD_REDUCED_GRAYSCALE_4: i32 = 32;
pub const IMREAD_REDUCED_GRAYSCALE_8: i32 = 64;
pub const IMREAD_UNCHANGED: i32 = -1;
pub const IMWRITE_EXR_TYPE_FLOAT: i32 = 2;
pub const IMWRITE_EXR_TYPE_HALF: i32 = 1;
pub const IMWRITE_JPEG_CHROMA_QUALITY: i32 = 6;
pub const IMWRITE_JPEG_LUMA_QUALITY: i32 = 5;
pub const IMWRITE_JPEG_OPTIMIZE: i32 = 3;
pub const IMWRITE_JPEG_PROGRESSIVE: i32 = 2;
pub const IMWRITE_JPEG_QUALITY: i32 = 1;
pub const IMWRITE_JPEG_RST_INTERVAL: i32 = 4;
pub const IMWRITE_PAM_FORMAT_BLACKANDWHITE: i32 = 1;
pub const IMWRITE_PAM_FORMAT_GRAYSCALE: i32 = 2;
pub const IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA: i32 = 3;
pub const IMWRITE_PAM_FORMAT_NULL: i32 = 0;
pub const IMWRITE_PAM_FORMAT_RGB: i32 = 4;
pub const IMWRITE_PAM_FORMAT_RGB_ALPHA: i32 = 5;
pub const IMWRITE_PAM_TUPLETYPE: i32 = 128;
pub const IMWRITE_PNG_BILEVEL: i32 = 18;
pub const IMWRITE_PNG_COMPRESSION: i32 = 16;
pub const IMWRITE_PNG_STRATEGY: i32 = 17;
pub const IMWRITE_PNG_STRATEGY_DEFAULT: i32 = 0;
pub const IMWRITE_PNG_STRATEGY_FILTERED: i32 = 1;
pub const IMWRITE_PNG_STRATEGY_FIXED: i32 = 4;
pub const IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY: i32 = 2;
pub const IMWRITE_PNG_STRATEGY_RLE: i32 = 3;
pub const IMWRITE_PXM_BINARY: i32 = 32;
pub const IMWRITE_TIFF_RESUNIT: i32 = 256;
pub const IMWRITE_TIFF_XDPI: i32 = 257;
pub const IMWRITE_TIFF_YDPI: i32 = 258;
pub const IMWRITE_WEBP_QUALITY: i32 = 64;
pub const INPAINT_NS: i32 = 0;
pub const INPAINT_TELEA: i32 = 1;
pub const INTERSECT_FULL: i32 = 2;
pub const INTERSECT_NONE: i32 = 0;
pub const INTERSECT_PARTIAL: i32 = 1;
pub const INTER_AREA: i32 = 3;
pub const INTER_BITS: i32 = 5;
pub const INTER_CUBIC: i32 = 2;
pub const INTER_LANCZOS4: i32 = 4;
pub const INTER_LINEAR: i32 = 1;
pub const INTER_LINEAR_EXACT: i32 = 5;
pub const INTER_MAX: i32 = 7;
pub const INTER_NEAREST: i32 = 0;
pub const IPL_ALIGN_16BYTES: i32 = 16;
pub const IPL_ALIGN_32BYTES: i32 = 32;
pub const IPL_ALIGN_4BYTES: i32 = 4;
pub const IPL_ALIGN_8BYTES: i32 = 8;
pub const IPL_ALIGN_DWORD: i32 = 4;
pub const IPL_ALIGN_QWORD: i32 = 8;
pub const IPL_BORDER_CONSTANT: i32 = 0;
pub const IPL_BORDER_REFLECT: i32 = 2;
pub const IPL_BORDER_REFLECT_101: i32 = 4;
pub const IPL_BORDER_REPLICATE: i32 = 1;
pub const IPL_BORDER_TRANSPARENT: i32 = 5;
pub const IPL_BORDER_WRAP: i32 = 3;
pub const IPL_DATA_ORDER_PIXEL: i32 = 0;
pub const IPL_DATA_ORDER_PLANE: i32 = 1;
pub const IPL_DEPTH_16U: i32 = 16;
pub const IPL_DEPTH_1U: i32 = 1;
pub const IPL_DEPTH_32F: i32 = 32;
pub const IPL_DEPTH_64F: i32 = 64;
pub const IPL_DEPTH_8U: i32 = 8;
pub const IPL_DEPTH_SIGN: i32 = 0x80000000;
pub const IPL_IMAGE_DATA: i32 = 2;
pub const IPL_IMAGE_HEADER: i32 = 1;
pub const IPL_IMAGE_ROI: i32 = 4;
pub const IPL_ORIGIN_BL: i32 = 1;
pub const IPL_ORIGIN_TL: i32 = 0;
pub const KAZE_DIFF_CHARBONNIER: i32 = 3;
pub const KAZE_DIFF_PM_G1: i32 = 0;
pub const KAZE_DIFF_PM_G2: i32 = 1;
pub const KAZE_DIFF_WEICKERT: i32 = 2;
pub const KMEANS_PP_CENTERS: i32 = 2;
pub const KMEANS_RANDOM_CENTERS: i32 = 0;
pub const KMEANS_USE_INITIAL_LABELS: i32 = 1;
pub const KNearest_BRUTE_FORCE: i32 = 1;
pub const KNearest_KDTREE: i32 = 2;
pub const LDR_SIZE: i32 = 256;
pub const LINE_4: i32 = 4;
pub const LINE_8: i32 = 8;
pub const LINE_AA: i32 = 16;
pub const LMEDS: i32 = 4;
pub const LOG_LEVEL_DEBUG: i32 = 5;
pub const LOG_LEVEL_ERROR: i32 = 2;
pub const LOG_LEVEL_FATAL: i32 = 1;
pub const LOG_LEVEL_INFO: i32 = 4;
pub const LOG_LEVEL_SILENT: i32 = 0;
pub const LOG_LEVEL_VERBOSE: i32 = 6;
pub const LOG_LEVEL_WARNING: i32 = 3;
pub const LSD_REFINE_ADV: i32 = 2;
pub const LSD_REFINE_NONE: i32 = 0;
pub const LSD_REFINE_STD: i32 = 1;
pub const LogisticRegression_BATCH: i32 = 0;
pub const LogisticRegression_MINI_BATCH: i32 = 1;
pub const LogisticRegression_REG_DISABLE: i32 = -1;
pub const LogisticRegression_REG_L1: i32 = 0;
pub const LogisticRegression_REG_L2: i32 = 1;
pub const MARKER_CROSS: i32 = 0;
pub const MARKER_DIAMOND: i32 = 3;
pub const MARKER_SQUARE: i32 = 4;
pub const MARKER_STAR: i32 = 2;
pub const MARKER_TILTED_CROSS: i32 = 1;
pub const MARKER_TRIANGLE_DOWN: i32 = 6;
pub const MARKER_TRIANGLE_UP: i32 = 5;
pub const MIXED_CLONE: i32 = 2;
pub const MM_AFFINE: i32 = 5;
pub const MM_HOMOGRAPHY: i32 = 6;
pub const MM_RIGID: i32 = 3;
pub const MM_ROTATION: i32 = 2;
pub const MM_SIMILARITY: i32 = 4;
pub const MM_TRANSLATION: i32 = 0;
pub const MM_TRANSLATION_AND_SCALE: i32 = 1;
pub const MM_UNKNOWN: i32 = 7;
pub const MONOCHROME_TRANSFER: i32 = 3;
pub const MORPH_BLACKHAT: i32 = 6;
pub const MORPH_CLOSE: i32 = 3;
pub const MORPH_CROSS: i32 = 1;
pub const MORPH_DILATE: i32 = 1;
pub const MORPH_ELLIPSE: i32 = 2;
pub const MORPH_ERODE: i32 = 0;
pub const MORPH_GRADIENT: i32 = 4;
pub const MORPH_HITMISS: i32 = 7;
pub const MORPH_OPEN: i32 = 2;
pub const MORPH_RECT: i32 = 0;
pub const MORPH_TOPHAT: i32 = 5;
pub const MOTION_AFFINE: i32 = 2;
pub const MOTION_EUCLIDEAN: i32 = 1;
pub const MOTION_HOMOGRAPHY: i32 = 3;
pub const MOTION_TRANSLATION: i32 = 0;
pub const MaskIsTiled: i32 = -26;
pub const Mat_AUTO_STEP: i32 = 0;
pub const Mat_DEPTH_MASK: i32 = 7;
pub const Mat_MAGIC_MASK: i32 = 0xFFFF0000;
pub const Mat_MAGIC_VAL: i32 = 0x42FF0000;
pub const Mat_TYPE_MASK: i32 = 0x00000FFF;
pub const NORMAL_CLONE: i32 = 1;
pub const NORMCONV_FILTER: i32 = 2;
pub const NORM_HAMMING: i32 = 6;
pub const NORM_HAMMING2: i32 = 7;
pub const NORM_INF: i32 = 1;
pub const NORM_L1: i32 = 2;
pub const NORM_L2: i32 = 4;
pub const NORM_L2SQR: i32 = 5;
pub const NORM_MINMAX: i32 = 32;
pub const NORM_RELATIVE: i32 = 8;
pub const NORM_TYPE_MASK: i32 = 7;
pub const OPENCV_ABI_COMPATIBILITY: i32 = 300;
pub const OPTFLOW_FARNEBACK_GAUSSIAN: i32 = 256;
pub const OPTFLOW_LK_GET_MIN_EIGENVALS: i32 = 8;
pub const OPTFLOW_USE_INITIAL_FLOW: i32 = 4;
pub const ORB_FAST_SCORE: i32 = 1;
pub const ORB_HARRIS_SCORE: i32 = 0;
pub const ORB_kBytes: i32 = 32;
pub const OpenCLApiCallError: i32 = -220;
pub const OpenCLDoubleNotSupported: i32 = -221;
pub const OpenCLInitError: i32 = -222;
pub const OpenCLNoAMDBlasFft: i32 = -223;
pub const OpenGlApiCallError: i32 = -219;
pub const OpenGlNotSupported: i32 = -218;
pub const PCA_DATA_AS_COL: i32 = 1;
pub const PCA_DATA_AS_ROW: i32 = 0;
pub const PCA_USE_AVG: i32 = 2;
pub const PROJ_SPHERICAL_EQRECT: i32 = 1;
pub const PROJ_SPHERICAL_ORTHO: i32 = 0;
pub const Param_ALGORITHM: i32 = 6;
pub const Param_BOOLEAN: i32 = 1;
pub const Param_FLOAT: i32 = 7;
pub const Param_INT: i32 = 0;
pub const Param_MAT: i32 = 4;
pub const Param_MAT_VECTOR: i32 = 5;
pub const Param_REAL: i32 = 2;
pub const Param_SCALAR: i32 = 12;
pub const Param_STRING: i32 = 3;
pub const Param_UCHAR: i32 = 11;
pub const Param_UINT64: i32 = 9;
pub const Param_UNSIGNED_INT: i32 = 8;
pub const QT_CHECKBOX: i32 = 1;
pub const QT_FONT_BLACK: i32 = 87;
pub const QT_FONT_BOLD: i32 = 75;
pub const QT_FONT_DEMIBOLD: i32 = 63;
pub const QT_FONT_LIGHT: i32 = 25;
pub const QT_FONT_NORMAL: i32 = 50;
pub const QT_NEW_BUTTONBAR: i32 = 1024;
pub const QT_PUSH_BUTTON: i32 = 0;
pub const QT_RADIOBOX: i32 = 2;
pub const QT_STYLE_ITALIC: i32 = 1;
pub const QT_STYLE_NORMAL: i32 = 0;
pub const QT_STYLE_OBLIQUE: i32 = 2;
pub const RANSAC: i32 = 8;
pub const RECURS_FILTER: i32 = 1;
pub const REDUCE_AVG: i32 = 1;
pub const REDUCE_MAX: i32 = 2;
pub const REDUCE_MIN: i32 = 3;
pub const REDUCE_SUM: i32 = 0;
pub const RETR_CCOMP: i32 = 2;
pub const RETR_EXTERNAL: i32 = 0;
pub const RETR_FLOODFILL: i32 = 4;
pub const RETR_LIST: i32 = 1;
pub const RETR_TREE: i32 = 3;
pub const RHO: i32 = 16;
pub const RNG_NORMAL: i32 = 1;
pub const RNG_UNIFORM: i32 = 0;
pub const ROTATE_180: i32 = 1;
pub const ROTATE_90_CLOCKWISE: i32 = 0;
pub const ROTATE_90_COUNTERCLOCKWISE: i32 = 2;
pub const ROW_SAMPLE: i32 = 0;
pub const SOLVELP_MULTI: i32 = 1;
pub const SOLVELP_SINGLE: i32 = 0;
pub const SOLVELP_UNBOUNDED: i32 = -2;
pub const SOLVELP_UNFEASIBLE: i32 = -1;
pub const SOLVEPNP_AP3P: i32 = 5;
pub const SOLVEPNP_DLS: i32 = 3;
pub const SOLVEPNP_EPNP: i32 = 1;
pub const SOLVEPNP_ITERATIVE: i32 = 0;
pub const SOLVEPNP_MAX_COUNT: i32 = 5+1;
pub const SOLVEPNP_P3P: i32 = 2;
pub const SOLVEPNP_UPNP: i32 = 4;
pub const SORT_ASCENDING: i32 = 0;
pub const SORT_DESCENDING: i32 = 16;
pub const SORT_EVERY_COLUMN: i32 = 1;
pub const SORT_EVERY_ROW: i32 = 0;
pub const SVD_FULL_UV: i32 = 4;
pub const SVD_MODIFY_A: i32 = 1;
pub const SVD_NO_UV: i32 = 2;
pub const SVMSGD_ASGD: i32 = 1;
pub const SVMSGD_HARD_MARGIN: i32 = 1;
pub const SVMSGD_SGD: i32 = 0;
pub const SVMSGD_SOFT_MARGIN: i32 = 0;
pub const SVM_C: i32 = 0;
pub const SVM_CHI2: i32 = 4;
pub const SVM_COEF: i32 = 4;
pub const SVM_CUSTOM: i32 = -1;
pub const SVM_C_SVC: i32 = 100;
pub const SVM_DEGREE: i32 = 5;
pub const SVM_EPS_SVR: i32 = 103;
pub const SVM_GAMMA: i32 = 1;
pub const SVM_INTER: i32 = 5;
pub const SVM_LINEAR: i32 = 0;
pub const SVM_NU: i32 = 3;
pub const SVM_NU_SVC: i32 = 101;
pub const SVM_NU_SVR: i32 = 104;
pub const SVM_ONE_CLASS: i32 = 102;
pub const SVM_P: i32 = 2;
pub const SVM_POLY: i32 = 1;
pub const SVM_RBF: i32 = 2;
pub const SVM_SIGMOID: i32 = 3;
pub const SparseMat_HASH_BIT: i32 = 0x80000000;
pub const SparseMat_HASH_SCALE: i32 = 0x5bd1e995;
pub const SparseMat_MAX_DIM: i32 = 32;
pub const StatModel_COMPRESSED_INPUT: i32 = 2;
pub const StatModel_PREPROCESSED_INPUT: i32 = 4;
pub const StatModel_RAW_OUTPUT: i32 = 1;
pub const StatModel_UPDATE_MODEL: i32 = 1;
pub const StereoBM_PREFILTER_NORMALIZED_RESPONSE: i32 = 0;
pub const StereoBM_PREFILTER_XSOBEL: i32 = 1;
pub const StereoMatcher_DISP_SHIFT: i32 = 4;
pub const StereoSGBM_MODE_HH: i32 = 1;
pub const StereoSGBM_MODE_HH4: i32 = 3;
pub const StereoSGBM_MODE_SGBM: i32 = 0;
pub const StereoSGBM_MODE_SGBM_3WAY: i32 = 2;
pub const Stitcher_ERR_CAMERA_PARAMS_ADJUST_FAIL: i32 = 3;
pub const Stitcher_ERR_HOMOGRAPHY_EST_FAIL: i32 = 2;
pub const Stitcher_ERR_NEED_MORE_IMGS: i32 = 1;
pub const Stitcher_OK: i32 = 0;
pub const Stitcher_ORIG_RESOL: i32 = -1;
pub const Stitcher_PANORAMA: i32 = 0;
pub const Stitcher_SCANS: i32 = 1;
pub const StsAssert: i32 = -215;
pub const StsAutoTrace: i32 = -8;
pub const StsBackTrace: i32 = -1;
pub const StsBadArg: i32 = -5;
pub const StsBadFlag: i32 = -206;
pub const StsBadFunc: i32 = -6;
pub const StsBadMask: i32 = -208;
pub const StsBadMemBlock: i32 = -214;
pub const StsBadPoint: i32 = -207;
pub const StsBadSize: i32 = -201;
pub const StsDivByZero: i32 = -202;
pub const StsError: i32 = -2;
pub const StsFilterOffsetErr: i32 = -31;
pub const StsFilterStructContentErr: i32 = -29;
pub const StsInplaceNotSupported: i32 = -203;
pub const StsInternal: i32 = -3;
pub const StsKernelStructContentErr: i32 = -30;
pub const StsNoConv: i32 = -7;
pub const StsNoMem: i32 = -4;
pub const StsNotImplemented: i32 = -213;
pub const StsNullPtr: i32 = -27;
pub const StsObjectNotFound: i32 = -204;
pub const StsOk: i32 = 0;
pub const StsOutOfRange: i32 = -211;
pub const StsParseError: i32 = -212;
pub const StsUnmatchedFormats: i32 = -205;
pub const StsUnmatchedSizes: i32 = -209;
pub const StsUnsupportedFormat: i32 = -210;
pub const StsVecLengthErr: i32 = -28;
pub const Subdiv2D_NEXT_AROUND_DST: i32 = 0x22;
pub const Subdiv2D_NEXT_AROUND_LEFT: i32 = 0x13;
pub const Subdiv2D_NEXT_AROUND_ORG: i32 = 0x00;
pub const Subdiv2D_NEXT_AROUND_RIGHT: i32 = 0x31;
pub const Subdiv2D_PREV_AROUND_DST: i32 = 0x33;
pub const Subdiv2D_PREV_AROUND_LEFT: i32 = 0x20;
pub const Subdiv2D_PREV_AROUND_ORG: i32 = 0x11;
pub const Subdiv2D_PREV_AROUND_RIGHT: i32 = 0x02;
pub const Subdiv2D_PTLOC_ERROR: i32 = -2;
pub const Subdiv2D_PTLOC_INSIDE: i32 = 0;
pub const Subdiv2D_PTLOC_ON_EDGE: i32 = 2;
pub const Subdiv2D_PTLOC_OUTSIDE_RECT: i32 = -1;
pub const Subdiv2D_PTLOC_VERTEX: i32 = 1;
pub const TEST_ERROR: i32 = 0;
pub const THRESH_BINARY: i32 = 0;
pub const THRESH_BINARY_INV: i32 = 1;
pub const THRESH_MASK: i32 = 7;
pub const THRESH_OTSU: i32 = 8;
pub const THRESH_TOZERO: i32 = 3;
pub const THRESH_TOZERO_INV: i32 = 4;
pub const THRESH_TRIANGLE: i32 = 16;
pub const THRESH_TRUNC: i32 = 2;
pub const TM_CCOEFF: i32 = 4;
pub const TM_CCOEFF_NORMED: i32 = 5;
pub const TM_CCORR: i32 = 2;
pub const TM_CCORR_NORMED: i32 = 3;
pub const TM_SQDIFF: i32 = 0;
pub const TM_SQDIFF_NORMED: i32 = 1;
pub const TRAIN_ERROR: i32 = 1;
pub const TYPE_FUN: i32 = 0+3;
pub const TYPE_GENERAL: i32 = 0;
pub const TYPE_MARKER: i32 = 0+1;
pub const TYPE_WRAPPER: i32 = 0+2;
pub const TermCriteria_COUNT: i32 = 1;
pub const TermCriteria_EPS: i32 = 2;
pub const TermCriteria_MAX_ITER: i32 = 1;
pub const UMatData_ASYNC_CLEANUP: i32 = 128;
pub const UMatData_COPY_ON_MAP: i32 = 1;
pub const UMatData_DEVICE_COPY_OBSOLETE: i32 = 4;
pub const UMatData_DEVICE_MEM_MAPPED: i32 = 64;
pub const UMatData_HOST_COPY_OBSOLETE: i32 = 2;
pub const UMatData_TEMP_COPIED_UMAT: i32 = 24;
pub const UMatData_TEMP_UMAT: i32 = 8;
pub const UMatData_USER_ALLOCATED: i32 = 32;
pub const USAGE_ALLOCATE_DEVICE_MEMORY: i32 = 1 << 1;
pub const USAGE_ALLOCATE_HOST_MEMORY: i32 = 1 << 0;
pub const USAGE_ALLOCATE_SHARED_MEMORY: i32 = 1 << 2;
pub const USAGE_DEFAULT: i32 = 0;
pub const VAR_CATEGORICAL: i32 = 1;
pub const VAR_NUMERICAL: i32 = 0;
pub const VAR_ORDERED: i32 = 0;
pub const VIDEOWRITER_PROP_FRAMEBYTES: i32 = 2;
pub const VIDEOWRITER_PROP_NSTRIPES: i32 = 3;
pub const VIDEOWRITER_PROP_QUALITY: i32 = 1;
pub const WARP_FILL_OUTLIERS: i32 = 8;
pub const WARP_INVERSE_MAP: i32 = 16;
pub const WARP_POLAR_LINEAR: i32 = 0;
pub const WARP_POLAR_LOG: i32 = 256;
pub const WINDOW_AUTOSIZE: i32 = 0x00000001;
pub const WINDOW_FREERATIO: i32 = 0x00000100;
pub const WINDOW_FULLSCREEN: i32 = 1;
pub const WINDOW_GUI_EXPANDED: i32 = 0x00000000;
pub const WINDOW_GUI_NORMAL: i32 = 0x00000010;
pub const WINDOW_KEEPRATIO: i32 = 0x00000000;
pub const WINDOW_NORMAL: i32 = 0x00000000;
pub const WINDOW_OPENGL: i32 = 0x00001000;
pub const WND_PROP_ASPECT_RATIO: i32 = 2;
pub const WND_PROP_AUTOSIZE: i32 = 1;
pub const WND_PROP_FULLSCREEN: i32 = 0;
pub const WND_PROP_OPENGL: i32 = 3;
pub const WND_PROP_VISIBLE: i32 = 4;
pub const _InputArray_KIND_SHIFT: i32 = 16;
pub const __UMAT_USAGE_FLAGS_32BIT: i32 = 0x7fffffff;
/// a < b ? -1 : a > b ? 1 : 0
pub type CvCmpFuncExtern = Option<extern "C" fn(a: *const c_void, b: *const c_void, userdata: *mut c_void)>;
/// a < b ? -1 : a > b ? 1 : 0
pub type CvCmpFunc = dyn FnMut(&c_void, &c_void) + Send + Sync + 'static;
pub type Cv_iplCreateROIExtern = Option<extern "C" fn(unnamed_arg: i32, unnamed_arg_1: i32, unnamed_arg_2: i32, unnamed_arg_3: i32, unnamed_arg_4: i32)>;
pub type Cv_iplCreateROI = dyn FnMut(i32, i32, i32, i32, i32) + Send + Sync + 'static;
pub type CvErrorCallbackExtern = Option<extern "C" fn(status: i32, func_name: *const c_char, err_msg: *const c_char, file_name: *const c_char, line: i32, userdata: *mut c_void)>;
pub type CvErrorCallback = dyn FnMut(i32, String, String, String, i32) + Send + Sync + 'static;
/// < map (collection of named file nodes)
pub type CvIsInstanceFuncExtern = Option<extern "C" fn(struct_ptr: *const c_void)>;
/// < map (collection of named file nodes)
pub type CvIsInstanceFunc = dyn FnMut(&c_void) + Send + Sync + 'static;
pub type CvCloneFuncExtern = Option<extern "C" fn(struct_ptr: *const c_void)>;
pub type CvCloneFunc = dyn FnMut(&c_void) + Send + Sync + 'static;
/// Callback function for mouse events. see cv::setMouseCallback
/// ## Parameters
/// * event: one of the cv::MouseEventTypes constants.
/// * x: The x-coordinate of the mouse event.
/// * y: The y-coordinate of the mouse event.
/// * flags: one of the cv::MouseEventFlags constants.
/// * userdata: The optional parameter.
pub type MouseCallbackExtern = Option<extern "C" fn(event: i32, x: i32, y: i32, flags: i32, userdata: *mut c_void)>;
/// Callback function for mouse events. see cv::setMouseCallback
/// ## Parameters
/// * event: one of the cv::MouseEventTypes constants.
/// * x: The x-coordinate of the mouse event.
/// * y: The y-coordinate of the mouse event.
/// * flags: one of the cv::MouseEventFlags constants.
/// * userdata: The optional parameter.
pub type MouseCallback = dyn FnMut(i32, i32, i32, i32) + Send + Sync + 'static;
/// Callback function for Trackbar see cv::createTrackbar
/// ## Parameters
/// * pos: current position of the specified trackbar.
/// * userdata: The optional parameter.
pub type TrackbarCallbackExtern = Option<extern "C" fn(pos: i32, userdata: *mut c_void)>;
/// Callback function for Trackbar see cv::createTrackbar
/// ## Parameters
/// * pos: current position of the specified trackbar.
/// * userdata: The optional parameter.
pub type TrackbarCallback = dyn FnMut(i32) + Send + Sync + 'static;
/// Callback function defined to be called every frame. See cv::setOpenGlDrawCallback
/// ## Parameters
/// * userdata: The optional parameter.
pub type OpenGlDrawCallbackExtern = Option<extern "C" fn(userdata: *mut c_void)>;
/// Callback function defined to be called every frame. See cv::setOpenGlDrawCallback
/// ## Parameters
/// * userdata: The optional parameter.
pub type OpenGlDrawCallback = dyn FnMut() + Send + Sync + 'static;
/// Callback function for a button created by cv::createButton
/// ## Parameters
/// * state: current state of the button. It could be -1 for a push button, 0 or 1 for a check/radio box button.
/// * userdata: The optional parameter.
pub type ButtonCallbackExtern = Option<extern "C" fn(state: i32, userdata: *mut c_void)>;
/// Callback function for a button created by cv::createButton
/// ## Parameters
/// * state: current state of the button. It could be -1 for a push button, 0 or 1 for a check/radio box button.
/// * userdata: The optional parameter.
pub type ButtonCallback = dyn FnMut(i32) + Send + Sync + 'static;
pub type CvButtonCallbackExtern = Option<extern "C" fn(state: i32, userdata: *mut c_void)>;
pub type CvButtonCallback = dyn FnMut(i32) + Send + Sync + 'static;
pub type CvTrackbarCallbackExtern = Option<extern "C" fn(pos: i32)>;
pub type CvTrackbarCallback = dyn FnMut(i32) + Send + Sync + 'static;
pub type CvTrackbarCallback2Extern = Option<extern "C" fn(pos: i32, userdata: *mut c_void)>;
pub type CvTrackbarCallback2 = dyn FnMut(i32) + Send + Sync + 'static;
pub type CvMouseCallbackExtern = Option<extern "C" fn(event: i32, x: i32, y: i32, flags: i32, param: *mut c_void)>;
pub type CvMouseCallback = dyn FnMut(i32, i32, i32, i32, &mut c_void) + Send + Sync + 'static;
pub type CvOpenGlDrawCallbackExtern = Option<extern "C" fn(userdata: *mut c_void)>;
pub type CvOpenGlDrawCallback = dyn FnMut() + Send + Sync + 'static;
pub type CvDistanceFunctionExtern = Option<extern "C" fn(a: *const f32, b: *const f32, user_param: *mut c_void)>;
pub type CvDistanceFunction = dyn FnMut(&f32, &f32, &mut c_void) + Send + Sync + 'static;
pub type Vec8i = core::Vec8<i32>;
pub type Vec6d = core::Vec6<f64>;
pub type Vec6f = core::Vec6<f32>;
pub type Vec6i = core::Vec6<i32>;
pub type Vec4d = core::Vec4<f64>;
pub type Vec4f = core::Vec4<f32>;
pub type Vec4i = core::Vec4<i32>;
pub type Vec4w = core::Vec4<u16>;
pub type Vec4s = core::Vec4<i16>;
pub type Vec4b = core::Vec4<u8>;
pub type Vec3d = core::Vec3<f64>;
pub type Vec3f = core::Vec3<f32>;
pub type Vec3i = core::Vec3<i32>;
pub type Vec3w = core::Vec3<u16>;
pub type Vec3s = core::Vec3<i16>;
pub type Vec3b = core::Vec3<u8>;
pub type Vec2d = core::Vec2<f64>;
pub type Size2d = core::Size_<f64>;
pub type Point2d = core::Point_<f64>;
pub type Rect2d = core::Rect_<f64>;
pub type Vec2f = core::Vec2<f32>;
pub type Size2f = core::Size_<f32>;
pub type Point2f = core::Point_<f32>;
pub type Rect2f = core::Rect_<f32>;
pub type Size2l = core::Size_<i64>;
pub type Point2l = core::Point_<i64>;
pub type Vec2i = core::Vec2<i32>;
pub type Size2i = core::Size_<i32>;
pub type Point2i = core::Point_<i32>;
pub type Rect2i = core::Rect_<i32>;
pub type Size = core::Size_<i32>;
pub type Point = core::Point_<i32>;
pub type Rect = core::Rect_<i32>;
pub type Vec2w = core::Vec2<u16>;
pub type Vec2s = core::Vec2<i16>;
pub type Vec2b = core::Vec2<u8>;
pub type Scalar = core::Scalar_<f64>;
/// Class for matching keypoint descriptors
///
/// query descriptor index, train descriptor index, train image index, and distance between
/// descriptors.
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct DMatch {
pub query_idx: i32,
pub train_idx: i32,
pub img_idx: i32,
pub distance: f32,
}
/// Data structure for salient point detectors.
///
/// The class instance stores a keypoint, i.e. a point feature found by one of many available keypoint
/// detectors, such as Harris corner detector, #FAST, %StarDetector, %SURF, %SIFT etc.
///
/// The keypoint is characterized by the 2D position, scale (proportional to the diameter of the
/// neighborhood that needs to be taken into account), orientation and some other parameters. The
/// keypoint neighborhood is then analyzed by another algorithm that builds a descriptor (usually
/// represented as a feature vector). The keypoints representing the same object in different images
/// can then be matched using %KDTree or another method.
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct KeyPoint {
pub pt: core::Point2f,
pub size: f32,
pub angle: f32,
pub response: f32,
pub octave: i32,
pub class_id: i32,
}
/// struct returned by cv::moments
///
/// The spatial moments <span lang='latex'>\texttt{Moments::m}_{ji}</span> are computed as:
///
/// <div lang='latex'>\texttt{m} _{ji}= \sum _{x,y} \left ( \texttt{array} (x,y) \cdot x^j \cdot y^i \right )</div>
///
/// The central moments <span lang='latex'>\texttt{Moments::mu}_{ji}</span> are computed as:
///
/// <div lang='latex'>\texttt{mu} _{ji}= \sum _{x,y} \left ( \texttt{array} (x,y) \cdot (x - \bar{x} )^j \cdot (y - \bar{y} )^i \right )</div>
///
/// where <span lang='latex'>(\bar{x}, \bar{y})</span> is the mass center:
///
/// <div lang='latex'>\bar{x} = \frac{\texttt{m}_{10}}{\texttt{m}_{00}} , \; \bar{y} = \frac{\texttt{m}_{01}}{\texttt{m}_{00}}</div>
///
/// The normalized central moments <span lang='latex'>\texttt{Moments::nu}_{ij}</span> are computed as:
///
/// <div lang='latex'>\texttt{nu} _{ji}= \frac{\texttt{mu}_{ji}}{\texttt{m}_{00}^{(i+j)/2+1}} .</div>
///
///
/// Note:
/// <span lang='latex'>\texttt{mu}_{00}=\texttt{m}_{00}</span>, <span lang='latex'>\texttt{nu}_{00}=1</span>
/// <span lang='latex'>\texttt{nu}_{10}=\texttt{mu}_{10}=\texttt{mu}_{01}=\texttt{mu}_{10}=0</span> , hence the values are not
/// stored.
///
/// The moments of a contour are defined in the same way but computed using the Green's formula (see
/// <http://en.wikipedia.org/wiki/Green_theorem>). So, due to a limited raster resolution, the moments
/// computed for a contour are slightly different from the moments computed for the same rasterized
/// contour.
///
///
/// Note:
/// Since the contour moments are computed using Green formula, you may get seemingly odd results for
/// contours with self-intersections, e.g. a zero area (m00) for butterfly-shaped contours.
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Moments {
pub m00: f64,
pub m10: f64,
pub m01: f64,
pub m20: f64,
pub m11: f64,
pub m02: f64,
pub m30: f64,
pub m21: f64,
pub m12: f64,
pub m03: f64,
pub mu20: f64,
pub mu11: f64,
pub mu02: f64,
pub mu30: f64,
pub mu21: f64,
pub mu12: f64,
pub mu03: f64,
pub nu20: f64,
pub nu11: f64,
pub nu02: f64,
pub nu30: f64,
pub nu21: f64,
pub nu12: f64,
pub nu03: f64,
}
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct CirclesGridFinderParameters {
pub density_neighborhood_size: core::Size2f,
pub min_density: f32,
pub kmeans_attempts: i32,
pub min_distance_to_add_keypoint: i32,
pub keypoint_scale: i32,
pub min_graph_confidence: f32,
pub vertex_gain: f32,
pub vertex_penalty: f32,
pub existing_vertex_gain: f32,
pub edge_gain: f32,
pub edge_penalty: f32,
pub convex_hull_factor: f32,
pub min_rng_edge_switch_dist: f32,
}
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct CirclesGridFinderParameters2 {
pub square_size: f32,
pub max_rectified_distance: f32,
}
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct SimpleBlobDetector_Params {
pub threshold_step: f32,
pub min_threshold: f32,
pub max_threshold: f32,
pub min_repeatability: size_t,
pub min_dist_between_blobs: f32,
pub filter_by_color: bool,
pub blob_color: u8,
pub filter_by_area: bool,
pub min_area: f32,
pub max_area: f32,
pub filter_by_circularity: bool,
pub min_circularity: f32,
pub max_circularity: f32,
pub filter_by_inertia: bool,
pub min_inertia_ratio: f32,
pub max_inertia_ratio: f32,
pub filter_by_convexity: bool,
pub min_convexity: f32,
pub max_convexity: f32,
}
/// This class allows to create and manipulate comprehensive artificial neural networks.
///
/// Neural network is presented as directed acyclic graph (DAG), where vertices are Layer instances,
/// and edges specify relationships between layers inputs and outputs.
///
/// Each network layer has unique integer id and unique string name inside its network.
/// LayerId can store either layer name or layer id.
///
/// This class supports reference counting of its instances, i. e. copies point to the same instance.
#[repr(C)]
#[derive(Copy,Clone,Debug,PartialEq)]
pub struct Net {
__rust_private: [u8; 0],
}
// identifier: CV_FOURCC_char_c1_char_c2_char_c3_char_c4
/// Constructs the fourcc code of the codec function
///
/// Simply call it with 4 chars fourcc code like `CV_FOURCC('I', 'Y', 'U', 'V')`
///
/// List of codes can be obtained at [Video Codecs by FOURCC](http://www.fourcc.org/codecs.php) page.
/// FFMPEG backend with MP4 container natively uses other values as fourcc code:
/// see [ObjectType](http://www.mp4ra.org/codecs.html).
pub fn cv_fourcc(c1: i8, c2: i8, c3: i8, c4: i8) -> Result<i32> {
unsafe { sys::cv_core_CV_FOURCC_char_c1_char_c2_char_c3_char_c4(c1, c2, c3, c4) }.into_result()
}
// identifier: cvCbrt_float_value
/// Fast cubic root calculation
pub fn cv_cbrt(value: f32) -> Result<f32> {
unsafe { sys::cv_core_cvCbrt_float_value(value) }.into_result()
}
// identifier: cvChangeSeqBlock_void_X_reader_int_direction
///
pub fn cv_change_seq_block(reader: &mut c_void, direction: i32) -> Result<()> {
unsafe { sys::cv_core_cvChangeSeqBlock_void_X_reader_int_direction(reader, direction) }.into_result()
}
// identifier: cvCheckHardwareSupport_int_feature
///
pub fn cv_check_hardware_support(feature: i32) -> Result<i32> {
unsafe { sys::cv_core_cvCheckHardwareSupport_int_feature(feature) }.into_result()
}
// identifier: cvContourPerimeter_const_void_X_contour
/// same as cvArcLength for closed contour
pub fn cv_contour_perimeter(contour: &c_void) -> Result<f64> {
unsafe { sys::cv_core_cvContourPerimeter_const_void_X_contour(contour) }.into_result()
}
// identifier: cvDestroyAllWindows
pub fn cv_destroy_all_windows() -> Result<()> {
unsafe { sys::cv_core_cvDestroyAllWindows() }.into_result()
}
// identifier: cvDestroyWindow_const_char_X_name
pub fn cv_destroy_window(name: &str) -> Result<()> {
string_arg!(name);
unsafe { sys::cv_core_cvDestroyWindow_const_char_X_name(name.as_ptr()) }.into_result()
}
// identifier: cvDisplayOverlay_const_char_X_name_const_char_X_text_int_delayms
///
/// ## C++ default parameters:
/// * delayms: 0
pub fn cv_display_overlay(name: &str, text: &str, delayms: i32) -> Result<()> {
string_arg!(name);
string_arg!(text);
unsafe { sys::cv_core_cvDisplayOverlay_const_char_X_name_const_char_X_text_int_delayms(name.as_ptr(), text.as_ptr(), delayms) }.into_result()
}
// identifier: cvDisplayStatusBar_const_char_X_name_const_char_X_text_int_delayms
///
/// ## C++ default parameters:
/// * delayms: 0
pub fn cv_display_status_bar(name: &str, text: &str, delayms: i32) -> Result<()> {
string_arg!(name);
string_arg!(text);
unsafe { sys::cv_core_cvDisplayStatusBar_const_char_X_name_const_char_X_text_int_delayms(name.as_ptr(), text.as_ptr(), delayms) }.into_result()
}
// identifier: cvErrorFromIppStatus_int_ipp_status
/// Maps IPP error codes to the counterparts from OpenCV
pub fn cv_error_from_ipp_status(ipp_status: i32) -> Result<i32> {
unsafe { sys::cv_core_cvErrorFromIppStatus_int_ipp_status(ipp_status) }.into_result()
}
// identifier: cvErrorStr_int_status
/// Retrieves textual description of the error given its code
pub fn cv_error_str(status: i32) -> Result<String> {
unsafe { sys::cv_core_cvErrorStr_int_status(status) }.into_result().map(crate::templ::receive_string)
}
// identifier: cvError_int_status_const_char_X_func_name_const_char_X_err_msg_const_char_X_file_name_int_line
/// Sets error status and performs some additional actions (displaying message box,
/// writing message to stderr, terminating application etc.)
/// depending on the current error mode
pub fn cv_error(status: i32, func_name: &str, err_msg: &str, file_name: &str, line: i32) -> Result<()> {
string_arg!(func_name);
string_arg!(err_msg);
string_arg!(file_name);
unsafe { sys::cv_core_cvError_int_status_const_char_X_func_name_const_char_X_err_msg_const_char_X_file_name_int_line(status, func_name.as_ptr(), err_msg.as_ptr(), file_name.as_ptr(), line) }.into_result()
}
// identifier: cvFastArctan_float_y_float_x
/// Fast arctangent calculation
pub fn cv_fast_arctan(y: f32, x: f32) -> Result<f32> {
unsafe { sys::cv_core_cvFastArctan_float_y_float_x(y, x) }.into_result()
}
// identifier: cvGetErrMode
/// Retrieves current error processing mode
pub fn cv_get_err_mode() -> Result<i32> {
unsafe { sys::cv_core_cvGetErrMode() }.into_result()
}
// identifier: cvGetErrStatus
/// Get current OpenCV error status
pub fn cv_get_err_status() -> Result<i32> {
unsafe { sys::cv_core_cvGetErrStatus() }.into_result()
}
// identifier: cvGetNumThreads
/// retrieve/set the number of threads used in OpenMP implementations
pub fn cv_get_num_threads() -> Result<i32> {
unsafe { sys::cv_core_cvGetNumThreads() }.into_result()
}
// identifier: cvGetOptimalDFTSize_int_size0
/// Finds optimal DFT vector size >= size0
pub fn cv_get_optimal_dft_size(size0: i32) -> Result<i32> {
unsafe { sys::cv_core_cvGetOptimalDFTSize_int_size0(size0) }.into_result()
}
// identifier: cvGetThreadNum
/// get index of the thread being executed
pub fn cv_get_thread_num() -> Result<i32> {
unsafe { sys::cv_core_cvGetThreadNum() }.into_result()
}
// identifier: cvGetTickCount
/// helper functions for RNG initialization and accurate time measurement:
/// uses internal clock counter on x86
pub fn cv_get_tick_count() -> Result<i64> {
unsafe { sys::cv_core_cvGetTickCount() }.into_result()
}
// identifier: cvGetTickFrequency
pub fn cv_get_tick_frequency() -> Result<f64> {
unsafe { sys::cv_core_cvGetTickFrequency() }.into_result()
}
// identifier: cvGetTrackbarPos_const_char_X_trackbar_name_const_char_X_window_name
pub fn cv_get_trackbar_pos(trackbar_name: &str, window_name: &str) -> Result<i32> {
string_arg!(trackbar_name);
string_arg!(window_name);
unsafe { sys::cv_core_cvGetTrackbarPos_const_char_X_trackbar_name_const_char_X_window_name(trackbar_name.as_ptr(), window_name.as_ptr()) }.into_result()
}
// identifier: cvGetWindowHandle_const_char_X_name
pub fn cv_get_window_handle(name: &str) -> Result<&mut c_void> {
string_arg!(name);
unsafe { sys::cv_core_cvGetWindowHandle_const_char_X_name(name.as_ptr()) }.into_result().and_then(|x| unsafe { x.as_mut() }.ok_or_else(|| Error::new(core::StsNullPtr, format!("Function returned Null pointer"))))
}
// identifier: cvGetWindowImageRect_const_char_X_name
pub fn cv_get_window_image_rect(name: &str) -> Result<core::Rect> {
string_arg!(name);
unsafe { sys::cv_core_cvGetWindowImageRect_const_char_X_name(name.as_ptr()) }.into_result()
}
// identifier: cvGetWindowName_void_X_window_handle
pub fn cv_get_window_name(window_handle: &mut c_void) -> Result<String> {
unsafe { sys::cv_core_cvGetWindowName_void_X_window_handle(window_handle) }.into_result().map(crate::templ::receive_string)
}
// identifier: cvGetWindowProperty_const_char_X_name_int_prop_id
pub fn cv_get_window_property(name: &str, prop_id: i32) -> Result<f64> {
string_arg!(name);
unsafe { sys::cv_core_cvGetWindowProperty_const_char_X_name_int_prop_id(name.as_ptr(), prop_id) }.into_result()
}
// identifier: cvGuiBoxReport_int_status_const_char_X_func_name_const_char_X_err_msg_const_char_X_file_name_int_line_void_X_userdata
/// Output to MessageBox(WIN32)
pub fn cv_gui_box_report(status: i32, func_name: &str, err_msg: &str, file_name: &str, line: i32, userdata: &mut c_void) -> Result<i32> {
string_arg!(func_name);
string_arg!(err_msg);
string_arg!(file_name);
unsafe { sys::cv_core_cvGuiBoxReport_int_status_const_char_X_func_name_const_char_X_err_msg_const_char_X_file_name_int_line_void_X_userdata(status, func_name.as_ptr(), err_msg.as_ptr(), file_name.as_ptr(), line, userdata) }.into_result()
}
// identifier: cvHaveImageReader_const_char_X_filename
pub fn cv_have_image_reader(filename: &str) -> Result<i32> {
string_arg!(filename);
unsafe { sys::cv_core_cvHaveImageReader_const_char_X_filename(filename.as_ptr()) }.into_result()
}
// identifier: cvHaveImageWriter_const_char_X_filename
pub fn cv_have_image_writer(filename: &str) -> Result<i32> {
string_arg!(filename);
unsafe { sys::cv_core_cvHaveImageWriter_const_char_X_filename(filename.as_ptr()) }.into_result()
}
// identifier: cvInsertNodeIntoTree_void_X_node_void_X_parent_void_X_frame
/// Inserts sequence into tree with specified "parent" sequence.
/// If parent is equal to frame (e.g. the most external contour),
/// then added contour will have null pointer to parent.
pub fn cv_insert_node_into_tree(node: &mut c_void, parent: &mut c_void, frame: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cvInsertNodeIntoTree_void_X_node_void_X_parent_void_X_frame(node, parent, frame) }.into_result()
}
// identifier: cvIplDepth_int_type
pub fn cv_ipl_depth(_type: i32) -> Result<i32> {
unsafe { sys::cv_core_cvIplDepth_int_type(_type) }.into_result()
}
// identifier: cvLoadWindowParameters_const_char_X_name
pub fn cv_load_window_parameters(name: &str) -> Result<()> {
string_arg!(name);
unsafe { sys::cv_core_cvLoadWindowParameters_const_char_X_name(name.as_ptr()) }.into_result()
}
// identifier: cvMatchShapes_const_void_X_object1_const_void_X_object2_int_method_double_parameter
/// Compares two contours by matching their moments
/// @see cv::matchShapes
///
/// ## C++ default parameters:
/// * parameter: 0
pub fn cv_match_shapes(object1: &c_void, object2: &c_void, method: i32, parameter: f64) -> Result<f64> {
unsafe { sys::cv_core_cvMatchShapes_const_void_X_object1_const_void_X_object2_int_method_double_parameter(object1, object2, method, parameter) }.into_result()
}
// identifier: cvMoveWindow_const_char_X_name_int_x_int_y
pub fn cv_move_window(name: &str, x: i32, y: i32) -> Result<()> {
string_arg!(name);
unsafe { sys::cv_core_cvMoveWindow_const_char_X_name_int_x_int_y(name.as_ptr(), x, y) }.into_result()
}
// identifier: cvNamedWindow_const_char_X_name_int_flags
///
/// ## C++ default parameters:
/// * flags: CV_WINDOW_AUTOSIZE
pub fn cv_named_window(name: &str, flags: i32) -> Result<i32> {
string_arg!(name);
unsafe { sys::cv_core_cvNamedWindow_const_char_X_name_int_flags(name.as_ptr(), flags) }.into_result()
}
// identifier: cvNulDevReport_int_status_const_char_X_func_name_const_char_X_err_msg_const_char_X_file_name_int_line_void_X_userdata
/// Output nothing
pub fn cv_nul_dev_report(status: i32, func_name: &str, err_msg: &str, file_name: &str, line: i32, userdata: &mut c_void) -> Result<i32> {
string_arg!(func_name);
string_arg!(err_msg);
string_arg!(file_name);
unsafe { sys::cv_core_cvNulDevReport_int_status_const_char_X_func_name_const_char_X_err_msg_const_char_X_file_name_int_line_void_X_userdata(status, func_name.as_ptr(), err_msg.as_ptr(), file_name.as_ptr(), line, userdata) }.into_result()
}
// identifier: cvRANSACUpdateNumIters_double_p_double_err_prob_int_model_points_int_max_iters
pub fn cv_ransac_update_num_iters(p: f64, err_prob: f64, model_points: i32, max_iters: i32) -> Result<i32> {
unsafe { sys::cv_core_cvRANSACUpdateNumIters_double_p_double_err_prob_int_model_points_int_max_iters(p, err_prob, model_points, max_iters) }.into_result()
}
// identifier: cvRNG_int64_seed
/// Initializes a random number generator state.
///
/// The function initializes a random number generator and returns the state. The pointer to the state
/// can be then passed to the cvRandInt, cvRandReal and cvRandArr functions. In the current
/// implementation a multiply-with-carry generator is used.
/// ## Parameters
/// * seed: 64-bit value used to initiate a random sequence
/// @sa the C++ class RNG replaced CvRNG.
///
/// ## C++ default parameters:
/// * seed: -1
pub fn cv_rng(seed: i64) -> Result<u64> {
unsafe { sys::cv_core_cvRNG_int64_seed(seed) }.into_result()
}
// identifier: cvRemoveNodeFromTree_void_X_node_void_X_frame
/// Removes contour from tree (together with the contour children).
pub fn cv_remove_node_from_tree(node: &mut c_void, frame: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cvRemoveNodeFromTree_void_X_node_void_X_frame(node, frame) }.into_result()
}
// identifier: cvResizeWindow_const_char_X_name_int_width_int_height
pub fn cv_resize_window(name: &str, width: i32, height: i32) -> Result<()> {
string_arg!(name);
unsafe { sys::cv_core_cvResizeWindow_const_char_X_name_int_width_int_height(name.as_ptr(), width, height) }.into_result()
}
// identifier: cvRound64_softdouble_a
/// Rounds a number to nearest even long long integer
pub fn cv_round64(a: &core::softdouble) -> Result<i64> {
unsafe { sys::cv_core_cvRound64_softdouble_a(a.as_raw_softdouble()) }.into_result()
}
// identifier: cvSaveWindowParameters_const_char_X_name
pub fn cv_save_window_parameters(name: &str) -> Result<()> {
string_arg!(name);
unsafe { sys::cv_core_cvSaveWindowParameters_const_char_X_name(name.as_ptr()) }.into_result()
}
// identifier: cvSetErrMode_int_mode
/// Sets error processing mode, returns previously used mode
pub fn cv_set_err_mode(mode: i32) -> Result<i32> {
unsafe { sys::cv_core_cvSetErrMode_int_mode(mode) }.into_result()
}
// identifier: cvSetErrStatus_int_status
/// Sets error status silently
pub fn cv_set_err_status(status: i32) -> Result<()> {
unsafe { sys::cv_core_cvSetErrStatus_int_status(status) }.into_result()
}
// identifier: cvSetNumThreads_int_threads
///
/// ## C++ default parameters:
/// * threads: 0
pub fn cv_set_num_threads(threads: i32) -> Result<()> {
unsafe { sys::cv_core_cvSetNumThreads_int_threads(threads) }.into_result()
}
// identifier: cvSetOpenGlContext_const_char_X_window_name
pub fn cv_set_open_gl_context(window_name: &str) -> Result<()> {
string_arg!(window_name);
unsafe { sys::cv_core_cvSetOpenGlContext_const_char_X_window_name(window_name.as_ptr()) }.into_result()
}
// identifier: cvSetTrackbarMax_const_char_X_trackbar_name_const_char_X_window_name_int_maxval
pub fn cv_set_trackbar_max(trackbar_name: &str, window_name: &str, maxval: i32) -> Result<()> {
string_arg!(trackbar_name);
string_arg!(window_name);
unsafe { sys::cv_core_cvSetTrackbarMax_const_char_X_trackbar_name_const_char_X_window_name_int_maxval(trackbar_name.as_ptr(), window_name.as_ptr(), maxval) }.into_result()
}
// identifier: cvSetTrackbarMin_const_char_X_trackbar_name_const_char_X_window_name_int_minval
pub fn cv_set_trackbar_min(trackbar_name: &str, window_name: &str, minval: i32) -> Result<()> {
string_arg!(trackbar_name);
string_arg!(window_name);
unsafe { sys::cv_core_cvSetTrackbarMin_const_char_X_trackbar_name_const_char_X_window_name_int_minval(trackbar_name.as_ptr(), window_name.as_ptr(), minval) }.into_result()
}
// identifier: cvSetTrackbarPos_const_char_X_trackbar_name_const_char_X_window_name_int_pos
pub fn cv_set_trackbar_pos(trackbar_name: &str, window_name: &str, pos: i32) -> Result<()> {
string_arg!(trackbar_name);
string_arg!(window_name);
unsafe { sys::cv_core_cvSetTrackbarPos_const_char_X_trackbar_name_const_char_X_window_name_int_pos(trackbar_name.as_ptr(), window_name.as_ptr(), pos) }.into_result()
}
// identifier: cvSetWindowProperty_const_char_X_name_int_prop_id_double_prop_value
pub fn cv_set_window_property(name: &str, prop_id: i32, prop_value: f64) -> Result<()> {
string_arg!(name);
unsafe { sys::cv_core_cvSetWindowProperty_const_char_X_name_int_prop_id_double_prop_value(name.as_ptr(), prop_id, prop_value) }.into_result()
}
// identifier: cvStartWindowThread
pub fn cv_start_window_thread() -> Result<i32> {
unsafe { sys::cv_core_cvStartWindowThread() }.into_result()
}
// identifier: cvStdErrReport_int_status_const_char_X_func_name_const_char_X_err_msg_const_char_X_file_name_int_line_void_X_userdata
/// Output to console(fprintf(stderr,...))
pub fn cv_std_err_report(status: i32, func_name: &str, err_msg: &str, file_name: &str, line: i32, userdata: &mut c_void) -> Result<i32> {
string_arg!(func_name);
string_arg!(err_msg);
string_arg!(file_name);
unsafe { sys::cv_core_cvStdErrReport_int_status_const_char_X_func_name_const_char_X_err_msg_const_char_X_file_name_int_line_void_X_userdata(status, func_name.as_ptr(), err_msg.as_ptr(), file_name.as_ptr(), line, userdata) }.into_result()
}
// identifier: cvStopLoop
pub fn cv_stop_loop() -> Result<()> {
unsafe { sys::cv_core_cvStopLoop() }.into_result()
}
// identifier: cvTrunc_softdouble_a
pub fn cv_trunc(a: &core::softdouble) -> Result<i32> {
unsafe { sys::cv_core_cvTrunc_softdouble_a(a.as_raw_softdouble()) }.into_result()
}
// identifier: cvTrunc_softfloat_a
/// Truncates number to integer with minimum magnitude
pub fn cv_trunc_1(a: &core::softfloat) -> Result<i32> {
unsafe { sys::cv_core_cvTrunc_softfloat_a(a.as_raw_softfloat()) }.into_result()
}
// identifier: cvUnregisterType_const_char_X_type_name
/// Unregisters the type.
///
/// The function unregisters a type with a specified name. If the name is unknown, it is possible to
/// locate the type info by an instance of the type using cvTypeOf or by iterating the type list,
/// starting from cvFirstType, and then calling cvUnregisterType(info-\>typeName).
/// ## Parameters
/// * type_name: Name of an unregistered type
pub fn cv_unregister_type(type_name: &str) -> Result<()> {
string_arg!(type_name);
unsafe { sys::cv_core_cvUnregisterType_const_char_X_type_name(type_name.as_ptr()) }.into_result()
}
// identifier: cvUpdateWindow_const_char_X_window_name
pub fn cv_update_window(window_name: &str) -> Result<()> {
string_arg!(window_name);
unsafe { sys::cv_core_cvUpdateWindow_const_char_X_window_name(window_name.as_ptr()) }.into_result()
}
// identifier: cvUseOptimized_int_on_off
/// Loads optimized functions from IPP, MKL etc. or switches back to pure C code
pub fn cv_use_optimized(on_off: i32) -> Result<i32> {
unsafe { sys::cv_core_cvUseOptimized_int_on_off(on_off) }.into_result()
}
// identifier: cvWaitKey_int_delay
///
/// ## C++ default parameters:
/// * delay: 0
pub fn cv_wait_key(delay: i32) -> Result<i32> {
unsafe { sys::cv_core_cvWaitKey_int_delay(delay) }.into_result()
}
// identifier: cv_AGAST_Mat_image_VectorOfKeyPoint_keypoints_int_threshold_bool_nonmaxSuppression
/// @overload
///
/// ## C++ default parameters:
/// * nonmax_suppression: true
pub fn AGAST(image: &core::Mat, keypoints: &types::VectorOfKeyPoint, threshold: i32, nonmax_suppression: bool) -> Result<()> {
unsafe { sys::cv_core_cv_AGAST_Mat_image_VectorOfKeyPoint_keypoints_int_threshold_bool_nonmaxSuppression(image.as_raw_Mat(), keypoints.as_raw_VectorOfKeyPoint(), threshold, nonmax_suppression) }.into_result()
}
// identifier: cv_AGAST_Mat_image_VectorOfKeyPoint_keypoints_int_threshold_bool_nonmaxSuppression_int_type
/// Detects corners using the AGAST algorithm
///
/// ## Parameters
/// * image: grayscale image where keypoints (corners) are detected.
/// * keypoints: keypoints detected on the image.
/// * threshold: threshold on difference between intensity of the central pixel and pixels of a
/// circle around this pixel.
/// * nonmaxSuppression: if true, non-maximum suppression is applied to detected corners
/// (keypoints).
/// * type: one of the four neighborhoods as defined in the paper:
/// AgastFeatureDetector::AGAST_5_8, AgastFeatureDetector::AGAST_7_12d,
/// AgastFeatureDetector::AGAST_7_12s, AgastFeatureDetector::OAST_9_16
///
/// For non-Intel platforms, there is a tree optimised variant of AGAST with same numerical results.
/// The 32-bit binary tree tables were generated automatically from original code using perl script.
/// The perl script and examples of tree generation are placed in features2d/doc folder.
/// Detects corners using the AGAST algorithm by @cite mair2010_agast .
pub fn AGAST_with_type(image: &core::Mat, keypoints: &types::VectorOfKeyPoint, threshold: i32, nonmax_suppression: bool, _type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_AGAST_Mat_image_VectorOfKeyPoint_keypoints_int_threshold_bool_nonmaxSuppression_int_type(image.as_raw_Mat(), keypoints.as_raw_VectorOfKeyPoint(), threshold, nonmax_suppression, _type) }.into_result()
}
// identifier: cv_CamShift_Mat_probImage_Rect_window_TermCriteria_criteria
/// Finds an object center, size, and orientation.
///
/// ## Parameters
/// * probImage: Back projection of the object histogram. See calcBackProject.
/// * window: Initial search window.
/// * criteria: Stop criteria for the underlying meanShift.
/// returns
/// (in old interfaces) Number of iterations CAMSHIFT took to converge
/// The function implements the CAMSHIFT object tracking algorithm @cite Bradski98 . First, it finds an
/// object center using meanShift and then adjusts the window size and finds the optimal rotation. The
/// function returns the rotated rectangle structure that includes the object position, size, and
/// orientation. The next position of the search window can be obtained with RotatedRect::boundingRect()
///
/// See the OpenCV sample camshiftdemo.c that tracks colored objects.
///
///
/// Note:
/// * (Python) A sample explaining the camshift tracking algorithm can be found at
/// opencv_source_code/samples/python/camshift.py
pub fn cam_shift(prob_image: &core::Mat, window: core::Rect, criteria: &core::TermCriteria) -> Result<core::RotatedRect> {
unsafe { sys::cv_core_cv_CamShift_Mat_probImage_Rect_window_TermCriteria_criteria(prob_image.as_raw_Mat(), window, criteria.as_raw_TermCriteria()) }.into_result().map(|x| core::RotatedRect { ptr: x })
}
// identifier: cv_Canny_Mat_dx_Mat_dy_Mat_edges_double_threshold1_double_threshold2_bool_L2gradient
/// \overload
///
/// Finds edges in an image using the Canny algorithm with custom image gradient.
///
/// ## Parameters
/// * dx: 16-bit x derivative of input image (CV_16SC1 or CV_16SC3).
/// * dy: 16-bit y derivative of input image (same type as dx).
/// * edges: output edge map; single channels 8-bit image, which has the same size as image .
/// * threshold1: first threshold for the hysteresis procedure.
/// * threshold2: second threshold for the hysteresis procedure.
/// * L2gradient: a flag, indicating whether a more accurate <span lang='latex'>L_2</span> norm
/// <span lang='latex'>=\sqrt{(dI/dx)^2 + (dI/dy)^2}</span> should be used to calculate the image gradient magnitude (
/// L2gradient=true ), or whether the default <span lang='latex'>L_1</span> norm <span lang='latex'>=|dI/dx|+|dI/dy|</span> is enough (
/// L2gradient=false ).
///
/// ## C++ default parameters:
/// * l2gradient: false
pub fn canny_derivative(dx: &core::Mat, dy: &core::Mat, edges: &mut core::Mat, threshold1: f64, threshold2: f64, l2gradient: bool) -> Result<()> {
unsafe { sys::cv_core_cv_Canny_Mat_dx_Mat_dy_Mat_edges_double_threshold1_double_threshold2_bool_L2gradient(dx.as_raw_Mat(), dy.as_raw_Mat(), edges.as_raw_Mat(), threshold1, threshold2, l2gradient) }.into_result()
}
// identifier: cv_Canny_Mat_image_Mat_edges_double_threshold1_double_threshold2_int_apertureSize_bool_L2gradient
/// Finds edges in an image using the Canny algorithm @cite Canny86 .
///
/// The function finds edges in the input image and marks them in the output map edges using the
/// Canny algorithm. The smallest value between threshold1 and threshold2 is used for edge linking. The
/// largest value is used to find initial segments of strong edges. See
/// <http://en.wikipedia.org/wiki/Canny_edge_detector>
///
/// ## Parameters
/// * image: 8-bit input image.
/// * edges: output edge map; single channels 8-bit image, which has the same size as image .
/// * threshold1: first threshold for the hysteresis procedure.
/// * threshold2: second threshold for the hysteresis procedure.
/// * apertureSize: aperture size for the Sobel operator.
/// * L2gradient: a flag, indicating whether a more accurate <span lang='latex'>L_2</span> norm
/// <span lang='latex'>=\sqrt{(dI/dx)^2 + (dI/dy)^2}</span> should be used to calculate the image gradient magnitude (
/// L2gradient=true ), or whether the default <span lang='latex'>L_1</span> norm <span lang='latex'>=|dI/dx|+|dI/dy|</span> is enough (
/// L2gradient=false ).
///
/// ## C++ default parameters:
/// * aperture_size: 3
/// * l2gradient: false
pub fn canny(image: &core::Mat, edges: &mut core::Mat, threshold1: f64, threshold2: f64, aperture_size: i32, l2gradient: bool) -> Result<()> {
unsafe { sys::cv_core_cv_Canny_Mat_image_Mat_edges_double_threshold1_double_threshold2_int_apertureSize_bool_L2gradient(image.as_raw_Mat(), edges.as_raw_Mat(), threshold1, threshold2, aperture_size, l2gradient) }.into_result()
}
// identifier: cv_Cholesky_double_X_A_size_t_astep_int_m_double_X_b_size_t_bstep_int_n
/// proxy for hal::Cholesky
pub fn cholesky(a: &mut f64, astep: size_t, m: i32, b: &mut f64, bstep: size_t, n: i32) -> Result<bool> {
unsafe { sys::cv_core_cv_Cholesky_double_X_A_size_t_astep_int_m_double_X_b_size_t_bstep_int_n(a, astep, m, b, bstep, n) }.into_result()
}
// identifier: cv_Cholesky_float_X_A_size_t_astep_int_m_float_X_b_size_t_bstep_int_n
/// proxy for hal::Cholesky
pub fn cholesky_1(a: &mut f32, astep: size_t, m: i32, b: &mut f32, bstep: size_t, n: i32) -> Result<bool> {
unsafe { sys::cv_core_cv_Cholesky_float_X_A_size_t_astep_int_m_float_X_b_size_t_bstep_int_n(a, astep, m, b, bstep, n) }.into_result()
}
// identifier: cv_EMDL1_Mat_signature1_Mat_signature2
/// Computes the "minimal work" distance between two weighted point configurations base on the papers
/// "EMD-L1: An efficient and Robust Algorithm for comparing histogram-based descriptors", by Haibin
/// Ling and Kazunori Okuda; and "The Earth Mover's Distance is the Mallows Distance: Some Insights from
/// Statistics", by Elizaveta Levina and Peter Bickel.
///
/// ## Parameters
/// * signature1: First signature, a single column floating-point matrix. Each row is the value of
/// the histogram in each bin.
/// * signature2: Second signature of the same format and size as signature1.
pub fn emdl1(signature1: &core::Mat, signature2: &core::Mat) -> Result<f32> {
unsafe { sys::cv_core_cv_EMDL1_Mat_signature1_Mat_signature2(signature1.as_raw_Mat(), signature2.as_raw_Mat()) }.into_result()
}
// identifier: cv_EMD_Mat_signature1_Mat_signature2_int_distType_Mat_cost_float_X_lowerBound_Mat_flow
/// Computes the "minimal work" distance between two weighted point configurations.
///
/// The function computes the earth mover distance and/or a lower boundary of the distance between the
/// two weighted point configurations. One of the applications described in @cite RubnerSept98,
/// @cite Rubner2000 is multi-dimensional histogram comparison for image retrieval. EMD is a transportation
/// problem that is solved using some modification of a simplex algorithm, thus the complexity is
/// exponential in the worst case, though, on average it is much faster. In the case of a real metric
/// the lower boundary can be calculated even faster (using linear-time algorithm) and it can be used
/// to determine roughly whether the two signatures are far enough so that they cannot relate to the
/// same object.
///
/// ## Parameters
/// * signature1: First signature, a <span lang='latex'>\texttt{size1}\times \texttt{dims}+1</span> floating-point matrix.
/// Each row stores the point weight followed by the point coordinates. The matrix is allowed to have
/// a single column (weights only) if the user-defined cost matrix is used. The weights must be
/// non-negative and have at least one non-zero value.
/// * signature2: Second signature of the same format as signature1 , though the number of rows
/// may be different. The total weights may be different. In this case an extra "dummy" point is added
/// to either signature1 or signature2. The weights must be non-negative and have at least one non-zero
/// value.
/// * distType: Used metric. See #DistanceTypes.
/// * cost: User-defined <span lang='latex'>\texttt{size1}\times \texttt{size2}</span> cost matrix. Also, if a cost matrix
/// is used, lower boundary lowerBound cannot be calculated because it needs a metric function.
/// * lowerBound: Optional input/output parameter: lower boundary of a distance between the two
/// signatures that is a distance between mass centers. The lower boundary may not be calculated if
/// the user-defined cost matrix is used, the total weights of point configurations are not equal, or
/// if the signatures consist of weights only (the signature matrices have a single column). You
/// **must** initialize \*lowerBound . If the calculated distance between mass centers is greater or
/// equal to \*lowerBound (it means that the signatures are far enough), the function does not
/// calculate EMD. In any case \*lowerBound is set to the calculated distance between mass centers on
/// return. Thus, if you want to calculate both distance between mass centers and EMD, \*lowerBound
/// should be set to 0.
/// * flow: Resultant <span lang='latex'>\texttt{size1} \times \texttt{size2}</span> flow matrix: <span lang='latex'>\texttt{flow}_{i,j}</span> is
/// a flow from <span lang='latex'>i</span> -th point of signature1 to <span lang='latex'>j</span> -th point of signature2 .
///
/// ## C++ default parameters:
/// * cost: noArray()
/// * lower_bound: 0
/// * flow: noArray()
pub fn emd(signature1: &core::Mat, signature2: &core::Mat, dist_type: i32, cost: &core::Mat, lower_bound: &mut f32, flow: &mut core::Mat) -> Result<f32> {
unsafe { sys::cv_core_cv_EMD_Mat_signature1_Mat_signature2_int_distType_Mat_cost_float_X_lowerBound_Mat_flow(signature1.as_raw_Mat(), signature2.as_raw_Mat(), dist_type, cost.as_raw_Mat(), lower_bound, flow.as_raw_Mat()) }.into_result()
}
// identifier: cv_FAST_Mat_image_VectorOfKeyPoint_keypoints_int_threshold_bool_nonmaxSuppression
/// @overload
///
/// ## C++ default parameters:
/// * nonmax_suppression: true
pub fn FAST(image: &core::Mat, keypoints: &types::VectorOfKeyPoint, threshold: i32, nonmax_suppression: bool) -> Result<()> {
unsafe { sys::cv_core_cv_FAST_Mat_image_VectorOfKeyPoint_keypoints_int_threshold_bool_nonmaxSuppression(image.as_raw_Mat(), keypoints.as_raw_VectorOfKeyPoint(), threshold, nonmax_suppression) }.into_result()
}
// identifier: cv_FAST_Mat_image_VectorOfKeyPoint_keypoints_int_threshold_bool_nonmaxSuppression_int_type
/// Detects corners using the FAST algorithm
///
/// ## Parameters
/// * image: grayscale image where keypoints (corners) are detected.
/// * keypoints: keypoints detected on the image.
/// * threshold: threshold on difference between intensity of the central pixel and pixels of a
/// circle around this pixel.
/// * nonmaxSuppression: if true, non-maximum suppression is applied to detected corners
/// (keypoints).
/// * type: one of the three neighborhoods as defined in the paper:
/// FastFeatureDetector::TYPE_9_16, FastFeatureDetector::TYPE_7_12,
/// FastFeatureDetector::TYPE_5_8
///
/// Detects corners using the FAST algorithm by @cite Rosten06 .
///
///
/// Note: In Python API, types are given as cv2.FAST_FEATURE_DETECTOR_TYPE_5_8,
/// cv2.FAST_FEATURE_DETECTOR_TYPE_7_12 and cv2.FAST_FEATURE_DETECTOR_TYPE_9_16. For corner
/// detection, use cv2.FAST.detect() method.
pub fn FAST_with_type(image: &core::Mat, keypoints: &types::VectorOfKeyPoint, threshold: i32, nonmax_suppression: bool, _type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_FAST_Mat_image_VectorOfKeyPoint_keypoints_int_threshold_bool_nonmaxSuppression_int_type(image.as_raw_Mat(), keypoints.as_raw_VectorOfKeyPoint(), threshold, nonmax_suppression, _type) }.into_result()
}
// identifier: cv_GaussianBlur_Mat_src_Mat_dst_Size_ksize_double_sigmaX_double_sigmaY_int_borderType
/// Blurs an image using a Gaussian filter.
///
/// The function convolves the source image with the specified Gaussian kernel. In-place filtering is
/// supported.
///
/// ## Parameters
/// * src: input image; the image can have any number of channels, which are processed
/// independently, but the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
/// * dst: output image of the same size and type as src.
/// * ksize: Gaussian kernel size. ksize.width and ksize.height can differ but they both must be
/// positive and odd. Or, they can be zero's and then they are computed from sigma.
/// * sigmaX: Gaussian kernel standard deviation in X direction.
/// * sigmaY: Gaussian kernel standard deviation in Y direction; if sigmaY is zero, it is set to be
/// equal to sigmaX, if both sigmas are zeros, they are computed from ksize.width and ksize.height,
/// respectively (see #getGaussianKernel for details); to fully control the result regardless of
/// possible future modifications of all this semantics, it is recommended to specify all of ksize,
/// sigmaX, and sigmaY.
/// * borderType: pixel extrapolation method, see #BorderTypes
///
/// @sa sepFilter2D, filter2D, blur, boxFilter, bilateralFilter, medianBlur
///
/// ## C++ default parameters:
/// * sigma_y: 0
/// * border_type: BORDER_DEFAULT
pub fn gaussian_blur(src: &core::Mat, dst: &mut core::Mat, ksize: core::Size, sigma_x: f64, sigma_y: f64, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_GaussianBlur_Mat_src_Mat_dst_Size_ksize_double_sigmaX_double_sigmaY_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ksize, sigma_x, sigma_y, border_type) }.into_result()
}
// identifier: cv_HoughCircles_Mat_image_Mat_circles_int_method_double_dp_double_minDist_double_param1_double_param2_int_minRadius_int_maxRadius
/// Finds circles in a grayscale image using the Hough transform.
///
/// The function finds circles in a grayscale image using a modification of the Hough transform.
///
/// Example: :
/// @include snippets/imgproc_HoughLinesCircles.cpp
///
///
/// Note: Usually the function detects the centers of circles well. However, it may fail to find correct
/// radii. You can assist to the function by specifying the radius range ( minRadius and maxRadius ) if
/// you know it. Or, you may set maxRadius to a negative number to return centers only without radius
/// search, and find the correct radius using an additional procedure.
///
/// ## Parameters
/// * image: 8-bit, single-channel, grayscale input image.
/// * circles: Output vector of found circles. Each vector is encoded as 3 or 4 element
/// floating-point vector <span lang='latex'>(x, y, radius)</span> or <span lang='latex'>(x, y, radius, votes)</span> .
/// * method: Detection method, see #HoughModes. Currently, the only implemented method is #HOUGH_GRADIENT
/// * dp: Inverse ratio of the accumulator resolution to the image resolution. For example, if
/// dp=1 , the accumulator has the same resolution as the input image. If dp=2 , the accumulator has
/// half as big width and height.
/// * minDist: Minimum distance between the centers of the detected circles. If the parameter is
/// too small, multiple neighbor circles may be falsely detected in addition to a true one. If it is
/// too large, some circles may be missed.
/// * param1: First method-specific parameter. In case of #HOUGH_GRADIENT , it is the higher
/// threshold of the two passed to the Canny edge detector (the lower one is twice smaller).
/// * param2: Second method-specific parameter. In case of #HOUGH_GRADIENT , it is the
/// accumulator threshold for the circle centers at the detection stage. The smaller it is, the more
/// false circles may be detected. Circles, corresponding to the larger accumulator values, will be
/// returned first.
/// * minRadius: Minimum circle radius.
/// * maxRadius: Maximum circle radius. If <= 0, uses the maximum image dimension. If < 0, returns
/// centers without finding the radius.
///
/// @sa fitEllipse, minEnclosingCircle
///
/// ## C++ default parameters:
/// * param1: 100
/// * param2: 100
/// * min_radius: 0
/// * max_radius: 0
pub fn hough_circles(image: &core::Mat, circles: &mut core::Mat, method: i32, dp: f64, min_dist: f64, param1: f64, param2: f64, min_radius: i32, max_radius: i32) -> Result<()> {
unsafe { sys::cv_core_cv_HoughCircles_Mat_image_Mat_circles_int_method_double_dp_double_minDist_double_param1_double_param2_int_minRadius_int_maxRadius(image.as_raw_Mat(), circles.as_raw_Mat(), method, dp, min_dist, param1, param2, min_radius, max_radius) }.into_result()
}
// identifier: cv_HoughLinesP_Mat_image_Mat_lines_double_rho_double_theta_int_threshold_double_minLineLength_double_maxLineGap
/// Finds line segments in a binary image using the probabilistic Hough transform.
///
/// The function implements the probabilistic Hough transform algorithm for line detection, described
/// in @cite Matas00
///
/// See the line detection example below:
/// @include snippets/imgproc_HoughLinesP.cpp
/// This is a sample picture the function parameters have been tuned for:
///
/// 
///
/// And this is the output of the above program in case of the probabilistic Hough transform:
///
/// 
///
/// ## Parameters
/// * image: 8-bit, single-channel binary source image. The image may be modified by the function.
/// * lines: Output vector of lines. Each line is represented by a 4-element vector
/// <span lang='latex'>(x_1, y_1, x_2, y_2)</span> , where <span lang='latex'>(x_1,y_1)</span> and <span lang='latex'>(x_2, y_2)</span> are the ending points of each detected
/// line segment.
/// * rho: Distance resolution of the accumulator in pixels.
/// * theta: Angle resolution of the accumulator in radians.
/// * threshold: Accumulator threshold parameter. Only those lines are returned that get enough
/// votes ( <span lang='latex'>>\texttt{threshold}</span> ).
/// * minLineLength: Minimum line length. Line segments shorter than that are rejected.
/// * maxLineGap: Maximum allowed gap between points on the same line to link them.
///
/// @sa LineSegmentDetector
///
/// ## C++ default parameters:
/// * min_line_length: 0
/// * max_line_gap: 0
pub fn hough_lines_p(image: &core::Mat, lines: &mut core::Mat, rho: f64, theta: f64, threshold: i32, min_line_length: f64, max_line_gap: f64) -> Result<()> {
unsafe { sys::cv_core_cv_HoughLinesP_Mat_image_Mat_lines_double_rho_double_theta_int_threshold_double_minLineLength_double_maxLineGap(image.as_raw_Mat(), lines.as_raw_Mat(), rho, theta, threshold, min_line_length, max_line_gap) }.into_result()
}
// identifier: cv_HoughLinesPointSet_Mat__point_Mat__lines_int_lines_max_int_threshold_double_min_rho_double_max_rho_double_rho_step_double_min_theta_double_max_theta_double_theta_step
/// Finds lines in a set of points using the standard Hough transform.
///
/// The function finds lines in a set of points using a modification of the Hough transform.
/// @include snippets/imgproc_HoughLinesPointSet.cpp
/// ## Parameters
/// * _point: Input vector of points. Each vector must be encoded as a Point vector <span lang='latex'>(x,y)</span>. Type must be CV_32FC2 or CV_32SC2.
/// * _lines: Output vector of found lines. Each vector is encoded as a vector<Vec3d> <span lang='latex'>(votes, rho, theta)</span>.
/// The larger the value of 'votes', the higher the reliability of the Hough line.
/// * lines_max: Max count of hough lines.
/// * threshold: Accumulator threshold parameter. Only those lines are returned that get enough
/// votes ( <span lang='latex'>>\texttt{threshold}</span> )
/// * min_rho: Minimum Distance value of the accumulator in pixels.
/// * max_rho: Maximum Distance value of the accumulator in pixels.
/// * rho_step: Distance resolution of the accumulator in pixels.
/// * min_theta: Minimum angle value of the accumulator in radians.
/// * max_theta: Maximum angle value of the accumulator in radians.
/// * theta_step: Angle resolution of the accumulator in radians.
pub fn hough_lines_point_set(_point: &core::Mat, _lines: &mut core::Mat, lines_max: i32, threshold: i32, min_rho: f64, max_rho: f64, rho_step: f64, min_theta: f64, max_theta: f64, theta_step: f64) -> Result<()> {
unsafe { sys::cv_core_cv_HoughLinesPointSet_Mat__point_Mat__lines_int_lines_max_int_threshold_double_min_rho_double_max_rho_double_rho_step_double_min_theta_double_max_theta_double_theta_step(_point.as_raw_Mat(), _lines.as_raw_Mat(), lines_max, threshold, min_rho, max_rho, rho_step, min_theta, max_theta, theta_step) }.into_result()
}
// identifier: cv_HoughLines_Mat_image_Mat_lines_double_rho_double_theta_int_threshold_double_srn_double_stn_double_min_theta_double_max_theta
/// Finds lines in a binary image using the standard Hough transform.
///
/// The function implements the standard or standard multi-scale Hough transform algorithm for line
/// detection. See <http://homepages.inf.ed.ac.uk/rbf/HIPR2/hough.htm> for a good explanation of Hough
/// transform.
///
/// ## Parameters
/// * image: 8-bit, single-channel binary source image. The image may be modified by the function.
/// * lines: Output vector of lines. Each line is represented by a 2 or 3 element vector
/// <span lang='latex'>(\rho, \theta)</span> or <span lang='latex'>(\rho, \theta, \textrm{votes})</span> . <span lang='latex'>\rho</span> is the distance from the coordinate origin <span lang='latex'>(0,0)</span> (top-left corner of
/// the image). <span lang='latex'>\theta</span> is the line rotation angle in radians (
/// <span lang='latex'>0 \sim \textrm{vertical line}, \pi/2 \sim \textrm{horizontal line}</span> ).
/// <span lang='latex'>\textrm{votes}</span> is the value of accumulator.
/// * rho: Distance resolution of the accumulator in pixels.
/// * theta: Angle resolution of the accumulator in radians.
/// * threshold: Accumulator threshold parameter. Only those lines are returned that get enough
/// votes ( <span lang='latex'>>\texttt{threshold}</span> ).
/// * srn: For the multi-scale Hough transform, it is a divisor for the distance resolution rho .
/// The coarse accumulator distance resolution is rho and the accurate accumulator resolution is
/// rho/srn . If both srn=0 and stn=0 , the classical Hough transform is used. Otherwise, both these
/// parameters should be positive.
/// * stn: For the multi-scale Hough transform, it is a divisor for the distance resolution theta.
/// * min_theta: For standard and multi-scale Hough transform, minimum angle to check for lines.
/// Must fall between 0 and max_theta.
/// * max_theta: For standard and multi-scale Hough transform, maximum angle to check for lines.
/// Must fall between min_theta and CV_PI.
///
/// ## C++ default parameters:
/// * srn: 0
/// * stn: 0
/// * min_theta: 0
/// * max_theta: CV_PI
pub fn hough_lines(image: &core::Mat, lines: &mut core::Mat, rho: f64, theta: f64, threshold: i32, srn: f64, stn: f64, min_theta: f64, max_theta: f64) -> Result<()> {
unsafe { sys::cv_core_cv_HoughLines_Mat_image_Mat_lines_double_rho_double_theta_int_threshold_double_srn_double_stn_double_min_theta_double_max_theta(image.as_raw_Mat(), lines.as_raw_Mat(), rho, theta, threshold, srn, stn, min_theta, max_theta) }.into_result()
}
// identifier: cv_HuMoments_Moments_m_Mat_hu
/// @overload
pub fn hu_moments(m: core::Moments, hu: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_HuMoments_Moments_m_Mat_hu(m, hu.as_raw_Mat()) }.into_result()
}
// identifier: cv_LUT_Mat_src_Mat_lut_Mat_dst
/// Performs a look-up table transform of an array.
///
/// The function LUT fills the output array with values from the look-up table. Indices of the entries
/// are taken from the input array. That is, the function processes each element of src as follows:
/// <div lang='latex'>\texttt{dst} (I) \leftarrow \texttt{lut(src(I) + d)}</div>
/// where
/// <div lang='latex'>d = \fork{0}{if \(\texttt{src}\) has depth \(\texttt{CV_8U}\)}{128}{if \(\texttt{src}\) has depth \(\texttt{CV_8S}\)}</div>
/// ## Parameters
/// * src: input array of 8-bit elements.
/// * lut: look-up table of 256 elements; in case of multi-channel input array, the table should
/// either have a single channel (in this case the same table is used for all channels) or the same
/// number of channels as in the input array.
/// * dst: output array of the same size and number of channels as src, and the same depth as lut.
/// @sa convertScaleAbs, Mat::convertTo
pub fn lut(src: &core::Mat, lut: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_LUT_Mat_src_Mat_lut_Mat_dst(src.as_raw_Mat(), lut.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_LU_double_X_A_size_t_astep_int_m_double_X_b_size_t_bstep_int_n
/// proxy for hal::LU
pub fn lu(a: &mut f64, astep: size_t, m: i32, b: &mut f64, bstep: size_t, n: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_LU_double_X_A_size_t_astep_int_m_double_X_b_size_t_bstep_int_n(a, astep, m, b, bstep, n) }.into_result()
}
// identifier: cv_LU_float_X_A_size_t_astep_int_m_float_X_b_size_t_bstep_int_n
/// proxy for hal::LU
pub fn lu_1(a: &mut f32, astep: size_t, m: i32, b: &mut f32, bstep: size_t, n: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_LU_float_X_A_size_t_astep_int_m_float_X_b_size_t_bstep_int_n(a, astep, m, b, bstep, n) }.into_result()
}
// identifier: cv_Laplacian_Mat_src_Mat_dst_int_ddepth_int_ksize_double_scale_double_delta_int_borderType
/// Calculates the Laplacian of an image.
///
/// The function calculates the Laplacian of the source image by adding up the second x and y
/// derivatives calculated using the Sobel operator:
///
/// <div lang='latex'>\texttt{dst} = \Delta \texttt{src} = \frac{\partial^2 \texttt{src}}{\partial x^2} + \frac{\partial^2 \texttt{src}}{\partial y^2}</div>
///
/// This is done when `ksize > 1`. When `ksize == 1`, the Laplacian is computed by filtering the image
/// with the following <span lang='latex'>3 \times 3</span> aperture:
///
/// <div lang='latex'>\vecthreethree {0}{1}{0}{1}{-4}{1}{0}{1}{0}</div>
///
/// ## Parameters
/// * src: Source image.
/// * dst: Destination image of the same size and the same number of channels as src .
/// * ddepth: Desired depth of the destination image.
/// * ksize: Aperture size used to compute the second-derivative filters. See #getDerivKernels for
/// details. The size must be positive and odd.
/// * scale: Optional scale factor for the computed Laplacian values. By default, no scaling is
/// applied. See #getDerivKernels for details.
/// * delta: Optional delta value that is added to the results prior to storing them in dst .
/// * borderType: Pixel extrapolation method, see #BorderTypes
/// @sa Sobel, Scharr
///
/// ## C++ default parameters:
/// * ksize: 1
/// * scale: 1
/// * delta: 0
/// * border_type: BORDER_DEFAULT
pub fn laplacian(src: &core::Mat, dst: &mut core::Mat, ddepth: i32, ksize: i32, scale: f64, delta: f64, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_Laplacian_Mat_src_Mat_dst_int_ddepth_int_ksize_double_scale_double_delta_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ddepth, ksize, scale, delta, border_type) }.into_result()
}
// identifier: cv_Mahalanobis_Mat_v1_Mat_v2_Mat_icovar
/// Calculates the Mahalanobis distance between two vectors.
///
/// The function cv::Mahalanobis calculates and returns the weighted distance between two vectors:
/// <div lang='latex'>d( \texttt{vec1} , \texttt{vec2} )= \sqrt{\sum_{i,j}{\texttt{icovar(i,j)}\cdot(\texttt{vec1}(I)-\texttt{vec2}(I))\cdot(\texttt{vec1(j)}-\texttt{vec2(j)})} }</div>
/// The covariance matrix may be calculated using the #calcCovarMatrix function and then inverted using
/// the invert function (preferably using the #DECOMP_SVD method, as the most accurate).
/// ## Parameters
/// * v1: first 1D input vector.
/// * v2: second 1D input vector.
/// * icovar: inverse covariance matrix.
pub fn mahalanobis(v1: &core::Mat, v2: &core::Mat, icovar: &core::Mat) -> Result<f64> {
unsafe { sys::cv_core_cv_Mahalanobis_Mat_v1_Mat_v2_Mat_icovar(v1.as_raw_Mat(), v2.as_raw_Mat(), icovar.as_raw_Mat()) }.into_result()
}
// identifier: cv_PCABackProject_Mat_data_Mat_mean_Mat_eigenvectors_Mat_result
/// wrap PCA::backProject
pub fn pca_back_project(data: &core::Mat, mean: &core::Mat, eigenvectors: &core::Mat, result: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_PCABackProject_Mat_data_Mat_mean_Mat_eigenvectors_Mat_result(data.as_raw_Mat(), mean.as_raw_Mat(), eigenvectors.as_raw_Mat(), result.as_raw_Mat()) }.into_result()
}
// identifier: cv_PCACompute_Mat_data_Mat_mean_Mat_eigenvectors_Mat_eigenvalues_double_retainedVariance
/// wrap PCA::operator() and add eigenvalues output parameter
pub fn pca_compute(data: &core::Mat, mean: &mut core::Mat, eigenvectors: &mut core::Mat, eigenvalues: &mut core::Mat, retained_variance: f64) -> Result<()> {
unsafe { sys::cv_core_cv_PCACompute_Mat_data_Mat_mean_Mat_eigenvectors_Mat_eigenvalues_double_retainedVariance(data.as_raw_Mat(), mean.as_raw_Mat(), eigenvectors.as_raw_Mat(), eigenvalues.as_raw_Mat(), retained_variance) }.into_result()
}
// identifier: cv_PCACompute_Mat_data_Mat_mean_Mat_eigenvectors_Mat_eigenvalues_int_maxComponents
/// wrap PCA::operator() and add eigenvalues output parameter
///
/// ## C++ default parameters:
/// * max_components: 0
pub fn pca_compute_1(data: &core::Mat, mean: &mut core::Mat, eigenvectors: &mut core::Mat, eigenvalues: &mut core::Mat, max_components: i32) -> Result<()> {
unsafe { sys::cv_core_cv_PCACompute_Mat_data_Mat_mean_Mat_eigenvectors_Mat_eigenvalues_int_maxComponents(data.as_raw_Mat(), mean.as_raw_Mat(), eigenvectors.as_raw_Mat(), eigenvalues.as_raw_Mat(), max_components) }.into_result()
}
// identifier: cv_PCACompute_Mat_data_Mat_mean_Mat_eigenvectors_double_retainedVariance
/// wrap PCA::operator()
pub fn pca_compute_variance(data: &core::Mat, mean: &mut core::Mat, eigenvectors: &mut core::Mat, retained_variance: f64) -> Result<()> {
unsafe { sys::cv_core_cv_PCACompute_Mat_data_Mat_mean_Mat_eigenvectors_double_retainedVariance(data.as_raw_Mat(), mean.as_raw_Mat(), eigenvectors.as_raw_Mat(), retained_variance) }.into_result()
}
// identifier: cv_PCACompute_Mat_data_Mat_mean_Mat_eigenvectors_int_maxComponents
/// wrap PCA::operator()
///
/// ## C++ default parameters:
/// * max_components: 0
pub fn pca_compute_2(data: &core::Mat, mean: &mut core::Mat, eigenvectors: &mut core::Mat, max_components: i32) -> Result<()> {
unsafe { sys::cv_core_cv_PCACompute_Mat_data_Mat_mean_Mat_eigenvectors_int_maxComponents(data.as_raw_Mat(), mean.as_raw_Mat(), eigenvectors.as_raw_Mat(), max_components) }.into_result()
}
// identifier: cv_PCAProject_Mat_data_Mat_mean_Mat_eigenvectors_Mat_result
/// wrap PCA::project
pub fn pca_project(data: &core::Mat, mean: &core::Mat, eigenvectors: &core::Mat, result: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_PCAProject_Mat_data_Mat_mean_Mat_eigenvectors_Mat_result(data.as_raw_Mat(), mean.as_raw_Mat(), eigenvectors.as_raw_Mat(), result.as_raw_Mat()) }.into_result()
}
// identifier: cv_PSNR_Mat_src1_Mat_src2
/// Computes the Peak Signal-to-Noise Ratio (PSNR) image quality metric.
///
/// This function calculates the Peak Signal-to-Noise Ratio (PSNR) image quality metric in decibels (dB), between two input arrays src1 and src2. Arrays must have depth CV_8U.
///
/// The PSNR is calculated as follows:
///
/// <div lang='latex'>
/// \texttt{PSNR} = 10 \cdot \log_{10}{\left( \frac{R^2}{MSE} \right) }
/// </div>
///
/// where R is the maximum integer value of depth CV_8U (255) and MSE is the mean squared error between the two arrays.
///
/// ## Parameters
/// * src1: first input array.
/// * src2: second input array of the same size as src1.
pub fn psnr(src1: &core::Mat, src2: &core::Mat) -> Result<f64> {
unsafe { sys::cv_core_cv_PSNR_Mat_src1_Mat_src2(src1.as_raw_Mat(), src2.as_raw_Mat()) }.into_result()
}
// identifier: cv_RQDecomp3x3_Mat_src_Mat_mtxR_Mat_mtxQ_Mat_Qx_Mat_Qy_Mat_Qz
/// Computes an RQ decomposition of 3x3 matrices.
///
/// ## Parameters
/// * src: 3x3 input matrix.
/// * mtxR: Output 3x3 upper-triangular matrix.
/// * mtxQ: Output 3x3 orthogonal matrix.
/// * Qx: Optional output 3x3 rotation matrix around x-axis.
/// * Qy: Optional output 3x3 rotation matrix around y-axis.
/// * Qz: Optional output 3x3 rotation matrix around z-axis.
///
/// The function computes a RQ decomposition using the given rotations. This function is used in
/// decomposeProjectionMatrix to decompose the left 3x3 submatrix of a projection matrix into a camera
/// and a rotation matrix.
///
/// It optionally returns three rotation matrices, one for each axis, and the three Euler angles in
/// degrees (as the return value) that could be used in OpenGL. Note, there is always more than one
/// sequence of rotations about the three principal axes that results in the same orientation of an
/// object, e.g. see @cite Slabaugh . Returned tree rotation matrices and corresponding three Euler angles
/// are only one of the possible solutions.
///
/// ## C++ default parameters:
/// * qx: noArray()
/// * qy: noArray()
/// * qz: noArray()
pub fn rq_decomp3x3(src: &core::Mat, mtx_r: &mut core::Mat, mtx_q: &mut core::Mat, qx: &mut core::Mat, qy: &mut core::Mat, qz: &mut core::Mat) -> Result<core::Vec3d> {
unsafe { sys::cv_core_cv_RQDecomp3x3_Mat_src_Mat_mtxR_Mat_mtxQ_Mat_Qx_Mat_Qy_Mat_Qz(src.as_raw_Mat(), mtx_r.as_raw_Mat(), mtx_q.as_raw_Mat(), qx.as_raw_Mat(), qy.as_raw_Mat(), qz.as_raw_Mat()) }.into_result()
}
// identifier: cv_Rodrigues_Mat_src_Mat_dst_Mat_jacobian
/// Converts a rotation matrix to a rotation vector or vice versa.
///
/// ## Parameters
/// * src: Input rotation vector (3x1 or 1x3) or rotation matrix (3x3).
/// * dst: Output rotation matrix (3x3) or rotation vector (3x1 or 1x3), respectively.
/// * jacobian: Optional output Jacobian matrix, 3x9 or 9x3, which is a matrix of partial
/// derivatives of the output array components with respect to the input array components.
///
/// <div lang='latex'>\begin{array}{l} \theta \leftarrow norm(r) \\ r \leftarrow r/ \theta \\ R = \cos{\theta} I + (1- \cos{\theta} ) r r^T + \sin{\theta} \vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} \end{array}</div>
///
/// Inverse transformation can be also done easily, since
///
/// <div lang='latex'>\sin ( \theta ) \vecthreethree{0}{-r_z}{r_y}{r_z}{0}{-r_x}{-r_y}{r_x}{0} = \frac{R - R^T}{2}</div>
///
/// A rotation vector is a convenient and most compact representation of a rotation matrix (since any
/// rotation matrix has just 3 degrees of freedom). The representation is used in the global 3D geometry
/// optimization procedures like calibrateCamera, stereoCalibrate, or solvePnP .
///
/// ## C++ default parameters:
/// * jacobian: noArray()
pub fn rodrigues(src: &core::Mat, dst: &mut core::Mat, jacobian: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_Rodrigues_Mat_src_Mat_dst_Mat_jacobian(src.as_raw_Mat(), dst.as_raw_Mat(), jacobian.as_raw_Mat()) }.into_result()
}
// identifier: cv_SVBackSubst_Mat_w_Mat_u_Mat_vt_Mat_rhs_Mat_dst
/// wrap SVD::backSubst
pub fn sv_back_subst(w: &core::Mat, u: &core::Mat, vt: &core::Mat, rhs: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_SVBackSubst_Mat_w_Mat_u_Mat_vt_Mat_rhs_Mat_dst(w.as_raw_Mat(), u.as_raw_Mat(), vt.as_raw_Mat(), rhs.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_SVDecomp_Mat_src_Mat_w_Mat_u_Mat_vt_int_flags
/// wrap SVD::compute
///
/// ## C++ default parameters:
/// * flags: 0
pub fn sv_decomp(src: &core::Mat, w: &mut core::Mat, u: &mut core::Mat, vt: &mut core::Mat, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_SVDecomp_Mat_src_Mat_w_Mat_u_Mat_vt_int_flags(src.as_raw_Mat(), w.as_raw_Mat(), u.as_raw_Mat(), vt.as_raw_Mat(), flags) }.into_result()
}
// identifier: cv_Scharr_Mat_src_Mat_dst_int_ddepth_int_dx_int_dy_double_scale_double_delta_int_borderType
/// Calculates the first x- or y- image derivative using Scharr operator.
///
/// The function computes the first x- or y- spatial image derivative using the Scharr operator. The
/// call
///
/// <div lang='latex'>\texttt{Scharr(src, dst, ddepth, dx, dy, scale, delta, borderType)}</div>
///
/// is equivalent to
///
/// <div lang='latex'>\texttt{Sobel(src, dst, ddepth, dx, dy, CV_SCHARR, scale, delta, borderType)} .</div>
///
/// ## Parameters
/// * src: input image.
/// * dst: output image of the same size and the same number of channels as src.
/// * ddepth: output image depth, see @ref filter_depths "combinations"
/// * dx: order of the derivative x.
/// * dy: order of the derivative y.
/// * scale: optional scale factor for the computed derivative values; by default, no scaling is
/// applied (see #getDerivKernels for details).
/// * delta: optional delta value that is added to the results prior to storing them in dst.
/// * borderType: pixel extrapolation method, see #BorderTypes
/// @sa cartToPolar
///
/// ## C++ default parameters:
/// * scale: 1
/// * delta: 0
/// * border_type: BORDER_DEFAULT
pub fn scharr(src: &core::Mat, dst: &mut core::Mat, ddepth: i32, dx: i32, dy: i32, scale: f64, delta: f64, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_Scharr_Mat_src_Mat_dst_int_ddepth_int_dx_int_dy_double_scale_double_delta_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ddepth, dx, dy, scale, delta, border_type) }.into_result()
}
// identifier: cv_Sobel_Mat_src_Mat_dst_int_ddepth_int_dx_int_dy_int_ksize_double_scale_double_delta_int_borderType
/// Calculates the first, second, third, or mixed image derivatives using an extended Sobel operator.
///
/// In all cases except one, the <span lang='latex'>\texttt{ksize} \times \texttt{ksize}</span> separable kernel is used to
/// calculate the derivative. When <span lang='latex'>\texttt{ksize = 1}</span>, the <span lang='latex'>3 \times 1</span> or <span lang='latex'>1 \times 3</span>
/// kernel is used (that is, no Gaussian smoothing is done). `ksize = 1` can only be used for the first
/// or the second x- or y- derivatives.
///
/// There is also the special value `ksize = #CV_SCHARR (-1)` that corresponds to the <span lang='latex'>3\times3</span> Scharr
/// filter that may give more accurate results than the <span lang='latex'>3\times3</span> Sobel. The Scharr aperture is
///
/// <div lang='latex'>\vecthreethree{-3}{0}{3}{-10}{0}{10}{-3}{0}{3}</div>
///
/// for the x-derivative, or transposed for the y-derivative.
///
/// The function calculates an image derivative by convolving the image with the appropriate kernel:
///
/// <div lang='latex'>\texttt{dst} = \frac{\partial^{xorder+yorder} \texttt{src}}{\partial x^{xorder} \partial y^{yorder}}</div>
///
/// The Sobel operators combine Gaussian smoothing and differentiation, so the result is more or less
/// resistant to the noise. Most often, the function is called with ( xorder = 1, yorder = 0, ksize = 3)
/// or ( xorder = 0, yorder = 1, ksize = 3) to calculate the first x- or y- image derivative. The first
/// case corresponds to a kernel of:
///
/// <div lang='latex'>\vecthreethree{-1}{0}{1}{-2}{0}{2}{-1}{0}{1}</div>
///
/// The second case corresponds to a kernel of:
///
/// <div lang='latex'>\vecthreethree{-1}{-2}{-1}{0}{0}{0}{1}{2}{1}</div>
///
/// ## Parameters
/// * src: input image.
/// * dst: output image of the same size and the same number of channels as src .
/// * ddepth: output image depth, see @ref filter_depths "combinations"; in the case of
/// 8-bit input images it will result in truncated derivatives.
/// * dx: order of the derivative x.
/// * dy: order of the derivative y.
/// * ksize: size of the extended Sobel kernel; it must be 1, 3, 5, or 7.
/// * scale: optional scale factor for the computed derivative values; by default, no scaling is
/// applied (see #getDerivKernels for details).
/// * delta: optional delta value that is added to the results prior to storing them in dst.
/// * borderType: pixel extrapolation method, see #BorderTypes
/// @sa Scharr, Laplacian, sepFilter2D, filter2D, GaussianBlur, cartToPolar
///
/// ## C++ default parameters:
/// * ksize: 3
/// * scale: 1
/// * delta: 0
/// * border_type: BORDER_DEFAULT
pub fn sobel(src: &core::Mat, dst: &mut core::Mat, ddepth: i32, dx: i32, dy: i32, ksize: i32, scale: f64, delta: f64, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_Sobel_Mat_src_Mat_dst_int_ddepth_int_dx_int_dy_int_ksize_double_scale_double_delta_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ddepth, dx, dy, ksize, scale, delta, border_type) }.into_result()
}
// identifier: cv_abs_softdouble_a
pub fn abs(a: &core::softdouble) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_abs_softdouble_a(a.as_raw_softdouble()) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_abs_softfloat_a
/// Absolute value
pub fn abs_1(a: &core::softfloat) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_abs_softfloat_a(a.as_raw_softfloat()) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_absdiff_Mat_src1_Mat_src2_Mat_dst
/// Calculates the per-element absolute difference between two arrays or between an array and a scalar.
///
/// The function cv::absdiff calculates:
/// Absolute difference between two arrays when they have the same
/// size and type:
/// <div lang='latex'>\texttt{dst}(I) = \texttt{saturate} (| \texttt{src1}(I) - \texttt{src2}(I)|)</div>
/// Absolute difference between an array and a scalar when the second
/// array is constructed from Scalar or has as many elements as the
/// number of channels in `src1`:
/// <div lang='latex'>\texttt{dst}(I) = \texttt{saturate} (| \texttt{src1}(I) - \texttt{src2} |)</div>
/// Absolute difference between a scalar and an array when the first
/// array is constructed from Scalar or has as many elements as the
/// number of channels in `src2`:
/// <div lang='latex'>\texttt{dst}(I) = \texttt{saturate} (| \texttt{src1} - \texttt{src2}(I) |)</div>
/// where I is a multi-dimensional index of array elements. In case of
/// multi-channel arrays, each channel is processed independently.
///
/// Note: Saturation is not applied when the arrays have the depth CV_32S.
/// You may even get a negative value in the case of overflow.
/// ## Parameters
/// * src1: first input array or a scalar.
/// * src2: second input array or a scalar.
/// * dst: output array that has the same size and type as input arrays.
/// @sa cv::abs(const Mat&)
pub fn absdiff(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_absdiff_Mat_src1_Mat_src2_Mat_dst(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_accumulateProduct_Mat_src1_Mat_src2_Mat_dst_Mat_mask
/// Adds the per-element product of two input images to the accumulator image.
///
/// The function adds the product of two images or their selected regions to the accumulator dst :
///
/// <div lang='latex'>\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src1} (x,y) \cdot \texttt{src2} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0</div>
///
/// The function supports multi-channel images. Each channel is processed independently.
///
/// ## Parameters
/// * src1: First input image, 1- or 3-channel, 8-bit or 32-bit floating point.
/// * src2: Second input image of the same type and the same size as src1 .
/// * dst: %Accumulator image with the same number of channels as input images, 32-bit or 64-bit
/// floating-point.
/// * mask: Optional operation mask.
///
/// @sa accumulate, accumulateSquare, accumulateWeighted
///
/// ## C++ default parameters:
/// * mask: noArray()
pub fn accumulate_product(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_accumulateProduct_Mat_src1_Mat_src2_Mat_dst_Mat_mask(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_accumulateSquare_Mat_src_Mat_dst_Mat_mask
/// Adds the square of a source image to the accumulator image.
///
/// The function adds the input image src or its selected region, raised to a power of 2, to the
/// accumulator dst :
///
/// <div lang='latex'>\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src} (x,y)^2 \quad \text{if} \quad \texttt{mask} (x,y) \ne 0</div>
///
/// The function supports multi-channel images. Each channel is processed independently.
///
/// ## Parameters
/// * src: Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
/// * dst: %Accumulator image with the same number of channels as input image, 32-bit or 64-bit
/// floating-point.
/// * mask: Optional operation mask.
///
/// @sa accumulateSquare, accumulateProduct, accumulateWeighted
///
/// ## C++ default parameters:
/// * mask: noArray()
pub fn accumulate_square(src: &core::Mat, dst: &mut core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_accumulateSquare_Mat_src_Mat_dst_Mat_mask(src.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_accumulateWeighted_Mat_src_Mat_dst_double_alpha_Mat_mask
/// Updates a running average.
///
/// The function calculates the weighted sum of the input image src and the accumulator dst so that dst
/// becomes a running average of a frame sequence:
///
/// <div lang='latex'>\texttt{dst} (x,y) \leftarrow (1- \texttt{alpha} ) \cdot \texttt{dst} (x,y) + \texttt{alpha} \cdot \texttt{src} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0</div>
///
/// That is, alpha regulates the update speed (how fast the accumulator "forgets" about earlier images).
/// The function supports multi-channel images. Each channel is processed independently.
///
/// ## Parameters
/// * src: Input image as 1- or 3-channel, 8-bit or 32-bit floating point.
/// * dst: %Accumulator image with the same number of channels as input image, 32-bit or 64-bit
/// floating-point.
/// * alpha: Weight of the input image.
/// * mask: Optional operation mask.
///
/// @sa accumulate, accumulateSquare, accumulateProduct
///
/// ## C++ default parameters:
/// * mask: noArray()
pub fn accumulate_weighted(src: &core::Mat, dst: &mut core::Mat, alpha: f64, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_accumulateWeighted_Mat_src_Mat_dst_double_alpha_Mat_mask(src.as_raw_Mat(), dst.as_raw_Mat(), alpha, mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_accumulate_Mat_src_Mat_dst_Mat_mask
/// Adds an image to the accumulator image.
///
/// The function adds src or some of its elements to dst :
///
/// <div lang='latex'>\texttt{dst} (x,y) \leftarrow \texttt{dst} (x,y) + \texttt{src} (x,y) \quad \text{if} \quad \texttt{mask} (x,y) \ne 0</div>
///
/// The function supports multi-channel images. Each channel is processed independently.
///
/// The function cv::accumulate can be used, for example, to collect statistics of a scene background
/// viewed by a still camera and for the further foreground-background segmentation.
///
/// ## Parameters
/// * src: Input image of type CV_8UC(n), CV_16UC(n), CV_32FC(n) or CV_64FC(n), where n is a positive integer.
/// * dst: %Accumulator image with the same number of channels as input image, and a depth of CV_32F or CV_64F.
/// * mask: Optional operation mask.
///
/// @sa accumulateSquare, accumulateProduct, accumulateWeighted
///
/// ## C++ default parameters:
/// * mask: noArray()
pub fn accumulate(src: &core::Mat, dst: &mut core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_accumulate_Mat_src_Mat_dst_Mat_mask(src.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_adaptiveThreshold_Mat_src_Mat_dst_double_maxValue_int_adaptiveMethod_int_thresholdType_int_blockSize_double_C
/// Applies an adaptive threshold to an array.
///
/// The function transforms a grayscale image to a binary image according to the formulae:
/// * **THRESH_BINARY**
/// <div lang='latex'>dst(x,y) = \fork{\texttt{maxValue}}{if \(src(x,y) > T(x,y)\)}{0}{otherwise}</div>
/// * **THRESH_BINARY_INV**
/// <div lang='latex'>dst(x,y) = \fork{0}{if \(src(x,y) > T(x,y)\)}{\texttt{maxValue}}{otherwise}</div>
/// where <span lang='latex'>T(x,y)</span> is a threshold calculated individually for each pixel (see adaptiveMethod parameter).
///
/// The function can process the image in-place.
///
/// ## Parameters
/// * src: Source 8-bit single-channel image.
/// * dst: Destination image of the same size and the same type as src.
/// * maxValue: Non-zero value assigned to the pixels for which the condition is satisfied
/// * adaptiveMethod: Adaptive thresholding algorithm to use, see #AdaptiveThresholdTypes.
/// The #BORDER_REPLICATE | #BORDER_ISOLATED is used to process boundaries.
/// * thresholdType: Thresholding type that must be either #THRESH_BINARY or #THRESH_BINARY_INV,
/// see #ThresholdTypes.
/// * blockSize: Size of a pixel neighborhood that is used to calculate a threshold value for the
/// pixel: 3, 5, 7, and so on.
/// * C: Constant subtracted from the mean or weighted mean (see the details below). Normally, it
/// is positive but may be zero or negative as well.
///
/// @sa threshold, blur, GaussianBlur
pub fn adaptive_threshold(src: &core::Mat, dst: &mut core::Mat, max_value: f64, adaptive_method: i32, threshold_type: i32, block_size: i32, c: f64) -> Result<()> {
unsafe { sys::cv_core_cv_adaptiveThreshold_Mat_src_Mat_dst_double_maxValue_int_adaptiveMethod_int_thresholdType_int_blockSize_double_C(src.as_raw_Mat(), dst.as_raw_Mat(), max_value, adaptive_method, threshold_type, block_size, c) }.into_result()
}
// identifier: cv_addText_Mat_img_String_text_Point_org_QtFont_font
/// Draws a text on the image.
///
/// The function addText draws *text* on the image *img* using a specific font *font* (see example cv::fontQt
/// )
///
/// ## Parameters
/// * img: 8-bit 3-channel image where the text should be drawn.
/// * text: Text to write on an image.
/// * org: Point(x,y) where the text should start on an image.
/// * font: Font to use to draw a text.
pub fn add_text(img: &core::Mat, text: &str, org: core::Point, font: &core::QtFont) -> Result<()> {
string_arg!(text);
unsafe { sys::cv_core_cv_addText_Mat_img_String_text_Point_org_QtFont_font(img.as_raw_Mat(), text.as_ptr(), org, font.as_raw_QtFont()) }.into_result()
}
// identifier: cv_addText_Mat_img_String_text_Point_org_String_nameFont_int_pointSize_Scalar_color_int_weight_int_style_int_spacing
/// Draws a text on the image.
///
/// ## Parameters
/// * img: 8-bit 3-channel image where the text should be drawn.
/// * text: Text to write on an image.
/// * org: Point(x,y) where the text should start on an image.
/// * nameFont: Name of the font. The name should match the name of a system font (such as
/// *Times*). If the font is not found, a default one is used.
/// * pointSize: Size of the font. If not specified, equal zero or negative, the point size of the
/// font is set to a system-dependent default value. Generally, this is 12 points.
/// * color: Color of the font in BGRA where A = 255 is fully transparent.
/// * weight: Font weight. Available operation flags are : cv::QtFontWeights You can also specify a positive integer for better control.
/// * style: Font style. Available operation flags are : cv::QtFontStyles
/// * spacing: Spacing between characters. It can be negative or positive.
///
/// ## C++ default parameters:
/// * point_size: -1
/// * color: Scalar::all(0)
/// * weight: QT_FONT_NORMAL
/// * style: QT_STYLE_NORMAL
/// * spacing: 0
pub fn add_text_1(img: &core::Mat, text: &str, org: core::Point, name_font: &str, point_size: i32, color: core::Scalar, weight: i32, style: i32, spacing: i32) -> Result<()> {
string_arg!(text);
string_arg!(name_font);
unsafe { sys::cv_core_cv_addText_Mat_img_String_text_Point_org_String_nameFont_int_pointSize_Scalar_color_int_weight_int_style_int_spacing(img.as_raw_Mat(), text.as_ptr(), org, name_font.as_ptr(), point_size, color, weight, style, spacing) }.into_result()
}
// identifier: cv_addWeighted_Mat_src1_double_alpha_Mat_src2_double_beta_double_gamma_Mat_dst_int_dtype
/// Calculates the weighted sum of two arrays.
///
/// The function addWeighted calculates the weighted sum of two arrays as follows:
/// <div lang='latex'>\texttt{dst} (I)= \texttt{saturate} ( \texttt{src1} (I)* \texttt{alpha} + \texttt{src2} (I)* \texttt{beta} + \texttt{gamma} )</div>
/// where I is a multi-dimensional index of array elements. In case of multi-channel arrays, each
/// channel is processed independently.
/// The function can be replaced with a matrix expression:
/// ```ignore{.cpp}
/// dst = src1*alpha + src2*beta + gamma;
/// ```
///
///
/// Note: Saturation is not applied when the output array has the depth CV_32S. You may even get
/// result of an incorrect sign in the case of overflow.
/// ## Parameters
/// * src1: first input array.
/// * alpha: weight of the first array elements.
/// * src2: second input array of the same size and channel number as src1.
/// * beta: weight of the second array elements.
/// * gamma: scalar added to each sum.
/// * dst: output array that has the same size and number of channels as the input arrays.
/// * dtype: optional depth of the output array; when both input arrays have the same depth, dtype
/// can be set to -1, which will be equivalent to src1.depth().
/// @sa add, subtract, scaleAdd, Mat::convertTo
///
/// ## C++ default parameters:
/// * dtype: -1
pub fn add_weighted(src1: &core::Mat, alpha: f64, src2: &core::Mat, beta: f64, gamma: f64, dst: &mut core::Mat, dtype: i32) -> Result<()> {
unsafe { sys::cv_core_cv_addWeighted_Mat_src1_double_alpha_Mat_src2_double_beta_double_gamma_Mat_dst_int_dtype(src1.as_raw_Mat(), alpha, src2.as_raw_Mat(), beta, gamma, dst.as_raw_Mat(), dtype) }.into_result()
}
// identifier: cv_add_Mat_src1_Mat_src2_Mat_dst_Mat_mask_int_dtype
/// Calculates the per-element sum of two arrays or an array and a scalar.
///
/// The function add calculates:
/// - Sum of two arrays when both input arrays have the same size and the same number of channels:
/// <div lang='latex'>\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1}(I) + \texttt{src2}(I)) \quad \texttt{if mask}(I) \ne0</div>
/// - Sum of an array and a scalar when src2 is constructed from Scalar or has the same number of
/// elements as `src1.channels()`:
/// <div lang='latex'>\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1}(I) + \texttt{src2} ) \quad \texttt{if mask}(I) \ne0</div>
/// - Sum of a scalar and an array when src1 is constructed from Scalar or has the same number of
/// elements as `src2.channels()`:
/// <div lang='latex'>\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1} + \texttt{src2}(I) ) \quad \texttt{if mask}(I) \ne0</div>
/// where `I` is a multi-dimensional index of array elements. In case of multi-channel arrays, each
/// channel is processed independently.
///
/// The first function in the list above can be replaced with matrix expressions:
/// ```ignore{.cpp}
/// dst = src1 + src2;
/// dst += src1; // equivalent to add(dst, src1, dst);
/// ```
///
/// The input arrays and the output array can all have the same or different depths. For example, you
/// can add a 16-bit unsigned array to a 8-bit signed array and store the sum as a 32-bit
/// floating-point array. Depth of the output array is determined by the dtype parameter. In the second
/// and third cases above, as well as in the first case, when src1.depth() == src2.depth(), dtype can
/// be set to the default -1. In this case, the output array will have the same depth as the input
/// array, be it src1, src2 or both.
///
/// Note: Saturation is not applied when the output array has the depth CV_32S. You may even get
/// result of an incorrect sign in the case of overflow.
/// ## Parameters
/// * src1: first input array or a scalar.
/// * src2: second input array or a scalar.
/// * dst: output array that has the same size and number of channels as the input array(s); the
/// depth is defined by dtype or src1/src2.
/// * mask: optional operation mask - 8-bit single channel array, that specifies elements of the
/// output array to be changed.
/// * dtype: optional depth of the output array (see the discussion below).
/// @sa subtract, addWeighted, scaleAdd, Mat::convertTo
///
/// ## C++ default parameters:
/// * mask: noArray()
/// * dtype: -1
pub fn add(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat, mask: &core::Mat, dtype: i32) -> Result<()> {
unsafe { sys::cv_core_cv_add_Mat_src1_Mat_src2_Mat_dst_Mat_mask_int_dtype(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat(), dtype) }.into_result()
}
// identifier: cv_alignSize_size_t_sz_int_n
/// Aligns a buffer size to the specified number of bytes.
///
/// The function returns the minimum number that is greater than or equal to sz and is divisible by n :
/// <div lang='latex'>\texttt{(sz + n-1) & -n}</div>
/// ## Parameters
/// * sz: Buffer size to align.
/// * n: Alignment size that must be a power of two.
pub fn align_size(sz: size_t, n: i32) -> Result<size_t> {
unsafe { sys::cv_core_cv_alignSize_size_t_sz_int_n(sz, n) }.into_result()
}
// identifier: cv_applyColorMap_Mat_src_Mat_dst_Mat_userColor
/// Applies a user colormap on a given image.
///
/// ## Parameters
/// * src: The source image, grayscale or colored of type CV_8UC1 or CV_8UC3.
/// * dst: The result is the colormapped source image. Note: Mat::create is called on dst.
/// * userColor: The colormap to apply of type CV_8UC1 or CV_8UC3 and size 256
pub fn apply_color_map(src: &core::Mat, dst: &mut core::Mat, user_color: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_applyColorMap_Mat_src_Mat_dst_Mat_userColor(src.as_raw_Mat(), dst.as_raw_Mat(), user_color.as_raw_Mat()) }.into_result()
}
// identifier: cv_applyColorMap_Mat_src_Mat_dst_int_colormap
/// Applies a GNU Octave/MATLAB equivalent colormap on a given image.
///
/// ## Parameters
/// * src: The source image, grayscale or colored of type CV_8UC1 or CV_8UC3.
/// * dst: The result is the colormapped source image. Note: Mat::create is called on dst.
/// * colormap: The colormap to apply, see #ColormapTypes
pub fn apply_color_map_1(src: &core::Mat, dst: &mut core::Mat, colormap: i32) -> Result<()> {
unsafe { sys::cv_core_cv_applyColorMap_Mat_src_Mat_dst_int_colormap(src.as_raw_Mat(), dst.as_raw_Mat(), colormap) }.into_result()
}
// identifier: cv_approxPolyDP_Mat_curve_Mat_approxCurve_double_epsilon_bool_closed
/// Approximates a polygonal curve(s) with the specified precision.
///
/// The function cv::approxPolyDP approximates a curve or a polygon with another curve/polygon with less
/// vertices so that the distance between them is less or equal to the specified precision. It uses the
/// Douglas-Peucker algorithm <http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm>
///
/// ## Parameters
/// * curve: Input vector of a 2D point stored in std::vector or Mat
/// * approxCurve: Result of the approximation. The type should match the type of the input curve.
/// * epsilon: Parameter specifying the approximation accuracy. This is the maximum distance
/// between the original curve and its approximation.
/// * closed: If true, the approximated curve is closed (its first and last vertices are
/// connected). Otherwise, it is not closed.
pub fn approx_poly_dp(curve: &core::Mat, approx_curve: &mut core::Mat, epsilon: f64, closed: bool) -> Result<()> {
unsafe { sys::cv_core_cv_approxPolyDP_Mat_curve_Mat_approxCurve_double_epsilon_bool_closed(curve.as_raw_Mat(), approx_curve.as_raw_Mat(), epsilon, closed) }.into_result()
}
// identifier: cv_arcLength_Mat_curve_bool_closed
/// Calculates a contour perimeter or a curve length.
///
/// The function computes a curve length or a closed contour perimeter.
///
/// ## Parameters
/// * curve: Input vector of 2D points, stored in std::vector or Mat.
/// * closed: Flag indicating whether the curve is closed or not.
pub fn arc_length(curve: &core::Mat, closed: bool) -> Result<f64> {
unsafe { sys::cv_core_cv_arcLength_Mat_curve_bool_closed(curve.as_raw_Mat(), closed) }.into_result()
}
// identifier: cv_arrowedLine_Mat_img_Point_pt1_Point_pt2_Scalar_color_int_thickness_int_line_type_int_shift_double_tipLength
/// Draws a arrow segment pointing from the first point to the second one.
///
/// The function cv::arrowedLine draws an arrow between pt1 and pt2 points in the image. See also #line.
///
/// ## Parameters
/// * img: Image.
/// * pt1: The point the arrow starts from.
/// * pt2: The point the arrow points to.
/// * color: Line color.
/// * thickness: Line thickness.
/// * line_type: Type of the line. See #LineTypes
/// * shift: Number of fractional bits in the point coordinates.
/// * tipLength: The length of the arrow tip in relation to the arrow length
///
/// ## C++ default parameters:
/// * thickness: 1
/// * line_type: 8
/// * shift: 0
/// * tip_length: 0.1
pub fn arrowed_line(img: &mut core::Mat, pt1: core::Point, pt2: core::Point, color: core::Scalar, thickness: i32, line_type: i32, shift: i32, tip_length: f64) -> Result<()> {
unsafe { sys::cv_core_cv_arrowedLine_Mat_img_Point_pt1_Point_pt2_Scalar_color_int_thickness_int_line_type_int_shift_double_tipLength(img.as_raw_Mat(), pt1, pt2, color, thickness, line_type, shift, tip_length) }.into_result()
}
// identifier: cv_batchDistance_Mat_src1_Mat_src2_Mat_dist_int_dtype_Mat_nidx_int_normType_int_K_Mat_mask_int_update_bool_crosscheck
/// naive nearest neighbor finder
///
/// see http://en.wikipedia.org/wiki/Nearest_neighbor_search
/// @todo document
///
/// ## C++ default parameters:
/// * norm_type: NORM_L2
/// * k: 0
/// * mask: noArray()
/// * update: 0
/// * crosscheck: false
pub fn batch_distance(src1: &core::Mat, src2: &core::Mat, dist: &mut core::Mat, dtype: i32, nidx: &mut core::Mat, norm_type: i32, k: i32, mask: &core::Mat, update: i32, crosscheck: bool) -> Result<()> {
unsafe { sys::cv_core_cv_batchDistance_Mat_src1_Mat_src2_Mat_dist_int_dtype_Mat_nidx_int_normType_int_K_Mat_mask_int_update_bool_crosscheck(src1.as_raw_Mat(), src2.as_raw_Mat(), dist.as_raw_Mat(), dtype, nidx.as_raw_Mat(), norm_type, k, mask.as_raw_Mat(), update, crosscheck) }.into_result()
}
// identifier: cv_bilateralFilter_Mat_src_Mat_dst_int_d_double_sigmaColor_double_sigmaSpace_int_borderType
/// Applies the bilateral filter to an image.
///
/// The function applies bilateral filtering to the input image, as described in
/// http://www.dai.ed.ac.uk/CVonline/LOCAL_COPIES/MANDUCHI1/Bilateral_Filtering.html
/// bilateralFilter can reduce unwanted noise very well while keeping edges fairly sharp. However, it is
/// very slow compared to most filters.
///
/// _Sigma values_: For simplicity, you can set the 2 sigma values to be the same. If they are small (\<
/// 10), the filter will not have much effect, whereas if they are large (\> 150), they will have a very
/// strong effect, making the image look "cartoonish".
///
/// _Filter size_: Large filters (d \> 5) are very slow, so it is recommended to use d=5 for real-time
/// applications, and perhaps d=9 for offline applications that need heavy noise filtering.
///
/// This filter does not work inplace.
/// ## Parameters
/// * src: Source 8-bit or floating-point, 1-channel or 3-channel image.
/// * dst: Destination image of the same size and type as src .
/// * d: Diameter of each pixel neighborhood that is used during filtering. If it is non-positive,
/// it is computed from sigmaSpace.
/// * sigmaColor: Filter sigma in the color space. A larger value of the parameter means that
/// farther colors within the pixel neighborhood (see sigmaSpace) will be mixed together, resulting
/// in larger areas of semi-equal color.
/// * sigmaSpace: Filter sigma in the coordinate space. A larger value of the parameter means that
/// farther pixels will influence each other as long as their colors are close enough (see sigmaColor
/// ). When d\>0, it specifies the neighborhood size regardless of sigmaSpace. Otherwise, d is
/// proportional to sigmaSpace.
/// * borderType: border mode used to extrapolate pixels outside of the image, see #BorderTypes
///
/// ## C++ default parameters:
/// * border_type: BORDER_DEFAULT
pub fn bilateral_filter(src: &core::Mat, dst: &mut core::Mat, d: i32, sigma_color: f64, sigma_space: f64, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_bilateralFilter_Mat_src_Mat_dst_int_d_double_sigmaColor_double_sigmaSpace_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), d, sigma_color, sigma_space, border_type) }.into_result()
}
// identifier: cv_bitwise_and_Mat_src1_Mat_src2_Mat_dst_Mat_mask
/// computes bitwise conjunction of the two arrays (dst = src1 & src2)
/// Calculates the per-element bit-wise conjunction of two arrays or an
/// array and a scalar.
///
/// The function cv::bitwise_and calculates the per-element bit-wise logical conjunction for:
/// Two arrays when src1 and src2 have the same size:
/// <div lang='latex'>\texttt{dst} (I) = \texttt{src1} (I) \wedge \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0</div>
/// An array and a scalar when src2 is constructed from Scalar or has
/// the same number of elements as `src1.channels()`:
/// <div lang='latex'>\texttt{dst} (I) = \texttt{src1} (I) \wedge \texttt{src2} \quad \texttt{if mask} (I) \ne0</div>
/// A scalar and an array when src1 is constructed from Scalar or has
/// the same number of elements as `src2.channels()`:
/// <div lang='latex'>\texttt{dst} (I) = \texttt{src1} \wedge \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0</div>
/// In case of floating-point arrays, their machine-specific bit
/// representations (usually IEEE754-compliant) are used for the operation.
/// In case of multi-channel arrays, each channel is processed
/// independently. In the second and third cases above, the scalar is first
/// converted to the array type.
/// ## Parameters
/// * src1: first input array or a scalar.
/// * src2: second input array or a scalar.
/// * dst: output array that has the same size and type as the input
/// arrays.
/// * mask: optional operation mask, 8-bit single channel array, that
/// specifies elements of the output array to be changed.
///
/// ## C++ default parameters:
/// * mask: noArray()
pub fn bitwise_and(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_bitwise_and_Mat_src1_Mat_src2_Mat_dst_Mat_mask(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_bitwise_not_Mat_src_Mat_dst_Mat_mask
/// Inverts every bit of an array.
///
/// The function cv::bitwise_not calculates per-element bit-wise inversion of the input
/// array:
/// <div lang='latex'>\texttt{dst} (I) = \neg \texttt{src} (I)</div>
/// In case of a floating-point input array, its machine-specific bit
/// representation (usually IEEE754-compliant) is used for the operation. In
/// case of multi-channel arrays, each channel is processed independently.
/// ## Parameters
/// * src: input array.
/// * dst: output array that has the same size and type as the input
/// array.
/// * mask: optional operation mask, 8-bit single channel array, that
/// specifies elements of the output array to be changed.
///
/// ## C++ default parameters:
/// * mask: noArray()
pub fn bitwise_not(src: &core::Mat, dst: &mut core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_bitwise_not_Mat_src_Mat_dst_Mat_mask(src.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_bitwise_or_Mat_src1_Mat_src2_Mat_dst_Mat_mask
/// Calculates the per-element bit-wise disjunction of two arrays or an
/// array and a scalar.
///
/// The function cv::bitwise_or calculates the per-element bit-wise logical disjunction for:
/// Two arrays when src1 and src2 have the same size:
/// <div lang='latex'>\texttt{dst} (I) = \texttt{src1} (I) \vee \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0</div>
/// An array and a scalar when src2 is constructed from Scalar or has
/// the same number of elements as `src1.channels()`:
/// <div lang='latex'>\texttt{dst} (I) = \texttt{src1} (I) \vee \texttt{src2} \quad \texttt{if mask} (I) \ne0</div>
/// A scalar and an array when src1 is constructed from Scalar or has
/// the same number of elements as `src2.channels()`:
/// <div lang='latex'>\texttt{dst} (I) = \texttt{src1} \vee \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0</div>
/// In case of floating-point arrays, their machine-specific bit
/// representations (usually IEEE754-compliant) are used for the operation.
/// In case of multi-channel arrays, each channel is processed
/// independently. In the second and third cases above, the scalar is first
/// converted to the array type.
/// ## Parameters
/// * src1: first input array or a scalar.
/// * src2: second input array or a scalar.
/// * dst: output array that has the same size and type as the input
/// arrays.
/// * mask: optional operation mask, 8-bit single channel array, that
/// specifies elements of the output array to be changed.
///
/// ## C++ default parameters:
/// * mask: noArray()
pub fn bitwise_or(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_bitwise_or_Mat_src1_Mat_src2_Mat_dst_Mat_mask(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_bitwise_xor_Mat_src1_Mat_src2_Mat_dst_Mat_mask
/// Calculates the per-element bit-wise "exclusive or" operation on two
/// arrays or an array and a scalar.
///
/// The function cv::bitwise_xor calculates the per-element bit-wise logical "exclusive-or"
/// operation for:
/// Two arrays when src1 and src2 have the same size:
/// <div lang='latex'>\texttt{dst} (I) = \texttt{src1} (I) \oplus \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0</div>
/// An array and a scalar when src2 is constructed from Scalar or has
/// the same number of elements as `src1.channels()`:
/// <div lang='latex'>\texttt{dst} (I) = \texttt{src1} (I) \oplus \texttt{src2} \quad \texttt{if mask} (I) \ne0</div>
/// A scalar and an array when src1 is constructed from Scalar or has
/// the same number of elements as `src2.channels()`:
/// <div lang='latex'>\texttt{dst} (I) = \texttt{src1} \oplus \texttt{src2} (I) \quad \texttt{if mask} (I) \ne0</div>
/// In case of floating-point arrays, their machine-specific bit
/// representations (usually IEEE754-compliant) are used for the operation.
/// In case of multi-channel arrays, each channel is processed
/// independently. In the 2nd and 3rd cases above, the scalar is first
/// converted to the array type.
/// ## Parameters
/// * src1: first input array or a scalar.
/// * src2: second input array or a scalar.
/// * dst: output array that has the same size and type as the input
/// arrays.
/// * mask: optional operation mask, 8-bit single channel array, that
/// specifies elements of the output array to be changed.
///
/// ## C++ default parameters:
/// * mask: noArray()
pub fn bitwise_xor(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_bitwise_xor_Mat_src1_Mat_src2_Mat_dst_Mat_mask(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_blendLinear_Mat_src1_Mat_src2_Mat_weights1_Mat_weights2_Mat_dst
pub fn blend_linear(src1: &core::Mat, src2: &core::Mat, weights1: &core::Mat, weights2: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_blendLinear_Mat_src1_Mat_src2_Mat_weights1_Mat_weights2_Mat_dst(src1.as_raw_Mat(), src2.as_raw_Mat(), weights1.as_raw_Mat(), weights2.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_blur_Mat_src_Mat_dst_Size_ksize_Point_anchor_int_borderType
/// Blurs an image using the normalized box filter.
///
/// The function smooths an image using the kernel:
///
/// <div lang='latex'>\texttt{K} = \frac{1}{\texttt{ksize.width*ksize.height}} \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \end{bmatrix}</div>
///
/// The call `blur(src, dst, ksize, anchor, borderType)` is equivalent to `boxFilter(src, dst, src.type(),
/// anchor, true, borderType)`.
///
/// ## Parameters
/// * src: input image; it can have any number of channels, which are processed independently, but
/// the depth should be CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
/// * dst: output image of the same size and type as src.
/// * ksize: blurring kernel size.
/// * anchor: anchor point; default value Point(-1,-1) means that the anchor is at the kernel
/// center.
/// * borderType: border mode used to extrapolate pixels outside of the image, see #BorderTypes
/// @sa boxFilter, bilateralFilter, GaussianBlur, medianBlur
///
/// ## C++ default parameters:
/// * anchor: Point(-1,-1)
/// * border_type: BORDER_DEFAULT
pub fn blur(src: &core::Mat, dst: &mut core::Mat, ksize: core::Size, anchor: core::Point, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_blur_Mat_src_Mat_dst_Size_ksize_Point_anchor_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ksize, anchor, border_type) }.into_result()
}
// identifier: cv_borderInterpolate_int_p_int_len_int_borderType
/// Computes the source location of an extrapolated pixel.
///
/// The function computes and returns the coordinate of a donor pixel corresponding to the specified
/// extrapolated pixel when using the specified extrapolation border mode. For example, if you use
/// cv::BORDER_WRAP mode in the horizontal direction, cv::BORDER_REFLECT_101 in the vertical direction and
/// want to compute value of the "virtual" pixel Point(-5, 100) in a floating-point image img , it
/// looks like:
/// ```ignore{.cpp}
/// float val = img.at<float>(borderInterpolate(100, img.rows, cv::BORDER_REFLECT_101),
/// borderInterpolate(-5, img.cols, cv::BORDER_WRAP));
/// ```
///
/// Normally, the function is not called directly. It is used inside filtering functions and also in
/// copyMakeBorder.
/// ## Parameters
/// * p: 0-based coordinate of the extrapolated pixel along one of the axes, likely \<0 or \>= len
/// * len: Length of the array along the corresponding axis.
/// * borderType: Border type, one of the #BorderTypes, except for #BORDER_TRANSPARENT and
/// #BORDER_ISOLATED . When borderType==#BORDER_CONSTANT , the function always returns -1, regardless
/// of p and len.
///
/// @sa copyMakeBorder
pub fn border_interpolate(p: i32, len: i32, border_type: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_borderInterpolate_int_p_int_len_int_borderType(p, len, border_type) }.into_result()
}
// identifier: cv_boundingRect_Mat_array
/// Calculates the up-right bounding rectangle of a point set or non-zero pixels of gray-scale image.
///
/// The function calculates and returns the minimal up-right bounding rectangle for the specified point set or
/// non-zero pixels of gray-scale image.
///
/// ## Parameters
/// * array: Input gray-scale image or 2D point set, stored in std::vector or Mat.
pub fn bounding_rect(array: &core::Mat) -> Result<core::Rect> {
unsafe { sys::cv_core_cv_boundingRect_Mat_array(array.as_raw_Mat()) }.into_result()
}
// identifier: cv_boxFilter_Mat_src_Mat_dst_int_ddepth_Size_ksize_Point_anchor_bool_normalize_int_borderType
/// Blurs an image using the box filter.
///
/// The function smooths an image using the kernel:
///
/// <div lang='latex'>\texttt{K} = \alpha \begin{bmatrix} 1 & 1 & 1 & \cdots & 1 & 1 \\ 1 & 1 & 1 & \cdots & 1 & 1 \\ \hdotsfor{6} \\ 1 & 1 & 1 & \cdots & 1 & 1 \end{bmatrix}</div>
///
/// where
///
/// <div lang='latex'>\alpha = \fork{\frac{1}{\texttt{ksize.width*ksize.height}}}{when \texttt{normalize=true}}{1}{otherwise}</div>
///
/// Unnormalized box filter is useful for computing various integral characteristics over each pixel
/// neighborhood, such as covariance matrices of image derivatives (used in dense optical flow
/// algorithms, and so on). If you need to compute pixel sums over variable-size windows, use #integral.
///
/// ## Parameters
/// * src: input image.
/// * dst: output image of the same size and type as src.
/// * ddepth: the output image depth (-1 to use src.depth()).
/// * ksize: blurring kernel size.
/// * anchor: anchor point; default value Point(-1,-1) means that the anchor is at the kernel
/// center.
/// * normalize: flag, specifying whether the kernel is normalized by its area or not.
/// * borderType: border mode used to extrapolate pixels outside of the image, see #BorderTypes
/// @sa blur, bilateralFilter, GaussianBlur, medianBlur, integral
///
/// ## C++ default parameters:
/// * anchor: Point(-1,-1)
/// * normalize: true
/// * border_type: BORDER_DEFAULT
pub fn box_filter(src: &core::Mat, dst: &mut core::Mat, ddepth: i32, ksize: core::Size, anchor: core::Point, normalize: bool, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_boxFilter_Mat_src_Mat_dst_int_ddepth_Size_ksize_Point_anchor_bool_normalize_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ddepth, ksize, anchor, normalize, border_type) }.into_result()
}
// identifier: cv_boxPoints_RotatedRect_box_Mat_points
/// Finds the four vertices of a rotated rect. Useful to draw the rotated rectangle.
///
/// The function finds the four vertices of a rotated rectangle. This function is useful to draw the
/// rectangle. In C++, instead of using this function, you can directly use RotatedRect::points method. Please
/// visit the @ref tutorial_bounding_rotated_ellipses "tutorial on Creating Bounding rotated boxes and ellipses for contours" for more information.
///
/// ## Parameters
/// * box: The input rotated rectangle. It may be the output of
/// * points: The output array of four vertices of rectangles.
pub fn box_points(_box: &core::RotatedRect, points: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_boxPoints_RotatedRect_box_Mat_points(_box.as_raw_RotatedRect(), points.as_raw_Mat()) }.into_result()
}
// identifier: cv_buildOpticalFlowPyramid_Mat_img_VectorOfMat_pyramid_Size_winSize_int_maxLevel_bool_withDerivatives_int_pyrBorder_int_derivBorder_bool_tryReuseInputImage
/// Constructs the image pyramid which can be passed to calcOpticalFlowPyrLK.
///
/// ## Parameters
/// * img: 8-bit input image.
/// * pyramid: output pyramid.
/// * winSize: window size of optical flow algorithm. Must be not less than winSize argument of
/// calcOpticalFlowPyrLK. It is needed to calculate required padding for pyramid levels.
/// * maxLevel: 0-based maximal pyramid level number.
/// * withDerivatives: set to precompute gradients for the every pyramid level. If pyramid is
/// constructed without the gradients then calcOpticalFlowPyrLK will calculate them internally.
/// * pyrBorder: the border mode for pyramid layers.
/// * derivBorder: the border mode for gradients.
/// * tryReuseInputImage: put ROI of input image into the pyramid if possible. You can pass false
/// to force data copying.
/// @return number of levels in constructed pyramid. Can be less than maxLevel.
///
/// ## C++ default parameters:
/// * with_derivatives: true
/// * pyr_border: BORDER_REFLECT_101
/// * deriv_border: BORDER_CONSTANT
/// * try_reuse_input_image: true
pub fn build_optical_flow_pyramid(img: &core::Mat, pyramid: &mut types::VectorOfMat, win_size: core::Size, max_level: i32, with_derivatives: bool, pyr_border: i32, deriv_border: i32, try_reuse_input_image: bool) -> Result<i32> {
unsafe { sys::cv_core_cv_buildOpticalFlowPyramid_Mat_img_VectorOfMat_pyramid_Size_winSize_int_maxLevel_bool_withDerivatives_int_pyrBorder_int_derivBorder_bool_tryReuseInputImage(img.as_raw_Mat(), pyramid.as_raw_VectorOfMat(), win_size, max_level, with_derivatives, pyr_border, deriv_border, try_reuse_input_image) }.into_result()
}
// identifier: cv_buildPyramid_Mat_src_VectorOfMat_dst_int_maxlevel_int_borderType
/// Constructs the Gaussian pyramid for an image.
///
/// The function constructs a vector of images and builds the Gaussian pyramid by recursively applying
/// pyrDown to the previously built pyramid layers, starting from `dst[0]==src`.
///
/// ## Parameters
/// * src: Source image. Check pyrDown for the list of supported types.
/// * dst: Destination vector of maxlevel+1 images of the same type as src. dst[0] will be the
/// same as src. dst[1] is the next pyramid layer, a smoothed and down-sized src, and so on.
/// * maxlevel: 0-based index of the last (the smallest) pyramid layer. It must be non-negative.
/// * borderType: Pixel extrapolation method, see #BorderTypes (#BORDER_CONSTANT isn't supported)
///
/// ## C++ default parameters:
/// * border_type: BORDER_DEFAULT
pub fn build_pyramid(src: &core::Mat, dst: &mut types::VectorOfMat, maxlevel: i32, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_buildPyramid_Mat_src_VectorOfMat_dst_int_maxlevel_int_borderType(src.as_raw_Mat(), dst.as_raw_VectorOfMat(), maxlevel, border_type) }.into_result()
}
// identifier: cv_calcBackProject_VectorOfMat_images_VectorOfint_channels_Mat_hist_Mat_dst_VectorOffloat_ranges_double_scale
/// @overload
pub fn calc_back_project(images: &types::VectorOfMat, channels: &types::VectorOfint, hist: &core::Mat, dst: &mut core::Mat, ranges: &types::VectorOffloat, scale: f64) -> Result<()> {
unsafe { sys::cv_core_cv_calcBackProject_VectorOfMat_images_VectorOfint_channels_Mat_hist_Mat_dst_VectorOffloat_ranges_double_scale(images.as_raw_VectorOfMat(), channels.as_raw_VectorOfint(), hist.as_raw_Mat(), dst.as_raw_Mat(), ranges.as_raw_VectorOffloat(), scale) }.into_result()
}
// identifier: cv_calcCovarMatrix_Mat_samples_Mat_covar_Mat_mean_int_flags_int_ctype
/// @overload
///
/// Note: use #COVAR_ROWS or #COVAR_COLS flag
/// ## Parameters
/// * samples: samples stored as rows/columns of a single matrix.
/// * covar: output covariance matrix of the type ctype and square size.
/// * mean: input or output (depending on the flags) array as the average value of the input vectors.
/// * flags: operation flags as a combination of #CovarFlags
/// * ctype: type of the matrixl; it equals 'CV_64F' by default.
///
/// ## C++ default parameters:
/// * ctype: CV_64F
pub fn calc_covar_matrix_arrays(samples: &core::Mat, covar: &mut core::Mat, mean: &mut core::Mat, flags: i32, ctype: i32) -> Result<()> {
unsafe { sys::cv_core_cv_calcCovarMatrix_Mat_samples_Mat_covar_Mat_mean_int_flags_int_ctype(samples.as_raw_Mat(), covar.as_raw_Mat(), mean.as_raw_Mat(), flags, ctype) }.into_result()
}
// identifier: cv_calcCovarMatrix_const_Mat_samples_int_nsamples_Mat_covar_Mat_mean_int_flags_int_ctype
/// Calculates the covariance matrix of a set of vectors.
///
/// The function cv::calcCovarMatrix calculates the covariance matrix and, optionally, the mean vector of
/// the set of input vectors.
/// ## Parameters
/// * samples: samples stored as separate matrices
/// * nsamples: number of samples
/// * covar: output covariance matrix of the type ctype and square size.
/// * mean: input or output (depending on the flags) array as the average value of the input vectors.
/// * flags: operation flags as a combination of #CovarFlags
/// * ctype: type of the matrixl; it equals 'CV_64F' by default.
/// @sa PCA, mulTransposed, Mahalanobis
/// @todo InputArrayOfArrays
///
/// ## C++ default parameters:
/// * ctype: CV_64F
pub fn calc_covar_matrix(samples: &core::Mat, nsamples: i32, covar: &core::Mat, mean: &core::Mat, flags: i32, ctype: i32) -> Result<()> {
unsafe { sys::cv_core_cv_calcCovarMatrix_const_Mat_samples_int_nsamples_Mat_covar_Mat_mean_int_flags_int_ctype(samples.as_raw_Mat(), nsamples, covar.as_raw_Mat(), mean.as_raw_Mat(), flags, ctype) }.into_result()
}
// identifier: cv_calcHist_VectorOfMat_images_VectorOfint_channels_Mat_mask_Mat_hist_VectorOfint_histSize_VectorOffloat_ranges_bool_accumulate
/// @overload
///
/// ## C++ default parameters:
/// * accumulate: false
pub fn calc_hist(images: &types::VectorOfMat, channels: &types::VectorOfint, mask: &core::Mat, hist: &mut core::Mat, hist_size: &types::VectorOfint, ranges: &types::VectorOffloat, accumulate: bool) -> Result<()> {
unsafe { sys::cv_core_cv_calcHist_VectorOfMat_images_VectorOfint_channels_Mat_mask_Mat_hist_VectorOfint_histSize_VectorOffloat_ranges_bool_accumulate(images.as_raw_VectorOfMat(), channels.as_raw_VectorOfint(), mask.as_raw_Mat(), hist.as_raw_Mat(), hist_size.as_raw_VectorOfint(), ranges.as_raw_VectorOffloat(), accumulate) }.into_result()
}
// identifier: cv_calcOpticalFlowFarneback_Mat_prev_Mat_next_Mat_flow_double_pyr_scale_int_levels_int_winsize_int_iterations_int_poly_n_double_poly_sigma_int_flags
/// Computes a dense optical flow using the Gunnar Farneback's algorithm.
///
/// ## Parameters
/// * prev: first 8-bit single-channel input image.
/// * next: second input image of the same size and the same type as prev.
/// * flow: computed flow image that has the same size as prev and type CV_32FC2.
/// * pyr_scale: parameter, specifying the image scale (\<1) to build pyramids for each image;
/// pyr_scale=0.5 means a classical pyramid, where each next layer is twice smaller than the previous
/// one.
/// * levels: number of pyramid layers including the initial image; levels=1 means that no extra
/// layers are created and only the original images are used.
/// * winsize: averaging window size; larger values increase the algorithm robustness to image
/// noise and give more chances for fast motion detection, but yield more blurred motion field.
/// * iterations: number of iterations the algorithm does at each pyramid level.
/// * poly_n: size of the pixel neighborhood used to find polynomial expansion in each pixel;
/// larger values mean that the image will be approximated with smoother surfaces, yielding more
/// robust algorithm and more blurred motion field, typically poly_n =5 or 7.
/// * poly_sigma: standard deviation of the Gaussian that is used to smooth derivatives used as a
/// basis for the polynomial expansion; for poly_n=5, you can set poly_sigma=1.1, for poly_n=7, a
/// good value would be poly_sigma=1.5.
/// * flags: operation flags that can be a combination of the following:
/// * **OPTFLOW_USE_INITIAL_FLOW** uses the input flow as an initial flow approximation.
/// * **OPTFLOW_FARNEBACK_GAUSSIAN** uses the Gaussian <span lang='latex'>\texttt{winsize}\times\texttt{winsize}</span>
/// filter instead of a box filter of the same size for optical flow estimation; usually, this
/// option gives z more accurate flow than with a box filter, at the cost of lower speed;
/// normally, winsize for a Gaussian window should be set to a larger value to achieve the same
/// level of robustness.
///
/// The function finds an optical flow for each prev pixel using the @cite Farneback2003 algorithm so that
///
/// <div lang='latex'>\texttt{prev} (y,x) \sim \texttt{next} ( y + \texttt{flow} (y,x)[1], x + \texttt{flow} (y,x)[0])</div>
///
///
/// Note:
///
/// * An example using the optical flow algorithm described by Gunnar Farneback can be found at
/// opencv_source_code/samples/cpp/fback.cpp
/// * (Python) An example using the optical flow algorithm described by Gunnar Farneback can be
/// found at opencv_source_code/samples/python/opt_flow.py
pub fn calc_optical_flow_farneback(prev: &core::Mat, next: &core::Mat, flow: &mut core::Mat, pyr_scale: f64, levels: i32, winsize: i32, iterations: i32, poly_n: i32, poly_sigma: f64, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_calcOpticalFlowFarneback_Mat_prev_Mat_next_Mat_flow_double_pyr_scale_int_levels_int_winsize_int_iterations_int_poly_n_double_poly_sigma_int_flags(prev.as_raw_Mat(), next.as_raw_Mat(), flow.as_raw_Mat(), pyr_scale, levels, winsize, iterations, poly_n, poly_sigma, flags) }.into_result()
}
// identifier: cv_calcOpticalFlowPyrLK_Mat_prevImg_Mat_nextImg_Mat_prevPts_Mat_nextPts_Mat_status_Mat_err_Size_winSize_int_maxLevel_TermCriteria_criteria_int_flags_double_minEigThreshold
/// Calculates an optical flow for a sparse feature set using the iterative Lucas-Kanade method with
/// pyramids.
///
/// ## Parameters
/// * prevImg: first 8-bit input image or pyramid constructed by buildOpticalFlowPyramid.
/// * nextImg: second input image or pyramid of the same size and the same type as prevImg.
/// * prevPts: vector of 2D points for which the flow needs to be found; point coordinates must be
/// single-precision floating-point numbers.
/// * nextPts: output vector of 2D points (with single-precision floating-point coordinates)
/// containing the calculated new positions of input features in the second image; when
/// OPTFLOW_USE_INITIAL_FLOW flag is passed, the vector must have the same size as in the input.
/// * status: output status vector (of unsigned chars); each element of the vector is set to 1 if
/// the flow for the corresponding features has been found, otherwise, it is set to 0.
/// * err: output vector of errors; each element of the vector is set to an error for the
/// corresponding feature, type of the error measure can be set in flags parameter; if the flow wasn't
/// found then the error is not defined (use the status parameter to find such cases).
/// * winSize: size of the search window at each pyramid level.
/// * maxLevel: 0-based maximal pyramid level number; if set to 0, pyramids are not used (single
/// level), if set to 1, two levels are used, and so on; if pyramids are passed to input then
/// algorithm will use as many levels as pyramids have but no more than maxLevel.
/// * criteria: parameter, specifying the termination criteria of the iterative search algorithm
/// (after the specified maximum number of iterations criteria.maxCount or when the search window
/// moves by less than criteria.epsilon.
/// * flags: operation flags:
/// * **OPTFLOW_USE_INITIAL_FLOW** uses initial estimations, stored in nextPts; if the flag is
/// not set, then prevPts is copied to nextPts and is considered the initial estimate.
/// * **OPTFLOW_LK_GET_MIN_EIGENVALS** use minimum eigen values as an error measure (see
/// minEigThreshold description); if the flag is not set, then L1 distance between patches
/// around the original and a moved point, divided by number of pixels in a window, is used as a
/// error measure.
/// * minEigThreshold: the algorithm calculates the minimum eigen value of a 2x2 normal matrix of
/// optical flow equations (this matrix is called a spatial gradient matrix in @cite Bouguet00), divided
/// by number of pixels in a window; if this value is less than minEigThreshold, then a corresponding
/// feature is filtered out and its flow is not processed, so it allows to remove bad points and get a
/// performance boost.
///
/// The function implements a sparse iterative version of the Lucas-Kanade optical flow in pyramids. See
/// @cite Bouguet00 . The function is parallelized with the TBB library.
///
///
/// Note:
///
/// * An example using the Lucas-Kanade optical flow algorithm can be found at
/// opencv_source_code/samples/cpp/lkdemo.cpp
/// * (Python) An example using the Lucas-Kanade optical flow algorithm can be found at
/// opencv_source_code/samples/python/lk_track.py
/// * (Python) An example using the Lucas-Kanade tracker for homography matching can be found at
/// opencv_source_code/samples/python/lk_homography.py
///
/// ## C++ default parameters:
/// * win_size: Size(21,21)
/// * max_level: 3
/// * criteria: TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01)
/// * flags: 0
/// * min_eig_threshold: 1e-4
pub fn calc_optical_flow_pyr_lk(prev_img: &core::Mat, next_img: &core::Mat, prev_pts: &core::Mat, next_pts: &mut core::Mat, status: &mut core::Mat, err: &mut core::Mat, win_size: core::Size, max_level: i32, criteria: &core::TermCriteria, flags: i32, min_eig_threshold: f64) -> Result<()> {
unsafe { sys::cv_core_cv_calcOpticalFlowPyrLK_Mat_prevImg_Mat_nextImg_Mat_prevPts_Mat_nextPts_Mat_status_Mat_err_Size_winSize_int_maxLevel_TermCriteria_criteria_int_flags_double_minEigThreshold(prev_img.as_raw_Mat(), next_img.as_raw_Mat(), prev_pts.as_raw_Mat(), next_pts.as_raw_Mat(), status.as_raw_Mat(), err.as_raw_Mat(), win_size, max_level, criteria.as_raw_TermCriteria(), flags, min_eig_threshold) }.into_result()
}
// identifier: cv_calibrateCamera_VectorOfMat_objectPoints_VectorOfMat_imagePoints_Size_imageSize_Mat_cameraMatrix_Mat_distCoeffs_VectorOfMat_rvecs_VectorOfMat_tvecs_Mat_stdDeviationsIntrinsics_Mat_stdDeviationsExtrinsics_Mat_perViewErrors_int_flags_TermCriteria_criteria
/// Finds the camera intrinsic and extrinsic parameters from several views of a calibration pattern.
///
/// ## Parameters
/// * objectPoints: In the new interface it is a vector of vectors of calibration pattern points in
/// the calibration pattern coordinate space (e.g. std::vector<std::vector<cv::Vec3f>>). The outer
/// vector contains as many elements as the number of the pattern views. If the same calibration pattern
/// is shown in each view and it is fully visible, all the vectors will be the same. Although, it is
/// possible to use partially occluded patterns, or even different patterns in different views. Then,
/// the vectors will be different. The points are 3D, but since they are in a pattern coordinate system,
/// then, if the rig is planar, it may make sense to put the model to a XY coordinate plane so that
/// Z-coordinate of each input object point is 0.
/// In the old interface all the vectors of object points from different views are concatenated
/// together.
/// * imagePoints: In the new interface it is a vector of vectors of the projections of calibration
/// pattern points (e.g. std::vector<std::vector<cv::Vec2f>>). imagePoints.size() and
/// objectPoints.size() and imagePoints[i].size() must be equal to objectPoints[i].size() for each i.
/// In the old interface all the vectors of object points from different views are concatenated
/// together.
/// * imageSize: Size of the image used only to initialize the intrinsic camera matrix.
/// * cameraMatrix: Output 3x3 floating-point camera matrix
/// <span lang='latex'>A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}</span> . If CV\_CALIB\_USE\_INTRINSIC\_GUESS
/// and/or CALIB_FIX_ASPECT_RATIO are specified, some or all of fx, fy, cx, cy must be
/// initialized before calling the function.
/// * distCoeffs: Output vector of distortion coefficients
/// <span lang='latex'>(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])</span> of
/// 4, 5, 8, 12 or 14 elements.
/// * rvecs: Output vector of rotation vectors (see Rodrigues ) estimated for each pattern view
/// (e.g. std::vector<cv::Mat>>). That is, each k-th rotation vector together with the corresponding
/// k-th translation vector (see the next output parameter description) brings the calibration pattern
/// from the model coordinate space (in which object points are specified) to the world coordinate
/// space, that is, a real position of the calibration pattern in the k-th pattern view (k=0.. *M* -1).
/// * tvecs: Output vector of translation vectors estimated for each pattern view.
/// * stdDeviationsIntrinsics: Output vector of standard deviations estimated for intrinsic parameters.
/// Order of deviations values:
/// \f$(f_x, f_y, c_x, c_y, k_1, k_2, p_1, p_2, k_3, k_4, k_5, k_6 , s_1, s_2, s_3,
/// s_4, \tau_x, \tau_y)\f$ If one of parameters is not estimated, it's deviation is equals to zero.
/// * stdDeviationsExtrinsics: Output vector of standard deviations estimated for extrinsic parameters.
/// Order of deviations values: <span lang='latex'>(R_1, T_1, \dotsc , R_M, T_M)</span> where M is number of pattern views,
/// <span lang='latex'>R_i, T_i</span> are concatenated 1x3 vectors.
/// * perViewErrors: Output vector of the RMS re-projection error estimated for each pattern view.
/// * flags: Different flags that may be zero or a combination of the following values:
/// * **CALIB_USE_INTRINSIC_GUESS** cameraMatrix contains valid initial values of
/// fx, fy, cx, cy that are optimized further. Otherwise, (cx, cy) is initially set to the image
/// center ( imageSize is used), and focal distances are computed in a least-squares fashion.
/// Note, that if intrinsic parameters are known, there is no need to use this function just to
/// estimate extrinsic parameters. Use solvePnP instead.
/// * **CALIB_FIX_PRINCIPAL_POINT** The principal point is not changed during the global
/// optimization. It stays at the center or at a different location specified when
/// CALIB_USE_INTRINSIC_GUESS is set too.
/// * **CALIB_FIX_ASPECT_RATIO** The functions considers only fy as a free parameter. The
/// ratio fx/fy stays the same as in the input cameraMatrix . When
/// CALIB_USE_INTRINSIC_GUESS is not set, the actual input values of fx and fy are
/// ignored, only their ratio is computed and used further.
/// * **CALIB_ZERO_TANGENT_DIST** Tangential distortion coefficients <span lang='latex'>(p_1, p_2)</span> are set
/// to zeros and stay zero.
/// * **CALIB_FIX_K1,...,CALIB_FIX_K6** The corresponding radial distortion
/// coefficient is not changed during the optimization. If CALIB_USE_INTRINSIC_GUESS is
/// set, the coefficient from the supplied distCoeffs matrix is used. Otherwise, it is set to 0.
/// * **CALIB_RATIONAL_MODEL** Coefficients k4, k5, and k6 are enabled. To provide the
/// backward compatibility, this extra flag should be explicitly specified to make the
/// calibration function use the rational model and return 8 coefficients. If the flag is not
/// set, the function computes and returns only 5 distortion coefficients.
/// * **CALIB_THIN_PRISM_MODEL** Coefficients s1, s2, s3 and s4 are enabled. To provide the
/// backward compatibility, this extra flag should be explicitly specified to make the
/// calibration function use the thin prism model and return 12 coefficients. If the flag is not
/// set, the function computes and returns only 5 distortion coefficients.
/// * **CALIB_FIX_S1_S2_S3_S4** The thin prism distortion coefficients are not changed during
/// the optimization. If CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the
/// supplied distCoeffs matrix is used. Otherwise, it is set to 0.
/// * **CALIB_TILTED_MODEL** Coefficients tauX and tauY are enabled. To provide the
/// backward compatibility, this extra flag should be explicitly specified to make the
/// calibration function use the tilted sensor model and return 14 coefficients. If the flag is not
/// set, the function computes and returns only 5 distortion coefficients.
/// * **CALIB_FIX_TAUX_TAUY** The coefficients of the tilted sensor model are not changed during
/// the optimization. If CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the
/// supplied distCoeffs matrix is used. Otherwise, it is set to 0.
/// * criteria: Termination criteria for the iterative optimization algorithm.
///
/// @return the overall RMS re-projection error.
///
/// The function estimates the intrinsic camera parameters and extrinsic parameters for each of the
/// views. The algorithm is based on @cite Zhang2000 and @cite BouguetMCT . The coordinates of 3D object
/// points and their corresponding 2D projections in each view must be specified. That may be achieved
/// by using an object with a known geometry and easily detectable feature points. Such an object is
/// called a calibration rig or calibration pattern, and OpenCV has built-in support for a chessboard as
/// a calibration rig (see findChessboardCorners ). Currently, initialization of intrinsic parameters
/// (when CALIB_USE_INTRINSIC_GUESS is not set) is only implemented for planar calibration
/// patterns (where Z-coordinates of the object points must be all zeros). 3D calibration rigs can also
/// be used as long as initial cameraMatrix is provided.
///
/// The algorithm performs the following steps:
///
/// * Compute the initial intrinsic parameters (the option only available for planar calibration
/// patterns) or read them from the input parameters. The distortion coefficients are all set to
/// zeros initially unless some of CALIB_FIX_K? are specified.
///
/// * Estimate the initial camera pose as if the intrinsic parameters have been already known. This is
/// done using solvePnP .
///
/// * Run the global Levenberg-Marquardt optimization algorithm to minimize the reprojection error,
/// that is, the total sum of squared distances between the observed feature points imagePoints and
/// the projected (using the current estimates for camera parameters and the poses) object points
/// objectPoints. See projectPoints for details.
///
///
/// Note:
/// If you use a non-square (=non-NxN) grid and findChessboardCorners for calibration, and
/// calibrateCamera returns bad values (zero distortion coefficients, an image center very far from
/// (w/2-0.5,h/2-0.5), and/or large differences between <span lang='latex'>f_x</span> and <span lang='latex'>f_y</span> (ratios of 10:1 or more)),
/// then you have probably used patternSize=cvSize(rows,cols) instead of using
/// patternSize=cvSize(cols,rows) in findChessboardCorners .
///
/// @sa
/// findChessboardCorners, solvePnP, initCameraMatrix2D, stereoCalibrate, undistort
///
/// ## C++ default parameters:
/// * flags: 0
/// * criteria: TermCriteria( TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON)
pub fn calibrate_camera(object_points: &types::VectorOfMat, image_points: &types::VectorOfMat, image_size: core::Size, camera_matrix: &mut core::Mat, dist_coeffs: &mut core::Mat, rvecs: &mut types::VectorOfMat, tvecs: &mut types::VectorOfMat, std_deviations_intrinsics: &mut core::Mat, std_deviations_extrinsics: &mut core::Mat, per_view_errors: &mut core::Mat, flags: i32, criteria: &core::TermCriteria) -> Result<f64> {
unsafe { sys::cv_core_cv_calibrateCamera_VectorOfMat_objectPoints_VectorOfMat_imagePoints_Size_imageSize_Mat_cameraMatrix_Mat_distCoeffs_VectorOfMat_rvecs_VectorOfMat_tvecs_Mat_stdDeviationsIntrinsics_Mat_stdDeviationsExtrinsics_Mat_perViewErrors_int_flags_TermCriteria_criteria(object_points.as_raw_VectorOfMat(), image_points.as_raw_VectorOfMat(), image_size, camera_matrix.as_raw_Mat(), dist_coeffs.as_raw_Mat(), rvecs.as_raw_VectorOfMat(), tvecs.as_raw_VectorOfMat(), std_deviations_intrinsics.as_raw_Mat(), std_deviations_extrinsics.as_raw_Mat(), per_view_errors.as_raw_Mat(), flags, criteria.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_calibrateCamera_VectorOfMat_objectPoints_VectorOfMat_imagePoints_Size_imageSize_Mat_cameraMatrix_Mat_distCoeffs_VectorOfMat_rvecs_VectorOfMat_tvecs_int_flags_TermCriteria_criteria
/// @overload double calibrateCamera( InputArrayOfArrays objectPoints,
/// InputArrayOfArrays imagePoints, Size imageSize,
/// InputOutputArray cameraMatrix, InputOutputArray distCoeffs,
/// OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs,
/// OutputArray stdDeviations, OutputArray perViewErrors,
/// int flags = 0, TermCriteria criteria = TermCriteria(
/// TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON) )
///
/// ## C++ default parameters:
/// * flags: 0
/// * criteria: TermCriteria( TermCriteria::COUNT + TermCriteria::EPS, 30, DBL_EPSILON)
pub fn calibrate_camera_1(object_points: &types::VectorOfMat, image_points: &types::VectorOfMat, image_size: core::Size, camera_matrix: &mut core::Mat, dist_coeffs: &mut core::Mat, rvecs: &mut types::VectorOfMat, tvecs: &mut types::VectorOfMat, flags: i32, criteria: &core::TermCriteria) -> Result<f64> {
unsafe { sys::cv_core_cv_calibrateCamera_VectorOfMat_objectPoints_VectorOfMat_imagePoints_Size_imageSize_Mat_cameraMatrix_Mat_distCoeffs_VectorOfMat_rvecs_VectorOfMat_tvecs_int_flags_TermCriteria_criteria(object_points.as_raw_VectorOfMat(), image_points.as_raw_VectorOfMat(), image_size, camera_matrix.as_raw_Mat(), dist_coeffs.as_raw_Mat(), rvecs.as_raw_VectorOfMat(), tvecs.as_raw_VectorOfMat(), flags, criteria.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_calibrationMatrixValues_Mat_cameraMatrix_Size_imageSize_double_apertureWidth_double_apertureHeight_double_fovx_double_fovy_double_focalLength_Point2d_principalPoint_double_aspectRatio
/// Computes useful camera characteristics from the camera matrix.
///
/// ## Parameters
/// * cameraMatrix: Input camera matrix that can be estimated by calibrateCamera or
/// stereoCalibrate .
/// * imageSize: Input image size in pixels.
/// * apertureWidth: Physical width in mm of the sensor.
/// * apertureHeight: Physical height in mm of the sensor.
/// * fovx: Output field of view in degrees along the horizontal sensor axis.
/// * fovy: Output field of view in degrees along the vertical sensor axis.
/// * focalLength: Focal length of the lens in mm.
/// * principalPoint: Principal point in mm.
/// * aspectRatio: <span lang='latex'>f_y/f_x</span>
///
/// The function computes various useful camera characteristics from the previously estimated camera
/// matrix.
///
///
/// Note:
/// Do keep in mind that the unity measure 'mm' stands for whatever unit of measure one chooses for
/// the chessboard pitch (it can thus be any value).
pub fn calibration_matrix_values(camera_matrix: &core::Mat, image_size: core::Size, aperture_width: f64, aperture_height: f64, fovx: f64, fovy: f64, focal_length: f64, principal_point: core::Point2d, aspect_ratio: f64) -> Result<()> {
unsafe { sys::cv_core_cv_calibrationMatrixValues_Mat_cameraMatrix_Size_imageSize_double_apertureWidth_double_apertureHeight_double_fovx_double_fovy_double_focalLength_Point2d_principalPoint_double_aspectRatio(camera_matrix.as_raw_Mat(), image_size, aperture_width, aperture_height, fovx, fovy, focal_length, principal_point, aspect_ratio) }.into_result()
}
// identifier: cv_cartToPolar_Mat_x_Mat_y_Mat_magnitude_Mat_angle_bool_angleInDegrees
/// Calculates the magnitude and angle of 2D vectors.
///
/// The function cv::cartToPolar calculates either the magnitude, angle, or both
/// for every 2D vector (x(I),y(I)):
/// <div lang='latex'>\begin{array}{l} \texttt{magnitude} (I)= \sqrt{\texttt{x}(I)^2+\texttt{y}(I)^2} , \\ \texttt{angle} (I)= \texttt{atan2} ( \texttt{y} (I), \texttt{x} (I))[ \cdot180 / \pi ] \end{array}</div>
///
/// The angles are calculated with accuracy about 0.3 degrees. For the point
/// (0,0), the angle is set to 0.
/// ## Parameters
/// * x: array of x-coordinates; this must be a single-precision or
/// double-precision floating-point array.
/// * y: array of y-coordinates, that must have the same size and same type as x.
/// * magnitude: output array of magnitudes of the same size and type as x.
/// * angle: output array of angles that has the same size and type as
/// x; the angles are measured in radians (from 0 to 2\*Pi) or in degrees (0 to 360 degrees).
/// * angleInDegrees: a flag, indicating whether the angles are measured
/// in radians (which is by default), or in degrees.
/// @sa Sobel, Scharr
///
/// ## C++ default parameters:
/// * angle_in_degrees: false
pub fn cart_to_polar(x: &core::Mat, y: &core::Mat, magnitude: &mut core::Mat, angle: &mut core::Mat, angle_in_degrees: bool) -> Result<()> {
unsafe { sys::cv_core_cv_cartToPolar_Mat_x_Mat_y_Mat_magnitude_Mat_angle_bool_angleInDegrees(x.as_raw_Mat(), y.as_raw_Mat(), magnitude.as_raw_Mat(), angle.as_raw_Mat(), angle_in_degrees) }.into_result()
}
// identifier: cv_cbrt_softfloat_a
/// Cube root
///
/// Special cases:
/// - cbrt(NaN) is NaN
/// - cbrt(+/-Inf) is +/-Inf
pub fn cbrt(a: &core::softfloat) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_cbrt_softfloat_a(a.as_raw_softfloat()) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_checkHardwareSupport_int_feature
/// Returns true if the specified feature is supported by the host hardware.
///
/// The function returns true if the host hardware supports the specified feature. When user calls
/// setUseOptimized(false), the subsequent calls to checkHardwareSupport() will return false until
/// setUseOptimized(true) is called. This way user can dynamically switch on and off the optimized code
/// in OpenCV.
/// ## Parameters
/// * feature: The feature of interest, one of cv::CpuFeatures
pub fn check_hardware_support(feature: i32) -> Result<bool> {
unsafe { sys::cv_core_cv_checkHardwareSupport_int_feature(feature) }.into_result()
}
// identifier: cv_checkRange_Mat_a_bool_quiet_Point_X_pos_double_minVal_double_maxVal
/// Checks every element of an input array for invalid values.
///
/// The function cv::checkRange checks that every array element is neither NaN nor infinite. When minVal \>
/// -DBL_MAX and maxVal \< DBL_MAX, the function also checks that each value is between minVal and
/// maxVal. In case of multi-channel arrays, each channel is processed independently. If some values
/// are out of range, position of the first outlier is stored in pos (when pos != NULL). Then, the
/// function either returns false (when quiet=true) or throws an exception.
/// ## Parameters
/// * a: input array.
/// * quiet: a flag, indicating whether the functions quietly return false when the array elements
/// are out of range or they throw an exception.
/// * pos: optional output parameter, when not NULL, must be a pointer to array of src.dims
/// elements.
/// * minVal: inclusive lower boundary of valid values range.
/// * maxVal: exclusive upper boundary of valid values range.
///
/// ## C++ default parameters:
/// * quiet: true
/// * pos: 0
/// * min_val: -DBL_MAX
/// * max_val: DBL_MAX
pub fn check_range(a: &core::Mat, quiet: bool, pos: &mut core::Point, min_val: f64, max_val: f64) -> Result<bool> {
unsafe { sys::cv_core_cv_checkRange_Mat_a_bool_quiet_Point_X_pos_double_minVal_double_maxVal(a.as_raw_Mat(), quiet, pos, min_val, max_val) }.into_result()
}
// identifier: cv_circle_Mat_img_Point_center_int_radius_Scalar_color_int_thickness_int_lineType_int_shift
/// Draws a circle.
///
/// The function cv::circle draws a simple or filled circle with a given center and radius.
/// ## Parameters
/// * img: Image where the circle is drawn.
/// * center: Center of the circle.
/// * radius: Radius of the circle.
/// * color: Circle color.
/// * thickness: Thickness of the circle outline, if positive. Negative values, like #FILLED,
/// mean that a filled circle is to be drawn.
/// * lineType: Type of the circle boundary. See #LineTypes
/// * shift: Number of fractional bits in the coordinates of the center and in the radius value.
///
/// ## C++ default parameters:
/// * thickness: 1
/// * line_type: LINE_8
/// * shift: 0
pub fn circle(img: &mut core::Mat, center: core::Point, radius: i32, color: core::Scalar, thickness: i32, line_type: i32, shift: i32) -> Result<()> {
unsafe { sys::cv_core_cv_circle_Mat_img_Point_center_int_radius_Scalar_color_int_thickness_int_lineType_int_shift(img.as_raw_Mat(), center, radius, color, thickness, line_type, shift) }.into_result()
}
// identifier: cv_clipLine_Rect_imgRect_Point_pt1_Point_pt2
/// @overload
/// ## Parameters
/// * imgRect: Image rectangle.
/// * pt1: First line point.
/// * pt2: Second line point.
pub fn clip_line(img_rect: core::Rect, pt1: core::Point, pt2: core::Point) -> Result<bool> {
unsafe { sys::cv_core_cv_clipLine_Rect_imgRect_Point_pt1_Point_pt2(img_rect, pt1, pt2) }.into_result()
}
// identifier: cv_clipLine_Size2l_imgSize_Point2l_pt1_Point2l_pt2
/// @overload
/// ## Parameters
/// * imgSize: Image size. The image rectangle is Rect(0, 0, imgSize.width, imgSize.height) .
/// * pt1: First line point.
/// * pt2: Second line point.
pub fn clip_line_size_i64(img_size: core::Size2l, pt1: core::Point2l, pt2: core::Point2l) -> Result<bool> {
unsafe { sys::cv_core_cv_clipLine_Size2l_imgSize_Point2l_pt1_Point2l_pt2(img_size, pt1, pt2) }.into_result()
}
// identifier: cv_clipLine_Size_imgSize_Point_pt1_Point_pt2
/// Clips the line against the image rectangle.
///
/// The function cv::clipLine calculates a part of the line segment that is entirely within the specified
/// rectangle. it returns false if the line segment is completely outside the rectangle. Otherwise,
/// it returns true .
/// ## Parameters
/// * imgSize: Image size. The image rectangle is Rect(0, 0, imgSize.width, imgSize.height) .
/// * pt1: First line point.
/// * pt2: Second line point.
pub fn clip_line_size(img_size: core::Size, pt1: core::Point, pt2: core::Point) -> Result<bool> {
unsafe { sys::cv_core_cv_clipLine_Size_imgSize_Point_pt1_Point_pt2(img_size, pt1, pt2) }.into_result()
}
// identifier: cv_colorChange_Mat_src_Mat_mask_Mat_dst_float_red_mul_float_green_mul_float_blue_mul
/// Given an original color image, two differently colored versions of this image can be mixed
/// seamlessly.
///
/// ## Parameters
/// * src: Input 8-bit 3-channel image.
/// * mask: Input 8-bit 1 or 3-channel image.
/// * dst: Output image with the same size and type as src .
/// * red_mul: R-channel multiply factor.
/// * green_mul: G-channel multiply factor.
/// * blue_mul: B-channel multiply factor.
///
/// Multiplication factor is between .5 to 2.5.
///
/// ## C++ default parameters:
/// * red_mul: 1.0f
/// * green_mul: 1.0f
/// * blue_mul: 1.0f
pub fn color_change(src: &core::Mat, mask: &core::Mat, dst: &mut core::Mat, red_mul: f32, green_mul: f32, blue_mul: f32) -> Result<()> {
unsafe { sys::cv_core_cv_colorChange_Mat_src_Mat_mask_Mat_dst_float_red_mul_float_green_mul_float_blue_mul(src.as_raw_Mat(), mask.as_raw_Mat(), dst.as_raw_Mat(), red_mul, green_mul, blue_mul) }.into_result()
}
// identifier: cv_compareHist_Mat_H1_Mat_H2_int_method
/// Compares two histograms.
///
/// The function cv::compareHist compares two dense or two sparse histograms using the specified method.
///
/// The function returns <span lang='latex'>d(H_1, H_2)</span> .
///
/// While the function works well with 1-, 2-, 3-dimensional dense histograms, it may not be suitable
/// for high-dimensional sparse histograms. In such histograms, because of aliasing and sampling
/// problems, the coordinates of non-zero histogram bins can slightly shift. To compare such histograms
/// or more general sparse configurations of weighted points, consider using the #EMD function.
///
/// ## Parameters
/// * H1: First compared histogram.
/// * H2: Second compared histogram of the same size as H1 .
/// * method: Comparison method, see #HistCompMethods
pub fn compare_hist(h1: &core::Mat, h2: &core::Mat, method: i32) -> Result<f64> {
unsafe { sys::cv_core_cv_compareHist_Mat_H1_Mat_H2_int_method(h1.as_raw_Mat(), h2.as_raw_Mat(), method) }.into_result()
}
// identifier: cv_compare_Mat_src1_Mat_src2_Mat_dst_int_cmpop
/// Performs the per-element comparison of two arrays or an array and scalar value.
///
/// The function compares:
/// Elements of two arrays when src1 and src2 have the same size:
/// <div lang='latex'>\texttt{dst} (I) = \texttt{src1} (I) \,\texttt{cmpop}\, \texttt{src2} (I)</div>
/// Elements of src1 with a scalar src2 when src2 is constructed from
/// Scalar or has a single element:
/// <div lang='latex'>\texttt{dst} (I) = \texttt{src1}(I) \,\texttt{cmpop}\, \texttt{src2}</div>
/// src1 with elements of src2 when src1 is constructed from Scalar or
/// has a single element:
/// <div lang='latex'>\texttt{dst} (I) = \texttt{src1} \,\texttt{cmpop}\, \texttt{src2} (I)</div>
/// When the comparison result is true, the corresponding element of output
/// array is set to 255. The comparison operations can be replaced with the
/// equivalent matrix expressions:
/// ```ignore{.cpp}
/// Mat dst1 = src1 >= src2;
/// Mat dst2 = src1 < 8;
/// ...
/// ```
///
/// ## Parameters
/// * src1: first input array or a scalar; when it is an array, it must have a single channel.
/// * src2: second input array or a scalar; when it is an array, it must have a single channel.
/// * dst: output array of type ref CV_8U that has the same size and the same number of channels as
/// the input arrays.
/// * cmpop: a flag, that specifies correspondence between the arrays (cv::CmpTypes)
/// @sa checkRange, min, max, threshold
pub fn compare(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat, cmpop: i32) -> Result<()> {
unsafe { sys::cv_core_cv_compare_Mat_src1_Mat_src2_Mat_dst_int_cmpop(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), cmpop) }.into_result()
}
// identifier: cv_completeSymm_Mat_m_bool_lowerToUpper
/// Copies the lower or the upper half of a square matrix to its another half.
///
/// The function cv::completeSymm copies the lower or the upper half of a square matrix to
/// its another half. The matrix diagonal remains unchanged:
/// - <span lang='latex'>\texttt{m}_{ij}=\texttt{m}_{ji}</span> for <span lang='latex'>i > j</span> if
/// lowerToUpper=false
/// - <span lang='latex'>\texttt{m}_{ij}=\texttt{m}_{ji}</span> for <span lang='latex'>i < j</span> if
/// lowerToUpper=true
///
/// ## Parameters
/// * m: input-output floating-point square matrix.
/// * lowerToUpper: operation flag; if true, the lower half is copied to
/// the upper half. Otherwise, the upper half is copied to the lower half.
/// @sa flip, transpose
///
/// ## C++ default parameters:
/// * lower_to_upper: false
pub fn complete_symm(m: &mut core::Mat, lower_to_upper: bool) -> Result<()> {
unsafe { sys::cv_core_cv_completeSymm_Mat_m_bool_lowerToUpper(m.as_raw_Mat(), lower_to_upper) }.into_result()
}
// identifier: cv_composeRT_Mat_rvec1_Mat_tvec1_Mat_rvec2_Mat_tvec2_Mat_rvec3_Mat_tvec3_Mat_dr3dr1_Mat_dr3dt1_Mat_dr3dr2_Mat_dr3dt2_Mat_dt3dr1_Mat_dt3dt1_Mat_dt3dr2_Mat_dt3dt2
/// Combines two rotation-and-shift transformations.
///
/// ## Parameters
/// * rvec1: First rotation vector.
/// * tvec1: First translation vector.
/// * rvec2: Second rotation vector.
/// * tvec2: Second translation vector.
/// * rvec3: Output rotation vector of the superposition.
/// * tvec3: Output translation vector of the superposition.
/// * dr3dr1
/// @param: dr3dt1
/// * dr3dr2
/// @param: dr3dt2
/// * dt3dr1
/// @param: dt3dt1
/// * dt3dr2
/// @param: dt3dt2 Optional output derivatives of rvec3 or tvec3 with regard to rvec1, rvec2, tvec1 and
/// tvec2, respectively.
///
/// The functions compute:
///
/// <div lang='latex'>\begin{array}{l} \texttt{rvec3} = \mathrm{rodrigues} ^{-1} \left ( \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \mathrm{rodrigues} ( \texttt{rvec1} ) \right ) \\ \texttt{tvec3} = \mathrm{rodrigues} ( \texttt{rvec2} ) \cdot \texttt{tvec1} + \texttt{tvec2} \end{array} ,</div>
///
/// where <span lang='latex'>\mathrm{rodrigues}</span> denotes a rotation vector to a rotation matrix transformation, and
/// <span lang='latex'>\mathrm{rodrigues}^{-1}</span> denotes the inverse transformation. See Rodrigues for details.
///
/// Also, the functions can compute the derivatives of the output vectors with regards to the input
/// vectors (see matMulDeriv ). The functions are used inside stereoCalibrate but can also be used in
/// your own code where Levenberg-Marquardt or another gradient-based solver is used to optimize a
/// function that contains a matrix multiplication.
///
/// ## C++ default parameters:
/// * dr3dr1: noArray()
/// * dr3dt1: noArray()
/// * dr3dr2: noArray()
/// * dr3dt2: noArray()
/// * dt3dr1: noArray()
/// * dt3dt1: noArray()
/// * dt3dr2: noArray()
/// * dt3dt2: noArray()
pub fn compose_rt(rvec1: &core::Mat, tvec1: &core::Mat, rvec2: &core::Mat, tvec2: &core::Mat, rvec3: &mut core::Mat, tvec3: &mut core::Mat, dr3dr1: &mut core::Mat, dr3dt1: &mut core::Mat, dr3dr2: &mut core::Mat, dr3dt2: &mut core::Mat, dt3dr1: &mut core::Mat, dt3dt1: &mut core::Mat, dt3dr2: &mut core::Mat, dt3dt2: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_composeRT_Mat_rvec1_Mat_tvec1_Mat_rvec2_Mat_tvec2_Mat_rvec3_Mat_tvec3_Mat_dr3dr1_Mat_dr3dt1_Mat_dr3dr2_Mat_dr3dt2_Mat_dt3dr1_Mat_dt3dt1_Mat_dt3dr2_Mat_dt3dt2(rvec1.as_raw_Mat(), tvec1.as_raw_Mat(), rvec2.as_raw_Mat(), tvec2.as_raw_Mat(), rvec3.as_raw_Mat(), tvec3.as_raw_Mat(), dr3dr1.as_raw_Mat(), dr3dt1.as_raw_Mat(), dr3dr2.as_raw_Mat(), dr3dt2.as_raw_Mat(), dt3dr1.as_raw_Mat(), dt3dt1.as_raw_Mat(), dt3dr2.as_raw_Mat(), dt3dt2.as_raw_Mat()) }.into_result()
}
// identifier: cv_computeCorrespondEpilines_Mat_points_int_whichImage_Mat_F_Mat_lines
/// For points in an image of a stereo pair, computes the corresponding epilines in the other image.
///
/// ## Parameters
/// * points: Input points. <span lang='latex'>N \times 1</span> or <span lang='latex'>1 \times N</span> matrix of type CV_32FC2 or
/// vector\<Point2f\> .
/// * whichImage: Index of the image (1 or 2) that contains the points .
/// * F: Fundamental matrix that can be estimated using findFundamentalMat or stereoRectify .
/// * lines: Output vector of the epipolar lines corresponding to the points in the other image.
/// Each line <span lang='latex'>ax + by + c=0</span> is encoded by 3 numbers <span lang='latex'>(a, b, c)</span> .
///
/// For every point in one of the two images of a stereo pair, the function finds the equation of the
/// corresponding epipolar line in the other image.
///
/// From the fundamental matrix definition (see findFundamentalMat ), line <span lang='latex'>l^{(2)}_i</span> in the second
/// image for the point <span lang='latex'>p^{(1)}_i</span> in the first image (when whichImage=1 ) is computed as:
///
/// <div lang='latex'>l^{(2)}_i = F p^{(1)}_i</div>
///
/// And vice versa, when whichImage=2, <span lang='latex'>l^{(1)}_i</span> is computed from <span lang='latex'>p^{(2)}_i</span> as:
///
/// <div lang='latex'>l^{(1)}_i = F^T p^{(2)}_i</div>
///
/// Line coefficients are defined up to a scale. They are normalized so that <span lang='latex'>a_i^2+b_i^2=1</span> .
pub fn compute_correspond_epilines(points: &core::Mat, which_image: i32, f: &core::Mat, lines: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_computeCorrespondEpilines_Mat_points_int_whichImage_Mat_F_Mat_lines(points.as_raw_Mat(), which_image, f.as_raw_Mat(), lines.as_raw_Mat()) }.into_result()
}
// identifier: cv_computeRecallPrecisionCurve_VectorOfVectorOfDMatch_matches1to2_VectorOfVectorOfuchar_correctMatches1to2Mask_VectorOfPoint2f_recallPrecisionCurve
pub fn compute_recall_precision_curve(matches1to2: &types::VectorOfVectorOfDMatch, correct_matches1to2_mask: &types::VectorOfVectorOfuchar, recall_precision_curve: &types::VectorOfPoint2f) -> Result<()> {
unsafe { sys::cv_core_cv_computeRecallPrecisionCurve_VectorOfVectorOfDMatch_matches1to2_VectorOfVectorOfuchar_correctMatches1to2Mask_VectorOfPoint2f_recallPrecisionCurve(matches1to2.as_raw_VectorOfVectorOfDMatch(), correct_matches1to2_mask.as_raw_VectorOfVectorOfuchar(), recall_precision_curve.as_raw_VectorOfPoint2f()) }.into_result()
}
// identifier: cv_connectedComponentsWithStats_Mat_image_Mat_labels_Mat_stats_Mat_centroids_int_connectivity_int_ltype
/// @overload
/// ## Parameters
/// * image: the 8-bit single-channel image to be labeled
/// * labels: destination labeled image
/// * stats: statistics output for each label, including the background label, see below for
/// available statistics. Statistics are accessed via stats(label, COLUMN) where COLUMN is one of
/// #ConnectedComponentsTypes. The data type is CV_32S.
/// * centroids: centroid output for each label, including the background label. Centroids are
/// accessed via centroids(label, 0) for x and centroids(label, 1) for y. The data type CV_64F.
/// * connectivity: 8 or 4 for 8-way or 4-way connectivity respectively
/// * ltype: output image label type. Currently CV_32S and CV_16U are supported.
///
/// ## C++ default parameters:
/// * connectivity: 8
/// * ltype: CV_32S
pub fn connected_components_with_stats(image: &core::Mat, labels: &mut core::Mat, stats: &mut core::Mat, centroids: &mut core::Mat, connectivity: i32, ltype: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_connectedComponentsWithStats_Mat_image_Mat_labels_Mat_stats_Mat_centroids_int_connectivity_int_ltype(image.as_raw_Mat(), labels.as_raw_Mat(), stats.as_raw_Mat(), centroids.as_raw_Mat(), connectivity, ltype) }.into_result()
}
// identifier: cv_connectedComponentsWithStats_Mat_image_Mat_labels_Mat_stats_Mat_centroids_int_connectivity_int_ltype_int_ccltype
/// computes the connected components labeled image of boolean image and also produces a statistics output for each label
///
/// image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0
/// represents the background label. ltype specifies the output label image type, an important
/// consideration based on the total number of labels or alternatively the total number of pixels in
/// the source image. ccltype specifies the connected components labeling algorithm to use, currently
/// Grana's (BBDT) and Wu's (SAUF) algorithms are supported, see the #ConnectedComponentsAlgorithmsTypes
/// for details. Note that SAUF algorithm forces a row major ordering of labels while BBDT does not.
/// This function uses parallel version of both Grana and Wu's algorithms (statistics included) if at least one allowed
/// parallel framework is enabled and if the rows of the image are at least twice the number returned by #getNumberOfCPUs.
///
/// ## Parameters
/// * image: the 8-bit single-channel image to be labeled
/// * labels: destination labeled image
/// * stats: statistics output for each label, including the background label, see below for
/// available statistics. Statistics are accessed via stats(label, COLUMN) where COLUMN is one of
/// #ConnectedComponentsTypes. The data type is CV_32S.
/// * centroids: centroid output for each label, including the background label. Centroids are
/// accessed via centroids(label, 0) for x and centroids(label, 1) for y. The data type CV_64F.
/// * connectivity: 8 or 4 for 8-way or 4-way connectivity respectively
/// * ltype: output image label type. Currently CV_32S and CV_16U are supported.
/// * ccltype: connected components algorithm type (see #ConnectedComponentsAlgorithmsTypes).
pub fn connected_components_with_stats_1(image: &core::Mat, labels: &mut core::Mat, stats: &mut core::Mat, centroids: &mut core::Mat, connectivity: i32, ltype: i32, ccltype: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_connectedComponentsWithStats_Mat_image_Mat_labels_Mat_stats_Mat_centroids_int_connectivity_int_ltype_int_ccltype(image.as_raw_Mat(), labels.as_raw_Mat(), stats.as_raw_Mat(), centroids.as_raw_Mat(), connectivity, ltype, ccltype) }.into_result()
}
// identifier: cv_connectedComponents_Mat_image_Mat_labels_int_connectivity_int_ltype
/// @overload
///
/// ## Parameters
/// * image: the 8-bit single-channel image to be labeled
/// * labels: destination labeled image
/// * connectivity: 8 or 4 for 8-way or 4-way connectivity respectively
/// * ltype: output image label type. Currently CV_32S and CV_16U are supported.
///
/// ## C++ default parameters:
/// * connectivity: 8
/// * ltype: CV_32S
pub fn connected_components(image: &core::Mat, labels: &mut core::Mat, connectivity: i32, ltype: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_connectedComponents_Mat_image_Mat_labels_int_connectivity_int_ltype(image.as_raw_Mat(), labels.as_raw_Mat(), connectivity, ltype) }.into_result()
}
// identifier: cv_connectedComponents_Mat_image_Mat_labels_int_connectivity_int_ltype_int_ccltype
/// computes the connected components labeled image of boolean image
///
/// image with 4 or 8 way connectivity - returns N, the total number of labels [0, N-1] where 0
/// represents the background label. ltype specifies the output label image type, an important
/// consideration based on the total number of labels or alternatively the total number of pixels in
/// the source image. ccltype specifies the connected components labeling algorithm to use, currently
/// Grana (BBDT) and Wu's (SAUF) algorithms are supported, see the #ConnectedComponentsAlgorithmsTypes
/// for details. Note that SAUF algorithm forces a row major ordering of labels while BBDT does not.
/// This function uses parallel version of both Grana and Wu's algorithms if at least one allowed
/// parallel framework is enabled and if the rows of the image are at least twice the number returned by #getNumberOfCPUs.
///
/// ## Parameters
/// * image: the 8-bit single-channel image to be labeled
/// * labels: destination labeled image
/// * connectivity: 8 or 4 for 8-way or 4-way connectivity respectively
/// * ltype: output image label type. Currently CV_32S and CV_16U are supported.
/// * ccltype: connected components algorithm type (see the #ConnectedComponentsAlgorithmsTypes).
pub fn connected_components_1(image: &core::Mat, labels: &mut core::Mat, connectivity: i32, ltype: i32, ccltype: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_connectedComponents_Mat_image_Mat_labels_int_connectivity_int_ltype_int_ccltype(image.as_raw_Mat(), labels.as_raw_Mat(), connectivity, ltype, ccltype) }.into_result()
}
// identifier: cv_contourArea_Mat_contour_bool_oriented
/// Calculates a contour area.
///
/// The function computes a contour area. Similarly to moments , the area is computed using the Green
/// formula. Thus, the returned area and the number of non-zero pixels, if you draw the contour using
/// #drawContours or #fillPoly , can be different. Also, the function will most certainly give a wrong
/// results for contours with self-intersections.
///
/// Example:
/// ```ignore
/// vector<Point> contour;
/// contour.push_back(Point2f(0, 0));
/// contour.push_back(Point2f(10, 0));
/// contour.push_back(Point2f(10, 10));
/// contour.push_back(Point2f(5, 4));
///
/// double area0 = contourArea(contour);
/// vector<Point> approx;
/// approxPolyDP(contour, approx, 5, true);
/// double area1 = contourArea(approx);
///
/// cout << "area0 =" << area0 << endl <<
/// "area1 =" << area1 << endl <<
/// "approx poly vertices" << approx.size() << endl;
/// ```
///
/// ## Parameters
/// * contour: Input vector of 2D points (contour vertices), stored in std::vector or Mat.
/// * oriented: Oriented area flag. If it is true, the function returns a signed area value,
/// depending on the contour orientation (clockwise or counter-clockwise). Using this feature you can
/// determine orientation of a contour by taking the sign of an area. By default, the parameter is
/// false, which means that the absolute value is returned.
///
/// ## C++ default parameters:
/// * oriented: false
pub fn contour_area(contour: &core::Mat, oriented: bool) -> Result<f64> {
unsafe { sys::cv_core_cv_contourArea_Mat_contour_bool_oriented(contour.as_raw_Mat(), oriented) }.into_result()
}
// identifier: cv_convertFp16_Mat_src_Mat_dst
/// Converts an array to half precision floating number.
///
/// This function converts FP32 (single precision floating point) from/to FP16 (half precision floating point). CV_16S format is used to represent FP16 data.
/// There are two use modes (src -> dst): CV_32F -> CV_16S and CV_16S -> CV_32F. The input array has to have type of CV_32F or
/// CV_16S to represent the bit depth. If the input array is neither of them, the function will raise an error.
/// The format of half precision floating point is defined in IEEE 754-2008.
///
/// ## Parameters
/// * src: input array.
/// * dst: output array.
pub fn convert_fp16(src: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_convertFp16_Mat_src_Mat_dst(src.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_convertMaps_Mat_map1_Mat_map2_Mat_dstmap1_Mat_dstmap2_int_dstmap1type_bool_nninterpolation
/// Converts image transformation maps from one representation to another.
///
/// The function converts a pair of maps for remap from one representation to another. The following
/// options ( (map1.type(), map2.type()) <span lang='latex'>\rightarrow</span> (dstmap1.type(), dstmap2.type()) ) are
/// supported:
///
/// - <span lang='latex'>\texttt{(CV_32FC1, CV_32FC1)} \rightarrow \texttt{(CV_16SC2, CV_16UC1)}</span>. This is the
/// most frequently used conversion operation, in which the original floating-point maps (see remap )
/// are converted to a more compact and much faster fixed-point representation. The first output array
/// contains the rounded coordinates and the second array (created only when nninterpolation=false )
/// contains indices in the interpolation tables.
///
/// - <span lang='latex'>\texttt{(CV_32FC2)} \rightarrow \texttt{(CV_16SC2, CV_16UC1)}</span>. The same as above but
/// the original maps are stored in one 2-channel matrix.
///
/// - Reverse conversion. Obviously, the reconstructed floating-point maps will not be exactly the same
/// as the originals.
///
/// ## Parameters
/// * map1: The first input map of type CV_16SC2, CV_32FC1, or CV_32FC2 .
/// * map2: The second input map of type CV_16UC1, CV_32FC1, or none (empty matrix),
/// respectively.
/// * dstmap1: The first output map that has the type dstmap1type and the same size as src .
/// * dstmap2: The second output map.
/// * dstmap1type: Type of the first output map that should be CV_16SC2, CV_32FC1, or
/// CV_32FC2 .
/// * nninterpolation: Flag indicating whether the fixed-point maps are used for the
/// nearest-neighbor or for a more complex interpolation.
///
/// @sa remap, undistort, initUndistortRectifyMap
///
/// ## C++ default parameters:
/// * nninterpolation: false
pub fn convert_maps(map1: &core::Mat, map2: &core::Mat, dstmap1: &mut core::Mat, dstmap2: &mut core::Mat, dstmap1type: i32, nninterpolation: bool) -> Result<()> {
unsafe { sys::cv_core_cv_convertMaps_Mat_map1_Mat_map2_Mat_dstmap1_Mat_dstmap2_int_dstmap1type_bool_nninterpolation(map1.as_raw_Mat(), map2.as_raw_Mat(), dstmap1.as_raw_Mat(), dstmap2.as_raw_Mat(), dstmap1type, nninterpolation) }.into_result()
}
// identifier: cv_convertPointsFromHomogeneous_Mat_src_Mat_dst
/// Converts points from homogeneous to Euclidean space.
///
/// ## Parameters
/// * src: Input vector of N-dimensional points.
/// * dst: Output vector of N-1-dimensional points.
///
/// The function converts points homogeneous to Euclidean space using perspective projection. That is,
/// each point (x1, x2, ... x(n-1), xn) is converted to (x1/xn, x2/xn, ..., x(n-1)/xn). When xn=0, the
/// output point coordinates will be (0,0,0,...).
pub fn convert_points_from_homogeneous(src: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_convertPointsFromHomogeneous_Mat_src_Mat_dst(src.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_convertPointsHomogeneous_Mat_src_Mat_dst
/// Converts points to/from homogeneous coordinates.
///
/// ## Parameters
/// * src: Input array or vector of 2D, 3D, or 4D points.
/// * dst: Output vector of 2D, 3D, or 4D points.
///
/// The function converts 2D or 3D points from/to homogeneous coordinates by calling either
/// convertPointsToHomogeneous or convertPointsFromHomogeneous.
///
///
/// Note: The function is obsolete. Use one of the previous two functions instead.
pub fn convert_points_homogeneous(src: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_convertPointsHomogeneous_Mat_src_Mat_dst(src.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_convertPointsToHomogeneous_Mat_src_Mat_dst
/// Converts points from Euclidean to homogeneous space.
///
/// ## Parameters
/// * src: Input vector of N-dimensional points.
/// * dst: Output vector of N+1-dimensional points.
///
/// The function converts points from Euclidean to homogeneous space by appending 1's to the tuple of
/// point coordinates. That is, each point (x1, x2, ..., xn) is converted to (x1, x2, ..., xn, 1).
pub fn convert_points_to_homogeneous(src: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_convertPointsToHomogeneous_Mat_src_Mat_dst(src.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_convertScaleAbs_Mat_src_Mat_dst_double_alpha_double_beta
/// Scales, calculates absolute values, and converts the result to 8-bit.
///
/// On each element of the input array, the function convertScaleAbs
/// performs three operations sequentially: scaling, taking an absolute
/// value, conversion to an unsigned 8-bit type:
/// <div lang='latex'>\texttt{dst} (I)= \texttt{saturate\_cast<uchar>} (| \texttt{src} (I)* \texttt{alpha} + \texttt{beta} |)</div>
/// In case of multi-channel arrays, the function processes each channel
/// independently. When the output is not 8-bit, the operation can be
/// emulated by calling the Mat::convertTo method (or by using matrix
/// expressions) and then by calculating an absolute value of the result.
/// For example:
/// ```ignore{.cpp}
/// Mat_<float> A(30,30);
/// randu(A, Scalar(-100), Scalar(100));
/// Mat_<float> B = A*5 + 3;
/// B = abs(B);
/// // Mat_<float> B = abs(A*5+3) will also do the job,
/// // but it will allocate a temporary matrix
/// ```
///
/// ## Parameters
/// * src: input array.
/// * dst: output array.
/// * alpha: optional scale factor.
/// * beta: optional delta added to the scaled values.
/// @sa Mat::convertTo, cv::abs(const Mat&)
///
/// ## C++ default parameters:
/// * alpha: 1
/// * beta: 0
pub fn convert_scale_abs(src: &core::Mat, dst: &mut core::Mat, alpha: f64, beta: f64) -> Result<()> {
unsafe { sys::cv_core_cv_convertScaleAbs_Mat_src_Mat_dst_double_alpha_double_beta(src.as_raw_Mat(), dst.as_raw_Mat(), alpha, beta) }.into_result()
}
// identifier: cv_convexHull_Mat_points_Mat_hull_bool_clockwise_bool_returnPoints
/// Finds the convex hull of a point set.
///
/// The function cv::convexHull finds the convex hull of a 2D point set using the Sklansky's algorithm @cite Sklansky82
/// that has *O(N logN)* complexity in the current implementation.
///
/// ## Parameters
/// * points: Input 2D point set, stored in std::vector or Mat.
/// * hull: Output convex hull. It is either an integer vector of indices or vector of points. In
/// the first case, the hull elements are 0-based indices of the convex hull points in the original
/// array (since the set of convex hull points is a subset of the original point set). In the second
/// case, hull elements are the convex hull points themselves.
/// * clockwise: Orientation flag. If it is true, the output convex hull is oriented clockwise.
/// Otherwise, it is oriented counter-clockwise. The assumed coordinate system has its X axis pointing
/// to the right, and its Y axis pointing upwards.
/// * returnPoints: Operation flag. In case of a matrix, when the flag is true, the function
/// returns convex hull points. Otherwise, it returns indices of the convex hull points. When the
/// output array is std::vector, the flag is ignored, and the output depends on the type of the
/// vector: std::vector\<int\> implies returnPoints=false, std::vector\<Point\> implies
/// returnPoints=true.
///
///
/// Note: `points` and `hull` should be different arrays, inplace processing isn't supported.
///
/// Check @ref tutorial_hull "the corresponding tutorial" for more details.
///
/// useful links:
///
/// https://www.learnopencv.com/convex-hull-using-opencv-in-python-and-c/
///
/// ## C++ default parameters:
/// * clockwise: false
/// * return_points: true
pub fn convex_hull(points: &core::Mat, hull: &mut core::Mat, clockwise: bool, return_points: bool) -> Result<()> {
unsafe { sys::cv_core_cv_convexHull_Mat_points_Mat_hull_bool_clockwise_bool_returnPoints(points.as_raw_Mat(), hull.as_raw_Mat(), clockwise, return_points) }.into_result()
}
// identifier: cv_convexityDefects_Mat_contour_Mat_convexhull_Mat_convexityDefects
/// Finds the convexity defects of a contour.
///
/// The figure below displays convexity defects of a hand contour:
///
/// 
///
/// ## Parameters
/// * contour: Input contour.
/// * convexhull: Convex hull obtained using convexHull that should contain indices of the contour
/// points that make the hull.
/// * convexityDefects: The output vector of convexity defects. In C++ and the new Python/Java
/// interface each convexity defect is represented as 4-element integer vector (a.k.a. #Vec4i):
/// (start_index, end_index, farthest_pt_index, fixpt_depth), where indices are 0-based indices
/// in the original contour of the convexity defect beginning, end and the farthest point, and
/// fixpt_depth is fixed-point approximation (with 8 fractional bits) of the distance between the
/// farthest contour point and the hull. That is, to get the floating-point value of the depth will be
/// fixpt_depth/256.0.
pub fn convexity_defects(contour: &core::Mat, convexhull: &core::Mat, convexity_defects: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_convexityDefects_Mat_contour_Mat_convexhull_Mat_convexityDefects(contour.as_raw_Mat(), convexhull.as_raw_Mat(), convexity_defects.as_raw_Mat()) }.into_result()
}
// identifier: cv_copyMakeBorder_Mat_src_Mat_dst_int_top_int_bottom_int_left_int_right_int_borderType_Scalar_value
/// Forms a border around an image.
///
/// The function copies the source image into the middle of the destination image. The areas to the
/// left, to the right, above and below the copied source image will be filled with extrapolated
/// pixels. This is not what filtering functions based on it do (they extrapolate pixels on-fly), but
/// what other more complex functions, including your own, may do to simplify image boundary handling.
///
/// The function supports the mode when src is already in the middle of dst . In this case, the
/// function does not copy src itself but simply constructs the border, for example:
///
/// ```ignore{.cpp}
/// // let border be the same in all directions
/// int border=2;
/// // constructs a larger image to fit both the image and the border
/// Mat gray_buf(rgb.rows + border*2, rgb.cols + border*2, rgb.depth());
/// // select the middle part of it w/o copying data
/// Mat gray(gray_canvas, Rect(border, border, rgb.cols, rgb.rows));
/// // convert image from RGB to grayscale
/// cvtColor(rgb, gray, COLOR_RGB2GRAY);
/// // form a border in-place
/// copyMakeBorder(gray, gray_buf, border, border,
/// border, border, BORDER_REPLICATE);
/// // now do some custom filtering ...
/// ...
/// ```
///
///
/// Note: When the source image is a part (ROI) of a bigger image, the function will try to use the
/// pixels outside of the ROI to form a border. To disable this feature and always do extrapolation, as
/// if src was not a ROI, use borderType | #BORDER_ISOLATED.
///
/// ## Parameters
/// * src: Source image.
/// * dst: Destination image of the same type as src and the size Size(src.cols+left+right,
/// src.rows+top+bottom) .
/// * top
/// @param: bottom
/// * left
/// @param: right Parameter specifying how many pixels in each direction from the source image rectangle
/// to extrapolate. For example, top=1, bottom=1, left=1, right=1 mean that 1 pixel-wide border needs
/// to be built.
/// * borderType: Border type. See borderInterpolate for details.
/// * value: Border value if borderType==BORDER_CONSTANT .
///
/// @sa borderInterpolate
///
/// ## C++ default parameters:
/// * value: Scalar()
pub fn copy_make_border(src: &core::Mat, dst: &mut core::Mat, top: i32, bottom: i32, left: i32, right: i32, border_type: i32, value: core::Scalar) -> Result<()> {
unsafe { sys::cv_core_cv_copyMakeBorder_Mat_src_Mat_dst_int_top_int_bottom_int_left_int_right_int_borderType_Scalar_value(src.as_raw_Mat(), dst.as_raw_Mat(), top, bottom, left, right, border_type, value) }.into_result()
}
// identifier: cv_cornerEigenValsAndVecs_Mat_src_Mat_dst_int_blockSize_int_ksize_int_borderType
/// Calculates eigenvalues and eigenvectors of image blocks for corner detection.
///
/// For every pixel <span lang='latex'>p</span> , the function cornerEigenValsAndVecs considers a blockSize <span lang='latex'>\times</span> blockSize
/// neighborhood <span lang='latex'>S(p)</span> . It calculates the covariation matrix of derivatives over the neighborhood as:
///
/// <div lang='latex'>M = \begin{bmatrix} \sum _{S(p)}(dI/dx)^2 & \sum _{S(p)}dI/dx dI/dy \\ \sum _{S(p)}dI/dx dI/dy & \sum _{S(p)}(dI/dy)^2 \end{bmatrix}</div>
///
/// where the derivatives are computed using the Sobel operator.
///
/// After that, it finds eigenvectors and eigenvalues of <span lang='latex'>M</span> and stores them in the destination image as
/// <span lang='latex'>(\lambda_1, \lambda_2, x_1, y_1, x_2, y_2)</span> where
///
/// * <span lang='latex'>\lambda_1, \lambda_2</span> are the non-sorted eigenvalues of <span lang='latex'>M</span>
/// * <span lang='latex'>x_1, y_1</span> are the eigenvectors corresponding to <span lang='latex'>\lambda_1</span>
/// * <span lang='latex'>x_2, y_2</span> are the eigenvectors corresponding to <span lang='latex'>\lambda_2</span>
///
/// The output of the function can be used for robust edge or corner detection.
///
/// ## Parameters
/// * src: Input single-channel 8-bit or floating-point image.
/// * dst: Image to store the results. It has the same size as src and the type CV_32FC(6) .
/// * blockSize: Neighborhood size (see details below).
/// * ksize: Aperture parameter for the Sobel operator.
/// * borderType: Pixel extrapolation method. See #BorderTypes.
///
/// @sa cornerMinEigenVal, cornerHarris, preCornerDetect
///
/// ## C++ default parameters:
/// * border_type: BORDER_DEFAULT
pub fn corner_eigen_vals_and_vecs(src: &core::Mat, dst: &mut core::Mat, block_size: i32, ksize: i32, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_cornerEigenValsAndVecs_Mat_src_Mat_dst_int_blockSize_int_ksize_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), block_size, ksize, border_type) }.into_result()
}
// identifier: cv_cornerHarris_Mat_src_Mat_dst_int_blockSize_int_ksize_double_k_int_borderType
/// Harris corner detector.
///
/// The function runs the Harris corner detector on the image. Similarly to cornerMinEigenVal and
/// cornerEigenValsAndVecs , for each pixel <span lang='latex'>(x, y)</span> it calculates a <span lang='latex'>2\times2</span> gradient covariance
/// matrix <span lang='latex'>M^{(x,y)}</span> over a <span lang='latex'>\texttt{blockSize} \times \texttt{blockSize}</span> neighborhood. Then, it
/// computes the following characteristic:
///
/// <div lang='latex'>\texttt{dst} (x,y) = \mathrm{det} M^{(x,y)} - k \cdot \left ( \mathrm{tr} M^{(x,y)} \right )^2</div>
///
/// Corners in the image can be found as the local maxima of this response map.
///
/// ## Parameters
/// * src: Input single-channel 8-bit or floating-point image.
/// * dst: Image to store the Harris detector responses. It has the type CV_32FC1 and the same
/// size as src .
/// * blockSize: Neighborhood size (see the details on #cornerEigenValsAndVecs ).
/// * ksize: Aperture parameter for the Sobel operator.
/// * k: Harris detector free parameter. See the formula above.
/// * borderType: Pixel extrapolation method. See #BorderTypes.
///
/// ## C++ default parameters:
/// * border_type: BORDER_DEFAULT
pub fn corner_harris(src: &core::Mat, dst: &mut core::Mat, block_size: i32, ksize: i32, k: f64, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_cornerHarris_Mat_src_Mat_dst_int_blockSize_int_ksize_double_k_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), block_size, ksize, k, border_type) }.into_result()
}
// identifier: cv_cornerMinEigenVal_Mat_src_Mat_dst_int_blockSize_int_ksize_int_borderType
/// Calculates the minimal eigenvalue of gradient matrices for corner detection.
///
/// The function is similar to cornerEigenValsAndVecs but it calculates and stores only the minimal
/// eigenvalue of the covariance matrix of derivatives, that is, <span lang='latex'>\min(\lambda_1, \lambda_2)</span> in terms
/// of the formulae in the cornerEigenValsAndVecs description.
///
/// ## Parameters
/// * src: Input single-channel 8-bit or floating-point image.
/// * dst: Image to store the minimal eigenvalues. It has the type CV_32FC1 and the same size as
/// src .
/// * blockSize: Neighborhood size (see the details on #cornerEigenValsAndVecs ).
/// * ksize: Aperture parameter for the Sobel operator.
/// * borderType: Pixel extrapolation method. See #BorderTypes.
///
/// ## C++ default parameters:
/// * ksize: 3
/// * border_type: BORDER_DEFAULT
pub fn corner_min_eigen_val(src: &core::Mat, dst: &mut core::Mat, block_size: i32, ksize: i32, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_cornerMinEigenVal_Mat_src_Mat_dst_int_blockSize_int_ksize_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), block_size, ksize, border_type) }.into_result()
}
// identifier: cv_cornerSubPix_Mat_image_Mat_corners_Size_winSize_Size_zeroZone_TermCriteria_criteria
/// Refines the corner locations.
///
/// The function iterates to find the sub-pixel accurate location of corners or radial saddle points, as
/// shown on the figure below.
///
/// 
///
/// Sub-pixel accurate corner locator is based on the observation that every vector from the center <span lang='latex'>q</span>
/// to a point <span lang='latex'>p</span> located within a neighborhood of <span lang='latex'>q</span> is orthogonal to the image gradient at <span lang='latex'>p</span>
/// subject to image and measurement noise. Consider the expression:
///
/// <div lang='latex'>\epsilon _i = {DI_{p_i}}^T \cdot (q - p_i)</div>
///
/// where <span lang='latex'>{DI_{p_i}}</span> is an image gradient at one of the points <span lang='latex'>p_i</span> in a neighborhood of <span lang='latex'>q</span> . The
/// value of <span lang='latex'>q</span> is to be found so that <span lang='latex'>\epsilon_i</span> is minimized. A system of equations may be set up
/// with <span lang='latex'>\epsilon_i</span> set to zero:
///
/// <div lang='latex'>\sum _i(DI_{p_i} \cdot {DI_{p_i}}^T) \cdot q - \sum _i(DI_{p_i} \cdot {DI_{p_i}}^T \cdot p_i)</div>
///
/// where the gradients are summed within a neighborhood ("search window") of <span lang='latex'>q</span> . Calling the first
/// gradient term <span lang='latex'>G</span> and the second gradient term <span lang='latex'>b</span> gives:
///
/// <div lang='latex'>q = G^{-1} \cdot b</div>
///
/// The algorithm sets the center of the neighborhood window at this new center <span lang='latex'>q</span> and then iterates
/// until the center stays within a set threshold.
///
/// ## Parameters
/// * image: Input single-channel, 8-bit or float image.
/// * corners: Initial coordinates of the input corners and refined coordinates provided for
/// output.
/// * winSize: Half of the side length of the search window. For example, if winSize=Size(5,5) ,
/// then a <span lang='latex'>(5*2+1) \times (5*2+1) = 11 \times 11</span> search window is used.
/// * zeroZone: Half of the size of the dead region in the middle of the search zone over which
/// the summation in the formula below is not done. It is used sometimes to avoid possible
/// singularities of the autocorrelation matrix. The value of (-1,-1) indicates that there is no such
/// a size.
/// * criteria: Criteria for termination of the iterative process of corner refinement. That is,
/// the process of corner position refinement stops either after criteria.maxCount iterations or when
/// the corner position moves by less than criteria.epsilon on some iteration.
pub fn corner_sub_pix(image: &core::Mat, corners: &mut core::Mat, win_size: core::Size, zero_zone: core::Size, criteria: &core::TermCriteria) -> Result<()> {
unsafe { sys::cv_core_cv_cornerSubPix_Mat_image_Mat_corners_Size_winSize_Size_zeroZone_TermCriteria_criteria(image.as_raw_Mat(), corners.as_raw_Mat(), win_size, zero_zone, criteria.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_correctMatches_Mat_F_Mat_points1_Mat_points2_Mat_newPoints1_Mat_newPoints2
/// Refines coordinates of corresponding points.
///
/// ## Parameters
/// * F: 3x3 fundamental matrix.
/// * points1: 1xN array containing the first set of points.
/// * points2: 1xN array containing the second set of points.
/// * newPoints1: The optimized points1.
/// * newPoints2: The optimized points2.
///
/// The function implements the Optimal Triangulation Method (see Multiple View Geometry for details).
/// For each given point correspondence points1[i] \<-\> points2[i], and a fundamental matrix F, it
/// computes the corrected correspondences newPoints1[i] \<-\> newPoints2[i] that minimize the geometric
/// error <span lang='latex'>d(points1[i], newPoints1[i])^2 + d(points2[i],newPoints2[i])^2</span> (where <span lang='latex'>d(a,b)</span> is the
/// geometric distance between points <span lang='latex'>a</span> and <span lang='latex'>b</span> ) subject to the epipolar constraint
/// <span lang='latex'>newPoints2^T * F * newPoints1 = 0</span> .
pub fn correct_matches(f: &core::Mat, points1: &core::Mat, points2: &core::Mat, new_points1: &mut core::Mat, new_points2: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_correctMatches_Mat_F_Mat_points1_Mat_points2_Mat_newPoints1_Mat_newPoints2(f.as_raw_Mat(), points1.as_raw_Mat(), points2.as_raw_Mat(), new_points1.as_raw_Mat(), new_points2.as_raw_Mat()) }.into_result()
}
// identifier: cv_cos_softdouble_a
/// Cosine
///
/// Special cases:
/// - cos(Inf) or cos(NaN) is NaN
/// - cos(x) == +/- 1 when cos(x) is close to +/- 1
pub fn cos(a: &core::softdouble) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_cos_softdouble_a(a.as_raw_softdouble()) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_countNonZero_Mat_src
/// Counts non-zero array elements.
///
/// The function returns the number of non-zero elements in src :
/// <div lang='latex'>\sum _{I: \; \texttt{src} (I) \ne0 } 1</div>
/// ## Parameters
/// * src: single-channel array.
/// @sa mean, meanStdDev, norm, minMaxLoc, calcCovarMatrix
pub fn count_non_zero(src: &core::Mat) -> Result<i32> {
unsafe { sys::cv_core_cv_countNonZero_Mat_src(src.as_raw_Mat()) }.into_result()
}
// identifier: cv_createAffineTransformer_bool_fullAffine
/// Complete constructor
pub fn create_affine_transformer(full_affine: bool) -> Result<types::PtrOfAffineTransformer> {
unsafe { sys::cv_core_cv_createAffineTransformer_bool_fullAffine(full_affine) }.into_result().map(|x| types::PtrOfAffineTransformer { ptr: x })
}
// identifier: cv_createAlignMTB_int_max_bits_int_exclude_range_bool_cut
/// Creates AlignMTB object
///
/// ## Parameters
/// * max_bits: logarithm to the base 2 of maximal shift in each dimension. Values of 5 and 6 are
/// usually good enough (31 and 63 pixels shift respectively).
/// * exclude_range: range for exclusion bitmap that is constructed to suppress noise around the
/// median value.
/// * cut: if true cuts images, otherwise fills the new regions with zeros.
///
/// ## C++ default parameters:
/// * max_bits: 6
/// * exclude_range: 4
/// * cut: true
pub fn create_align_mtb(max_bits: i32, exclude_range: i32, cut: bool) -> Result<types::PtrOfAlignMTB> {
unsafe { sys::cv_core_cv_createAlignMTB_int_max_bits_int_exclude_range_bool_cut(max_bits, exclude_range, cut) }.into_result().map(|x| types::PtrOfAlignMTB { ptr: x })
}
// identifier: cv_createBackgroundSubtractorKNN_int_history_double_dist2Threshold_bool_detectShadows
/// Creates KNN Background Subtractor
///
/// ## Parameters
/// * history: Length of the history.
/// * dist2Threshold: Threshold on the squared distance between the pixel and the sample to decide
/// whether a pixel is close to that sample. This parameter does not affect the background update.
/// * detectShadows: If true, the algorithm will detect shadows and mark them. It decreases the
/// speed a bit, so if you do not need this feature, set the parameter to false.
///
/// ## C++ default parameters:
/// * history: 500
/// * dist2_threshold: 400.0
/// * detect_shadows: true
pub fn create_background_subtractor_knn(history: i32, dist2_threshold: f64, detect_shadows: bool) -> Result<types::PtrOfBackgroundSubtractorKNN> {
unsafe { sys::cv_core_cv_createBackgroundSubtractorKNN_int_history_double_dist2Threshold_bool_detectShadows(history, dist2_threshold, detect_shadows) }.into_result().map(|x| types::PtrOfBackgroundSubtractorKNN { ptr: x })
}
// identifier: cv_createBackgroundSubtractorMOG2_int_history_double_varThreshold_bool_detectShadows
/// Creates MOG2 Background Subtractor
///
/// ## Parameters
/// * history: Length of the history.
/// * varThreshold: Threshold on the squared Mahalanobis distance between the pixel and the model
/// to decide whether a pixel is well described by the background model. This parameter does not
/// affect the background update.
/// * detectShadows: If true, the algorithm will detect shadows and mark them. It decreases the
/// speed a bit, so if you do not need this feature, set the parameter to false.
///
/// ## C++ default parameters:
/// * history: 500
/// * var_threshold: 16
/// * detect_shadows: true
pub fn create_background_subtractor_mog2(history: i32, var_threshold: f64, detect_shadows: bool) -> Result<types::PtrOfBackgroundSubtractorMOG2> {
unsafe { sys::cv_core_cv_createBackgroundSubtractorMOG2_int_history_double_varThreshold_bool_detectShadows(history, var_threshold, detect_shadows) }.into_result().map(|x| types::PtrOfBackgroundSubtractorMOG2 { ptr: x })
}
// identifier: cv_createButton_String_bar_name_ButtonCallback_on_change_void_X_userdata_int_type_bool_initial_button_state
/// Attaches a button to the control panel.
///
/// The function createButton attaches a button to the control panel. Each button is added to a
/// buttonbar to the right of the last button. A new buttonbar is created if nothing was attached to the
/// control panel before, or if the last element attached to the control panel was a trackbar or if the
/// QT_NEW_BUTTONBAR flag is added to the type.
///
/// See below various examples of the cv::createButton function call: :
/// ```ignore
/// createButton(NULL,callbackButton);//create a push button "button 0", that will call callbackButton.
/// createButton("button2",callbackButton,NULL,QT_CHECKBOX,0);
/// createButton("button3",callbackButton,&value);
/// createButton("button5",callbackButton1,NULL,QT_RADIOBOX);
/// createButton("button6",callbackButton2,NULL,QT_PUSH_BUTTON,1);
/// createButton("button6",callbackButton2,NULL,QT_PUSH_BUTTON|QT_NEW_BUTTONBAR);// create a push button in a new row
/// ```
///
///
/// ## Parameters
/// @param bar_name Name of the button.
/// * on_change: Pointer to the function to be called every time the button changes its state.
/// This function should be prototyped as void Foo(int state,\*void); . *state* is the current state
/// of the button. It could be -1 for a push button, 0 or 1 for a check/radio box button.
/// * userdata: Pointer passed to the callback function.
/// * type: Optional type of the button. Available types are: (cv::QtButtonTypes)
/// * initial_button_state: Default state of the button. Use for checkbox and radiobox. Its
/// value could be 0 or 1. (__Optional__)
///
/// ## C++ default parameters:
/// * userdata: 0
/// * _type: QT_PUSH_BUTTON
/// * initial_button_state: false
pub fn create_button(bar_name: &str, on_change: Option<Box<core::ButtonCallback>>, _type: i32, initial_button_state: bool) -> Result<i32> {
string_arg!(bar_name);
callback_arg!(on_change(state: i32, userdata: *mut c_void) via userdata => (state: i32));
unsafe { sys::cv_core_cv_createButton_String_bar_name_ButtonCallback_on_change_void_X_userdata_int_type_bool_initial_button_state(bar_name.as_ptr(), on_change, userdata, _type, initial_button_state) }.into_result()
}
// identifier: cv_createCLAHE_double_clipLimit_Size_tileGridSize
/// Creates a smart pointer to a cv::CLAHE class and initializes it.
///
/// ## Parameters
/// * clipLimit: Threshold for contrast limiting.
/// * tileGridSize: Size of grid for histogram equalization. Input image will be divided into
/// equally sized rectangular tiles. tileGridSize defines the number of tiles in row and column.
///
/// ## C++ default parameters:
/// * clip_limit: 40.0
/// * tile_grid_size: Size(8, 8)
pub fn create_clahe(clip_limit: f64, tile_grid_size: core::Size) -> Result<types::PtrOfCLAHE> {
unsafe { sys::cv_core_cv_createCLAHE_double_clipLimit_Size_tileGridSize(clip_limit, tile_grid_size) }.into_result().map(|x| types::PtrOfCLAHE { ptr: x })
}
// identifier: cv_createCalibrateDebevec_int_samples_float_lambda_bool_random
/// Creates CalibrateDebevec object
///
/// ## Parameters
/// * samples: number of pixel locations to use
/// * lambda: smoothness term weight. Greater values produce smoother results, but can alter the
/// response.
/// * random: if true sample pixel locations are chosen at random, otherwise they form a
/// rectangular grid.
///
/// ## C++ default parameters:
/// * samples: 70
/// * lambda: 10.0f
/// * random: false
pub fn create_calibrate_debevec(samples: i32, lambda: f32, random: bool) -> Result<types::PtrOfCalibrateDebevec> {
unsafe { sys::cv_core_cv_createCalibrateDebevec_int_samples_float_lambda_bool_random(samples, lambda, random) }.into_result().map(|x| types::PtrOfCalibrateDebevec { ptr: x })
}
// identifier: cv_createCalibrateRobertson_int_max_iter_float_threshold
/// Creates CalibrateRobertson object
///
/// ## Parameters
/// * max_iter: maximal number of Gauss-Seidel solver iterations.
/// * threshold: target difference between results of two successive steps of the minimization.
///
/// ## C++ default parameters:
/// * max_iter: 30
/// * threshold: 0.01f
pub fn create_calibrate_robertson(max_iter: i32, threshold: f32) -> Result<types::PtrOfCalibrateRobertson> {
unsafe { sys::cv_core_cv_createCalibrateRobertson_int_max_iter_float_threshold(max_iter, threshold) }.into_result().map(|x| types::PtrOfCalibrateRobertson { ptr: x })
}
// identifier: cv_createChiHistogramCostExtractor_int_nDummies_float_defaultCost
///
/// ## C++ default parameters:
/// * n_dummies: 25
/// * default_cost: 0.2f
pub fn create_chi_histogram_cost_extractor(n_dummies: i32, default_cost: f32) -> Result<types::PtrOfHistogramCostExtractor> {
unsafe { sys::cv_core_cv_createChiHistogramCostExtractor_int_nDummies_float_defaultCost(n_dummies, default_cost) }.into_result().map(|x| types::PtrOfHistogramCostExtractor { ptr: x })
}
// identifier: cv_createEMDHistogramCostExtractor_int_flag_int_nDummies_float_defaultCost
///
/// ## C++ default parameters:
/// * flag: DIST_L2
/// * n_dummies: 25
/// * default_cost: 0.2f
pub fn create_emd_histogram_cost_extractor(flag: i32, n_dummies: i32, default_cost: f32) -> Result<types::PtrOfHistogramCostExtractor> {
unsafe { sys::cv_core_cv_createEMDHistogramCostExtractor_int_flag_int_nDummies_float_defaultCost(flag, n_dummies, default_cost) }.into_result().map(|x| types::PtrOfHistogramCostExtractor { ptr: x })
}
// identifier: cv_createEMDL1HistogramCostExtractor_int_nDummies_float_defaultCost
///
/// ## C++ default parameters:
/// * n_dummies: 25
/// * default_cost: 0.2f
pub fn create_emdl1_histogram_cost_extractor(n_dummies: i32, default_cost: f32) -> Result<types::PtrOfHistogramCostExtractor> {
unsafe { sys::cv_core_cv_createEMDL1HistogramCostExtractor_int_nDummies_float_defaultCost(n_dummies, default_cost) }.into_result().map(|x| types::PtrOfHistogramCostExtractor { ptr: x })
}
// identifier: cv_createFaceDetectionMaskGenerator
pub fn create_face_detection_mask_generator() -> Result<types::PtrOfMaskGenerator> {
unsafe { sys::cv_core_cv_createFaceDetectionMaskGenerator() }.into_result().map(|x| types::PtrOfMaskGenerator { ptr: x })
}
// identifier: cv_createGeneralizedHoughBallard
/// Creates a smart pointer to a cv::GeneralizedHoughBallard class and initializes it.
pub fn create_generalized_hough_ballard() -> Result<types::PtrOfGeneralizedHoughBallard> {
unsafe { sys::cv_core_cv_createGeneralizedHoughBallard() }.into_result().map(|x| types::PtrOfGeneralizedHoughBallard { ptr: x })
}
// identifier: cv_createGeneralizedHoughGuil
/// Creates a smart pointer to a cv::GeneralizedHoughGuil class and initializes it.
pub fn create_generalized_hough_guil() -> Result<types::PtrOfGeneralizedHoughGuil> {
unsafe { sys::cv_core_cv_createGeneralizedHoughGuil() }.into_result().map(|x| types::PtrOfGeneralizedHoughGuil { ptr: x })
}
// identifier: cv_createHanningWindow_Mat_dst_Size_winSize_int_type
/// This function computes a Hanning window coefficients in two dimensions.
///
/// See (http://en.wikipedia.org/wiki/Hann_function) and (http://en.wikipedia.org/wiki/Window_function)
/// for more information.
///
/// An example is shown below:
/// ```ignore
/// // create hanning window of size 100x100 and type CV_32F
/// Mat hann;
/// createHanningWindow(hann, Size(100, 100), CV_32F);
/// ```
///
/// ## Parameters
/// * dst: Destination array to place Hann coefficients in
/// * winSize: The window size specifications (both width and height must be > 1)
/// * type: Created array type
pub fn create_hanning_window(dst: &mut core::Mat, win_size: core::Size, _type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_createHanningWindow_Mat_dst_Size_winSize_int_type(dst.as_raw_Mat(), win_size, _type) }.into_result()
}
// identifier: cv_createHausdorffDistanceExtractor_int_distanceFlag_float_rankProp
///
/// ## C++ default parameters:
/// * distance_flag: cv::NORM_L2
/// * rank_prop: 0.6f
pub fn create_hausdorff_distance_extractor(distance_flag: i32, rank_prop: f32) -> Result<types::PtrOfHausdorffDistanceExtractor> {
unsafe { sys::cv_core_cv_createHausdorffDistanceExtractor_int_distanceFlag_float_rankProp(distance_flag, rank_prop) }.into_result().map(|x| types::PtrOfHausdorffDistanceExtractor { ptr: x })
}
// identifier: cv_createLineSegmentDetector_int__refine_double__scale_double__sigma_scale_double__quant_double__ang_th_double__log_eps_double__density_th_int__n_bins
/// Creates a smart pointer to a LineSegmentDetector object and initializes it.
///
/// The LineSegmentDetector algorithm is defined using the standard values. Only advanced users may want
/// to edit those, as to tailor it for their own application.
///
/// ## Parameters
/// * _refine: The way found lines will be refined, see #LineSegmentDetectorModes
/// * _scale: The scale of the image that will be used to find the lines. Range (0..1].
/// * _sigma_scale: Sigma for Gaussian filter. It is computed as sigma = _sigma_scale/_scale.
/// * _quant: Bound to the quantization error on the gradient norm.
/// * _ang_th: Gradient angle tolerance in degrees.
/// * _log_eps: Detection threshold: -log10(NFA) \> log_eps. Used only when advance refinement
/// is chosen.
/// * _density_th: Minimal density of aligned region points in the enclosing rectangle.
/// * _n_bins: Number of bins in pseudo-ordering of gradient modulus.
///
/// ## C++ default parameters:
/// * _refine: LSD_REFINE_STD
/// * _scale: 0.8
/// * _sigma_scale: 0.6
/// * _quant: 2.0
/// * _ang_th: 22.5
/// * _log_eps: 0
/// * _density_th: 0.7
/// * _n_bins: 1024
pub fn create_line_segment_detector(_refine: i32, _scale: f64, _sigma_scale: f64, _quant: f64, _ang_th: f64, _log_eps: f64, _density_th: f64, _n_bins: i32) -> Result<types::PtrOfLineSegmentDetector> {
unsafe { sys::cv_core_cv_createLineSegmentDetector_int__refine_double__scale_double__sigma_scale_double__quant_double__ang_th_double__log_eps_double__density_th_int__n_bins(_refine, _scale, _sigma_scale, _quant, _ang_th, _log_eps, _density_th, _n_bins) }.into_result().map(|x| types::PtrOfLineSegmentDetector { ptr: x })
}
// identifier: cv_createMergeDebevec
/// Creates MergeDebevec object
pub fn create_merge_debevec() -> Result<types::PtrOfMergeDebevec> {
unsafe { sys::cv_core_cv_createMergeDebevec() }.into_result().map(|x| types::PtrOfMergeDebevec { ptr: x })
}
// identifier: cv_createMergeMertens_float_contrast_weight_float_saturation_weight_float_exposure_weight
/// Creates MergeMertens object
///
/// ## Parameters
/// * contrast_weight: contrast measure weight. See MergeMertens.
/// * saturation_weight: saturation measure weight
/// * exposure_weight: well-exposedness measure weight
///
/// ## C++ default parameters:
/// * contrast_weight: 1.0f
/// * saturation_weight: 1.0f
/// * exposure_weight: 0.0f
pub fn create_merge_mertens(contrast_weight: f32, saturation_weight: f32, exposure_weight: f32) -> Result<types::PtrOfMergeMertens> {
unsafe { sys::cv_core_cv_createMergeMertens_float_contrast_weight_float_saturation_weight_float_exposure_weight(contrast_weight, saturation_weight, exposure_weight) }.into_result().map(|x| types::PtrOfMergeMertens { ptr: x })
}
// identifier: cv_createMergeRobertson
/// Creates MergeRobertson object
pub fn create_merge_robertson() -> Result<types::PtrOfMergeRobertson> {
unsafe { sys::cv_core_cv_createMergeRobertson() }.into_result().map(|x| types::PtrOfMergeRobertson { ptr: x })
}
// identifier: cv_createNormHistogramCostExtractor_int_flag_int_nDummies_float_defaultCost
///
/// ## C++ default parameters:
/// * flag: DIST_L2
/// * n_dummies: 25
/// * default_cost: 0.2f
pub fn create_norm_histogram_cost_extractor(flag: i32, n_dummies: i32, default_cost: f32) -> Result<types::PtrOfHistogramCostExtractor> {
unsafe { sys::cv_core_cv_createNormHistogramCostExtractor_int_flag_int_nDummies_float_defaultCost(flag, n_dummies, default_cost) }.into_result().map(|x| types::PtrOfHistogramCostExtractor { ptr: x })
}
// identifier: cv_createOptFlow_DualTVL1
/// Creates instance of cv::DenseOpticalFlow
pub fn create_opt_flow__dual_tvl1() -> Result<types::PtrOfDualTVL1OpticalFlow> {
unsafe { sys::cv_core_cv_createOptFlow_DualTVL1() }.into_result().map(|x| types::PtrOfDualTVL1OpticalFlow { ptr: x })
}
// identifier: cv_createStitcherScans_bool_try_use_gpu
///
/// ## C++ default parameters:
/// * try_use_gpu: false
pub fn create_stitcher_scans(try_use_gpu: bool) -> Result<types::PtrOfStitcher> {
unsafe { sys::cv_core_cv_createStitcherScans_bool_try_use_gpu(try_use_gpu) }.into_result().map(|x| types::PtrOfStitcher { ptr: x })
}
// identifier: cv_createStitcher_bool_try_use_gpu
///
/// ## C++ default parameters:
/// * try_use_gpu: false
pub fn create_stitcher(try_use_gpu: bool) -> Result<types::PtrOfStitcher> {
unsafe { sys::cv_core_cv_createStitcher_bool_try_use_gpu(try_use_gpu) }.into_result().map(|x| types::PtrOfStitcher { ptr: x })
}
// identifier: cv_createThinPlateSplineShapeTransformer_double_regularizationParameter
/// Complete constructor
///
/// ## C++ default parameters:
/// * regularization_parameter: 0
pub fn create_thin_plate_spline_shape_transformer(regularization_parameter: f64) -> Result<types::PtrOfThinPlateSplineShapeTransformer> {
unsafe { sys::cv_core_cv_createThinPlateSplineShapeTransformer_double_regularizationParameter(regularization_parameter) }.into_result().map(|x| types::PtrOfThinPlateSplineShapeTransformer { ptr: x })
}
// identifier: cv_createTonemapDrago_float_gamma_float_saturation_float_bias
/// Creates TonemapDrago object
///
/// ## Parameters
/// * gamma: gamma value for gamma correction. See createTonemap
/// * saturation: positive saturation enhancement value. 1.0 preserves saturation, values greater
/// than 1 increase saturation and values less than 1 decrease it.
/// * bias: value for bias function in [0, 1] range. Values from 0.7 to 0.9 usually give best
/// results, default value is 0.85.
///
/// ## C++ default parameters:
/// * gamma: 1.0f
/// * saturation: 1.0f
/// * bias: 0.85f
pub fn create_tonemap_drago(gamma: f32, saturation: f32, bias: f32) -> Result<types::PtrOfTonemapDrago> {
unsafe { sys::cv_core_cv_createTonemapDrago_float_gamma_float_saturation_float_bias(gamma, saturation, bias) }.into_result().map(|x| types::PtrOfTonemapDrago { ptr: x })
}
// identifier: cv_createTonemapMantiuk_float_gamma_float_scale_float_saturation
/// Creates TonemapMantiuk object
///
/// ## Parameters
/// * gamma: gamma value for gamma correction. See createTonemap
/// * scale: contrast scale factor. HVS response is multiplied by this parameter, thus compressing
/// dynamic range. Values from 0.6 to 0.9 produce best results.
/// * saturation: saturation enhancement value. See createTonemapDrago
///
/// ## C++ default parameters:
/// * gamma: 1.0f
/// * scale: 0.7f
/// * saturation: 1.0f
pub fn create_tonemap_mantiuk(gamma: f32, scale: f32, saturation: f32) -> Result<types::PtrOfTonemapMantiuk> {
unsafe { sys::cv_core_cv_createTonemapMantiuk_float_gamma_float_scale_float_saturation(gamma, scale, saturation) }.into_result().map(|x| types::PtrOfTonemapMantiuk { ptr: x })
}
// identifier: cv_createTonemapReinhard_float_gamma_float_intensity_float_light_adapt_float_color_adapt
/// Creates TonemapReinhard object
///
/// ## Parameters
/// * gamma: gamma value for gamma correction. See createTonemap
/// * intensity: result intensity in [-8, 8] range. Greater intensity produces brighter results.
/// * light_adapt: light adaptation in [0, 1] range. If 1 adaptation is based only on pixel
/// value, if 0 it's global, otherwise it's a weighted mean of this two cases.
/// * color_adapt: chromatic adaptation in [0, 1] range. If 1 channels are treated independently,
/// if 0 adaptation level is the same for each channel.
///
/// ## C++ default parameters:
/// * gamma: 1.0f
/// * intensity: 0.0f
/// * light_adapt: 1.0f
/// * color_adapt: 0.0f
pub fn create_tonemap_reinhard(gamma: f32, intensity: f32, light_adapt: f32, color_adapt: f32) -> Result<types::PtrOfTonemapReinhard> {
unsafe { sys::cv_core_cv_createTonemapReinhard_float_gamma_float_intensity_float_light_adapt_float_color_adapt(gamma, intensity, light_adapt, color_adapt) }.into_result().map(|x| types::PtrOfTonemapReinhard { ptr: x })
}
// identifier: cv_createTonemap_float_gamma
/// Creates simple linear mapper with gamma correction
///
/// ## Parameters
/// * gamma: positive value for gamma correction. Gamma value of 1.0 implies no correction, gamma
/// equal to 2.2f is suitable for most displays.
/// Generally gamma \> 1 brightens the image and gamma \< 1 darkens it.
///
/// ## C++ default parameters:
/// * gamma: 1.0f
pub fn create_tonemap(gamma: f32) -> Result<types::PtrOfTonemap> {
unsafe { sys::cv_core_cv_createTonemap_float_gamma(gamma) }.into_result().map(|x| types::PtrOfTonemap { ptr: x })
}
// identifier: cv_createTrackbar_String_trackbarname_String_winname_int_X_value_int_count_TrackbarCallback_onChange_void_X_userdata
/// Creates a trackbar and attaches it to the specified window.
///
/// The function createTrackbar creates a trackbar (a slider or range control) with the specified name
/// and range, assigns a variable value to be a position synchronized with the trackbar and specifies
/// the callback function onChange to be called on the trackbar position change. The created trackbar is
/// displayed in the specified window winname.
///
///
/// Note:
///
/// [__Qt Backend Only__] winname can be empty (or NULL) if the trackbar should be attached to the
/// control panel.
///
/// Clicking the label of each trackbar enables editing the trackbar values manually.
///
/// ## Parameters
/// * trackbarname: Name of the created trackbar.
/// * winname: Name of the window that will be used as a parent of the created trackbar.
/// * value: Optional pointer to an integer variable whose value reflects the position of the
/// slider. Upon creation, the slider position is defined by this variable.
/// * count: Maximal position of the slider. The minimal position is always 0.
/// * onChange: Pointer to the function to be called every time the slider changes position. This
/// function should be prototyped as void Foo(int,void\*); , where the first parameter is the trackbar
/// position and the second parameter is the user data (see the next parameter). If the callback is
/// the NULL pointer, no callbacks are called, but only value is updated.
/// * userdata: User data that is passed as is to the callback. It can be used to handle trackbar
/// events without using global variables.
///
/// ## C++ default parameters:
/// * on_change: 0
/// * userdata: 0
pub fn create_trackbar(trackbarname: &str, winname: &str, value: &mut i32, count: i32, on_change: Option<Box<core::TrackbarCallback>>) -> Result<i32> {
string_arg!(trackbarname);
string_arg!(winname);
callback_arg!(on_change(pos: i32, userdata: *mut c_void) via userdata => (pos: i32));
unsafe { sys::cv_core_cv_createTrackbar_String_trackbarname_String_winname_int_X_value_int_count_TrackbarCallback_onChange_void_X_userdata(trackbarname.as_ptr(), winname.as_ptr(), value, count, on_change, userdata) }.into_result()
}
// identifier: cv_cubeRoot_float_val
/// Computes the cube root of an argument.
///
/// The function cubeRoot computes <span lang='latex'>\sqrt[3]{\texttt{val}}</span>. Negative arguments are handled correctly.
/// NaN and Inf are not handled. The accuracy approaches the maximum possible accuracy for
/// single-precision data.
/// ## Parameters
/// * val: A function argument.
pub fn cube_root(val: f32) -> Result<f32> {
unsafe { sys::cv_core_cv_cubeRoot_float_val(val) }.into_result()
}
// identifier: cv_cv_abs_schar_x
pub fn cv_abs(x: i8) -> Result<i32> {
unsafe { sys::cv_core_cv_cv_abs_schar_x(x) }.into_result()
}
// identifier: cv_cv_abs_ushort_x
pub fn cv_abs_1(x: u16) -> Result<i32> {
unsafe { sys::cv_core_cv_cv_abs_ushort_x(x) }.into_result()
}
// identifier: cv_cvtColorTwoPlane_Mat_src1_Mat_src2_Mat_dst_int_code
/// Converts an image from one color space to another where the source image is
/// stored in two planes.
///
/// This function only supports YUV420 to RGB conversion as of now.
///
/// ## Parameters
/// * src1:: 8-bit image (#CV_8U) of the Y plane.
/// * src2:: image containing interleaved U/V plane.
/// * dst:: output image.
/// * code:: Specifies the type of conversion. It can take any of the following values:
/// - #COLOR_YUV2BGR_NV12
/// - #COLOR_YUV2RGB_NV12
/// - #COLOR_YUV2BGRA_NV12
/// - #COLOR_YUV2RGBA_NV12
/// - #COLOR_YUV2BGR_NV21
/// - #COLOR_YUV2RGB_NV21
/// - #COLOR_YUV2BGRA_NV21
/// - #COLOR_YUV2RGBA_NV21
pub fn cvt_color_two_plane(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat, code: i32) -> Result<()> {
unsafe { sys::cv_core_cv_cvtColorTwoPlane_Mat_src1_Mat_src2_Mat_dst_int_code(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), code) }.into_result()
}
// identifier: cv_cvtColor_Mat_src_Mat_dst_int_code_int_dstCn
/// Converts an image from one color space to another.
///
/// The function converts an input image from one color space to another. In case of a transformation
/// to-from RGB color space, the order of the channels should be specified explicitly (RGB or BGR). Note
/// that the default color format in OpenCV is often referred to as RGB but it is actually BGR (the
/// bytes are reversed). So the first byte in a standard (24-bit) color image will be an 8-bit Blue
/// component, the second byte will be Green, and the third byte will be Red. The fourth, fifth, and
/// sixth bytes would then be the second pixel (Blue, then Green, then Red), and so on.
///
/// The conventional ranges for R, G, and B channel values are:
/// * 0 to 255 for CV_8U images
/// * 0 to 65535 for CV_16U images
/// * 0 to 1 for CV_32F images
///
/// In case of linear transformations, the range does not matter. But in case of a non-linear
/// transformation, an input RGB image should be normalized to the proper value range to get the correct
/// results, for example, for RGB <span lang='latex'>\rightarrow</span> L\*u\*v\* transformation. For example, if you have a
/// 32-bit floating-point image directly converted from an 8-bit image without any scaling, then it will
/// have the 0..255 value range instead of 0..1 assumed by the function. So, before calling #cvtColor ,
/// you need first to scale the image down:
/// ```ignore
/// img *= 1./255;
/// cvtColor(img, img, COLOR_BGR2Luv);
/// ```
///
/// If you use #cvtColor with 8-bit images, the conversion will have some information lost. For many
/// applications, this will not be noticeable but it is recommended to use 32-bit images in applications
/// that need the full range of colors or that convert an image before an operation and then convert
/// back.
///
/// If conversion adds the alpha channel, its value will set to the maximum of corresponding channel
/// range: 255 for CV_8U, 65535 for CV_16U, 1 for CV_32F.
///
/// ## Parameters
/// * src: input image: 8-bit unsigned, 16-bit unsigned ( CV_16UC... ), or single-precision
/// floating-point.
/// * dst: output image of the same size and depth as src.
/// * code: color space conversion code (see #ColorConversionCodes).
/// * dstCn: number of channels in the destination image; if the parameter is 0, the number of the
/// channels is derived automatically from src and code.
///
/// @see @ref imgproc_color_conversions
///
/// ## C++ default parameters:
/// * dst_cn: 0
pub fn cvt_color(src: &core::Mat, dst: &mut core::Mat, code: i32, dst_cn: i32) -> Result<()> {
unsafe { sys::cv_core_cv_cvtColor_Mat_src_Mat_dst_int_code_int_dstCn(src.as_raw_Mat(), dst.as_raw_Mat(), code, dst_cn) }.into_result()
}
// identifier: cv_dct_Mat_src_Mat_dst_int_flags
/// Performs a forward or inverse discrete Cosine transform of 1D or 2D array.
///
/// The function cv::dct performs a forward or inverse discrete Cosine transform (DCT) of a 1D or 2D
/// floating-point array:
/// * Forward Cosine transform of a 1D vector of N elements:
/// <div lang='latex'>Y = C^{(N)} \cdot X</div>
/// where
/// <div lang='latex'>C^{(N)}_{jk}= \sqrt{\alpha_j/N} \cos \left ( \frac{\pi(2k+1)j}{2N} \right )</div>
/// and
/// <span lang='latex'>\alpha_0=1</span>, <span lang='latex'>\alpha_j=2</span> for *j \> 0*.
/// * Inverse Cosine transform of a 1D vector of N elements:
/// <div lang='latex'>X = \left (C^{(N)} \right )^{-1} \cdot Y = \left (C^{(N)} \right )^T \cdot Y</div>
/// (since <span lang='latex'>C^{(N)}</span> is an orthogonal matrix, <span lang='latex'>C^{(N)} \cdot \left(C^{(N)}\right)^T = I</span> )
/// * Forward 2D Cosine transform of M x N matrix:
/// <div lang='latex'>Y = C^{(N)} \cdot X \cdot \left (C^{(N)} \right )^T</div>
/// * Inverse 2D Cosine transform of M x N matrix:
/// <div lang='latex'>X = \left (C^{(N)} \right )^T \cdot X \cdot C^{(N)}</div>
///
/// The function chooses the mode of operation by looking at the flags and size of the input array:
/// * If (flags & #DCT_INVERSE) == 0 , the function does a forward 1D or 2D transform. Otherwise, it
/// is an inverse 1D or 2D transform.
/// * If (flags & #DCT_ROWS) != 0 , the function performs a 1D transform of each row.
/// * If the array is a single column or a single row, the function performs a 1D transform.
/// * If none of the above is true, the function performs a 2D transform.
///
///
/// Note: Currently dct supports even-size arrays (2, 4, 6 ...). For data analysis and approximation, you
/// can pad the array when necessary.
/// Also, the function performance depends very much, and not monotonically, on the array size (see
/// getOptimalDFTSize ). In the current implementation DCT of a vector of size N is calculated via DFT
/// of a vector of size N/2 . Thus, the optimal DCT size N1 \>= N can be calculated as:
/// ```ignore
/// size_t getOptimalDCTSize(size_t N) { return 2*getOptimalDFTSize((N+1)/2); }
/// N1 = getOptimalDCTSize(N);
/// ```
///
/// ## Parameters
/// * src: input floating-point array.
/// * dst: output array of the same size and type as src .
/// * flags: transformation flags as a combination of cv::DftFlags (DCT_*)
/// @sa dft , getOptimalDFTSize , idct
///
/// ## C++ default parameters:
/// * flags: 0
pub fn dct(src: &core::Mat, dst: &mut core::Mat, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_dct_Mat_src_Mat_dst_int_flags(src.as_raw_Mat(), dst.as_raw_Mat(), flags) }.into_result()
}
// identifier: cv_decolor_Mat_src_Mat_grayscale_Mat_color_boost
/// Transforms a color image to a grayscale image. It is a basic tool in digital printing, stylized
/// black-and-white photograph rendering, and in many single channel image processing applications
/// @cite CL12 .
///
/// ## Parameters
/// * src: Input 8-bit 3-channel image.
/// * grayscale: Output 8-bit 1-channel image.
/// * color_boost: Output 8-bit 3-channel image.
///
/// This function is to be applied on color images.
pub fn decolor(src: &core::Mat, grayscale: &mut core::Mat, color_boost: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_decolor_Mat_src_Mat_grayscale_Mat_color_boost(src.as_raw_Mat(), grayscale.as_raw_Mat(), color_boost.as_raw_Mat()) }.into_result()
}
// identifier: cv_decomposeEssentialMat_Mat_E_Mat_R1_Mat_R2_Mat_t
/// Decompose an essential matrix to possible rotations and translation.
///
/// ## Parameters
/// * E: The input essential matrix.
/// * R1: One possible rotation matrix.
/// * R2: Another possible rotation matrix.
/// * t: One possible translation.
///
/// This function decompose an essential matrix E using svd decomposition @cite HartleyZ00 . Generally 4
/// possible poses exists for a given E. They are <span lang='latex'>[R_1, t]</span>, <span lang='latex'>[R_1, -t]</span>, <span lang='latex'>[R_2, t]</span>, <span lang='latex'>[R_2, -t]</span>. By
/// decomposing E, you can only get the direction of the translation, so the function returns unit t.
pub fn decompose_essential_mat(e: &core::Mat, r1: &mut core::Mat, r2: &mut core::Mat, t: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_decomposeEssentialMat_Mat_E_Mat_R1_Mat_R2_Mat_t(e.as_raw_Mat(), r1.as_raw_Mat(), r2.as_raw_Mat(), t.as_raw_Mat()) }.into_result()
}
// identifier: cv_decomposeHomographyMat_Mat_H_Mat_K_VectorOfMat_rotations_VectorOfMat_translations_VectorOfMat_normals
/// Decompose a homography matrix to rotation(s), translation(s) and plane normal(s).
///
/// ## Parameters
/// * H: The input homography matrix between two images.
/// * K: The input intrinsic camera calibration matrix.
/// * rotations: Array of rotation matrices.
/// * translations: Array of translation matrices.
/// * normals: Array of plane normal matrices.
///
/// This function extracts relative camera motion between two views observing a planar object from the
/// homography H induced by the plane. The intrinsic camera matrix K must also be provided. The function
/// may return up to four mathematical solution sets. At least two of the solutions may further be
/// invalidated if point correspondences are available by applying positive depth constraint (all points
/// must be in front of the camera). The decomposition method is described in detail in @cite Malis .
pub fn decompose_homography_mat(h: &core::Mat, k: &core::Mat, rotations: &mut types::VectorOfMat, translations: &mut types::VectorOfMat, normals: &mut types::VectorOfMat) -> Result<i32> {
unsafe { sys::cv_core_cv_decomposeHomographyMat_Mat_H_Mat_K_VectorOfMat_rotations_VectorOfMat_translations_VectorOfMat_normals(h.as_raw_Mat(), k.as_raw_Mat(), rotations.as_raw_VectorOfMat(), translations.as_raw_VectorOfMat(), normals.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_decomposeProjectionMatrix_Mat_projMatrix_Mat_cameraMatrix_Mat_rotMatrix_Mat_transVect_Mat_rotMatrixX_Mat_rotMatrixY_Mat_rotMatrixZ_Mat_eulerAngles
/// Decomposes a projection matrix into a rotation matrix and a camera matrix.
///
/// ## Parameters
/// * projMatrix: 3x4 input projection matrix P.
/// * cameraMatrix: Output 3x3 camera matrix K.
/// * rotMatrix: Output 3x3 external rotation matrix R.
/// * transVect: Output 4x1 translation vector T.
/// * rotMatrixX: Optional 3x3 rotation matrix around x-axis.
/// * rotMatrixY: Optional 3x3 rotation matrix around y-axis.
/// * rotMatrixZ: Optional 3x3 rotation matrix around z-axis.
/// * eulerAngles: Optional three-element vector containing three Euler angles of rotation in
/// degrees.
///
/// The function computes a decomposition of a projection matrix into a calibration and a rotation
/// matrix and the position of a camera.
///
/// It optionally returns three rotation matrices, one for each axis, and three Euler angles that could
/// be used in OpenGL. Note, there is always more than one sequence of rotations about the three
/// principal axes that results in the same orientation of an object, e.g. see @cite Slabaugh . Returned
/// tree rotation matrices and corresponding three Euler angles are only one of the possible solutions.
///
/// The function is based on RQDecomp3x3 .
///
/// ## C++ default parameters:
/// * rot_matrix_x: noArray()
/// * rot_matrix_y: noArray()
/// * rot_matrix_z: noArray()
/// * euler_angles: noArray()
pub fn decompose_projection_matrix(proj_matrix: &core::Mat, camera_matrix: &mut core::Mat, rot_matrix: &mut core::Mat, trans_vect: &mut core::Mat, rot_matrix_x: &mut core::Mat, rot_matrix_y: &mut core::Mat, rot_matrix_z: &mut core::Mat, euler_angles: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_decomposeProjectionMatrix_Mat_projMatrix_Mat_cameraMatrix_Mat_rotMatrix_Mat_transVect_Mat_rotMatrixX_Mat_rotMatrixY_Mat_rotMatrixZ_Mat_eulerAngles(proj_matrix.as_raw_Mat(), camera_matrix.as_raw_Mat(), rot_matrix.as_raw_Mat(), trans_vect.as_raw_Mat(), rot_matrix_x.as_raw_Mat(), rot_matrix_y.as_raw_Mat(), rot_matrix_z.as_raw_Mat(), euler_angles.as_raw_Mat()) }.into_result()
}
// identifier: cv_demosaicing_Mat_src_Mat_dst_int_code_int_dstCn
/// main function for all demosaicing processes
///
/// ## Parameters
/// * src: input image: 8-bit unsigned or 16-bit unsigned.
/// * dst: output image of the same size and depth as src.
/// * code: Color space conversion code (see the description below).
/// * dstCn: number of channels in the destination image; if the parameter is 0, the number of the
/// channels is derived automatically from src and code.
///
/// The function can do the following transformations:
///
/// * Demosaicing using bilinear interpolation
///
/// #COLOR_BayerBG2BGR , #COLOR_BayerGB2BGR , #COLOR_BayerRG2BGR , #COLOR_BayerGR2BGR
///
/// #COLOR_BayerBG2GRAY , #COLOR_BayerGB2GRAY , #COLOR_BayerRG2GRAY , #COLOR_BayerGR2GRAY
///
/// * Demosaicing using Variable Number of Gradients.
///
/// #COLOR_BayerBG2BGR_VNG , #COLOR_BayerGB2BGR_VNG , #COLOR_BayerRG2BGR_VNG , #COLOR_BayerGR2BGR_VNG
///
/// * Edge-Aware Demosaicing.
///
/// #COLOR_BayerBG2BGR_EA , #COLOR_BayerGB2BGR_EA , #COLOR_BayerRG2BGR_EA , #COLOR_BayerGR2BGR_EA
///
/// * Demosaicing with alpha channel
///
/// #COLOR_BayerBG2BGRA , #COLOR_BayerGB2BGRA , #COLOR_BayerRG2BGRA , #COLOR_BayerGR2BGRA
///
/// @sa cvtColor
///
/// ## C++ default parameters:
/// * dst_cn: 0
pub fn demosaicing(src: &core::Mat, dst: &mut core::Mat, code: i32, dst_cn: i32) -> Result<()> {
unsafe { sys::cv_core_cv_demosaicing_Mat_src_Mat_dst_int_code_int_dstCn(src.as_raw_Mat(), dst.as_raw_Mat(), code, dst_cn) }.into_result()
}
// identifier: cv_denoise_TVL1_VectorOfMat_observations_Mat_result_double_lambda_int_niters
/// Primal-dual algorithm is an algorithm for solving special types of variational problems (that is,
/// finding a function to minimize some functional). As the image denoising, in particular, may be seen
/// as the variational problem, primal-dual algorithm then can be used to perform denoising and this is
/// exactly what is implemented.
///
/// It should be noted, that this implementation was taken from the July 2013 blog entry
/// @cite MA13 , which also contained (slightly more general) ready-to-use source code on Python.
/// Subsequently, that code was rewritten on C++ with the usage of openCV by Vadim Pisarevsky at the end
/// of July 2013 and finally it was slightly adapted by later authors.
///
/// Although the thorough discussion and justification of the algorithm involved may be found in
/// @cite ChambolleEtAl, it might make sense to skim over it here, following @cite MA13 . To begin
/// with, we consider the 1-byte gray-level images as the functions from the rectangular domain of
/// pixels (it may be seen as set
/// <span lang='latex'>\left\{(x,y)\in\mathbb{N}\times\mathbb{N}\mid 1\leq x\leq n,\;1\leq y\leq m\right\}</span> for some
/// <span lang='latex'>m,\;n\in\mathbb{N}</span>) into <span lang='latex'>\{0,1,\dots,255\}</span>. We shall denote the noised images as <span lang='latex'>f_i</span> and with
/// this view, given some image <span lang='latex'>x</span> of the same size, we may measure how bad it is by the formula
///
/// <div lang='latex'>\left\|\left\|\nabla x\right\|\right\| + \lambda\sum_i\left\|\left\|x-f_i\right\|\right\|</div>
///
/// <span lang='latex'>\|\|\cdot\|\|</span> here denotes <span lang='latex'>L_2</span>-norm and as you see, the first addend states that we want our
/// image to be smooth (ideally, having zero gradient, thus being constant) and the second states that
/// we want our result to be close to the observations we've got. If we treat <span lang='latex'>x</span> as a function, this is
/// exactly the functional what we seek to minimize and here the Primal-Dual algorithm comes into play.
///
/// ## Parameters
/// * observations: This array should contain one or more noised versions of the image that is to
/// be restored.
/// * result: Here the denoised image will be stored. There is no need to do pre-allocation of
/// storage space, as it will be automatically allocated, if necessary.
/// * lambda: Corresponds to <span lang='latex'>\lambda</span> in the formulas above. As it is enlarged, the smooth
/// (blurred) images are treated more favorably than detailed (but maybe more noised) ones. Roughly
/// speaking, as it becomes smaller, the result will be more blur but more sever outliers will be
/// removed.
/// * niters: Number of iterations that the algorithm will run. Of course, as more iterations as
/// better, but it is hard to quantitatively refine this statement, so just use the default and
/// increase it if the results are poor.
///
/// ## C++ default parameters:
/// * lambda: 1.0
/// * niters: 30
pub fn denoise_tvl1(observations: &types::VectorOfMat, result: &core::Mat, lambda: f64, niters: i32) -> Result<()> {
unsafe { sys::cv_core_cv_denoise_TVL1_VectorOfMat_observations_Mat_result_double_lambda_int_niters(observations.as_raw_VectorOfMat(), result.as_raw_Mat(), lambda, niters) }.into_result()
}
// identifier: cv_destroyAllWindows
/// Destroys all of the HighGUI windows.
///
/// The function destroyAllWindows destroys all of the opened HighGUI windows.
pub fn destroy_all_windows() -> Result<()> {
unsafe { sys::cv_core_cv_destroyAllWindows() }.into_result()
}
// identifier: cv_destroyWindow_String_winname
/// Destroys the specified window.
///
/// The function destroyWindow destroys the window with the given name.
///
/// ## Parameters
/// * winname: Name of the window to be destroyed.
pub fn destroy_window(winname: &str) -> Result<()> {
string_arg!(winname);
unsafe { sys::cv_core_cv_destroyWindow_String_winname(winname.as_ptr()) }.into_result()
}
// identifier: cv_detailEnhance_Mat_src_Mat_dst_float_sigma_s_float_sigma_r
/// This filter enhances the details of a particular image.
///
/// ## Parameters
/// * src: Input 8-bit 3-channel image.
/// * dst: Output image with the same size and type as src.
/// * sigma_s: Range between 0 to 200.
/// * sigma_r: Range between 0 to 1.
///
/// ## C++ default parameters:
/// * sigma_s: 10
/// * sigma_r: 0.15f
pub fn detail_enhance(src: &core::Mat, dst: &mut core::Mat, sigma_s: f32, sigma_r: f32) -> Result<()> {
unsafe { sys::cv_core_cv_detailEnhance_Mat_src_Mat_dst_float_sigma_s_float_sigma_r(src.as_raw_Mat(), dst.as_raw_Mat(), sigma_s, sigma_r) }.into_result()
}
// identifier: cv_detectQRCode_Mat_in_VectorOfPoint_points_double_eps_x_double_eps_y
/// Detect QR code in image and return minimum area of quadrangle that describes QR code.
/// ## Parameters
/// * in: Matrix of the type CV_8UC1 containing an image where QR code are detected.
/// * points: Output vector of vertices of a quadrangle of minimal area that describes QR code.
/// * eps_x: Epsilon neighborhood, which allows you to determine the horizontal pattern of the scheme 1:1:3:1:1 according to QR code standard.
/// * eps_y: Epsilon neighborhood, which allows you to determine the vertical pattern of the scheme 1:1:3:1:1 according to QR code standard.
///
/// ## C++ default parameters:
/// * eps_x: 0.2
/// * eps_y: 0.1
pub fn detect_qr_code(_in: &core::Mat, points: &types::VectorOfPoint, eps_x: f64, eps_y: f64) -> Result<bool> {
unsafe { sys::cv_core_cv_detectQRCode_Mat_in_VectorOfPoint_points_double_eps_x_double_eps_y(_in.as_raw_Mat(), points.as_raw_VectorOfPoint(), eps_x, eps_y) }.into_result()
}
// identifier: cv_determinant_Mat_mtx
/// Returns the determinant of a square floating-point matrix.
///
/// The function cv::determinant calculates and returns the determinant of the
/// specified matrix. For small matrices ( mtx.cols=mtx.rows\<=3 ), the
/// direct method is used. For larger matrices, the function uses LU
/// factorization with partial pivoting.
///
/// For symmetric positively-determined matrices, it is also possible to use
/// eigen decomposition to calculate the determinant.
/// ## Parameters
/// * mtx: input matrix that must have CV_32FC1 or CV_64FC1 type and
/// square size.
/// @sa trace, invert, solve, eigen, @ref MatrixExpressions
pub fn determinant(mtx: &core::Mat) -> Result<f64> {
unsafe { sys::cv_core_cv_determinant_Mat_mtx(mtx.as_raw_Mat()) }.into_result()
}
// identifier: cv_dft_Mat_src_Mat_dst_int_flags_int_nonzeroRows
/// Performs a forward or inverse Discrete Fourier transform of a 1D or 2D floating-point array.
///
/// The function cv::dft performs one of the following:
/// * Forward the Fourier transform of a 1D vector of N elements:
/// <div lang='latex'>Y = F^{(N)} \cdot X,</div>
/// where <span lang='latex'>F^{(N)}_{jk}=\exp(-2\pi i j k/N)</span> and <span lang='latex'>i=\sqrt{-1}</span>
/// * Inverse the Fourier transform of a 1D vector of N elements:
/// <div lang='latex'>\begin{array}{l} X'= \left (F^{(N)} \right )^{-1} \cdot Y = \left (F^{(N)} \right )^* \cdot y \\ X = (1/N) \cdot X, \end{array}</div>
/// where <span lang='latex'>F^*=\left(\textrm{Re}(F^{(N)})-\textrm{Im}(F^{(N)})\right)^T</span>
/// * Forward the 2D Fourier transform of a M x N matrix:
/// <div lang='latex'>Y = F^{(M)} \cdot X \cdot F^{(N)}</div>
/// * Inverse the 2D Fourier transform of a M x N matrix:
/// <div lang='latex'>\begin{array}{l} X'= \left (F^{(M)} \right )^* \cdot Y \cdot \left (F^{(N)} \right )^* \\ X = \frac{1}{M \cdot N} \cdot X' \end{array}</div>
///
/// In case of real (single-channel) data, the output spectrum of the forward Fourier transform or input
/// spectrum of the inverse Fourier transform can be represented in a packed format called *CCS*
/// (complex-conjugate-symmetrical). It was borrowed from IPL (Intel\* Image Processing Library). Here
/// is how 2D *CCS* spectrum looks:
/// <div lang='latex'>\begin{bmatrix} Re Y_{0,0} & Re Y_{0,1} & Im Y_{0,1} & Re Y_{0,2} & Im Y_{0,2} & \cdots & Re Y_{0,N/2-1} & Im Y_{0,N/2-1} & Re Y_{0,N/2} \\ Re Y_{1,0} & Re Y_{1,1} & Im Y_{1,1} & Re Y_{1,2} & Im Y_{1,2} & \cdots & Re Y_{1,N/2-1} & Im Y_{1,N/2-1} & Re Y_{1,N/2} \\ Im Y_{1,0} & Re Y_{2,1} & Im Y_{2,1} & Re Y_{2,2} & Im Y_{2,2} & \cdots & Re Y_{2,N/2-1} & Im Y_{2,N/2-1} & Im Y_{1,N/2} \\ \hdotsfor{9} \\ Re Y_{M/2-1,0} & Re Y_{M-3,1} & Im Y_{M-3,1} & \hdotsfor{3} & Re Y_{M-3,N/2-1} & Im Y_{M-3,N/2-1}& Re Y_{M/2-1,N/2} \\ Im Y_{M/2-1,0} & Re Y_{M-2,1} & Im Y_{M-2,1} & \hdotsfor{3} & Re Y_{M-2,N/2-1} & Im Y_{M-2,N/2-1}& Im Y_{M/2-1,N/2} \\ Re Y_{M/2,0} & Re Y_{M-1,1} & Im Y_{M-1,1} & \hdotsfor{3} & Re Y_{M-1,N/2-1} & Im Y_{M-1,N/2-1}& Re Y_{M/2,N/2} \end{bmatrix}</div>
///
/// In case of 1D transform of a real vector, the output looks like the first row of the matrix above.
///
/// So, the function chooses an operation mode depending on the flags and size of the input array:
/// * If #DFT_ROWS is set or the input array has a single row or single column, the function
/// performs a 1D forward or inverse transform of each row of a matrix when #DFT_ROWS is set.
/// Otherwise, it performs a 2D transform.
/// * If the input array is real and #DFT_INVERSE is not set, the function performs a forward 1D or
/// 2D transform:
/// * When #DFT_COMPLEX_OUTPUT is set, the output is a complex matrix of the same size as
/// input.
/// * When #DFT_COMPLEX_OUTPUT is not set, the output is a real matrix of the same size as
/// input. In case of 2D transform, it uses the packed format as shown above. In case of a
/// single 1D transform, it looks like the first row of the matrix above. In case of
/// multiple 1D transforms (when using the #DFT_ROWS flag), each row of the output matrix
/// looks like the first row of the matrix above.
/// * If the input array is complex and either #DFT_INVERSE or #DFT_REAL_OUTPUT are not set, the
/// output is a complex array of the same size as input. The function performs a forward or
/// inverse 1D or 2D transform of the whole input array or each row of the input array
/// independently, depending on the flags DFT_INVERSE and DFT_ROWS.
/// * When #DFT_INVERSE is set and the input array is real, or it is complex but #DFT_REAL_OUTPUT
/// is set, the output is a real array of the same size as input. The function performs a 1D or 2D
/// inverse transformation of the whole input array or each individual row, depending on the flags
/// #DFT_INVERSE and #DFT_ROWS.
///
/// If #DFT_SCALE is set, the scaling is done after the transformation.
///
/// Unlike dct , the function supports arrays of arbitrary size. But only those arrays are processed
/// efficiently, whose sizes can be factorized in a product of small prime numbers (2, 3, and 5 in the
/// current implementation). Such an efficient DFT size can be calculated using the getOptimalDFTSize
/// method.
///
/// The sample below illustrates how to calculate a DFT-based convolution of two 2D real arrays:
/// ```ignore
/// void convolveDFT(InputArray A, InputArray B, OutputArray C)
/// {
/// // reallocate the output array if needed
/// C.create(abs(A.rows - B.rows)+1, abs(A.cols - B.cols)+1, A.type());
/// Size dftSize;
/// // calculate the size of DFT transform
/// dftSize.width = getOptimalDFTSize(A.cols + B.cols - 1);
/// dftSize.height = getOptimalDFTSize(A.rows + B.rows - 1);
///
/// // allocate temporary buffers and initialize them with 0's
/// Mat tempA(dftSize, A.type(), Scalar::all(0));
/// Mat tempB(dftSize, B.type(), Scalar::all(0));
///
/// // copy A and B to the top-left corners of tempA and tempB, respectively
/// Mat roiA(tempA, Rect(0,0,A.cols,A.rows));
/// A.copyTo(roiA);
/// Mat roiB(tempB, Rect(0,0,B.cols,B.rows));
/// B.copyTo(roiB);
///
/// // now transform the padded A & B in-place;
/// // use "nonzeroRows" hint for faster processing
/// dft(tempA, tempA, 0, A.rows);
/// dft(tempB, tempB, 0, B.rows);
///
/// // multiply the spectrums;
/// // the function handles packed spectrum representations well
/// mulSpectrums(tempA, tempB, tempA);
///
/// // transform the product back from the frequency domain.
/// // Even though all the result rows will be non-zero,
/// // you need only the first C.rows of them, and thus you
/// // pass nonzeroRows == C.rows
/// dft(tempA, tempA, DFT_INVERSE + DFT_SCALE, C.rows);
///
/// // now copy the result back to C.
/// tempA(Rect(0, 0, C.cols, C.rows)).copyTo(C);
///
/// // all the temporary buffers will be deallocated automatically
/// }
/// ```
///
/// To optimize this sample, consider the following approaches:
/// * Since nonzeroRows != 0 is passed to the forward transform calls and since A and B are copied to
/// the top-left corners of tempA and tempB, respectively, it is not necessary to clear the whole
/// tempA and tempB. It is only necessary to clear the tempA.cols - A.cols ( tempB.cols - B.cols)
/// rightmost columns of the matrices.
/// * This DFT-based convolution does not have to be applied to the whole big arrays, especially if B
/// is significantly smaller than A or vice versa. Instead, you can calculate convolution by parts.
/// To do this, you need to split the output array C into multiple tiles. For each tile, estimate
/// which parts of A and B are required to calculate convolution in this tile. If the tiles in C are
/// too small, the speed will decrease a lot because of repeated work. In the ultimate case, when
/// each tile in C is a single pixel, the algorithm becomes equivalent to the naive convolution
/// algorithm. If the tiles are too big, the temporary arrays tempA and tempB become too big and
/// there is also a slowdown because of bad cache locality. So, there is an optimal tile size
/// somewhere in the middle.
/// * If different tiles in C can be calculated in parallel and, thus, the convolution is done by
/// parts, the loop can be threaded.
///
/// All of the above improvements have been implemented in #matchTemplate and #filter2D . Therefore, by
/// using them, you can get the performance even better than with the above theoretically optimal
/// implementation. Though, those two functions actually calculate cross-correlation, not convolution,
/// so you need to "flip" the second convolution operand B vertically and horizontally using flip .
///
/// Note:
/// * An example using the discrete fourier transform can be found at
/// opencv_source_code/samples/cpp/dft.cpp
/// * (Python) An example using the dft functionality to perform Wiener deconvolution can be found
/// at opencv_source/samples/python/deconvolution.py
/// * (Python) An example rearranging the quadrants of a Fourier image can be found at
/// opencv_source/samples/python/dft.py
/// ## Parameters
/// * src: input array that could be real or complex.
/// * dst: output array whose size and type depends on the flags .
/// * flags: transformation flags, representing a combination of the #DftFlags
/// * nonzeroRows: when the parameter is not zero, the function assumes that only the first
/// nonzeroRows rows of the input array (#DFT_INVERSE is not set) or only the first nonzeroRows of the
/// output array (#DFT_INVERSE is set) contain non-zeros, thus, the function can handle the rest of the
/// rows more efficiently and save some time; this technique is very useful for calculating array
/// cross-correlation or convolution using DFT.
/// @sa dct , getOptimalDFTSize , mulSpectrums, filter2D , matchTemplate , flip , cartToPolar ,
/// magnitude , phase
///
/// ## C++ default parameters:
/// * flags: 0
/// * nonzero_rows: 0
pub fn dft(src: &core::Mat, dst: &mut core::Mat, flags: i32, nonzero_rows: i32) -> Result<()> {
unsafe { sys::cv_core_cv_dft_Mat_src_Mat_dst_int_flags_int_nonzeroRows(src.as_raw_Mat(), dst.as_raw_Mat(), flags, nonzero_rows) }.into_result()
}
// identifier: cv_dilate_Mat_src_Mat_dst_Mat_kernel_Point_anchor_int_iterations_int_borderType_Scalar_borderValue
/// Dilates an image by using a specific structuring element.
///
/// The function dilates the source image using the specified structuring element that determines the
/// shape of a pixel neighborhood over which the maximum is taken:
/// <div lang='latex'>\texttt{dst} (x,y) = \max _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')</div>
///
/// The function supports the in-place mode. Dilation can be applied several ( iterations ) times. In
/// case of multi-channel images, each channel is processed independently.
///
/// ## Parameters
/// * src: input image; the number of channels can be arbitrary, but the depth should be one of
/// CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
/// * dst: output image of the same size and type as src.
/// * kernel: structuring element used for dilation; if elemenat=Mat(), a 3 x 3 rectangular
/// structuring element is used. Kernel can be created using #getStructuringElement
/// * anchor: position of the anchor within the element; default value (-1, -1) means that the
/// anchor is at the element center.
/// * iterations: number of times dilation is applied.
/// * borderType: pixel extrapolation method, see #BorderTypes
/// * borderValue: border value in case of a constant border
/// @sa erode, morphologyEx, getStructuringElement
///
/// ## C++ default parameters:
/// * anchor: Point(-1,-1)
/// * iterations: 1
/// * border_type: BORDER_CONSTANT
/// * border_value: morphologyDefaultBorderValue()
pub fn dilate(src: &core::Mat, dst: &mut core::Mat, kernel: &core::Mat, anchor: core::Point, iterations: i32, border_type: i32, border_value: core::Scalar) -> Result<()> {
unsafe { sys::cv_core_cv_dilate_Mat_src_Mat_dst_Mat_kernel_Point_anchor_int_iterations_int_borderType_Scalar_borderValue(src.as_raw_Mat(), dst.as_raw_Mat(), kernel.as_raw_Mat(), anchor, iterations, border_type, border_value) }.into_result()
}
// identifier: cv_directx_getTypeFromD3DFORMAT_int_iD3DFORMAT
pub fn get_type_from_d3_dformat(i_d3_dformat: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_directx_getTypeFromD3DFORMAT_int_iD3DFORMAT(i_d3_dformat) }.into_result()
}
// identifier: cv_directx_getTypeFromDXGI_FORMAT_int_iDXGI_FORMAT
pub fn get_type_from_dxgi_format(i_dxgi_format: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_directx_getTypeFromDXGI_FORMAT_int_iDXGI_FORMAT(i_dxgi_format) }.into_result()
}
// identifier: cv_displayOverlay_String_winname_String_text_int_delayms
/// Displays a text on a window image as an overlay for a specified duration.
///
/// The function displayOverlay displays useful information/tips on top of the window for a certain
/// amount of time *delayms*. The function does not modify the image, displayed in the window, that is,
/// after the specified delay the original content of the window is restored.
///
/// ## Parameters
/// * winname: Name of the window.
/// * text: Overlay text to write on a window image.
/// * delayms: The period (in milliseconds), during which the overlay text is displayed. If this
/// function is called before the previous overlay text timed out, the timer is restarted and the text
/// is updated. If this value is zero, the text never disappears.
///
/// ## C++ default parameters:
/// * delayms: 0
pub fn display_overlay(winname: &str, text: &str, delayms: i32) -> Result<()> {
string_arg!(winname);
string_arg!(text);
unsafe { sys::cv_core_cv_displayOverlay_String_winname_String_text_int_delayms(winname.as_ptr(), text.as_ptr(), delayms) }.into_result()
}
// identifier: cv_displayStatusBar_String_winname_String_text_int_delayms
/// Displays a text on the window statusbar during the specified period of time.
///
/// The function displayStatusBar displays useful information/tips on top of the window for a certain
/// amount of time *delayms* . This information is displayed on the window statusbar (the window must be
/// created with the CV_GUI_EXPANDED flags).
///
/// ## Parameters
/// * winname: Name of the window.
/// * text: Text to write on the window statusbar.
/// * delayms: Duration (in milliseconds) to display the text. If this function is called before
/// the previous text timed out, the timer is restarted and the text is updated. If this value is
/// zero, the text never disappears.
///
/// ## C++ default parameters:
/// * delayms: 0
pub fn display_status_bar(winname: &str, text: &str, delayms: i32) -> Result<()> {
string_arg!(winname);
string_arg!(text);
unsafe { sys::cv_core_cv_displayStatusBar_String_winname_String_text_int_delayms(winname.as_ptr(), text.as_ptr(), delayms) }.into_result()
}
// identifier: cv_distanceTransform_Mat_src_Mat_dst_Mat_labels_int_distanceType_int_maskSize_int_labelType
/// Calculates the distance to the closest zero pixel for each pixel of the source image.
///
/// The function cv::distanceTransform calculates the approximate or precise distance from every binary
/// image pixel to the nearest zero pixel. For zero image pixels, the distance will obviously be zero.
///
/// When maskSize == #DIST_MASK_PRECISE and distanceType == #DIST_L2 , the function runs the
/// algorithm described in @cite Felzenszwalb04 . This algorithm is parallelized with the TBB library.
///
/// In other cases, the algorithm @cite Borgefors86 is used. This means that for a pixel the function
/// finds the shortest path to the nearest zero pixel consisting of basic shifts: horizontal, vertical,
/// diagonal, or knight's move (the latest is available for a <span lang='latex'>5\times 5</span> mask). The overall
/// distance is calculated as a sum of these basic distances. Since the distance function should be
/// symmetric, all of the horizontal and vertical shifts must have the same cost (denoted as a ), all
/// the diagonal shifts must have the same cost (denoted as `b`), and all knight's moves must have the
/// same cost (denoted as `c`). For the #DIST_C and #DIST_L1 types, the distance is calculated
/// precisely, whereas for #DIST_L2 (Euclidean distance) the distance can be calculated only with a
/// relative error (a <span lang='latex'>5\times 5</span> mask gives more accurate results). For `a`,`b`, and `c`, OpenCV
/// uses the values suggested in the original paper:
/// - DIST_L1: `a = 1, b = 2`
/// - DIST_L2:
/// - `3 x 3`: `a=0.955, b=1.3693`
/// - `5 x 5`: `a=1, b=1.4, c=2.1969`
/// - DIST_C: `a = 1, b = 1`
///
/// Typically, for a fast, coarse distance estimation #DIST_L2, a <span lang='latex'>3\times 3</span> mask is used. For a
/// more accurate distance estimation #DIST_L2, a <span lang='latex'>5\times 5</span> mask or the precise algorithm is used.
/// Note that both the precise and the approximate algorithms are linear on the number of pixels.
///
/// This variant of the function does not only compute the minimum distance for each pixel <span lang='latex'>(x, y)</span>
/// but also identifies the nearest connected component consisting of zero pixels
/// (labelType==#DIST_LABEL_CCOMP) or the nearest zero pixel (labelType==#DIST_LABEL_PIXEL). Index of the
/// component/pixel is stored in `labels(x, y)`. When labelType==#DIST_LABEL_CCOMP, the function
/// automatically finds connected components of zero pixels in the input image and marks them with
/// distinct labels. When labelType==#DIST_LABEL_CCOMP, the function scans through the input image and
/// marks all the zero pixels with distinct labels.
///
/// In this mode, the complexity is still linear. That is, the function provides a very fast way to
/// compute the Voronoi diagram for a binary image. Currently, the second variant can use only the
/// approximate distance transform algorithm, i.e. maskSize=#DIST_MASK_PRECISE is not supported
/// yet.
///
/// ## Parameters
/// * src: 8-bit, single-channel (binary) source image.
/// * dst: Output image with calculated distances. It is a 8-bit or 32-bit floating-point,
/// single-channel image of the same size as src.
/// * labels: Output 2D array of labels (the discrete Voronoi diagram). It has the type
/// CV_32SC1 and the same size as src.
/// * distanceType: Type of distance, see #DistanceTypes
/// * maskSize: Size of the distance transform mask, see #DistanceTransformMasks.
/// #DIST_MASK_PRECISE is not supported by this variant. In case of the #DIST_L1 or #DIST_C distance type,
/// the parameter is forced to 3 because a <span lang='latex'>3\times 3</span> mask gives the same result as \f$5\times
/// 5\f$ or any larger aperture.
/// * labelType: Type of the label array to build, see #DistanceTransformLabelTypes.
///
/// ## C++ default parameters:
/// * label_type: DIST_LABEL_CCOMP
pub fn distance_transform_labels(src: &core::Mat, dst: &mut core::Mat, labels: &mut core::Mat, distance_type: i32, mask_size: i32, label_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_distanceTransform_Mat_src_Mat_dst_Mat_labels_int_distanceType_int_maskSize_int_labelType(src.as_raw_Mat(), dst.as_raw_Mat(), labels.as_raw_Mat(), distance_type, mask_size, label_type) }.into_result()
}
// identifier: cv_distanceTransform_Mat_src_Mat_dst_int_distanceType_int_maskSize_int_dstType
/// @overload
/// ## Parameters
/// * src: 8-bit, single-channel (binary) source image.
/// * dst: Output image with calculated distances. It is a 8-bit or 32-bit floating-point,
/// single-channel image of the same size as src .
/// * distanceType: Type of distance, see #DistanceTypes
/// * maskSize: Size of the distance transform mask, see #DistanceTransformMasks. In case of the
/// #DIST_L1 or #DIST_C distance type, the parameter is forced to 3 because a <span lang='latex'>3\times 3</span> mask gives
/// the same result as <span lang='latex'>5\times 5</span> or any larger aperture.
/// * dstType: Type of output image. It can be CV_8U or CV_32F. Type CV_8U can be used only for
/// the first variant of the function and distanceType == #DIST_L1.
///
/// ## C++ default parameters:
/// * dst_type: CV_32F
pub fn distance_transform(src: &core::Mat, dst: &mut core::Mat, distance_type: i32, mask_size: i32, dst_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_distanceTransform_Mat_src_Mat_dst_int_distanceType_int_maskSize_int_dstType(src.as_raw_Mat(), dst.as_raw_Mat(), distance_type, mask_size, dst_type) }.into_result()
}
// identifier: cv_divUp_int_a_unsigned_int_b
/// Integer division with result round up.
///
/// Use this function instead of `ceil((float)a / b)` expressions.
///
/// @sa alignSize
pub fn div_up(a: i32, b: u32) -> Result<i32> {
unsafe { sys::cv_core_cv_divUp_int_a_unsigned_int_b(a, b) }.into_result()
}
// identifier: cv_divUp_size_t_a_unsigned_int_b
/// @overload
pub fn div_up_1(a: size_t, b: u32) -> Result<size_t> {
unsafe { sys::cv_core_cv_divUp_size_t_a_unsigned_int_b(a, b) }.into_result()
}
// identifier: cv_divide_Mat_src1_Mat_src2_Mat_dst_double_scale_int_dtype
/// Performs per-element division of two arrays or a scalar by an array.
///
/// The function cv::divide divides one array by another:
/// <div lang='latex'>\texttt{dst(I) = saturate(src1(I)*scale/src2(I))}</div>
/// or a scalar by an array when there is no src1 :
/// <div lang='latex'>\texttt{dst(I) = saturate(scale/src2(I))}</div>
///
/// When src2(I) is zero, dst(I) will also be zero. Different channels of
/// multi-channel arrays are processed independently.
///
///
/// Note: Saturation is not applied when the output array has the depth CV_32S. You may even get
/// result of an incorrect sign in the case of overflow.
/// ## Parameters
/// * src1: first input array.
/// * src2: second input array of the same size and type as src1.
/// * scale: scalar factor.
/// * dst: output array of the same size and type as src2.
/// * dtype: optional depth of the output array; if -1, dst will have depth src2.depth(), but in
/// case of an array-by-array division, you can only pass -1 when src1.depth()==src2.depth().
/// @sa multiply, add, subtract
///
/// ## C++ default parameters:
/// * scale: 1
/// * dtype: -1
pub fn divide_mat(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat, scale: f64, dtype: i32) -> Result<()> {
unsafe { sys::cv_core_cv_divide_Mat_src1_Mat_src2_Mat_dst_double_scale_int_dtype(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), scale, dtype) }.into_result()
}
// identifier: cv_divide_double_scale_Mat_src2_Mat_dst_int_dtype
/// @overload
///
/// ## C++ default parameters:
/// * dtype: -1
pub fn divide(scale: f64, src2: &core::Mat, dst: &mut core::Mat, dtype: i32) -> Result<()> {
unsafe { sys::cv_core_cv_divide_double_scale_Mat_src2_Mat_dst_int_dtype(scale, src2.as_raw_Mat(), dst.as_raw_Mat(), dtype) }.into_result()
}
// identifier: cv_dnn_NMSBoxes_VectorOfRect2d_bboxes_VectorOffloat_scores_float_score_threshold_float_nms_threshold_VectorOfint_indices_float_eta_int_top_k
///
/// ## C++ default parameters:
/// * eta: 1.f
/// * top_k: 0
pub fn nms_boxes_rotated_f64(bboxes: &types::VectorOfRect2d, scores: &types::VectorOffloat, score_threshold: f32, nms_threshold: f32, indices: &types::VectorOfint, eta: f32, top_k: i32) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_NMSBoxes_VectorOfRect2d_bboxes_VectorOffloat_scores_float_score_threshold_float_nms_threshold_VectorOfint_indices_float_eta_int_top_k(bboxes.as_raw_VectorOfRect2d(), scores.as_raw_VectorOffloat(), score_threshold, nms_threshold, indices.as_raw_VectorOfint(), eta, top_k) }.into_result()
}
// identifier: cv_dnn_NMSBoxes_VectorOfRect_bboxes_VectorOffloat_scores_float_score_threshold_float_nms_threshold_VectorOfint_indices_float_eta_int_top_k
/// Performs non maximum suppression given boxes and corresponding scores.
///
/// ## Parameters
/// * bboxes: a set of bounding boxes to apply NMS.
/// * scores: a set of corresponding confidences.
/// * score_threshold: a threshold used to filter boxes by score.
/// * nms_threshold: a threshold used in non maximum suppression.
/// * indices: the kept indices of bboxes after NMS.
/// * eta: a coefficient in adaptive threshold formula: <span lang='latex'>nms\_threshold_{i+1}=eta\cdot nms\_threshold_i</span>.
/// * top_k: if `>0`, keep at most @p top_k picked indices.
///
/// ## C++ default parameters:
/// * eta: 1.f
/// * top_k: 0
pub fn nms_boxes(bboxes: &types::VectorOfRect, scores: &types::VectorOffloat, score_threshold: f32, nms_threshold: f32, indices: &types::VectorOfint, eta: f32, top_k: i32) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_NMSBoxes_VectorOfRect_bboxes_VectorOffloat_scores_float_score_threshold_float_nms_threshold_VectorOfint_indices_float_eta_int_top_k(bboxes.as_raw_VectorOfRect(), scores.as_raw_VectorOffloat(), score_threshold, nms_threshold, indices.as_raw_VectorOfint(), eta, top_k) }.into_result()
}
// identifier: cv_dnn_NMSBoxes_VectorOfRotatedRect_bboxes_VectorOffloat_scores_float_score_threshold_float_nms_threshold_VectorOfint_indices_float_eta_int_top_k
///
/// ## C++ default parameters:
/// * eta: 1.f
/// * top_k: 0
pub fn nms_boxes_rotated(bboxes: &types::VectorOfRotatedRect, scores: &types::VectorOffloat, score_threshold: f32, nms_threshold: f32, indices: &types::VectorOfint, eta: f32, top_k: i32) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_NMSBoxes_VectorOfRotatedRect_bboxes_VectorOffloat_scores_float_score_threshold_float_nms_threshold_VectorOfint_indices_float_eta_int_top_k(bboxes.as_raw_VectorOfRotatedRect(), scores.as_raw_VectorOffloat(), score_threshold, nms_threshold, indices.as_raw_VectorOfint(), eta, top_k) }.into_result()
}
// identifier: cv_dnn_blobFromImage_Mat_image_Mat_blob_double_scalefactor_Size_size_Scalar_mean_bool_swapRB_bool_crop_int_ddepth
/// Creates 4-dimensional blob from image.
/// @details This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what argument(s) it accepts.
///
/// ## C++ default parameters:
/// * scalefactor: 1.0
/// * size: Size()
/// * mean: Scalar()
/// * swap_rb: false
/// * crop: false
/// * ddepth: CV_32F
pub fn blob_from_image(image: &core::Mat, blob: &mut core::Mat, scalefactor: f64, size: core::Size, mean: core::Scalar, swap_rb: bool, crop: bool, ddepth: i32) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_blobFromImage_Mat_image_Mat_blob_double_scalefactor_Size_size_Scalar_mean_bool_swapRB_bool_crop_int_ddepth(image.as_raw_Mat(), blob.as_raw_Mat(), scalefactor, size, mean, swap_rb, crop, ddepth) }.into_result()
}
// identifier: cv_dnn_blobFromImage_Mat_image_double_scalefactor_Size_size_Scalar_mean_bool_swapRB_bool_crop_int_ddepth
/// Creates 4-dimensional blob from image. Optionally resizes and crops @p image from center,
/// subtract @p mean values, scales values by @p scalefactor, swap Blue and Red channels.
/// ## Parameters
/// * image: input image (with 1-, 3- or 4-channels).
/// * size: spatial size for output image
/// * mean: scalar with mean values which are subtracted from channels. Values are intended
/// to be in (mean-R, mean-G, mean-B) order if @p image has BGR ordering and @p swapRB is true.
/// * scalefactor: multiplier for @p image values.
/// * swapRB: flag which indicates that swap first and last channels
/// in 3-channel image is necessary.
/// * crop: flag which indicates whether image will be cropped after resize or not
/// * ddepth: Depth of output blob. Choose CV_32F or CV_8U.
/// @details if @p crop is true, input image is resized so one side after resize is equal to corresponding
/// dimension in @p size and another one is equal or larger. Then, crop from the center is performed.
/// If @p crop is false, direct resize without cropping and preserving aspect ratio is performed.
/// @returns 4-dimensional Mat with NCHW dimensions order.
///
/// ## C++ default parameters:
/// * scalefactor: 1.0
/// * size: Size()
/// * mean: Scalar()
/// * swap_rb: false
/// * crop: false
/// * ddepth: CV_32F
pub fn blob_from_image_1(image: &core::Mat, scalefactor: f64, size: core::Size, mean: core::Scalar, swap_rb: bool, crop: bool, ddepth: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_dnn_blobFromImage_Mat_image_double_scalefactor_Size_size_Scalar_mean_bool_swapRB_bool_crop_int_ddepth(image.as_raw_Mat(), scalefactor, size, mean, swap_rb, crop, ddepth) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_dnn_blobFromImages_VectorOfMat_images_Mat_blob_double_scalefactor_Size_size_Scalar_mean_bool_swapRB_bool_crop_int_ddepth
/// Creates 4-dimensional blob from series of images.
/// @details This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what argument(s) it accepts.
///
/// ## C++ default parameters:
/// * scalefactor: 1.0
/// * size: Size()
/// * mean: Scalar()
/// * swap_rb: false
/// * crop: false
/// * ddepth: CV_32F
pub fn blob_from_images(images: &types::VectorOfMat, blob: &mut core::Mat, scalefactor: f64, size: core::Size, mean: core::Scalar, swap_rb: bool, crop: bool, ddepth: i32) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_blobFromImages_VectorOfMat_images_Mat_blob_double_scalefactor_Size_size_Scalar_mean_bool_swapRB_bool_crop_int_ddepth(images.as_raw_VectorOfMat(), blob.as_raw_Mat(), scalefactor, size, mean, swap_rb, crop, ddepth) }.into_result()
}
// identifier: cv_dnn_blobFromImages_VectorOfMat_images_double_scalefactor_Size_size_Scalar_mean_bool_swapRB_bool_crop_int_ddepth
/// Creates 4-dimensional blob from series of images. Optionally resizes and
/// crops @p images from center, subtract @p mean values, scales values by @p scalefactor,
/// swap Blue and Red channels.
/// ## Parameters
/// * images: input images (all with 1-, 3- or 4-channels).
/// * size: spatial size for output image
/// * mean: scalar with mean values which are subtracted from channels. Values are intended
/// to be in (mean-R, mean-G, mean-B) order if @p image has BGR ordering and @p swapRB is true.
/// * scalefactor: multiplier for @p images values.
/// * swapRB: flag which indicates that swap first and last channels
/// in 3-channel image is necessary.
/// * crop: flag which indicates whether image will be cropped after resize or not
/// * ddepth: Depth of output blob. Choose CV_32F or CV_8U.
/// @details if @p crop is true, input image is resized so one side after resize is equal to corresponding
/// dimension in @p size and another one is equal or larger. Then, crop from the center is performed.
/// If @p crop is false, direct resize without cropping and preserving aspect ratio is performed.
/// @returns 4-dimensional Mat with NCHW dimensions order.
///
/// ## C++ default parameters:
/// * scalefactor: 1.0
/// * size: Size()
/// * mean: Scalar()
/// * swap_rb: false
/// * crop: false
/// * ddepth: CV_32F
pub fn blob_from_images_1(images: &types::VectorOfMat, scalefactor: f64, size: core::Size, mean: core::Scalar, swap_rb: bool, crop: bool, ddepth: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_dnn_blobFromImages_VectorOfMat_images_double_scalefactor_Size_size_Scalar_mean_bool_swapRB_bool_crop_int_ddepth(images.as_raw_VectorOfMat(), scalefactor, size, mean, swap_rb, crop, ddepth) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_dnn_clamp_Range_r_int_axisSize
pub fn clamp(r: &core::Range, axis_size: i32) -> Result<core::Range> {
unsafe { sys::cv_core_cv_dnn_clamp_Range_r_int_axisSize(r.as_raw_Range(), axis_size) }.into_result().map(|x| core::Range { ptr: x })
}
// identifier: cv_dnn_clamp_int_ax_int_dims
pub fn clamp_1(ax: i32, dims: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_dnn_clamp_int_ax_int_dims(ax, dims) }.into_result()
}
// identifier: cv_dnn_getPlane_Mat_m_int_n_int_cn
pub fn get_plane(m: &core::Mat, n: i32, cn: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_dnn_getPlane_Mat_m_int_n_int_cn(m.as_raw_Mat(), n, cn) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_dnn_imagesFromBlob_Mat_blob__VectorOfMat_images_
/// Parse a 4D blob and output the images it contains as 2D arrays through a simpler data structure
/// (std::vector<cv::Mat>).
/// ## Parameters
/// @param[in] blob_ 4 dimensional array (images, channels, height, width) in floating point precision (CV_32F) from
/// which you would like to extract the images.
/// @param[out] images_ array of 2D Mat containing the images extracted from the blob in floating point precision
/// (CV_32F). They are non normalized neither mean added. The number of returned images equals the first dimension
/// of the blob (batch size). Every image has a number of channels equals to the second dimension of the blob (depth).
pub fn images_from_blob(blob_: &core::Mat, images_: &mut types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_imagesFromBlob_Mat_blob__VectorOfMat_images_(blob_.as_raw_Mat(), images_.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_dnn_readNetFromCaffe_String_prototxt_String_caffeModel
/// Reads a network model stored in <a href="http://caffe.berkeleyvision.org">Caffe</a> framework's format.
/// ## Parameters
/// * prototxt: path to the .prototxt file with text description of the network architecture.
/// * caffeModel: path to the .caffemodel file with learned network.
/// @returns Net object.
///
/// ## C++ default parameters:
/// * caffe_model: String()
pub fn read_net_from_caffe(prototxt: &str, caffe_model: &str) -> Result<core::Net> {
string_arg!(prototxt);
string_arg!(caffe_model);
unsafe { sys::cv_core_cv_dnn_readNetFromCaffe_String_prototxt_String_caffeModel(prototxt.as_ptr(), caffe_model.as_ptr()) }.into_result()
}
// identifier: cv_dnn_readNetFromCaffe_VectorOfuchar_bufferProto_VectorOfuchar_bufferModel
/// Reads a network model stored in Caffe model in memory.
/// ## Parameters
/// * bufferProto: buffer containing the content of the .prototxt file
/// * bufferModel: buffer containing the content of the .caffemodel file
/// @returns Net object.
///
/// ## C++ default parameters:
/// * buffer_model: std::vector<uchar>()
pub fn read_net_from_caffe_1(buffer_proto: &types::VectorOfuchar, buffer_model: &types::VectorOfuchar) -> Result<core::Net> {
unsafe { sys::cv_core_cv_dnn_readNetFromCaffe_VectorOfuchar_bufferProto_VectorOfuchar_bufferModel(buffer_proto.as_raw_VectorOfuchar(), buffer_model.as_raw_VectorOfuchar()) }.into_result()
}
// identifier: cv_dnn_readNetFromCaffe_const_char_X_bufferProto_size_t_lenProto_const_char_X_bufferModel_size_t_lenModel
/// Reads a network model stored in Caffe model in memory.
/// @details This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what argument(s) it accepts.
/// ## Parameters
/// * bufferProto: buffer containing the content of the .prototxt file
/// * lenProto: length of bufferProto
/// * bufferModel: buffer containing the content of the .caffemodel file
/// * lenModel: length of bufferModel
/// @returns Net object.
///
/// ## C++ default parameters:
/// * buffer_model: NULL
/// * len_model: 0
pub fn read_net_from_caffe_2(buffer_proto: &str, len_proto: size_t, buffer_model: &str, len_model: size_t) -> Result<core::Net> {
string_arg!(buffer_proto);
string_arg!(buffer_model);
unsafe { sys::cv_core_cv_dnn_readNetFromCaffe_const_char_X_bufferProto_size_t_lenProto_const_char_X_bufferModel_size_t_lenModel(buffer_proto.as_ptr(), len_proto, buffer_model.as_ptr(), len_model) }.into_result()
}
// identifier: cv_dnn_readNetFromDarknet_String_cfgFile_String_darknetModel
/// Reads a network model stored in <a href="https://pjreddie.com/darknet/">Darknet</a> model files.
/// ## Parameters
/// * cfgFile: path to the .cfg file with text description of the network architecture.
/// * darknetModel: path to the .weights file with learned network.
/// @returns Network object that ready to do forward, throw an exception in failure cases.
/// @returns Net object.
///
/// ## C++ default parameters:
/// * darknet_model: String()
pub fn read_net_from_darknet(cfg_file: &str, darknet_model: &str) -> Result<core::Net> {
string_arg!(cfg_file);
string_arg!(darknet_model);
unsafe { sys::cv_core_cv_dnn_readNetFromDarknet_String_cfgFile_String_darknetModel(cfg_file.as_ptr(), darknet_model.as_ptr()) }.into_result()
}
// identifier: cv_dnn_readNetFromDarknet_VectorOfuchar_bufferCfg_VectorOfuchar_bufferModel
/// Reads a network model stored in <a href="https://pjreddie.com/darknet/">Darknet</a> model files.
/// ## Parameters
/// * bufferCfg: A buffer contains a content of .cfg file with text description of the network architecture.
/// * bufferModel: A buffer contains a content of .weights file with learned network.
/// @returns Net object.
///
/// ## C++ default parameters:
/// * buffer_model: std::vector<uchar>()
pub fn read_net_from_darknet_1(buffer_cfg: &types::VectorOfuchar, buffer_model: &types::VectorOfuchar) -> Result<core::Net> {
unsafe { sys::cv_core_cv_dnn_readNetFromDarknet_VectorOfuchar_bufferCfg_VectorOfuchar_bufferModel(buffer_cfg.as_raw_VectorOfuchar(), buffer_model.as_raw_VectorOfuchar()) }.into_result()
}
// identifier: cv_dnn_readNetFromDarknet_const_char_X_bufferCfg_size_t_lenCfg_const_char_X_bufferModel_size_t_lenModel
/// Reads a network model stored in <a href="https://pjreddie.com/darknet/">Darknet</a> model files.
/// ## Parameters
/// * bufferCfg: A buffer contains a content of .cfg file with text description of the network architecture.
/// * lenCfg: Number of bytes to read from bufferCfg
/// * bufferModel: A buffer contains a content of .weights file with learned network.
/// * lenModel: Number of bytes to read from bufferModel
/// @returns Net object.
///
/// ## C++ default parameters:
/// * buffer_model: NULL
/// * len_model: 0
pub fn read_net_from_darknet_2(buffer_cfg: &str, len_cfg: size_t, buffer_model: &str, len_model: size_t) -> Result<core::Net> {
string_arg!(buffer_cfg);
string_arg!(buffer_model);
unsafe { sys::cv_core_cv_dnn_readNetFromDarknet_const_char_X_bufferCfg_size_t_lenCfg_const_char_X_bufferModel_size_t_lenModel(buffer_cfg.as_ptr(), len_cfg, buffer_model.as_ptr(), len_model) }.into_result()
}
// identifier: cv_dnn_readNetFromModelOptimizer_String_xml_String_bin
/// Load a network from Intel's Model Optimizer intermediate representation.
/// ## Parameters
/// @param[in] xml XML configuration file with network's topology.
/// @param[in] bin Binary file with trained weights.
/// @returns Net object.
/// Networks imported from Intel's Model Optimizer are launched in Intel's Inference Engine
/// backend.
pub fn read_net_from_model_optimizer(xml: &str, bin: &str) -> Result<core::Net> {
string_arg!(xml);
string_arg!(bin);
unsafe { sys::cv_core_cv_dnn_readNetFromModelOptimizer_String_xml_String_bin(xml.as_ptr(), bin.as_ptr()) }.into_result()
}
// identifier: cv_dnn_readNetFromONNX_String_onnxFile
/// Reads a network model <a href="https://onnx.ai/">ONNX</a>.
/// ## Parameters
/// * onnxFile: path to the .onnx file with text description of the network architecture.
/// @returns Network object that ready to do forward, throw an exception in failure cases.
pub fn read_net_from_onnx(onnx_file: &str) -> Result<core::Net> {
string_arg!(onnx_file);
unsafe { sys::cv_core_cv_dnn_readNetFromONNX_String_onnxFile(onnx_file.as_ptr()) }.into_result()
}
// identifier: cv_dnn_readNetFromTensorflow_String_model_String_config
/// Reads a network model stored in <a href="https://www.tensorflow.org/">TensorFlow</a> framework's format.
/// ## Parameters
/// * model: path to the .pb file with binary protobuf description of the network architecture
/// * config: path to the .pbtxt file that contains text graph definition in protobuf format.
/// Resulting Net object is built by text graph using weights from a binary one that
/// let us make it more flexible.
/// @returns Net object.
///
/// ## C++ default parameters:
/// * config: String()
pub fn read_net_from_tensorflow(model: &str, config: &str) -> Result<core::Net> {
string_arg!(model);
string_arg!(config);
unsafe { sys::cv_core_cv_dnn_readNetFromTensorflow_String_model_String_config(model.as_ptr(), config.as_ptr()) }.into_result()
}
// identifier: cv_dnn_readNetFromTensorflow_VectorOfuchar_bufferModel_VectorOfuchar_bufferConfig
/// Reads a network model stored in <a href="https://www.tensorflow.org/">TensorFlow</a> framework's format.
/// ## Parameters
/// * bufferModel: buffer containing the content of the pb file
/// * bufferConfig: buffer containing the content of the pbtxt file
/// @returns Net object.
///
/// ## C++ default parameters:
/// * buffer_config: std::vector<uchar>()
pub fn read_net_from_tensorflow_1(buffer_model: &types::VectorOfuchar, buffer_config: &types::VectorOfuchar) -> Result<core::Net> {
unsafe { sys::cv_core_cv_dnn_readNetFromTensorflow_VectorOfuchar_bufferModel_VectorOfuchar_bufferConfig(buffer_model.as_raw_VectorOfuchar(), buffer_config.as_raw_VectorOfuchar()) }.into_result()
}
// identifier: cv_dnn_readNetFromTensorflow_const_char_X_bufferModel_size_t_lenModel_const_char_X_bufferConfig_size_t_lenConfig
/// Reads a network model stored in <a href="https://www.tensorflow.org/">TensorFlow</a> framework's format.
/// @details This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what argument(s) it accepts.
/// ## Parameters
/// * bufferModel: buffer containing the content of the pb file
/// * lenModel: length of bufferModel
/// * bufferConfig: buffer containing the content of the pbtxt file
/// * lenConfig: length of bufferConfig
///
/// ## C++ default parameters:
/// * buffer_config: NULL
/// * len_config: 0
pub fn read_net_from_tensorflow_2(buffer_model: &str, len_model: size_t, buffer_config: &str, len_config: size_t) -> Result<core::Net> {
string_arg!(buffer_model);
string_arg!(buffer_config);
unsafe { sys::cv_core_cv_dnn_readNetFromTensorflow_const_char_X_bufferModel_size_t_lenModel_const_char_X_bufferConfig_size_t_lenConfig(buffer_model.as_ptr(), len_model, buffer_config.as_ptr(), len_config) }.into_result()
}
// identifier: cv_dnn_readNetFromTorch_String_model_bool_isBinary_bool_evaluate
/// Reads a network model stored in <a href="http://torch.ch">Torch7</a> framework's format.
/// ## Parameters
/// * model: path to the file, dumped from Torch by using torch.save() function.
/// * isBinary: specifies whether the network was serialized in ascii mode or binary.
/// * evaluate: specifies testing phase of network. If true, it's similar to evaluate() method in Torch.
/// @returns Net object.
///
///
/// Note: Ascii mode of Torch serializer is more preferable, because binary mode extensively use `long` type of C language,
/// which has various bit-length on different systems.
///
/// The loading file must contain serialized <a href="https://github.com/torch/nn/blob/master/doc/module.md">nn.Module</a> object
/// with importing network. Try to eliminate a custom objects from serialazing data to avoid importing errors.
///
/// List of supported layers (i.e. object instances derived from Torch nn.Module class):
/// - nn.Sequential
/// - nn.Parallel
/// - nn.Concat
/// - nn.Linear
/// - nn.SpatialConvolution
/// - nn.SpatialMaxPooling, nn.SpatialAveragePooling
/// - nn.ReLU, nn.TanH, nn.Sigmoid
/// - nn.Reshape
/// - nn.SoftMax, nn.LogSoftMax
///
/// Also some equivalents of these classes from cunn, cudnn, and fbcunn may be successfully imported.
///
/// ## C++ default parameters:
/// * is_binary: true
/// * evaluate: true
pub fn read_net_from_torch(model: &str, is_binary: bool, evaluate: bool) -> Result<core::Net> {
string_arg!(model);
unsafe { sys::cv_core_cv_dnn_readNetFromTorch_String_model_bool_isBinary_bool_evaluate(model.as_ptr(), is_binary, evaluate) }.into_result()
}
// identifier: cv_dnn_readNet_String_framework_VectorOfuchar_bufferModel_VectorOfuchar_bufferConfig
/// Read deep learning network represented in one of the supported formats.
/// @details This is an overloaded member function, provided for convenience.
/// It differs from the above function only in what argument(s) it accepts.
/// ## Parameters
/// @param[in] framework Name of origin framework.
/// @param[in] bufferModel A buffer with a content of binary file with weights
/// @param[in] bufferConfig A buffer with a content of text file contains network configuration.
/// @returns Net object.
///
/// ## C++ default parameters:
/// * buffer_config: std::vector<uchar>()
pub fn read_net(framework: &str, buffer_model: &types::VectorOfuchar, buffer_config: &types::VectorOfuchar) -> Result<core::Net> {
string_arg!(framework);
unsafe { sys::cv_core_cv_dnn_readNet_String_framework_VectorOfuchar_bufferModel_VectorOfuchar_bufferConfig(framework.as_ptr(), buffer_model.as_raw_VectorOfuchar(), buffer_config.as_raw_VectorOfuchar()) }.into_result()
}
// identifier: cv_dnn_readNet_String_model_String_config_String_framework
/// Read deep learning network represented in one of the supported formats.
/// ## Parameters
/// @param[in] model Binary file contains trained weights. The following file
/// extensions are expected for models from different frameworks:
/// * `*.caffemodel` (Caffe, http://caffe.berkeleyvision.org/)
/// * `*.pb` (TensorFlow, https://www.tensorflow.org/)
/// * `*.t7` | `*.net` (Torch, http://torch.ch/)
/// * `*.weights` (Darknet, https://pjreddie.com/darknet/)
/// * `*.bin` (DLDT, https://software.intel.com/openvino-toolkit)
/// @param[in] config Text file contains network configuration. It could be a
/// file with the following extensions:
/// * `*.prototxt` (Caffe, http://caffe.berkeleyvision.org/)
/// * `*.pbtxt` (TensorFlow, https://www.tensorflow.org/)
/// * `*.cfg` (Darknet, https://pjreddie.com/darknet/)
/// * `*.xml` (DLDT, https://software.intel.com/openvino-toolkit)
/// @param[in] framework Explicit framework name tag to determine a format.
/// @returns Net object.
///
/// This function automatically detects an origin framework of trained model
/// and calls an appropriate function such @ref readNetFromCaffe, @ref readNetFromTensorflow,
/// @ref readNetFromTorch or @ref readNetFromDarknet. An order of @p model and @p config
/// arguments does not matter.
///
/// ## C++ default parameters:
/// * config: ""
/// * framework: ""
pub fn read_net_1(model: &str, config: &str, framework: &str) -> Result<core::Net> {
string_arg!(model);
string_arg!(config);
string_arg!(framework);
unsafe { sys::cv_core_cv_dnn_readNet_String_model_String_config_String_framework(model.as_ptr(), config.as_ptr(), framework.as_ptr()) }.into_result()
}
// identifier: cv_dnn_readTensorFromONNX_String_path
/// Creates blob from .pb file.
/// ## Parameters
/// * path: to the .pb file with input tensor.
/// @returns Mat.
pub fn read_tensor_from_onnx(path: &str) -> Result<core::Mat> {
string_arg!(path);
unsafe { sys::cv_core_cv_dnn_readTensorFromONNX_String_path(path.as_ptr()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_dnn_readTorchBlob_String_filename_bool_isBinary
/// Loads blob which was serialized as torch.Tensor object of Torch7 framework.
/// @warning This function has the same limitations as readNetFromTorch().
///
/// ## C++ default parameters:
/// * is_binary: true
pub fn read_torch_blob(filename: &str, is_binary: bool) -> Result<core::Mat> {
string_arg!(filename);
unsafe { sys::cv_core_cv_dnn_readTorchBlob_String_filename_bool_isBinary(filename.as_ptr(), is_binary) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_dnn_resetMyriadDevice
/// Release a Myriad device is binded by OpenCV.
///
/// Single Myriad device cannot be shared across multiple processes which uses
/// Inference Engine's Myriad plugin.
pub fn reset_myriad_device() -> Result<()> {
unsafe { sys::cv_core_cv_dnn_resetMyriadDevice() }.into_result()
}
// identifier: cv_dnn_shape_MatSize_sz
pub fn shape(sz: &core::MatSize) -> Result<types::VectorOfint> {
unsafe { sys::cv_core_cv_dnn_shape_MatSize_sz(sz.as_raw_MatSize()) }.into_result().map(|x| types::VectorOfint { ptr: x })
}
// identifier: cv_dnn_shape_Mat_mat
pub fn shape_1(mat: &core::Mat) -> Result<types::VectorOfint> {
unsafe { sys::cv_core_cv_dnn_shape_Mat_mat(mat.as_raw_Mat()) }.into_result().map(|x| types::VectorOfint { ptr: x })
}
// identifier: cv_dnn_shape_const_int_X_dims_int_n
pub fn shape_2(dims: &i32, n: i32) -> Result<types::VectorOfint> {
unsafe { sys::cv_core_cv_dnn_shape_const_int_X_dims_int_n(dims, n) }.into_result().map(|x| types::VectorOfint { ptr: x })
}
// identifier: cv_dnn_shape_int_a0_int_a1_int_a2_int_a3
///
/// ## C++ default parameters:
/// * a1: -1
/// * a2: -1
/// * a3: -1
pub fn shape_3(a0: i32, a1: i32, a2: i32, a3: i32) -> Result<types::VectorOfint> {
unsafe { sys::cv_core_cv_dnn_shape_int_a0_int_a1_int_a2_int_a3(a0, a1, a2, a3) }.into_result().map(|x| types::VectorOfint { ptr: x })
}
// identifier: cv_dnn_shrinkCaffeModel_String_src_String_dst_VectorOfString_layersTypes
/// Convert all weights of Caffe network to half precision floating point.
/// ## Parameters
/// * src: Path to origin model from Caffe framework contains single
/// precision floating point weights (usually has `.caffemodel` extension).
/// * dst: Path to destination model with updated weights.
/// * layersTypes: Set of layers types which parameters will be converted.
/// By default, converts only Convolutional and Fully-Connected layers'
/// weights.
///
///
/// Note: Shrinked model has no origin float32 weights so it can't be used
/// in origin Caffe framework anymore. However the structure of data
/// is taken from NVidia's Caffe fork: https://github.com/NVIDIA/caffe.
/// So the resulting model may be used there.
///
/// ## C++ default parameters:
/// * layers_types: std::vector<String>()
pub fn shrink_caffe_model(src: &str, dst: &str, layers_types: &types::VectorOfString) -> Result<()> {
string_arg!(src);
string_arg!(dst);
unsafe { sys::cv_core_cv_dnn_shrinkCaffeModel_String_src_String_dst_VectorOfString_layersTypes(src.as_ptr(), dst.as_ptr(), layers_types.as_raw_VectorOfString()) }.into_result()
}
// identifier: cv_dnn_slice_Mat_m_Range_r0
pub fn slice(m: &core::Mat, r0: &core::Range) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_dnn_slice_Mat_m_Range_r0(m.as_raw_Mat(), r0.as_raw_Range()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_dnn_slice_Mat_m_Range_r0_Range_r1
pub fn slice_1(m: &core::Mat, r0: &core::Range, r1: &core::Range) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_dnn_slice_Mat_m_Range_r0_Range_r1(m.as_raw_Mat(), r0.as_raw_Range(), r1.as_raw_Range()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_dnn_slice_Mat_m_Range_r0_Range_r1_Range_r2
pub fn slice_2(m: &core::Mat, r0: &core::Range, r1: &core::Range, r2: &core::Range) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_dnn_slice_Mat_m_Range_r0_Range_r1_Range_r2(m.as_raw_Mat(), r0.as_raw_Range(), r1.as_raw_Range(), r2.as_raw_Range()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_dnn_slice_Mat_m_Range_r0_Range_r1_Range_r2_Range_r3
pub fn slice_3(m: &core::Mat, r0: &core::Range, r1: &core::Range, r2: &core::Range, r3: &core::Range) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_dnn_slice_Mat_m_Range_r0_Range_r1_Range_r2_Range_r3(m.as_raw_Mat(), r0.as_raw_Range(), r1.as_raw_Range(), r2.as_raw_Range(), r3.as_raw_Range()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_dnn_writeTextGraph_String_model_String_output
/// Create a text representation for a binary network stored in protocol buffer format.
/// ## Parameters
/// @param[in] model A path to binary network.
/// @param[in] output A path to output text file to be created.
///
///
/// Note: To reduce output file size, trained weights are not included.
pub fn write_text_graph(model: &str, output: &str) -> Result<()> {
string_arg!(model);
string_arg!(output);
unsafe { sys::cv_core_cv_dnn_writeTextGraph_String_model_String_output(model.as_ptr(), output.as_ptr()) }.into_result()
}
// identifier: cv_drawChessboardCorners_Mat_image_Size_patternSize_Mat_corners_bool_patternWasFound
/// Renders the detected chessboard corners.
///
/// ## Parameters
/// * image: Destination image. It must be an 8-bit color image.
/// * patternSize: Number of inner corners per a chessboard row and column
/// (patternSize = cv::Size(points_per_row,points_per_column)).
/// * corners: Array of detected corners, the output of findChessboardCorners.
/// * patternWasFound: Parameter indicating whether the complete board was found or not. The
/// return value of findChessboardCorners should be passed here.
///
/// The function draws individual chessboard corners detected either as red circles if the board was not
/// found, or as colored corners connected with lines if the board was found.
pub fn draw_chessboard_corners(image: &mut core::Mat, pattern_size: core::Size, corners: &core::Mat, pattern_was_found: bool) -> Result<()> {
unsafe { sys::cv_core_cv_drawChessboardCorners_Mat_image_Size_patternSize_Mat_corners_bool_patternWasFound(image.as_raw_Mat(), pattern_size, corners.as_raw_Mat(), pattern_was_found) }.into_result()
}
// identifier: cv_drawContours_Mat_image_VectorOfMat_contours_int_contourIdx_Scalar_color_int_thickness_int_lineType_Mat_hierarchy_int_maxLevel_Point_offset
/// Draws contours outlines or filled contours.
///
/// The function draws contour outlines in the image if <span lang='latex'>\texttt{thickness} \ge 0</span> or fills the area
/// bounded by the contours if <span lang='latex'>\texttt{thickness}<0</span> . The example below shows how to retrieve
/// connected components from the binary image and label them: :
/// @include snippets/imgproc_drawContours.cpp
///
/// ## Parameters
/// * image: Destination image.
/// * contours: All the input contours. Each contour is stored as a point vector.
/// * contourIdx: Parameter indicating a contour to draw. If it is negative, all the contours are drawn.
/// * color: Color of the contours.
/// * thickness: Thickness of lines the contours are drawn with. If it is negative (for example,
/// thickness=#FILLED ), the contour interiors are drawn.
/// * lineType: Line connectivity. See #LineTypes
/// * hierarchy: Optional information about hierarchy. It is only needed if you want to draw only
/// some of the contours (see maxLevel ).
/// * maxLevel: Maximal level for drawn contours. If it is 0, only the specified contour is drawn.
/// If it is 1, the function draws the contour(s) and all the nested contours. If it is 2, the function
/// draws the contours, all the nested contours, all the nested-to-nested contours, and so on. This
/// parameter is only taken into account when there is hierarchy available.
/// * offset: Optional contour shift parameter. Shift all the drawn contours by the specified
/// <span lang='latex'>\texttt{offset}=(dx,dy)</span> .
///
/// Note: When thickness=#FILLED, the function is designed to handle connected components with holes correctly
/// even when no hierarchy date is provided. This is done by analyzing all the outlines together
/// using even-odd rule. This may give incorrect results if you have a joint collection of separately retrieved
/// contours. In order to solve this problem, you need to call #drawContours separately for each sub-group
/// of contours, or iterate over the collection using contourIdx parameter.
///
/// ## C++ default parameters:
/// * thickness: 1
/// * line_type: LINE_8
/// * hierarchy: noArray()
/// * max_level: INT_MAX
/// * offset: Point()
pub fn draw_contours(image: &mut core::Mat, contours: &types::VectorOfMat, contour_idx: i32, color: core::Scalar, thickness: i32, line_type: i32, hierarchy: &core::Mat, max_level: i32, offset: core::Point) -> Result<()> {
unsafe { sys::cv_core_cv_drawContours_Mat_image_VectorOfMat_contours_int_contourIdx_Scalar_color_int_thickness_int_lineType_Mat_hierarchy_int_maxLevel_Point_offset(image.as_raw_Mat(), contours.as_raw_VectorOfMat(), contour_idx, color, thickness, line_type, hierarchy.as_raw_Mat(), max_level, offset) }.into_result()
}
// identifier: cv_drawFrameAxes_Mat_image_Mat_cameraMatrix_Mat_distCoeffs_Mat_rvec_Mat_tvec_float_length_int_thickness
/// Draw axes of the world/object coordinate system from pose estimation. @sa solvePnP
///
/// ## Parameters
/// * image: Input/output image. It must have 1 or 3 channels. The number of channels is not altered.
/// * cameraMatrix: Input 3x3 floating-point matrix of camera intrinsic parameters.
/// <span lang='latex'>A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}</span>
/// * distCoeffs: Input vector of distortion coefficients
/// <span lang='latex'>(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])</span> of
/// 4, 5, 8, 12 or 14 elements. If the vector is empty, the zero distortion coefficients are assumed.
/// * rvec: Rotation vector (see @ref Rodrigues ) that, together with tvec , brings points from
/// the model coordinate system to the camera coordinate system.
/// * tvec: Translation vector.
/// * length: Length of the painted axes in the same unit than tvec (usually in meters).
/// * thickness: Line thickness of the painted axes.
///
/// This function draws the axes of the world/object coordinate system w.r.t. to the camera frame.
/// OX is drawn in red, OY in green and OZ in blue.
///
/// ## C++ default parameters:
/// * thickness: 3
pub fn draw_frame_axes(image: &mut core::Mat, camera_matrix: &core::Mat, dist_coeffs: &core::Mat, rvec: &core::Mat, tvec: &core::Mat, length: f32, thickness: i32) -> Result<()> {
unsafe { sys::cv_core_cv_drawFrameAxes_Mat_image_Mat_cameraMatrix_Mat_distCoeffs_Mat_rvec_Mat_tvec_float_length_int_thickness(image.as_raw_Mat(), camera_matrix.as_raw_Mat(), dist_coeffs.as_raw_Mat(), rvec.as_raw_Mat(), tvec.as_raw_Mat(), length, thickness) }.into_result()
}
// identifier: cv_drawKeypoints_Mat_image_VectorOfKeyPoint_keypoints_Mat_outImage_Scalar_color_int_flags
/// Draws keypoints.
///
/// ## Parameters
/// * image: Source image.
/// * keypoints: Keypoints from the source image.
/// * outImage: Output image. Its content depends on the flags value defining what is drawn in the
/// output image. See possible flags bit values below.
/// * color: Color of keypoints.
/// * flags: Flags setting drawing features. Possible flags bit values are defined by
/// DrawMatchesFlags. See details above in drawMatches .
///
///
/// Note:
/// For Python API, flags are modified as cv2.DRAW_MATCHES_FLAGS_DEFAULT,
/// cv2.DRAW_MATCHES_FLAGS_DRAW_RICH_KEYPOINTS, cv2.DRAW_MATCHES_FLAGS_DRAW_OVER_OUTIMG,
/// cv2.DRAW_MATCHES_FLAGS_NOT_DRAW_SINGLE_POINTS
///
/// ## C++ default parameters:
/// * color: Scalar::all(-1)
/// * flags: DrawMatchesFlags::DEFAULT
pub fn draw_keypoints(image: &core::Mat, keypoints: &types::VectorOfKeyPoint, out_image: &mut core::Mat, color: core::Scalar, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_drawKeypoints_Mat_image_VectorOfKeyPoint_keypoints_Mat_outImage_Scalar_color_int_flags(image.as_raw_Mat(), keypoints.as_raw_VectorOfKeyPoint(), out_image.as_raw_Mat(), color, flags) }.into_result()
}
// identifier: cv_drawMarker_Mat_img_Point_position_Scalar_color_int_markerType_int_markerSize_int_thickness_int_line_type
/// Draws a marker on a predefined position in an image.
///
/// The function cv::drawMarker draws a marker on a given position in the image. For the moment several
/// marker types are supported, see #MarkerTypes for more information.
///
/// ## Parameters
/// * img: Image.
/// * position: The point where the crosshair is positioned.
/// * color: Line color.
/// * markerType: The specific type of marker you want to use, see #MarkerTypes
/// * thickness: Line thickness.
/// * line_type: Type of the line, See #LineTypes
/// * markerSize: The length of the marker axis [default = 20 pixels]
///
/// ## C++ default parameters:
/// * marker_type: MARKER_CROSS
/// * marker_size: 20
/// * thickness: 1
/// * line_type: 8
pub fn draw_marker(img: &core::Mat, position: core::Point, color: core::Scalar, marker_type: i32, marker_size: i32, thickness: i32, line_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_drawMarker_Mat_img_Point_position_Scalar_color_int_markerType_int_markerSize_int_thickness_int_line_type(img.as_raw_Mat(), position, color, marker_type, marker_size, thickness, line_type) }.into_result()
}
// identifier: cv_drawMatches_Mat_img1_VectorOfKeyPoint_keypoints1_Mat_img2_VectorOfKeyPoint_keypoints2_VectorOfDMatch_matches1to2_Mat_outImg_Scalar_matchColor_Scalar_singlePointColor_VectorOfchar_matchesMask_int_flags
/// Draws the found matches of keypoints from two images.
///
/// ## Parameters
/// * img1: First source image.
/// * keypoints1: Keypoints from the first source image.
/// * img2: Second source image.
/// * keypoints2: Keypoints from the second source image.
/// * matches1to2: Matches from the first image to the second one, which means that keypoints1[i]
/// has a corresponding point in keypoints2[matches[i]] .
/// * outImg: Output image. Its content depends on the flags value defining what is drawn in the
/// output image. See possible flags bit values below.
/// * matchColor: Color of matches (lines and connected keypoints). If matchColor==Scalar::all(-1)
/// , the color is generated randomly.
/// * singlePointColor: Color of single keypoints (circles), which means that keypoints do not
/// have the matches. If singlePointColor==Scalar::all(-1) , the color is generated randomly.
/// * matchesMask: Mask determining which matches are drawn. If the mask is empty, all matches are
/// drawn.
/// * flags: Flags setting drawing features. Possible flags bit values are defined by
/// DrawMatchesFlags.
///
/// This function draws matches of keypoints from two images in the output image. Match is a line
/// connecting two keypoints (circles). See cv::DrawMatchesFlags.
///
/// ## C++ default parameters:
/// * match_color: Scalar::all(-1)
/// * single_point_color: Scalar::all(-1)
/// * matches_mask: std::vector<char>()
/// * flags: DrawMatchesFlags::DEFAULT
pub fn draw_matches(img1: &core::Mat, keypoints1: &types::VectorOfKeyPoint, img2: &core::Mat, keypoints2: &types::VectorOfKeyPoint, matches1to2: &types::VectorOfDMatch, out_img: &mut core::Mat, match_color: core::Scalar, single_point_color: core::Scalar, matches_mask: &types::VectorOfchar, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_drawMatches_Mat_img1_VectorOfKeyPoint_keypoints1_Mat_img2_VectorOfKeyPoint_keypoints2_VectorOfDMatch_matches1to2_Mat_outImg_Scalar_matchColor_Scalar_singlePointColor_VectorOfchar_matchesMask_int_flags(img1.as_raw_Mat(), keypoints1.as_raw_VectorOfKeyPoint(), img2.as_raw_Mat(), keypoints2.as_raw_VectorOfKeyPoint(), matches1to2.as_raw_VectorOfDMatch(), out_img.as_raw_Mat(), match_color, single_point_color, matches_mask.as_raw_VectorOfchar(), flags) }.into_result()
}
// identifier: cv_drawMatches_Mat_img1_VectorOfKeyPoint_keypoints1_Mat_img2_VectorOfKeyPoint_keypoints2_VectorOfVectorOfDMatch_matches1to2_Mat_outImg_Scalar_matchColor_Scalar_singlePointColor_VectorOfVectorOfchar_matchesMask_int_flags
/// @overload
///
/// ## C++ default parameters:
/// * match_color: Scalar::all(-1)
/// * single_point_color: Scalar::all(-1)
/// * matches_mask: std::vector<std::vector<char> >()
/// * flags: DrawMatchesFlags::DEFAULT
pub fn draw_vector_matches(img1: &core::Mat, keypoints1: &types::VectorOfKeyPoint, img2: &core::Mat, keypoints2: &types::VectorOfKeyPoint, matches1to2: &types::VectorOfVectorOfDMatch, out_img: &mut core::Mat, match_color: core::Scalar, single_point_color: core::Scalar, matches_mask: &types::VectorOfVectorOfchar, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_drawMatches_Mat_img1_VectorOfKeyPoint_keypoints1_Mat_img2_VectorOfKeyPoint_keypoints2_VectorOfVectorOfDMatch_matches1to2_Mat_outImg_Scalar_matchColor_Scalar_singlePointColor_VectorOfVectorOfchar_matchesMask_int_flags(img1.as_raw_Mat(), keypoints1.as_raw_VectorOfKeyPoint(), img2.as_raw_Mat(), keypoints2.as_raw_VectorOfKeyPoint(), matches1to2.as_raw_VectorOfVectorOfDMatch(), out_img.as_raw_Mat(), match_color, single_point_color, matches_mask.as_raw_VectorOfVectorOfchar(), flags) }.into_result()
}
// identifier: cv_edgePreservingFilter_Mat_src_Mat_dst_int_flags_float_sigma_s_float_sigma_r
/// Filtering is the fundamental operation in image and video processing. Edge-preserving smoothing
/// filters are used in many different applications @cite EM11 .
///
/// ## Parameters
/// * src: Input 8-bit 3-channel image.
/// * dst: Output 8-bit 3-channel image.
/// * flags: Edge preserving filters:
/// * **RECURS_FILTER** = 1
/// * **NORMCONV_FILTER** = 2
/// * sigma_s: Range between 0 to 200.
/// * sigma_r: Range between 0 to 1.
///
/// ## C++ default parameters:
/// * flags: 1
/// * sigma_s: 60
/// * sigma_r: 0.4f
pub fn edge_preserving_filter(src: &core::Mat, dst: &mut core::Mat, flags: i32, sigma_s: f32, sigma_r: f32) -> Result<()> {
unsafe { sys::cv_core_cv_edgePreservingFilter_Mat_src_Mat_dst_int_flags_float_sigma_s_float_sigma_r(src.as_raw_Mat(), dst.as_raw_Mat(), flags, sigma_s, sigma_r) }.into_result()
}
// identifier: cv_eigenNonSymmetric_Mat_src_Mat_eigenvalues_Mat_eigenvectors
/// Calculates eigenvalues and eigenvectors of a non-symmetric matrix (real eigenvalues only).
///
///
/// Note: Assumes real eigenvalues.
///
/// The function calculates eigenvalues and eigenvectors (optional) of the square matrix src:
/// ```ignore
/// src*eigenvectors.row(i).t() = eigenvalues.at<srcType>(i)*eigenvectors.row(i).t()
/// ```
///
///
/// ## Parameters
/// * src: input matrix (CV_32FC1 or CV_64FC1 type).
/// * eigenvalues: output vector of eigenvalues (type is the same type as src).
/// * eigenvectors: output matrix of eigenvectors (type is the same type as src). The eigenvectors are stored as subsequent matrix rows, in the same order as the corresponding eigenvalues.
/// @sa eigen
pub fn eigen_non_symmetric(src: &core::Mat, eigenvalues: &mut core::Mat, eigenvectors: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_eigenNonSymmetric_Mat_src_Mat_eigenvalues_Mat_eigenvectors(src.as_raw_Mat(), eigenvalues.as_raw_Mat(), eigenvectors.as_raw_Mat()) }.into_result()
}
// identifier: cv_eigen_Mat_src_Mat_eigenvalues_Mat_eigenvectors
/// Calculates eigenvalues and eigenvectors of a symmetric matrix.
///
/// The function cv::eigen calculates just eigenvalues, or eigenvalues and eigenvectors of the symmetric
/// matrix src:
/// ```ignore
/// src*eigenvectors.row(i).t() = eigenvalues.at<srcType>(i)*eigenvectors.row(i).t()
/// ```
///
///
///
/// Note: Use cv::eigenNonSymmetric for calculation of real eigenvalues and eigenvectors of non-symmetric matrix.
///
/// ## Parameters
/// * src: input matrix that must have CV_32FC1 or CV_64FC1 type, square size and be symmetrical
/// (src ^T^ == src).
/// * eigenvalues: output vector of eigenvalues of the same type as src; the eigenvalues are stored
/// in the descending order.
/// * eigenvectors: output matrix of eigenvectors; it has the same size and type as src; the
/// eigenvectors are stored as subsequent matrix rows, in the same order as the corresponding
/// eigenvalues.
/// @sa eigenNonSymmetric, completeSymm , PCA
///
/// ## C++ default parameters:
/// * eigenvectors: noArray()
pub fn eigen(src: &core::Mat, eigenvalues: &mut core::Mat, eigenvectors: &mut core::Mat) -> Result<bool> {
unsafe { sys::cv_core_cv_eigen_Mat_src_Mat_eigenvalues_Mat_eigenvectors(src.as_raw_Mat(), eigenvalues.as_raw_Mat(), eigenvectors.as_raw_Mat()) }.into_result()
}
// identifier: cv_ellipse2Poly_Point2d_center_Size2d_axes_int_angle_int_arcStart_int_arcEnd_int_delta_VectorOfPoint2d_pts
/// @overload
/// ## Parameters
/// * center: Center of the arc.
/// * axes: Half of the size of the ellipse main axes. See #ellipse for details.
/// * angle: Rotation angle of the ellipse in degrees. See #ellipse for details.
/// * arcStart: Starting angle of the elliptic arc in degrees.
/// * arcEnd: Ending angle of the elliptic arc in degrees.
/// * delta: Angle between the subsequent polyline vertices. It defines the approximation accuracy.
/// * pts: Output vector of polyline vertices.
pub fn ellipse2_poly_f64(center: core::Point2d, axes: core::Size2d, angle: i32, arc_start: i32, arc_end: i32, delta: i32, pts: &types::VectorOfPoint2d) -> Result<()> {
unsafe { sys::cv_core_cv_ellipse2Poly_Point2d_center_Size2d_axes_int_angle_int_arcStart_int_arcEnd_int_delta_VectorOfPoint2d_pts(center, axes, angle, arc_start, arc_end, delta, pts.as_raw_VectorOfPoint2d()) }.into_result()
}
// identifier: cv_ellipse2Poly_Point_center_Size_axes_int_angle_int_arcStart_int_arcEnd_int_delta_VectorOfPoint_pts
/// Approximates an elliptic arc with a polyline.
///
/// The function ellipse2Poly computes the vertices of a polyline that approximates the specified
/// elliptic arc. It is used by #ellipse. If `arcStart` is greater than `arcEnd`, they are swapped.
///
/// ## Parameters
/// * center: Center of the arc.
/// * axes: Half of the size of the ellipse main axes. See #ellipse for details.
/// * angle: Rotation angle of the ellipse in degrees. See #ellipse for details.
/// * arcStart: Starting angle of the elliptic arc in degrees.
/// * arcEnd: Ending angle of the elliptic arc in degrees.
/// * delta: Angle between the subsequent polyline vertices. It defines the approximation
/// accuracy.
/// * pts: Output vector of polyline vertices.
pub fn ellipse2_poly(center: core::Point, axes: core::Size, angle: i32, arc_start: i32, arc_end: i32, delta: i32, pts: &types::VectorOfPoint) -> Result<()> {
unsafe { sys::cv_core_cv_ellipse2Poly_Point_center_Size_axes_int_angle_int_arcStart_int_arcEnd_int_delta_VectorOfPoint_pts(center, axes, angle, arc_start, arc_end, delta, pts.as_raw_VectorOfPoint()) }.into_result()
}
// identifier: cv_ellipse_Mat_img_Point_center_Size_axes_double_angle_double_startAngle_double_endAngle_Scalar_color_int_thickness_int_lineType_int_shift
/// Draws a simple or thick elliptic arc or fills an ellipse sector.
///
/// The function cv::ellipse with more parameters draws an ellipse outline, a filled ellipse, an elliptic
/// arc, or a filled ellipse sector. The drawing code uses general parametric form.
/// A piecewise-linear curve is used to approximate the elliptic arc
/// boundary. If you need more control of the ellipse rendering, you can retrieve the curve using
/// #ellipse2Poly and then render it with #polylines or fill it with #fillPoly. If you use the first
/// variant of the function and want to draw the whole ellipse, not an arc, pass `startAngle=0` and
/// `endAngle=360`. If `startAngle` is greater than `endAngle`, they are swapped. The figure below explains
/// the meaning of the parameters to draw the blue arc.
///
/// 
///
/// ## Parameters
/// * img: Image.
/// * center: Center of the ellipse.
/// * axes: Half of the size of the ellipse main axes.
/// * angle: Ellipse rotation angle in degrees.
/// * startAngle: Starting angle of the elliptic arc in degrees.
/// * endAngle: Ending angle of the elliptic arc in degrees.
/// * color: Ellipse color.
/// * thickness: Thickness of the ellipse arc outline, if positive. Otherwise, this indicates that
/// a filled ellipse sector is to be drawn.
/// * lineType: Type of the ellipse boundary. See #LineTypes
/// * shift: Number of fractional bits in the coordinates of the center and values of axes.
///
/// ## C++ default parameters:
/// * thickness: 1
/// * line_type: LINE_8
/// * shift: 0
pub fn ellipse(img: &mut core::Mat, center: core::Point, axes: core::Size, angle: f64, start_angle: f64, end_angle: f64, color: core::Scalar, thickness: i32, line_type: i32, shift: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ellipse_Mat_img_Point_center_Size_axes_double_angle_double_startAngle_double_endAngle_Scalar_color_int_thickness_int_lineType_int_shift(img.as_raw_Mat(), center, axes, angle, start_angle, end_angle, color, thickness, line_type, shift) }.into_result()
}
// identifier: cv_ellipse_Mat_img_RotatedRect_box_Scalar_color_int_thickness_int_lineType
/// @overload
/// ## Parameters
/// * img: Image.
/// * box: Alternative ellipse representation via RotatedRect. This means that the function draws
/// an ellipse inscribed in the rotated rectangle.
/// * color: Ellipse color.
/// * thickness: Thickness of the ellipse arc outline, if positive. Otherwise, this indicates that
/// a filled ellipse sector is to be drawn.
/// * lineType: Type of the ellipse boundary. See #LineTypes
///
/// ## C++ default parameters:
/// * thickness: 1
/// * line_type: LINE_8
pub fn ellipse_new_rotated_rect(img: &mut core::Mat, _box: &core::RotatedRect, color: core::Scalar, thickness: i32, line_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ellipse_Mat_img_RotatedRect_box_Scalar_color_int_thickness_int_lineType(img.as_raw_Mat(), _box.as_raw_RotatedRect(), color, thickness, line_type) }.into_result()
}
// identifier: cv_equalizeHist_Mat_src_Mat_dst
/// Equalizes the histogram of a grayscale image.
///
/// The function equalizes the histogram of the input image using the following algorithm:
///
/// - Calculate the histogram <span lang='latex'>H</span> for src .
/// - Normalize the histogram so that the sum of histogram bins is 255.
/// - Compute the integral of the histogram:
/// <div lang='latex'>H'_i = \sum _{0 \le j < i} H(j)</div>
/// - Transform the image using <span lang='latex'>H'</span> as a look-up table: <span lang='latex'>\texttt{dst}(x,y) = H'(\texttt{src}(x,y))</span>
///
/// The algorithm normalizes the brightness and increases the contrast of the image.
///
/// ## Parameters
/// * src: Source 8-bit single channel image.
/// * dst: Destination image of the same size and type as src .
pub fn equalize_hist(src: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_equalizeHist_Mat_src_Mat_dst(src.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_erode_Mat_src_Mat_dst_Mat_kernel_Point_anchor_int_iterations_int_borderType_Scalar_borderValue
/// Erodes an image by using a specific structuring element.
///
/// The function erodes the source image using the specified structuring element that determines the
/// shape of a pixel neighborhood over which the minimum is taken:
///
/// <div lang='latex'>\texttt{dst} (x,y) = \min _{(x',y'): \, \texttt{element} (x',y') \ne0 } \texttt{src} (x+x',y+y')</div>
///
/// The function supports the in-place mode. Erosion can be applied several ( iterations ) times. In
/// case of multi-channel images, each channel is processed independently.
///
/// ## Parameters
/// * src: input image; the number of channels can be arbitrary, but the depth should be one of
/// CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
/// * dst: output image of the same size and type as src.
/// * kernel: structuring element used for erosion; if `element=Mat()`, a `3 x 3` rectangular
/// structuring element is used. Kernel can be created using #getStructuringElement.
/// * anchor: position of the anchor within the element; default value (-1, -1) means that the
/// anchor is at the element center.
/// * iterations: number of times erosion is applied.
/// * borderType: pixel extrapolation method, see #BorderTypes
/// * borderValue: border value in case of a constant border
/// @sa dilate, morphologyEx, getStructuringElement
///
/// ## C++ default parameters:
/// * anchor: Point(-1,-1)
/// * iterations: 1
/// * border_type: BORDER_CONSTANT
/// * border_value: morphologyDefaultBorderValue()
pub fn erode(src: &core::Mat, dst: &mut core::Mat, kernel: &core::Mat, anchor: core::Point, iterations: i32, border_type: i32, border_value: core::Scalar) -> Result<()> {
unsafe { sys::cv_core_cv_erode_Mat_src_Mat_dst_Mat_kernel_Point_anchor_int_iterations_int_borderType_Scalar_borderValue(src.as_raw_Mat(), dst.as_raw_Mat(), kernel.as_raw_Mat(), anchor, iterations, border_type, border_value) }.into_result()
}
// identifier: cv_error_int__code_String__err_const_char_X__func_const_char_X__file_int__line
pub fn error(_code: i32, _err: &str, _func: &str, _file: &str, _line: i32) -> Result<()> {
string_arg!(_err);
string_arg!(_func);
string_arg!(_file);
unsafe { sys::cv_core_cv_error_int__code_String__err_const_char_X__func_const_char_X__file_int__line(_code, _err.as_ptr(), _func.as_ptr(), _file.as_ptr(), _line) }.into_result()
}
// identifier: cv_estimateAffine2D_Mat_from_Mat_to_Mat_inliers_int_method_double_ransacReprojThreshold_size_t_maxIters_double_confidence_size_t_refineIters
/// Computes an optimal affine transformation between two 2D point sets.
///
/// It computes
/// <div lang='latex'>
/// \begin{bmatrix}
/// x\\
/// y\\
/// \end{bmatrix}
/// =
/// \begin{bmatrix}
/// a_{11} & a_{12}\\
/// a_{21} & a_{22}\\
/// \end{bmatrix}
/// \begin{bmatrix}
/// X\\
/// Y\\
/// \end{bmatrix}
/// +
/// \begin{bmatrix}
/// b_1\\
/// b_2\\
/// \end{bmatrix}
/// </div>
///
/// ## Parameters
/// * from: First input 2D point set containing <span lang='latex'>(X,Y)</span>.
/// * to: Second input 2D point set containing <span lang='latex'>(x,y)</span>.
/// * inliers: Output vector indicating which points are inliers (1-inlier, 0-outlier).
/// * method: Robust method used to compute transformation. The following methods are possible:
/// * cv::RANSAC - RANSAC-based robust method
/// * cv::LMEDS - Least-Median robust method
/// RANSAC is the default method.
/// * ransacReprojThreshold: Maximum reprojection error in the RANSAC algorithm to consider
/// a point as an inlier. Applies only to RANSAC.
/// * maxIters: The maximum number of robust method iterations.
/// * confidence: Confidence level, between 0 and 1, for the estimated transformation. Anything
/// between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation
/// significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation.
/// * refineIters: Maximum number of iterations of refining algorithm (Levenberg-Marquardt).
/// Passing 0 will disable refining, so the output matrix will be output of robust method.
///
/// @return Output 2D affine transformation matrix <span lang='latex'>2 \times 3</span> or empty matrix if transformation
/// could not be estimated. The returned matrix has the following form:
/// <div lang='latex'>
/// \begin{bmatrix}
/// a_{11} & a_{12} & b_1\\
/// a_{21} & a_{22} & b_2\\
/// \end{bmatrix}
/// </div>
///
/// The function estimates an optimal 2D affine transformation between two 2D point sets using the
/// selected robust algorithm.
///
/// The computed transformation is then refined further (using only inliers) with the
/// Levenberg-Marquardt method to reduce the re-projection error even more.
///
///
/// Note:
/// The RANSAC method can handle practically any ratio of outliers but needs a threshold to
/// distinguish inliers from outliers. The method LMeDS does not need any threshold but it works
/// correctly only when there are more than 50% of inliers.
///
/// @sa estimateAffinePartial2D, getAffineTransform
///
/// ## C++ default parameters:
/// * inliers: noArray()
/// * method: RANSAC
/// * ransac_reproj_threshold: 3
/// * max_iters: 2000
/// * confidence: 0.99
/// * refine_iters: 10
pub fn estimate_affine2_d(from: &core::Mat, to: &core::Mat, inliers: &mut core::Mat, method: i32, ransac_reproj_threshold: f64, max_iters: size_t, confidence: f64, refine_iters: size_t) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_estimateAffine2D_Mat_from_Mat_to_Mat_inliers_int_method_double_ransacReprojThreshold_size_t_maxIters_double_confidence_size_t_refineIters(from.as_raw_Mat(), to.as_raw_Mat(), inliers.as_raw_Mat(), method, ransac_reproj_threshold, max_iters, confidence, refine_iters) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_estimateAffine3D_Mat_src_Mat_dst_Mat_out_Mat_inliers_double_ransacThreshold_double_confidence
/// Computes an optimal affine transformation between two 3D point sets.
///
/// It computes
/// <div lang='latex'>
/// \begin{bmatrix}
/// x\\
/// y\\
/// z\\
/// \end{bmatrix}
/// =
/// \begin{bmatrix}
/// a_{11} & a_{12} & a_{13}\\
/// a_{21} & a_{22} & a_{23}\\
/// a_{31} & a_{32} & a_{33}\\
/// \end{bmatrix}
/// \begin{bmatrix}
/// X\\
/// Y\\
/// Z\\
/// \end{bmatrix}
/// +
/// \begin{bmatrix}
/// b_1\\
/// b_2\\
/// b_3\\
/// \end{bmatrix}
/// </div>
///
/// ## Parameters
/// * src: First input 3D point set containing <span lang='latex'>(X,Y,Z)</span>.
/// * dst: Second input 3D point set containing <span lang='latex'>(x,y,z)</span>.
/// * out: Output 3D affine transformation matrix <span lang='latex'>3 \times 4</span> of the form
/// <div lang='latex'>
/// \begin{bmatrix}
/// a_{11} & a_{12} & a_{13} & b_1\\
/// a_{21} & a_{22} & a_{23} & b_2\\
/// a_{31} & a_{32} & a_{33} & b_3\\
/// \end{bmatrix}
/// </div>
/// * inliers: Output vector indicating which points are inliers (1-inlier, 0-outlier).
/// * ransacThreshold: Maximum reprojection error in the RANSAC algorithm to consider a point as
/// an inlier.
/// * confidence: Confidence level, between 0 and 1, for the estimated transformation. Anything
/// between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation
/// significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation.
///
/// The function estimates an optimal 3D affine transformation between two 3D point sets using the
/// RANSAC algorithm.
///
/// ## C++ default parameters:
/// * ransac_threshold: 3
/// * confidence: 0.99
pub fn estimate_affine3_d(src: &core::Mat, dst: &core::Mat, out: &mut core::Mat, inliers: &mut core::Mat, ransac_threshold: f64, confidence: f64) -> Result<i32> {
unsafe { sys::cv_core_cv_estimateAffine3D_Mat_src_Mat_dst_Mat_out_Mat_inliers_double_ransacThreshold_double_confidence(src.as_raw_Mat(), dst.as_raw_Mat(), out.as_raw_Mat(), inliers.as_raw_Mat(), ransac_threshold, confidence) }.into_result()
}
// identifier: cv_estimateAffinePartial2D_Mat_from_Mat_to_Mat_inliers_int_method_double_ransacReprojThreshold_size_t_maxIters_double_confidence_size_t_refineIters
/// Computes an optimal limited affine transformation with 4 degrees of freedom between
/// two 2D point sets.
///
/// ## Parameters
/// * from: First input 2D point set.
/// * to: Second input 2D point set.
/// * inliers: Output vector indicating which points are inliers.
/// * method: Robust method used to compute transformation. The following methods are possible:
/// * cv::RANSAC - RANSAC-based robust method
/// * cv::LMEDS - Least-Median robust method
/// RANSAC is the default method.
/// * ransacReprojThreshold: Maximum reprojection error in the RANSAC algorithm to consider
/// a point as an inlier. Applies only to RANSAC.
/// * maxIters: The maximum number of robust method iterations.
/// * confidence: Confidence level, between 0 and 1, for the estimated transformation. Anything
/// between 0.95 and 0.99 is usually good enough. Values too close to 1 can slow down the estimation
/// significantly. Values lower than 0.8-0.9 can result in an incorrectly estimated transformation.
/// * refineIters: Maximum number of iterations of refining algorithm (Levenberg-Marquardt).
/// Passing 0 will disable refining, so the output matrix will be output of robust method.
///
/// @return Output 2D affine transformation (4 degrees of freedom) matrix <span lang='latex'>2 \times 3</span> or
/// empty matrix if transformation could not be estimated.
///
/// The function estimates an optimal 2D affine transformation with 4 degrees of freedom limited to
/// combinations of translation, rotation, and uniform scaling. Uses the selected algorithm for robust
/// estimation.
///
/// The computed transformation is then refined further (using only inliers) with the
/// Levenberg-Marquardt method to reduce the re-projection error even more.
///
/// Estimated transformation matrix is:
/// <div lang='latex'> \begin{bmatrix} \cos(\theta) \cdot s & -\sin(\theta) \cdot s & t_x \\
/// \sin(\theta) \cdot s & \cos(\theta) \cdot s & t_y
/// \end{bmatrix} </div>
/// Where <span lang='latex'> \theta </span> is the rotation angle, <span lang='latex'> s </span> the scaling factor and <span lang='latex'> t_x, t_y </span> are
/// translations in <span lang='latex'> x, y </span> axes respectively.
///
///
/// Note:
/// The RANSAC method can handle practically any ratio of outliers but need a threshold to
/// distinguish inliers from outliers. The method LMeDS does not need any threshold but it works
/// correctly only when there are more than 50% of inliers.
///
/// @sa estimateAffine2D, getAffineTransform
///
/// ## C++ default parameters:
/// * inliers: noArray()
/// * method: RANSAC
/// * ransac_reproj_threshold: 3
/// * max_iters: 2000
/// * confidence: 0.99
/// * refine_iters: 10
pub fn estimate_affine_partial2_d(from: &core::Mat, to: &core::Mat, inliers: &mut core::Mat, method: i32, ransac_reproj_threshold: f64, max_iters: size_t, confidence: f64, refine_iters: size_t) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_estimateAffinePartial2D_Mat_from_Mat_to_Mat_inliers_int_method_double_ransacReprojThreshold_size_t_maxIters_double_confidence_size_t_refineIters(from.as_raw_Mat(), to.as_raw_Mat(), inliers.as_raw_Mat(), method, ransac_reproj_threshold, max_iters, confidence, refine_iters) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_estimateRigidTransform_Mat_src_Mat_dst_bool_fullAffine
/// Computes an optimal affine transformation between two 2D point sets.
///
/// ## Parameters
/// * src: First input 2D point set stored in std::vector or Mat, or an image stored in Mat.
/// * dst: Second input 2D point set of the same size and the same type as A, or another image.
/// * fullAffine: If true, the function finds an optimal affine transformation with no additional
/// restrictions (6 degrees of freedom). Otherwise, the class of transformations to choose from is
/// limited to combinations of translation, rotation, and uniform scaling (4 degrees of freedom).
///
/// The function finds an optimal affine transform *[A|b]* (a 2 x 3 floating-point matrix) that
/// approximates best the affine transformation between:
///
/// Two point sets
/// Two raster images. In this case, the function first finds some features in the src image and
/// finds the corresponding features in dst image. After that, the problem is reduced to the first
/// case.
/// In case of point sets, the problem is formulated as follows: you need to find a 2x2 matrix *A* and
/// 2x1 vector *b* so that:
///
/// <div lang='latex'>[A^*|b^*] = arg \min _{[A|b]} \sum _i \| \texttt{dst}[i] - A { \texttt{src}[i]}^T - b \| ^2</div>
/// where src[i] and dst[i] are the i-th points in src and dst, respectively
/// <span lang='latex'>[A|b]</span> can be either arbitrary (when fullAffine=true ) or have a form of
/// <div lang='latex'>\begin{bmatrix} a_{11} & a_{12} & b_1 \\ -a_{12} & a_{11} & b_2 \end{bmatrix}</div>
/// when fullAffine=false.
///
/// @sa
/// estimateAffine2D, estimateAffinePartial2D, getAffineTransform, getPerspectiveTransform, findHomography
pub fn estimate_rigid_transform(src: &core::Mat, dst: &core::Mat, full_affine: bool) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_estimateRigidTransform_Mat_src_Mat_dst_bool_fullAffine(src.as_raw_Mat(), dst.as_raw_Mat(), full_affine) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_estimateRigidTransform_Mat_src_Mat_dst_bool_fullAffine_int_ransacMaxIters_double_ransacGoodRatio_int_ransacSize0
pub fn estimate_rigid_transform_1(src: &core::Mat, dst: &core::Mat, full_affine: bool, ransac_max_iters: i32, ransac_good_ratio: f64, ransac_size0: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_estimateRigidTransform_Mat_src_Mat_dst_bool_fullAffine_int_ransacMaxIters_double_ransacGoodRatio_int_ransacSize0(src.as_raw_Mat(), dst.as_raw_Mat(), full_affine, ransac_max_iters, ransac_good_ratio, ransac_size0) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_evaluateFeatureDetector_Mat_img1_Mat_img2_Mat_H1to2_VectorOfKeyPoint_keypoints1_VectorOfKeyPoint_keypoints2_float_repeatability_int_correspCount_PtrOfFeature2D_fdetector
/// \
/// Functions to evaluate the feature detectors and [generic] descriptor extractors *
///
/// ## C++ default parameters:
/// * fdetector: Ptr<FeatureDetector>()
pub fn evaluate_feature_detector(img1: &core::Mat, img2: &core::Mat, h1to2: &core::Mat, keypoints1: &types::VectorOfKeyPoint, keypoints2: &types::VectorOfKeyPoint, repeatability: f32, corresp_count: i32, fdetector: &types::PtrOfFeature2D) -> Result<()> {
unsafe { sys::cv_core_cv_evaluateFeatureDetector_Mat_img1_Mat_img2_Mat_H1to2_VectorOfKeyPoint_keypoints1_VectorOfKeyPoint_keypoints2_float_repeatability_int_correspCount_PtrOfFeature2D_fdetector(img1.as_raw_Mat(), img2.as_raw_Mat(), h1to2.as_raw_Mat(), keypoints1.as_raw_VectorOfKeyPoint(), keypoints2.as_raw_VectorOfKeyPoint(), repeatability, corresp_count, fdetector.as_raw_PtrOfFeature2D()) }.into_result()
}
// identifier: cv_exp_Mat_src_Mat_dst
/// Calculates the exponent of every array element.
///
/// The function cv::exp calculates the exponent of every element of the input
/// array:
/// <div lang='latex'>\texttt{dst} [I] = e^{ src(I) }</div>
///
/// The maximum relative error is about 7e-6 for single-precision input and
/// less than 1e-10 for double-precision input. Currently, the function
/// converts denormalized values to zeros on output. Special values (NaN,
/// Inf) are not handled.
/// ## Parameters
/// * src: input array.
/// * dst: output array of the same size and type as src.
/// @sa log , cartToPolar , polarToCart , phase , pow , sqrt , magnitude
pub fn exp(src: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_exp_Mat_src_Mat_dst(src.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_exp_softdouble_a
pub fn exp_1(a: &core::softdouble) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_exp_softdouble_a(a.as_raw_softdouble()) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_exp_softfloat_a
/// Exponent
///
/// Special cases:
/// - exp(NaN) is NaN
/// - exp(-Inf) == 0
/// - exp(+Inf) == +Inf
pub fn exp_2(a: &core::softfloat) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_exp_softfloat_a(a.as_raw_softfloat()) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_extractChannel_Mat_src_Mat_dst_int_coi
/// Extracts a single channel from src (coi is 0-based index)
/// ## Parameters
/// * src: input array
/// * dst: output array
/// * coi: index of channel to extract
/// @sa mixChannels, split
pub fn extract_channel(src: &core::Mat, dst: &mut core::Mat, coi: i32) -> Result<()> {
unsafe { sys::cv_core_cv_extractChannel_Mat_src_Mat_dst_int_coi(src.as_raw_Mat(), dst.as_raw_Mat(), coi) }.into_result()
}
// identifier: cv_fastAtan2_float_y_float_x
/// Calculates the angle of a 2D vector in degrees.
///
/// The function fastAtan2 calculates the full-range angle of an input 2D vector. The angle is measured
/// in degrees and varies from 0 to 360 degrees. The accuracy is about 0.3 degrees.
/// ## Parameters
/// * x: x-coordinate of the vector.
/// * y: y-coordinate of the vector.
pub fn fast_atan2(y: f32, x: f32) -> Result<f32> {
unsafe { sys::cv_core_cv_fastAtan2_float_y_float_x(y, x) }.into_result()
}
// identifier: cv_fastNlMeansDenoisingColoredMulti_VectorOfMat_srcImgs_Mat_dst_int_imgToDenoiseIndex_int_temporalWindowSize_float_h_float_hColor_int_templateWindowSize_int_searchWindowSize
/// Modification of fastNlMeansDenoisingMulti function for colored images sequences
///
/// ## Parameters
/// * srcImgs: Input 8-bit 3-channel images sequence. All images should have the same type and
/// size.
/// * imgToDenoiseIndex: Target image to denoise index in srcImgs sequence
/// * temporalWindowSize: Number of surrounding images to use for target image denoising. Should
/// be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
/// imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
/// srcImgs[imgToDenoiseIndex] image.
/// * dst: Output image with the same size and type as srcImgs images.
/// * templateWindowSize: Size in pixels of the template patch that is used to compute weights.
/// Should be odd. Recommended value 7 pixels
/// * searchWindowSize: Size in pixels of the window that is used to compute weighted average for
/// given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
/// denoising time. Recommended value 21 pixels
/// * h: Parameter regulating filter strength for luminance component. Bigger h value perfectly
/// removes noise but also removes image details, smaller h value preserves details but also preserves
/// some noise.
/// * hColor: The same as h but for color components.
///
/// The function converts images to CIELAB colorspace and then separately denoise L and AB components
/// with given h parameters using fastNlMeansDenoisingMulti function.
///
/// ## C++ default parameters:
/// * h: 3
/// * h_color: 3
/// * template_window_size: 7
/// * search_window_size: 21
pub fn fast_nl_means_denoising_colored_multi(src_imgs: &types::VectorOfMat, dst: &mut core::Mat, img_to_denoise_index: i32, temporal_window_size: i32, h: f32, h_color: f32, template_window_size: i32, search_window_size: i32) -> Result<()> {
unsafe { sys::cv_core_cv_fastNlMeansDenoisingColoredMulti_VectorOfMat_srcImgs_Mat_dst_int_imgToDenoiseIndex_int_temporalWindowSize_float_h_float_hColor_int_templateWindowSize_int_searchWindowSize(src_imgs.as_raw_VectorOfMat(), dst.as_raw_Mat(), img_to_denoise_index, temporal_window_size, h, h_color, template_window_size, search_window_size) }.into_result()
}
// identifier: cv_fastNlMeansDenoisingColored_Mat_src_Mat_dst_float_h_float_hColor_int_templateWindowSize_int_searchWindowSize
/// Modification of fastNlMeansDenoising function for colored images
///
/// ## Parameters
/// * src: Input 8-bit 3-channel image.
/// * dst: Output image with the same size and type as src .
/// * templateWindowSize: Size in pixels of the template patch that is used to compute weights.
/// Should be odd. Recommended value 7 pixels
/// * searchWindowSize: Size in pixels of the window that is used to compute weighted average for
/// given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
/// denoising time. Recommended value 21 pixels
/// * h: Parameter regulating filter strength for luminance component. Bigger h value perfectly
/// removes noise but also removes image details, smaller h value preserves details but also preserves
/// some noise
/// * hColor: The same as h but for color components. For most images value equals 10
/// will be enough to remove colored noise and do not distort colors
///
/// The function converts image to CIELAB colorspace and then separately denoise L and AB components
/// with given h parameters using fastNlMeansDenoising function.
///
/// ## C++ default parameters:
/// * h: 3
/// * h_color: 3
/// * template_window_size: 7
/// * search_window_size: 21
pub fn fast_nl_means_denoising_color(src: &core::Mat, dst: &mut core::Mat, h: f32, h_color: f32, template_window_size: i32, search_window_size: i32) -> Result<()> {
unsafe { sys::cv_core_cv_fastNlMeansDenoisingColored_Mat_src_Mat_dst_float_h_float_hColor_int_templateWindowSize_int_searchWindowSize(src.as_raw_Mat(), dst.as_raw_Mat(), h, h_color, template_window_size, search_window_size) }.into_result()
}
// identifier: cv_fastNlMeansDenoisingMulti_VectorOfMat_srcImgs_Mat_dst_int_imgToDenoiseIndex_int_temporalWindowSize_VectorOffloat_h_int_templateWindowSize_int_searchWindowSize_int_normType
/// Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
/// captured in small period of time. For example video. This version of the function is for grayscale
/// images or for manual manipulation with colorspaces. For more details see
/// <http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.131.6394>
///
/// ## Parameters
/// * srcImgs: Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
/// 2-channel, 3-channel or 4-channel images sequence. All images should
/// have the same type and size.
/// * imgToDenoiseIndex: Target image to denoise index in srcImgs sequence
/// * temporalWindowSize: Number of surrounding images to use for target image denoising. Should
/// be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
/// imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
/// srcImgs[imgToDenoiseIndex] image.
/// * dst: Output image with the same size and type as srcImgs images.
/// * templateWindowSize: Size in pixels of the template patch that is used to compute weights.
/// Should be odd. Recommended value 7 pixels
/// * searchWindowSize: Size in pixels of the window that is used to compute weighted average for
/// given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
/// denoising time. Recommended value 21 pixels
/// * h: Array of parameters regulating filter strength, either one
/// parameter applied to all channels or one per channel in dst. Big h value
/// perfectly removes noise but also removes image details, smaller h
/// value preserves details but also preserves some noise
/// * normType: Type of norm used for weight calculation. Can be either NORM_L2 or NORM_L1
///
/// ## C++ default parameters:
/// * template_window_size: 7
/// * search_window_size: 21
/// * norm_type: NORM_L2
pub fn fast_nl_means_denoising_multi(src_imgs: &types::VectorOfMat, dst: &mut core::Mat, img_to_denoise_index: i32, temporal_window_size: i32, h: &types::VectorOffloat, template_window_size: i32, search_window_size: i32, norm_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_fastNlMeansDenoisingMulti_VectorOfMat_srcImgs_Mat_dst_int_imgToDenoiseIndex_int_temporalWindowSize_VectorOffloat_h_int_templateWindowSize_int_searchWindowSize_int_normType(src_imgs.as_raw_VectorOfMat(), dst.as_raw_Mat(), img_to_denoise_index, temporal_window_size, h.as_raw_VectorOffloat(), template_window_size, search_window_size, norm_type) }.into_result()
}
// identifier: cv_fastNlMeansDenoisingMulti_VectorOfMat_srcImgs_Mat_dst_int_imgToDenoiseIndex_int_temporalWindowSize_float_h_int_templateWindowSize_int_searchWindowSize
/// Modification of fastNlMeansDenoising function for images sequence where consecutive images have been
/// captured in small period of time. For example video. This version of the function is for grayscale
/// images or for manual manipulation with colorspaces. For more details see
/// <http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.131.6394>
///
/// ## Parameters
/// * srcImgs: Input 8-bit 1-channel, 2-channel, 3-channel or
/// 4-channel images sequence. All images should have the same type and
/// size.
/// * imgToDenoiseIndex: Target image to denoise index in srcImgs sequence
/// * temporalWindowSize: Number of surrounding images to use for target image denoising. Should
/// be odd. Images from imgToDenoiseIndex - temporalWindowSize / 2 to
/// imgToDenoiseIndex - temporalWindowSize / 2 from srcImgs will be used to denoise
/// srcImgs[imgToDenoiseIndex] image.
/// * dst: Output image with the same size and type as srcImgs images.
/// * templateWindowSize: Size in pixels of the template patch that is used to compute weights.
/// Should be odd. Recommended value 7 pixels
/// * searchWindowSize: Size in pixels of the window that is used to compute weighted average for
/// given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
/// denoising time. Recommended value 21 pixels
/// * h: Parameter regulating filter strength. Bigger h value
/// perfectly removes noise but also removes image details, smaller h
/// value preserves details but also preserves some noise
///
/// ## C++ default parameters:
/// * h: 3
/// * template_window_size: 7
/// * search_window_size: 21
pub fn fast_nl_means_denoising_multi_1(src_imgs: &types::VectorOfMat, dst: &mut core::Mat, img_to_denoise_index: i32, temporal_window_size: i32, h: f32, template_window_size: i32, search_window_size: i32) -> Result<()> {
unsafe { sys::cv_core_cv_fastNlMeansDenoisingMulti_VectorOfMat_srcImgs_Mat_dst_int_imgToDenoiseIndex_int_temporalWindowSize_float_h_int_templateWindowSize_int_searchWindowSize(src_imgs.as_raw_VectorOfMat(), dst.as_raw_Mat(), img_to_denoise_index, temporal_window_size, h, template_window_size, search_window_size) }.into_result()
}
// identifier: cv_fastNlMeansDenoising_Mat_src_Mat_dst_VectorOffloat_h_int_templateWindowSize_int_searchWindowSize_int_normType
/// Perform image denoising using Non-local Means Denoising algorithm
/// <http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/> with several computational
/// optimizations. Noise expected to be a gaussian white noise
///
/// ## Parameters
/// * src: Input 8-bit or 16-bit (only with NORM_L1) 1-channel,
/// 2-channel, 3-channel or 4-channel image.
/// * dst: Output image with the same size and type as src .
/// * templateWindowSize: Size in pixels of the template patch that is used to compute weights.
/// Should be odd. Recommended value 7 pixels
/// * searchWindowSize: Size in pixels of the window that is used to compute weighted average for
/// given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
/// denoising time. Recommended value 21 pixels
/// * h: Array of parameters regulating filter strength, either one
/// parameter applied to all channels or one per channel in dst. Big h value
/// perfectly removes noise but also removes image details, smaller h
/// value preserves details but also preserves some noise
/// * normType: Type of norm used for weight calculation. Can be either NORM_L2 or NORM_L1
///
/// This function expected to be applied to grayscale images. For colored images look at
/// fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
/// image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
/// image to CIELAB colorspace and then separately denoise L and AB components with different h
/// parameter.
///
/// ## C++ default parameters:
/// * template_window_size: 7
/// * search_window_size: 21
/// * norm_type: NORM_L2
pub fn fast_nl_means_denoising_vec(src: &core::Mat, dst: &mut core::Mat, h: &types::VectorOffloat, template_window_size: i32, search_window_size: i32, norm_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_fastNlMeansDenoising_Mat_src_Mat_dst_VectorOffloat_h_int_templateWindowSize_int_searchWindowSize_int_normType(src.as_raw_Mat(), dst.as_raw_Mat(), h.as_raw_VectorOffloat(), template_window_size, search_window_size, norm_type) }.into_result()
}
// identifier: cv_fastNlMeansDenoising_Mat_src_Mat_dst_float_h_int_templateWindowSize_int_searchWindowSize
/// Perform image denoising using Non-local Means Denoising algorithm
/// <http://www.ipol.im/pub/algo/bcm_non_local_means_denoising/> with several computational
/// optimizations. Noise expected to be a gaussian white noise
///
/// ## Parameters
/// * src: Input 8-bit 1-channel, 2-channel, 3-channel or 4-channel image.
/// * dst: Output image with the same size and type as src .
/// * templateWindowSize: Size in pixels of the template patch that is used to compute weights.
/// Should be odd. Recommended value 7 pixels
/// * searchWindowSize: Size in pixels of the window that is used to compute weighted average for
/// given pixel. Should be odd. Affect performance linearly: greater searchWindowsSize - greater
/// denoising time. Recommended value 21 pixels
/// * h: Parameter regulating filter strength. Big h value perfectly removes noise but also
/// removes image details, smaller h value preserves details but also preserves some noise
///
/// This function expected to be applied to grayscale images. For colored images look at
/// fastNlMeansDenoisingColored. Advanced usage of this functions can be manual denoising of colored
/// image in different colorspaces. Such approach is used in fastNlMeansDenoisingColored by converting
/// image to CIELAB colorspace and then separately denoise L and AB components with different h
/// parameter.
///
/// ## C++ default parameters:
/// * h: 3
/// * template_window_size: 7
/// * search_window_size: 21
pub fn fast_nl_means_denoising_window(src: &core::Mat, dst: &mut core::Mat, h: f32, template_window_size: i32, search_window_size: i32) -> Result<()> {
unsafe { sys::cv_core_cv_fastNlMeansDenoising_Mat_src_Mat_dst_float_h_int_templateWindowSize_int_searchWindowSize(src.as_raw_Mat(), dst.as_raw_Mat(), h, template_window_size, search_window_size) }.into_result()
}
// identifier: cv_fillConvexPoly_Mat_img_Mat_points_Scalar_color_int_lineType_int_shift
/// Fills a convex polygon.
///
/// The function cv::fillConvexPoly draws a filled convex polygon. This function is much faster than the
/// function #fillPoly . It can fill not only convex polygons but any monotonic polygon without
/// self-intersections, that is, a polygon whose contour intersects every horizontal line (scan line)
/// twice at the most (though, its top-most and/or the bottom edge could be horizontal).
///
/// ## Parameters
/// * img: Image.
/// * points: Polygon vertices.
/// * color: Polygon color.
/// * lineType: Type of the polygon boundaries. See #LineTypes
/// * shift: Number of fractional bits in the vertex coordinates.
///
/// ## C++ default parameters:
/// * line_type: LINE_8
/// * shift: 0
pub fn fill_convex_poly(img: &mut core::Mat, points: &core::Mat, color: core::Scalar, line_type: i32, shift: i32) -> Result<()> {
unsafe { sys::cv_core_cv_fillConvexPoly_Mat_img_Mat_points_Scalar_color_int_lineType_int_shift(img.as_raw_Mat(), points.as_raw_Mat(), color, line_type, shift) }.into_result()
}
// identifier: cv_fillConvexPoly_Mat_img_const_Point_X_pts_int_npts_Scalar_color_int_lineType_int_shift
/// @overload
///
/// ## C++ default parameters:
/// * line_type: LINE_8
/// * shift: 0
pub fn fill_convex_poly_1(img: &core::Mat, pts: &core::Point, npts: i32, color: core::Scalar, line_type: i32, shift: i32) -> Result<()> {
unsafe { sys::cv_core_cv_fillConvexPoly_Mat_img_const_Point_X_pts_int_npts_Scalar_color_int_lineType_int_shift(img.as_raw_Mat(), pts, npts, color, line_type, shift) }.into_result()
}
// identifier: cv_fillPoly_Mat_img_VectorOfMat_pts_Scalar_color_int_lineType_int_shift_Point_offset
/// Fills the area bounded by one or more polygons.
///
/// The function cv::fillPoly fills an area bounded by several polygonal contours. The function can fill
/// complex areas, for example, areas with holes, contours with self-intersections (some of their
/// parts), and so forth.
///
/// ## Parameters
/// * img: Image.
/// * pts: Array of polygons where each polygon is represented as an array of points.
/// * color: Polygon color.
/// * lineType: Type of the polygon boundaries. See #LineTypes
/// * shift: Number of fractional bits in the vertex coordinates.
/// * offset: Optional offset of all points of the contours.
///
/// ## C++ default parameters:
/// * line_type: LINE_8
/// * shift: 0
/// * offset: Point()
pub fn fill_poly(img: &mut core::Mat, pts: &types::VectorOfMat, color: core::Scalar, line_type: i32, shift: i32, offset: core::Point) -> Result<()> {
unsafe { sys::cv_core_cv_fillPoly_Mat_img_VectorOfMat_pts_Scalar_color_int_lineType_int_shift_Point_offset(img.as_raw_Mat(), pts.as_raw_VectorOfMat(), color, line_type, shift, offset) }.into_result()
}
// identifier: cv_filter2D_Mat_src_Mat_dst_int_ddepth_Mat_kernel_Point_anchor_double_delta_int_borderType
/// Convolves an image with the kernel.
///
/// The function applies an arbitrary linear filter to an image. In-place operation is supported. When
/// the aperture is partially outside the image, the function interpolates outlier pixel values
/// according to the specified border mode.
///
/// The function does actually compute correlation, not the convolution:
///
/// <div lang='latex'>\texttt{dst} (x,y) = \sum _{ \stackrel{0\leq x' < \texttt{kernel.cols},}{0\leq y' < \texttt{kernel.rows}} } \texttt{kernel} (x',y')* \texttt{src} (x+x'- \texttt{anchor.x} ,y+y'- \texttt{anchor.y} )</div>
///
/// That is, the kernel is not mirrored around the anchor point. If you need a real convolution, flip
/// the kernel using #flip and set the new anchor to `(kernel.cols - anchor.x - 1, kernel.rows -
/// anchor.y - 1)`.
///
/// The function uses the DFT-based algorithm in case of sufficiently large kernels (~`11 x 11` or
/// larger) and the direct algorithm for small kernels.
///
/// ## Parameters
/// * src: input image.
/// * dst: output image of the same size and the same number of channels as src.
/// * ddepth: desired depth of the destination image, see @ref filter_depths "combinations"
/// * kernel: convolution kernel (or rather a correlation kernel), a single-channel floating point
/// matrix; if you want to apply different kernels to different channels, split the image into
/// separate color planes using split and process them individually.
/// * anchor: anchor of the kernel that indicates the relative position of a filtered point within
/// the kernel; the anchor should lie within the kernel; default value (-1,-1) means that the anchor
/// is at the kernel center.
/// * delta: optional value added to the filtered pixels before storing them in dst.
/// * borderType: pixel extrapolation method, see #BorderTypes
/// @sa sepFilter2D, dft, matchTemplate
///
/// ## C++ default parameters:
/// * anchor: Point(-1,-1)
/// * delta: 0
/// * border_type: BORDER_DEFAULT
pub fn filter2_d(src: &core::Mat, dst: &mut core::Mat, ddepth: i32, kernel: &core::Mat, anchor: core::Point, delta: f64, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_filter2D_Mat_src_Mat_dst_int_ddepth_Mat_kernel_Point_anchor_double_delta_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ddepth, kernel.as_raw_Mat(), anchor, delta, border_type) }.into_result()
}
// identifier: cv_filterHomographyDecompByVisibleRefpoints_VectorOfMat_rotations_VectorOfMat_normals_Mat_beforePoints_Mat_afterPoints_Mat_possibleSolutions_Mat_pointsMask
/// Filters homography decompositions based on additional information.
///
/// ## Parameters
/// * rotations: Vector of rotation matrices.
/// * normals: Vector of plane normal matrices.
/// * beforePoints: Vector of (rectified) visible reference points before the homography is applied
/// * afterPoints: Vector of (rectified) visible reference points after the homography is applied
/// * possibleSolutions: Vector of int indices representing the viable solution set after filtering
/// * pointsMask: optional Mat/Vector of 8u type representing the mask for the inliers as given by the findHomography function
///
/// This function is intended to filter the output of the decomposeHomographyMat based on additional
/// information as described in @cite Malis . The summary of the method: the decomposeHomographyMat function
/// returns 2 unique solutions and their "opposites" for a total of 4 solutions. If we have access to the
/// sets of points visible in the camera frame before and after the homography transformation is applied,
/// we can determine which are the true potential solutions and which are the opposites by verifying which
/// homographies are consistent with all visible reference points being in front of the camera. The inputs
/// are left unchanged; the filtered solution set is returned as indices into the existing one.
///
/// ## C++ default parameters:
/// * points_mask: noArray()
pub fn filter_homography_decomp_by_visible_refpoints(rotations: &types::VectorOfMat, normals: &types::VectorOfMat, before_points: &core::Mat, after_points: &core::Mat, possible_solutions: &mut core::Mat, points_mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_filterHomographyDecompByVisibleRefpoints_VectorOfMat_rotations_VectorOfMat_normals_Mat_beforePoints_Mat_afterPoints_Mat_possibleSolutions_Mat_pointsMask(rotations.as_raw_VectorOfMat(), normals.as_raw_VectorOfMat(), before_points.as_raw_Mat(), after_points.as_raw_Mat(), possible_solutions.as_raw_Mat(), points_mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_filterSpeckles_Mat_img_double_newVal_int_maxSpeckleSize_double_maxDiff_Mat_buf
/// Filters off small noise blobs (speckles) in the disparity map
///
/// ## Parameters
/// * img: The input 16-bit signed disparity image
/// * newVal: The disparity value used to paint-off the speckles
/// * maxSpeckleSize: The maximum speckle size to consider it a speckle. Larger blobs are not
/// affected by the algorithm
/// * maxDiff: Maximum difference between neighbor disparity pixels to put them into the same
/// blob. Note that since StereoBM, StereoSGBM and may be other algorithms return a fixed-point
/// disparity map, where disparity values are multiplied by 16, this scale factor should be taken into
/// account when specifying this parameter value.
/// * buf: The optional temporary buffer to avoid memory allocation within the function.
///
/// ## C++ default parameters:
/// * buf: noArray()
pub fn filter_speckles(img: &mut core::Mat, new_val: f64, max_speckle_size: i32, max_diff: f64, buf: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_filterSpeckles_Mat_img_double_newVal_int_maxSpeckleSize_double_maxDiff_Mat_buf(img.as_raw_Mat(), new_val, max_speckle_size, max_diff, buf.as_raw_Mat()) }.into_result()
}
// identifier: cv_find4QuadCornerSubpix_Mat_img_Mat_corners_Size_region_size
pub fn find4_quad_corner_subpix(img: &core::Mat, corners: &mut core::Mat, region_size: core::Size) -> Result<bool> {
unsafe { sys::cv_core_cv_find4QuadCornerSubpix_Mat_img_Mat_corners_Size_region_size(img.as_raw_Mat(), corners.as_raw_Mat(), region_size) }.into_result()
}
// identifier: cv_findChessboardCorners_Mat_image_Size_patternSize_Mat_corners_int_flags
/// Finds the positions of internal corners of the chessboard.
///
/// ## Parameters
/// * image: Source chessboard view. It must be an 8-bit grayscale or color image.
/// * patternSize: Number of inner corners per a chessboard row and column
/// ( patternSize = cvSize(points_per_row,points_per_colum) = cvSize(columns,rows) ).
/// * corners: Output array of detected corners.
/// * flags: Various operation flags that can be zero or a combination of the following values:
/// * **CALIB_CB_ADAPTIVE_THRESH** Use adaptive thresholding to convert the image to black
/// and white, rather than a fixed threshold level (computed from the average image brightness).
/// * **CALIB_CB_NORMALIZE_IMAGE** Normalize the image gamma with equalizeHist before
/// applying fixed or adaptive thresholding.
/// * **CALIB_CB_FILTER_QUADS** Use additional criteria (like contour area, perimeter,
/// square-like shape) to filter out false quads extracted at the contour retrieval stage.
/// * **CALIB_CB_FAST_CHECK** Run a fast check on the image that looks for chessboard corners,
/// and shortcut the call if none is found. This can drastically speed up the call in the
/// degenerate condition when no chessboard is observed.
///
/// The function attempts to determine whether the input image is a view of the chessboard pattern and
/// locate the internal chessboard corners. The function returns a non-zero value if all of the corners
/// are found and they are placed in a certain order (row by row, left to right in every row).
/// Otherwise, if the function fails to find all the corners or reorder them, it returns 0. For example,
/// a regular chessboard has 8 x 8 squares and 7 x 7 internal corners, that is, points where the black
/// squares touch each other. The detected coordinates are approximate, and to determine their positions
/// more accurately, the function calls cornerSubPix. You also may use the function cornerSubPix with
/// different parameters if returned coordinates are not accurate enough.
///
/// Sample usage of detecting and drawing chessboard corners: :
/// ```ignore
/// Size patternsize(8,6); //interior number of corners
/// Mat gray = ....; //source image
/// vector<Point2f> corners; //this will be filled by the detected corners
///
/// //CALIB_CB_FAST_CHECK saves a lot of time on images
/// //that do not contain any chessboard corners
/// bool patternfound = findChessboardCorners(gray, patternsize, corners,
/// CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE
/// + CALIB_CB_FAST_CHECK);
///
/// if(patternfound)
/// cornerSubPix(gray, corners, Size(11, 11), Size(-1, -1),
/// TermCriteria(CV_TERMCRIT_EPS + CV_TERMCRIT_ITER, 30, 0.1));
///
/// drawChessboardCorners(img, patternsize, Mat(corners), patternfound);
/// ```
///
///
/// Note: The function requires white space (like a square-thick border, the wider the better) around
/// the board to make the detection more robust in various environments. Otherwise, if there is no
/// border and the background is dark, the outer black squares cannot be segmented properly and so the
/// square grouping and ordering algorithm fails.
///
/// ## C++ default parameters:
/// * flags: CALIB_CB_ADAPTIVE_THRESH + CALIB_CB_NORMALIZE_IMAGE
pub fn find_chessboard_corners(image: &core::Mat, pattern_size: core::Size, corners: &mut core::Mat, flags: i32) -> Result<bool> {
unsafe { sys::cv_core_cv_findChessboardCorners_Mat_image_Size_patternSize_Mat_corners_int_flags(image.as_raw_Mat(), pattern_size, corners.as_raw_Mat(), flags) }.into_result()
}
// identifier: cv_findContours_Mat_image_VectorOfMat_contours_Mat_hierarchy_int_mode_int_method_Point_offset
/// Finds contours in a binary image.
///
/// The function retrieves contours from the binary image using the algorithm @cite Suzuki85 . The contours
/// are a useful tool for shape analysis and object detection and recognition. See squares.cpp in the
/// OpenCV sample directory.
///
/// Note: Since opencv 3.2 source image is not modified by this function.
///
/// ## Parameters
/// * image: Source, an 8-bit single-channel image. Non-zero pixels are treated as 1's. Zero
/// pixels remain 0's, so the image is treated as binary . You can use #compare, #inRange, #threshold ,
/// #adaptiveThreshold, #Canny, and others to create a binary image out of a grayscale or color one.
/// If mode equals to #RETR_CCOMP or #RETR_FLOODFILL, the input can also be a 32-bit integer image of labels (CV_32SC1).
/// * contours: Detected contours. Each contour is stored as a vector of points (e.g.
/// std::vector<std::vector<cv::Point> >).
/// * hierarchy: Optional output vector (e.g. std::vector<cv::Vec4i>), containing information about the image topology. It has
/// as many elements as the number of contours. For each i-th contour contours[i], the elements
/// hierarchy[i][0] , hierarchy[i][1] , hierarchy[i][2] , and hierarchy[i][3] are set to 0-based indices
/// in contours of the next and previous contours at the same hierarchical level, the first child
/// contour and the parent contour, respectively. If for the contour i there are no next, previous,
/// parent, or nested contours, the corresponding elements of hierarchy[i] will be negative.
/// * mode: Contour retrieval mode, see #RetrievalModes
/// * method: Contour approximation method, see #ContourApproximationModes
/// * offset: Optional offset by which every contour point is shifted. This is useful if the
/// contours are extracted from the image ROI and then they should be analyzed in the whole image
/// context.
///
/// ## C++ default parameters:
/// * offset: Point()
pub fn find_contours_with_hierarchy(image: &mut core::Mat, contours: &mut types::VectorOfMat, hierarchy: &mut core::Mat, mode: i32, method: i32, offset: core::Point) -> Result<()> {
unsafe { sys::cv_core_cv_findContours_Mat_image_VectorOfMat_contours_Mat_hierarchy_int_mode_int_method_Point_offset(image.as_raw_Mat(), contours.as_raw_VectorOfMat(), hierarchy.as_raw_Mat(), mode, method, offset) }.into_result()
}
// identifier: cv_findContours_Mat_image_VectorOfMat_contours_int_mode_int_method_Point_offset
/// @overload
///
/// ## C++ default parameters:
/// * offset: Point()
pub fn find_contours(image: &mut core::Mat, contours: &mut types::VectorOfMat, mode: i32, method: i32, offset: core::Point) -> Result<()> {
unsafe { sys::cv_core_cv_findContours_Mat_image_VectorOfMat_contours_int_mode_int_method_Point_offset(image.as_raw_Mat(), contours.as_raw_VectorOfMat(), mode, method, offset) }.into_result()
}
// identifier: cv_findEssentialMat_Mat_points1_Mat_points2_Mat_cameraMatrix_int_method_double_prob_double_threshold_Mat_mask
/// Calculates an essential matrix from the corresponding points in two images.
///
/// ## Parameters
/// * points1: Array of N (N \>= 5) 2D points from the first image. The point coordinates should
/// be floating-point (single or double precision).
/// * points2: Array of the second image points of the same size and format as points1 .
/// * cameraMatrix: Camera matrix <span lang='latex'>K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}</span> .
/// Note that this function assumes that points1 and points2 are feature points from cameras with the
/// same camera matrix.
/// * method: Method for computing an essential matrix.
/// * **RANSAC** for the RANSAC algorithm.
/// * **LMEDS** for the LMedS algorithm.
/// * prob: Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of
/// confidence (probability) that the estimated matrix is correct.
/// * threshold: Parameter used for RANSAC. It is the maximum distance from a point to an epipolar
/// line in pixels, beyond which the point is considered an outlier and is not used for computing the
/// final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the
/// point localization, image resolution, and the image noise.
/// * mask: Output array of N elements, every element of which is set to 0 for outliers and to 1
/// for the other points. The array is computed only in the RANSAC and LMedS methods.
///
/// This function estimates essential matrix based on the five-point algorithm solver in @cite Nister03 .
/// @cite SteweniusCFS is also a related. The epipolar geometry is described by the following equation:
///
/// <div lang='latex'>[p_2; 1]^T K^{-T} E K^{-1} [p_1; 1] = 0</div>
///
/// where <span lang='latex'>E</span> is an essential matrix, <span lang='latex'>p_1</span> and <span lang='latex'>p_2</span> are corresponding points in the first and the
/// second images, respectively. The result of this function may be passed further to
/// decomposeEssentialMat or recoverPose to recover the relative pose between cameras.
///
/// ## C++ default parameters:
/// * method: RANSAC
/// * prob: 0.999
/// * threshold: 1.0
/// * mask: noArray()
pub fn find_essential_map_matrix(points1: &core::Mat, points2: &core::Mat, camera_matrix: &core::Mat, method: i32, prob: f64, threshold: f64, mask: &mut core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_findEssentialMat_Mat_points1_Mat_points2_Mat_cameraMatrix_int_method_double_prob_double_threshold_Mat_mask(points1.as_raw_Mat(), points2.as_raw_Mat(), camera_matrix.as_raw_Mat(), method, prob, threshold, mask.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_findEssentialMat_Mat_points1_Mat_points2_double_focal_Point2d_pp_int_method_double_prob_double_threshold_Mat_mask
/// @overload
/// ## Parameters
/// * points1: Array of N (N \>= 5) 2D points from the first image. The point coordinates should
/// be floating-point (single or double precision).
/// * points2: Array of the second image points of the same size and format as points1 .
/// * focal: focal length of the camera. Note that this function assumes that points1 and points2
/// are feature points from cameras with same focal length and principal point.
/// * pp: principal point of the camera.
/// * method: Method for computing a fundamental matrix.
/// * **RANSAC** for the RANSAC algorithm.
/// * **LMEDS** for the LMedS algorithm.
/// * threshold: Parameter used for RANSAC. It is the maximum distance from a point to an epipolar
/// line in pixels, beyond which the point is considered an outlier and is not used for computing the
/// final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the
/// point localization, image resolution, and the image noise.
/// * prob: Parameter used for the RANSAC or LMedS methods only. It specifies a desirable level of
/// confidence (probability) that the estimated matrix is correct.
/// * mask: Output array of N elements, every element of which is set to 0 for outliers and to 1
/// for the other points. The array is computed only in the RANSAC and LMedS methods.
///
/// This function differs from the one above that it computes camera matrix from focal length and
/// principal point:
///
/// <div lang='latex'>K =
/// \begin{bmatrix}
/// f & 0 & x_{pp} \\
/// 0 & f & y_{pp} \\
/// 0 & 0 & 1
/// \end{bmatrix}</div>
///
/// ## C++ default parameters:
/// * focal: 1.0
/// * pp: Point2d(0, 0)
/// * method: RANSAC
/// * prob: 0.999
/// * threshold: 1.0
/// * mask: noArray()
pub fn find_essential_mat(points1: &core::Mat, points2: &core::Mat, focal: f64, pp: core::Point2d, method: i32, prob: f64, threshold: f64, mask: &mut core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_findEssentialMat_Mat_points1_Mat_points2_double_focal_Point2d_pp_int_method_double_prob_double_threshold_Mat_mask(points1.as_raw_Mat(), points2.as_raw_Mat(), focal, pp, method, prob, threshold, mask.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_findFundamentalMat_Mat_points1_Mat_points2_Mat_mask_int_method_double_ransacReprojThreshold_double_confidence
/// @overload
///
/// ## C++ default parameters:
/// * method: FM_RANSAC
/// * ransac_reproj_threshold: 3.
/// * confidence: 0.99
pub fn find_fundamental_mat(points1: &core::Mat, points2: &core::Mat, mask: &mut core::Mat, method: i32, ransac_reproj_threshold: f64, confidence: f64) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_findFundamentalMat_Mat_points1_Mat_points2_Mat_mask_int_method_double_ransacReprojThreshold_double_confidence(points1.as_raw_Mat(), points2.as_raw_Mat(), mask.as_raw_Mat(), method, ransac_reproj_threshold, confidence) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_findFundamentalMat_Mat_points1_Mat_points2_int_method_double_ransacReprojThreshold_double_confidence_Mat_mask
/// Calculates a fundamental matrix from the corresponding points in two images.
///
/// ## Parameters
/// * points1: Array of N points from the first image. The point coordinates should be
/// floating-point (single or double precision).
/// * points2: Array of the second image points of the same size and format as points1 .
/// * method: Method for computing a fundamental matrix.
/// * **CV_FM_7POINT** for a 7-point algorithm. <span lang='latex'>N = 7</span>
/// * **CV_FM_8POINT** for an 8-point algorithm. <span lang='latex'>N \ge 8</span>
/// * **CV_FM_RANSAC** for the RANSAC algorithm. <span lang='latex'>N \ge 8</span>
/// * **CV_FM_LMEDS** for the LMedS algorithm. <span lang='latex'>N \ge 8</span>
/// * ransacReprojThreshold: Parameter used only for RANSAC. It is the maximum distance from a point to an epipolar
/// line in pixels, beyond which the point is considered an outlier and is not used for computing the
/// final fundamental matrix. It can be set to something like 1-3, depending on the accuracy of the
/// point localization, image resolution, and the image noise.
/// * confidence: Parameter used for the RANSAC and LMedS methods only. It specifies a desirable level
/// of confidence (probability) that the estimated matrix is correct.
/// * mask
///
/// The: epipolar geometry is described by the following equation:
///
/// <div lang='latex'>[p_2; 1]^T F [p_1; 1] = 0</div>
///
/// where <span lang='latex'>F</span> is a fundamental matrix, <span lang='latex'>p_1</span> and <span lang='latex'>p_2</span> are corresponding points in the first and the
/// second images, respectively.
///
/// The function calculates the fundamental matrix using one of four methods listed above and returns
/// the found fundamental matrix. Normally just one matrix is found. But in case of the 7-point
/// algorithm, the function may return up to 3 solutions ( <span lang='latex'>9 \times 3</span> matrix that stores all 3
/// matrices sequentially).
///
/// The calculated fundamental matrix may be passed further to computeCorrespondEpilines that finds the
/// epipolar lines corresponding to the specified points. It can also be passed to
/// stereoRectifyUncalibrated to compute the rectification transformation. :
/// ```ignore
/// // Example. Estimation of fundamental matrix using the RANSAC algorithm
/// int point_count = 100;
/// vector<Point2f> points1(point_count);
/// vector<Point2f> points2(point_count);
///
/// // initialize the points here ...
/// for( int i = 0; i < point_count; i++ )
/// {
/// points1[i] = ...;
/// points2[i] = ...;
/// }
///
/// Mat fundamental_matrix =
/// findFundamentalMat(points1, points2, FM_RANSAC, 3, 0.99);
/// ```
///
/// ## C++ default parameters:
/// * method: FM_RANSAC
/// * ransac_reproj_threshold: 3.
/// * confidence: 0.99
/// * mask: noArray()
pub fn find_fundamental_mat_1(points1: &core::Mat, points2: &core::Mat, method: i32, ransac_reproj_threshold: f64, confidence: f64, mask: &mut core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_findFundamentalMat_Mat_points1_Mat_points2_int_method_double_ransacReprojThreshold_double_confidence_Mat_mask(points1.as_raw_Mat(), points2.as_raw_Mat(), method, ransac_reproj_threshold, confidence, mask.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_findHomography_Mat_srcPoints_Mat_dstPoints_Mat_mask_int_method_double_ransacReprojThreshold
/// @overload
///
/// ## C++ default parameters:
/// * method: 0
/// * ransac_reproj_threshold: 3
pub fn find_homography(src_points: &core::Mat, dst_points: &core::Mat, mask: &mut core::Mat, method: i32, ransac_reproj_threshold: f64) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_findHomography_Mat_srcPoints_Mat_dstPoints_Mat_mask_int_method_double_ransacReprojThreshold(src_points.as_raw_Mat(), dst_points.as_raw_Mat(), mask.as_raw_Mat(), method, ransac_reproj_threshold) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_findHomography_Mat_srcPoints_Mat_dstPoints_int_method_double_ransacReprojThreshold_Mat_mask_int_maxIters_double_confidence
/// Finds a perspective transformation between two planes.
///
/// ## Parameters
/// * srcPoints: Coordinates of the points in the original plane, a matrix of the type CV_32FC2
/// or vector\<Point2f\> .
/// * dstPoints: Coordinates of the points in the target plane, a matrix of the type CV_32FC2 or
/// a vector\<Point2f\> .
/// * method: Method used to compute a homography matrix. The following methods are possible:
/// * **0** - a regular method using all the points, i.e., the least squares method
/// * **RANSAC** - RANSAC-based robust method
/// * **LMEDS** - Least-Median robust method
/// * **RHO** - PROSAC-based robust method
/// * ransacReprojThreshold: Maximum allowed reprojection error to treat a point pair as an inlier
/// (used in the RANSAC and RHO methods only). That is, if
/// <div lang='latex'>\| \texttt{dstPoints} _i - \texttt{convertPointsHomogeneous} ( \texttt{H} * \texttt{srcPoints} _i) \|_2 > \texttt{ransacReprojThreshold}</div>
/// then the point <span lang='latex'>i</span> is considered as an outlier. If srcPoints and dstPoints are measured in pixels,
/// it usually makes sense to set this parameter somewhere in the range of 1 to 10.
/// * mask: Optional output mask set by a robust method ( RANSAC or LMEDS ). Note that the input
/// mask values are ignored.
/// * maxIters: The maximum number of RANSAC iterations.
/// * confidence: Confidence level, between 0 and 1.
///
/// The function finds and returns the perspective transformation <span lang='latex'>H</span> between the source and the
/// destination planes:
///
/// <div lang='latex'>s_i \vecthree{x'_i}{y'_i}{1} \sim H \vecthree{x_i}{y_i}{1}</div>
///
/// so that the back-projection error
///
/// <div lang='latex'>\sum _i \left ( x'_i- \frac{h_{11} x_i + h_{12} y_i + h_{13}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2+ \left ( y'_i- \frac{h_{21} x_i + h_{22} y_i + h_{23}}{h_{31} x_i + h_{32} y_i + h_{33}} \right )^2</div>
///
/// is minimized. If the parameter method is set to the default value 0, the function uses all the point
/// pairs to compute an initial homography estimate with a simple least-squares scheme.
///
/// However, if not all of the point pairs ( <span lang='latex'>srcPoints_i</span>, <span lang='latex'>dstPoints_i</span> ) fit the rigid perspective
/// transformation (that is, there are some outliers), this initial estimate will be poor. In this case,
/// you can use one of the three robust methods. The methods RANSAC, LMeDS and RHO try many different
/// random subsets of the corresponding point pairs (of four pairs each, collinear pairs are discarded), estimate the homography matrix
/// using this subset and a simple least-squares algorithm, and then compute the quality/goodness of the
/// computed homography (which is the number of inliers for RANSAC or the least median re-projection error for
/// LMeDS). The best subset is then used to produce the initial estimate of the homography matrix and
/// the mask of inliers/outliers.
///
/// Regardless of the method, robust or not, the computed homography matrix is refined further (using
/// inliers only in case of a robust method) with the Levenberg-Marquardt method to reduce the
/// re-projection error even more.
///
/// The methods RANSAC and RHO can handle practically any ratio of outliers but need a threshold to
/// distinguish inliers from outliers. The method LMeDS does not need any threshold but it works
/// correctly only when there are more than 50% of inliers. Finally, if there are no outliers and the
/// noise is rather small, use the default method (method=0).
///
/// The function is used to find initial intrinsic and extrinsic matrices. Homography matrix is
/// determined up to a scale. Thus, it is normalized so that <span lang='latex'>h_{33}=1</span>. Note that whenever an <span lang='latex'>H</span> matrix
/// cannot be estimated, an empty one will be returned.
///
/// @sa
/// getAffineTransform, estimateAffine2D, estimateAffinePartial2D, getPerspectiveTransform, warpPerspective,
/// perspectiveTransform
///
/// ## C++ default parameters:
/// * method: 0
/// * ransac_reproj_threshold: 3
/// * mask: noArray()
/// * max_iters: 2000
/// * confidence: 0.995
pub fn find_homography_full(src_points: &core::Mat, dst_points: &core::Mat, method: i32, ransac_reproj_threshold: f64, mask: &mut core::Mat, max_iters: i32, confidence: f64) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_findHomography_Mat_srcPoints_Mat_dstPoints_int_method_double_ransacReprojThreshold_Mat_mask_int_maxIters_double_confidence(src_points.as_raw_Mat(), dst_points.as_raw_Mat(), method, ransac_reproj_threshold, mask.as_raw_Mat(), max_iters, confidence) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_findNonZero_Mat_src_Mat_idx
/// Returns the list of locations of non-zero pixels
///
/// Given a binary matrix (likely returned from an operation such
/// as threshold(), compare(), >, ==, etc, return all of
/// the non-zero indices as a cv::Mat or std::vector<cv::Point> (x,y)
/// For example:
/// ```ignore{.cpp}
/// cv::Mat binaryImage; // input, binary image
/// cv::Mat locations; // output, locations of non-zero pixels
/// cv::findNonZero(binaryImage, locations);
///
/// // access pixel coordinates
/// Point pnt = locations.at<Point>(i);
/// ```
///
/// or
/// ```ignore{.cpp}
/// cv::Mat binaryImage; // input, binary image
/// vector<Point> locations; // output, locations of non-zero pixels
/// cv::findNonZero(binaryImage, locations);
///
/// // access pixel coordinates
/// Point pnt = locations[i];
/// ```
///
/// ## Parameters
/// * src: single-channel array (type CV_8UC1)
/// * idx: the output array, type of cv::Mat or std::vector<Point>, corresponding to non-zero indices in the input
pub fn find_non_zero(src: &core::Mat, idx: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_findNonZero_Mat_src_Mat_idx(src.as_raw_Mat(), idx.as_raw_Mat()) }.into_result()
}
// identifier: cv_findTransformECC_Mat_templateImage_Mat_inputImage_Mat_warpMatrix_int_motionType_TermCriteria_criteria_Mat_inputMask
/// Finds the geometric transform (warp) between two images in terms of the ECC criterion @cite EP08 .
///
/// ## Parameters
/// * templateImage: single-channel template image; CV_8U or CV_32F array.
/// * inputImage: single-channel input image which should be warped with the final warpMatrix in
/// order to provide an image similar to templateImage, same type as temlateImage.
/// * warpMatrix: floating-point <span lang='latex'>2\times 3</span> or <span lang='latex'>3\times 3</span> mapping matrix (warp).
/// * motionType: parameter, specifying the type of motion:
/// * **MOTION_TRANSLATION** sets a translational motion model; warpMatrix is <span lang='latex'>2\times 3</span> with
/// the first <span lang='latex'>2\times 2</span> part being the unity matrix and the rest two parameters being
/// estimated.
/// * **MOTION_EUCLIDEAN** sets a Euclidean (rigid) transformation as motion model; three
/// parameters are estimated; warpMatrix is <span lang='latex'>2\times 3</span>.
/// * **MOTION_AFFINE** sets an affine motion model (DEFAULT); six parameters are estimated;
/// warpMatrix is <span lang='latex'>2\times 3</span>.
/// * **MOTION_HOMOGRAPHY** sets a homography as a motion model; eight parameters are
/// estimated;\`warpMatrix\` is <span lang='latex'>3\times 3</span>.
/// * criteria: parameter, specifying the termination criteria of the ECC algorithm;
/// criteria.epsilon defines the threshold of the increment in the correlation coefficient between two
/// iterations (a negative criteria.epsilon makes criteria.maxcount the only termination criterion).
/// Default values are shown in the declaration above.
/// * inputMask: An optional mask to indicate valid values of inputImage.
///
/// The function estimates the optimum transformation (warpMatrix) with respect to ECC criterion
/// (@cite EP08), that is
///
/// <div lang='latex'>\texttt{warpMatrix} = \texttt{warpMatrix} = \arg\max_{W} \texttt{ECC}(\texttt{templateImage}(x,y),\texttt{inputImage}(x',y'))</div>
///
/// where
///
/// <div lang='latex'>\begin{bmatrix} x' \\ y' \end{bmatrix} = W \cdot \begin{bmatrix} x \\ y \\ 1 \end{bmatrix}</div>
///
/// (the equation holds with homogeneous coordinates for homography). It returns the final enhanced
/// correlation coefficient, that is the correlation coefficient between the template image and the
/// final warped input image. When a <span lang='latex'>3\times 3</span> matrix is given with motionType =0, 1 or 2, the third
/// row is ignored.
///
/// Unlike findHomography and estimateRigidTransform, the function findTransformECC implements an
/// area-based alignment that builds on intensity similarities. In essence, the function updates the
/// initial transformation that roughly aligns the images. If this information is missing, the identity
/// warp (unity matrix) is used as an initialization. Note that if images undergo strong
/// displacements/rotations, an initial transformation that roughly aligns the images is necessary
/// (e.g., a simple euclidean/similarity transform that allows for the images showing the same image
/// content approximately). Use inverse warping in the second image to take an image close to the first
/// one, i.e. use the flag WARP_INVERSE_MAP with warpAffine or warpPerspective. See also the OpenCV
/// sample image_alignment.cpp that demonstrates the use of the function. Note that the function throws
/// an exception if algorithm does not converges.
///
/// @sa
/// estimateAffine2D, estimateAffinePartial2D, findHomography
///
/// ## C++ default parameters:
/// * motion_type: MOTION_AFFINE
/// * criteria: TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 50, 0.001)
/// * input_mask: noArray()
pub fn find_transform_ecc(template_image: &core::Mat, input_image: &core::Mat, warp_matrix: &mut core::Mat, motion_type: i32, criteria: &core::TermCriteria, input_mask: &core::Mat) -> Result<f64> {
unsafe { sys::cv_core_cv_findTransformECC_Mat_templateImage_Mat_inputImage_Mat_warpMatrix_int_motionType_TermCriteria_criteria_Mat_inputMask(template_image.as_raw_Mat(), input_image.as_raw_Mat(), warp_matrix.as_raw_Mat(), motion_type, criteria.as_raw_TermCriteria(), input_mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_fisheye_calibrate_VectorOfMat_objectPoints_VectorOfMat_imagePoints_Size_image_size_Mat_K_Mat_D_VectorOfMat_rvecs_VectorOfMat_tvecs_int_flags_TermCriteria_criteria
/// Performs camera calibaration
///
/// ## Parameters
/// * objectPoints: vector of vectors of calibration pattern points in the calibration pattern
/// coordinate space.
/// * imagePoints: vector of vectors of the projections of calibration pattern points.
/// imagePoints.size() and objectPoints.size() and imagePoints[i].size() must be equal to
/// objectPoints[i].size() for each i.
/// * image_size: Size of the image used only to initialize the intrinsic camera matrix.
/// * K: Output 3x3 floating-point camera matrix
/// <span lang='latex'>A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}</span> . If
/// fisheye::CALIB_USE_INTRINSIC_GUESS/ is specified, some or all of fx, fy, cx, cy must be
/// initialized before calling the function.
/// * D: Output vector of distortion coefficients <span lang='latex'>(k_1, k_2, k_3, k_4)</span>.
/// * rvecs: Output vector of rotation vectors (see Rodrigues ) estimated for each pattern view.
/// That is, each k-th rotation vector together with the corresponding k-th translation vector (see
/// the next output parameter description) brings the calibration pattern from the model coordinate
/// space (in which object points are specified) to the world coordinate space, that is, a real
/// position of the calibration pattern in the k-th pattern view (k=0.. *M* -1).
/// * tvecs: Output vector of translation vectors estimated for each pattern view.
/// * flags: Different flags that may be zero or a combination of the following values:
/// * **fisheye::CALIB_USE_INTRINSIC_GUESS** cameraMatrix contains valid initial values of
/// fx, fy, cx, cy that are optimized further. Otherwise, (cx, cy) is initially set to the image
/// center ( imageSize is used), and focal distances are computed in a least-squares fashion.
/// * **fisheye::CALIB_RECOMPUTE_EXTRINSIC** Extrinsic will be recomputed after each iteration
/// of intrinsic optimization.
/// * **fisheye::CALIB_CHECK_COND** The functions will check validity of condition number.
/// * **fisheye::CALIB_FIX_SKEW** Skew coefficient (alpha) is set to zero and stay zero.
/// * **fisheye::CALIB_FIX_K1..fisheye::CALIB_FIX_K4** Selected distortion coefficients
/// are set to zeros and stay zero.
/// * **fisheye::CALIB_FIX_PRINCIPAL_POINT** The principal point is not changed during the global
/// optimization. It stays at the center or at a different location specified when CALIB_USE_INTRINSIC_GUESS is set too.
/// * criteria: Termination criteria for the iterative optimization algorithm.
///
/// ## C++ default parameters:
/// * flags: 0
/// * criteria: TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)
pub fn calibrate(object_points: &types::VectorOfMat, image_points: &types::VectorOfMat, image_size: core::Size, k: &mut core::Mat, d: &mut core::Mat, rvecs: &mut types::VectorOfMat, tvecs: &mut types::VectorOfMat, flags: i32, criteria: &core::TermCriteria) -> Result<f64> {
unsafe { sys::cv_core_cv_fisheye_calibrate_VectorOfMat_objectPoints_VectorOfMat_imagePoints_Size_image_size_Mat_K_Mat_D_VectorOfMat_rvecs_VectorOfMat_tvecs_int_flags_TermCriteria_criteria(object_points.as_raw_VectorOfMat(), image_points.as_raw_VectorOfMat(), image_size, k.as_raw_Mat(), d.as_raw_Mat(), rvecs.as_raw_VectorOfMat(), tvecs.as_raw_VectorOfMat(), flags, criteria.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_fisheye_distortPoints_Mat_undistorted_Mat_distorted_Mat_K_Mat_D_double_alpha
/// Distorts 2D points using fisheye model.
///
/// ## Parameters
/// * undistorted: Array of object points, 1xN/Nx1 2-channel (or vector\<Point2f\> ), where N is
/// the number of points in the view.
/// * K: Camera matrix <span lang='latex'>K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}</span>.
/// * D: Input vector of distortion coefficients <span lang='latex'>(k_1, k_2, k_3, k_4)</span>.
/// * alpha: The skew coefficient.
/// * distorted: Output array of image points, 1xN/Nx1 2-channel, or vector\<Point2f\> .
///
/// Note that the function assumes the camera matrix of the undistorted points to be identity.
/// This means if you want to transform back points undistorted with undistortPoints() you have to
/// multiply them with <span lang='latex'>P^{-1}</span>.
///
/// ## C++ default parameters:
/// * alpha: 0
pub fn distort_points(undistorted: &core::Mat, distorted: &mut core::Mat, k: &core::Mat, d: &core::Mat, alpha: f64) -> Result<()> {
unsafe { sys::cv_core_cv_fisheye_distortPoints_Mat_undistorted_Mat_distorted_Mat_K_Mat_D_double_alpha(undistorted.as_raw_Mat(), distorted.as_raw_Mat(), k.as_raw_Mat(), d.as_raw_Mat(), alpha) }.into_result()
}
// identifier: cv_fisheye_estimateNewCameraMatrixForUndistortRectify_Mat_K_Mat_D_Size_image_size_Mat_R_Mat_P_double_balance_Size_new_size_double_fov_scale
/// Estimates new camera matrix for undistortion or rectification.
///
/// ## Parameters
/// * K: Camera matrix <span lang='latex'>K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}</span>.
/// * image_size
/// @param: D Input vector of distortion coefficients <span lang='latex'>(k_1, k_2, k_3, k_4)</span>.
/// * R: Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3
/// 1-channel or 1x1 3-channel
/// * P: New camera matrix (3x3) or new projection matrix (3x4)
/// * balance: Sets the new focal length in range between the min focal length and the max focal
/// length. Balance is in range of [0, 1].
/// * new_size
/// @param: fov_scale Divisor for new focal length.
///
/// ## C++ default parameters:
/// * balance: 0.0
/// * new_size: Size()
/// * fov_scale: 1.0
pub fn estimate_new_camera_matrix_for_undistort_rectify(k: &core::Mat, d: &core::Mat, image_size: core::Size, r: &core::Mat, p: &mut core::Mat, balance: f64, new_size: core::Size, fov_scale: f64) -> Result<()> {
unsafe { sys::cv_core_cv_fisheye_estimateNewCameraMatrixForUndistortRectify_Mat_K_Mat_D_Size_image_size_Mat_R_Mat_P_double_balance_Size_new_size_double_fov_scale(k.as_raw_Mat(), d.as_raw_Mat(), image_size, r.as_raw_Mat(), p.as_raw_Mat(), balance, new_size, fov_scale) }.into_result()
}
// identifier: cv_fisheye_initUndistortRectifyMap_Mat_K_Mat_D_Mat_R_Mat_P_Size_size_int_m1type_Mat_map1_Mat_map2
/// Computes undistortion and rectification maps for image transform by cv::remap(). If D is empty zero
/// distortion is used, if R or P is empty identity matrixes are used.
///
/// ## Parameters
/// * K: Camera matrix <span lang='latex'>K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}</span>.
/// * D: Input vector of distortion coefficients <span lang='latex'>(k_1, k_2, k_3, k_4)</span>.
/// * R: Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3
/// 1-channel or 1x1 3-channel
/// * P: New camera matrix (3x3) or new projection matrix (3x4)
/// * size: Undistorted image size.
/// * m1type: Type of the first output map that can be CV_32FC1 or CV_16SC2 . See convertMaps()
/// for details.
/// * map1: The first output map.
/// * map2: The second output map.
pub fn init_undistort_rectify_map(k: &core::Mat, d: &core::Mat, r: &core::Mat, p: &core::Mat, size: core::Size, m1type: i32, map1: &mut core::Mat, map2: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_fisheye_initUndistortRectifyMap_Mat_K_Mat_D_Mat_R_Mat_P_Size_size_int_m1type_Mat_map1_Mat_map2(k.as_raw_Mat(), d.as_raw_Mat(), r.as_raw_Mat(), p.as_raw_Mat(), size, m1type, map1.as_raw_Mat(), map2.as_raw_Mat()) }.into_result()
}
// identifier: cv_fisheye_projectPoints_Mat_objectPoints_Mat_imagePoints_Mat_rvec_Mat_tvec_Mat_K_Mat_D_double_alpha_Mat_jacobian
/// @overload
///
/// ## C++ default parameters:
/// * alpha: 0
/// * jacobian: noArray()
pub fn fisheye_project_points(object_points: &core::Mat, image_points: &mut core::Mat, rvec: &core::Mat, tvec: &core::Mat, k: &core::Mat, d: &core::Mat, alpha: f64, jacobian: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_fisheye_projectPoints_Mat_objectPoints_Mat_imagePoints_Mat_rvec_Mat_tvec_Mat_K_Mat_D_double_alpha_Mat_jacobian(object_points.as_raw_Mat(), image_points.as_raw_Mat(), rvec.as_raw_Mat(), tvec.as_raw_Mat(), k.as_raw_Mat(), d.as_raw_Mat(), alpha, jacobian.as_raw_Mat()) }.into_result()
}
// identifier: cv_fisheye_stereoCalibrate_VectorOfMat_objectPoints_VectorOfMat_imagePoints1_VectorOfMat_imagePoints2_Mat_K1_Mat_D1_Mat_K2_Mat_D2_Size_imageSize_Mat_R_Mat_T_int_flags_TermCriteria_criteria
/// Performs stereo calibration
///
/// ## Parameters
/// * objectPoints: Vector of vectors of the calibration pattern points.
/// * imagePoints1: Vector of vectors of the projections of the calibration pattern points,
/// observed by the first camera.
/// * imagePoints2: Vector of vectors of the projections of the calibration pattern points,
/// observed by the second camera.
/// * K1: Input/output first camera matrix:
/// <span lang='latex'>\vecthreethree{f_x^{(j)}}{0}{c_x^{(j)}}{0}{f_y^{(j)}}{c_y^{(j)}}{0}{0}{1}</span> , <span lang='latex'>j = 0,\, 1</span> . If
/// any of fisheye::CALIB_USE_INTRINSIC_GUESS , fisheye::CALIB_FIX_INTRINSIC are specified,
/// some or all of the matrix components must be initialized.
/// * D1: Input/output vector of distortion coefficients <span lang='latex'>(k_1, k_2, k_3, k_4)</span> of 4 elements.
/// * K2: Input/output second camera matrix. The parameter is similar to K1 .
/// * D2: Input/output lens distortion coefficients for the second camera. The parameter is
/// similar to D1 .
/// * imageSize: Size of the image used only to initialize intrinsic camera matrix.
/// * R: Output rotation matrix between the 1st and the 2nd camera coordinate systems.
/// * T: Output translation vector between the coordinate systems of the cameras.
/// * flags: Different flags that may be zero or a combination of the following values:
/// * **fisheye::CALIB_FIX_INTRINSIC** Fix K1, K2? and D1, D2? so that only R, T matrices
/// are estimated.
/// * **fisheye::CALIB_USE_INTRINSIC_GUESS** K1, K2 contains valid initial values of
/// fx, fy, cx, cy that are optimized further. Otherwise, (cx, cy) is initially set to the image
/// center (imageSize is used), and focal distances are computed in a least-squares fashion.
/// * **fisheye::CALIB_RECOMPUTE_EXTRINSIC** Extrinsic will be recomputed after each iteration
/// of intrinsic optimization.
/// * **fisheye::CALIB_CHECK_COND** The functions will check validity of condition number.
/// * **fisheye::CALIB_FIX_SKEW** Skew coefficient (alpha) is set to zero and stay zero.
/// * **fisheye::CALIB_FIX_K1..4** Selected distortion coefficients are set to zeros and stay
/// zero.
/// * criteria: Termination criteria for the iterative optimization algorithm.
///
/// ## C++ default parameters:
/// * flags: fisheye::CALIB_FIX_INTRINSIC
/// * criteria: TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON)
pub fn stereo_calibrate(object_points: &types::VectorOfMat, image_points1: &types::VectorOfMat, image_points2: &types::VectorOfMat, k1: &mut core::Mat, d1: &mut core::Mat, k2: &mut core::Mat, d2: &mut core::Mat, image_size: core::Size, r: &mut core::Mat, t: &mut core::Mat, flags: i32, criteria: &core::TermCriteria) -> Result<f64> {
unsafe { sys::cv_core_cv_fisheye_stereoCalibrate_VectorOfMat_objectPoints_VectorOfMat_imagePoints1_VectorOfMat_imagePoints2_Mat_K1_Mat_D1_Mat_K2_Mat_D2_Size_imageSize_Mat_R_Mat_T_int_flags_TermCriteria_criteria(object_points.as_raw_VectorOfMat(), image_points1.as_raw_VectorOfMat(), image_points2.as_raw_VectorOfMat(), k1.as_raw_Mat(), d1.as_raw_Mat(), k2.as_raw_Mat(), d2.as_raw_Mat(), image_size, r.as_raw_Mat(), t.as_raw_Mat(), flags, criteria.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_fisheye_stereoRectify_Mat_K1_Mat_D1_Mat_K2_Mat_D2_Size_imageSize_Mat_R_Mat_tvec_Mat_R1_Mat_R2_Mat_P1_Mat_P2_Mat_Q_int_flags_Size_newImageSize_double_balance_double_fov_scale
/// Stereo rectification for fisheye camera model
///
/// ## Parameters
/// * K1: First camera matrix.
/// * D1: First camera distortion parameters.
/// * K2: Second camera matrix.
/// * D2: Second camera distortion parameters.
/// * imageSize: Size of the image used for stereo calibration.
/// * R: Rotation matrix between the coordinate systems of the first and the second
/// cameras.
/// * tvec: Translation vector between coordinate systems of the cameras.
/// * R1: Output 3x3 rectification transform (rotation matrix) for the first camera.
/// * R2: Output 3x3 rectification transform (rotation matrix) for the second camera.
/// * P1: Output 3x4 projection matrix in the new (rectified) coordinate systems for the first
/// camera.
/// * P2: Output 3x4 projection matrix in the new (rectified) coordinate systems for the second
/// camera.
/// * Q: Output <span lang='latex'>4 \times 4</span> disparity-to-depth mapping matrix (see reprojectImageTo3D ).
/// * flags: Operation flags that may be zero or CALIB_ZERO_DISPARITY . If the flag is set,
/// the function makes the principal points of each camera have the same pixel coordinates in the
/// rectified views. And if the flag is not set, the function may still shift the images in the
/// horizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the
/// useful image area.
/// * newImageSize: New image resolution after rectification. The same size should be passed to
/// initUndistortRectifyMap (see the stereo_calib.cpp sample in OpenCV samples directory). When (0,0)
/// is passed (default), it is set to the original imageSize . Setting it to larger value can help you
/// preserve details in the original image, especially when there is a big radial distortion.
/// * balance: Sets the new focal length in range between the min focal length and the max focal
/// length. Balance is in range of [0, 1].
/// * fov_scale: Divisor for new focal length.
///
/// ## C++ default parameters:
/// * new_image_size: Size()
/// * balance: 0.0
/// * fov_scale: 1.0
pub fn stereo_rectify(k1: &core::Mat, d1: &core::Mat, k2: &core::Mat, d2: &core::Mat, image_size: core::Size, r: &core::Mat, tvec: &core::Mat, r1: &mut core::Mat, r2: &mut core::Mat, p1: &mut core::Mat, p2: &mut core::Mat, q: &mut core::Mat, flags: i32, new_image_size: core::Size, balance: f64, fov_scale: f64) -> Result<()> {
unsafe { sys::cv_core_cv_fisheye_stereoRectify_Mat_K1_Mat_D1_Mat_K2_Mat_D2_Size_imageSize_Mat_R_Mat_tvec_Mat_R1_Mat_R2_Mat_P1_Mat_P2_Mat_Q_int_flags_Size_newImageSize_double_balance_double_fov_scale(k1.as_raw_Mat(), d1.as_raw_Mat(), k2.as_raw_Mat(), d2.as_raw_Mat(), image_size, r.as_raw_Mat(), tvec.as_raw_Mat(), r1.as_raw_Mat(), r2.as_raw_Mat(), p1.as_raw_Mat(), p2.as_raw_Mat(), q.as_raw_Mat(), flags, new_image_size, balance, fov_scale) }.into_result()
}
// identifier: cv_fisheye_undistortImage_Mat_distorted_Mat_undistorted_Mat_K_Mat_D_Mat_Knew_Size_new_size
/// Transforms an image to compensate for fisheye lens distortion.
///
/// ## Parameters
/// * distorted: image with fisheye lens distortion.
/// * undistorted: Output image with compensated fisheye lens distortion.
/// * K: Camera matrix <span lang='latex'>K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}</span>.
/// * D: Input vector of distortion coefficients <span lang='latex'>(k_1, k_2, k_3, k_4)</span>.
/// * Knew: Camera matrix of the distorted image. By default, it is the identity matrix but you
/// may additionally scale and shift the result by using a different matrix.
/// * new_size
///
/// The: function transforms an image to compensate radial and tangential lens distortion.
///
/// The function is simply a combination of fisheye::initUndistortRectifyMap (with unity R ) and remap
/// (with bilinear interpolation). See the former function for details of the transformation being
/// performed.
///
/// See below the results of undistortImage.
/// * a\) result of undistort of perspective camera model (all possible coefficients (k_1, k_2, k_3,
/// k_4, k_5, k_6) of distortion were optimized under calibration)
/// * b\) result of fisheye::undistortImage of fisheye camera model (all possible coefficients (k_1, k_2,
/// k_3, k_4) of fisheye distortion were optimized under calibration)
/// * c\) original image was captured with fisheye lens
///
/// Pictures a) and b) almost the same. But if we consider points of image located far from the center
/// of image, we can notice that on image a) these points are distorted.
///
/// 
///
/// ## C++ default parameters:
/// * knew: cv::noArray()
/// * new_size: Size()
pub fn fisheye_undistort_image(distorted: &core::Mat, undistorted: &mut core::Mat, k: &core::Mat, d: &core::Mat, knew: &core::Mat, new_size: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_fisheye_undistortImage_Mat_distorted_Mat_undistorted_Mat_K_Mat_D_Mat_Knew_Size_new_size(distorted.as_raw_Mat(), undistorted.as_raw_Mat(), k.as_raw_Mat(), d.as_raw_Mat(), knew.as_raw_Mat(), new_size) }.into_result()
}
// identifier: cv_fisheye_undistortPoints_Mat_distorted_Mat_undistorted_Mat_K_Mat_D_Mat_R_Mat_P
/// Undistorts 2D points using fisheye model
///
/// ## Parameters
/// * distorted: Array of object points, 1xN/Nx1 2-channel (or vector\<Point2f\> ), where N is the
/// number of points in the view.
/// * K: Camera matrix <span lang='latex'>K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}</span>.
/// * D: Input vector of distortion coefficients <span lang='latex'>(k_1, k_2, k_3, k_4)</span>.
/// * R: Rectification transformation in the object space: 3x3 1-channel, or vector: 3x1/1x3
/// 1-channel or 1x1 3-channel
/// * P: New camera matrix (3x3) or new projection matrix (3x4)
/// * undistorted: Output array of image points, 1xN/Nx1 2-channel, or vector\<Point2f\> .
///
/// ## C++ default parameters:
/// * r: noArray()
/// * p: noArray()
pub fn fisheye_undistort_points(distorted: &core::Mat, undistorted: &mut core::Mat, k: &core::Mat, d: &core::Mat, r: &core::Mat, p: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_fisheye_undistortPoints_Mat_distorted_Mat_undistorted_Mat_K_Mat_D_Mat_R_Mat_P(distorted.as_raw_Mat(), undistorted.as_raw_Mat(), k.as_raw_Mat(), d.as_raw_Mat(), r.as_raw_Mat(), p.as_raw_Mat()) }.into_result()
}
// identifier: cv_fitEllipseAMS_Mat_points
/// Fits an ellipse around a set of 2D points.
///
/// The function calculates the ellipse that fits a set of 2D points.
/// It returns the rotated rectangle in which the ellipse is inscribed.
/// The Approximate Mean Square (AMS) proposed by @cite Taubin1991 is used.
///
/// For an ellipse, this basis set is <span lang='latex'> \chi= \left(x^2, x y, y^2, x, y, 1\right) </span>,
/// which is a set of six free coefficients <span lang='latex'> A^T=\left\{A_{\text{xx}},A_{\text{xy}},A_{\text{yy}},A_x,A_y,A_0\right\} </span>.
/// However, to specify an ellipse, all that is needed is five numbers; the major and minor axes lengths <span lang='latex'> (a,b) </span>,
/// the position <span lang='latex'> (x_0,y_0) </span>, and the orientation <span lang='latex'> \theta </span>. This is because the basis set includes lines,
/// quadratics, parabolic and hyperbolic functions as well as elliptical functions as possible fits.
/// If the fit is found to be a parabolic or hyperbolic function then the standard #fitEllipse method is used.
/// The AMS method restricts the fit to parabolic, hyperbolic and elliptical curves
/// by imposing the condition that <span lang='latex'> A^T ( D_x^T D_x + D_y^T D_y) A = 1 </span> where
/// the matrices <span lang='latex'> Dx </span> and <span lang='latex'> Dy </span> are the partial derivatives of the design matrix <span lang='latex'> D </span> with
/// respect to x and y. The matrices are formed row by row applying the following to
/// each of the points in the set:
/// \f{align*}{
/// D(i,:)&=\left\{x_i^2, x_i y_i, y_i^2, x_i, y_i, 1\right\} &
/// D_x(i,:)&=\left\{2 x_i,y_i,0,1,0,0\right\} &
/// D_y(i,:)&=\left\{0,x_i,2 y_i,0,1,0\right\}
/// \f}
/// The AMS method minimizes the cost function
/// \f{equation*}{
/// \epsilon ^2=\frac{ A^T D^T D A }{ A^T (D_x^T D_x + D_y^T D_y) A^T }
/// \f}
///
/// The minimum cost is found by solving the generalized eigenvalue problem.
///
/// \f{equation*}{
/// D^T D A = \lambda \left( D_x^T D_x + D_y^T D_y\right) A
/// \f}
///
/// ## Parameters
/// * points: Input 2D point set, stored in std::vector\<\> or Mat
pub fn fit_ellipse_ams(points: &core::Mat) -> Result<core::RotatedRect> {
unsafe { sys::cv_core_cv_fitEllipseAMS_Mat_points(points.as_raw_Mat()) }.into_result().map(|x| core::RotatedRect { ptr: x })
}
// identifier: cv_fitEllipseDirect_Mat_points
/// Fits an ellipse around a set of 2D points.
///
/// The function calculates the ellipse that fits a set of 2D points.
/// It returns the rotated rectangle in which the ellipse is inscribed.
/// The Direct least square (Direct) method by @cite Fitzgibbon1999 is used.
///
/// For an ellipse, this basis set is <span lang='latex'> \chi= \left(x^2, x y, y^2, x, y, 1\right) </span>,
/// which is a set of six free coefficients <span lang='latex'> A^T=\left\{A_{\text{xx}},A_{\text{xy}},A_{\text{yy}},A_x,A_y,A_0\right\} </span>.
/// However, to specify an ellipse, all that is needed is five numbers; the major and minor axes lengths <span lang='latex'> (a,b) </span>,
/// the position <span lang='latex'> (x_0,y_0) </span>, and the orientation <span lang='latex'> \theta </span>. This is because the basis set includes lines,
/// quadratics, parabolic and hyperbolic functions as well as elliptical functions as possible fits.
/// The Direct method confines the fit to ellipses by ensuring that <span lang='latex'> 4 A_{xx} A_{yy}- A_{xy}^2 > 0 </span>.
/// The condition imposed is that <span lang='latex'> 4 A_{xx} A_{yy}- A_{xy}^2=1 </span> which satisfies the inequality
/// and as the coefficients can be arbitrarily scaled is not overly restrictive.
///
/// \f{equation*}{
/// \epsilon ^2= A^T D^T D A \quad \text{with} \quad A^T C A =1 \quad \text{and} \quad C=\left(\begin{matrix}
/// 0 & 0 & 2 & 0 & 0 & 0 \\
/// 0 & -1 & 0 & 0 & 0 & 0 \\
/// 2 & 0 & 0 & 0 & 0 & 0 \\
/// 0 & 0 & 0 & 0 & 0 & 0 \\
/// 0 & 0 & 0 & 0 & 0 & 0 \\
/// 0 & 0 & 0 & 0 & 0 & 0
/// \end{matrix} \right)
/// \f}
///
/// The minimum cost is found by solving the generalized eigenvalue problem.
///
/// \f{equation*}{
/// D^T D A = \lambda \left( C\right) A
/// \f}
///
/// The system produces only one positive eigenvalue <span lang='latex'> \lambda</span> which is chosen as the solution
/// with its eigenvector <span lang='latex'>\mathbf{u}</span>. These are used to find the coefficients
///
/// \f{equation*}{
/// A = \sqrt{\frac{1}{\mathbf{u}^T C \mathbf{u}}} \mathbf{u}
/// \f}
/// The scaling factor guarantees that <span lang='latex'>A^T C A =1</span>.
///
/// ## Parameters
/// * points: Input 2D point set, stored in std::vector\<\> or Mat
pub fn fit_ellipse_direct(points: &core::Mat) -> Result<core::RotatedRect> {
unsafe { sys::cv_core_cv_fitEllipseDirect_Mat_points(points.as_raw_Mat()) }.into_result().map(|x| core::RotatedRect { ptr: x })
}
// identifier: cv_fitEllipse_Mat_points
/// Fits an ellipse around a set of 2D points.
///
/// The function calculates the ellipse that fits (in a least-squares sense) a set of 2D points best of
/// all. It returns the rotated rectangle in which the ellipse is inscribed. The first algorithm described by @cite Fitzgibbon95
/// is used. Developer should keep in mind that it is possible that the returned
/// ellipse/rotatedRect data contains negative indices, due to the data points being close to the
/// border of the containing Mat element.
///
/// ## Parameters
/// * points: Input 2D point set, stored in std::vector\<\> or Mat
pub fn fit_ellipse(points: &core::Mat) -> Result<core::RotatedRect> {
unsafe { sys::cv_core_cv_fitEllipse_Mat_points(points.as_raw_Mat()) }.into_result().map(|x| core::RotatedRect { ptr: x })
}
// identifier: cv_fitLine_Mat_points_Mat_line_int_distType_double_param_double_reps_double_aeps
/// Fits a line to a 2D or 3D point set.
///
/// The function fitLine fits a line to a 2D or 3D point set by minimizing <span lang='latex'>\sum_i \rho(r_i)</span> where
/// <span lang='latex'>r_i</span> is a distance between the <span lang='latex'>i^{th}</span> point, the line and <span lang='latex'>\rho(r)</span> is a distance function, one
/// of the following:
/// * DIST_L2
/// <div lang='latex'>\rho (r) = r^2/2 \quad \text{(the simplest and the fastest least-squares method)}</div>
/// - DIST_L1
/// <div lang='latex'>\rho (r) = r</div>
/// - DIST_L12
/// <div lang='latex'>\rho (r) = 2 \cdot ( \sqrt{1 + \frac{r^2}{2}} - 1)</div>
/// - DIST_FAIR
/// <div lang='latex'>\rho \left (r \right ) = C^2 \cdot \left ( \frac{r}{C} - \log{\left(1 + \frac{r}{C}\right)} \right ) \quad \text{where} \quad C=1.3998</div>
/// - DIST_WELSCH
/// <div lang='latex'>\rho \left (r \right ) = \frac{C^2}{2} \cdot \left ( 1 - \exp{\left(-\left(\frac{r}{C}\right)^2\right)} \right ) \quad \text{where} \quad C=2.9846</div>
/// - DIST_HUBER
/// <div lang='latex'>\rho (r) = \fork{r^2/2}{if \(r < C\)}{C \cdot (r-C/2)}{otherwise} \quad \text{where} \quad C=1.345</div>
///
/// The algorithm is based on the M-estimator ( <http://en.wikipedia.org/wiki/M-estimator> ) technique
/// that iteratively fits the line using the weighted least-squares algorithm. After each iteration the
/// weights <span lang='latex'>w_i</span> are adjusted to be inversely proportional to <span lang='latex'>\rho(r_i)</span> .
///
/// ## Parameters
/// * points: Input vector of 2D or 3D points, stored in std::vector\<\> or Mat.
/// * line: Output line parameters. In case of 2D fitting, it should be a vector of 4 elements
/// (like Vec4f) - (vx, vy, x0, y0), where (vx, vy) is a normalized vector collinear to the line and
/// (x0, y0) is a point on the line. In case of 3D fitting, it should be a vector of 6 elements (like
/// Vec6f) - (vx, vy, vz, x0, y0, z0), where (vx, vy, vz) is a normalized vector collinear to the line
/// and (x0, y0, z0) is a point on the line.
/// * distType: Distance used by the M-estimator, see #DistanceTypes
/// * param: Numerical parameter ( C ) for some types of distances. If it is 0, an optimal value
/// is chosen.
/// * reps: Sufficient accuracy for the radius (distance between the coordinate origin and the line).
/// * aeps: Sufficient accuracy for the angle. 0.01 would be a good default value for reps and aeps.
pub fn fit_line(points: &core::Mat, line: &mut core::Mat, dist_type: i32, param: f64, reps: f64, aeps: f64) -> Result<()> {
unsafe { sys::cv_core_cv_fitLine_Mat_points_Mat_line_int_distType_double_param_double_reps_double_aeps(points.as_raw_Mat(), line.as_raw_Mat(), dist_type, param, reps, aeps) }.into_result()
}
// identifier: cv_flip_Mat_src_Mat_dst_int_flipCode
/// Flips a 2D array around vertical, horizontal, or both axes.
///
/// The function cv::flip flips the array in one of three different ways (row
/// and column indices are 0-based):
/// <div lang='latex'>\texttt{dst} _{ij} =
/// \left\{
/// \begin{array}{l l}
/// \texttt{src} _{\texttt{src.rows}-i-1,j} & if\; \texttt{flipCode} = 0 \\
/// \texttt{src} _{i, \texttt{src.cols} -j-1} & if\; \texttt{flipCode} > 0 \\
/// \texttt{src} _{ \texttt{src.rows} -i-1, \texttt{src.cols} -j-1} & if\; \texttt{flipCode} < 0 \\
/// \end{array}
/// \right.</div>
/// The example scenarios of using the function are the following:
/// Vertical flipping of the image (flipCode == 0) to switch between
/// top-left and bottom-left image origin. This is a typical operation
/// in video processing on Microsoft Windows\* OS.
/// Horizontal flipping of the image with the subsequent horizontal
/// shift and absolute difference calculation to check for a
/// vertical-axis symmetry (flipCode \> 0).
/// Simultaneous horizontal and vertical flipping of the image with
/// the subsequent shift and absolute difference calculation to check
/// for a central symmetry (flipCode \< 0).
/// Reversing the order of point arrays (flipCode \> 0 or
/// flipCode == 0).
/// ## Parameters
/// * src: input array.
/// * dst: output array of the same size and type as src.
/// * flipCode: a flag to specify how to flip the array; 0 means
/// flipping around the x-axis and positive value (for example, 1) means
/// flipping around y-axis. Negative value (for example, -1) means flipping
/// around both axes.
/// @sa transpose , repeat , completeSymm
pub fn flip(src: &core::Mat, dst: &mut core::Mat, flip_code: i32) -> Result<()> {
unsafe { sys::cv_core_cv_flip_Mat_src_Mat_dst_int_flipCode(src.as_raw_Mat(), dst.as_raw_Mat(), flip_code) }.into_result()
}
// identifier: cv_floodFill_Mat_image_Mat_mask_Point_seedPoint_Scalar_newVal_Rect_X_rect_Scalar_loDiff_Scalar_upDiff_int_flags
/// Fills a connected component with the given color.
///
/// The function cv::floodFill fills a connected component starting from the seed point with the specified
/// color. The connectivity is determined by the color/brightness closeness of the neighbor pixels. The
/// pixel at <span lang='latex'>(x,y)</span> is considered to belong to the repainted domain if:
///
/// - in case of a grayscale image and floating range
/// <div lang='latex'>\texttt{src} (x',y')- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} (x',y')+ \texttt{upDiff}</div>
///
///
/// - in case of a grayscale image and fixed range
/// <div lang='latex'>\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)- \texttt{loDiff} \leq \texttt{src} (x,y) \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)+ \texttt{upDiff}</div>
///
///
/// - in case of a color image and floating range
/// <div lang='latex'>\texttt{src} (x',y')_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} (x',y')_r+ \texttt{upDiff} _r,</div>
/// <div lang='latex'>\texttt{src} (x',y')_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} (x',y')_g+ \texttt{upDiff} _g</div>
/// and
/// <div lang='latex'>\texttt{src} (x',y')_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} (x',y')_b+ \texttt{upDiff} _b</div>
///
///
/// - in case of a color image and fixed range
/// <div lang='latex'>\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r- \texttt{loDiff} _r \leq \texttt{src} (x,y)_r \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_r+ \texttt{upDiff} _r,</div>
/// <div lang='latex'>\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g- \texttt{loDiff} _g \leq \texttt{src} (x,y)_g \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_g+ \texttt{upDiff} _g</div>
/// and
/// <div lang='latex'>\texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b- \texttt{loDiff} _b \leq \texttt{src} (x,y)_b \leq \texttt{src} ( \texttt{seedPoint} .x, \texttt{seedPoint} .y)_b+ \texttt{upDiff} _b</div>
///
///
/// where <span lang='latex'>src(x',y')</span> is the value of one of pixel neighbors that is already known to belong to the
/// component. That is, to be added to the connected component, a color/brightness of the pixel should
/// be close enough to:
/// - Color/brightness of one of its neighbors that already belong to the connected component in case
/// of a floating range.
/// - Color/brightness of the seed point in case of a fixed range.
///
/// Use these functions to either mark a connected component with the specified color in-place, or build
/// a mask and then extract the contour, or copy the region to another image, and so on.
///
/// ## Parameters
/// * image: Input/output 1- or 3-channel, 8-bit, or floating-point image. It is modified by the
/// function unless the #FLOODFILL_MASK_ONLY flag is set in the second variant of the function. See
/// the details below.
/// * mask: Operation mask that should be a single-channel 8-bit image, 2 pixels wider and 2 pixels
/// taller than image. Since this is both an input and output parameter, you must take responsibility
/// of initializing it. Flood-filling cannot go across non-zero pixels in the input mask. For example,
/// an edge detector output can be used as a mask to stop filling at edges. On output, pixels in the
/// mask corresponding to filled pixels in the image are set to 1 or to the a value specified in flags
/// as described below. Additionally, the function fills the border of the mask with ones to simplify
/// internal processing. It is therefore possible to use the same mask in multiple calls to the function
/// to make sure the filled areas do not overlap.
/// * seedPoint: Starting point.
/// * newVal: New value of the repainted domain pixels.
/// * loDiff: Maximal lower brightness/color difference between the currently observed pixel and
/// one of its neighbors belonging to the component, or a seed pixel being added to the component.
/// * upDiff: Maximal upper brightness/color difference between the currently observed pixel and
/// one of its neighbors belonging to the component, or a seed pixel being added to the component.
/// * rect: Optional output parameter set by the function to the minimum bounding rectangle of the
/// repainted domain.
/// * flags: Operation flags. The first 8 bits contain a connectivity value. The default value of
/// 4 means that only the four nearest neighbor pixels (those that share an edge) are considered. A
/// connectivity value of 8 means that the eight nearest neighbor pixels (those that share a corner)
/// will be considered. The next 8 bits (8-16) contain a value between 1 and 255 with which to fill
/// the mask (the default value is 1). For example, 4 | ( 255 \<\< 8 ) will consider 4 nearest
/// neighbours and fill the mask with a value of 255. The following additional options occupy higher
/// bits and therefore may be further combined with the connectivity and mask fill values using
/// bit-wise or (|), see #FloodFillFlags.
///
///
/// Note: Since the mask is larger than the filled image, a pixel <span lang='latex'>(x, y)</span> in image corresponds to the
/// pixel <span lang='latex'>(x+1, y+1)</span> in the mask .
///
/// @sa findContours
///
/// ## C++ default parameters:
/// * rect: 0
/// * lo_diff: Scalar()
/// * up_diff: Scalar()
/// * flags: 4
pub fn flood_fill(image: &mut core::Mat, mask: &mut core::Mat, seed_point: core::Point, new_val: core::Scalar, rect: &mut core::Rect, lo_diff: core::Scalar, up_diff: core::Scalar, flags: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_floodFill_Mat_image_Mat_mask_Point_seedPoint_Scalar_newVal_Rect_X_rect_Scalar_loDiff_Scalar_upDiff_int_flags(image.as_raw_Mat(), mask.as_raw_Mat(), seed_point, new_val, rect, lo_diff, up_diff, flags) }.into_result()
}
// identifier: cv_floodFill_Mat_image_Point_seedPoint_Scalar_newVal_Rect_X_rect_Scalar_loDiff_Scalar_upDiff_int_flags
/// @overload
///
/// variant without `mask` parameter
///
/// ## C++ default parameters:
/// * rect: 0
/// * lo_diff: Scalar()
/// * up_diff: Scalar()
/// * flags: 4
pub fn flood_fill_1(image: &mut core::Mat, seed_point: core::Point, new_val: core::Scalar, rect: &mut core::Rect, lo_diff: core::Scalar, up_diff: core::Scalar, flags: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_floodFill_Mat_image_Point_seedPoint_Scalar_newVal_Rect_X_rect_Scalar_loDiff_Scalar_upDiff_int_flags(image.as_raw_Mat(), seed_point, new_val, rect, lo_diff, up_diff, flags) }.into_result()
}
// identifier: cv_fontQt_String_nameFont_int_pointSize_Scalar_color_int_weight_int_style_int_spacing
/// Creates the font to draw a text on an image.
///
/// The function fontQt creates a cv::QtFont object. This cv::QtFont is not compatible with putText .
///
/// A basic usage of this function is the following: :
/// ```ignore
/// QtFont font = fontQt("Times");
/// addText( img1, "Hello World !", Point(50,50), font);
/// ```
///
///
/// ## Parameters
/// * nameFont: Name of the font. The name should match the name of a system font (such as
/// *Times*). If the font is not found, a default one is used.
/// * pointSize: Size of the font. If not specified, equal zero or negative, the point size of the
/// font is set to a system-dependent default value. Generally, this is 12 points.
/// * color: Color of the font in BGRA where A = 255 is fully transparent. Use the macro CV_RGB
/// for simplicity.
/// * weight: Font weight. Available operation flags are : cv::QtFontWeights You can also specify a positive integer for better control.
/// * style: Font style. Available operation flags are : cv::QtFontStyles
/// * spacing: Spacing between characters. It can be negative or positive.
///
/// ## C++ default parameters:
/// * point_size: -1
/// * color: Scalar::all(0)
/// * weight: QT_FONT_NORMAL
/// * style: QT_STYLE_NORMAL
/// * spacing: 0
pub fn font_qt(name_font: &str, point_size: i32, color: core::Scalar, weight: i32, style: i32, spacing: i32) -> Result<core::QtFont> {
string_arg!(name_font);
unsafe { sys::cv_core_cv_fontQt_String_nameFont_int_pointSize_Scalar_color_int_weight_int_style_int_spacing(name_font.as_ptr(), point_size, color, weight, style, spacing) }.into_result().map(|x| core::QtFont { ptr: x })
}
// identifier: cv_gemm_Mat_src1_Mat_src2_double_alpha_Mat_src3_double_beta_Mat_dst_int_flags
/// Performs generalized matrix multiplication.
///
/// The function cv::gemm performs generalized matrix multiplication similar to the
/// gemm functions in BLAS level 3. For example,
/// `gemm(src1, src2, alpha, src3, beta, dst, GEMM_1_T + GEMM_3_T)`
/// corresponds to
/// <div lang='latex'>\texttt{dst} = \texttt{alpha} \cdot \texttt{src1} ^T \cdot \texttt{src2} + \texttt{beta} \cdot \texttt{src3} ^T</div>
///
/// In case of complex (two-channel) data, performed a complex matrix
/// multiplication.
///
/// The function can be replaced with a matrix expression. For example, the
/// above call can be replaced with:
/// ```ignore{.cpp}
/// dst = alpha*src1.t()*src2 + beta*src3.t();
/// ```
///
/// ## Parameters
/// * src1: first multiplied input matrix that could be real(CV_32FC1,
/// CV_64FC1) or complex(CV_32FC2, CV_64FC2).
/// * src2: second multiplied input matrix of the same type as src1.
/// * alpha: weight of the matrix product.
/// * src3: third optional delta matrix added to the matrix product; it
/// should have the same type as src1 and src2.
/// * beta: weight of src3.
/// * dst: output matrix; it has the proper size and the same type as
/// input matrices.
/// * flags: operation flags (cv::GemmFlags)
/// @sa mulTransposed , transform
///
/// ## C++ default parameters:
/// * flags: 0
pub fn gemm(src1: &core::Mat, src2: &core::Mat, alpha: f64, src3: &core::Mat, beta: f64, dst: &mut core::Mat, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_gemm_Mat_src1_Mat_src2_double_alpha_Mat_src3_double_beta_Mat_dst_int_flags(src1.as_raw_Mat(), src2.as_raw_Mat(), alpha, src3.as_raw_Mat(), beta, dst.as_raw_Mat(), flags) }.into_result()
}
// identifier: cv_getAffineTransform_Mat_src_Mat_dst
pub fn get_affine_transform(src: &core::Mat, dst: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_getAffineTransform_Mat_src_Mat_dst(src.as_raw_Mat(), dst.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_getAffineTransform_const_Point2f_X_src_const_Point2f_X_dst
/// Calculates an affine transform from three pairs of the corresponding points.
///
/// The function calculates the <span lang='latex'>2 \times 3</span> matrix of an affine transform so that:
///
/// <div lang='latex'>\begin{bmatrix} x'_i \\ y'_i \end{bmatrix} = \texttt{map_matrix} \cdot \begin{bmatrix} x_i \\ y_i \\ 1 \end{bmatrix}</div>
///
/// where
///
/// <div lang='latex'>dst(i)=(x'_i,y'_i), src(i)=(x_i, y_i), i=0,1,2</div>
///
/// ## Parameters
/// * src: Coordinates of triangle vertices in the source image.
/// * dst: Coordinates of the corresponding triangle vertices in the destination image.
///
/// @sa warpAffine, transform
pub fn get_affine_transform_1(src: &core::Point2f, dst: &core::Point2f) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_getAffineTransform_const_Point2f_X_src_const_Point2f_X_dst(src, dst) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_getBuildInformation
/// Returns full configuration time cmake output.
///
/// Returned value is raw cmake output including version control system revision, compiler version,
/// compiler flags, enabled modules and third party libraries, etc. Output format depends on target
/// architecture.
pub fn get_build_information() -> Result<String> {
unsafe { sys::cv_core_cv_getBuildInformation() }.into_result().map(crate::templ::receive_string)
}
// identifier: cv_getCPUTickCount
/// Returns the number of CPU ticks.
///
/// The function returns the current number of CPU ticks on some architectures (such as x86, x64,
/// PowerPC). On other platforms the function is equivalent to getTickCount. It can also be used for
/// very accurate time measurements, as well as for RNG initialization. Note that in case of multi-CPU
/// systems a thread, from which getCPUTickCount is called, can be suspended and resumed at another CPU
/// with its own counter. So, theoretically (and practically) the subsequent calls to the function do
/// not necessary return the monotonously increasing values. Also, since a modern CPU varies the CPU
/// frequency depending on the load, the number of CPU clocks spent in some code cannot be directly
/// converted to time units. Therefore, getTickCount is generally a preferable solution for measuring
/// execution time.
pub fn get_cpu_tick_count() -> Result<i64> {
unsafe { sys::cv_core_cv_getCPUTickCount() }.into_result()
}
// identifier: cv_getDefaultNewCameraMatrix_Mat_cameraMatrix_Size_imgsize_bool_centerPrincipalPoint
/// Returns the default new camera matrix.
///
/// The function returns the camera matrix that is either an exact copy of the input cameraMatrix (when
/// centerPrinicipalPoint=false ), or the modified one (when centerPrincipalPoint=true).
///
/// In the latter case, the new camera matrix will be:
///
/// <div lang='latex'>\begin{bmatrix} f_x && 0 && ( \texttt{imgSize.width} -1)*0.5 \\ 0 && f_y && ( \texttt{imgSize.height} -1)*0.5 \\ 0 && 0 && 1 \end{bmatrix} ,</div>
///
/// where <span lang='latex'>f_x</span> and <span lang='latex'>f_y</span> are <span lang='latex'>(0,0)</span> and <span lang='latex'>(1,1)</span> elements of cameraMatrix, respectively.
///
/// By default, the undistortion functions in OpenCV (see #initUndistortRectifyMap, #undistort) do not
/// move the principal point. However, when you work with stereo, it is important to move the principal
/// points in both views to the same y-coordinate (which is required by most of stereo correspondence
/// algorithms), and may be to the same x-coordinate too. So, you can form the new camera matrix for
/// each view where the principal points are located at the center.
///
/// ## Parameters
/// * cameraMatrix: Input camera matrix.
/// * imgsize: Camera view image size in pixels.
/// * centerPrincipalPoint: Location of the principal point in the new camera matrix. The
/// parameter indicates whether this location should be at the image center or not.
///
/// ## C++ default parameters:
/// * imgsize: Size()
/// * center_principal_point: false
pub fn get_default_new_camera_matrix(camera_matrix: &core::Mat, imgsize: core::Size, center_principal_point: bool) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_getDefaultNewCameraMatrix_Mat_cameraMatrix_Size_imgsize_bool_centerPrincipalPoint(camera_matrix.as_raw_Mat(), imgsize, center_principal_point) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_getDerivKernels_Mat_kx_Mat_ky_int_dx_int_dy_int_ksize_bool_normalize_int_ktype
/// Returns filter coefficients for computing spatial image derivatives.
///
/// The function computes and returns the filter coefficients for spatial image derivatives. When
/// `ksize=CV_SCHARR`, the Scharr <span lang='latex'>3 \times 3</span> kernels are generated (see #Scharr). Otherwise, Sobel
/// kernels are generated (see #Sobel). The filters are normally passed to #sepFilter2D or to
///
/// ## Parameters
/// * kx: Output matrix of row filter coefficients. It has the type ktype .
/// * ky: Output matrix of column filter coefficients. It has the type ktype .
/// * dx: Derivative order in respect of x.
/// * dy: Derivative order in respect of y.
/// * ksize: Aperture size. It can be CV_SCHARR, 1, 3, 5, or 7.
/// * normalize: Flag indicating whether to normalize (scale down) the filter coefficients or not.
/// Theoretically, the coefficients should have the denominator <span lang='latex'>=2^{ksize*2-dx-dy-2}</span>. If you are
/// going to filter floating-point images, you are likely to use the normalized kernels. But if you
/// compute derivatives of an 8-bit image, store the results in a 16-bit image, and wish to preserve
/// all the fractional bits, you may want to set normalize=false .
/// * ktype: Type of filter coefficients. It can be CV_32f or CV_64F .
///
/// ## C++ default parameters:
/// * normalize: false
/// * ktype: CV_32F
pub fn get_deriv_kernels(kx: &mut core::Mat, ky: &mut core::Mat, dx: i32, dy: i32, ksize: i32, normalize: bool, ktype: i32) -> Result<()> {
unsafe { sys::cv_core_cv_getDerivKernels_Mat_kx_Mat_ky_int_dx_int_dy_int_ksize_bool_normalize_int_ktype(kx.as_raw_Mat(), ky.as_raw_Mat(), dx, dy, ksize, normalize, ktype) }.into_result()
}
// identifier: cv_getElemSize_int_type
pub fn get_elem_size(_type: i32) -> Result<size_t> {
unsafe { sys::cv_core_cv_getElemSize_int_type(_type) }.into_result()
}
// identifier: cv_getFontScaleFromHeight_int_fontFace_int_pixelHeight_int_thickness
/// Calculates the font-specific size to use to achieve a given height in pixels.
///
/// ## Parameters
/// * fontFace: Font to use, see cv::HersheyFonts.
/// * pixelHeight: Pixel height to compute the fontScale for
/// * thickness: Thickness of lines used to render the text.See putText for details.
/// @return The fontSize to use for cv::putText
///
/// @see cv::putText
///
/// ## C++ default parameters:
/// * thickness: 1
pub fn get_font_scale_from_height(font_face: i32, pixel_height: i32, thickness: i32) -> Result<f64> {
unsafe { sys::cv_core_cv_getFontScaleFromHeight_int_fontFace_int_pixelHeight_int_thickness(font_face, pixel_height, thickness) }.into_result()
}
// identifier: cv_getGaborKernel_Size_ksize_double_sigma_double_theta_double_lambd_double_gamma_double_psi_int_ktype
/// Returns Gabor filter coefficients.
///
/// For more details about gabor filter equations and parameters, see: [Gabor
/// Filter](http://en.wikipedia.org/wiki/Gabor_filter).
///
/// ## Parameters
/// * ksize: Size of the filter returned.
/// * sigma: Standard deviation of the gaussian envelope.
/// * theta: Orientation of the normal to the parallel stripes of a Gabor function.
/// * lambd: Wavelength of the sinusoidal factor.
/// * gamma: Spatial aspect ratio.
/// * psi: Phase offset.
/// * ktype: Type of filter coefficients. It can be CV_32F or CV_64F .
///
/// ## C++ default parameters:
/// * psi: CV_PI*0.5
/// * ktype: CV_64F
pub fn get_gabor_kernel(ksize: core::Size, sigma: f64, theta: f64, lambd: f64, gamma: f64, psi: f64, ktype: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_getGaborKernel_Size_ksize_double_sigma_double_theta_double_lambd_double_gamma_double_psi_int_ktype(ksize, sigma, theta, lambd, gamma, psi, ktype) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_getGaussianKernel_int_ksize_double_sigma_int_ktype
/// Returns Gaussian filter coefficients.
///
/// The function computes and returns the <span lang='latex'>\texttt{ksize} \times 1</span> matrix of Gaussian filter
/// coefficients:
///
/// <div lang='latex'>G_i= \alpha *e^{-(i-( \texttt{ksize} -1)/2)^2/(2* \texttt{sigma}^2)},</div>
///
/// where <span lang='latex'>i=0..\texttt{ksize}-1</span> and <span lang='latex'>\alpha</span> is the scale factor chosen so that <span lang='latex'>\sum_i G_i=1</span>.
///
/// Two of such generated kernels can be passed to sepFilter2D. Those functions automatically recognize
/// smoothing kernels (a symmetrical kernel with sum of weights equal to 1) and handle them accordingly.
/// You may also use the higher-level GaussianBlur.
/// ## Parameters
/// * ksize: Aperture size. It should be odd ( <span lang='latex'>\texttt{ksize} \mod 2 = 1</span> ) and positive.
/// * sigma: Gaussian standard deviation. If it is non-positive, it is computed from ksize as
/// `sigma = 0.3*((ksize-1)*0.5 - 1) + 0.8`.
/// * ktype: Type of filter coefficients. It can be CV_32F or CV_64F .
/// @sa sepFilter2D, getDerivKernels, getStructuringElement, GaussianBlur
///
/// ## C++ default parameters:
/// * ktype: CV_64F
pub fn get_gaussian_kernel(ksize: i32, sigma: f64, ktype: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_getGaussianKernel_int_ksize_double_sigma_int_ktype(ksize, sigma, ktype) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_getHardwareFeatureName_int_feature
/// Returns feature name by ID
///
/// Returns empty string if feature is not defined
pub fn get_hardware_feature_name(feature: i32) -> Result<String> {
unsafe { sys::cv_core_cv_getHardwareFeatureName_int_feature(feature) }.into_result().map(crate::templ::receive_string_mut)
}
// identifier: cv_getMouseWheelDelta_int_flags
/// Gets the mouse-wheel motion delta, when handling mouse-wheel events cv::EVENT_MOUSEWHEEL and
/// cv::EVENT_MOUSEHWHEEL.
///
/// For regular mice with a scroll-wheel, delta will be a multiple of 120. The value 120 corresponds to
/// a one notch rotation of the wheel or the threshold for action to be taken and one such action should
/// occur for each delta. Some high-precision mice with higher-resolution freely-rotating wheels may
/// generate smaller values.
///
/// For cv::EVENT_MOUSEWHEEL positive and negative values mean forward and backward scrolling,
/// respectively. For cv::EVENT_MOUSEHWHEEL, where available, positive and negative values mean right and
/// left scrolling, respectively.
///
/// With the C API, the macro CV_GET_WHEEL_DELTA(flags) can be used alternatively.
///
///
/// Note:
///
/// Mouse-wheel events are currently supported only on Windows.
///
/// ## Parameters
/// * flags: The mouse callback flags parameter.
pub fn get_mouse_wheel_delta(flags: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_getMouseWheelDelta_int_flags(flags) }.into_result()
}
// identifier: cv_getNearestPoint_VectorOfPoint2f_recallPrecisionCurve_float_l_precision
pub fn get_nearest_point(recall_precision_curve: &types::VectorOfPoint2f, l_precision: f32) -> Result<i32> {
unsafe { sys::cv_core_cv_getNearestPoint_VectorOfPoint2f_recallPrecisionCurve_float_l_precision(recall_precision_curve.as_raw_VectorOfPoint2f(), l_precision) }.into_result()
}
// identifier: cv_getNumThreads
/// Returns the number of threads used by OpenCV for parallel regions.
///
/// Always returns 1 if OpenCV is built without threading support.
///
/// The exact meaning of return value depends on the threading framework used by OpenCV library:
/// - `TBB` - The number of threads, that OpenCV will try to use for parallel regions. If there is
/// any tbb::thread_scheduler_init in user code conflicting with OpenCV, then function returns
/// default number of threads used by TBB library.
/// - `OpenMP` - An upper bound on the number of threads that could be used to form a new team.
/// - `Concurrency` - The number of threads, that OpenCV will try to use for parallel regions.
/// - `GCD` - Unsupported; returns the GCD thread pool limit (512) for compatibility.
/// - `C=` - The number of threads, that OpenCV will try to use for parallel regions, if before
/// called setNumThreads with threads \> 0, otherwise returns the number of logical CPUs,
/// available for the process.
/// @sa setNumThreads, getThreadNum
pub fn get_num_threads() -> Result<i32> {
unsafe { sys::cv_core_cv_getNumThreads() }.into_result()
}
// identifier: cv_getNumberOfCPUs
/// Returns the number of logical CPUs available for the process.
pub fn get_number_of_cpus() -> Result<i32> {
unsafe { sys::cv_core_cv_getNumberOfCPUs() }.into_result()
}
// identifier: cv_getOptimalDFTSize_int_vecsize
/// Returns the optimal DFT size for a given vector size.
///
/// DFT performance is not a monotonic function of a vector size. Therefore, when you calculate
/// convolution of two arrays or perform the spectral analysis of an array, it usually makes sense to
/// pad the input data with zeros to get a bit larger array that can be transformed much faster than the
/// original one. Arrays whose size is a power-of-two (2, 4, 8, 16, 32, ...) are the fastest to process.
/// Though, the arrays whose size is a product of 2's, 3's, and 5's (for example, 300 = 5\*5\*3\*2\*2)
/// are also processed quite efficiently.
///
/// The function cv::getOptimalDFTSize returns the minimum number N that is greater than or equal to vecsize
/// so that the DFT of a vector of size N can be processed efficiently. In the current implementation N
/// = 2 ^p^ \* 3 ^q^ \* 5 ^r^ for some integer p, q, r.
///
/// The function returns a negative number if vecsize is too large (very close to INT_MAX ).
///
/// While the function cannot be used directly to estimate the optimal vector size for DCT transform
/// (since the current DCT implementation supports only even-size vectors), it can be easily processed
/// as getOptimalDFTSize((vecsize+1)/2)\*2.
/// ## Parameters
/// * vecsize: vector size.
/// @sa dft , dct , idft , idct , mulSpectrums
pub fn get_optimal_dft_size(vecsize: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_getOptimalDFTSize_int_vecsize(vecsize) }.into_result()
}
// identifier: cv_getOptimalNewCameraMatrix_Mat_cameraMatrix_Mat_distCoeffs_Size_imageSize_double_alpha_Size_newImgSize_Rect_X_validPixROI_bool_centerPrincipalPoint
/// Returns the new camera matrix based on the free scaling parameter.
///
/// ## Parameters
/// * cameraMatrix: Input camera matrix.
/// * distCoeffs: Input vector of distortion coefficients
/// <span lang='latex'>(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])</span> of
/// 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are
/// assumed.
/// * imageSize: Original image size.
/// * alpha: Free scaling parameter between 0 (when all the pixels in the undistorted image are
/// valid) and 1 (when all the source image pixels are retained in the undistorted image). See
/// stereoRectify for details.
/// * newImgSize: Image size after rectification. By default, it is set to imageSize .
/// * validPixROI: Optional output rectangle that outlines all-good-pixels region in the
/// undistorted image. See roi1, roi2 description in stereoRectify .
/// * centerPrincipalPoint: Optional flag that indicates whether in the new camera matrix the
/// principal point should be at the image center or not. By default, the principal point is chosen to
/// best fit a subset of the source image (determined by alpha) to the corrected image.
/// @return new_camera_matrix Output new camera matrix.
///
/// The function computes and returns the optimal new camera matrix based on the free scaling parameter.
/// By varying this parameter, you may retrieve only sensible pixels alpha=0 , keep all the original
/// image pixels if there is valuable information in the corners alpha=1 , or get something in between.
/// When alpha\>0 , the undistorted result is likely to have some black pixels corresponding to
/// "virtual" pixels outside of the captured distorted image. The original camera matrix, distortion
/// coefficients, the computed new camera matrix, and newImageSize should be passed to
/// initUndistortRectifyMap to produce the maps for remap .
///
/// ## C++ default parameters:
/// * new_img_size: Size()
/// * valid_pix_roi: 0
/// * center_principal_point: false
pub fn get_optimal_new_camera_matrix(camera_matrix: &core::Mat, dist_coeffs: &core::Mat, image_size: core::Size, alpha: f64, new_img_size: core::Size, valid_pix_roi: &mut core::Rect, center_principal_point: bool) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_getOptimalNewCameraMatrix_Mat_cameraMatrix_Mat_distCoeffs_Size_imageSize_double_alpha_Size_newImgSize_Rect_X_validPixROI_bool_centerPrincipalPoint(camera_matrix.as_raw_Mat(), dist_coeffs.as_raw_Mat(), image_size, alpha, new_img_size, valid_pix_roi, center_principal_point) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_getPerspectiveTransform_Mat_src_Mat_dst
/// Calculates a perspective transform from four pairs of the corresponding points.
///
/// The function calculates the <span lang='latex'>3 \times 3</span> matrix of a perspective transform so that:
///
/// <div lang='latex'>\begin{bmatrix} t_i x'_i \\ t_i y'_i \\ t_i \end{bmatrix} = \texttt{map_matrix} \cdot \begin{bmatrix} x_i \\ y_i \\ 1 \end{bmatrix}</div>
///
/// where
///
/// <div lang='latex'>dst(i)=(x'_i,y'_i), src(i)=(x_i, y_i), i=0,1,2,3</div>
///
/// ## Parameters
/// * src: Coordinates of quadrangle vertices in the source image.
/// * dst: Coordinates of the corresponding quadrangle vertices in the destination image.
///
/// @sa findHomography, warpPerspective, perspectiveTransform
pub fn get_perspective_transform(src: &core::Mat, dst: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_getPerspectiveTransform_Mat_src_Mat_dst(src.as_raw_Mat(), dst.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_getPerspectiveTransform_const_Point2f_X_src_const_Point2f_X_dst
pub fn get_perspective_transform_1(src: &core::Point2f, dst: &core::Point2f) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_getPerspectiveTransform_const_Point2f_X_src_const_Point2f_X_dst(src, dst) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_getRecall_VectorOfPoint2f_recallPrecisionCurve_float_l_precision
pub fn get_recall(recall_precision_curve: &types::VectorOfPoint2f, l_precision: f32) -> Result<f32> {
unsafe { sys::cv_core_cv_getRecall_VectorOfPoint2f_recallPrecisionCurve_float_l_precision(recall_precision_curve.as_raw_VectorOfPoint2f(), l_precision) }.into_result()
}
// identifier: cv_getRectSubPix_Mat_image_Size_patchSize_Point2f_center_Mat_patch_int_patchType
/// Retrieves a pixel rectangle from an image with sub-pixel accuracy.
///
/// The function getRectSubPix extracts pixels from src:
///
/// <div lang='latex'>patch(x, y) = src(x + \texttt{center.x} - ( \texttt{dst.cols} -1)*0.5, y + \texttt{center.y} - ( \texttt{dst.rows} -1)*0.5)</div>
///
/// where the values of the pixels at non-integer coordinates are retrieved using bilinear
/// interpolation. Every channel of multi-channel images is processed independently. Also
/// the image should be a single channel or three channel image. While the center of the
/// rectangle must be inside the image, parts of the rectangle may be outside.
///
/// ## Parameters
/// * image: Source image.
/// * patchSize: Size of the extracted patch.
/// * center: Floating point coordinates of the center of the extracted rectangle within the
/// source image. The center must be inside the image.
/// * patch: Extracted patch that has the size patchSize and the same number of channels as src .
/// * patchType: Depth of the extracted pixels. By default, they have the same depth as src .
///
/// @sa warpAffine, warpPerspective
///
/// ## C++ default parameters:
/// * patch_type: -1
pub fn get_rect_sub_pix(image: &core::Mat, patch_size: core::Size, center: core::Point2f, patch: &mut core::Mat, patch_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_getRectSubPix_Mat_image_Size_patchSize_Point2f_center_Mat_patch_int_patchType(image.as_raw_Mat(), patch_size, center, patch.as_raw_Mat(), patch_type) }.into_result()
}
// identifier: cv_getRotationMatrix2D_Point2f_center_double_angle_double_scale
/// Calculates an affine matrix of 2D rotation.
///
/// The function calculates the following matrix:
///
/// <div lang='latex'>\begin{bmatrix} \alpha & \beta & (1- \alpha ) \cdot \texttt{center.x} - \beta \cdot \texttt{center.y} \\ - \beta & \alpha & \beta \cdot \texttt{center.x} + (1- \alpha ) \cdot \texttt{center.y} \end{bmatrix}</div>
///
/// where
///
/// <div lang='latex'>\begin{array}{l} \alpha = \texttt{scale} \cdot \cos \texttt{angle} , \\ \beta = \texttt{scale} \cdot \sin \texttt{angle} \end{array}</div>
///
/// The transformation maps the rotation center to itself. If this is not the target, adjust the shift.
///
/// ## Parameters
/// * center: Center of the rotation in the source image.
/// * angle: Rotation angle in degrees. Positive values mean counter-clockwise rotation (the
/// coordinate origin is assumed to be the top-left corner).
/// * scale: Isotropic scale factor.
///
/// @sa getAffineTransform, warpAffine, transform
pub fn get_rotation_matrix2_d(center: core::Point2f, angle: f64, scale: f64) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_getRotationMatrix2D_Point2f_center_double_angle_double_scale(center, angle, scale) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_getStructuringElement_int_shape_Size_ksize_Point_anchor
/// Returns a structuring element of the specified size and shape for morphological operations.
///
/// The function constructs and returns the structuring element that can be further passed to #erode,
/// #dilate or #morphologyEx. But you can also construct an arbitrary binary mask yourself and use it as
/// the structuring element.
///
/// ## Parameters
/// * shape: Element shape that could be one of #MorphShapes
/// * ksize: Size of the structuring element.
/// * anchor: Anchor position within the element. The default value <span lang='latex'>(-1, -1)</span> means that the
/// anchor is at the center. Note that only the shape of a cross-shaped element depends on the anchor
/// position. In other cases the anchor just regulates how much the result of the morphological
/// operation is shifted.
///
/// ## C++ default parameters:
/// * anchor: Point(-1,-1)
pub fn get_structuring_element(shape: i32, ksize: core::Size, anchor: core::Point) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_getStructuringElement_int_shape_Size_ksize_Point_anchor(shape, ksize, anchor) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_getTextSize_String_text_int_fontFace_double_fontScale_int_thickness_int_X_baseLine
/// Calculates the width and height of a text string.
///
/// The function cv::getTextSize calculates and returns the size of a box that contains the specified text.
/// That is, the following code renders some text, the tight box surrounding it, and the baseline: :
/// ```ignore
/// String text = "Funny text inside the box";
/// int fontFace = FONT_HERSHEY_SCRIPT_SIMPLEX;
/// double fontScale = 2;
/// int thickness = 3;
///
/// Mat img(600, 800, CV_8UC3, Scalar::all(0));
///
/// int baseline=0;
/// Size textSize = getTextSize(text, fontFace,
/// fontScale, thickness, &baseline);
/// baseline += thickness;
///
/// // center the text
/// Point textOrg((img.cols - textSize.width)/2,
/// (img.rows + textSize.height)/2);
///
/// // draw the box
/// rectangle(img, textOrg + Point(0, baseline),
/// textOrg + Point(textSize.width, -textSize.height),
/// Scalar(0,0,255));
/// // ... and the baseline first
/// line(img, textOrg + Point(0, thickness),
/// textOrg + Point(textSize.width, thickness),
/// Scalar(0, 0, 255));
///
/// // then put the text itself
/// putText(img, text, textOrg, fontFace, fontScale,
/// Scalar::all(255), thickness, 8);
/// ```
///
///
/// ## Parameters
/// * text: Input text string.
/// * fontFace: Font to use, see #HersheyFonts.
/// * fontScale: Font scale factor that is multiplied by the font-specific base size.
/// * thickness: Thickness of lines used to render the text. See #putText for details.
/// @param[out] baseLine y-coordinate of the baseline relative to the bottom-most text
/// point.
/// @return The size of a box that contains the specified text.
///
/// @see putText
pub fn get_text_size(text: &str, font_face: i32, font_scale: f64, thickness: i32, base_line: &mut i32) -> Result<core::Size> {
string_arg!(text);
unsafe { sys::cv_core_cv_getTextSize_String_text_int_fontFace_double_fontScale_int_thickness_int_X_baseLine(text.as_ptr(), font_face, font_scale, thickness, base_line) }.into_result()
}
// identifier: cv_getThreadNum
/// Returns the index of the currently executed thread within the current parallel region. Always
/// returns 0 if called outside of parallel region.
///
/// @deprecated Current implementation doesn't corresponding to this documentation.
///
/// The exact meaning of the return value depends on the threading framework used by OpenCV library:
/// - `TBB` - Unsupported with current 4.1 TBB release. Maybe will be supported in future.
/// - `OpenMP` - The thread number, within the current team, of the calling thread.
/// - `Concurrency` - An ID for the virtual processor that the current context is executing on (0
/// for master thread and unique number for others, but not necessary 1,2,3,...).
/// - `GCD` - System calling thread's ID. Never returns 0 inside parallel region.
/// - `C=` - The index of the current parallel task.
/// @sa setNumThreads, getNumThreads
pub fn get_thread_num() -> Result<i32> {
unsafe { sys::cv_core_cv_getThreadNum() }.into_result()
}
// identifier: cv_getTickCount
/// Returns the number of ticks.
///
/// The function returns the number of ticks after the certain event (for example, when the machine was
/// turned on). It can be used to initialize RNG or to measure a function execution time by reading the
/// tick count before and after the function call.
/// @sa getTickFrequency, TickMeter
pub fn get_tick_count() -> Result<i64> {
unsafe { sys::cv_core_cv_getTickCount() }.into_result()
}
// identifier: cv_getTickFrequency
/// Returns the number of ticks per second.
///
/// The function returns the number of ticks per second. That is, the following code computes the
/// execution time in seconds:
/// ```ignore
/// double t = (double)getTickCount();
/// // do something ...
/// t = ((double)getTickCount() - t)/getTickFrequency();
/// ```
///
/// @sa getTickCount, TickMeter
pub fn get_tick_frequency() -> Result<f64> {
unsafe { sys::cv_core_cv_getTickFrequency() }.into_result()
}
// identifier: cv_getTrackbarPos_String_trackbarname_String_winname
/// Returns the trackbar position.
///
/// The function returns the current position of the specified trackbar.
///
///
/// Note:
///
/// [__Qt Backend Only__] winname can be empty (or NULL) if the trackbar is attached to the control
/// panel.
///
/// ## Parameters
/// * trackbarname: Name of the trackbar.
/// * winname: Name of the window that is the parent of the trackbar.
pub fn get_trackbar_pos(trackbarname: &str, winname: &str) -> Result<i32> {
string_arg!(trackbarname);
string_arg!(winname);
unsafe { sys::cv_core_cv_getTrackbarPos_String_trackbarname_String_winname(trackbarname.as_ptr(), winname.as_ptr()) }.into_result()
}
// identifier: cv_getValidDisparityROI_Rect_roi1_Rect_roi2_int_minDisparity_int_numberOfDisparities_int_SADWindowSize
pub fn get_valid_disparity_roi(roi1: core::Rect, roi2: core::Rect, min_disparity: i32, number_of_disparities: i32, sad_window_size: i32) -> Result<core::Rect> {
unsafe { sys::cv_core_cv_getValidDisparityROI_Rect_roi1_Rect_roi2_int_minDisparity_int_numberOfDisparities_int_SADWindowSize(roi1, roi2, min_disparity, number_of_disparities, sad_window_size) }.into_result()
}
// identifier: cv_getVersionMajor
/// Returns major library version
pub fn get_version_major() -> Result<i32> {
unsafe { sys::cv_core_cv_getVersionMajor() }.into_result()
}
// identifier: cv_getVersionMinor
/// Returns minor library version
pub fn get_version_minor() -> Result<i32> {
unsafe { sys::cv_core_cv_getVersionMinor() }.into_result()
}
// identifier: cv_getVersionRevision
/// Returns revision field of the library version
pub fn get_version_revision() -> Result<i32> {
unsafe { sys::cv_core_cv_getVersionRevision() }.into_result()
}
// identifier: cv_getVersionString
/// Returns library version string
///
/// For example "3.4.1-dev".
///
/// @sa getMajorVersion, getMinorVersion, getRevisionVersion
pub fn get_version_string() -> Result<String> {
unsafe { sys::cv_core_cv_getVersionString() }.into_result().map(crate::templ::receive_string_mut)
}
// identifier: cv_getWindowImageRect_String_winname
/// Provides rectangle of image in the window.
///
/// The function getWindowImageRect returns the client screen coordinates, width and height of the image rendering area.
///
/// ## Parameters
/// * winname: Name of the window.
///
/// @sa resizeWindow moveWindow
pub fn get_window_image_rect(winname: &str) -> Result<core::Rect> {
string_arg!(winname);
unsafe { sys::cv_core_cv_getWindowImageRect_String_winname(winname.as_ptr()) }.into_result()
}
// identifier: cv_getWindowProperty_String_winname_int_prop_id
/// Provides parameters of a window.
///
/// The function getWindowProperty returns properties of a window.
///
/// ## Parameters
/// * winname: Name of the window.
/// * prop_id: Window property to retrieve. The following operation flags are available: (cv::WindowPropertyFlags)
///
/// @sa setWindowProperty
pub fn get_window_property(winname: &str, prop_id: i32) -> Result<f64> {
string_arg!(winname);
unsafe { sys::cv_core_cv_getWindowProperty_String_winname_int_prop_id(winname.as_ptr(), prop_id) }.into_result()
}
// identifier: cv_glob_String_pattern_VectorOfString_result_bool_recursive
///
/// ## C++ default parameters:
/// * recursive: false
pub fn glob(pattern: &str, result: &types::VectorOfString, recursive: bool) -> Result<()> {
string_arg!(mut pattern);
unsafe { sys::cv_core_cv_glob_String_pattern_VectorOfString_result_bool_recursive(pattern.as_ptr() as _, result.as_raw_VectorOfString(), recursive) }.into_result()
}
// identifier: cv_goodFeaturesToTrack_Mat_image_Mat_corners_int_maxCorners_double_qualityLevel_double_minDistance_Mat_mask_int_blockSize_bool_useHarrisDetector_double_k
/// Determines strong corners on an image.
///
/// The function finds the most prominent corners in the image or in the specified image region, as
/// described in @cite Shi94
///
/// * Function calculates the corner quality measure at every source image pixel using the
/// #cornerMinEigenVal or #cornerHarris .
/// * Function performs a non-maximum suppression (the local maximums in *3 x 3* neighborhood are
/// retained).
/// * The corners with the minimal eigenvalue less than
/// <span lang='latex'>\texttt{qualityLevel} \cdot \max_{x,y} qualityMeasureMap(x,y)</span> are rejected.
/// * The remaining corners are sorted by the quality measure in the descending order.
/// * Function throws away each corner for which there is a stronger corner at a distance less than
/// maxDistance.
///
/// The function can be used to initialize a point-based tracker of an object.
///
///
/// Note: If the function is called with different values A and B of the parameter qualityLevel , and
/// A \> B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector
/// with qualityLevel=B .
///
/// ## Parameters
/// * image: Input 8-bit or floating-point 32-bit, single-channel image.
/// * corners: Output vector of detected corners.
/// * maxCorners: Maximum number of corners to return. If there are more corners than are found,
/// the strongest of them is returned. `maxCorners <= 0` implies that no limit on the maximum is set
/// and all detected corners are returned.
/// * qualityLevel: Parameter characterizing the minimal accepted quality of image corners. The
/// parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue
/// (see #cornerMinEigenVal ) or the Harris function response (see #cornerHarris ). The corners with the
/// quality measure less than the product are rejected. For example, if the best corner has the
/// quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure
/// less than 15 are rejected.
/// * minDistance: Minimum possible Euclidean distance between the returned corners.
/// * mask: Optional region of interest. If the image is not empty (it needs to have the type
/// CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected.
/// * blockSize: Size of an average block for computing a derivative covariation matrix over each
/// pixel neighborhood. See cornerEigenValsAndVecs .
/// * useHarrisDetector: Parameter indicating whether to use a Harris detector (see #cornerHarris)
/// or #cornerMinEigenVal.
/// * k: Free parameter of the Harris detector.
///
/// @sa cornerMinEigenVal, cornerHarris, calcOpticalFlowPyrLK, estimateRigidTransform,
///
/// ## C++ default parameters:
/// * mask: noArray()
/// * block_size: 3
/// * use_harris_detector: false
/// * k: 0.04
pub fn good_features_to_track(image: &core::Mat, corners: &mut core::Mat, max_corners: i32, quality_level: f64, min_distance: f64, mask: &core::Mat, block_size: i32, use_harris_detector: bool, k: f64) -> Result<()> {
unsafe { sys::cv_core_cv_goodFeaturesToTrack_Mat_image_Mat_corners_int_maxCorners_double_qualityLevel_double_minDistance_Mat_mask_int_blockSize_bool_useHarrisDetector_double_k(image.as_raw_Mat(), corners.as_raw_Mat(), max_corners, quality_level, min_distance, mask.as_raw_Mat(), block_size, use_harris_detector, k) }.into_result()
}
// identifier: cv_goodFeaturesToTrack_Mat_image_Mat_corners_int_maxCorners_double_qualityLevel_double_minDistance_Mat_mask_int_blockSize_int_gradientSize_bool_useHarrisDetector_double_k
///
/// ## C++ default parameters:
/// * use_harris_detector: false
/// * k: 0.04
pub fn good_features_to_track_1(image: &core::Mat, corners: &mut core::Mat, max_corners: i32, quality_level: f64, min_distance: f64, mask: &core::Mat, block_size: i32, gradient_size: i32, use_harris_detector: bool, k: f64) -> Result<()> {
unsafe { sys::cv_core_cv_goodFeaturesToTrack_Mat_image_Mat_corners_int_maxCorners_double_qualityLevel_double_minDistance_Mat_mask_int_blockSize_int_gradientSize_bool_useHarrisDetector_double_k(image.as_raw_Mat(), corners.as_raw_Mat(), max_corners, quality_level, min_distance, mask.as_raw_Mat(), block_size, gradient_size, use_harris_detector, k) }.into_result()
}
// identifier: cv_grabCut_Mat_img_Mat_mask_Rect_rect_Mat_bgdModel_Mat_fgdModel_int_iterCount_int_mode
/// Runs the GrabCut algorithm.
///
/// The function implements the [GrabCut image segmentation algorithm](http://en.wikipedia.org/wiki/GrabCut).
///
/// ## Parameters
/// * img: Input 8-bit 3-channel image.
/// * mask: Input/output 8-bit single-channel mask. The mask is initialized by the function when
/// mode is set to #GC_INIT_WITH_RECT. Its elements may have one of the #GrabCutClasses.
/// * rect: ROI containing a segmented object. The pixels outside of the ROI are marked as
/// "obvious background". The parameter is only used when mode==#GC_INIT_WITH_RECT .
/// * bgdModel: Temporary array for the background model. Do not modify it while you are
/// processing the same image.
/// * fgdModel: Temporary arrays for the foreground model. Do not modify it while you are
/// processing the same image.
/// * iterCount: Number of iterations the algorithm should make before returning the result. Note
/// that the result can be refined with further calls with mode==#GC_INIT_WITH_MASK or
/// mode==GC_EVAL .
/// * mode: Operation mode that could be one of the #GrabCutModes
///
/// ## C++ default parameters:
/// * mode: GC_EVAL
pub fn grab_cut(img: &core::Mat, mask: &mut core::Mat, rect: core::Rect, bgd_model: &mut core::Mat, fgd_model: &mut core::Mat, iter_count: i32, mode: i32) -> Result<()> {
unsafe { sys::cv_core_cv_grabCut_Mat_img_Mat_mask_Rect_rect_Mat_bgdModel_Mat_fgdModel_int_iterCount_int_mode(img.as_raw_Mat(), mask.as_raw_Mat(), rect, bgd_model.as_raw_Mat(), fgd_model.as_raw_Mat(), iter_count, mode) }.into_result()
}
// identifier: cv_groupRectangles_VectorOfRect_rectList_VectorOfint_rejectLevels_VectorOfdouble_levelWeights_int_groupThreshold_double_eps
/// @overload
///
/// ## C++ default parameters:
/// * eps: 0.2
pub fn group_rectangles_weights_rejects(rect_list: &types::VectorOfRect, reject_levels: &types::VectorOfint, level_weights: &types::VectorOfdouble, group_threshold: i32, eps: f64) -> Result<()> {
unsafe { sys::cv_core_cv_groupRectangles_VectorOfRect_rectList_VectorOfint_rejectLevels_VectorOfdouble_levelWeights_int_groupThreshold_double_eps(rect_list.as_raw_VectorOfRect(), reject_levels.as_raw_VectorOfint(), level_weights.as_raw_VectorOfdouble(), group_threshold, eps) }.into_result()
}
// identifier: cv_groupRectangles_VectorOfRect_rectList_VectorOfint_weights_int_groupThreshold_double_eps
/// @overload
///
/// ## C++ default parameters:
/// * eps: 0.2
pub fn group_rectangle_weights(rect_list: &types::VectorOfRect, weights: &types::VectorOfint, group_threshold: i32, eps: f64) -> Result<()> {
unsafe { sys::cv_core_cv_groupRectangles_VectorOfRect_rectList_VectorOfint_weights_int_groupThreshold_double_eps(rect_list.as_raw_VectorOfRect(), weights.as_raw_VectorOfint(), group_threshold, eps) }.into_result()
}
// identifier: cv_groupRectangles_VectorOfRect_rectList_int_groupThreshold_double_eps
/// Groups the object candidate rectangles.
///
/// ## Parameters
/// * rectList: Input/output vector of rectangles. Output vector includes retained and grouped
/// rectangles. (The Python list is not modified in place.)
/// * groupThreshold: Minimum possible number of rectangles minus 1. The threshold is used in a
/// group of rectangles to retain it.
/// * eps: Relative difference between sides of the rectangles to merge them into a group.
///
/// The function is a wrapper for the generic function partition . It clusters all the input rectangles
/// using the rectangle equivalence criteria that combines rectangles with similar sizes and similar
/// locations. The similarity is defined by eps. When eps=0 , no clustering is done at all. If
/// <span lang='latex'>\texttt{eps}\rightarrow +\inf</span> , all the rectangles are put in one cluster. Then, the small
/// clusters containing less than or equal to groupThreshold rectangles are rejected. In each other
/// cluster, the average rectangle is computed and put into the output rectangle list.
///
/// ## C++ default parameters:
/// * eps: 0.2
pub fn group_rectangle(rect_list: &types::VectorOfRect, group_threshold: i32, eps: f64) -> Result<()> {
unsafe { sys::cv_core_cv_groupRectangles_VectorOfRect_rectList_int_groupThreshold_double_eps(rect_list.as_raw_VectorOfRect(), group_threshold, eps) }.into_result()
}
// identifier: cv_groupRectangles_VectorOfRect_rectList_int_groupThreshold_double_eps_VectorOfint_weights_VectorOfdouble_levelWeights
/// @overload
pub fn group_rectangle_levelweights(rect_list: &types::VectorOfRect, group_threshold: i32, eps: f64, weights: &types::VectorOfint, level_weights: &types::VectorOfdouble) -> Result<()> {
unsafe { sys::cv_core_cv_groupRectangles_VectorOfRect_rectList_int_groupThreshold_double_eps_VectorOfint_weights_VectorOfdouble_levelWeights(rect_list.as_raw_VectorOfRect(), group_threshold, eps, weights.as_raw_VectorOfint(), level_weights.as_raw_VectorOfdouble()) }.into_result()
}
// identifier: cv_groupRectangles_meanshift_VectorOfRect_rectList_VectorOfdouble_foundWeights_VectorOfdouble_foundScales_double_detectThreshold_Size_winDetSize
/// @overload
///
/// ## C++ default parameters:
/// * detect_threshold: 0.0
/// * win_det_size: Size(64, 128)
pub fn group_rectangles_meanshift(rect_list: &types::VectorOfRect, found_weights: &types::VectorOfdouble, found_scales: &types::VectorOfdouble, detect_threshold: f64, win_det_size: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_groupRectangles_meanshift_VectorOfRect_rectList_VectorOfdouble_foundWeights_VectorOfdouble_foundScales_double_detectThreshold_Size_winDetSize(rect_list.as_raw_VectorOfRect(), found_weights.as_raw_VectorOfdouble(), found_scales.as_raw_VectorOfdouble(), detect_threshold, win_det_size) }.into_result()
}
// identifier: cv_hal_Cholesky32f_float_X_A_size_t_astep_int_m_float_X_b_size_t_bstep_int_n
pub fn cholesky32f(a: &mut f32, astep: size_t, m: i32, b: &mut f32, bstep: size_t, n: i32) -> Result<bool> {
unsafe { sys::cv_core_cv_hal_Cholesky32f_float_X_A_size_t_astep_int_m_float_X_b_size_t_bstep_int_n(a, astep, m, b, bstep, n) }.into_result()
}
// identifier: cv_hal_Cholesky64f_double_X_A_size_t_astep_int_m_double_X_b_size_t_bstep_int_n
pub fn cholesky64f(a: &mut f64, astep: size_t, m: i32, b: &mut f64, bstep: size_t, n: i32) -> Result<bool> {
unsafe { sys::cv_core_cv_hal_Cholesky64f_double_X_A_size_t_astep_int_m_double_X_b_size_t_bstep_int_n(a, astep, m, b, bstep, n) }.into_result()
}
// identifier: cv_hal_LU32f_float_X_A_size_t_astep_int_m_float_X_b_size_t_bstep_int_n
pub fn lu32f(a: &mut f32, astep: size_t, m: i32, b: &mut f32, bstep: size_t, n: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_hal_LU32f_float_X_A_size_t_astep_int_m_float_X_b_size_t_bstep_int_n(a, astep, m, b, bstep, n) }.into_result()
}
// identifier: cv_hal_LU64f_double_X_A_size_t_astep_int_m_double_X_b_size_t_bstep_int_n
pub fn lu64f(a: &mut f64, astep: size_t, m: i32, b: &mut f64, bstep: size_t, n: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_hal_LU64f_double_X_A_size_t_astep_int_m_double_X_b_size_t_bstep_int_n(a, astep, m, b, bstep, n) }.into_result()
}
// identifier: cv_hal_QR32f_float_X_A_size_t_astep_int_m_int_n_int_k_float_X_b_size_t_bstep_float_X_hFactors
pub fn qr32f(a: &mut f32, astep: size_t, m: i32, n: i32, k: i32, b: &mut f32, bstep: size_t, h_factors: &mut f32) -> Result<i32> {
unsafe { sys::cv_core_cv_hal_QR32f_float_X_A_size_t_astep_int_m_int_n_int_k_float_X_b_size_t_bstep_float_X_hFactors(a, astep, m, n, k, b, bstep, h_factors) }.into_result()
}
// identifier: cv_hal_QR64f_double_X_A_size_t_astep_int_m_int_n_int_k_double_X_b_size_t_bstep_double_X_hFactors
pub fn qr64f(a: &mut f64, astep: size_t, m: i32, n: i32, k: i32, b: &mut f64, bstep: size_t, h_factors: &mut f64) -> Result<i32> {
unsafe { sys::cv_core_cv_hal_QR64f_double_X_A_size_t_astep_int_m_int_n_int_k_double_X_b_size_t_bstep_double_X_hFactors(a, astep, m, n, k, b, bstep, h_factors) }.into_result()
}
// identifier: cv_hal_SVD32f_float_X_At_size_t_astep_float_X_W_float_X_U_size_t_ustep_float_X_Vt_size_t_vstep_int_m_int_n_int_flags
pub fn svd32f(at: &mut f32, astep: size_t, w: &mut f32, u: &mut f32, ustep: size_t, vt: &mut f32, vstep: size_t, m: i32, n: i32, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_SVD32f_float_X_At_size_t_astep_float_X_W_float_X_U_size_t_ustep_float_X_Vt_size_t_vstep_int_m_int_n_int_flags(at, astep, w, u, ustep, vt, vstep, m, n, flags) }.into_result()
}
// identifier: cv_hal_SVD64f_double_X_At_size_t_astep_double_X_W_double_X_U_size_t_ustep_double_X_Vt_size_t_vstep_int_m_int_n_int_flags
pub fn svd64f(at: &mut f64, astep: size_t, w: &mut f64, u: &mut f64, ustep: size_t, vt: &mut f64, vstep: size_t, m: i32, n: i32, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_SVD64f_double_X_At_size_t_astep_double_X_W_double_X_U_size_t_ustep_double_X_Vt_size_t_vstep_int_m_int_n_int_flags(at, astep, w, u, ustep, vt, vstep, m, n, flags) }.into_result()
}
// identifier: cv_hal_absdiff16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn absdiff16s(src1: &i16, step1: size_t, src2: &i16, step2: size_t, dst: &mut i16, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_absdiff16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_absdiff16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn absdiff16u(src1: &u16, step1: size_t, src2: &u16, step2: size_t, dst: &mut u16, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_absdiff16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_absdiff32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn absdiff32f(src1: &f32, step1: size_t, src2: &f32, step2: size_t, dst: &mut f32, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_absdiff32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_absdiff32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn absdiff32s(src1: &i32, step1: size_t, src2: &i32, step2: size_t, dst: &mut i32, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_absdiff32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_absdiff64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn absdiff64f(src1: &f64, step1: size_t, src2: &f64, step2: size_t, dst: &mut f64, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_absdiff64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_absdiff8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn absdiff8s(src1: &i8, step1: size_t, src2: &i8, step2: size_t, dst: &mut i8, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_absdiff8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_absdiff8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn absdiff8u(src1: &u8, step1: size_t, src2: &u8, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_absdiff8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_add16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn add16s(src1: &i16, step1: size_t, src2: &i16, step2: size_t, dst: &mut i16, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_add16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_add16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn add16u(src1: &u16, step1: size_t, src2: &u16, step2: size_t, dst: &mut u16, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_add16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_add32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn add32f(src1: &f32, step1: size_t, src2: &f32, step2: size_t, dst: &mut f32, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_add32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_add32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn add32s(src1: &i32, step1: size_t, src2: &i32, step2: size_t, dst: &mut i32, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_add32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_add64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn add64f(src1: &f64, step1: size_t, src2: &f64, step2: size_t, dst: &mut f64, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_add64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_add8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn add8s(src1: &i8, step1: size_t, src2: &i8, step2: size_t, dst: &mut i8, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_add8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_add8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn add8u(src1: &u8, step1: size_t, src2: &u8, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_add8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_addWeighted16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_scalars
pub fn add_weighted16s(src1: &i16, step1: size_t, src2: &i16, step2: size_t, dst: &mut i16, step: size_t, width: i32, height: i32, scalars: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_addWeighted16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_scalars(src1, step1, src2, step2, dst, step, width, height, scalars) }.into_result()
}
// identifier: cv_hal_addWeighted16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_scalars
pub fn add_weighted16u(src1: &u16, step1: size_t, src2: &u16, step2: size_t, dst: &mut u16, step: size_t, width: i32, height: i32, scalars: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_addWeighted16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_scalars(src1, step1, src2, step2, dst, step, width, height, scalars) }.into_result()
}
// identifier: cv_hal_addWeighted32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_scalars
pub fn add_weighted32f(src1: &f32, step1: size_t, src2: &f32, step2: size_t, dst: &mut f32, step: size_t, width: i32, height: i32, scalars: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_addWeighted32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_scalars(src1, step1, src2, step2, dst, step, width, height, scalars) }.into_result()
}
// identifier: cv_hal_addWeighted32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_scalars
pub fn add_weighted32s(src1: &i32, step1: size_t, src2: &i32, step2: size_t, dst: &mut i32, step: size_t, width: i32, height: i32, scalars: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_addWeighted32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_scalars(src1, step1, src2, step2, dst, step, width, height, scalars) }.into_result()
}
// identifier: cv_hal_addWeighted64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_scalars
pub fn add_weighted64f(src1: &f64, step1: size_t, src2: &f64, step2: size_t, dst: &mut f64, step: size_t, width: i32, height: i32, scalars: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_addWeighted64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_scalars(src1, step1, src2, step2, dst, step, width, height, scalars) }.into_result()
}
// identifier: cv_hal_addWeighted8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_scalars
pub fn add_weighted8s(src1: &i8, step1: size_t, src2: &i8, step2: size_t, dst: &mut i8, step: size_t, width: i32, height: i32, scalars: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_addWeighted8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_scalars(src1, step1, src2, step2, dst, step, width, height, scalars) }.into_result()
}
// identifier: cv_hal_addWeighted8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__scalars
pub fn add_weighted8u(src1: &u8, step1: size_t, src2: &u8, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, _scalars: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_addWeighted8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__scalars(src1, step1, src2, step2, dst, step, width, height, _scalars) }.into_result()
}
// identifier: cv_hal_and8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn and8u(src1: &u8, step1: size_t, src2: &u8, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_and8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_cmp16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__cmpop
pub fn cmp16s(src1: &i16, step1: size_t, src2: &i16, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, _cmpop: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cmp16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__cmpop(src1, step1, src2, step2, dst, step, width, height, _cmpop) }.into_result()
}
// identifier: cv_hal_cmp16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__cmpop
pub fn cmp16u(src1: &u16, step1: size_t, src2: &u16, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, _cmpop: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cmp16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__cmpop(src1, step1, src2, step2, dst, step, width, height, _cmpop) }.into_result()
}
// identifier: cv_hal_cmp32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__cmpop
pub fn cmp32f(src1: &f32, step1: size_t, src2: &f32, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, _cmpop: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cmp32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__cmpop(src1, step1, src2, step2, dst, step, width, height, _cmpop) }.into_result()
}
// identifier: cv_hal_cmp32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__cmpop
pub fn cmp32s(src1: &i32, step1: size_t, src2: &i32, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, _cmpop: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cmp32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__cmpop(src1, step1, src2, step2, dst, step, width, height, _cmpop) }.into_result()
}
// identifier: cv_hal_cmp64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__cmpop
pub fn cmp64f(src1: &f64, step1: size_t, src2: &f64, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, _cmpop: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cmp64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__cmpop(src1, step1, src2, step2, dst, step, width, height, _cmpop) }.into_result()
}
// identifier: cv_hal_cmp8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__cmpop
pub fn cmp8s(src1: &i8, step1: size_t, src2: &i8, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, _cmpop: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cmp8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__cmpop(src1, step1, src2, step2, dst, step, width, height, _cmpop) }.into_result()
}
// identifier: cv_hal_cmp8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__cmpop
pub fn cmp8u(src1: &u8, step1: size_t, src2: &u8, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, _cmpop: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cmp8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X__cmpop(src1, step1, src2, step2, dst, step, width, height, _cmpop) }.into_result()
}
// identifier: cv_hal_cvtBGR5x5toBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_dcn_bool_swapBlue_int_greenBits
pub fn cvt_bgr5x5to_bgr(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, dcn: i32, swap_blue: bool, green_bits: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtBGR5x5toBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_dcn_bool_swapBlue_int_greenBits(src_data, src_step, dst_data, dst_step, width, height, dcn, swap_blue, green_bits) }.into_result()
}
// identifier: cv_hal_cvtBGR5x5toGray_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_greenBits
pub fn cvt_bgr5x5to_gray(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, green_bits: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtBGR5x5toGray_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_greenBits(src_data, src_step, dst_data, dst_step, width, height, green_bits) }.into_result()
}
// identifier: cv_hal_cvtBGRtoBGR5x5_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_scn_bool_swapBlue_int_greenBits
pub fn cvt_bg_rto_bgr5x5(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, scn: i32, swap_blue: bool, green_bits: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtBGRtoBGR5x5_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_scn_bool_swapBlue_int_greenBits(src_data, src_step, dst_data, dst_step, width, height, scn, swap_blue, green_bits) }.into_result()
}
// identifier: cv_hal_cvtBGRtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_scn_int_dcn_bool_swapBlue
pub fn cvt_bg_rto_bgr(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, depth: i32, scn: i32, dcn: i32, swap_blue: bool) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtBGRtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_scn_int_dcn_bool_swapBlue(src_data, src_step, dst_data, dst_step, width, height, depth, scn, dcn, swap_blue) }.into_result()
}
// identifier: cv_hal_cvtBGRtoGray_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_scn_bool_swapBlue
pub fn cvt_bg_rto_gray(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, depth: i32, scn: i32, swap_blue: bool) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtBGRtoGray_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_scn_bool_swapBlue(src_data, src_step, dst_data, dst_step, width, height, depth, scn, swap_blue) }.into_result()
}
// identifier: cv_hal_cvtBGRtoHSV_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_scn_bool_swapBlue_bool_isFullRange_bool_isHSV
pub fn cvt_bg_rto_hsv(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, depth: i32, scn: i32, swap_blue: bool, is_full_range: bool, is_hsv: bool) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtBGRtoHSV_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_scn_bool_swapBlue_bool_isFullRange_bool_isHSV(src_data, src_step, dst_data, dst_step, width, height, depth, scn, swap_blue, is_full_range, is_hsv) }.into_result()
}
// identifier: cv_hal_cvtBGRtoLab_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_scn_bool_swapBlue_bool_isLab_bool_srgb
pub fn cvt_bg_rto_lab(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, depth: i32, scn: i32, swap_blue: bool, is_lab: bool, srgb: bool) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtBGRtoLab_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_scn_bool_swapBlue_bool_isLab_bool_srgb(src_data, src_step, dst_data, dst_step, width, height, depth, scn, swap_blue, is_lab, srgb) }.into_result()
}
// identifier: cv_hal_cvtBGRtoThreePlaneYUV_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_scn_bool_swapBlue_int_uIdx
pub fn cvt_bg_rto_three_plane_yuv(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, scn: i32, swap_blue: bool, u_idx: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtBGRtoThreePlaneYUV_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_scn_bool_swapBlue_int_uIdx(src_data, src_step, dst_data, dst_step, width, height, scn, swap_blue, u_idx) }.into_result()
}
// identifier: cv_hal_cvtBGRtoTwoPlaneYUV_const_uchar_X_src_data_size_t_src_step_uchar_X_y_data_uchar_X_uv_data_size_t_dst_step_int_width_int_height_int_scn_bool_swapBlue_int_uIdx
pub fn cvt_bg_rto_two_plane_yuv(src_data: &u8, src_step: size_t, y_data: &mut u8, uv_data: &mut u8, dst_step: size_t, width: i32, height: i32, scn: i32, swap_blue: bool, u_idx: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtBGRtoTwoPlaneYUV_const_uchar_X_src_data_size_t_src_step_uchar_X_y_data_uchar_X_uv_data_size_t_dst_step_int_width_int_height_int_scn_bool_swapBlue_int_uIdx(src_data, src_step, y_data, uv_data, dst_step, width, height, scn, swap_blue, u_idx) }.into_result()
}
// identifier: cv_hal_cvtBGRtoXYZ_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_scn_bool_swapBlue
pub fn cvt_bg_rto_xyz(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, depth: i32, scn: i32, swap_blue: bool) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtBGRtoXYZ_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_scn_bool_swapBlue(src_data, src_step, dst_data, dst_step, width, height, depth, scn, swap_blue) }.into_result()
}
// identifier: cv_hal_cvtBGRtoYUV_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_scn_bool_swapBlue_bool_isCbCr
pub fn cvt_bg_rto_yuv(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, depth: i32, scn: i32, swap_blue: bool, is_cb_cr: bool) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtBGRtoYUV_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_scn_bool_swapBlue_bool_isCbCr(src_data, src_step, dst_data, dst_step, width, height, depth, scn, swap_blue, is_cb_cr) }.into_result()
}
// identifier: cv_hal_cvtGraytoBGR5x5_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_greenBits
pub fn cvt_grayto_bgr5x5(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, green_bits: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtGraytoBGR5x5_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_greenBits(src_data, src_step, dst_data, dst_step, width, height, green_bits) }.into_result()
}
// identifier: cv_hal_cvtGraytoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_dcn
pub fn cvt_grayto_bgr(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, depth: i32, dcn: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtGraytoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_dcn(src_data, src_step, dst_data, dst_step, width, height, depth, dcn) }.into_result()
}
// identifier: cv_hal_cvtHSVtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_dcn_bool_swapBlue_bool_isFullRange_bool_isHSV
pub fn cvt_hs_vto_bgr(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, depth: i32, dcn: i32, swap_blue: bool, is_full_range: bool, is_hsv: bool) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtHSVtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_dcn_bool_swapBlue_bool_isFullRange_bool_isHSV(src_data, src_step, dst_data, dst_step, width, height, depth, dcn, swap_blue, is_full_range, is_hsv) }.into_result()
}
// identifier: cv_hal_cvtLabtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_dcn_bool_swapBlue_bool_isLab_bool_srgb
pub fn cvt_labto_bgr(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, depth: i32, dcn: i32, swap_blue: bool, is_lab: bool, srgb: bool) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtLabtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_dcn_bool_swapBlue_bool_isLab_bool_srgb(src_data, src_step, dst_data, dst_step, width, height, depth, dcn, swap_blue, is_lab, srgb) }.into_result()
}
// identifier: cv_hal_cvtMultipliedRGBAtoRGBA_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height
pub fn cvt_multiplied_rgb_ato_rgba(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtMultipliedRGBAtoRGBA_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height(src_data, src_step, dst_data, dst_step, width, height) }.into_result()
}
// identifier: cv_hal_cvtOnePlaneYUVtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_dcn_bool_swapBlue_int_uIdx_int_ycn
pub fn cvt_one_plane_yu_vto_bgr(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, dcn: i32, swap_blue: bool, u_idx: i32, ycn: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtOnePlaneYUVtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_dcn_bool_swapBlue_int_uIdx_int_ycn(src_data, src_step, dst_data, dst_step, width, height, dcn, swap_blue, u_idx, ycn) }.into_result()
}
// identifier: cv_hal_cvtRGBAtoMultipliedRGBA_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height
pub fn cvt_rgb_ato_multiplied_rgba(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtRGBAtoMultipliedRGBA_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height(src_data, src_step, dst_data, dst_step, width, height) }.into_result()
}
// identifier: cv_hal_cvtThreePlaneYUVtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_dst_width_int_dst_height_int_dcn_bool_swapBlue_int_uIdx
pub fn cvt_three_plane_yu_vto_bgr(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, dst_width: i32, dst_height: i32, dcn: i32, swap_blue: bool, u_idx: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtThreePlaneYUVtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_dst_width_int_dst_height_int_dcn_bool_swapBlue_int_uIdx(src_data, src_step, dst_data, dst_step, dst_width, dst_height, dcn, swap_blue, u_idx) }.into_result()
}
// identifier: cv_hal_cvtTwoPlaneYUVtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_dst_width_int_dst_height_int_dcn_bool_swapBlue_int_uIdx
pub fn cvt_two_plane_yu_vto_bgr(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, dst_width: i32, dst_height: i32, dcn: i32, swap_blue: bool, u_idx: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtTwoPlaneYUVtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_dst_width_int_dst_height_int_dcn_bool_swapBlue_int_uIdx(src_data, src_step, dst_data, dst_step, dst_width, dst_height, dcn, swap_blue, u_idx) }.into_result()
}
// identifier: cv_hal_cvtTwoPlaneYUVtoBGR_const_uchar_X_y_data_const_uchar_X_uv_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_dst_width_int_dst_height_int_dcn_bool_swapBlue_int_uIdx
pub fn cvt_two_plane_yu_vto_bgr_1(y_data: &u8, uv_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, dst_width: i32, dst_height: i32, dcn: i32, swap_blue: bool, u_idx: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtTwoPlaneYUVtoBGR_const_uchar_X_y_data_const_uchar_X_uv_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_dst_width_int_dst_height_int_dcn_bool_swapBlue_int_uIdx(y_data, uv_data, src_step, dst_data, dst_step, dst_width, dst_height, dcn, swap_blue, u_idx) }.into_result()
}
// identifier: cv_hal_cvtXYZtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_dcn_bool_swapBlue
pub fn cvt_xy_zto_bgr(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, depth: i32, dcn: i32, swap_blue: bool) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtXYZtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_dcn_bool_swapBlue(src_data, src_step, dst_data, dst_step, width, height, depth, dcn, swap_blue) }.into_result()
}
// identifier: cv_hal_cvtYUVtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_dcn_bool_swapBlue_bool_isCbCr
pub fn cvt_yu_vto_bgr(src_data: &u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, depth: i32, dcn: i32, swap_blue: bool, is_cb_cr: bool) -> Result<()> {
unsafe { sys::cv_core_cv_hal_cvtYUVtoBGR_const_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_depth_int_dcn_bool_swapBlue_bool_isCbCr(src_data, src_step, dst_data, dst_step, width, height, depth, dcn, swap_blue, is_cb_cr) }.into_result()
}
// identifier: cv_hal_div16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn div16s(src1: &i16, step1: size_t, src2: &i16, step2: size_t, dst: &mut i16, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_div16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_scale(src1, step1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_div16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn div16u(src1: &u16, step1: size_t, src2: &u16, step2: size_t, dst: &mut u16, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_div16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_scale(src1, step1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_div32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn div32f(src1: &f32, step1: size_t, src2: &f32, step2: size_t, dst: &mut f32, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_div32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_scale(src1, step1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_div32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn div32s(src1: &i32, step1: size_t, src2: &i32, step2: size_t, dst: &mut i32, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_div32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_scale(src1, step1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_div64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn div64f(src1: &f64, step1: size_t, src2: &f64, step2: size_t, dst: &mut f64, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_div64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_scale(src1, step1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_div8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn div8s(src1: &i8, step1: size_t, src2: &i8, step2: size_t, dst: &mut i8, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_div8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_scale(src1, step1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_div8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn div8u(src1: &u8, step1: size_t, src2: &u8, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_div8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_scale(src1, step1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_exp32f_const_float_X_src_float_X_dst_int_n
pub fn exp32f(src: &f32, dst: &mut f32, n: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_exp32f_const_float_X_src_float_X_dst_int_n(src, dst, n) }.into_result()
}
// identifier: cv_hal_exp64f_const_double_X_src_double_X_dst_int_n
pub fn exp64f(src: &f64, dst: &mut f64, n: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_exp64f_const_double_X_src_double_X_dst_int_n(src, dst, n) }.into_result()
}
// identifier: cv_hal_exp_const_double_X_src_double_X_dst_int_n
pub fn exp_3(src: &f64, dst: &mut f64, n: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_exp_const_double_X_src_double_X_dst_int_n(src, dst, n) }.into_result()
}
// identifier: cv_hal_exp_const_float_X_src_float_X_dst_int_n
pub fn exp_4(src: &f32, dst: &mut f32, n: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_exp_const_float_X_src_float_X_dst_int_n(src, dst, n) }.into_result()
}
// identifier: cv_hal_fastAtan2_const_float_X_y_const_float_X_x_float_X_dst_int_n_bool_angleInDegrees
pub fn fast_atan3(y: &f32, x: &f32, dst: &mut f32, n: i32, angle_in_degrees: bool) -> Result<()> {
unsafe { sys::cv_core_cv_hal_fastAtan2_const_float_X_y_const_float_X_x_float_X_dst_int_n_bool_angleInDegrees(y, x, dst, n, angle_in_degrees) }.into_result()
}
// identifier: cv_hal_fastAtan32f_const_float_X_y_const_float_X_x_float_X_dst_int_n_bool_angleInDegrees
pub fn fast_atan32f(y: &f32, x: &f32, dst: &mut f32, n: i32, angle_in_degrees: bool) -> Result<()> {
unsafe { sys::cv_core_cv_hal_fastAtan32f_const_float_X_y_const_float_X_x_float_X_dst_int_n_bool_angleInDegrees(y, x, dst, n, angle_in_degrees) }.into_result()
}
// identifier: cv_hal_fastAtan64f_const_double_X_y_const_double_X_x_double_X_dst_int_n_bool_angleInDegrees
pub fn fast_atan64f(y: &f64, x: &f64, dst: &mut f64, n: i32, angle_in_degrees: bool) -> Result<()> {
unsafe { sys::cv_core_cv_hal_fastAtan64f_const_double_X_y_const_double_X_x_double_X_dst_int_n_bool_angleInDegrees(y, x, dst, n, angle_in_degrees) }.into_result()
}
// identifier: cv_hal_filter2D_int_stype_int_dtype_int_kernel_type_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_full_width_int_full_height_int_offset_x_int_offset_y_uchar_X_kernel_data_size_t_kernel_step_int_kernel_width_int_kernel_height_int_anchor_x_int_anchor_y_double_delta_int_borderType_bool_isSubmatrix
pub fn filter2_d_1(stype: i32, dtype: i32, kernel_type: i32, src_data: &mut u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, full_width: i32, full_height: i32, offset_x: i32, offset_y: i32, kernel_data: &mut u8, kernel_step: size_t, kernel_width: i32, kernel_height: i32, anchor_x: i32, anchor_y: i32, delta: f64, border_type: i32, is_submatrix: bool) -> Result<()> {
unsafe { sys::cv_core_cv_hal_filter2D_int_stype_int_dtype_int_kernel_type_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_full_width_int_full_height_int_offset_x_int_offset_y_uchar_X_kernel_data_size_t_kernel_step_int_kernel_width_int_kernel_height_int_anchor_x_int_anchor_y_double_delta_int_borderType_bool_isSubmatrix(stype, dtype, kernel_type, src_data, src_step, dst_data, dst_step, width, height, full_width, full_height, offset_x, offset_y, kernel_data, kernel_step, kernel_width, kernel_height, anchor_x, anchor_y, delta, border_type, is_submatrix) }.into_result()
}
// identifier: cv_hal_gemm32f_const_float_X_src1_size_t_src1_step_const_float_X_src2_size_t_src2_step_float_alpha_const_float_X_src3_size_t_src3_step_float_beta_float_X_dst_size_t_dst_step_int_m_a_int_n_a_int_n_d_int_flags
pub fn gemm32f(src1: &f32, src1_step: size_t, src2: &f32, src2_step: size_t, alpha: f32, src3: &f32, src3_step: size_t, beta: f32, dst: &mut f32, dst_step: size_t, m_a: i32, n_a: i32, n_d: i32, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_gemm32f_const_float_X_src1_size_t_src1_step_const_float_X_src2_size_t_src2_step_float_alpha_const_float_X_src3_size_t_src3_step_float_beta_float_X_dst_size_t_dst_step_int_m_a_int_n_a_int_n_d_int_flags(src1, src1_step, src2, src2_step, alpha, src3, src3_step, beta, dst, dst_step, m_a, n_a, n_d, flags) }.into_result()
}
// identifier: cv_hal_gemm32fc_const_float_X_src1_size_t_src1_step_const_float_X_src2_size_t_src2_step_float_alpha_const_float_X_src3_size_t_src3_step_float_beta_float_X_dst_size_t_dst_step_int_m_a_int_n_a_int_n_d_int_flags
pub fn gemm32fc(src1: &f32, src1_step: size_t, src2: &f32, src2_step: size_t, alpha: f32, src3: &f32, src3_step: size_t, beta: f32, dst: &mut f32, dst_step: size_t, m_a: i32, n_a: i32, n_d: i32, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_gemm32fc_const_float_X_src1_size_t_src1_step_const_float_X_src2_size_t_src2_step_float_alpha_const_float_X_src3_size_t_src3_step_float_beta_float_X_dst_size_t_dst_step_int_m_a_int_n_a_int_n_d_int_flags(src1, src1_step, src2, src2_step, alpha, src3, src3_step, beta, dst, dst_step, m_a, n_a, n_d, flags) }.into_result()
}
// identifier: cv_hal_gemm64f_const_double_X_src1_size_t_src1_step_const_double_X_src2_size_t_src2_step_double_alpha_const_double_X_src3_size_t_src3_step_double_beta_double_X_dst_size_t_dst_step_int_m_a_int_n_a_int_n_d_int_flags
pub fn gemm64f(src1: &f64, src1_step: size_t, src2: &f64, src2_step: size_t, alpha: f64, src3: &f64, src3_step: size_t, beta: f64, dst: &mut f64, dst_step: size_t, m_a: i32, n_a: i32, n_d: i32, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_gemm64f_const_double_X_src1_size_t_src1_step_const_double_X_src2_size_t_src2_step_double_alpha_const_double_X_src3_size_t_src3_step_double_beta_double_X_dst_size_t_dst_step_int_m_a_int_n_a_int_n_d_int_flags(src1, src1_step, src2, src2_step, alpha, src3, src3_step, beta, dst, dst_step, m_a, n_a, n_d, flags) }.into_result()
}
// identifier: cv_hal_gemm64fc_const_double_X_src1_size_t_src1_step_const_double_X_src2_size_t_src2_step_double_alpha_const_double_X_src3_size_t_src3_step_double_beta_double_X_dst_size_t_dst_step_int_m_a_int_n_a_int_n_d_int_flags
pub fn gemm64fc(src1: &f64, src1_step: size_t, src2: &f64, src2_step: size_t, alpha: f64, src3: &f64, src3_step: size_t, beta: f64, dst: &mut f64, dst_step: size_t, m_a: i32, n_a: i32, n_d: i32, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_gemm64fc_const_double_X_src1_size_t_src1_step_const_double_X_src2_size_t_src2_step_double_alpha_const_double_X_src3_size_t_src3_step_double_beta_double_X_dst_size_t_dst_step_int_m_a_int_n_a_int_n_d_int_flags(src1, src1_step, src2, src2_step, alpha, src3, src3_step, beta, dst, dst_step, m_a, n_a, n_d, flags) }.into_result()
}
// identifier: cv_hal_integral_int_depth_int_sdepth_int_sqdepth_const_uchar_X_src_size_t_srcstep_uchar_X_sum_size_t_sumstep_uchar_X_sqsum_size_t_sqsumstep_uchar_X_tilted_size_t_tstep_int_width_int_height_int_cn
pub fn integral(depth: i32, sdepth: i32, sqdepth: i32, src: &u8, srcstep: size_t, sum: &mut u8, sumstep: size_t, sqsum: &mut u8, sqsumstep: size_t, tilted: &mut u8, tstep: size_t, width: i32, height: i32, cn: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_integral_int_depth_int_sdepth_int_sqdepth_const_uchar_X_src_size_t_srcstep_uchar_X_sum_size_t_sumstep_uchar_X_sqsum_size_t_sqsumstep_uchar_X_tilted_size_t_tstep_int_width_int_height_int_cn(depth, sdepth, sqdepth, src, srcstep, sum, sumstep, sqsum, sqsumstep, tilted, tstep, width, height, cn) }.into_result()
}
// identifier: cv_hal_invSqrt32f_const_float_X_src_float_X_dst_int_len
pub fn inv_sqrt32f(src: &f32, dst: &mut f32, len: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_invSqrt32f_const_float_X_src_float_X_dst_int_len(src, dst, len) }.into_result()
}
// identifier: cv_hal_invSqrt64f_const_double_X_src_double_X_dst_int_len
pub fn inv_sqrt64f(src: &f64, dst: &mut f64, len: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_invSqrt64f_const_double_X_src_double_X_dst_int_len(src, dst, len) }.into_result()
}
// identifier: cv_hal_invSqrt_const_double_X_src_double_X_dst_int_len
pub fn inv_sqrt(src: &f64, dst: &mut f64, len: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_invSqrt_const_double_X_src_double_X_dst_int_len(src, dst, len) }.into_result()
}
// identifier: cv_hal_invSqrt_const_float_X_src_float_X_dst_int_len
pub fn inv_sqrt_1(src: &f32, dst: &mut f32, len: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_invSqrt_const_float_X_src_float_X_dst_int_len(src, dst, len) }.into_result()
}
// identifier: cv_hal_log32f_const_float_X_src_float_X_dst_int_n
pub fn log32f(src: &f32, dst: &mut f32, n: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_log32f_const_float_X_src_float_X_dst_int_n(src, dst, n) }.into_result()
}
// identifier: cv_hal_log64f_const_double_X_src_double_X_dst_int_n
pub fn log64f(src: &f64, dst: &mut f64, n: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_log64f_const_double_X_src_double_X_dst_int_n(src, dst, n) }.into_result()
}
// identifier: cv_hal_log_const_double_X_src_double_X_dst_int_n
pub fn log(src: &f64, dst: &mut f64, n: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_log_const_double_X_src_double_X_dst_int_n(src, dst, n) }.into_result()
}
// identifier: cv_hal_log_const_float_X_src_float_X_dst_int_n
pub fn log_1(src: &f32, dst: &mut f32, n: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_log_const_float_X_src_float_X_dst_int_n(src, dst, n) }.into_result()
}
// identifier: cv_hal_magnitude32f_const_float_X_x_const_float_X_y_float_X_dst_int_n
pub fn magnitude32f(x: &f32, y: &f32, dst: &mut f32, n: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_magnitude32f_const_float_X_x_const_float_X_y_float_X_dst_int_n(x, y, dst, n) }.into_result()
}
// identifier: cv_hal_magnitude64f_const_double_X_x_const_double_X_y_double_X_dst_int_n
pub fn magnitude64f(x: &f64, y: &f64, dst: &mut f64, n: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_magnitude64f_const_double_X_x_const_double_X_y_double_X_dst_int_n(x, y, dst, n) }.into_result()
}
// identifier: cv_hal_magnitude_const_double_X_x_const_double_X_y_double_X_dst_int_n
pub fn magnitude(x: &f64, y: &f64, dst: &mut f64, n: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_magnitude_const_double_X_x_const_double_X_y_double_X_dst_int_n(x, y, dst, n) }.into_result()
}
// identifier: cv_hal_magnitude_const_float_X_x_const_float_X_y_float_X_dst_int_n
pub fn magnitude_1(x: &f32, y: &f32, dst: &mut f32, n: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_magnitude_const_float_X_x_const_float_X_y_float_X_dst_int_n(x, y, dst, n) }.into_result()
}
// identifier: cv_hal_max16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn max16s(src1: &i16, step1: size_t, src2: &i16, step2: size_t, dst: &mut i16, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_max16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_max16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn max16u(src1: &u16, step1: size_t, src2: &u16, step2: size_t, dst: &mut u16, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_max16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_max32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn max32f(src1: &f32, step1: size_t, src2: &f32, step2: size_t, dst: &mut f32, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_max32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_max32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn max32s(src1: &i32, step1: size_t, src2: &i32, step2: size_t, dst: &mut i32, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_max32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_max64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn max64f(src1: &f64, step1: size_t, src2: &f64, step2: size_t, dst: &mut f64, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_max64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_max8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn max8s(src1: &i8, step1: size_t, src2: &i8, step2: size_t, dst: &mut i8, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_max8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_max8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn max8u(src1: &u8, step1: size_t, src2: &u8, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_max8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_min16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn min16s(src1: &i16, step1: size_t, src2: &i16, step2: size_t, dst: &mut i16, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_min16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_min16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn min16u(src1: &u16, step1: size_t, src2: &u16, step2: size_t, dst: &mut u16, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_min16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_min32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn min32f(src1: &f32, step1: size_t, src2: &f32, step2: size_t, dst: &mut f32, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_min32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_min32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn min32s(src1: &i32, step1: size_t, src2: &i32, step2: size_t, dst: &mut i32, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_min32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_min64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn min64f(src1: &f64, step1: size_t, src2: &f64, step2: size_t, dst: &mut f64, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_min64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_min8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn min8s(src1: &i8, step1: size_t, src2: &i8, step2: size_t, dst: &mut i8, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_min8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_min8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn min8u(src1: &u8, step1: size_t, src2: &u8, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_min8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_mul16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn mul16s(src1: &i16, step1: size_t, src2: &i16, step2: size_t, dst: &mut i16, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_mul16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_scale(src1, step1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_mul16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn mul16u(src1: &u16, step1: size_t, src2: &u16, step2: size_t, dst: &mut u16, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_mul16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_scale(src1, step1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_mul32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn mul32f(src1: &f32, step1: size_t, src2: &f32, step2: size_t, dst: &mut f32, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_mul32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_scale(src1, step1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_mul32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn mul32s(src1: &i32, step1: size_t, src2: &i32, step2: size_t, dst: &mut i32, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_mul32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_scale(src1, step1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_mul64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn mul64f(src1: &f64, step1: size_t, src2: &f64, step2: size_t, dst: &mut f64, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_mul64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_scale(src1, step1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_mul8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn mul8s(src1: &i8, step1: size_t, src2: &i8, step2: size_t, dst: &mut i8, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_mul8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_scale(src1, step1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_mul8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn mul8u(src1: &u8, step1: size_t, src2: &u8, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_mul8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_scale(src1, step1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_normHamming_const_uchar_X_a_const_uchar_X_b_int_n
pub fn norm_hamming(a: &u8, b: &u8, n: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_hal_normHamming_const_uchar_X_a_const_uchar_X_b_int_n(a, b, n) }.into_result()
}
// identifier: cv_hal_normHamming_const_uchar_X_a_const_uchar_X_b_int_n_int_cellSize
pub fn norm_hamming_1(a: &u8, b: &u8, n: i32, cell_size: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_hal_normHamming_const_uchar_X_a_const_uchar_X_b_int_n_int_cellSize(a, b, n, cell_size) }.into_result()
}
// identifier: cv_hal_normHamming_const_uchar_X_a_int_n
pub fn norm_hamming_2(a: &u8, n: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_hal_normHamming_const_uchar_X_a_int_n(a, n) }.into_result()
}
// identifier: cv_hal_normHamming_const_uchar_X_a_int_n_int_cellSize
pub fn norm_hamming_3(a: &u8, n: i32, cell_size: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_hal_normHamming_const_uchar_X_a_int_n_int_cellSize(a, n, cell_size) }.into_result()
}
// identifier: cv_hal_normL1__const_float_X_a_const_float_X_b_int_n
pub fn norm_l1_(a: &f32, b: &f32, n: i32) -> Result<f32> {
unsafe { sys::cv_core_cv_hal_normL1__const_float_X_a_const_float_X_b_int_n(a, b, n) }.into_result()
}
// identifier: cv_hal_normL1__const_uchar_X_a_const_uchar_X_b_int_n
pub fn norm_l1__1(a: &u8, b: &u8, n: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_hal_normL1__const_uchar_X_a_const_uchar_X_b_int_n(a, b, n) }.into_result()
}
// identifier: cv_hal_normL2Sqr__const_float_X_a_const_float_X_b_int_n
pub fn norm_l2_sqr_(a: &f32, b: &f32, n: i32) -> Result<f32> {
unsafe { sys::cv_core_cv_hal_normL2Sqr__const_float_X_a_const_float_X_b_int_n(a, b, n) }.into_result()
}
// identifier: cv_hal_not8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn not8u(src1: &u8, step1: size_t, src2: &u8, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_not8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_or8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn or8u(src1: &u8, step1: size_t, src2: &u8, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_or8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_recip16s_const_short_X_unnamed_arg_size_t_unnamed_arg_1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn recip16s(unnamed_arg: &i16, unnamed_arg_1: size_t, src2: &i16, step2: size_t, dst: &mut i16, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_recip16s_const_short_X_unnamed_arg_size_t_unnamed_arg_1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_scale(unnamed_arg, unnamed_arg_1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_recip16u_const_ushort_X_unnamed_arg_size_t_unnamed_arg_1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn recip16u(unnamed_arg: &u16, unnamed_arg_1: size_t, src2: &u16, step2: size_t, dst: &mut u16, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_recip16u_const_ushort_X_unnamed_arg_size_t_unnamed_arg_1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_scale(unnamed_arg, unnamed_arg_1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_recip32f_const_float_X_unnamed_arg_size_t_unnamed_arg_1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn recip32f(unnamed_arg: &f32, unnamed_arg_1: size_t, src2: &f32, step2: size_t, dst: &mut f32, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_recip32f_const_float_X_unnamed_arg_size_t_unnamed_arg_1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_scale(unnamed_arg, unnamed_arg_1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_recip32s_const_int_X_unnamed_arg_size_t_unnamed_arg_1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn recip32s(unnamed_arg: &i32, unnamed_arg_1: size_t, src2: &i32, step2: size_t, dst: &mut i32, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_recip32s_const_int_X_unnamed_arg_size_t_unnamed_arg_1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_scale(unnamed_arg, unnamed_arg_1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_recip64f_const_double_X_unnamed_arg_size_t_unnamed_arg_1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn recip64f(unnamed_arg: &f64, unnamed_arg_1: size_t, src2: &f64, step2: size_t, dst: &mut f64, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_recip64f_const_double_X_unnamed_arg_size_t_unnamed_arg_1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_scale(unnamed_arg, unnamed_arg_1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_recip8s_const_schar_X_unnamed_arg_size_t_unnamed_arg_1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn recip8s(unnamed_arg: &i8, unnamed_arg_1: size_t, src2: &i8, step2: size_t, dst: &mut i8, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_recip8s_const_schar_X_unnamed_arg_size_t_unnamed_arg_1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_scale(unnamed_arg, unnamed_arg_1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_recip8u_const_uchar_X_unnamed_arg_size_t_unnamed_arg_1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_scale
pub fn recip8u(unnamed_arg: &u8, unnamed_arg_1: size_t, src2: &u8, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, scale: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_recip8u_const_uchar_X_unnamed_arg_size_t_unnamed_arg_1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_scale(unnamed_arg, unnamed_arg_1, src2, step2, dst, step, width, height, scale) }.into_result()
}
// identifier: cv_hal_resize_int_src_type_const_uchar_X_src_data_size_t_src_step_int_src_width_int_src_height_uchar_X_dst_data_size_t_dst_step_int_dst_width_int_dst_height_double_inv_scale_x_double_inv_scale_y_int_interpolation
pub fn hal_resize(src_type: i32, src_data: &u8, src_step: size_t, src_width: i32, src_height: i32, dst_data: &mut u8, dst_step: size_t, dst_width: i32, dst_height: i32, inv_scale_x: f64, inv_scale_y: f64, interpolation: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_resize_int_src_type_const_uchar_X_src_data_size_t_src_step_int_src_width_int_src_height_uchar_X_dst_data_size_t_dst_step_int_dst_width_int_dst_height_double_inv_scale_x_double_inv_scale_y_int_interpolation(src_type, src_data, src_step, src_width, src_height, dst_data, dst_step, dst_width, dst_height, inv_scale_x, inv_scale_y, interpolation) }.into_result()
}
// identifier: cv_hal_sepFilter2D_int_stype_int_dtype_int_ktype_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_full_width_int_full_height_int_offset_x_int_offset_y_uchar_X_kernelx_data_int_kernelx_len_uchar_X_kernely_data_int_kernely_len_int_anchor_x_int_anchor_y_double_delta_int_borderType
pub fn sep_filter2_d(stype: i32, dtype: i32, ktype: i32, src_data: &mut u8, src_step: size_t, dst_data: &mut u8, dst_step: size_t, width: i32, height: i32, full_width: i32, full_height: i32, offset_x: i32, offset_y: i32, kernelx_data: &mut u8, kernelx_len: i32, kernely_data: &mut u8, kernely_len: i32, anchor_x: i32, anchor_y: i32, delta: f64, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_sepFilter2D_int_stype_int_dtype_int_ktype_uchar_X_src_data_size_t_src_step_uchar_X_dst_data_size_t_dst_step_int_width_int_height_int_full_width_int_full_height_int_offset_x_int_offset_y_uchar_X_kernelx_data_int_kernelx_len_uchar_X_kernely_data_int_kernely_len_int_anchor_x_int_anchor_y_double_delta_int_borderType(stype, dtype, ktype, src_data, src_step, dst_data, dst_step, width, height, full_width, full_height, offset_x, offset_y, kernelx_data, kernelx_len, kernely_data, kernely_len, anchor_x, anchor_y, delta, border_type) }.into_result()
}
// identifier: cv_hal_sqrt32f_const_float_X_src_float_X_dst_int_len
pub fn sqrt32f(src: &f32, dst: &mut f32, len: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_sqrt32f_const_float_X_src_float_X_dst_int_len(src, dst, len) }.into_result()
}
// identifier: cv_hal_sqrt64f_const_double_X_src_double_X_dst_int_len
pub fn sqrt64f(src: &f64, dst: &mut f64, len: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_sqrt64f_const_double_X_src_double_X_dst_int_len(src, dst, len) }.into_result()
}
// identifier: cv_hal_sqrt_const_double_X_src_double_X_dst_int_len
pub fn sqrt(src: &f64, dst: &mut f64, len: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_sqrt_const_double_X_src_double_X_dst_int_len(src, dst, len) }.into_result()
}
// identifier: cv_hal_sqrt_const_float_X_src_float_X_dst_int_len
pub fn sqrt_1(src: &f32, dst: &mut f32, len: i32) -> Result<()> {
unsafe { sys::cv_core_cv_hal_sqrt_const_float_X_src_float_X_dst_int_len(src, dst, len) }.into_result()
}
// identifier: cv_hal_sub16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn sub16s(src1: &i16, step1: size_t, src2: &i16, step2: size_t, dst: &mut i16, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_sub16s_const_short_X_src1_size_t_step1_const_short_X_src2_size_t_step2_short_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_sub16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn sub16u(src1: &u16, step1: size_t, src2: &u16, step2: size_t, dst: &mut u16, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_sub16u_const_ushort_X_src1_size_t_step1_const_ushort_X_src2_size_t_step2_ushort_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_sub32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn sub32f(src1: &f32, step1: size_t, src2: &f32, step2: size_t, dst: &mut f32, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_sub32f_const_float_X_src1_size_t_step1_const_float_X_src2_size_t_step2_float_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_sub32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn sub32s(src1: &i32, step1: size_t, src2: &i32, step2: size_t, dst: &mut i32, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_sub32s_const_int_X_src1_size_t_step1_const_int_X_src2_size_t_step2_int_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_sub64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn sub64f(src1: &f64, step1: size_t, src2: &f64, step2: size_t, dst: &mut f64, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_sub64f_const_double_X_src1_size_t_step1_const_double_X_src2_size_t_step2_double_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_sub8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn sub8s(src1: &i8, step1: size_t, src2: &i8, step2: size_t, dst: &mut i8, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_sub8s_const_schar_X_src1_size_t_step1_const_schar_X_src2_size_t_step2_schar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_sub8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn sub8u(src1: &u8, step1: size_t, src2: &u8, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_sub8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_hal_xor8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg
pub fn xor8u(src1: &u8, step1: size_t, src2: &u8, step2: size_t, dst: &mut u8, step: size_t, width: i32, height: i32, unnamed_arg: &mut c_void) -> Result<()> {
unsafe { sys::cv_core_cv_hal_xor8u_const_uchar_X_src1_size_t_step1_const_uchar_X_src2_size_t_step2_uchar_X_dst_size_t_step_int_width_int_height_void_X_unnamed_arg(src1, step1, src2, step2, dst, step, width, height, unnamed_arg) }.into_result()
}
// identifier: cv_haveOpenVX
pub fn have_open_vx() -> Result<bool> {
unsafe { sys::cv_core_cv_haveOpenVX() }.into_result()
}
// identifier: cv_hconcat_Mat_src1_Mat_src2_Mat_dst
/// @overload
/// ```ignore{.cpp}
/// cv::Mat_<float> A = (cv::Mat_<float>(3, 2) << 1, 4,
/// 2, 5,
/// 3, 6);
/// cv::Mat_<float> B = (cv::Mat_<float>(3, 2) << 7, 10,
/// 8, 11,
/// 9, 12);
///
/// cv::Mat C;
/// cv::hconcat(A, B, C);
/// //C:
/// //[1, 4, 7, 10;
/// // 2, 5, 8, 11;
/// // 3, 6, 9, 12]
/// ```
///
/// ## Parameters
/// * src1: first input array to be considered for horizontal concatenation.
/// * src2: second input array to be considered for horizontal concatenation.
/// * dst: output array. It has the same number of rows and depth as the src1 and src2, and the sum of cols of the src1 and src2.
pub fn hconcat(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_hconcat_Mat_src1_Mat_src2_Mat_dst(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_hconcat_VectorOfMat_src_Mat_dst
/// @overload
/// ```ignore{.cpp}
/// std::vector<cv::Mat> matrices = { cv::Mat(4, 1, CV_8UC1, cv::Scalar(1)),
/// cv::Mat(4, 1, CV_8UC1, cv::Scalar(2)),
/// cv::Mat(4, 1, CV_8UC1, cv::Scalar(3)),};
///
/// cv::Mat out;
/// cv::hconcat( matrices, out );
/// //out:
/// //[1, 2, 3;
/// // 1, 2, 3;
/// // 1, 2, 3;
/// // 1, 2, 3]
/// ```
///
/// ## Parameters
/// * src: input array or vector of matrices. all of the matrices must have the same number of rows and the same depth.
/// * dst: output array. It has the same number of rows and depth as the src, and the sum of cols of the src.
/// same depth.
pub fn hconcat_1(src: &types::VectorOfMat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_hconcat_VectorOfMat_src_Mat_dst(src.as_raw_VectorOfMat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_hconcat_const_Mat_src_size_t_nsrc_Mat_dst
/// Applies horizontal concatenation to given matrices.
///
/// The function horizontally concatenates two or more cv::Mat matrices (with the same number of rows).
/// ```ignore{.cpp}
/// cv::Mat matArray[] = { cv::Mat(4, 1, CV_8UC1, cv::Scalar(1)),
/// cv::Mat(4, 1, CV_8UC1, cv::Scalar(2)),
/// cv::Mat(4, 1, CV_8UC1, cv::Scalar(3)),};
///
/// cv::Mat out;
/// cv::hconcat( matArray, 3, out );
/// //out:
/// //[1, 2, 3;
/// // 1, 2, 3;
/// // 1, 2, 3;
/// // 1, 2, 3]
/// ```
///
/// ## Parameters
/// * src: input array or vector of matrices. all of the matrices must have the same number of rows and the same depth.
/// * nsrc: number of matrices in src.
/// * dst: output array. It has the same number of rows and depth as the src, and the sum of cols of the src.
/// @sa cv::vconcat(const Mat*, size_t, OutputArray), @sa cv::vconcat(InputArrayOfArrays, OutputArray) and @sa cv::vconcat(InputArray, InputArray, OutputArray)
pub fn hconcat_2(src: &core::Mat, nsrc: size_t, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_hconcat_const_Mat_src_size_t_nsrc_Mat_dst(src.as_raw_Mat(), nsrc, dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_idct_Mat_src_Mat_dst_int_flags
/// Calculates the inverse Discrete Cosine Transform of a 1D or 2D array.
///
/// idct(src, dst, flags) is equivalent to dct(src, dst, flags | DCT_INVERSE).
/// ## Parameters
/// * src: input floating-point single-channel array.
/// * dst: output array of the same size and type as src.
/// * flags: operation flags.
/// @sa dct, dft, idft, getOptimalDFTSize
///
/// ## C++ default parameters:
/// * flags: 0
pub fn idct(src: &core::Mat, dst: &mut core::Mat, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_idct_Mat_src_Mat_dst_int_flags(src.as_raw_Mat(), dst.as_raw_Mat(), flags) }.into_result()
}
// identifier: cv_idft_Mat_src_Mat_dst_int_flags_int_nonzeroRows
/// Calculates the inverse Discrete Fourier Transform of a 1D or 2D array.
///
/// idft(src, dst, flags) is equivalent to dft(src, dst, flags | #DFT_INVERSE) .
///
/// Note: None of dft and idft scales the result by default. So, you should pass #DFT_SCALE to one of
/// dft or idft explicitly to make these transforms mutually inverse.
/// @sa dft, dct, idct, mulSpectrums, getOptimalDFTSize
/// ## Parameters
/// * src: input floating-point real or complex array.
/// * dst: output array whose size and type depend on the flags.
/// * flags: operation flags (see dft and #DftFlags).
/// * nonzeroRows: number of dst rows to process; the rest of the rows have undefined content (see
/// the convolution sample in dft description.
///
/// ## C++ default parameters:
/// * flags: 0
/// * nonzero_rows: 0
pub fn idft(src: &core::Mat, dst: &mut core::Mat, flags: i32, nonzero_rows: i32) -> Result<()> {
unsafe { sys::cv_core_cv_idft_Mat_src_Mat_dst_int_flags_int_nonzeroRows(src.as_raw_Mat(), dst.as_raw_Mat(), flags, nonzero_rows) }.into_result()
}
// identifier: cv_illuminationChange_Mat_src_Mat_mask_Mat_dst_float_alpha_float_beta
/// Applying an appropriate non-linear transformation to the gradient field inside the selection and
/// then integrating back with a Poisson solver, modifies locally the apparent illumination of an image.
///
/// ## Parameters
/// * src: Input 8-bit 3-channel image.
/// * mask: Input 8-bit 1 or 3-channel image.
/// * dst: Output image with the same size and type as src.
/// * alpha: Value ranges between 0-2.
/// * beta: Value ranges between 0-2.
///
/// This is useful to highlight under-exposed foreground objects or to reduce specular reflections.
///
/// ## C++ default parameters:
/// * alpha: 0.2f
/// * beta: 0.4f
pub fn illumination_change(src: &core::Mat, mask: &core::Mat, dst: &mut core::Mat, alpha: f32, beta: f32) -> Result<()> {
unsafe { sys::cv_core_cv_illuminationChange_Mat_src_Mat_mask_Mat_dst_float_alpha_float_beta(src.as_raw_Mat(), mask.as_raw_Mat(), dst.as_raw_Mat(), alpha, beta) }.into_result()
}
// identifier: cv_imdecode_Mat_buf_int_flags
/// Reads an image from a buffer in memory.
///
/// The function imdecode reads an image from the specified buffer in the memory. If the buffer is too short or
/// contains invalid data, the function returns an empty matrix ( Mat::data==NULL ).
///
/// See cv::imread for the list of supported formats and flags description.
///
///
/// Note: In the case of color images, the decoded images will have the channels stored in **B G R** order.
/// ## Parameters
/// * buf: Input array or vector of bytes.
/// * flags: The same flags as in cv::imread, see cv::ImreadModes.
pub fn decode(buf: &core::Mat, flags: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_imdecode_Mat_buf_int_flags(buf.as_raw_Mat(), flags) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_imdecode_Mat_buf_int_flags_Mat_dst
/// @overload
/// ## Parameters
/// * buf
/// @param: flags
/// * dst: The optional output placeholder for the decoded matrix. It can save the image
/// reallocations when the function is called repeatedly for images of the same size.
pub fn decode_to(buf: &core::Mat, flags: i32, dst: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_imdecode_Mat_buf_int_flags_Mat_dst(buf.as_raw_Mat(), flags, dst.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_imencode_String_ext_Mat_img_VectorOfuchar_buf_VectorOfint_params
/// Encodes an image into a memory buffer.
///
/// The function imencode compresses the image and stores it in the memory buffer that is resized to fit the
/// result. See cv::imwrite for the list of supported formats and flags description.
///
/// ## Parameters
/// * ext: File extension that defines the output format.
/// * img: Image to be written.
/// * buf: Output buffer resized to fit the compressed image.
/// * params: Format-specific parameters. See cv::imwrite and cv::ImwriteFlags.
///
/// ## C++ default parameters:
/// * params: std::vector<int>()
pub fn imencode(ext: &str, img: &core::Mat, buf: &types::VectorOfuchar, params: &types::VectorOfint) -> Result<bool> {
string_arg!(ext);
unsafe { sys::cv_core_cv_imencode_String_ext_Mat_img_VectorOfuchar_buf_VectorOfint_params(ext.as_ptr(), img.as_raw_Mat(), buf.as_raw_VectorOfuchar(), params.as_raw_VectorOfint()) }.into_result()
}
// identifier: cv_imread_String_filename_int_flags
/// Loads an image from a file.
///
/// @anchor imread
///
/// The function imread loads an image from the specified file and returns it. If the image cannot be
/// read (because of missing file, improper permissions, unsupported or invalid format), the function
/// returns an empty matrix ( Mat::data==NULL ).
///
/// Currently, the following file formats are supported:
///
/// * Windows bitmaps - \*.bmp, \*.dib (always supported)
/// * JPEG files - \*.jpeg, \*.jpg, \*.jpe (see the *Note* section)
/// * JPEG 2000 files - \*.jp2 (see the *Note* section)
/// * Portable Network Graphics - \*.png (see the *Note* section)
/// * WebP - \*.webp (see the *Note* section)
/// * Portable image format - \*.pbm, \*.pgm, \*.ppm \*.pxm, \*.pnm (always supported)
/// * Sun rasters - \*.sr, \*.ras (always supported)
/// * TIFF files - \*.tiff, \*.tif (see the *Note* section)
/// * OpenEXR Image files - \*.exr (see the *Note* section)
/// * Radiance HDR - \*.hdr, \*.pic (always supported)
/// * Raster and Vector geospatial data supported by GDAL (see the *Note* section)
///
///
/// Note:
/// * The function determines the type of an image by the content, not by the file extension.
/// * In the case of color images, the decoded images will have the channels stored in **B G R** order.
/// * When using IMREAD_GRAYSCALE, the codec's internal grayscale conversion will be used, if available.
/// Results may differ to the output of cvtColor()
/// * On Microsoft Windows\* OS and MacOSX\*, the codecs shipped with an OpenCV image (libjpeg,
/// libpng, libtiff, and libjasper) are used by default. So, OpenCV can always read JPEGs, PNGs,
/// and TIFFs. On MacOSX, there is also an option to use native MacOSX image readers. But beware
/// that currently these native image loaders give images with different pixel values because of
/// the color management embedded into MacOSX.
/// * On Linux\*, BSD flavors and other Unix-like open-source operating systems, OpenCV looks for
/// codecs supplied with an OS image. Install the relevant packages (do not forget the development
/// files, for example, "libjpeg-dev", in Debian\* and Ubuntu\*) to get the codec support or turn
/// on the OPENCV_BUILD_3RDPARTY_LIBS flag in CMake.
/// * In the case you set *WITH_GDAL* flag to true in CMake and @ref IMREAD_LOAD_GDAL to load the image,
/// then the [GDAL](http://www.gdal.org) driver will be used in order to decode the image, supporting
/// the following formats: [Raster](http://www.gdal.org/formats_list.html),
/// [Vector](http://www.gdal.org/ogr_formats.html).
/// * If EXIF information are embedded in the image file, the EXIF orientation will be taken into account
/// and thus the image will be rotated accordingly except if the flag @ref IMREAD_IGNORE_ORIENTATION is passed.
/// * By default number of pixels must be less than 2^30. Limit can be set using system
/// variable OPENCV_IO_MAX_IMAGE_PIXELS
///
/// ## Parameters
/// * filename: Name of file to be loaded.
/// * flags: Flag that can take values of cv::ImreadModes
///
/// ## C++ default parameters:
/// * flags: IMREAD_COLOR
pub fn imread(filename: &str, flags: i32) -> Result<core::Mat> {
string_arg!(filename);
unsafe { sys::cv_core_cv_imread_String_filename_int_flags(filename.as_ptr(), flags) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_imreadmulti_String_filename_VectorOfMat_mats_int_flags
/// Loads a multi-page image from a file.
///
/// The function imreadmulti loads a multi-page image from the specified file into a vector of Mat objects.
/// ## Parameters
/// * filename: Name of file to be loaded.
/// * flags: Flag that can take values of cv::ImreadModes, default with cv::IMREAD_ANYCOLOR.
/// * mats: A vector of Mat objects holding each page, if more than one.
/// @sa cv::imread
///
/// ## C++ default parameters:
/// * flags: IMREAD_ANYCOLOR
pub fn imreadmulti(filename: &str, mats: &types::VectorOfMat, flags: i32) -> Result<bool> {
string_arg!(filename);
unsafe { sys::cv_core_cv_imreadmulti_String_filename_VectorOfMat_mats_int_flags(filename.as_ptr(), mats.as_raw_VectorOfMat(), flags) }.into_result()
}
// identifier: cv_imshow_String_winname_Mat_mat
/// Displays an image in the specified window.
///
/// The function imshow displays an image in the specified window. If the window was created with the
/// cv::WINDOW_AUTOSIZE flag, the image is shown with its original size, however it is still limited by the screen resolution.
/// Otherwise, the image is scaled to fit the window. The function may scale the image, depending on its depth:
///
/// * If the image is 8-bit unsigned, it is displayed as is.
/// * If the image is 16-bit unsigned or 32-bit integer, the pixels are divided by 256. That is, the
/// value range [0,255\*256] is mapped to [0,255].
/// * If the image is 32-bit or 64-bit floating-point, the pixel values are multiplied by 255. That is, the
/// value range [0,1] is mapped to [0,255].
///
/// If window was created with OpenGL support, cv::imshow also support ogl::Buffer , ogl::Texture2D and
/// cuda::GpuMat as input.
///
/// If the window was not created before this function, it is assumed creating a window with cv::WINDOW_AUTOSIZE.
///
/// If you need to show an image that is bigger than the screen resolution, you will need to call namedWindow("", WINDOW_NORMAL) before the imshow.
///
///
/// Note: This function should be followed by cv::waitKey function which displays the image for specified
/// milliseconds. Otherwise, it won't display the image. For example, **waitKey(0)** will display the window
/// infinitely until any keypress (it is suitable for image display). **waitKey(25)** will display a frame
/// for 25 ms, after which display will be automatically closed. (If you put it in a loop to read
/// videos, it will display the video frame-by-frame)
///
///
/// Note:
///
/// [__Windows Backend Only__] Pressing Ctrl+C will copy the image to the clipboard.
///
/// [__Windows Backend Only__] Pressing Ctrl+S will show a dialog to save the image.
///
/// ## Parameters
/// * winname: Name of the window.
/// * mat: Image to be shown.
pub fn imshow(winname: &str, mat: &core::Mat) -> Result<()> {
string_arg!(winname);
unsafe { sys::cv_core_cv_imshow_String_winname_Mat_mat(winname.as_ptr(), mat.as_raw_Mat()) }.into_result()
}
// identifier: cv_imwrite_String_filename_Mat_img_VectorOfint_params
/// Saves an image to a specified file.
///
/// The function imwrite saves the image to the specified file. The image format is chosen based on the
/// filename extension (see cv::imread for the list of extensions). In general, only 8-bit
/// single-channel or 3-channel (with 'BGR' channel order) images
/// can be saved using this function, with these exceptions:
///
/// - 16-bit unsigned (CV_16U) images can be saved in the case of PNG, JPEG 2000, and TIFF formats
/// - 32-bit float (CV_32F) images can be saved in TIFF, OpenEXR, and Radiance HDR formats; 3-channel
/// (CV_32FC3) TIFF images will be saved using the LogLuv high dynamic range encoding (4 bytes per pixel)
/// - PNG images with an alpha channel can be saved using this function. To do this, create
/// 8-bit (or 16-bit) 4-channel image BGRA, where the alpha channel goes last. Fully transparent pixels
/// should have alpha set to 0, fully opaque pixels should have alpha set to 255/65535 (see the code sample below).
///
/// If the format, depth or channel order is different, use
/// Mat::convertTo and cv::cvtColor to convert it before saving. Or, use the universal FileStorage I/O
/// functions to save the image to XML or YAML format.
///
/// The sample below shows how to create a BGRA image and save it to a PNG file. It also demonstrates how to set custom
/// compression parameters:
/// @include snippets/imgcodecs_imwrite.cpp
/// ## Parameters
/// * filename: Name of the file.
/// * img: Image to be saved.
/// * params: Format-specific parameters encoded as pairs (paramId_1, paramValue_1, paramId_2, paramValue_2, ... .) see cv::ImwriteFlags
///
/// ## C++ default parameters:
/// * params: std::vector<int>()
pub fn imwrite(filename: &str, img: &core::Mat, params: &types::VectorOfint) -> Result<bool> {
string_arg!(filename);
unsafe { sys::cv_core_cv_imwrite_String_filename_Mat_img_VectorOfint_params(filename.as_ptr(), img.as_raw_Mat(), params.as_raw_VectorOfint()) }.into_result()
}
// identifier: cv_inRange_Mat_src_Mat_lowerb_Mat_upperb_Mat_dst
/// Checks if array elements lie between the elements of two other arrays.
///
/// The function checks the range as follows:
/// * For every element of a single-channel input array:
/// <div lang='latex'>\texttt{dst} (I)= \texttt{lowerb} (I)_0 \leq \texttt{src} (I)_0 \leq \texttt{upperb} (I)_0</div>
/// * For two-channel arrays:
/// <div lang='latex'>\texttt{dst} (I)= \texttt{lowerb} (I)_0 \leq \texttt{src} (I)_0 \leq \texttt{upperb} (I)_0 \land \texttt{lowerb} (I)_1 \leq \texttt{src} (I)_1 \leq \texttt{upperb} (I)_1</div>
/// * and so forth.
///
/// That is, dst (I) is set to 255 (all 1 -bits) if src (I) is within the
/// specified 1D, 2D, 3D, ... box and 0 otherwise.
///
/// When the lower and/or upper boundary parameters are scalars, the indexes
/// (I) at lowerb and upperb in the above formulas should be omitted.
/// ## Parameters
/// * src: first input array.
/// * lowerb: inclusive lower boundary array or a scalar.
/// * upperb: inclusive upper boundary array or a scalar.
/// * dst: output array of the same size as src and CV_8U type.
pub fn in_range(src: &core::Mat, lowerb: &core::Mat, upperb: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_inRange_Mat_src_Mat_lowerb_Mat_upperb_Mat_dst(src.as_raw_Mat(), lowerb.as_raw_Mat(), upperb.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_initCameraMatrix2D_VectorOfMat_objectPoints_VectorOfMat_imagePoints_Size_imageSize_double_aspectRatio
/// Finds an initial camera matrix from 3D-2D point correspondences.
///
/// ## Parameters
/// * objectPoints: Vector of vectors of the calibration pattern points in the calibration pattern
/// coordinate space. In the old interface all the per-view vectors are concatenated. See
/// calibrateCamera for details.
/// * imagePoints: Vector of vectors of the projections of the calibration pattern points. In the
/// old interface all the per-view vectors are concatenated.
/// * imageSize: Image size in pixels used to initialize the principal point.
/// * aspectRatio: If it is zero or negative, both <span lang='latex'>f_x</span> and <span lang='latex'>f_y</span> are estimated independently.
/// Otherwise, <span lang='latex'>f_x = f_y * \texttt{aspectRatio}</span> .
///
/// The function estimates and returns an initial camera matrix for the camera calibration process.
/// Currently, the function only supports planar calibration patterns, which are patterns where each
/// object point has z-coordinate =0.
///
/// ## C++ default parameters:
/// * aspect_ratio: 1.0
pub fn init_camera_matrix2_d(object_points: &types::VectorOfMat, image_points: &types::VectorOfMat, image_size: core::Size, aspect_ratio: f64) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_initCameraMatrix2D_VectorOfMat_objectPoints_VectorOfMat_imagePoints_Size_imageSize_double_aspectRatio(object_points.as_raw_VectorOfMat(), image_points.as_raw_VectorOfMat(), image_size, aspect_ratio) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_initUndistortRectifyMap_Mat_cameraMatrix_Mat_distCoeffs_Mat_R_Mat_newCameraMatrix_Size_size_int_m1type_Mat_map1_Mat_map2
/// Computes the undistortion and rectification transformation map.
///
/// The function computes the joint undistortion and rectification transformation and represents the
/// result in the form of maps for remap. The undistorted image looks like original, as if it is
/// captured with a camera using the camera matrix =newCameraMatrix and zero distortion. In case of a
/// monocular camera, newCameraMatrix is usually equal to cameraMatrix, or it can be computed by
/// #getOptimalNewCameraMatrix for a better control over scaling. In case of a stereo camera,
/// newCameraMatrix is normally set to P1 or P2 computed by #stereoRectify .
///
/// Also, this new camera is oriented differently in the coordinate space, according to R. That, for
/// example, helps to align two heads of a stereo camera so that the epipolar lines on both images
/// become horizontal and have the same y- coordinate (in case of a horizontally aligned stereo camera).
///
/// The function actually builds the maps for the inverse mapping algorithm that is used by remap. That
/// is, for each pixel <span lang='latex'>(u, v)</span> in the destination (corrected and rectified) image, the function
/// computes the corresponding coordinates in the source image (that is, in the original image from
/// camera). The following process is applied:
/// <div lang='latex'>
/// \begin{array}{l}
/// x \leftarrow (u - {c'}_x)/{f'}_x \\
/// y \leftarrow (v - {c'}_y)/{f'}_y \\
/// {[X\,Y\,W]} ^T \leftarrow R^{-1}*[x \, y \, 1]^T \\
/// x' \leftarrow X/W \\
/// y' \leftarrow Y/W \\
/// r^2 \leftarrow x'^2 + y'^2 \\
/// x'' \leftarrow x' \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6}
/// + 2p_1 x' y' + p_2(r^2 + 2 x'^2) + s_1 r^2 + s_2 r^4\\
/// y'' \leftarrow y' \frac{1 + k_1 r^2 + k_2 r^4 + k_3 r^6}{1 + k_4 r^2 + k_5 r^4 + k_6 r^6}
/// + p_1 (r^2 + 2 y'^2) + 2 p_2 x' y' + s_3 r^2 + s_4 r^4 \\
/// s\vecthree{x'''}{y'''}{1} =
/// \vecthreethree{R_{33}(\tau_x, \tau_y)}{0}{-R_{13}((\tau_x, \tau_y)}
/// {0}{R_{33}(\tau_x, \tau_y)}{-R_{23}(\tau_x, \tau_y)}
/// {0}{0}{1} R(\tau_x, \tau_y) \vecthree{x''}{y''}{1}\\
/// map_x(u,v) \leftarrow x''' f_x + c_x \\
/// map_y(u,v) \leftarrow y''' f_y + c_y
/// \end{array}
/// </div>
/// where <span lang='latex'>(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])</span>
/// are the distortion coefficients.
///
/// In case of a stereo camera, this function is called twice: once for each camera head, after
/// stereoRectify, which in its turn is called after #stereoCalibrate. But if the stereo camera
/// was not calibrated, it is still possible to compute the rectification transformations directly from
/// the fundamental matrix using #stereoRectifyUncalibrated. For each camera, the function computes
/// homography H as the rectification transformation in a pixel domain, not a rotation matrix R in 3D
/// space. R can be computed from H as
/// <div lang='latex'>\texttt{R} = \texttt{cameraMatrix} ^{-1} \cdot \texttt{H} \cdot \texttt{cameraMatrix}</div>
/// where cameraMatrix can be chosen arbitrarily.
///
/// ## Parameters
/// * cameraMatrix: Input camera matrix <span lang='latex'>A=\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}</span> .
/// * distCoeffs: Input vector of distortion coefficients
/// <span lang='latex'>(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])</span>
/// of 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
/// * R: Optional rectification transformation in the object space (3x3 matrix). R1 or R2 ,
/// computed by #stereoRectify can be passed here. If the matrix is empty, the identity transformation
/// is assumed. In cvInitUndistortMap R assumed to be an identity matrix.
/// * newCameraMatrix: New camera matrix <span lang='latex'>A'=\vecthreethree{f_x'}{0}{c_x'}{0}{f_y'}{c_y'}{0}{0}{1}</span>.
/// * size: Undistorted image size.
/// * m1type: Type of the first output map that can be CV_32FC1, CV_32FC2 or CV_16SC2, see #convertMaps
/// * map1: The first output map.
/// * map2: The second output map.
pub fn init_undistort_rectify_map_1(camera_matrix: &core::Mat, dist_coeffs: &core::Mat, r: &core::Mat, new_camera_matrix: &core::Mat, size: core::Size, m1type: i32, map1: &mut core::Mat, map2: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_initUndistortRectifyMap_Mat_cameraMatrix_Mat_distCoeffs_Mat_R_Mat_newCameraMatrix_Size_size_int_m1type_Mat_map1_Mat_map2(camera_matrix.as_raw_Mat(), dist_coeffs.as_raw_Mat(), r.as_raw_Mat(), new_camera_matrix.as_raw_Mat(), size, m1type, map1.as_raw_Mat(), map2.as_raw_Mat()) }.into_result()
}
// identifier: cv_initWideAngleProjMap_Mat_cameraMatrix_Mat_distCoeffs_Size_imageSize_int_destImageWidth_int_m1type_Mat_map1_Mat_map2_int_projType_double_alpha
///
/// ## C++ default parameters:
/// * proj_type: PROJ_SPHERICAL_EQRECT
/// * alpha: 0
pub fn init_wide_angle_proj_map(camera_matrix: &core::Mat, dist_coeffs: &core::Mat, image_size: core::Size, dest_image_width: i32, m1type: i32, map1: &mut core::Mat, map2: &mut core::Mat, proj_type: i32, alpha: f64) -> Result<f32> {
unsafe { sys::cv_core_cv_initWideAngleProjMap_Mat_cameraMatrix_Mat_distCoeffs_Size_imageSize_int_destImageWidth_int_m1type_Mat_map1_Mat_map2_int_projType_double_alpha(camera_matrix.as_raw_Mat(), dist_coeffs.as_raw_Mat(), image_size, dest_image_width, m1type, map1.as_raw_Mat(), map2.as_raw_Mat(), proj_type, alpha) }.into_result()
}
// identifier: cv_inpaint_Mat_src_Mat_inpaintMask_Mat_dst_double_inpaintRadius_int_flags
/// Restores the selected region in an image using the region neighborhood.
///
/// ## Parameters
/// * src: Input 8-bit, 16-bit unsigned or 32-bit float 1-channel or 8-bit 3-channel image.
/// * inpaintMask: Inpainting mask, 8-bit 1-channel image. Non-zero pixels indicate the area that
/// needs to be inpainted.
/// * dst: Output image with the same size and type as src .
/// * inpaintRadius: Radius of a circular neighborhood of each point inpainted that is considered
/// by the algorithm.
/// * flags: Inpainting method that could be one of the following:
/// * **INPAINT_NS** Navier-Stokes based method [Navier01]
/// * **INPAINT_TELEA** Method by Alexandru Telea @cite Telea04 .
///
/// The function reconstructs the selected image area from the pixel near the area boundary. The
/// function may be used to remove dust and scratches from a scanned photo, or to remove undesirable
/// objects from still images or video. See <http://en.wikipedia.org/wiki/Inpainting> for more details.
///
///
/// Note:
/// * An example using the inpainting technique can be found at
/// opencv_source_code/samples/cpp/inpaint.cpp
/// * (Python) An example using the inpainting technique can be found at
/// opencv_source_code/samples/python/inpaint.py
pub fn inpaint(src: &core::Mat, inpaint_mask: &core::Mat, dst: &mut core::Mat, inpaint_radius: f64, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_inpaint_Mat_src_Mat_inpaintMask_Mat_dst_double_inpaintRadius_int_flags(src.as_raw_Mat(), inpaint_mask.as_raw_Mat(), dst.as_raw_Mat(), inpaint_radius, flags) }.into_result()
}
// identifier: cv_insertChannel_Mat_src_Mat_dst_int_coi
/// Inserts a single channel to dst (coi is 0-based index)
/// ## Parameters
/// * src: input array
/// * dst: output array
/// * coi: index of channel for insertion
/// @sa mixChannels, merge
pub fn insert_channel(src: &core::Mat, dst: &mut core::Mat, coi: i32) -> Result<()> {
unsafe { sys::cv_core_cv_insertChannel_Mat_src_Mat_dst_int_coi(src.as_raw_Mat(), dst.as_raw_Mat(), coi) }.into_result()
}
// identifier: cv_instr_resetTrace
pub fn reset_trace() -> Result<()> {
unsafe { sys::cv_core_cv_instr_resetTrace() }.into_result()
}
// identifier: cv_instr_setFlags_int_modeFlags
pub fn set_flags(mode_flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_instr_setFlags_int_modeFlags(mode_flags) }.into_result()
}
// identifier: cv_instr_setUseInstrumentation_bool_flag
pub fn set_use_instrumentation(flag: bool) -> Result<()> {
unsafe { sys::cv_core_cv_instr_setUseInstrumentation_bool_flag(flag) }.into_result()
}
// identifier: cv_instr_useInstrumentation
pub fn use_instrumentation() -> Result<bool> {
unsafe { sys::cv_core_cv_instr_useInstrumentation() }.into_result()
}
// identifier: cv_integral_Mat_src_Mat_sum_Mat_sqsum_Mat_tilted_int_sdepth_int_sqdepth
/// Calculates the integral of an image.
///
/// The function calculates one or more integral images for the source image as follows:
///
/// <div lang='latex'>\texttt{sum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)</div>
///
/// <div lang='latex'>\texttt{sqsum} (X,Y) = \sum _{x<X,y<Y} \texttt{image} (x,y)^2</div>
///
/// <div lang='latex'>\texttt{tilted} (X,Y) = \sum _{y<Y,abs(x-X+1) \leq Y-y-1} \texttt{image} (x,y)</div>
///
/// Using these integral images, you can calculate sum, mean, and standard deviation over a specific
/// up-right or rotated rectangular region of the image in a constant time, for example:
///
/// <div lang='latex'>\sum _{x_1 \leq x < x_2, \, y_1 \leq y < y_2} \texttt{image} (x,y) = \texttt{sum} (x_2,y_2)- \texttt{sum} (x_1,y_2)- \texttt{sum} (x_2,y_1)+ \texttt{sum} (x_1,y_1)</div>
///
/// It makes possible to do a fast blurring or fast block correlation with a variable window size, for
/// example. In case of multi-channel images, sums for each channel are accumulated independently.
///
/// As a practical example, the next figure shows the calculation of the integral of a straight
/// rectangle Rect(3,3,3,2) and of a tilted rectangle Rect(5,1,2,3) . The selected pixels in the
/// original image are shown, as well as the relative pixels in the integral images sum and tilted .
///
/// 
///
/// ## Parameters
/// * src: input image as <span lang='latex'>W \times H</span>, 8-bit or floating-point (32f or 64f).
/// * sum: integral image as <span lang='latex'>(W+1)\times (H+1)</span> , 32-bit integer or floating-point (32f or 64f).
/// * sqsum: integral image for squared pixel values; it is <span lang='latex'>(W+1)\times (H+1)</span>, double-precision
/// floating-point (64f) array.
/// * tilted: integral for the image rotated by 45 degrees; it is <span lang='latex'>(W+1)\times (H+1)</span> array with
/// the same data type as sum.
/// * sdepth: desired depth of the integral and the tilted integral images, CV_32S, CV_32F, or
/// CV_64F.
/// * sqdepth: desired depth of the integral image of squared pixel values, CV_32F or CV_64F.
///
/// ## C++ default parameters:
/// * sdepth: -1
/// * sqdepth: -1
pub fn integral_titled_sq(src: &core::Mat, sum: &mut core::Mat, sqsum: &mut core::Mat, tilted: &mut core::Mat, sdepth: i32, sqdepth: i32) -> Result<()> {
unsafe { sys::cv_core_cv_integral_Mat_src_Mat_sum_Mat_sqsum_Mat_tilted_int_sdepth_int_sqdepth(src.as_raw_Mat(), sum.as_raw_Mat(), sqsum.as_raw_Mat(), tilted.as_raw_Mat(), sdepth, sqdepth) }.into_result()
}
// identifier: cv_integral_Mat_src_Mat_sum_Mat_sqsum_int_sdepth_int_sqdepth
/// @overload
///
/// ## C++ default parameters:
/// * sdepth: -1
/// * sqdepth: -1
pub fn integral_sq_depth(src: &core::Mat, sum: &mut core::Mat, sqsum: &mut core::Mat, sdepth: i32, sqdepth: i32) -> Result<()> {
unsafe { sys::cv_core_cv_integral_Mat_src_Mat_sum_Mat_sqsum_int_sdepth_int_sqdepth(src.as_raw_Mat(), sum.as_raw_Mat(), sqsum.as_raw_Mat(), sdepth, sqdepth) }.into_result()
}
// identifier: cv_integral_Mat_src_Mat_sum_int_sdepth
/// @overload
///
/// ## C++ default parameters:
/// * sdepth: -1
pub fn integral_1(src: &core::Mat, sum: &mut core::Mat, sdepth: i32) -> Result<()> {
unsafe { sys::cv_core_cv_integral_Mat_src_Mat_sum_int_sdepth(src.as_raw_Mat(), sum.as_raw_Mat(), sdepth) }.into_result()
}
// identifier: cv_intersectConvexConvex_Mat__p1_Mat__p2_Mat__p12_bool_handleNested
///
/// ## C++ default parameters:
/// * handle_nested: true
pub fn intersect_convex_convex(_p1: &core::Mat, _p2: &core::Mat, _p12: &mut core::Mat, handle_nested: bool) -> Result<f32> {
unsafe { sys::cv_core_cv_intersectConvexConvex_Mat__p1_Mat__p2_Mat__p12_bool_handleNested(_p1.as_raw_Mat(), _p2.as_raw_Mat(), _p12.as_raw_Mat(), handle_nested) }.into_result()
}
// identifier: cv_invertAffineTransform_Mat_M_Mat_iM
/// Inverts an affine transformation.
///
/// The function computes an inverse affine transformation represented by <span lang='latex'>2 \times 3</span> matrix M:
///
/// <div lang='latex'>\begin{bmatrix} a_{11} & a_{12} & b_1 \\ a_{21} & a_{22} & b_2 \end{bmatrix}</div>
///
/// The result is also a <span lang='latex'>2 \times 3</span> matrix of the same type as M.
///
/// ## Parameters
/// * M: Original affine transformation.
/// * iM: Output reverse affine transformation.
pub fn invert_affine_transform(m: &core::Mat, i_m: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_invertAffineTransform_Mat_M_Mat_iM(m.as_raw_Mat(), i_m.as_raw_Mat()) }.into_result()
}
// identifier: cv_invert_Mat_src_Mat_dst_int_flags
/// Finds the inverse or pseudo-inverse of a matrix.
///
/// The function cv::invert inverts the matrix src and stores the result in dst
/// . When the matrix src is singular or non-square, the function calculates
/// the pseudo-inverse matrix (the dst matrix) so that norm(src\*dst - I) is
/// minimal, where I is an identity matrix.
///
/// In case of the #DECOMP_LU method, the function returns non-zero value if
/// the inverse has been successfully calculated and 0 if src is singular.
///
/// In case of the #DECOMP_SVD method, the function returns the inverse
/// condition number of src (the ratio of the smallest singular value to the
/// largest singular value) and 0 if src is singular. The SVD method
/// calculates a pseudo-inverse matrix if src is singular.
///
/// Similarly to #DECOMP_LU, the method #DECOMP_CHOLESKY works only with
/// non-singular square matrices that should also be symmetrical and
/// positively defined. In this case, the function stores the inverted
/// matrix in dst and returns non-zero. Otherwise, it returns 0.
///
/// ## Parameters
/// * src: input floating-point M x N matrix.
/// * dst: output matrix of N x M size and the same type as src.
/// * flags: inversion method (cv::DecompTypes)
/// @sa solve, SVD
///
/// ## C++ default parameters:
/// * flags: DECOMP_LU
pub fn invert(src: &core::Mat, dst: &mut core::Mat, flags: i32) -> Result<f64> {
unsafe { sys::cv_core_cv_invert_Mat_src_Mat_dst_int_flags(src.as_raw_Mat(), dst.as_raw_Mat(), flags) }.into_result()
}
// identifier: cv_ipp_getIppErrorLocation
pub fn get_ipp_error_location() -> Result<String> {
unsafe { sys::cv_core_cv_ipp_getIppErrorLocation() }.into_result().map(crate::templ::receive_string_mut)
}
// identifier: cv_ipp_getIppFeatures
pub fn get_ipp_features() -> Result<u64> {
unsafe { sys::cv_core_cv_ipp_getIppFeatures() }.into_result()
}
// identifier: cv_ipp_getIppStatus
pub fn get_ipp_status() -> Result<i32> {
unsafe { sys::cv_core_cv_ipp_getIppStatus() }.into_result()
}
// identifier: cv_ipp_getIppVersion
pub fn get_ipp_version() -> Result<String> {
unsafe { sys::cv_core_cv_ipp_getIppVersion() }.into_result().map(crate::templ::receive_string_mut)
}
// identifier: cv_ipp_setUseIPP_NE_bool_flag
pub fn set_use_ipp_ne(flag: bool) -> Result<()> {
unsafe { sys::cv_core_cv_ipp_setUseIPP_NE_bool_flag(flag) }.into_result()
}
// identifier: cv_ipp_setUseIPP_NotExact_bool_flag
pub fn set_use_ipp__not_exact(flag: bool) -> Result<()> {
unsafe { sys::cv_core_cv_ipp_setUseIPP_NotExact_bool_flag(flag) }.into_result()
}
// identifier: cv_ipp_setUseIPP_bool_flag
pub fn set_use_ipp(flag: bool) -> Result<()> {
unsafe { sys::cv_core_cv_ipp_setUseIPP_bool_flag(flag) }.into_result()
}
// identifier: cv_ipp_useIPP
pub fn use_ipp() -> Result<bool> {
unsafe { sys::cv_core_cv_ipp_useIPP() }.into_result()
}
// identifier: cv_ipp_useIPP_NE
pub fn use_ipp_ne() -> Result<bool> {
unsafe { sys::cv_core_cv_ipp_useIPP_NE() }.into_result()
}
// identifier: cv_ipp_useIPP_NotExact
pub fn use_ipp__not_exact() -> Result<bool> {
unsafe { sys::cv_core_cv_ipp_useIPP_NotExact() }.into_result()
}
// identifier: cv_isContourConvex_Mat_contour
/// Tests a contour convexity.
///
/// The function tests whether the input contour is convex or not. The contour must be simple, that is,
/// without self-intersections. Otherwise, the function output is undefined.
///
/// ## Parameters
/// * contour: Input vector of 2D points, stored in std::vector\<\> or Mat
pub fn is_contour_convex(contour: &core::Mat) -> Result<bool> {
unsafe { sys::cv_core_cv_isContourConvex_Mat_contour(contour.as_raw_Mat()) }.into_result()
}
// identifier: cv_kmeans_Mat_data_int_K_Mat_bestLabels_TermCriteria_criteria_int_attempts_int_flags_Mat_centers
/// Finds centers of clusters and groups input samples around the clusters.
///
/// The function kmeans implements a k-means algorithm that finds the centers of cluster_count clusters
/// and groups the input samples around the clusters. As an output, <span lang='latex'>\texttt{bestLabels}_i</span> contains a
/// 0-based cluster index for the sample stored in the <span lang='latex'>i^{th}</span> row of the samples matrix.
///
///
/// Note:
/// * (Python) An example on K-means clustering can be found at
/// opencv_source_code/samples/python/kmeans.py
/// ## Parameters
/// * data: Data for clustering. An array of N-Dimensional points with float coordinates is needed.
/// Examples of this array can be:
/// * Mat points(count, 2, CV_32F);
/// * Mat points(count, 1, CV_32FC2);
/// * Mat points(1, count, CV_32FC2);
/// * std::vector\<cv::Point2f\> points(sampleCount);
/// * K: Number of clusters to split the set by.
/// * bestLabels: Input/output integer array that stores the cluster indices for every sample.
/// * criteria: The algorithm termination criteria, that is, the maximum number of iterations and/or
/// the desired accuracy. The accuracy is specified as criteria.epsilon. As soon as each of the cluster
/// centers moves by less than criteria.epsilon on some iteration, the algorithm stops.
/// * attempts: Flag to specify the number of times the algorithm is executed using different
/// initial labellings. The algorithm returns the labels that yield the best compactness (see the last
/// function parameter).
/// * flags: Flag that can take values of cv::KmeansFlags
/// * centers: Output matrix of the cluster centers, one row per each cluster center.
/// @return The function returns the compactness measure that is computed as
/// <div lang='latex'>\sum _i \| \texttt{samples} _i - \texttt{centers} _{ \texttt{labels} _i} \| ^2</div>
/// after every attempt. The best (minimum) value is chosen and the corresponding labels and the
/// compactness value are returned by the function. Basically, you can use only the core of the
/// function, set the number of attempts to 1, initialize labels each time using a custom algorithm,
/// pass them with the ( flags = #KMEANS_USE_INITIAL_LABELS ) flag, and then choose the best
/// (most-compact) clustering.
///
/// ## C++ default parameters:
/// * centers: noArray()
pub fn kmeans(data: &core::Mat, k: i32, best_labels: &mut core::Mat, criteria: &core::TermCriteria, attempts: i32, flags: i32, centers: &mut core::Mat) -> Result<f64> {
unsafe { sys::cv_core_cv_kmeans_Mat_data_int_K_Mat_bestLabels_TermCriteria_criteria_int_attempts_int_flags_Mat_centers(data.as_raw_Mat(), k, best_labels.as_raw_Mat(), criteria.as_raw_TermCriteria(), attempts, flags, centers.as_raw_Mat()) }.into_result()
}
// identifier: cv_line_Mat_img_Point_pt1_Point_pt2_Scalar_color_int_thickness_int_lineType_int_shift
/// Draws a line segment connecting two points.
///
/// The function line draws the line segment between pt1 and pt2 points in the image. The line is
/// clipped by the image boundaries. For non-antialiased lines with integer coordinates, the 8-connected
/// or 4-connected Bresenham algorithm is used. Thick lines are drawn with rounding endings. Antialiased
/// lines are drawn using Gaussian filtering.
///
/// ## Parameters
/// * img: Image.
/// * pt1: First point of the line segment.
/// * pt2: Second point of the line segment.
/// * color: Line color.
/// * thickness: Line thickness.
/// * lineType: Type of the line. See #LineTypes.
/// * shift: Number of fractional bits in the point coordinates.
///
/// ## C++ default parameters:
/// * thickness: 1
/// * line_type: LINE_8
/// * shift: 0
pub fn line(img: &mut core::Mat, pt1: core::Point, pt2: core::Point, color: core::Scalar, thickness: i32, line_type: i32, shift: i32) -> Result<()> {
unsafe { sys::cv_core_cv_line_Mat_img_Point_pt1_Point_pt2_Scalar_color_int_thickness_int_lineType_int_shift(img.as_raw_Mat(), pt1, pt2, color, thickness, line_type, shift) }.into_result()
}
// identifier: cv_linearPolar_Mat_src_Mat_dst_Point2f_center_double_maxRadius_int_flags
/// Remaps an image to polar coordinates space.
///
/// @deprecated This function produces same result as cv::warpPolar(src, dst, src.size(), center, maxRadius, flags)
///
/// @internal
/// Transform the source image using the following transformation (See @ref polar_remaps_reference_image "Polar remaps reference image c)"):
/// <div lang='latex'>\begin{array}{l}
/// dst( \rho , \phi ) = src(x,y) \\
/// dst.size() \leftarrow src.size()
/// \end{array}</div>
///
/// where
/// <div lang='latex'>\begin{array}{l}
/// I = (dx,dy) = (x - center.x,y - center.y) \\
/// \rho = Kmag \cdot \texttt{magnitude} (I) ,\\
/// \phi = angle \cdot \texttt{angle} (I)
/// \end{array}</div>
///
/// and
/// <div lang='latex'>\begin{array}{l}
/// Kx = src.cols / maxRadius \\
/// Ky = src.rows / 2\Pi
/// \end{array}</div>
///
///
/// ## Parameters
/// * src: Source image
/// * dst: Destination image. It will have same size and type as src.
/// * center: The transformation center;
/// * maxRadius: The radius of the bounding circle to transform. It determines the inverse magnitude scale parameter too.
/// * flags: A combination of interpolation methods, see #InterpolationFlags
///
///
/// Note:
/// * The function can not operate in-place.
/// * To calculate magnitude and angle in degrees #cartToPolar is used internally thus angles are measured from 0 to 360 with accuracy about 0.3 degrees.
///
/// @sa cv::logPolar
/// @endinternal
pub fn linear_polar(src: &core::Mat, dst: &mut core::Mat, center: core::Point2f, max_radius: f64, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_linearPolar_Mat_src_Mat_dst_Point2f_center_double_maxRadius_int_flags(src.as_raw_Mat(), dst.as_raw_Mat(), center, max_radius, flags) }.into_result()
}
// identifier: cv_loadWindowParameters_String_windowName
/// Loads parameters of the specified window.
///
/// The function loadWindowParameters loads size, location, flags, trackbars value, zoom and panning
/// location of the window windowName.
///
/// ## Parameters
/// * windowName: Name of the window.
pub fn load_window_parameters(window_name: &str) -> Result<()> {
string_arg!(window_name);
unsafe { sys::cv_core_cv_loadWindowParameters_String_windowName(window_name.as_ptr()) }.into_result()
}
// identifier: cv_logPolar_Mat_src_Mat_dst_Point2f_center_double_M_int_flags
/// Remaps an image to semilog-polar coordinates space.
///
/// @deprecated This function produces same result as cv::warpPolar(src, dst, src.size(), center, maxRadius, flags+WARP_POLAR_LOG);
///
/// @internal
/// Transform the source image using the following transformation (See @ref polar_remaps_reference_image "Polar remaps reference image d)"):
/// <div lang='latex'>\begin{array}{l}
/// dst( \rho , \phi ) = src(x,y) \\
/// dst.size() \leftarrow src.size()
/// \end{array}</div>
///
/// where
/// <div lang='latex'>\begin{array}{l}
/// I = (dx,dy) = (x - center.x,y - center.y) \\
/// \rho = M \cdot log_e(\texttt{magnitude} (I)) ,\\
/// \phi = Kangle \cdot \texttt{angle} (I) \\
/// \end{array}</div>
///
/// and
/// <div lang='latex'>\begin{array}{l}
/// M = src.cols / log_e(maxRadius) \\
/// Kangle = src.rows / 2\Pi \\
/// \end{array}</div>
///
/// The function emulates the human "foveal" vision and can be used for fast scale and
/// rotation-invariant template matching, for object tracking and so forth.
/// ## Parameters
/// * src: Source image
/// * dst: Destination image. It will have same size and type as src.
/// * center: The transformation center; where the output precision is maximal
/// * M: Magnitude scale parameter. It determines the radius of the bounding circle to transform too.
/// * flags: A combination of interpolation methods, see #InterpolationFlags
///
///
/// Note:
/// * The function can not operate in-place.
/// * To calculate magnitude and angle in degrees #cartToPolar is used internally thus angles are measured from 0 to 360 with accuracy about 0.3 degrees.
///
/// @sa cv::linearPolar
/// @endinternal
pub fn log_polar(src: &core::Mat, dst: &mut core::Mat, center: core::Point2f, m: f64, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_logPolar_Mat_src_Mat_dst_Point2f_center_double_M_int_flags(src.as_raw_Mat(), dst.as_raw_Mat(), center, m, flags) }.into_result()
}
// identifier: cv_log_Mat_src_Mat_dst
/// Calculates the natural logarithm of every array element.
///
/// The function cv::log calculates the natural logarithm of every element of the input array:
/// <div lang='latex'>\texttt{dst} (I) = \log (\texttt{src}(I)) </div>
///
/// Output on zero, negative and special (NaN, Inf) values is undefined.
///
/// ## Parameters
/// * src: input array.
/// * dst: output array of the same size and type as src .
/// @sa exp, cartToPolar, polarToCart, phase, pow, sqrt, magnitude
pub fn log_2(src: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_log_Mat_src_Mat_dst(src.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_log_softdouble_a
pub fn log_3(a: &core::softdouble) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_log_softdouble_a(a.as_raw_softdouble()) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_log_softfloat_a
/// Natural logarithm
///
/// Special cases:
/// - log(NaN), log(x < 0) are NaN
/// - log(0) == -Inf
pub fn log_4(a: &core::softfloat) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_log_softfloat_a(a.as_raw_softfloat()) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_magnitude_Mat_x_Mat_y_Mat_magnitude
/// Calculates the magnitude of 2D vectors.
///
/// The function cv::magnitude calculates the magnitude of 2D vectors formed
/// from the corresponding elements of x and y arrays:
/// <div lang='latex'>\texttt{dst} (I) = \sqrt{\texttt{x}(I)^2 + \texttt{y}(I)^2}</div>
/// ## Parameters
/// * x: floating-point array of x-coordinates of the vectors.
/// * y: floating-point array of y-coordinates of the vectors; it must
/// have the same size as x.
/// * magnitude: output array of the same size and type as x.
/// @sa cartToPolar, polarToCart, phase, sqrt
pub fn magnitude_2(x: &core::Mat, y: &core::Mat, magnitude: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_magnitude_Mat_x_Mat_y_Mat_magnitude(x.as_raw_Mat(), y.as_raw_Mat(), magnitude.as_raw_Mat()) }.into_result()
}
// identifier: cv_matMulDeriv_Mat_A_Mat_B_Mat_dABdA_Mat_dABdB
/// Computes partial derivatives of the matrix product for each multiplied matrix.
///
/// ## Parameters
/// * A: First multiplied matrix.
/// * B: Second multiplied matrix.
/// * dABdA: First output derivative matrix d(A\*B)/dA of size
/// <span lang='latex'>\texttt{A.rows*B.cols} \times {A.rows*A.cols}</span> .
/// * dABdB: Second output derivative matrix d(A\*B)/dB of size
/// <span lang='latex'>\texttt{A.rows*B.cols} \times {B.rows*B.cols}</span> .
///
/// The function computes partial derivatives of the elements of the matrix product <span lang='latex'>A*B</span> with regard to
/// the elements of each of the two input matrices. The function is used to compute the Jacobian
/// matrices in stereoCalibrate but can also be used in any other similar optimization function.
pub fn mat_mul_deriv(a: &core::Mat, b: &core::Mat, d_a_bd_a: &mut core::Mat, d_a_bd_b: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_matMulDeriv_Mat_A_Mat_B_Mat_dABdA_Mat_dABdB(a.as_raw_Mat(), b.as_raw_Mat(), d_a_bd_a.as_raw_Mat(), d_a_bd_b.as_raw_Mat()) }.into_result()
}
// identifier: cv_matchShapes_Mat_contour1_Mat_contour2_int_method_double_parameter
/// Compares two shapes.
///
/// The function compares two shapes. All three implemented methods use the Hu invariants (see #HuMoments)
///
/// ## Parameters
/// * contour1: First contour or grayscale image.
/// * contour2: Second contour or grayscale image.
/// * method: Comparison method, see #ShapeMatchModes
/// * parameter: Method-specific parameter (not supported now).
pub fn match_shapes(contour1: &core::Mat, contour2: &core::Mat, method: i32, parameter: f64) -> Result<f64> {
unsafe { sys::cv_core_cv_matchShapes_Mat_contour1_Mat_contour2_int_method_double_parameter(contour1.as_raw_Mat(), contour2.as_raw_Mat(), method, parameter) }.into_result()
}
// identifier: cv_matchTemplate_Mat_image_Mat_templ_Mat_result_int_method_Mat_mask
/// Compares a template against overlapped image regions.
///
/// The function slides through image , compares the overlapped patches of size <span lang='latex'>w \times h</span> against
/// templ using the specified method and stores the comparison results in result . Here are the formulae
/// for the available comparison methods ( <span lang='latex'>I</span> denotes image, <span lang='latex'>T</span> template, <span lang='latex'>R</span> result ). The summation
/// is done over template and/or the image patch: <span lang='latex'>x' = 0...w-1, y' = 0...h-1</span>
///
/// After the function finishes the comparison, the best matches can be found as global minimums (when
/// #TM_SQDIFF was used) or maximums (when #TM_CCORR or #TM_CCOEFF was used) using the
/// #minMaxLoc function. In case of a color image, template summation in the numerator and each sum in
/// the denominator is done over all of the channels and separate mean values are used for each channel.
/// That is, the function can take a color template and a color image. The result will still be a
/// single-channel image, which is easier to analyze.
///
/// ## Parameters
/// * image: Image where the search is running. It must be 8-bit or 32-bit floating-point.
/// * templ: Searched template. It must be not greater than the source image and have the same
/// data type.
/// * result: Map of comparison results. It must be single-channel 32-bit floating-point. If image
/// is <span lang='latex'>W \times H</span> and templ is <span lang='latex'>w \times h</span> , then result is <span lang='latex'>(W-w+1) \times (H-h+1)</span> .
/// * method: Parameter specifying the comparison method, see #TemplateMatchModes
/// * mask: Mask of searched template. It must have the same datatype and size with templ. It is
/// not set by default. Currently, only the #TM_SQDIFF and #TM_CCORR_NORMED methods are supported.
///
/// ## C++ default parameters:
/// * mask: noArray()
pub fn match_template(image: &core::Mat, templ: &core::Mat, result: &mut core::Mat, method: i32, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_matchTemplate_Mat_image_Mat_templ_Mat_result_int_method_Mat_mask(image.as_raw_Mat(), templ.as_raw_Mat(), result.as_raw_Mat(), method, mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_max_Mat_src1_Mat_src2_Mat_dst
/// Calculates per-element maximum of two arrays or an array and a scalar.
///
/// The function cv::max calculates the per-element maximum of two arrays:
/// <div lang='latex'>\texttt{dst} (I)= \max ( \texttt{src1} (I), \texttt{src2} (I))</div>
/// or array and a scalar:
/// <div lang='latex'>\texttt{dst} (I)= \max ( \texttt{src1} (I), \texttt{value} )</div>
/// ## Parameters
/// * src1: first input array.
/// * src2: second input array of the same size and type as src1 .
/// * dst: output array of the same size and type as src1.
/// @sa min, compare, inRange, minMaxLoc, @ref MatrixExpressions
pub fn max_mat_mat(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_max_Mat_src1_Mat_src2_Mat_dst(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_max_softdouble_a_softdouble_b
pub fn max(a: &core::softdouble, b: &core::softdouble) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_max_softdouble_a_softdouble_b(a.as_raw_softdouble(), b.as_raw_softdouble()) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_max_softfloat_a_softfloat_b
pub fn max_1(a: &core::softfloat, b: &core::softfloat) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_max_softfloat_a_softfloat_b(a.as_raw_softfloat(), b.as_raw_softfloat()) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_meanShift_Mat_probImage_Rect_window_TermCriteria_criteria
/// Finds an object on a back projection image.
///
/// ## Parameters
/// * probImage: Back projection of the object histogram. See calcBackProject for details.
/// * window: Initial search window.
/// * criteria: Stop criteria for the iterative search algorithm.
/// returns
/// : Number of iterations CAMSHIFT took to converge.
/// The function implements the iterative object search algorithm. It takes the input back projection of
/// an object and the initial position. The mass center in window of the back projection image is
/// computed and the search window center shifts to the mass center. The procedure is repeated until the
/// specified number of iterations criteria.maxCount is done or until the window center shifts by less
/// than criteria.epsilon. The algorithm is used inside CamShift and, unlike CamShift , the search
/// window size or orientation do not change during the search. You can simply pass the output of
/// calcBackProject to this function. But better results can be obtained if you pre-filter the back
/// projection and remove the noise. For example, you can do this by retrieving connected components
/// with findContours , throwing away contours with small area ( contourArea ), and rendering the
/// remaining contours with drawContours.
pub fn mean_shift(prob_image: &core::Mat, window: core::Rect, criteria: &core::TermCriteria) -> Result<i32> {
unsafe { sys::cv_core_cv_meanShift_Mat_probImage_Rect_window_TermCriteria_criteria(prob_image.as_raw_Mat(), window, criteria.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_meanStdDev_Mat_src_Mat_mean_Mat_stddev_Mat_mask
/// Calculates a mean and standard deviation of array elements.
///
/// The function cv::meanStdDev calculates the mean and the standard deviation M
/// of array elements independently for each channel and returns it via the
/// output parameters:
/// <div lang='latex'>\begin{array}{l} N = \sum _{I, \texttt{mask} (I) \ne 0} 1 \\ \texttt{mean} _c = \frac{\sum_{ I: \; \texttt{mask}(I) \ne 0} \texttt{src} (I)_c}{N} \\ \texttt{stddev} _c = \sqrt{\frac{\sum_{ I: \; \texttt{mask}(I) \ne 0} \left ( \texttt{src} (I)_c - \texttt{mean} _c \right )^2}{N}} \end{array}</div>
/// When all the mask elements are 0's, the function returns
/// mean=stddev=Scalar::all(0).
///
/// Note: The calculated standard deviation is only the diagonal of the
/// complete normalized covariance matrix. If the full matrix is needed, you
/// can reshape the multi-channel array M x N to the single-channel array
/// M\*N x mtx.channels() (only possible when the matrix is continuous) and
/// then pass the matrix to calcCovarMatrix .
/// ## Parameters
/// * src: input array that should have from 1 to 4 channels so that the results can be stored in
/// Scalar_ 's.
/// * mean: output parameter: calculated mean value.
/// * stddev: output parameter: calculated standard deviation.
/// * mask: optional operation mask.
/// @sa countNonZero, mean, norm, minMaxLoc, calcCovarMatrix
///
/// ## C++ default parameters:
/// * mask: noArray()
pub fn mean_std_dev(src: &core::Mat, mean: &mut core::Mat, stddev: &mut core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_meanStdDev_Mat_src_Mat_mean_Mat_stddev_Mat_mask(src.as_raw_Mat(), mean.as_raw_Mat(), stddev.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_mean_Mat_src_Mat_mask
/// Calculates an average (mean) of array elements.
///
/// The function cv::mean calculates the mean value M of array elements,
/// independently for each channel, and return it:
/// <div lang='latex'>\begin{array}{l} N = \sum _{I: \; \texttt{mask} (I) \ne 0} 1 \\ M_c = \left ( \sum _{I: \; \texttt{mask} (I) \ne 0}{ \texttt{mtx} (I)_c} \right )/N \end{array}</div>
/// When all the mask elements are 0's, the function returns Scalar::all(0)
/// ## Parameters
/// * src: input array that should have from 1 to 4 channels so that the result can be stored in
/// Scalar_ .
/// * mask: optional operation mask.
/// @sa countNonZero, meanStdDev, norm, minMaxLoc
///
/// ## C++ default parameters:
/// * mask: noArray()
pub fn mean(src: &core::Mat, mask: &core::Mat) -> Result<core::Scalar> {
unsafe { sys::cv_core_cv_mean_Mat_src_Mat_mask(src.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_medianBlur_Mat_src_Mat_dst_int_ksize
/// Blurs an image using the median filter.
///
/// The function smoothes an image using the median filter with the \f$\texttt{ksize} \times
/// \texttt{ksize}\f$ aperture. Each channel of a multi-channel image is processed independently.
/// In-place operation is supported.
///
///
/// Note: The median filter uses #BORDER_REPLICATE internally to cope with border pixels, see #BorderTypes
///
/// ## Parameters
/// * src: input 1-, 3-, or 4-channel image; when ksize is 3 or 5, the image depth should be
/// CV_8U, CV_16U, or CV_32F, for larger aperture sizes, it can only be CV_8U.
/// * dst: destination array of the same size and type as src.
/// * ksize: aperture linear size; it must be odd and greater than 1, for example: 3, 5, 7 ...
/// @sa bilateralFilter, blur, boxFilter, GaussianBlur
pub fn median_blur(src: &core::Mat, dst: &mut core::Mat, ksize: i32) -> Result<()> {
unsafe { sys::cv_core_cv_medianBlur_Mat_src_Mat_dst_int_ksize(src.as_raw_Mat(), dst.as_raw_Mat(), ksize) }.into_result()
}
// identifier: cv_merge_VectorOfMat_mv_Mat_dst
/// @overload
/// ## Parameters
/// * mv: input vector of matrices to be merged; all the matrices in mv must have the same
/// size and the same depth.
/// * dst: output array of the same size and the same depth as mv[0]; The number of channels will
/// be the total number of channels in the matrix array.
pub fn merge(mv: &types::VectorOfMat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_merge_VectorOfMat_mv_Mat_dst(mv.as_raw_VectorOfMat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_merge_const_Mat_mv_size_t_count_Mat_dst
/// Creates one multi-channel array out of several single-channel ones.
///
/// The function cv::merge merges several arrays to make a single multi-channel array. That is, each
/// element of the output array will be a concatenation of the elements of the input arrays, where
/// elements of i-th input array are treated as mv[i].channels()-element vectors.
///
/// The function cv::split does the reverse operation. If you need to shuffle channels in some other
/// advanced way, use cv::mixChannels.
///
/// The following example shows how to merge 3 single channel matrices into a single 3-channel matrix.
/// @snippet snippets/core_merge.cpp example
///
/// ## Parameters
/// * mv: input array of matrices to be merged; all the matrices in mv must have the same
/// size and the same depth.
/// * count: number of input matrices when mv is a plain C array; it must be greater than zero.
/// * dst: output array of the same size and the same depth as mv[0]; The number of channels will
/// be equal to the parameter count.
/// @sa mixChannels, split, Mat::reshape
pub fn merge_1(mv: &core::Mat, count: size_t, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_merge_const_Mat_mv_size_t_count_Mat_dst(mv.as_raw_Mat(), count, dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_minAreaRect_Mat_points
/// Finds a rotated rectangle of the minimum area enclosing the input 2D point set.
///
/// The function calculates and returns the minimum-area bounding rectangle (possibly rotated) for a
/// specified point set. Developer should keep in mind that the returned RotatedRect can contain negative
/// indices when data is close to the containing Mat element boundary.
///
/// ## Parameters
/// * points: Input vector of 2D points, stored in std::vector\<\> or Mat
pub fn min_area_rect(points: &core::Mat) -> Result<core::RotatedRect> {
unsafe { sys::cv_core_cv_minAreaRect_Mat_points(points.as_raw_Mat()) }.into_result().map(|x| core::RotatedRect { ptr: x })
}
// identifier: cv_minEnclosingCircle_Mat_points_Point2f_center_float_radius
/// Finds a circle of the minimum area enclosing a 2D point set.
///
/// The function finds the minimal enclosing circle of a 2D point set using an iterative algorithm.
///
/// ## Parameters
/// * points: Input vector of 2D points, stored in std::vector\<\> or Mat
/// * center: Output center of the circle.
/// * radius: Output radius of the circle.
pub fn min_enclosing_circle(points: &core::Mat, center: core::Point2f, radius: f32) -> Result<()> {
unsafe { sys::cv_core_cv_minEnclosingCircle_Mat_points_Point2f_center_float_radius(points.as_raw_Mat(), center, radius) }.into_result()
}
// identifier: cv_minEnclosingTriangle_Mat_points_Mat_triangle
/// Finds a triangle of minimum area enclosing a 2D point set and returns its area.
///
/// The function finds a triangle of minimum area enclosing the given set of 2D points and returns its
/// area. The output for a given 2D point set is shown in the image below. 2D points are depicted in
/// *red* and the enclosing triangle in *yellow*.
///
/// 
///
/// The implementation of the algorithm is based on O'Rourke's @cite ORourke86 and Klee and Laskowski's
/// @cite KleeLaskowski85 papers. O'Rourke provides a <span lang='latex'>\theta(n)</span> algorithm for finding the minimal
/// enclosing triangle of a 2D convex polygon with n vertices. Since the #minEnclosingTriangle function
/// takes a 2D point set as input an additional preprocessing step of computing the convex hull of the
/// 2D point set is required. The complexity of the #convexHull function is <span lang='latex'>O(n log(n))</span> which is higher
/// than <span lang='latex'>\theta(n)</span>. Thus the overall complexity of the function is <span lang='latex'>O(n log(n))</span>.
///
/// ## Parameters
/// * points: Input vector of 2D points with depth CV_32S or CV_32F, stored in std::vector\<\> or Mat
/// * triangle: Output vector of three 2D points defining the vertices of the triangle. The depth
/// of the OutputArray must be CV_32F.
pub fn min_enclosing_triangle(points: &core::Mat, triangle: &mut core::Mat) -> Result<f64> {
unsafe { sys::cv_core_cv_minEnclosingTriangle_Mat_points_Mat_triangle(points.as_raw_Mat(), triangle.as_raw_Mat()) }.into_result()
}
// identifier: cv_minMaxIdx_Mat_src_double_X_minVal_double_X_maxVal_int_X_minIdx_int_X_maxIdx_Mat_mask
/// Finds the global minimum and maximum in an array
///
/// The function cv::minMaxIdx finds the minimum and maximum element values and their positions. The
/// extremums are searched across the whole array or, if mask is not an empty array, in the specified
/// array region. The function does not work with multi-channel arrays. If you need to find minimum or
/// maximum elements across all the channels, use Mat::reshape first to reinterpret the array as
/// single-channel. Or you may extract the particular channel using either extractImageCOI , or
/// mixChannels , or split . In case of a sparse matrix, the minimum is found among non-zero elements
/// only.
///
/// Note: When minIdx is not NULL, it must have at least 2 elements (as well as maxIdx), even if src is
/// a single-row or single-column matrix. In OpenCV (following MATLAB) each array has at least 2
/// dimensions, i.e. single-column matrix is Mx1 matrix (and therefore minIdx/maxIdx will be
/// (i1,0)/(i2,0)) and single-row matrix is 1xN matrix (and therefore minIdx/maxIdx will be
/// (0,j1)/(0,j2)).
/// ## Parameters
/// * src: input single-channel array.
/// * minVal: pointer to the returned minimum value; NULL is used if not required.
/// * maxVal: pointer to the returned maximum value; NULL is used if not required.
/// * minIdx: pointer to the returned minimum location (in nD case); NULL is used if not required;
/// Otherwise, it must point to an array of src.dims elements, the coordinates of the minimum element
/// in each dimension are stored there sequentially.
/// * maxIdx: pointer to the returned maximum location (in nD case). NULL is used if not required.
/// * mask: specified array region
///
/// ## C++ default parameters:
/// * max_val: 0
/// * min_idx: 0
/// * max_idx: 0
/// * mask: noArray()
pub fn min_max_idx(src: &core::Mat, min_val: &mut f64, max_val: &mut f64, min_idx: &mut i32, max_idx: &mut i32, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_minMaxIdx_Mat_src_double_X_minVal_double_X_maxVal_int_X_minIdx_int_X_maxIdx_Mat_mask(src.as_raw_Mat(), min_val, max_val, min_idx, max_idx, mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_minMaxLoc_Mat_src_double_X_minVal_double_X_maxVal_Point_X_minLoc_Point_X_maxLoc_Mat_mask
/// Finds the global minimum and maximum in an array.
///
/// The function cv::minMaxLoc finds the minimum and maximum element values and their positions. The
/// extremums are searched across the whole array or, if mask is not an empty array, in the specified
/// array region.
///
/// The function do not work with multi-channel arrays. If you need to find minimum or maximum
/// elements across all the channels, use Mat::reshape first to reinterpret the array as
/// single-channel. Or you may extract the particular channel using either extractImageCOI , or
/// mixChannels , or split .
/// ## Parameters
/// * src: input single-channel array.
/// * minVal: pointer to the returned minimum value; NULL is used if not required.
/// * maxVal: pointer to the returned maximum value; NULL is used if not required.
/// * minLoc: pointer to the returned minimum location (in 2D case); NULL is used if not required.
/// * maxLoc: pointer to the returned maximum location (in 2D case); NULL is used if not required.
/// * mask: optional mask used to select a sub-array.
/// @sa max, min, compare, inRange, extractImageCOI, mixChannels, split, Mat::reshape
///
/// ## C++ default parameters:
/// * max_val: 0
/// * min_loc: 0
/// * max_loc: 0
/// * mask: noArray()
pub fn min_max_loc(src: &core::Mat, min_val: &mut f64, max_val: &mut f64, min_loc: &mut core::Point, max_loc: &mut core::Point, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_minMaxLoc_Mat_src_double_X_minVal_double_X_maxVal_Point_X_minLoc_Point_X_maxLoc_Mat_mask(src.as_raw_Mat(), min_val, max_val, min_loc, max_loc, mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_min_Mat_src1_Mat_src2_Mat_dst
/// Calculates per-element minimum of two arrays or an array and a scalar.
///
/// The function cv::min calculates the per-element minimum of two arrays:
/// <div lang='latex'>\texttt{dst} (I)= \min ( \texttt{src1} (I), \texttt{src2} (I))</div>
/// or array and a scalar:
/// <div lang='latex'>\texttt{dst} (I)= \min ( \texttt{src1} (I), \texttt{value} )</div>
/// ## Parameters
/// * src1: first input array.
/// * src2: second input array of the same size and type as src1.
/// * dst: output array of the same size and type as src1.
/// @sa max, compare, inRange, minMaxLoc
pub fn min_mat_mat(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_min_Mat_src1_Mat_src2_Mat_dst(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_min_softdouble_a_softdouble_b
pub fn min(a: &core::softdouble, b: &core::softdouble) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_min_softdouble_a_softdouble_b(a.as_raw_softdouble(), b.as_raw_softdouble()) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_min_softfloat_a_softfloat_b
/// Min and Max functions
pub fn min_1(a: &core::softfloat, b: &core::softfloat) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_min_softfloat_a_softfloat_b(a.as_raw_softfloat(), b.as_raw_softfloat()) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_mixChannels_VectorOfMat_src_VectorOfMat_dst_VectorOfint_fromTo
/// @overload
/// ## Parameters
/// * src: input array or vector of matrices; all of the matrices must have the same size and the
/// same depth.
/// * dst: output array or vector of matrices; all the matrices **must be allocated**; their size and
/// depth must be the same as in src[0].
/// * fromTo: array of index pairs specifying which channels are copied and where; fromTo[k\*2] is
/// a 0-based index of the input channel in src, fromTo[k\*2+1] is an index of the output channel in
/// dst; the continuous channel numbering is used: the first input image channels are indexed from 0 to
/// src[0].channels()-1, the second input image channels are indexed from src[0].channels() to
/// src[0].channels() + src[1].channels()-1, and so on, the same scheme is used for the output image
/// channels; as a special case, when fromTo[k\*2] is negative, the corresponding output channel is
/// filled with zero .
pub fn mix_channels(src: &types::VectorOfMat, dst: &mut types::VectorOfMat, from_to: &types::VectorOfint) -> Result<()> {
unsafe { sys::cv_core_cv_mixChannels_VectorOfMat_src_VectorOfMat_dst_VectorOfint_fromTo(src.as_raw_VectorOfMat(), dst.as_raw_VectorOfMat(), from_to.as_raw_VectorOfint()) }.into_result()
}
// identifier: cv_mixChannels_VectorOfMat_src_VectorOfMat_dst_const_int_X_fromTo_size_t_npairs
/// @overload
/// ## Parameters
/// * src: input array or vector of matrices; all of the matrices must have the same size and the
/// same depth.
/// * dst: output array or vector of matrices; all the matrices **must be allocated**; their size and
/// depth must be the same as in src[0].
/// * fromTo: array of index pairs specifying which channels are copied and where; fromTo[k\*2] is
/// a 0-based index of the input channel in src, fromTo[k\*2+1] is an index of the output channel in
/// dst; the continuous channel numbering is used: the first input image channels are indexed from 0 to
/// src[0].channels()-1, the second input image channels are indexed from src[0].channels() to
/// src[0].channels() + src[1].channels()-1, and so on, the same scheme is used for the output image
/// channels; as a special case, when fromTo[k\*2] is negative, the corresponding output channel is
/// filled with zero .
/// * npairs: number of index pairs in fromTo.
pub fn mix_channels_1(src: &types::VectorOfMat, dst: &mut types::VectorOfMat, from_to: &i32, npairs: size_t) -> Result<()> {
unsafe { sys::cv_core_cv_mixChannels_VectorOfMat_src_VectorOfMat_dst_const_int_X_fromTo_size_t_npairs(src.as_raw_VectorOfMat(), dst.as_raw_VectorOfMat(), from_to, npairs) }.into_result()
}
// identifier: cv_mixChannels_const_Mat_src_size_t_nsrcs_Mat_dst_size_t_ndsts_const_int_X_fromTo_size_t_npairs
/// Copies specified channels from input arrays to the specified channels of
/// output arrays.
///
/// The function cv::mixChannels provides an advanced mechanism for shuffling image channels.
///
/// cv::split,cv::merge,cv::extractChannel,cv::insertChannel and some forms of cv::cvtColor are partial cases of cv::mixChannels.
///
/// In the example below, the code splits a 4-channel BGRA image into a 3-channel BGR (with B and R
/// channels swapped) and a separate alpha-channel image:
/// ```ignore{.cpp}
/// Mat bgra( 100, 100, CV_8UC4, Scalar(255,0,0,255) );
/// Mat bgr( bgra.rows, bgra.cols, CV_8UC3 );
/// Mat alpha( bgra.rows, bgra.cols, CV_8UC1 );
///
/// // forming an array of matrices is a quite efficient operation,
/// // because the matrix data is not copied, only the headers
/// Mat out[] = { bgr, alpha };
/// // bgra[0] -> bgr[2], bgra[1] -> bgr[1],
/// // bgra[2] -> bgr[0], bgra[3] -> alpha[0]
/// int from_to[] = { 0,2, 1,1, 2,0, 3,3 };
/// mixChannels( &bgra, 1, out, 2, from_to, 4 );
/// ```
///
///
/// Note: Unlike many other new-style C++ functions in OpenCV (see the introduction section and
/// Mat::create ), cv::mixChannels requires the output arrays to be pre-allocated before calling the
/// function.
/// ## Parameters
/// * src: input array or vector of matrices; all of the matrices must have the same size and the
/// same depth.
/// * nsrcs: number of matrices in `src`.
/// * dst: output array or vector of matrices; all the matrices **must be allocated**; their size and
/// depth must be the same as in `src[0]`.
/// * ndsts: number of matrices in `dst`.
/// * fromTo: array of index pairs specifying which channels are copied and where; fromTo[k\*2] is
/// a 0-based index of the input channel in src, fromTo[k\*2+1] is an index of the output channel in
/// dst; the continuous channel numbering is used: the first input image channels are indexed from 0 to
/// src[0].channels()-1, the second input image channels are indexed from src[0].channels() to
/// src[0].channels() + src[1].channels()-1, and so on, the same scheme is used for the output image
/// channels; as a special case, when fromTo[k\*2] is negative, the corresponding output channel is
/// filled with zero .
/// * npairs: number of index pairs in `fromTo`.
/// @sa split, merge, extractChannel, insertChannel, cvtColor
pub fn mix_channels_2(src: &core::Mat, nsrcs: size_t, dst: &core::Mat, ndsts: size_t, from_to: &i32, npairs: size_t) -> Result<()> {
unsafe { sys::cv_core_cv_mixChannels_const_Mat_src_size_t_nsrcs_Mat_dst_size_t_ndsts_const_int_X_fromTo_size_t_npairs(src.as_raw_Mat(), nsrcs, dst.as_raw_Mat(), ndsts, from_to, npairs) }.into_result()
}
// identifier: cv_ml_createConcentricSpheresTestSet_int_nsamples_int_nfeatures_int_nclasses_Mat_samples_Mat_responses
/// Creates test set
pub fn create_concentric_spheres_test_set(nsamples: i32, nfeatures: i32, nclasses: i32, samples: &mut core::Mat, responses: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_ml_createConcentricSpheresTestSet_int_nsamples_int_nfeatures_int_nclasses_Mat_samples_Mat_responses(nsamples, nfeatures, nclasses, samples.as_raw_Mat(), responses.as_raw_Mat()) }.into_result()
}
// identifier: cv_ml_randMVNormal_Mat_mean_Mat_cov_int_nsamples_Mat_samples
/// Generates _sample_ from multivariate normal distribution
///
/// ## Parameters
/// * mean: an average row vector
/// * cov: symmetric covariation matrix
/// * nsamples: returned samples count
/// * samples: returned samples array
pub fn rand_mv_normal(mean: &core::Mat, cov: &core::Mat, nsamples: i32, samples: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_ml_randMVNormal_Mat_mean_Mat_cov_int_nsamples_Mat_samples(mean.as_raw_Mat(), cov.as_raw_Mat(), nsamples, samples.as_raw_Mat()) }.into_result()
}
// identifier: cv_moments_Mat_array_bool_binaryImage
/// Calculates all of the moments up to the third order of a polygon or rasterized shape.
///
/// The function computes moments, up to the 3rd order, of a vector shape or a rasterized shape. The
/// results are returned in the structure cv::Moments.
///
/// ## Parameters
/// * array: Raster image (single-channel, 8-bit or floating-point 2D array) or an array (
/// <span lang='latex'>1 \times N</span> or <span lang='latex'>N \times 1</span> ) of 2D points (Point or Point2f ).
/// * binaryImage: If it is true, all non-zero image pixels are treated as 1's. The parameter is
/// used for images only.
/// @returns moments.
///
///
/// Note: Only applicable to contour moments calculations from Python bindings: Note that the numpy
/// type for the input array should be either np.int32 or np.float32.
///
/// @sa contourArea, arcLength
///
/// ## C++ default parameters:
/// * binary_image: false
pub fn moments(array: &core::Mat, binary_image: bool) -> Result<core::Moments> {
unsafe { sys::cv_core_cv_moments_Mat_array_bool_binaryImage(array.as_raw_Mat(), binary_image) }.into_result()
}
// identifier: cv_morphologyDefaultBorderValue
pub fn morphology_default_border_value() -> Result<core::Scalar> {
unsafe { sys::cv_core_cv_morphologyDefaultBorderValue() }.into_result()
}
// identifier: cv_morphologyEx_Mat_src_Mat_dst_int_op_Mat_kernel_Point_anchor_int_iterations_int_borderType_Scalar_borderValue
/// Performs advanced morphological transformations.
///
/// The function cv::morphologyEx can perform advanced morphological transformations using an erosion and dilation as
/// basic operations.
///
/// Any of the operations can be done in-place. In case of multi-channel images, each channel is
/// processed independently.
///
/// ## Parameters
/// * src: Source image. The number of channels can be arbitrary. The depth should be one of
/// CV_8U, CV_16U, CV_16S, CV_32F or CV_64F.
/// * dst: Destination image of the same size and type as source image.
/// * op: Type of a morphological operation, see #MorphTypes
/// * kernel: Structuring element. It can be created using #getStructuringElement.
/// * anchor: Anchor position with the kernel. Negative values mean that the anchor is at the
/// kernel center.
/// * iterations: Number of times erosion and dilation are applied.
/// * borderType: Pixel extrapolation method, see #BorderTypes
/// * borderValue: Border value in case of a constant border. The default value has a special
/// meaning.
/// @sa dilate, erode, getStructuringElement
///
/// Note: The number of iterations is the number of times erosion or dilatation operation will be applied.
/// For instance, an opening operation (#MORPH_OPEN) with two iterations is equivalent to apply
/// successively: erode -> erode -> dilate -> dilate (and not erode -> dilate -> erode -> dilate).
///
/// ## C++ default parameters:
/// * anchor: Point(-1,-1)
/// * iterations: 1
/// * border_type: BORDER_CONSTANT
/// * border_value: morphologyDefaultBorderValue()
pub fn morphology_ex(src: &core::Mat, dst: &mut core::Mat, op: i32, kernel: &core::Mat, anchor: core::Point, iterations: i32, border_type: i32, border_value: core::Scalar) -> Result<()> {
unsafe { sys::cv_core_cv_morphologyEx_Mat_src_Mat_dst_int_op_Mat_kernel_Point_anchor_int_iterations_int_borderType_Scalar_borderValue(src.as_raw_Mat(), dst.as_raw_Mat(), op, kernel.as_raw_Mat(), anchor, iterations, border_type, border_value) }.into_result()
}
// identifier: cv_moveWindow_String_winname_int_x_int_y
/// Moves window to the specified position
///
/// ## Parameters
/// * winname: Name of the window.
/// * x: The new x-coordinate of the window.
/// * y: The new y-coordinate of the window.
pub fn move_window(winname: &str, x: i32, y: i32) -> Result<()> {
string_arg!(winname);
unsafe { sys::cv_core_cv_moveWindow_String_winname_int_x_int_y(winname.as_ptr(), x, y) }.into_result()
}
// identifier: cv_mulAdd_softdouble_a_softdouble_b_softdouble_c
pub fn mul_add(a: &core::softdouble, b: &core::softdouble, c: &core::softdouble) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_mulAdd_softdouble_a_softdouble_b_softdouble_c(a.as_raw_softdouble(), b.as_raw_softdouble(), c.as_raw_softdouble()) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_mulAdd_softfloat_a_softfloat_b_softfloat_c
/// Fused Multiplication and Addition
///
/// Computes (a*b)+c with single rounding
pub fn mul_add_1(a: &core::softfloat, b: &core::softfloat, c: &core::softfloat) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_mulAdd_softfloat_a_softfloat_b_softfloat_c(a.as_raw_softfloat(), b.as_raw_softfloat(), c.as_raw_softfloat()) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_mulSpectrums_Mat_a_Mat_b_Mat_c_int_flags_bool_conjB
/// Performs the per-element multiplication of two Fourier spectrums.
///
/// The function cv::mulSpectrums performs the per-element multiplication of the two CCS-packed or complex
/// matrices that are results of a real or complex Fourier transform.
///
/// The function, together with dft and idft , may be used to calculate convolution (pass conjB=false )
/// or correlation (pass conjB=true ) of two arrays rapidly. When the arrays are complex, they are
/// simply multiplied (per element) with an optional conjugation of the second-array elements. When the
/// arrays are real, they are assumed to be CCS-packed (see dft for details).
/// ## Parameters
/// * a: first input array.
/// * b: second input array of the same size and type as src1 .
/// * c: output array of the same size and type as src1 .
/// * flags: operation flags; currently, the only supported flag is cv::DFT_ROWS, which indicates that
/// each row of src1 and src2 is an independent 1D Fourier spectrum. If you do not want to use this flag, then simply add a `0` as value.
/// * conjB: optional flag that conjugates the second input array before the multiplication (true)
/// or not (false).
///
/// ## C++ default parameters:
/// * conj_b: false
pub fn mul_spectrums(a: &core::Mat, b: &core::Mat, c: &mut core::Mat, flags: i32, conj_b: bool) -> Result<()> {
unsafe { sys::cv_core_cv_mulSpectrums_Mat_a_Mat_b_Mat_c_int_flags_bool_conjB(a.as_raw_Mat(), b.as_raw_Mat(), c.as_raw_Mat(), flags, conj_b) }.into_result()
}
// identifier: cv_mulTransposed_Mat_src_Mat_dst_bool_aTa_Mat_delta_double_scale_int_dtype
/// Calculates the product of a matrix and its transposition.
///
/// The function cv::mulTransposed calculates the product of src and its
/// transposition:
/// <div lang='latex'>\texttt{dst} = \texttt{scale} ( \texttt{src} - \texttt{delta} )^T ( \texttt{src} - \texttt{delta} )</div>
/// if aTa=true , and
/// <div lang='latex'>\texttt{dst} = \texttt{scale} ( \texttt{src} - \texttt{delta} ) ( \texttt{src} - \texttt{delta} )^T</div>
/// otherwise. The function is used to calculate the covariance matrix. With
/// zero delta, it can be used as a faster substitute for general matrix
/// product A\*B when B=A'
/// ## Parameters
/// * src: input single-channel matrix. Note that unlike gemm, the
/// function can multiply not only floating-point matrices.
/// * dst: output square matrix.
/// * aTa: Flag specifying the multiplication ordering. See the
/// description below.
/// * delta: Optional delta matrix subtracted from src before the
/// multiplication. When the matrix is empty ( delta=noArray() ), it is
/// assumed to be zero, that is, nothing is subtracted. If it has the same
/// size as src , it is simply subtracted. Otherwise, it is "repeated" (see
/// repeat ) to cover the full src and then subtracted. Type of the delta
/// matrix, when it is not empty, must be the same as the type of created
/// output matrix. See the dtype parameter description below.
/// * scale: Optional scale factor for the matrix product.
/// * dtype: Optional type of the output matrix. When it is negative,
/// the output matrix will have the same type as src . Otherwise, it will be
/// type=CV_MAT_DEPTH(dtype) that should be either CV_32F or CV_64F .
/// @sa calcCovarMatrix, gemm, repeat, reduce
///
/// ## C++ default parameters:
/// * delta: noArray()
/// * scale: 1
/// * dtype: -1
pub fn mul_transposed(src: &core::Mat, dst: &mut core::Mat, a_ta: bool, delta: &core::Mat, scale: f64, dtype: i32) -> Result<()> {
unsafe { sys::cv_core_cv_mulTransposed_Mat_src_Mat_dst_bool_aTa_Mat_delta_double_scale_int_dtype(src.as_raw_Mat(), dst.as_raw_Mat(), a_ta, delta.as_raw_Mat(), scale, dtype) }.into_result()
}
// identifier: cv_multiply_Mat_src1_Mat_src2_Mat_dst_double_scale_int_dtype
/// Calculates the per-element scaled product of two arrays.
///
/// The function multiply calculates the per-element product of two arrays:
///
/// <div lang='latex'>\texttt{dst} (I)= \texttt{saturate} ( \texttt{scale} \cdot \texttt{src1} (I) \cdot \texttt{src2} (I))</div>
///
/// There is also a @ref MatrixExpressions -friendly variant of the first function. See Mat::mul .
///
/// For a not-per-element matrix product, see gemm .
///
///
/// Note: Saturation is not applied when the output array has the depth
/// CV_32S. You may even get result of an incorrect sign in the case of
/// overflow.
/// ## Parameters
/// * src1: first input array.
/// * src2: second input array of the same size and the same type as src1.
/// * dst: output array of the same size and type as src1.
/// * scale: optional scale factor.
/// * dtype: optional depth of the output array
/// @sa add, subtract, divide, scaleAdd, addWeighted, accumulate, accumulateProduct, accumulateSquare,
/// Mat::convertTo
///
/// ## C++ default parameters:
/// * scale: 1
/// * dtype: -1
pub fn multiply(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat, scale: f64, dtype: i32) -> Result<()> {
unsafe { sys::cv_core_cv_multiply_Mat_src1_Mat_src2_Mat_dst_double_scale_int_dtype(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), scale, dtype) }.into_result()
}
// identifier: cv_namedWindow_String_winname_int_flags
/// Creates a window.
///
/// The function namedWindow creates a window that can be used as a placeholder for images and
/// trackbars. Created windows are referred to by their names.
///
/// If a window with the same name already exists, the function does nothing.
///
/// You can call cv::destroyWindow or cv::destroyAllWindows to close the window and de-allocate any associated
/// memory usage. For a simple program, you do not really have to call these functions because all the
/// resources and windows of the application are closed automatically by the operating system upon exit.
///
///
/// Note:
///
/// Qt backend supports additional flags:
/// * **WINDOW_NORMAL or WINDOW_AUTOSIZE:** WINDOW_NORMAL enables you to resize the
/// window, whereas WINDOW_AUTOSIZE adjusts automatically the window size to fit the
/// displayed image (see imshow ), and you cannot change the window size manually.
/// * **WINDOW_FREERATIO or WINDOW_KEEPRATIO:** WINDOW_FREERATIO adjusts the image
/// with no respect to its ratio, whereas WINDOW_KEEPRATIO keeps the image ratio.
/// * **WINDOW_GUI_NORMAL or WINDOW_GUI_EXPANDED:** WINDOW_GUI_NORMAL is the old way to draw the window
/// without statusbar and toolbar, whereas WINDOW_GUI_EXPANDED is a new enhanced GUI.
/// By default, flags == WINDOW_AUTOSIZE | WINDOW_KEEPRATIO | WINDOW_GUI_EXPANDED
///
/// ## Parameters
/// * winname: Name of the window in the window caption that may be used as a window identifier.
/// * flags: Flags of the window. The supported flags are: (cv::WindowFlags)
///
/// ## C++ default parameters:
/// * flags: WINDOW_AUTOSIZE
pub fn named_window(winname: &str, flags: i32) -> Result<()> {
string_arg!(winname);
unsafe { sys::cv_core_cv_namedWindow_String_winname_int_flags(winname.as_ptr(), flags) }.into_result()
}
// identifier: cv_normL1_const_float_X_a_const_float_X_b_int_n
pub fn norm_l1(a: &f32, b: &f32, n: i32) -> Result<f32> {
unsafe { sys::cv_core_cv_normL1_const_float_X_a_const_float_X_b_int_n(a, b, n) }.into_result()
}
// identifier: cv_normL1_const_uchar_X_a_const_uchar_X_b_int_n
pub fn norm_l2(a: &u8, b: &u8, n: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_normL1_const_uchar_X_a_const_uchar_X_b_int_n(a, b, n) }.into_result()
}
// identifier: cv_normL2Sqr_const_float_X_a_const_float_X_b_int_n
pub fn norm_l2_sqr(a: &f32, b: &f32, n: i32) -> Result<f32> {
unsafe { sys::cv_core_cv_normL2Sqr_const_float_X_a_const_float_X_b_int_n(a, b, n) }.into_result()
}
// identifier: cv_norm_Mat_src1_Mat_src2_int_normType_Mat_mask
/// Calculates an absolute difference norm or a relative difference norm.
///
/// This version of cv::norm calculates the absolute difference norm
/// or the relative difference norm of arrays src1 and src2.
/// The type of norm to calculate is specified using #NormTypes.
///
/// ## Parameters
/// * src1: first input array.
/// * src2: second input array of the same size and the same type as src1.
/// * normType: type of the norm (see #NormTypes).
/// * mask: optional operation mask; it must have the same size as src1 and CV_8UC1 type.
///
/// ## C++ default parameters:
/// * norm_type: NORM_L2
/// * mask: noArray()
pub fn norm_with_type(src1: &core::Mat, src2: &core::Mat, norm_type: i32, mask: &core::Mat) -> Result<f64> {
unsafe { sys::cv_core_cv_norm_Mat_src1_Mat_src2_int_normType_Mat_mask(src1.as_raw_Mat(), src2.as_raw_Mat(), norm_type, mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_norm_Mat_src1_int_normType_Mat_mask
/// Calculates the absolute norm of an array.
///
/// This version of #norm calculates the absolute norm of src1. The type of norm to calculate is specified using #NormTypes.
///
/// As example for one array consider the function <span lang='latex'>r(x)= \begin{pmatrix} x \\ 1-x \end{pmatrix}, x \in [-1;1]</span>.
/// The <span lang='latex'> L_{1}, L_{2} </span> and <span lang='latex'> L_{\infty} </span> norm for the sample value <span lang='latex'>r(-1) = \begin{pmatrix} -1 \\ 2 \end{pmatrix}</span>
/// is calculated as follows
/// \f{align*}
/// \| r(-1) \|_{L_1} &= |-1| + |2| = 3 \\
/// \| r(-1) \|_{L_2} &= \sqrt{(-1)^{2} + (2)^{2}} = \sqrt{5} \\
/// \| r(-1) \|_{L_\infty} &= \max(|-1|,|2|) = 2
/// \f}
/// and for <span lang='latex'>r(0.5) = \begin{pmatrix} 0.5 \\ 0.5 \end{pmatrix}</span> the calculation is
/// \f{align*}
/// \| r(0.5) \|_{L_1} &= |0.5| + |0.5| = 1 \\
/// \| r(0.5) \|_{L_2} &= \sqrt{(0.5)^{2} + (0.5)^{2}} = \sqrt{0.5} \\
/// \| r(0.5) \|_{L_\infty} &= \max(|0.5|,|0.5|) = 0.5.
/// \f}
/// The following graphic shows all values for the three norm functions <span lang='latex'>\| r(x) \|_{L_1}, \| r(x) \|_{L_2}</span> and <span lang='latex'>\| r(x) \|_{L_\infty}</span>.
/// It is notable that the <span lang='latex'> L_{1} </span> norm forms the upper and the <span lang='latex'> L_{\infty} </span> norm forms the lower border for the example function <span lang='latex'> r(x) </span>.
/// 
///
/// When the mask parameter is specified and it is not empty, the norm is
///
/// If normType is not specified, #NORM_L2 is used.
/// calculated only over the region specified by the mask.
///
/// Multi-channel input arrays are treated as single-channel arrays, that is,
/// the results for all channels are combined.
///
/// Hamming norms can only be calculated with CV_8U depth arrays.
///
/// ## Parameters
/// * src1: first input array.
/// * normType: type of the norm (see #NormTypes).
/// * mask: optional operation mask; it must have the same size as src1 and CV_8UC1 type.
///
/// ## C++ default parameters:
/// * norm_type: NORM_L2
/// * mask: noArray()
pub fn norm(src1: &core::Mat, norm_type: i32, mask: &core::Mat) -> Result<f64> {
unsafe { sys::cv_core_cv_norm_Mat_src1_int_normType_Mat_mask(src1.as_raw_Mat(), norm_type, mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_normalize_Mat_src_Mat_dst_double_alpha_double_beta_int_norm_type_int_dtype_Mat_mask
/// Normalizes the norm or value range of an array.
///
/// The function cv::normalize normalizes scale and shift the input array elements so that
/// <div lang='latex'>\| \texttt{dst} \| _{L_p}= \texttt{alpha}</div>
/// (where p=Inf, 1 or 2) when normType=NORM_INF, NORM_L1, or NORM_L2, respectively; or so that
/// <div lang='latex'>\min _I \texttt{dst} (I)= \texttt{alpha} , \, \, \max _I \texttt{dst} (I)= \texttt{beta}</div>
///
/// when normType=NORM_MINMAX (for dense arrays only). The optional mask specifies a sub-array to be
/// normalized. This means that the norm or min-n-max are calculated over the sub-array, and then this
/// sub-array is modified to be normalized. If you want to only use the mask to calculate the norm or
/// min-max but modify the whole array, you can use norm and Mat::convertTo.
///
/// In case of sparse matrices, only the non-zero values are analyzed and transformed. Because of this,
/// the range transformation for sparse matrices is not allowed since it can shift the zero level.
///
/// Possible usage with some positive example data:
/// ```ignore{.cpp}
/// vector<double> positiveData = { 2.0, 8.0, 10.0 };
/// vector<double> normalizedData_l1, normalizedData_l2, normalizedData_inf, normalizedData_minmax;
///
/// // Norm to probability (total count)
/// // sum(numbers) = 20.0
/// // 2.0 0.1 (2.0/20.0)
/// // 8.0 0.4 (8.0/20.0)
/// // 10.0 0.5 (10.0/20.0)
/// normalize(positiveData, normalizedData_l1, 1.0, 0.0, NORM_L1);
///
/// // Norm to unit vector: ||positiveData|| = 1.0
/// // 2.0 0.15
/// // 8.0 0.62
/// // 10.0 0.77
/// normalize(positiveData, normalizedData_l2, 1.0, 0.0, NORM_L2);
///
/// // Norm to max element
/// // 2.0 0.2 (2.0/10.0)
/// // 8.0 0.8 (8.0/10.0)
/// // 10.0 1.0 (10.0/10.0)
/// normalize(positiveData, normalizedData_inf, 1.0, 0.0, NORM_INF);
///
/// // Norm to range [0.0;1.0]
/// // 2.0 0.0 (shift to left border)
/// // 8.0 0.75 (6.0/8.0)
/// // 10.0 1.0 (shift to right border)
/// normalize(positiveData, normalizedData_minmax, 1.0, 0.0, NORM_MINMAX);
/// ```
///
///
/// ## Parameters
/// * src: input array.
/// * dst: output array of the same size as src .
/// * alpha: norm value to normalize to or the lower range boundary in case of the range
/// normalization.
/// * beta: upper range boundary in case of the range normalization; it is not used for the norm
/// normalization.
/// * norm_type: normalization type (see cv::NormTypes).
/// * dtype: when negative, the output array has the same type as src; otherwise, it has the same
/// number of channels as src and the depth =CV_MAT_DEPTH(dtype).
/// * mask: optional operation mask.
/// @sa norm, Mat::convertTo, SparseMat::convertTo
///
/// ## C++ default parameters:
/// * alpha: 1
/// * beta: 0
/// * norm_type: NORM_L2
/// * dtype: -1
/// * mask: noArray()
pub fn normalize(src: &core::Mat, dst: &mut core::Mat, alpha: f64, beta: f64, norm_type: i32, dtype: i32, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_normalize_Mat_src_Mat_dst_double_alpha_double_beta_int_norm_type_int_dtype_Mat_mask(src.as_raw_Mat(), dst.as_raw_Mat(), alpha, beta, norm_type, dtype, mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_parallel_for__Range_range_ParallelLoopBody_body_double_nstripes
/// Parallel data processor
///
/// ## C++ default parameters:
/// * nstripes: -1.
pub fn parallel_for_(range: &core::Range, body: &core::ParallelLoopBody, nstripes: f64) -> Result<()> {
unsafe { sys::cv_core_cv_parallel_for__Range_range_ParallelLoopBody_body_double_nstripes(range.as_raw_Range(), body.as_raw_ParallelLoopBody(), nstripes) }.into_result()
}
// identifier: cv_patchNaNs_Mat_a_double_val
/// converts NaN's to the given number
///
/// ## C++ default parameters:
/// * val: 0
pub fn patch_na_ns(a: &mut core::Mat, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_patchNaNs_Mat_a_double_val(a.as_raw_Mat(), val) }.into_result()
}
// identifier: cv_pencilSketch_Mat_src_Mat_dst1_Mat_dst2_float_sigma_s_float_sigma_r_float_shade_factor
/// Pencil-like non-photorealistic line drawing
///
/// ## Parameters
/// * src: Input 8-bit 3-channel image.
/// * dst1: Output 8-bit 1-channel image.
/// * dst2: Output image with the same size and type as src.
/// * sigma_s: Range between 0 to 200.
/// * sigma_r: Range between 0 to 1.
/// * shade_factor: Range between 0 to 0.1.
///
/// ## C++ default parameters:
/// * sigma_s: 60
/// * sigma_r: 0.07f
/// * shade_factor: 0.02f
pub fn pencil_sketch(src: &core::Mat, dst1: &mut core::Mat, dst2: &mut core::Mat, sigma_s: f32, sigma_r: f32, shade_factor: f32) -> Result<()> {
unsafe { sys::cv_core_cv_pencilSketch_Mat_src_Mat_dst1_Mat_dst2_float_sigma_s_float_sigma_r_float_shade_factor(src.as_raw_Mat(), dst1.as_raw_Mat(), dst2.as_raw_Mat(), sigma_s, sigma_r, shade_factor) }.into_result()
}
// identifier: cv_perspectiveTransform_Mat_src_Mat_dst_Mat_m
/// Performs the perspective matrix transformation of vectors.
///
/// The function cv::perspectiveTransform transforms every element of src by
/// treating it as a 2D or 3D vector, in the following way:
/// <div lang='latex'>(x, y, z) \rightarrow (x'/w, y'/w, z'/w)</div>
/// where
/// <div lang='latex'>(x', y', z', w') = \texttt{mat} \cdot \begin{bmatrix} x & y & z & 1 \end{bmatrix}</div>
/// and
/// <div lang='latex'>w = \fork{w'}{if \(w' \ne 0\)}{\infty}{otherwise}</div>
///
/// Here a 3D vector transformation is shown. In case of a 2D vector
/// transformation, the z component is omitted.
///
///
/// Note: The function transforms a sparse set of 2D or 3D vectors. If you
/// want to transform an image using perspective transformation, use
/// warpPerspective . If you have an inverse problem, that is, you want to
/// compute the most probable perspective transformation out of several
/// pairs of corresponding points, you can use getPerspectiveTransform or
/// findHomography .
/// ## Parameters
/// * src: input two-channel or three-channel floating-point array; each
/// element is a 2D/3D vector to be transformed.
/// * dst: output array of the same size and type as src.
/// * m: 3x3 or 4x4 floating-point transformation matrix.
/// @sa transform, warpPerspective, getPerspectiveTransform, findHomography
pub fn perspective_transform(src: &core::Mat, dst: &mut core::Mat, m: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_perspectiveTransform_Mat_src_Mat_dst_Mat_m(src.as_raw_Mat(), dst.as_raw_Mat(), m.as_raw_Mat()) }.into_result()
}
// identifier: cv_phaseCorrelate_Mat_src1_Mat_src2_Mat_window_double_X_response
/// The function is used to detect translational shifts that occur between two images.
///
/// The operation takes advantage of the Fourier shift theorem for detecting the translational shift in
/// the frequency domain. It can be used for fast image registration as well as motion estimation. For
/// more information please see <http://en.wikipedia.org/wiki/Phase_correlation>
///
/// Calculates the cross-power spectrum of two supplied source arrays. The arrays are padded if needed
/// with getOptimalDFTSize.
///
/// The function performs the following equations:
/// - First it applies a Hanning window (see <http://en.wikipedia.org/wiki/Hann_function>) to each
/// image to remove possible edge effects. This window is cached until the array size changes to speed
/// up processing time.
/// - Next it computes the forward DFTs of each source array:
/// <div lang='latex'>\mathbf{G}_a = \mathcal{F}\{src_1\}, \; \mathbf{G}_b = \mathcal{F}\{src_2\}</div>
/// where <span lang='latex'>\mathcal{F}</span> is the forward DFT.
/// - It then computes the cross-power spectrum of each frequency domain array:
/// <div lang='latex'>R = \frac{ \mathbf{G}_a \mathbf{G}_b^*}{|\mathbf{G}_a \mathbf{G}_b^*|}</div>
/// - Next the cross-correlation is converted back into the time domain via the inverse DFT:
/// <div lang='latex'>r = \mathcal{F}^{-1}\{R\}</div>
/// - Finally, it computes the peak location and computes a 5x5 weighted centroid around the peak to
/// achieve sub-pixel accuracy.
/// <div lang='latex'>(\Delta x, \Delta y) = \texttt{weightedCentroid} \{\arg \max_{(x, y)}\{r\}\}</div>
/// - If non-zero, the response parameter is computed as the sum of the elements of r within the 5x5
/// centroid around the peak location. It is normalized to a maximum of 1 (meaning there is a single
/// peak) and will be smaller when there are multiple peaks.
///
/// ## Parameters
/// * src1: Source floating point array (CV_32FC1 or CV_64FC1)
/// * src2: Source floating point array (CV_32FC1 or CV_64FC1)
/// * window: Floating point array with windowing coefficients to reduce edge effects (optional).
/// * response: Signal power within the 5x5 centroid around the peak, between 0 and 1 (optional).
/// @returns detected phase shift (sub-pixel) between the two arrays.
///
/// @sa dft, getOptimalDFTSize, idft, mulSpectrums createHanningWindow
///
/// ## C++ default parameters:
/// * window: noArray()
/// * response: 0
pub fn phase_correlate(src1: &core::Mat, src2: &core::Mat, window: &core::Mat, response: &mut f64) -> Result<core::Point2d> {
unsafe { sys::cv_core_cv_phaseCorrelate_Mat_src1_Mat_src2_Mat_window_double_X_response(src1.as_raw_Mat(), src2.as_raw_Mat(), window.as_raw_Mat(), response) }.into_result()
}
// identifier: cv_phase_Mat_x_Mat_y_Mat_angle_bool_angleInDegrees
/// Calculates the rotation angle of 2D vectors.
///
/// The function cv::phase calculates the rotation angle of each 2D vector that
/// is formed from the corresponding elements of x and y :
/// <div lang='latex'>\texttt{angle} (I) = \texttt{atan2} ( \texttt{y} (I), \texttt{x} (I))</div>
///
/// The angle estimation accuracy is about 0.3 degrees. When x(I)=y(I)=0 ,
/// the corresponding angle(I) is set to 0.
/// ## Parameters
/// * x: input floating-point array of x-coordinates of 2D vectors.
/// * y: input array of y-coordinates of 2D vectors; it must have the
/// same size and the same type as x.
/// * angle: output array of vector angles; it has the same size and
/// same type as x .
/// * angleInDegrees: when true, the function calculates the angle in
/// degrees, otherwise, they are measured in radians.
///
/// ## C++ default parameters:
/// * angle_in_degrees: false
pub fn phase(x: &core::Mat, y: &core::Mat, angle: &mut core::Mat, angle_in_degrees: bool) -> Result<()> {
unsafe { sys::cv_core_cv_phase_Mat_x_Mat_y_Mat_angle_bool_angleInDegrees(x.as_raw_Mat(), y.as_raw_Mat(), angle.as_raw_Mat(), angle_in_degrees) }.into_result()
}
// identifier: cv_pointPolygonTest_Mat_contour_Point2f_pt_bool_measureDist
/// Performs a point-in-contour test.
///
/// The function determines whether the point is inside a contour, outside, or lies on an edge (or
/// coincides with a vertex). It returns positive (inside), negative (outside), or zero (on an edge)
/// value, correspondingly. When measureDist=false , the return value is +1, -1, and 0, respectively.
/// Otherwise, the return value is a signed distance between the point and the nearest contour edge.
///
/// See below a sample output of the function where each image pixel is tested against the contour:
///
/// 
///
/// ## Parameters
/// * contour: Input contour.
/// * pt: Point tested against the contour.
/// * measureDist: If true, the function estimates the signed distance from the point to the
/// nearest contour edge. Otherwise, the function only checks if the point is inside a contour or not.
pub fn point_polygon_test(contour: &core::Mat, pt: core::Point2f, measure_dist: bool) -> Result<f64> {
unsafe { sys::cv_core_cv_pointPolygonTest_Mat_contour_Point2f_pt_bool_measureDist(contour.as_raw_Mat(), pt, measure_dist) }.into_result()
}
// identifier: cv_polarToCart_Mat_magnitude_Mat_angle_Mat_x_Mat_y_bool_angleInDegrees
/// Calculates x and y coordinates of 2D vectors from their magnitude and angle.
///
/// The function cv::polarToCart calculates the Cartesian coordinates of each 2D
/// vector represented by the corresponding elements of magnitude and angle:
/// <div lang='latex'>\begin{array}{l} \texttt{x} (I) = \texttt{magnitude} (I) \cos ( \texttt{angle} (I)) \\ \texttt{y} (I) = \texttt{magnitude} (I) \sin ( \texttt{angle} (I)) \\ \end{array}</div>
///
/// The relative accuracy of the estimated coordinates is about 1e-6.
/// ## Parameters
/// * magnitude: input floating-point array of magnitudes of 2D vectors;
/// it can be an empty matrix (=Mat()), in this case, the function assumes
/// that all the magnitudes are =1; if it is not empty, it must have the
/// same size and type as angle.
/// * angle: input floating-point array of angles of 2D vectors.
/// * x: output array of x-coordinates of 2D vectors; it has the same
/// size and type as angle.
/// * y: output array of y-coordinates of 2D vectors; it has the same
/// size and type as angle.
/// * angleInDegrees: when true, the input angles are measured in
/// degrees, otherwise, they are measured in radians.
/// @sa cartToPolar, magnitude, phase, exp, log, pow, sqrt
///
/// ## C++ default parameters:
/// * angle_in_degrees: false
pub fn polar_to_cart(magnitude: &core::Mat, angle: &core::Mat, x: &mut core::Mat, y: &mut core::Mat, angle_in_degrees: bool) -> Result<()> {
unsafe { sys::cv_core_cv_polarToCart_Mat_magnitude_Mat_angle_Mat_x_Mat_y_bool_angleInDegrees(magnitude.as_raw_Mat(), angle.as_raw_Mat(), x.as_raw_Mat(), y.as_raw_Mat(), angle_in_degrees) }.into_result()
}
// identifier: cv_polylines_Mat_img_VectorOfMat_pts_bool_isClosed_Scalar_color_int_thickness_int_lineType_int_shift
/// Draws several polygonal curves.
///
/// ## Parameters
/// * img: Image.
/// * pts: Array of polygonal curves.
/// * isClosed: Flag indicating whether the drawn polylines are closed or not. If they are closed,
/// the function draws a line from the last vertex of each curve to its first vertex.
/// * color: Polyline color.
/// * thickness: Thickness of the polyline edges.
/// * lineType: Type of the line segments. See #LineTypes
/// * shift: Number of fractional bits in the vertex coordinates.
///
/// The function cv::polylines draws one or more polygonal curves.
///
/// ## C++ default parameters:
/// * thickness: 1
/// * line_type: LINE_8
/// * shift: 0
pub fn polylines(img: &mut core::Mat, pts: &types::VectorOfMat, is_closed: bool, color: core::Scalar, thickness: i32, line_type: i32, shift: i32) -> Result<()> {
unsafe { sys::cv_core_cv_polylines_Mat_img_VectorOfMat_pts_bool_isClosed_Scalar_color_int_thickness_int_lineType_int_shift(img.as_raw_Mat(), pts.as_raw_VectorOfMat(), is_closed, color, thickness, line_type, shift) }.into_result()
}
// identifier: cv_pow_Mat_src_double_power_Mat_dst
/// Raises every array element to a power.
///
/// The function cv::pow raises every element of the input array to power :
/// <div lang='latex'>\texttt{dst} (I) = \fork{\texttt{src}(I)^{power}}{if \(\texttt{power}\) is integer}{|\texttt{src}(I)|^{power}}{otherwise}</div>
///
/// So, for a non-integer power exponent, the absolute values of input array
/// elements are used. However, it is possible to get true values for
/// negative values using some extra operations. In the example below,
/// computing the 5th root of array src shows:
/// ```ignore{.cpp}
/// Mat mask = src < 0;
/// pow(src, 1./5, dst);
/// subtract(Scalar::all(0), dst, dst, mask);
/// ```
///
/// For some values of power, such as integer values, 0.5 and -0.5,
/// specialized faster algorithms are used.
///
/// Special values (NaN, Inf) are not handled.
/// ## Parameters
/// * src: input array.
/// * power: exponent of power.
/// * dst: output array of the same size and type as src.
/// @sa sqrt, exp, log, cartToPolar, polarToCart
pub fn pow(src: &core::Mat, power: f64, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_pow_Mat_src_double_power_Mat_dst(src.as_raw_Mat(), power, dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_pow_softdouble_a_softdouble_b
pub fn pow_1(a: &core::softdouble, b: &core::softdouble) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_pow_softdouble_a_softdouble_b(a.as_raw_softdouble(), b.as_raw_softdouble()) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_pow_softfloat_a_softfloat_b
/// Raising to the power
///
/// Special cases:
/// - x**NaN is NaN for any x
/// - ( |x| == 1 )**Inf is NaN
/// - ( |x| > 1 )**+Inf or ( |x| < 1 )**-Inf is +Inf
/// - ( |x| > 1 )**-Inf or ( |x| < 1 )**+Inf is 0
/// - x ** 0 == 1 for any x
/// - x ** 1 == 1 for any x
/// - NaN ** y is NaN for any other y
/// - Inf**(y < 0) == 0
/// - Inf ** y is +Inf for any other y
/// - (x < 0)**y is NaN for any other y if x can't be correctly rounded to integer
/// - 0 ** 0 == 1
/// - 0 ** (y < 0) is +Inf
/// - 0 ** (y > 0) is 0
pub fn pow_2(a: &core::softfloat, b: &core::softfloat) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_pow_softfloat_a_softfloat_b(a.as_raw_softfloat(), b.as_raw_softfloat()) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_preCornerDetect_Mat_src_Mat_dst_int_ksize_int_borderType
/// Calculates a feature map for corner detection.
///
/// The function calculates the complex spatial derivative-based function of the source image
///
/// <div lang='latex'>\texttt{dst} = (D_x \texttt{src} )^2 \cdot D_{yy} \texttt{src} + (D_y \texttt{src} )^2 \cdot D_{xx} \texttt{src} - 2 D_x \texttt{src} \cdot D_y \texttt{src} \cdot D_{xy} \texttt{src}</div>
///
/// where <span lang='latex'>D_x</span>,<span lang='latex'>D_y</span> are the first image derivatives, <span lang='latex'>D_{xx}</span>,<span lang='latex'>D_{yy}</span> are the second image
/// derivatives, and <span lang='latex'>D_{xy}</span> is the mixed derivative.
///
/// The corners can be found as local maximums of the functions, as shown below:
/// ```ignore
/// Mat corners, dilated_corners;
/// preCornerDetect(image, corners, 3);
/// // dilation with 3x3 rectangular structuring element
/// dilate(corners, dilated_corners, Mat(), 1);
/// Mat corner_mask = corners == dilated_corners;
/// ```
///
///
/// ## Parameters
/// * src: Source single-channel 8-bit of floating-point image.
/// * dst: Output image that has the type CV_32F and the same size as src .
/// * ksize: %Aperture size of the Sobel .
/// * borderType: Pixel extrapolation method. See #BorderTypes.
///
/// ## C++ default parameters:
/// * border_type: BORDER_DEFAULT
pub fn pre_corner_detect(src: &core::Mat, dst: &mut core::Mat, ksize: i32, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_preCornerDetect_Mat_src_Mat_dst_int_ksize_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ksize, border_type) }.into_result()
}
// identifier: cv_projectPoints_Mat_objectPoints_Mat_rvec_Mat_tvec_Mat_cameraMatrix_Mat_distCoeffs_Mat_imagePoints_Mat_jacobian_double_aspectRatio
/// Projects 3D points to an image plane.
///
/// ## Parameters
/// * objectPoints: Array of object points, 3xN/Nx3 1-channel or 1xN/Nx1 3-channel (or
/// vector\<Point3f\> ), where N is the number of points in the view.
/// * rvec: Rotation vector. See Rodrigues for details.
/// * tvec: Translation vector.
/// * cameraMatrix: Camera matrix <span lang='latex'>A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{_1}</span> .
/// * distCoeffs: Input vector of distortion coefficients
/// <span lang='latex'>(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])</span> of
/// 4, 5, 8, 12 or 14 elements. If the vector is empty, the zero distortion coefficients are assumed.
/// * imagePoints: Output array of image points, 2xN/Nx2 1-channel or 1xN/Nx1 2-channel, or
/// vector\<Point2f\> .
/// * jacobian: Optional output 2Nx(10+\<numDistCoeffs\>) jacobian matrix of derivatives of image
/// points with respect to components of the rotation vector, translation vector, focal lengths,
/// coordinates of the principal point and the distortion coefficients. In the old interface different
/// components of the jacobian are returned via different output parameters.
/// * aspectRatio: Optional "fixed aspect ratio" parameter. If the parameter is not 0, the
/// function assumes that the aspect ratio (*fx/fy*) is fixed and correspondingly adjusts the jacobian
/// matrix.
///
/// The function computes projections of 3D points to the image plane given intrinsic and extrinsic
/// camera parameters. Optionally, the function computes Jacobians - matrices of partial derivatives of
/// image points coordinates (as functions of all the input parameters) with respect to the particular
/// parameters, intrinsic and/or extrinsic. The Jacobians are used during the global optimization in
/// calibrateCamera, solvePnP, and stereoCalibrate . The function itself can also be used to compute a
/// re-projection error given the current intrinsic and extrinsic parameters.
///
///
/// Note: By setting rvec=tvec=(0,0,0) or by setting cameraMatrix to a 3x3 identity matrix, or by
/// passing zero distortion coefficients, you can get various useful partial cases of the function. This
/// means that you can compute the distorted coordinates for a sparse set of points or apply a
/// perspective transformation (and also compute the derivatives) in the ideal zero-distortion setup.
///
/// ## C++ default parameters:
/// * jacobian: noArray()
/// * aspect_ratio: 0
pub fn project_points(object_points: &core::Mat, rvec: &core::Mat, tvec: &core::Mat, camera_matrix: &core::Mat, dist_coeffs: &core::Mat, image_points: &mut core::Mat, jacobian: &mut core::Mat, aspect_ratio: f64) -> Result<()> {
unsafe { sys::cv_core_cv_projectPoints_Mat_objectPoints_Mat_rvec_Mat_tvec_Mat_cameraMatrix_Mat_distCoeffs_Mat_imagePoints_Mat_jacobian_double_aspectRatio(object_points.as_raw_Mat(), rvec.as_raw_Mat(), tvec.as_raw_Mat(), camera_matrix.as_raw_Mat(), dist_coeffs.as_raw_Mat(), image_points.as_raw_Mat(), jacobian.as_raw_Mat(), aspect_ratio) }.into_result()
}
// identifier: cv_putText_Mat_img_String_text_Point_org_int_fontFace_double_fontScale_Scalar_color_int_thickness_int_lineType_bool_bottomLeftOrigin
/// Draws a text string.
///
/// The function cv::putText renders the specified text string in the image. Symbols that cannot be rendered
/// using the specified font are replaced by question marks. See #getTextSize for a text rendering code
/// example.
///
/// ## Parameters
/// * img: Image.
/// * text: Text string to be drawn.
/// * org: Bottom-left corner of the text string in the image.
/// * fontFace: Font type, see #HersheyFonts.
/// * fontScale: Font scale factor that is multiplied by the font-specific base size.
/// * color: Text color.
/// * thickness: Thickness of the lines used to draw a text.
/// * lineType: Line type. See #LineTypes
/// * bottomLeftOrigin: When true, the image data origin is at the bottom-left corner. Otherwise,
/// it is at the top-left corner.
///
/// ## C++ default parameters:
/// * thickness: 1
/// * line_type: LINE_8
/// * bottom_left_origin: false
pub fn put_text(img: &mut core::Mat, text: &str, org: core::Point, font_face: i32, font_scale: f64, color: core::Scalar, thickness: i32, line_type: i32, bottom_left_origin: bool) -> Result<()> {
string_arg!(text);
unsafe { sys::cv_core_cv_putText_Mat_img_String_text_Point_org_int_fontFace_double_fontScale_Scalar_color_int_thickness_int_lineType_bool_bottomLeftOrigin(img.as_raw_Mat(), text.as_ptr(), org, font_face, font_scale, color, thickness, line_type, bottom_left_origin) }.into_result()
}
// identifier: cv_pyrDown_Mat_src_Mat_dst_Size_dstsize_int_borderType
/// Blurs an image and downsamples it.
///
/// By default, size of the output image is computed as `Size((src.cols+1)/2, (src.rows+1)/2)`, but in
/// any case, the following conditions should be satisfied:
///
/// <div lang='latex'>\begin{array}{l} | \texttt{dstsize.width} *2-src.cols| \leq 2 \\ | \texttt{dstsize.height} *2-src.rows| \leq 2 \end{array}</div>
///
/// The function performs the downsampling step of the Gaussian pyramid construction. First, it
/// convolves the source image with the kernel:
///
/// <div lang='latex'>\frac{1}{256} \begin{bmatrix} 1 & 4 & 6 & 4 & 1 \\ 4 & 16 & 24 & 16 & 4 \\ 6 & 24 & 36 & 24 & 6 \\ 4 & 16 & 24 & 16 & 4 \\ 1 & 4 & 6 & 4 & 1 \end{bmatrix}</div>
///
/// Then, it downsamples the image by rejecting even rows and columns.
///
/// ## Parameters
/// * src: input image.
/// * dst: output image; it has the specified size and the same type as src.
/// * dstsize: size of the output image.
/// * borderType: Pixel extrapolation method, see #BorderTypes (#BORDER_CONSTANT isn't supported)
///
/// ## C++ default parameters:
/// * dstsize: Size()
/// * border_type: BORDER_DEFAULT
pub fn pyr_down(src: &core::Mat, dst: &mut core::Mat, dstsize: core::Size, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_pyrDown_Mat_src_Mat_dst_Size_dstsize_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), dstsize, border_type) }.into_result()
}
// identifier: cv_pyrMeanShiftFiltering_Mat_src_Mat_dst_double_sp_double_sr_int_maxLevel_TermCriteria_termcrit
/// Performs initial step of meanshift segmentation of an image.
///
/// The function implements the filtering stage of meanshift segmentation, that is, the output of the
/// function is the filtered "posterized" image with color gradients and fine-grain texture flattened.
/// At every pixel (X,Y) of the input image (or down-sized input image, see below) the function executes
/// meanshift iterations, that is, the pixel (X,Y) neighborhood in the joint space-color hyperspace is
/// considered:
///
/// <div lang='latex'>(x,y): X- \texttt{sp} \le x \le X+ \texttt{sp} , Y- \texttt{sp} \le y \le Y+ \texttt{sp} , ||(R,G,B)-(r,g,b)|| \le \texttt{sr}</div>
///
/// where (R,G,B) and (r,g,b) are the vectors of color components at (X,Y) and (x,y), respectively
/// (though, the algorithm does not depend on the color space used, so any 3-component color space can
/// be used instead). Over the neighborhood the average spatial value (X',Y') and average color vector
/// (R',G',B') are found and they act as the neighborhood center on the next iteration:
///
/// <div lang='latex'>(X,Y)~(X',Y'), (R,G,B)~(R',G',B').</div>
///
/// After the iterations over, the color components of the initial pixel (that is, the pixel from where
/// the iterations started) are set to the final value (average color at the last iteration):
///
/// <div lang='latex'>I(X,Y) <- (R*,G*,B*)</div>
///
/// When maxLevel \> 0, the gaussian pyramid of maxLevel+1 levels is built, and the above procedure is
/// run on the smallest layer first. After that, the results are propagated to the larger layer and the
/// iterations are run again only on those pixels where the layer colors differ by more than sr from the
/// lower-resolution layer of the pyramid. That makes boundaries of color regions sharper. Note that the
/// results will be actually different from the ones obtained by running the meanshift procedure on the
/// whole original image (i.e. when maxLevel==0).
///
/// ## Parameters
/// * src: The source 8-bit, 3-channel image.
/// * dst: The destination image of the same format and the same size as the source.
/// * sp: The spatial window radius.
/// * sr: The color window radius.
/// * maxLevel: Maximum level of the pyramid for the segmentation.
/// * termcrit: Termination criteria: when to stop meanshift iterations.
///
/// ## C++ default parameters:
/// * max_level: 1
/// * termcrit: TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5,1)
pub fn pyr_mean_shift_filtering(src: &core::Mat, dst: &mut core::Mat, sp: f64, sr: f64, max_level: i32, termcrit: &core::TermCriteria) -> Result<()> {
unsafe { sys::cv_core_cv_pyrMeanShiftFiltering_Mat_src_Mat_dst_double_sp_double_sr_int_maxLevel_TermCriteria_termcrit(src.as_raw_Mat(), dst.as_raw_Mat(), sp, sr, max_level, termcrit.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_pyrUp_Mat_src_Mat_dst_Size_dstsize_int_borderType
/// Upsamples an image and then blurs it.
///
/// By default, size of the output image is computed as `Size(src.cols\*2, (src.rows\*2)`, but in any
/// case, the following conditions should be satisfied:
///
/// <div lang='latex'>\begin{array}{l} | \texttt{dstsize.width} -src.cols*2| \leq ( \texttt{dstsize.width} \mod 2) \\ | \texttt{dstsize.height} -src.rows*2| \leq ( \texttt{dstsize.height} \mod 2) \end{array}</div>
///
/// The function performs the upsampling step of the Gaussian pyramid construction, though it can
/// actually be used to construct the Laplacian pyramid. First, it upsamples the source image by
/// injecting even zero rows and columns and then convolves the result with the same kernel as in
/// pyrDown multiplied by 4.
///
/// ## Parameters
/// * src: input image.
/// * dst: output image. It has the specified size and the same type as src .
/// * dstsize: size of the output image.
/// * borderType: Pixel extrapolation method, see #BorderTypes (only #BORDER_DEFAULT is supported)
///
/// ## C++ default parameters:
/// * dstsize: Size()
/// * border_type: BORDER_DEFAULT
pub fn pyr_up(src: &core::Mat, dst: &mut core::Mat, dstsize: core::Size, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_pyrUp_Mat_src_Mat_dst_Size_dstsize_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), dstsize, border_type) }.into_result()
}
// identifier: cv_randn_Mat_dst_Mat_mean_Mat_stddev
/// Fills the array with normally distributed random numbers.
///
/// The function cv::randn fills the matrix dst with normally distributed random numbers with the specified
/// mean vector and the standard deviation matrix. The generated random numbers are clipped to fit the
/// value range of the output array data type.
/// ## Parameters
/// * dst: output array of random numbers; the array must be pre-allocated and have 1 to 4 channels.
/// * mean: mean value (expectation) of the generated random numbers.
/// * stddev: standard deviation of the generated random numbers; it can be either a vector (in
/// which case a diagonal standard deviation matrix is assumed) or a square matrix.
/// @sa RNG, randu
pub fn randn(dst: &mut core::Mat, mean: &core::Mat, stddev: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_randn_Mat_dst_Mat_mean_Mat_stddev(dst.as_raw_Mat(), mean.as_raw_Mat(), stddev.as_raw_Mat()) }.into_result()
}
// identifier: cv_randu_Mat_dst_Mat_low_Mat_high
/// Generates a single uniformly-distributed random number or an array of random numbers.
///
/// Non-template variant of the function fills the matrix dst with uniformly-distributed
/// random numbers from the specified range:
/// <div lang='latex'>\texttt{low} _c \leq \texttt{dst} (I)_c < \texttt{high} _c</div>
/// ## Parameters
/// * dst: output array of random numbers; the array must be pre-allocated.
/// * low: inclusive lower boundary of the generated random numbers.
/// * high: exclusive upper boundary of the generated random numbers.
/// @sa RNG, randn, theRNG
pub fn randu(dst: &mut core::Mat, low: &core::Mat, high: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_randu_Mat_dst_Mat_low_Mat_high(dst.as_raw_Mat(), low.as_raw_Mat(), high.as_raw_Mat()) }.into_result()
}
// identifier: cv_recoverPose_Mat_E_Mat_points1_Mat_points2_Mat_R_Mat_t_double_focal_Point2d_pp_Mat_mask
/// @overload
/// ## Parameters
/// * E: The input essential matrix.
/// * points1: Array of N 2D points from the first image. The point coordinates should be
/// floating-point (single or double precision).
/// * points2: Array of the second image points of the same size and format as points1 .
/// * R: Recovered relative rotation.
/// * t: Recovered relative translation.
/// * focal: Focal length of the camera. Note that this function assumes that points1 and points2
/// are feature points from cameras with same focal length and principal point.
/// * pp: principal point of the camera.
/// * mask: Input/output mask for inliers in points1 and points2.
/// : If it is not empty, then it marks inliers in points1 and points2 for then given essential
/// matrix E. Only these inliers will be used to recover pose. In the output mask only inliers
/// which pass the cheirality check.
///
/// This function differs from the one above that it computes camera matrix from focal length and
/// principal point:
///
/// <div lang='latex'>K =
/// \begin{bmatrix}
/// f & 0 & x_{pp} \\
/// 0 & f & y_{pp} \\
/// 0 & 0 & 1
/// \end{bmatrix}</div>
///
/// ## C++ default parameters:
/// * focal: 1.0
/// * pp: Point2d(0, 0)
/// * mask: noArray()
pub fn recover_pose(e: &core::Mat, points1: &core::Mat, points2: &core::Mat, r: &mut core::Mat, t: &mut core::Mat, focal: f64, pp: core::Point2d, mask: &mut core::Mat) -> Result<i32> {
unsafe { sys::cv_core_cv_recoverPose_Mat_E_Mat_points1_Mat_points2_Mat_R_Mat_t_double_focal_Point2d_pp_Mat_mask(e.as_raw_Mat(), points1.as_raw_Mat(), points2.as_raw_Mat(), r.as_raw_Mat(), t.as_raw_Mat(), focal, pp, mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_recoverPose_Mat_E_Mat_points1_Mat_points2_Mat_cameraMatrix_Mat_R_Mat_t_Mat_mask
/// Recover relative camera rotation and translation from an estimated essential matrix and the
/// corresponding points in two images, using cheirality check. Returns the number of inliers which pass
/// the check.
///
/// ## Parameters
/// * E: The input essential matrix.
/// * points1: Array of N 2D points from the first image. The point coordinates should be
/// floating-point (single or double precision).
/// * points2: Array of the second image points of the same size and format as points1 .
/// * cameraMatrix: Camera matrix <span lang='latex'>K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}</span> .
/// Note that this function assumes that points1 and points2 are feature points from cameras with the
/// same camera matrix.
/// * R: Recovered relative rotation.
/// * t: Recovered relative translation.
/// * mask: Input/output mask for inliers in points1 and points2.
/// : If it is not empty, then it marks inliers in points1 and points2 for then given essential
/// matrix E. Only these inliers will be used to recover pose. In the output mask only inliers
/// which pass the cheirality check.
/// This function decomposes an essential matrix using decomposeEssentialMat and then verifies possible
/// pose hypotheses by doing cheirality check. The cheirality check basically means that the
/// triangulated 3D points should have positive depth. Some details can be found in @cite Nister03 .
///
/// This function can be used to process output E and mask from findEssentialMat. In this scenario,
/// points1 and points2 are the same input for findEssentialMat. :
/// ```ignore
/// // Example. Estimation of fundamental matrix using the RANSAC algorithm
/// int point_count = 100;
/// vector<Point2f> points1(point_count);
/// vector<Point2f> points2(point_count);
///
/// // initialize the points here ...
/// for( int i = 0; i < point_count; i++ )
/// {
/// points1[i] = ...;
/// points2[i] = ...;
/// }
///
/// // cametra matrix with both focal lengths = 1, and principal point = (0, 0)
/// Mat cameraMatrix = Mat::eye(3, 3, CV_64F);
///
/// Mat E, R, t, mask;
///
/// E = findEssentialMat(points1, points2, cameraMatrix, RANSAC, 0.999, 1.0, mask);
/// recoverPose(E, points1, points2, cameraMatrix, R, t, mask);
/// ```
///
/// ## C++ default parameters:
/// * mask: noArray()
pub fn recover_pose_matrix(e: &core::Mat, points1: &core::Mat, points2: &core::Mat, camera_matrix: &core::Mat, r: &mut core::Mat, t: &mut core::Mat, mask: &mut core::Mat) -> Result<i32> {
unsafe { sys::cv_core_cv_recoverPose_Mat_E_Mat_points1_Mat_points2_Mat_cameraMatrix_Mat_R_Mat_t_Mat_mask(e.as_raw_Mat(), points1.as_raw_Mat(), points2.as_raw_Mat(), camera_matrix.as_raw_Mat(), r.as_raw_Mat(), t.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_recoverPose_Mat_E_Mat_points1_Mat_points2_Mat_cameraMatrix_Mat_R_Mat_t_double_distanceThresh_Mat_mask_Mat_triangulatedPoints
/// @overload
/// ## Parameters
/// * E: The input essential matrix.
/// * points1: Array of N 2D points from the first image. The point coordinates should be
/// floating-point (single or double precision).
/// * points2: Array of the second image points of the same size and format as points1.
/// * cameraMatrix: Camera matrix <span lang='latex'>K = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}</span> .
/// Note that this function assumes that points1 and points2 are feature points from cameras with the
/// same camera matrix.
/// * R: Recovered relative rotation.
/// * t: Recovered relative translation.
/// * distanceThresh: threshold distance which is used to filter out far away points (i.e. infinite points).
/// * mask: Input/output mask for inliers in points1 and points2.
/// : If it is not empty, then it marks inliers in points1 and points2 for then given essential
/// matrix E. Only these inliers will be used to recover pose. In the output mask only inliers
/// which pass the cheirality check.
/// * triangulatedPoints: 3d points which were reconstructed by triangulation.
///
/// ## C++ default parameters:
/// * mask: noArray()
/// * triangulated_points: noArray()
pub fn recover_pose_1(e: &core::Mat, points1: &core::Mat, points2: &core::Mat, camera_matrix: &core::Mat, r: &mut core::Mat, t: &mut core::Mat, distance_thresh: f64, mask: &mut core::Mat, triangulated_points: &mut core::Mat) -> Result<i32> {
unsafe { sys::cv_core_cv_recoverPose_Mat_E_Mat_points1_Mat_points2_Mat_cameraMatrix_Mat_R_Mat_t_double_distanceThresh_Mat_mask_Mat_triangulatedPoints(e.as_raw_Mat(), points1.as_raw_Mat(), points2.as_raw_Mat(), camera_matrix.as_raw_Mat(), r.as_raw_Mat(), t.as_raw_Mat(), distance_thresh, mask.as_raw_Mat(), triangulated_points.as_raw_Mat()) }.into_result()
}
// identifier: cv_rectangle_Mat_img_Point_pt1_Point_pt2_Scalar_color_int_thickness_int_lineType_int_shift
/// Draws a simple, thick, or filled up-right rectangle.
///
/// The function cv::rectangle draws a rectangle outline or a filled rectangle whose two opposite corners
/// are pt1 and pt2.
///
/// ## Parameters
/// * img: Image.
/// * pt1: Vertex of the rectangle.
/// * pt2: Vertex of the rectangle opposite to pt1 .
/// * color: Rectangle color or brightness (grayscale image).
/// * thickness: Thickness of lines that make up the rectangle. Negative values, like #FILLED,
/// mean that the function has to draw a filled rectangle.
/// * lineType: Type of the line. See #LineTypes
/// * shift: Number of fractional bits in the point coordinates.
///
/// ## C++ default parameters:
/// * thickness: 1
/// * line_type: LINE_8
/// * shift: 0
pub fn rectangle_points(img: &mut core::Mat, pt1: core::Point, pt2: core::Point, color: core::Scalar, thickness: i32, line_type: i32, shift: i32) -> Result<()> {
unsafe { sys::cv_core_cv_rectangle_Mat_img_Point_pt1_Point_pt2_Scalar_color_int_thickness_int_lineType_int_shift(img.as_raw_Mat(), pt1, pt2, color, thickness, line_type, shift) }.into_result()
}
// identifier: cv_rectangle_Mat_img_Rect_rec_Scalar_color_int_thickness_int_lineType_int_shift
/// @overload
///
/// use `rec` parameter as alternative specification of the drawn rectangle: `r.tl() and
/// r.br()-Point(1,1)` are opposite corners
///
/// ## C++ default parameters:
/// * thickness: 1
/// * line_type: LINE_8
/// * shift: 0
pub fn rectangle(img: &core::Mat, rec: core::Rect, color: core::Scalar, thickness: i32, line_type: i32, shift: i32) -> Result<()> {
unsafe { sys::cv_core_cv_rectangle_Mat_img_Rect_rec_Scalar_color_int_thickness_int_lineType_int_shift(img.as_raw_Mat(), rec, color, thickness, line_type, shift) }.into_result()
}
// identifier: cv_rectify3Collinear_Mat_cameraMatrix1_Mat_distCoeffs1_Mat_cameraMatrix2_Mat_distCoeffs2_Mat_cameraMatrix3_Mat_distCoeffs3_VectorOfMat_imgpt1_VectorOfMat_imgpt3_Size_imageSize_Mat_R12_Mat_T12_Mat_R13_Mat_T13_Mat_R1_Mat_R2_Mat_R3_Mat_P1_Mat_P2_Mat_P3_Mat_Q_double_alpha_Size_newImgSize_Rect_X_roi1_Rect_X_roi2_int_flags
pub fn rectify3_collinear(camera_matrix1: &core::Mat, dist_coeffs1: &core::Mat, camera_matrix2: &core::Mat, dist_coeffs2: &core::Mat, camera_matrix3: &core::Mat, dist_coeffs3: &core::Mat, imgpt1: &types::VectorOfMat, imgpt3: &types::VectorOfMat, image_size: core::Size, r12: &core::Mat, t12: &core::Mat, r13: &core::Mat, t13: &core::Mat, r1: &mut core::Mat, r2: &mut core::Mat, r3: &mut core::Mat, p1: &mut core::Mat, p2: &mut core::Mat, p3: &mut core::Mat, q: &mut core::Mat, alpha: f64, new_img_size: core::Size, roi1: &mut core::Rect, roi2: &mut core::Rect, flags: i32) -> Result<f32> {
unsafe { sys::cv_core_cv_rectify3Collinear_Mat_cameraMatrix1_Mat_distCoeffs1_Mat_cameraMatrix2_Mat_distCoeffs2_Mat_cameraMatrix3_Mat_distCoeffs3_VectorOfMat_imgpt1_VectorOfMat_imgpt3_Size_imageSize_Mat_R12_Mat_T12_Mat_R13_Mat_T13_Mat_R1_Mat_R2_Mat_R3_Mat_P1_Mat_P2_Mat_P3_Mat_Q_double_alpha_Size_newImgSize_Rect_X_roi1_Rect_X_roi2_int_flags(camera_matrix1.as_raw_Mat(), dist_coeffs1.as_raw_Mat(), camera_matrix2.as_raw_Mat(), dist_coeffs2.as_raw_Mat(), camera_matrix3.as_raw_Mat(), dist_coeffs3.as_raw_Mat(), imgpt1.as_raw_VectorOfMat(), imgpt3.as_raw_VectorOfMat(), image_size, r12.as_raw_Mat(), t12.as_raw_Mat(), r13.as_raw_Mat(), t13.as_raw_Mat(), r1.as_raw_Mat(), r2.as_raw_Mat(), r3.as_raw_Mat(), p1.as_raw_Mat(), p2.as_raw_Mat(), p3.as_raw_Mat(), q.as_raw_Mat(), alpha, new_img_size, roi1, roi2, flags) }.into_result()
}
// identifier: cv_reduce_Mat_src_Mat_dst_int_dim_int_rtype_int_dtype
/// Reduces a matrix to a vector.
///
/// The function #reduce reduces the matrix to a vector by treating the matrix rows/columns as a set of
/// 1D vectors and performing the specified operation on the vectors until a single row/column is
/// obtained. For example, the function can be used to compute horizontal and vertical projections of a
/// raster image. In case of #REDUCE_MAX and #REDUCE_MIN , the output image should have the same type as the source one.
/// In case of #REDUCE_SUM and #REDUCE_AVG , the output may have a larger element bit-depth to preserve accuracy.
/// And multi-channel arrays are also supported in these two reduction modes.
///
/// The following code demonstrates its usage for a single channel matrix.
/// @snippet snippets/core_reduce.cpp example
///
/// And the following code demonstrates its usage for a two-channel matrix.
/// @snippet snippets/core_reduce.cpp example2
///
/// ## Parameters
/// * src: input 2D matrix.
/// * dst: output vector. Its size and type is defined by dim and dtype parameters.
/// * dim: dimension index along which the matrix is reduced. 0 means that the matrix is reduced to
/// a single row. 1 means that the matrix is reduced to a single column.
/// * rtype: reduction operation that could be one of #ReduceTypes
/// * dtype: when negative, the output vector will have the same type as the input matrix,
/// otherwise, its type will be CV_MAKE_TYPE(CV_MAT_DEPTH(dtype), src.channels()).
/// @sa repeat
///
/// ## C++ default parameters:
/// * dtype: -1
pub fn reduce(src: &core::Mat, dst: &mut core::Mat, dim: i32, rtype: i32, dtype: i32) -> Result<()> {
unsafe { sys::cv_core_cv_reduce_Mat_src_Mat_dst_int_dim_int_rtype_int_dtype(src.as_raw_Mat(), dst.as_raw_Mat(), dim, rtype, dtype) }.into_result()
}
// identifier: cv_remap_Mat_src_Mat_dst_Mat_map1_Mat_map2_int_interpolation_int_borderMode_Scalar_borderValue
/// Applies a generic geometrical transformation to an image.
///
/// The function remap transforms the source image using the specified map:
///
/// <div lang='latex'>\texttt{dst} (x,y) = \texttt{src} (map_x(x,y),map_y(x,y))</div>
///
/// where values of pixels with non-integer coordinates are computed using one of available
/// interpolation methods. <span lang='latex'>map_x</span> and <span lang='latex'>map_y</span> can be encoded as separate floating-point maps
/// in <span lang='latex'>map_1</span> and <span lang='latex'>map_2</span> respectively, or interleaved floating-point maps of <span lang='latex'>(x,y)</span> in
/// <span lang='latex'>map_1</span>, or fixed-point maps created by using convertMaps. The reason you might want to
/// convert from floating to fixed-point representations of a map is that they can yield much faster
/// (\~2x) remapping operations. In the converted case, <span lang='latex'>map_1</span> contains pairs (cvFloor(x),
/// cvFloor(y)) and <span lang='latex'>map_2</span> contains indices in a table of interpolation coefficients.
///
/// This function cannot operate in-place.
///
/// ## Parameters
/// * src: Source image.
/// * dst: Destination image. It has the same size as map1 and the same type as src .
/// * map1: The first map of either (x,y) points or just x values having the type CV_16SC2 ,
/// CV_32FC1, or CV_32FC2. See convertMaps for details on converting a floating point
/// representation to fixed-point for speed.
/// * map2: The second map of y values having the type CV_16UC1, CV_32FC1, or none (empty map
/// if map1 is (x,y) points), respectively.
/// * interpolation: Interpolation method (see #InterpolationFlags). The method #INTER_AREA is
/// not supported by this function.
/// * borderMode: Pixel extrapolation method (see #BorderTypes). When
/// borderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image that
/// corresponds to the "outliers" in the source image are not modified by the function.
/// * borderValue: Value used in case of a constant border. By default, it is 0.
///
/// Note:
/// Due to current implementation limitations the size of an input and output images should be less than 32767x32767.
///
/// ## C++ default parameters:
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
pub fn remap(src: &core::Mat, dst: &mut core::Mat, map1: &core::Mat, map2: &core::Mat, interpolation: i32, border_mode: i32, border_value: core::Scalar) -> Result<()> {
unsafe { sys::cv_core_cv_remap_Mat_src_Mat_dst_Mat_map1_Mat_map2_int_interpolation_int_borderMode_Scalar_borderValue(src.as_raw_Mat(), dst.as_raw_Mat(), map1.as_raw_Mat(), map2.as_raw_Mat(), interpolation, border_mode, border_value) }.into_result()
}
// identifier: cv_repeat_Mat_src_int_ny_int_nx
/// @overload
/// ## Parameters
/// * src: input array to replicate.
/// * ny: Flag to specify how many times the `src` is repeated along the
/// vertical axis.
/// * nx: Flag to specify how many times the `src` is repeated along the
/// horizontal axis.
pub fn repeat(src: &core::Mat, ny: i32, nx: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_repeat_Mat_src_int_ny_int_nx(src.as_raw_Mat(), ny, nx) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_repeat_Mat_src_int_ny_int_nx_Mat_dst
/// Fills the output array with repeated copies of the input array.
///
/// The function cv::repeat duplicates the input array one or more times along each of the two axes:
/// <div lang='latex'>\texttt{dst} _{ij}= \texttt{src} _{i\mod src.rows, \; j\mod src.cols }</div>
/// The second variant of the function is more convenient to use with @ref MatrixExpressions.
/// ## Parameters
/// * src: input array to replicate.
/// * ny: Flag to specify how many times the `src` is repeated along the
/// vertical axis.
/// * nx: Flag to specify how many times the `src` is repeated along the
/// horizontal axis.
/// * dst: output array of the same type as `src`.
/// @sa cv::reduce
pub fn repeat_to(src: &core::Mat, ny: i32, nx: i32, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_repeat_Mat_src_int_ny_int_nx_Mat_dst(src.as_raw_Mat(), ny, nx, dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_reprojectImageTo3D_Mat_disparity_Mat__3dImage_Mat_Q_bool_handleMissingValues_int_ddepth
/// Reprojects a disparity image to 3D space.
///
/// ## Parameters
/// * disparity: Input single-channel 8-bit unsigned, 16-bit signed, 32-bit signed or 32-bit
/// floating-point disparity image. If 16-bit signed format is used, the values are assumed to have no
/// fractional bits.
/// * _3dImage: Output 3-channel floating-point image of the same size as disparity . Each
/// element of _3dImage(x,y) contains 3D coordinates of the point (x,y) computed from the disparity
/// map.
/// * Q: <span lang='latex'>4 \times 4</span> perspective transformation matrix that can be obtained with stereoRectify.
/// * handleMissingValues: Indicates, whether the function should handle missing values (i.e.
/// points where the disparity was not computed). If handleMissingValues=true, then pixels with the
/// minimal disparity that corresponds to the outliers (see StereoMatcher::compute ) are transformed
/// to 3D points with a very large Z value (currently set to 10000).
/// * ddepth: The optional output array depth. If it is -1, the output image will have CV_32F
/// depth. ddepth can also be set to CV_16S, CV_32S or CV_32F.
///
/// The function transforms a single-channel disparity map to a 3-channel image representing a 3D
/// surface. That is, for each pixel (x,y) and the corresponding disparity d=disparity(x,y) , it
/// computes:
///
/// <div lang='latex'>\begin{array}{l} [X \; Y \; Z \; W]^T = \texttt{Q} *[x \; y \; \texttt{disparity} (x,y) \; 1]^T \\ \texttt{\_3dImage} (x,y) = (X/W, \; Y/W, \; Z/W) \end{array}</div>
///
/// The matrix Q can be an arbitrary <span lang='latex'>4 \times 4</span> matrix (for example, the one computed by
/// stereoRectify). To reproject a sparse set of points {(x,y,d),...} to 3D space, use
/// perspectiveTransform .
///
/// ## C++ default parameters:
/// * handle_missing_values: false
/// * ddepth: -1
pub fn reproject_image_to3_d(disparity: &core::Mat, _3d_image: &mut core::Mat, q: &core::Mat, handle_missing_values: bool, ddepth: i32) -> Result<()> {
unsafe { sys::cv_core_cv_reprojectImageTo3D_Mat_disparity_Mat__3dImage_Mat_Q_bool_handleMissingValues_int_ddepth(disparity.as_raw_Mat(), _3d_image.as_raw_Mat(), q.as_raw_Mat(), handle_missing_values, ddepth) }.into_result()
}
// identifier: cv_resizeWindow_String_winname_Size_size
/// @overload
/// ## Parameters
/// * winname: Window name.
/// * size: The new window size.
pub fn resize_window(winname: &str, size: core::Size) -> Result<()> {
string_arg!(winname);
unsafe { sys::cv_core_cv_resizeWindow_String_winname_Size_size(winname.as_ptr(), size) }.into_result()
}
// identifier: cv_resizeWindow_String_winname_int_width_int_height
/// Resizes window to the specified size
///
///
/// Note:
///
/// * The specified window size is for the image area. Toolbars are not counted.
/// * Only windows created without cv::WINDOW_AUTOSIZE flag can be resized.
///
/// ## Parameters
/// * winname: Window name.
/// * width: The new window width.
/// * height: The new window height.
pub fn resize_window_1(winname: &str, width: i32, height: i32) -> Result<()> {
string_arg!(winname);
unsafe { sys::cv_core_cv_resizeWindow_String_winname_int_width_int_height(winname.as_ptr(), width, height) }.into_result()
}
// identifier: cv_resize_Mat_src_Mat_dst_Size_dsize_double_fx_double_fy_int_interpolation
/// Resizes an image.
///
/// The function resize resizes the image src down to or up to the specified size. Note that the
/// initial dst type or size are not taken into account. Instead, the size and type are derived from
/// the `src`,`dsize`,`fx`, and `fy`. If you want to resize src so that it fits the pre-created dst,
/// you may call the function as follows:
/// ```ignore
/// // explicitly specify dsize=dst.size(); fx and fy will be computed from that.
/// resize(src, dst, dst.size(), 0, 0, interpolation);
/// ```
///
/// If you want to decimate the image by factor of 2 in each direction, you can call the function this
/// way:
/// ```ignore
/// // specify fx and fy and let the function compute the destination image size.
/// resize(src, dst, Size(), 0.5, 0.5, interpolation);
/// ```
///
/// To shrink an image, it will generally look best with #INTER_AREA interpolation, whereas to
/// enlarge an image, it will generally look best with c#INTER_CUBIC (slow) or #INTER_LINEAR
/// (faster but still looks OK).
///
/// ## Parameters
/// * src: input image.
/// * dst: output image; it has the size dsize (when it is non-zero) or the size computed from
/// src.size(), fx, and fy; the type of dst is the same as of src.
/// * dsize: output image size; if it equals zero, it is computed as:
/// <div lang='latex'>\texttt{dsize = Size(round(fx*src.cols), round(fy*src.rows))}</div>
/// Either dsize or both fx and fy must be non-zero.
/// * fx: scale factor along the horizontal axis; when it equals 0, it is computed as
/// <div lang='latex'>\texttt{(double)dsize.width/src.cols}</div>
/// * fy: scale factor along the vertical axis; when it equals 0, it is computed as
/// <div lang='latex'>\texttt{(double)dsize.height/src.rows}</div>
/// * interpolation: interpolation method, see #InterpolationFlags
///
/// @sa warpAffine, warpPerspective, remap
///
/// ## C++ default parameters:
/// * fx: 0
/// * fy: 0
/// * interpolation: INTER_LINEAR
pub fn resize(src: &core::Mat, dst: &mut core::Mat, dsize: core::Size, fx: f64, fy: f64, interpolation: i32) -> Result<()> {
unsafe { sys::cv_core_cv_resize_Mat_src_Mat_dst_Size_dsize_double_fx_double_fy_int_interpolation(src.as_raw_Mat(), dst.as_raw_Mat(), dsize, fx, fy, interpolation) }.into_result()
}
// identifier: cv_rotate_Mat_src_Mat_dst_int_rotateCode
/// Rotates a 2D array in multiples of 90 degrees.
/// The function cv::rotate rotates the array in one of three different ways:
/// Rotate by 90 degrees clockwise (rotateCode = ROTATE_90_CLOCKWISE).
/// Rotate by 180 degrees clockwise (rotateCode = ROTATE_180).
/// Rotate by 270 degrees clockwise (rotateCode = ROTATE_90_COUNTERCLOCKWISE).
/// ## Parameters
/// * src: input array.
/// * dst: output array of the same type as src. The size is the same with ROTATE_180,
/// and the rows and cols are switched for ROTATE_90_CLOCKWISE and ROTATE_90_COUNTERCLOCKWISE.
/// * rotateCode: an enum to specify how to rotate the array; see the enum #RotateFlags
/// @sa transpose , repeat , completeSymm, flip, RotateFlags
pub fn rotate(src: &core::Mat, dst: &mut core::Mat, rotate_code: i32) -> Result<()> {
unsafe { sys::cv_core_cv_rotate_Mat_src_Mat_dst_int_rotateCode(src.as_raw_Mat(), dst.as_raw_Mat(), rotate_code) }.into_result()
}
// identifier: cv_rotatedRectangleIntersection_RotatedRect_rect1_RotatedRect_rect2_Mat_intersectingRegion
/// Finds out if there is any intersection between two rotated rectangles.
///
/// If there is then the vertices of the intersecting region are returned as well.
///
/// Below are some examples of intersection configurations. The hatched pattern indicates the
/// intersecting region and the red vertices are returned by the function.
///
/// 
///
/// ## Parameters
/// * rect1: First rectangle
/// * rect2: Second rectangle
/// * intersectingRegion: The output array of the vertices of the intersecting region. It returns
/// at most 8 vertices. Stored as std::vector\<cv::Point2f\> or cv::Mat as Mx1 of type CV_32FC2.
/// @returns One of #RectanglesIntersectTypes
pub fn rotated_rectangle_intersection(rect1: &core::RotatedRect, rect2: &core::RotatedRect, intersecting_region: &mut core::Mat) -> Result<i32> {
unsafe { sys::cv_core_cv_rotatedRectangleIntersection_RotatedRect_rect1_RotatedRect_rect2_Mat_intersectingRegion(rect1.as_raw_RotatedRect(), rect2.as_raw_RotatedRect(), intersecting_region.as_raw_Mat()) }.into_result()
}
// identifier: cv_roundUp_int_a_unsigned_int_b
/// Round first value up to the nearest multiple of second value.
///
/// Use this function instead of `ceil((float)a / b) * b` expressions.
///
/// @sa divUp
pub fn round_up(a: i32, b: u32) -> Result<i32> {
unsafe { sys::cv_core_cv_roundUp_int_a_unsigned_int_b(a, b) }.into_result()
}
// identifier: cv_roundUp_size_t_a_unsigned_int_b
/// @overload
pub fn round_up_1(a: size_t, b: u32) -> Result<size_t> {
unsafe { sys::cv_core_cv_roundUp_size_t_a_unsigned_int_b(a, b) }.into_result()
}
// identifier: cv_sampsonDistance_Mat_pt1_Mat_pt2_Mat_F
/// Calculates the Sampson Distance between two points.
///
/// The function cv::sampsonDistance calculates and returns the first order approximation of the geometric error as:
/// <div lang='latex'>
/// sd( \texttt{pt1} , \texttt{pt2} )=
/// \frac{(\texttt{pt2}^t \cdot \texttt{F} \cdot \texttt{pt1})^2}
/// {((\texttt{F} \cdot \texttt{pt1})(0))^2 +
/// ((\texttt{F} \cdot \texttt{pt1})(1))^2 +
/// ((\texttt{F}^t \cdot \texttt{pt2})(0))^2 +
/// ((\texttt{F}^t \cdot \texttt{pt2})(1))^2}
/// </div>
/// The fundamental matrix may be calculated using the cv::findFundamentalMat function. See @cite HartleyZ00 11.4.3 for details.
/// ## Parameters
/// * pt1: first homogeneous 2d point
/// * pt2: second homogeneous 2d point
/// * F: fundamental matrix
/// @return The computed Sampson distance.
pub fn sampson_distance(pt1: &core::Mat, pt2: &core::Mat, f: &core::Mat) -> Result<f64> {
unsafe { sys::cv_core_cv_sampsonDistance_Mat_pt1_Mat_pt2_Mat_F(pt1.as_raw_Mat(), pt2.as_raw_Mat(), f.as_raw_Mat()) }.into_result()
}
// identifier: cv_saveWindowParameters_String_windowName
/// Saves parameters of the specified window.
///
/// The function saveWindowParameters saves size, location, flags, trackbars value, zoom and panning
/// location of the window windowName.
///
/// ## Parameters
/// * windowName: Name of the window.
pub fn save_window_parameters(window_name: &str) -> Result<()> {
string_arg!(window_name);
unsafe { sys::cv_core_cv_saveWindowParameters_String_windowName(window_name.as_ptr()) }.into_result()
}
// identifier: cv_scaleAdd_Mat_src1_double_alpha_Mat_src2_Mat_dst
/// Calculates the sum of a scaled array and another array.
///
/// The function scaleAdd is one of the classical primitive linear algebra operations, known as DAXPY
/// or SAXPY in [BLAS](http://en.wikipedia.org/wiki/Basic_Linear_Algebra_Subprograms). It calculates
/// the sum of a scaled array and another array:
/// <div lang='latex'>\texttt{dst} (I)= \texttt{scale} \cdot \texttt{src1} (I) + \texttt{src2} (I)</div>
/// The function can also be emulated with a matrix expression, for example:
/// ```ignore{.cpp}
/// Mat A(3, 3, CV_64F);
/// ...
/// A.row(0) = A.row(1)*2 + A.row(2);
/// ```
///
/// ## Parameters
/// * src1: first input array.
/// * alpha: scale factor for the first array.
/// * src2: second input array of the same size and type as src1.
/// * dst: output array of the same size and type as src1.
/// @sa add, addWeighted, subtract, Mat::dot, Mat::convertTo
pub fn scale_add(src1: &core::Mat, alpha: f64, src2: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_scaleAdd_Mat_src1_double_alpha_Mat_src2_Mat_dst(src1.as_raw_Mat(), alpha, src2.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_seamlessClone_Mat_src_Mat_dst_Mat_mask_Point_p_Mat_blend_int_flags
/// Image editing tasks concern either global changes (color/intensity corrections, filters,
/// deformations) or local changes concerned to a selection. Here we are interested in achieving local
/// changes, ones that are restricted to a region manually selected (ROI), in a seamless and effortless
/// manner. The extent of the changes ranges from slight distortions to complete replacement by novel
/// content @cite PM03 .
///
/// ## Parameters
/// * src: Input 8-bit 3-channel image.
/// * dst: Input 8-bit 3-channel image.
/// * mask: Input 8-bit 1 or 3-channel image.
/// * p: Point in dst image where object is placed.
/// * blend: Output image with the same size and type as dst.
/// * flags: Cloning method that could be one of the following:
/// * **NORMAL_CLONE** The power of the method is fully expressed when inserting objects with
/// complex outlines into a new background
/// * **MIXED_CLONE** The classic method, color-based selection and alpha masking might be time
/// consuming and often leaves an undesirable halo. Seamless cloning, even averaged with the
/// original image, is not effective. Mixed seamless cloning based on a loose selection proves
/// effective.
/// * **MONOCHROME_TRANSFER** Monochrome transfer allows the user to easily replace certain features of
/// one object by alternative features.
pub fn seamless_clone(src: &core::Mat, dst: &core::Mat, mask: &core::Mat, p: core::Point, blend: &mut core::Mat, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_seamlessClone_Mat_src_Mat_dst_Mat_mask_Point_p_Mat_blend_int_flags(src.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat(), p, blend.as_raw_Mat(), flags) }.into_result()
}
// identifier: cv_selectROI_Mat_img_bool_showCrosshair_bool_fromCenter
/// @overload
///
/// ## C++ default parameters:
/// * show_crosshair: true
/// * from_center: false
pub fn select_roi(img: &core::Mat, show_crosshair: bool, from_center: bool) -> Result<core::Rect> {
unsafe { sys::cv_core_cv_selectROI_Mat_img_bool_showCrosshair_bool_fromCenter(img.as_raw_Mat(), show_crosshair, from_center) }.into_result()
}
// identifier: cv_selectROI_String_windowName_Mat_img_bool_showCrosshair_bool_fromCenter
/// Selects ROI on the given image.
/// Function creates a window and allows user to select a ROI using mouse.
/// Controls: use `space` or `enter` to finish selection, use key `c` to cancel selection (function will return the zero cv::Rect).
///
/// ## Parameters
/// * windowName: name of the window where selection process will be shown.
/// * img: image to select a ROI.
/// * showCrosshair: if true crosshair of selection rectangle will be shown.
/// * fromCenter: if true center of selection will match initial mouse position. In opposite case a corner of
/// selection rectangle will correspont to the initial mouse position.
/// @return selected ROI or empty rect if selection canceled.
///
///
/// Note: The function sets it's own mouse callback for specified window using cv::setMouseCallback(windowName, ...).
/// After finish of work an empty callback will be set for the used window.
///
/// ## C++ default parameters:
/// * show_crosshair: true
/// * from_center: false
pub fn select_roi_1(window_name: &str, img: &core::Mat, show_crosshair: bool, from_center: bool) -> Result<core::Rect> {
string_arg!(window_name);
unsafe { sys::cv_core_cv_selectROI_String_windowName_Mat_img_bool_showCrosshair_bool_fromCenter(window_name.as_ptr(), img.as_raw_Mat(), show_crosshair, from_center) }.into_result()
}
// identifier: cv_selectROIs_String_windowName_Mat_img_VectorOfRect_boundingBoxes_bool_showCrosshair_bool_fromCenter
/// Selects ROIs on the given image.
/// Function creates a window and allows user to select a ROIs using mouse.
/// Controls: use `space` or `enter` to finish current selection and start a new one,
/// use `esc` to terminate multiple ROI selection process.
///
/// ## Parameters
/// * windowName: name of the window where selection process will be shown.
/// * img: image to select a ROI.
/// * boundingBoxes: selected ROIs.
/// * showCrosshair: if true crosshair of selection rectangle will be shown.
/// * fromCenter: if true center of selection will match initial mouse position. In opposite case a corner of
/// selection rectangle will correspont to the initial mouse position.
///
///
/// Note: The function sets it's own mouse callback for specified window using cv::setMouseCallback(windowName, ...).
/// After finish of work an empty callback will be set for the used window.
///
/// ## C++ default parameters:
/// * show_crosshair: true
/// * from_center: false
pub fn select_ro_is(window_name: &str, img: &core::Mat, bounding_boxes: &types::VectorOfRect, show_crosshair: bool, from_center: bool) -> Result<()> {
string_arg!(window_name);
unsafe { sys::cv_core_cv_selectROIs_String_windowName_Mat_img_VectorOfRect_boundingBoxes_bool_showCrosshair_bool_fromCenter(window_name.as_ptr(), img.as_raw_Mat(), bounding_boxes.as_raw_VectorOfRect(), show_crosshair, from_center) }.into_result()
}
// identifier: cv_sepFilter2D_Mat_src_Mat_dst_int_ddepth_Mat_kernelX_Mat_kernelY_Point_anchor_double_delta_int_borderType
/// Applies a separable linear filter to an image.
///
/// The function applies a separable linear filter to the image. That is, first, every row of src is
/// filtered with the 1D kernel kernelX. Then, every column of the result is filtered with the 1D
/// kernel kernelY. The final result shifted by delta is stored in dst .
///
/// ## Parameters
/// * src: Source image.
/// * dst: Destination image of the same size and the same number of channels as src .
/// * ddepth: Destination image depth, see @ref filter_depths "combinations"
/// * kernelX: Coefficients for filtering each row.
/// * kernelY: Coefficients for filtering each column.
/// * anchor: Anchor position within the kernel. The default value <span lang='latex'>(-1,-1)</span> means that the anchor
/// is at the kernel center.
/// * delta: Value added to the filtered results before storing them.
/// * borderType: Pixel extrapolation method, see #BorderTypes
/// @sa filter2D, Sobel, GaussianBlur, boxFilter, blur
///
/// ## C++ default parameters:
/// * anchor: Point(-1,-1)
/// * delta: 0
/// * border_type: BORDER_DEFAULT
pub fn sep_filter2_d_1(src: &core::Mat, dst: &mut core::Mat, ddepth: i32, kernel_x: &core::Mat, kernel_y: &core::Mat, anchor: core::Point, delta: f64, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_sepFilter2D_Mat_src_Mat_dst_int_ddepth_Mat_kernelX_Mat_kernelY_Point_anchor_double_delta_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ddepth, kernel_x.as_raw_Mat(), kernel_y.as_raw_Mat(), anchor, delta, border_type) }.into_result()
}
// identifier: cv_setBreakOnError_bool_flag
/// Sets/resets the break-on-error mode.
///
/// When the break-on-error mode is set, the default error handler issues a hardware exception, which
/// can make debugging more convenient.
///
/// \return the previous state
pub fn set_break_on_error(flag: bool) -> Result<bool> {
unsafe { sys::cv_core_cv_setBreakOnError_bool_flag(flag) }.into_result()
}
// identifier: cv_setIdentity_Mat_mtx_Scalar_s
/// Initializes a scaled identity matrix.
///
/// The function cv::setIdentity initializes a scaled identity matrix:
/// <div lang='latex'>\texttt{mtx} (i,j)= \fork{\texttt{value}}{ if \(i=j\)}{0}{otherwise}</div>
///
/// The function can also be emulated using the matrix initializers and the
/// matrix expressions:
/// ```ignore
/// Mat A = Mat::eye(4, 3, CV_32F)*5;
/// // A will be set to [[5, 0, 0], [0, 5, 0], [0, 0, 5], [0, 0, 0]]
/// ```
///
/// ## Parameters
/// * mtx: matrix to initialize (not necessarily square).
/// * s: value to assign to diagonal elements.
/// @sa Mat::zeros, Mat::ones, Mat::setTo, Mat::operator=
///
/// ## C++ default parameters:
/// * s: Scalar(1)
pub fn set_identity(mtx: &mut core::Mat, s: core::Scalar) -> Result<()> {
unsafe { sys::cv_core_cv_setIdentity_Mat_mtx_Scalar_s(mtx.as_raw_Mat(), s) }.into_result()
}
// identifier: cv_setMouseCallback_String_winname_MouseCallback_onMouse_void_X_userdata
/// Sets mouse handler for the specified window
///
/// ## Parameters
/// * winname: Name of the window.
/// * onMouse: Callback function for mouse events. See OpenCV samples on how to specify and use the callback.
/// * userdata: The optional parameter passed to the callback.
///
/// ## C++ default parameters:
/// * userdata: 0
pub fn set_mouse_callback(winname: &str, on_mouse: Option<Box<core::MouseCallback>>) -> Result<()> {
string_arg!(winname);
callback_arg!(on_mouse(event: i32, x: i32, y: i32, flags: i32, userdata: *mut c_void) via userdata => (event: i32, x: i32, y: i32, flags: i32));
unsafe { sys::cv_core_cv_setMouseCallback_String_winname_MouseCallback_onMouse_void_X_userdata(winname.as_ptr(), on_mouse, userdata) }.into_result()
}
// identifier: cv_setNumThreads_int_nthreads
/// OpenCV will try to set the number of threads for the next parallel region.
///
/// If threads == 0, OpenCV will disable threading optimizations and run all it's functions
/// sequentially. Passing threads \< 0 will reset threads number to system default. This function must
/// be called outside of parallel region.
///
/// OpenCV will try to run its functions with specified threads number, but some behaviour differs from
/// framework:
/// * `TBB` - User-defined parallel constructions will run with the same threads number, if
/// another is not specified. If later on user creates his own scheduler, OpenCV will use it.
/// * `OpenMP` - No special defined behaviour.
/// * `Concurrency` - If threads == 1, OpenCV will disable threading optimizations and run its
/// functions sequentially.
/// * `GCD` - Supports only values \<= 0.
/// * `C=` - No special defined behaviour.
/// ## Parameters
/// * nthreads: Number of threads used by OpenCV.
/// @sa getNumThreads, getThreadNum
pub fn set_num_threads(nthreads: i32) -> Result<()> {
unsafe { sys::cv_core_cv_setNumThreads_int_nthreads(nthreads) }.into_result()
}
// identifier: cv_setOpenGlContext_String_winname
/// Sets the specified window as current OpenGL context.
///
/// ## Parameters
/// * winname: Name of the window.
pub fn set_open_gl_context(winname: &str) -> Result<()> {
string_arg!(winname);
unsafe { sys::cv_core_cv_setOpenGlContext_String_winname(winname.as_ptr()) }.into_result()
}
// identifier: cv_setOpenGlDrawCallback_String_winname_OpenGlDrawCallback_onOpenGlDraw_void_X_userdata
/// Sets a callback function to be called to draw on top of displayed image.
///
/// The function setOpenGlDrawCallback can be used to draw 3D data on the window. See the example of
/// callback function below:
/// ```ignore
/// void on_opengl(void* param)
/// {
/// glLoadIdentity();
///
/// glTranslated(0.0, 0.0, -1.0);
///
/// glRotatef( 55, 1, 0, 0 );
/// glRotatef( 45, 0, 1, 0 );
/// glRotatef( 0, 0, 0, 1 );
///
/// static const int coords[6][4][3] = {
/// { { +1, -1, -1 }, { -1, -1, -1 }, { -1, +1, -1 }, { +1, +1, -1 } },
/// { { +1, +1, -1 }, { -1, +1, -1 }, { -1, +1, +1 }, { +1, +1, +1 } },
/// { { +1, -1, +1 }, { +1, -1, -1 }, { +1, +1, -1 }, { +1, +1, +1 } },
/// { { -1, -1, -1 }, { -1, -1, +1 }, { -1, +1, +1 }, { -1, +1, -1 } },
/// { { +1, -1, +1 }, { -1, -1, +1 }, { -1, -1, -1 }, { +1, -1, -1 } },
/// { { -1, -1, +1 }, { +1, -1, +1 }, { +1, +1, +1 }, { -1, +1, +1 } }
/// };
///
/// for (int i = 0; i < 6; ++i) {
/// glColor3ub( i*20, 100+i*10, i*42 );
/// glBegin(GL_QUADS);
/// for (int j = 0; j < 4; ++j) {
/// glVertex3d(0.2 * coords[i][j][0], 0.2 * coords[i][j][1], 0.2 * coords[i][j][2]);
/// }
/// glEnd();
/// }
/// }
/// ```
///
///
/// ## Parameters
/// * winname: Name of the window.
/// * onOpenGlDraw: Pointer to the function to be called every frame. This function should be
/// prototyped as void Foo(void\*) .
/// * userdata: Pointer passed to the callback function.(__Optional__)
///
/// ## C++ default parameters:
/// * userdata: 0
pub fn set_open_gl_draw_callback(winname: &str, on_open_gl_draw: Option<Box<core::OpenGlDrawCallback>>) -> Result<()> {
string_arg!(winname);
callback_arg!(on_open_gl_draw(userdata: *mut c_void) via userdata => ());
unsafe { sys::cv_core_cv_setOpenGlDrawCallback_String_winname_OpenGlDrawCallback_onOpenGlDraw_void_X_userdata(winname.as_ptr(), on_open_gl_draw, userdata) }.into_result()
}
// identifier: cv_setRNGSeed_int_seed
/// Sets state of default random number generator.
///
/// The function cv::setRNGSeed sets state of default random number generator to custom value.
/// ## Parameters
/// * seed: new state for default random number generator
/// @sa RNG, randu, randn
pub fn set_rng_seed(seed: i32) -> Result<()> {
unsafe { sys::cv_core_cv_setRNGSeed_int_seed(seed) }.into_result()
}
// identifier: cv_setTrackbarMax_String_trackbarname_String_winname_int_maxval
/// Sets the trackbar maximum position.
///
/// The function sets the maximum position of the specified trackbar in the specified window.
///
///
/// Note:
///
/// [__Qt Backend Only__] winname can be empty (or NULL) if the trackbar is attached to the control
/// panel.
///
/// ## Parameters
/// * trackbarname: Name of the trackbar.
/// * winname: Name of the window that is the parent of trackbar.
/// * maxval: New maximum position.
pub fn set_trackbar_max(trackbarname: &str, winname: &str, maxval: i32) -> Result<()> {
string_arg!(trackbarname);
string_arg!(winname);
unsafe { sys::cv_core_cv_setTrackbarMax_String_trackbarname_String_winname_int_maxval(trackbarname.as_ptr(), winname.as_ptr(), maxval) }.into_result()
}
// identifier: cv_setTrackbarMin_String_trackbarname_String_winname_int_minval
/// Sets the trackbar minimum position.
///
/// The function sets the minimum position of the specified trackbar in the specified window.
///
///
/// Note:
///
/// [__Qt Backend Only__] winname can be empty (or NULL) if the trackbar is attached to the control
/// panel.
///
/// ## Parameters
/// * trackbarname: Name of the trackbar.
/// * winname: Name of the window that is the parent of trackbar.
/// * minval: New minimum position.
pub fn set_trackbar_min(trackbarname: &str, winname: &str, minval: i32) -> Result<()> {
string_arg!(trackbarname);
string_arg!(winname);
unsafe { sys::cv_core_cv_setTrackbarMin_String_trackbarname_String_winname_int_minval(trackbarname.as_ptr(), winname.as_ptr(), minval) }.into_result()
}
// identifier: cv_setTrackbarPos_String_trackbarname_String_winname_int_pos
/// Sets the trackbar position.
///
/// The function sets the position of the specified trackbar in the specified window.
///
///
/// Note:
///
/// [__Qt Backend Only__] winname can be empty (or NULL) if the trackbar is attached to the control
/// panel.
///
/// ## Parameters
/// * trackbarname: Name of the trackbar.
/// * winname: Name of the window that is the parent of trackbar.
/// * pos: New position.
pub fn set_trackbar_pos(trackbarname: &str, winname: &str, pos: i32) -> Result<()> {
string_arg!(trackbarname);
string_arg!(winname);
unsafe { sys::cv_core_cv_setTrackbarPos_String_trackbarname_String_winname_int_pos(trackbarname.as_ptr(), winname.as_ptr(), pos) }.into_result()
}
// identifier: cv_setUseOpenVX_bool_flag
pub fn set_use_open_vx(flag: bool) -> Result<()> {
unsafe { sys::cv_core_cv_setUseOpenVX_bool_flag(flag) }.into_result()
}
// identifier: cv_setUseOptimized_bool_onoff
/// Enables or disables the optimized code.
///
/// The function can be used to dynamically turn on and off optimized dispatched code (code that uses SSE4.2, AVX/AVX2,
/// and other instructions on the platforms that support it). It sets a global flag that is further
/// checked by OpenCV functions. Since the flag is not checked in the inner OpenCV loops, it is only
/// safe to call the function on the very top level in your application where you can be sure that no
/// other OpenCV function is currently executed.
///
/// By default, the optimized code is enabled unless you disable it in CMake. The current status can be
/// retrieved using useOptimized.
/// ## Parameters
/// * onoff: The boolean flag specifying whether the optimized code should be used (onoff=true)
/// or not (onoff=false).
pub fn set_use_optimized(onoff: bool) -> Result<()> {
unsafe { sys::cv_core_cv_setUseOptimized_bool_onoff(onoff) }.into_result()
}
// identifier: cv_setWindowProperty_String_winname_int_prop_id_double_prop_value
/// Changes parameters of a window dynamically.
///
/// The function setWindowProperty enables changing properties of a window.
///
/// ## Parameters
/// * winname: Name of the window.
/// * prop_id: Window property to edit. The supported operation flags are: (cv::WindowPropertyFlags)
/// * prop_value: New value of the window property. The supported flags are: (cv::WindowFlags)
pub fn set_window_property(winname: &str, prop_id: i32, prop_value: f64) -> Result<()> {
string_arg!(winname);
unsafe { sys::cv_core_cv_setWindowProperty_String_winname_int_prop_id_double_prop_value(winname.as_ptr(), prop_id, prop_value) }.into_result()
}
// identifier: cv_setWindowTitle_String_winname_String_title
/// Updates window title
/// ## Parameters
/// * winname: Name of the window.
/// * title: New title.
pub fn set_window_title(winname: &str, title: &str) -> Result<()> {
string_arg!(winname);
string_arg!(title);
unsafe { sys::cv_core_cv_setWindowTitle_String_winname_String_title(winname.as_ptr(), title.as_ptr()) }.into_result()
}
// identifier: cv_sin_softdouble_a
/// Sine
///
/// Special cases:
/// - sin(Inf) or sin(NaN) is NaN
/// - sin(x) == x when sin(x) is close to zero
pub fn sin(a: &core::softdouble) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_sin_softdouble_a(a.as_raw_softdouble()) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_solveCubic_Mat_coeffs_Mat_roots
/// Finds the real roots of a cubic equation.
///
/// The function solveCubic finds the real roots of a cubic equation:
/// * if coeffs is a 4-element vector:
/// <div lang='latex'>\texttt{coeffs} [0] x^3 + \texttt{coeffs} [1] x^2 + \texttt{coeffs} [2] x + \texttt{coeffs} [3] = 0</div>
/// * if coeffs is a 3-element vector:
/// <div lang='latex'>x^3 + \texttt{coeffs} [0] x^2 + \texttt{coeffs} [1] x + \texttt{coeffs} [2] = 0</div>
///
/// The roots are stored in the roots array.
/// ## Parameters
/// * coeffs: equation coefficients, an array of 3 or 4 elements.
/// * roots: output array of real roots that has 1 or 3 elements.
/// @return number of real roots. It can be 0, 1 or 2.
pub fn solve_cubic(coeffs: &core::Mat, roots: &mut core::Mat) -> Result<i32> {
unsafe { sys::cv_core_cv_solveCubic_Mat_coeffs_Mat_roots(coeffs.as_raw_Mat(), roots.as_raw_Mat()) }.into_result()
}
// identifier: cv_solveLP_Mat_Func_Mat_Constr_Mat_z
/// Solve given (non-integer) linear programming problem using the Simplex Algorithm (Simplex Method).
///
/// What we mean here by "linear programming problem" (or LP problem, for short) can be formulated as:
///
/// <div lang='latex'>\mbox{Maximize } c\cdot x\\
/// \mbox{Subject to:}\\
/// Ax\leq b\\
/// x\geq 0</div>
///
/// Where <span lang='latex'>c</span> is fixed `1`-by-`n` row-vector, <span lang='latex'>A</span> is fixed `m`-by-`n` matrix, <span lang='latex'>b</span> is fixed `m`-by-`1`
/// column vector and <span lang='latex'>x</span> is an arbitrary `n`-by-`1` column vector, which satisfies the constraints.
///
/// Simplex algorithm is one of many algorithms that are designed to handle this sort of problems
/// efficiently. Although it is not optimal in theoretical sense (there exist algorithms that can solve
/// any problem written as above in polynomial time, while simplex method degenerates to exponential
/// time for some special cases), it is well-studied, easy to implement and is shown to work well for
/// real-life purposes.
///
/// The particular implementation is taken almost verbatim from **Introduction to Algorithms, third
/// edition** by T. H. Cormen, C. E. Leiserson, R. L. Rivest and Clifford Stein. In particular, the
/// Bland's rule <http://en.wikipedia.org/wiki/Bland%27s_rule> is used to prevent cycling.
///
/// ## Parameters
/// * Func: This row-vector corresponds to <span lang='latex'>c</span> in the LP problem formulation (see above). It should
/// contain 32- or 64-bit floating point numbers. As a convenience, column-vector may be also submitted,
/// in the latter case it is understood to correspond to <span lang='latex'>c^T</span>.
/// * Constr: `m`-by-`n+1` matrix, whose rightmost column corresponds to <span lang='latex'>b</span> in formulation above
/// and the remaining to <span lang='latex'>A</span>. It should contain 32- or 64-bit floating point numbers.
/// * z: The solution will be returned here as a column-vector - it corresponds to <span lang='latex'>c</span> in the
/// formulation above. It will contain 64-bit floating point numbers.
/// @return One of cv::SolveLPResult
pub fn solve_lp(func: &core::Mat, constr: &core::Mat, z: &core::Mat) -> Result<i32> {
unsafe { sys::cv_core_cv_solveLP_Mat_Func_Mat_Constr_Mat_z(func.as_raw_Mat(), constr.as_raw_Mat(), z.as_raw_Mat()) }.into_result()
}
// identifier: cv_solveP3P_Mat_objectPoints_Mat_imagePoints_Mat_cameraMatrix_Mat_distCoeffs_VectorOfMat_rvecs_VectorOfMat_tvecs_int_flags
/// Finds an object pose from 3 3D-2D point correspondences.
///
/// ## Parameters
/// * objectPoints: Array of object points in the object coordinate space, 3x3 1-channel or
/// 1x3/3x1 3-channel. vector\<Point3f\> can be also passed here.
/// * imagePoints: Array of corresponding image points, 3x2 1-channel or 1x3/3x1 2-channel.
/// vector\<Point2f\> can be also passed here.
/// * cameraMatrix: Input camera matrix <span lang='latex'>A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}</span> .
/// * distCoeffs: Input vector of distortion coefficients
/// <span lang='latex'>(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])</span> of
/// 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are
/// assumed.
/// * rvecs: Output rotation vectors (see Rodrigues ) that, together with tvecs , brings points from
/// the model coordinate system to the camera coordinate system. A P3P problem has up to 4 solutions.
/// * tvecs: Output translation vectors.
/// * flags: Method for solving a P3P problem:
/// * **SOLVEPNP_P3P** Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang
/// "Complete Solution Classification for the Perspective-Three-Point Problem" (@cite gao2003complete).
/// * **SOLVEPNP_AP3P** Method is based on the paper of Tong Ke and Stergios I. Roumeliotis.
/// "An Efficient Algebraic Solution to the Perspective-Three-Point Problem" (@cite Ke17).
///
/// The function estimates the object pose given 3 object points, their corresponding image
/// projections, as well as the camera matrix and the distortion coefficients.
pub fn solve_p3_p(object_points: &core::Mat, image_points: &core::Mat, camera_matrix: &core::Mat, dist_coeffs: &core::Mat, rvecs: &mut types::VectorOfMat, tvecs: &mut types::VectorOfMat, flags: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_solveP3P_Mat_objectPoints_Mat_imagePoints_Mat_cameraMatrix_Mat_distCoeffs_VectorOfMat_rvecs_VectorOfMat_tvecs_int_flags(object_points.as_raw_Mat(), image_points.as_raw_Mat(), camera_matrix.as_raw_Mat(), dist_coeffs.as_raw_Mat(), rvecs.as_raw_VectorOfMat(), tvecs.as_raw_VectorOfMat(), flags) }.into_result()
}
// identifier: cv_solvePnPRansac_Mat_objectPoints_Mat_imagePoints_Mat_cameraMatrix_Mat_distCoeffs_Mat_rvec_Mat_tvec_bool_useExtrinsicGuess_int_iterationsCount_float_reprojectionError_double_confidence_Mat_inliers_int_flags
/// Finds an object pose from 3D-2D point correspondences using the RANSAC scheme.
///
/// ## Parameters
/// * objectPoints: Array of object points in the object coordinate space, Nx3 1-channel or
/// 1xN/Nx1 3-channel, where N is the number of points. vector\<Point3f\> can be also passed here.
/// * imagePoints: Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel,
/// where N is the number of points. vector\<Point2f\> can be also passed here.
/// * cameraMatrix: Input camera matrix <span lang='latex'>A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}</span> .
/// * distCoeffs: Input vector of distortion coefficients
/// <span lang='latex'>(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])</span> of
/// 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are
/// assumed.
/// * rvec: Output rotation vector (see Rodrigues ) that, together with tvec , brings points from
/// the model coordinate system to the camera coordinate system.
/// * tvec: Output translation vector.
/// * useExtrinsicGuess: Parameter used for SOLVEPNP_ITERATIVE. If true (1), the function uses
/// the provided rvec and tvec values as initial approximations of the rotation and translation
/// vectors, respectively, and further optimizes them.
/// * iterationsCount: Number of iterations.
/// * reprojectionError: Inlier threshold value used by the RANSAC procedure. The parameter value
/// is the maximum allowed distance between the observed and computed point projections to consider it
/// an inlier.
/// * confidence: The probability that the algorithm produces a useful result.
/// * inliers: Output vector that contains indices of inliers in objectPoints and imagePoints .
/// * flags: Method for solving a PnP problem (see solvePnP ).
///
/// The function estimates an object pose given a set of object points, their corresponding image
/// projections, as well as the camera matrix and the distortion coefficients. This function finds such
/// a pose that minimizes reprojection error, that is, the sum of squared distances between the observed
/// projections imagePoints and the projected (using projectPoints ) objectPoints. The use of RANSAC
/// makes the function resistant to outliers.
///
///
/// Note:
/// * An example of how to use solvePNPRansac for object detection can be found at
/// opencv_source_code/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/
/// * The default method used to estimate the camera pose for the Minimal Sample Sets step
/// is #SOLVEPNP_EPNP. Exceptions are:
/// - if you choose #SOLVEPNP_P3P or #SOLVEPNP_AP3P, these methods will be used.
/// - if the number of input points is equal to 4, #SOLVEPNP_P3P is used.
/// * The method used to estimate the camera pose using all the inliers is defined by the
/// flags parameters unless it is equal to #SOLVEPNP_P3P or #SOLVEPNP_AP3P. In this case,
/// the method #SOLVEPNP_EPNP will be used instead.
///
/// ## C++ default parameters:
/// * use_extrinsic_guess: false
/// * iterations_count: 100
/// * reprojection_error: 8.0
/// * confidence: 0.99
/// * inliers: noArray()
/// * flags: SOLVEPNP_ITERATIVE
pub fn solve_pn_p_ransac(object_points: &core::Mat, image_points: &core::Mat, camera_matrix: &core::Mat, dist_coeffs: &core::Mat, rvec: &mut core::Mat, tvec: &mut core::Mat, use_extrinsic_guess: bool, iterations_count: i32, reprojection_error: f32, confidence: f64, inliers: &mut core::Mat, flags: i32) -> Result<bool> {
unsafe { sys::cv_core_cv_solvePnPRansac_Mat_objectPoints_Mat_imagePoints_Mat_cameraMatrix_Mat_distCoeffs_Mat_rvec_Mat_tvec_bool_useExtrinsicGuess_int_iterationsCount_float_reprojectionError_double_confidence_Mat_inliers_int_flags(object_points.as_raw_Mat(), image_points.as_raw_Mat(), camera_matrix.as_raw_Mat(), dist_coeffs.as_raw_Mat(), rvec.as_raw_Mat(), tvec.as_raw_Mat(), use_extrinsic_guess, iterations_count, reprojection_error, confidence, inliers.as_raw_Mat(), flags) }.into_result()
}
// identifier: cv_solvePnP_Mat_objectPoints_Mat_imagePoints_Mat_cameraMatrix_Mat_distCoeffs_Mat_rvec_Mat_tvec_bool_useExtrinsicGuess_int_flags
/// Finds an object pose from 3D-2D point correspondences.
///
/// ## Parameters
/// * objectPoints: Array of object points in the object coordinate space, Nx3 1-channel or
/// 1xN/Nx1 3-channel, where N is the number of points. vector\<Point3f\> can be also passed here.
/// * imagePoints: Array of corresponding image points, Nx2 1-channel or 1xN/Nx1 2-channel,
/// where N is the number of points. vector\<Point2f\> can be also passed here.
/// * cameraMatrix: Input camera matrix <span lang='latex'>A = \vecthreethree{fx}{0}{cx}{0}{fy}{cy}{0}{0}{1}</span> .
/// * distCoeffs: Input vector of distortion coefficients
/// <span lang='latex'>(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])</span> of
/// 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are
/// assumed.
/// * rvec: Output rotation vector (see @ref Rodrigues ) that, together with tvec , brings points from
/// the model coordinate system to the camera coordinate system.
/// * tvec: Output translation vector.
/// * useExtrinsicGuess: Parameter used for #SOLVEPNP_ITERATIVE. If true (1), the function uses
/// the provided rvec and tvec values as initial approximations of the rotation and translation
/// vectors, respectively, and further optimizes them.
/// * flags: Method for solving a PnP problem:
/// * **SOLVEPNP_ITERATIVE** Iterative method is based on Levenberg-Marquardt optimization. In
/// this case the function finds such a pose that minimizes reprojection error, that is the sum
/// of squared distances between the observed projections imagePoints and the projected (using
/// projectPoints ) objectPoints .
/// * **SOLVEPNP_P3P** Method is based on the paper of X.S. Gao, X.-R. Hou, J. Tang, H.-F. Chang
/// "Complete Solution Classification for the Perspective-Three-Point Problem" (@cite gao2003complete).
/// In this case the function requires exactly four object and image points.
/// * **SOLVEPNP_AP3P** Method is based on the paper of T. Ke, S. Roumeliotis
/// "An Efficient Algebraic Solution to the Perspective-Three-Point Problem" (@cite Ke17).
/// In this case the function requires exactly four object and image points.
/// * **SOLVEPNP_EPNP** Method has been introduced by F.Moreno-Noguer, V.Lepetit and P.Fua in the
/// paper "EPnP: Efficient Perspective-n-Point Camera Pose Estimation" (@cite lepetit2009epnp).
/// * **SOLVEPNP_DLS** Method is based on the paper of Joel A. Hesch and Stergios I. Roumeliotis.
/// "A Direct Least-Squares (DLS) Method for PnP" (@cite hesch2011direct).
/// * **SOLVEPNP_UPNP** Method is based on the paper of A.Penate-Sanchez, J.Andrade-Cetto,
/// F.Moreno-Noguer. "Exhaustive Linearization for Robust Camera Pose and Focal Length
/// Estimation" (@cite penate2013exhaustive). In this case the function also estimates the parameters <span lang='latex'>f_x</span> and <span lang='latex'>f_y</span>
/// assuming that both have the same value. Then the cameraMatrix is updated with the estimated
/// focal length.
/// * **SOLVEPNP_AP3P** Method is based on the paper of Tong Ke and Stergios I. Roumeliotis.
/// "An Efficient Algebraic Solution to the Perspective-Three-Point Problem" (@cite Ke17). In this case the
/// function requires exactly four object and image points.
///
/// The function estimates the object pose given a set of object points, their corresponding image
/// projections, as well as the camera matrix and the distortion coefficients, see the figure below
/// (more precisely, the X-axis of the camera frame is pointing to the right, the Y-axis downward
/// and the Z-axis forward).
///
/// 
///
/// Points expressed in the world frame <span lang='latex'> \bf{X}_w </span> are projected into the image plane <span lang='latex'> \left[ u, v \right] </span>
/// using the perspective projection model <span lang='latex'> \Pi </span> and the camera intrinsic parameters matrix <span lang='latex'> \bf{A} </span>:
///
/// <div lang='latex'>
/// \begin{align*}
/// \begin{bmatrix}
/// u \\
/// v \\
/// 1
/// \end{bmatrix} &=
/// \bf{A} \hspace{0.1em} \Pi \hspace{0.2em} ^{c}\bf{M}_w
/// \begin{bmatrix}
/// X_{w} \\
/// Y_{w} \\
/// Z_{w} \\
/// 1
/// \end{bmatrix} \\
/// \begin{bmatrix}
/// u \\
/// v \\
/// 1
/// \end{bmatrix} &=
/// \begin{bmatrix}
/// f_x & 0 & c_x \\
/// 0 & f_y & c_y \\
/// 0 & 0 & 1
/// \end{bmatrix}
/// \begin{bmatrix}
/// 1 & 0 & 0 & 0 \\
/// 0 & 1 & 0 & 0 \\
/// 0 & 0 & 1 & 0
/// \end{bmatrix}
/// \begin{bmatrix}
/// r_{11} & r_{12} & r_{13} & t_x \\
/// r_{21} & r_{22} & r_{23} & t_y \\
/// r_{31} & r_{32} & r_{33} & t_z \\
/// 0 & 0 & 0 & 1
/// \end{bmatrix}
/// \begin{bmatrix}
/// X_{w} \\
/// Y_{w} \\
/// Z_{w} \\
/// 1
/// \end{bmatrix}
/// \end{align*}
/// </div>
///
/// The estimated pose is thus the rotation (`rvec`) and the translation (`tvec`) vectors that allow to transform
/// a 3D point expressed in the world frame into the camera frame:
///
/// <div lang='latex'>
/// \begin{align*}
/// \begin{bmatrix}
/// X_c \\
/// Y_c \\
/// Z_c \\
/// 1
/// \end{bmatrix} &=
/// \hspace{0.2em} ^{c}\bf{M}_w
/// \begin{bmatrix}
/// X_{w} \\
/// Y_{w} \\
/// Z_{w} \\
/// 1
/// \end{bmatrix} \\
/// \begin{bmatrix}
/// X_c \\
/// Y_c \\
/// Z_c \\
/// 1
/// \end{bmatrix} &=
/// \begin{bmatrix}
/// r_{11} & r_{12} & r_{13} & t_x \\
/// r_{21} & r_{22} & r_{23} & t_y \\
/// r_{31} & r_{32} & r_{33} & t_z \\
/// 0 & 0 & 0 & 1
/// \end{bmatrix}
/// \begin{bmatrix}
/// X_{w} \\
/// Y_{w} \\
/// Z_{w} \\
/// 1
/// \end{bmatrix}
/// \end{align*}
/// </div>
///
///
/// Note:
/// * An example of how to use solvePnP for planar augmented reality can be found at
/// opencv_source_code/samples/python/plane_ar.py
/// * If you are using Python:
/// - Numpy array slices won't work as input because solvePnP requires contiguous
/// arrays (enforced by the assertion using cv::Mat::checkVector() around line 55 of
/// modules/calib3d/src/solvepnp.cpp version 2.4.9)
/// - The P3P algorithm requires image points to be in an array of shape (N,1,2) due
/// to its calling of cv::undistortPoints (around line 75 of modules/calib3d/src/solvepnp.cpp version 2.4.9)
/// which requires 2-channel information.
/// - Thus, given some data D = np.array(...) where D.shape = (N,M), in order to use a subset of
/// it as, e.g., imagePoints, one must effectively copy it into a new array: imagePoints =
/// np.ascontiguousarray(D[:,:2]).reshape((N,1,2))
/// * The methods **SOLVEPNP_DLS** and **SOLVEPNP_UPNP** cannot be used as the current implementations are
/// unstable and sometimes give completely wrong results. If you pass one of these two
/// flags, **SOLVEPNP_EPNP** method will be used instead.
/// * The minimum number of points is 4 in the general case. In the case of **SOLVEPNP_P3P** and **SOLVEPNP_AP3P**
/// methods, it is required to use exactly 4 points (the first 3 points are used to estimate all the solutions
/// of the P3P problem, the last one is used to retain the best solution that minimizes the reprojection error).
/// * With **SOLVEPNP_ITERATIVE** method and `useExtrinsicGuess=true`, the minimum number of points is 3 (3 points
/// are sufficient to compute a pose but there are up to 4 solutions). The initial solution should be close to the
/// global solution to converge.
///
/// ## C++ default parameters:
/// * use_extrinsic_guess: false
/// * flags: SOLVEPNP_ITERATIVE
pub fn solve_pn_p(object_points: &core::Mat, image_points: &core::Mat, camera_matrix: &core::Mat, dist_coeffs: &core::Mat, rvec: &mut core::Mat, tvec: &mut core::Mat, use_extrinsic_guess: bool, flags: i32) -> Result<bool> {
unsafe { sys::cv_core_cv_solvePnP_Mat_objectPoints_Mat_imagePoints_Mat_cameraMatrix_Mat_distCoeffs_Mat_rvec_Mat_tvec_bool_useExtrinsicGuess_int_flags(object_points.as_raw_Mat(), image_points.as_raw_Mat(), camera_matrix.as_raw_Mat(), dist_coeffs.as_raw_Mat(), rvec.as_raw_Mat(), tvec.as_raw_Mat(), use_extrinsic_guess, flags) }.into_result()
}
// identifier: cv_solvePoly_Mat_coeffs_Mat_roots_int_maxIters
/// Finds the real or complex roots of a polynomial equation.
///
/// The function cv::solvePoly finds real and complex roots of a polynomial equation:
/// <div lang='latex'>\texttt{coeffs} [n] x^{n} + \texttt{coeffs} [n-1] x^{n-1} + ... + \texttt{coeffs} [1] x + \texttt{coeffs} [0] = 0</div>
/// ## Parameters
/// * coeffs: array of polynomial coefficients.
/// * roots: output (complex) array of roots.
/// * maxIters: maximum number of iterations the algorithm does.
///
/// ## C++ default parameters:
/// * max_iters: 300
pub fn solve_poly(coeffs: &core::Mat, roots: &mut core::Mat, max_iters: i32) -> Result<f64> {
unsafe { sys::cv_core_cv_solvePoly_Mat_coeffs_Mat_roots_int_maxIters(coeffs.as_raw_Mat(), roots.as_raw_Mat(), max_iters) }.into_result()
}
// identifier: cv_solve_Mat_src1_Mat_src2_Mat_dst_int_flags
/// Solves one or more linear systems or least-squares problems.
///
/// The function cv::solve solves a linear system or least-squares problem (the
/// latter is possible with SVD or QR methods, or by specifying the flag
/// #DECOMP_NORMAL ):
/// <div lang='latex'>\texttt{dst} = \arg \min _X \| \texttt{src1} \cdot \texttt{X} - \texttt{src2} \|</div>
///
/// If #DECOMP_LU or #DECOMP_CHOLESKY method is used, the function returns 1
/// if src1 (or <span lang='latex'>\texttt{src1}^T\texttt{src1}</span> ) is non-singular. Otherwise,
/// it returns 0. In the latter case, dst is not valid. Other methods find a
/// pseudo-solution in case of a singular left-hand side part.
///
///
/// Note: If you want to find a unity-norm solution of an under-defined
/// singular system <span lang='latex'>\texttt{src1}\cdot\texttt{dst}=0</span> , the function solve
/// will not do the work. Use SVD::solveZ instead.
///
/// ## Parameters
/// * src1: input matrix on the left-hand side of the system.
/// * src2: input matrix on the right-hand side of the system.
/// * dst: output solution.
/// * flags: solution (matrix inversion) method (#DecompTypes)
/// @sa invert, SVD, eigen
///
/// ## C++ default parameters:
/// * flags: DECOMP_LU
pub fn solve(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat, flags: i32) -> Result<bool> {
unsafe { sys::cv_core_cv_solve_Mat_src1_Mat_src2_Mat_dst_int_flags(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), flags) }.into_result()
}
// identifier: cv_sortIdx_Mat_src_Mat_dst_int_flags
/// Sorts each row or each column of a matrix.
///
/// The function cv::sortIdx sorts each matrix row or each matrix column in the
/// ascending or descending order. So you should pass two operation flags to
/// get desired behaviour. Instead of reordering the elements themselves, it
/// stores the indices of sorted elements in the output array. For example:
/// ```ignore
/// Mat A = Mat::eye(3,3,CV_32F), B;
/// sortIdx(A, B, SORT_EVERY_ROW + SORT_ASCENDING);
/// // B will probably contain
/// // (because of equal elements in A some permutations are possible):
/// // [[1, 2, 0], [0, 2, 1], [0, 1, 2]]
/// ```
///
/// ## Parameters
/// * src: input single-channel array.
/// * dst: output integer array of the same size as src.
/// * flags: operation flags that could be a combination of cv::SortFlags
/// @sa sort, randShuffle
pub fn sort_idx(src: &core::Mat, dst: &mut core::Mat, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_sortIdx_Mat_src_Mat_dst_int_flags(src.as_raw_Mat(), dst.as_raw_Mat(), flags) }.into_result()
}
// identifier: cv_sort_Mat_src_Mat_dst_int_flags
/// Sorts each row or each column of a matrix.
///
/// The function cv::sort sorts each matrix row or each matrix column in
/// ascending or descending order. So you should pass two operation flags to
/// get desired behaviour. If you want to sort matrix rows or columns
/// lexicographically, you can use STL std::sort generic function with the
/// proper comparison predicate.
///
/// ## Parameters
/// * src: input single-channel array.
/// * dst: output array of the same size and type as src.
/// * flags: operation flags, a combination of #SortFlags
/// @sa sortIdx, randShuffle
pub fn sort(src: &core::Mat, dst: &mut core::Mat, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_sort_Mat_src_Mat_dst_int_flags(src.as_raw_Mat(), dst.as_raw_Mat(), flags) }.into_result()
}
// identifier: cv_spatialGradient_Mat_src_Mat_dx_Mat_dy_int_ksize_int_borderType
/// Calculates the first order image derivative in both x and y using a Sobel operator
///
/// Equivalent to calling:
///
/// ```ignore
/// Sobel( src, dx, CV_16SC1, 1, 0, 3 );
/// Sobel( src, dy, CV_16SC1, 0, 1, 3 );
/// ```
///
///
/// ## Parameters
/// * src: input image.
/// * dx: output image with first-order derivative in x.
/// * dy: output image with first-order derivative in y.
/// * ksize: size of Sobel kernel. It must be 3.
/// * borderType: pixel extrapolation method, see #BorderTypes
///
/// @sa Sobel
///
/// ## C++ default parameters:
/// * ksize: 3
/// * border_type: BORDER_DEFAULT
pub fn spatial_gradient(src: &core::Mat, dx: &mut core::Mat, dy: &mut core::Mat, ksize: i32, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_spatialGradient_Mat_src_Mat_dx_Mat_dy_int_ksize_int_borderType(src.as_raw_Mat(), dx.as_raw_Mat(), dy.as_raw_Mat(), ksize, border_type) }.into_result()
}
// identifier: cv_split_Mat_m_VectorOfMat_mv
/// @overload
/// ## Parameters
/// * m: input multi-channel array.
/// * mv: output vector of arrays; the arrays themselves are reallocated, if needed.
pub fn split(m: &core::Mat, mv: &mut types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_split_Mat_m_VectorOfMat_mv(m.as_raw_Mat(), mv.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_split_Mat_src_Mat_mvbegin
/// Divides a multi-channel array into several single-channel arrays.
///
/// The function cv::split splits a multi-channel array into separate single-channel arrays:
/// <div lang='latex'>\texttt{mv} [c](I) = \texttt{src} (I)_c</div>
/// If you need to extract a single channel or do some other sophisticated channel permutation, use
/// mixChannels .
///
/// The following example demonstrates how to split a 3-channel matrix into 3 single channel matrices.
/// @snippet snippets/core_split.cpp example
///
/// ## Parameters
/// * src: input multi-channel array.
/// * mvbegin: output array; the number of arrays must match src.channels(); the arrays themselves are
/// reallocated, if needed.
/// @sa merge, mixChannels, cvtColor
pub fn split_at(src: &core::Mat, mvbegin: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_split_Mat_src_Mat_mvbegin(src.as_raw_Mat(), mvbegin.as_raw_Mat()) }.into_result()
}
// identifier: cv_sqrBoxFilter_Mat_src_Mat_dst_int_ddepth_Size_ksize_Point_anchor_bool_normalize_int_borderType
/// Calculates the normalized sum of squares of the pixel values overlapping the filter.
///
/// For every pixel <span lang='latex'> (x, y) </span> in the source image, the function calculates the sum of squares of those neighboring
/// pixel values which overlap the filter placed over the pixel <span lang='latex'> (x, y) </span>.
///
/// The unnormalized square box filter can be useful in computing local image statistics such as the the local
/// variance and standard deviation around the neighborhood of a pixel.
///
/// ## Parameters
/// * src: input image
/// * dst: output image of the same size and type as _src
/// * ddepth: the output image depth (-1 to use src.depth())
/// * ksize: kernel size
/// * anchor: kernel anchor point. The default value of Point(-1, -1) denotes that the anchor is at the kernel
/// center.
/// * normalize: flag, specifying whether the kernel is to be normalized by it's area or not.
/// * borderType: border mode used to extrapolate pixels outside of the image, see #BorderTypes
/// @sa boxFilter
///
/// ## C++ default parameters:
/// * anchor: Point(-1, -1)
/// * normalize: true
/// * border_type: BORDER_DEFAULT
pub fn sqr_box_filter(src: &core::Mat, dst: &mut core::Mat, ddepth: i32, ksize: core::Size, anchor: core::Point, normalize: bool, border_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_sqrBoxFilter_Mat_src_Mat_dst_int_ddepth_Size_ksize_Point_anchor_bool_normalize_int_borderType(src.as_raw_Mat(), dst.as_raw_Mat(), ddepth, ksize, anchor, normalize, border_type) }.into_result()
}
// identifier: cv_sqrt_Mat_src_Mat_dst
/// Calculates a square root of array elements.
///
/// The function cv::sqrt calculates a square root of each input array element.
/// In case of multi-channel arrays, each channel is processed
/// independently. The accuracy is approximately the same as of the built-in
/// std::sqrt .
/// ## Parameters
/// * src: input floating-point array.
/// * dst: output array of the same size and type as src.
pub fn sqrt_2(src: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_sqrt_Mat_src_Mat_dst(src.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_sqrt_softdouble_a
pub fn sqrt_3(a: &core::softdouble) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_sqrt_softdouble_a(a.as_raw_softdouble()) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_sqrt_softfloat_a
/// Square root
pub fn sqrt_4(a: &core::softfloat) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_sqrt_softfloat_a(a.as_raw_softfloat()) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_startWindowThread
pub fn start_window_thread() -> Result<i32> {
unsafe { sys::cv_core_cv_startWindowThread() }.into_result()
}
// identifier: cv_stereoCalibrate_VectorOfMat_objectPoints_VectorOfMat_imagePoints1_VectorOfMat_imagePoints2_Mat_cameraMatrix1_Mat_distCoeffs1_Mat_cameraMatrix2_Mat_distCoeffs2_Size_imageSize_Mat_R_Mat_T_Mat_E_Mat_F_Mat_perViewErrors_int_flags_TermCriteria_criteria
/// Calibrates the stereo camera.
///
/// ## Parameters
/// * objectPoints: Vector of vectors of the calibration pattern points.
/// * imagePoints1: Vector of vectors of the projections of the calibration pattern points,
/// observed by the first camera.
/// * imagePoints2: Vector of vectors of the projections of the calibration pattern points,
/// observed by the second camera.
/// * cameraMatrix1: Input/output first camera matrix:
/// <span lang='latex'>\vecthreethree{f_x^{(j)}}{0}{c_x^{(j)}}{0}{f_y^{(j)}}{c_y^{(j)}}{0}{0}{1}</span> , <span lang='latex'>j = 0,\, 1</span> . If
/// any of CALIB_USE_INTRINSIC_GUESS , CALIB_FIX_ASPECT_RATIO ,
/// CALIB_FIX_INTRINSIC , or CALIB_FIX_FOCAL_LENGTH are specified, some or all of the
/// matrix components must be initialized. See the flags description for details.
/// * distCoeffs1: Input/output vector of distortion coefficients
/// <span lang='latex'>(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6 [, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])</span> of
/// 4, 5, 8, 12 or 14 elements. The output vector length depends on the flags.
/// * cameraMatrix2: Input/output second camera matrix. The parameter is similar to cameraMatrix1
/// * distCoeffs2: Input/output lens distortion coefficients for the second camera. The parameter
/// is similar to distCoeffs1 .
/// * imageSize: Size of the image used only to initialize intrinsic camera matrix.
/// * R: Output rotation matrix between the 1st and the 2nd camera coordinate systems.
/// * T: Output translation vector between the coordinate systems of the cameras.
/// * E: Output essential matrix.
/// * F: Output fundamental matrix.
/// * perViewErrors: Output vector of the RMS re-projection error estimated for each pattern view.
/// * flags: Different flags that may be zero or a combination of the following values:
/// * **CALIB_FIX_INTRINSIC** Fix cameraMatrix? and distCoeffs? so that only R, T, E , and F
/// matrices are estimated.
/// * **CALIB_USE_INTRINSIC_GUESS** Optimize some or all of the intrinsic parameters
/// according to the specified flags. Initial values are provided by the user.
/// * **CALIB_USE_EXTRINSIC_GUESS** R, T contain valid initial values that are optimized further.
/// Otherwise R, T are initialized to the median value of the pattern views (each dimension separately).
/// * **CALIB_FIX_PRINCIPAL_POINT** Fix the principal points during the optimization.
/// * **CALIB_FIX_FOCAL_LENGTH** Fix <span lang='latex'>f^{(j)}_x</span> and <span lang='latex'>f^{(j)}_y</span> .
/// * **CALIB_FIX_ASPECT_RATIO** Optimize <span lang='latex'>f^{(j)}_y</span> . Fix the ratio <span lang='latex'>f^{(j)}_x/f^{(j)}_y</span>
/// .
/// * **CALIB_SAME_FOCAL_LENGTH** Enforce <span lang='latex'>f^{(0)}_x=f^{(1)}_x</span> and <span lang='latex'>f^{(0)}_y=f^{(1)}_y</span> .
/// * **CALIB_ZERO_TANGENT_DIST** Set tangential distortion coefficients for each camera to
/// zeros and fix there.
/// * **CALIB_FIX_K1,...,CALIB_FIX_K6** Do not change the corresponding radial
/// distortion coefficient during the optimization. If CALIB_USE_INTRINSIC_GUESS is set,
/// the coefficient from the supplied distCoeffs matrix is used. Otherwise, it is set to 0.
/// * **CALIB_RATIONAL_MODEL** Enable coefficients k4, k5, and k6. To provide the backward
/// compatibility, this extra flag should be explicitly specified to make the calibration
/// function use the rational model and return 8 coefficients. If the flag is not set, the
/// function computes and returns only 5 distortion coefficients.
/// * **CALIB_THIN_PRISM_MODEL** Coefficients s1, s2, s3 and s4 are enabled. To provide the
/// backward compatibility, this extra flag should be explicitly specified to make the
/// calibration function use the thin prism model and return 12 coefficients. If the flag is not
/// set, the function computes and returns only 5 distortion coefficients.
/// * **CALIB_FIX_S1_S2_S3_S4** The thin prism distortion coefficients are not changed during
/// the optimization. If CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the
/// supplied distCoeffs matrix is used. Otherwise, it is set to 0.
/// * **CALIB_TILTED_MODEL** Coefficients tauX and tauY are enabled. To provide the
/// backward compatibility, this extra flag should be explicitly specified to make the
/// calibration function use the tilted sensor model and return 14 coefficients. If the flag is not
/// set, the function computes and returns only 5 distortion coefficients.
/// * **CALIB_FIX_TAUX_TAUY** The coefficients of the tilted sensor model are not changed during
/// the optimization. If CALIB_USE_INTRINSIC_GUESS is set, the coefficient from the
/// supplied distCoeffs matrix is used. Otherwise, it is set to 0.
/// * criteria: Termination criteria for the iterative optimization algorithm.
///
/// The function estimates transformation between two cameras making a stereo pair. If you have a stereo
/// camera where the relative position and orientation of two cameras is fixed, and if you computed
/// poses of an object relative to the first camera and to the second camera, (R1, T1) and (R2, T2),
/// respectively (this can be done with solvePnP ), then those poses definitely relate to each other.
/// This means that, given ( <span lang='latex'>R_1</span>,<span lang='latex'>T_1</span> ), it should be possible to compute ( <span lang='latex'>R_2</span>,<span lang='latex'>T_2</span> ). You only
/// need to know the position and orientation of the second camera relative to the first camera. This is
/// what the described function does. It computes ( <span lang='latex'>R</span>,<span lang='latex'>T</span> ) so that:
///
/// <div lang='latex'>R_2=R*R_1</div>
/// <div lang='latex'>T_2=R*T_1 + T,</div>
///
/// Optionally, it computes the essential matrix E:
///
/// <div lang='latex'>E= \vecthreethree{0}{-T_2}{T_1}{T_2}{0}{-T_0}{-T_1}{T_0}{0} *R</div>
///
/// where <span lang='latex'>T_i</span> are components of the translation vector <span lang='latex'>T</span> : <span lang='latex'>T=[T_0, T_1, T_2]^T</span> . And the function
/// can also compute the fundamental matrix F:
///
/// <div lang='latex'>F = cameraMatrix2^{-T} E cameraMatrix1^{-1}</div>
///
/// Besides the stereo-related information, the function can also perform a full calibration of each of
/// two cameras. However, due to the high dimensionality of the parameter space and noise in the input
/// data, the function can diverge from the correct solution. If the intrinsic parameters can be
/// estimated with high accuracy for each of the cameras individually (for example, using
/// calibrateCamera ), you are recommended to do so and then pass CALIB_FIX_INTRINSIC flag to the
/// function along with the computed intrinsic parameters. Otherwise, if all the parameters are
/// estimated at once, it makes sense to restrict some parameters, for example, pass
/// CALIB_SAME_FOCAL_LENGTH and CALIB_ZERO_TANGENT_DIST flags, which is usually a
/// reasonable assumption.
///
/// Similarly to calibrateCamera , the function minimizes the total re-projection error for all the
/// points in all the available views from both cameras. The function returns the final value of the
/// re-projection error.
///
/// ## C++ default parameters:
/// * flags: CALIB_FIX_INTRINSIC
/// * criteria: TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 1e-6)
pub fn stereo_calibrate_1(object_points: &types::VectorOfMat, image_points1: &types::VectorOfMat, image_points2: &types::VectorOfMat, camera_matrix1: &mut core::Mat, dist_coeffs1: &mut core::Mat, camera_matrix2: &mut core::Mat, dist_coeffs2: &mut core::Mat, image_size: core::Size, r: &mut core::Mat, t: &mut core::Mat, e: &mut core::Mat, f: &mut core::Mat, per_view_errors: &mut core::Mat, flags: i32, criteria: &core::TermCriteria) -> Result<f64> {
unsafe { sys::cv_core_cv_stereoCalibrate_VectorOfMat_objectPoints_VectorOfMat_imagePoints1_VectorOfMat_imagePoints2_Mat_cameraMatrix1_Mat_distCoeffs1_Mat_cameraMatrix2_Mat_distCoeffs2_Size_imageSize_Mat_R_Mat_T_Mat_E_Mat_F_Mat_perViewErrors_int_flags_TermCriteria_criteria(object_points.as_raw_VectorOfMat(), image_points1.as_raw_VectorOfMat(), image_points2.as_raw_VectorOfMat(), camera_matrix1.as_raw_Mat(), dist_coeffs1.as_raw_Mat(), camera_matrix2.as_raw_Mat(), dist_coeffs2.as_raw_Mat(), image_size, r.as_raw_Mat(), t.as_raw_Mat(), e.as_raw_Mat(), f.as_raw_Mat(), per_view_errors.as_raw_Mat(), flags, criteria.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_stereoCalibrate_VectorOfMat_objectPoints_VectorOfMat_imagePoints1_VectorOfMat_imagePoints2_Mat_cameraMatrix1_Mat_distCoeffs1_Mat_cameraMatrix2_Mat_distCoeffs2_Size_imageSize_Mat_R_Mat_T_Mat_E_Mat_F_int_flags_TermCriteria_criteria
///
/// ## C++ default parameters:
/// * flags: CALIB_FIX_INTRINSIC
/// * criteria: TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 1e-6)
pub fn stereo_calibrate_2(object_points: &types::VectorOfMat, image_points1: &types::VectorOfMat, image_points2: &types::VectorOfMat, camera_matrix1: &mut core::Mat, dist_coeffs1: &mut core::Mat, camera_matrix2: &mut core::Mat, dist_coeffs2: &mut core::Mat, image_size: core::Size, r: &mut core::Mat, t: &mut core::Mat, e: &mut core::Mat, f: &mut core::Mat, flags: i32, criteria: &core::TermCriteria) -> Result<f64> {
unsafe { sys::cv_core_cv_stereoCalibrate_VectorOfMat_objectPoints_VectorOfMat_imagePoints1_VectorOfMat_imagePoints2_Mat_cameraMatrix1_Mat_distCoeffs1_Mat_cameraMatrix2_Mat_distCoeffs2_Size_imageSize_Mat_R_Mat_T_Mat_E_Mat_F_int_flags_TermCriteria_criteria(object_points.as_raw_VectorOfMat(), image_points1.as_raw_VectorOfMat(), image_points2.as_raw_VectorOfMat(), camera_matrix1.as_raw_Mat(), dist_coeffs1.as_raw_Mat(), camera_matrix2.as_raw_Mat(), dist_coeffs2.as_raw_Mat(), image_size, r.as_raw_Mat(), t.as_raw_Mat(), e.as_raw_Mat(), f.as_raw_Mat(), flags, criteria.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_stereoRectifyUncalibrated_Mat_points1_Mat_points2_Mat_F_Size_imgSize_Mat_H1_Mat_H2_double_threshold
/// Computes a rectification transform for an uncalibrated stereo camera.
///
/// ## Parameters
/// * points1: Array of feature points in the first image.
/// * points2: The corresponding points in the second image. The same formats as in
/// findFundamentalMat are supported.
/// * F: Input fundamental matrix. It can be computed from the same set of point pairs using
/// findFundamentalMat .
/// * imgSize: Size of the image.
/// * H1: Output rectification homography matrix for the first image.
/// * H2: Output rectification homography matrix for the second image.
/// * threshold: Optional threshold used to filter out the outliers. If the parameter is greater
/// than zero, all the point pairs that do not comply with the epipolar geometry (that is, the points
/// for which <span lang='latex'>|\texttt{points2[i]}^T*\texttt{F}*\texttt{points1[i]}|>\texttt{threshold}</span> ) are
/// rejected prior to computing the homographies. Otherwise, all the points are considered inliers.
///
/// The function computes the rectification transformations without knowing intrinsic parameters of the
/// cameras and their relative position in the space, which explains the suffix "uncalibrated". Another
/// related difference from stereoRectify is that the function outputs not the rectification
/// transformations in the object (3D) space, but the planar perspective transformations encoded by the
/// homography matrices H1 and H2 . The function implements the algorithm @cite Hartley99 .
///
///
/// Note:
/// While the algorithm does not need to know the intrinsic parameters of the cameras, it heavily
/// depends on the epipolar geometry. Therefore, if the camera lenses have a significant distortion,
/// it would be better to correct it before computing the fundamental matrix and calling this
/// function. For example, distortion coefficients can be estimated for each head of stereo camera
/// separately by using calibrateCamera . Then, the images can be corrected using undistort , or
/// just the point coordinates can be corrected with undistortPoints .
///
/// ## C++ default parameters:
/// * threshold: 5
pub fn stereo_rectify_uncalibrated(points1: &core::Mat, points2: &core::Mat, f: &core::Mat, img_size: core::Size, h1: &mut core::Mat, h2: &mut core::Mat, threshold: f64) -> Result<bool> {
unsafe { sys::cv_core_cv_stereoRectifyUncalibrated_Mat_points1_Mat_points2_Mat_F_Size_imgSize_Mat_H1_Mat_H2_double_threshold(points1.as_raw_Mat(), points2.as_raw_Mat(), f.as_raw_Mat(), img_size, h1.as_raw_Mat(), h2.as_raw_Mat(), threshold) }.into_result()
}
// identifier: cv_stereoRectify_Mat_cameraMatrix1_Mat_distCoeffs1_Mat_cameraMatrix2_Mat_distCoeffs2_Size_imageSize_Mat_R_Mat_T_Mat_R1_Mat_R2_Mat_P1_Mat_P2_Mat_Q_int_flags_double_alpha_Size_newImageSize_Rect_X_validPixROI1_Rect_X_validPixROI2
/// Computes rectification transforms for each head of a calibrated stereo camera.
///
/// ## Parameters
/// * cameraMatrix1: First camera matrix.
/// * distCoeffs1: First camera distortion parameters.
/// * cameraMatrix2: Second camera matrix.
/// * distCoeffs2: Second camera distortion parameters.
/// * imageSize: Size of the image used for stereo calibration.
/// * R: Rotation matrix between the coordinate systems of the first and the second cameras.
/// * T: Translation vector between coordinate systems of the cameras.
/// * R1: Output 3x3 rectification transform (rotation matrix) for the first camera.
/// * R2: Output 3x3 rectification transform (rotation matrix) for the second camera.
/// * P1: Output 3x4 projection matrix in the new (rectified) coordinate systems for the first
/// camera.
/// * P2: Output 3x4 projection matrix in the new (rectified) coordinate systems for the second
/// camera.
/// * Q: Output <span lang='latex'>4 \times 4</span> disparity-to-depth mapping matrix (see reprojectImageTo3D ).
/// * flags: Operation flags that may be zero or CALIB_ZERO_DISPARITY . If the flag is set,
/// the function makes the principal points of each camera have the same pixel coordinates in the
/// rectified views. And if the flag is not set, the function may still shift the images in the
/// horizontal or vertical direction (depending on the orientation of epipolar lines) to maximize the
/// useful image area.
/// * alpha: Free scaling parameter. If it is -1 or absent, the function performs the default
/// scaling. Otherwise, the parameter should be between 0 and 1. alpha=0 means that the rectified
/// images are zoomed and shifted so that only valid pixels are visible (no black areas after
/// rectification). alpha=1 means that the rectified image is decimated and shifted so that all the
/// pixels from the original images from the cameras are retained in the rectified images (no source
/// image pixels are lost). Obviously, any intermediate value yields an intermediate result between
/// those two extreme cases.
/// * newImageSize: New image resolution after rectification. The same size should be passed to
/// initUndistortRectifyMap (see the stereo_calib.cpp sample in OpenCV samples directory). When (0,0)
/// is passed (default), it is set to the original imageSize . Setting it to larger value can help you
/// preserve details in the original image, especially when there is a big radial distortion.
/// * validPixROI1: Optional output rectangles inside the rectified images where all the pixels
/// are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller
/// (see the picture below).
/// * validPixROI2: Optional output rectangles inside the rectified images where all the pixels
/// are valid. If alpha=0 , the ROIs cover the whole images. Otherwise, they are likely to be smaller
/// (see the picture below).
///
/// The function computes the rotation matrices for each camera that (virtually) make both camera image
/// planes the same plane. Consequently, this makes all the epipolar lines parallel and thus simplifies
/// the dense stereo correspondence problem. The function takes the matrices computed by stereoCalibrate
/// as input. As output, it provides two rotation matrices and also two projection matrices in the new
/// coordinates. The function distinguishes the following two cases:
///
/// * **Horizontal stereo**: the first and the second camera views are shifted relative to each other
/// mainly along the x axis (with possible small vertical shift). In the rectified images, the
/// corresponding epipolar lines in the left and right cameras are horizontal and have the same
/// y-coordinate. P1 and P2 look like:
///
/// <div lang='latex'>\texttt{P1} = \begin{bmatrix} f & 0 & cx_1 & 0 \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}</div>
///
/// <div lang='latex'>\texttt{P2} = \begin{bmatrix} f & 0 & cx_2 & T_x*f \\ 0 & f & cy & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix} ,</div>
///
/// where <span lang='latex'>T_x</span> is a horizontal shift between the cameras and <span lang='latex'>cx_1=cx_2</span> if
/// CALIB_ZERO_DISPARITY is set.
///
/// * **Vertical stereo**: the first and the second camera views are shifted relative to each other
/// mainly in vertical direction (and probably a bit in the horizontal direction too). The epipolar
/// lines in the rectified images are vertical and have the same x-coordinate. P1 and P2 look like:
///
/// <div lang='latex'>\texttt{P1} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_1 & 0 \\ 0 & 0 & 1 & 0 \end{bmatrix}</div>
///
/// <div lang='latex'>\texttt{P2} = \begin{bmatrix} f & 0 & cx & 0 \\ 0 & f & cy_2 & T_y*f \\ 0 & 0 & 1 & 0 \end{bmatrix} ,</div>
///
/// where <span lang='latex'>T_y</span> is a vertical shift between the cameras and <span lang='latex'>cy_1=cy_2</span> if CALIB_ZERO_DISPARITY is
/// set.
///
/// As you can see, the first three columns of P1 and P2 will effectively be the new "rectified" camera
/// matrices. The matrices, together with R1 and R2 , can then be passed to initUndistortRectifyMap to
/// initialize the rectification map for each camera.
///
/// See below the screenshot from the stereo_calib.cpp sample. Some red horizontal lines pass through
/// the corresponding image regions. This means that the images are well rectified, which is what most
/// stereo correspondence algorithms rely on. The green rectangles are roi1 and roi2 . You see that
/// their interiors are all valid pixels.
///
/// 
///
/// ## C++ default parameters:
/// * flags: CALIB_ZERO_DISPARITY
/// * alpha: -1
/// * new_image_size: Size()
/// * valid_pix_roi1: 0
/// * valid_pix_roi2: 0
pub fn stereo_rectify_1(camera_matrix1: &core::Mat, dist_coeffs1: &core::Mat, camera_matrix2: &core::Mat, dist_coeffs2: &core::Mat, image_size: core::Size, r: &core::Mat, t: &core::Mat, r1: &mut core::Mat, r2: &mut core::Mat, p1: &mut core::Mat, p2: &mut core::Mat, q: &mut core::Mat, flags: i32, alpha: f64, new_image_size: core::Size, valid_pix_roi1: &mut core::Rect, valid_pix_roi2: &mut core::Rect) -> Result<()> {
unsafe { sys::cv_core_cv_stereoRectify_Mat_cameraMatrix1_Mat_distCoeffs1_Mat_cameraMatrix2_Mat_distCoeffs2_Size_imageSize_Mat_R_Mat_T_Mat_R1_Mat_R2_Mat_P1_Mat_P2_Mat_Q_int_flags_double_alpha_Size_newImageSize_Rect_X_validPixROI1_Rect_X_validPixROI2(camera_matrix1.as_raw_Mat(), dist_coeffs1.as_raw_Mat(), camera_matrix2.as_raw_Mat(), dist_coeffs2.as_raw_Mat(), image_size, r.as_raw_Mat(), t.as_raw_Mat(), r1.as_raw_Mat(), r2.as_raw_Mat(), p1.as_raw_Mat(), p2.as_raw_Mat(), q.as_raw_Mat(), flags, alpha, new_image_size, valid_pix_roi1, valid_pix_roi2) }.into_result()
}
// identifier: cv_stopLoop
pub fn stop_loop() -> Result<()> {
unsafe { sys::cv_core_cv_stopLoop() }.into_result()
}
// identifier: cv_stylization_Mat_src_Mat_dst_float_sigma_s_float_sigma_r
/// Stylization aims to produce digital imagery with a wide variety of effects not focused on
/// photorealism. Edge-aware filters are ideal for stylization, as they can abstract regions of low
/// contrast while preserving, or enhancing, high-contrast features.
///
/// ## Parameters
/// * src: Input 8-bit 3-channel image.
/// * dst: Output image with the same size and type as src.
/// * sigma_s: Range between 0 to 200.
/// * sigma_r: Range between 0 to 1.
///
/// ## C++ default parameters:
/// * sigma_s: 60
/// * sigma_r: 0.45f
pub fn stylization(src: &core::Mat, dst: &mut core::Mat, sigma_s: f32, sigma_r: f32) -> Result<()> {
unsafe { sys::cv_core_cv_stylization_Mat_src_Mat_dst_float_sigma_s_float_sigma_r(src.as_raw_Mat(), dst.as_raw_Mat(), sigma_s, sigma_r) }.into_result()
}
// identifier: cv_subtract_Mat_src1_Mat_src2_Mat_dst_Mat_mask_int_dtype
/// Calculates the per-element difference between two arrays or array and a scalar.
///
/// The function subtract calculates:
/// - Difference between two arrays, when both input arrays have the same size and the same number of
/// channels:
/// <div lang='latex'>\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1}(I) - \texttt{src2}(I)) \quad \texttt{if mask}(I) \ne0</div>
/// - Difference between an array and a scalar, when src2 is constructed from Scalar or has the same
/// number of elements as `src1.channels()`:
/// <div lang='latex'>\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1}(I) - \texttt{src2} ) \quad \texttt{if mask}(I) \ne0</div>
/// - Difference between a scalar and an array, when src1 is constructed from Scalar or has the same
/// number of elements as `src2.channels()`:
/// <div lang='latex'>\texttt{dst}(I) = \texttt{saturate} ( \texttt{src1} - \texttt{src2}(I) ) \quad \texttt{if mask}(I) \ne0</div>
/// - The reverse difference between a scalar and an array in the case of `SubRS`:
/// <div lang='latex'>\texttt{dst}(I) = \texttt{saturate} ( \texttt{src2} - \texttt{src1}(I) ) \quad \texttt{if mask}(I) \ne0</div>
/// where I is a multi-dimensional index of array elements. In case of multi-channel arrays, each
/// channel is processed independently.
///
/// The first function in the list above can be replaced with matrix expressions:
/// ```ignore{.cpp}
/// dst = src1 - src2;
/// dst -= src1; // equivalent to subtract(dst, src1, dst);
/// ```
///
/// The input arrays and the output array can all have the same or different depths. For example, you
/// can subtract to 8-bit unsigned arrays and store the difference in a 16-bit signed array. Depth of
/// the output array is determined by dtype parameter. In the second and third cases above, as well as
/// in the first case, when src1.depth() == src2.depth(), dtype can be set to the default -1. In this
/// case the output array will have the same depth as the input array, be it src1, src2 or both.
///
/// Note: Saturation is not applied when the output array has the depth CV_32S. You may even get
/// result of an incorrect sign in the case of overflow.
/// ## Parameters
/// * src1: first input array or a scalar.
/// * src2: second input array or a scalar.
/// * dst: output array of the same size and the same number of channels as the input array.
/// * mask: optional operation mask; this is an 8-bit single channel array that specifies elements
/// of the output array to be changed.
/// * dtype: optional depth of the output array
/// @sa add, addWeighted, scaleAdd, Mat::convertTo
///
/// ## C++ default parameters:
/// * mask: noArray()
/// * dtype: -1
pub fn subtract(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat, mask: &core::Mat, dtype: i32) -> Result<()> {
unsafe { sys::cv_core_cv_subtract_Mat_src1_Mat_src2_Mat_dst_Mat_mask_int_dtype(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat(), mask.as_raw_Mat(), dtype) }.into_result()
}
// identifier: cv_sum_Mat_src
/// Calculates the sum of array elements.
///
/// The function cv::sum calculates and returns the sum of array elements,
/// independently for each channel.
/// ## Parameters
/// * src: input array that must have from 1 to 4 channels.
/// @sa countNonZero, mean, meanStdDev, norm, minMaxLoc, reduce
pub fn sum(src: &core::Mat) -> Result<core::Scalar> {
unsafe { sys::cv_core_cv_sum_Mat_src(src.as_raw_Mat()) }.into_result()
}
// identifier: cv_superres_createFrameSource_Camera_int_deviceId
///
/// ## C++ default parameters:
/// * device_id: 0
pub fn create_frame_source__camera(device_id: i32) -> Result<types::PtrOfFrameSource> {
unsafe { sys::cv_core_cv_superres_createFrameSource_Camera_int_deviceId(device_id) }.into_result().map(|x| types::PtrOfFrameSource { ptr: x })
}
// identifier: cv_superres_createFrameSource_Empty
pub fn create_frame_source__empty() -> Result<types::PtrOfFrameSource> {
unsafe { sys::cv_core_cv_superres_createFrameSource_Empty() }.into_result().map(|x| types::PtrOfFrameSource { ptr: x })
}
// identifier: cv_superres_createFrameSource_Video_CUDA_String_fileName
pub fn create_frame_source__video_cuda(file_name: &str) -> Result<types::PtrOfFrameSource> {
string_arg!(file_name);
unsafe { sys::cv_core_cv_superres_createFrameSource_Video_CUDA_String_fileName(file_name.as_ptr()) }.into_result().map(|x| types::PtrOfFrameSource { ptr: x })
}
// identifier: cv_superres_createFrameSource_Video_String_fileName
pub fn create_frame_source__video(file_name: &str) -> Result<types::PtrOfFrameSource> {
string_arg!(file_name);
unsafe { sys::cv_core_cv_superres_createFrameSource_Video_String_fileName(file_name.as_ptr()) }.into_result().map(|x| types::PtrOfFrameSource { ptr: x })
}
// identifier: cv_superres_createSuperResolution_BTVL1
/// Create Bilateral TV-L1 Super Resolution.
///
/// This class implements Super Resolution algorithm described in the papers @cite Farsiu03 and
/// @cite Mitzel09 .
///
/// Here are important members of the class that control the algorithm, which you can set after
/// constructing the class instance:
///
/// * **int scale** Scale factor.
/// * **int iterations** Iteration count.
/// * **double tau** Asymptotic value of steepest descent method.
/// * **double lambda** Weight parameter to balance data term and smoothness term.
/// * **double alpha** Parameter of spacial distribution in Bilateral-TV.
/// * **int btvKernelSize** Kernel size of Bilateral-TV filter.
/// * **int blurKernelSize** Gaussian blur kernel size.
/// * **double blurSigma** Gaussian blur sigma.
/// * **int temporalAreaRadius** Radius of the temporal search area.
/// * **Ptr\<DenseOpticalFlowExt\> opticalFlow** Dense optical flow algorithm.
pub fn create_super_resolution_btvl1() -> Result<types::PtrOfSuperResolution> {
unsafe { sys::cv_core_cv_superres_createSuperResolution_BTVL1() }.into_result().map(|x| types::PtrOfSuperResolution { ptr: x })
}
// identifier: cv_superres_createSuperResolution_BTVL1_CUDA
pub fn create_super_resolution_btvl1_cuda() -> Result<types::PtrOfSuperResolution> {
unsafe { sys::cv_core_cv_superres_createSuperResolution_BTVL1_CUDA() }.into_result().map(|x| types::PtrOfSuperResolution { ptr: x })
}
// identifier: cv_swap_Mat_a_Mat_b
/// Swaps two matrices
pub fn swap(a: &core::Mat, b: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_swap_Mat_a_Mat_b(a.as_raw_Mat(), b.as_raw_Mat()) }.into_result()
}
// identifier: cv_tempfile_const_char_X_suffix
///
/// ## C++ default parameters:
/// * suffix: 0
pub fn tempfile(suffix: &str) -> Result<String> {
string_arg!(suffix);
unsafe { sys::cv_core_cv_tempfile_const_char_X_suffix(suffix.as_ptr()) }.into_result().map(crate::templ::receive_string_mut)
}
// identifier: cv_textureFlattening_Mat_src_Mat_mask_Mat_dst_float_low_threshold_float_high_threshold_int_kernel_size
/// By retaining only the gradients at edge locations, before integrating with the Poisson solver, one
/// washes out the texture of the selected region, giving its contents a flat aspect. Here Canny Edge
/// Detector is used.
///
/// ## Parameters
/// * src: Input 8-bit 3-channel image.
/// * mask: Input 8-bit 1 or 3-channel image.
/// * dst: Output image with the same size and type as src.
/// * low_threshold: Range from 0 to 100.
/// * high_threshold: Value \> 100.
/// * kernel_size: The size of the Sobel kernel to be used.
///
/// **NOTE:**
///
/// The algorithm assumes that the color of the source image is close to that of the destination. This
/// assumption means that when the colors don't match, the source image color gets tinted toward the
/// color of the destination image.
///
/// ## C++ default parameters:
/// * low_threshold: 30
/// * high_threshold: 45
/// * kernel_size: 3
pub fn texture_flattening(src: &core::Mat, mask: &core::Mat, dst: &mut core::Mat, low_threshold: f32, high_threshold: f32, kernel_size: i32) -> Result<()> {
unsafe { sys::cv_core_cv_textureFlattening_Mat_src_Mat_mask_Mat_dst_float_low_threshold_float_high_threshold_int_kernel_size(src.as_raw_Mat(), mask.as_raw_Mat(), dst.as_raw_Mat(), low_threshold, high_threshold, kernel_size) }.into_result()
}
// identifier: cv_threshold_Mat_src_Mat_dst_double_thresh_double_maxval_int_type
/// Applies a fixed-level threshold to each array element.
///
/// The function applies fixed-level thresholding to a multiple-channel array. The function is typically
/// used to get a bi-level (binary) image out of a grayscale image ( #compare could be also used for
/// this purpose) or for removing a noise, that is, filtering out pixels with too small or too large
/// values. There are several types of thresholding supported by the function. They are determined by
/// type parameter.
///
/// Also, the special values #THRESH_OTSU or #THRESH_TRIANGLE may be combined with one of the
/// above values. In these cases, the function determines the optimal threshold value using the Otsu's
/// or Triangle algorithm and uses it instead of the specified thresh.
///
///
/// Note: Currently, the Otsu's and Triangle methods are implemented only for 8-bit single-channel images.
///
/// ## Parameters
/// * src: input array (multiple-channel, 8-bit or 32-bit floating point).
/// * dst: output array of the same size and type and the same number of channels as src.
/// * thresh: threshold value.
/// * maxval: maximum value to use with the #THRESH_BINARY and #THRESH_BINARY_INV thresholding
/// types.
/// * type: thresholding type (see #ThresholdTypes).
/// @return the computed threshold value if Otsu's or Triangle methods used.
///
/// @sa adaptiveThreshold, findContours, compare, min, max
pub fn threshold(src: &core::Mat, dst: &mut core::Mat, thresh: f64, maxval: f64, _type: i32) -> Result<f64> {
unsafe { sys::cv_core_cv_threshold_Mat_src_Mat_dst_double_thresh_double_maxval_int_type(src.as_raw_Mat(), dst.as_raw_Mat(), thresh, maxval, _type) }.into_result()
}
// identifier: cv_trace_Mat_mtx
/// Returns the trace of a matrix.
///
/// The function cv::trace returns the sum of the diagonal elements of the
/// matrix mtx .
/// <div lang='latex'>\mathrm{tr} ( \texttt{mtx} ) = \sum _i \texttt{mtx} (i,i)</div>
/// ## Parameters
/// * mtx: input matrix.
pub fn trace(mtx: &core::Mat) -> Result<core::Scalar> {
unsafe { sys::cv_core_cv_trace_Mat_mtx(mtx.as_raw_Mat()) }.into_result()
}
// identifier: cv_transform_Mat_src_Mat_dst_Mat_m
/// Performs the matrix transformation of every array element.
///
/// The function cv::transform performs the matrix transformation of every
/// element of the array src and stores the results in dst :
/// <div lang='latex'>\texttt{dst} (I) = \texttt{m} \cdot \texttt{src} (I)</div>
/// (when m.cols=src.channels() ), or
/// <div lang='latex'>\texttt{dst} (I) = \texttt{m} \cdot [ \texttt{src} (I); 1]</div>
/// (when m.cols=src.channels()+1 )
///
/// Every element of the N -channel array src is interpreted as N -element
/// vector that is transformed using the M x N or M x (N+1) matrix m to
/// M-element vector - the corresponding element of the output array dst .
///
/// The function may be used for geometrical transformation of
/// N -dimensional points, arbitrary linear color space transformation (such
/// as various kinds of RGB to YUV transforms), shuffling the image
/// channels, and so forth.
/// ## Parameters
/// * src: input array that must have as many channels (1 to 4) as
/// m.cols or m.cols-1.
/// * dst: output array of the same size and depth as src; it has as
/// many channels as m.rows.
/// * m: transformation 2x2 or 2x3 floating-point matrix.
/// @sa perspectiveTransform, getAffineTransform, estimateAffine2D, warpAffine, warpPerspective
pub fn transform(src: &core::Mat, dst: &mut core::Mat, m: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_transform_Mat_src_Mat_dst_Mat_m(src.as_raw_Mat(), dst.as_raw_Mat(), m.as_raw_Mat()) }.into_result()
}
// identifier: cv_transpose_Mat_src_Mat_dst
/// Transposes a matrix.
///
/// The function cv::transpose transposes the matrix src :
/// <div lang='latex'>\texttt{dst} (i,j) = \texttt{src} (j,i)</div>
///
/// Note: No complex conjugation is done in case of a complex matrix. It
/// should be done separately if needed.
/// ## Parameters
/// * src: input array.
/// * dst: output array of the same type as src.
pub fn transpose(src: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_transpose_Mat_src_Mat_dst(src.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_triangulatePoints_Mat_projMatr1_Mat_projMatr2_Mat_projPoints1_Mat_projPoints2_Mat_points4D
/// Reconstructs points by triangulation.
///
/// ## Parameters
/// * projMatr1: 3x4 projection matrix of the first camera.
/// * projMatr2: 3x4 projection matrix of the second camera.
/// * projPoints1: 2xN array of feature points in the first image. In case of c++ version it can
/// be also a vector of feature points or two-channel matrix of size 1xN or Nx1.
/// * projPoints2: 2xN array of corresponding points in the second image. In case of c++ version
/// it can be also a vector of feature points or two-channel matrix of size 1xN or Nx1.
/// * points4D: 4xN array of reconstructed points in homogeneous coordinates.
///
/// The function reconstructs 3-dimensional points (in homogeneous coordinates) by using their
/// observations with a stereo camera. Projections matrices can be obtained from stereoRectify.
///
///
/// Note:
/// Keep in mind that all input data should be of float type in order for this function to work.
///
/// @sa
/// reprojectImageTo3D
pub fn triangulate_points(proj_matr1: &core::Mat, proj_matr2: &core::Mat, proj_points1: &core::Mat, proj_points2: &core::Mat, points4_d: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_triangulatePoints_Mat_projMatr1_Mat_projMatr2_Mat_projPoints1_Mat_projPoints2_Mat_points4D(proj_matr1.as_raw_Mat(), proj_matr2.as_raw_Mat(), proj_points1.as_raw_Mat(), proj_points2.as_raw_Mat(), points4_d.as_raw_Mat()) }.into_result()
}
// identifier: cv_undistortPoints_Mat_src_Mat_dst_Mat_cameraMatrix_Mat_distCoeffs_Mat_R_Mat_P
/// Computes the ideal point coordinates from the observed point coordinates.
///
/// The function is similar to #undistort and #initUndistortRectifyMap but it operates on a
/// sparse set of points instead of a raster image. Also the function performs a reverse transformation
/// to projectPoints. In case of a 3D object, it does not reconstruct its 3D coordinates, but for a
/// planar object, it does, up to a translation vector, if the proper R is specified.
///
/// For each observed point coordinate <span lang='latex'>(u, v)</span> the function computes:
/// <div lang='latex'>
/// \begin{array}{l}
/// x^{"} \leftarrow (u - c_x)/f_x \\
/// y^{"} \leftarrow (v - c_y)/f_y \\
/// (x',y') = undistort(x^{"},y^{"}, \texttt{distCoeffs}) \\
/// {[X\,Y\,W]} ^T \leftarrow R*[x' \, y' \, 1]^T \\
/// x \leftarrow X/W \\
/// y \leftarrow Y/W \\
/// \text{only performed if P is specified:} \\
/// u' \leftarrow x {f'}_x + {c'}_x \\
/// v' \leftarrow y {f'}_y + {c'}_y
/// \end{array}
/// </div>
///
/// where *undistort* is an approximate iterative algorithm that estimates the normalized original
/// point coordinates out of the normalized distorted point coordinates ("normalized" means that the
/// coordinates do not depend on the camera matrix).
///
/// The function can be used for both a stereo camera head or a monocular camera (when R is empty).
///
/// ## Parameters
/// * src: Observed point coordinates, 1xN or Nx1 2-channel (CV_32FC2 or CV_64FC2).
/// * dst: Output ideal point coordinates after undistortion and reverse perspective
/// transformation. If matrix P is identity or omitted, dst will contain normalized point coordinates.
/// * cameraMatrix: Camera matrix <span lang='latex'>\vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}</span> .
/// * distCoeffs: Input vector of distortion coefficients
/// <span lang='latex'>(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])</span>
/// of 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
/// * R: Rectification transformation in the object space (3x3 matrix). R1 or R2 computed by
/// #stereoRectify can be passed here. If the matrix is empty, the identity transformation is used.
/// * P: New camera matrix (3x3) or new projection matrix (3x4) <span lang='latex'>\begin{bmatrix} {f'}_x & 0 & {c'}_x & t_x \\ 0 & {f'}_y & {c'}_y & t_y \\ 0 & 0 & 1 & t_z \end{bmatrix}</span>. P1 or P2 computed by
/// #stereoRectify can be passed here. If the matrix is empty, the identity new camera matrix is used.
///
/// ## C++ default parameters:
/// * r: noArray()
/// * p: noArray()
pub fn undistort_points(src: &core::Mat, dst: &mut core::Mat, camera_matrix: &core::Mat, dist_coeffs: &core::Mat, r: &core::Mat, p: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_undistortPoints_Mat_src_Mat_dst_Mat_cameraMatrix_Mat_distCoeffs_Mat_R_Mat_P(src.as_raw_Mat(), dst.as_raw_Mat(), camera_matrix.as_raw_Mat(), dist_coeffs.as_raw_Mat(), r.as_raw_Mat(), p.as_raw_Mat()) }.into_result()
}
// identifier: cv_undistortPoints_Mat_src_Mat_dst_Mat_cameraMatrix_Mat_distCoeffs_Mat_R_Mat_P_TermCriteria_criteria
/// @overload
///
/// Note: Default version of #undistortPoints does 5 iterations to compute undistorted points.
pub fn undistort_points_1(src: &core::Mat, dst: &mut core::Mat, camera_matrix: &core::Mat, dist_coeffs: &core::Mat, r: &core::Mat, p: &core::Mat, criteria: &core::TermCriteria) -> Result<()> {
unsafe { sys::cv_core_cv_undistortPoints_Mat_src_Mat_dst_Mat_cameraMatrix_Mat_distCoeffs_Mat_R_Mat_P_TermCriteria_criteria(src.as_raw_Mat(), dst.as_raw_Mat(), camera_matrix.as_raw_Mat(), dist_coeffs.as_raw_Mat(), r.as_raw_Mat(), p.as_raw_Mat(), criteria.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_undistort_Mat_src_Mat_dst_Mat_cameraMatrix_Mat_distCoeffs_Mat_newCameraMatrix
/// Transforms an image to compensate for lens distortion.
///
/// The function transforms an image to compensate radial and tangential lens distortion.
///
/// The function is simply a combination of #initUndistortRectifyMap (with unity R ) and #remap
/// (with bilinear interpolation). See the former function for details of the transformation being
/// performed.
///
/// Those pixels in the destination image, for which there is no correspondent pixels in the source
/// image, are filled with zeros (black color).
///
/// A particular subset of the source image that will be visible in the corrected image can be regulated
/// by newCameraMatrix. You can use #getOptimalNewCameraMatrix to compute the appropriate
/// newCameraMatrix depending on your requirements.
///
/// The camera matrix and the distortion parameters can be determined using #calibrateCamera. If
/// the resolution of images is different from the resolution used at the calibration stage, \f$f_x,
/// f_y, c_x<span lang='latex'> and </span>c_y\f$ need to be scaled accordingly, while the distortion coefficients remain
/// the same.
///
/// ## Parameters
/// * src: Input (distorted) image.
/// * dst: Output (corrected) image that has the same size and type as src .
/// * cameraMatrix: Input camera matrix <span lang='latex'>A = \vecthreethree{f_x}{0}{c_x}{0}{f_y}{c_y}{0}{0}{1}</span> .
/// * distCoeffs: Input vector of distortion coefficients
/// <span lang='latex'>(k_1, k_2, p_1, p_2[, k_3[, k_4, k_5, k_6[, s_1, s_2, s_3, s_4[, \tau_x, \tau_y]]]])</span>
/// of 4, 5, 8, 12 or 14 elements. If the vector is NULL/empty, the zero distortion coefficients are assumed.
/// * newCameraMatrix: Camera matrix of the distorted image. By default, it is the same as
/// cameraMatrix but you may additionally scale and shift the result by using a different matrix.
///
/// ## C++ default parameters:
/// * new_camera_matrix: noArray()
pub fn undistort(src: &core::Mat, dst: &mut core::Mat, camera_matrix: &core::Mat, dist_coeffs: &core::Mat, new_camera_matrix: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_undistort_Mat_src_Mat_dst_Mat_cameraMatrix_Mat_distCoeffs_Mat_newCameraMatrix(src.as_raw_Mat(), dst.as_raw_Mat(), camera_matrix.as_raw_Mat(), dist_coeffs.as_raw_Mat(), new_camera_matrix.as_raw_Mat()) }.into_result()
}
// identifier: cv_updateWindow_String_winname
/// Force window to redraw its context and call draw callback ( See cv::setOpenGlDrawCallback ).
///
/// ## Parameters
/// * winname: Name of the window.
pub fn update_window(winname: &str) -> Result<()> {
string_arg!(winname);
unsafe { sys::cv_core_cv_updateWindow_String_winname(winname.as_ptr()) }.into_result()
}
// identifier: cv_useOpenVX
pub fn use_open_vx() -> Result<bool> {
unsafe { sys::cv_core_cv_useOpenVX() }.into_result()
}
// identifier: cv_useOptimized
/// Returns the status of optimized code usage.
///
/// The function returns true if the optimized code is enabled. Otherwise, it returns false.
pub fn use_optimized() -> Result<bool> {
unsafe { sys::cv_core_cv_useOptimized() }.into_result()
}
// identifier: cv_utils_getThreadID
pub fn get_thread_id() -> Result<i32> {
unsafe { sys::cv_core_cv_utils_getThreadID() }.into_result()
}
// identifier: cv_va_intel_convertFromVASurface_void_X_display_unsigned_int_surface_Size_size_Mat_dst
/// Converts VASurfaceID object to OutputArray.
/// ## Parameters
/// * display: - VADisplay object.
/// * surface: - source VASurfaceID object.
/// * size: - size of image represented by VASurfaceID object.
/// * dst: - destination OutputArray.
pub fn convert_from_va_surface(display: &mut c_void, surface: u32, size: core::Size, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_va_intel_convertFromVASurface_void_X_display_unsigned_int_surface_Size_size_Mat_dst(display, surface, size, dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_va_intel_convertToVASurface_void_X_display_Mat_src_unsigned_int_surface_Size_size
/// Converts InputArray to VASurfaceID object.
/// ## Parameters
/// * display: - VADisplay object.
/// * src: - source InputArray.
/// * surface: - destination VASurfaceID object.
/// * size: - size of image represented by VASurfaceID object.
pub fn convert_to_va_surface(display: &mut c_void, src: &core::Mat, surface: u32, size: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_va_intel_convertToVASurface_void_X_display_Mat_src_unsigned_int_surface_Size_size(display, src.as_raw_Mat(), surface, size) }.into_result()
}
// identifier: cv_validateDisparity_Mat_disparity_Mat_cost_int_minDisparity_int_numberOfDisparities_int_disp12MaxDisp
///
/// ## C++ default parameters:
/// * disp12_max_disp: 1
pub fn validate_disparity(disparity: &mut core::Mat, cost: &core::Mat, min_disparity: i32, number_of_disparities: i32, disp12_max_disp: i32) -> Result<()> {
unsafe { sys::cv_core_cv_validateDisparity_Mat_disparity_Mat_cost_int_minDisparity_int_numberOfDisparities_int_disp12MaxDisp(disparity.as_raw_Mat(), cost.as_raw_Mat(), min_disparity, number_of_disparities, disp12_max_disp) }.into_result()
}
// identifier: cv_vconcat_Mat_src1_Mat_src2_Mat_dst
/// @overload
/// ```ignore{.cpp}
/// cv::Mat_<float> A = (cv::Mat_<float>(3, 2) << 1, 7,
/// 2, 8,
/// 3, 9);
/// cv::Mat_<float> B = (cv::Mat_<float>(3, 2) << 4, 10,
/// 5, 11,
/// 6, 12);
///
/// cv::Mat C;
/// cv::vconcat(A, B, C);
/// //C:
/// //[1, 7;
/// // 2, 8;
/// // 3, 9;
/// // 4, 10;
/// // 5, 11;
/// // 6, 12]
/// ```
///
/// ## Parameters
/// * src1: first input array to be considered for vertical concatenation.
/// * src2: second input array to be considered for vertical concatenation.
/// * dst: output array. It has the same number of cols and depth as the src1 and src2, and the sum of rows of the src1 and src2.
pub fn vconcat(src1: &core::Mat, src2: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_vconcat_Mat_src1_Mat_src2_Mat_dst(src1.as_raw_Mat(), src2.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_vconcat_VectorOfMat_src_Mat_dst
/// @overload
/// ```ignore{.cpp}
/// std::vector<cv::Mat> matrices = { cv::Mat(1, 4, CV_8UC1, cv::Scalar(1)),
/// cv::Mat(1, 4, CV_8UC1, cv::Scalar(2)),
/// cv::Mat(1, 4, CV_8UC1, cv::Scalar(3)),};
///
/// cv::Mat out;
/// cv::vconcat( matrices, out );
/// //out:
/// //[1, 1, 1, 1;
/// // 2, 2, 2, 2;
/// // 3, 3, 3, 3]
/// ```
///
/// ## Parameters
/// * src: input array or vector of matrices. all of the matrices must have the same number of cols and the same depth
/// * dst: output array. It has the same number of cols and depth as the src, and the sum of rows of the src.
/// same depth.
pub fn vconcat_1(src: &types::VectorOfMat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_vconcat_VectorOfMat_src_Mat_dst(src.as_raw_VectorOfMat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_vconcat_const_Mat_src_size_t_nsrc_Mat_dst
/// Applies vertical concatenation to given matrices.
///
/// The function vertically concatenates two or more cv::Mat matrices (with the same number of cols).
/// ```ignore{.cpp}
/// cv::Mat matArray[] = { cv::Mat(1, 4, CV_8UC1, cv::Scalar(1)),
/// cv::Mat(1, 4, CV_8UC1, cv::Scalar(2)),
/// cv::Mat(1, 4, CV_8UC1, cv::Scalar(3)),};
///
/// cv::Mat out;
/// cv::vconcat( matArray, 3, out );
/// //out:
/// //[1, 1, 1, 1;
/// // 2, 2, 2, 2;
/// // 3, 3, 3, 3]
/// ```
///
/// ## Parameters
/// * src: input array or vector of matrices. all of the matrices must have the same number of cols and the same depth.
/// * nsrc: number of matrices in src.
/// * dst: output array. It has the same number of cols and depth as the src, and the sum of rows of the src.
/// @sa cv::hconcat(const Mat*, size_t, OutputArray), @sa cv::hconcat(InputArrayOfArrays, OutputArray) and @sa cv::hconcat(InputArray, InputArray, OutputArray)
pub fn vconcat_2(src: &core::Mat, nsrc: size_t, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_vconcat_const_Mat_src_size_t_nsrc_Mat_dst(src.as_raw_Mat(), nsrc, dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_videostab_calcBlurriness_Mat_frame
pub fn calc_blurriness(frame: &core::Mat) -> Result<f32> {
unsafe { sys::cv_core_cv_videostab_calcBlurriness_Mat_frame(frame.as_raw_Mat()) }.into_result()
}
// identifier: cv_videostab_calcFlowMask_Mat_flowX_Mat_flowY_Mat_errors_float_maxError_Mat_mask0_Mat_mask1_Mat_flowMask
pub fn calc_flow_mask(flow_x: &core::Mat, flow_y: &core::Mat, errors: &core::Mat, max_error: f32, mask0: &core::Mat, mask1: &core::Mat, flow_mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_calcFlowMask_Mat_flowX_Mat_flowY_Mat_errors_float_maxError_Mat_mask0_Mat_mask1_Mat_flowMask(flow_x.as_raw_Mat(), flow_y.as_raw_Mat(), errors.as_raw_Mat(), max_error, mask0.as_raw_Mat(), mask1.as_raw_Mat(), flow_mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_videostab_completeFrameAccordingToFlow_Mat_flowMask_Mat_flowX_Mat_flowY_Mat_frame1_Mat_mask1_float_distThresh_Mat_frame0_Mat_mask0
pub fn complete_frame_according_to_flow(flow_mask: &core::Mat, flow_x: &core::Mat, flow_y: &core::Mat, frame1: &core::Mat, mask1: &core::Mat, dist_thresh: f32, frame0: &core::Mat, mask0: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_completeFrameAccordingToFlow_Mat_flowMask_Mat_flowX_Mat_flowY_Mat_frame1_Mat_mask1_float_distThresh_Mat_frame0_Mat_mask0(flow_mask.as_raw_Mat(), flow_x.as_raw_Mat(), flow_y.as_raw_Mat(), frame1.as_raw_Mat(), mask1.as_raw_Mat(), dist_thresh, frame0.as_raw_Mat(), mask0.as_raw_Mat()) }.into_result()
}
// identifier: cv_videostab_ensureInclusionConstraint_Mat_M_Size_size_float_trimRatio
pub fn ensure_inclusion_constraint(m: &core::Mat, size: core::Size, trim_ratio: f32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_ensureInclusionConstraint_Mat_M_Size_size_float_trimRatio(m.as_raw_Mat(), size, trim_ratio) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_videostab_estimateGlobalMotionLeastSquares_Mat_points0_Mat_points1_int_model_float_X_rmse
/// Estimates best global motion between two 2D point clouds in the least-squares sense.
///
///
/// Note: Works in-place and changes input point arrays.
///
/// ## Parameters
/// * points0: Source set of 2D points (32F).
/// * points1: Destination set of 2D points (32F).
/// * model: Motion model (up to MM_AFFINE).
/// * rmse: Final root-mean-square error.
/// @return 3x3 2D transformation matrix (32F).
///
/// ## C++ default parameters:
/// * model: MM_AFFINE
/// * rmse: 0
pub fn estimate_global_motion_least_squares(points0: &mut core::Mat, points1: &mut core::Mat, model: i32, rmse: &mut f32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_estimateGlobalMotionLeastSquares_Mat_points0_Mat_points1_int_model_float_X_rmse(points0.as_raw_Mat(), points1.as_raw_Mat(), model, rmse) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_videostab_estimateOptimalTrimRatio_Mat_M_Size_size
pub fn estimate_optimal_trim_ratio(m: &core::Mat, size: core::Size) -> Result<f32> {
unsafe { sys::cv_core_cv_videostab_estimateOptimalTrimRatio_Mat_M_Size_size(m.as_raw_Mat(), size) }.into_result()
}
// identifier: cv_videostab_getMotion_int_from_int_to_VectorOfMat_motions
/// Computes motion between two frames assuming that all the intermediate motions are known.
///
/// ## Parameters
/// * from: Source frame index.
/// * to: Destination frame index.
/// * motions: Pair-wise motions. motions[i] denotes motion from the frame i to the frame i+1
/// @return Motion from the Source frame to the Destination frame.
pub fn get_motion(from: i32, to: i32, motions: &types::VectorOfMat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_getMotion_int_from_int_to_VectorOfMat_motions(from, to, motions.as_raw_VectorOfMat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_waitKeyEx_int_delay
/// Similar to #waitKey, but returns full key code.
///
///
/// Note:
///
/// Key code is implementation specific and depends on used backend: QT/GTK/Win32/etc
///
/// ## C++ default parameters:
/// * delay: 0
pub fn wait_key_ex(delay: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_waitKeyEx_int_delay(delay) }.into_result()
}
// identifier: cv_waitKey_int_delay
/// Waits for a pressed key.
///
/// The function waitKey waits for a key event infinitely (when <span lang='latex'>\texttt{delay}\leq 0</span> ) or for delay
/// milliseconds, when it is positive. Since the OS has a minimum time between switching threads, the
/// function will not wait exactly delay ms, it will wait at least delay ms, depending on what else is
/// running on your computer at that time. It returns the code of the pressed key or -1 if no key was
/// pressed before the specified time had elapsed.
///
///
/// Note:
///
/// This function is the only method in HighGUI that can fetch and handle events, so it needs to be
/// called periodically for normal event processing unless HighGUI is used within an environment that
/// takes care of event processing.
///
///
/// Note:
///
/// The function only works if there is at least one HighGUI window created and the window is active.
/// If there are several HighGUI windows, any of them can be active.
///
/// ## Parameters
/// * delay: Delay in milliseconds. 0 is the special value that means "forever".
///
/// ## C++ default parameters:
/// * delay: 0
pub fn wait_key(delay: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_waitKey_int_delay(delay) }.into_result()
}
// identifier: cv_warpAffine_Mat_src_Mat_dst_Mat_M_Size_dsize_int_flags_int_borderMode_Scalar_borderValue
/// Applies an affine transformation to an image.
///
/// The function warpAffine transforms the source image using the specified matrix:
///
/// <div lang='latex'>\texttt{dst} (x,y) = \texttt{src} ( \texttt{M} _{11} x + \texttt{M} _{12} y + \texttt{M} _{13}, \texttt{M} _{21} x + \texttt{M} _{22} y + \texttt{M} _{23})</div>
///
/// when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted
/// with #invertAffineTransform and then put in the formula above instead of M. The function cannot
/// operate in-place.
///
/// ## Parameters
/// * src: input image.
/// * dst: output image that has the size dsize and the same type as src .
/// * M: <span lang='latex'>2\times 3</span> transformation matrix.
/// * dsize: size of the output image.
/// * flags: combination of interpolation methods (see #InterpolationFlags) and the optional
/// flag #WARP_INVERSE_MAP that means that M is the inverse transformation (
/// <span lang='latex'>\texttt{dst}\rightarrow\texttt{src}</span> ).
/// * borderMode: pixel extrapolation method (see #BorderTypes); when
/// borderMode=#BORDER_TRANSPARENT, it means that the pixels in the destination image corresponding to
/// the "outliers" in the source image are not modified by the function.
/// * borderValue: value used in case of a constant border; by default, it is 0.
///
/// @sa warpPerspective, resize, remap, getRectSubPix, transform
///
/// ## C++ default parameters:
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
pub fn warp_affine(src: &core::Mat, dst: &mut core::Mat, m: &core::Mat, dsize: core::Size, flags: i32, border_mode: i32, border_value: core::Scalar) -> Result<()> {
unsafe { sys::cv_core_cv_warpAffine_Mat_src_Mat_dst_Mat_M_Size_dsize_int_flags_int_borderMode_Scalar_borderValue(src.as_raw_Mat(), dst.as_raw_Mat(), m.as_raw_Mat(), dsize, flags, border_mode, border_value) }.into_result()
}
// identifier: cv_warpPerspective_Mat_src_Mat_dst_Mat_M_Size_dsize_int_flags_int_borderMode_Scalar_borderValue
/// Applies a perspective transformation to an image.
///
/// The function warpPerspective transforms the source image using the specified matrix:
///
/// <div lang='latex'>\texttt{dst} (x,y) = \texttt{src} \left ( \frac{M_{11} x + M_{12} y + M_{13}}{M_{31} x + M_{32} y + M_{33}} ,
/// \frac{M_{21} x + M_{22} y + M_{23}}{M_{31} x + M_{32} y + M_{33}} \right )</div>
///
/// when the flag #WARP_INVERSE_MAP is set. Otherwise, the transformation is first inverted with invert
/// and then put in the formula above instead of M. The function cannot operate in-place.
///
/// ## Parameters
/// * src: input image.
/// * dst: output image that has the size dsize and the same type as src .
/// * M: <span lang='latex'>3\times 3</span> transformation matrix.
/// * dsize: size of the output image.
/// * flags: combination of interpolation methods (#INTER_LINEAR or #INTER_NEAREST) and the
/// optional flag #WARP_INVERSE_MAP, that sets M as the inverse transformation (
/// <span lang='latex'>\texttt{dst}\rightarrow\texttt{src}</span> ).
/// * borderMode: pixel extrapolation method (#BORDER_CONSTANT or #BORDER_REPLICATE).
/// * borderValue: value used in case of a constant border; by default, it equals 0.
///
/// @sa warpAffine, resize, remap, getRectSubPix, perspectiveTransform
///
/// ## C++ default parameters:
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
pub fn warp_perspective(src: &core::Mat, dst: &mut core::Mat, m: &core::Mat, dsize: core::Size, flags: i32, border_mode: i32, border_value: core::Scalar) -> Result<()> {
unsafe { sys::cv_core_cv_warpPerspective_Mat_src_Mat_dst_Mat_M_Size_dsize_int_flags_int_borderMode_Scalar_borderValue(src.as_raw_Mat(), dst.as_raw_Mat(), m.as_raw_Mat(), dsize, flags, border_mode, border_value) }.into_result()
}
// identifier: cv_warpPolar_Mat_src_Mat_dst_Size_dsize_Point2f_center_double_maxRadius_int_flags
/// \brief Remaps an image to polar or semilog-polar coordinates space
///
/// @anchor polar_remaps_reference_image
/// 
///
/// Transform the source image using the following transformation:
/// <div lang='latex'>
/// dst(\rho , \phi ) = src(x,y)
/// </div>
///
/// where
/// <div lang='latex'>
/// \begin{array}{l}
/// \vec{I} = (x - center.x, \;y - center.y) \\
/// \phi = Kangle \cdot \texttt{angle} (\vec{I}) \\
/// \rho = \left\{\begin{matrix}
/// Klin \cdot \texttt{magnitude} (\vec{I}) & default \\
/// Klog \cdot log_e(\texttt{magnitude} (\vec{I})) & if \; semilog \\
/// \end{matrix}\right.
/// \end{array}
/// </div>
///
/// and
/// <div lang='latex'>
/// \begin{array}{l}
/// Kangle = dsize.height / 2\Pi \\
/// Klin = dsize.width / maxRadius \\
/// Klog = dsize.width / log_e(maxRadius) \\
/// \end{array}
/// </div>
///
///
/// \par Linear vs semilog mapping
///
/// Polar mapping can be linear or semi-log. Add one of #WarpPolarMode to `flags` to specify the polar mapping mode.
///
/// Linear is the default mode.
///
/// The semilog mapping emulates the human "foveal" vision that permit very high acuity on the line of sight (central vision)
/// in contrast to peripheral vision where acuity is minor.
///
/// \par Option on `dsize`:
///
/// - if both values in `dsize <=0 ` (default),
/// the destination image will have (almost) same area of source bounding circle:
/// <div lang='latex'>\begin{array}{l}
/// dsize.area \leftarrow (maxRadius^2 \cdot \Pi) \\
/// dsize.width = \texttt{cvRound}(maxRadius) \\
/// dsize.height = \texttt{cvRound}(maxRadius \cdot \Pi) \\
/// \end{array}</div>
///
///
/// - if only `dsize.height <= 0`,
/// the destination image area will be proportional to the bounding circle area but scaled by `Kx * Kx`:
/// <div lang='latex'>\begin{array}{l}
/// dsize.height = \texttt{cvRound}(dsize.width \cdot \Pi) \\
/// \end{array}
/// </div>
///
/// - if both values in `dsize > 0 `,
/// the destination image will have the given size therefore the area of the bounding circle will be scaled to `dsize`.
///
///
/// \par Reverse mapping
///
/// You can get reverse mapping adding #WARP_INVERSE_MAP to `flags`
/// \snippet polar_transforms.cpp InverseMap
///
/// In addiction, to calculate the original coordinate from a polar mapped coordinate <span lang='latex'>(rho, phi)->(x, y)</span>:
/// \snippet polar_transforms.cpp InverseCoordinate
///
/// ## Parameters
/// * src: Source image.
/// * dst: Destination image. It will have same type as src.
/// * dsize: The destination image size (see description for valid options).
/// * center: The transformation center.
/// * maxRadius: The radius of the bounding circle to transform. It determines the inverse magnitude scale parameter too.
/// * flags: A combination of interpolation methods, #InterpolationFlags + #WarpPolarMode.
/// - Add #WARP_POLAR_LINEAR to select linear polar mapping (default)
/// - Add #WARP_POLAR_LOG to select semilog polar mapping
/// - Add #WARP_INVERSE_MAP for reverse mapping.
///
/// Note:
/// * The function can not operate in-place.
/// * To calculate magnitude and angle in degrees #cartToPolar is used internally thus angles are measured from 0 to 360 with accuracy about 0.3 degrees.
/// * This function uses #remap. Due to current implementation limitations the size of an input and output images should be less than 32767x32767.
///
/// @sa cv::remap
pub fn warp_polar(src: &core::Mat, dst: &mut core::Mat, dsize: core::Size, center: core::Point2f, max_radius: f64, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_warpPolar_Mat_src_Mat_dst_Size_dsize_Point2f_center_double_maxRadius_int_flags(src.as_raw_Mat(), dst.as_raw_Mat(), dsize, center, max_radius, flags) }.into_result()
}
// identifier: cv_watershed_Mat_image_Mat_markers
/// Performs a marker-based image segmentation using the watershed algorithm.
///
/// The function implements one of the variants of watershed, non-parametric marker-based segmentation
/// algorithm, described in @cite Meyer92 .
///
/// Before passing the image to the function, you have to roughly outline the desired regions in the
/// image markers with positive (\>0) indices. So, every region is represented as one or more connected
/// components with the pixel values 1, 2, 3, and so on. Such markers can be retrieved from a binary
/// mask using #findContours and #drawContours (see the watershed.cpp demo). The markers are "seeds" of
/// the future image regions. All the other pixels in markers , whose relation to the outlined regions
/// is not known and should be defined by the algorithm, should be set to 0's. In the function output,
/// each pixel in markers is set to a value of the "seed" components or to -1 at boundaries between the
/// regions.
///
///
/// Note: Any two neighbor connected components are not necessarily separated by a watershed boundary
/// (-1's pixels); for example, they can touch each other in the initial marker image passed to the
/// function.
///
/// ## Parameters
/// * image: Input 8-bit 3-channel image.
/// * markers: Input/output 32-bit single-channel image (map) of markers. It should have the same
/// size as image .
///
/// @sa findContours
///
/// @ingroup imgproc_misc
pub fn watershed(image: &core::Mat, markers: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_watershed_Mat_image_Mat_markers(image.as_raw_Mat(), markers.as_raw_Mat()) }.into_result()
}
// identifier: cv_wrapperEMD_Mat_signature1_Mat_signature2_int_distType_Mat_cost_PtrOffloat_lowerBound_Mat_flow
///
/// ## C++ default parameters:
/// * cost: noArray()
/// * lower_bound: Ptr<float>()
/// * flow: noArray()
pub fn wrapper_emd(signature1: &core::Mat, signature2: &core::Mat, dist_type: i32, cost: &core::Mat, lower_bound: &types::PtrOffloat, flow: &mut core::Mat) -> Result<f32> {
unsafe { sys::cv_core_cv_wrapperEMD_Mat_signature1_Mat_signature2_int_distType_Mat_cost_PtrOffloat_lowerBound_Mat_flow(signature1.as_raw_Mat(), signature2.as_raw_Mat(), dist_type, cost.as_raw_Mat(), lower_bound.as_raw_PtrOffloat(), flow.as_raw_Mat()) }.into_result()
}
// Generating impl for trait cv::AKAZE (trait)
/// Class implementing the AKAZE keypoint detector and descriptor extractor, described in @cite ANB13.
///
/// @details AKAZE descriptors can only be used with KAZE or AKAZE keypoints. This class is thread-safe.
///
///
/// Note: When you need descriptors use Feature2D::detectAndCompute, which
/// provides better performance. When using Feature2D::detect followed by
/// Feature2D::compute scale space pyramid is computed twice.
///
///
/// Note: AKAZE implements T-API. When image is passed as UMat some parts of the algorithm
/// will use OpenCL.
///
///
/// Note: [ANB13] Fast Explicit Diffusion for Accelerated Features in Nonlinear
/// Scale Spaces. Pablo F. Alcantarilla, Jess Nuevo and Adrien Bartoli. In
/// British Machine Vision Conference (BMVC), Bristol, UK, September 2013.
pub trait AKAZE : core::Feature2D {
#[doc(hidden)] fn as_raw_AKAZE(&self) -> *mut c_void;
// identifier: cv_AKAZE_setDescriptorType_int_dtype
fn set_descriptor_type(&mut self, dtype: i32) -> Result<()> {
unsafe { sys::cv_core_cv_AKAZE_setDescriptorType_int_dtype(self.as_raw_AKAZE(), dtype) }.into_result()
}
// identifier: cv_AKAZE_getDescriptorType_const
fn get_descriptor_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_AKAZE_getDescriptorType_const(self.as_raw_AKAZE()) }.into_result()
}
// identifier: cv_AKAZE_setDescriptorSize_int_dsize
fn set_descriptor_size(&mut self, dsize: i32) -> Result<()> {
unsafe { sys::cv_core_cv_AKAZE_setDescriptorSize_int_dsize(self.as_raw_AKAZE(), dsize) }.into_result()
}
// identifier: cv_AKAZE_getDescriptorSize_const
fn get_descriptor_size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_AKAZE_getDescriptorSize_const(self.as_raw_AKAZE()) }.into_result()
}
// identifier: cv_AKAZE_setDescriptorChannels_int_dch
fn set_descriptor_channels(&mut self, dch: i32) -> Result<()> {
unsafe { sys::cv_core_cv_AKAZE_setDescriptorChannels_int_dch(self.as_raw_AKAZE(), dch) }.into_result()
}
// identifier: cv_AKAZE_getDescriptorChannels_const
fn get_descriptor_channels(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_AKAZE_getDescriptorChannels_const(self.as_raw_AKAZE()) }.into_result()
}
// identifier: cv_AKAZE_setThreshold_double_threshold
fn set_threshold(&mut self, threshold: f64) -> Result<()> {
unsafe { sys::cv_core_cv_AKAZE_setThreshold_double_threshold(self.as_raw_AKAZE(), threshold) }.into_result()
}
// identifier: cv_AKAZE_getThreshold_const
fn get_threshold(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_AKAZE_getThreshold_const(self.as_raw_AKAZE()) }.into_result()
}
// identifier: cv_AKAZE_setNOctaves_int_octaves
fn set_n_octaves(&mut self, octaves: i32) -> Result<()> {
unsafe { sys::cv_core_cv_AKAZE_setNOctaves_int_octaves(self.as_raw_AKAZE(), octaves) }.into_result()
}
// identifier: cv_AKAZE_getNOctaves_const
fn get_n_octaves(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_AKAZE_getNOctaves_const(self.as_raw_AKAZE()) }.into_result()
}
// identifier: cv_AKAZE_setNOctaveLayers_int_octaveLayers
fn set_n_octave_layers(&mut self, octave_layers: i32) -> Result<()> {
unsafe { sys::cv_core_cv_AKAZE_setNOctaveLayers_int_octaveLayers(self.as_raw_AKAZE(), octave_layers) }.into_result()
}
// identifier: cv_AKAZE_getNOctaveLayers_const
fn get_n_octave_layers(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_AKAZE_getNOctaveLayers_const(self.as_raw_AKAZE()) }.into_result()
}
// identifier: cv_AKAZE_setDiffusivity_int_diff
fn set_diffusivity(&mut self, diff: i32) -> Result<()> {
unsafe { sys::cv_core_cv_AKAZE_setDiffusivity_int_diff(self.as_raw_AKAZE(), diff) }.into_result()
}
// identifier: cv_AKAZE_getDiffusivity_const
fn get_diffusivity(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_AKAZE_getDiffusivity_const(self.as_raw_AKAZE()) }.into_result()
}
// identifier: cv_AKAZE_getDefaultName_const
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_core_cv_AKAZE_getDefaultName_const(self.as_raw_AKAZE()) }.into_result().map(crate::templ::receive_string_mut)
}
}
impl<'a> AKAZE + 'a {
// identifier: cv_AKAZE_create_int_descriptor_type_int_descriptor_size_int_descriptor_channels_float_threshold_int_nOctaves_int_nOctaveLayers_int_diffusivity
/// The AKAZE constructor
///
/// ## Parameters
/// * descriptor_type: Type of the extracted descriptor: DESCRIPTOR_KAZE,
/// DESCRIPTOR_KAZE_UPRIGHT, DESCRIPTOR_MLDB or DESCRIPTOR_MLDB_UPRIGHT.
/// * descriptor_size: Size of the descriptor in bits. 0 -\> Full size
/// * descriptor_channels: Number of channels in the descriptor (1, 2, 3)
/// * threshold: Detector response threshold to accept point
/// * nOctaves: Maximum octave evolution of the image
/// * nOctaveLayers: Default number of sublevels per scale level
/// * diffusivity: Diffusivity type. DIFF_PM_G1, DIFF_PM_G2, DIFF_WEICKERT or
/// DIFF_CHARBONNIER
///
/// ## C++ default parameters:
/// * descriptor_type: AKAZE::DESCRIPTOR_MLDB
/// * descriptor_size: 0
/// * descriptor_channels: 3
/// * threshold: 0.001f
/// * n_octaves: 4
/// * n_octave_layers: 4
/// * diffusivity: KAZE::DIFF_PM_G2
pub fn create(descriptor_type: i32, descriptor_size: i32, descriptor_channels: i32, threshold: f32, n_octaves: i32, n_octave_layers: i32, diffusivity: i32) -> Result<types::PtrOfAKAZE> {
unsafe { sys::cv_core_cv_AKAZE_create_int_descriptor_type_int_descriptor_size_int_descriptor_channels_float_threshold_int_nOctaves_int_nOctaveLayers_int_diffusivity(descriptor_type, descriptor_size, descriptor_channels, threshold, n_octaves, n_octave_layers, diffusivity) }.into_result().map(|x| types::PtrOfAKAZE { ptr: x })
}
}
// Generating impl for trait cv::AffineTransformer (trait)
/// Wrapper class for the OpenCV Affine Transformation algorithm. :
pub trait AffineTransformer : core::ShapeTransformer {
#[doc(hidden)] fn as_raw_AffineTransformer(&self) -> *mut c_void;
// identifier: cv_AffineTransformer_setFullAffine_bool_fullAffine
fn set_full_affine(&mut self, full_affine: bool) -> Result<()> {
unsafe { sys::cv_core_cv_AffineTransformer_setFullAffine_bool_fullAffine(self.as_raw_AffineTransformer(), full_affine) }.into_result()
}
// identifier: cv_AffineTransformer_getFullAffine_const
fn get_full_affine(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_AffineTransformer_getFullAffine_const(self.as_raw_AffineTransformer()) }.into_result()
}
}
impl<'a> AffineTransformer + 'a {
}
// boxed class cv::AffineWarper
/// Affine warper factory class.
/// @sa detail::AffineWarper
#[allow(dead_code)]
pub struct AffineWarper {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::AffineWarper {
fn drop(&mut self) {
unsafe { sys::cv_delete_AffineWarper(self.ptr) };
}
}
impl core::AffineWarper {
#[doc(hidden)] pub fn as_raw_AffineWarper(&self) -> *mut c_void { self.ptr }
}
impl core::WarperCreator for AffineWarper {
#[doc(hidden)] fn as_raw_WarperCreator(&self) -> *mut c_void { self.ptr }
}
impl AffineWarper {
}
// Generating impl for trait cv::AgastFeatureDetector (trait)
/// Wrapping class for feature detection using the AGAST method. :
pub trait AgastFeatureDetector : core::Feature2D {
#[doc(hidden)] fn as_raw_AgastFeatureDetector(&self) -> *mut c_void;
// identifier: cv_AgastFeatureDetector_setThreshold_int_threshold
fn set_threshold(&mut self, threshold: i32) -> Result<()> {
unsafe { sys::cv_core_cv_AgastFeatureDetector_setThreshold_int_threshold(self.as_raw_AgastFeatureDetector(), threshold) }.into_result()
}
// identifier: cv_AgastFeatureDetector_getThreshold_const
fn get_threshold(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_AgastFeatureDetector_getThreshold_const(self.as_raw_AgastFeatureDetector()) }.into_result()
}
// identifier: cv_AgastFeatureDetector_setNonmaxSuppression_bool_f
fn set_nonmax_suppression(&mut self, f: bool) -> Result<()> {
unsafe { sys::cv_core_cv_AgastFeatureDetector_setNonmaxSuppression_bool_f(self.as_raw_AgastFeatureDetector(), f) }.into_result()
}
// identifier: cv_AgastFeatureDetector_getNonmaxSuppression_const
fn get_nonmax_suppression(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_AgastFeatureDetector_getNonmaxSuppression_const(self.as_raw_AgastFeatureDetector()) }.into_result()
}
// identifier: cv_AgastFeatureDetector_setType_int_type
fn set_type(&mut self, _type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_AgastFeatureDetector_setType_int_type(self.as_raw_AgastFeatureDetector(), _type) }.into_result()
}
// identifier: cv_AgastFeatureDetector_getType_const
fn get_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_AgastFeatureDetector_getType_const(self.as_raw_AgastFeatureDetector()) }.into_result()
}
// identifier: cv_AgastFeatureDetector_getDefaultName_const
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_core_cv_AgastFeatureDetector_getDefaultName_const(self.as_raw_AgastFeatureDetector()) }.into_result().map(crate::templ::receive_string_mut)
}
}
impl<'a> AgastFeatureDetector + 'a {
// identifier: cv_AgastFeatureDetector_create_int_threshold_bool_nonmaxSuppression_int_type
///
/// ## C++ default parameters:
/// * threshold: 10
/// * nonmax_suppression: true
/// * _type: AgastFeatureDetector::OAST_9_16
pub fn create(threshold: i32, nonmax_suppression: bool, _type: i32) -> Result<types::PtrOfAgastFeatureDetector> {
unsafe { sys::cv_core_cv_AgastFeatureDetector_create_int_threshold_bool_nonmaxSuppression_int_type(threshold, nonmax_suppression, _type) }.into_result().map(|x| types::PtrOfAgastFeatureDetector { ptr: x })
}
}
// Generating impl for trait cv::Algorithm (trait)
/// This is a base class for all more or less complex algorithms in OpenCV
///
/// especially for classes of algorithms, for which there can be multiple implementations. The examples
/// are stereo correspondence (for which there are algorithms like block matching, semi-global block
/// matching, graph-cut etc.), background subtraction (which can be done using mixture-of-gaussians
/// models, codebook-based algorithm etc.), optical flow (block matching, Lucas-Kanade, Horn-Schunck
/// etc.).
///
/// Here is example of SimpleBlobDetector use in your application via Algorithm interface:
/// @snippet snippets/core_various.cpp Algorithm
pub trait Algorithm {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void;
// identifier: cv_Algorithm_clear
/// Clears the algorithm state
fn clear(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_Algorithm_clear(self.as_raw_Algorithm()) }.into_result()
}
// identifier: cv_Algorithm_empty_const
/// Returns true if the Algorithm is empty (e.g. in the very beginning or after unsuccessful read
fn empty(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_Algorithm_empty_const(self.as_raw_Algorithm()) }.into_result()
}
// identifier: cv_Algorithm_save_const_String_filename
/// Saves the algorithm to a file.
/// In order to make this method work, the derived class must implement Algorithm::write(FileStorage& fs).
fn save(&self, filename: &str) -> Result<()> {
string_arg!(filename);
unsafe { sys::cv_core_cv_Algorithm_save_const_String_filename(self.as_raw_Algorithm(), filename.as_ptr()) }.into_result()
}
// identifier: cv_Algorithm_getDefaultName_const
/// Returns the algorithm string identifier.
/// This string is used as top level xml/yml node tag when the object is saved to a file or string.
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_core_cv_Algorithm_getDefaultName_const(self.as_raw_Algorithm()) }.into_result().map(crate::templ::receive_string_mut)
}
}
impl<'a> Algorithm + 'a {
}
// Generating impl for trait cv::AlignExposures (trait)
/// The base class for algorithms that align images of the same scene with different exposures
pub trait AlignExposures : core::Algorithm {
#[doc(hidden)] fn as_raw_AlignExposures(&self) -> *mut c_void;
// identifier: cv_AlignExposures_process_VectorOfMat_src_VectorOfMat_dst_Mat_times_Mat_response
/// Aligns images
///
/// ## Parameters
/// * src: vector of input images
/// * dst: vector of aligned images
/// * times: vector of exposure time values for each image
/// * response: 256x1 matrix with inverse camera response function for each pixel value, it should
/// have the same number of channels as images.
fn process(&mut self, src: &types::VectorOfMat, dst: &types::VectorOfMat, times: &core::Mat, response: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_AlignExposures_process_VectorOfMat_src_VectorOfMat_dst_Mat_times_Mat_response(self.as_raw_AlignExposures(), src.as_raw_VectorOfMat(), dst.as_raw_VectorOfMat(), times.as_raw_Mat(), response.as_raw_Mat()) }.into_result()
}
}
impl<'a> AlignExposures + 'a {
}
// Generating impl for trait cv::AlignMTB (trait)
/// This algorithm converts images to median threshold bitmaps (1 for pixels brighter than median
/// luminance and 0 otherwise) and than aligns the resulting bitmaps using bit operations.
///
/// It is invariant to exposure, so exposure values and camera response are not necessary.
///
/// In this implementation new image regions are filled with zeros.
///
/// For more information see @cite GW03 .
pub trait AlignMTB : core::AlignExposures {
#[doc(hidden)] fn as_raw_AlignMTB(&self) -> *mut c_void;
// identifier: cv_AlignMTB_process_VectorOfMat_src_VectorOfMat_dst_Mat_times_Mat_response
fn process_with_response(&mut self, src: &types::VectorOfMat, dst: &types::VectorOfMat, times: &core::Mat, response: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_AlignMTB_process_VectorOfMat_src_VectorOfMat_dst_Mat_times_Mat_response(self.as_raw_AlignMTB(), src.as_raw_VectorOfMat(), dst.as_raw_VectorOfMat(), times.as_raw_Mat(), response.as_raw_Mat()) }.into_result()
}
// identifier: cv_AlignMTB_process_VectorOfMat_src_VectorOfMat_dst
/// Short version of process, that doesn't take extra arguments.
///
/// ## Parameters
/// * src: vector of input images
/// * dst: vector of aligned images
fn process(&mut self, src: &types::VectorOfMat, dst: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_AlignMTB_process_VectorOfMat_src_VectorOfMat_dst(self.as_raw_AlignMTB(), src.as_raw_VectorOfMat(), dst.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_AlignMTB_calculateShift_Mat_img0_Mat_img1
/// Calculates shift between two images, i. e. how to shift the second image to correspond it with the
/// first.
///
/// ## Parameters
/// * img0: first image
/// * img1: second image
fn calculate_shift(&mut self, img0: &core::Mat, img1: &core::Mat) -> Result<core::Point> {
unsafe { sys::cv_core_cv_AlignMTB_calculateShift_Mat_img0_Mat_img1(self.as_raw_AlignMTB(), img0.as_raw_Mat(), img1.as_raw_Mat()) }.into_result()
}
// identifier: cv_AlignMTB_shiftMat_Mat_src_Mat_dst_Point_shift
/// Helper function, that shift Mat filling new regions with zeros.
///
/// ## Parameters
/// * src: input image
/// * dst: result image
/// * shift: shift value
fn shift_mat(&mut self, src: &core::Mat, dst: &mut core::Mat, shift: core::Point) -> Result<()> {
unsafe { sys::cv_core_cv_AlignMTB_shiftMat_Mat_src_Mat_dst_Point_shift(self.as_raw_AlignMTB(), src.as_raw_Mat(), dst.as_raw_Mat(), shift) }.into_result()
}
// identifier: cv_AlignMTB_computeBitmaps_Mat_img_Mat_tb_Mat_eb
/// Computes median threshold and exclude bitmaps of given image.
///
/// ## Parameters
/// * img: input image
/// * tb: median threshold bitmap
/// * eb: exclude bitmap
fn compute_bitmaps(&mut self, img: &core::Mat, tb: &mut core::Mat, eb: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_AlignMTB_computeBitmaps_Mat_img_Mat_tb_Mat_eb(self.as_raw_AlignMTB(), img.as_raw_Mat(), tb.as_raw_Mat(), eb.as_raw_Mat()) }.into_result()
}
// identifier: cv_AlignMTB_getMaxBits_const
fn get_max_bits(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_AlignMTB_getMaxBits_const(self.as_raw_AlignMTB()) }.into_result()
}
// identifier: cv_AlignMTB_setMaxBits_int_max_bits
fn set_max_bits(&mut self, max_bits: i32) -> Result<()> {
unsafe { sys::cv_core_cv_AlignMTB_setMaxBits_int_max_bits(self.as_raw_AlignMTB(), max_bits) }.into_result()
}
// identifier: cv_AlignMTB_getExcludeRange_const
fn get_exclude_range(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_AlignMTB_getExcludeRange_const(self.as_raw_AlignMTB()) }.into_result()
}
// identifier: cv_AlignMTB_setExcludeRange_int_exclude_range
fn set_exclude_range(&mut self, exclude_range: i32) -> Result<()> {
unsafe { sys::cv_core_cv_AlignMTB_setExcludeRange_int_exclude_range(self.as_raw_AlignMTB(), exclude_range) }.into_result()
}
// identifier: cv_AlignMTB_getCut_const
fn get_cut(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_AlignMTB_getCut_const(self.as_raw_AlignMTB()) }.into_result()
}
// identifier: cv_AlignMTB_setCut_bool_value
fn set_cut(&mut self, value: bool) -> Result<()> {
unsafe { sys::cv_core_cv_AlignMTB_setCut_bool_value(self.as_raw_AlignMTB(), value) }.into_result()
}
}
impl<'a> AlignMTB + 'a {
}
// boxed class cv::AutoLock
#[allow(dead_code)]
pub struct AutoLock {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::AutoLock {
fn drop(&mut self) {
unsafe { sys::cv_delete_AutoLock(self.ptr) };
}
}
impl core::AutoLock {
#[doc(hidden)] pub fn as_raw_AutoLock(&self) -> *mut c_void { self.ptr }
}
// boxed class cv::BFMatcher
/// Brute-force descriptor matcher.
///
/// For each descriptor in the first set, this matcher finds the closest descriptor in the second set
/// by trying each one. This descriptor matcher supports masking permissible matches of descriptor
/// sets.
#[allow(dead_code)]
pub struct BFMatcher {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::BFMatcher {
fn drop(&mut self) {
unsafe { sys::cv_delete_BFMatcher(self.ptr) };
}
}
impl core::BFMatcher {
#[doc(hidden)] pub fn as_raw_BFMatcher(&self) -> *mut c_void { self.ptr }
}
impl core::DescriptorMatcher for BFMatcher {
#[doc(hidden)] fn as_raw_DescriptorMatcher(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for BFMatcher {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl BFMatcher {
// identifier: cv_BFMatcher_BFMatcher_int_normType_bool_crossCheck
/// Brute-force matcher constructor (obsolete). Please use BFMatcher.create()
///
/// ## C++ default parameters:
/// * norm_type: NORM_L2
/// * cross_check: false
pub fn new(norm_type: i32, cross_check: bool) -> Result<core::BFMatcher> {
unsafe { sys::cv_core_cv_BFMatcher_BFMatcher_int_normType_bool_crossCheck(norm_type, cross_check) }.into_result().map(|x| core::BFMatcher { ptr: x })
}
// identifier: cv_BFMatcher_isMaskSupported_const
pub fn is_mask_supported(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_BFMatcher_isMaskSupported_const(self.as_raw_BFMatcher()) }.into_result()
}
// identifier: cv_BFMatcher_create_int_normType_bool_crossCheck
/// Brute-force matcher create method.
/// ## Parameters
/// * normType: One of NORM_L1, NORM_L2, NORM_HAMMING, NORM_HAMMING2. L1 and L2 norms are
/// preferable choices for SIFT and SURF descriptors, NORM_HAMMING should be used with ORB, BRISK and
/// BRIEF, NORM_HAMMING2 should be used with ORB when WTA_K==3 or 4 (see ORB::ORB constructor
/// description).
/// * crossCheck: If it is false, this is will be default BFMatcher behaviour when it finds the k
/// nearest neighbors for each query descriptor. If crossCheck==true, then the knnMatch() method with
/// k=1 will only return pairs (i,j) such that for i-th query descriptor the j-th descriptor in the
/// matcher's collection is the nearest and vice versa, i.e. the BFMatcher will only return consistent
/// pairs. Such technique usually produces best results with minimal number of outliers when there are
/// enough matches. This is alternative to the ratio test, used by D. Lowe in SIFT paper.
///
/// ## C++ default parameters:
/// * norm_type: NORM_L2
/// * cross_check: false
pub fn create(norm_type: i32, cross_check: bool) -> Result<types::PtrOfBFMatcher> {
unsafe { sys::cv_core_cv_BFMatcher_create_int_normType_bool_crossCheck(norm_type, cross_check) }.into_result().map(|x| types::PtrOfBFMatcher { ptr: x })
}
// identifier: cv_BFMatcher_clone_const_bool_emptyTrainData
///
/// ## C++ default parameters:
/// * empty_train_data: false
pub fn clone(&self, empty_train_data: bool) -> Result<types::PtrOfDescriptorMatcher> {
unsafe { sys::cv_core_cv_BFMatcher_clone_const_bool_emptyTrainData(self.as_raw_BFMatcher(), empty_train_data) }.into_result().map(|x| types::PtrOfDescriptorMatcher { ptr: x })
}
}
// boxed class cv::BOWImgDescriptorExtractor
/// Class to compute an image descriptor using the *bag of visual words*.
///
/// Such a computation consists of the following steps:
///
/// 1. Compute descriptors for a given image and its keypoints set.
/// 2. Find the nearest visual words from the vocabulary for each keypoint descriptor.
/// 3. Compute the bag-of-words image descriptor as is a normalized histogram of vocabulary words
/// encountered in the image. The i-th bin of the histogram is a frequency of i-th word of the
/// vocabulary in the given image.
#[allow(dead_code)]
pub struct BOWImgDescriptorExtractor {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::BOWImgDescriptorExtractor {
fn drop(&mut self) {
unsafe { sys::cv_delete_BOWImgDescriptorExtractor(self.ptr) };
}
}
impl core::BOWImgDescriptorExtractor {
#[doc(hidden)] pub fn as_raw_BOWImgDescriptorExtractor(&self) -> *mut c_void { self.ptr }
}
impl BOWImgDescriptorExtractor {
// identifier: cv_BOWImgDescriptorExtractor_BOWImgDescriptorExtractor_PtrOfFeature2D_dextractor_PtrOfDescriptorMatcher_dmatcher
/// The constructor.
///
/// ## Parameters
/// * dextractor: Descriptor extractor that is used to compute descriptors for an input image and
/// its keypoints.
/// * dmatcher: Descriptor matcher that is used to find the nearest word of the trained vocabulary
/// for each keypoint descriptor of the image.
pub fn new(dextractor: &types::PtrOfFeature2D, dmatcher: &types::PtrOfDescriptorMatcher) -> Result<core::BOWImgDescriptorExtractor> {
unsafe { sys::cv_core_cv_BOWImgDescriptorExtractor_BOWImgDescriptorExtractor_PtrOfFeature2D_dextractor_PtrOfDescriptorMatcher_dmatcher(dextractor.as_raw_PtrOfFeature2D(), dmatcher.as_raw_PtrOfDescriptorMatcher()) }.into_result().map(|x| core::BOWImgDescriptorExtractor { ptr: x })
}
// identifier: cv_BOWImgDescriptorExtractor_BOWImgDescriptorExtractor_PtrOfDescriptorMatcher_dmatcher
/// @overload
pub fn new_1(dmatcher: &types::PtrOfDescriptorMatcher) -> Result<core::BOWImgDescriptorExtractor> {
unsafe { sys::cv_core_cv_BOWImgDescriptorExtractor_BOWImgDescriptorExtractor_PtrOfDescriptorMatcher_dmatcher(dmatcher.as_raw_PtrOfDescriptorMatcher()) }.into_result().map(|x| core::BOWImgDescriptorExtractor { ptr: x })
}
// identifier: cv_BOWImgDescriptorExtractor_setVocabulary_Mat_vocabulary
/// Sets a visual vocabulary.
///
/// ## Parameters
/// * vocabulary: Vocabulary (can be trained using the inheritor of BOWTrainer ). Each row of the
/// vocabulary is a visual word (cluster center).
pub fn set_vocabulary(&mut self, vocabulary: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_BOWImgDescriptorExtractor_setVocabulary_Mat_vocabulary(self.as_raw_BOWImgDescriptorExtractor(), vocabulary.as_raw_Mat()) }.into_result()
}
// identifier: cv_BOWImgDescriptorExtractor_getVocabulary_const
/// Returns the set vocabulary.
pub fn get_vocabulary(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_BOWImgDescriptorExtractor_getVocabulary_const(self.as_raw_BOWImgDescriptorExtractor()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_BOWImgDescriptorExtractor_compute_Mat_image_VectorOfKeyPoint_keypoints_Mat_imgDescriptor_VectorOfVectorOfint_pointIdxsOfClusters_Mat_descriptors
/// Computes an image descriptor using the set visual vocabulary.
///
/// ## Parameters
/// * image: Image, for which the descriptor is computed.
/// * keypoints: Keypoints detected in the input image.
/// * imgDescriptor: Computed output image descriptor.
/// * pointIdxsOfClusters: Indices of keypoints that belong to the cluster. This means that
/// pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster (word of vocabulary)
/// returned if it is non-zero.
/// * descriptors: Descriptors of the image keypoints that are returned if they are non-zero.
///
/// ## C++ default parameters:
/// * point_idxs_of_clusters: 0
/// * descriptors: 0
pub fn compute_desc(&mut self, image: &core::Mat, keypoints: &types::VectorOfKeyPoint, img_descriptor: &mut core::Mat, point_idxs_of_clusters: &types::VectorOfVectorOfint, descriptors: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_BOWImgDescriptorExtractor_compute_Mat_image_VectorOfKeyPoint_keypoints_Mat_imgDescriptor_VectorOfVectorOfint_pointIdxsOfClusters_Mat_descriptors(self.as_raw_BOWImgDescriptorExtractor(), image.as_raw_Mat(), keypoints.as_raw_VectorOfKeyPoint(), img_descriptor.as_raw_Mat(), point_idxs_of_clusters.as_raw_VectorOfVectorOfint(), descriptors.as_raw_Mat()) }.into_result()
}
// identifier: cv_BOWImgDescriptorExtractor_compute_Mat_keypointDescriptors_Mat_imgDescriptor_VectorOfVectorOfint_pointIdxsOfClusters
/// @overload
/// ## Parameters
/// * keypointDescriptors: Computed descriptors to match with vocabulary.
/// * imgDescriptor: Computed output image descriptor.
/// * pointIdxsOfClusters: Indices of keypoints that belong to the cluster. This means that
/// pointIdxsOfClusters[i] are keypoint indices that belong to the i -th cluster (word of vocabulary)
/// returned if it is non-zero.
///
/// ## C++ default parameters:
/// * point_idxs_of_clusters: 0
pub fn compute(&mut self, keypoint_descriptors: &core::Mat, img_descriptor: &mut core::Mat, point_idxs_of_clusters: &types::VectorOfVectorOfint) -> Result<()> {
unsafe { sys::cv_core_cv_BOWImgDescriptorExtractor_compute_Mat_keypointDescriptors_Mat_imgDescriptor_VectorOfVectorOfint_pointIdxsOfClusters(self.as_raw_BOWImgDescriptorExtractor(), keypoint_descriptors.as_raw_Mat(), img_descriptor.as_raw_Mat(), point_idxs_of_clusters.as_raw_VectorOfVectorOfint()) }.into_result()
}
// identifier: cv_BOWImgDescriptorExtractor_compute2_Mat_image_VectorOfKeyPoint_keypoints_Mat_imgDescriptor
pub fn compute2(&mut self, image: &core::Mat, keypoints: &types::VectorOfKeyPoint, img_descriptor: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_BOWImgDescriptorExtractor_compute2_Mat_image_VectorOfKeyPoint_keypoints_Mat_imgDescriptor(self.as_raw_BOWImgDescriptorExtractor(), image.as_raw_Mat(), keypoints.as_raw_VectorOfKeyPoint(), img_descriptor.as_raw_Mat()) }.into_result()
}
// identifier: cv_BOWImgDescriptorExtractor_descriptorSize_const
/// Returns an image descriptor size if the vocabulary is set. Otherwise, it returns 0.
pub fn descriptor_size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_BOWImgDescriptorExtractor_descriptorSize_const(self.as_raw_BOWImgDescriptorExtractor()) }.into_result()
}
// identifier: cv_BOWImgDescriptorExtractor_descriptorType_const
/// Returns an image descriptor type.
pub fn descriptor_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_BOWImgDescriptorExtractor_descriptorType_const(self.as_raw_BOWImgDescriptorExtractor()) }.into_result()
}
}
// boxed class cv::BOWKMeansTrainer
/// kmeans -based class to train visual vocabulary using the *bag of visual words* approach. :
#[allow(dead_code)]
pub struct BOWKMeansTrainer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::BOWKMeansTrainer {
fn drop(&mut self) {
unsafe { sys::cv_delete_BOWKMeansTrainer(self.ptr) };
}
}
impl core::BOWKMeansTrainer {
#[doc(hidden)] pub fn as_raw_BOWKMeansTrainer(&self) -> *mut c_void { self.ptr }
}
impl core::BOWTrainer for BOWKMeansTrainer {
#[doc(hidden)] fn as_raw_BOWTrainer(&self) -> *mut c_void { self.ptr }
}
impl BOWKMeansTrainer {
// identifier: cv_BOWKMeansTrainer_BOWKMeansTrainer_int_clusterCount_TermCriteria_termcrit_int_attempts_int_flags
/// The constructor.
///
/// @see cv::kmeans
///
/// ## C++ default parameters:
/// * termcrit: TermCriteria()
/// * attempts: 3
/// * flags: KMEANS_PP_CENTERS
pub fn new_with_criteria(cluster_count: i32, termcrit: &core::TermCriteria, attempts: i32, flags: i32) -> Result<core::BOWKMeansTrainer> {
unsafe { sys::cv_core_cv_BOWKMeansTrainer_BOWKMeansTrainer_int_clusterCount_TermCriteria_termcrit_int_attempts_int_flags(cluster_count, termcrit.as_raw_TermCriteria(), attempts, flags) }.into_result().map(|x| core::BOWKMeansTrainer { ptr: x })
}
// identifier: cv_BOWKMeansTrainer_cluster_const
pub fn default(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_BOWKMeansTrainer_cluster_const(self.as_raw_BOWKMeansTrainer()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_BOWKMeansTrainer_cluster_const_Mat_descriptors
pub fn new(&self, descriptors: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_BOWKMeansTrainer_cluster_const_Mat_descriptors(self.as_raw_BOWKMeansTrainer(), descriptors.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
// Generating impl for trait cv::BOWTrainer (trait)
/// Abstract base class for training the *bag of visual words* vocabulary from a set of descriptors.
///
/// For details, see, for example, *Visual Categorization with Bags of Keypoints* by Gabriella Csurka,
/// Christopher R. Dance, Lixin Fan, Jutta Willamowski, Cedric Bray, 2004. :
pub trait BOWTrainer {
#[doc(hidden)] fn as_raw_BOWTrainer(&self) -> *mut c_void;
// identifier: cv_BOWTrainer_add_Mat_descriptors
/// Adds descriptors to a training set.
///
/// ## Parameters
/// * descriptors: Descriptors to add to a training set. Each row of the descriptors matrix is a
/// descriptor.
///
/// The training set is clustered using clustermethod to construct the vocabulary.
fn add(&mut self, descriptors: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_BOWTrainer_add_Mat_descriptors(self.as_raw_BOWTrainer(), descriptors.as_raw_Mat()) }.into_result()
}
// identifier: cv_BOWTrainer_getDescriptors_const
/// Returns a training set of descriptors.
fn get_descriptors(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_core_cv_BOWTrainer_getDescriptors_const(self.as_raw_BOWTrainer()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
// identifier: cv_BOWTrainer_descriptorsCount_const
/// Returns the count of all descriptors stored in the training set.
fn descriptors_count(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_BOWTrainer_descriptorsCount_const(self.as_raw_BOWTrainer()) }.into_result()
}
// identifier: cv_BOWTrainer_clear
fn clear(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_BOWTrainer_clear(self.as_raw_BOWTrainer()) }.into_result()
}
// identifier: cv_BOWTrainer_cluster_const
/// @overload
fn cluster(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_BOWTrainer_cluster_const(self.as_raw_BOWTrainer()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_BOWTrainer_cluster_const_Mat_descriptors
/// Clusters train descriptors.
///
/// ## Parameters
/// * descriptors: Descriptors to cluster. Each row of the descriptors matrix is a descriptor.
/// Descriptors are not added to the inner train descriptor set.
///
/// The vocabulary consists of cluster centers. So, this method returns the vocabulary. In the first
/// variant of the method, train descriptors stored in the object are clustered. In the second variant,
/// input descriptors are clustered.
fn cluster_1(&self, descriptors: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_BOWTrainer_cluster_const_Mat_descriptors(self.as_raw_BOWTrainer(), descriptors.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
impl<'a> BOWTrainer + 'a {
}
// boxed class cv::BRISK
/// Class implementing the BRISK keypoint detector and descriptor extractor, described in @cite LCS11 .
#[allow(dead_code)]
pub struct BRISK {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::BRISK {
fn drop(&mut self) {
unsafe { sys::cv_delete_BRISK(self.ptr) };
}
}
impl core::BRISK {
#[doc(hidden)] pub fn as_raw_BRISK(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for BRISK {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::Feature2D for BRISK {
#[doc(hidden)] fn as_raw_Feature2D(&self) -> *mut c_void { self.ptr }
}
impl BRISK {
// identifier: cv_BRISK_create_int_thresh_int_octaves_float_patternScale
/// The BRISK constructor
///
/// ## Parameters
/// * thresh: AGAST detection threshold score.
/// * octaves: detection octaves. Use 0 to do single scale.
/// * patternScale: apply this scale to the pattern used for sampling the neighbourhood of a
/// keypoint.
///
/// ## C++ default parameters:
/// * thresh: 30
/// * octaves: 3
/// * pattern_scale: 1.0f
pub fn create(thresh: i32, octaves: i32, pattern_scale: f32) -> Result<types::PtrOfBRISK> {
unsafe { sys::cv_core_cv_BRISK_create_int_thresh_int_octaves_float_patternScale(thresh, octaves, pattern_scale) }.into_result().map(|x| types::PtrOfBRISK { ptr: x })
}
// identifier: cv_BRISK_create_VectorOffloat_radiusList_VectorOfint_numberList_float_dMax_float_dMin_VectorOfint_indexChange
/// The BRISK constructor for a custom pattern
///
/// ## Parameters
/// * radiusList: defines the radii (in pixels) where the samples around a keypoint are taken (for
/// keypoint scale 1).
/// * numberList: defines the number of sampling points on the sampling circle. Must be the same
/// size as radiusList..
/// * dMax: threshold for the short pairings used for descriptor formation (in pixels for keypoint
/// scale 1).
/// * dMin: threshold for the long pairings used for orientation determination (in pixels for
/// keypoint scale 1).
/// * indexChange: index remapping of the bits.
///
/// ## C++ default parameters:
/// * d_max: 5.85f
/// * d_min: 8.2f
/// * index_change: std::vector<int>()
pub fn create_1(radius_list: &types::VectorOffloat, number_list: &types::VectorOfint, d_max: f32, d_min: f32, index_change: &types::VectorOfint) -> Result<types::PtrOfBRISK> {
unsafe { sys::cv_core_cv_BRISK_create_VectorOffloat_radiusList_VectorOfint_numberList_float_dMax_float_dMin_VectorOfint_indexChange(radius_list.as_raw_VectorOffloat(), number_list.as_raw_VectorOfint(), d_max, d_min, index_change.as_raw_VectorOfint()) }.into_result().map(|x| types::PtrOfBRISK { ptr: x })
}
// identifier: cv_BRISK_create_int_thresh_int_octaves_VectorOffloat_radiusList_VectorOfint_numberList_float_dMax_float_dMin_VectorOfint_indexChange
/// The BRISK constructor for a custom pattern, detection threshold and octaves
///
/// ## Parameters
/// * thresh: AGAST detection threshold score.
/// * octaves: detection octaves. Use 0 to do single scale.
/// * radiusList: defines the radii (in pixels) where the samples around a keypoint are taken (for
/// keypoint scale 1).
/// * numberList: defines the number of sampling points on the sampling circle. Must be the same
/// size as radiusList..
/// * dMax: threshold for the short pairings used for descriptor formation (in pixels for keypoint
/// scale 1).
/// * dMin: threshold for the long pairings used for orientation determination (in pixels for
/// keypoint scale 1).
/// * indexChange: index remapping of the bits.
///
/// ## C++ default parameters:
/// * d_max: 5.85f
/// * d_min: 8.2f
/// * index_change: std::vector<int>()
pub fn create_2(thresh: i32, octaves: i32, radius_list: &types::VectorOffloat, number_list: &types::VectorOfint, d_max: f32, d_min: f32, index_change: &types::VectorOfint) -> Result<types::PtrOfBRISK> {
unsafe { sys::cv_core_cv_BRISK_create_int_thresh_int_octaves_VectorOffloat_radiusList_VectorOfint_numberList_float_dMax_float_dMin_VectorOfint_indexChange(thresh, octaves, radius_list.as_raw_VectorOffloat(), number_list.as_raw_VectorOfint(), d_max, d_min, index_change.as_raw_VectorOfint()) }.into_result().map(|x| types::PtrOfBRISK { ptr: x })
}
// identifier: cv_BRISK_getDefaultName_const
pub fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_core_cv_BRISK_getDefaultName_const(self.as_raw_BRISK()) }.into_result().map(crate::templ::receive_string_mut)
}
}
// Generating impl for trait cv::BackgroundSubtractor (trait)
/// Base class for background/foreground segmentation. :
///
/// The class is only used to define the common interface for the whole family of background/foreground
/// segmentation algorithms.
pub trait BackgroundSubtractor : core::Algorithm {
#[doc(hidden)] fn as_raw_BackgroundSubtractor(&self) -> *mut c_void;
// identifier: cv_BackgroundSubtractor_apply_Mat_image_Mat_fgmask_double_learningRate
/// Computes a foreground mask.
///
/// ## Parameters
/// * image: Next video frame.
/// * fgmask: The output foreground mask as an 8-bit binary image.
/// * learningRate: The value between 0 and 1 that indicates how fast the background model is
/// learnt. Negative parameter value makes the algorithm to use some automatically chosen learning
/// rate. 0 means that the background model is not updated at all, 1 means that the background model
/// is completely reinitialized from the last frame.
///
/// ## C++ default parameters:
/// * learning_rate: -1
fn apply(&mut self, image: &core::Mat, fgmask: &mut core::Mat, learning_rate: f64) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractor_apply_Mat_image_Mat_fgmask_double_learningRate(self.as_raw_BackgroundSubtractor(), image.as_raw_Mat(), fgmask.as_raw_Mat(), learning_rate) }.into_result()
}
// identifier: cv_BackgroundSubtractor_getBackgroundImage_const_Mat_backgroundImage
/// Computes a background image.
///
/// ## Parameters
/// * backgroundImage: The output background image.
///
///
/// Note: Sometimes the background image can be very blurry, as it contain the average background
/// statistics.
fn get_background_image(&self, background_image: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractor_getBackgroundImage_const_Mat_backgroundImage(self.as_raw_BackgroundSubtractor(), background_image.as_raw_Mat()) }.into_result()
}
}
impl<'a> BackgroundSubtractor + 'a {
}
// Generating impl for trait cv::BackgroundSubtractorKNN (trait)
/// K-nearest neighbours - based Background/Foreground Segmentation Algorithm.
///
/// The class implements the K-nearest neighbours background subtraction described in @cite Zivkovic2006 .
/// Very efficient if number of foreground pixels is low.
pub trait BackgroundSubtractorKNN : core::BackgroundSubtractor {
#[doc(hidden)] fn as_raw_BackgroundSubtractorKNN(&self) -> *mut c_void;
// identifier: cv_BackgroundSubtractorKNN_getHistory_const
/// Returns the number of last frames that affect the background model
fn get_history(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_BackgroundSubtractorKNN_getHistory_const(self.as_raw_BackgroundSubtractorKNN()) }.into_result()
}
// identifier: cv_BackgroundSubtractorKNN_setHistory_int_history
/// Sets the number of last frames that affect the background model
fn set_history(&mut self, history: i32) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorKNN_setHistory_int_history(self.as_raw_BackgroundSubtractorKNN(), history) }.into_result()
}
// identifier: cv_BackgroundSubtractorKNN_getNSamples_const
/// Returns the number of data samples in the background model
fn get_n_samples(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_BackgroundSubtractorKNN_getNSamples_const(self.as_raw_BackgroundSubtractorKNN()) }.into_result()
}
// identifier: cv_BackgroundSubtractorKNN_setNSamples_int__nN
/// Sets the number of data samples in the background model.
///
/// The model needs to be reinitalized to reserve memory.
fn set_n_samples(&mut self, _n_n: i32) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorKNN_setNSamples_int__nN(self.as_raw_BackgroundSubtractorKNN(), _n_n) }.into_result()
}
// identifier: cv_BackgroundSubtractorKNN_getDist2Threshold_const
/// Returns the threshold on the squared distance between the pixel and the sample
///
/// The threshold on the squared distance between the pixel and the sample to decide whether a pixel is
/// close to a data sample.
fn get_dist2_threshold(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_BackgroundSubtractorKNN_getDist2Threshold_const(self.as_raw_BackgroundSubtractorKNN()) }.into_result()
}
// identifier: cv_BackgroundSubtractorKNN_setDist2Threshold_double__dist2Threshold
/// Sets the threshold on the squared distance
fn set_dist2_threshold(&mut self, _dist2_threshold: f64) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorKNN_setDist2Threshold_double__dist2Threshold(self.as_raw_BackgroundSubtractorKNN(), _dist2_threshold) }.into_result()
}
// identifier: cv_BackgroundSubtractorKNN_getkNNSamples_const
/// Returns the number of neighbours, the k in the kNN.
///
/// K is the number of samples that need to be within dist2Threshold in order to decide that that
/// pixel is matching the kNN background model.
fn getk_nn_samples(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_BackgroundSubtractorKNN_getkNNSamples_const(self.as_raw_BackgroundSubtractorKNN()) }.into_result()
}
// identifier: cv_BackgroundSubtractorKNN_setkNNSamples_int__nkNN
/// Sets the k in the kNN. How many nearest neighbours need to match.
fn setk_nn_samples(&mut self, _nk_nn: i32) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorKNN_setkNNSamples_int__nkNN(self.as_raw_BackgroundSubtractorKNN(), _nk_nn) }.into_result()
}
// identifier: cv_BackgroundSubtractorKNN_getDetectShadows_const
/// Returns the shadow detection flag
///
/// If true, the algorithm detects shadows and marks them. See createBackgroundSubtractorKNN for
/// details.
fn get_detect_shadows(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_BackgroundSubtractorKNN_getDetectShadows_const(self.as_raw_BackgroundSubtractorKNN()) }.into_result()
}
// identifier: cv_BackgroundSubtractorKNN_setDetectShadows_bool_detectShadows
/// Enables or disables shadow detection
fn set_detect_shadows(&mut self, detect_shadows: bool) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorKNN_setDetectShadows_bool_detectShadows(self.as_raw_BackgroundSubtractorKNN(), detect_shadows) }.into_result()
}
// identifier: cv_BackgroundSubtractorKNN_getShadowValue_const
/// Returns the shadow value
///
/// Shadow value is the value used to mark shadows in the foreground mask. Default value is 127. Value 0
/// in the mask always means background, 255 means foreground.
fn get_shadow_value(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_BackgroundSubtractorKNN_getShadowValue_const(self.as_raw_BackgroundSubtractorKNN()) }.into_result()
}
// identifier: cv_BackgroundSubtractorKNN_setShadowValue_int_value
/// Sets the shadow value
fn set_shadow_value(&mut self, value: i32) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorKNN_setShadowValue_int_value(self.as_raw_BackgroundSubtractorKNN(), value) }.into_result()
}
// identifier: cv_BackgroundSubtractorKNN_getShadowThreshold_const
/// Returns the shadow threshold
///
/// A shadow is detected if pixel is a darker version of the background. The shadow threshold (Tau in
/// the paper) is a threshold defining how much darker the shadow can be. Tau= 0.5 means that if a pixel
/// is more than twice darker then it is not shadow. See Prati, Mikic, Trivedi and Cucchiara,
/// *Detecting Moving Shadows...*, IEEE PAMI,2003.
fn get_shadow_threshold(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_BackgroundSubtractorKNN_getShadowThreshold_const(self.as_raw_BackgroundSubtractorKNN()) }.into_result()
}
// identifier: cv_BackgroundSubtractorKNN_setShadowThreshold_double_threshold
/// Sets the shadow threshold
fn set_shadow_threshold(&mut self, threshold: f64) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorKNN_setShadowThreshold_double_threshold(self.as_raw_BackgroundSubtractorKNN(), threshold) }.into_result()
}
}
impl<'a> BackgroundSubtractorKNN + 'a {
}
// Generating impl for trait cv::BackgroundSubtractorMOG2 (trait)
/// Gaussian Mixture-based Background/Foreground Segmentation Algorithm.
///
/// The class implements the Gaussian mixture model background subtraction described in @cite Zivkovic2004
/// and @cite Zivkovic2006 .
pub trait BackgroundSubtractorMOG2 : core::BackgroundSubtractor {
#[doc(hidden)] fn as_raw_BackgroundSubtractorMOG2(&self) -> *mut c_void;
// identifier: cv_BackgroundSubtractorMOG2_getHistory_const
/// Returns the number of last frames that affect the background model
fn get_history(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_getHistory_const(self.as_raw_BackgroundSubtractorMOG2()) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_setHistory_int_history
/// Sets the number of last frames that affect the background model
fn set_history(&mut self, history: i32) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_setHistory_int_history(self.as_raw_BackgroundSubtractorMOG2(), history) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_getNMixtures_const
/// Returns the number of gaussian components in the background model
fn get_n_mixtures(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_getNMixtures_const(self.as_raw_BackgroundSubtractorMOG2()) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_setNMixtures_int_nmixtures
/// Sets the number of gaussian components in the background model.
///
/// The model needs to be reinitalized to reserve memory.
fn set_n_mixtures(&mut self, nmixtures: i32) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_setNMixtures_int_nmixtures(self.as_raw_BackgroundSubtractorMOG2(), nmixtures) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_getBackgroundRatio_const
/// Returns the "background ratio" parameter of the algorithm
///
/// If a foreground pixel keeps semi-constant value for about backgroundRatio\*history frames, it's
/// considered background and added to the model as a center of a new component. It corresponds to TB
/// parameter in the paper.
fn get_background_ratio(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_getBackgroundRatio_const(self.as_raw_BackgroundSubtractorMOG2()) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_setBackgroundRatio_double_ratio
/// Sets the "background ratio" parameter of the algorithm
fn set_background_ratio(&mut self, ratio: f64) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_setBackgroundRatio_double_ratio(self.as_raw_BackgroundSubtractorMOG2(), ratio) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_getVarThreshold_const
/// Returns the variance threshold for the pixel-model match
///
/// The main threshold on the squared Mahalanobis distance to decide if the sample is well described by
/// the background model or not. Related to Cthr from the paper.
fn get_var_threshold(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_getVarThreshold_const(self.as_raw_BackgroundSubtractorMOG2()) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_setVarThreshold_double_varThreshold
/// Sets the variance threshold for the pixel-model match
fn set_var_threshold(&mut self, var_threshold: f64) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_setVarThreshold_double_varThreshold(self.as_raw_BackgroundSubtractorMOG2(), var_threshold) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_getVarThresholdGen_const
/// Returns the variance threshold for the pixel-model match used for new mixture component generation
///
/// Threshold for the squared Mahalanobis distance that helps decide when a sample is close to the
/// existing components (corresponds to Tg in the paper). If a pixel is not close to any component, it
/// is considered foreground or added as a new component. 3 sigma =\> Tg=3\*3=9 is default. A smaller Tg
/// value generates more components. A higher Tg value may result in a small number of components but
/// they can grow too large.
fn get_var_threshold_gen(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_getVarThresholdGen_const(self.as_raw_BackgroundSubtractorMOG2()) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_setVarThresholdGen_double_varThresholdGen
/// Sets the variance threshold for the pixel-model match used for new mixture component generation
fn set_var_threshold_gen(&mut self, var_threshold_gen: f64) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_setVarThresholdGen_double_varThresholdGen(self.as_raw_BackgroundSubtractorMOG2(), var_threshold_gen) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_getVarInit_const
/// Returns the initial variance of each gaussian component
fn get_var_init(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_getVarInit_const(self.as_raw_BackgroundSubtractorMOG2()) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_setVarInit_double_varInit
/// Sets the initial variance of each gaussian component
fn set_var_init(&mut self, var_init: f64) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_setVarInit_double_varInit(self.as_raw_BackgroundSubtractorMOG2(), var_init) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_getVarMin_const
fn get_var_min(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_getVarMin_const(self.as_raw_BackgroundSubtractorMOG2()) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_setVarMin_double_varMin
fn set_var_min(&mut self, var_min: f64) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_setVarMin_double_varMin(self.as_raw_BackgroundSubtractorMOG2(), var_min) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_getVarMax_const
fn get_var_max(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_getVarMax_const(self.as_raw_BackgroundSubtractorMOG2()) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_setVarMax_double_varMax
fn set_var_max(&mut self, var_max: f64) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_setVarMax_double_varMax(self.as_raw_BackgroundSubtractorMOG2(), var_max) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_getComplexityReductionThreshold_const
/// Returns the complexity reduction threshold
///
/// This parameter defines the number of samples needed to accept to prove the component exists. CT=0.05
/// is a default value for all the samples. By setting CT=0 you get an algorithm very similar to the
/// standard Stauffer&Grimson algorithm.
fn get_complexity_reduction_threshold(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_getComplexityReductionThreshold_const(self.as_raw_BackgroundSubtractorMOG2()) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_setComplexityReductionThreshold_double_ct
/// Sets the complexity reduction threshold
fn set_complexity_reduction_threshold(&mut self, ct: f64) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_setComplexityReductionThreshold_double_ct(self.as_raw_BackgroundSubtractorMOG2(), ct) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_getDetectShadows_const
/// Returns the shadow detection flag
///
/// If true, the algorithm detects shadows and marks them. See createBackgroundSubtractorMOG2 for
/// details.
fn get_detect_shadows(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_getDetectShadows_const(self.as_raw_BackgroundSubtractorMOG2()) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_setDetectShadows_bool_detectShadows
/// Enables or disables shadow detection
fn set_detect_shadows(&mut self, detect_shadows: bool) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_setDetectShadows_bool_detectShadows(self.as_raw_BackgroundSubtractorMOG2(), detect_shadows) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_getShadowValue_const
/// Returns the shadow value
///
/// Shadow value is the value used to mark shadows in the foreground mask. Default value is 127. Value 0
/// in the mask always means background, 255 means foreground.
fn get_shadow_value(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_getShadowValue_const(self.as_raw_BackgroundSubtractorMOG2()) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_setShadowValue_int_value
/// Sets the shadow value
fn set_shadow_value(&mut self, value: i32) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_setShadowValue_int_value(self.as_raw_BackgroundSubtractorMOG2(), value) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_getShadowThreshold_const
/// Returns the shadow threshold
///
/// A shadow is detected if pixel is a darker version of the background. The shadow threshold (Tau in
/// the paper) is a threshold defining how much darker the shadow can be. Tau= 0.5 means that if a pixel
/// is more than twice darker then it is not shadow. See Prati, Mikic, Trivedi and Cucchiara,
/// *Detecting Moving Shadows...*, IEEE PAMI,2003.
fn get_shadow_threshold(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_getShadowThreshold_const(self.as_raw_BackgroundSubtractorMOG2()) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_setShadowThreshold_double_threshold
/// Sets the shadow threshold
fn set_shadow_threshold(&mut self, threshold: f64) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_setShadowThreshold_double_threshold(self.as_raw_BackgroundSubtractorMOG2(), threshold) }.into_result()
}
// identifier: cv_BackgroundSubtractorMOG2_apply_Mat_image_Mat_fgmask_double_learningRate
/// Computes a foreground mask.
///
/// ## Parameters
/// * image: Next video frame. Floating point frame will be used without scaling and should be in range <span lang='latex'>[0,255]</span>.
/// * fgmask: The output foreground mask as an 8-bit binary image.
/// * learningRate: The value between 0 and 1 that indicates how fast the background model is
/// learnt. Negative parameter value makes the algorithm to use some automatically chosen learning
/// rate. 0 means that the background model is not updated at all, 1 means that the background model
/// is completely reinitialized from the last frame.
///
/// ## C++ default parameters:
/// * learning_rate: -1
fn apply(&mut self, image: &core::Mat, fgmask: &mut core::Mat, learning_rate: f64) -> Result<()> {
unsafe { sys::cv_core_cv_BackgroundSubtractorMOG2_apply_Mat_image_Mat_fgmask_double_learningRate(self.as_raw_BackgroundSubtractorMOG2(), image.as_raw_Mat(), fgmask.as_raw_Mat(), learning_rate) }.into_result()
}
}
impl<'a> BackgroundSubtractorMOG2 + 'a {
}
// Generating impl for trait cv::BaseCascadeClassifier (trait)
pub trait BaseCascadeClassifier : core::Algorithm {
#[doc(hidden)] fn as_raw_BaseCascadeClassifier(&self) -> *mut c_void;
// identifier: cv_BaseCascadeClassifier_empty_const
fn empty(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_BaseCascadeClassifier_empty_const(self.as_raw_BaseCascadeClassifier()) }.into_result()
}
// identifier: cv_BaseCascadeClassifier_load_String_filename
fn load(&mut self, filename: &str) -> Result<bool> {
string_arg!(filename);
unsafe { sys::cv_core_cv_BaseCascadeClassifier_load_String_filename(self.as_raw_BaseCascadeClassifier(), filename.as_ptr()) }.into_result()
}
// identifier: cv_BaseCascadeClassifier_detectMultiScale_Mat_image_VectorOfRect_objects_double_scaleFactor_int_minNeighbors_int_flags_Size_minSize_Size_maxSize
fn detect_multi_scale(&mut self, image: &core::Mat, objects: &types::VectorOfRect, scale_factor: f64, min_neighbors: i32, flags: i32, min_size: core::Size, max_size: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_BaseCascadeClassifier_detectMultiScale_Mat_image_VectorOfRect_objects_double_scaleFactor_int_minNeighbors_int_flags_Size_minSize_Size_maxSize(self.as_raw_BaseCascadeClassifier(), image.as_raw_Mat(), objects.as_raw_VectorOfRect(), scale_factor, min_neighbors, flags, min_size, max_size) }.into_result()
}
// identifier: cv_BaseCascadeClassifier_detectMultiScale_Mat_image_VectorOfRect_objects_VectorOfint_numDetections_double_scaleFactor_int_minNeighbors_int_flags_Size_minSize_Size_maxSize
fn detect_multi_scale_1(&mut self, image: &core::Mat, objects: &types::VectorOfRect, num_detections: &types::VectorOfint, scale_factor: f64, min_neighbors: i32, flags: i32, min_size: core::Size, max_size: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_BaseCascadeClassifier_detectMultiScale_Mat_image_VectorOfRect_objects_VectorOfint_numDetections_double_scaleFactor_int_minNeighbors_int_flags_Size_minSize_Size_maxSize(self.as_raw_BaseCascadeClassifier(), image.as_raw_Mat(), objects.as_raw_VectorOfRect(), num_detections.as_raw_VectorOfint(), scale_factor, min_neighbors, flags, min_size, max_size) }.into_result()
}
// identifier: cv_BaseCascadeClassifier_detectMultiScale_Mat_image_VectorOfRect_objects_VectorOfint_rejectLevels_VectorOfdouble_levelWeights_double_scaleFactor_int_minNeighbors_int_flags_Size_minSize_Size_maxSize_bool_outputRejectLevels
fn detect_multi_scale_2(&mut self, image: &core::Mat, objects: &types::VectorOfRect, reject_levels: &types::VectorOfint, level_weights: &types::VectorOfdouble, scale_factor: f64, min_neighbors: i32, flags: i32, min_size: core::Size, max_size: core::Size, output_reject_levels: bool) -> Result<()> {
unsafe { sys::cv_core_cv_BaseCascadeClassifier_detectMultiScale_Mat_image_VectorOfRect_objects_VectorOfint_rejectLevels_VectorOfdouble_levelWeights_double_scaleFactor_int_minNeighbors_int_flags_Size_minSize_Size_maxSize_bool_outputRejectLevels(self.as_raw_BaseCascadeClassifier(), image.as_raw_Mat(), objects.as_raw_VectorOfRect(), reject_levels.as_raw_VectorOfint(), level_weights.as_raw_VectorOfdouble(), scale_factor, min_neighbors, flags, min_size, max_size, output_reject_levels) }.into_result()
}
// identifier: cv_BaseCascadeClassifier_isOldFormatCascade_const
fn is_old_format_cascade(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_BaseCascadeClassifier_isOldFormatCascade_const(self.as_raw_BaseCascadeClassifier()) }.into_result()
}
// identifier: cv_BaseCascadeClassifier_getOriginalWindowSize_const
fn get_original_window_size(&self) -> Result<core::Size> {
unsafe { sys::cv_core_cv_BaseCascadeClassifier_getOriginalWindowSize_const(self.as_raw_BaseCascadeClassifier()) }.into_result()
}
// identifier: cv_BaseCascadeClassifier_getFeatureType_const
fn get_feature_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_BaseCascadeClassifier_getFeatureType_const(self.as_raw_BaseCascadeClassifier()) }.into_result()
}
// identifier: cv_BaseCascadeClassifier_getOldCascade
fn get_old_cascade(&mut self) -> Result<&mut c_void> {
unsafe { sys::cv_core_cv_BaseCascadeClassifier_getOldCascade(self.as_raw_BaseCascadeClassifier()) }.into_result().and_then(|x| unsafe { x.as_mut() }.ok_or_else(|| Error::new(core::StsNullPtr, format!("Function returned Null pointer"))))
}
// identifier: cv_BaseCascadeClassifier_setMaskGenerator_PtrOfMaskGenerator_maskGenerator
fn set_mask_generator(&mut self, mask_generator: &types::PtrOfMaskGenerator) -> Result<()> {
unsafe { sys::cv_core_cv_BaseCascadeClassifier_setMaskGenerator_PtrOfMaskGenerator_maskGenerator(self.as_raw_BaseCascadeClassifier(), mask_generator.as_raw_PtrOfMaskGenerator()) }.into_result()
}
// identifier: cv_BaseCascadeClassifier_getMaskGenerator
fn get_mask_generator(&mut self) -> Result<types::PtrOfMaskGenerator> {
unsafe { sys::cv_core_cv_BaseCascadeClassifier_getMaskGenerator(self.as_raw_BaseCascadeClassifier()) }.into_result().map(|x| types::PtrOfMaskGenerator { ptr: x })
}
}
impl<'a> BaseCascadeClassifier + 'a {
}
// Generating impl for trait cv::BaseCascadeClassifier::MaskGenerator (trait)
pub trait BaseCascadeClassifier_MaskGenerator {
#[doc(hidden)] fn as_raw_BaseCascadeClassifier_MaskGenerator(&self) -> *mut c_void;
// identifier: cv_BaseCascadeClassifier_MaskGenerator_generateMask_Mat_src
fn generate_mask(&mut self, src: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_BaseCascadeClassifier_MaskGenerator_generateMask_Mat_src(self.as_raw_BaseCascadeClassifier_MaskGenerator(), src.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_BaseCascadeClassifier_MaskGenerator_initializeMask_Mat_unnamed_arg
fn initialize_mask(&mut self, unnamed_arg: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_BaseCascadeClassifier_MaskGenerator_initializeMask_Mat_unnamed_arg(self.as_raw_BaseCascadeClassifier_MaskGenerator(), unnamed_arg.as_raw_Mat()) }.into_result()
}
}
impl<'a> BaseCascadeClassifier_MaskGenerator + 'a {
}
// Generating impl for trait cv::BufferPoolController (trait)
pub trait BufferPoolController {
#[doc(hidden)] fn as_raw_BufferPoolController(&self) -> *mut c_void;
// identifier: cv_BufferPoolController_getReservedSize_const
fn get_reserved_size(&self) -> Result<size_t> {
unsafe { sys::cv_core_cv_BufferPoolController_getReservedSize_const(self.as_raw_BufferPoolController()) }.into_result()
}
// identifier: cv_BufferPoolController_getMaxReservedSize_const
fn get_max_reserved_size(&self) -> Result<size_t> {
unsafe { sys::cv_core_cv_BufferPoolController_getMaxReservedSize_const(self.as_raw_BufferPoolController()) }.into_result()
}
// identifier: cv_BufferPoolController_setMaxReservedSize_size_t_size
fn set_max_reserved_size(&mut self, size: size_t) -> Result<()> {
unsafe { sys::cv_core_cv_BufferPoolController_setMaxReservedSize_size_t_size(self.as_raw_BufferPoolController(), size) }.into_result()
}
// identifier: cv_BufferPoolController_freeAllReservedBuffers
fn free_all_reserved_buffers(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_BufferPoolController_freeAllReservedBuffers(self.as_raw_BufferPoolController()) }.into_result()
}
}
impl<'a> BufferPoolController + 'a {
}
// Generating impl for trait cv::CLAHE (trait)
/// Base class for Contrast Limited Adaptive Histogram Equalization.
pub trait CLAHE : core::Algorithm {
#[doc(hidden)] fn as_raw_CLAHE(&self) -> *mut c_void;
// identifier: cv_CLAHE_apply_Mat_src_Mat_dst
/// Equalizes the histogram of a grayscale image using Contrast Limited Adaptive Histogram Equalization.
///
/// ## Parameters
/// * src: Source image of type CV_8UC1 or CV_16UC1.
/// * dst: Destination image.
fn apply(&mut self, src: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_CLAHE_apply_Mat_src_Mat_dst(self.as_raw_CLAHE(), src.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_CLAHE_setClipLimit_double_clipLimit
/// Sets threshold for contrast limiting.
///
/// ## Parameters
/// * clipLimit: threshold value.
fn set_clip_limit(&mut self, clip_limit: f64) -> Result<()> {
unsafe { sys::cv_core_cv_CLAHE_setClipLimit_double_clipLimit(self.as_raw_CLAHE(), clip_limit) }.into_result()
}
// identifier: cv_CLAHE_getClipLimit_const
fn get_clip_limit(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_CLAHE_getClipLimit_const(self.as_raw_CLAHE()) }.into_result()
}
// identifier: cv_CLAHE_setTilesGridSize_Size_tileGridSize
/// Sets size of grid for histogram equalization. Input image will be divided into
/// equally sized rectangular tiles.
///
/// ## Parameters
/// * tileGridSize: defines the number of tiles in row and column.
fn set_tiles_grid_size(&mut self, tile_grid_size: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_CLAHE_setTilesGridSize_Size_tileGridSize(self.as_raw_CLAHE(), tile_grid_size) }.into_result()
}
// identifier: cv_CLAHE_getTilesGridSize_const
fn get_tiles_grid_size(&self) -> Result<core::Size> {
unsafe { sys::cv_core_cv_CLAHE_getTilesGridSize_const(self.as_raw_CLAHE()) }.into_result()
}
// identifier: cv_CLAHE_collectGarbage
fn collect_garbage(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_CLAHE_collectGarbage(self.as_raw_CLAHE()) }.into_result()
}
}
impl<'a> CLAHE + 'a {
}
// Generating impl for trait cv::CalibrateCRF (trait)
/// The base class for camera response calibration algorithms.
pub trait CalibrateCRF : core::Algorithm {
#[doc(hidden)] fn as_raw_CalibrateCRF(&self) -> *mut c_void;
// identifier: cv_CalibrateCRF_process_VectorOfMat_src_Mat_dst_Mat_times
/// Recovers inverse camera response.
///
/// ## Parameters
/// * src: vector of input images
/// * dst: 256x1 matrix with inverse camera response function
/// * times: vector of exposure time values for each image
fn process(&mut self, src: &types::VectorOfMat, dst: &mut core::Mat, times: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_CalibrateCRF_process_VectorOfMat_src_Mat_dst_Mat_times(self.as_raw_CalibrateCRF(), src.as_raw_VectorOfMat(), dst.as_raw_Mat(), times.as_raw_Mat()) }.into_result()
}
}
impl<'a> CalibrateCRF + 'a {
}
// Generating impl for trait cv::CalibrateDebevec (trait)
/// Inverse camera response function is extracted for each brightness value by minimizing an objective
/// function as linear system. Objective function is constructed using pixel values on the same position
/// in all images, extra term is added to make the result smoother.
///
/// For more information see @cite DM97 .
pub trait CalibrateDebevec : core::CalibrateCRF {
#[doc(hidden)] fn as_raw_CalibrateDebevec(&self) -> *mut c_void;
// identifier: cv_CalibrateDebevec_getLambda_const
fn get_lambda(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_CalibrateDebevec_getLambda_const(self.as_raw_CalibrateDebevec()) }.into_result()
}
// identifier: cv_CalibrateDebevec_setLambda_float_lambda
fn set_lambda(&mut self, lambda: f32) -> Result<()> {
unsafe { sys::cv_core_cv_CalibrateDebevec_setLambda_float_lambda(self.as_raw_CalibrateDebevec(), lambda) }.into_result()
}
// identifier: cv_CalibrateDebevec_getSamples_const
fn get_samples(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_CalibrateDebevec_getSamples_const(self.as_raw_CalibrateDebevec()) }.into_result()
}
// identifier: cv_CalibrateDebevec_setSamples_int_samples
fn set_samples(&mut self, samples: i32) -> Result<()> {
unsafe { sys::cv_core_cv_CalibrateDebevec_setSamples_int_samples(self.as_raw_CalibrateDebevec(), samples) }.into_result()
}
// identifier: cv_CalibrateDebevec_getRandom_const
fn get_random(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_CalibrateDebevec_getRandom_const(self.as_raw_CalibrateDebevec()) }.into_result()
}
// identifier: cv_CalibrateDebevec_setRandom_bool_random
fn set_random(&mut self, random: bool) -> Result<()> {
unsafe { sys::cv_core_cv_CalibrateDebevec_setRandom_bool_random(self.as_raw_CalibrateDebevec(), random) }.into_result()
}
}
impl<'a> CalibrateDebevec + 'a {
}
// Generating impl for trait cv::CalibrateRobertson (trait)
/// Inverse camera response function is extracted for each brightness value by minimizing an objective
/// function as linear system. This algorithm uses all image pixels.
///
/// For more information see @cite RB99 .
pub trait CalibrateRobertson : core::CalibrateCRF {
#[doc(hidden)] fn as_raw_CalibrateRobertson(&self) -> *mut c_void;
// identifier: cv_CalibrateRobertson_getMaxIter_const
fn get_max_iter(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_CalibrateRobertson_getMaxIter_const(self.as_raw_CalibrateRobertson()) }.into_result()
}
// identifier: cv_CalibrateRobertson_setMaxIter_int_max_iter
fn set_max_iter(&mut self, max_iter: i32) -> Result<()> {
unsafe { sys::cv_core_cv_CalibrateRobertson_setMaxIter_int_max_iter(self.as_raw_CalibrateRobertson(), max_iter) }.into_result()
}
// identifier: cv_CalibrateRobertson_getThreshold_const
fn get_threshold(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_CalibrateRobertson_getThreshold_const(self.as_raw_CalibrateRobertson()) }.into_result()
}
// identifier: cv_CalibrateRobertson_setThreshold_float_threshold
fn set_threshold(&mut self, threshold: f32) -> Result<()> {
unsafe { sys::cv_core_cv_CalibrateRobertson_setThreshold_float_threshold(self.as_raw_CalibrateRobertson(), threshold) }.into_result()
}
// identifier: cv_CalibrateRobertson_getRadiance_const
fn get_radiance(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_CalibrateRobertson_getRadiance_const(self.as_raw_CalibrateRobertson()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
impl<'a> CalibrateRobertson + 'a {
}
// boxed class cv::CascadeClassifier
/// Cascade classifier class for object detection.
#[allow(dead_code)]
pub struct CascadeClassifier {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::CascadeClassifier {
fn drop(&mut self) {
unsafe { sys::cv_delete_CascadeClassifier(self.ptr) };
}
}
impl core::CascadeClassifier {
#[doc(hidden)] pub fn as_raw_CascadeClassifier(&self) -> *mut c_void { self.ptr }
}
impl CascadeClassifier {
// identifier: cv_CascadeClassifier_CascadeClassifier
pub fn default() -> Result<core::CascadeClassifier> {
unsafe { sys::cv_core_cv_CascadeClassifier_CascadeClassifier() }.into_result().map(|x| core::CascadeClassifier { ptr: x })
}
// identifier: cv_CascadeClassifier_CascadeClassifier_String_filename
/// Loads a classifier from a file.
///
/// ## Parameters
/// * filename: Name of the file from which the classifier is loaded.
pub fn new(filename: &str) -> Result<core::CascadeClassifier> {
string_arg!(filename);
unsafe { sys::cv_core_cv_CascadeClassifier_CascadeClassifier_String_filename(filename.as_ptr()) }.into_result().map(|x| core::CascadeClassifier { ptr: x })
}
// identifier: cv_CascadeClassifier_empty_const
/// Checks whether the classifier has been loaded.
pub fn empty(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_CascadeClassifier_empty_const(self.as_raw_CascadeClassifier()) }.into_result()
}
// identifier: cv_CascadeClassifier_load_String_filename
/// Loads a classifier from a file.
///
/// ## Parameters
/// * filename: Name of the file from which the classifier is loaded. The file may contain an old
/// HAAR classifier trained by the haartraining application or a new cascade classifier trained by the
/// traincascade application.
pub fn load(&mut self, filename: &str) -> Result<bool> {
string_arg!(filename);
unsafe { sys::cv_core_cv_CascadeClassifier_load_String_filename(self.as_raw_CascadeClassifier(), filename.as_ptr()) }.into_result()
}
// identifier: cv_CascadeClassifier_detectMultiScale_Mat_image_VectorOfRect_objects_double_scaleFactor_int_minNeighbors_int_flags_Size_minSize_Size_maxSize
/// Detects objects of different sizes in the input image. The detected objects are returned as a list
/// of rectangles.
///
/// ## Parameters
/// * image: Matrix of the type CV_8U containing an image where objects are detected.
/// * objects: Vector of rectangles where each rectangle contains the detected object, the
/// rectangles may be partially outside the original image.
/// * scaleFactor: Parameter specifying how much the image size is reduced at each image scale.
/// * minNeighbors: Parameter specifying how many neighbors each candidate rectangle should have
/// to retain it.
/// * flags: Parameter with the same meaning for an old cascade as in the function
/// cvHaarDetectObjects. It is not used for a new cascade.
/// * minSize: Minimum possible object size. Objects smaller than that are ignored.
/// * maxSize: Maximum possible object size. Objects larger than that are ignored. If `maxSize == minSize` model is evaluated on single scale.
///
/// The function is parallelized with the TBB library.
///
///
/// Note:
/// * (Python) A face detection example using cascade classifiers can be found at
/// opencv_source_code/samples/python/facedetect.py
///
/// ## C++ default parameters:
/// * scale_factor: 1.1
/// * min_neighbors: 3
/// * flags: 0
/// * min_size: Size()
/// * max_size: Size()
pub fn detect_multi_scale(&mut self, image: &core::Mat, objects: &types::VectorOfRect, scale_factor: f64, min_neighbors: i32, flags: i32, min_size: core::Size, max_size: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_CascadeClassifier_detectMultiScale_Mat_image_VectorOfRect_objects_double_scaleFactor_int_minNeighbors_int_flags_Size_minSize_Size_maxSize(self.as_raw_CascadeClassifier(), image.as_raw_Mat(), objects.as_raw_VectorOfRect(), scale_factor, min_neighbors, flags, min_size, max_size) }.into_result()
}
// identifier: cv_CascadeClassifier_detectMultiScale_Mat_image_VectorOfRect_objects_VectorOfint_numDetections_double_scaleFactor_int_minNeighbors_int_flags_Size_minSize_Size_maxSize
/// @overload
/// ## Parameters
/// * image: Matrix of the type CV_8U containing an image where objects are detected.
/// * objects: Vector of rectangles where each rectangle contains the detected object, the
/// rectangles may be partially outside the original image.
/// * numDetections: Vector of detection numbers for the corresponding objects. An object's number
/// of detections is the number of neighboring positively classified rectangles that were joined
/// together to form the object.
/// * scaleFactor: Parameter specifying how much the image size is reduced at each image scale.
/// * minNeighbors: Parameter specifying how many neighbors each candidate rectangle should have
/// to retain it.
/// * flags: Parameter with the same meaning for an old cascade as in the function
/// cvHaarDetectObjects. It is not used for a new cascade.
/// * minSize: Minimum possible object size. Objects smaller than that are ignored.
/// * maxSize: Maximum possible object size. Objects larger than that are ignored. If `maxSize == minSize` model is evaluated on single scale.
///
/// ## C++ default parameters:
/// * scale_factor: 1.1
/// * min_neighbors: 3
/// * flags: 0
/// * min_size: Size()
/// * max_size: Size()
pub fn detect_multi_scale_num(&mut self, image: &core::Mat, objects: &types::VectorOfRect, num_detections: &types::VectorOfint, scale_factor: f64, min_neighbors: i32, flags: i32, min_size: core::Size, max_size: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_CascadeClassifier_detectMultiScale_Mat_image_VectorOfRect_objects_VectorOfint_numDetections_double_scaleFactor_int_minNeighbors_int_flags_Size_minSize_Size_maxSize(self.as_raw_CascadeClassifier(), image.as_raw_Mat(), objects.as_raw_VectorOfRect(), num_detections.as_raw_VectorOfint(), scale_factor, min_neighbors, flags, min_size, max_size) }.into_result()
}
// identifier: cv_CascadeClassifier_detectMultiScale_Mat_image_VectorOfRect_objects_VectorOfint_rejectLevels_VectorOfdouble_levelWeights_double_scaleFactor_int_minNeighbors_int_flags_Size_minSize_Size_maxSize_bool_outputRejectLevels
/// @overload
/// This function allows you to retrieve the final stage decision certainty of classification.
/// For this, one needs to set `outputRejectLevels` on true and provide the `rejectLevels` and `levelWeights` parameter.
/// For each resulting detection, `levelWeights` will then contain the certainty of classification at the final stage.
/// This value can then be used to separate strong from weaker classifications.
///
/// A code sample on how to use it efficiently can be found below:
/// ```ignore
/// Mat img;
/// vector<double> weights;
/// vector<int> levels;
/// vector<Rect> detections;
/// CascadeClassifier model("/path/to/your/model.xml");
/// model.detectMultiScale(img, detections, levels, weights, 1.1, 3, 0, Size(), Size(), true);
/// cerr << "Detection " << detections[0] << " with weight " << weights[0] << endl;
/// ```
///
/// ## C++ default parameters:
/// * scale_factor: 1.1
/// * min_neighbors: 3
/// * flags: 0
/// * min_size: Size()
/// * max_size: Size()
/// * output_reject_levels: false
pub fn detect_multi_scale_levels(&mut self, image: &core::Mat, objects: &types::VectorOfRect, reject_levels: &types::VectorOfint, level_weights: &types::VectorOfdouble, scale_factor: f64, min_neighbors: i32, flags: i32, min_size: core::Size, max_size: core::Size, output_reject_levels: bool) -> Result<()> {
unsafe { sys::cv_core_cv_CascadeClassifier_detectMultiScale_Mat_image_VectorOfRect_objects_VectorOfint_rejectLevels_VectorOfdouble_levelWeights_double_scaleFactor_int_minNeighbors_int_flags_Size_minSize_Size_maxSize_bool_outputRejectLevels(self.as_raw_CascadeClassifier(), image.as_raw_Mat(), objects.as_raw_VectorOfRect(), reject_levels.as_raw_VectorOfint(), level_weights.as_raw_VectorOfdouble(), scale_factor, min_neighbors, flags, min_size, max_size, output_reject_levels) }.into_result()
}
// identifier: cv_CascadeClassifier_isOldFormatCascade_const
pub fn is_old_format_cascade(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_CascadeClassifier_isOldFormatCascade_const(self.as_raw_CascadeClassifier()) }.into_result()
}
// identifier: cv_CascadeClassifier_getOriginalWindowSize_const
pub fn get_original_window_size(&self) -> Result<core::Size> {
unsafe { sys::cv_core_cv_CascadeClassifier_getOriginalWindowSize_const(self.as_raw_CascadeClassifier()) }.into_result()
}
// identifier: cv_CascadeClassifier_getFeatureType_const
pub fn get_feature_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_CascadeClassifier_getFeatureType_const(self.as_raw_CascadeClassifier()) }.into_result()
}
// identifier: cv_CascadeClassifier_getOldCascade
pub fn get_old_cascade(&mut self) -> Result<&mut c_void> {
unsafe { sys::cv_core_cv_CascadeClassifier_getOldCascade(self.as_raw_CascadeClassifier()) }.into_result().and_then(|x| unsafe { x.as_mut() }.ok_or_else(|| Error::new(core::StsNullPtr, format!("Function returned Null pointer"))))
}
// identifier: cv_CascadeClassifier_convert_String_oldcascade_String_newcascade
pub fn convert(oldcascade: &str, newcascade: &str) -> Result<bool> {
string_arg!(oldcascade);
string_arg!(newcascade);
unsafe { sys::cv_core_cv_CascadeClassifier_convert_String_oldcascade_String_newcascade(oldcascade.as_ptr(), newcascade.as_ptr()) }.into_result()
}
// identifier: cv_CascadeClassifier_setMaskGenerator_PtrOfMaskGenerator_maskGenerator
pub fn set_mask_generator(&mut self, mask_generator: &types::PtrOfMaskGenerator) -> Result<()> {
unsafe { sys::cv_core_cv_CascadeClassifier_setMaskGenerator_PtrOfMaskGenerator_maskGenerator(self.as_raw_CascadeClassifier(), mask_generator.as_raw_PtrOfMaskGenerator()) }.into_result()
}
// identifier: cv_CascadeClassifier_getMaskGenerator
pub fn get_mask_generator(&mut self) -> Result<types::PtrOfMaskGenerator> {
unsafe { sys::cv_core_cv_CascadeClassifier_getMaskGenerator(self.as_raw_CascadeClassifier()) }.into_result().map(|x| types::PtrOfMaskGenerator { ptr: x })
}
}
// boxed class cv::ChiHistogramCostExtractor
/// An Chi based cost extraction. :
#[allow(dead_code)]
pub struct ChiHistogramCostExtractor {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ChiHistogramCostExtractor {
fn drop(&mut self) {
unsafe { sys::cv_delete_ChiHistogramCostExtractor(self.ptr) };
}
}
impl core::ChiHistogramCostExtractor {
#[doc(hidden)] pub fn as_raw_ChiHistogramCostExtractor(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ChiHistogramCostExtractor {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::HistogramCostExtractor for ChiHistogramCostExtractor {
#[doc(hidden)] fn as_raw_HistogramCostExtractor(&self) -> *mut c_void { self.ptr }
}
impl CirclesGridFinderParameters {
}
impl CirclesGridFinderParameters2 {
// identifier: cv_CirclesGridFinderParameters2_CirclesGridFinderParameters2
pub fn new() -> Result<core::CirclesGridFinderParameters2> {
unsafe { sys::cv_core_cv_CirclesGridFinderParameters2_CirclesGridFinderParameters2() }.into_result()
}
}
// boxed class cv::CommandLineParser
/// Designed for command line parsing
///
/// The sample below demonstrates how to use CommandLineParser:
/// ```ignore
/// CommandLineParser parser(argc, argv, keys);
/// parser.about("Application name v1.0.0");
///
/// if (parser.has("help"))
/// {
/// parser.printMessage();
/// return 0;
/// }
///
/// int N = parser.get<int>("N");
/// double fps = parser.get<double>("fps");
/// String path = parser.get<String>("path");
///
/// use_time_stamp = parser.has("timestamp");
///
/// String img1 = parser.get<String>(0);
/// String img2 = parser.get<String>(1);
///
/// int repeat = parser.get<int>(2);
///
/// if (!parser.check())
/// {
/// parser.printErrors();
/// return 0;
/// }
/// ```
///
///
/// ### Keys syntax
///
/// The keys parameter is a string containing several blocks, each one is enclosed in curly braces and
/// describes one argument. Each argument contains three parts separated by the `|` symbol:
///
/// -# argument names is a space-separated list of option synonyms (to mark argument as positional, prefix it with the `@` symbol)
/// -# default value will be used if the argument was not provided (can be empty)
/// -# help message (can be empty)
///
/// For example:
///
/// ```ignore{.cpp}
/// const String keys =
/// "{help h usage ? | | print this message }"
/// "{@image1 | | image1 for compare }"
/// "{@image2 |<none>| image2 for compare }"
/// "{@repeat |1 | number }"
/// "{path |. | path to file }"
/// "{fps | -1.0 | fps for output video }"
/// "{N count |100 | count of objects }"
/// "{ts timestamp | | use time stamp }"
/// ;
/// }
/// ```
///
///
/// Note that there are no default values for `help` and `timestamp` so we can check their presence using the `has()` method.
/// Arguments with default values are considered to be always present. Use the `get()` method in these cases to check their
/// actual value instead.
///
/// String keys like `get<String>("@image1")` return the empty string `""` by default - even with an empty default value.
/// Use the special `<none>` default value to enforce that the returned string must not be empty. (like in `get<String>("@image2")`)
///
/// ### Usage
///
/// For the described keys:
///
/// ```ignore{.sh}
/// # Good call (3 positional parameters: image1, image2 and repeat; N is 200, ts is true)
/// $ ./app -N=200 1.png 2.jpg 19 -ts
///
/// # Bad call
/// $ ./app -fps=aaa
/// ERRORS:
/// Parameter 'fps': can not convert: [aaa] to [double]
/// ```
#[allow(dead_code)]
pub struct CommandLineParser {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::CommandLineParser {
fn drop(&mut self) {
unsafe { sys::cv_delete_CommandLineParser(self.ptr) };
}
}
impl core::CommandLineParser {
#[doc(hidden)] pub fn as_raw_CommandLineParser(&self) -> *mut c_void { self.ptr }
}
impl CommandLineParser {
// identifier: cv_CommandLineParser_CommandLineParser_CommandLineParser_parser
/// Copy constructor
pub fn new(parser: &core::CommandLineParser) -> Result<core::CommandLineParser> {
unsafe { sys::cv_core_cv_CommandLineParser_CommandLineParser_CommandLineParser_parser(parser.as_raw_CommandLineParser()) }.into_result().map(|x| core::CommandLineParser { ptr: x })
}
// identifier: cv_CommandLineParser_getPathToApplication_const
/// Returns application path
///
/// This method returns the path to the executable from the command line (`argv[0]`).
///
/// For example, if the application has been started with such a command:
/// ```ignore{.sh}
/// $ ./bin/my-executable
/// ```
///
/// this method will return `./bin`.
pub fn get_path_to_application(&self) -> Result<String> {
unsafe { sys::cv_core_cv_CommandLineParser_getPathToApplication_const(self.as_raw_CommandLineParser()) }.into_result().map(crate::templ::receive_string_mut)
}
// identifier: cv_CommandLineParser_has_const_String_name
/// Check if field was provided in the command line
///
/// ## Parameters
/// * name: argument name to check
pub fn has(&self, name: &str) -> Result<bool> {
string_arg!(name);
unsafe { sys::cv_core_cv_CommandLineParser_has_const_String_name(self.as_raw_CommandLineParser(), name.as_ptr()) }.into_result()
}
// identifier: cv_CommandLineParser_check_const
/// Check for parsing errors
///
/// Returns false if error occurred while accessing the parameters (bad conversion, missing arguments,
/// etc.). Call @ref printErrors to print error messages list.
pub fn check(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_CommandLineParser_check_const(self.as_raw_CommandLineParser()) }.into_result()
}
// identifier: cv_CommandLineParser_about_String_message
/// Set the about message
///
/// The about message will be shown when @ref printMessage is called, right before arguments table.
pub fn about(&mut self, message: &str) -> Result<()> {
string_arg!(message);
unsafe { sys::cv_core_cv_CommandLineParser_about_String_message(self.as_raw_CommandLineParser(), message.as_ptr()) }.into_result()
}
// identifier: cv_CommandLineParser_printMessage_const
/// Print help message
///
/// This method will print standard help message containing the about message and arguments description.
///
/// @sa about
pub fn print_message(&self) -> Result<()> {
unsafe { sys::cv_core_cv_CommandLineParser_printMessage_const(self.as_raw_CommandLineParser()) }.into_result()
}
// identifier: cv_CommandLineParser_printErrors_const
/// Print list of errors occurred
///
/// @sa check
pub fn print_errors(&self) -> Result<()> {
unsafe { sys::cv_core_cv_CommandLineParser_printErrors_const(self.as_raw_CommandLineParser()) }.into_result()
}
}
// boxed class cv::CompressedRectilinearPortraitWarper
#[allow(dead_code)]
pub struct CompressedRectilinearPortraitWarper {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::CompressedRectilinearPortraitWarper {
fn drop(&mut self) {
unsafe { sys::cv_delete_CompressedRectilinearPortraitWarper(self.ptr) };
}
}
impl core::CompressedRectilinearPortraitWarper {
#[doc(hidden)] pub fn as_raw_CompressedRectilinearPortraitWarper(&self) -> *mut c_void { self.ptr }
}
impl core::WarperCreator for CompressedRectilinearPortraitWarper {
#[doc(hidden)] fn as_raw_WarperCreator(&self) -> *mut c_void { self.ptr }
}
impl CompressedRectilinearPortraitWarper {
// identifier: cv_CompressedRectilinearPortraitWarper_CompressedRectilinearPortraitWarper_float_A_float_B
///
/// ## C++ default parameters:
/// * a: 1
/// * b: 1
pub fn new(a: f32, b: f32) -> Result<core::CompressedRectilinearPortraitWarper> {
unsafe { sys::cv_core_cv_CompressedRectilinearPortraitWarper_CompressedRectilinearPortraitWarper_float_A_float_B(a, b) }.into_result().map(|x| core::CompressedRectilinearPortraitWarper { ptr: x })
}
}
// boxed class cv::CompressedRectilinearWarper
#[allow(dead_code)]
pub struct CompressedRectilinearWarper {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::CompressedRectilinearWarper {
fn drop(&mut self) {
unsafe { sys::cv_delete_CompressedRectilinearWarper(self.ptr) };
}
}
impl core::CompressedRectilinearWarper {
#[doc(hidden)] pub fn as_raw_CompressedRectilinearWarper(&self) -> *mut c_void { self.ptr }
}
impl core::WarperCreator for CompressedRectilinearWarper {
#[doc(hidden)] fn as_raw_WarperCreator(&self) -> *mut c_void { self.ptr }
}
impl CompressedRectilinearWarper {
// identifier: cv_CompressedRectilinearWarper_CompressedRectilinearWarper_float_A_float_B
///
/// ## C++ default parameters:
/// * a: 1
/// * b: 1
pub fn new(a: f32, b: f32) -> Result<core::CompressedRectilinearWarper> {
unsafe { sys::cv_core_cv_CompressedRectilinearWarper_CompressedRectilinearWarper_float_A_float_B(a, b) }.into_result().map(|x| core::CompressedRectilinearWarper { ptr: x })
}
}
// boxed class cv::ConjGradSolver
/// This class is used to perform the non-linear non-constrained minimization of a function
/// with known gradient,
///
/// defined on an *n*-dimensional Euclidean space, using the **Nonlinear Conjugate Gradient method**.
/// The implementation was done based on the beautifully clear explanatory article [An Introduction to
/// the Conjugate Gradient Method Without the Agonizing
/// Pain](http://www.cs.cmu.edu/~quake-papers/painless-conjugate-gradient.pdf) by Jonathan Richard
/// Shewchuk. The method can be seen as an adaptation of a standard Conjugate Gradient method (see, for
/// example <http://en.wikipedia.org/wiki/Conjugate_gradient_method>) for numerically solving the
/// systems of linear equations.
///
/// It should be noted, that this method, although deterministic, is rather a heuristic method and
/// therefore may converge to a local minima, not necessary a global one. What is even more disastrous,
/// most of its behaviour is ruled by gradient, therefore it essentially cannot distinguish between
/// local minima and maxima. Therefore, if it starts sufficiently near to the local maximum, it may
/// converge to it. Another obvious restriction is that it should be possible to compute the gradient of
/// a function at any point, thus it is preferable to have analytic expression for gradient and
/// computational burden should be born by the user.
///
/// The latter responsibility is accompilished via the getGradient method of a
/// MinProblemSolver::Function interface (which represents function being optimized). This method takes
/// point a point in *n*-dimensional space (first argument represents the array of coordinates of that
/// point) and comput its gradient (it should be stored in the second argument as an array).
///
///
/// Note: class ConjGradSolver thus does not add any new methods to the basic MinProblemSolver interface.
///
///
/// Note: term criteria should meet following condition:
/// ```ignore
/// termcrit.type == (TermCriteria::MAX_ITER + TermCriteria::EPS) && termcrit.epsilon > 0 && termcrit.maxCount > 0
/// // or
/// termcrit.type == TermCriteria::MAX_ITER) && termcrit.maxCount > 0
/// ```
#[allow(dead_code)]
pub struct ConjGradSolver {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ConjGradSolver {
fn drop(&mut self) {
unsafe { sys::cv_delete_ConjGradSolver(self.ptr) };
}
}
impl core::ConjGradSolver {
#[doc(hidden)] pub fn as_raw_ConjGradSolver(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ConjGradSolver {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::MinProblemSolver for ConjGradSolver {
#[doc(hidden)] fn as_raw_MinProblemSolver(&self) -> *mut c_void { self.ptr }
}
impl ConjGradSolver {
// identifier: cv_ConjGradSolver_create_PtrOfFunction_f_TermCriteria_termcrit
/// This function returns the reference to the ready-to-use ConjGradSolver object.
///
/// All the parameters are optional, so this procedure can be called even without parameters at
/// all. In this case, the default values will be used. As default value for terminal criteria are
/// the only sensible ones, MinProblemSolver::setFunction() should be called upon the obtained
/// object, if the function was not given to create(). Otherwise, the two ways (submit it to
/// create() or miss it out and call the MinProblemSolver::setFunction()) are absolutely equivalent
/// (and will drop the same errors in the same way, should invalid input be detected).
/// ## Parameters
/// * f: Pointer to the function that will be minimized, similarly to the one you submit via
/// MinProblemSolver::setFunction.
/// * termcrit: Terminal criteria to the algorithm, similarly to the one you submit via
/// MinProblemSolver::setTermCriteria.
///
/// ## C++ default parameters:
/// * f: Ptr<ConjGradSolver::Function>()
/// * termcrit: TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5000,0.000001)
pub fn create(f: &types::PtrOfFunction, termcrit: &core::TermCriteria) -> Result<types::PtrOfConjGradSolver> {
unsafe { sys::cv_core_cv_ConjGradSolver_create_PtrOfFunction_f_TermCriteria_termcrit(f.as_raw_PtrOfFunction(), termcrit.as_raw_TermCriteria()) }.into_result().map(|x| types::PtrOfConjGradSolver { ptr: x })
}
}
// boxed class cv::CylindricalWarper
/// Cylindrical warper factory class.
/// @sa detail::CylindricalWarper
#[allow(dead_code)]
pub struct CylindricalWarper {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::CylindricalWarper {
fn drop(&mut self) {
unsafe { sys::cv_delete_CylindricalWarper(self.ptr) };
}
}
impl core::CylindricalWarper {
#[doc(hidden)] pub fn as_raw_CylindricalWarper(&self) -> *mut c_void { self.ptr }
}
impl core::WarperCreator for CylindricalWarper {
#[doc(hidden)] fn as_raw_WarperCreator(&self) -> *mut c_void { self.ptr }
}
impl CylindricalWarper {
}
impl DMatch {
// identifier: cv_DMatch_DMatch
pub fn default() -> Result<core::DMatch> {
unsafe { sys::cv_core_cv_DMatch_DMatch() }.into_result()
}
// identifier: cv_DMatch_DMatch_int__queryIdx_int__trainIdx_float__distance
pub fn new(_query_idx: i32, _train_idx: i32, _distance: f32) -> Result<core::DMatch> {
unsafe { sys::cv_core_cv_DMatch_DMatch_int__queryIdx_int__trainIdx_float__distance(_query_idx, _train_idx, _distance) }.into_result()
}
// identifier: cv_DMatch_DMatch_int__queryIdx_int__trainIdx_int__imgIdx_float__distance
pub fn new_index(_query_idx: i32, _train_idx: i32, _img_idx: i32, _distance: f32) -> Result<core::DMatch> {
unsafe { sys::cv_core_cv_DMatch_DMatch_int__queryIdx_int__trainIdx_int__imgIdx_float__distance(_query_idx, _train_idx, _img_idx, _distance) }.into_result()
}
}
// Generating impl for trait cv::DenseOpticalFlow (trait)
pub trait DenseOpticalFlow : core::Algorithm {
#[doc(hidden)] fn as_raw_DenseOpticalFlow(&self) -> *mut c_void;
// identifier: cv_DenseOpticalFlow_calc_Mat_I0_Mat_I1_Mat_flow
/// Calculates an optical flow.
///
/// ## Parameters
/// * I0: first 8-bit single-channel input image.
/// * I1: second input image of the same size and the same type as prev.
/// * flow: computed flow image that has the same size as prev and type CV_32FC2.
fn calc(&mut self, i0: &core::Mat, i1: &core::Mat, flow: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_DenseOpticalFlow_calc_Mat_I0_Mat_I1_Mat_flow(self.as_raw_DenseOpticalFlow(), i0.as_raw_Mat(), i1.as_raw_Mat(), flow.as_raw_Mat()) }.into_result()
}
// identifier: cv_DenseOpticalFlow_collectGarbage
/// Releases all inner buffers.
fn collect_garbage(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_DenseOpticalFlow_collectGarbage(self.as_raw_DenseOpticalFlow()) }.into_result()
}
}
impl<'a> DenseOpticalFlow + 'a {
}
// Generating impl for trait cv::DescriptorMatcher (trait)
/// Abstract base class for matching keypoint descriptors.
///
/// It has two groups of match methods: for matching descriptors of an image with another image or with
/// an image set.
pub trait DescriptorMatcher : core::Algorithm {
#[doc(hidden)] fn as_raw_DescriptorMatcher(&self) -> *mut c_void;
// identifier: cv_DescriptorMatcher_add_VectorOfMat_descriptors
/// Adds descriptors to train a CPU(trainDescCollectionis) or GPU(utrainDescCollectionis) descriptor
/// collection.
///
/// If the collection is not empty, the new descriptors are added to existing train descriptors.
///
/// ## Parameters
/// * descriptors: Descriptors to add. Each descriptors[i] is a set of descriptors from the same
/// train image.
fn add(&mut self, descriptors: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_DescriptorMatcher_add_VectorOfMat_descriptors(self.as_raw_DescriptorMatcher(), descriptors.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_DescriptorMatcher_getTrainDescriptors_const
/// Returns a constant link to the train descriptor collection trainDescCollection .
fn get_train_descriptors(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_core_cv_DescriptorMatcher_getTrainDescriptors_const(self.as_raw_DescriptorMatcher()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
// identifier: cv_DescriptorMatcher_clear
/// Clears the train descriptor collections.
fn clear(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_DescriptorMatcher_clear(self.as_raw_DescriptorMatcher()) }.into_result()
}
// identifier: cv_DescriptorMatcher_empty_const
/// Returns true if there are no train descriptors in the both collections.
fn empty(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_DescriptorMatcher_empty_const(self.as_raw_DescriptorMatcher()) }.into_result()
}
// identifier: cv_DescriptorMatcher_isMaskSupported_const
/// Returns true if the descriptor matcher supports masking permissible matches.
fn is_mask_supported(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_DescriptorMatcher_isMaskSupported_const(self.as_raw_DescriptorMatcher()) }.into_result()
}
// identifier: cv_DescriptorMatcher_train
/// Trains a descriptor matcher
///
/// Trains a descriptor matcher (for example, the flann index). In all methods to match, the method
/// train() is run every time before matching. Some descriptor matchers (for example, BruteForceMatcher)
/// have an empty implementation of this method. Other matchers really train their inner structures (for
/// example, FlannBasedMatcher trains flann::Index ).
fn train(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_DescriptorMatcher_train(self.as_raw_DescriptorMatcher()) }.into_result()
}
// identifier: cv_DescriptorMatcher_match_const_Mat_queryDescriptors_Mat_trainDescriptors_VectorOfDMatch_matches_Mat_mask
/// Finds the best match for each descriptor from a query set.
///
/// ## Parameters
/// * queryDescriptors: Query set of descriptors.
/// * trainDescriptors: Train set of descriptors. This set is not added to the train descriptors
/// collection stored in the class object.
/// * matches: Matches. If a query descriptor is masked out in mask , no match is added for this
/// descriptor. So, matches size may be smaller than the query descriptors count.
/// * mask: Mask specifying permissible matches between an input query and train matrices of
/// descriptors.
///
/// In the first variant of this method, the train descriptors are passed as an input argument. In the
/// second variant of the method, train descriptors collection that was set by DescriptorMatcher::add is
/// used. Optional mask (or masks) can be passed to specify which query and training descriptors can be
/// matched. Namely, queryDescriptors[i] can be matched with trainDescriptors[j] only if
/// mask.at\<uchar\>(i,j) is non-zero.
///
/// ## C++ default parameters:
/// * mask: noArray()
fn train_matches(&self, query_descriptors: &core::Mat, train_descriptors: &core::Mat, matches: &types::VectorOfDMatch, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_DescriptorMatcher_match_const_Mat_queryDescriptors_Mat_trainDescriptors_VectorOfDMatch_matches_Mat_mask(self.as_raw_DescriptorMatcher(), query_descriptors.as_raw_Mat(), train_descriptors.as_raw_Mat(), matches.as_raw_VectorOfDMatch(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_DescriptorMatcher_knnMatch_const_Mat_queryDescriptors_Mat_trainDescriptors_VectorOfVectorOfDMatch_matches_int_k_Mat_mask_bool_compactResult
/// Finds the k best matches for each descriptor from a query set.
///
/// ## Parameters
/// * queryDescriptors: Query set of descriptors.
/// * trainDescriptors: Train set of descriptors. This set is not added to the train descriptors
/// collection stored in the class object.
/// * mask: Mask specifying permissible matches between an input query and train matrices of
/// descriptors.
/// * matches: Matches. Each matches[i] is k or less matches for the same query descriptor.
/// * k: Count of best matches found per each query descriptor or less if a query descriptor has
/// less than k possible matches in total.
/// * compactResult: Parameter used when the mask (or masks) is not empty. If compactResult is
/// false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
/// the matches vector does not contain matches for fully masked-out query descriptors.
///
/// These extended variants of DescriptorMatcher::match methods find several best matches for each query
/// descriptor. The matches are returned in the distance increasing order. See DescriptorMatcher::match
/// for the details about query and train descriptors.
///
/// ## C++ default parameters:
/// * mask: noArray()
/// * compact_result: false
fn knn_train_matches(&self, query_descriptors: &core::Mat, train_descriptors: &core::Mat, matches: &types::VectorOfVectorOfDMatch, k: i32, mask: &core::Mat, compact_result: bool) -> Result<()> {
unsafe { sys::cv_core_cv_DescriptorMatcher_knnMatch_const_Mat_queryDescriptors_Mat_trainDescriptors_VectorOfVectorOfDMatch_matches_int_k_Mat_mask_bool_compactResult(self.as_raw_DescriptorMatcher(), query_descriptors.as_raw_Mat(), train_descriptors.as_raw_Mat(), matches.as_raw_VectorOfVectorOfDMatch(), k, mask.as_raw_Mat(), compact_result) }.into_result()
}
// identifier: cv_DescriptorMatcher_radiusMatch_const_Mat_queryDescriptors_Mat_trainDescriptors_VectorOfVectorOfDMatch_matches_float_maxDistance_Mat_mask_bool_compactResult
/// For each query descriptor, finds the training descriptors not farther than the specified distance.
///
/// ## Parameters
/// * queryDescriptors: Query set of descriptors.
/// * trainDescriptors: Train set of descriptors. This set is not added to the train descriptors
/// collection stored in the class object.
/// * matches: Found matches.
/// * compactResult: Parameter used when the mask (or masks) is not empty. If compactResult is
/// false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
/// the matches vector does not contain matches for fully masked-out query descriptors.
/// * maxDistance: Threshold for the distance between matched descriptors. Distance means here
/// metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured
/// in Pixels)!
/// * mask: Mask specifying permissible matches between an input query and train matrices of
/// descriptors.
///
/// For each query descriptor, the methods find such training descriptors that the distance between the
/// query descriptor and the training descriptor is equal or smaller than maxDistance. Found matches are
/// returned in the distance increasing order.
///
/// ## C++ default parameters:
/// * mask: noArray()
/// * compact_result: false
fn train_radius_matches(&self, query_descriptors: &core::Mat, train_descriptors: &core::Mat, matches: &types::VectorOfVectorOfDMatch, max_distance: f32, mask: &core::Mat, compact_result: bool) -> Result<()> {
unsafe { sys::cv_core_cv_DescriptorMatcher_radiusMatch_const_Mat_queryDescriptors_Mat_trainDescriptors_VectorOfVectorOfDMatch_matches_float_maxDistance_Mat_mask_bool_compactResult(self.as_raw_DescriptorMatcher(), query_descriptors.as_raw_Mat(), train_descriptors.as_raw_Mat(), matches.as_raw_VectorOfVectorOfDMatch(), max_distance, mask.as_raw_Mat(), compact_result) }.into_result()
}
// identifier: cv_DescriptorMatcher_match_Mat_queryDescriptors_VectorOfDMatch_matches_VectorOfMat_masks
/// @overload
/// ## Parameters
/// * queryDescriptors: Query set of descriptors.
/// * matches: Matches. If a query descriptor is masked out in mask , no match is added for this
/// descriptor. So, matches size may be smaller than the query descriptors count.
/// * masks: Set of masks. Each masks[i] specifies permissible matches between the input query
/// descriptors and stored train descriptors from the i-th image trainDescCollection[i].
///
/// ## C++ default parameters:
/// * masks: noArray()
fn matches(&mut self, query_descriptors: &core::Mat, matches: &types::VectorOfDMatch, masks: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_DescriptorMatcher_match_Mat_queryDescriptors_VectorOfDMatch_matches_VectorOfMat_masks(self.as_raw_DescriptorMatcher(), query_descriptors.as_raw_Mat(), matches.as_raw_VectorOfDMatch(), masks.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_DescriptorMatcher_knnMatch_Mat_queryDescriptors_VectorOfVectorOfDMatch_matches_int_k_VectorOfMat_masks_bool_compactResult
/// @overload
/// ## Parameters
/// * queryDescriptors: Query set of descriptors.
/// * matches: Matches. Each matches[i] is k or less matches for the same query descriptor.
/// * k: Count of best matches found per each query descriptor or less if a query descriptor has
/// less than k possible matches in total.
/// * masks: Set of masks. Each masks[i] specifies permissible matches between the input query
/// descriptors and stored train descriptors from the i-th image trainDescCollection[i].
/// * compactResult: Parameter used when the mask (or masks) is not empty. If compactResult is
/// false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
/// the matches vector does not contain matches for fully masked-out query descriptors.
///
/// ## C++ default parameters:
/// * masks: noArray()
/// * compact_result: false
fn knn_matches(&mut self, query_descriptors: &core::Mat, matches: &types::VectorOfVectorOfDMatch, k: i32, masks: &types::VectorOfMat, compact_result: bool) -> Result<()> {
unsafe { sys::cv_core_cv_DescriptorMatcher_knnMatch_Mat_queryDescriptors_VectorOfVectorOfDMatch_matches_int_k_VectorOfMat_masks_bool_compactResult(self.as_raw_DescriptorMatcher(), query_descriptors.as_raw_Mat(), matches.as_raw_VectorOfVectorOfDMatch(), k, masks.as_raw_VectorOfMat(), compact_result) }.into_result()
}
// identifier: cv_DescriptorMatcher_radiusMatch_Mat_queryDescriptors_VectorOfVectorOfDMatch_matches_float_maxDistance_VectorOfMat_masks_bool_compactResult
/// @overload
/// ## Parameters
/// * queryDescriptors: Query set of descriptors.
/// * matches: Found matches.
/// * maxDistance: Threshold for the distance between matched descriptors. Distance means here
/// metric distance (e.g. Hamming distance), not the distance between coordinates (which is measured
/// in Pixels)!
/// * masks: Set of masks. Each masks[i] specifies permissible matches between the input query
/// descriptors and stored train descriptors from the i-th image trainDescCollection[i].
/// * compactResult: Parameter used when the mask (or masks) is not empty. If compactResult is
/// false, the matches vector has the same size as queryDescriptors rows. If compactResult is true,
/// the matches vector does not contain matches for fully masked-out query descriptors.
///
/// ## C++ default parameters:
/// * masks: noArray()
/// * compact_result: false
fn radius_matches(&mut self, query_descriptors: &core::Mat, matches: &types::VectorOfVectorOfDMatch, max_distance: f32, masks: &types::VectorOfMat, compact_result: bool) -> Result<()> {
unsafe { sys::cv_core_cv_DescriptorMatcher_radiusMatch_Mat_queryDescriptors_VectorOfVectorOfDMatch_matches_float_maxDistance_VectorOfMat_masks_bool_compactResult(self.as_raw_DescriptorMatcher(), query_descriptors.as_raw_Mat(), matches.as_raw_VectorOfVectorOfDMatch(), max_distance, masks.as_raw_VectorOfMat(), compact_result) }.into_result()
}
// identifier: cv_DescriptorMatcher_write_const_String_fileName
fn write(&self, file_name: &str) -> Result<()> {
string_arg!(file_name);
unsafe { sys::cv_core_cv_DescriptorMatcher_write_const_String_fileName(self.as_raw_DescriptorMatcher(), file_name.as_ptr()) }.into_result()
}
// identifier: cv_DescriptorMatcher_read_String_fileName
fn read(&mut self, file_name: &str) -> Result<()> {
string_arg!(file_name);
unsafe { sys::cv_core_cv_DescriptorMatcher_read_String_fileName(self.as_raw_DescriptorMatcher(), file_name.as_ptr()) }.into_result()
}
// identifier: cv_DescriptorMatcher_clone_const_bool_emptyTrainData
/// Clones the matcher.
///
/// ## Parameters
/// * emptyTrainData: If emptyTrainData is false, the method creates a deep copy of the object,
/// that is, copies both parameters and train data. If emptyTrainData is true, the method creates an
/// object copy with the current parameters but with empty train data.
///
/// ## C++ default parameters:
/// * empty_train_data: false
fn clone(&self, empty_train_data: bool) -> Result<types::PtrOfDescriptorMatcher> {
unsafe { sys::cv_core_cv_DescriptorMatcher_clone_const_bool_emptyTrainData(self.as_raw_DescriptorMatcher(), empty_train_data) }.into_result().map(|x| types::PtrOfDescriptorMatcher { ptr: x })
}
}
impl<'a> DescriptorMatcher + 'a {
// identifier: cv_DescriptorMatcher_create_String_descriptorMatcherType
/// Creates a descriptor matcher of a given type with the default parameters (using default
/// constructor).
///
/// ## Parameters
/// * descriptorMatcherType: Descriptor matcher type. Now the following matcher types are
/// supported:
/// * `BruteForce` (it uses L2 )
/// * `BruteForce-L1`
/// * `BruteForce-Hamming`
/// * `BruteForce-Hamming(2)`
/// * `FlannBased`
pub fn create(descriptor_matcher_type: &str) -> Result<types::PtrOfDescriptorMatcher> {
string_arg!(descriptor_matcher_type);
unsafe { sys::cv_core_cv_DescriptorMatcher_create_String_descriptorMatcherType(descriptor_matcher_type.as_ptr()) }.into_result().map(|x| types::PtrOfDescriptorMatcher { ptr: x })
}
// identifier: cv_DescriptorMatcher_create_int_matcherType
pub fn create_1(matcher_type: i32) -> Result<types::PtrOfDescriptorMatcher> {
unsafe { sys::cv_core_cv_DescriptorMatcher_create_int_matcherType(matcher_type) }.into_result().map(|x| types::PtrOfDescriptorMatcher { ptr: x })
}
}
// boxed class cv::DetectionBasedTracker
#[allow(dead_code)]
pub struct DetectionBasedTracker {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::DetectionBasedTracker {
fn drop(&mut self) {
unsafe { sys::cv_delete_DetectionBasedTracker(self.ptr) };
}
}
impl core::DetectionBasedTracker {
#[doc(hidden)] pub fn as_raw_DetectionBasedTracker(&self) -> *mut c_void { self.ptr }
}
impl DetectionBasedTracker {
// identifier: cv_DetectionBasedTracker_run
pub fn run(&mut self) -> Result<bool> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_run(self.as_raw_DetectionBasedTracker()) }.into_result()
}
// identifier: cv_DetectionBasedTracker_stop
pub fn stop(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_stop(self.as_raw_DetectionBasedTracker()) }.into_result()
}
// identifier: cv_DetectionBasedTracker_resetTracking
pub fn reset_tracking(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_resetTracking(self.as_raw_DetectionBasedTracker()) }.into_result()
}
// identifier: cv_DetectionBasedTracker_process_Mat_imageGray
pub fn process(&mut self, image_gray: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_process_Mat_imageGray(self.as_raw_DetectionBasedTracker(), image_gray.as_raw_Mat()) }.into_result()
}
// identifier: cv_DetectionBasedTracker_setParameters_Parameters_params
pub fn set_parameters(&mut self, params: &core::DetectionBasedTracker_Parameters) -> Result<bool> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_setParameters_Parameters_params(self.as_raw_DetectionBasedTracker(), params.as_raw_DetectionBasedTracker_Parameters()) }.into_result()
}
// identifier: cv_DetectionBasedTracker_getParameters_const
pub fn get_parameters(&self) -> Result<core::DetectionBasedTracker_Parameters> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_getParameters_const(self.as_raw_DetectionBasedTracker()) }.into_result().map(|x| core::DetectionBasedTracker_Parameters { ptr: x })
}
// identifier: cv_DetectionBasedTracker_getObjects_const_VectorOfRect_result
pub fn get_objects(&self, result: &types::VectorOfRect) -> Result<()> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_getObjects_const_VectorOfRect_result(self.as_raw_DetectionBasedTracker(), result.as_raw_VectorOfRect()) }.into_result()
}
// identifier: cv_DetectionBasedTracker_getObjects_const_VectorOfExtObject_result
pub fn get_objects_1(&self, result: &types::VectorOfExtObject) -> Result<()> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_getObjects_const_VectorOfExtObject_result(self.as_raw_DetectionBasedTracker(), result.as_raw_VectorOfExtObject()) }.into_result()
}
// identifier: cv_DetectionBasedTracker_addObject_Rect_location
pub fn add_object(&mut self, location: core::Rect) -> Result<i32> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_addObject_Rect_location(self.as_raw_DetectionBasedTracker(), location) }.into_result()
}
}
// boxed class cv::DetectionBasedTracker::ExtObject
#[allow(dead_code)]
pub struct DetectionBasedTracker_ExtObject {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::DetectionBasedTracker_ExtObject {
fn drop(&mut self) {
unsafe { sys::cv_delete_DetectionBasedTracker_ExtObject(self.ptr) };
}
}
impl core::DetectionBasedTracker_ExtObject {
#[doc(hidden)] pub fn as_raw_DetectionBasedTracker_ExtObject(&self) -> *mut c_void { self.ptr }
}
// Generating impl for trait cv::DetectionBasedTracker::IDetector (trait)
pub trait DetectionBasedTracker_IDetector {
#[doc(hidden)] fn as_raw_DetectionBasedTracker_IDetector(&self) -> *mut c_void;
// identifier: cv_DetectionBasedTracker_IDetector_detect_Mat_image_VectorOfRect_objects
fn detect(&mut self, image: &core::Mat, objects: &types::VectorOfRect) -> Result<()> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_IDetector_detect_Mat_image_VectorOfRect_objects(self.as_raw_DetectionBasedTracker_IDetector(), image.as_raw_Mat(), objects.as_raw_VectorOfRect()) }.into_result()
}
// identifier: cv_DetectionBasedTracker_IDetector_setMinObjectSize_Size_min
fn set_min_object_size(&mut self, min: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_IDetector_setMinObjectSize_Size_min(self.as_raw_DetectionBasedTracker_IDetector(), min) }.into_result()
}
// identifier: cv_DetectionBasedTracker_IDetector_setMaxObjectSize_Size_max
fn set_max_object_size(&mut self, max: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_IDetector_setMaxObjectSize_Size_max(self.as_raw_DetectionBasedTracker_IDetector(), max) }.into_result()
}
// identifier: cv_DetectionBasedTracker_IDetector_getMinObjectSize_const
fn get_min_object_size(&self) -> Result<core::Size> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_IDetector_getMinObjectSize_const(self.as_raw_DetectionBasedTracker_IDetector()) }.into_result()
}
// identifier: cv_DetectionBasedTracker_IDetector_getMaxObjectSize_const
fn get_max_object_size(&self) -> Result<core::Size> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_IDetector_getMaxObjectSize_const(self.as_raw_DetectionBasedTracker_IDetector()) }.into_result()
}
// identifier: cv_DetectionBasedTracker_IDetector_getScaleFactor
fn get_scale_factor(&mut self) -> Result<f32> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_IDetector_getScaleFactor(self.as_raw_DetectionBasedTracker_IDetector()) }.into_result()
}
// identifier: cv_DetectionBasedTracker_IDetector_setScaleFactor_float_value
fn set_scale_factor(&mut self, value: f32) -> Result<()> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_IDetector_setScaleFactor_float_value(self.as_raw_DetectionBasedTracker_IDetector(), value) }.into_result()
}
// identifier: cv_DetectionBasedTracker_IDetector_getMinNeighbours
fn get_min_neighbours(&mut self) -> Result<i32> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_IDetector_getMinNeighbours(self.as_raw_DetectionBasedTracker_IDetector()) }.into_result()
}
// identifier: cv_DetectionBasedTracker_IDetector_setMinNeighbours_int_value
fn set_min_neighbours(&mut self, value: i32) -> Result<()> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_IDetector_setMinNeighbours_int_value(self.as_raw_DetectionBasedTracker_IDetector(), value) }.into_result()
}
}
impl<'a> DetectionBasedTracker_IDetector + 'a {
}
// boxed class cv::DetectionBasedTracker::Parameters
#[allow(dead_code)]
pub struct DetectionBasedTracker_Parameters {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::DetectionBasedTracker_Parameters {
fn drop(&mut self) {
unsafe { sys::cv_delete_DetectionBasedTracker_Parameters(self.ptr) };
}
}
impl core::DetectionBasedTracker_Parameters {
#[doc(hidden)] pub fn as_raw_DetectionBasedTracker_Parameters(&self) -> *mut c_void { self.ptr }
}
impl DetectionBasedTracker_Parameters {
// identifier: cv_DetectionBasedTracker_Parameters_Parameters
pub fn new() -> Result<core::DetectionBasedTracker_Parameters> {
unsafe { sys::cv_core_cv_DetectionBasedTracker_Parameters_Parameters() }.into_result().map(|x| core::DetectionBasedTracker_Parameters { ptr: x })
}
}
// boxed class cv::DetectionROI
#[allow(dead_code)]
pub struct DetectionROI {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::DetectionROI {
fn drop(&mut self) {
unsafe { sys::cv_delete_DetectionROI(self.ptr) };
}
}
impl core::DetectionROI {
#[doc(hidden)] pub fn as_raw_DetectionROI(&self) -> *mut c_void { self.ptr }
}
// Generating impl for trait cv::DownhillSolver (trait)
/// This class is used to perform the non-linear non-constrained minimization of a function,
///
/// defined on an `n`-dimensional Euclidean space, using the **Nelder-Mead method**, also known as
/// **downhill simplex method**. The basic idea about the method can be obtained from
/// <http://en.wikipedia.org/wiki/Nelder-Mead_method>.
///
/// It should be noted, that this method, although deterministic, is rather a heuristic and therefore
/// may converge to a local minima, not necessary a global one. It is iterative optimization technique,
/// which at each step uses an information about the values of a function evaluated only at `n+1`
/// points, arranged as a *simplex* in `n`-dimensional space (hence the second name of the method). At
/// each step new point is chosen to evaluate function at, obtained value is compared with previous
/// ones and based on this information simplex changes it's shape , slowly moving to the local minimum.
/// Thus this method is using *only* function values to make decision, on contrary to, say, Nonlinear
/// Conjugate Gradient method (which is also implemented in optim).
///
/// Algorithm stops when the number of function evaluations done exceeds termcrit.maxCount, when the
/// function values at the vertices of simplex are within termcrit.epsilon range or simplex becomes so
/// small that it can enclosed in a box with termcrit.epsilon sides, whatever comes first, for some
/// defined by user positive integer termcrit.maxCount and positive non-integer termcrit.epsilon.
///
///
/// Note: DownhillSolver is a derivative of the abstract interface
/// cv::MinProblemSolver, which in turn is derived from the Algorithm interface and is used to
/// encapsulate the functionality, common to all non-linear optimization algorithms in the optim
/// module.
///
///
/// Note: term criteria should meet following condition:
/// ```ignore
/// termcrit.type == (TermCriteria::MAX_ITER + TermCriteria::EPS) && termcrit.epsilon > 0 && termcrit.maxCount > 0
/// ```
pub trait DownhillSolver : core::MinProblemSolver {
#[doc(hidden)] fn as_raw_DownhillSolver(&self) -> *mut c_void;
// identifier: cv_DownhillSolver_getInitStep_const_Mat_step
/// Returns the initial step that will be used in downhill simplex algorithm.
///
/// ## Parameters
/// * step: Initial step that will be used in algorithm. Note, that although corresponding setter
/// accepts column-vectors as well as row-vectors, this method will return a row-vector.
/// @see DownhillSolver::setInitStep
fn get_init_step(&self, step: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_DownhillSolver_getInitStep_const_Mat_step(self.as_raw_DownhillSolver(), step.as_raw_Mat()) }.into_result()
}
// identifier: cv_DownhillSolver_setInitStep_Mat_step
/// Sets the initial step that will be used in downhill simplex algorithm.
///
/// Step, together with initial point (givin in DownhillSolver::minimize) are two `n`-dimensional
/// vectors that are used to determine the shape of initial simplex. Roughly said, initial point
/// determines the position of a simplex (it will become simplex's centroid), while step determines the
/// spread (size in each dimension) of a simplex. To be more precise, if <span lang='latex'>s,x_0\in\mathbb{R}^n</span> are
/// the initial step and initial point respectively, the vertices of a simplex will be:
/// <span lang='latex'>v_0:=x_0-\frac{1}{2} s</span> and <span lang='latex'>v_i:=x_0+s_i</span> for <span lang='latex'>i=1,2,\dots,n</span> where <span lang='latex'>s_i</span> denotes
/// projections of the initial step of *n*-th coordinate (the result of projection is treated to be
/// vector given by <span lang='latex'>s_i:=e_i\cdot\left<e_i\cdot s\right></span>, where <span lang='latex'>e_i</span> form canonical basis)
///
/// ## Parameters
/// * step: Initial step that will be used in algorithm. Roughly said, it determines the spread
/// (size in each dimension) of an initial simplex.
fn set_init_step(&mut self, step: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_DownhillSolver_setInitStep_Mat_step(self.as_raw_DownhillSolver(), step.as_raw_Mat()) }.into_result()
}
}
impl<'a> DownhillSolver + 'a {
// identifier: cv_DownhillSolver_create_PtrOfFunction_f_Mat_initStep_TermCriteria_termcrit
/// This function returns the reference to the ready-to-use DownhillSolver object.
///
/// All the parameters are optional, so this procedure can be called even without parameters at
/// all. In this case, the default values will be used. As default value for terminal criteria are
/// the only sensible ones, MinProblemSolver::setFunction() and DownhillSolver::setInitStep()
/// should be called upon the obtained object, if the respective parameters were not given to
/// create(). Otherwise, the two ways (give parameters to createDownhillSolver() or miss them out
/// and call the MinProblemSolver::setFunction() and DownhillSolver::setInitStep()) are absolutely
/// equivalent (and will drop the same errors in the same way, should invalid input be detected).
/// ## Parameters
/// * f: Pointer to the function that will be minimized, similarly to the one you submit via
/// MinProblemSolver::setFunction.
/// * initStep: Initial step, that will be used to construct the initial simplex, similarly to the one
/// you submit via MinProblemSolver::setInitStep.
/// * termcrit: Terminal criteria to the algorithm, similarly to the one you submit via
/// MinProblemSolver::setTermCriteria.
///
/// ## C++ default parameters:
/// * f: Ptr<MinProblemSolver::Function>()
/// * init_step: Mat_<double>(1,1,0.0)
/// * termcrit: TermCriteria(TermCriteria::MAX_ITER+TermCriteria::EPS,5000,0.000001)
pub fn create(f: &types::PtrOfFunction, init_step: &core::Mat, termcrit: &core::TermCriteria) -> Result<types::PtrOfDownhillSolver> {
unsafe { sys::cv_core_cv_DownhillSolver_create_PtrOfFunction_f_Mat_initStep_TermCriteria_termcrit(f.as_raw_PtrOfFunction(), init_step.as_raw_Mat(), termcrit.as_raw_TermCriteria()) }.into_result().map(|x| types::PtrOfDownhillSolver { ptr: x })
}
}
// boxed class cv::DrawMatchesFlags
/// \
/// Drawing functions *
#[allow(dead_code)]
pub struct DrawMatchesFlags {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::DrawMatchesFlags {
fn drop(&mut self) {
unsafe { sys::cv_delete_DrawMatchesFlags(self.ptr) };
}
}
impl core::DrawMatchesFlags {
#[doc(hidden)] pub fn as_raw_DrawMatchesFlags(&self) -> *mut c_void { self.ptr }
}
// Generating impl for trait cv::DualTVL1OpticalFlow (trait)
/// "Dual TV L1" Optical Flow Algorithm.
///
/// The class implements the "Dual TV L1" optical flow algorithm described in @cite Zach2007 and
/// @cite Javier2012 .
/// Here are important members of the class that control the algorithm, which you can set after
/// constructing the class instance:
///
/// * member double tau
/// Time step of the numerical scheme.
///
/// * member double lambda
/// Weight parameter for the data term, attachment parameter. This is the most relevant
/// parameter, which determines the smoothness of the output. The smaller this parameter is,
/// the smoother the solutions we obtain. It depends on the range of motions of the images, so
/// its value should be adapted to each image sequence.
///
/// * member double theta
/// Weight parameter for (u - v)\^2, tightness parameter. It serves as a link between the
/// attachment and the regularization terms. In theory, it should have a small value in order
/// to maintain both parts in correspondence. The method is stable for a large range of values
/// of this parameter.
///
/// * member int nscales
/// Number of scales used to create the pyramid of images.
///
/// * member int warps
/// Number of warpings per scale. Represents the number of times that I1(x+u0) and grad(
/// I1(x+u0) ) are computed per scale. This is a parameter that assures the stability of the
/// method. It also affects the running time, so it is a compromise between speed and
/// accuracy.
///
/// * member double epsilon
/// Stopping criterion threshold used in the numerical scheme, which is a trade-off between
/// precision and running time. A small value will yield more accurate solutions at the
/// expense of a slower convergence.
///
/// * member int iterations
/// Stopping criterion iterations number used in the numerical scheme.
///
/// C. Zach, T. Pock and H. Bischof, "A Duality Based Approach for Realtime TV-L1 Optical Flow".
/// Javier Sanchez, Enric Meinhardt-Llopis and Gabriele Facciolo. "TV-L1 Optical Flow Estimation".
pub trait DualTVL1OpticalFlow : core::DenseOpticalFlow {
#[doc(hidden)] fn as_raw_DualTVL1OpticalFlow(&self) -> *mut c_void;
// identifier: cv_DualTVL1OpticalFlow_getTau_const
/// @see setTau
fn get_tau(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_getTau_const(self.as_raw_DualTVL1OpticalFlow()) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_setTau_double_val
/// @copybrief getTau @see getTau
fn set_tau(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_setTau_double_val(self.as_raw_DualTVL1OpticalFlow(), val) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_getLambda_const
/// @see setLambda
fn get_lambda(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_getLambda_const(self.as_raw_DualTVL1OpticalFlow()) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_setLambda_double_val
/// @copybrief getLambda @see getLambda
fn set_lambda(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_setLambda_double_val(self.as_raw_DualTVL1OpticalFlow(), val) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_getTheta_const
/// @see setTheta
fn get_theta(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_getTheta_const(self.as_raw_DualTVL1OpticalFlow()) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_setTheta_double_val
/// @copybrief getTheta @see getTheta
fn set_theta(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_setTheta_double_val(self.as_raw_DualTVL1OpticalFlow(), val) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_getGamma_const
/// @see setGamma
fn get_gamma(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_getGamma_const(self.as_raw_DualTVL1OpticalFlow()) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_setGamma_double_val
/// @copybrief getGamma @see getGamma
fn set_gamma(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_setGamma_double_val(self.as_raw_DualTVL1OpticalFlow(), val) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_getScalesNumber_const
/// @see setScalesNumber
fn get_scales_number(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_getScalesNumber_const(self.as_raw_DualTVL1OpticalFlow()) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_setScalesNumber_int_val
/// @copybrief getScalesNumber @see getScalesNumber
fn set_scales_number(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_setScalesNumber_int_val(self.as_raw_DualTVL1OpticalFlow(), val) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_getWarpingsNumber_const
/// @see setWarpingsNumber
fn get_warpings_number(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_getWarpingsNumber_const(self.as_raw_DualTVL1OpticalFlow()) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_setWarpingsNumber_int_val
/// @copybrief getWarpingsNumber @see getWarpingsNumber
fn set_warpings_number(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_setWarpingsNumber_int_val(self.as_raw_DualTVL1OpticalFlow(), val) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_getEpsilon_const
/// @see setEpsilon
fn get_epsilon(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_getEpsilon_const(self.as_raw_DualTVL1OpticalFlow()) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_setEpsilon_double_val
/// @copybrief getEpsilon @see getEpsilon
fn set_epsilon(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_setEpsilon_double_val(self.as_raw_DualTVL1OpticalFlow(), val) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_getInnerIterations_const
/// @see setInnerIterations
fn get_inner_iterations(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_getInnerIterations_const(self.as_raw_DualTVL1OpticalFlow()) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_setInnerIterations_int_val
/// @copybrief getInnerIterations @see getInnerIterations
fn set_inner_iterations(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_setInnerIterations_int_val(self.as_raw_DualTVL1OpticalFlow(), val) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_getOuterIterations_const
/// @see setOuterIterations
fn get_outer_iterations(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_getOuterIterations_const(self.as_raw_DualTVL1OpticalFlow()) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_setOuterIterations_int_val
/// @copybrief getOuterIterations @see getOuterIterations
fn set_outer_iterations(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_setOuterIterations_int_val(self.as_raw_DualTVL1OpticalFlow(), val) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_getUseInitialFlow_const
/// @see setUseInitialFlow
fn get_use_initial_flow(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_getUseInitialFlow_const(self.as_raw_DualTVL1OpticalFlow()) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_setUseInitialFlow_bool_val
/// @copybrief getUseInitialFlow @see getUseInitialFlow
fn set_use_initial_flow(&mut self, val: bool) -> Result<()> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_setUseInitialFlow_bool_val(self.as_raw_DualTVL1OpticalFlow(), val) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_getScaleStep_const
/// @see setScaleStep
fn get_scale_step(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_getScaleStep_const(self.as_raw_DualTVL1OpticalFlow()) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_setScaleStep_double_val
/// @copybrief getScaleStep @see getScaleStep
fn set_scale_step(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_setScaleStep_double_val(self.as_raw_DualTVL1OpticalFlow(), val) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_getMedianFiltering_const
/// @see setMedianFiltering
fn get_median_filtering(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_getMedianFiltering_const(self.as_raw_DualTVL1OpticalFlow()) }.into_result()
}
// identifier: cv_DualTVL1OpticalFlow_setMedianFiltering_int_val
/// @copybrief getMedianFiltering @see getMedianFiltering
fn set_median_filtering(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_setMedianFiltering_int_val(self.as_raw_DualTVL1OpticalFlow(), val) }.into_result()
}
}
impl<'a> DualTVL1OpticalFlow + 'a {
// identifier: cv_DualTVL1OpticalFlow_create_double_tau_double_lambda_double_theta_int_nscales_int_warps_double_epsilon_int_innnerIterations_int_outerIterations_double_scaleStep_double_gamma_int_medianFiltering_bool_useInitialFlow
/// Creates instance of cv::DualTVL1OpticalFlow
///
/// ## C++ default parameters:
/// * tau: 0.25
/// * lambda: 0.15
/// * theta: 0.3
/// * nscales: 5
/// * warps: 5
/// * epsilon: 0.01
/// * innner_iterations: 30
/// * outer_iterations: 10
/// * scale_step: 0.8
/// * gamma: 0.0
/// * median_filtering: 5
/// * use_initial_flow: false
pub fn create(tau: f64, lambda: f64, theta: f64, nscales: i32, warps: i32, epsilon: f64, innner_iterations: i32, outer_iterations: i32, scale_step: f64, gamma: f64, median_filtering: i32, use_initial_flow: bool) -> Result<types::PtrOfDualTVL1OpticalFlow> {
unsafe { sys::cv_core_cv_DualTVL1OpticalFlow_create_double_tau_double_lambda_double_theta_int_nscales_int_warps_double_epsilon_int_innnerIterations_int_outerIterations_double_scaleStep_double_gamma_int_medianFiltering_bool_useInitialFlow(tau, lambda, theta, nscales, warps, epsilon, innner_iterations, outer_iterations, scale_step, gamma, median_filtering, use_initial_flow) }.into_result().map(|x| types::PtrOfDualTVL1OpticalFlow { ptr: x })
}
}
// Generating impl for trait cv::EMDHistogramCostExtractor (trait)
/// An EMD based cost extraction. :
pub trait EMDHistogramCostExtractor : core::HistogramCostExtractor {
#[doc(hidden)] fn as_raw_EMDHistogramCostExtractor(&self) -> *mut c_void;
// identifier: cv_EMDHistogramCostExtractor_setNormFlag_int_flag
fn set_norm_flag(&mut self, flag: i32) -> Result<()> {
unsafe { sys::cv_core_cv_EMDHistogramCostExtractor_setNormFlag_int_flag(self.as_raw_EMDHistogramCostExtractor(), flag) }.into_result()
}
// identifier: cv_EMDHistogramCostExtractor_getNormFlag_const
fn get_norm_flag(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_EMDHistogramCostExtractor_getNormFlag_const(self.as_raw_EMDHistogramCostExtractor()) }.into_result()
}
}
impl<'a> EMDHistogramCostExtractor + 'a {
}
// boxed class cv::EMDL1HistogramCostExtractor
/// An EMD-L1 based cost extraction. :
#[allow(dead_code)]
pub struct EMDL1HistogramCostExtractor {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::EMDL1HistogramCostExtractor {
fn drop(&mut self) {
unsafe { sys::cv_delete_EMDL1HistogramCostExtractor(self.ptr) };
}
}
impl core::EMDL1HistogramCostExtractor {
#[doc(hidden)] pub fn as_raw_EMDL1HistogramCostExtractor(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for EMDL1HistogramCostExtractor {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::HistogramCostExtractor for EMDL1HistogramCostExtractor {
#[doc(hidden)] fn as_raw_HistogramCostExtractor(&self) -> *mut c_void { self.ptr }
}
// Generating impl for trait cv::FarnebackOpticalFlow (trait)
/// Class computing a dense optical flow using the Gunnar Farneback's algorithm.
pub trait FarnebackOpticalFlow : core::DenseOpticalFlow {
#[doc(hidden)] fn as_raw_FarnebackOpticalFlow(&self) -> *mut c_void;
// identifier: cv_FarnebackOpticalFlow_getNumLevels_const
fn get_num_levels(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_getNumLevels_const(self.as_raw_FarnebackOpticalFlow()) }.into_result()
}
// identifier: cv_FarnebackOpticalFlow_setNumLevels_int_numLevels
fn set_num_levels(&mut self, num_levels: i32) -> Result<()> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_setNumLevels_int_numLevels(self.as_raw_FarnebackOpticalFlow(), num_levels) }.into_result()
}
// identifier: cv_FarnebackOpticalFlow_getPyrScale_const
fn get_pyr_scale(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_getPyrScale_const(self.as_raw_FarnebackOpticalFlow()) }.into_result()
}
// identifier: cv_FarnebackOpticalFlow_setPyrScale_double_pyrScale
fn set_pyr_scale(&mut self, pyr_scale: f64) -> Result<()> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_setPyrScale_double_pyrScale(self.as_raw_FarnebackOpticalFlow(), pyr_scale) }.into_result()
}
// identifier: cv_FarnebackOpticalFlow_getFastPyramids_const
fn get_fast_pyramids(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_getFastPyramids_const(self.as_raw_FarnebackOpticalFlow()) }.into_result()
}
// identifier: cv_FarnebackOpticalFlow_setFastPyramids_bool_fastPyramids
fn set_fast_pyramids(&mut self, fast_pyramids: bool) -> Result<()> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_setFastPyramids_bool_fastPyramids(self.as_raw_FarnebackOpticalFlow(), fast_pyramids) }.into_result()
}
// identifier: cv_FarnebackOpticalFlow_getWinSize_const
fn get_win_size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_getWinSize_const(self.as_raw_FarnebackOpticalFlow()) }.into_result()
}
// identifier: cv_FarnebackOpticalFlow_setWinSize_int_winSize
fn set_win_size(&mut self, win_size: i32) -> Result<()> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_setWinSize_int_winSize(self.as_raw_FarnebackOpticalFlow(), win_size) }.into_result()
}
// identifier: cv_FarnebackOpticalFlow_getNumIters_const
fn get_num_iters(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_getNumIters_const(self.as_raw_FarnebackOpticalFlow()) }.into_result()
}
// identifier: cv_FarnebackOpticalFlow_setNumIters_int_numIters
fn set_num_iters(&mut self, num_iters: i32) -> Result<()> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_setNumIters_int_numIters(self.as_raw_FarnebackOpticalFlow(), num_iters) }.into_result()
}
// identifier: cv_FarnebackOpticalFlow_getPolyN_const
fn get_poly_n(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_getPolyN_const(self.as_raw_FarnebackOpticalFlow()) }.into_result()
}
// identifier: cv_FarnebackOpticalFlow_setPolyN_int_polyN
fn set_poly_n(&mut self, poly_n: i32) -> Result<()> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_setPolyN_int_polyN(self.as_raw_FarnebackOpticalFlow(), poly_n) }.into_result()
}
// identifier: cv_FarnebackOpticalFlow_getPolySigma_const
fn get_poly_sigma(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_getPolySigma_const(self.as_raw_FarnebackOpticalFlow()) }.into_result()
}
// identifier: cv_FarnebackOpticalFlow_setPolySigma_double_polySigma
fn set_poly_sigma(&mut self, poly_sigma: f64) -> Result<()> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_setPolySigma_double_polySigma(self.as_raw_FarnebackOpticalFlow(), poly_sigma) }.into_result()
}
// identifier: cv_FarnebackOpticalFlow_getFlags_const
fn get_flags(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_getFlags_const(self.as_raw_FarnebackOpticalFlow()) }.into_result()
}
// identifier: cv_FarnebackOpticalFlow_setFlags_int_flags
fn set_flags(&mut self, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_setFlags_int_flags(self.as_raw_FarnebackOpticalFlow(), flags) }.into_result()
}
}
impl<'a> FarnebackOpticalFlow + 'a {
// identifier: cv_FarnebackOpticalFlow_create_int_numLevels_double_pyrScale_bool_fastPyramids_int_winSize_int_numIters_int_polyN_double_polySigma_int_flags
///
/// ## C++ default parameters:
/// * num_levels: 5
/// * pyr_scale: 0.5
/// * fast_pyramids: false
/// * win_size: 13
/// * num_iters: 10
/// * poly_n: 5
/// * poly_sigma: 1.1
/// * flags: 0
pub fn create(num_levels: i32, pyr_scale: f64, fast_pyramids: bool, win_size: i32, num_iters: i32, poly_n: i32, poly_sigma: f64, flags: i32) -> Result<types::PtrOfFarnebackOpticalFlow> {
unsafe { sys::cv_core_cv_FarnebackOpticalFlow_create_int_numLevels_double_pyrScale_bool_fastPyramids_int_winSize_int_numIters_int_polyN_double_polySigma_int_flags(num_levels, pyr_scale, fast_pyramids, win_size, num_iters, poly_n, poly_sigma, flags) }.into_result().map(|x| types::PtrOfFarnebackOpticalFlow { ptr: x })
}
}
// Generating impl for trait cv::FastFeatureDetector (trait)
/// Wrapping class for feature detection using the FAST method. :
pub trait FastFeatureDetector : core::Feature2D {
#[doc(hidden)] fn as_raw_FastFeatureDetector(&self) -> *mut c_void;
// identifier: cv_FastFeatureDetector_setThreshold_int_threshold
fn set_threshold(&mut self, threshold: i32) -> Result<()> {
unsafe { sys::cv_core_cv_FastFeatureDetector_setThreshold_int_threshold(self.as_raw_FastFeatureDetector(), threshold) }.into_result()
}
// identifier: cv_FastFeatureDetector_getThreshold_const
fn get_threshold(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_FastFeatureDetector_getThreshold_const(self.as_raw_FastFeatureDetector()) }.into_result()
}
// identifier: cv_FastFeatureDetector_setNonmaxSuppression_bool_f
fn set_nonmax_suppression(&mut self, f: bool) -> Result<()> {
unsafe { sys::cv_core_cv_FastFeatureDetector_setNonmaxSuppression_bool_f(self.as_raw_FastFeatureDetector(), f) }.into_result()
}
// identifier: cv_FastFeatureDetector_getNonmaxSuppression_const
fn get_nonmax_suppression(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_FastFeatureDetector_getNonmaxSuppression_const(self.as_raw_FastFeatureDetector()) }.into_result()
}
// identifier: cv_FastFeatureDetector_setType_int_type
fn set_type(&mut self, _type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_FastFeatureDetector_setType_int_type(self.as_raw_FastFeatureDetector(), _type) }.into_result()
}
// identifier: cv_FastFeatureDetector_getType_const
fn get_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_FastFeatureDetector_getType_const(self.as_raw_FastFeatureDetector()) }.into_result()
}
// identifier: cv_FastFeatureDetector_getDefaultName_const
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_core_cv_FastFeatureDetector_getDefaultName_const(self.as_raw_FastFeatureDetector()) }.into_result().map(crate::templ::receive_string_mut)
}
}
impl<'a> FastFeatureDetector + 'a {
// identifier: cv_FastFeatureDetector_create_int_threshold_bool_nonmaxSuppression_int_type
///
/// ## C++ default parameters:
/// * threshold: 10
/// * nonmax_suppression: true
/// * _type: FastFeatureDetector::TYPE_9_16
pub fn create(threshold: i32, nonmax_suppression: bool, _type: i32) -> Result<types::PtrOfFastFeatureDetector> {
unsafe { sys::cv_core_cv_FastFeatureDetector_create_int_threshold_bool_nonmaxSuppression_int_type(threshold, nonmax_suppression, _type) }.into_result().map(|x| types::PtrOfFastFeatureDetector { ptr: x })
}
}
// Generating impl for trait cv::Feature2D (trait)
/// Abstract base class for 2D image feature detectors and descriptor extractors
pub trait Feature2D : core::Algorithm {
#[doc(hidden)] fn as_raw_Feature2D(&self) -> *mut c_void;
// identifier: cv_Feature2D_detect_Mat_image_VectorOfKeyPoint_keypoints_Mat_mask
/// Detects keypoints in an image (first variant) or image set (second variant).
///
/// ## Parameters
/// * image: Image.
/// * keypoints: The detected keypoints. In the second variant of the method keypoints[i] is a set
/// of keypoints detected in images[i] .
/// * mask: Mask specifying where to look for keypoints (optional). It must be a 8-bit integer
/// matrix with non-zero values in the region of interest.
///
/// ## C++ default parameters:
/// * mask: noArray()
fn detect(&mut self, image: &core::Mat, keypoints: &types::VectorOfKeyPoint, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_Feature2D_detect_Mat_image_VectorOfKeyPoint_keypoints_Mat_mask(self.as_raw_Feature2D(), image.as_raw_Mat(), keypoints.as_raw_VectorOfKeyPoint(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_Feature2D_detect_VectorOfMat_images_VectorOfVectorOfKeyPoint_keypoints_VectorOfMat_masks
/// @overload
/// ## Parameters
/// * images: Image set.
/// * keypoints: The detected keypoints. In the second variant of the method keypoints[i] is a set
/// of keypoints detected in images[i] .
/// * masks: Masks for each input image specifying where to look for keypoints (optional).
/// masks[i] is a mask for images[i].
///
/// ## C++ default parameters:
/// * masks: noArray()
fn detect_n(&mut self, images: &types::VectorOfMat, keypoints: &types::VectorOfVectorOfKeyPoint, masks: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_Feature2D_detect_VectorOfMat_images_VectorOfVectorOfKeyPoint_keypoints_VectorOfMat_masks(self.as_raw_Feature2D(), images.as_raw_VectorOfMat(), keypoints.as_raw_VectorOfVectorOfKeyPoint(), masks.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_Feature2D_compute_Mat_image_VectorOfKeyPoint_keypoints_Mat_descriptors
/// Computes the descriptors for a set of keypoints detected in an image (first variant) or image set
/// (second variant).
///
/// ## Parameters
/// * image: Image.
/// * keypoints: Input collection of keypoints. Keypoints for which a descriptor cannot be
/// computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint
/// with several dominant orientations (for each orientation).
/// * descriptors: Computed descriptors. In the second variant of the method descriptors[i] are
/// descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the
/// descriptor for keypoint j-th keypoint.
fn compute(&mut self, image: &core::Mat, keypoints: &types::VectorOfKeyPoint, descriptors: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_Feature2D_compute_Mat_image_VectorOfKeyPoint_keypoints_Mat_descriptors(self.as_raw_Feature2D(), image.as_raw_Mat(), keypoints.as_raw_VectorOfKeyPoint(), descriptors.as_raw_Mat()) }.into_result()
}
// identifier: cv_Feature2D_compute_VectorOfMat_images_VectorOfVectorOfKeyPoint_keypoints_VectorOfMat_descriptors
/// @overload
///
/// ## Parameters
/// * images: Image set.
/// * keypoints: Input collection of keypoints. Keypoints for which a descriptor cannot be
/// computed are removed. Sometimes new keypoints can be added, for example: SIFT duplicates keypoint
/// with several dominant orientations (for each orientation).
/// * descriptors: Computed descriptors. In the second variant of the method descriptors[i] are
/// descriptors computed for a keypoints[i]. Row j is the keypoints (or keypoints[i]) is the
/// descriptor for keypoint j-th keypoint.
fn compute_1(&mut self, images: &types::VectorOfMat, keypoints: &types::VectorOfVectorOfKeyPoint, descriptors: &mut types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_Feature2D_compute_VectorOfMat_images_VectorOfVectorOfKeyPoint_keypoints_VectorOfMat_descriptors(self.as_raw_Feature2D(), images.as_raw_VectorOfMat(), keypoints.as_raw_VectorOfVectorOfKeyPoint(), descriptors.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_Feature2D_detectAndCompute_Mat_image_Mat_mask_VectorOfKeyPoint_keypoints_Mat_descriptors_bool_useProvidedKeypoints
/// Detects keypoints and computes the descriptors
///
/// ## C++ default parameters:
/// * use_provided_keypoints: false
fn detect_and_compute(&mut self, image: &core::Mat, mask: &core::Mat, keypoints: &types::VectorOfKeyPoint, descriptors: &mut core::Mat, use_provided_keypoints: bool) -> Result<()> {
unsafe { sys::cv_core_cv_Feature2D_detectAndCompute_Mat_image_Mat_mask_VectorOfKeyPoint_keypoints_Mat_descriptors_bool_useProvidedKeypoints(self.as_raw_Feature2D(), image.as_raw_Mat(), mask.as_raw_Mat(), keypoints.as_raw_VectorOfKeyPoint(), descriptors.as_raw_Mat(), use_provided_keypoints) }.into_result()
}
// identifier: cv_Feature2D_descriptorSize_const
fn descriptor_size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_Feature2D_descriptorSize_const(self.as_raw_Feature2D()) }.into_result()
}
// identifier: cv_Feature2D_descriptorType_const
fn descriptor_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_Feature2D_descriptorType_const(self.as_raw_Feature2D()) }.into_result()
}
// identifier: cv_Feature2D_defaultNorm_const
fn default_norm(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_Feature2D_defaultNorm_const(self.as_raw_Feature2D()) }.into_result()
}
// identifier: cv_Feature2D_write_const_String_fileName
fn write(&self, file_name: &str) -> Result<()> {
string_arg!(file_name);
unsafe { sys::cv_core_cv_Feature2D_write_const_String_fileName(self.as_raw_Feature2D(), file_name.as_ptr()) }.into_result()
}
// identifier: cv_Feature2D_read_String_fileName
fn read(&mut self, file_name: &str) -> Result<()> {
string_arg!(file_name);
unsafe { sys::cv_core_cv_Feature2D_read_String_fileName(self.as_raw_Feature2D(), file_name.as_ptr()) }.into_result()
}
// identifier: cv_Feature2D_empty_const
fn empty(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_Feature2D_empty_const(self.as_raw_Feature2D()) }.into_result()
}
// identifier: cv_Feature2D_getDefaultName_const
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_core_cv_Feature2D_getDefaultName_const(self.as_raw_Feature2D()) }.into_result().map(crate::templ::receive_string_mut)
}
}
impl<'a> Feature2D + 'a {
}
// boxed class cv::FisheyeWarper
#[allow(dead_code)]
pub struct FisheyeWarper {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::FisheyeWarper {
fn drop(&mut self) {
unsafe { sys::cv_delete_FisheyeWarper(self.ptr) };
}
}
impl core::FisheyeWarper {
#[doc(hidden)] pub fn as_raw_FisheyeWarper(&self) -> *mut c_void { self.ptr }
}
impl core::WarperCreator for FisheyeWarper {
#[doc(hidden)] fn as_raw_WarperCreator(&self) -> *mut c_void { self.ptr }
}
impl FisheyeWarper {
}
// boxed class cv::FlannBasedMatcher
/// Flann-based descriptor matcher.
///
/// This matcher trains cv::flann::Index on a train descriptor collection and calls its nearest search
/// methods to find the best matches. So, this matcher may be faster when matching a large train
/// collection than the brute force matcher. FlannBasedMatcher does not support masking permissible
/// matches of descriptor sets because flann::Index does not support this. :
#[allow(dead_code)]
pub struct FlannBasedMatcher {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::FlannBasedMatcher {
fn drop(&mut self) {
unsafe { sys::cv_delete_FlannBasedMatcher(self.ptr) };
}
}
impl core::FlannBasedMatcher {
#[doc(hidden)] pub fn as_raw_FlannBasedMatcher(&self) -> *mut c_void { self.ptr }
}
impl core::DescriptorMatcher for FlannBasedMatcher {
#[doc(hidden)] fn as_raw_DescriptorMatcher(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for FlannBasedMatcher {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl FlannBasedMatcher {
// identifier: cv_FlannBasedMatcher_add_VectorOfMat_descriptors
pub fn add(&mut self, descriptors: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_FlannBasedMatcher_add_VectorOfMat_descriptors(self.as_raw_FlannBasedMatcher(), descriptors.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_FlannBasedMatcher_clear
pub fn clear(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_FlannBasedMatcher_clear(self.as_raw_FlannBasedMatcher()) }.into_result()
}
// identifier: cv_FlannBasedMatcher_train
pub fn train(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_FlannBasedMatcher_train(self.as_raw_FlannBasedMatcher()) }.into_result()
}
// identifier: cv_FlannBasedMatcher_isMaskSupported_const
pub fn is_mask_supported(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_FlannBasedMatcher_isMaskSupported_const(self.as_raw_FlannBasedMatcher()) }.into_result()
}
// identifier: cv_FlannBasedMatcher_create
pub fn create() -> Result<types::PtrOfFlannBasedMatcher> {
unsafe { sys::cv_core_cv_FlannBasedMatcher_create() }.into_result().map(|x| types::PtrOfFlannBasedMatcher { ptr: x })
}
// identifier: cv_FlannBasedMatcher_clone_const_bool_emptyTrainData
///
/// ## C++ default parameters:
/// * empty_train_data: false
pub fn clone(&self, empty_train_data: bool) -> Result<types::PtrOfDescriptorMatcher> {
unsafe { sys::cv_core_cv_FlannBasedMatcher_clone_const_bool_emptyTrainData(self.as_raw_FlannBasedMatcher(), empty_train_data) }.into_result().map(|x| types::PtrOfDescriptorMatcher { ptr: x })
}
}
// Generating impl for trait cv::Formatted (trait)
/// @todo document
pub trait Formatted {
#[doc(hidden)] fn as_raw_Formatted(&self) -> *mut c_void;
// identifier: cv_Formatted_next
fn next(&mut self) -> Result<String> {
unsafe { sys::cv_core_cv_Formatted_next(self.as_raw_Formatted()) }.into_result().map(crate::templ::receive_string)
}
// identifier: cv_Formatted_reset
fn reset(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_Formatted_reset(self.as_raw_Formatted()) }.into_result()
}
}
impl<'a> Formatted + 'a {
}
// Generating impl for trait cv::Formatter (trait)
/// @todo document
pub trait Formatter {
#[doc(hidden)] fn as_raw_Formatter(&self) -> *mut c_void;
// identifier: cv_Formatter_format_const_Mat_mtx
fn format(&self, mtx: &core::Mat) -> Result<types::PtrOfFormatted> {
unsafe { sys::cv_core_cv_Formatter_format_const_Mat_mtx(self.as_raw_Formatter(), mtx.as_raw_Mat()) }.into_result().map(|x| types::PtrOfFormatted { ptr: x })
}
// identifier: cv_Formatter_set32fPrecision_int_p
///
/// ## C++ default parameters:
/// * p: 8
fn set32f_precision(&mut self, p: i32) -> Result<()> {
unsafe { sys::cv_core_cv_Formatter_set32fPrecision_int_p(self.as_raw_Formatter(), p) }.into_result()
}
// identifier: cv_Formatter_set64fPrecision_int_p
///
/// ## C++ default parameters:
/// * p: 16
fn set64f_precision(&mut self, p: i32) -> Result<()> {
unsafe { sys::cv_core_cv_Formatter_set64fPrecision_int_p(self.as_raw_Formatter(), p) }.into_result()
}
// identifier: cv_Formatter_setMultiline_bool_ml
///
/// ## C++ default parameters:
/// * ml: true
fn set_multiline(&mut self, ml: bool) -> Result<()> {
unsafe { sys::cv_core_cv_Formatter_setMultiline_bool_ml(self.as_raw_Formatter(), ml) }.into_result()
}
}
impl<'a> Formatter + 'a {
// identifier: cv_Formatter_get_int_fmt
///
/// ## C++ default parameters:
/// * fmt: FMT_DEFAULT
pub fn get(fmt: i32) -> Result<types::PtrOfFormatter> {
unsafe { sys::cv_core_cv_Formatter_get_int_fmt(fmt) }.into_result().map(|x| types::PtrOfFormatter { ptr: x })
}
}
// Generating impl for trait cv::GFTTDetector (trait)
/// Wrapping class for feature detection using the goodFeaturesToTrack function. :
pub trait GFTTDetector : core::Feature2D {
#[doc(hidden)] fn as_raw_GFTTDetector(&self) -> *mut c_void;
// identifier: cv_GFTTDetector_setMaxFeatures_int_maxFeatures
fn set_max_features(&mut self, max_features: i32) -> Result<()> {
unsafe { sys::cv_core_cv_GFTTDetector_setMaxFeatures_int_maxFeatures(self.as_raw_GFTTDetector(), max_features) }.into_result()
}
// identifier: cv_GFTTDetector_getMaxFeatures_const
fn get_max_features(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_GFTTDetector_getMaxFeatures_const(self.as_raw_GFTTDetector()) }.into_result()
}
// identifier: cv_GFTTDetector_setQualityLevel_double_qlevel
fn set_quality_level(&mut self, qlevel: f64) -> Result<()> {
unsafe { sys::cv_core_cv_GFTTDetector_setQualityLevel_double_qlevel(self.as_raw_GFTTDetector(), qlevel) }.into_result()
}
// identifier: cv_GFTTDetector_getQualityLevel_const
fn get_quality_level(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_GFTTDetector_getQualityLevel_const(self.as_raw_GFTTDetector()) }.into_result()
}
// identifier: cv_GFTTDetector_setMinDistance_double_minDistance
fn set_min_distance(&mut self, min_distance: f64) -> Result<()> {
unsafe { sys::cv_core_cv_GFTTDetector_setMinDistance_double_minDistance(self.as_raw_GFTTDetector(), min_distance) }.into_result()
}
// identifier: cv_GFTTDetector_getMinDistance_const
fn get_min_distance(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_GFTTDetector_getMinDistance_const(self.as_raw_GFTTDetector()) }.into_result()
}
// identifier: cv_GFTTDetector_setBlockSize_int_blockSize
fn set_block_size(&mut self, block_size: i32) -> Result<()> {
unsafe { sys::cv_core_cv_GFTTDetector_setBlockSize_int_blockSize(self.as_raw_GFTTDetector(), block_size) }.into_result()
}
// identifier: cv_GFTTDetector_getBlockSize_const
fn get_block_size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_GFTTDetector_getBlockSize_const(self.as_raw_GFTTDetector()) }.into_result()
}
// identifier: cv_GFTTDetector_setHarrisDetector_bool_val
fn set_harris_detector(&mut self, val: bool) -> Result<()> {
unsafe { sys::cv_core_cv_GFTTDetector_setHarrisDetector_bool_val(self.as_raw_GFTTDetector(), val) }.into_result()
}
// identifier: cv_GFTTDetector_getHarrisDetector_const
fn get_harris_detector(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_GFTTDetector_getHarrisDetector_const(self.as_raw_GFTTDetector()) }.into_result()
}
// identifier: cv_GFTTDetector_setK_double_k
fn set_k(&mut self, k: f64) -> Result<()> {
unsafe { sys::cv_core_cv_GFTTDetector_setK_double_k(self.as_raw_GFTTDetector(), k) }.into_result()
}
// identifier: cv_GFTTDetector_getK_const
fn get_k(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_GFTTDetector_getK_const(self.as_raw_GFTTDetector()) }.into_result()
}
// identifier: cv_GFTTDetector_getDefaultName_const
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_core_cv_GFTTDetector_getDefaultName_const(self.as_raw_GFTTDetector()) }.into_result().map(crate::templ::receive_string_mut)
}
}
impl<'a> GFTTDetector + 'a {
// identifier: cv_GFTTDetector_create_int_maxCorners_double_qualityLevel_double_minDistance_int_blockSize_bool_useHarrisDetector_double_k
///
/// ## C++ default parameters:
/// * max_corners: 1000
/// * quality_level: 0.01
/// * min_distance: 1
/// * block_size: 3
/// * use_harris_detector: false
/// * k: 0.04
pub fn create(max_corners: i32, quality_level: f64, min_distance: f64, block_size: i32, use_harris_detector: bool, k: f64) -> Result<types::PtrOfGFTTDetector> {
unsafe { sys::cv_core_cv_GFTTDetector_create_int_maxCorners_double_qualityLevel_double_minDistance_int_blockSize_bool_useHarrisDetector_double_k(max_corners, quality_level, min_distance, block_size, use_harris_detector, k) }.into_result().map(|x| types::PtrOfGFTTDetector { ptr: x })
}
// identifier: cv_GFTTDetector_create_int_maxCorners_double_qualityLevel_double_minDistance_int_blockSize_int_gradiantSize_bool_useHarrisDetector_double_k
///
/// ## C++ default parameters:
/// * use_harris_detector: false
/// * k: 0.04
pub fn create_1(max_corners: i32, quality_level: f64, min_distance: f64, block_size: i32, gradiant_size: i32, use_harris_detector: bool, k: f64) -> Result<types::PtrOfGFTTDetector> {
unsafe { sys::cv_core_cv_GFTTDetector_create_int_maxCorners_double_qualityLevel_double_minDistance_int_blockSize_int_gradiantSize_bool_useHarrisDetector_double_k(max_corners, quality_level, min_distance, block_size, gradiant_size, use_harris_detector, k) }.into_result().map(|x| types::PtrOfGFTTDetector { ptr: x })
}
}
// Generating impl for trait cv::GeneralizedHough (trait)
/// finds arbitrary template in the grayscale image using Generalized Hough Transform
pub trait GeneralizedHough : core::Algorithm {
#[doc(hidden)] fn as_raw_GeneralizedHough(&self) -> *mut c_void;
// identifier: cv_GeneralizedHough_setTemplate_Mat_templ_Point_templCenter
///
/// ## C++ default parameters:
/// * templ_center: Point(-1, -1)
fn set_template(&mut self, templ: &core::Mat, templ_center: core::Point) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHough_setTemplate_Mat_templ_Point_templCenter(self.as_raw_GeneralizedHough(), templ.as_raw_Mat(), templ_center) }.into_result()
}
// identifier: cv_GeneralizedHough_setTemplate_Mat_edges_Mat_dx_Mat_dy_Point_templCenter
///
/// ## C++ default parameters:
/// * templ_center: Point(-1, -1)
fn set_template_1(&mut self, edges: &core::Mat, dx: &core::Mat, dy: &core::Mat, templ_center: core::Point) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHough_setTemplate_Mat_edges_Mat_dx_Mat_dy_Point_templCenter(self.as_raw_GeneralizedHough(), edges.as_raw_Mat(), dx.as_raw_Mat(), dy.as_raw_Mat(), templ_center) }.into_result()
}
// identifier: cv_GeneralizedHough_detect_Mat_image_Mat_positions_Mat_votes
///
/// ## C++ default parameters:
/// * votes: noArray()
fn detect(&mut self, image: &core::Mat, positions: &mut core::Mat, votes: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHough_detect_Mat_image_Mat_positions_Mat_votes(self.as_raw_GeneralizedHough(), image.as_raw_Mat(), positions.as_raw_Mat(), votes.as_raw_Mat()) }.into_result()
}
// identifier: cv_GeneralizedHough_detect_Mat_edges_Mat_dx_Mat_dy_Mat_positions_Mat_votes
///
/// ## C++ default parameters:
/// * votes: noArray()
fn detect_1(&mut self, edges: &core::Mat, dx: &core::Mat, dy: &core::Mat, positions: &mut core::Mat, votes: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHough_detect_Mat_edges_Mat_dx_Mat_dy_Mat_positions_Mat_votes(self.as_raw_GeneralizedHough(), edges.as_raw_Mat(), dx.as_raw_Mat(), dy.as_raw_Mat(), positions.as_raw_Mat(), votes.as_raw_Mat()) }.into_result()
}
// identifier: cv_GeneralizedHough_setCannyLowThresh_int_cannyLowThresh
fn set_canny_low_thresh(&mut self, canny_low_thresh: i32) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHough_setCannyLowThresh_int_cannyLowThresh(self.as_raw_GeneralizedHough(), canny_low_thresh) }.into_result()
}
// identifier: cv_GeneralizedHough_getCannyLowThresh_const
fn get_canny_low_thresh(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_GeneralizedHough_getCannyLowThresh_const(self.as_raw_GeneralizedHough()) }.into_result()
}
// identifier: cv_GeneralizedHough_setCannyHighThresh_int_cannyHighThresh
fn set_canny_high_thresh(&mut self, canny_high_thresh: i32) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHough_setCannyHighThresh_int_cannyHighThresh(self.as_raw_GeneralizedHough(), canny_high_thresh) }.into_result()
}
// identifier: cv_GeneralizedHough_getCannyHighThresh_const
fn get_canny_high_thresh(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_GeneralizedHough_getCannyHighThresh_const(self.as_raw_GeneralizedHough()) }.into_result()
}
// identifier: cv_GeneralizedHough_setMinDist_double_minDist
fn set_min_dist(&mut self, min_dist: f64) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHough_setMinDist_double_minDist(self.as_raw_GeneralizedHough(), min_dist) }.into_result()
}
// identifier: cv_GeneralizedHough_getMinDist_const
fn get_min_dist(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_GeneralizedHough_getMinDist_const(self.as_raw_GeneralizedHough()) }.into_result()
}
// identifier: cv_GeneralizedHough_setDp_double_dp
fn set_dp(&mut self, dp: f64) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHough_setDp_double_dp(self.as_raw_GeneralizedHough(), dp) }.into_result()
}
// identifier: cv_GeneralizedHough_getDp_const
fn get_dp(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_GeneralizedHough_getDp_const(self.as_raw_GeneralizedHough()) }.into_result()
}
// identifier: cv_GeneralizedHough_setMaxBufferSize_int_maxBufferSize
fn set_max_buffer_size(&mut self, max_buffer_size: i32) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHough_setMaxBufferSize_int_maxBufferSize(self.as_raw_GeneralizedHough(), max_buffer_size) }.into_result()
}
// identifier: cv_GeneralizedHough_getMaxBufferSize_const
fn get_max_buffer_size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_GeneralizedHough_getMaxBufferSize_const(self.as_raw_GeneralizedHough()) }.into_result()
}
}
impl<'a> GeneralizedHough + 'a {
}
// Generating impl for trait cv::GeneralizedHoughBallard (trait)
/// finds arbitrary template in the grayscale image using Generalized Hough Transform
///
/// Detects position only without translation and rotation @cite Ballard1981 .
pub trait GeneralizedHoughBallard : core::GeneralizedHough {
#[doc(hidden)] fn as_raw_GeneralizedHoughBallard(&self) -> *mut c_void;
// identifier: cv_GeneralizedHoughBallard_setLevels_int_levels
fn set_levels(&mut self, levels: i32) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHoughBallard_setLevels_int_levels(self.as_raw_GeneralizedHoughBallard(), levels) }.into_result()
}
// identifier: cv_GeneralizedHoughBallard_getLevels_const
fn get_levels(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_GeneralizedHoughBallard_getLevels_const(self.as_raw_GeneralizedHoughBallard()) }.into_result()
}
// identifier: cv_GeneralizedHoughBallard_setVotesThreshold_int_votesThreshold
fn set_votes_threshold(&mut self, votes_threshold: i32) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHoughBallard_setVotesThreshold_int_votesThreshold(self.as_raw_GeneralizedHoughBallard(), votes_threshold) }.into_result()
}
// identifier: cv_GeneralizedHoughBallard_getVotesThreshold_const
fn get_votes_threshold(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_GeneralizedHoughBallard_getVotesThreshold_const(self.as_raw_GeneralizedHoughBallard()) }.into_result()
}
}
impl<'a> GeneralizedHoughBallard + 'a {
}
// Generating impl for trait cv::GeneralizedHoughGuil (trait)
/// finds arbitrary template in the grayscale image using Generalized Hough Transform
///
/// Detects position, translation and rotation @cite Guil1999 .
pub trait GeneralizedHoughGuil : core::GeneralizedHough {
#[doc(hidden)] fn as_raw_GeneralizedHoughGuil(&self) -> *mut c_void;
// identifier: cv_GeneralizedHoughGuil_setXi_double_xi
fn set_xi(&mut self, xi: f64) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_setXi_double_xi(self.as_raw_GeneralizedHoughGuil(), xi) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_getXi_const
fn get_xi(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_getXi_const(self.as_raw_GeneralizedHoughGuil()) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_setLevels_int_levels
fn set_levels(&mut self, levels: i32) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_setLevels_int_levels(self.as_raw_GeneralizedHoughGuil(), levels) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_getLevels_const
fn get_levels(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_getLevels_const(self.as_raw_GeneralizedHoughGuil()) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_setAngleEpsilon_double_angleEpsilon
fn set_angle_epsilon(&mut self, angle_epsilon: f64) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_setAngleEpsilon_double_angleEpsilon(self.as_raw_GeneralizedHoughGuil(), angle_epsilon) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_getAngleEpsilon_const
fn get_angle_epsilon(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_getAngleEpsilon_const(self.as_raw_GeneralizedHoughGuil()) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_setMinAngle_double_minAngle
fn set_min_angle(&mut self, min_angle: f64) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_setMinAngle_double_minAngle(self.as_raw_GeneralizedHoughGuil(), min_angle) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_getMinAngle_const
fn get_min_angle(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_getMinAngle_const(self.as_raw_GeneralizedHoughGuil()) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_setMaxAngle_double_maxAngle
fn set_max_angle(&mut self, max_angle: f64) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_setMaxAngle_double_maxAngle(self.as_raw_GeneralizedHoughGuil(), max_angle) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_getMaxAngle_const
fn get_max_angle(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_getMaxAngle_const(self.as_raw_GeneralizedHoughGuil()) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_setAngleStep_double_angleStep
fn set_angle_step(&mut self, angle_step: f64) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_setAngleStep_double_angleStep(self.as_raw_GeneralizedHoughGuil(), angle_step) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_getAngleStep_const
fn get_angle_step(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_getAngleStep_const(self.as_raw_GeneralizedHoughGuil()) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_setAngleThresh_int_angleThresh
fn set_angle_thresh(&mut self, angle_thresh: i32) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_setAngleThresh_int_angleThresh(self.as_raw_GeneralizedHoughGuil(), angle_thresh) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_getAngleThresh_const
fn get_angle_thresh(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_getAngleThresh_const(self.as_raw_GeneralizedHoughGuil()) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_setMinScale_double_minScale
fn set_min_scale(&mut self, min_scale: f64) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_setMinScale_double_minScale(self.as_raw_GeneralizedHoughGuil(), min_scale) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_getMinScale_const
fn get_min_scale(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_getMinScale_const(self.as_raw_GeneralizedHoughGuil()) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_setMaxScale_double_maxScale
fn set_max_scale(&mut self, max_scale: f64) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_setMaxScale_double_maxScale(self.as_raw_GeneralizedHoughGuil(), max_scale) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_getMaxScale_const
fn get_max_scale(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_getMaxScale_const(self.as_raw_GeneralizedHoughGuil()) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_setScaleStep_double_scaleStep
fn set_scale_step(&mut self, scale_step: f64) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_setScaleStep_double_scaleStep(self.as_raw_GeneralizedHoughGuil(), scale_step) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_getScaleStep_const
fn get_scale_step(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_getScaleStep_const(self.as_raw_GeneralizedHoughGuil()) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_setScaleThresh_int_scaleThresh
fn set_scale_thresh(&mut self, scale_thresh: i32) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_setScaleThresh_int_scaleThresh(self.as_raw_GeneralizedHoughGuil(), scale_thresh) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_getScaleThresh_const
fn get_scale_thresh(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_getScaleThresh_const(self.as_raw_GeneralizedHoughGuil()) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_setPosThresh_int_posThresh
fn set_pos_thresh(&mut self, pos_thresh: i32) -> Result<()> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_setPosThresh_int_posThresh(self.as_raw_GeneralizedHoughGuil(), pos_thresh) }.into_result()
}
// identifier: cv_GeneralizedHoughGuil_getPosThresh_const
fn get_pos_thresh(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_GeneralizedHoughGuil_getPosThresh_const(self.as_raw_GeneralizedHoughGuil()) }.into_result()
}
}
impl<'a> GeneralizedHoughGuil + 'a {
}
// boxed class cv::HOGDescriptor
/// Implementation of HOG (Histogram of Oriented Gradients) descriptor and object detector.
///
/// the HOG descriptor algorithm introduced by Navneet Dalal and Bill Triggs @cite Dalal2005 .
///
/// useful links:
///
/// https://hal.inria.fr/inria-00548512/document/
///
/// https://en.wikipedia.org/wiki/Histogram_of_oriented_gradients
///
/// https://software.intel.com/en-us/ipp-dev-reference-histogram-of-oriented-gradients-hog-descriptor
///
/// http://www.learnopencv.com/histogram-of-oriented-gradients
///
/// http://www.learnopencv.com/handwritten-digits-classification-an-opencv-c-python-tutorial
#[allow(dead_code)]
pub struct HOGDescriptor {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::HOGDescriptor {
fn drop(&mut self) {
unsafe { sys::cv_delete_HOGDescriptor(self.ptr) };
}
}
impl core::HOGDescriptor {
#[doc(hidden)] pub fn as_raw_HOGDescriptor(&self) -> *mut c_void { self.ptr }
}
impl HOGDescriptor {
// identifier: cv_HOGDescriptor_HOGDescriptor_String_filename
/// @overload
/// ## Parameters
/// * filename: the file name containing HOGDescriptor properties and coefficients of the trained classifier
pub fn new(filename: &str) -> Result<core::HOGDescriptor> {
string_arg!(filename);
unsafe { sys::cv_core_cv_HOGDescriptor_HOGDescriptor_String_filename(filename.as_ptr()) }.into_result().map(|x| core::HOGDescriptor { ptr: x })
}
// identifier: cv_HOGDescriptor_HOGDescriptor_HOGDescriptor_d
/// @overload
/// ## Parameters
/// * d: the HOGDescriptor which cloned to create a new one.
pub fn copy(d: &core::HOGDescriptor) -> Result<core::HOGDescriptor> {
unsafe { sys::cv_core_cv_HOGDescriptor_HOGDescriptor_HOGDescriptor_d(d.as_raw_HOGDescriptor()) }.into_result().map(|x| core::HOGDescriptor { ptr: x })
}
// identifier: cv_HOGDescriptor_getDescriptorSize_const
/// Returns the number of coefficients required for the classification.
pub fn get_descriptor_size(&self) -> Result<size_t> {
unsafe { sys::cv_core_cv_HOGDescriptor_getDescriptorSize_const(self.as_raw_HOGDescriptor()) }.into_result()
}
// identifier: cv_HOGDescriptor_checkDetectorSize_const
/// Checks if detector size equal to descriptor size.
pub fn check_detector_size(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_HOGDescriptor_checkDetectorSize_const(self.as_raw_HOGDescriptor()) }.into_result()
}
// identifier: cv_HOGDescriptor_getWinSigma_const
/// Returns winSigma value
pub fn get_win_sigma(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_HOGDescriptor_getWinSigma_const(self.as_raw_HOGDescriptor()) }.into_result()
}
// identifier: cv_HOGDescriptor_setSVMDetector_Mat__svmdetector
/// Sets coefficients for the linear SVM classifier.
/// ## Parameters
/// * _svmdetector: coefficients for the linear SVM classifier.
pub fn set_svm_detector(&mut self, _svmdetector: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_HOGDescriptor_setSVMDetector_Mat__svmdetector(self.as_raw_HOGDescriptor(), _svmdetector.as_raw_Mat()) }.into_result()
}
// identifier: cv_HOGDescriptor_load_String_filename_String_objname
/// loads coefficients for the linear SVM classifier from a file
/// ## Parameters
/// * filename: Name of the file to read.
/// * objname: The optional name of the node to read (if empty, the first top-level node will be used).
///
/// ## C++ default parameters:
/// * objname: String()
pub fn load(&mut self, filename: &str, objname: &str) -> Result<bool> {
string_arg!(filename);
string_arg!(objname);
unsafe { sys::cv_core_cv_HOGDescriptor_load_String_filename_String_objname(self.as_raw_HOGDescriptor(), filename.as_ptr(), objname.as_ptr()) }.into_result()
}
// identifier: cv_HOGDescriptor_save_const_String_filename_String_objname
/// saves coefficients for the linear SVM classifier to a file
/// ## Parameters
/// * filename: File name
/// * objname: Object name
///
/// ## C++ default parameters:
/// * objname: String()
pub fn save(&self, filename: &str, objname: &str) -> Result<()> {
string_arg!(filename);
string_arg!(objname);
unsafe { sys::cv_core_cv_HOGDescriptor_save_const_String_filename_String_objname(self.as_raw_HOGDescriptor(), filename.as_ptr(), objname.as_ptr()) }.into_result()
}
// identifier: cv_HOGDescriptor_copyTo_const_HOGDescriptor_c
/// clones the HOGDescriptor
/// ## Parameters
/// * c: cloned HOGDescriptor
pub fn copy_to(&self, c: &core::HOGDescriptor) -> Result<()> {
unsafe { sys::cv_core_cv_HOGDescriptor_copyTo_const_HOGDescriptor_c(self.as_raw_HOGDescriptor(), c.as_raw_HOGDescriptor()) }.into_result()
}
// identifier: cv_HOGDescriptor_compute_const_Mat_img_VectorOffloat_descriptors_Size_winStride_Size_padding_VectorOfPoint_locations
/// Computes HOG descriptors of given image.
/// ## Parameters
/// * img: Matrix of the type CV_8U containing an image where HOG features will be calculated.
/// * descriptors: Matrix of the type CV_32F
/// * winStride: Window stride. It must be a multiple of block stride.
/// * padding: Padding
/// * locations: Vector of Point
///
/// ## C++ default parameters:
/// * win_stride: Size()
/// * padding: Size()
/// * locations: std::vector<Point>()
pub fn compute(&self, img: &core::Mat, descriptors: &types::VectorOffloat, win_stride: core::Size, padding: core::Size, locations: &types::VectorOfPoint) -> Result<()> {
unsafe { sys::cv_core_cv_HOGDescriptor_compute_const_Mat_img_VectorOffloat_descriptors_Size_winStride_Size_padding_VectorOfPoint_locations(self.as_raw_HOGDescriptor(), img.as_raw_Mat(), descriptors.as_raw_VectorOffloat(), win_stride, padding, locations.as_raw_VectorOfPoint()) }.into_result()
}
// identifier: cv_HOGDescriptor_detect_const_Mat_img_VectorOfPoint_foundLocations_VectorOfdouble_weights_double_hitThreshold_Size_winStride_Size_padding_VectorOfPoint_searchLocations
/// Performs object detection without a multi-scale window.
/// ## Parameters
/// * img: Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
/// * foundLocations: Vector of point where each point contains left-top corner point of detected object boundaries.
/// * weights: Vector that will contain confidence values for each detected object.
/// * hitThreshold: Threshold for the distance between features and SVM classifying plane.
/// Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
/// But if the free coefficient is omitted (which is allowed), you can specify it manually here.
/// * winStride: Window stride. It must be a multiple of block stride.
/// * padding: Padding
/// * searchLocations: Vector of Point includes set of requested locations to be evaluated.
///
/// ## C++ default parameters:
/// * hit_threshold: 0
/// * win_stride: Size()
/// * padding: Size()
/// * search_locations: std::vector<Point>()
pub fn detect_weights(&self, img: &core::Mat, found_locations: &types::VectorOfPoint, weights: &types::VectorOfdouble, hit_threshold: f64, win_stride: core::Size, padding: core::Size, search_locations: &types::VectorOfPoint) -> Result<()> {
unsafe { sys::cv_core_cv_HOGDescriptor_detect_const_Mat_img_VectorOfPoint_foundLocations_VectorOfdouble_weights_double_hitThreshold_Size_winStride_Size_padding_VectorOfPoint_searchLocations(self.as_raw_HOGDescriptor(), img.as_raw_Mat(), found_locations.as_raw_VectorOfPoint(), weights.as_raw_VectorOfdouble(), hit_threshold, win_stride, padding, search_locations.as_raw_VectorOfPoint()) }.into_result()
}
// identifier: cv_HOGDescriptor_detect_const_Mat_img_VectorOfPoint_foundLocations_double_hitThreshold_Size_winStride_Size_padding_VectorOfPoint_searchLocations
/// Performs object detection without a multi-scale window.
/// ## Parameters
/// * img: Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
/// * foundLocations: Vector of point where each point contains left-top corner point of detected object boundaries.
/// * hitThreshold: Threshold for the distance between features and SVM classifying plane.
/// Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
/// But if the free coefficient is omitted (which is allowed), you can specify it manually here.
/// * winStride: Window stride. It must be a multiple of block stride.
/// * padding: Padding
/// * searchLocations: Vector of Point includes locations to search.
///
/// ## C++ default parameters:
/// * hit_threshold: 0
/// * win_stride: Size()
/// * padding: Size()
/// * search_locations: std::vector<Point>()
pub fn detect(&self, img: &core::Mat, found_locations: &types::VectorOfPoint, hit_threshold: f64, win_stride: core::Size, padding: core::Size, search_locations: &types::VectorOfPoint) -> Result<()> {
unsafe { sys::cv_core_cv_HOGDescriptor_detect_const_Mat_img_VectorOfPoint_foundLocations_double_hitThreshold_Size_winStride_Size_padding_VectorOfPoint_searchLocations(self.as_raw_HOGDescriptor(), img.as_raw_Mat(), found_locations.as_raw_VectorOfPoint(), hit_threshold, win_stride, padding, search_locations.as_raw_VectorOfPoint()) }.into_result()
}
// identifier: cv_HOGDescriptor_detectMultiScale_const_Mat_img_VectorOfRect_foundLocations_VectorOfdouble_foundWeights_double_hitThreshold_Size_winStride_Size_padding_double_scale_double_finalThreshold_bool_useMeanshiftGrouping
/// Detects objects of different sizes in the input image. The detected objects are returned as a list
/// of rectangles.
/// ## Parameters
/// * img: Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
/// * foundLocations: Vector of rectangles where each rectangle contains the detected object.
/// * foundWeights: Vector that will contain confidence values for each detected object.
/// * hitThreshold: Threshold for the distance between features and SVM classifying plane.
/// Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
/// But if the free coefficient is omitted (which is allowed), you can specify it manually here.
/// * winStride: Window stride. It must be a multiple of block stride.
/// * padding: Padding
/// * scale: Coefficient of the detection window increase.
/// * finalThreshold: Final threshold
/// * useMeanshiftGrouping: indicates grouping algorithm
///
/// ## C++ default parameters:
/// * hit_threshold: 0
/// * win_stride: Size()
/// * padding: Size()
/// * scale: 1.05
/// * final_threshold: 2.0
/// * use_meanshift_grouping: false
pub fn detect_multi_scale(&self, img: &core::Mat, found_locations: &types::VectorOfRect, found_weights: &types::VectorOfdouble, hit_threshold: f64, win_stride: core::Size, padding: core::Size, scale: f64, final_threshold: f64, use_meanshift_grouping: bool) -> Result<()> {
unsafe { sys::cv_core_cv_HOGDescriptor_detectMultiScale_const_Mat_img_VectorOfRect_foundLocations_VectorOfdouble_foundWeights_double_hitThreshold_Size_winStride_Size_padding_double_scale_double_finalThreshold_bool_useMeanshiftGrouping(self.as_raw_HOGDescriptor(), img.as_raw_Mat(), found_locations.as_raw_VectorOfRect(), found_weights.as_raw_VectorOfdouble(), hit_threshold, win_stride, padding, scale, final_threshold, use_meanshift_grouping) }.into_result()
}
// identifier: cv_HOGDescriptor_detectMultiScale_const_Mat_img_VectorOfRect_foundLocations_double_hitThreshold_Size_winStride_Size_padding_double_scale_double_finalThreshold_bool_useMeanshiftGrouping
/// Detects objects of different sizes in the input image. The detected objects are returned as a list
/// of rectangles.
/// ## Parameters
/// * img: Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
/// * foundLocations: Vector of rectangles where each rectangle contains the detected object.
/// * hitThreshold: Threshold for the distance between features and SVM classifying plane.
/// Usually it is 0 and should be specified in the detector coefficients (as the last free coefficient).
/// But if the free coefficient is omitted (which is allowed), you can specify it manually here.
/// * winStride: Window stride. It must be a multiple of block stride.
/// * padding: Padding
/// * scale: Coefficient of the detection window increase.
/// * finalThreshold: Final threshold
/// * useMeanshiftGrouping: indicates grouping algorithm
///
/// ## C++ default parameters:
/// * hit_threshold: 0
/// * win_stride: Size()
/// * padding: Size()
/// * scale: 1.05
/// * final_threshold: 2.0
/// * use_meanshift_grouping: false
pub fn detect_multi_scale_weights(&self, img: &core::Mat, found_locations: &types::VectorOfRect, hit_threshold: f64, win_stride: core::Size, padding: core::Size, scale: f64, final_threshold: f64, use_meanshift_grouping: bool) -> Result<()> {
unsafe { sys::cv_core_cv_HOGDescriptor_detectMultiScale_const_Mat_img_VectorOfRect_foundLocations_double_hitThreshold_Size_winStride_Size_padding_double_scale_double_finalThreshold_bool_useMeanshiftGrouping(self.as_raw_HOGDescriptor(), img.as_raw_Mat(), found_locations.as_raw_VectorOfRect(), hit_threshold, win_stride, padding, scale, final_threshold, use_meanshift_grouping) }.into_result()
}
// identifier: cv_HOGDescriptor_computeGradient_const_Mat_img_Mat_grad_Mat_angleOfs_Size_paddingTL_Size_paddingBR
/// Computes gradients and quantized gradient orientations.
/// ## Parameters
/// * img: Matrix contains the image to be computed
/// * grad: Matrix of type CV_32FC2 contains computed gradients
/// * angleOfs: Matrix of type CV_8UC2 contains quantized gradient orientations
/// * paddingTL: Padding from top-left
/// * paddingBR: Padding from bottom-right
///
/// ## C++ default parameters:
/// * padding_tl: Size()
/// * padding_br: Size()
pub fn compute_gradient(&self, img: &core::Mat, grad: &core::Mat, angle_ofs: &core::Mat, padding_tl: core::Size, padding_br: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_HOGDescriptor_computeGradient_const_Mat_img_Mat_grad_Mat_angleOfs_Size_paddingTL_Size_paddingBR(self.as_raw_HOGDescriptor(), img.as_raw_Mat(), grad.as_raw_Mat(), angle_ofs.as_raw_Mat(), padding_tl, padding_br) }.into_result()
}
// identifier: cv_HOGDescriptor_getDefaultPeopleDetector
/// Returns coefficients of the classifier trained for people detection (for 64x128 windows).
pub fn get_default_people_detector() -> Result<types::VectorOffloat> {
unsafe { sys::cv_core_cv_HOGDescriptor_getDefaultPeopleDetector() }.into_result().map(|x| types::VectorOffloat { ptr: x })
}
// identifier: cv_HOGDescriptor_getDaimlerPeopleDetector
/// Returns coefficients of the classifier trained for people detection (for 48x96 windows).
pub fn get_daimler_people_detector() -> Result<types::VectorOffloat> {
unsafe { sys::cv_core_cv_HOGDescriptor_getDaimlerPeopleDetector() }.into_result().map(|x| types::VectorOffloat { ptr: x })
}
// identifier: cv_HOGDescriptor_detectROI_const_Mat_img_VectorOfPoint_locations_VectorOfPoint_foundLocations_VectorOfdouble_confidences_double_hitThreshold_Size_winStride_Size_padding
/// evaluate specified ROI and return confidence value for each location
/// ## Parameters
/// * img: Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
/// * locations: Vector of Point
/// * foundLocations: Vector of Point where each Point is detected object's top-left point.
/// * confidences: confidences
/// * hitThreshold: Threshold for the distance between features and SVM classifying plane. Usually
/// it is 0 and should be specified in the detector coefficients (as the last free coefficient). But if
/// the free coefficient is omitted (which is allowed), you can specify it manually here
/// * winStride: winStride
/// * padding: padding
///
/// ## C++ default parameters:
/// * hit_threshold: 0
/// * win_stride: Size()
/// * padding: Size()
pub fn detect_roi(&self, img: &core::Mat, locations: &types::VectorOfPoint, found_locations: &types::VectorOfPoint, confidences: &types::VectorOfdouble, hit_threshold: f64, win_stride: core::Size, padding: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_HOGDescriptor_detectROI_const_Mat_img_VectorOfPoint_locations_VectorOfPoint_foundLocations_VectorOfdouble_confidences_double_hitThreshold_Size_winStride_Size_padding(self.as_raw_HOGDescriptor(), img.as_raw_Mat(), locations.as_raw_VectorOfPoint(), found_locations.as_raw_VectorOfPoint(), confidences.as_raw_VectorOfdouble(), hit_threshold, win_stride, padding) }.into_result()
}
// identifier: cv_HOGDescriptor_detectMultiScaleROI_const_Mat_img_VectorOfRect_foundLocations_VectorOfDetectionROI_locations_double_hitThreshold_int_groupThreshold
/// evaluate specified ROI and return confidence value for each location in multiple scales
/// ## Parameters
/// * img: Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
/// * foundLocations: Vector of rectangles where each rectangle contains the detected object.
/// * locations: Vector of DetectionROI
/// * hitThreshold: Threshold for the distance between features and SVM classifying plane. Usually it is 0 and should be specified
/// in the detector coefficients (as the last free coefficient). But if the free coefficient is omitted (which is allowed), you can specify it manually here.
/// * groupThreshold: Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it.
///
/// ## C++ default parameters:
/// * hit_threshold: 0
/// * group_threshold: 0
pub fn detect_multi_scale_roi(&self, img: &core::Mat, found_locations: &types::VectorOfRect, locations: &types::VectorOfDetectionROI, hit_threshold: f64, group_threshold: i32) -> Result<()> {
unsafe { sys::cv_core_cv_HOGDescriptor_detectMultiScaleROI_const_Mat_img_VectorOfRect_foundLocations_VectorOfDetectionROI_locations_double_hitThreshold_int_groupThreshold(self.as_raw_HOGDescriptor(), img.as_raw_Mat(), found_locations.as_raw_VectorOfRect(), locations.as_raw_VectorOfDetectionROI(), hit_threshold, group_threshold) }.into_result()
}
// identifier: cv_HOGDescriptor_readALTModel_String_modelfile
/// read/parse Dalal's alt model file
/// ## Parameters
/// * modelfile: Path of Dalal's alt model file.
pub fn read_alt_model(&mut self, modelfile: &str) -> Result<()> {
string_arg!(mut modelfile);
unsafe { sys::cv_core_cv_HOGDescriptor_readALTModel_String_modelfile(self.as_raw_HOGDescriptor(), modelfile.as_ptr() as _) }.into_result()
}
// identifier: cv_HOGDescriptor_groupRectangles_const_VectorOfRect_rectList_VectorOfdouble_weights_int_groupThreshold_double_eps
/// Groups the object candidate rectangles.
/// ## Parameters
/// * rectList: Input/output vector of rectangles. Output vector includes retained and grouped rectangles. (The Python list is not modified in place.)
/// * weights: Input/output vector of weights of rectangles. Output vector includes weights of retained and grouped rectangles. (The Python list is not modified in place.)
/// * groupThreshold: Minimum possible number of rectangles minus 1. The threshold is used in a group of rectangles to retain it.
/// * eps: Relative difference between sides of the rectangles to merge them into a group.
pub fn group_rectangles(&self, rect_list: &types::VectorOfRect, weights: &types::VectorOfdouble, group_threshold: i32, eps: f64) -> Result<()> {
unsafe { sys::cv_core_cv_HOGDescriptor_groupRectangles_const_VectorOfRect_rectList_VectorOfdouble_weights_int_groupThreshold_double_eps(self.as_raw_HOGDescriptor(), rect_list.as_raw_VectorOfRect(), weights.as_raw_VectorOfdouble(), group_threshold, eps) }.into_result()
}
}
// boxed class cv::Hamming
/// replaced with CV_Assert(expr) in Debug configuration
#[allow(dead_code)]
pub struct Hamming {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::Hamming {
fn drop(&mut self) {
unsafe { sys::cv_delete_Hamming(self.ptr) };
}
}
impl core::Hamming {
#[doc(hidden)] pub fn as_raw_Hamming(&self) -> *mut c_void { self.ptr }
}
// Generating impl for trait cv::HausdorffDistanceExtractor (trait)
/// A simple Hausdorff distance measure between shapes defined by contours
///
/// according to the paper "Comparing Images using the Hausdorff distance." by D.P. Huttenlocher, G.A.
/// Klanderman, and W.J. Rucklidge. (PAMI 1993). :
pub trait HausdorffDistanceExtractor : core::ShapeDistanceExtractor {
#[doc(hidden)] fn as_raw_HausdorffDistanceExtractor(&self) -> *mut c_void;
// identifier: cv_HausdorffDistanceExtractor_setDistanceFlag_int_distanceFlag
/// Set the norm used to compute the Hausdorff value between two shapes. It can be L1 or L2 norm.
///
/// ## Parameters
/// * distanceFlag: Flag indicating which norm is used to compute the Hausdorff distance
/// (NORM_L1, NORM_L2).
fn set_distance_flag(&mut self, distance_flag: i32) -> Result<()> {
unsafe { sys::cv_core_cv_HausdorffDistanceExtractor_setDistanceFlag_int_distanceFlag(self.as_raw_HausdorffDistanceExtractor(), distance_flag) }.into_result()
}
// identifier: cv_HausdorffDistanceExtractor_getDistanceFlag_const
fn get_distance_flag(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_HausdorffDistanceExtractor_getDistanceFlag_const(self.as_raw_HausdorffDistanceExtractor()) }.into_result()
}
// identifier: cv_HausdorffDistanceExtractor_setRankProportion_float_rankProportion
/// This method sets the rank proportion (or fractional value) that establish the Kth ranked value of
/// the partial Hausdorff distance. Experimentally had been shown that 0.6 is a good value to compare
/// shapes.
///
/// ## Parameters
/// * rankProportion: fractional value (between 0 and 1).
fn set_rank_proportion(&mut self, rank_proportion: f32) -> Result<()> {
unsafe { sys::cv_core_cv_HausdorffDistanceExtractor_setRankProportion_float_rankProportion(self.as_raw_HausdorffDistanceExtractor(), rank_proportion) }.into_result()
}
// identifier: cv_HausdorffDistanceExtractor_getRankProportion_const
fn get_rank_proportion(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_HausdorffDistanceExtractor_getRankProportion_const(self.as_raw_HausdorffDistanceExtractor()) }.into_result()
}
}
impl<'a> HausdorffDistanceExtractor + 'a {
}
// Generating impl for trait cv::HistogramCostExtractor (trait)
/// Abstract base class for histogram cost algorithms.
pub trait HistogramCostExtractor : core::Algorithm {
#[doc(hidden)] fn as_raw_HistogramCostExtractor(&self) -> *mut c_void;
// identifier: cv_HistogramCostExtractor_buildCostMatrix_Mat_descriptors1_Mat_descriptors2_Mat_costMatrix
fn build_cost_matrix(&mut self, descriptors1: &core::Mat, descriptors2: &core::Mat, cost_matrix: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_HistogramCostExtractor_buildCostMatrix_Mat_descriptors1_Mat_descriptors2_Mat_costMatrix(self.as_raw_HistogramCostExtractor(), descriptors1.as_raw_Mat(), descriptors2.as_raw_Mat(), cost_matrix.as_raw_Mat()) }.into_result()
}
// identifier: cv_HistogramCostExtractor_setNDummies_int_nDummies
fn set_n_dummies(&mut self, n_dummies: i32) -> Result<()> {
unsafe { sys::cv_core_cv_HistogramCostExtractor_setNDummies_int_nDummies(self.as_raw_HistogramCostExtractor(), n_dummies) }.into_result()
}
// identifier: cv_HistogramCostExtractor_getNDummies_const
fn get_n_dummies(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_HistogramCostExtractor_getNDummies_const(self.as_raw_HistogramCostExtractor()) }.into_result()
}
// identifier: cv_HistogramCostExtractor_setDefaultCost_float_defaultCost
fn set_default_cost(&mut self, default_cost: f32) -> Result<()> {
unsafe { sys::cv_core_cv_HistogramCostExtractor_setDefaultCost_float_defaultCost(self.as_raw_HistogramCostExtractor(), default_cost) }.into_result()
}
// identifier: cv_HistogramCostExtractor_getDefaultCost_const
fn get_default_cost(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_HistogramCostExtractor_getDefaultCost_const(self.as_raw_HistogramCostExtractor()) }.into_result()
}
}
impl<'a> HistogramCostExtractor + 'a {
}
// Generating impl for trait cv::KAZE (trait)
/// Class implementing the KAZE keypoint detector and descriptor extractor, described in @cite ABD12 .
///
///
/// Note: AKAZE descriptor can only be used with KAZE or AKAZE keypoints .. [ABD12] KAZE Features. Pablo
/// F. Alcantarilla, Adrien Bartoli and Andrew J. Davison. In European Conference on Computer Vision
/// (ECCV), Fiorenze, Italy, October 2012.
pub trait KAZE : core::Feature2D {
#[doc(hidden)] fn as_raw_KAZE(&self) -> *mut c_void;
// identifier: cv_KAZE_setExtended_bool_extended
fn set_extended(&mut self, extended: bool) -> Result<()> {
unsafe { sys::cv_core_cv_KAZE_setExtended_bool_extended(self.as_raw_KAZE(), extended) }.into_result()
}
// identifier: cv_KAZE_getExtended_const
fn get_extended(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_KAZE_getExtended_const(self.as_raw_KAZE()) }.into_result()
}
// identifier: cv_KAZE_setUpright_bool_upright
fn set_upright(&mut self, upright: bool) -> Result<()> {
unsafe { sys::cv_core_cv_KAZE_setUpright_bool_upright(self.as_raw_KAZE(), upright) }.into_result()
}
// identifier: cv_KAZE_getUpright_const
fn get_upright(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_KAZE_getUpright_const(self.as_raw_KAZE()) }.into_result()
}
// identifier: cv_KAZE_setThreshold_double_threshold
fn set_threshold(&mut self, threshold: f64) -> Result<()> {
unsafe { sys::cv_core_cv_KAZE_setThreshold_double_threshold(self.as_raw_KAZE(), threshold) }.into_result()
}
// identifier: cv_KAZE_getThreshold_const
fn get_threshold(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_KAZE_getThreshold_const(self.as_raw_KAZE()) }.into_result()
}
// identifier: cv_KAZE_setNOctaves_int_octaves
fn set_n_octaves(&mut self, octaves: i32) -> Result<()> {
unsafe { sys::cv_core_cv_KAZE_setNOctaves_int_octaves(self.as_raw_KAZE(), octaves) }.into_result()
}
// identifier: cv_KAZE_getNOctaves_const
fn get_n_octaves(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_KAZE_getNOctaves_const(self.as_raw_KAZE()) }.into_result()
}
// identifier: cv_KAZE_setNOctaveLayers_int_octaveLayers
fn set_n_octave_layers(&mut self, octave_layers: i32) -> Result<()> {
unsafe { sys::cv_core_cv_KAZE_setNOctaveLayers_int_octaveLayers(self.as_raw_KAZE(), octave_layers) }.into_result()
}
// identifier: cv_KAZE_getNOctaveLayers_const
fn get_n_octave_layers(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_KAZE_getNOctaveLayers_const(self.as_raw_KAZE()) }.into_result()
}
// identifier: cv_KAZE_setDiffusivity_int_diff
fn set_diffusivity(&mut self, diff: i32) -> Result<()> {
unsafe { sys::cv_core_cv_KAZE_setDiffusivity_int_diff(self.as_raw_KAZE(), diff) }.into_result()
}
// identifier: cv_KAZE_getDiffusivity_const
fn get_diffusivity(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_KAZE_getDiffusivity_const(self.as_raw_KAZE()) }.into_result()
}
// identifier: cv_KAZE_getDefaultName_const
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_core_cv_KAZE_getDefaultName_const(self.as_raw_KAZE()) }.into_result().map(crate::templ::receive_string_mut)
}
}
impl<'a> KAZE + 'a {
// identifier: cv_KAZE_create_bool_extended_bool_upright_float_threshold_int_nOctaves_int_nOctaveLayers_int_diffusivity
/// The KAZE constructor
///
/// ## Parameters
/// * extended: Set to enable extraction of extended (128-byte) descriptor.
/// * upright: Set to enable use of upright descriptors (non rotation-invariant).
/// * threshold: Detector response threshold to accept point
/// * nOctaves: Maximum octave evolution of the image
/// * nOctaveLayers: Default number of sublevels per scale level
/// * diffusivity: Diffusivity type. DIFF_PM_G1, DIFF_PM_G2, DIFF_WEICKERT or
/// DIFF_CHARBONNIER
///
/// ## C++ default parameters:
/// * extended: false
/// * upright: false
/// * threshold: 0.001f
/// * n_octaves: 4
/// * n_octave_layers: 4
/// * diffusivity: KAZE::DIFF_PM_G2
pub fn create(extended: bool, upright: bool, threshold: f32, n_octaves: i32, n_octave_layers: i32, diffusivity: i32) -> Result<types::PtrOfKAZE> {
unsafe { sys::cv_core_cv_KAZE_create_bool_extended_bool_upright_float_threshold_int_nOctaves_int_nOctaveLayers_int_diffusivity(extended, upright, threshold, n_octaves, n_octave_layers, diffusivity) }.into_result().map(|x| types::PtrOfKAZE { ptr: x })
}
}
// boxed class cv::KalmanFilter
/// Kalman filter class.
///
/// The class implements a standard Kalman filter <http://en.wikipedia.org/wiki/Kalman_filter>,
/// @cite Welch95 . However, you can modify transitionMatrix, controlMatrix, and measurementMatrix to get
/// an extended Kalman filter functionality.
///
/// Note: In C API when CvKalman\* kalmanFilter structure is not needed anymore, it should be released
/// with cvReleaseKalman(&kalmanFilter)
#[allow(dead_code)]
pub struct KalmanFilter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::KalmanFilter {
fn drop(&mut self) {
unsafe { sys::cv_delete_KalmanFilter(self.ptr) };
}
}
impl core::KalmanFilter {
#[doc(hidden)] pub fn as_raw_KalmanFilter(&self) -> *mut c_void { self.ptr }
}
impl KalmanFilter {
// identifier: cv_KalmanFilter_KalmanFilter
pub fn default() -> Result<core::KalmanFilter> {
unsafe { sys::cv_core_cv_KalmanFilter_KalmanFilter() }.into_result().map(|x| core::KalmanFilter { ptr: x })
}
// identifier: cv_KalmanFilter_KalmanFilter_int_dynamParams_int_measureParams_int_controlParams_int_type
/// @overload
/// ## Parameters
/// * dynamParams: Dimensionality of the state.
/// * measureParams: Dimensionality of the measurement.
/// * controlParams: Dimensionality of the control vector.
/// * type: Type of the created matrices that should be CV_32F or CV_64F.
///
/// ## C++ default parameters:
/// * control_params: 0
/// * _type: CV_32F
pub fn new(dynam_params: i32, measure_params: i32, control_params: i32, _type: i32) -> Result<core::KalmanFilter> {
unsafe { sys::cv_core_cv_KalmanFilter_KalmanFilter_int_dynamParams_int_measureParams_int_controlParams_int_type(dynam_params, measure_params, control_params, _type) }.into_result().map(|x| core::KalmanFilter { ptr: x })
}
// identifier: cv_KalmanFilter_init_int_dynamParams_int_measureParams_int_controlParams_int_type
/// Re-initializes Kalman filter. The previous content is destroyed.
///
/// ## Parameters
/// * dynamParams: Dimensionality of the state.
/// * measureParams: Dimensionality of the measurement.
/// * controlParams: Dimensionality of the control vector.
/// * type: Type of the created matrices that should be CV_32F or CV_64F.
///
/// ## C++ default parameters:
/// * control_params: 0
/// * _type: CV_32F
pub fn init(&mut self, dynam_params: i32, measure_params: i32, control_params: i32, _type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_KalmanFilter_init_int_dynamParams_int_measureParams_int_controlParams_int_type(self.as_raw_KalmanFilter(), dynam_params, measure_params, control_params, _type) }.into_result()
}
// identifier: cv_KalmanFilter_predict_Mat_control
/// Computes a predicted state.
///
/// ## Parameters
/// * control: The optional input control
///
/// ## C++ default parameters:
/// * control: Mat()
pub fn predict(&mut self, control: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_KalmanFilter_predict_Mat_control(self.as_raw_KalmanFilter(), control.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_KalmanFilter_correct_Mat_measurement
/// Updates the predicted state from the measurement.
///
/// ## Parameters
/// * measurement: The measured system parameters
pub fn correct(&mut self, measurement: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_KalmanFilter_correct_Mat_measurement(self.as_raw_KalmanFilter(), measurement.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
impl KeyPoint {
// identifier: cv_KeyPoint_KeyPoint
pub fn default() -> Result<core::KeyPoint> {
unsafe { sys::cv_core_cv_KeyPoint_KeyPoint() }.into_result()
}
// identifier: cv_KeyPoint_KeyPoint_Point2f__pt_float__size_float__angle_float__response_int__octave_int__class_id
/// ## Parameters
/// * _pt: x & y coordinates of the keypoint
/// * _size: keypoint diameter
/// * _angle: keypoint orientation
/// * _response: keypoint detector response on the keypoint (that is, strength of the keypoint)
/// * _octave: pyramid octave in which the keypoint has been detected
/// * _class_id: object id
///
/// ## C++ default parameters:
/// * _angle: -1
/// * _response: 0
/// * _octave: 0
/// * _class_id: -1
pub fn new_point(_pt: core::Point2f, _size: f32, _angle: f32, _response: f32, _octave: i32, _class_id: i32) -> Result<core::KeyPoint> {
unsafe { sys::cv_core_cv_KeyPoint_KeyPoint_Point2f__pt_float__size_float__angle_float__response_int__octave_int__class_id(_pt, _size, _angle, _response, _octave, _class_id) }.into_result()
}
// identifier: cv_KeyPoint_KeyPoint_float_x_float_y_float__size_float__angle_float__response_int__octave_int__class_id
/// ## Parameters
/// * x: x-coordinate of the keypoint
/// * y: y-coordinate of the keypoint
/// * _size: keypoint diameter
/// * _angle: keypoint orientation
/// * _response: keypoint detector response on the keypoint (that is, strength of the keypoint)
/// * _octave: pyramid octave in which the keypoint has been detected
/// * _class_id: object id
///
/// ## C++ default parameters:
/// * _angle: -1
/// * _response: 0
/// * _octave: 0
/// * _class_id: -1
pub fn new_coords(x: f32, y: f32, _size: f32, _angle: f32, _response: f32, _octave: i32, _class_id: i32) -> Result<core::KeyPoint> {
unsafe { sys::cv_core_cv_KeyPoint_KeyPoint_float_x_float_y_float__size_float__angle_float__response_int__octave_int__class_id(x, y, _size, _angle, _response, _octave, _class_id) }.into_result()
}
// identifier: cv_KeyPoint_hash_const
pub fn hash(self) -> Result<size_t> {
unsafe { sys::cv_core_cv_KeyPoint_hash_const(self) }.into_result()
}
// identifier: cv_KeyPoint_convert_VectorOfKeyPoint_keypoints_VectorOfPoint2f_points2f_VectorOfint_keypointIndexes
/// This method converts vector of keypoints to vector of points or the reverse, where each keypoint is
/// assigned the same size and the same orientation.
///
/// ## Parameters
/// * keypoints: Keypoints obtained from any feature detection algorithm like SIFT/SURF/ORB
/// * points2f: Array of (x,y) coordinates of each keypoint
/// * keypointIndexes: Array of indexes of keypoints to be converted to points. (Acts like a mask to
/// convert only specified keypoints)
///
/// ## C++ default parameters:
/// * keypoint_indexes: std::vector<int>()
pub fn convert_from(keypoints: &types::VectorOfKeyPoint, points2f: &types::VectorOfPoint2f, keypoint_indexes: &types::VectorOfint) -> Result<()> {
unsafe { sys::cv_core_cv_KeyPoint_convert_VectorOfKeyPoint_keypoints_VectorOfPoint2f_points2f_VectorOfint_keypointIndexes(keypoints.as_raw_VectorOfKeyPoint(), points2f.as_raw_VectorOfPoint2f(), keypoint_indexes.as_raw_VectorOfint()) }.into_result()
}
// identifier: cv_KeyPoint_convert_VectorOfPoint2f_points2f_VectorOfKeyPoint_keypoints_float_size_float_response_int_octave_int_class_id
/// @overload
/// ## Parameters
/// * points2f: Array of (x,y) coordinates of each keypoint
/// * keypoints: Keypoints obtained from any feature detection algorithm like SIFT/SURF/ORB
/// * size: keypoint diameter
/// * response: keypoint detector response on the keypoint (that is, strength of the keypoint)
/// * octave: pyramid octave in which the keypoint has been detected
/// * class_id: object id
///
/// ## C++ default parameters:
/// * size: 1
/// * response: 1
/// * octave: 0
/// * class_id: -1
pub fn convert_to(points2f: &types::VectorOfPoint2f, keypoints: &types::VectorOfKeyPoint, size: f32, response: f32, octave: i32, class_id: i32) -> Result<()> {
unsafe { sys::cv_core_cv_KeyPoint_convert_VectorOfPoint2f_points2f_VectorOfKeyPoint_keypoints_float_size_float_response_int_octave_int_class_id(points2f.as_raw_VectorOfPoint2f(), keypoints.as_raw_VectorOfKeyPoint(), size, response, octave, class_id) }.into_result()
}
// identifier: cv_KeyPoint_overlap_KeyPoint_kp1_KeyPoint_kp2
/// This method computes overlap for pair of keypoints. Overlap is the ratio between area of keypoint
/// regions' intersection and area of keypoint regions' union (considering keypoint region as circle).
/// If they don't overlap, we get zero. If they coincide at same location with same size, we get 1.
/// ## Parameters
/// * kp1: First keypoint
/// * kp2: Second keypoint
pub fn overlap(kp1: core::KeyPoint, kp2: core::KeyPoint) -> Result<f32> {
unsafe { sys::cv_core_cv_KeyPoint_overlap_KeyPoint_kp1_KeyPoint_kp2(kp1, kp2) }.into_result()
}
}
// boxed class cv::KeyPointsFilter
/// A class filters a vector of keypoints.
///
/// Because now it is difficult to provide a convenient interface for all usage scenarios of the
/// keypoints filter class, it has only several needed by now static methods.
#[allow(dead_code)]
pub struct KeyPointsFilter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::KeyPointsFilter {
fn drop(&mut self) {
unsafe { sys::cv_delete_KeyPointsFilter(self.ptr) };
}
}
impl core::KeyPointsFilter {
#[doc(hidden)] pub fn as_raw_KeyPointsFilter(&self) -> *mut c_void { self.ptr }
}
impl KeyPointsFilter {
// identifier: cv_KeyPointsFilter_KeyPointsFilter
pub fn new() -> Result<core::KeyPointsFilter> {
unsafe { sys::cv_core_cv_KeyPointsFilter_KeyPointsFilter() }.into_result().map(|x| core::KeyPointsFilter { ptr: x })
}
// identifier: cv_KeyPointsFilter_runByImageBorder_VectorOfKeyPoint_keypoints_Size_imageSize_int_borderSize
pub fn run_by_image_border(keypoints: &types::VectorOfKeyPoint, image_size: core::Size, border_size: i32) -> Result<()> {
unsafe { sys::cv_core_cv_KeyPointsFilter_runByImageBorder_VectorOfKeyPoint_keypoints_Size_imageSize_int_borderSize(keypoints.as_raw_VectorOfKeyPoint(), image_size, border_size) }.into_result()
}
// identifier: cv_KeyPointsFilter_runByKeypointSize_VectorOfKeyPoint_keypoints_float_minSize_float_maxSize
///
/// ## C++ default parameters:
/// * max_size: FLT_MAX
pub fn run_by_keypoint_size(keypoints: &types::VectorOfKeyPoint, min_size: f32, max_size: f32) -> Result<()> {
unsafe { sys::cv_core_cv_KeyPointsFilter_runByKeypointSize_VectorOfKeyPoint_keypoints_float_minSize_float_maxSize(keypoints.as_raw_VectorOfKeyPoint(), min_size, max_size) }.into_result()
}
// identifier: cv_KeyPointsFilter_runByPixelsMask_VectorOfKeyPoint_keypoints_Mat_mask
pub fn run_by_pixels_mask(keypoints: &types::VectorOfKeyPoint, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_KeyPointsFilter_runByPixelsMask_VectorOfKeyPoint_keypoints_Mat_mask(keypoints.as_raw_VectorOfKeyPoint(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_KeyPointsFilter_removeDuplicated_VectorOfKeyPoint_keypoints
pub fn remove_duplicated(keypoints: &types::VectorOfKeyPoint) -> Result<()> {
unsafe { sys::cv_core_cv_KeyPointsFilter_removeDuplicated_VectorOfKeyPoint_keypoints(keypoints.as_raw_VectorOfKeyPoint()) }.into_result()
}
// identifier: cv_KeyPointsFilter_removeDuplicatedSorted_VectorOfKeyPoint_keypoints
pub fn remove_duplicated_sorted(keypoints: &types::VectorOfKeyPoint) -> Result<()> {
unsafe { sys::cv_core_cv_KeyPointsFilter_removeDuplicatedSorted_VectorOfKeyPoint_keypoints(keypoints.as_raw_VectorOfKeyPoint()) }.into_result()
}
// identifier: cv_KeyPointsFilter_retainBest_VectorOfKeyPoint_keypoints_int_npoints
pub fn retain_best(keypoints: &types::VectorOfKeyPoint, npoints: i32) -> Result<()> {
unsafe { sys::cv_core_cv_KeyPointsFilter_retainBest_VectorOfKeyPoint_keypoints_int_npoints(keypoints.as_raw_VectorOfKeyPoint(), npoints) }.into_result()
}
}
// boxed class cv::LDA
/// Linear Discriminant Analysis
/// @todo document this class
#[allow(dead_code)]
pub struct LDA {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::LDA {
fn drop(&mut self) {
unsafe { sys::cv_delete_LDA(self.ptr) };
}
}
impl core::LDA {
#[doc(hidden)] pub fn as_raw_LDA(&self) -> *mut c_void { self.ptr }
}
impl LDA {
// identifier: cv_LDA_LDA_int_num_components
/// constructor
/// Initializes a LDA with num_components (default 0).
///
/// ## C++ default parameters:
/// * num_components: 0
pub fn new(num_components: i32) -> Result<core::LDA> {
unsafe { sys::cv_core_cv_LDA_LDA_int_num_components(num_components) }.into_result().map(|x| core::LDA { ptr: x })
}
// identifier: cv_LDA_LDA_VectorOfMat_src_Mat_labels_int_num_components
/// Initializes and performs a Discriminant Analysis with Fisher's
/// Optimization Criterion on given data in src and corresponding labels
/// in labels. If 0 (or less) number of components are given, they are
/// automatically determined for given data in computation.
///
/// ## C++ default parameters:
/// * num_components: 0
pub fn new_1(src: &types::VectorOfMat, labels: &core::Mat, num_components: i32) -> Result<core::LDA> {
unsafe { sys::cv_core_cv_LDA_LDA_VectorOfMat_src_Mat_labels_int_num_components(src.as_raw_VectorOfMat(), labels.as_raw_Mat(), num_components) }.into_result().map(|x| core::LDA { ptr: x })
}
// identifier: cv_LDA_save_const_String_filename
/// Serializes this object to a given filename.
pub fn save(&self, filename: &str) -> Result<()> {
string_arg!(filename);
unsafe { sys::cv_core_cv_LDA_save_const_String_filename(self.as_raw_LDA(), filename.as_ptr()) }.into_result()
}
// identifier: cv_LDA_load_String_filename
/// Deserializes this object from a given filename.
pub fn load(&mut self, filename: &str) -> Result<()> {
string_arg!(filename);
unsafe { sys::cv_core_cv_LDA_load_String_filename(self.as_raw_LDA(), filename.as_ptr()) }.into_result()
}
// identifier: cv_LDA_compute_VectorOfMat_src_Mat_labels
/// Compute the discriminants for data in src (row aligned) and labels.
pub fn compute(&mut self, src: &types::VectorOfMat, labels: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_LDA_compute_VectorOfMat_src_Mat_labels(self.as_raw_LDA(), src.as_raw_VectorOfMat(), labels.as_raw_Mat()) }.into_result()
}
// identifier: cv_LDA_project_Mat_src
/// Projects samples into the LDA subspace.
/// src may be one or more row aligned samples.
pub fn project(&mut self, src: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_LDA_project_Mat_src(self.as_raw_LDA(), src.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_LDA_reconstruct_Mat_src
/// Reconstructs projections from the LDA subspace.
/// src may be one or more row aligned projections.
pub fn reconstruct(&mut self, src: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_LDA_reconstruct_Mat_src(self.as_raw_LDA(), src.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_LDA_eigenvectors_const
/// Returns the eigenvectors of this LDA.
pub fn eigenvectors(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_LDA_eigenvectors_const(self.as_raw_LDA()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_LDA_eigenvalues_const
/// Returns the eigenvalues of this LDA.
pub fn eigenvalues(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_LDA_eigenvalues_const(self.as_raw_LDA()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_LDA_subspaceProject_Mat_W_Mat_mean_Mat_src
pub fn subspace_project(w: &core::Mat, mean: &core::Mat, src: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_LDA_subspaceProject_Mat_W_Mat_mean_Mat_src(w.as_raw_Mat(), mean.as_raw_Mat(), src.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_LDA_subspaceReconstruct_Mat_W_Mat_mean_Mat_src
pub fn subspace_reconstruct(w: &core::Mat, mean: &core::Mat, src: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_LDA_subspaceReconstruct_Mat_W_Mat_mean_Mat_src(w.as_raw_Mat(), mean.as_raw_Mat(), src.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
// boxed class cv::LineIterator
/// Line iterator
///
/// The class is used to iterate over all the pixels on the raster line
/// segment connecting two specified points.
///
/// The class LineIterator is used to get each pixel of a raster line. It
/// can be treated as versatile implementation of the Bresenham algorithm
/// where you can stop at each pixel and do some extra processing, for
/// example, grab pixel values along the line or draw a line with an effect
/// (for example, with XOR operation).
///
/// The number of pixels along the line is stored in LineIterator::count.
/// The method LineIterator::pos returns the current position in the image:
///
/// ```ignore{.cpp}
/// // grabs pixels along the line (pt1, pt2)
/// // from 8-bit 3-channel image to the buffer
/// LineIterator it(img, pt1, pt2, 8);
/// LineIterator it2 = it;
/// vector<Vec3b> buf(it.count);
///
/// for(int i = 0; i < it.count; i++, ++it)
/// buf[i] = *(const Vec3b*)*it;
///
/// // alternative way of iterating through the line
/// for(int i = 0; i < it2.count; i++, ++it2)
/// {
/// Vec3b val = img.at<Vec3b>(it2.pos());
/// CV_Assert(buf[i] == val);
/// }
/// ```
#[allow(dead_code)]
pub struct LineIterator {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::LineIterator {
fn drop(&mut self) {
unsafe { sys::cv_delete_LineIterator(self.ptr) };
}
}
impl core::LineIterator {
#[doc(hidden)] pub fn as_raw_LineIterator(&self) -> *mut c_void { self.ptr }
}
impl LineIterator {
// identifier: cv_LineIterator_LineIterator_Mat_img_Point_pt1_Point_pt2_int_connectivity_bool_leftToRight
/// initializes the iterator
///
/// creates iterators for the line connecting pt1 and pt2
/// the line will be clipped on the image boundaries
/// the line is 8-connected or 4-connected
/// If leftToRight=true, then the iteration is always done
/// from the left-most point to the right most,
/// not to depend on the ordering of pt1 and pt2 parameters
///
/// ## C++ default parameters:
/// * connectivity: 8
/// * left_to_right: false
pub fn new(img: &core::Mat, pt1: core::Point, pt2: core::Point, connectivity: i32, left_to_right: bool) -> Result<core::LineIterator> {
unsafe { sys::cv_core_cv_LineIterator_LineIterator_Mat_img_Point_pt1_Point_pt2_int_connectivity_bool_leftToRight(img.as_raw_Mat(), pt1, pt2, connectivity, left_to_right) }.into_result().map(|x| core::LineIterator { ptr: x })
}
// identifier: cv_LineIterator_pos_const
/// returns coordinates of the current pixel
pub fn pos(&self) -> Result<core::Point> {
unsafe { sys::cv_core_cv_LineIterator_pos_const(self.as_raw_LineIterator()) }.into_result()
}
}
// Generating impl for trait cv::LineSegmentDetector (trait)
/// Line segment detector class
///
/// following the algorithm described at @cite Rafael12 .
pub trait LineSegmentDetector : core::Algorithm {
#[doc(hidden)] fn as_raw_LineSegmentDetector(&self) -> *mut c_void;
// identifier: cv_LineSegmentDetector_detect_Mat__image_Mat__lines_Mat_width_Mat_prec_Mat_nfa
/// Finds lines in the input image.
///
/// This is the output of the default parameters of the algorithm on the above shown image.
///
/// 
///
/// ## Parameters
/// * _image: A grayscale (CV_8UC1) input image. If only a roi needs to be selected, use:
/// `lsd_ptr-\>detect(image(roi), lines, ...); lines += Scalar(roi.x, roi.y, roi.x, roi.y);`
/// * _lines: A vector of Vec4i or Vec4f elements specifying the beginning and ending point of a line. Where
/// Vec4i/Vec4f is (x1, y1, x2, y2), point 1 is the start, point 2 - end. Returned lines are strictly
/// oriented depending on the gradient.
/// * width: Vector of widths of the regions, where the lines are found. E.g. Width of line.
/// * prec: Vector of precisions with which the lines are found.
/// * nfa: Vector containing number of false alarms in the line region, with precision of 10%. The
/// bigger the value, logarithmically better the detection.
/// - -1 corresponds to 10 mean false alarms
/// - 0 corresponds to 1 mean false alarm
/// - 1 corresponds to 0.1 mean false alarms
/// This vector will be calculated only when the objects type is #LSD_REFINE_ADV.
///
/// ## C++ default parameters:
/// * width: noArray()
/// * prec: noArray()
/// * nfa: noArray()
fn detect(&mut self, _image: &core::Mat, _lines: &mut core::Mat, width: &mut core::Mat, prec: &mut core::Mat, nfa: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_LineSegmentDetector_detect_Mat__image_Mat__lines_Mat_width_Mat_prec_Mat_nfa(self.as_raw_LineSegmentDetector(), _image.as_raw_Mat(), _lines.as_raw_Mat(), width.as_raw_Mat(), prec.as_raw_Mat(), nfa.as_raw_Mat()) }.into_result()
}
// identifier: cv_LineSegmentDetector_drawSegments_Mat__image_Mat_lines
/// Draws the line segments on a given image.
/// ## Parameters
/// * _image: The image, where the lines will be drawn. Should be bigger or equal to the image,
/// where the lines were found.
/// * lines: A vector of the lines that needed to be drawn.
fn draw_segments(&mut self, _image: &mut core::Mat, lines: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_LineSegmentDetector_drawSegments_Mat__image_Mat_lines(self.as_raw_LineSegmentDetector(), _image.as_raw_Mat(), lines.as_raw_Mat()) }.into_result()
}
// identifier: cv_LineSegmentDetector_compareSegments_Size_size_Mat_lines1_Mat_lines2_Mat__image
/// Draws two groups of lines in blue and red, counting the non overlapping (mismatching) pixels.
///
/// ## Parameters
/// * size: The size of the image, where lines1 and lines2 were found.
/// * lines1: The first group of lines that needs to be drawn. It is visualized in blue color.
/// * lines2: The second group of lines. They visualized in red color.
/// * _image: Optional image, where the lines will be drawn. The image should be color(3-channel)
/// in order for lines1 and lines2 to be drawn in the above mentioned colors.
///
/// ## C++ default parameters:
/// * _image: noArray()
fn compare_segments(&mut self, size: core::Size, lines1: &core::Mat, lines2: &core::Mat, _image: &mut core::Mat) -> Result<i32> {
unsafe { sys::cv_core_cv_LineSegmentDetector_compareSegments_Size_size_Mat_lines1_Mat_lines2_Mat__image(self.as_raw_LineSegmentDetector(), size, lines1.as_raw_Mat(), lines2.as_raw_Mat(), _image.as_raw_Mat()) }.into_result()
}
}
impl<'a> LineSegmentDetector + 'a {
}
// Generating impl for trait cv::MSER (trait)
/// Maximally stable extremal region extractor
///
/// The class encapsulates all the parameters of the %MSER extraction algorithm (see [wiki
/// article](http://en.wikipedia.org/wiki/Maximally_stable_extremal_regions)).
///
/// - there are two different implementation of %MSER: one for grey image, one for color image
///
/// - the grey image algorithm is taken from: @cite nister2008linear ; the paper claims to be faster
/// than union-find method; it actually get 1.5~2m/s on my centrino L7200 1.2GHz laptop.
///
/// - the color image algorithm is taken from: @cite forssen2007maximally ; it should be much slower
/// than grey image method ( 3~4 times ); the chi_table.h file is taken directly from paper's source
/// code which is distributed under GPL.
///
/// - (Python) A complete example showing the use of the %MSER detector can be found at samples/python/mser.py
pub trait MSER : core::Feature2D {
#[doc(hidden)] fn as_raw_MSER(&self) -> *mut c_void;
// identifier: cv_MSER_detectRegions_Mat_image_VectorOfVectorOfPoint_msers_VectorOfRect_bboxes
/// Detect %MSER regions
///
/// ## Parameters
/// * image: input image (8UC1, 8UC3 or 8UC4, must be greater or equal than 3x3)
/// * msers: resulting list of point sets
/// * bboxes: resulting bounding boxes
fn detect_regions(&mut self, image: &core::Mat, msers: &types::VectorOfVectorOfPoint, bboxes: &types::VectorOfRect) -> Result<()> {
unsafe { sys::cv_core_cv_MSER_detectRegions_Mat_image_VectorOfVectorOfPoint_msers_VectorOfRect_bboxes(self.as_raw_MSER(), image.as_raw_Mat(), msers.as_raw_VectorOfVectorOfPoint(), bboxes.as_raw_VectorOfRect()) }.into_result()
}
// identifier: cv_MSER_setDelta_int_delta
fn set_delta(&mut self, delta: i32) -> Result<()> {
unsafe { sys::cv_core_cv_MSER_setDelta_int_delta(self.as_raw_MSER(), delta) }.into_result()
}
// identifier: cv_MSER_getDelta_const
fn get_delta(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_MSER_getDelta_const(self.as_raw_MSER()) }.into_result()
}
// identifier: cv_MSER_setMinArea_int_minArea
fn set_min_area(&mut self, min_area: i32) -> Result<()> {
unsafe { sys::cv_core_cv_MSER_setMinArea_int_minArea(self.as_raw_MSER(), min_area) }.into_result()
}
// identifier: cv_MSER_getMinArea_const
fn get_min_area(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_MSER_getMinArea_const(self.as_raw_MSER()) }.into_result()
}
// identifier: cv_MSER_setMaxArea_int_maxArea
fn set_max_area(&mut self, max_area: i32) -> Result<()> {
unsafe { sys::cv_core_cv_MSER_setMaxArea_int_maxArea(self.as_raw_MSER(), max_area) }.into_result()
}
// identifier: cv_MSER_getMaxArea_const
fn get_max_area(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_MSER_getMaxArea_const(self.as_raw_MSER()) }.into_result()
}
// identifier: cv_MSER_setPass2Only_bool_f
fn set_pass2_only(&mut self, f: bool) -> Result<()> {
unsafe { sys::cv_core_cv_MSER_setPass2Only_bool_f(self.as_raw_MSER(), f) }.into_result()
}
// identifier: cv_MSER_getPass2Only_const
fn get_pass2_only(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_MSER_getPass2Only_const(self.as_raw_MSER()) }.into_result()
}
// identifier: cv_MSER_getDefaultName_const
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_core_cv_MSER_getDefaultName_const(self.as_raw_MSER()) }.into_result().map(crate::templ::receive_string_mut)
}
}
impl<'a> MSER + 'a {
// identifier: cv_MSER_create_int__delta_int__min_area_int__max_area_double__max_variation_double__min_diversity_int__max_evolution_double__area_threshold_double__min_margin_int__edge_blur_size
/// Full consturctor for %MSER detector
///
/// ## Parameters
/// * _delta: it compares <span lang='latex'>(size_{i}-size_{i-delta})/size_{i-delta}</span>
/// * _min_area: prune the area which smaller than minArea
/// * _max_area: prune the area which bigger than maxArea
/// * _max_variation: prune the area have similar size to its children
/// * _min_diversity: for color image, trace back to cut off mser with diversity less than min_diversity
/// * _max_evolution: for color image, the evolution steps
/// * _area_threshold: for color image, the area threshold to cause re-initialize
/// * _min_margin: for color image, ignore too small margin
/// * _edge_blur_size: for color image, the aperture size for edge blur
///
/// ## C++ default parameters:
/// * _delta: 5
/// * _min_area: 60
/// * _max_area: 14400
/// * _max_variation: 0.25
/// * _min_diversity: .2
/// * _max_evolution: 200
/// * _area_threshold: 1.01
/// * _min_margin: 0.003
/// * _edge_blur_size: 5
pub fn create(_delta: i32, _min_area: i32, _max_area: i32, _max_variation: f64, _min_diversity: f64, _max_evolution: i32, _area_threshold: f64, _min_margin: f64, _edge_blur_size: i32) -> Result<types::PtrOfMSER> {
unsafe { sys::cv_core_cv_MSER_create_int__delta_int__min_area_int__max_area_double__max_variation_double__min_diversity_int__max_evolution_double__area_threshold_double__min_margin_int__edge_blur_size(_delta, _min_area, _max_area, _max_variation, _min_diversity, _max_evolution, _area_threshold, _min_margin, _edge_blur_size) }.into_result().map(|x| types::PtrOfMSER { ptr: x })
}
}
// boxed class cv::Mat
/// n-dimensional dense array class \anchor CVMat_Details
///
/// The class Mat represents an n-dimensional dense numerical single-channel or multi-channel array. It
/// can be used to store real or complex-valued vectors and matrices, grayscale or color images, voxel
/// volumes, vector fields, point clouds, tensors, histograms (though, very high-dimensional histograms
/// may be better stored in a SparseMat ). The data layout of the array `M` is defined by the array
/// `M.step[]`, so that the address of element <span lang='latex'>(i_0,...,i_{M.dims-1})</span>, where <span lang='latex'>0\leq i_k<M.size[k]</span>, is
/// computed as:
/// <div lang='latex'>addr(M_{i_0,...,i_{M.dims-1}}) = M.data + M.step[0]*i_0 + M.step[1]*i_1 + ... + M.step[M.dims-1]*i_{M.dims-1}</div>
/// In case of a 2-dimensional array, the above formula is reduced to:
/// <div lang='latex'>addr(M_{i,j}) = M.data + M.step[0]*i + M.step[1]*j</div>
/// Note that `M.step[i] >= M.step[i+1]` (in fact, `M.step[i] >= M.step[i+1]*M.size[i+1]` ). This means
/// that 2-dimensional matrices are stored row-by-row, 3-dimensional matrices are stored plane-by-plane,
/// and so on. M.step[M.dims-1] is minimal and always equal to the element size M.elemSize() .
///
/// So, the data layout in Mat is fully compatible with CvMat, IplImage, and CvMatND types from OpenCV
/// 1.x. It is also compatible with the majority of dense array types from the standard toolkits and
/// SDKs, such as Numpy (ndarray), Win32 (independent device bitmaps), and others, that is, with any
/// array that uses *steps* (or *strides*) to compute the position of a pixel. Due to this
/// compatibility, it is possible to make a Mat header for user-allocated data and process it in-place
/// using OpenCV functions.
///
/// There are many different ways to create a Mat object. The most popular options are listed below:
///
/// - Use the create(nrows, ncols, type) method or the similar Mat(nrows, ncols, type[, fillValue])
/// constructor. A new array of the specified size and type is allocated. type has the same meaning as
/// in the cvCreateMat method. For example, CV_8UC1 means a 8-bit single-channel array, CV_32FC2
/// means a 2-channel (complex) floating-point array, and so on.
/// ```ignore
/// // make a 7x7 complex matrix filled with 1+3j.
/// Mat M(7,7,CV_32FC2,Scalar(1,3));
/// // and now turn M to a 100x60 15-channel 8-bit matrix.
/// // The old content will be deallocated
/// M.create(100,60,CV_8UC(15));
/// ```
///
/// As noted in the introduction to this chapter, create() allocates only a new array when the shape
/// or type of the current array are different from the specified ones.
///
/// - Create a multi-dimensional array:
/// ```ignore
/// // create a 100x100x100 8-bit array
/// int sz[] = {100, 100, 100};
/// Mat bigCube(3, sz, CV_8U, Scalar::all(0));
/// ```
///
/// It passes the number of dimensions =1 to the Mat constructor but the created array will be
/// 2-dimensional with the number of columns set to 1. So, Mat::dims is always \>= 2 (can also be 0
/// when the array is empty).
///
/// - Use a copy constructor or assignment operator where there can be an array or expression on the
/// right side (see below). As noted in the introduction, the array assignment is an O(1) operation
/// because it only copies the header and increases the reference counter. The Mat::clone() method can
/// be used to get a full (deep) copy of the array when you need it.
///
/// - Construct a header for a part of another array. It can be a single row, single column, several
/// rows, several columns, rectangular region in the array (called a *minor* in algebra) or a
/// diagonal. Such operations are also O(1) because the new header references the same data. You can
/// actually modify a part of the array using this feature, for example:
/// ```ignore
/// // add the 5-th row, multiplied by 3 to the 3rd row
/// M.row(3) = M.row(3) + M.row(5)*3;
/// // now copy the 7-th column to the 1-st column
/// // M.col(1) = M.col(7); // this will not work
/// Mat M1 = M.col(1);
/// M.col(7).copyTo(M1);
/// // create a new 320x240 image
/// Mat img(Size(320,240),CV_8UC3);
/// // select a ROI
/// Mat roi(img, Rect(10,10,100,100));
/// // fill the ROI with (0,255,0) (which is green in RGB space);
/// // the original 320x240 image will be modified
/// roi = Scalar(0,255,0);
/// ```
///
/// Due to the additional datastart and dataend members, it is possible to compute a relative
/// sub-array position in the main *container* array using locateROI():
/// ```ignore
/// Mat A = Mat::eye(10, 10, CV_32S);
/// // extracts A columns, 1 (inclusive) to 3 (exclusive).
/// Mat B = A(Range::all(), Range(1, 3));
/// // extracts B rows, 5 (inclusive) to 9 (exclusive).
/// // that is, C \~ A(Range(5, 9), Range(1, 3))
/// Mat C = B(Range(5, 9), Range::all());
/// Size size; Point ofs;
/// C.locateROI(size, ofs);
/// // size will be (width=10,height=10) and the ofs will be (x=1, y=5)
/// ```
///
/// As in case of whole matrices, if you need a deep copy, use the `clone()` method of the extracted
/// sub-matrices.
///
/// - Make a header for user-allocated data. It can be useful to do the following:
/// -# Process "foreign" data using OpenCV (for example, when you implement a DirectShow\* filter or
/// a processing module for gstreamer, and so on). For example:
/// ```ignore
/// void process_video_frame(const unsigned char* pixels,
/// int width, int height, int step)
/// {
/// Mat img(height, width, CV_8UC3, pixels, step);
/// GaussianBlur(img, img, Size(7,7), 1.5, 1.5);
/// }
/// ```
///
/// -# Quickly initialize small matrices and/or get a super-fast element access.
/// ```ignore
/// double m[3][3] = {{a, b, c}, {d, e, f}, {g, h, i}};
/// Mat M = Mat(3, 3, CV_64F, m).inv();
/// ```
///
/// .
/// Partial yet very common cases of this *user-allocated data* case are conversions from CvMat and
/// IplImage to Mat. For this purpose, there is function cv::cvarrToMat taking pointers to CvMat or
/// IplImage and the optional flag indicating whether to copy the data or not.
/// @snippet samples/cpp/image.cpp iplimage
///
/// - Use MATLAB-style array initializers, zeros(), ones(), eye(), for example:
/// ```ignore
/// // create a double-precision identity matrix and add it to M.
/// M += Mat::eye(M.rows, M.cols, CV_64F);
/// ```
///
///
/// - Use a comma-separated initializer:
/// ```ignore
/// // create a 3x3 double-precision identity matrix
/// Mat M = (Mat_<double>(3,3) << 1, 0, 0, 0, 1, 0, 0, 0, 1);
/// ```
///
/// With this approach, you first call a constructor of the Mat class with the proper parameters, and
/// then you just put `<< operator` followed by comma-separated values that can be constants,
/// variables, expressions, and so on. Also, note the extra parentheses required to avoid compilation
/// errors.
///
/// Once the array is created, it is automatically managed via a reference-counting mechanism. If the
/// array header is built on top of user-allocated data, you should handle the data by yourself. The
/// array data is deallocated when no one points to it. If you want to release the data pointed by a
/// array header before the array destructor is called, use Mat::release().
///
/// The next important thing to learn about the array class is element access. This manual already
/// described how to compute an address of each array element. Normally, you are not required to use the
/// formula directly in the code. If you know the array element type (which can be retrieved using the
/// method Mat::type() ), you can access the element <span lang='latex'>M_{ij}</span> of a 2-dimensional array as:
/// ```ignore
/// M.at<double>(i,j) += 1.f;
/// ```
///
/// assuming that `M` is a double-precision floating-point array. There are several variants of the method
/// at for a different number of dimensions.
///
/// If you need to process a whole row of a 2D array, the most efficient way is to get the pointer to
/// the row first, and then just use the plain C operator [] :
/// ```ignore
/// // compute sum of positive matrix elements
/// // (assuming that M is a double-precision matrix)
/// double sum=0;
/// for(int i = 0; i < M.rows; i++)
/// {
/// const double* Mi = M.ptr<double>(i);
/// for(int j = 0; j < M.cols; j++)
/// sum += std::max(Mi[j], 0.);
/// }
/// ```
///
/// Some operations, like the one above, do not actually depend on the array shape. They just process
/// elements of an array one by one (or elements from multiple arrays that have the same coordinates,
/// for example, array addition). Such operations are called *element-wise*. It makes sense to check
/// whether all the input/output arrays are continuous, namely, have no gaps at the end of each row. If
/// yes, process them as a long single row:
/// ```ignore
/// // compute the sum of positive matrix elements, optimized variant
/// double sum=0;
/// int cols = M.cols, rows = M.rows;
/// if(M.isContinuous())
/// {
/// cols *= rows;
/// rows = 1;
/// }
/// for(int i = 0; i < rows; i++)
/// {
/// const double* Mi = M.ptr<double>(i);
/// for(int j = 0; j < cols; j++)
/// sum += std::max(Mi[j], 0.);
/// }
/// ```
///
/// In case of the continuous matrix, the outer loop body is executed just once. So, the overhead is
/// smaller, which is especially noticeable in case of small matrices.
///
/// Finally, there are STL-style iterators that are smart enough to skip gaps between successive rows:
/// ```ignore
/// // compute sum of positive matrix elements, iterator-based variant
/// double sum=0;
/// MatConstIterator_<double> it = M.begin<double>(), it_end = M.end<double>();
/// for(; it != it_end; ++it)
/// sum += std::max(*it, 0.);
/// ```
///
/// The matrix iterators are random-access iterators, so they can be passed to any STL algorithm,
/// including std::sort().
///
///
/// Note: Matrix Expressions and arithmetic see MatExpr
#[allow(dead_code)]
pub struct Mat {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::Mat {
fn drop(&mut self) {
unsafe { sys::cv_delete_Mat(self.ptr) };
}
}
impl core::Mat {
#[doc(hidden)] pub fn as_raw_Mat(&self) -> *mut c_void { self.ptr }
}
impl Mat {
// identifier: cv_Mat_Mat
/// These are various constructors that form a matrix. As noted in the AutomaticAllocation, often
/// the default constructor is enough, and the proper matrix will be allocated by an OpenCV function.
/// The constructed matrix can further be assigned to another matrix or matrix expression or can be
/// allocated with Mat::create . In the former case, the old content is de-referenced.
pub fn new() -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat() }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_int_rows_int_cols_int_type
/// @overload
/// ## Parameters
/// * rows: Number of rows in a 2D array.
/// * cols: Number of columns in a 2D array.
/// * type: Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
/// CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
pub fn new_rows_cols(rows: i32, cols: i32, _type: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_int_rows_int_cols_int_type(rows, cols, _type) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_Size_size_int_type
/// @overload
/// ## Parameters
/// * size: 2D array size: Size(cols, rows) . In the Size() constructor, the number of rows and the
/// number of columns go in the reverse order.
/// * type: Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
/// CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
pub fn new_size(size: core::Size, _type: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_Size_size_int_type(size, _type) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_int_rows_int_cols_int_type_Scalar_s
/// @overload
/// ## Parameters
/// * rows: Number of rows in a 2D array.
/// * cols: Number of columns in a 2D array.
/// * type: Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
/// CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
/// * s: An optional value to initialize each matrix element with. To set all the matrix elements to
/// the particular value after the construction, use the assignment operator
/// Mat::operator=(const Scalar& value) .
pub fn new_rows_cols_with_default(rows: i32, cols: i32, _type: i32, s: core::Scalar) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_int_rows_int_cols_int_type_Scalar_s(rows, cols, _type, s) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_Size_size_int_type_Scalar_s
/// @overload
/// ## Parameters
/// * size: 2D array size: Size(cols, rows) . In the Size() constructor, the number of rows and the
/// number of columns go in the reverse order.
/// * type: Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
/// CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
/// * s: An optional value to initialize each matrix element with. To set all the matrix elements to
/// the particular value after the construction, use the assignment operator
/// Mat::operator=(const Scalar& value) .
pub fn new_size_with_default(size: core::Size, _type: i32, s: core::Scalar) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_Size_size_int_type_Scalar_s(size, _type, s) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_int_ndims_const_int_X_sizes_int_type
/// @overload
/// ## Parameters
/// * ndims: Array dimensionality.
/// * sizes: Array of integers specifying an n-dimensional array shape.
/// * type: Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
/// CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
pub fn new_1(ndims: i32, sizes: &i32, _type: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_int_ndims_const_int_X_sizes_int_type(ndims, sizes, _type) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_VectorOfint_sizes_int_type
/// @overload
/// ## Parameters
/// * sizes: Array of integers specifying an n-dimensional array shape.
/// * type: Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
/// CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
pub fn new_2(sizes: &types::VectorOfint, _type: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_VectorOfint_sizes_int_type(sizes.as_raw_VectorOfint(), _type) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_int_ndims_const_int_X_sizes_int_type_Scalar_s
/// @overload
/// ## Parameters
/// * ndims: Array dimensionality.
/// * sizes: Array of integers specifying an n-dimensional array shape.
/// * type: Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
/// CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
/// * s: An optional value to initialize each matrix element with. To set all the matrix elements to
/// the particular value after the construction, use the assignment operator
/// Mat::operator=(const Scalar& value) .
pub fn new_3(ndims: i32, sizes: &i32, _type: i32, s: core::Scalar) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_int_ndims_const_int_X_sizes_int_type_Scalar_s(ndims, sizes, _type, s) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_VectorOfint_sizes_int_type_Scalar_s
/// @overload
/// ## Parameters
/// * sizes: Array of integers specifying an n-dimensional array shape.
/// * type: Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
/// CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
/// * s: An optional value to initialize each matrix element with. To set all the matrix elements to
/// the particular value after the construction, use the assignment operator
/// Mat::operator=(const Scalar& value) .
pub fn new_4(sizes: &types::VectorOfint, _type: i32, s: core::Scalar) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_VectorOfint_sizes_int_type_Scalar_s(sizes.as_raw_VectorOfint(), _type, s) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_Mat_m
/// @overload
/// ## Parameters
/// * m: Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied
/// by these constructors. Instead, the header pointing to m data or its sub-array is constructed and
/// associated with it. The reference counter, if any, is incremented. So, when you modify the matrix
/// formed using such a constructor, you also modify the corresponding elements of m . If you want to
/// have an independent copy of the sub-array, use Mat::clone() .
pub fn copy(m: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_Mat_m(m.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_int_rows_int_cols_int_type_void_X_data_size_t_step
/// @overload
/// ## Parameters
/// * rows: Number of rows in a 2D array.
/// * cols: Number of columns in a 2D array.
/// * type: Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
/// CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
/// * data: Pointer to the user data. Matrix constructors that take data and step parameters do not
/// allocate matrix data. Instead, they just initialize the matrix header that points to the specified
/// data, which means that no data is copied. This operation is very efficient and can be used to
/// process external data using OpenCV functions. The external data is not automatically deallocated, so
/// you should take care of it.
/// * step: Number of bytes each matrix row occupies. The value should include the padding bytes at
/// the end of each row, if any. If the parameter is missing (set to AUTO_STEP ), no padding is assumed
/// and the actual step is calculated as cols*elemSize(). See Mat::elemSize.
///
/// ## C++ default parameters:
/// * step: AUTO_STEP
pub fn new_5(rows: i32, cols: i32, _type: i32, data: &mut c_void, step: size_t) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_int_rows_int_cols_int_type_void_X_data_size_t_step(rows, cols, _type, data, step) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_Size_size_int_type_void_X_data_size_t_step
/// @overload
/// ## Parameters
/// * size: 2D array size: Size(cols, rows) . In the Size() constructor, the number of rows and the
/// number of columns go in the reverse order.
/// * type: Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
/// CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
/// * data: Pointer to the user data. Matrix constructors that take data and step parameters do not
/// allocate matrix data. Instead, they just initialize the matrix header that points to the specified
/// data, which means that no data is copied. This operation is very efficient and can be used to
/// process external data using OpenCV functions. The external data is not automatically deallocated, so
/// you should take care of it.
/// * step: Number of bytes each matrix row occupies. The value should include the padding bytes at
/// the end of each row, if any. If the parameter is missing (set to AUTO_STEP ), no padding is assumed
/// and the actual step is calculated as cols*elemSize(). See Mat::elemSize.
///
/// ## C++ default parameters:
/// * step: AUTO_STEP
pub fn new_6(size: core::Size, _type: i32, data: &mut c_void, step: size_t) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_Size_size_int_type_void_X_data_size_t_step(size, _type, data, step) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_int_ndims_const_int_X_sizes_int_type_void_X_data_const_size_t_X_steps
/// @overload
/// ## Parameters
/// * ndims: Array dimensionality.
/// * sizes: Array of integers specifying an n-dimensional array shape.
/// * type: Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
/// CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
/// * data: Pointer to the user data. Matrix constructors that take data and step parameters do not
/// allocate matrix data. Instead, they just initialize the matrix header that points to the specified
/// data, which means that no data is copied. This operation is very efficient and can be used to
/// process external data using OpenCV functions. The external data is not automatically deallocated, so
/// you should take care of it.
/// * steps: Array of ndims-1 steps in case of a multi-dimensional array (the last step is always
/// set to the element size). If not specified, the matrix is assumed to be continuous.
///
/// ## C++ default parameters:
/// * steps: 0
pub fn new_7(ndims: i32, sizes: &i32, _type: i32, data: &mut c_void, steps: &size_t) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_int_ndims_const_int_X_sizes_int_type_void_X_data_const_size_t_X_steps(ndims, sizes, _type, data, steps) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_VectorOfint_sizes_int_type_void_X_data_const_size_t_X_steps
/// @overload
/// ## Parameters
/// * sizes: Array of integers specifying an n-dimensional array shape.
/// * type: Array type. Use CV_8UC1, ..., CV_64FC4 to create 1-4 channel matrices, or
/// CV_8UC(n), ..., CV_64FC(n) to create multi-channel (up to CV_CN_MAX channels) matrices.
/// * data: Pointer to the user data. Matrix constructors that take data and step parameters do not
/// allocate matrix data. Instead, they just initialize the matrix header that points to the specified
/// data, which means that no data is copied. This operation is very efficient and can be used to
/// process external data using OpenCV functions. The external data is not automatically deallocated, so
/// you should take care of it.
/// * steps: Array of ndims-1 steps in case of a multi-dimensional array (the last step is always
/// set to the element size). If not specified, the matrix is assumed to be continuous.
///
/// ## C++ default parameters:
/// * steps: 0
pub fn new_8(sizes: &types::VectorOfint, _type: i32, data: &mut c_void, steps: &size_t) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_VectorOfint_sizes_int_type_void_X_data_const_size_t_X_steps(sizes.as_raw_VectorOfint(), _type, data, steps) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_Mat_m_Range_rowRange_Range_colRange
/// @overload
/// ## Parameters
/// * m: Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied
/// by these constructors. Instead, the header pointing to m data or its sub-array is constructed and
/// associated with it. The reference counter, if any, is incremented. So, when you modify the matrix
/// formed using such a constructor, you also modify the corresponding elements of m . If you want to
/// have an independent copy of the sub-array, use Mat::clone() .
/// * rowRange: Range of the m rows to take. As usual, the range start is inclusive and the range
/// end is exclusive. Use Range::all() to take all the rows.
/// * colRange: Range of the m columns to take. Use Range::all() to take all the columns.
///
/// ## C++ default parameters:
/// * col_range: Range::all()
pub fn rowscols(m: &core::Mat, row_range: &core::Range, col_range: &core::Range) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_Mat_m_Range_rowRange_Range_colRange(m.as_raw_Mat(), row_range.as_raw_Range(), col_range.as_raw_Range()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_Mat_m_Rect_roi
/// @overload
/// ## Parameters
/// * m: Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied
/// by these constructors. Instead, the header pointing to m data or its sub-array is constructed and
/// associated with it. The reference counter, if any, is incremented. So, when you modify the matrix
/// formed using such a constructor, you also modify the corresponding elements of m . If you want to
/// have an independent copy of the sub-array, use Mat::clone() .
/// * roi: Region of interest.
pub fn roi(m: &core::Mat, roi: core::Rect) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_Mat_m_Rect_roi(m.as_raw_Mat(), roi) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_Mat_m_const_Range_ranges
/// @overload
/// ## Parameters
/// * m: Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied
/// by these constructors. Instead, the header pointing to m data or its sub-array is constructed and
/// associated with it. The reference counter, if any, is incremented. So, when you modify the matrix
/// formed using such a constructor, you also modify the corresponding elements of m . If you want to
/// have an independent copy of the sub-array, use Mat::clone() .
/// * ranges: Array of selected ranges of m along each dimensionality.
pub fn ranges(m: &core::Mat, ranges: &core::Range) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_Mat_m_const_Range_ranges(m.as_raw_Mat(), ranges.as_raw_Range()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_Mat_Mat_m_VectorOfRange_ranges
/// @overload
/// ## Parameters
/// * m: Array that (as a whole or partly) is assigned to the constructed matrix. No data is copied
/// by these constructors. Instead, the header pointing to m data or its sub-array is constructed and
/// associated with it. The reference counter, if any, is incremented. So, when you modify the matrix
/// formed using such a constructor, you also modify the corresponding elements of m . If you want to
/// have an independent copy of the sub-array, use Mat::clone() .
/// * ranges: Array of selected ranges of m along each dimensionality.
pub fn new_9(m: &core::Mat, ranges: &types::VectorOfRange) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_Mat_Mat_m_VectorOfRange_ranges(m.as_raw_Mat(), ranges.as_raw_VectorOfRange()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_row_const_int_y
/// Creates a matrix header for the specified matrix row.
///
/// The method makes a new header for the specified matrix row and returns it. This is an O(1)
/// operation, regardless of the matrix size. The underlying data of the new matrix is shared with the
/// original matrix. Here is the example of one of the classical basic matrix processing operations,
/// axpy, used by LU and many other algorithms:
/// ```ignore
/// inline void matrix_axpy(Mat& A, int i, int j, double alpha)
/// {
/// A.row(i) += A.row(j)*alpha;
/// }
/// ```
///
///
/// Note: In the current implementation, the following code does not work as expected:
/// ```ignore
/// Mat A;
/// ...
/// A.row(i) = A.row(j); // will not work
/// ```
///
/// This happens because A.row(i) forms a temporary header that is further assigned to another header.
/// Remember that each of these operations is O(1), that is, no data is copied. Thus, the above
/// assignment is not true if you may have expected the j-th row to be copied to the i-th row. To
/// achieve that, you should either turn this simple assignment into an expression or use the
/// Mat::copyTo method:
/// ```ignore
/// Mat A;
/// ...
/// // works, but looks a bit obscure.
/// A.row(i) = A.row(j) + 0;
/// // this is a bit longer, but the recommended method.
/// A.row(j).copyTo(A.row(i));
/// ```
///
/// ## Parameters
/// * y: A 0-based row index.
pub fn row(&self, y: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_row_const_int_y(self.as_raw_Mat(), y) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_col_const_int_x
/// Creates a matrix header for the specified matrix column.
///
/// The method makes a new header for the specified matrix column and returns it. This is an O(1)
/// operation, regardless of the matrix size. The underlying data of the new matrix is shared with the
/// original matrix. See also the Mat::row description.
/// ## Parameters
/// * x: A 0-based column index.
pub fn col(&self, x: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_col_const_int_x(self.as_raw_Mat(), x) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_rowRange_const_int_startrow_int_endrow
/// Creates a matrix header for the specified row span.
///
/// The method makes a new header for the specified row span of the matrix. Similarly to Mat::row and
/// Mat::col , this is an O(1) operation.
/// ## Parameters
/// * startrow: An inclusive 0-based start index of the row span.
/// * endrow: An exclusive 0-based ending index of the row span.
pub fn rowbounds(&self, startrow: i32, endrow: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_rowRange_const_int_startrow_int_endrow(self.as_raw_Mat(), startrow, endrow) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_rowRange_const_Range_r
/// @overload
/// ## Parameters
/// * r: Range structure containing both the start and the end indices.
pub fn row_range(&self, r: &core::Range) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_rowRange_const_Range_r(self.as_raw_Mat(), r.as_raw_Range()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_colRange_const_int_startcol_int_endcol
/// Creates a matrix header for the specified column span.
///
/// The method makes a new header for the specified column span of the matrix. Similarly to Mat::row and
/// Mat::col , this is an O(1) operation.
/// ## Parameters
/// * startcol: An inclusive 0-based start index of the column span.
/// * endcol: An exclusive 0-based ending index of the column span.
pub fn colbounds(&self, startcol: i32, endcol: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_colRange_const_int_startcol_int_endcol(self.as_raw_Mat(), startcol, endcol) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_colRange_const_Range_r
/// @overload
/// ## Parameters
/// * r: Range structure containing both the start and the end indices.
pub fn colrange(&self, r: &core::Range) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_colRange_const_Range_r(self.as_raw_Mat(), r.as_raw_Range()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_diag_const_int_d
/// Extracts a diagonal from a matrix
///
/// The method makes a new header for the specified matrix diagonal. The new matrix is represented as a
/// single-column matrix. Similarly to Mat::row and Mat::col, this is an O(1) operation.
/// ## Parameters
/// * d: index of the diagonal, with the following values:
/// - `d=0` is the main diagonal.
/// - `d<0` is a diagonal from the lower half. For example, d=-1 means the diagonal is set
/// immediately below the main one.
/// - `d>0` is a diagonal from the upper half. For example, d=1 means the diagonal is set
/// immediately above the main one.
/// For example:
/// ```ignore
/// Mat m = (Mat_<int>(3,3) <<
/// 1,2,3,
/// 4,5,6,
/// 7,8,9);
/// Mat d0 = m.diag(0);
/// Mat d1 = m.diag(1);
/// Mat d_1 = m.diag(-1);
/// ```
///
/// The resulting matrices are
/// ```ignore
/// d0 =
/// [1;
/// 5;
/// 9]
/// d1 =
/// [2;
/// 6]
/// d_1 =
/// [4;
/// 8]
/// ```
///
/// ## C++ default parameters:
/// * d: 0
pub fn diag(&self, d: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_diag_const_int_d(self.as_raw_Mat(), d) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_diag_Mat_d
/// creates a diagonal matrix
///
/// The method creates a square diagonal matrix from specified main diagonal.
/// ## Parameters
/// * d: One-dimensional matrix that represents the main diagonal.
pub fn diag_new_mat(d: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_diag_Mat_d(d.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_clone_const
/// Creates a full copy of the array and the underlying data.
///
/// The method creates a full copy of the array. The original step[] is not taken into account. So, the
/// array copy is a continuous array occupying total()*elemSize() bytes.
pub fn clone(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_clone_const(self.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_copyTo_const_Mat_m
/// Copies the matrix to another one.
///
/// The method copies the matrix data to another matrix. Before copying the data, the method invokes :
/// ```ignore
/// m.create(this->size(), this->type());
/// ```
///
/// so that the destination matrix is reallocated if needed. While m.copyTo(m); works flawlessly, the
/// function does not handle the case of a partial overlap between the source and the destination
/// matrices.
///
/// When the operation mask is specified, if the Mat::create call shown above reallocates the matrix,
/// the newly allocated matrix is initialized with all zeros before copying the data.
/// ## Parameters
/// * m: Destination matrix. If it does not have a proper size or type before the operation, it is
/// reallocated.
pub fn copy_to(&self, m: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_copyTo_const_Mat_m(self.as_raw_Mat(), m.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_copyTo_const_Mat_m_Mat_mask
/// @overload
/// ## Parameters
/// * m: Destination matrix. If it does not have a proper size or type before the operation, it is
/// reallocated.
/// * mask: Operation mask of the same size as \*this. Its non-zero elements indicate which matrix
/// elements need to be copied. The mask has to be of type CV_8U and can have 1 or multiple channels.
pub fn copy_to_masked(&self, m: &mut core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_copyTo_const_Mat_m_Mat_mask(self.as_raw_Mat(), m.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_convertTo_const_Mat_m_int_rtype_double_alpha_double_beta
/// Converts an array to another data type with optional scaling.
///
/// The method converts source pixel values to the target data type. saturate_cast\<\> is applied at
/// the end to avoid possible overflows:
///
/// <div lang='latex'>m(x,y) = saturate \_ cast<rType>( \alpha (*this)(x,y) + \beta )</div>
/// ## Parameters
/// * m: output matrix; if it does not have a proper size or type before the operation, it is
/// reallocated.
/// * rtype: desired output matrix type or, rather, the depth since the number of channels are the
/// same as the input has; if rtype is negative, the output matrix will have the same type as the input.
/// * alpha: optional scale factor.
/// * beta: optional delta added to the scaled values.
///
/// ## C++ default parameters:
/// * alpha: 1
/// * beta: 0
pub fn convert_to(&self, m: &mut core::Mat, rtype: i32, alpha: f64, beta: f64) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_convertTo_const_Mat_m_int_rtype_double_alpha_double_beta(self.as_raw_Mat(), m.as_raw_Mat(), rtype, alpha, beta) }.into_result()
}
// identifier: cv_Mat_assignTo_const_Mat_m_int_type
/// Provides a functional form of convertTo.
///
/// This is an internally used method called by the @ref MatrixExpressions engine.
/// ## Parameters
/// * m: Destination array.
/// * type: Desired destination array depth (or -1 if it should be the same as the source type).
///
/// ## C++ default parameters:
/// * _type: -1
pub fn assign_to(&self, m: &core::Mat, _type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_assignTo_const_Mat_m_int_type(self.as_raw_Mat(), m.as_raw_Mat(), _type) }.into_result()
}
// identifier: cv_Mat_setTo_Mat_value_Mat_mask
/// Sets all or some of the array elements to the specified value.
///
/// This is an advanced variant of the Mat::operator=(const Scalar& s) operator.
/// ## Parameters
/// * value: Assigned scalar converted to the actual array type.
/// * mask: Operation mask of the same size as \*this. Its non-zero elements indicate which matrix
/// elements need to be copied. The mask has to be of type CV_8U and can have 1 or multiple channels
///
/// ## C++ default parameters:
/// * mask: noArray()
pub fn set_to(&mut self, value: &core::Mat, mask: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_setTo_Mat_value_Mat_mask(self.as_raw_Mat(), value.as_raw_Mat(), mask.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_reshape_const_int_cn_int_rows
/// Changes the shape and/or the number of channels of a 2D matrix without copying the data.
///
/// The method makes a new matrix header for \*this elements. The new matrix may have a different size
/// and/or different number of channels. Any combination is possible if:
/// * No extra elements are included into the new matrix and no elements are excluded. Consequently,
/// the product rows\*cols\*channels() must stay the same after the transformation.
/// * No data is copied. That is, this is an O(1) operation. Consequently, if you change the number of
/// rows, or the operation changes the indices of elements row in some other way, the matrix must be
/// continuous. See Mat::isContinuous .
///
/// For example, if there is a set of 3D points stored as an STL vector, and you want to represent the
/// points as a 3xN matrix, do the following:
/// ```ignore
/// std::vector<Point3f> vec;
/// ...
/// Mat pointMat = Mat(vec). // convert vector to Mat, O(1) operation
/// reshape(1). // make Nx3 1-channel matrix out of Nx1 3-channel.
/// // Also, an O(1) operation
/// t(); // finally, transpose the Nx3 matrix.
/// // This involves copying all the elements
/// ```
///
/// ## Parameters
/// * cn: New number of channels. If the parameter is 0, the number of channels remains the same.
/// * rows: New number of rows. If the parameter is 0, the number of rows remains the same.
///
/// ## C++ default parameters:
/// * rows: 0
pub fn reshape(&self, cn: i32, rows: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_reshape_const_int_cn_int_rows(self.as_raw_Mat(), cn, rows) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_reshape_const_int_cn_int_newndims_const_int_X_newsz
/// @overload
pub fn reshape_1(&self, cn: i32, newndims: i32, newsz: &i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_reshape_const_int_cn_int_newndims_const_int_X_newsz(self.as_raw_Mat(), cn, newndims, newsz) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_reshape_const_int_cn_VectorOfint_newshape
/// @overload
pub fn reshape_2(&self, cn: i32, newshape: &types::VectorOfint) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_reshape_const_int_cn_VectorOfint_newshape(self.as_raw_Mat(), cn, newshape.as_raw_VectorOfint()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_cross_const_Mat_m
/// Computes a cross-product of two 3-element vectors.
///
/// The method computes a cross-product of two 3-element vectors. The vectors must be 3-element
/// floating-point vectors of the same shape and size. The result is another 3-element vector of the
/// same shape and type as operands.
/// ## Parameters
/// * m: Another cross-product operand.
pub fn cross(&self, m: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_cross_const_Mat_m(self.as_raw_Mat(), m.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_dot_const_Mat_m
/// Computes a dot-product of two vectors.
///
/// The method computes a dot-product of two matrices. If the matrices are not single-column or
/// single-row vectors, the top-to-bottom left-to-right scan ordering is used to treat them as 1D
/// vectors. The vectors must have the same size and type. If the matrices have more than one channel,
/// the dot products from all the channels are summed together.
/// ## Parameters
/// * m: another dot-product operand.
pub fn dot(&self, m: &core::Mat) -> Result<f64> {
unsafe { sys::cv_core_cv_Mat_dot_const_Mat_m(self.as_raw_Mat(), m.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_create_int_ndims_const_int_X_sizes_int_type
/// @overload
/// ## Parameters
/// * ndims: New array dimensionality.
/// * sizes: Array of integers specifying a new array shape.
/// * type: New matrix type.
pub fn create(&mut self, ndims: i32, sizes: &i32, _type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_create_int_ndims_const_int_X_sizes_int_type(self.as_raw_Mat(), ndims, sizes, _type) }.into_result()
}
// identifier: cv_Mat_create_VectorOfint_sizes_int_type
/// @overload
/// ## Parameters
/// * sizes: Array of integers specifying a new array shape.
/// * type: New matrix type.
pub fn create_1(&mut self, sizes: &types::VectorOfint, _type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_create_VectorOfint_sizes_int_type(self.as_raw_Mat(), sizes.as_raw_VectorOfint(), _type) }.into_result()
}
// identifier: cv_Mat_addref
/// Increments the reference counter.
///
/// The method increments the reference counter associated with the matrix data. If the matrix header
/// points to an external data set (see Mat::Mat ), the reference counter is NULL, and the method has no
/// effect in this case. Normally, to avoid memory leaks, the method should not be called explicitly. It
/// is called implicitly by the matrix assignment operator. The reference counter increment is an atomic
/// operation on the platforms that support it. Thus, it is safe to operate on the same matrices
/// asynchronously in different threads.
pub fn addref(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_addref(self.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_release
/// Decrements the reference counter and deallocates the matrix if needed.
///
/// The method decrements the reference counter associated with the matrix data. When the reference
/// counter reaches 0, the matrix data is deallocated and the data and the reference counter pointers
/// are set to NULL's. If the matrix header points to an external data set (see Mat::Mat ), the
/// reference counter is NULL, and the method has no effect in this case.
///
/// This method can be called manually to force the matrix data deallocation. But since this method is
/// automatically called in the destructor, or by any other method that changes the data pointer, it is
/// usually not needed. The reference counter decrement and check for 0 is an atomic operation on the
/// platforms that support it. Thus, it is safe to operate on the same matrices asynchronously in
/// different threads.
pub fn release(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_release(self.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_deallocate
pub fn deallocate(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_deallocate(self.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_copySize_Mat_m
pub fn copy_size(&mut self, m: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_copySize_Mat_m(self.as_raw_Mat(), m.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_reserve_size_t_sz
/// Reserves space for the certain number of rows.
///
/// The method reserves space for sz rows. If the matrix already has enough space to store sz rows,
/// nothing happens. If the matrix is reallocated, the first Mat::rows rows are preserved. The method
/// emulates the corresponding method of the STL vector class.
/// ## Parameters
/// * sz: Number of rows.
pub fn reserve(&mut self, sz: size_t) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_reserve_size_t_sz(self.as_raw_Mat(), sz) }.into_result()
}
// identifier: cv_Mat_reserveBuffer_size_t_sz
/// Reserves space for the certain number of bytes.
///
/// The method reserves space for sz bytes. If the matrix already has enough space to store sz bytes,
/// nothing happens. If matrix has to be reallocated its previous content could be lost.
/// ## Parameters
/// * sz: Number of bytes.
pub fn reserve_buffer(&mut self, sz: size_t) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_reserveBuffer_size_t_sz(self.as_raw_Mat(), sz) }.into_result()
}
// identifier: cv_Mat_resize_size_t_sz
/// Changes the number of matrix rows.
///
/// The methods change the number of matrix rows. If the matrix is reallocated, the first
/// min(Mat::rows, sz) rows are preserved. The methods emulate the corresponding methods of the STL
/// vector class.
/// ## Parameters
/// * sz: New number of rows.
pub fn resize(&mut self, sz: size_t) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_resize_size_t_sz(self.as_raw_Mat(), sz) }.into_result()
}
// identifier: cv_Mat_resize_size_t_sz_Scalar_s
/// @overload
/// ## Parameters
/// * sz: New number of rows.
/// * s: Value assigned to the newly added elements.
pub fn resize_with_default(&mut self, sz: size_t, s: core::Scalar) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_resize_size_t_sz_Scalar_s(self.as_raw_Mat(), sz, s) }.into_result()
}
// identifier: cv_Mat_push_back__const_void_X_elem
pub fn push_back_(&mut self, elem: &c_void) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_push_back__const_void_X_elem(self.as_raw_Mat(), elem) }.into_result()
}
// identifier: cv_Mat_push_back_Mat_m
/// @overload
/// ## Parameters
/// * m: Added line(s).
pub fn push_back(&mut self, m: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_push_back_Mat_m(self.as_raw_Mat(), m.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_pop_back_size_t_nelems
/// Removes elements from the bottom of the matrix.
///
/// The method removes one or more rows from the bottom of the matrix.
/// ## Parameters
/// * nelems: Number of removed rows. If it is greater than the total number of rows, an exception
/// is thrown.
///
/// ## C++ default parameters:
/// * nelems: 1
pub fn pop_back(&mut self, nelems: size_t) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_pop_back_size_t_nelems(self.as_raw_Mat(), nelems) }.into_result()
}
// identifier: cv_Mat_locateROI_const_Size_wholeSize_Point_ofs
/// Locates the matrix header within a parent matrix.
///
/// After you extracted a submatrix from a matrix using Mat::row, Mat::col, Mat::rowRange,
/// Mat::colRange, and others, the resultant submatrix points just to the part of the original big
/// matrix. However, each submatrix contains information (represented by datastart and dataend
/// fields) that helps reconstruct the original matrix size and the position of the extracted
/// submatrix within the original matrix. The method locateROI does exactly that.
/// ## Parameters
/// * wholeSize: Output parameter that contains the size of the whole matrix containing *this*
/// as a part.
/// * ofs: Output parameter that contains an offset of *this* inside the whole matrix.
pub fn locate_roi(&self, whole_size: core::Size, ofs: core::Point) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_locateROI_const_Size_wholeSize_Point_ofs(self.as_raw_Mat(), whole_size, ofs) }.into_result()
}
// identifier: cv_Mat_adjustROI_int_dtop_int_dbottom_int_dleft_int_dright
/// Adjusts a submatrix size and position within the parent matrix.
///
/// The method is complimentary to Mat::locateROI . The typical use of these functions is to determine
/// the submatrix position within the parent matrix and then shift the position somehow. Typically, it
/// can be required for filtering operations when pixels outside of the ROI should be taken into
/// account. When all the method parameters are positive, the ROI needs to grow in all directions by the
/// specified amount, for example:
/// ```ignore
/// A.adjustROI(2, 2, 2, 2);
/// ```
///
/// In this example, the matrix size is increased by 4 elements in each direction. The matrix is shifted
/// by 2 elements to the left and 2 elements up, which brings in all the necessary pixels for the
/// filtering with the 5x5 kernel.
///
/// adjustROI forces the adjusted ROI to be inside of the parent matrix that is boundaries of the
/// adjusted ROI are constrained by boundaries of the parent matrix. For example, if the submatrix A is
/// located in the first row of a parent matrix and you called A.adjustROI(2, 2, 2, 2) then A will not
/// be increased in the upward direction.
///
/// The function is used internally by the OpenCV filtering functions, like filter2D , morphological
/// operations, and so on.
/// ## Parameters
/// * dtop: Shift of the top submatrix boundary upwards.
/// * dbottom: Shift of the bottom submatrix boundary downwards.
/// * dleft: Shift of the left submatrix boundary to the left.
/// * dright: Shift of the right submatrix boundary to the right.
/// @sa copyMakeBorder
pub fn adjust_roi(&mut self, dtop: i32, dbottom: i32, dleft: i32, dright: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_Mat_adjustROI_int_dtop_int_dbottom_int_dleft_int_dright(self.as_raw_Mat(), dtop, dbottom, dleft, dright) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_Mat_isContinuous_const
/// Reports whether the matrix is continuous or not.
///
/// The method returns true if the matrix elements are stored continuously without gaps at the end of
/// each row. Otherwise, it returns false. Obviously, 1x1 or 1xN matrices are always continuous.
/// Matrices created with Mat::create are always continuous. But if you extract a part of the matrix
/// using Mat::col, Mat::diag, and so on, or constructed a matrix header for externally allocated data,
/// such matrices may no longer have this property.
///
/// The continuity flag is stored as a bit in the Mat::flags field and is computed automatically when
/// you construct a matrix header. Thus, the continuity check is a very fast operation, though
/// theoretically it could be done as follows:
/// ```ignore
/// // alternative implementation of Mat::isContinuous()
/// bool myCheckMatContinuity(const Mat& m)
/// {
/// //return (m.flags & Mat::CONTINUOUS_FLAG) != 0;
/// return m.rows == 1 || m.step == m.cols*m.elemSize();
/// }
/// ```
///
/// The method is used in quite a few of OpenCV functions. The point is that element-wise operations
/// (such as arithmetic and logical operations, math functions, alpha blending, color space
/// transformations, and others) do not depend on the image geometry. Thus, if all the input and output
/// arrays are continuous, the functions can process them as very long single-row vectors. The example
/// below illustrates how an alpha-blending function can be implemented:
/// ```ignore
/// template<typename T>
/// void alphaBlendRGBA(const Mat& src1, const Mat& src2, Mat& dst)
/// {
/// const float alpha_scale = (float)std::numeric_limits<T>::max(),
/// inv_scale = 1.f/alpha_scale;
///
/// CV_Assert( src1.type() == src2.type() &&
/// src1.type() == CV_MAKETYPE(traits::Depth<T>::value, 4) &&
/// src1.size() == src2.size());
/// Size size = src1.size();
/// dst.create(size, src1.type());
///
/// // here is the idiom: check the arrays for continuity and,
/// // if this is the case,
/// // treat the arrays as 1D vectors
/// if( src1.isContinuous() && src2.isContinuous() && dst.isContinuous() )
/// {
/// size.width *= size.height;
/// size.height = 1;
/// }
/// size.width *= 4;
///
/// for( int i = 0; i < size.height; i++ )
/// {
/// // when the arrays are continuous,
/// // the outer loop is executed only once
/// const T* ptr1 = src1.ptr<T>(i);
/// const T* ptr2 = src2.ptr<T>(i);
/// T* dptr = dst.ptr<T>(i);
///
/// for( int j = 0; j < size.width; j += 4 )
/// {
/// float alpha = ptr1[j+3]*inv_scale, beta = ptr2[j+3]*inv_scale;
/// dptr[j] = saturate_cast<T>(ptr1[j]*alpha + ptr2[j]*beta);
/// dptr[j+1] = saturate_cast<T>(ptr1[j+1]*alpha + ptr2[j+1]*beta);
/// dptr[j+2] = saturate_cast<T>(ptr1[j+2]*alpha + ptr2[j+2]*beta);
/// dptr[j+3] = saturate_cast<T>((1 - (1-alpha)*(1-beta))*alpha_scale);
/// }
/// }
/// }
/// ```
///
/// This approach, while being very simple, can boost the performance of a simple element-operation by
/// 10-20 percents, especially if the image is rather small and the operation is quite simple.
///
/// Another OpenCV idiom in this function, a call of Mat::create for the destination array, that
/// allocates the destination array unless it already has the proper size and type. And while the newly
/// allocated arrays are always continuous, you still need to check the destination array because
/// Mat::create does not always allocate a new matrix.
pub fn is_continuous(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_Mat_isContinuous_const(self.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_isSubmatrix_const
pub fn is_submatrix(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_Mat_isSubmatrix_const(self.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_elemSize_const
/// Returns the matrix element size in bytes.
///
/// The method returns the matrix element size in bytes. For example, if the matrix type is CV_16SC3 ,
/// the method returns 3\*sizeof(short) or 6.
pub fn elem_size(&self) -> Result<size_t> {
unsafe { sys::cv_core_cv_Mat_elemSize_const(self.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_elemSize1_const
/// Returns the size of each matrix element channel in bytes.
///
/// The method returns the matrix element channel size in bytes, that is, it ignores the number of
/// channels. For example, if the matrix type is CV_16SC3 , the method returns sizeof(short) or 2.
pub fn elem_size1(&self) -> Result<size_t> {
unsafe { sys::cv_core_cv_Mat_elemSize1_const(self.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_type_const
/// Returns the type of a matrix element.
///
/// The method returns a matrix element type. This is an identifier compatible with the CvMat type
/// system, like CV_16SC3 or 16-bit signed 3-channel array, and so on.
pub fn typ(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_Mat_type_const(self.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_depth_const
/// Returns the depth of a matrix element.
///
/// The method returns the identifier of the matrix element depth (the type of each individual channel).
/// For example, for a 16-bit signed element array, the method returns CV_16S . A complete list of
/// matrix types contains the following values:
/// * CV_8U - 8-bit unsigned integers ( 0..255 )
/// * CV_8S - 8-bit signed integers ( -128..127 )
/// * CV_16U - 16-bit unsigned integers ( 0..65535 )
/// * CV_16S - 16-bit signed integers ( -32768..32767 )
/// * CV_32S - 32-bit signed integers ( -2147483648..2147483647 )
/// * CV_32F - 32-bit floating-point numbers ( -FLT_MAX..FLT_MAX, INF, NAN )
/// * CV_64F - 64-bit floating-point numbers ( -DBL_MAX..DBL_MAX, INF, NAN )
pub fn depth(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_Mat_depth_const(self.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_channels_const
/// Returns the number of matrix channels.
///
/// The method returns the number of matrix channels.
pub fn channels(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_Mat_channels_const(self.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_step1_const_int_i
/// Returns a normalized step.
///
/// The method returns a matrix step divided by Mat::elemSize1() . It can be useful to quickly access an
/// arbitrary matrix element.
///
/// ## C++ default parameters:
/// * i: 0
pub fn step1(&self, i: i32) -> Result<size_t> {
unsafe { sys::cv_core_cv_Mat_step1_const_int_i(self.as_raw_Mat(), i) }.into_result()
}
// identifier: cv_Mat_empty_const
/// Returns true if the array has no elements.
///
/// The method returns true if Mat::total() is 0 or if Mat::data is NULL. Because of pop_back() and
/// resize() methods `M.total() == 0` does not imply that `M.data == NULL`.
pub fn empty(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_Mat_empty_const(self.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_total_const
/// Returns the total number of array elements.
///
/// The method returns the number of array elements (a number of pixels if the array represents an
/// image).
pub fn total(&self) -> Result<size_t> {
unsafe { sys::cv_core_cv_Mat_total_const(self.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_total_const_int_startDim_int_endDim
/// Returns the total number of array elements.
///
/// The method returns the number of elements within a certain sub-array slice with startDim <= dim < endDim
///
/// ## C++ default parameters:
/// * end_dim: INT_MAX
pub fn total_1(&self, start_dim: i32, end_dim: i32) -> Result<size_t> {
unsafe { sys::cv_core_cv_Mat_total_const_int_startDim_int_endDim(self.as_raw_Mat(), start_dim, end_dim) }.into_result()
}
// identifier: cv_Mat_checkVector_const_int_elemChannels_int_depth_bool_requireContinuous
/// ## Parameters
/// * elemChannels: Number of channels or number of columns the matrix should have.
/// For a 2-D matrix, when the matrix has only 1 column, then it should have
/// elemChannels channels; When the matrix has only 1 channel,
/// then it should have elemChannels columns.
/// For a 3-D matrix, it should have only one channel. Furthermore,
/// if the number of planes is not one, then the number of rows
/// within every plane has to be 1; if the number of rows within
/// every plane is not 1, then the number of planes has to be 1.
/// * depth: The depth the matrix should have. Set it to -1 when any depth is fine.
/// * requireContinuous: Set it to true to require the matrix to be continuous
/// @return -1 if the requirement is not satisfied.
/// Otherwise, it returns the number of elements in the matrix. Note
/// that an element may have multiple channels.
///
/// The following code demonstrates its usage for a 2-d matrix:
/// @snippet snippets/core_mat_checkVector.cpp example-2d
///
/// The following code demonstrates its usage for a 3-d matrix:
/// @snippet snippets/core_mat_checkVector.cpp example-3d
///
/// ## C++ default parameters:
/// * depth: -1
/// * require_continuous: true
pub fn check_vector(&self, elem_channels: i32, depth: i32, require_continuous: bool) -> Result<i32> {
unsafe { sys::cv_core_cv_Mat_checkVector_const_int_elemChannels_int_depth_bool_requireContinuous(self.as_raw_Mat(), elem_channels, depth, require_continuous) }.into_result()
}
// identifier: cv_Mat_ptr_int_i0
/// Returns a pointer to the specified matrix row.
///
/// The methods return `uchar*` or typed pointer to the specified matrix row. See the sample in
/// Mat::isContinuous to know how to use these methods.
/// ## Parameters
/// * i0: A 0-based row index.
///
/// ## C++ default parameters:
/// * i0: 0
pub fn ptr_mut(&mut self, i0: i32) -> Result<&mut u8> {
unsafe { sys::cv_core_cv_Mat_ptr_int_i0(self.as_raw_Mat(), i0) }.into_result().and_then(|x| unsafe { x.as_mut() }.ok_or_else(|| Error::new(core::StsNullPtr, format!("Function returned Null pointer"))))
}
// identifier: cv_Mat_ptr_const_int_i0
/// @overload
///
/// ## C++ default parameters:
/// * i0: 0
pub fn ptr(&self, i0: i32) -> Result<&u8> {
unsafe { sys::cv_core_cv_Mat_ptr_const_int_i0(self.as_raw_Mat(), i0) }.into_result().and_then(|x| unsafe { x.as_ref() }.ok_or_else(|| Error::new(core::StsNullPtr, format!("Function returned Null pointer"))))
}
// identifier: cv_Mat_ptr_int_row_int_col
/// @overload
/// ## Parameters
/// * row: Index along the dimension 0
/// * col: Index along the dimension 1
pub fn ptr_2d_mut(&mut self, row: i32, col: i32) -> Result<&mut u8> {
unsafe { sys::cv_core_cv_Mat_ptr_int_row_int_col(self.as_raw_Mat(), row, col) }.into_result().and_then(|x| unsafe { x.as_mut() }.ok_or_else(|| Error::new(core::StsNullPtr, format!("Function returned Null pointer"))))
}
// identifier: cv_Mat_ptr_const_int_row_int_col
/// @overload
/// ## Parameters
/// * row: Index along the dimension 0
/// * col: Index along the dimension 1
pub fn ptr_2d(&self, row: i32, col: i32) -> Result<&u8> {
unsafe { sys::cv_core_cv_Mat_ptr_const_int_row_int_col(self.as_raw_Mat(), row, col) }.into_result().and_then(|x| unsafe { x.as_ref() }.ok_or_else(|| Error::new(core::StsNullPtr, format!("Function returned Null pointer"))))
}
// identifier: cv_Mat_ptr_int_i0_int_i1_int_i2
/// @overload
pub fn ptr_3d_mut(&mut self, i0: i32, i1: i32, i2: i32) -> Result<&mut u8> {
unsafe { sys::cv_core_cv_Mat_ptr_int_i0_int_i1_int_i2(self.as_raw_Mat(), i0, i1, i2) }.into_result().and_then(|x| unsafe { x.as_mut() }.ok_or_else(|| Error::new(core::StsNullPtr, format!("Function returned Null pointer"))))
}
// identifier: cv_Mat_ptr_const_int_i0_int_i1_int_i2
/// @overload
pub fn ptr_3d(&self, i0: i32, i1: i32, i2: i32) -> Result<&u8> {
unsafe { sys::cv_core_cv_Mat_ptr_const_int_i0_int_i1_int_i2(self.as_raw_Mat(), i0, i1, i2) }.into_result().and_then(|x| unsafe { x.as_ref() }.ok_or_else(|| Error::new(core::StsNullPtr, format!("Function returned Null pointer"))))
}
// identifier: cv_Mat_ptr_const_int_X_idx
/// @overload
pub fn ptr_1(&mut self, idx: &i32) -> Result<&mut u8> {
unsafe { sys::cv_core_cv_Mat_ptr_const_int_X_idx(self.as_raw_Mat(), idx) }.into_result().and_then(|x| unsafe { x.as_mut() }.ok_or_else(|| Error::new(core::StsNullPtr, format!("Function returned Null pointer"))))
}
// identifier: cv_Mat_ptr_const_const_int_X_idx
/// @overload
pub fn ptr_2(&self, idx: &i32) -> Result<&u8> {
unsafe { sys::cv_core_cv_Mat_ptr_const_const_int_X_idx(self.as_raw_Mat(), idx) }.into_result().and_then(|x| unsafe { x.as_ref() }.ok_or_else(|| Error::new(core::StsNullPtr, format!("Function returned Null pointer"))))
}
// identifier: cv_Mat_at_int_i0
/// Returns a reference to the specified array element.
///
/// The template methods return a reference to the specified array element. For the sake of higher
/// performance, the index range checks are only performed in the Debug configuration.
///
/// Note that the variants with a single index (i) can be used to access elements of single-row or
/// single-column 2-dimensional arrays. That is, if, for example, A is a 1 x N floating-point matrix and
/// B is an M x 1 integer matrix, you can simply write `A.at<float>(k+4)` and `B.at<int>(2*i+1)`
/// instead of `A.at<float>(0,k+4)` and `B.at<int>(2*i+1,0)`, respectively.
///
/// The example below initializes a Hilbert matrix:
/// ```ignore
/// Mat H(100, 100, CV_64F);
/// for(int i = 0; i < H.rows; i++)
/// for(int j = 0; j < H.cols; j++)
/// H.at<double>(i,j)=1./(i+j+1);
/// ```
///
///
/// Keep in mind that the size identifier used in the at operator cannot be chosen at random. It depends
/// on the image from which you are trying to retrieve the data. The table below gives a better insight in this:
/// - If matrix is of type `CV_8U` then use `Mat.at<uchar>(y,x)`.
/// - If matrix is of type `CV_8S` then use `Mat.at<schar>(y,x)`.
/// - If matrix is of type `CV_16U` then use `Mat.at<ushort>(y,x)`.
/// - If matrix is of type `CV_16S` then use `Mat.at<short>(y,x)`.
/// - If matrix is of type `CV_32S` then use `Mat.at<int>(y,x)`.
/// - If matrix is of type `CV_32F` then use `Mat.at<float>(y,x)`.
/// - If matrix is of type `CV_64F` then use `Mat.at<double>(y,x)`.
///
/// ## Parameters
/// * i0: Index along the dimension 0
///
/// ## C++ default parameters:
/// * i0: 0
pub fn at_mut<T: core::ValidMatElement>(&mut self, i0: i32) -> Result<&mut T> { self._at_mut(i0) }
// identifier: cv_Mat_at_const_int_i0
/// @overload
/// ## Parameters
/// * i0: Index along the dimension 0
///
/// ## C++ default parameters:
/// * i0: 0
pub fn at<T: core::ValidMatElement>(&self, i0: i32) -> Result<&T> { self._at(i0) }
// identifier: cv_Mat_at_int_row_int_col
/// @overload
/// ## Parameters
/// * row: Index along the dimension 0
/// * col: Index along the dimension 1
pub fn at_2d_mut<T: core::ValidMatElement>(&mut self, row: i32, col: i32) -> Result<&mut T> { self._at_2d_mut(row, col) }
// identifier: cv_Mat_at_const_int_row_int_col
/// @overload
/// ## Parameters
/// * row: Index along the dimension 0
/// * col: Index along the dimension 1
pub fn at_2d<T: core::ValidMatElement>(&self, row: i32, col: i32) -> Result<&T> { self._at_2d(row, col) }
// identifier: cv_Mat_at_int_i0_int_i1_int_i2
/// @overload
/// ## Parameters
/// * i0: Index along the dimension 0
/// * i1: Index along the dimension 1
/// * i2: Index along the dimension 2
pub fn at_3d_mut<T: core::ValidMatElement>(&mut self, i0: i32, i1: i32, i2: i32) -> Result<&mut T> { self._at_3d_mut(i0, i1, i2) }
// identifier: cv_Mat_at_const_int_i0_int_i1_int_i2
/// @overload
/// ## Parameters
/// * i0: Index along the dimension 0
/// * i1: Index along the dimension 1
/// * i2: Index along the dimension 2
pub fn at_3d<T: core::ValidMatElement>(&self, i0: i32, i1: i32, i2: i32) -> Result<&T> { self._at_3d(i0, i1, i2) }
// identifier: cv_Mat_updateContinuityFlag
pub fn update_continuity_flag(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_Mat_updateContinuityFlag(self.as_raw_Mat()) }.into_result()
}
// identifier: cv_Mat_size_const
pub fn size(&self) -> Result<core::Size> {
unsafe { sys::cv_core_cv_Mat_size_const(self.as_raw_Mat()) }.into_result()
}
}
// boxed class cv::MatExpr
/// Matrix expression representation
/// @anchor MatrixExpressions
/// This is a list of implemented matrix operations that can be combined in arbitrary complex
/// expressions (here A, B stand for matrices ( Mat ), s for a scalar ( Scalar ), alpha for a
/// real-valued scalar ( double )):
/// * Addition, subtraction, negation: `A+B`, `A-B`, `A+s`, `A-s`, `s+A`, `s-A`, `-A`
/// * Scaling: `A*alpha`
/// * Per-element multiplication and division: `A.mul(B)`, `A/B`, `alpha/A`
/// * Matrix multiplication: `A*B`
/// * Transposition: `A.t()` (means A<sup>T</sup>)
/// * Matrix inversion and pseudo-inversion, solving linear systems and least-squares problems:
/// `A.inv([method]) (~ A<sup>-1</sup>)`, `A.inv([method])*B (~ X: AX=B)`
/// * Comparison: `A cmpop B`, `A cmpop alpha`, `alpha cmpop A`, where *cmpop* is one of
/// `>`, `>=`, `==`, `!=`, `<=`, `<`. The result of comparison is an 8-bit single channel mask whose
/// elements are set to 255 (if the particular element or pair of elements satisfy the condition) or
/// 0.
/// * Bitwise logical operations: `A logicop B`, `A logicop s`, `s logicop A`, `~A`, where *logicop* is one of
/// `&`, `|`, `^`.
/// * Element-wise minimum and maximum: `min(A, B)`, `min(A, alpha)`, `max(A, B)`, `max(A, alpha)`
/// * Element-wise absolute value: `abs(A)`
/// * Cross-product, dot-product: `A.cross(B)`, `A.dot(B)`
/// * Any function of matrix or matrices and scalars that returns a matrix or a scalar, such as norm,
/// mean, sum, countNonZero, trace, determinant, repeat, and others.
/// * Matrix initializers ( Mat::eye(), Mat::zeros(), Mat::ones() ), matrix comma-separated
/// initializers, matrix constructors and operators that extract sub-matrices (see Mat description).
/// * Mat_<destination_type>() constructors to cast the result to the proper type.
///
/// Note: Comma-separated initializers and probably some other operations may require additional
/// explicit Mat() or Mat_<T>() constructor calls to resolve a possible ambiguity.
///
/// Here are examples of matrix expressions:
/// ```ignore
/// // compute pseudo-inverse of A, equivalent to A.inv(DECOMP_SVD)
/// SVD svd(A);
/// Mat pinvA = svd.vt.t()*Mat::diag(1./svd.w)*svd.u.t();
///
/// // compute the new vector of parameters in the Levenberg-Marquardt algorithm
/// x -= (A.t()*A + lambda*Mat::eye(A.cols,A.cols,A.type())).inv(DECOMP_CHOLESKY)*(A.t()*err);
///
/// // sharpen image using "unsharp mask" algorithm
/// Mat blurred; double sigma = 1, threshold = 5, amount = 1;
/// GaussianBlur(img, blurred, Size(), sigma, sigma);
/// Mat lowContrastMask = abs(img - blurred) < threshold;
/// Mat sharpened = img*(1+amount) + blurred*(-amount);
/// img.copyTo(sharpened, lowContrastMask);
/// ```
#[allow(dead_code)]
pub struct MatExpr {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::MatExpr {
fn drop(&mut self) {
unsafe { sys::cv_delete_MatExpr(self.ptr) };
}
}
impl core::MatExpr {
#[doc(hidden)] pub fn as_raw_MatExpr(&self) -> *mut c_void { self.ptr }
}
impl MatExpr {
// identifier: cv_MatExpr_size_const
pub fn size(&self) -> Result<core::Size> {
unsafe { sys::cv_core_cv_MatExpr_size_const(self.as_raw_MatExpr()) }.into_result()
}
// identifier: cv_MatExpr_type_const
pub fn typ(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_MatExpr_type_const(self.as_raw_MatExpr()) }.into_result()
}
// identifier: cv_MatExpr_cross_const_Mat_m
pub fn cross(&self, m: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_MatExpr_cross_const_Mat_m(self.as_raw_MatExpr(), m.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_MatExpr_dot_const_Mat_m
pub fn dot(&self, m: &core::Mat) -> Result<f64> {
unsafe { sys::cv_core_cv_MatExpr_dot_const_Mat_m(self.as_raw_MatExpr(), m.as_raw_Mat()) }.into_result()
}
}
// Generating impl for trait cv::MatOp (trait)
pub trait MatOp {
#[doc(hidden)] fn as_raw_MatOp(&self) -> *mut c_void;
}
impl<'a> MatOp + 'a {
}
// boxed class cv::MatSize
#[allow(dead_code)]
pub struct MatSize {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::MatSize {
fn drop(&mut self) {
unsafe { sys::cv_delete_MatSize(self.ptr) };
}
}
impl core::MatSize {
#[doc(hidden)] pub fn as_raw_MatSize(&self) -> *mut c_void { self.ptr }
}
impl MatSize {
// identifier: cv_MatSize_MatSize_int_X__p
pub fn new(_p: &mut i32) -> Result<core::MatSize> {
unsafe { sys::cv_core_cv_MatSize_MatSize_int_X__p(_p) }.into_result().map(|x| core::MatSize { ptr: x })
}
// identifier: cv_MatSize_dims_const
pub fn dims(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_MatSize_dims_const(self.as_raw_MatSize()) }.into_result()
}
}
// boxed class cv::MatStep
#[allow(dead_code)]
pub struct MatStep {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::MatStep {
fn drop(&mut self) {
unsafe { sys::cv_delete_MatStep(self.ptr) };
}
}
impl core::MatStep {
#[doc(hidden)] pub fn as_raw_MatStep(&self) -> *mut c_void { self.ptr }
}
impl MatStep {
// identifier: cv_MatStep_MatStep
pub fn default() -> Result<core::MatStep> {
unsafe { sys::cv_core_cv_MatStep_MatStep() }.into_result().map(|x| core::MatStep { ptr: x })
}
// identifier: cv_MatStep_MatStep_size_t_s
pub fn new(s: size_t) -> Result<core::MatStep> {
unsafe { sys::cv_core_cv_MatStep_MatStep_size_t_s(s) }.into_result().map(|x| core::MatStep { ptr: x })
}
}
// boxed class cv::Matx_AddOp
#[allow(dead_code)]
pub struct Matx_AddOp {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::Matx_AddOp {
fn drop(&mut self) {
unsafe { sys::cv_delete_Matx_AddOp(self.ptr) };
}
}
impl core::Matx_AddOp {
#[doc(hidden)] pub fn as_raw_Matx_AddOp(&self) -> *mut c_void { self.ptr }
}
impl Matx_AddOp {
// identifier: cv_Matx_AddOp_Matx_AddOp
pub fn new() -> Result<core::Matx_AddOp> {
unsafe { sys::cv_core_cv_Matx_AddOp_Matx_AddOp() }.into_result().map(|x| core::Matx_AddOp { ptr: x })
}
// identifier: cv_Matx_AddOp_Matx_AddOp_Matx_AddOp_unnamed_arg
pub fn new_1(unnamed_arg: &core::Matx_AddOp) -> Result<core::Matx_AddOp> {
unsafe { sys::cv_core_cv_Matx_AddOp_Matx_AddOp_Matx_AddOp_unnamed_arg(unnamed_arg.as_raw_Matx_AddOp()) }.into_result().map(|x| core::Matx_AddOp { ptr: x })
}
}
// boxed class cv::Matx_DivOp
#[allow(dead_code)]
pub struct Matx_DivOp {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::Matx_DivOp {
fn drop(&mut self) {
unsafe { sys::cv_delete_Matx_DivOp(self.ptr) };
}
}
impl core::Matx_DivOp {
#[doc(hidden)] pub fn as_raw_Matx_DivOp(&self) -> *mut c_void { self.ptr }
}
impl Matx_DivOp {
// identifier: cv_Matx_DivOp_Matx_DivOp
pub fn new() -> Result<core::Matx_DivOp> {
unsafe { sys::cv_core_cv_Matx_DivOp_Matx_DivOp() }.into_result().map(|x| core::Matx_DivOp { ptr: x })
}
// identifier: cv_Matx_DivOp_Matx_DivOp_Matx_DivOp_unnamed_arg
pub fn new_1(unnamed_arg: &core::Matx_DivOp) -> Result<core::Matx_DivOp> {
unsafe { sys::cv_core_cv_Matx_DivOp_Matx_DivOp_Matx_DivOp_unnamed_arg(unnamed_arg.as_raw_Matx_DivOp()) }.into_result().map(|x| core::Matx_DivOp { ptr: x })
}
}
// boxed class cv::Matx_MatMulOp
#[allow(dead_code)]
pub struct Matx_MatMulOp {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::Matx_MatMulOp {
fn drop(&mut self) {
unsafe { sys::cv_delete_Matx_MatMulOp(self.ptr) };
}
}
impl core::Matx_MatMulOp {
#[doc(hidden)] pub fn as_raw_Matx_MatMulOp(&self) -> *mut c_void { self.ptr }
}
impl Matx_MatMulOp {
// identifier: cv_Matx_MatMulOp_Matx_MatMulOp
pub fn new() -> Result<core::Matx_MatMulOp> {
unsafe { sys::cv_core_cv_Matx_MatMulOp_Matx_MatMulOp() }.into_result().map(|x| core::Matx_MatMulOp { ptr: x })
}
// identifier: cv_Matx_MatMulOp_Matx_MatMulOp_Matx_MatMulOp_unnamed_arg
pub fn new_1(unnamed_arg: &core::Matx_MatMulOp) -> Result<core::Matx_MatMulOp> {
unsafe { sys::cv_core_cv_Matx_MatMulOp_Matx_MatMulOp_Matx_MatMulOp_unnamed_arg(unnamed_arg.as_raw_Matx_MatMulOp()) }.into_result().map(|x| core::Matx_MatMulOp { ptr: x })
}
}
// boxed class cv::Matx_MulOp
#[allow(dead_code)]
pub struct Matx_MulOp {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::Matx_MulOp {
fn drop(&mut self) {
unsafe { sys::cv_delete_Matx_MulOp(self.ptr) };
}
}
impl core::Matx_MulOp {
#[doc(hidden)] pub fn as_raw_Matx_MulOp(&self) -> *mut c_void { self.ptr }
}
impl Matx_MulOp {
// identifier: cv_Matx_MulOp_Matx_MulOp
pub fn new() -> Result<core::Matx_MulOp> {
unsafe { sys::cv_core_cv_Matx_MulOp_Matx_MulOp() }.into_result().map(|x| core::Matx_MulOp { ptr: x })
}
// identifier: cv_Matx_MulOp_Matx_MulOp_Matx_MulOp_unnamed_arg
pub fn new_1(unnamed_arg: &core::Matx_MulOp) -> Result<core::Matx_MulOp> {
unsafe { sys::cv_core_cv_Matx_MulOp_Matx_MulOp_Matx_MulOp_unnamed_arg(unnamed_arg.as_raw_Matx_MulOp()) }.into_result().map(|x| core::Matx_MulOp { ptr: x })
}
}
// boxed class cv::Matx_ScaleOp
#[allow(dead_code)]
pub struct Matx_ScaleOp {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::Matx_ScaleOp {
fn drop(&mut self) {
unsafe { sys::cv_delete_Matx_ScaleOp(self.ptr) };
}
}
impl core::Matx_ScaleOp {
#[doc(hidden)] pub fn as_raw_Matx_ScaleOp(&self) -> *mut c_void { self.ptr }
}
impl Matx_ScaleOp {
// identifier: cv_Matx_ScaleOp_Matx_ScaleOp
pub fn new() -> Result<core::Matx_ScaleOp> {
unsafe { sys::cv_core_cv_Matx_ScaleOp_Matx_ScaleOp() }.into_result().map(|x| core::Matx_ScaleOp { ptr: x })
}
// identifier: cv_Matx_ScaleOp_Matx_ScaleOp_Matx_ScaleOp_unnamed_arg
pub fn new_1(unnamed_arg: &core::Matx_ScaleOp) -> Result<core::Matx_ScaleOp> {
unsafe { sys::cv_core_cv_Matx_ScaleOp_Matx_ScaleOp_Matx_ScaleOp_unnamed_arg(unnamed_arg.as_raw_Matx_ScaleOp()) }.into_result().map(|x| core::Matx_ScaleOp { ptr: x })
}
}
// boxed class cv::Matx_SubOp
#[allow(dead_code)]
pub struct Matx_SubOp {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::Matx_SubOp {
fn drop(&mut self) {
unsafe { sys::cv_delete_Matx_SubOp(self.ptr) };
}
}
impl core::Matx_SubOp {
#[doc(hidden)] pub fn as_raw_Matx_SubOp(&self) -> *mut c_void { self.ptr }
}
impl Matx_SubOp {
// identifier: cv_Matx_SubOp_Matx_SubOp
pub fn new() -> Result<core::Matx_SubOp> {
unsafe { sys::cv_core_cv_Matx_SubOp_Matx_SubOp() }.into_result().map(|x| core::Matx_SubOp { ptr: x })
}
// identifier: cv_Matx_SubOp_Matx_SubOp_Matx_SubOp_unnamed_arg
pub fn new_1(unnamed_arg: &core::Matx_SubOp) -> Result<core::Matx_SubOp> {
unsafe { sys::cv_core_cv_Matx_SubOp_Matx_SubOp_Matx_SubOp_unnamed_arg(unnamed_arg.as_raw_Matx_SubOp()) }.into_result().map(|x| core::Matx_SubOp { ptr: x })
}
}
// boxed class cv::Matx_TOp
#[allow(dead_code)]
pub struct Matx_TOp {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::Matx_TOp {
fn drop(&mut self) {
unsafe { sys::cv_delete_Matx_TOp(self.ptr) };
}
}
impl core::Matx_TOp {
#[doc(hidden)] pub fn as_raw_Matx_TOp(&self) -> *mut c_void { self.ptr }
}
impl Matx_TOp {
// identifier: cv_Matx_TOp_Matx_TOp
pub fn new() -> Result<core::Matx_TOp> {
unsafe { sys::cv_core_cv_Matx_TOp_Matx_TOp() }.into_result().map(|x| core::Matx_TOp { ptr: x })
}
// identifier: cv_Matx_TOp_Matx_TOp_Matx_TOp_unnamed_arg
pub fn new_1(unnamed_arg: &core::Matx_TOp) -> Result<core::Matx_TOp> {
unsafe { sys::cv_core_cv_Matx_TOp_Matx_TOp_Matx_TOp_unnamed_arg(unnamed_arg.as_raw_Matx_TOp()) }.into_result().map(|x| core::Matx_TOp { ptr: x })
}
}
// boxed class cv::MercatorWarper
#[allow(dead_code)]
pub struct MercatorWarper {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::MercatorWarper {
fn drop(&mut self) {
unsafe { sys::cv_delete_MercatorWarper(self.ptr) };
}
}
impl core::MercatorWarper {
#[doc(hidden)] pub fn as_raw_MercatorWarper(&self) -> *mut c_void { self.ptr }
}
impl core::WarperCreator for MercatorWarper {
#[doc(hidden)] fn as_raw_WarperCreator(&self) -> *mut c_void { self.ptr }
}
impl MercatorWarper {
}
// Generating impl for trait cv::MergeDebevec (trait)
/// The resulting HDR image is calculated as weighted average of the exposures considering exposure
/// values and camera response.
///
/// For more information see @cite DM97 .
pub trait MergeDebevec : core::MergeExposures {
#[doc(hidden)] fn as_raw_MergeDebevec(&self) -> *mut c_void;
// identifier: cv_MergeDebevec_process_VectorOfMat_src_Mat_dst_Mat_times_Mat_response
fn process_with_response(&mut self, src: &types::VectorOfMat, dst: &mut core::Mat, times: &core::Mat, response: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_MergeDebevec_process_VectorOfMat_src_Mat_dst_Mat_times_Mat_response(self.as_raw_MergeDebevec(), src.as_raw_VectorOfMat(), dst.as_raw_Mat(), times.as_raw_Mat(), response.as_raw_Mat()) }.into_result()
}
// identifier: cv_MergeDebevec_process_VectorOfMat_src_Mat_dst_Mat_times
fn process(&mut self, src: &types::VectorOfMat, dst: &mut core::Mat, times: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_MergeDebevec_process_VectorOfMat_src_Mat_dst_Mat_times(self.as_raw_MergeDebevec(), src.as_raw_VectorOfMat(), dst.as_raw_Mat(), times.as_raw_Mat()) }.into_result()
}
}
impl<'a> MergeDebevec + 'a {
}
// Generating impl for trait cv::MergeExposures (trait)
/// The base class algorithms that can merge exposure sequence to a single image.
pub trait MergeExposures : core::Algorithm {
#[doc(hidden)] fn as_raw_MergeExposures(&self) -> *mut c_void;
// identifier: cv_MergeExposures_process_VectorOfMat_src_Mat_dst_Mat_times_Mat_response
/// Merges images.
///
/// ## Parameters
/// * src: vector of input images
/// * dst: result image
/// * times: vector of exposure time values for each image
/// * response: 256x1 matrix with inverse camera response function for each pixel value, it should
/// have the same number of channels as images.
fn process(&mut self, src: &types::VectorOfMat, dst: &mut core::Mat, times: &core::Mat, response: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_MergeExposures_process_VectorOfMat_src_Mat_dst_Mat_times_Mat_response(self.as_raw_MergeExposures(), src.as_raw_VectorOfMat(), dst.as_raw_Mat(), times.as_raw_Mat(), response.as_raw_Mat()) }.into_result()
}
}
impl<'a> MergeExposures + 'a {
}
// Generating impl for trait cv::MergeMertens (trait)
/// Pixels are weighted using contrast, saturation and well-exposedness measures, than images are
/// combined using laplacian pyramids.
///
/// The resulting image weight is constructed as weighted average of contrast, saturation and
/// well-exposedness measures.
///
/// The resulting image doesn't require tonemapping and can be converted to 8-bit image by multiplying
/// by 255, but it's recommended to apply gamma correction and/or linear tonemapping.
///
/// For more information see @cite MK07 .
pub trait MergeMertens : core::MergeExposures {
#[doc(hidden)] fn as_raw_MergeMertens(&self) -> *mut c_void;
// identifier: cv_MergeMertens_process_VectorOfMat_src_Mat_dst_Mat_times_Mat_response
fn process_with_response(&mut self, src: &types::VectorOfMat, dst: &mut core::Mat, times: &core::Mat, response: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_MergeMertens_process_VectorOfMat_src_Mat_dst_Mat_times_Mat_response(self.as_raw_MergeMertens(), src.as_raw_VectorOfMat(), dst.as_raw_Mat(), times.as_raw_Mat(), response.as_raw_Mat()) }.into_result()
}
// identifier: cv_MergeMertens_process_VectorOfMat_src_Mat_dst
/// Short version of process, that doesn't take extra arguments.
///
/// ## Parameters
/// * src: vector of input images
/// * dst: result image
fn process(&mut self, src: &types::VectorOfMat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_MergeMertens_process_VectorOfMat_src_Mat_dst(self.as_raw_MergeMertens(), src.as_raw_VectorOfMat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_MergeMertens_getContrastWeight_const
fn get_contrast_weight(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_MergeMertens_getContrastWeight_const(self.as_raw_MergeMertens()) }.into_result()
}
// identifier: cv_MergeMertens_setContrastWeight_float_contrast_weiht
fn set_contrast_weight(&mut self, contrast_weiht: f32) -> Result<()> {
unsafe { sys::cv_core_cv_MergeMertens_setContrastWeight_float_contrast_weiht(self.as_raw_MergeMertens(), contrast_weiht) }.into_result()
}
// identifier: cv_MergeMertens_getSaturationWeight_const
fn get_saturation_weight(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_MergeMertens_getSaturationWeight_const(self.as_raw_MergeMertens()) }.into_result()
}
// identifier: cv_MergeMertens_setSaturationWeight_float_saturation_weight
fn set_saturation_weight(&mut self, saturation_weight: f32) -> Result<()> {
unsafe { sys::cv_core_cv_MergeMertens_setSaturationWeight_float_saturation_weight(self.as_raw_MergeMertens(), saturation_weight) }.into_result()
}
// identifier: cv_MergeMertens_getExposureWeight_const
fn get_exposure_weight(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_MergeMertens_getExposureWeight_const(self.as_raw_MergeMertens()) }.into_result()
}
// identifier: cv_MergeMertens_setExposureWeight_float_exposure_weight
fn set_exposure_weight(&mut self, exposure_weight: f32) -> Result<()> {
unsafe { sys::cv_core_cv_MergeMertens_setExposureWeight_float_exposure_weight(self.as_raw_MergeMertens(), exposure_weight) }.into_result()
}
}
impl<'a> MergeMertens + 'a {
}
// Generating impl for trait cv::MergeRobertson (trait)
/// The resulting HDR image is calculated as weighted average of the exposures considering exposure
/// values and camera response.
///
/// For more information see @cite RB99 .
pub trait MergeRobertson : core::MergeExposures {
#[doc(hidden)] fn as_raw_MergeRobertson(&self) -> *mut c_void;
// identifier: cv_MergeRobertson_process_VectorOfMat_src_Mat_dst_Mat_times_Mat_response
fn process_with_response(&mut self, src: &types::VectorOfMat, dst: &mut core::Mat, times: &core::Mat, response: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_MergeRobertson_process_VectorOfMat_src_Mat_dst_Mat_times_Mat_response(self.as_raw_MergeRobertson(), src.as_raw_VectorOfMat(), dst.as_raw_Mat(), times.as_raw_Mat(), response.as_raw_Mat()) }.into_result()
}
// identifier: cv_MergeRobertson_process_VectorOfMat_src_Mat_dst_Mat_times
fn process(&mut self, src: &types::VectorOfMat, dst: &mut core::Mat, times: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_MergeRobertson_process_VectorOfMat_src_Mat_dst_Mat_times(self.as_raw_MergeRobertson(), src.as_raw_VectorOfMat(), dst.as_raw_Mat(), times.as_raw_Mat()) }.into_result()
}
}
impl<'a> MergeRobertson + 'a {
}
// Generating impl for trait cv::MinProblemSolver (trait)
/// Basic interface for all solvers
pub trait MinProblemSolver : core::Algorithm {
#[doc(hidden)] fn as_raw_MinProblemSolver(&self) -> *mut c_void;
// identifier: cv_MinProblemSolver_getFunction_const
/// Getter for the optimized function.
///
/// The optimized function is represented by Function interface, which requires derivatives to
/// implement the calc(double*) and getDim() methods to evaluate the function.
///
/// @return Smart-pointer to an object that implements Function interface - it represents the
/// function that is being optimized. It can be empty, if no function was given so far.
fn get_function(&self) -> Result<types::PtrOfFunction> {
unsafe { sys::cv_core_cv_MinProblemSolver_getFunction_const(self.as_raw_MinProblemSolver()) }.into_result().map(|x| types::PtrOfFunction { ptr: x })
}
// identifier: cv_MinProblemSolver_setFunction_PtrOfFunction_f
/// Setter for the optimized function.
///
/// *It should be called at least once before the call to* minimize(), as default value is not usable.
///
/// ## Parameters
/// * f: The new function to optimize.
fn set_function(&mut self, f: &types::PtrOfFunction) -> Result<()> {
unsafe { sys::cv_core_cv_MinProblemSolver_setFunction_PtrOfFunction_f(self.as_raw_MinProblemSolver(), f.as_raw_PtrOfFunction()) }.into_result()
}
// identifier: cv_MinProblemSolver_getTermCriteria_const
/// Getter for the previously set terminal criteria for this algorithm.
///
/// @return Deep copy of the terminal criteria used at the moment.
fn get_term_criteria(&self) -> Result<core::TermCriteria> {
unsafe { sys::cv_core_cv_MinProblemSolver_getTermCriteria_const(self.as_raw_MinProblemSolver()) }.into_result().map(|x| core::TermCriteria { ptr: x })
}
// identifier: cv_MinProblemSolver_setTermCriteria_TermCriteria_termcrit
/// Set terminal criteria for solver.
///
/// This method *is not necessary* to be called before the first call to minimize(), as the default
/// value is sensible.
///
/// Algorithm stops when the number of function evaluations done exceeds termcrit.maxCount, when
/// the function values at the vertices of simplex are within termcrit.epsilon range or simplex
/// becomes so small that it can enclosed in a box with termcrit.epsilon sides, whatever comes
/// first.
/// ## Parameters
/// * termcrit: Terminal criteria to be used, represented as cv::TermCriteria structure.
fn set_term_criteria(&mut self, termcrit: &core::TermCriteria) -> Result<()> {
unsafe { sys::cv_core_cv_MinProblemSolver_setTermCriteria_TermCriteria_termcrit(self.as_raw_MinProblemSolver(), termcrit.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_MinProblemSolver_minimize_Mat_x
/// actually runs the algorithm and performs the minimization.
///
/// The sole input parameter determines the centroid of the starting simplex (roughly, it tells
/// where to start), all the others (terminal criteria, initial step, function to be minimized) are
/// supposed to be set via the setters before the call to this method or the default values (not
/// always sensible) will be used.
///
/// ## Parameters
/// * x: The initial point, that will become a centroid of an initial simplex. After the algorithm
/// will terminate, it will be set to the point where the algorithm stops, the point of possible
/// minimum.
/// @return The value of a function at the point found.
fn minimize(&mut self, x: &mut core::Mat) -> Result<f64> {
unsafe { sys::cv_core_cv_MinProblemSolver_minimize_Mat_x(self.as_raw_MinProblemSolver(), x.as_raw_Mat()) }.into_result()
}
}
impl<'a> MinProblemSolver + 'a {
}
// Generating impl for trait cv::MinProblemSolver::Function (trait)
/// Represents function being optimized
pub trait MinProblemSolver_Function {
#[doc(hidden)] fn as_raw_MinProblemSolver_Function(&self) -> *mut c_void;
// identifier: cv_MinProblemSolver_Function_getDims_const
fn get_dims(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_MinProblemSolver_Function_getDims_const(self.as_raw_MinProblemSolver_Function()) }.into_result()
}
// identifier: cv_MinProblemSolver_Function_getGradientEps_const
fn get_gradient_eps(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_MinProblemSolver_Function_getGradientEps_const(self.as_raw_MinProblemSolver_Function()) }.into_result()
}
// identifier: cv_MinProblemSolver_Function_calc_const_const_double_X_x
fn calc(&self, x: &f64) -> Result<f64> {
unsafe { sys::cv_core_cv_MinProblemSolver_Function_calc_const_const_double_X_x(self.as_raw_MinProblemSolver_Function(), x) }.into_result()
}
// identifier: cv_MinProblemSolver_Function_getGradient_const_double_X_x_double_X_grad
fn get_gradient(&mut self, x: &f64, grad: &mut f64) -> Result<()> {
unsafe { sys::cv_core_cv_MinProblemSolver_Function_getGradient_const_double_X_x_double_X_grad(self.as_raw_MinProblemSolver_Function(), x, grad) }.into_result()
}
}
impl<'a> MinProblemSolver_Function + 'a {
}
impl Moments {
// identifier: cv_Moments_Moments
pub fn default() -> Result<core::Moments> {
unsafe { sys::cv_core_cv_Moments_Moments() }.into_result()
}
// identifier: cv_Moments_Moments_double_m00_double_m10_double_m01_double_m20_double_m11_double_m02_double_m30_double_m21_double_m12_double_m03
pub fn new(m00: f64, m10: f64, m01: f64, m20: f64, m11: f64, m02: f64, m30: f64, m21: f64, m12: f64, m03: f64) -> Result<core::Moments> {
unsafe { sys::cv_core_cv_Moments_Moments_double_m00_double_m10_double_m01_double_m20_double_m11_double_m02_double_m30_double_m21_double_m12_double_m03(m00, m10, m01, m20, m11, m02, m30, m21, m12, m03) }.into_result()
}
}
// boxed class cv::Mutex
#[allow(dead_code)]
pub struct Mutex {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::Mutex {
fn drop(&mut self) {
unsafe { sys::cv_delete_Mutex(self.ptr) };
}
}
impl core::Mutex {
#[doc(hidden)] pub fn as_raw_Mutex(&self) -> *mut c_void { self.ptr }
}
impl Mutex {
// identifier: cv_Mutex_Mutex
pub fn new() -> Result<core::Mutex> {
unsafe { sys::cv_core_cv_Mutex_Mutex() }.into_result().map(|x| core::Mutex { ptr: x })
}
// identifier: cv_Mutex_Mutex_Mutex_m
pub fn new_1(m: &core::Mutex) -> Result<core::Mutex> {
unsafe { sys::cv_core_cv_Mutex_Mutex_Mutex_m(m.as_raw_Mutex()) }.into_result().map(|x| core::Mutex { ptr: x })
}
// identifier: cv_Mutex_lock
pub fn lock(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_Mutex_lock(self.as_raw_Mutex()) }.into_result()
}
// identifier: cv_Mutex_trylock
pub fn trylock(&mut self) -> Result<bool> {
unsafe { sys::cv_core_cv_Mutex_trylock(self.as_raw_Mutex()) }.into_result()
}
// identifier: cv_Mutex_unlock
pub fn unlock(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_Mutex_unlock(self.as_raw_Mutex()) }.into_result()
}
}
// boxed class cv::NAryMatIterator
/// n-ary multi-dimensional array iterator.
///
/// Use the class to implement unary, binary, and, generally, n-ary element-wise operations on
/// multi-dimensional arrays. Some of the arguments of an n-ary function may be continuous arrays, some
/// may be not. It is possible to use conventional MatIterator 's for each array but incrementing all of
/// the iterators after each small operations may be a big overhead. In this case consider using
/// NAryMatIterator to iterate through several matrices simultaneously as long as they have the same
/// geometry (dimensionality and all the dimension sizes are the same). On each iteration `it.planes[0]`,
/// `it.planes[1]`,... will be the slices of the corresponding matrices.
///
/// The example below illustrates how you can compute a normalized and threshold 3D color histogram:
/// ```ignore
/// void computeNormalizedColorHist(const Mat& image, Mat& hist, int N, double minProb)
/// {
/// const int histSize[] = {N, N, N};
///
/// // make sure that the histogram has a proper size and type
/// hist.create(3, histSize, CV_32F);
///
/// // and clear it
/// hist = Scalar(0);
///
/// // the loop below assumes that the image
/// // is a 8-bit 3-channel. check it.
/// CV_Assert(image.type() == CV_8UC3);
/// MatConstIterator_<Vec3b> it = image.begin<Vec3b>(),
/// it_end = image.end<Vec3b>();
/// for( ; it != it_end; ++it )
/// {
/// const Vec3b& pix = *it;
/// hist.at<float>(pix[0]*N/256, pix[1]*N/256, pix[2]*N/256) += 1.f;
/// }
///
/// minProb *= image.rows*image.cols;
///
/// // initialize iterator (the style is different from STL).
/// // after initialization the iterator will contain
/// // the number of slices or planes the iterator will go through.
/// // it simultaneously increments iterators for several matrices
/// // supplied as a null terminated list of pointers
/// const Mat* arrays[] = {&hist, 0};
/// Mat planes[1];
/// NAryMatIterator itNAry(arrays, planes, 1);
/// double s = 0;
/// // iterate through the matrix. on each iteration
/// // itNAry.planes[i] (of type Mat) will be set to the current plane
/// // of the i-th n-dim matrix passed to the iterator constructor.
/// for(int p = 0; p < itNAry.nplanes; p++, ++itNAry)
/// {
/// threshold(itNAry.planes[0], itNAry.planes[0], minProb, 0, THRESH_TOZERO);
/// s += sum(itNAry.planes[0])[0];
/// }
///
/// s = 1./s;
/// itNAry = NAryMatIterator(arrays, planes, 1);
/// for(int p = 0; p < itNAry.nplanes; p++, ++itNAry)
/// itNAry.planes[0] *= s;
/// }
/// ```
#[allow(dead_code)]
pub struct NAryMatIterator {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::NAryMatIterator {
fn drop(&mut self) {
unsafe { sys::cv_delete_NAryMatIterator(self.ptr) };
}
}
impl core::NAryMatIterator {
#[doc(hidden)] pub fn as_raw_NAryMatIterator(&self) -> *mut c_void { self.ptr }
}
impl NAryMatIterator {
// identifier: cv_NAryMatIterator_NAryMatIterator
pub fn new() -> Result<core::NAryMatIterator> {
unsafe { sys::cv_core_cv_NAryMatIterator_NAryMatIterator() }.into_result().map(|x| core::NAryMatIterator { ptr: x })
}
}
// Generating impl for trait cv::NormHistogramCostExtractor (trait)
/// A norm based cost extraction. :
pub trait NormHistogramCostExtractor : core::HistogramCostExtractor {
#[doc(hidden)] fn as_raw_NormHistogramCostExtractor(&self) -> *mut c_void;
// identifier: cv_NormHistogramCostExtractor_setNormFlag_int_flag
fn set_norm_flag(&mut self, flag: i32) -> Result<()> {
unsafe { sys::cv_core_cv_NormHistogramCostExtractor_setNormFlag_int_flag(self.as_raw_NormHistogramCostExtractor(), flag) }.into_result()
}
// identifier: cv_NormHistogramCostExtractor_getNormFlag_const
fn get_norm_flag(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_NormHistogramCostExtractor_getNormFlag_const(self.as_raw_NormHistogramCostExtractor()) }.into_result()
}
}
impl<'a> NormHistogramCostExtractor + 'a {
}
// Generating impl for trait cv::ORB (trait)
/// Class implementing the ORB (*oriented BRIEF*) keypoint detector and descriptor extractor
///
/// described in @cite RRKB11 . The algorithm uses FAST in pyramids to detect stable keypoints, selects
/// the strongest features using FAST or Harris response, finds their orientation using first-order
/// moments and computes the descriptors using BRIEF (where the coordinates of random point pairs (or
/// k-tuples) are rotated according to the measured orientation).
pub trait ORB : core::Feature2D {
#[doc(hidden)] fn as_raw_ORB(&self) -> *mut c_void;
// identifier: cv_ORB_setMaxFeatures_int_maxFeatures
fn set_max_features(&mut self, max_features: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ORB_setMaxFeatures_int_maxFeatures(self.as_raw_ORB(), max_features) }.into_result()
}
// identifier: cv_ORB_getMaxFeatures_const
fn get_max_features(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ORB_getMaxFeatures_const(self.as_raw_ORB()) }.into_result()
}
// identifier: cv_ORB_setScaleFactor_double_scaleFactor
fn set_scale_factor(&mut self, scale_factor: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ORB_setScaleFactor_double_scaleFactor(self.as_raw_ORB(), scale_factor) }.into_result()
}
// identifier: cv_ORB_getScaleFactor_const
fn get_scale_factor(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ORB_getScaleFactor_const(self.as_raw_ORB()) }.into_result()
}
// identifier: cv_ORB_setNLevels_int_nlevels
fn set_n_levels(&mut self, nlevels: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ORB_setNLevels_int_nlevels(self.as_raw_ORB(), nlevels) }.into_result()
}
// identifier: cv_ORB_getNLevels_const
fn get_n_levels(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ORB_getNLevels_const(self.as_raw_ORB()) }.into_result()
}
// identifier: cv_ORB_setEdgeThreshold_int_edgeThreshold
fn set_edge_threshold(&mut self, edge_threshold: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ORB_setEdgeThreshold_int_edgeThreshold(self.as_raw_ORB(), edge_threshold) }.into_result()
}
// identifier: cv_ORB_getEdgeThreshold_const
fn get_edge_threshold(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ORB_getEdgeThreshold_const(self.as_raw_ORB()) }.into_result()
}
// identifier: cv_ORB_setFirstLevel_int_firstLevel
fn set_first_level(&mut self, first_level: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ORB_setFirstLevel_int_firstLevel(self.as_raw_ORB(), first_level) }.into_result()
}
// identifier: cv_ORB_getFirstLevel_const
fn get_first_level(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ORB_getFirstLevel_const(self.as_raw_ORB()) }.into_result()
}
// identifier: cv_ORB_setWTA_K_int_wta_k
fn set_wta_k(&mut self, wta_k: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ORB_setWTA_K_int_wta_k(self.as_raw_ORB(), wta_k) }.into_result()
}
// identifier: cv_ORB_getWTA_K_const
fn get_wta_k(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ORB_getWTA_K_const(self.as_raw_ORB()) }.into_result()
}
// identifier: cv_ORB_setScoreType_int_scoreType
fn set_score_type(&mut self, score_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ORB_setScoreType_int_scoreType(self.as_raw_ORB(), score_type) }.into_result()
}
// identifier: cv_ORB_getScoreType_const
fn get_score_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ORB_getScoreType_const(self.as_raw_ORB()) }.into_result()
}
// identifier: cv_ORB_setPatchSize_int_patchSize
fn set_patch_size(&mut self, patch_size: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ORB_setPatchSize_int_patchSize(self.as_raw_ORB(), patch_size) }.into_result()
}
// identifier: cv_ORB_getPatchSize_const
fn get_patch_size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ORB_getPatchSize_const(self.as_raw_ORB()) }.into_result()
}
// identifier: cv_ORB_setFastThreshold_int_fastThreshold
fn set_fast_threshold(&mut self, fast_threshold: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ORB_setFastThreshold_int_fastThreshold(self.as_raw_ORB(), fast_threshold) }.into_result()
}
// identifier: cv_ORB_getFastThreshold_const
fn get_fast_threshold(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ORB_getFastThreshold_const(self.as_raw_ORB()) }.into_result()
}
// identifier: cv_ORB_getDefaultName_const
fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_core_cv_ORB_getDefaultName_const(self.as_raw_ORB()) }.into_result().map(crate::templ::receive_string_mut)
}
}
impl<'a> ORB + 'a {
// identifier: cv_ORB_create_int_nfeatures_float_scaleFactor_int_nlevels_int_edgeThreshold_int_firstLevel_int_WTA_K_int_scoreType_int_patchSize_int_fastThreshold
/// The ORB constructor
///
/// ## Parameters
/// * nfeatures: The maximum number of features to retain.
/// * scaleFactor: Pyramid decimation ratio, greater than 1. scaleFactor==2 means the classical
/// pyramid, where each next level has 4x less pixels than the previous, but such a big scale factor
/// will degrade feature matching scores dramatically. On the other hand, too close to 1 scale factor
/// will mean that to cover certain scale range you will need more pyramid levels and so the speed
/// will suffer.
/// * nlevels: The number of pyramid levels. The smallest level will have linear size equal to
/// input_image_linear_size/pow(scaleFactor, nlevels - firstLevel).
/// * edgeThreshold: This is size of the border where the features are not detected. It should
/// roughly match the patchSize parameter.
/// * firstLevel: The level of pyramid to put source image to. Previous layers are filled
/// with upscaled source image.
/// * WTA_K: The number of points that produce each element of the oriented BRIEF descriptor. The
/// default value 2 means the BRIEF where we take a random point pair and compare their brightnesses,
/// so we get 0/1 response. Other possible values are 3 and 4. For example, 3 means that we take 3
/// random points (of course, those point coordinates are random, but they are generated from the
/// pre-defined seed, so each element of BRIEF descriptor is computed deterministically from the pixel
/// rectangle), find point of maximum brightness and output index of the winner (0, 1 or 2). Such
/// output will occupy 2 bits, and therefore it will need a special variant of Hamming distance,
/// denoted as NORM_HAMMING2 (2 bits per bin). When WTA_K=4, we take 4 random points to compute each
/// bin (that will also occupy 2 bits with possible values 0, 1, 2 or 3).
/// * scoreType: The default HARRIS_SCORE means that Harris algorithm is used to rank features
/// (the score is written to KeyPoint::score and is used to retain best nfeatures features);
/// FAST_SCORE is alternative value of the parameter that produces slightly less stable keypoints,
/// but it is a little faster to compute.
/// * patchSize: size of the patch used by the oriented BRIEF descriptor. Of course, on smaller
/// pyramid layers the perceived image area covered by a feature will be larger.
/// @param fastThreshold
///
/// ## C++ default parameters:
/// * nfeatures: 500
/// * scale_factor: 1.2f
/// * nlevels: 8
/// * edge_threshold: 31
/// * first_level: 0
/// * wta_k: 2
/// * score_type: ORB::HARRIS_SCORE
/// * patch_size: 31
/// * fast_threshold: 20
pub fn create(nfeatures: i32, scale_factor: f32, nlevels: i32, edge_threshold: i32, first_level: i32, wta_k: i32, score_type: i32, patch_size: i32, fast_threshold: i32) -> Result<types::PtrOfORB> {
unsafe { sys::cv_core_cv_ORB_create_int_nfeatures_float_scaleFactor_int_nlevels_int_edgeThreshold_int_firstLevel_int_WTA_K_int_scoreType_int_patchSize_int_fastThreshold(nfeatures, scale_factor, nlevels, edge_threshold, first_level, wta_k, score_type, patch_size, fast_threshold) }.into_result().map(|x| types::PtrOfORB { ptr: x })
}
}
// boxed class cv::PCA
/// Principal Component Analysis
///
/// The class is used to calculate a special basis for a set of vectors. The
/// basis will consist of eigenvectors of the covariance matrix calculated
/// from the input set of vectors. The class %PCA can also transform
/// vectors to/from the new coordinate space defined by the basis. Usually,
/// in this new coordinate system, each vector from the original set (and
/// any linear combination of such vectors) can be quite accurately
/// approximated by taking its first few components, corresponding to the
/// eigenvectors of the largest eigenvalues of the covariance matrix.
/// Geometrically it means that you calculate a projection of the vector to
/// a subspace formed by a few eigenvectors corresponding to the dominant
/// eigenvalues of the covariance matrix. And usually such a projection is
/// very close to the original vector. So, you can represent the original
/// vector from a high-dimensional space with a much shorter vector
/// consisting of the projected vector's coordinates in the subspace. Such a
/// transformation is also known as Karhunen-Loeve Transform, or KLT.
/// See http://en.wikipedia.org/wiki/Principal_component_analysis
///
/// The sample below is the function that takes two matrices. The first
/// function stores a set of vectors (a row per vector) that is used to
/// calculate PCA. The second function stores another "test" set of vectors
/// (a row per vector). First, these vectors are compressed with PCA, then
/// reconstructed back, and then the reconstruction error norm is computed
/// and printed for each vector. :
///
/// ```ignore{.cpp}
/// using namespace cv;
///
/// PCA compressPCA(const Mat& pcaset, int maxComponents,
/// const Mat& testset, Mat& compressed)
/// {
/// PCA pca(pcaset, // pass the data
/// Mat(), // we do not have a pre-computed mean vector,
/// // so let the PCA engine to compute it
/// PCA::DATA_AS_ROW, // indicate that the vectors
/// // are stored as matrix rows
/// // (use PCA::DATA_AS_COL if the vectors are
/// // the matrix columns)
/// maxComponents // specify, how many principal components to retain
/// );
/// // if there is no test data, just return the computed basis, ready-to-use
/// if( !testset.data )
/// return pca;
/// CV_Assert( testset.cols == pcaset.cols );
///
/// compressed.create(testset.rows, maxComponents, testset.type());
///
/// Mat reconstructed;
/// for( int i = 0; i < testset.rows; i++ )
/// {
/// Mat vec = testset.row(i), coeffs = compressed.row(i), reconstructed;
/// // compress the vector, the result will be stored
/// // in the i-th row of the output matrix
/// pca.project(vec, coeffs);
/// // and then reconstruct it
/// pca.backProject(coeffs, reconstructed);
/// // and measure the error
/// printf("%d. diff = %g\n", i, norm(vec, reconstructed, NORM_L2));
/// }
/// return pca;
/// }
/// ```
///
/// @sa calcCovarMatrix, mulTransposed, SVD, dft, dct
#[allow(dead_code)]
pub struct PCA {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::PCA {
fn drop(&mut self) {
unsafe { sys::cv_delete_PCA(self.ptr) };
}
}
impl core::PCA {
#[doc(hidden)] pub fn as_raw_PCA(&self) -> *mut c_void { self.ptr }
}
impl PCA {
// identifier: cv_PCA_PCA
/// default constructor
///
/// The default constructor initializes an empty %PCA structure. The other
/// constructors initialize the structure and call PCA::operator()().
pub fn default() -> Result<core::PCA> {
unsafe { sys::cv_core_cv_PCA_PCA() }.into_result().map(|x| core::PCA { ptr: x })
}
// identifier: cv_PCA_PCA_Mat_data_Mat_mean_int_flags_int_maxComponents
/// @overload
/// ## Parameters
/// * data: input samples stored as matrix rows or matrix columns.
/// * mean: optional mean value; if the matrix is empty (@c noArray()),
/// the mean is computed from the data.
/// * flags: operation flags; currently the parameter is only used to
/// specify the data layout (PCA::Flags)
/// * maxComponents: maximum number of components that %PCA should
/// retain; by default, all the components are retained.
///
/// ## C++ default parameters:
/// * max_components: 0
pub fn new_mat_max(data: &core::Mat, mean: &core::Mat, flags: i32, max_components: i32) -> Result<core::PCA> {
unsafe { sys::cv_core_cv_PCA_PCA_Mat_data_Mat_mean_int_flags_int_maxComponents(data.as_raw_Mat(), mean.as_raw_Mat(), flags, max_components) }.into_result().map(|x| core::PCA { ptr: x })
}
// identifier: cv_PCA_PCA_Mat_data_Mat_mean_int_flags_double_retainedVariance
/// @overload
/// ## Parameters
/// * data: input samples stored as matrix rows or matrix columns.
/// * mean: optional mean value; if the matrix is empty (noArray()),
/// the mean is computed from the data.
/// * flags: operation flags; currently the parameter is only used to
/// specify the data layout (PCA::Flags)
/// * retainedVariance: Percentage of variance that PCA should retain.
/// Using this parameter will let the PCA decided how many components to
/// retain but it will always keep at least 2.
pub fn new_mat_variance(data: &core::Mat, mean: &core::Mat, flags: i32, retained_variance: f64) -> Result<core::PCA> {
unsafe { sys::cv_core_cv_PCA_PCA_Mat_data_Mat_mean_int_flags_double_retainedVariance(data.as_raw_Mat(), mean.as_raw_Mat(), flags, retained_variance) }.into_result().map(|x| core::PCA { ptr: x })
}
// identifier: cv_PCA_project_const_Mat_vec
/// Projects vector(s) to the principal component subspace.
///
/// The methods project one or more vectors to the principal component
/// subspace, where each vector projection is represented by coefficients in
/// the principal component basis. The first form of the method returns the
/// matrix that the second form writes to the result. So the first form can
/// be used as a part of expression while the second form can be more
/// efficient in a processing loop.
/// ## Parameters
/// * vec: input vector(s); must have the same dimensionality and the
/// same layout as the input data used at %PCA phase, that is, if
/// DATA_AS_ROW are specified, then `vec.cols==data.cols`
/// (vector dimensionality) and `vec.rows` is the number of vectors to
/// project, and the same is true for the PCA::DATA_AS_COL case.
pub fn project(&self, vec: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_PCA_project_const_Mat_vec(self.as_raw_PCA(), vec.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_PCA_project_const_Mat_vec_Mat_result
/// @overload
/// ## Parameters
/// * vec: input vector(s); must have the same dimensionality and the
/// same layout as the input data used at PCA phase, that is, if
/// DATA_AS_ROW are specified, then `vec.cols==data.cols`
/// (vector dimensionality) and `vec.rows` is the number of vectors to
/// project, and the same is true for the PCA::DATA_AS_COL case.
/// * result: output vectors; in case of PCA::DATA_AS_COL, the
/// output matrix has as many columns as the number of input vectors, this
/// means that `result.cols==vec.cols` and the number of rows match the
/// number of principal components (for example, `maxComponents` parameter
/// passed to the constructor).
pub fn project_to(&self, vec: &core::Mat, result: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_PCA_project_const_Mat_vec_Mat_result(self.as_raw_PCA(), vec.as_raw_Mat(), result.as_raw_Mat()) }.into_result()
}
// identifier: cv_PCA_backProject_const_Mat_vec
/// Reconstructs vectors from their PC projections.
///
/// The methods are inverse operations to PCA::project. They take PC
/// coordinates of projected vectors and reconstruct the original vectors.
/// Unless all the principal components have been retained, the
/// reconstructed vectors are different from the originals. But typically,
/// the difference is small if the number of components is large enough (but
/// still much smaller than the original vector dimensionality). As a
/// result, PCA is used.
/// ## Parameters
/// * vec: coordinates of the vectors in the principal component
/// subspace, the layout and size are the same as of PCA::project output
/// vectors.
pub fn back_project(&self, vec: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_PCA_backProject_const_Mat_vec(self.as_raw_PCA(), vec.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_PCA_backProject_const_Mat_vec_Mat_result
/// @overload
/// ## Parameters
/// * vec: coordinates of the vectors in the principal component
/// subspace, the layout and size are the same as of PCA::project output
/// vectors.
/// * result: reconstructed vectors; the layout and size are the same as
/// of PCA::project input vectors.
pub fn back_project_to(&self, vec: &core::Mat, result: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_PCA_backProject_const_Mat_vec_Mat_result(self.as_raw_PCA(), vec.as_raw_Mat(), result.as_raw_Mat()) }.into_result()
}
}
// boxed class cv::PaniniPortraitWarper
#[allow(dead_code)]
pub struct PaniniPortraitWarper {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::PaniniPortraitWarper {
fn drop(&mut self) {
unsafe { sys::cv_delete_PaniniPortraitWarper(self.ptr) };
}
}
impl core::PaniniPortraitWarper {
#[doc(hidden)] pub fn as_raw_PaniniPortraitWarper(&self) -> *mut c_void { self.ptr }
}
impl core::WarperCreator for PaniniPortraitWarper {
#[doc(hidden)] fn as_raw_WarperCreator(&self) -> *mut c_void { self.ptr }
}
impl PaniniPortraitWarper {
// identifier: cv_PaniniPortraitWarper_PaniniPortraitWarper_float_A_float_B
///
/// ## C++ default parameters:
/// * a: 1
/// * b: 1
pub fn new(a: f32, b: f32) -> Result<core::PaniniPortraitWarper> {
unsafe { sys::cv_core_cv_PaniniPortraitWarper_PaniniPortraitWarper_float_A_float_B(a, b) }.into_result().map(|x| core::PaniniPortraitWarper { ptr: x })
}
}
// boxed class cv::PaniniWarper
#[allow(dead_code)]
pub struct PaniniWarper {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::PaniniWarper {
fn drop(&mut self) {
unsafe { sys::cv_delete_PaniniWarper(self.ptr) };
}
}
impl core::PaniniWarper {
#[doc(hidden)] pub fn as_raw_PaniniWarper(&self) -> *mut c_void { self.ptr }
}
impl core::WarperCreator for PaniniWarper {
#[doc(hidden)] fn as_raw_WarperCreator(&self) -> *mut c_void { self.ptr }
}
impl PaniniWarper {
// identifier: cv_PaniniWarper_PaniniWarper_float_A_float_B
///
/// ## C++ default parameters:
/// * a: 1
/// * b: 1
pub fn new(a: f32, b: f32) -> Result<core::PaniniWarper> {
unsafe { sys::cv_core_cv_PaniniWarper_PaniniWarper_float_A_float_B(a, b) }.into_result().map(|x| core::PaniniWarper { ptr: x })
}
}
// Generating impl for trait cv::ParallelLoopBody (trait)
/// Base class for parallel data processors
pub trait ParallelLoopBody {
#[doc(hidden)] fn as_raw_ParallelLoopBody(&self) -> *mut c_void;
}
impl<'a> ParallelLoopBody + 'a {
}
// boxed class cv::ParallelLoopBodyLambdaWrapper
#[allow(dead_code)]
pub struct ParallelLoopBodyLambdaWrapper {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ParallelLoopBodyLambdaWrapper {
fn drop(&mut self) {
unsafe { sys::cv_delete_ParallelLoopBodyLambdaWrapper(self.ptr) };
}
}
impl core::ParallelLoopBodyLambdaWrapper {
#[doc(hidden)] pub fn as_raw_ParallelLoopBodyLambdaWrapper(&self) -> *mut c_void { self.ptr }
}
impl core::ParallelLoopBody for ParallelLoopBodyLambdaWrapper {
#[doc(hidden)] fn as_raw_ParallelLoopBody(&self) -> *mut c_void { self.ptr }
}
// boxed class cv::Param
#[allow(dead_code)]
pub struct Param {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::Param {
fn drop(&mut self) {
unsafe { sys::cv_delete_Param(self.ptr) };
}
}
impl core::Param {
#[doc(hidden)] pub fn as_raw_Param(&self) -> *mut c_void { self.ptr }
}
// boxed class cv::PlaneWarper
/// Plane warper factory class.
/// @sa detail::PlaneWarper
#[allow(dead_code)]
pub struct PlaneWarper {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::PlaneWarper {
fn drop(&mut self) {
unsafe { sys::cv_delete_PlaneWarper(self.ptr) };
}
}
impl core::PlaneWarper {
#[doc(hidden)] pub fn as_raw_PlaneWarper(&self) -> *mut c_void { self.ptr }
}
impl core::WarperCreator for PlaneWarper {
#[doc(hidden)] fn as_raw_WarperCreator(&self) -> *mut c_void { self.ptr }
}
impl PlaneWarper {
}
// boxed class cv::QRCodeDetector
#[allow(dead_code)]
pub struct QRCodeDetector {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::QRCodeDetector {
fn drop(&mut self) {
unsafe { sys::cv_delete_QRCodeDetector(self.ptr) };
}
}
impl core::QRCodeDetector {
#[doc(hidden)] pub fn as_raw_QRCodeDetector(&self) -> *mut c_void { self.ptr }
}
impl QRCodeDetector {
// identifier: cv_QRCodeDetector_QRCodeDetector
pub fn new() -> Result<core::QRCodeDetector> {
unsafe { sys::cv_core_cv_QRCodeDetector_QRCodeDetector() }.into_result().map(|x| core::QRCodeDetector { ptr: x })
}
// identifier: cv_QRCodeDetector_setEpsX_double_epsX
/// sets the epsilon used during the horizontal scan of QR code stop marker detection.
/// ## Parameters
/// * epsX: Epsilon neighborhood, which allows you to determine the horizontal pattern
/// of the scheme 1:1:3:1:1 according to QR code standard.
pub fn set_eps_x(&mut self, eps_x: f64) -> Result<()> {
unsafe { sys::cv_core_cv_QRCodeDetector_setEpsX_double_epsX(self.as_raw_QRCodeDetector(), eps_x) }.into_result()
}
// identifier: cv_QRCodeDetector_setEpsY_double_epsY
/// sets the epsilon used during the vertical scan of QR code stop marker detection.
/// ## Parameters
/// * epsY: Epsilon neighborhood, which allows you to determine the vertical pattern
/// of the scheme 1:1:3:1:1 according to QR code standard.
pub fn set_eps_y(&mut self, eps_y: f64) -> Result<()> {
unsafe { sys::cv_core_cv_QRCodeDetector_setEpsY_double_epsY(self.as_raw_QRCodeDetector(), eps_y) }.into_result()
}
// identifier: cv_QRCodeDetector_detect_const_Mat_img_Mat_points
/// Detects QR code in image and returns the quadrangle containing the code.
/// ## Parameters
/// * img: grayscale or color (BGR) image containing (or not) QR code.
/// * points: Output vector of vertices of the minimum-area quadrangle containing the code.
pub fn detect(&self, img: &core::Mat, points: &mut core::Mat) -> Result<bool> {
unsafe { sys::cv_core_cv_QRCodeDetector_detect_const_Mat_img_Mat_points(self.as_raw_QRCodeDetector(), img.as_raw_Mat(), points.as_raw_Mat()) }.into_result()
}
}
// boxed class cv::QtFont
/// QtFont available only for Qt. See cv::fontQt
#[allow(dead_code)]
pub struct QtFont {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::QtFont {
fn drop(&mut self) {
unsafe { sys::cv_delete_QtFont(self.ptr) };
}
}
impl core::QtFont {
#[doc(hidden)] pub fn as_raw_QtFont(&self) -> *mut c_void { self.ptr }
}
// Generating impl for trait cv::Range (trait)
/// Template class specifying a continuous subsequence (slice) of a sequence.
///
/// The class is used to specify a row or a column span in a matrix ( Mat ) and for many other purposes.
/// Range(a,b) is basically the same as a:b in Matlab or a..b in Python. As in Python, start is an
/// inclusive left boundary of the range and end is an exclusive right boundary of the range. Such a
/// half-opened interval is usually denoted as <span lang='latex'>[start,end)</span> .
///
/// The static method Range::all() returns a special variable that means "the whole sequence" or "the
/// whole range", just like " : " in Matlab or " ... " in Python. All the methods and functions in
/// OpenCV that take Range support this special Range::all() value. But, of course, in case of your own
/// custom processing, you will probably have to check and handle it explicitly:
/// ```ignore
/// void my_function(..., const Range& r, ....)
/// {
/// if(r == Range::all()) {
/// // process all the data
/// }
/// else {
/// // process [r.start, r.end)
/// }
/// }
/// ```
pub trait Range {
#[doc(hidden)] fn as_raw_Range(&self) -> *mut c_void;
// identifier: cv_Range_size_const
fn size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_Range_size_const(self.as_raw_Range()) }.into_result()
}
// identifier: cv_Range_empty_const
fn empty(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_Range_empty_const(self.as_raw_Range()) }.into_result()
}
// identifier: cv_Range_all
fn all(&mut self) -> Result<core::Range> {
unsafe { sys::cv_core_cv_Range_all(self.as_raw_Range()) }.into_result().map(|x| core::Range { ptr: x })
}
}
impl<'a> Range + 'a {
}
// boxed class cv::RotatedRect
/// The class represents rotated (i.e. not up-right) rectangles on a plane.
///
/// Each rectangle is specified by the center point (mass center), length of each side (represented by
/// #Size2f structure) and the rotation angle in degrees.
///
/// The sample below demonstrates how to use RotatedRect:
/// @snippet snippets/core_various.cpp RotatedRect_demo
/// 
///
/// @sa CamShift, fitEllipse, minAreaRect, CvBox2D
#[allow(dead_code)]
pub struct RotatedRect {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::RotatedRect {
fn drop(&mut self) {
unsafe { sys::cv_delete_RotatedRect(self.ptr) };
}
}
impl core::RotatedRect {
#[doc(hidden)] pub fn as_raw_RotatedRect(&self) -> *mut c_void { self.ptr }
}
impl RotatedRect {
// identifier: RotatedRect_get_angle
/// returns the angle attr of float type
pub fn get_angle(&mut self) -> Result<f32> {
unsafe { sys::cv_core_RotatedRect_get_angle(self.as_raw_RotatedRect()) }.into_result()
}
// identifier: RotatedRect_get_center
/// returns the center attr of Point2f type
pub fn get_center(&mut self) -> Result<core::Point2f> {
unsafe { sys::cv_core_RotatedRect_get_center(self.as_raw_RotatedRect()) }.into_result()
}
// identifier: RotatedRect_get_size
/// returns the size attr of Size2f type
pub fn get_size(&mut self) -> Result<core::Size2f> {
unsafe { sys::cv_core_RotatedRect_get_size(self.as_raw_RotatedRect()) }.into_result()
}
// identifier: cv_RotatedRect_RotatedRect
pub fn default() -> Result<core::RotatedRect> {
unsafe { sys::cv_core_cv_RotatedRect_RotatedRect() }.into_result().map(|x| core::RotatedRect { ptr: x })
}
// identifier: cv_RotatedRect_RotatedRect_Point2f_center_Size2f_size_float_angle
/// full constructor
/// ## Parameters
/// * center: The rectangle mass center.
/// * size: Width and height of the rectangle.
/// * angle: The rotation angle in a clockwise direction. When the angle is 0, 90, 180, 270 etc.,
/// the rectangle becomes an up-right rectangle.
pub fn new(center: core::Point2f, size: core::Size2f, angle: f32) -> Result<core::RotatedRect> {
unsafe { sys::cv_core_cv_RotatedRect_RotatedRect_Point2f_center_Size2f_size_float_angle(center, size, angle) }.into_result().map(|x| core::RotatedRect { ptr: x })
}
// identifier: cv_RotatedRect_RotatedRect_Point2f_point1_Point2f_point2_Point2f_point3
/// Any 3 end points of the RotatedRect. They must be given in order (either clockwise or
/// anticlockwise).
pub fn for_points(point1: core::Point2f, point2: core::Point2f, point3: core::Point2f) -> Result<core::RotatedRect> {
unsafe { sys::cv_core_cv_RotatedRect_RotatedRect_Point2f_point1_Point2f_point2_Point2f_point3(point1, point2, point3) }.into_result().map(|x| core::RotatedRect { ptr: x })
}
// identifier: cv_RotatedRect_points_const_Point2f_X_pts
/// returns 4 vertices of the rectangle
/// ## Parameters
/// * pts: The points array for storing rectangle vertices. The order is bottomLeft, topLeft, topRight, bottomRight.
pub fn points(&self, pts: &mut core::Point2f) -> Result<()> {
unsafe { sys::cv_core_cv_RotatedRect_points_const_Point2f_X_pts(self.as_raw_RotatedRect(), pts) }.into_result()
}
// identifier: cv_RotatedRect_boundingRect_const
pub fn bounding_rect(&self) -> Result<core::Rect> {
unsafe { sys::cv_core_cv_RotatedRect_boundingRect_const(self.as_raw_RotatedRect()) }.into_result()
}
// identifier: cv_RotatedRect_boundingRect2f_const
pub fn bounding_rect2f(&self) -> Result<core::Rect2f> {
unsafe { sys::cv_core_cv_RotatedRect_boundingRect2f_const(self.as_raw_RotatedRect()) }.into_result()
}
}
// Generating impl for trait cv::ShapeContextDistanceExtractor (trait)
/// Implementation of the Shape Context descriptor and matching algorithm
///
/// proposed by Belongie et al. in "Shape Matching and Object Recognition Using Shape Contexts" (PAMI
/// 2002). This implementation is packaged in a generic scheme, in order to allow you the
/// implementation of the common variations of the original pipeline.
pub trait ShapeContextDistanceExtractor : core::ShapeDistanceExtractor {
#[doc(hidden)] fn as_raw_ShapeContextDistanceExtractor(&self) -> *mut c_void;
// identifier: cv_ShapeContextDistanceExtractor_setAngularBins_int_nAngularBins
/// Establish the number of angular bins for the Shape Context Descriptor used in the shape matching
/// pipeline.
///
/// ## Parameters
/// * nAngularBins: The number of angular bins in the shape context descriptor.
fn set_angular_bins(&mut self, n_angular_bins: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_setAngularBins_int_nAngularBins(self.as_raw_ShapeContextDistanceExtractor(), n_angular_bins) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_getAngularBins_const
fn get_angular_bins(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_getAngularBins_const(self.as_raw_ShapeContextDistanceExtractor()) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_setRadialBins_int_nRadialBins
/// Establish the number of radial bins for the Shape Context Descriptor used in the shape matching
/// pipeline.
///
/// ## Parameters
/// * nRadialBins: The number of radial bins in the shape context descriptor.
fn set_radial_bins(&mut self, n_radial_bins: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_setRadialBins_int_nRadialBins(self.as_raw_ShapeContextDistanceExtractor(), n_radial_bins) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_getRadialBins_const
fn get_radial_bins(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_getRadialBins_const(self.as_raw_ShapeContextDistanceExtractor()) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_setInnerRadius_float_innerRadius
/// Set the inner radius of the shape context descriptor.
///
/// ## Parameters
/// * innerRadius: The value of the inner radius.
fn set_inner_radius(&mut self, inner_radius: f32) -> Result<()> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_setInnerRadius_float_innerRadius(self.as_raw_ShapeContextDistanceExtractor(), inner_radius) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_getInnerRadius_const
fn get_inner_radius(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_getInnerRadius_const(self.as_raw_ShapeContextDistanceExtractor()) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_setOuterRadius_float_outerRadius
/// Set the outer radius of the shape context descriptor.
///
/// ## Parameters
/// * outerRadius: The value of the outer radius.
fn set_outer_radius(&mut self, outer_radius: f32) -> Result<()> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_setOuterRadius_float_outerRadius(self.as_raw_ShapeContextDistanceExtractor(), outer_radius) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_getOuterRadius_const
fn get_outer_radius(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_getOuterRadius_const(self.as_raw_ShapeContextDistanceExtractor()) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_setRotationInvariant_bool_rotationInvariant
fn set_rotation_invariant(&mut self, rotation_invariant: bool) -> Result<()> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_setRotationInvariant_bool_rotationInvariant(self.as_raw_ShapeContextDistanceExtractor(), rotation_invariant) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_getRotationInvariant_const
fn get_rotation_invariant(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_getRotationInvariant_const(self.as_raw_ShapeContextDistanceExtractor()) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_setShapeContextWeight_float_shapeContextWeight
/// Set the weight of the shape context distance in the final value of the shape distance. The shape
/// context distance between two shapes is defined as the symmetric sum of shape context matching costs
/// over best matching points. The final value of the shape distance is a user-defined linear
/// combination of the shape context distance, an image appearance distance, and a bending energy.
///
/// ## Parameters
/// * shapeContextWeight: The weight of the shape context distance in the final distance value.
fn set_shape_context_weight(&mut self, shape_context_weight: f32) -> Result<()> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_setShapeContextWeight_float_shapeContextWeight(self.as_raw_ShapeContextDistanceExtractor(), shape_context_weight) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_getShapeContextWeight_const
fn get_shape_context_weight(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_getShapeContextWeight_const(self.as_raw_ShapeContextDistanceExtractor()) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_setImageAppearanceWeight_float_imageAppearanceWeight
/// Set the weight of the Image Appearance cost in the final value of the shape distance. The image
/// appearance cost is defined as the sum of squared brightness differences in Gaussian windows around
/// corresponding image points. The final value of the shape distance is a user-defined linear
/// combination of the shape context distance, an image appearance distance, and a bending energy. If
/// this value is set to a number different from 0, is mandatory to set the images that correspond to
/// each shape.
///
/// ## Parameters
/// * imageAppearanceWeight: The weight of the appearance cost in the final distance value.
fn set_image_appearance_weight(&mut self, image_appearance_weight: f32) -> Result<()> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_setImageAppearanceWeight_float_imageAppearanceWeight(self.as_raw_ShapeContextDistanceExtractor(), image_appearance_weight) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_getImageAppearanceWeight_const
fn get_image_appearance_weight(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_getImageAppearanceWeight_const(self.as_raw_ShapeContextDistanceExtractor()) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_setBendingEnergyWeight_float_bendingEnergyWeight
/// Set the weight of the Bending Energy in the final value of the shape distance. The bending energy
/// definition depends on what transformation is being used to align the shapes. The final value of the
/// shape distance is a user-defined linear combination of the shape context distance, an image
/// appearance distance, and a bending energy.
///
/// ## Parameters
/// * bendingEnergyWeight: The weight of the Bending Energy in the final distance value.
fn set_bending_energy_weight(&mut self, bending_energy_weight: f32) -> Result<()> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_setBendingEnergyWeight_float_bendingEnergyWeight(self.as_raw_ShapeContextDistanceExtractor(), bending_energy_weight) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_getBendingEnergyWeight_const
fn get_bending_energy_weight(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_getBendingEnergyWeight_const(self.as_raw_ShapeContextDistanceExtractor()) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_setImages_Mat_image1_Mat_image2
/// Set the images that correspond to each shape. This images are used in the calculation of the Image
/// Appearance cost.
///
/// ## Parameters
/// * image1: Image corresponding to the shape defined by contours1.
/// * image2: Image corresponding to the shape defined by contours2.
fn set_images(&mut self, image1: &core::Mat, image2: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_setImages_Mat_image1_Mat_image2(self.as_raw_ShapeContextDistanceExtractor(), image1.as_raw_Mat(), image2.as_raw_Mat()) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_getImages_const_Mat_image1_Mat_image2
fn get_images(&self, image1: &mut core::Mat, image2: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_getImages_const_Mat_image1_Mat_image2(self.as_raw_ShapeContextDistanceExtractor(), image1.as_raw_Mat(), image2.as_raw_Mat()) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_setIterations_int_iterations
fn set_iterations(&mut self, iterations: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_setIterations_int_iterations(self.as_raw_ShapeContextDistanceExtractor(), iterations) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_getIterations_const
fn get_iterations(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_getIterations_const(self.as_raw_ShapeContextDistanceExtractor()) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_setCostExtractor_PtrOfHistogramCostExtractor_comparer
/// Set the algorithm used for building the shape context descriptor cost matrix.
///
/// ## Parameters
/// * comparer: Smart pointer to a HistogramCostExtractor, an algorithm that defines the cost
/// matrix between descriptors.
fn set_cost_extractor(&mut self, comparer: &types::PtrOfHistogramCostExtractor) -> Result<()> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_setCostExtractor_PtrOfHistogramCostExtractor_comparer(self.as_raw_ShapeContextDistanceExtractor(), comparer.as_raw_PtrOfHistogramCostExtractor()) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_getCostExtractor_const
fn get_cost_extractor(&self) -> Result<types::PtrOfHistogramCostExtractor> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_getCostExtractor_const(self.as_raw_ShapeContextDistanceExtractor()) }.into_result().map(|x| types::PtrOfHistogramCostExtractor { ptr: x })
}
// identifier: cv_ShapeContextDistanceExtractor_setStdDev_float_sigma
/// Set the value of the standard deviation for the Gaussian window for the image appearance cost.
///
/// ## Parameters
/// * sigma: Standard Deviation.
fn set_std_dev(&mut self, sigma: f32) -> Result<()> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_setStdDev_float_sigma(self.as_raw_ShapeContextDistanceExtractor(), sigma) }.into_result()
}
// identifier: cv_ShapeContextDistanceExtractor_getStdDev_const
fn get_std_dev(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_ShapeContextDistanceExtractor_getStdDev_const(self.as_raw_ShapeContextDistanceExtractor()) }.into_result()
}
}
impl<'a> ShapeContextDistanceExtractor + 'a {
}
// Generating impl for trait cv::ShapeDistanceExtractor (trait)
/// Abstract base class for shape distance algorithms.
pub trait ShapeDistanceExtractor : core::Algorithm {
#[doc(hidden)] fn as_raw_ShapeDistanceExtractor(&self) -> *mut c_void;
// identifier: cv_ShapeDistanceExtractor_computeDistance_Mat_contour1_Mat_contour2
/// Compute the shape distance between two shapes defined by its contours.
///
/// ## Parameters
/// * contour1: Contour defining first shape.
/// * contour2: Contour defining second shape.
fn compute_distance(&mut self, contour1: &core::Mat, contour2: &core::Mat) -> Result<f32> {
unsafe { sys::cv_core_cv_ShapeDistanceExtractor_computeDistance_Mat_contour1_Mat_contour2(self.as_raw_ShapeDistanceExtractor(), contour1.as_raw_Mat(), contour2.as_raw_Mat()) }.into_result()
}
}
impl<'a> ShapeDistanceExtractor + 'a {
}
// Generating impl for trait cv::ShapeTransformer (trait)
/// Abstract base class for shape transformation algorithms.
pub trait ShapeTransformer : core::Algorithm {
#[doc(hidden)] fn as_raw_ShapeTransformer(&self) -> *mut c_void;
// identifier: cv_ShapeTransformer_estimateTransformation_Mat_transformingShape_Mat_targetShape_VectorOfDMatch_matches
/// Estimate the transformation parameters of the current transformer algorithm, based on point matches.
///
/// ## Parameters
/// * transformingShape: Contour defining first shape.
/// * targetShape: Contour defining second shape (Target).
/// * matches: Standard vector of Matches between points.
fn estimate_transformation(&mut self, transforming_shape: &core::Mat, target_shape: &core::Mat, matches: &types::VectorOfDMatch) -> Result<()> {
unsafe { sys::cv_core_cv_ShapeTransformer_estimateTransformation_Mat_transformingShape_Mat_targetShape_VectorOfDMatch_matches(self.as_raw_ShapeTransformer(), transforming_shape.as_raw_Mat(), target_shape.as_raw_Mat(), matches.as_raw_VectorOfDMatch()) }.into_result()
}
// identifier: cv_ShapeTransformer_applyTransformation_Mat_input_Mat_output
/// Apply a transformation, given a pre-estimated transformation parameters.
///
/// ## Parameters
/// * input: Contour (set of points) to apply the transformation.
/// * output: Output contour.
///
/// ## C++ default parameters:
/// * output: noArray()
fn apply_transformation(&mut self, input: &core::Mat, output: &mut core::Mat) -> Result<f32> {
unsafe { sys::cv_core_cv_ShapeTransformer_applyTransformation_Mat_input_Mat_output(self.as_raw_ShapeTransformer(), input.as_raw_Mat(), output.as_raw_Mat()) }.into_result()
}
// identifier: cv_ShapeTransformer_warpImage_const_Mat_transformingImage_Mat_output_int_flags_int_borderMode_Scalar_borderValue
/// Apply a transformation, given a pre-estimated transformation parameters, to an Image.
///
/// ## Parameters
/// * transformingImage: Input image.
/// * output: Output image.
/// * flags: Image interpolation method.
/// * borderMode: border style.
/// * borderValue: border value.
///
/// ## C++ default parameters:
/// * flags: INTER_LINEAR
/// * border_mode: BORDER_CONSTANT
/// * border_value: Scalar()
fn warp_image(&self, transforming_image: &core::Mat, output: &mut core::Mat, flags: i32, border_mode: i32, border_value: core::Scalar) -> Result<()> {
unsafe { sys::cv_core_cv_ShapeTransformer_warpImage_const_Mat_transformingImage_Mat_output_int_flags_int_borderMode_Scalar_borderValue(self.as_raw_ShapeTransformer(), transforming_image.as_raw_Mat(), output.as_raw_Mat(), flags, border_mode, border_value) }.into_result()
}
}
impl<'a> ShapeTransformer + 'a {
}
// boxed class cv::SimilarRects
#[allow(dead_code)]
pub struct SimilarRects {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::SimilarRects {
fn drop(&mut self) {
unsafe { sys::cv_delete_SimilarRects(self.ptr) };
}
}
impl core::SimilarRects {
#[doc(hidden)] pub fn as_raw_SimilarRects(&self) -> *mut c_void { self.ptr }
}
// boxed class cv::SimpleBlobDetector
/// Class for extracting blobs from an image. :
///
/// The class implements a simple algorithm for extracting blobs from an image:
///
/// 1. Convert the source image to binary images by applying thresholding with several thresholds from
/// minThreshold (inclusive) to maxThreshold (exclusive) with distance thresholdStep between
/// neighboring thresholds.
/// 2. Extract connected components from every binary image by findContours and calculate their
/// centers.
/// 3. Group centers from several binary images by their coordinates. Close centers form one group that
/// corresponds to one blob, which is controlled by the minDistBetweenBlobs parameter.
/// 4. From the groups, estimate final centers of blobs and their radiuses and return as locations and
/// sizes of keypoints.
///
/// This class performs several filtrations of returned blobs. You should set filterBy\* to true/false
/// to turn on/off corresponding filtration. Available filtrations:
///
/// * **By color**. This filter compares the intensity of a binary image at the center of a blob to
/// blobColor. If they differ, the blob is filtered out. Use blobColor = 0 to extract dark blobs
/// and blobColor = 255 to extract light blobs.
/// * **By area**. Extracted blobs have an area between minArea (inclusive) and maxArea (exclusive).
/// * **By circularity**. Extracted blobs have circularity
/// (<span lang='latex'>\frac{4*\pi*Area}{perimeter * perimeter}</span>) between minCircularity (inclusive) and
/// maxCircularity (exclusive).
/// * **By ratio of the minimum inertia to maximum inertia**. Extracted blobs have this ratio
/// between minInertiaRatio (inclusive) and maxInertiaRatio (exclusive).
/// * **By convexity**. Extracted blobs have convexity (area / area of blob convex hull) between
/// minConvexity (inclusive) and maxConvexity (exclusive).
///
/// Default values of parameters are tuned to extract dark circular blobs.
#[allow(dead_code)]
pub struct SimpleBlobDetector {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::SimpleBlobDetector {
fn drop(&mut self) {
unsafe { sys::cv_delete_SimpleBlobDetector(self.ptr) };
}
}
impl core::SimpleBlobDetector {
#[doc(hidden)] pub fn as_raw_SimpleBlobDetector(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for SimpleBlobDetector {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::Feature2D for SimpleBlobDetector {
#[doc(hidden)] fn as_raw_Feature2D(&self) -> *mut c_void { self.ptr }
}
impl SimpleBlobDetector {
// identifier: cv_SimpleBlobDetector_create_SimpleBlobDetector_Params_parameters
///
/// ## C++ default parameters:
/// * parameters: SimpleBlobDetector::Params()
pub fn create(parameters: core::SimpleBlobDetector_Params) -> Result<types::PtrOfSimpleBlobDetector> {
unsafe { sys::cv_core_cv_SimpleBlobDetector_create_SimpleBlobDetector_Params_parameters(parameters) }.into_result().map(|x| types::PtrOfSimpleBlobDetector { ptr: x })
}
// identifier: cv_SimpleBlobDetector_getDefaultName_const
pub fn get_default_name(&self) -> Result<String> {
unsafe { sys::cv_core_cv_SimpleBlobDetector_getDefaultName_const(self.as_raw_SimpleBlobDetector()) }.into_result().map(crate::templ::receive_string_mut)
}
}
impl SimpleBlobDetector_Params {
// identifier: cv_SimpleBlobDetector_Params_Params
pub fn new() -> Result<core::SimpleBlobDetector_Params> {
unsafe { sys::cv_core_cv_SimpleBlobDetector_Params_Params() }.into_result()
}
}
// Generating impl for trait cv::SparseOpticalFlow (trait)
/// Base interface for sparse optical flow algorithms.
pub trait SparseOpticalFlow : core::Algorithm {
#[doc(hidden)] fn as_raw_SparseOpticalFlow(&self) -> *mut c_void;
// identifier: cv_SparseOpticalFlow_calc_Mat_prevImg_Mat_nextImg_Mat_prevPts_Mat_nextPts_Mat_status_Mat_err
/// Calculates a sparse optical flow.
///
/// ## Parameters
/// * prevImg: First input image.
/// * nextImg: Second input image of the same size and the same type as prevImg.
/// * prevPts: Vector of 2D points for which the flow needs to be found.
/// * nextPts: Output vector of 2D points containing the calculated new positions of input features in the second image.
/// * status: Output status vector. Each element of the vector is set to 1 if the
/// flow for the corresponding features has been found. Otherwise, it is set to 0.
/// * err: Optional output vector that contains error response for each point (inverse confidence).
///
/// ## C++ default parameters:
/// * err: cv::noArray()
fn calc(&mut self, prev_img: &core::Mat, next_img: &core::Mat, prev_pts: &core::Mat, next_pts: &mut core::Mat, status: &mut core::Mat, err: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_SparseOpticalFlow_calc_Mat_prevImg_Mat_nextImg_Mat_prevPts_Mat_nextPts_Mat_status_Mat_err(self.as_raw_SparseOpticalFlow(), prev_img.as_raw_Mat(), next_img.as_raw_Mat(), prev_pts.as_raw_Mat(), next_pts.as_raw_Mat(), status.as_raw_Mat(), err.as_raw_Mat()) }.into_result()
}
}
impl<'a> SparseOpticalFlow + 'a {
}
// Generating impl for trait cv::SparsePyrLKOpticalFlow (trait)
/// Class used for calculating a sparse optical flow.
///
/// The class can calculate an optical flow for a sparse feature set using the
/// iterative Lucas-Kanade method with pyramids.
///
/// @sa calcOpticalFlowPyrLK
pub trait SparsePyrLKOpticalFlow : core::SparseOpticalFlow {
#[doc(hidden)] fn as_raw_SparsePyrLKOpticalFlow(&self) -> *mut c_void;
// identifier: cv_SparsePyrLKOpticalFlow_getWinSize_const
fn get_win_size(&self) -> Result<core::Size> {
unsafe { sys::cv_core_cv_SparsePyrLKOpticalFlow_getWinSize_const(self.as_raw_SparsePyrLKOpticalFlow()) }.into_result()
}
// identifier: cv_SparsePyrLKOpticalFlow_setWinSize_Size_winSize
fn set_win_size(&mut self, win_size: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_SparsePyrLKOpticalFlow_setWinSize_Size_winSize(self.as_raw_SparsePyrLKOpticalFlow(), win_size) }.into_result()
}
// identifier: cv_SparsePyrLKOpticalFlow_getMaxLevel_const
fn get_max_level(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_SparsePyrLKOpticalFlow_getMaxLevel_const(self.as_raw_SparsePyrLKOpticalFlow()) }.into_result()
}
// identifier: cv_SparsePyrLKOpticalFlow_setMaxLevel_int_maxLevel
fn set_max_level(&mut self, max_level: i32) -> Result<()> {
unsafe { sys::cv_core_cv_SparsePyrLKOpticalFlow_setMaxLevel_int_maxLevel(self.as_raw_SparsePyrLKOpticalFlow(), max_level) }.into_result()
}
// identifier: cv_SparsePyrLKOpticalFlow_getTermCriteria_const
fn get_term_criteria(&self) -> Result<core::TermCriteria> {
unsafe { sys::cv_core_cv_SparsePyrLKOpticalFlow_getTermCriteria_const(self.as_raw_SparsePyrLKOpticalFlow()) }.into_result().map(|x| core::TermCriteria { ptr: x })
}
// identifier: cv_SparsePyrLKOpticalFlow_setTermCriteria_TermCriteria_crit
fn set_term_criteria(&mut self, crit: &core::TermCriteria) -> Result<()> {
unsafe { sys::cv_core_cv_SparsePyrLKOpticalFlow_setTermCriteria_TermCriteria_crit(self.as_raw_SparsePyrLKOpticalFlow(), crit.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_SparsePyrLKOpticalFlow_getFlags_const
fn get_flags(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_SparsePyrLKOpticalFlow_getFlags_const(self.as_raw_SparsePyrLKOpticalFlow()) }.into_result()
}
// identifier: cv_SparsePyrLKOpticalFlow_setFlags_int_flags
fn set_flags(&mut self, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_SparsePyrLKOpticalFlow_setFlags_int_flags(self.as_raw_SparsePyrLKOpticalFlow(), flags) }.into_result()
}
// identifier: cv_SparsePyrLKOpticalFlow_getMinEigThreshold_const
fn get_min_eig_threshold(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_SparsePyrLKOpticalFlow_getMinEigThreshold_const(self.as_raw_SparsePyrLKOpticalFlow()) }.into_result()
}
// identifier: cv_SparsePyrLKOpticalFlow_setMinEigThreshold_double_minEigThreshold
fn set_min_eig_threshold(&mut self, min_eig_threshold: f64) -> Result<()> {
unsafe { sys::cv_core_cv_SparsePyrLKOpticalFlow_setMinEigThreshold_double_minEigThreshold(self.as_raw_SparsePyrLKOpticalFlow(), min_eig_threshold) }.into_result()
}
}
impl<'a> SparsePyrLKOpticalFlow + 'a {
// identifier: cv_SparsePyrLKOpticalFlow_create_Size_winSize_int_maxLevel_TermCriteria_crit_int_flags_double_minEigThreshold
///
/// ## C++ default parameters:
/// * win_size: Size(21, 21)
/// * max_level: 3
/// * crit: TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, 0.01)
/// * flags: 0
/// * min_eig_threshold: 1e-4
pub fn create(win_size: core::Size, max_level: i32, crit: &core::TermCriteria, flags: i32, min_eig_threshold: f64) -> Result<types::PtrOfSparsePyrLKOpticalFlow> {
unsafe { sys::cv_core_cv_SparsePyrLKOpticalFlow_create_Size_winSize_int_maxLevel_TermCriteria_crit_int_flags_double_minEigThreshold(win_size, max_level, crit.as_raw_TermCriteria(), flags, min_eig_threshold) }.into_result().map(|x| types::PtrOfSparsePyrLKOpticalFlow { ptr: x })
}
}
// boxed class cv::SphericalWarper
/// Spherical warper factory class
#[allow(dead_code)]
pub struct SphericalWarper {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::SphericalWarper {
fn drop(&mut self) {
unsafe { sys::cv_delete_SphericalWarper(self.ptr) };
}
}
impl core::SphericalWarper {
#[doc(hidden)] pub fn as_raw_SphericalWarper(&self) -> *mut c_void { self.ptr }
}
impl core::WarperCreator for SphericalWarper {
#[doc(hidden)] fn as_raw_WarperCreator(&self) -> *mut c_void { self.ptr }
}
impl SphericalWarper {
}
// Generating impl for trait cv::StereoBM (trait)
/// Class for computing stereo correspondence using the block matching algorithm, introduced and
/// contributed to OpenCV by K. Konolige.
pub trait StereoBM : core::StereoMatcher {
#[doc(hidden)] fn as_raw_StereoBM(&self) -> *mut c_void;
// identifier: cv_StereoBM_getPreFilterType_const
fn get_pre_filter_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoBM_getPreFilterType_const(self.as_raw_StereoBM()) }.into_result()
}
// identifier: cv_StereoBM_setPreFilterType_int_preFilterType
fn set_pre_filter_type(&mut self, pre_filter_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoBM_setPreFilterType_int_preFilterType(self.as_raw_StereoBM(), pre_filter_type) }.into_result()
}
// identifier: cv_StereoBM_getPreFilterSize_const
fn get_pre_filter_size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoBM_getPreFilterSize_const(self.as_raw_StereoBM()) }.into_result()
}
// identifier: cv_StereoBM_setPreFilterSize_int_preFilterSize
fn set_pre_filter_size(&mut self, pre_filter_size: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoBM_setPreFilterSize_int_preFilterSize(self.as_raw_StereoBM(), pre_filter_size) }.into_result()
}
// identifier: cv_StereoBM_getPreFilterCap_const
fn get_pre_filter_cap(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoBM_getPreFilterCap_const(self.as_raw_StereoBM()) }.into_result()
}
// identifier: cv_StereoBM_setPreFilterCap_int_preFilterCap
fn set_pre_filter_cap(&mut self, pre_filter_cap: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoBM_setPreFilterCap_int_preFilterCap(self.as_raw_StereoBM(), pre_filter_cap) }.into_result()
}
// identifier: cv_StereoBM_getTextureThreshold_const
fn get_texture_threshold(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoBM_getTextureThreshold_const(self.as_raw_StereoBM()) }.into_result()
}
// identifier: cv_StereoBM_setTextureThreshold_int_textureThreshold
fn set_texture_threshold(&mut self, texture_threshold: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoBM_setTextureThreshold_int_textureThreshold(self.as_raw_StereoBM(), texture_threshold) }.into_result()
}
// identifier: cv_StereoBM_getUniquenessRatio_const
fn get_uniqueness_ratio(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoBM_getUniquenessRatio_const(self.as_raw_StereoBM()) }.into_result()
}
// identifier: cv_StereoBM_setUniquenessRatio_int_uniquenessRatio
fn set_uniqueness_ratio(&mut self, uniqueness_ratio: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoBM_setUniquenessRatio_int_uniquenessRatio(self.as_raw_StereoBM(), uniqueness_ratio) }.into_result()
}
// identifier: cv_StereoBM_getSmallerBlockSize_const
fn get_smaller_block_size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoBM_getSmallerBlockSize_const(self.as_raw_StereoBM()) }.into_result()
}
// identifier: cv_StereoBM_setSmallerBlockSize_int_blockSize
fn set_smaller_block_size(&mut self, block_size: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoBM_setSmallerBlockSize_int_blockSize(self.as_raw_StereoBM(), block_size) }.into_result()
}
// identifier: cv_StereoBM_getROI1_const
fn get_roi1(&self) -> Result<core::Rect> {
unsafe { sys::cv_core_cv_StereoBM_getROI1_const(self.as_raw_StereoBM()) }.into_result()
}
// identifier: cv_StereoBM_setROI1_Rect_roi1
fn set_roi1(&mut self, roi1: core::Rect) -> Result<()> {
unsafe { sys::cv_core_cv_StereoBM_setROI1_Rect_roi1(self.as_raw_StereoBM(), roi1) }.into_result()
}
// identifier: cv_StereoBM_getROI2_const
fn get_roi2(&self) -> Result<core::Rect> {
unsafe { sys::cv_core_cv_StereoBM_getROI2_const(self.as_raw_StereoBM()) }.into_result()
}
// identifier: cv_StereoBM_setROI2_Rect_roi2
fn set_roi2(&mut self, roi2: core::Rect) -> Result<()> {
unsafe { sys::cv_core_cv_StereoBM_setROI2_Rect_roi2(self.as_raw_StereoBM(), roi2) }.into_result()
}
}
impl<'a> StereoBM + 'a {
// identifier: cv_StereoBM_create_int_numDisparities_int_blockSize
/// Creates StereoBM object
///
/// ## Parameters
/// * numDisparities: the disparity search range. For each pixel algorithm will find the best
/// disparity from 0 (default minimum disparity) to numDisparities. The search range can then be
/// shifted by changing the minimum disparity.
/// * blockSize: the linear size of the blocks compared by the algorithm. The size should be odd
/// (as the block is centered at the current pixel). Larger block size implies smoother, though less
/// accurate disparity map. Smaller block size gives more detailed disparity map, but there is higher
/// chance for algorithm to find a wrong correspondence.
///
/// The function create StereoBM object. You can then call StereoBM::compute() to compute disparity for
/// a specific stereo pair.
///
/// ## C++ default parameters:
/// * num_disparities: 0
/// * block_size: 21
pub fn create(num_disparities: i32, block_size: i32) -> Result<types::PtrOfStereoBM> {
unsafe { sys::cv_core_cv_StereoBM_create_int_numDisparities_int_blockSize(num_disparities, block_size) }.into_result().map(|x| types::PtrOfStereoBM { ptr: x })
}
}
// Generating impl for trait cv::StereoMatcher (trait)
/// The base class for stereo correspondence algorithms.
pub trait StereoMatcher : core::Algorithm {
#[doc(hidden)] fn as_raw_StereoMatcher(&self) -> *mut c_void;
// identifier: cv_StereoMatcher_compute_Mat_left_Mat_right_Mat_disparity
/// Computes disparity map for the specified stereo pair
///
/// ## Parameters
/// * left: Left 8-bit single-channel image.
/// * right: Right image of the same size and the same type as the left one.
/// * disparity: Output disparity map. It has the same size as the input images. Some algorithms,
/// like StereoBM or StereoSGBM compute 16-bit fixed-point disparity map (where each disparity value
/// has 4 fractional bits), whereas other algorithms output 32-bit floating-point disparity map.
fn compute(&mut self, left: &core::Mat, right: &core::Mat, disparity: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_StereoMatcher_compute_Mat_left_Mat_right_Mat_disparity(self.as_raw_StereoMatcher(), left.as_raw_Mat(), right.as_raw_Mat(), disparity.as_raw_Mat()) }.into_result()
}
// identifier: cv_StereoMatcher_getMinDisparity_const
fn get_min_disparity(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoMatcher_getMinDisparity_const(self.as_raw_StereoMatcher()) }.into_result()
}
// identifier: cv_StereoMatcher_setMinDisparity_int_minDisparity
fn set_min_disparity(&mut self, min_disparity: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoMatcher_setMinDisparity_int_minDisparity(self.as_raw_StereoMatcher(), min_disparity) }.into_result()
}
// identifier: cv_StereoMatcher_getNumDisparities_const
fn get_num_disparities(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoMatcher_getNumDisparities_const(self.as_raw_StereoMatcher()) }.into_result()
}
// identifier: cv_StereoMatcher_setNumDisparities_int_numDisparities
fn set_num_disparities(&mut self, num_disparities: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoMatcher_setNumDisparities_int_numDisparities(self.as_raw_StereoMatcher(), num_disparities) }.into_result()
}
// identifier: cv_StereoMatcher_getBlockSize_const
fn get_block_size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoMatcher_getBlockSize_const(self.as_raw_StereoMatcher()) }.into_result()
}
// identifier: cv_StereoMatcher_setBlockSize_int_blockSize
fn set_block_size(&mut self, block_size: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoMatcher_setBlockSize_int_blockSize(self.as_raw_StereoMatcher(), block_size) }.into_result()
}
// identifier: cv_StereoMatcher_getSpeckleWindowSize_const
fn get_speckle_window_size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoMatcher_getSpeckleWindowSize_const(self.as_raw_StereoMatcher()) }.into_result()
}
// identifier: cv_StereoMatcher_setSpeckleWindowSize_int_speckleWindowSize
fn set_speckle_window_size(&mut self, speckle_window_size: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoMatcher_setSpeckleWindowSize_int_speckleWindowSize(self.as_raw_StereoMatcher(), speckle_window_size) }.into_result()
}
// identifier: cv_StereoMatcher_getSpeckleRange_const
fn get_speckle_range(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoMatcher_getSpeckleRange_const(self.as_raw_StereoMatcher()) }.into_result()
}
// identifier: cv_StereoMatcher_setSpeckleRange_int_speckleRange
fn set_speckle_range(&mut self, speckle_range: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoMatcher_setSpeckleRange_int_speckleRange(self.as_raw_StereoMatcher(), speckle_range) }.into_result()
}
// identifier: cv_StereoMatcher_getDisp12MaxDiff_const
fn get_disp12_max_diff(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoMatcher_getDisp12MaxDiff_const(self.as_raw_StereoMatcher()) }.into_result()
}
// identifier: cv_StereoMatcher_setDisp12MaxDiff_int_disp12MaxDiff
fn set_disp12_max_diff(&mut self, disp12_max_diff: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoMatcher_setDisp12MaxDiff_int_disp12MaxDiff(self.as_raw_StereoMatcher(), disp12_max_diff) }.into_result()
}
}
impl<'a> StereoMatcher + 'a {
}
// Generating impl for trait cv::StereoSGBM (trait)
/// The class implements the modified H. Hirschmuller algorithm @cite HH08 that differs from the original
/// one as follows:
///
/// * By default, the algorithm is single-pass, which means that you consider only 5 directions
/// instead of 8. Set mode=StereoSGBM::MODE_HH in createStereoSGBM to run the full variant of the
/// algorithm but beware that it may consume a lot of memory.
/// * The algorithm matches blocks, not individual pixels. Though, setting blockSize=1 reduces the
/// blocks to single pixels.
/// * Mutual information cost function is not implemented. Instead, a simpler Birchfield-Tomasi
/// sub-pixel metric from @cite BT98 is used. Though, the color images are supported as well.
/// * Some pre- and post- processing steps from K. Konolige algorithm StereoBM are included, for
/// example: pre-filtering (StereoBM::PREFILTER_XSOBEL type) and post-filtering (uniqueness
/// check, quadratic interpolation and speckle filtering).
///
///
/// Note:
/// * (Python) An example illustrating the use of the StereoSGBM matching algorithm can be found
/// at opencv_source_code/samples/python/stereo_match.py
pub trait StereoSGBM : core::StereoMatcher {
#[doc(hidden)] fn as_raw_StereoSGBM(&self) -> *mut c_void;
// identifier: cv_StereoSGBM_getPreFilterCap_const
fn get_pre_filter_cap(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoSGBM_getPreFilterCap_const(self.as_raw_StereoSGBM()) }.into_result()
}
// identifier: cv_StereoSGBM_setPreFilterCap_int_preFilterCap
fn set_pre_filter_cap(&mut self, pre_filter_cap: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoSGBM_setPreFilterCap_int_preFilterCap(self.as_raw_StereoSGBM(), pre_filter_cap) }.into_result()
}
// identifier: cv_StereoSGBM_getUniquenessRatio_const
fn get_uniqueness_ratio(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoSGBM_getUniquenessRatio_const(self.as_raw_StereoSGBM()) }.into_result()
}
// identifier: cv_StereoSGBM_setUniquenessRatio_int_uniquenessRatio
fn set_uniqueness_ratio(&mut self, uniqueness_ratio: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoSGBM_setUniquenessRatio_int_uniquenessRatio(self.as_raw_StereoSGBM(), uniqueness_ratio) }.into_result()
}
// identifier: cv_StereoSGBM_getP1_const
fn get_p1(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoSGBM_getP1_const(self.as_raw_StereoSGBM()) }.into_result()
}
// identifier: cv_StereoSGBM_setP1_int_P1
fn set_p1(&mut self, p1: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoSGBM_setP1_int_P1(self.as_raw_StereoSGBM(), p1) }.into_result()
}
// identifier: cv_StereoSGBM_getP2_const
fn get_p2(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoSGBM_getP2_const(self.as_raw_StereoSGBM()) }.into_result()
}
// identifier: cv_StereoSGBM_setP2_int_P2
fn set_p2(&mut self, p2: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoSGBM_setP2_int_P2(self.as_raw_StereoSGBM(), p2) }.into_result()
}
// identifier: cv_StereoSGBM_getMode_const
fn get_mode(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_StereoSGBM_getMode_const(self.as_raw_StereoSGBM()) }.into_result()
}
// identifier: cv_StereoSGBM_setMode_int_mode
fn set_mode(&mut self, mode: i32) -> Result<()> {
unsafe { sys::cv_core_cv_StereoSGBM_setMode_int_mode(self.as_raw_StereoSGBM(), mode) }.into_result()
}
}
impl<'a> StereoSGBM + 'a {
// identifier: cv_StereoSGBM_create_int_minDisparity_int_numDisparities_int_blockSize_int_P1_int_P2_int_disp12MaxDiff_int_preFilterCap_int_uniquenessRatio_int_speckleWindowSize_int_speckleRange_int_mode
/// Creates StereoSGBM object
///
/// ## Parameters
/// * minDisparity: Minimum possible disparity value. Normally, it is zero but sometimes
/// rectification algorithms can shift images, so this parameter needs to be adjusted accordingly.
/// * numDisparities: Maximum disparity minus minimum disparity. The value is always greater than
/// zero. In the current implementation, this parameter must be divisible by 16.
/// * blockSize: Matched block size. It must be an odd number \>=1 . Normally, it should be
/// somewhere in the 3..11 range.
/// * P1: The first parameter controlling the disparity smoothness. See below.
/// * P2: The second parameter controlling the disparity smoothness. The larger the values are,
/// the smoother the disparity is. P1 is the penalty on the disparity change by plus or minus 1
/// between neighbor pixels. P2 is the penalty on the disparity change by more than 1 between neighbor
/// pixels. The algorithm requires P2 \> P1 . See stereo_match.cpp sample where some reasonably good
/// P1 and P2 values are shown (like 8\*number_of_image_channels\*SADWindowSize\*SADWindowSize and
/// 32\*number_of_image_channels\*SADWindowSize\*SADWindowSize , respectively).
/// * disp12MaxDiff: Maximum allowed difference (in integer pixel units) in the left-right
/// disparity check. Set it to a non-positive value to disable the check.
/// * preFilterCap: Truncation value for the prefiltered image pixels. The algorithm first
/// computes x-derivative at each pixel and clips its value by [-preFilterCap, preFilterCap] interval.
/// The result values are passed to the Birchfield-Tomasi pixel cost function.
/// * uniquenessRatio: Margin in percentage by which the best (minimum) computed cost function
/// value should "win" the second best value to consider the found match correct. Normally, a value
/// within the 5-15 range is good enough.
/// * speckleWindowSize: Maximum size of smooth disparity regions to consider their noise speckles
/// and invalidate. Set it to 0 to disable speckle filtering. Otherwise, set it somewhere in the
/// 50-200 range.
/// * speckleRange: Maximum disparity variation within each connected component. If you do speckle
/// filtering, set the parameter to a positive value, it will be implicitly multiplied by 16.
/// Normally, 1 or 2 is good enough.
/// * mode: Set it to StereoSGBM::MODE_HH to run the full-scale two-pass dynamic programming
/// algorithm. It will consume O(W\*H\*numDisparities) bytes, which is large for 640x480 stereo and
/// huge for HD-size pictures. By default, it is set to false .
///
/// The first constructor initializes StereoSGBM with all the default parameters. So, you only have to
/// set StereoSGBM::numDisparities at minimum. The second constructor enables you to set each parameter
/// to a custom value.
///
/// ## C++ default parameters:
/// * min_disparity: 0
/// * num_disparities: 16
/// * block_size: 3
/// * p1: 0
/// * p2: 0
/// * disp12_max_diff: 0
/// * pre_filter_cap: 0
/// * uniqueness_ratio: 0
/// * speckle_window_size: 0
/// * speckle_range: 0
/// * mode: StereoSGBM::MODE_SGBM
pub fn create(min_disparity: i32, num_disparities: i32, block_size: i32, p1: i32, p2: i32, disp12_max_diff: i32, pre_filter_cap: i32, uniqueness_ratio: i32, speckle_window_size: i32, speckle_range: i32, mode: i32) -> Result<types::PtrOfStereoSGBM> {
unsafe { sys::cv_core_cv_StereoSGBM_create_int_minDisparity_int_numDisparities_int_blockSize_int_P1_int_P2_int_disp12MaxDiff_int_preFilterCap_int_uniquenessRatio_int_speckleWindowSize_int_speckleRange_int_mode(min_disparity, num_disparities, block_size, p1, p2, disp12_max_diff, pre_filter_cap, uniqueness_ratio, speckle_window_size, speckle_range, mode) }.into_result().map(|x| types::PtrOfStereoSGBM { ptr: x })
}
}
// boxed class cv::StereographicWarper
#[allow(dead_code)]
pub struct StereographicWarper {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::StereographicWarper {
fn drop(&mut self) {
unsafe { sys::cv_delete_StereographicWarper(self.ptr) };
}
}
impl core::StereographicWarper {
#[doc(hidden)] pub fn as_raw_StereographicWarper(&self) -> *mut c_void { self.ptr }
}
impl core::WarperCreator for StereographicWarper {
#[doc(hidden)] fn as_raw_WarperCreator(&self) -> *mut c_void { self.ptr }
}
impl StereographicWarper {
}
// boxed class cv::Stitcher
/// High level image stitcher.
///
/// It's possible to use this class without being aware of the entire stitching pipeline. However, to
/// be able to achieve higher stitching stability and quality of the final images at least being
/// familiar with the theory is recommended.
///
///
/// Note:
/// * A basic example on image stitching can be found at
/// opencv_source_code/samples/cpp/stitching.cpp
/// * A detailed example on image stitching can be found at
/// opencv_source_code/samples/cpp/stitching_detailed.cpp
#[allow(dead_code)]
pub struct Stitcher {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::Stitcher {
fn drop(&mut self) {
unsafe { sys::cv_delete_Stitcher(self.ptr) };
}
}
impl core::Stitcher {
#[doc(hidden)] pub fn as_raw_Stitcher(&self) -> *mut c_void { self.ptr }
}
impl Stitcher {
// identifier: cv_Stitcher_createDefault_bool_try_use_gpu
/// Creates a stitcher with the default parameters.
///
/// ## Parameters
/// * try_use_gpu: Flag indicating whether GPU should be used whenever it's possible.
/// @return Stitcher class instance.
///
/// ## C++ default parameters:
/// * try_use_gpu: false
pub fn create_default(try_use_gpu: bool) -> Result<core::Stitcher> {
unsafe { sys::cv_core_cv_Stitcher_createDefault_bool_try_use_gpu(try_use_gpu) }.into_result().map(|x| core::Stitcher { ptr: x })
}
// identifier: cv_Stitcher_registrationResol_const
pub fn registration_resol(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_Stitcher_registrationResol_const(self.as_raw_Stitcher()) }.into_result()
}
// identifier: cv_Stitcher_setRegistrationResol_double_resol_mpx
pub fn set_registration_resol(&mut self, resol_mpx: f64) -> Result<()> {
unsafe { sys::cv_core_cv_Stitcher_setRegistrationResol_double_resol_mpx(self.as_raw_Stitcher(), resol_mpx) }.into_result()
}
// identifier: cv_Stitcher_seamEstimationResol_const
pub fn seam_estimation_resol(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_Stitcher_seamEstimationResol_const(self.as_raw_Stitcher()) }.into_result()
}
// identifier: cv_Stitcher_setSeamEstimationResol_double_resol_mpx
pub fn set_seam_estimation_resol(&mut self, resol_mpx: f64) -> Result<()> {
unsafe { sys::cv_core_cv_Stitcher_setSeamEstimationResol_double_resol_mpx(self.as_raw_Stitcher(), resol_mpx) }.into_result()
}
// identifier: cv_Stitcher_compositingResol_const
pub fn compositing_resol(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_Stitcher_compositingResol_const(self.as_raw_Stitcher()) }.into_result()
}
// identifier: cv_Stitcher_setCompositingResol_double_resol_mpx
pub fn set_compositing_resol(&mut self, resol_mpx: f64) -> Result<()> {
unsafe { sys::cv_core_cv_Stitcher_setCompositingResol_double_resol_mpx(self.as_raw_Stitcher(), resol_mpx) }.into_result()
}
// identifier: cv_Stitcher_panoConfidenceThresh_const
pub fn pano_confidence_thresh(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_Stitcher_panoConfidenceThresh_const(self.as_raw_Stitcher()) }.into_result()
}
// identifier: cv_Stitcher_setPanoConfidenceThresh_double_conf_thresh
pub fn set_pano_confidence_thresh(&mut self, conf_thresh: f64) -> Result<()> {
unsafe { sys::cv_core_cv_Stitcher_setPanoConfidenceThresh_double_conf_thresh(self.as_raw_Stitcher(), conf_thresh) }.into_result()
}
// identifier: cv_Stitcher_waveCorrection_const
pub fn wave_correction(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_Stitcher_waveCorrection_const(self.as_raw_Stitcher()) }.into_result()
}
// identifier: cv_Stitcher_setWaveCorrection_bool_flag
pub fn set_wave_correction(&mut self, flag: bool) -> Result<()> {
unsafe { sys::cv_core_cv_Stitcher_setWaveCorrection_bool_flag(self.as_raw_Stitcher(), flag) }.into_result()
}
// identifier: cv_Stitcher_matchingMask_const
pub fn matching_mask(&self) -> Result<core::UMat> {
unsafe { sys::cv_core_cv_Stitcher_matchingMask_const(self.as_raw_Stitcher()) }.into_result().map(|x| core::UMat { ptr: x })
}
// identifier: cv_Stitcher_setMatchingMask_UMat_mask
pub fn set_matching_mask(&mut self, mask: &core::UMat) -> Result<()> {
unsafe { sys::cv_core_cv_Stitcher_setMatchingMask_UMat_mask(self.as_raw_Stitcher(), mask.as_raw_UMat()) }.into_result()
}
// identifier: cv_Stitcher_component_const
pub fn component(&self) -> Result<types::VectorOfint> {
unsafe { sys::cv_core_cv_Stitcher_component_const(self.as_raw_Stitcher()) }.into_result().map(|x| types::VectorOfint { ptr: x })
}
// identifier: cv_Stitcher_workScale_const
pub fn work_scale(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_Stitcher_workScale_const(self.as_raw_Stitcher()) }.into_result()
}
}
// boxed class cv::Subdiv2D
#[allow(dead_code)]
pub struct Subdiv2D {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::Subdiv2D {
fn drop(&mut self) {
unsafe { sys::cv_delete_Subdiv2D(self.ptr) };
}
}
impl core::Subdiv2D {
#[doc(hidden)] pub fn as_raw_Subdiv2D(&self) -> *mut c_void { self.ptr }
}
impl Subdiv2D {
// identifier: cv_Subdiv2D_Subdiv2D
/// creates an empty Subdiv2D object.
/// To create a new empty Delaunay subdivision you need to use the #initDelaunay function.
pub fn default() -> Result<core::Subdiv2D> {
unsafe { sys::cv_core_cv_Subdiv2D_Subdiv2D() }.into_result().map(|x| core::Subdiv2D { ptr: x })
}
// identifier: cv_Subdiv2D_Subdiv2D_Rect_rect
/// @overload
///
/// ## Parameters
/// * rect: Rectangle that includes all of the 2D points that are to be added to the subdivision.
///
/// The function creates an empty Delaunay subdivision where 2D points can be added using the function
/// insert() . All of the points to be added must be within the specified rectangle, otherwise a runtime
/// error is raised.
pub fn new(rect: core::Rect) -> Result<core::Subdiv2D> {
unsafe { sys::cv_core_cv_Subdiv2D_Subdiv2D_Rect_rect(rect) }.into_result().map(|x| core::Subdiv2D { ptr: x })
}
// identifier: cv_Subdiv2D_initDelaunay_Rect_rect
/// Creates a new empty Delaunay subdivision
///
/// ## Parameters
/// * rect: Rectangle that includes all of the 2D points that are to be added to the subdivision.
pub fn init_delaunay(&mut self, rect: core::Rect) -> Result<()> {
unsafe { sys::cv_core_cv_Subdiv2D_initDelaunay_Rect_rect(self.as_raw_Subdiv2D(), rect) }.into_result()
}
// identifier: cv_Subdiv2D_insert_Point2f_pt
/// Insert a single point into a Delaunay triangulation.
///
/// ## Parameters
/// * pt: Point to insert.
///
/// The function inserts a single point into a subdivision and modifies the subdivision topology
/// appropriately. If a point with the same coordinates exists already, no new point is added.
/// @returns the ID of the point.
///
///
/// Note: If the point is outside of the triangulation specified rect a runtime error is raised.
pub fn insert(&mut self, pt: core::Point2f) -> Result<i32> {
unsafe { sys::cv_core_cv_Subdiv2D_insert_Point2f_pt(self.as_raw_Subdiv2D(), pt) }.into_result()
}
// identifier: cv_Subdiv2D_insert_VectorOfPoint2f_ptvec
/// Insert multiple points into a Delaunay triangulation.
///
/// ## Parameters
/// * ptvec: Points to insert.
///
/// The function inserts a vector of points into a subdivision and modifies the subdivision topology
/// appropriately.
pub fn insert_n(&mut self, ptvec: &types::VectorOfPoint2f) -> Result<()> {
unsafe { sys::cv_core_cv_Subdiv2D_insert_VectorOfPoint2f_ptvec(self.as_raw_Subdiv2D(), ptvec.as_raw_VectorOfPoint2f()) }.into_result()
}
// identifier: cv_Subdiv2D_locate_Point2f_pt_int_edge_int_vertex
/// Returns the location of a point within a Delaunay triangulation.
///
/// ## Parameters
/// * pt: Point to locate.
/// * edge: Output edge that the point belongs to or is located to the right of it.
/// * vertex: Optional output vertex the input point coincides with.
///
/// The function locates the input point within the subdivision and gives one of the triangle edges
/// or vertices.
///
/// @returns an integer which specify one of the following five cases for point location:
/// * The point falls into some facet. The function returns #PTLOC_INSIDE and edge will contain one of
/// edges of the facet.
/// * The point falls onto the edge. The function returns #PTLOC_ON_EDGE and edge will contain this edge.
/// * The point coincides with one of the subdivision vertices. The function returns #PTLOC_VERTEX and
/// vertex will contain a pointer to the vertex.
/// * The point is outside the subdivision reference rectangle. The function returns #PTLOC_OUTSIDE_RECT
/// and no pointers are filled.
/// * One of input arguments is invalid. A runtime error is raised or, if silent or "parent" error
/// processing mode is selected, #PTLOC_ERROR is returned.
pub fn locate(&mut self, pt: core::Point2f, edge: i32, vertex: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_Subdiv2D_locate_Point2f_pt_int_edge_int_vertex(self.as_raw_Subdiv2D(), pt, edge, vertex) }.into_result()
}
// identifier: cv_Subdiv2D_findNearest_Point2f_pt_Point2f_X_nearestPt
/// Finds the subdivision vertex closest to the given point.
///
/// ## Parameters
/// * pt: Input point.
/// * nearestPt: Output subdivision vertex point.
///
/// The function is another function that locates the input point within the subdivision. It finds the
/// subdivision vertex that is the closest to the input point. It is not necessarily one of vertices
/// of the facet containing the input point, though the facet (located using locate() ) is used as a
/// starting point.
///
/// @returns vertex ID.
///
/// ## C++ default parameters:
/// * nearest_pt: 0
pub fn find_nearest(&mut self, pt: core::Point2f, nearest_pt: &mut core::Point2f) -> Result<i32> {
unsafe { sys::cv_core_cv_Subdiv2D_findNearest_Point2f_pt_Point2f_X_nearestPt(self.as_raw_Subdiv2D(), pt, nearest_pt) }.into_result()
}
// identifier: cv_Subdiv2D_getEdgeList_const_VectorOfVec4f_edgeList
/// Returns a list of all edges.
///
/// ## Parameters
/// * edgeList: Output vector.
///
/// The function gives each edge as a 4 numbers vector, where each two are one of the edge
/// vertices. i.e. org_x = v[0], org_y = v[1], dst_x = v[2], dst_y = v[3].
pub fn get_edge_list(&self, edge_list: &types::VectorOfVec4f) -> Result<()> {
unsafe { sys::cv_core_cv_Subdiv2D_getEdgeList_const_VectorOfVec4f_edgeList(self.as_raw_Subdiv2D(), edge_list.as_raw_VectorOfVec4f()) }.into_result()
}
// identifier: cv_Subdiv2D_getLeadingEdgeList_const_VectorOfint_leadingEdgeList
/// Returns a list of the leading edge ID connected to each triangle.
///
/// ## Parameters
/// * leadingEdgeList: Output vector.
///
/// The function gives one edge ID for each triangle.
pub fn get_leading_edge_list(&self, leading_edge_list: &types::VectorOfint) -> Result<()> {
unsafe { sys::cv_core_cv_Subdiv2D_getLeadingEdgeList_const_VectorOfint_leadingEdgeList(self.as_raw_Subdiv2D(), leading_edge_list.as_raw_VectorOfint()) }.into_result()
}
// identifier: cv_Subdiv2D_getTriangleList_const_VectorOfVec6f_triangleList
/// Returns a list of all triangles.
///
/// ## Parameters
/// * triangleList: Output vector.
///
/// The function gives each triangle as a 6 numbers vector, where each two are one of the triangle
/// vertices. i.e. p1_x = v[0], p1_y = v[1], p2_x = v[2], p2_y = v[3], p3_x = v[4], p3_y = v[5].
pub fn get_triangle_list(&self, triangle_list: &types::VectorOfVec6f) -> Result<()> {
unsafe { sys::cv_core_cv_Subdiv2D_getTriangleList_const_VectorOfVec6f_triangleList(self.as_raw_Subdiv2D(), triangle_list.as_raw_VectorOfVec6f()) }.into_result()
}
// identifier: cv_Subdiv2D_getVoronoiFacetList_VectorOfint_idx_VectorOfVectorOfPoint2f_facetList_VectorOfPoint2f_facetCenters
/// Returns a list of all Voroni facets.
///
/// ## Parameters
/// * idx: Vector of vertices IDs to consider. For all vertices you can pass empty vector.
/// * facetList: Output vector of the Voroni facets.
/// * facetCenters: Output vector of the Voroni facets center points.
pub fn get_voronoi_facet_list(&mut self, idx: &types::VectorOfint, facet_list: &types::VectorOfVectorOfPoint2f, facet_centers: &types::VectorOfPoint2f) -> Result<()> {
unsafe { sys::cv_core_cv_Subdiv2D_getVoronoiFacetList_VectorOfint_idx_VectorOfVectorOfPoint2f_facetList_VectorOfPoint2f_facetCenters(self.as_raw_Subdiv2D(), idx.as_raw_VectorOfint(), facet_list.as_raw_VectorOfVectorOfPoint2f(), facet_centers.as_raw_VectorOfPoint2f()) }.into_result()
}
// identifier: cv_Subdiv2D_getVertex_const_int_vertex_int_X_firstEdge
/// Returns vertex location from vertex ID.
///
/// ## Parameters
/// * vertex: vertex ID.
/// * firstEdge: Optional. The first edge ID which is connected to the vertex.
/// @returns vertex (x,y)
///
/// ## C++ default parameters:
/// * first_edge: 0
pub fn get_vertex(&self, vertex: i32, first_edge: &mut i32) -> Result<core::Point2f> {
unsafe { sys::cv_core_cv_Subdiv2D_getVertex_const_int_vertex_int_X_firstEdge(self.as_raw_Subdiv2D(), vertex, first_edge) }.into_result()
}
// identifier: cv_Subdiv2D_getEdge_const_int_edge_int_nextEdgeType
/// Returns one of the edges related to the given edge.
///
/// ## Parameters
/// * edge: Subdivision edge ID.
/// * nextEdgeType: Parameter specifying which of the related edges to return.
/// The following values are possible:
/// * NEXT_AROUND_ORG next around the edge origin ( eOnext on the picture below if e is the input edge)
/// * NEXT_AROUND_DST next around the edge vertex ( eDnext )
/// * PREV_AROUND_ORG previous around the edge origin (reversed eRnext )
/// * PREV_AROUND_DST previous around the edge destination (reversed eLnext )
/// * NEXT_AROUND_LEFT next around the left facet ( eLnext )
/// * NEXT_AROUND_RIGHT next around the right facet ( eRnext )
/// * PREV_AROUND_LEFT previous around the left facet (reversed eOnext )
/// * PREV_AROUND_RIGHT previous around the right facet (reversed eDnext )
///
/// 
///
/// @returns edge ID related to the input edge.
pub fn get_edge(&self, edge: i32, next_edge_type: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_Subdiv2D_getEdge_const_int_edge_int_nextEdgeType(self.as_raw_Subdiv2D(), edge, next_edge_type) }.into_result()
}
// identifier: cv_Subdiv2D_nextEdge_const_int_edge
/// Returns next edge around the edge origin.
///
/// ## Parameters
/// * edge: Subdivision edge ID.
///
/// @returns an integer which is next edge ID around the edge origin: eOnext on the
/// picture above if e is the input edge).
pub fn next_edge(&self, edge: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_Subdiv2D_nextEdge_const_int_edge(self.as_raw_Subdiv2D(), edge) }.into_result()
}
// identifier: cv_Subdiv2D_rotateEdge_const_int_edge_int_rotate
/// Returns another edge of the same quad-edge.
///
/// ## Parameters
/// * edge: Subdivision edge ID.
/// * rotate: Parameter specifying which of the edges of the same quad-edge as the input
/// one to return. The following values are possible:
/// * 0 - the input edge ( e on the picture below if e is the input edge)
/// * 1 - the rotated edge ( eRot )
/// * 2 - the reversed edge (reversed e (in green))
/// * 3 - the reversed rotated edge (reversed eRot (in green))
///
/// @returns one of the edges ID of the same quad-edge as the input edge.
pub fn rotate_edge(&self, edge: i32, rotate: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_Subdiv2D_rotateEdge_const_int_edge_int_rotate(self.as_raw_Subdiv2D(), edge, rotate) }.into_result()
}
// identifier: cv_Subdiv2D_symEdge_const_int_edge
pub fn sym_edge(&self, edge: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_Subdiv2D_symEdge_const_int_edge(self.as_raw_Subdiv2D(), edge) }.into_result()
}
// identifier: cv_Subdiv2D_edgeOrg_const_int_edge_Point2f_X_orgpt
/// Returns the edge origin.
///
/// ## Parameters
/// * edge: Subdivision edge ID.
/// * orgpt: Output vertex location.
///
/// @returns vertex ID.
///
/// ## C++ default parameters:
/// * orgpt: 0
pub fn edge_org(&self, edge: i32, orgpt: &mut core::Point2f) -> Result<i32> {
unsafe { sys::cv_core_cv_Subdiv2D_edgeOrg_const_int_edge_Point2f_X_orgpt(self.as_raw_Subdiv2D(), edge, orgpt) }.into_result()
}
// identifier: cv_Subdiv2D_edgeDst_const_int_edge_Point2f_X_dstpt
/// Returns the edge destination.
///
/// ## Parameters
/// * edge: Subdivision edge ID.
/// * dstpt: Output vertex location.
///
/// @returns vertex ID.
///
/// ## C++ default parameters:
/// * dstpt: 0
pub fn edge_dst(&self, edge: i32, dstpt: &mut core::Point2f) -> Result<i32> {
unsafe { sys::cv_core_cv_Subdiv2D_edgeDst_const_int_edge_Point2f_X_dstpt(self.as_raw_Subdiv2D(), edge, dstpt) }.into_result()
}
}
// boxed class cv::TermCriteria
/// The class defining termination criteria for iterative algorithms.
///
/// You can initialize it by default constructor and then override any parameters, or the structure may
/// be fully initialized using the advanced variant of the constructor.
#[allow(dead_code)]
pub struct TermCriteria {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::TermCriteria {
fn drop(&mut self) {
unsafe { sys::cv_delete_TermCriteria(self.ptr) };
}
}
impl core::TermCriteria {
#[doc(hidden)] pub fn as_raw_TermCriteria(&self) -> *mut c_void { self.ptr }
}
impl TermCriteria {
// identifier: cv_TermCriteria_TermCriteria
pub fn default() -> Result<core::TermCriteria> {
unsafe { sys::cv_core_cv_TermCriteria_TermCriteria() }.into_result().map(|x| core::TermCriteria { ptr: x })
}
// identifier: cv_TermCriteria_TermCriteria_int_type_int_maxCount_double_epsilon
/// ## Parameters
/// * type: The type of termination criteria, one of TermCriteria::Type
/// * maxCount: The maximum number of iterations or elements to compute.
/// * epsilon: The desired accuracy or change in parameters at which the iterative algorithm stops.
pub fn new(_type: i32, max_count: i32, epsilon: f64) -> Result<core::TermCriteria> {
unsafe { sys::cv_core_cv_TermCriteria_TermCriteria_int_type_int_maxCount_double_epsilon(_type, max_count, epsilon) }.into_result().map(|x| core::TermCriteria { ptr: x })
}
// identifier: cv_TermCriteria_isValid_const
pub fn is_valid(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_TermCriteria_isValid_const(self.as_raw_TermCriteria()) }.into_result()
}
}
// Generating impl for trait cv::ThinPlateSplineShapeTransformer (trait)
/// Definition of the transformation
///
/// occupied in the paper "Principal Warps: Thin-Plate Splines and Decomposition of Deformations", by
/// F.L. Bookstein (PAMI 1989). :
pub trait ThinPlateSplineShapeTransformer : core::ShapeTransformer {
#[doc(hidden)] fn as_raw_ThinPlateSplineShapeTransformer(&self) -> *mut c_void;
// identifier: cv_ThinPlateSplineShapeTransformer_setRegularizationParameter_double_beta
/// Set the regularization parameter for relaxing the exact interpolation requirements of the TPS
/// algorithm.
///
/// ## Parameters
/// * beta: value of the regularization parameter.
fn set_regularization_parameter(&mut self, beta: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ThinPlateSplineShapeTransformer_setRegularizationParameter_double_beta(self.as_raw_ThinPlateSplineShapeTransformer(), beta) }.into_result()
}
// identifier: cv_ThinPlateSplineShapeTransformer_getRegularizationParameter_const
fn get_regularization_parameter(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ThinPlateSplineShapeTransformer_getRegularizationParameter_const(self.as_raw_ThinPlateSplineShapeTransformer()) }.into_result()
}
}
impl<'a> ThinPlateSplineShapeTransformer + 'a {
}
// boxed class cv::TickMeter
/// a Class to measure passing time.
///
/// The class computes passing time by counting the number of ticks per second. That is, the following code computes the
/// execution time in seconds:
/// ```ignore
/// TickMeter tm;
/// tm.start();
/// // do something ...
/// tm.stop();
/// std::cout << tm.getTimeSec();
/// ```
///
///
/// It is also possible to compute the average time over multiple runs:
/// ```ignore
/// TickMeter tm;
/// for (int i = 0; i < 100; i++)
/// {
/// tm.start();
/// // do something ...
/// tm.stop();
/// }
/// double average_time = tm.getTimeSec() / tm.getCounter();
/// std::cout << "Average time in second per iteration is: " << average_time << std::endl;
/// ```
///
/// @sa getTickCount, getTickFrequency
#[allow(dead_code)]
pub struct TickMeter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::TickMeter {
fn drop(&mut self) {
unsafe { sys::cv_delete_TickMeter(self.ptr) };
}
}
impl core::TickMeter {
#[doc(hidden)] pub fn as_raw_TickMeter(&self) -> *mut c_void { self.ptr }
}
impl TickMeter {
// identifier: cv_TickMeter_TickMeter
pub fn new() -> Result<core::TickMeter> {
unsafe { sys::cv_core_cv_TickMeter_TickMeter() }.into_result().map(|x| core::TickMeter { ptr: x })
}
// identifier: cv_TickMeter_start
/// starts counting ticks.
pub fn start(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_TickMeter_start(self.as_raw_TickMeter()) }.into_result()
}
// identifier: cv_TickMeter_stop
/// stops counting ticks.
pub fn stop(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_TickMeter_stop(self.as_raw_TickMeter()) }.into_result()
}
// identifier: cv_TickMeter_getTimeTicks_const
/// returns counted ticks.
pub fn get_time_ticks(&self) -> Result<i64> {
unsafe { sys::cv_core_cv_TickMeter_getTimeTicks_const(self.as_raw_TickMeter()) }.into_result()
}
// identifier: cv_TickMeter_getTimeMicro_const
/// returns passed time in microseconds.
pub fn get_time_micro(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_TickMeter_getTimeMicro_const(self.as_raw_TickMeter()) }.into_result()
}
// identifier: cv_TickMeter_getTimeMilli_const
/// returns passed time in milliseconds.
pub fn get_time_milli(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_TickMeter_getTimeMilli_const(self.as_raw_TickMeter()) }.into_result()
}
// identifier: cv_TickMeter_getTimeSec_const
/// returns passed time in seconds.
pub fn get_time_sec(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_TickMeter_getTimeSec_const(self.as_raw_TickMeter()) }.into_result()
}
// identifier: cv_TickMeter_getCounter_const
/// returns internal counter value.
pub fn get_counter(&self) -> Result<i64> {
unsafe { sys::cv_core_cv_TickMeter_getCounter_const(self.as_raw_TickMeter()) }.into_result()
}
// identifier: cv_TickMeter_reset
/// resets internal values.
pub fn reset(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_TickMeter_reset(self.as_raw_TickMeter()) }.into_result()
}
}
// Generating impl for trait cv::Tonemap (trait)
/// Base class for tonemapping algorithms - tools that are used to map HDR image to 8-bit range.
pub trait Tonemap : core::Algorithm {
#[doc(hidden)] fn as_raw_Tonemap(&self) -> *mut c_void;
// identifier: cv_Tonemap_process_Mat_src_Mat_dst
/// Tonemaps image
///
/// ## Parameters
/// * src: source image - 32-bit 3-channel Mat
/// * dst: destination image - 32-bit 3-channel Mat with values in [0, 1] range
fn process(&mut self, src: &core::Mat, dst: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_Tonemap_process_Mat_src_Mat_dst(self.as_raw_Tonemap(), src.as_raw_Mat(), dst.as_raw_Mat()) }.into_result()
}
// identifier: cv_Tonemap_getGamma_const
fn get_gamma(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_Tonemap_getGamma_const(self.as_raw_Tonemap()) }.into_result()
}
// identifier: cv_Tonemap_setGamma_float_gamma
fn set_gamma(&mut self, gamma: f32) -> Result<()> {
unsafe { sys::cv_core_cv_Tonemap_setGamma_float_gamma(self.as_raw_Tonemap(), gamma) }.into_result()
}
}
impl<'a> Tonemap + 'a {
}
// Generating impl for trait cv::TonemapDrago (trait)
/// Adaptive logarithmic mapping is a fast global tonemapping algorithm that scales the image in
/// logarithmic domain.
///
/// Since it's a global operator the same function is applied to all the pixels, it is controlled by the
/// bias parameter.
///
/// Optional saturation enhancement is possible as described in @cite FL02 .
///
/// For more information see @cite DM03 .
pub trait TonemapDrago : core::Tonemap {
#[doc(hidden)] fn as_raw_TonemapDrago(&self) -> *mut c_void;
// identifier: cv_TonemapDrago_getSaturation_const
fn get_saturation(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_TonemapDrago_getSaturation_const(self.as_raw_TonemapDrago()) }.into_result()
}
// identifier: cv_TonemapDrago_setSaturation_float_saturation
fn set_saturation(&mut self, saturation: f32) -> Result<()> {
unsafe { sys::cv_core_cv_TonemapDrago_setSaturation_float_saturation(self.as_raw_TonemapDrago(), saturation) }.into_result()
}
// identifier: cv_TonemapDrago_getBias_const
fn get_bias(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_TonemapDrago_getBias_const(self.as_raw_TonemapDrago()) }.into_result()
}
// identifier: cv_TonemapDrago_setBias_float_bias
fn set_bias(&mut self, bias: f32) -> Result<()> {
unsafe { sys::cv_core_cv_TonemapDrago_setBias_float_bias(self.as_raw_TonemapDrago(), bias) }.into_result()
}
}
impl<'a> TonemapDrago + 'a {
}
// Generating impl for trait cv::TonemapMantiuk (trait)
/// This algorithm transforms image to contrast using gradients on all levels of gaussian pyramid,
/// transforms contrast values to HVS response and scales the response. After this the image is
/// reconstructed from new contrast values.
///
/// For more information see @cite MM06 .
pub trait TonemapMantiuk : core::Tonemap {
#[doc(hidden)] fn as_raw_TonemapMantiuk(&self) -> *mut c_void;
// identifier: cv_TonemapMantiuk_getScale_const
fn get_scale(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_TonemapMantiuk_getScale_const(self.as_raw_TonemapMantiuk()) }.into_result()
}
// identifier: cv_TonemapMantiuk_setScale_float_scale
fn set_scale(&mut self, scale: f32) -> Result<()> {
unsafe { sys::cv_core_cv_TonemapMantiuk_setScale_float_scale(self.as_raw_TonemapMantiuk(), scale) }.into_result()
}
// identifier: cv_TonemapMantiuk_getSaturation_const
fn get_saturation(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_TonemapMantiuk_getSaturation_const(self.as_raw_TonemapMantiuk()) }.into_result()
}
// identifier: cv_TonemapMantiuk_setSaturation_float_saturation
fn set_saturation(&mut self, saturation: f32) -> Result<()> {
unsafe { sys::cv_core_cv_TonemapMantiuk_setSaturation_float_saturation(self.as_raw_TonemapMantiuk(), saturation) }.into_result()
}
}
impl<'a> TonemapMantiuk + 'a {
}
// Generating impl for trait cv::TonemapReinhard (trait)
/// This is a global tonemapping operator that models human visual system.
///
/// Mapping function is controlled by adaptation parameter, that is computed using light adaptation and
/// color adaptation.
///
/// For more information see @cite RD05 .
pub trait TonemapReinhard : core::Tonemap {
#[doc(hidden)] fn as_raw_TonemapReinhard(&self) -> *mut c_void;
// identifier: cv_TonemapReinhard_getIntensity_const
fn get_intensity(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_TonemapReinhard_getIntensity_const(self.as_raw_TonemapReinhard()) }.into_result()
}
// identifier: cv_TonemapReinhard_setIntensity_float_intensity
fn set_intensity(&mut self, intensity: f32) -> Result<()> {
unsafe { sys::cv_core_cv_TonemapReinhard_setIntensity_float_intensity(self.as_raw_TonemapReinhard(), intensity) }.into_result()
}
// identifier: cv_TonemapReinhard_getLightAdaptation_const
fn get_light_adaptation(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_TonemapReinhard_getLightAdaptation_const(self.as_raw_TonemapReinhard()) }.into_result()
}
// identifier: cv_TonemapReinhard_setLightAdaptation_float_light_adapt
fn set_light_adaptation(&mut self, light_adapt: f32) -> Result<()> {
unsafe { sys::cv_core_cv_TonemapReinhard_setLightAdaptation_float_light_adapt(self.as_raw_TonemapReinhard(), light_adapt) }.into_result()
}
// identifier: cv_TonemapReinhard_getColorAdaptation_const
fn get_color_adaptation(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_TonemapReinhard_getColorAdaptation_const(self.as_raw_TonemapReinhard()) }.into_result()
}
// identifier: cv_TonemapReinhard_setColorAdaptation_float_color_adapt
fn set_color_adaptation(&mut self, color_adapt: f32) -> Result<()> {
unsafe { sys::cv_core_cv_TonemapReinhard_setColorAdaptation_float_color_adapt(self.as_raw_TonemapReinhard(), color_adapt) }.into_result()
}
}
impl<'a> TonemapReinhard + 'a {
}
// boxed class cv::TransverseMercatorWarper
#[allow(dead_code)]
pub struct TransverseMercatorWarper {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::TransverseMercatorWarper {
fn drop(&mut self) {
unsafe { sys::cv_delete_TransverseMercatorWarper(self.ptr) };
}
}
impl core::TransverseMercatorWarper {
#[doc(hidden)] pub fn as_raw_TransverseMercatorWarper(&self) -> *mut c_void { self.ptr }
}
impl core::WarperCreator for TransverseMercatorWarper {
#[doc(hidden)] fn as_raw_WarperCreator(&self) -> *mut c_void { self.ptr }
}
impl TransverseMercatorWarper {
}
// boxed class cv::UMat
/// @todo document
#[allow(dead_code)]
pub struct UMat {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::UMat {
fn drop(&mut self) {
unsafe { sys::cv_delete_UMat(self.ptr) };
}
}
impl core::UMat {
#[doc(hidden)] pub fn as_raw_UMat(&self) -> *mut c_void { self.ptr }
}
impl UMat {
// identifier: cv_UMat_getMat_const_int_flags
pub fn get_mat(&self, flags: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_UMat_getMat_const_int_flags(self.as_raw_UMat(), flags) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_UMat_copyTo_const_Mat_m
pub fn copy_to(&self, m: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_UMat_copyTo_const_Mat_m(self.as_raw_UMat(), m.as_raw_Mat()) }.into_result()
}
// identifier: cv_UMat_copyTo_const_Mat_m_Mat_mask
pub fn copy_to_masked(&self, m: &mut core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_UMat_copyTo_const_Mat_m_Mat_mask(self.as_raw_UMat(), m.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_UMat_convertTo_const_Mat_m_int_rtype_double_alpha_double_beta
///
/// ## C++ default parameters:
/// * alpha: 1
/// * beta: 0
pub fn convert_to(&self, m: &mut core::Mat, rtype: i32, alpha: f64, beta: f64) -> Result<()> {
unsafe { sys::cv_core_cv_UMat_convertTo_const_Mat_m_int_rtype_double_alpha_double_beta(self.as_raw_UMat(), m.as_raw_Mat(), rtype, alpha, beta) }.into_result()
}
// identifier: cv_UMat_dot_const_Mat_m
pub fn dot(&self, m: &core::Mat) -> Result<f64> {
unsafe { sys::cv_core_cv_UMat_dot_const_Mat_m(self.as_raw_UMat(), m.as_raw_Mat()) }.into_result()
}
// identifier: cv_UMat_addref
pub fn addref(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_UMat_addref(self.as_raw_UMat()) }.into_result()
}
// identifier: cv_UMat_release
pub fn release(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_UMat_release(self.as_raw_UMat()) }.into_result()
}
// identifier: cv_UMat_deallocate
pub fn deallocate(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_UMat_deallocate(self.as_raw_UMat()) }.into_result()
}
// identifier: cv_UMat_locateROI_const_Size_wholeSize_Point_ofs
pub fn locate_roi(&self, whole_size: core::Size, ofs: core::Point) -> Result<()> {
unsafe { sys::cv_core_cv_UMat_locateROI_const_Size_wholeSize_Point_ofs(self.as_raw_UMat(), whole_size, ofs) }.into_result()
}
// identifier: cv_UMat_isContinuous_const
pub fn is_continuous(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_UMat_isContinuous_const(self.as_raw_UMat()) }.into_result()
}
// identifier: cv_UMat_isSubmatrix_const
pub fn is_submatrix(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_UMat_isSubmatrix_const(self.as_raw_UMat()) }.into_result()
}
// identifier: cv_UMat_elemSize_const
pub fn elem_size(&self) -> Result<size_t> {
unsafe { sys::cv_core_cv_UMat_elemSize_const(self.as_raw_UMat()) }.into_result()
}
// identifier: cv_UMat_elemSize1_const
pub fn elem_size1(&self) -> Result<size_t> {
unsafe { sys::cv_core_cv_UMat_elemSize1_const(self.as_raw_UMat()) }.into_result()
}
// identifier: cv_UMat_type_const
pub fn typ(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_UMat_type_const(self.as_raw_UMat()) }.into_result()
}
// identifier: cv_UMat_depth_const
pub fn depth(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_UMat_depth_const(self.as_raw_UMat()) }.into_result()
}
// identifier: cv_UMat_channels_const
pub fn channels(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_UMat_channels_const(self.as_raw_UMat()) }.into_result()
}
// identifier: cv_UMat_step1_const_int_i
///
/// ## C++ default parameters:
/// * i: 0
pub fn step1(&self, i: i32) -> Result<size_t> {
unsafe { sys::cv_core_cv_UMat_step1_const_int_i(self.as_raw_UMat(), i) }.into_result()
}
// identifier: cv_UMat_empty_const
pub fn empty(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_UMat_empty_const(self.as_raw_UMat()) }.into_result()
}
// identifier: cv_UMat_total_const
pub fn total(&self) -> Result<size_t> {
unsafe { sys::cv_core_cv_UMat_total_const(self.as_raw_UMat()) }.into_result()
}
// identifier: cv_UMat_checkVector_const_int_elemChannels_int_depth_bool_requireContinuous
///
/// ## C++ default parameters:
/// * depth: -1
/// * require_continuous: true
pub fn check_vector(&self, elem_channels: i32, depth: i32, require_continuous: bool) -> Result<i32> {
unsafe { sys::cv_core_cv_UMat_checkVector_const_int_elemChannels_int_depth_bool_requireContinuous(self.as_raw_UMat(), elem_channels, depth, require_continuous) }.into_result()
}
// identifier: cv_UMat_handle_const_int_accessFlags
pub fn handle(&self, access_flags: i32) -> Result<&mut c_void> {
unsafe { sys::cv_core_cv_UMat_handle_const_int_accessFlags(self.as_raw_UMat(), access_flags) }.into_result().and_then(|x| unsafe { x.as_mut() }.ok_or_else(|| Error::new(core::StsNullPtr, format!("Function returned Null pointer"))))
}
// identifier: cv_UMat_ndoffset_const_size_t_X_ofs
pub fn ndoffset(&self, ofs: &mut size_t) -> Result<()> {
unsafe { sys::cv_core_cv_UMat_ndoffset_const_size_t_X_ofs(self.as_raw_UMat(), ofs) }.into_result()
}
// identifier: cv_UMat_updateContinuityFlag
pub fn update_continuity_flag(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_UMat_updateContinuityFlag(self.as_raw_UMat()) }.into_result()
}
}
// boxed class cv::UMatData
/// Comma-separated Matrix Initializer
///
/// The class instances are usually not created explicitly.
/// Instead, they are created on "matrix << firstValue" operator.
///
/// The sample below initializes 2x2 rotation matrix:
///
/// \code
/// double angle = 30, a = cos(angle*CV_PI/180), b = sin(angle*CV_PI/180);
/// Mat R = (Mat_<double>(2,2) << a, -b, b, a);
/// \endcode
#[allow(dead_code)]
pub struct UMatData {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::UMatData {
fn drop(&mut self) {
unsafe { sys::cv_delete_UMatData(self.ptr) };
}
}
impl core::UMatData {
#[doc(hidden)] pub fn as_raw_UMatData(&self) -> *mut c_void { self.ptr }
}
impl UMatData {
// identifier: cv_UMatData_lock
pub fn lock(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_UMatData_lock(self.as_raw_UMatData()) }.into_result()
}
// identifier: cv_UMatData_unlock
pub fn unlock(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_UMatData_unlock(self.as_raw_UMatData()) }.into_result()
}
// identifier: cv_UMatData_hostCopyObsolete_const
pub fn host_copy_obsolete(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_UMatData_hostCopyObsolete_const(self.as_raw_UMatData()) }.into_result()
}
// identifier: cv_UMatData_deviceCopyObsolete_const
pub fn device_copy_obsolete(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_UMatData_deviceCopyObsolete_const(self.as_raw_UMatData()) }.into_result()
}
// identifier: cv_UMatData_deviceMemMapped_const
pub fn device_mem_mapped(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_UMatData_deviceMemMapped_const(self.as_raw_UMatData()) }.into_result()
}
// identifier: cv_UMatData_copyOnMap_const
pub fn copy_on_map(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_UMatData_copyOnMap_const(self.as_raw_UMatData()) }.into_result()
}
// identifier: cv_UMatData_tempUMat_const
pub fn temp_u_mat(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_UMatData_tempUMat_const(self.as_raw_UMatData()) }.into_result()
}
// identifier: cv_UMatData_tempCopiedUMat_const
pub fn temp_copied_u_mat(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_UMatData_tempCopiedUMat_const(self.as_raw_UMatData()) }.into_result()
}
// identifier: cv_UMatData_markHostCopyObsolete_bool_flag
pub fn mark_host_copy_obsolete(&mut self, flag: bool) -> Result<()> {
unsafe { sys::cv_core_cv_UMatData_markHostCopyObsolete_bool_flag(self.as_raw_UMatData(), flag) }.into_result()
}
// identifier: cv_UMatData_markDeviceCopyObsolete_bool_flag
pub fn mark_device_copy_obsolete(&mut self, flag: bool) -> Result<()> {
unsafe { sys::cv_core_cv_UMatData_markDeviceCopyObsolete_bool_flag(self.as_raw_UMatData(), flag) }.into_result()
}
// identifier: cv_UMatData_markDeviceMemMapped_bool_flag
pub fn mark_device_mem_mapped(&mut self, flag: bool) -> Result<()> {
unsafe { sys::cv_core_cv_UMatData_markDeviceMemMapped_bool_flag(self.as_raw_UMatData(), flag) }.into_result()
}
}
// boxed class cv::VideoCapture
/// Class for video capturing from video files, image sequences or cameras.
///
/// The class provides C++ API for capturing video from cameras or for reading video files and image sequences.
///
/// Here is how the class can be used:
/// @include samples/cpp/videocapture_basic.cpp
///
///
/// Note: In @ref videoio_c "C API" the black-box structure `CvCapture` is used instead of %VideoCapture.
///
/// Note:
/// * (C++) A basic sample on using the %VideoCapture interface can be found at
/// `OPENCV_SOURCE_CODE/samples/cpp/videocapture_starter.cpp`
/// * (Python) A basic sample on using the %VideoCapture interface can be found at
/// `OPENCV_SOURCE_CODE/samples/python/video.py`
/// * (Python) A multi threaded video processing sample can be found at
/// `OPENCV_SOURCE_CODE/samples/python/video_threaded.py`
/// * (Python) %VideoCapture sample showcasing some features of the Video4Linux2 backend
/// `OPENCV_SOURCE_CODE/samples/python/video_v4l2.py`
#[allow(dead_code)]
pub struct VideoCapture {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::VideoCapture {
fn drop(&mut self) {
unsafe { sys::cv_delete_VideoCapture(self.ptr) };
}
}
impl core::VideoCapture {
#[doc(hidden)] pub fn as_raw_VideoCapture(&self) -> *mut c_void { self.ptr }
}
impl VideoCapture {
// identifier: cv_VideoCapture_VideoCapture
/// Default constructor
///
/// Note: In @ref videoio_c "C API", when you finished working with video, release CvCapture structure with
/// cvReleaseCapture(), or use Ptr\<CvCapture\> that calls cvReleaseCapture() automatically in the
/// destructor.
pub fn default() -> Result<core::VideoCapture> {
unsafe { sys::cv_core_cv_VideoCapture_VideoCapture() }.into_result().map(|x| core::VideoCapture { ptr: x })
}
// identifier: cv_VideoCapture_VideoCapture_String_filename
/// @overload
/// Open video file or a capturing device or a IP video stream for video capturing
///
/// Same as VideoCapture(const String& filename, int apiPreference) but using default Capture API backends
pub fn filename(filename: &str) -> Result<core::VideoCapture> {
string_arg!(filename);
unsafe { sys::cv_core_cv_VideoCapture_VideoCapture_String_filename(filename.as_ptr()) }.into_result().map(|x| core::VideoCapture { ptr: x })
}
// identifier: cv_VideoCapture_VideoCapture_String_filename_int_apiPreference
/// @overload
/// Open video file or a capturing device or a IP video stream for video capturing with API Preference
///
/// ## Parameters
/// * filename: it can be:
/// - name of video file (eg. `video.avi`)
/// - or image sequence (eg. `img_%02d.jpg`, which will read samples like `img_00.jpg, img_01.jpg, img_02.jpg, ...`)
/// - or URL of video stream (eg. `protocol://host:port/script_name?script_params|auth`).
/// Note that each video stream or IP camera feed has its own URL scheme. Please refer to the
/// documentation of source stream to know the right URL.
/// * apiPreference: preferred Capture API backends to use. Can be used to enforce a specific reader
/// implementation if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_IMAGES or cv::CAP_DSHOW.
/// @sa The list of supported API backends cv::VideoCaptureAPIs
pub fn filename_api(filename: &str, api_preference: i32) -> Result<core::VideoCapture> {
string_arg!(filename);
unsafe { sys::cv_core_cv_VideoCapture_VideoCapture_String_filename_int_apiPreference(filename.as_ptr(), api_preference) }.into_result().map(|x| core::VideoCapture { ptr: x })
}
// identifier: cv_VideoCapture_VideoCapture_int_index
/// @overload
/// Open a camera for video capturing
///
/// ## Parameters
/// * index: camera_id + domain_offset (CAP_*) id of the video capturing device to open. To open default camera using default backend just pass 0.
/// Use a `domain_offset` to enforce a specific reader implementation if multiple are available like cv::CAP_FFMPEG or cv::CAP_IMAGES or cv::CAP_DSHOW.
/// e.g. to open Camera 1 using the MS Media Foundation API use `index = 1 + cv::CAP_MSMF`
///
/// @sa The list of supported API backends cv::VideoCaptureAPIs
pub fn index(index: i32) -> Result<core::VideoCapture> {
unsafe { sys::cv_core_cv_VideoCapture_VideoCapture_int_index(index) }.into_result().map(|x| core::VideoCapture { ptr: x })
}
// identifier: cv_VideoCapture_VideoCapture_int_index_int_apiPreference
/// @overload
/// Opens a camera for video capturing
///
/// ## Parameters
/// * index: id of the video capturing device to open. To open default camera using default backend just pass 0.
/// (to backward compatibility usage of camera_id + domain_offset (CAP_*) is valid when apiPreference is CAP_ANY)
/// * apiPreference: preferred Capture API backends to use. Can be used to enforce a specific reader
/// implementation if multiple are available: e.g. cv::CAP_DSHOW or cv::CAP_MSMF or cv::CAP_V4L2.
///
/// @sa The list of supported API backends cv::VideoCaptureAPIs
pub fn new(index: i32, api_preference: i32) -> Result<core::VideoCapture> {
unsafe { sys::cv_core_cv_VideoCapture_VideoCapture_int_index_int_apiPreference(index, api_preference) }.into_result().map(|x| core::VideoCapture { ptr: x })
}
// identifier: cv_VideoCapture_open_String_filename
/// Open video file or a capturing device or a IP video stream for video capturing
///
/// @overload
///
/// Parameters are same as the constructor VideoCapture(const String& filename)
/// @return `true` if the file has been successfully opened
///
/// The method first calls VideoCapture::release to close the already opened file or camera.
pub fn open_filename(&mut self, filename: &str) -> Result<bool> {
string_arg!(filename);
unsafe { sys::cv_core_cv_VideoCapture_open_String_filename(self.as_raw_VideoCapture(), filename.as_ptr()) }.into_result()
}
// identifier: cv_VideoCapture_open_int_index
/// Open a camera for video capturing
///
/// @overload
///
/// Parameters are same as the constructor VideoCapture(int index)
/// @return `true` if the camera has been successfully opened.
///
/// The method first calls VideoCapture::release to close the already opened file or camera.
pub fn open_index(&mut self, index: i32) -> Result<bool> {
unsafe { sys::cv_core_cv_VideoCapture_open_int_index(self.as_raw_VideoCapture(), index) }.into_result()
}
// identifier: cv_VideoCapture_open_int_cameraNum_int_apiPreference
/// Open a camera for video capturing
///
/// @overload
///
/// Parameters are similar as the constructor VideoCapture(int index),except it takes an additional argument apiPreference.
/// Definitely, is same as open(int index) where `index=cameraNum + apiPreference`
/// @return `true` if the camera has been successfully opened.
pub fn open(&mut self, camera_num: i32, api_preference: i32) -> Result<bool> {
unsafe { sys::cv_core_cv_VideoCapture_open_int_cameraNum_int_apiPreference(self.as_raw_VideoCapture(), camera_num, api_preference) }.into_result()
}
// identifier: cv_VideoCapture_isOpened_const
/// Returns true if video capturing has been initialized already.
///
/// If the previous call to VideoCapture constructor or VideoCapture::open() succeeded, the method returns
/// true.
pub fn is_opened(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_VideoCapture_isOpened_const(self.as_raw_VideoCapture()) }.into_result()
}
// identifier: cv_VideoCapture_release
/// Closes video file or capturing device.
///
/// The method is automatically called by subsequent VideoCapture::open and by VideoCapture
/// destructor.
///
/// The C function also deallocates memory and clears \*capture pointer.
pub fn release(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_VideoCapture_release(self.as_raw_VideoCapture()) }.into_result()
}
// identifier: cv_VideoCapture_grab
/// Grabs the next frame from video file or capturing device.
///
/// @return `true` (non-zero) in the case of success.
///
/// The method/function grabs the next frame from video file or camera and returns true (non-zero) in
/// the case of success.
///
/// The primary use of the function is in multi-camera environments, especially when the cameras do not
/// have hardware synchronization. That is, you call VideoCapture::grab() for each camera and after that
/// call the slower method VideoCapture::retrieve() to decode and get frame from each camera. This way
/// the overhead on demosaicing or motion jpeg decompression etc. is eliminated and the retrieved frames
/// from different cameras will be closer in time.
///
/// Also, when a connected camera is multi-head (for example, a stereo camera or a Kinect device), the
/// correct way of retrieving data from it is to call VideoCapture::grab() first and then call
/// VideoCapture::retrieve() one or more times with different values of the channel parameter.
///
/// @ref tutorial_kinect_openni
pub fn grab(&mut self) -> Result<bool> {
unsafe { sys::cv_core_cv_VideoCapture_grab(self.as_raw_VideoCapture()) }.into_result()
}
// identifier: cv_VideoCapture_retrieve_Mat_image_int_flag
/// Decodes and returns the grabbed video frame.
///
/// ## Parameters
/// * [out]: image the video frame is returned here. If no frames has been grabbed the image will be empty.
/// * flag: it could be a frame index or a driver specific flag
/// @return `false` if no frames has been grabbed
///
/// The method decodes and returns the just grabbed frame. If no frames has been grabbed
/// (camera has been disconnected, or there are no more frames in video file), the method returns false
/// and the function returns an empty image (with %cv::Mat, test it with Mat::empty()).
///
/// @sa read()
///
///
/// Note: In @ref videoio_c "C API", functions cvRetrieveFrame() and cv.RetrieveFrame() return image stored inside the video
/// capturing structure. It is not allowed to modify or release the image! You can copy the frame using
/// cvCloneImage and then do whatever you want with the copy.
///
/// ## C++ default parameters:
/// * flag: 0
pub fn retrieve(&mut self, image: &mut core::Mat, flag: i32) -> Result<bool> {
unsafe { sys::cv_core_cv_VideoCapture_retrieve_Mat_image_int_flag(self.as_raw_VideoCapture(), image.as_raw_Mat(), flag) }.into_result()
}
// identifier: cv_VideoCapture_read_Mat_image
/// Grabs, decodes and returns the next video frame.
///
/// ## Parameters
/// * [out]: image the video frame is returned here. If no frames has been grabbed the image will be empty.
/// @return `false` if no frames has been grabbed
///
/// The method/function combines VideoCapture::grab() and VideoCapture::retrieve() in one call. This is the
/// most convenient method for reading video files or capturing data from decode and returns the just
/// grabbed frame. If no frames has been grabbed (camera has been disconnected, or there are no more
/// frames in video file), the method returns false and the function returns empty image (with %cv::Mat, test it with Mat::empty()).
///
///
/// Note: In @ref videoio_c "C API", functions cvRetrieveFrame() and cv.RetrieveFrame() return image stored inside the video
/// capturing structure. It is not allowed to modify or release the image! You can copy the frame using
/// cvCloneImage and then do whatever you want with the copy.
pub fn read(&mut self, image: &mut core::Mat) -> Result<bool> {
unsafe { sys::cv_core_cv_VideoCapture_read_Mat_image(self.as_raw_VideoCapture(), image.as_raw_Mat()) }.into_result()
}
// identifier: cv_VideoCapture_set_int_propId_double_value
/// Sets a property in the VideoCapture.
///
/// ## Parameters
/// * propId: Property identifier from cv::VideoCaptureProperties (eg. cv::CAP_PROP_POS_MSEC, cv::CAP_PROP_POS_FRAMES, ...)
/// or one from @ref videoio_flags_others
/// * value: Value of the property.
/// @return `true` if the property is supported by backend used by the VideoCapture instance.
///
/// Note: Even if it returns `true` this doesn't ensure that the property
/// value has been accepted by the capture device. See note in VideoCapture::get()
pub fn set(&mut self, prop_id: i32, value: f64) -> Result<bool> {
unsafe { sys::cv_core_cv_VideoCapture_set_int_propId_double_value(self.as_raw_VideoCapture(), prop_id, value) }.into_result()
}
// identifier: cv_VideoCapture_get_const_int_propId
/// Returns the specified VideoCapture property
///
/// ## Parameters
/// * propId: Property identifier from cv::VideoCaptureProperties (eg. cv::CAP_PROP_POS_MSEC, cv::CAP_PROP_POS_FRAMES, ...)
/// or one from @ref videoio_flags_others
/// @return Value for the specified property. Value 0 is returned when querying a property that is
/// not supported by the backend used by the VideoCapture instance.
///
///
/// Note: Reading / writing properties involves many layers. Some unexpected result might happens
/// along this chain.
/// ```ignore {.txt}
/// `VideoCapture -> API Backend -> Operating System -> Device Driver -> Device Hardware`
/// ```
///
/// The returned value might be different from what really used by the device or it could be encoded
/// using device dependent rules (eg. steps or percentage). Effective behaviour depends from device
/// driver and API Backend
pub fn get(&self, prop_id: i32) -> Result<f64> {
unsafe { sys::cv_core_cv_VideoCapture_get_const_int_propId(self.as_raw_VideoCapture(), prop_id) }.into_result()
}
// identifier: cv_VideoCapture_open_String_filename_int_apiPreference
/// Open video file or a capturing device or a IP video stream for video capturing with API Preference
///
/// @overload
///
/// Parameters are same as the constructor VideoCapture(const String& filename, int apiPreference)
/// @return `true` if the file has been successfully opened
///
/// The method first calls VideoCapture::release to close the already opened file or camera.
pub fn open_filename_api(&mut self, filename: &str, api_preference: i32) -> Result<bool> {
string_arg!(filename);
unsafe { sys::cv_core_cv_VideoCapture_open_String_filename_int_apiPreference(self.as_raw_VideoCapture(), filename.as_ptr(), api_preference) }.into_result()
}
// identifier: cv_VideoCapture_getBackendName_const
/// Returns used backend API name
///
///
/// Note: Stream should be opened.
pub fn get_backend_name(&self) -> Result<String> {
unsafe { sys::cv_core_cv_VideoCapture_getBackendName_const(self.as_raw_VideoCapture()) }.into_result().map(crate::templ::receive_string_mut)
}
}
// boxed class cv::VideoWriter
/// Video writer class.
///
/// The class provides C++ API for writing video files or image sequences.
#[allow(dead_code)]
pub struct VideoWriter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::VideoWriter {
fn drop(&mut self) {
unsafe { sys::cv_delete_VideoWriter(self.ptr) };
}
}
impl core::VideoWriter {
#[doc(hidden)] pub fn as_raw_VideoWriter(&self) -> *mut c_void { self.ptr }
}
impl VideoWriter {
// identifier: cv_VideoWriter_VideoWriter
/// Default constructors
///
/// The constructors/functions initialize video writers.
/// * On Linux FFMPEG is used to write videos;
/// * On Windows FFMPEG or VFW is used;
/// * On MacOSX QTKit is used.
pub fn default() -> Result<core::VideoWriter> {
unsafe { sys::cv_core_cv_VideoWriter_VideoWriter() }.into_result().map(|x| core::VideoWriter { ptr: x })
}
// identifier: cv_VideoWriter_VideoWriter_String_filename_int_fourcc_double_fps_Size_frameSize_bool_isColor
/// @overload
/// ## Parameters
/// * filename: Name of the output video file.
/// * fourcc: 4-character code of codec used to compress the frames. For example,
/// VideoWriter::fourcc('P','I','M','1') is a MPEG-1 codec, VideoWriter::fourcc('M','J','P','G') is a
/// motion-jpeg codec etc. List of codes can be obtained at [Video Codecs by
/// FOURCC](http://www.fourcc.org/codecs.php) page. FFMPEG backend with MP4 container natively uses
/// other values as fourcc code: see [ObjectType](http://www.mp4ra.org/codecs.html),
/// so you may receive a warning message from OpenCV about fourcc code conversion.
/// * fps: Framerate of the created video stream.
/// * frameSize: Size of the video frames.
/// * isColor: If it is not zero, the encoder will expect and encode color frames, otherwise it
/// will work with grayscale frames (the flag is currently supported on Windows only).
///
/// @b Tips:
/// - With some backends `fourcc=-1` pops up the codec selection dialog from the system.
/// - To save image sequence use a proper filename (eg. `img_%02d.jpg`) and `fourcc=0`
/// OR `fps=0`. Use uncompressed image format (eg. `img_%02d.BMP`) to save raw frames.
/// - Most codecs are lossy. If you want lossless video file you need to use a lossless codecs
/// (eg. FFMPEG FFV1, Huffman HFYU, Lagarith LAGS, etc...)
/// - If FFMPEG is enabled, using `codec=0; fps=0;` you can create an uncompressed (raw) video file.
///
/// ## C++ default parameters:
/// * is_color: true
pub fn new(filename: &str, fourcc: i32, fps: f64, frame_size: core::Size, is_color: bool) -> Result<core::VideoWriter> {
string_arg!(filename);
unsafe { sys::cv_core_cv_VideoWriter_VideoWriter_String_filename_int_fourcc_double_fps_Size_frameSize_bool_isColor(filename.as_ptr(), fourcc, fps, frame_size, is_color) }.into_result().map(|x| core::VideoWriter { ptr: x })
}
// identifier: cv_VideoWriter_VideoWriter_String_filename_int_apiPreference_int_fourcc_double_fps_Size_frameSize_bool_isColor
/// @overload
/// The `apiPreference` parameter allows to specify API backends to use. Can be used to enforce a specific reader implementation
/// if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_GSTREAMER.
///
/// ## C++ default parameters:
/// * is_color: true
pub fn new_1(filename: &str, api_preference: i32, fourcc: i32, fps: f64, frame_size: core::Size, is_color: bool) -> Result<core::VideoWriter> {
string_arg!(filename);
unsafe { sys::cv_core_cv_VideoWriter_VideoWriter_String_filename_int_apiPreference_int_fourcc_double_fps_Size_frameSize_bool_isColor(filename.as_ptr(), api_preference, fourcc, fps, frame_size, is_color) }.into_result().map(|x| core::VideoWriter { ptr: x })
}
// identifier: cv_VideoWriter_open_String_filename_int_fourcc_double_fps_Size_frameSize_bool_isColor
/// Initializes or reinitializes video writer.
///
/// The method opens video writer. Parameters are the same as in the constructor
/// VideoWriter::VideoWriter.
/// @return `true` if video writer has been successfully initialized
///
/// The method first calls VideoWriter::release to close the already opened file.
///
/// ## C++ default parameters:
/// * is_color: true
pub fn open(&mut self, filename: &str, fourcc: i32, fps: f64, frame_size: core::Size, is_color: bool) -> Result<bool> {
string_arg!(filename);
unsafe { sys::cv_core_cv_VideoWriter_open_String_filename_int_fourcc_double_fps_Size_frameSize_bool_isColor(self.as_raw_VideoWriter(), filename.as_ptr(), fourcc, fps, frame_size, is_color) }.into_result()
}
// identifier: cv_VideoWriter_open_String_filename_int_apiPreference_int_fourcc_double_fps_Size_frameSize_bool_isColor
/// @overload
///
/// ## C++ default parameters:
/// * is_color: true
pub fn open_1(&mut self, filename: &str, api_preference: i32, fourcc: i32, fps: f64, frame_size: core::Size, is_color: bool) -> Result<bool> {
string_arg!(filename);
unsafe { sys::cv_core_cv_VideoWriter_open_String_filename_int_apiPreference_int_fourcc_double_fps_Size_frameSize_bool_isColor(self.as_raw_VideoWriter(), filename.as_ptr(), api_preference, fourcc, fps, frame_size, is_color) }.into_result()
}
// identifier: cv_VideoWriter_isOpened_const
/// Returns true if video writer has been successfully initialized.
pub fn is_opened(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_VideoWriter_isOpened_const(self.as_raw_VideoWriter()) }.into_result()
}
// identifier: cv_VideoWriter_release
/// Closes the video writer.
///
/// The method is automatically called by subsequent VideoWriter::open and by the VideoWriter
/// destructor.
pub fn release(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_VideoWriter_release(self.as_raw_VideoWriter()) }.into_result()
}
// identifier: cv_VideoWriter_write_Mat_image
/// Writes the next video frame
///
/// ## Parameters
/// * image: The written frame. In general, color images are expected in BGR format.
///
/// The function/method writes the specified image to video file. It must have the same size as has
/// been specified when opening the video writer.
pub fn write(&mut self, image: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_VideoWriter_write_Mat_image(self.as_raw_VideoWriter(), image.as_raw_Mat()) }.into_result()
}
// identifier: cv_VideoWriter_set_int_propId_double_value
/// Sets a property in the VideoWriter.
///
/// ## Parameters
/// * propId: Property identifier from cv::VideoWriterProperties (eg. cv::VIDEOWRITER_PROP_QUALITY)
/// or one of @ref videoio_flags_others
///
/// * value: Value of the property.
/// @return `true` if the property is supported by the backend used by the VideoWriter instance.
pub fn set(&mut self, prop_id: i32, value: f64) -> Result<bool> {
unsafe { sys::cv_core_cv_VideoWriter_set_int_propId_double_value(self.as_raw_VideoWriter(), prop_id, value) }.into_result()
}
// identifier: cv_VideoWriter_get_const_int_propId
/// Returns the specified VideoWriter property
///
/// ## Parameters
/// * propId: Property identifier from cv::VideoWriterProperties (eg. cv::VIDEOWRITER_PROP_QUALITY)
/// or one of @ref videoio_flags_others
///
/// @return Value for the specified property. Value 0 is returned when querying a property that is
/// not supported by the backend used by the VideoWriter instance.
pub fn get(&self, prop_id: i32) -> Result<f64> {
unsafe { sys::cv_core_cv_VideoWriter_get_const_int_propId(self.as_raw_VideoWriter(), prop_id) }.into_result()
}
// identifier: cv_VideoWriter_fourcc_char_c1_char_c2_char_c3_char_c4
/// Concatenates 4 chars to a fourcc code
///
/// @return a fourcc code
///
/// This static method constructs the fourcc code of the codec to be used in the constructor
/// VideoWriter::VideoWriter or VideoWriter::open.
pub fn fourcc(c1: i8, c2: i8, c3: i8, c4: i8) -> Result<i32> {
unsafe { sys::cv_core_cv_VideoWriter_fourcc_char_c1_char_c2_char_c3_char_c4(c1, c2, c3, c4) }.into_result()
}
// identifier: cv_VideoWriter_getBackendName_const
/// Returns used backend API name
///
///
/// Note: Stream should be opened.
pub fn get_backend_name(&self) -> Result<String> {
unsafe { sys::cv_core_cv_VideoWriter_getBackendName_const(self.as_raw_VideoWriter()) }.into_result().map(crate::templ::receive_string_mut)
}
}
// Generating impl for trait cv::WarperCreator (trait)
/// Image warper factories base class.
pub trait WarperCreator {
#[doc(hidden)] fn as_raw_WarperCreator(&self) -> *mut c_void;
}
impl<'a> WarperCreator + 'a {
}
// boxed class cv::dnn::AbsLayer
#[allow(dead_code)]
pub struct AbsLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::AbsLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_AbsLayer(self.ptr) };
}
}
impl core::AbsLayer {
#[doc(hidden)] pub fn as_raw_AbsLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for AbsLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for AbsLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::ActivationLayer for AbsLayer {
#[doc(hidden)] fn as_raw_ActivationLayer(&self) -> *mut c_void { self.ptr }
}
impl AbsLayer {
}
// Generating impl for trait cv::dnn::ActivationLayer (trait)
pub trait ActivationLayer : core::Layer {
#[doc(hidden)] fn as_raw_ActivationLayer(&self) -> *mut c_void;
// identifier: cv_dnn_ActivationLayer_forwardSlice_const_const_float_X_src_float_X_dst_int_len_size_t_outPlaneSize_int_cn0_int_cn1
fn forward_slice(&self, src: &f32, dst: &mut f32, len: i32, out_plane_size: size_t, cn0: i32, cn1: i32) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_ActivationLayer_forwardSlice_const_const_float_X_src_float_X_dst_int_len_size_t_outPlaneSize_int_cn0_int_cn1(self.as_raw_ActivationLayer(), src, dst, len, out_plane_size, cn0, cn1) }.into_result()
}
}
impl<'a> ActivationLayer + 'a {
}
// boxed class cv::dnn::BNLLLayer
#[allow(dead_code)]
pub struct BNLLLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::BNLLLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_BNLLLayer(self.ptr) };
}
}
impl core::BNLLLayer {
#[doc(hidden)] pub fn as_raw_BNLLLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for BNLLLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for BNLLLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::ActivationLayer for BNLLLayer {
#[doc(hidden)] fn as_raw_ActivationLayer(&self) -> *mut c_void { self.ptr }
}
impl BNLLLayer {
}
// boxed class cv::dnn::BackendNode
/// Derivatives of this class encapsulates functions of certain backends.
#[allow(dead_code)]
pub struct BackendNode {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::BackendNode {
fn drop(&mut self) {
unsafe { sys::cv_delete_BackendNode(self.ptr) };
}
}
impl core::BackendNode {
#[doc(hidden)] pub fn as_raw_BackendNode(&self) -> *mut c_void { self.ptr }
}
impl BackendNode {
// identifier: cv_dnn_BackendNode_BackendNode_int_backendId
pub fn new(backend_id: i32) -> Result<core::BackendNode> {
unsafe { sys::cv_core_cv_dnn_BackendNode_BackendNode_int_backendId(backend_id) }.into_result().map(|x| core::BackendNode { ptr: x })
}
}
// Generating impl for trait cv::dnn::BackendWrapper (trait)
/// Derivatives of this class wraps cv::Mat for different backends and targets.
pub trait BackendWrapper {
#[doc(hidden)] fn as_raw_BackendWrapper(&self) -> *mut c_void;
// identifier: cv_dnn_BackendWrapper_copyToHost
/// Transfer data to CPU host memory.
fn copy_to_host(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_BackendWrapper_copyToHost(self.as_raw_BackendWrapper()) }.into_result()
}
// identifier: cv_dnn_BackendWrapper_setHostDirty
/// Indicate that an actual data is on CPU.
fn set_host_dirty(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_BackendWrapper_setHostDirty(self.as_raw_BackendWrapper()) }.into_result()
}
}
impl<'a> BackendWrapper + 'a {
}
// Generating impl for trait cv::dnn::BaseConvolutionLayer (trait)
pub trait BaseConvolutionLayer : core::Layer {
#[doc(hidden)] fn as_raw_BaseConvolutionLayer(&self) -> *mut c_void;
}
impl<'a> BaseConvolutionLayer + 'a {
}
// boxed class cv::dnn::BatchNormLayer
#[allow(dead_code)]
pub struct BatchNormLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::BatchNormLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_BatchNormLayer(self.ptr) };
}
}
impl core::BatchNormLayer {
#[doc(hidden)] pub fn as_raw_BatchNormLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for BatchNormLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for BatchNormLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::ActivationLayer for BatchNormLayer {
#[doc(hidden)] fn as_raw_ActivationLayer(&self) -> *mut c_void { self.ptr }
}
impl BatchNormLayer {
}
// boxed class cv::dnn::BlankLayer
/// Partial List of Implemented Layers
///
/// # Partial List of Implemented Layers
/// @{
/// This subsection of dnn module contains information about built-in layers and their descriptions.
///
/// Classes listed here, in fact, provides C++ API for creating instances of built-in layers.
/// In addition to this way of layers instantiation, there is a more common factory API (see @ref dnnLayerFactory), it allows to create layers dynamically (by name) and register new ones.
/// You can use both API, but factory API is less convenient for native C++ programming and basically designed for use inside importers (see @ref readNetFromCaffe(), @ref readNetFromTorch(), @ref readNetFromTensorflow()).
///
/// Built-in layers partially reproduce functionality of corresponding Caffe and Torch7 layers.
/// In particular, the following layers and Caffe importer were tested to reproduce <a href="http://caffe.berkeleyvision.org/tutorial/layers.html">Caffe</a> functionality:
/// - Convolution
/// - Deconvolution
/// - Pooling
/// - InnerProduct
/// - TanH, ReLU, Sigmoid, BNLL, Power, AbsVal
/// - Softmax
/// - Reshape, Flatten, Slice, Split
/// - LRN
/// - MVN
/// - Dropout (since it does nothing on forward pass -))
#[allow(dead_code)]
pub struct BlankLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::BlankLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_BlankLayer(self.ptr) };
}
}
impl core::BlankLayer {
#[doc(hidden)] pub fn as_raw_BlankLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for BlankLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for BlankLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl BlankLayer {
}
// boxed class cv::dnn::ChannelsPReLULayer
#[allow(dead_code)]
pub struct ChannelsPReLULayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ChannelsPReLULayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_ChannelsPReLULayer(self.ptr) };
}
}
impl core::ChannelsPReLULayer {
#[doc(hidden)] pub fn as_raw_ChannelsPReLULayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for ChannelsPReLULayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ChannelsPReLULayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::ActivationLayer for ChannelsPReLULayer {
#[doc(hidden)] fn as_raw_ActivationLayer(&self) -> *mut c_void { self.ptr }
}
impl ChannelsPReLULayer {
}
// boxed class cv::dnn::ConcatLayer
#[allow(dead_code)]
pub struct ConcatLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ConcatLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_ConcatLayer(self.ptr) };
}
}
impl core::ConcatLayer {
#[doc(hidden)] pub fn as_raw_ConcatLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for ConcatLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ConcatLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl ConcatLayer {
}
// boxed class cv::dnn::ConstLayer
/// Constant layer produces the same data blob at an every forward pass.
#[allow(dead_code)]
pub struct ConstLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ConstLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_ConstLayer(self.ptr) };
}
}
impl core::ConstLayer {
#[doc(hidden)] pub fn as_raw_ConstLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for ConstLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ConstLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl ConstLayer {
}
// boxed class cv::dnn::ConvolutionLayer
#[allow(dead_code)]
pub struct ConvolutionLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ConvolutionLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_ConvolutionLayer(self.ptr) };
}
}
impl core::ConvolutionLayer {
#[doc(hidden)] pub fn as_raw_ConvolutionLayer(&self) -> *mut c_void { self.ptr }
}
impl core::BaseConvolutionLayer for ConvolutionLayer {
#[doc(hidden)] fn as_raw_BaseConvolutionLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ConvolutionLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for ConvolutionLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl ConvolutionLayer {
}
// boxed class cv::dnn::CropAndResizeLayer
#[allow(dead_code)]
pub struct CropAndResizeLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::CropAndResizeLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_CropAndResizeLayer(self.ptr) };
}
}
impl core::CropAndResizeLayer {
#[doc(hidden)] pub fn as_raw_CropAndResizeLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for CropAndResizeLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for CropAndResizeLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl CropAndResizeLayer {
}
// boxed class cv::dnn::CropLayer
#[allow(dead_code)]
pub struct CropLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::CropLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_CropLayer(self.ptr) };
}
}
impl core::CropLayer {
#[doc(hidden)] pub fn as_raw_CropLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for CropLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for CropLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl CropLayer {
}
// boxed class cv::dnn::DeconvolutionLayer
#[allow(dead_code)]
pub struct DeconvolutionLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::DeconvolutionLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_DeconvolutionLayer(self.ptr) };
}
}
impl core::DeconvolutionLayer {
#[doc(hidden)] pub fn as_raw_DeconvolutionLayer(&self) -> *mut c_void { self.ptr }
}
impl core::BaseConvolutionLayer for DeconvolutionLayer {
#[doc(hidden)] fn as_raw_BaseConvolutionLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for DeconvolutionLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for DeconvolutionLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl DeconvolutionLayer {
}
// boxed class cv::dnn::DetectionOutputLayer
#[allow(dead_code)]
pub struct DetectionOutputLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::DetectionOutputLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_DetectionOutputLayer(self.ptr) };
}
}
impl core::DetectionOutputLayer {
#[doc(hidden)] pub fn as_raw_DetectionOutputLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for DetectionOutputLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for DetectionOutputLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl DetectionOutputLayer {
}
// Generating impl for trait cv::dnn::Dict (trait)
/// This class implements name-value dictionary, values are instances of DictValue.
pub trait Dict {
#[doc(hidden)] fn as_raw_Dict(&self) -> *mut c_void;
// identifier: cv_dnn_Dict_has_const_String_key
fn has(&self, key: &str) -> Result<bool> {
string_arg!(key);
unsafe { sys::cv_core_cv_dnn_Dict_has_const_String_key(self.as_raw_Dict(), key.as_ptr()) }.into_result()
}
// identifier: cv_dnn_Dict_ptr_String_key
fn ptr_mut(&mut self, key: &str) -> Result<core::DictValue> {
string_arg!(key);
unsafe { sys::cv_core_cv_dnn_Dict_ptr_String_key(self.as_raw_Dict(), key.as_ptr()) }.into_result().map(|x| core::DictValue { ptr: x })
}
// identifier: cv_dnn_Dict_ptr_const_String_key
/// @overload
fn ptr(&self, key: &str) -> Result<core::DictValue> {
string_arg!(key);
unsafe { sys::cv_core_cv_dnn_Dict_ptr_const_String_key(self.as_raw_Dict(), key.as_ptr()) }.into_result().map(|x| core::DictValue { ptr: x })
}
// identifier: cv_dnn_Dict_get_const_String_key
fn get(&self, key: &str) -> Result<core::DictValue> {
string_arg!(key);
unsafe { sys::cv_core_cv_dnn_Dict_get_const_String_key(self.as_raw_Dict(), key.as_ptr()) }.into_result().map(|x| core::DictValue { ptr: x })
}
// identifier: cv_dnn_Dict_erase_String_key
fn erase(&mut self, key: &str) -> Result<()> {
string_arg!(key);
unsafe { sys::cv_core_cv_dnn_Dict_erase_String_key(self.as_raw_Dict(), key.as_ptr()) }.into_result()
}
}
impl<'a> Dict + 'a {
}
// boxed class cv::dnn::DictValue
/// This struct stores the scalar value (or array) of one of the following type: double, cv::String or int64.
/// @todo Maybe int64 is useless because double type exactly stores at least 2^52 integers.
#[allow(dead_code)]
pub struct DictValue {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::DictValue {
fn drop(&mut self) {
unsafe { sys::cv_delete_DictValue(self.ptr) };
}
}
impl core::DictValue {
#[doc(hidden)] pub fn as_raw_DictValue(&self) -> *mut c_void { self.ptr }
}
impl DictValue {
// identifier: cv_dnn_DictValue_DictValue_DictValue_r
pub fn new(r: &core::DictValue) -> Result<core::DictValue> {
unsafe { sys::cv_core_cv_dnn_DictValue_DictValue_DictValue_r(r.as_raw_DictValue()) }.into_result().map(|x| core::DictValue { ptr: x })
}
// identifier: cv_dnn_DictValue_size_const
pub fn size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_dnn_DictValue_size_const(self.as_raw_DictValue()) }.into_result()
}
// identifier: cv_dnn_DictValue_isInt_const
pub fn is_int(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_dnn_DictValue_isInt_const(self.as_raw_DictValue()) }.into_result()
}
// identifier: cv_dnn_DictValue_isString_const
pub fn is_string(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_dnn_DictValue_isString_const(self.as_raw_DictValue()) }.into_result()
}
// identifier: cv_dnn_DictValue_isReal_const
pub fn is_real(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_dnn_DictValue_isReal_const(self.as_raw_DictValue()) }.into_result()
}
// identifier: cv_dnn_DictValue_getIntValue_const_int_idx
///
/// ## C++ default parameters:
/// * idx: -1
pub fn get_int_value(&self, idx: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_dnn_DictValue_getIntValue_const_int_idx(self.as_raw_DictValue(), idx) }.into_result()
}
// identifier: cv_dnn_DictValue_getRealValue_const_int_idx
///
/// ## C++ default parameters:
/// * idx: -1
pub fn get_real_value(&self, idx: i32) -> Result<f64> {
unsafe { sys::cv_core_cv_dnn_DictValue_getRealValue_const_int_idx(self.as_raw_DictValue(), idx) }.into_result()
}
// identifier: cv_dnn_DictValue_getStringValue_const_int_idx
///
/// ## C++ default parameters:
/// * idx: -1
pub fn get_string_value(&self, idx: i32) -> Result<String> {
unsafe { sys::cv_core_cv_dnn_DictValue_getStringValue_const_int_idx(self.as_raw_DictValue(), idx) }.into_result().map(crate::templ::receive_string_mut)
}
}
// boxed class cv::dnn::ELULayer
#[allow(dead_code)]
pub struct ELULayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ELULayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_ELULayer(self.ptr) };
}
}
impl core::ELULayer {
#[doc(hidden)] pub fn as_raw_ELULayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for ELULayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ELULayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::ActivationLayer for ELULayer {
#[doc(hidden)] fn as_raw_ActivationLayer(&self) -> *mut c_void { self.ptr }
}
impl ELULayer {
}
// boxed class cv::dnn::EltwiseLayer
#[allow(dead_code)]
pub struct EltwiseLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::EltwiseLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_EltwiseLayer(self.ptr) };
}
}
impl core::EltwiseLayer {
#[doc(hidden)] pub fn as_raw_EltwiseLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for EltwiseLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for EltwiseLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl EltwiseLayer {
}
// boxed class cv::dnn::FlattenLayer
#[allow(dead_code)]
pub struct FlattenLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::FlattenLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_FlattenLayer(self.ptr) };
}
}
impl core::FlattenLayer {
#[doc(hidden)] pub fn as_raw_FlattenLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for FlattenLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for FlattenLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl FlattenLayer {
}
// boxed class cv::dnn::InnerProductLayer
#[allow(dead_code)]
pub struct InnerProductLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::InnerProductLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_InnerProductLayer(self.ptr) };
}
}
impl core::InnerProductLayer {
#[doc(hidden)] pub fn as_raw_InnerProductLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for InnerProductLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for InnerProductLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl InnerProductLayer {
}
// boxed class cv::dnn::InterpLayer
/// Bilinear resize layer from https://github.com/cdmh/deeplab-public
///
/// It differs from @ref ResizeLayer in output shape and resize scales computations.
#[allow(dead_code)]
pub struct InterpLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::InterpLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_InterpLayer(self.ptr) };
}
}
impl core::InterpLayer {
#[doc(hidden)] pub fn as_raw_InterpLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for InterpLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for InterpLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl InterpLayer {
}
// boxed class cv::dnn::LRNLayer
#[allow(dead_code)]
pub struct LRNLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::LRNLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_LRNLayer(self.ptr) };
}
}
impl core::LRNLayer {
#[doc(hidden)] pub fn as_raw_LRNLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for LRNLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for LRNLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl LRNLayer {
}
// Generating impl for trait cv::dnn::LSTMLayer (trait)
pub trait LSTMLayer : core::Layer {
#[doc(hidden)] fn as_raw_LSTMLayer(&self) -> *mut c_void;
// identifier: cv_dnn_LSTMLayer_setWeights_Mat_Wh_Mat_Wx_Mat_b
/// @deprecated Use LayerParams::blobs instead.
/// Set trained weights for LSTM layer.
///
/// LSTM behavior on each step is defined by current input, previous output, previous cell state and learned weights.
///
/// Let @f$x_t@f$ be current input, @f$h_t@f$ be current output, @f$c_t@f$ be current state.
/// Than current output and current cell state is computed as follows:
/// @f{eqnarray*}{
/// h_t &= o_t \odot tanh(c_t), \\
/// c_t &= f_t \odot c_{t-1} + i_t \odot g_t, \\
/// @f}
/// where @f$\odot@f$ is per-element multiply operation and @f$i_t, f_t, o_t, g_t@f$ is internal gates that are computed using learned wights.
///
/// Gates are computed as follows:
/// @f{eqnarray*}{
/// i_t &= sigmoid&(W_{xi} x_t + W_{hi} h_{t-1} + b_i), \\
/// f_t &= sigmoid&(W_{xf} x_t + W_{hf} h_{t-1} + b_f), \\
/// o_t &= sigmoid&(W_{xo} x_t + W_{ho} h_{t-1} + b_o), \\
/// g_t &= tanh &(W_{xg} x_t + W_{hg} h_{t-1} + b_g), \\
/// @f}
/// where @f$W_{x?}@f$, @f$W_{h?}@f$ and @f$b_{?}@f$ are learned weights represented as matrices:
/// @f$W_{x?} \in R^{N_h \times N_x}@f$, @f$W_{h?} \in R^{N_h \times N_h}@f$, @f$b_? \in R^{N_h}@f$.
///
/// For simplicity and performance purposes we use @f$ W_x = [W_{xi}; W_{xf}; W_{xo}, W_{xg}] @f$
/// (i.e. @f$W_x@f$ is vertical concatenation of @f$ W_{x?} @f$), @f$ W_x \in R^{4N_h \times N_x} @f$.
/// The same for @f$ W_h = [W_{hi}; W_{hf}; W_{ho}, W_{hg}], W_h \in R^{4N_h \times N_h} @f$
/// and for @f$ b = [b_i; b_f, b_o, b_g]@f$, @f$b \in R^{4N_h} @f$.
///
/// ## Parameters
/// * Wh: is matrix defining how previous output is transformed to internal gates (i.e. according to above mentioned notation is @f$ W_h @f$)
/// * Wx: is matrix defining how current input is transformed to internal gates (i.e. according to above mentioned notation is @f$ W_x @f$)
/// * b: is bias vector (i.e. according to above mentioned notation is @f$ b @f$)
fn set_weights(&mut self, wh: &core::Mat, wx: &core::Mat, b: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_LSTMLayer_setWeights_Mat_Wh_Mat_Wx_Mat_b(self.as_raw_LSTMLayer(), wh.as_raw_Mat(), wx.as_raw_Mat(), b.as_raw_Mat()) }.into_result()
}
// identifier: cv_dnn_LSTMLayer_setUseTimstampsDim_bool_use
/// @deprecated Use flag `produce_cell_output` in LayerParams.
/// Specifies either interpret first dimension of input blob as timestamp dimenion either as sample.
///
/// If flag is set to true then shape of input blob will be interpreted as [`T`, `N`, `[data dims]`] where `T` specifies number of timestamps, `N` is number of independent streams.
/// In this case each forward() call will iterate through `T` timestamps and update layer's state `T` times.
///
/// If flag is set to false then shape of input blob will be interpreted as [`N`, `[data dims]`].
/// In this case each forward() call will make one iteration and produce one timestamp with shape [`N`, `[out dims]`].
///
/// ## C++ default parameters:
/// * _use: true
fn set_use_timstamps_dim(&mut self, _use: bool) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_LSTMLayer_setUseTimstampsDim_bool_use(self.as_raw_LSTMLayer(), _use) }.into_result()
}
// identifier: cv_dnn_LSTMLayer_setProduceCellOutput_bool_produce
/// @deprecated Use flag `use_timestamp_dim` in LayerParams.
/// If this flag is set to true then layer will produce @f$ c_t @f$ as second output.
/// @details Shape of the second output is the same as first output.
///
/// ## C++ default parameters:
/// * produce: false
fn set_produce_cell_output(&mut self, produce: bool) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_LSTMLayer_setProduceCellOutput_bool_produce(self.as_raw_LSTMLayer(), produce) }.into_result()
}
// identifier: cv_dnn_LSTMLayer_inputNameToIndex_String_inputName
fn input_name_to_index(&mut self, input_name: &str) -> Result<i32> {
string_arg!(mut input_name);
unsafe { sys::cv_core_cv_dnn_LSTMLayer_inputNameToIndex_String_inputName(self.as_raw_LSTMLayer(), input_name.as_ptr() as _) }.into_result()
}
// identifier: cv_dnn_LSTMLayer_outputNameToIndex_String_outputName
fn output_name_to_index(&mut self, output_name: &str) -> Result<i32> {
string_arg!(output_name);
unsafe { sys::cv_core_cv_dnn_LSTMLayer_outputNameToIndex_String_outputName(self.as_raw_LSTMLayer(), output_name.as_ptr()) }.into_result()
}
}
impl<'a> LSTMLayer + 'a {
}
// Generating impl for trait cv::dnn::Layer (trait)
/// This interface class allows to build new Layers - are building blocks of networks.
///
/// Each class, derived from Layer, must implement allocate() methods to declare own outputs and forward() to compute outputs.
/// Also before using the new layer into networks you must register your layer by using one of @ref dnnLayerFactory "LayerFactory" macros.
pub trait Layer : core::Algorithm {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void;
// identifier: cv_dnn_Layer_finalize_VectorOfMat_inputs_VectorOfMat_outputs
/// Computes and sets internal parameters according to inputs, outputs and blobs.
/// ## Parameters
/// @param[in] inputs vector of already allocated input blobs
/// @param[out] outputs vector of already allocated output blobs
///
/// If this method is called after network has allocated all memory for input and output blobs
/// and before inferencing.
fn finalize(&mut self, inputs: &types::VectorOfMat, outputs: &mut types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Layer_finalize_VectorOfMat_inputs_VectorOfMat_outputs(self.as_raw_Layer(), inputs.as_raw_VectorOfMat(), outputs.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_dnn_Layer_forward_VectorOfMat_inputs_VectorOfMat_outputs_VectorOfMat_internals
/// Given the @p input blobs, computes the output @p blobs.
/// ## Parameters
/// @param[in] inputs the input blobs.
/// @param[out] outputs allocated output blobs, which will store results of the computation.
/// @param[out] internals allocated internal blobs
fn forward(&mut self, inputs: &types::VectorOfMat, outputs: &mut types::VectorOfMat, internals: &mut types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Layer_forward_VectorOfMat_inputs_VectorOfMat_outputs_VectorOfMat_internals(self.as_raw_Layer(), inputs.as_raw_VectorOfMat(), outputs.as_raw_VectorOfMat(), internals.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_dnn_Layer_forward_fallback_VectorOfMat_inputs_VectorOfMat_outputs_VectorOfMat_internals
/// Given the @p input blobs, computes the output @p blobs.
/// ## Parameters
/// @param[in] inputs the input blobs.
/// @param[out] outputs allocated output blobs, which will store results of the computation.
/// @param[out] internals allocated internal blobs
fn forward_fallback(&mut self, inputs: &types::VectorOfMat, outputs: &mut types::VectorOfMat, internals: &mut types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Layer_forward_fallback_VectorOfMat_inputs_VectorOfMat_outputs_VectorOfMat_internals(self.as_raw_Layer(), inputs.as_raw_VectorOfMat(), outputs.as_raw_VectorOfMat(), internals.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_dnn_Layer_finalize_VectorOfMat_inputs
/// @overload
/// @deprecated Use Layer::finalize(InputArrayOfArrays, OutputArrayOfArrays) instead
fn finalize_1(&mut self, inputs: &types::VectorOfMat) -> Result<types::VectorOfMat> {
unsafe { sys::cv_core_cv_dnn_Layer_finalize_VectorOfMat_inputs(self.as_raw_Layer(), inputs.as_raw_VectorOfMat()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
// identifier: cv_dnn_Layer_run_VectorOfMat_inputs_VectorOfMat_outputs_VectorOfMat_internals
/// Allocates layer and computes output.
/// @deprecated This method will be removed in the future release.
fn run(&mut self, inputs: &types::VectorOfMat, outputs: &types::VectorOfMat, internals: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Layer_run_VectorOfMat_inputs_VectorOfMat_outputs_VectorOfMat_internals(self.as_raw_Layer(), inputs.as_raw_VectorOfMat(), outputs.as_raw_VectorOfMat(), internals.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_dnn_Layer_inputNameToIndex_String_inputName
/// Returns index of input blob into the input array.
/// ## Parameters
/// * inputName: label of input blob
///
/// Each layer input and output can be labeled to easily identify them using "%<layer_name%>[.output_name]" notation.
/// This method maps label of input blob to its index into input vector.
fn input_name_to_index(&mut self, input_name: &str) -> Result<i32> {
string_arg!(mut input_name);
unsafe { sys::cv_core_cv_dnn_Layer_inputNameToIndex_String_inputName(self.as_raw_Layer(), input_name.as_ptr() as _) }.into_result()
}
// identifier: cv_dnn_Layer_outputNameToIndex_String_outputName
/// Returns index of output blob in output array.
/// @see inputNameToIndex()
fn output_name_to_index(&mut self, output_name: &str) -> Result<i32> {
string_arg!(output_name);
unsafe { sys::cv_core_cv_dnn_Layer_outputNameToIndex_String_outputName(self.as_raw_Layer(), output_name.as_ptr()) }.into_result()
}
// identifier: cv_dnn_Layer_supportBackend_int_backendId
/// Ask layer if it support specific backend for doing computations.
/// ## Parameters
/// @param[in] backendId computation backend identifier.
/// @see Backend
fn support_backend(&mut self, backend_id: i32) -> Result<bool> {
unsafe { sys::cv_core_cv_dnn_Layer_supportBackend_int_backendId(self.as_raw_Layer(), backend_id) }.into_result()
}
// identifier: cv_dnn_Layer_initHalide_VectorOfPtrOfBackendWrapper_inputs
/// Returns Halide backend node.
/// ## Parameters
/// @param[in] inputs Input Halide buffers.
/// @see BackendNode, BackendWrapper
///
/// Input buffers should be exactly the same that will be used in forward invocations.
/// Despite we can use Halide::ImageParam based on input shape only,
/// it helps prevent some memory management issues (if something wrong,
/// Halide tests will be failed).
fn init_halide(&mut self, inputs: &types::VectorOfPtrOfBackendWrapper) -> Result<types::PtrOfBackendNode> {
unsafe { sys::cv_core_cv_dnn_Layer_initHalide_VectorOfPtrOfBackendWrapper_inputs(self.as_raw_Layer(), inputs.as_raw_VectorOfPtrOfBackendWrapper()) }.into_result().map(|x| types::PtrOfBackendNode { ptr: x })
}
// identifier: cv_dnn_Layer_initInfEngine_VectorOfPtrOfBackendWrapper_inputs
fn init_inf_engine(&mut self, inputs: &types::VectorOfPtrOfBackendWrapper) -> Result<types::PtrOfBackendNode> {
unsafe { sys::cv_core_cv_dnn_Layer_initInfEngine_VectorOfPtrOfBackendWrapper_inputs(self.as_raw_Layer(), inputs.as_raw_VectorOfPtrOfBackendWrapper()) }.into_result().map(|x| types::PtrOfBackendNode { ptr: x })
}
// identifier: cv_dnn_Layer_tryAttach_PtrOfBackendNode_node
/// Implement layers fusing.
/// ## Parameters
/// @param[in] node Backend node of bottom layer.
/// @see BackendNode
///
/// Actual for graph-based backends. If layer attached successfully,
/// returns non-empty cv::Ptr to node of the same backend.
/// Fuse only over the last function.
fn try_attach(&mut self, node: &types::PtrOfBackendNode) -> Result<types::PtrOfBackendNode> {
unsafe { sys::cv_core_cv_dnn_Layer_tryAttach_PtrOfBackendNode_node(self.as_raw_Layer(), node.as_raw_PtrOfBackendNode()) }.into_result().map(|x| types::PtrOfBackendNode { ptr: x })
}
// identifier: cv_dnn_Layer_setActivation_PtrOfActivationLayer_layer
/// Tries to attach to the layer the subsequent activation layer, i.e. do the layer fusion in a partial case.
/// ## Parameters
/// @param[in] layer The subsequent activation layer.
///
/// Returns true if the activation layer has been attached successfully.
fn set_activation(&mut self, layer: &types::PtrOfActivationLayer) -> Result<bool> {
unsafe { sys::cv_core_cv_dnn_Layer_setActivation_PtrOfActivationLayer_layer(self.as_raw_Layer(), layer.as_raw_PtrOfActivationLayer()) }.into_result()
}
// identifier: cv_dnn_Layer_getScaleShift_const_Mat_scale_Mat_shift
/// Returns parameters of layers with channel-wise multiplication and addition.
/// ## Parameters
/// @param[out] scale Channel-wise multipliers. Total number of values should
/// be equal to number of channels.
/// @param[out] shift Channel-wise offsets. Total number of values should
/// be equal to number of channels.
///
/// Some layers can fuse their transformations with further layers.
/// In example, convolution + batch normalization. This way base layer
/// use weights from layer after it. Fused layer is skipped.
/// By default, @p scale and @p shift are empty that means layer has no
/// element-wise multiplications or additions.
fn get_scale_shift(&self, scale: &core::Mat, shift: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Layer_getScaleShift_const_Mat_scale_Mat_shift(self.as_raw_Layer(), scale.as_raw_Mat(), shift.as_raw_Mat()) }.into_result()
}
// identifier: cv_dnn_Layer_unsetAttached
/// "Deattaches" all the layers, attached to particular layer.
fn unset_attached(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Layer_unsetAttached(self.as_raw_Layer()) }.into_result()
}
// identifier: cv_dnn_Layer_getMemoryShapes_const_VectorOfVectorOfint_inputs_int_requiredOutputs_VectorOfVectorOfint_outputs_VectorOfVectorOfint_internals
fn get_memory_shapes(&self, inputs: &types::VectorOfVectorOfint, required_outputs: i32, outputs: &types::VectorOfVectorOfint, internals: &types::VectorOfVectorOfint) -> Result<bool> {
unsafe { sys::cv_core_cv_dnn_Layer_getMemoryShapes_const_VectorOfVectorOfint_inputs_int_requiredOutputs_VectorOfVectorOfint_outputs_VectorOfVectorOfint_internals(self.as_raw_Layer(), inputs.as_raw_VectorOfVectorOfint(), required_outputs, outputs.as_raw_VectorOfVectorOfint(), internals.as_raw_VectorOfVectorOfint()) }.into_result()
}
// identifier: cv_dnn_Layer_getFLOPS_const_VectorOfVectorOfint_inputs_VectorOfVectorOfint_outputs
fn get_flops(&self, inputs: &types::VectorOfVectorOfint, outputs: &types::VectorOfVectorOfint) -> Result<i64> {
unsafe { sys::cv_core_cv_dnn_Layer_getFLOPS_const_VectorOfVectorOfint_inputs_VectorOfVectorOfint_outputs(self.as_raw_Layer(), inputs.as_raw_VectorOfVectorOfint(), outputs.as_raw_VectorOfVectorOfint()) }.into_result()
}
}
impl<'a> Layer + 'a {
}
// boxed class cv::dnn::LayerFactory
/// %Layer factory allows to create instances of registered layers.
#[allow(dead_code)]
pub struct LayerFactory {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::LayerFactory {
fn drop(&mut self) {
unsafe { sys::cv_delete_LayerFactory(self.ptr) };
}
}
impl core::LayerFactory {
#[doc(hidden)] pub fn as_raw_LayerFactory(&self) -> *mut c_void { self.ptr }
}
impl LayerFactory {
// identifier: cv_dnn_LayerFactory_unregisterLayer_String_type
pub fn unregister_layer(_type: &str) -> Result<()> {
string_arg!(_type);
unsafe { sys::cv_core_cv_dnn_LayerFactory_unregisterLayer_String_type(_type.as_ptr()) }.into_result()
}
}
// boxed class cv::dnn::LayerParams
/// This class provides all data needed to initialize layer.
///
/// It includes dictionary with scalar params (which can be read by using Dict interface),
/// blob params #blobs and optional meta information: #name and #type of layer instance.
#[allow(dead_code)]
pub struct LayerParams {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::LayerParams {
fn drop(&mut self) {
unsafe { sys::cv_delete_LayerParams(self.ptr) };
}
}
impl core::LayerParams {
#[doc(hidden)] pub fn as_raw_LayerParams(&self) -> *mut c_void { self.ptr }
}
impl core::Dict for LayerParams {
#[doc(hidden)] fn as_raw_Dict(&self) -> *mut c_void { self.ptr }
}
// boxed class cv::dnn::MVNLayer
#[allow(dead_code)]
pub struct MVNLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::MVNLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_MVNLayer(self.ptr) };
}
}
impl core::MVNLayer {
#[doc(hidden)] pub fn as_raw_MVNLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for MVNLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for MVNLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl MVNLayer {
}
// boxed class cv::dnn::MaxUnpoolLayer
#[allow(dead_code)]
pub struct MaxUnpoolLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::MaxUnpoolLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_MaxUnpoolLayer(self.ptr) };
}
}
impl core::MaxUnpoolLayer {
#[doc(hidden)] pub fn as_raw_MaxUnpoolLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for MaxUnpoolLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for MaxUnpoolLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl MaxUnpoolLayer {
}
impl Net {
// identifier: cv_dnn_Net_Net
pub fn new() -> Result<core::Net> {
unsafe { sys::cv_core_cv_dnn_Net_Net() }.into_result()
}
// identifier: cv_dnn_Net_readFromModelOptimizer_String_xml_String_bin
/// Create a network from Intel's Model Optimizer intermediate representation.
/// ## Parameters
/// @param[in] xml XML configuration file with network's topology.
/// @param[in] bin Binary file with trained weights.
/// Networks imported from Intel's Model Optimizer are launched in Intel's Inference Engine
/// backend.
pub fn read_from_model_optimizer(xml: &str, bin: &str) -> Result<core::Net> {
string_arg!(xml);
string_arg!(bin);
unsafe { sys::cv_core_cv_dnn_Net_readFromModelOptimizer_String_xml_String_bin(xml.as_ptr(), bin.as_ptr()) }.into_result()
}
// identifier: cv_dnn_Net_empty_const
/// Returns true if there are no layers in the network.
pub fn empty(self) -> Result<bool> {
unsafe { sys::cv_core_cv_dnn_Net_empty_const(self) }.into_result()
}
// identifier: cv_dnn_Net_addLayer_String_name_String_type_LayerParams_params
/// Adds new layer to the net.
/// ## Parameters
/// * name: unique name of the adding layer.
/// * type: typename of the adding layer (type must be registered in LayerRegister).
/// * params: parameters which will be used to initialize the creating layer.
/// @returns unique identifier of created layer, or -1 if a failure will happen.
pub fn add_layer(self, name: &str, _type: &str, params: &core::LayerParams) -> Result<i32> {
string_arg!(name);
string_arg!(_type);
unsafe { sys::cv_core_cv_dnn_Net_addLayer_String_name_String_type_LayerParams_params(self, name.as_ptr(), _type.as_ptr(), params.as_raw_LayerParams()) }.into_result()
}
// identifier: cv_dnn_Net_addLayerToPrev_String_name_String_type_LayerParams_params
/// Adds new layer and connects its first input to the first output of previously added layer.
/// @see addLayer()
pub fn add_layer_to_prev(self, name: &str, _type: &str, params: &core::LayerParams) -> Result<i32> {
string_arg!(name);
string_arg!(_type);
unsafe { sys::cv_core_cv_dnn_Net_addLayerToPrev_String_name_String_type_LayerParams_params(self, name.as_ptr(), _type.as_ptr(), params.as_raw_LayerParams()) }.into_result()
}
// identifier: cv_dnn_Net_getLayerId_String_layer
/// Converts string name of the layer to the integer identifier.
/// @returns id of the layer, or -1 if the layer wasn't found.
pub fn get_layer_id(self, layer: &str) -> Result<i32> {
string_arg!(layer);
unsafe { sys::cv_core_cv_dnn_Net_getLayerId_String_layer(self, layer.as_ptr()) }.into_result()
}
// identifier: cv_dnn_Net_getLayerNames_const
pub fn get_layer_names(self) -> Result<types::VectorOfString> {
unsafe { sys::cv_core_cv_dnn_Net_getLayerNames_const(self) }.into_result().map(|x| types::VectorOfString { ptr: x })
}
// identifier: cv_dnn_Net_connect_String_outPin_String_inpPin
/// Connects output of the first layer to input of the second layer.
/// ## Parameters
/// * outPin: descriptor of the first layer output.
/// * inpPin: descriptor of the second layer input.
///
/// Descriptors have the following template <DFN><layer_name>[.input_number]</DFN>:
/// - the first part of the template <DFN>layer_name</DFN> is sting name of the added layer.
/// If this part is empty then the network input pseudo layer will be used;
/// - the second optional part of the template <DFN>input_number</DFN>
/// is either number of the layer input, either label one.
/// If this part is omitted then the first layer input will be used.
///
/// @see setNetInputs(), Layer::inputNameToIndex(), Layer::outputNameToIndex()
pub fn connect(self, out_pin: &str, inp_pin: &str) -> Result<()> {
string_arg!(mut out_pin);
string_arg!(mut inp_pin);
unsafe { sys::cv_core_cv_dnn_Net_connect_String_outPin_String_inpPin(self, out_pin.as_ptr() as _, inp_pin.as_ptr() as _) }.into_result()
}
// identifier: cv_dnn_Net_connect_int_outLayerId_int_outNum_int_inpLayerId_int_inpNum
/// Connects #@p outNum output of the first layer to #@p inNum input of the second layer.
/// ## Parameters
/// * outLayerId: identifier of the first layer
/// * outNum: number of the first layer output
/// * inpLayerId: identifier of the second layer
/// * inpNum: number of the second layer input
pub fn connect_1(self, out_layer_id: i32, out_num: i32, inp_layer_id: i32, inp_num: i32) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Net_connect_int_outLayerId_int_outNum_int_inpLayerId_int_inpNum(self, out_layer_id, out_num, inp_layer_id, inp_num) }.into_result()
}
// identifier: cv_dnn_Net_setInputsNames_VectorOfString_inputBlobNames
/// Sets outputs names of the network input pseudo layer.
///
/// Each net always has special own the network input pseudo layer with id=0.
/// This layer stores the user blobs only and don't make any computations.
/// In fact, this layer provides the only way to pass user data into the network.
/// As any other layer, this layer can label its outputs and this function provides an easy way to do this.
pub fn set_inputs_names(self, input_blob_names: &types::VectorOfString) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Net_setInputsNames_VectorOfString_inputBlobNames(self, input_blob_names.as_raw_VectorOfString()) }.into_result()
}
// identifier: cv_dnn_Net_forward_String_outputName
/// Runs forward pass to compute output of layer with name @p outputName.
/// ## Parameters
/// * outputName: name for layer which output is needed to get
/// @return blob for first output of specified layer.
/// @details By default runs forward pass for the whole network.
///
/// ## C++ default parameters:
/// * output_name: String()
pub fn forward(self, output_name: &str) -> Result<core::Mat> {
string_arg!(output_name);
unsafe { sys::cv_core_cv_dnn_Net_forward_String_outputName(self, output_name.as_ptr()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_dnn_Net_forward_VectorOfMat_outputBlobs_String_outputName
/// Runs forward pass to compute output of layer with name @p outputName.
/// ## Parameters
/// * outputBlobs: contains all output blobs for specified layer.
/// * outputName: name for layer which output is needed to get
/// @details If @p outputName is empty, runs forward pass for the whole network.
///
/// ## C++ default parameters:
/// * output_name: String()
pub fn forward_1(self, output_blobs: &mut types::VectorOfMat, output_name: &str) -> Result<()> {
string_arg!(output_name);
unsafe { sys::cv_core_cv_dnn_Net_forward_VectorOfMat_outputBlobs_String_outputName(self, output_blobs.as_raw_VectorOfMat(), output_name.as_ptr()) }.into_result()
}
// identifier: cv_dnn_Net_forward_VectorOfMat_outputBlobs_VectorOfString_outBlobNames
/// Runs forward pass to compute outputs of layers listed in @p outBlobNames.
/// ## Parameters
/// * outputBlobs: contains blobs for first outputs of specified layers.
/// * outBlobNames: names for layers which outputs are needed to get
pub fn forward_2(self, output_blobs: &mut types::VectorOfMat, out_blob_names: &types::VectorOfString) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Net_forward_VectorOfMat_outputBlobs_VectorOfString_outBlobNames(self, output_blobs.as_raw_VectorOfMat(), out_blob_names.as_raw_VectorOfString()) }.into_result()
}
// identifier: cv_dnn_Net_forward_VectorOfVectorOfMat_outputBlobs_VectorOfString_outBlobNames
/// Runs forward pass to compute outputs of layers listed in @p outBlobNames.
/// ## Parameters
/// * outputBlobs: contains all output blobs for each layer specified in @p outBlobNames.
/// * outBlobNames: names for layers which outputs are needed to get
pub fn forward_3(self, output_blobs: &types::VectorOfVectorOfMat, out_blob_names: &types::VectorOfString) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Net_forward_VectorOfVectorOfMat_outputBlobs_VectorOfString_outBlobNames(self, output_blobs.as_raw_VectorOfVectorOfMat(), out_blob_names.as_raw_VectorOfString()) }.into_result()
}
// identifier: cv_dnn_Net_setHalideScheduler_String_scheduler
/// Compile Halide layers.
/// ## Parameters
/// @param[in] scheduler Path to YAML file with scheduling directives.
/// @see setPreferableBackend
///
/// Schedule layers that support Halide backend. Then compile them for
/// specific target. For layers that not represented in scheduling file
/// or if no manual scheduling used at all, automatic scheduling will be applied.
pub fn set_halide_scheduler(self, scheduler: &str) -> Result<()> {
string_arg!(scheduler);
unsafe { sys::cv_core_cv_dnn_Net_setHalideScheduler_String_scheduler(self, scheduler.as_ptr()) }.into_result()
}
// identifier: cv_dnn_Net_setPreferableBackend_int_backendId
/// Ask network to use specific computation backend where it supported.
/// ## Parameters
/// @param[in] backendId backend identifier.
/// @see Backend
///
/// If OpenCV is compiled with Intel's Inference Engine library, DNN_BACKEND_DEFAULT
/// means DNN_BACKEND_INFERENCE_ENGINE. Otherwise it equals to DNN_BACKEND_OPENCV.
pub fn set_preferable_backend(self, backend_id: i32) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Net_setPreferableBackend_int_backendId(self, backend_id) }.into_result()
}
// identifier: cv_dnn_Net_setPreferableTarget_int_targetId
/// Ask network to make computations on specific target device.
/// ## Parameters
/// @param[in] targetId target identifier.
/// @see Target
///
/// List of supported combinations backend / target:
/// | | DNN_BACKEND_OPENCV | DNN_BACKEND_INFERENCE_ENGINE | DNN_BACKEND_HALIDE |
/// |------------------------|--------------------|------------------------------|--------------------|
/// | DNN_TARGET_CPU | + | + | + |
/// | DNN_TARGET_OPENCL | + | + | + |
/// | DNN_TARGET_OPENCL_FP16 | + | + | |
/// | DNN_TARGET_MYRIAD | | + | |
/// | DNN_TARGET_FPGA | | + | |
pub fn set_preferable_target(self, target_id: i32) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Net_setPreferableTarget_int_targetId(self, target_id) }.into_result()
}
// identifier: cv_dnn_Net_setInput_Mat_blob_String_name_double_scalefactor_Scalar_mean
/// Sets the new input value for the network
/// ## Parameters
/// * blob: A new blob. Should have CV_32F or CV_8U depth.
/// * name: A name of input layer.
/// * scalefactor: An optional normalization scale.
/// * mean: An optional mean subtraction values.
/// @see connect(String, String) to know format of the descriptor.
///
/// If scale or mean values are specified, a final input blob is computed
/// as:
/// <div lang='latex'>input(n,c,h,w) = scalefactor \times (blob(n,c,h,w) - mean_c)</div>
///
/// ## C++ default parameters:
/// * name: ""
/// * scalefactor: 1.0
/// * mean: Scalar()
pub fn set_input(self, blob: &core::Mat, name: &str, scalefactor: f64, mean: core::Scalar) -> Result<()> {
string_arg!(name);
unsafe { sys::cv_core_cv_dnn_Net_setInput_Mat_blob_String_name_double_scalefactor_Scalar_mean(self, blob.as_raw_Mat(), name.as_ptr(), scalefactor, mean) }.into_result()
}
// identifier: cv_dnn_Net_setParam_DictValue_layer_int_numParam_Mat_blob
/// Sets the new value for the learned param of the layer.
/// ## Parameters
/// * layer: name or id of the layer.
/// * numParam: index of the layer parameter in the Layer::blobs array.
/// * blob: the new value.
/// @see Layer::blobs
///
/// Note: If shape of the new blob differs from the previous shape,
/// then the following forward pass may fail.
pub fn set_param(self, layer: &core::DictValue, num_param: i32, blob: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Net_setParam_DictValue_layer_int_numParam_Mat_blob(self, layer.as_raw_DictValue(), num_param, blob.as_raw_Mat()) }.into_result()
}
// identifier: cv_dnn_Net_getParam_DictValue_layer_int_numParam
/// Returns parameter blob of the layer.
/// ## Parameters
/// * layer: name or id of the layer.
/// * numParam: index of the layer parameter in the Layer::blobs array.
/// @see Layer::blobs
///
/// ## C++ default parameters:
/// * num_param: 0
pub fn get_param(self, layer: &core::DictValue, num_param: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_dnn_Net_getParam_DictValue_layer_int_numParam(self, layer.as_raw_DictValue(), num_param) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_dnn_Net_getUnconnectedOutLayers_const
/// Returns indexes of layers with unconnected outputs.
pub fn get_unconnected_out_layers(self) -> Result<types::VectorOfint> {
unsafe { sys::cv_core_cv_dnn_Net_getUnconnectedOutLayers_const(self) }.into_result().map(|x| types::VectorOfint { ptr: x })
}
// identifier: cv_dnn_Net_getUnconnectedOutLayersNames_const
/// Returns names of layers with unconnected outputs.
pub fn get_unconnected_out_layers_names(self) -> Result<types::VectorOfString> {
unsafe { sys::cv_core_cv_dnn_Net_getUnconnectedOutLayersNames_const(self) }.into_result().map(|x| types::VectorOfString { ptr: x })
}
// identifier: cv_dnn_Net_getLayersShapes_const_VectorOfVectorOfint_netInputShapes_VectorOfint_layersIds_VectorOfVectorOfVectorOfint_inLayersShapes_VectorOfVectorOfVectorOfint_outLayersShapes
/// Returns input and output shapes for all layers in loaded model;
/// preliminary inferencing isn't necessary.
/// ## Parameters
/// * netInputShapes: shapes for all input blobs in net input layer.
/// * layersIds: output parameter for layer IDs.
/// * inLayersShapes: output parameter for input layers shapes;
/// order is the same as in layersIds
/// * outLayersShapes: output parameter for output layers shapes;
/// order is the same as in layersIds
pub fn get_layers_shapes(self, net_input_shapes: &types::VectorOfVectorOfint, layers_ids: &types::VectorOfint, in_layers_shapes: &types::VectorOfVectorOfVectorOfint, out_layers_shapes: &types::VectorOfVectorOfVectorOfint) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Net_getLayersShapes_const_VectorOfVectorOfint_netInputShapes_VectorOfint_layersIds_VectorOfVectorOfVectorOfint_inLayersShapes_VectorOfVectorOfVectorOfint_outLayersShapes(self, net_input_shapes.as_raw_VectorOfVectorOfint(), layers_ids.as_raw_VectorOfint(), in_layers_shapes.as_raw_VectorOfVectorOfVectorOfint(), out_layers_shapes.as_raw_VectorOfVectorOfVectorOfint()) }.into_result()
}
// identifier: cv_dnn_Net_getLayerShapes_const_VectorOfVectorOfint_netInputShapes_int_layerId_VectorOfVectorOfint_inLayerShapes_VectorOfVectorOfint_outLayerShapes
/// @overload
pub fn get_layer_shapes(self, net_input_shapes: &types::VectorOfVectorOfint, layer_id: i32, in_layer_shapes: &types::VectorOfVectorOfint, out_layer_shapes: &types::VectorOfVectorOfint) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Net_getLayerShapes_const_VectorOfVectorOfint_netInputShapes_int_layerId_VectorOfVectorOfint_inLayerShapes_VectorOfVectorOfint_outLayerShapes(self, net_input_shapes.as_raw_VectorOfVectorOfint(), layer_id, in_layer_shapes.as_raw_VectorOfVectorOfint(), out_layer_shapes.as_raw_VectorOfVectorOfint()) }.into_result()
}
// identifier: cv_dnn_Net_getFLOPS_const_VectorOfVectorOfint_netInputShapes
/// Computes FLOP for whole loaded model with specified input shapes.
/// ## Parameters
/// * netInputShapes: vector of shapes for all net inputs.
/// @returns computed FLOP.
pub fn get_flops(self, net_input_shapes: &types::VectorOfVectorOfint) -> Result<i64> {
unsafe { sys::cv_core_cv_dnn_Net_getFLOPS_const_VectorOfVectorOfint_netInputShapes(self, net_input_shapes.as_raw_VectorOfVectorOfint()) }.into_result()
}
// identifier: cv_dnn_Net_getFLOPS_const_int_layerId_VectorOfVectorOfint_netInputShapes
/// @overload
pub fn get_flops_1(self, layer_id: i32, net_input_shapes: &types::VectorOfVectorOfint) -> Result<i64> {
unsafe { sys::cv_core_cv_dnn_Net_getFLOPS_const_int_layerId_VectorOfVectorOfint_netInputShapes(self, layer_id, net_input_shapes.as_raw_VectorOfVectorOfint()) }.into_result()
}
// identifier: cv_dnn_Net_getLayerTypes_const_VectorOfString_layersTypes
/// Returns list of types for layer used in model.
/// ## Parameters
/// * layersTypes: output parameter for returning types.
pub fn get_layer_types(self, layers_types: &types::VectorOfString) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Net_getLayerTypes_const_VectorOfString_layersTypes(self, layers_types.as_raw_VectorOfString()) }.into_result()
}
// identifier: cv_dnn_Net_getLayersCount_const_String_layerType
/// Returns count of layers of specified type.
/// ## Parameters
/// * layerType: type.
/// @returns count of layers
pub fn get_layers_count(self, layer_type: &str) -> Result<i32> {
string_arg!(layer_type);
unsafe { sys::cv_core_cv_dnn_Net_getLayersCount_const_String_layerType(self, layer_type.as_ptr()) }.into_result()
}
// identifier: cv_dnn_Net_getMemoryConsumption_const_VectorOfVectorOfint_netInputShapes_size_t_weights_size_t_blobs
/// Computes bytes number which are required to store
/// all weights and intermediate blobs for model.
/// ## Parameters
/// * netInputShapes: vector of shapes for all net inputs.
/// * weights: output parameter to store resulting bytes for weights.
/// * blobs: output parameter to store resulting bytes for intermediate blobs.
pub fn get_memory_consumption(self, net_input_shapes: &types::VectorOfVectorOfint, weights: size_t, blobs: size_t) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Net_getMemoryConsumption_const_VectorOfVectorOfint_netInputShapes_size_t_weights_size_t_blobs(self, net_input_shapes.as_raw_VectorOfVectorOfint(), weights, blobs) }.into_result()
}
// identifier: cv_dnn_Net_getMemoryConsumption_const_int_layerId_VectorOfVectorOfint_netInputShapes_size_t_weights_size_t_blobs
/// @overload
pub fn get_memory_consumption_1(self, layer_id: i32, net_input_shapes: &types::VectorOfVectorOfint, weights: size_t, blobs: size_t) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Net_getMemoryConsumption_const_int_layerId_VectorOfVectorOfint_netInputShapes_size_t_weights_size_t_blobs(self, layer_id, net_input_shapes.as_raw_VectorOfVectorOfint(), weights, blobs) }.into_result()
}
// identifier: cv_dnn_Net_getMemoryConsumption_const_VectorOfVectorOfint_netInputShapes_VectorOfint_layerIds_VectorOfsize_t_weights_VectorOfsize_t_blobs
/// Computes bytes number which are required to store
/// all weights and intermediate blobs for each layer.
/// ## Parameters
/// * netInputShapes: vector of shapes for all net inputs.
/// * layerIds: output vector to save layer IDs.
/// * weights: output parameter to store resulting bytes for weights.
/// * blobs: output parameter to store resulting bytes for intermediate blobs.
pub fn get_memory_consumption_2(self, net_input_shapes: &types::VectorOfVectorOfint, layer_ids: &types::VectorOfint, weights: &types::VectorOfsize_t, blobs: &types::VectorOfsize_t) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Net_getMemoryConsumption_const_VectorOfVectorOfint_netInputShapes_VectorOfint_layerIds_VectorOfsize_t_weights_VectorOfsize_t_blobs(self, net_input_shapes.as_raw_VectorOfVectorOfint(), layer_ids.as_raw_VectorOfint(), weights.as_raw_VectorOfsize_t(), blobs.as_raw_VectorOfsize_t()) }.into_result()
}
// identifier: cv_dnn_Net_enableFusion_bool_fusion
/// Enables or disables layer fusion in the network.
/// ## Parameters
/// * fusion: true to enable the fusion, false to disable. The fusion is enabled by default.
pub fn enable_fusion(self, fusion: bool) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_Net_enableFusion_bool_fusion(self, fusion) }.into_result()
}
// identifier: cv_dnn_Net_getPerfProfile_VectorOfdouble_timings
/// Returns overall time for inference and timings (in ticks) for layers.
/// Indexes in returned vector correspond to layers ids. Some layers can be fused with others,
/// in this case zero ticks count will be return for that skipped layers.
/// ## Parameters
/// * timings: vector for tick timings for all layers.
/// @return overall ticks for model inference.
pub fn get_perf_profile(self, timings: &types::VectorOfdouble) -> Result<i64> {
unsafe { sys::cv_core_cv_dnn_Net_getPerfProfile_VectorOfdouble_timings(self, timings.as_raw_VectorOfdouble()) }.into_result()
}
}
// boxed class cv::dnn::NormalizeBBoxLayer
/// <span lang='latex'> L_p </span> - normalization layer.
/// ## Parameters
/// * p: Normalization factor. The most common `p = 1` for <span lang='latex'> L_1 </span> -
/// normalization or `p = 2` for <span lang='latex'> L_2 </span> - normalization or a custom one.
/// * eps: Parameter <span lang='latex'> \epsilon </span> to prevent a division by zero.
/// * across_spatial: If true, normalize an input across all non-batch dimensions.
/// Otherwise normalize an every channel separately.
///
/// Across spatial:
/// @f[
/// norm = \sqrt[p]{\epsilon + \sum_{x, y, c} |src(x, y, c)|^p } \\
/// dst(x, y, c) = \frac{ src(x, y, c) }{norm}
/// @f]
///
/// Channel wise normalization:
/// @f[
/// norm(c) = \sqrt[p]{\epsilon + \sum_{x, y} |src(x, y, c)|^p } \\
/// dst(x, y, c) = \frac{ src(x, y, c) }{norm(c)}
/// @f]
///
/// Where `x, y` - spatial coordinates, `c` - channel.
///
/// An every sample in the batch is normalized separately. Optionally,
/// output is scaled by the trained parameters.
#[allow(dead_code)]
pub struct NormalizeBBoxLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::NormalizeBBoxLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_NormalizeBBoxLayer(self.ptr) };
}
}
impl core::NormalizeBBoxLayer {
#[doc(hidden)] pub fn as_raw_NormalizeBBoxLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for NormalizeBBoxLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for NormalizeBBoxLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl NormalizeBBoxLayer {
}
// boxed class cv::dnn::PaddingLayer
/// Adds extra values for specific axes.
/// ## Parameters
/// * paddings: Vector of paddings in format
/// ```ignore
/// [ pad_before, pad_after, // [0]th dimension
/// pad_before, pad_after, // [1]st dimension
/// ...
/// pad_before, pad_after ] // [n]th dimension
/// ```
///
/// that represents number of padded values at every dimension
/// starting from the first one. The rest of dimensions won't
/// be padded.
/// * value: Value to be padded. Defaults to zero.
/// * type: Padding type: 'constant', 'reflect'
/// * input_dims: Torch's parameter. If @p input_dims is not equal to the
/// actual input dimensionality then the `[0]th` dimension
/// is considered as a batch dimension and @p paddings are shifted
/// to a one dimension. Defaults to `-1` that means padding
/// corresponding to @p paddings.
#[allow(dead_code)]
pub struct PaddingLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::PaddingLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_PaddingLayer(self.ptr) };
}
}
impl core::PaddingLayer {
#[doc(hidden)] pub fn as_raw_PaddingLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for PaddingLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for PaddingLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl PaddingLayer {
}
// boxed class cv::dnn::PermuteLayer
#[allow(dead_code)]
pub struct PermuteLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::PermuteLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_PermuteLayer(self.ptr) };
}
}
impl core::PermuteLayer {
#[doc(hidden)] pub fn as_raw_PermuteLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for PermuteLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for PermuteLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl PermuteLayer {
}
// boxed class cv::dnn::PoolingLayer
#[allow(dead_code)]
pub struct PoolingLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::PoolingLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_PoolingLayer(self.ptr) };
}
}
impl core::PoolingLayer {
#[doc(hidden)] pub fn as_raw_PoolingLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for PoolingLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for PoolingLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl PoolingLayer {
}
// boxed class cv::dnn::PowerLayer
#[allow(dead_code)]
pub struct PowerLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::PowerLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_PowerLayer(self.ptr) };
}
}
impl core::PowerLayer {
#[doc(hidden)] pub fn as_raw_PowerLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for PowerLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for PowerLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::ActivationLayer for PowerLayer {
#[doc(hidden)] fn as_raw_ActivationLayer(&self) -> *mut c_void { self.ptr }
}
impl PowerLayer {
}
// boxed class cv::dnn::PriorBoxLayer
#[allow(dead_code)]
pub struct PriorBoxLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::PriorBoxLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_PriorBoxLayer(self.ptr) };
}
}
impl core::PriorBoxLayer {
#[doc(hidden)] pub fn as_raw_PriorBoxLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for PriorBoxLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for PriorBoxLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl PriorBoxLayer {
}
// boxed class cv::dnn::ProposalLayer
#[allow(dead_code)]
pub struct ProposalLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ProposalLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_ProposalLayer(self.ptr) };
}
}
impl core::ProposalLayer {
#[doc(hidden)] pub fn as_raw_ProposalLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for ProposalLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ProposalLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl ProposalLayer {
}
// Generating impl for trait cv::dnn::RNNLayer (trait)
/// Classical recurrent layer
///
/// Accepts two inputs @f$x_t@f$ and @f$h_{t-1}@f$ and compute two outputs @f$o_t@f$ and @f$h_t@f$.
///
/// - input: should contain packed input @f$x_t@f$.
/// - output: should contain output @f$o_t@f$ (and @f$h_t@f$ if setProduceHiddenOutput() is set to true).
///
/// input[0] should have shape [`T`, `N`, `data_dims`] where `T` and `N` is number of timestamps and number of independent samples of @f$x_t@f$ respectively.
///
/// output[0] will have shape [`T`, `N`, @f$N_o@f$], where @f$N_o@f$ is number of rows in @f$ W_{xo} @f$ matrix.
///
/// If setProduceHiddenOutput() is set to true then @p output[1] will contain a Mat with shape [`T`, `N`, @f$N_h@f$], where @f$N_h@f$ is number of rows in @f$ W_{hh} @f$ matrix.
pub trait RNNLayer : core::Layer {
#[doc(hidden)] fn as_raw_RNNLayer(&self) -> *mut c_void;
// identifier: cv_dnn_RNNLayer_setWeights_Mat_Wxh_Mat_bh_Mat_Whh_Mat_Who_Mat_bo
/// Setups learned weights.
///
/// Recurrent-layer behavior on each step is defined by current input @f$ x_t @f$, previous state @f$ h_t @f$ and learned weights as follows:
/// @f{eqnarray*}{
/// h_t &= tanh&(W_{hh} h_{t-1} + W_{xh} x_t + b_h), \\
/// o_t &= tanh&(W_{ho} h_t + b_o),
/// @f}
///
/// ## Parameters
/// * Wxh: is @f$ W_{xh} @f$ matrix
/// * bh: is @f$ b_{h} @f$ vector
/// * Whh: is @f$ W_{hh} @f$ matrix
/// * Who: is @f$ W_{xo} @f$ matrix
/// * bo: is @f$ b_{o} @f$ vector
fn set_weights(&mut self, wxh: &core::Mat, bh: &core::Mat, whh: &core::Mat, who: &core::Mat, bo: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_RNNLayer_setWeights_Mat_Wxh_Mat_bh_Mat_Whh_Mat_Who_Mat_bo(self.as_raw_RNNLayer(), wxh.as_raw_Mat(), bh.as_raw_Mat(), whh.as_raw_Mat(), who.as_raw_Mat(), bo.as_raw_Mat()) }.into_result()
}
// identifier: cv_dnn_RNNLayer_setProduceHiddenOutput_bool_produce
/// If this flag is set to true then layer will produce @f$ h_t @f$ as second output.
/// @details Shape of the second output is the same as first output.
///
/// ## C++ default parameters:
/// * produce: false
fn set_produce_hidden_output(&mut self, produce: bool) -> Result<()> {
unsafe { sys::cv_core_cv_dnn_RNNLayer_setProduceHiddenOutput_bool_produce(self.as_raw_RNNLayer(), produce) }.into_result()
}
}
impl<'a> RNNLayer + 'a {
}
// boxed class cv::dnn::ReLU6Layer
#[allow(dead_code)]
pub struct ReLU6Layer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ReLU6Layer {
fn drop(&mut self) {
unsafe { sys::cv_delete_ReLU6Layer(self.ptr) };
}
}
impl core::ReLU6Layer {
#[doc(hidden)] pub fn as_raw_ReLU6Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for ReLU6Layer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ReLU6Layer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::ActivationLayer for ReLU6Layer {
#[doc(hidden)] fn as_raw_ActivationLayer(&self) -> *mut c_void { self.ptr }
}
impl ReLU6Layer {
}
// boxed class cv::dnn::ReLULayer
#[allow(dead_code)]
pub struct ReLULayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ReLULayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_ReLULayer(self.ptr) };
}
}
impl core::ReLULayer {
#[doc(hidden)] pub fn as_raw_ReLULayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for ReLULayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ReLULayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::ActivationLayer for ReLULayer {
#[doc(hidden)] fn as_raw_ActivationLayer(&self) -> *mut c_void { self.ptr }
}
impl ReLULayer {
}
// boxed class cv::dnn::RegionLayer
#[allow(dead_code)]
pub struct RegionLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::RegionLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_RegionLayer(self.ptr) };
}
}
impl core::RegionLayer {
#[doc(hidden)] pub fn as_raw_RegionLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for RegionLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for RegionLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl RegionLayer {
}
// boxed class cv::dnn::ReorgLayer
#[allow(dead_code)]
pub struct ReorgLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ReorgLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_ReorgLayer(self.ptr) };
}
}
impl core::ReorgLayer {
#[doc(hidden)] pub fn as_raw_ReorgLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for ReorgLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ReorgLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl ReorgLayer {
}
// boxed class cv::dnn::ReshapeLayer
#[allow(dead_code)]
pub struct ReshapeLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ReshapeLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_ReshapeLayer(self.ptr) };
}
}
impl core::ReshapeLayer {
#[doc(hidden)] pub fn as_raw_ReshapeLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for ReshapeLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ReshapeLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl ReshapeLayer {
}
// boxed class cv::dnn::ResizeLayer
/// Resize input 4-dimensional blob by nearest neighbor or bilinear strategy.
///
/// Layer is used to support TensorFlow's resize_nearest_neighbor and resize_bilinear ops.
#[allow(dead_code)]
pub struct ResizeLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ResizeLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_ResizeLayer(self.ptr) };
}
}
impl core::ResizeLayer {
#[doc(hidden)] pub fn as_raw_ResizeLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for ResizeLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ResizeLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl ResizeLayer {
}
// boxed class cv::dnn::ScaleLayer
#[allow(dead_code)]
pub struct ScaleLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ScaleLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_ScaleLayer(self.ptr) };
}
}
impl core::ScaleLayer {
#[doc(hidden)] pub fn as_raw_ScaleLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for ScaleLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ScaleLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl ScaleLayer {
}
// boxed class cv::dnn::ShiftLayer
#[allow(dead_code)]
pub struct ShiftLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ShiftLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_ShiftLayer(self.ptr) };
}
}
impl core::ShiftLayer {
#[doc(hidden)] pub fn as_raw_ShiftLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for ShiftLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ShiftLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl ShiftLayer {
}
// boxed class cv::dnn::ShuffleChannelLayer
/// Permute channels of 4-dimensional input blob.
/// ## Parameters
/// * group: Number of groups to split input channels and pick in turns
/// into output blob.
///
/// <div lang='latex'> groupSize = \frac{number\ of\ channels}{group} </div>
/// <div lang='latex'> output(n, c, h, w) = input(n, groupSize \times (c \% group) + \lfloor \frac{c}{group} \rfloor, h, w) </div>
/// Read more at https://arxiv.org/pdf/1707.01083.pdf
#[allow(dead_code)]
pub struct ShuffleChannelLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ShuffleChannelLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_ShuffleChannelLayer(self.ptr) };
}
}
impl core::ShuffleChannelLayer {
#[doc(hidden)] pub fn as_raw_ShuffleChannelLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for ShuffleChannelLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for ShuffleChannelLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl ShuffleChannelLayer {
}
// boxed class cv::dnn::SigmoidLayer
#[allow(dead_code)]
pub struct SigmoidLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::SigmoidLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_SigmoidLayer(self.ptr) };
}
}
impl core::SigmoidLayer {
#[doc(hidden)] pub fn as_raw_SigmoidLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for SigmoidLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for SigmoidLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::ActivationLayer for SigmoidLayer {
#[doc(hidden)] fn as_raw_ActivationLayer(&self) -> *mut c_void { self.ptr }
}
impl SigmoidLayer {
}
// boxed class cv::dnn::SliceLayer
/// Slice layer has several modes:
/// 1. Caffe mode
/// ## Parameters
/// @param[in] axis Axis of split operation
/// @param[in] slice_point Array of split points
///
/// Number of output blobs equals to number of split points plus one. The
/// first blob is a slice on input from 0 to @p slice_point[0] - 1 by @p axis,
/// the second output blob is a slice of input from @p slice_point[0] to
/// @p slice_point[1] - 1 by @p axis and the last output blob is a slice of
/// input from @p slice_point[-1] up to the end of @p axis size.
///
/// 2. TensorFlow mode
/// * begin: Vector of start indices
/// * size: Vector of sizes
///
/// More convenient numpy-like slice. One and only output blob
/// is a slice `input[begin[0]:begin[0]+size[0], begin[1]:begin[1]+size[1], ...]`
///
/// 3. Torch mode
/// * axis: Axis of split operation
///
/// Split input blob on the equal parts by @p axis.
#[allow(dead_code)]
pub struct SliceLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::SliceLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_SliceLayer(self.ptr) };
}
}
impl core::SliceLayer {
#[doc(hidden)] pub fn as_raw_SliceLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for SliceLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for SliceLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl SliceLayer {
}
// boxed class cv::dnn::SoftmaxLayer
#[allow(dead_code)]
pub struct SoftmaxLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::SoftmaxLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_SoftmaxLayer(self.ptr) };
}
}
impl core::SoftmaxLayer {
#[doc(hidden)] pub fn as_raw_SoftmaxLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for SoftmaxLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for SoftmaxLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl SoftmaxLayer {
}
// boxed class cv::dnn::SplitLayer
#[allow(dead_code)]
pub struct SplitLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::SplitLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_SplitLayer(self.ptr) };
}
}
impl core::SplitLayer {
#[doc(hidden)] pub fn as_raw_SplitLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for SplitLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for SplitLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl SplitLayer {
}
// boxed class cv::dnn::TanHLayer
#[allow(dead_code)]
pub struct TanHLayer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::TanHLayer {
fn drop(&mut self) {
unsafe { sys::cv_delete_TanHLayer(self.ptr) };
}
}
impl core::TanHLayer {
#[doc(hidden)] pub fn as_raw_TanHLayer(&self) -> *mut c_void { self.ptr }
}
impl core::Layer for TanHLayer {
#[doc(hidden)] fn as_raw_Layer(&self) -> *mut c_void { self.ptr }
}
impl core::Algorithm for TanHLayer {
#[doc(hidden)] fn as_raw_Algorithm(&self) -> *mut c_void { self.ptr }
}
impl core::ActivationLayer for TanHLayer {
#[doc(hidden)] fn as_raw_ActivationLayer(&self) -> *mut c_void { self.ptr }
}
impl TanHLayer {
}
// boxed class cv::float16_t
#[allow(dead_code)]
pub struct float16_t {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::float16_t {
fn drop(&mut self) {
unsafe { sys::cv_delete_float16_t(self.ptr) };
}
}
impl core::float16_t {
#[doc(hidden)] pub fn as_raw_float16_t(&self) -> *mut c_void { self.ptr }
}
impl float16_t {
// identifier: cv_float16_t_float16_t
pub fn new() -> Result<core::float16_t> {
unsafe { sys::cv_core_cv_float16_t_float16_t() }.into_result().map(|x| core::float16_t { ptr: x })
}
// identifier: cv_float16_t_float16_t_float_x
pub fn new_1(x: f32) -> Result<core::float16_t> {
unsafe { sys::cv_core_cv_float16_t_float16_t_float_x(x) }.into_result().map(|x| core::float16_t { ptr: x })
}
// identifier: cv_float16_t_fromBits_ushort_w
pub fn from_bits(w: u16) -> Result<core::float16_t> {
unsafe { sys::cv_core_cv_float16_t_fromBits_ushort_w(w) }.into_result().map(|x| core::float16_t { ptr: x })
}
// identifier: cv_float16_t_zero
pub fn zero() -> Result<core::float16_t> {
unsafe { sys::cv_core_cv_float16_t_zero() }.into_result().map(|x| core::float16_t { ptr: x })
}
// identifier: cv_float16_t_bits_const
pub fn bits(&self) -> Result<u16> {
unsafe { sys::cv_core_cv_float16_t_bits_const(self.as_raw_float16_t()) }.into_result()
}
}
// boxed class cv::instr::NodeData
#[allow(dead_code)]
pub struct NodeData {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::NodeData {
fn drop(&mut self) {
unsafe { sys::cv_delete_NodeData(self.ptr) };
}
}
impl core::NodeData {
#[doc(hidden)] pub fn as_raw_NodeData(&self) -> *mut c_void { self.ptr }
}
impl NodeData {
// identifier: cv_instr_NodeData_NodeData_NodeData_ref
pub fn new(_ref: &core::NodeData) -> Result<core::NodeData> {
unsafe { sys::cv_core_cv_instr_NodeData_NodeData_NodeData_ref(_ref.as_raw_NodeData()) }.into_result().map(|x| core::NodeData { ptr: x })
}
// identifier: cv_instr_NodeData_getTotalMs_const
pub fn get_total_ms(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_instr_NodeData_getTotalMs_const(self.as_raw_NodeData()) }.into_result()
}
// identifier: cv_instr_NodeData_getMeanMs_const
pub fn get_mean_ms(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_instr_NodeData_getMeanMs_const(self.as_raw_NodeData()) }.into_result()
}
}
// boxed class cv::instr::NodeDataTls
#[allow(dead_code)]
pub struct NodeDataTls {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::NodeDataTls {
fn drop(&mut self) {
unsafe { sys::cv_delete_NodeDataTls(self.ptr) };
}
}
impl core::NodeDataTls {
#[doc(hidden)] pub fn as_raw_NodeDataTls(&self) -> *mut c_void { self.ptr }
}
impl NodeDataTls {
// identifier: cv_instr_NodeDataTls_NodeDataTls
pub fn new() -> Result<core::NodeDataTls> {
unsafe { sys::cv_core_cv_instr_NodeDataTls_NodeDataTls() }.into_result().map(|x| core::NodeDataTls { ptr: x })
}
}
// Generating impl for trait cv::ml::ANN_MLP (trait)
/// Artificial Neural Networks - Multi-Layer Perceptrons.
///
/// Unlike many other models in ML that are constructed and trained at once, in the MLP model these
/// steps are separated. First, a network with the specified topology is created using the non-default
/// constructor or the method ANN_MLP::create. All the weights are set to zeros. Then, the network is
/// trained using a set of input and output vectors. The training procedure can be repeated more than
/// once, that is, the weights can be adjusted based on the new training data.
///
/// Additional flags for StatModel::train are available: ANN_MLP::TrainFlags.
///
/// @sa @ref ml_intro_ann
pub trait ANN_MLP : core::StatModel {
#[doc(hidden)] fn as_raw_ANN_MLP(&self) -> *mut c_void;
// identifier: cv_ml_ANN_MLP_setTrainMethod_int_method_double_param1_double_param2
/// Sets training method and common parameters.
/// ## Parameters
/// * method: Default value is ANN_MLP::RPROP. See ANN_MLP::TrainingMethods.
/// * param1: passed to setRpropDW0 for ANN_MLP::RPROP and to setBackpropWeightScale for ANN_MLP::BACKPROP and to initialT for ANN_MLP::ANNEAL.
/// * param2: passed to setRpropDWMin for ANN_MLP::RPROP and to setBackpropMomentumScale for ANN_MLP::BACKPROP and to finalT for ANN_MLP::ANNEAL.
///
/// ## C++ default parameters:
/// * param1: 0
/// * param2: 0
fn set_train_method(&mut self, method: i32, param1: f64, param2: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_setTrainMethod_int_method_double_param1_double_param2(self.as_raw_ANN_MLP(), method, param1, param2) }.into_result()
}
// identifier: cv_ml_ANN_MLP_getTrainMethod_const
/// Returns current training method
fn get_train_method(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_getTrainMethod_const(self.as_raw_ANN_MLP()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_setActivationFunction_int_type_double_param1_double_param2
/// Initialize the activation function for each neuron.
/// Currently the default and the only fully supported activation function is ANN_MLP::SIGMOID_SYM.
/// ## Parameters
/// * type: The type of activation function. See ANN_MLP::ActivationFunctions.
/// * param1: The first parameter of the activation function, <span lang='latex'>\alpha</span>. Default value is 0.
/// * param2: The second parameter of the activation function, <span lang='latex'>\beta</span>. Default value is 0.
///
/// ## C++ default parameters:
/// * param1: 0
/// * param2: 0
fn set_activation_function(&mut self, _type: i32, param1: f64, param2: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_setActivationFunction_int_type_double_param1_double_param2(self.as_raw_ANN_MLP(), _type, param1, param2) }.into_result()
}
// identifier: cv_ml_ANN_MLP_setLayerSizes_Mat__layer_sizes
/// Integer vector specifying the number of neurons in each layer including the input and output layers.
/// The very first element specifies the number of elements in the input layer.
/// The last element - number of elements in the output layer. Default value is empty Mat.
/// @sa getLayerSizes
fn set_layer_sizes(&mut self, _layer_sizes: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_setLayerSizes_Mat__layer_sizes(self.as_raw_ANN_MLP(), _layer_sizes.as_raw_Mat()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_getLayerSizes_const
/// Integer vector specifying the number of neurons in each layer including the input and output layers.
/// The very first element specifies the number of elements in the input layer.
/// The last element - number of elements in the output layer.
/// @sa setLayerSizes
fn get_layer_sizes(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_getLayerSizes_const(self.as_raw_ANN_MLP()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_ANN_MLP_getTermCriteria_const
/// @see setTermCriteria
fn get_term_criteria(&self) -> Result<core::TermCriteria> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_getTermCriteria_const(self.as_raw_ANN_MLP()) }.into_result().map(|x| core::TermCriteria { ptr: x })
}
// identifier: cv_ml_ANN_MLP_setTermCriteria_TermCriteria_val
/// @copybrief getTermCriteria @see getTermCriteria
fn set_term_criteria(&mut self, val: &core::TermCriteria) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_setTermCriteria_TermCriteria_val(self.as_raw_ANN_MLP(), val.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_getBackpropWeightScale_const
/// @see setBackpropWeightScale
fn get_backprop_weight_scale(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_getBackpropWeightScale_const(self.as_raw_ANN_MLP()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_setBackpropWeightScale_double_val
/// @copybrief getBackpropWeightScale @see getBackpropWeightScale
fn set_backprop_weight_scale(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_setBackpropWeightScale_double_val(self.as_raw_ANN_MLP(), val) }.into_result()
}
// identifier: cv_ml_ANN_MLP_getBackpropMomentumScale_const
/// @see setBackpropMomentumScale
fn get_backprop_momentum_scale(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_getBackpropMomentumScale_const(self.as_raw_ANN_MLP()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_setBackpropMomentumScale_double_val
/// @copybrief getBackpropMomentumScale @see getBackpropMomentumScale
fn set_backprop_momentum_scale(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_setBackpropMomentumScale_double_val(self.as_raw_ANN_MLP(), val) }.into_result()
}
// identifier: cv_ml_ANN_MLP_getRpropDW0_const
/// @see setRpropDW0
fn get_rprop_dw0(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_getRpropDW0_const(self.as_raw_ANN_MLP()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_setRpropDW0_double_val
/// @copybrief getRpropDW0 @see getRpropDW0
fn set_rprop_dw0(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_setRpropDW0_double_val(self.as_raw_ANN_MLP(), val) }.into_result()
}
// identifier: cv_ml_ANN_MLP_getRpropDWPlus_const
/// @see setRpropDWPlus
fn get_rprop_dw_plus(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_getRpropDWPlus_const(self.as_raw_ANN_MLP()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_setRpropDWPlus_double_val
/// @copybrief getRpropDWPlus @see getRpropDWPlus
fn set_rprop_dw_plus(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_setRpropDWPlus_double_val(self.as_raw_ANN_MLP(), val) }.into_result()
}
// identifier: cv_ml_ANN_MLP_getRpropDWMinus_const
/// @see setRpropDWMinus
fn get_rprop_dw_minus(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_getRpropDWMinus_const(self.as_raw_ANN_MLP()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_setRpropDWMinus_double_val
/// @copybrief getRpropDWMinus @see getRpropDWMinus
fn set_rprop_dw_minus(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_setRpropDWMinus_double_val(self.as_raw_ANN_MLP(), val) }.into_result()
}
// identifier: cv_ml_ANN_MLP_getRpropDWMin_const
/// @see setRpropDWMin
fn get_rprop_dw_min(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_getRpropDWMin_const(self.as_raw_ANN_MLP()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_setRpropDWMin_double_val
/// @copybrief getRpropDWMin @see getRpropDWMin
fn set_rprop_dw_min(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_setRpropDWMin_double_val(self.as_raw_ANN_MLP(), val) }.into_result()
}
// identifier: cv_ml_ANN_MLP_getRpropDWMax_const
/// @see setRpropDWMax
fn get_rprop_dw_max(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_getRpropDWMax_const(self.as_raw_ANN_MLP()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_setRpropDWMax_double_val
/// @copybrief getRpropDWMax @see getRpropDWMax
fn set_rprop_dw_max(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_setRpropDWMax_double_val(self.as_raw_ANN_MLP(), val) }.into_result()
}
// identifier: cv_ml_ANN_MLP_getAnnealInitialT_const
/// @see setAnnealInitialT
fn get_anneal_initial_t(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_getAnnealInitialT_const(self.as_raw_ANN_MLP()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_setAnnealInitialT_double_val
/// @copybrief getAnnealInitialT @see getAnnealInitialT
fn set_anneal_initial_t(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_setAnnealInitialT_double_val(self.as_raw_ANN_MLP(), val) }.into_result()
}
// identifier: cv_ml_ANN_MLP_getAnnealFinalT_const
/// @see setAnnealFinalT
fn get_anneal_final_t(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_getAnnealFinalT_const(self.as_raw_ANN_MLP()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_setAnnealFinalT_double_val
/// @copybrief getAnnealFinalT @see getAnnealFinalT
fn set_anneal_final_t(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_setAnnealFinalT_double_val(self.as_raw_ANN_MLP(), val) }.into_result()
}
// identifier: cv_ml_ANN_MLP_getAnnealCoolingRatio_const
/// @see setAnnealCoolingRatio
fn get_anneal_cooling_ratio(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_getAnnealCoolingRatio_const(self.as_raw_ANN_MLP()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_setAnnealCoolingRatio_double_val
/// @copybrief getAnnealCoolingRatio @see getAnnealCoolingRatio
fn set_anneal_cooling_ratio(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_setAnnealCoolingRatio_double_val(self.as_raw_ANN_MLP(), val) }.into_result()
}
// identifier: cv_ml_ANN_MLP_getAnnealItePerStep_const
/// @see setAnnealItePerStep
fn get_anneal_ite_per_step(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_getAnnealItePerStep_const(self.as_raw_ANN_MLP()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_setAnnealItePerStep_int_val
/// @copybrief getAnnealItePerStep @see getAnnealItePerStep
fn set_anneal_ite_per_step(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_setAnnealItePerStep_int_val(self.as_raw_ANN_MLP(), val) }.into_result()
}
// identifier: cv_ml_ANN_MLP_getWeights_const_int_layerIdx
fn get_weights(&self, layer_idx: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_getWeights_const_int_layerIdx(self.as_raw_ANN_MLP(), layer_idx) }.into_result().map(|x| core::Mat { ptr: x })
}
}
impl<'a> ANN_MLP + 'a {
// identifier: cv_ml_ANN_MLP_create
/// Creates empty model
///
/// Use StatModel::train to train the model, Algorithm::load\<ANN_MLP\>(filename) to load the pre-trained model.
/// Note that the train method has optional flags: ANN_MLP::TrainFlags.
pub fn create() -> Result<types::PtrOfANN_MLP> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_create() }.into_result().map(|x| types::PtrOfANN_MLP { ptr: x })
}
// identifier: cv_ml_ANN_MLP_load_String_filepath
/// Loads and creates a serialized ANN from a file
///
/// Use ANN::save to serialize and store an ANN to disk.
/// Load the ANN from this file again, by calling this function with the path to the file.
///
/// ## Parameters
/// * filepath: path to serialized ANN
pub fn load(filepath: &str) -> Result<types::PtrOfANN_MLP> {
string_arg!(filepath);
unsafe { sys::cv_core_cv_ml_ANN_MLP_load_String_filepath(filepath.as_ptr()) }.into_result().map(|x| types::PtrOfANN_MLP { ptr: x })
}
}
// Generating impl for trait cv::ml::ANN_MLP_ANNEAL (trait)
/// Artificial Neural Networks - Multi-Layer Perceptrons.
///
/// @sa @ref ml_intro_ann
pub trait ANN_MLP_ANNEAL : core::ANN_MLP {
#[doc(hidden)] fn as_raw_ANN_MLP_ANNEAL(&self) -> *mut c_void;
// identifier: cv_ml_ANN_MLP_ANNEAL_getAnnealInitialT_const
/// @see setAnnealInitialT
fn get_anneal_initial_t(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_ANNEAL_getAnnealInitialT_const(self.as_raw_ANN_MLP_ANNEAL()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_ANNEAL_setAnnealInitialT_double_val
/// @copybrief getAnnealInitialT @see getAnnealInitialT
fn set_anneal_initial_t(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_ANNEAL_setAnnealInitialT_double_val(self.as_raw_ANN_MLP_ANNEAL(), val) }.into_result()
}
// identifier: cv_ml_ANN_MLP_ANNEAL_getAnnealFinalT_const
/// @see setAnnealFinalT
fn get_anneal_final_t(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_ANNEAL_getAnnealFinalT_const(self.as_raw_ANN_MLP_ANNEAL()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_ANNEAL_setAnnealFinalT_double_val
/// @copybrief getAnnealFinalT @see getAnnealFinalT
fn set_anneal_final_t(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_ANNEAL_setAnnealFinalT_double_val(self.as_raw_ANN_MLP_ANNEAL(), val) }.into_result()
}
// identifier: cv_ml_ANN_MLP_ANNEAL_getAnnealCoolingRatio_const
/// @see setAnnealCoolingRatio
fn get_anneal_cooling_ratio(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_ANNEAL_getAnnealCoolingRatio_const(self.as_raw_ANN_MLP_ANNEAL()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_ANNEAL_setAnnealCoolingRatio_double_val
/// @copybrief getAnnealCoolingRatio @see getAnnealCoolingRatio
fn set_anneal_cooling_ratio(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_ANNEAL_setAnnealCoolingRatio_double_val(self.as_raw_ANN_MLP_ANNEAL(), val) }.into_result()
}
// identifier: cv_ml_ANN_MLP_ANNEAL_getAnnealItePerStep_const
/// @see setAnnealItePerStep
fn get_anneal_ite_per_step(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_ANNEAL_getAnnealItePerStep_const(self.as_raw_ANN_MLP_ANNEAL()) }.into_result()
}
// identifier: cv_ml_ANN_MLP_ANNEAL_setAnnealItePerStep_int_val
/// @copybrief getAnnealItePerStep @see getAnnealItePerStep
fn set_anneal_ite_per_step(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_ANN_MLP_ANNEAL_setAnnealItePerStep_int_val(self.as_raw_ANN_MLP_ANNEAL(), val) }.into_result()
}
}
impl<'a> ANN_MLP_ANNEAL + 'a {
}
// Generating impl for trait cv::ml::Boost (trait)
/// Boosted tree classifier derived from DTrees
///
/// @sa @ref ml_intro_boost
pub trait Boost : core::DTrees {
#[doc(hidden)] fn as_raw_Boost(&self) -> *mut c_void;
// identifier: cv_ml_Boost_getBoostType_const
/// @see setBoostType
fn get_boost_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_Boost_getBoostType_const(self.as_raw_Boost()) }.into_result()
}
// identifier: cv_ml_Boost_setBoostType_int_val
/// @copybrief getBoostType @see getBoostType
fn set_boost_type(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_Boost_setBoostType_int_val(self.as_raw_Boost(), val) }.into_result()
}
// identifier: cv_ml_Boost_getWeakCount_const
/// @see setWeakCount
fn get_weak_count(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_Boost_getWeakCount_const(self.as_raw_Boost()) }.into_result()
}
// identifier: cv_ml_Boost_setWeakCount_int_val
/// @copybrief getWeakCount @see getWeakCount
fn set_weak_count(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_Boost_setWeakCount_int_val(self.as_raw_Boost(), val) }.into_result()
}
// identifier: cv_ml_Boost_getWeightTrimRate_const
/// @see setWeightTrimRate
fn get_weight_trim_rate(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_Boost_getWeightTrimRate_const(self.as_raw_Boost()) }.into_result()
}
// identifier: cv_ml_Boost_setWeightTrimRate_double_val
/// @copybrief getWeightTrimRate @see getWeightTrimRate
fn set_weight_trim_rate(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_Boost_setWeightTrimRate_double_val(self.as_raw_Boost(), val) }.into_result()
}
}
impl<'a> Boost + 'a {
// identifier: cv_ml_Boost_create
/// Creates the empty model.
/// Use StatModel::train to train the model, Algorithm::load\<Boost\>(filename) to load the pre-trained model.
pub fn create() -> Result<types::PtrOfBoost> {
unsafe { sys::cv_core_cv_ml_Boost_create() }.into_result().map(|x| types::PtrOfBoost { ptr: x })
}
// identifier: cv_ml_Boost_load_String_filepath_String_nodeName
/// Loads and creates a serialized Boost from a file
///
/// Use Boost::save to serialize and store an RTree to disk.
/// Load the Boost from this file again, by calling this function with the path to the file.
/// Optionally specify the node for the file containing the classifier
///
/// ## Parameters
/// * filepath: path to serialized Boost
/// * nodeName: name of node containing the classifier
///
/// ## C++ default parameters:
/// * node_name: String()
pub fn load(filepath: &str, node_name: &str) -> Result<types::PtrOfBoost> {
string_arg!(filepath);
string_arg!(node_name);
unsafe { sys::cv_core_cv_ml_Boost_load_String_filepath_String_nodeName(filepath.as_ptr(), node_name.as_ptr()) }.into_result().map(|x| types::PtrOfBoost { ptr: x })
}
}
// Generating impl for trait cv::ml::DTrees (trait)
/// The class represents a single decision tree or a collection of decision trees.
///
/// The current public interface of the class allows user to train only a single decision tree, however
/// the class is capable of storing multiple decision trees and using them for prediction (by summing
/// responses or using a voting schemes), and the derived from DTrees classes (such as RTrees and Boost)
/// use this capability to implement decision tree ensembles.
///
/// @sa @ref ml_intro_trees
pub trait DTrees : core::StatModel {
#[doc(hidden)] fn as_raw_DTrees(&self) -> *mut c_void;
// identifier: cv_ml_DTrees_getMaxCategories_const
/// @see setMaxCategories
fn get_max_categories(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_DTrees_getMaxCategories_const(self.as_raw_DTrees()) }.into_result()
}
// identifier: cv_ml_DTrees_setMaxCategories_int_val
/// @copybrief getMaxCategories @see getMaxCategories
fn set_max_categories(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_DTrees_setMaxCategories_int_val(self.as_raw_DTrees(), val) }.into_result()
}
// identifier: cv_ml_DTrees_getMaxDepth_const
/// @see setMaxDepth
fn get_max_depth(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_DTrees_getMaxDepth_const(self.as_raw_DTrees()) }.into_result()
}
// identifier: cv_ml_DTrees_setMaxDepth_int_val
/// @copybrief getMaxDepth @see getMaxDepth
fn set_max_depth(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_DTrees_setMaxDepth_int_val(self.as_raw_DTrees(), val) }.into_result()
}
// identifier: cv_ml_DTrees_getMinSampleCount_const
/// @see setMinSampleCount
fn get_min_sample_count(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_DTrees_getMinSampleCount_const(self.as_raw_DTrees()) }.into_result()
}
// identifier: cv_ml_DTrees_setMinSampleCount_int_val
/// @copybrief getMinSampleCount @see getMinSampleCount
fn set_min_sample_count(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_DTrees_setMinSampleCount_int_val(self.as_raw_DTrees(), val) }.into_result()
}
// identifier: cv_ml_DTrees_getCVFolds_const
/// @see setCVFolds
fn get_cv_folds(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_DTrees_getCVFolds_const(self.as_raw_DTrees()) }.into_result()
}
// identifier: cv_ml_DTrees_setCVFolds_int_val
/// @copybrief getCVFolds @see getCVFolds
fn set_cv_folds(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_DTrees_setCVFolds_int_val(self.as_raw_DTrees(), val) }.into_result()
}
// identifier: cv_ml_DTrees_getUseSurrogates_const
/// @see setUseSurrogates
fn get_use_surrogates(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_ml_DTrees_getUseSurrogates_const(self.as_raw_DTrees()) }.into_result()
}
// identifier: cv_ml_DTrees_setUseSurrogates_bool_val
/// @copybrief getUseSurrogates @see getUseSurrogates
fn set_use_surrogates(&mut self, val: bool) -> Result<()> {
unsafe { sys::cv_core_cv_ml_DTrees_setUseSurrogates_bool_val(self.as_raw_DTrees(), val) }.into_result()
}
// identifier: cv_ml_DTrees_getUse1SERule_const
/// @see setUse1SERule
fn get_use1_se_rule(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_ml_DTrees_getUse1SERule_const(self.as_raw_DTrees()) }.into_result()
}
// identifier: cv_ml_DTrees_setUse1SERule_bool_val
/// @copybrief getUse1SERule @see getUse1SERule
fn set_use1_se_rule(&mut self, val: bool) -> Result<()> {
unsafe { sys::cv_core_cv_ml_DTrees_setUse1SERule_bool_val(self.as_raw_DTrees(), val) }.into_result()
}
// identifier: cv_ml_DTrees_getTruncatePrunedTree_const
/// @see setTruncatePrunedTree
fn get_truncate_pruned_tree(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_ml_DTrees_getTruncatePrunedTree_const(self.as_raw_DTrees()) }.into_result()
}
// identifier: cv_ml_DTrees_setTruncatePrunedTree_bool_val
/// @copybrief getTruncatePrunedTree @see getTruncatePrunedTree
fn set_truncate_pruned_tree(&mut self, val: bool) -> Result<()> {
unsafe { sys::cv_core_cv_ml_DTrees_setTruncatePrunedTree_bool_val(self.as_raw_DTrees(), val) }.into_result()
}
// identifier: cv_ml_DTrees_getRegressionAccuracy_const
/// @see setRegressionAccuracy
fn get_regression_accuracy(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_ml_DTrees_getRegressionAccuracy_const(self.as_raw_DTrees()) }.into_result()
}
// identifier: cv_ml_DTrees_setRegressionAccuracy_float_val
/// @copybrief getRegressionAccuracy @see getRegressionAccuracy
fn set_regression_accuracy(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_DTrees_setRegressionAccuracy_float_val(self.as_raw_DTrees(), val) }.into_result()
}
// identifier: cv_ml_DTrees_getPriors_const
/// @see setPriors
fn get_priors(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_DTrees_getPriors_const(self.as_raw_DTrees()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_DTrees_setPriors_Mat_val
/// @copybrief getPriors @see getPriors
fn set_priors(&mut self, val: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_ml_DTrees_setPriors_Mat_val(self.as_raw_DTrees(), val.as_raw_Mat()) }.into_result()
}
// identifier: cv_ml_DTrees_getRoots_const
/// Returns indices of root nodes
fn get_roots(&self) -> Result<types::VectorOfint> {
unsafe { sys::cv_core_cv_ml_DTrees_getRoots_const(self.as_raw_DTrees()) }.into_result().map(|x| types::VectorOfint { ptr: x })
}
// identifier: cv_ml_DTrees_getSplits_const
/// Returns all the splits
///
/// all the split indices are indices in the returned vector
fn get_splits(&self) -> Result<types::VectorOfSplit> {
unsafe { sys::cv_core_cv_ml_DTrees_getSplits_const(self.as_raw_DTrees()) }.into_result().map(|x| types::VectorOfSplit { ptr: x })
}
// identifier: cv_ml_DTrees_getSubsets_const
/// Returns all the bitsets for categorical splits
///
/// Split::subsetOfs is an offset in the returned vector
fn get_subsets(&self) -> Result<types::VectorOfint> {
unsafe { sys::cv_core_cv_ml_DTrees_getSubsets_const(self.as_raw_DTrees()) }.into_result().map(|x| types::VectorOfint { ptr: x })
}
}
impl<'a> DTrees + 'a {
// identifier: cv_ml_DTrees_create
/// Creates the empty model
///
/// The static method creates empty decision tree with the specified parameters. It should be then
/// trained using train method (see StatModel::train). Alternatively, you can load the model from
/// file using Algorithm::load\<DTrees\>(filename).
pub fn create() -> Result<types::PtrOfDTrees> {
unsafe { sys::cv_core_cv_ml_DTrees_create() }.into_result().map(|x| types::PtrOfDTrees { ptr: x })
}
// identifier: cv_ml_DTrees_load_String_filepath_String_nodeName
/// Loads and creates a serialized DTrees from a file
///
/// Use DTree::save to serialize and store an DTree to disk.
/// Load the DTree from this file again, by calling this function with the path to the file.
/// Optionally specify the node for the file containing the classifier
///
/// ## Parameters
/// * filepath: path to serialized DTree
/// * nodeName: name of node containing the classifier
///
/// ## C++ default parameters:
/// * node_name: String()
pub fn load(filepath: &str, node_name: &str) -> Result<types::PtrOfDTrees> {
string_arg!(filepath);
string_arg!(node_name);
unsafe { sys::cv_core_cv_ml_DTrees_load_String_filepath_String_nodeName(filepath.as_ptr(), node_name.as_ptr()) }.into_result().map(|x| types::PtrOfDTrees { ptr: x })
}
}
// boxed class cv::ml::DTrees::Node
/// The class represents a decision tree node.
#[allow(dead_code)]
pub struct DTrees_Node {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::DTrees_Node {
fn drop(&mut self) {
unsafe { sys::cv_delete_DTrees_Node(self.ptr) };
}
}
impl core::DTrees_Node {
#[doc(hidden)] pub fn as_raw_DTrees_Node(&self) -> *mut c_void { self.ptr }
}
// boxed class cv::ml::DTrees::Split
/// The class represents split in a decision tree.
#[allow(dead_code)]
pub struct DTrees_Split {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::DTrees_Split {
fn drop(&mut self) {
unsafe { sys::cv_delete_DTrees_Split(self.ptr) };
}
}
impl core::DTrees_Split {
#[doc(hidden)] pub fn as_raw_DTrees_Split(&self) -> *mut c_void { self.ptr }
}
impl DTrees_Split {
// identifier: cv_ml_DTrees_Split_Split
pub fn new() -> Result<core::DTrees_Split> {
unsafe { sys::cv_core_cv_ml_DTrees_Split_Split() }.into_result().map(|x| core::DTrees_Split { ptr: x })
}
}
// Generating impl for trait cv::ml::EM (trait)
/// The class implements the Expectation Maximization algorithm.
///
/// @sa @ref ml_intro_em
pub trait EM : core::StatModel {
#[doc(hidden)] fn as_raw_EM(&self) -> *mut c_void;
// identifier: cv_ml_EM_getClustersNumber_const
/// @see setClustersNumber
fn get_clusters_number(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_EM_getClustersNumber_const(self.as_raw_EM()) }.into_result()
}
// identifier: cv_ml_EM_setClustersNumber_int_val
/// @copybrief getClustersNumber @see getClustersNumber
fn set_clusters_number(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_EM_setClustersNumber_int_val(self.as_raw_EM(), val) }.into_result()
}
// identifier: cv_ml_EM_getCovarianceMatrixType_const
/// @see setCovarianceMatrixType
fn get_covariance_matrix_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_EM_getCovarianceMatrixType_const(self.as_raw_EM()) }.into_result()
}
// identifier: cv_ml_EM_setCovarianceMatrixType_int_val
/// @copybrief getCovarianceMatrixType @see getCovarianceMatrixType
fn set_covariance_matrix_type(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_EM_setCovarianceMatrixType_int_val(self.as_raw_EM(), val) }.into_result()
}
// identifier: cv_ml_EM_getTermCriteria_const
/// @see setTermCriteria
fn get_term_criteria(&self) -> Result<core::TermCriteria> {
unsafe { sys::cv_core_cv_ml_EM_getTermCriteria_const(self.as_raw_EM()) }.into_result().map(|x| core::TermCriteria { ptr: x })
}
// identifier: cv_ml_EM_setTermCriteria_TermCriteria_val
/// @copybrief getTermCriteria @see getTermCriteria
fn set_term_criteria(&mut self, val: &core::TermCriteria) -> Result<()> {
unsafe { sys::cv_core_cv_ml_EM_setTermCriteria_TermCriteria_val(self.as_raw_EM(), val.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_ml_EM_getWeights_const
/// Returns weights of the mixtures
///
/// Returns vector with the number of elements equal to the number of mixtures.
fn get_weights(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_EM_getWeights_const(self.as_raw_EM()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_EM_getMeans_const
/// Returns the cluster centers (means of the Gaussian mixture)
///
/// Returns matrix with the number of rows equal to the number of mixtures and number of columns
/// equal to the space dimensionality.
fn get_means(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_EM_getMeans_const(self.as_raw_EM()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_EM_getCovs_const_VectorOfMat_covs
/// Returns covariation matrices
///
/// Returns vector of covariation matrices. Number of matrices is the number of gaussian mixtures,
/// each matrix is a square floating-point matrix NxN, where N is the space dimensionality.
fn get_covs(&self, covs: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_ml_EM_getCovs_const_VectorOfMat_covs(self.as_raw_EM(), covs.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_ml_EM_predict_const_Mat_samples_Mat_results_int_flags
/// Returns posterior probabilities for the provided samples
///
/// ## Parameters
/// * samples: The input samples, floating-point matrix
/// * results: The optional output <span lang='latex'> nSamples \times nClusters</span> matrix of results. It contains
/// posterior probabilities for each sample from the input
/// * flags: This parameter will be ignored
///
/// ## C++ default parameters:
/// * results: noArray()
/// * flags: 0
fn predict(&self, samples: &core::Mat, results: &mut core::Mat, flags: i32) -> Result<f32> {
unsafe { sys::cv_core_cv_ml_EM_predict_const_Mat_samples_Mat_results_int_flags(self.as_raw_EM(), samples.as_raw_Mat(), results.as_raw_Mat(), flags) }.into_result()
}
// identifier: cv_ml_EM_predict2_const_Mat_sample_Mat_probs
/// Returns a likelihood logarithm value and an index of the most probable mixture component
/// for the given sample.
///
/// ## Parameters
/// * sample: A sample for classification. It should be a one-channel matrix of
/// <span lang='latex'>1 \times dims</span> or <span lang='latex'>dims \times 1</span> size.
/// * probs: Optional output matrix that contains posterior probabilities of each component
/// given the sample. It has <span lang='latex'>1 \times nclusters</span> size and CV_64FC1 type.
///
/// The method returns a two-element double vector. Zero element is a likelihood logarithm value for
/// the sample. First element is an index of the most probable mixture component for the given
/// sample.
fn predict2(&self, sample: &core::Mat, probs: &mut core::Mat) -> Result<core::Vec2d> {
unsafe { sys::cv_core_cv_ml_EM_predict2_const_Mat_sample_Mat_probs(self.as_raw_EM(), sample.as_raw_Mat(), probs.as_raw_Mat()) }.into_result()
}
// identifier: cv_ml_EM_trainEM_Mat_samples_Mat_logLikelihoods_Mat_labels_Mat_probs
/// Estimate the Gaussian mixture parameters from a samples set.
///
/// This variation starts with Expectation step. Initial values of the model parameters will be
/// estimated by the k-means algorithm.
///
/// Unlike many of the ML models, %EM is an unsupervised learning algorithm and it does not take
/// responses (class labels or function values) as input. Instead, it computes the *Maximum
/// Likelihood Estimate* of the Gaussian mixture parameters from an input sample set, stores all the
/// parameters inside the structure: <span lang='latex'>p_{i,k}</span> in probs, <span lang='latex'>a_k</span> in means , <span lang='latex'>S_k</span> in
/// covs[k], <span lang='latex'>\pi_k</span> in weights , and optionally computes the output "class label" for each
/// sample: <span lang='latex'>\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N</span> (indices of the most
/// probable mixture component for each sample).
///
/// The trained model can be used further for prediction, just like any other classifier. The
/// trained model is similar to the NormalBayesClassifier.
///
/// ## Parameters
/// * samples: Samples from which the Gaussian mixture model will be estimated. It should be a
/// one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type
/// it will be converted to the inner matrix of such type for the further computing.
/// * logLikelihoods: The optional output matrix that contains a likelihood logarithm value for
/// each sample. It has <span lang='latex'>nsamples \times 1</span> size and CV_64FC1 type.
/// * labels: The optional output "class label" for each sample:
/// <span lang='latex'>\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N</span> (indices of the most probable
/// mixture component for each sample). It has <span lang='latex'>nsamples \times 1</span> size and CV_32SC1 type.
/// * probs: The optional output matrix that contains posterior probabilities of each Gaussian
/// mixture component given the each sample. It has <span lang='latex'>nsamples \times nclusters</span> size and
/// CV_64FC1 type.
///
/// ## C++ default parameters:
/// * log_likelihoods: noArray()
/// * labels: noArray()
/// * probs: noArray()
fn train_em(&mut self, samples: &core::Mat, log_likelihoods: &mut core::Mat, labels: &mut core::Mat, probs: &mut core::Mat) -> Result<bool> {
unsafe { sys::cv_core_cv_ml_EM_trainEM_Mat_samples_Mat_logLikelihoods_Mat_labels_Mat_probs(self.as_raw_EM(), samples.as_raw_Mat(), log_likelihoods.as_raw_Mat(), labels.as_raw_Mat(), probs.as_raw_Mat()) }.into_result()
}
// identifier: cv_ml_EM_trainE_Mat_samples_Mat_means0_Mat_covs0_Mat_weights0_Mat_logLikelihoods_Mat_labels_Mat_probs
/// Estimate the Gaussian mixture parameters from a samples set.
///
/// This variation starts with Expectation step. You need to provide initial means <span lang='latex'>a_k</span> of
/// mixture components. Optionally you can pass initial weights <span lang='latex'>\pi_k</span> and covariance matrices
/// <span lang='latex'>S_k</span> of mixture components.
///
/// ## Parameters
/// * samples: Samples from which the Gaussian mixture model will be estimated. It should be a
/// one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type
/// it will be converted to the inner matrix of such type for the further computing.
/// * means0: Initial means <span lang='latex'>a_k</span> of mixture components. It is a one-channel matrix of
/// <span lang='latex'>nclusters \times dims</span> size. If the matrix does not have CV_64F type it will be
/// converted to the inner matrix of such type for the further computing.
/// * covs0: The vector of initial covariance matrices <span lang='latex'>S_k</span> of mixture components. Each of
/// covariance matrices is a one-channel matrix of <span lang='latex'>dims \times dims</span> size. If the matrices
/// do not have CV_64F type they will be converted to the inner matrices of such type for the
/// further computing.
/// * weights0: Initial weights <span lang='latex'>\pi_k</span> of mixture components. It should be a one-channel
/// floating-point matrix with <span lang='latex'>1 \times nclusters</span> or <span lang='latex'>nclusters \times 1</span> size.
/// * logLikelihoods: The optional output matrix that contains a likelihood logarithm value for
/// each sample. It has <span lang='latex'>nsamples \times 1</span> size and CV_64FC1 type.
/// * labels: The optional output "class label" for each sample:
/// <span lang='latex'>\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N</span> (indices of the most probable
/// mixture component for each sample). It has <span lang='latex'>nsamples \times 1</span> size and CV_32SC1 type.
/// * probs: The optional output matrix that contains posterior probabilities of each Gaussian
/// mixture component given the each sample. It has <span lang='latex'>nsamples \times nclusters</span> size and
/// CV_64FC1 type.
///
/// ## C++ default parameters:
/// * covs0: noArray()
/// * weights0: noArray()
/// * log_likelihoods: noArray()
/// * labels: noArray()
/// * probs: noArray()
fn train_e(&mut self, samples: &core::Mat, means0: &core::Mat, covs0: &core::Mat, weights0: &core::Mat, log_likelihoods: &mut core::Mat, labels: &mut core::Mat, probs: &mut core::Mat) -> Result<bool> {
unsafe { sys::cv_core_cv_ml_EM_trainE_Mat_samples_Mat_means0_Mat_covs0_Mat_weights0_Mat_logLikelihoods_Mat_labels_Mat_probs(self.as_raw_EM(), samples.as_raw_Mat(), means0.as_raw_Mat(), covs0.as_raw_Mat(), weights0.as_raw_Mat(), log_likelihoods.as_raw_Mat(), labels.as_raw_Mat(), probs.as_raw_Mat()) }.into_result()
}
// identifier: cv_ml_EM_trainM_Mat_samples_Mat_probs0_Mat_logLikelihoods_Mat_labels_Mat_probs
/// Estimate the Gaussian mixture parameters from a samples set.
///
/// This variation starts with Maximization step. You need to provide initial probabilities
/// <span lang='latex'>p_{i,k}</span> to use this option.
///
/// ## Parameters
/// * samples: Samples from which the Gaussian mixture model will be estimated. It should be a
/// one-channel matrix, each row of which is a sample. If the matrix does not have CV_64F type
/// it will be converted to the inner matrix of such type for the further computing.
/// * probs0
/// @param: logLikelihoods The optional output matrix that contains a likelihood logarithm value for
/// each sample. It has <span lang='latex'>nsamples \times 1</span> size and CV_64FC1 type.
/// * labels: The optional output "class label" for each sample:
/// <span lang='latex'>\texttt{labels}_i=\texttt{arg max}_k(p_{i,k}), i=1..N</span> (indices of the most probable
/// mixture component for each sample). It has <span lang='latex'>nsamples \times 1</span> size and CV_32SC1 type.
/// * probs: The optional output matrix that contains posterior probabilities of each Gaussian
/// mixture component given the each sample. It has <span lang='latex'>nsamples \times nclusters</span> size and
/// CV_64FC1 type.
///
/// ## C++ default parameters:
/// * log_likelihoods: noArray()
/// * labels: noArray()
/// * probs: noArray()
fn train_m(&mut self, samples: &core::Mat, probs0: &core::Mat, log_likelihoods: &mut core::Mat, labels: &mut core::Mat, probs: &mut core::Mat) -> Result<bool> {
unsafe { sys::cv_core_cv_ml_EM_trainM_Mat_samples_Mat_probs0_Mat_logLikelihoods_Mat_labels_Mat_probs(self.as_raw_EM(), samples.as_raw_Mat(), probs0.as_raw_Mat(), log_likelihoods.as_raw_Mat(), labels.as_raw_Mat(), probs.as_raw_Mat()) }.into_result()
}
}
impl<'a> EM + 'a {
// identifier: cv_ml_EM_create
/// Creates empty %EM model.
/// The model should be trained then using StatModel::train(traindata, flags) method. Alternatively, you
/// can use one of the EM::train\* methods or load it from file using Algorithm::load\<EM\>(filename).
pub fn create() -> Result<types::PtrOfEM> {
unsafe { sys::cv_core_cv_ml_EM_create() }.into_result().map(|x| types::PtrOfEM { ptr: x })
}
// identifier: cv_ml_EM_load_String_filepath_String_nodeName
/// Loads and creates a serialized EM from a file
///
/// Use EM::save to serialize and store an EM to disk.
/// Load the EM from this file again, by calling this function with the path to the file.
/// Optionally specify the node for the file containing the classifier
///
/// ## Parameters
/// * filepath: path to serialized EM
/// * nodeName: name of node containing the classifier
///
/// ## C++ default parameters:
/// * node_name: String()
pub fn load(filepath: &str, node_name: &str) -> Result<types::PtrOfEM> {
string_arg!(filepath);
string_arg!(node_name);
unsafe { sys::cv_core_cv_ml_EM_load_String_filepath_String_nodeName(filepath.as_ptr(), node_name.as_ptr()) }.into_result().map(|x| types::PtrOfEM { ptr: x })
}
}
// Generating impl for trait cv::ml::KNearest (trait)
/// The class implements K-Nearest Neighbors model
///
/// @sa @ref ml_intro_knn
pub trait KNearest : core::StatModel {
#[doc(hidden)] fn as_raw_KNearest(&self) -> *mut c_void;
// identifier: cv_ml_KNearest_getDefaultK_const
/// @see setDefaultK
fn get_default_k(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_KNearest_getDefaultK_const(self.as_raw_KNearest()) }.into_result()
}
// identifier: cv_ml_KNearest_setDefaultK_int_val
/// @copybrief getDefaultK @see getDefaultK
fn set_default_k(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_KNearest_setDefaultK_int_val(self.as_raw_KNearest(), val) }.into_result()
}
// identifier: cv_ml_KNearest_getIsClassifier_const
/// @see setIsClassifier
fn get_is_classifier(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_ml_KNearest_getIsClassifier_const(self.as_raw_KNearest()) }.into_result()
}
// identifier: cv_ml_KNearest_setIsClassifier_bool_val
/// @copybrief getIsClassifier @see getIsClassifier
fn set_is_classifier(&mut self, val: bool) -> Result<()> {
unsafe { sys::cv_core_cv_ml_KNearest_setIsClassifier_bool_val(self.as_raw_KNearest(), val) }.into_result()
}
// identifier: cv_ml_KNearest_getEmax_const
/// @see setEmax
fn get_emax(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_KNearest_getEmax_const(self.as_raw_KNearest()) }.into_result()
}
// identifier: cv_ml_KNearest_setEmax_int_val
/// @copybrief getEmax @see getEmax
fn set_emax(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_KNearest_setEmax_int_val(self.as_raw_KNearest(), val) }.into_result()
}
// identifier: cv_ml_KNearest_getAlgorithmType_const
/// @see setAlgorithmType
fn get_algorithm_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_KNearest_getAlgorithmType_const(self.as_raw_KNearest()) }.into_result()
}
// identifier: cv_ml_KNearest_setAlgorithmType_int_val
/// @copybrief getAlgorithmType @see getAlgorithmType
fn set_algorithm_type(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_KNearest_setAlgorithmType_int_val(self.as_raw_KNearest(), val) }.into_result()
}
// identifier: cv_ml_KNearest_findNearest_const_Mat_samples_int_k_Mat_results_Mat_neighborResponses_Mat_dist
/// Finds the neighbors and predicts responses for input vectors.
///
/// ## Parameters
/// * samples: Input samples stored by rows. It is a single-precision floating-point matrix of
/// `<number_of_samples> * k` size.
/// * k: Number of used nearest neighbors. Should be greater than 1.
/// * results: Vector with results of prediction (regression or classification) for each input
/// sample. It is a single-precision floating-point vector with `<number_of_samples>` elements.
/// * neighborResponses: Optional output values for corresponding neighbors. It is a single-
/// precision floating-point matrix of `<number_of_samples> * k` size.
/// * dist: Optional output distances from the input vectors to the corresponding neighbors. It
/// is a single-precision floating-point matrix of `<number_of_samples> * k` size.
///
/// For each input vector (a row of the matrix samples), the method finds the k nearest neighbors.
/// In case of regression, the predicted result is a mean value of the particular vector's neighbor
/// responses. In case of classification, the class is determined by voting.
///
/// For each input vector, the neighbors are sorted by their distances to the vector.
///
/// In case of C++ interface you can use output pointers to empty matrices and the function will
/// allocate memory itself.
///
/// If only a single input vector is passed, all output matrices are optional and the predicted
/// value is returned by the method.
///
/// The function is parallelized with the TBB library.
///
/// ## C++ default parameters:
/// * neighbor_responses: noArray()
/// * dist: noArray()
fn find_nearest(&self, samples: &core::Mat, k: i32, results: &mut core::Mat, neighbor_responses: &mut core::Mat, dist: &mut core::Mat) -> Result<f32> {
unsafe { sys::cv_core_cv_ml_KNearest_findNearest_const_Mat_samples_int_k_Mat_results_Mat_neighborResponses_Mat_dist(self.as_raw_KNearest(), samples.as_raw_Mat(), k, results.as_raw_Mat(), neighbor_responses.as_raw_Mat(), dist.as_raw_Mat()) }.into_result()
}
}
impl<'a> KNearest + 'a {
// identifier: cv_ml_KNearest_create
/// Creates the empty model
///
/// The static method creates empty %KNearest classifier. It should be then trained using StatModel::train method.
pub fn create() -> Result<types::PtrOfKNearest> {
unsafe { sys::cv_core_cv_ml_KNearest_create() }.into_result().map(|x| types::PtrOfKNearest { ptr: x })
}
}
// Generating impl for trait cv::ml::LogisticRegression (trait)
/// Implements Logistic Regression classifier.
///
/// @sa @ref ml_intro_lr
pub trait LogisticRegression : core::StatModel {
#[doc(hidden)] fn as_raw_LogisticRegression(&self) -> *mut c_void;
// identifier: cv_ml_LogisticRegression_getLearningRate_const
/// @see setLearningRate
fn get_learning_rate(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_LogisticRegression_getLearningRate_const(self.as_raw_LogisticRegression()) }.into_result()
}
// identifier: cv_ml_LogisticRegression_setLearningRate_double_val
/// @copybrief getLearningRate @see getLearningRate
fn set_learning_rate(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_LogisticRegression_setLearningRate_double_val(self.as_raw_LogisticRegression(), val) }.into_result()
}
// identifier: cv_ml_LogisticRegression_getIterations_const
/// @see setIterations
fn get_iterations(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_LogisticRegression_getIterations_const(self.as_raw_LogisticRegression()) }.into_result()
}
// identifier: cv_ml_LogisticRegression_setIterations_int_val
/// @copybrief getIterations @see getIterations
fn set_iterations(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_LogisticRegression_setIterations_int_val(self.as_raw_LogisticRegression(), val) }.into_result()
}
// identifier: cv_ml_LogisticRegression_getRegularization_const
/// @see setRegularization
fn get_regularization(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_LogisticRegression_getRegularization_const(self.as_raw_LogisticRegression()) }.into_result()
}
// identifier: cv_ml_LogisticRegression_setRegularization_int_val
/// @copybrief getRegularization @see getRegularization
fn set_regularization(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_LogisticRegression_setRegularization_int_val(self.as_raw_LogisticRegression(), val) }.into_result()
}
// identifier: cv_ml_LogisticRegression_getTrainMethod_const
/// @see setTrainMethod
fn get_train_method(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_LogisticRegression_getTrainMethod_const(self.as_raw_LogisticRegression()) }.into_result()
}
// identifier: cv_ml_LogisticRegression_setTrainMethod_int_val
/// @copybrief getTrainMethod @see getTrainMethod
fn set_train_method(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_LogisticRegression_setTrainMethod_int_val(self.as_raw_LogisticRegression(), val) }.into_result()
}
// identifier: cv_ml_LogisticRegression_getMiniBatchSize_const
/// @see setMiniBatchSize
fn get_mini_batch_size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_LogisticRegression_getMiniBatchSize_const(self.as_raw_LogisticRegression()) }.into_result()
}
// identifier: cv_ml_LogisticRegression_setMiniBatchSize_int_val
/// @copybrief getMiniBatchSize @see getMiniBatchSize
fn set_mini_batch_size(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_LogisticRegression_setMiniBatchSize_int_val(self.as_raw_LogisticRegression(), val) }.into_result()
}
// identifier: cv_ml_LogisticRegression_getTermCriteria_const
/// @see setTermCriteria
fn get_term_criteria(&self) -> Result<core::TermCriteria> {
unsafe { sys::cv_core_cv_ml_LogisticRegression_getTermCriteria_const(self.as_raw_LogisticRegression()) }.into_result().map(|x| core::TermCriteria { ptr: x })
}
// identifier: cv_ml_LogisticRegression_setTermCriteria_TermCriteria_val
/// @copybrief getTermCriteria @see getTermCriteria
fn set_term_criteria(&mut self, val: &core::TermCriteria) -> Result<()> {
unsafe { sys::cv_core_cv_ml_LogisticRegression_setTermCriteria_TermCriteria_val(self.as_raw_LogisticRegression(), val.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_ml_LogisticRegression_predict_const_Mat_samples_Mat_results_int_flags
/// Predicts responses for input samples and returns a float type.
///
/// ## Parameters
/// * samples: The input data for the prediction algorithm. Matrix [m x n], where each row
/// contains variables (features) of one object being classified. Should have data type CV_32F.
/// * results: Predicted labels as a column matrix of type CV_32S.
/// * flags: Not used.
///
/// ## C++ default parameters:
/// * results: noArray()
/// * flags: 0
fn predict(&self, samples: &core::Mat, results: &mut core::Mat, flags: i32) -> Result<f32> {
unsafe { sys::cv_core_cv_ml_LogisticRegression_predict_const_Mat_samples_Mat_results_int_flags(self.as_raw_LogisticRegression(), samples.as_raw_Mat(), results.as_raw_Mat(), flags) }.into_result()
}
// identifier: cv_ml_LogisticRegression_get_learnt_thetas_const
/// This function returns the trained parameters arranged across rows.
///
/// For a two class classifcation problem, it returns a row matrix. It returns learnt parameters of
/// the Logistic Regression as a matrix of type CV_32F.
fn get_learnt_thetas(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_LogisticRegression_get_learnt_thetas_const(self.as_raw_LogisticRegression()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
impl<'a> LogisticRegression + 'a {
// identifier: cv_ml_LogisticRegression_create
/// Creates empty model.
///
/// Creates Logistic Regression model with parameters given.
pub fn create() -> Result<types::PtrOfLogisticRegression> {
unsafe { sys::cv_core_cv_ml_LogisticRegression_create() }.into_result().map(|x| types::PtrOfLogisticRegression { ptr: x })
}
// identifier: cv_ml_LogisticRegression_load_String_filepath_String_nodeName
/// Loads and creates a serialized LogisticRegression from a file
///
/// Use LogisticRegression::save to serialize and store an LogisticRegression to disk.
/// Load the LogisticRegression from this file again, by calling this function with the path to the file.
/// Optionally specify the node for the file containing the classifier
///
/// ## Parameters
/// * filepath: path to serialized LogisticRegression
/// * nodeName: name of node containing the classifier
///
/// ## C++ default parameters:
/// * node_name: String()
pub fn load(filepath: &str, node_name: &str) -> Result<types::PtrOfLogisticRegression> {
string_arg!(filepath);
string_arg!(node_name);
unsafe { sys::cv_core_cv_ml_LogisticRegression_load_String_filepath_String_nodeName(filepath.as_ptr(), node_name.as_ptr()) }.into_result().map(|x| types::PtrOfLogisticRegression { ptr: x })
}
}
// Generating impl for trait cv::ml::NormalBayesClassifier (trait)
/// Bayes classifier for normally distributed data.
///
/// @sa @ref ml_intro_bayes
pub trait NormalBayesClassifier : core::StatModel {
#[doc(hidden)] fn as_raw_NormalBayesClassifier(&self) -> *mut c_void;
// identifier: cv_ml_NormalBayesClassifier_predictProb_const_Mat_inputs_Mat_outputs_Mat_outputProbs_int_flags
/// Predicts the response for sample(s).
///
/// The method estimates the most probable classes for input vectors. Input vectors (one or more)
/// are stored as rows of the matrix inputs. In case of multiple input vectors, there should be one
/// output vector outputs. The predicted class for a single input vector is returned by the method.
/// The vector outputProbs contains the output probabilities corresponding to each element of
/// result.
///
/// ## C++ default parameters:
/// * flags: 0
fn predict_prob(&self, inputs: &core::Mat, outputs: &mut core::Mat, output_probs: &mut core::Mat, flags: i32) -> Result<f32> {
unsafe { sys::cv_core_cv_ml_NormalBayesClassifier_predictProb_const_Mat_inputs_Mat_outputs_Mat_outputProbs_int_flags(self.as_raw_NormalBayesClassifier(), inputs.as_raw_Mat(), outputs.as_raw_Mat(), output_probs.as_raw_Mat(), flags) }.into_result()
}
}
impl<'a> NormalBayesClassifier + 'a {
// identifier: cv_ml_NormalBayesClassifier_create
/// Creates empty model
/// Use StatModel::train to train the model after creation.
pub fn create() -> Result<types::PtrOfNormalBayesClassifier> {
unsafe { sys::cv_core_cv_ml_NormalBayesClassifier_create() }.into_result().map(|x| types::PtrOfNormalBayesClassifier { ptr: x })
}
// identifier: cv_ml_NormalBayesClassifier_load_String_filepath_String_nodeName
/// Loads and creates a serialized NormalBayesClassifier from a file
///
/// Use NormalBayesClassifier::save to serialize and store an NormalBayesClassifier to disk.
/// Load the NormalBayesClassifier from this file again, by calling this function with the path to the file.
/// Optionally specify the node for the file containing the classifier
///
/// ## Parameters
/// * filepath: path to serialized NormalBayesClassifier
/// * nodeName: name of node containing the classifier
///
/// ## C++ default parameters:
/// * node_name: String()
pub fn load(filepath: &str, node_name: &str) -> Result<types::PtrOfNormalBayesClassifier> {
string_arg!(filepath);
string_arg!(node_name);
unsafe { sys::cv_core_cv_ml_NormalBayesClassifier_load_String_filepath_String_nodeName(filepath.as_ptr(), node_name.as_ptr()) }.into_result().map(|x| types::PtrOfNormalBayesClassifier { ptr: x })
}
}
// boxed class cv::ml::ParamGrid
/// The structure represents the logarithmic grid range of statmodel parameters.
///
/// It is used for optimizing statmodel accuracy by varying model parameters, the accuracy estimate
/// being computed by cross-validation.
#[allow(dead_code)]
pub struct ParamGrid {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ParamGrid {
fn drop(&mut self) {
unsafe { sys::cv_delete_ParamGrid(self.ptr) };
}
}
impl core::ParamGrid {
#[doc(hidden)] pub fn as_raw_ParamGrid(&self) -> *mut c_void { self.ptr }
}
impl ParamGrid {
// identifier: cv_ml_ParamGrid_ParamGrid
/// Default constructor
pub fn new() -> Result<core::ParamGrid> {
unsafe { sys::cv_core_cv_ml_ParamGrid_ParamGrid() }.into_result().map(|x| core::ParamGrid { ptr: x })
}
// identifier: cv_ml_ParamGrid_ParamGrid_double__minVal_double__maxVal_double__logStep
/// Constructor with parameters
pub fn for_range(_min_val: f64, _max_val: f64, _log_step: f64) -> Result<core::ParamGrid> {
unsafe { sys::cv_core_cv_ml_ParamGrid_ParamGrid_double__minVal_double__maxVal_double__logStep(_min_val, _max_val, _log_step) }.into_result().map(|x| core::ParamGrid { ptr: x })
}
// identifier: cv_ml_ParamGrid_create_double_minVal_double_maxVal_double_logstep
/// Creates a ParamGrid Ptr that can be given to the %SVM::trainAuto method
///
/// ## Parameters
/// * minVal: minimum value of the parameter grid
/// * maxVal: maximum value of the parameter grid
/// * logstep: Logarithmic step for iterating the statmodel parameter
///
/// ## C++ default parameters:
/// * min_val: 0.
/// * max_val: 0.
/// * logstep: 1.
pub fn create(min_val: f64, max_val: f64, logstep: f64) -> Result<types::PtrOfParamGrid> {
unsafe { sys::cv_core_cv_ml_ParamGrid_create_double_minVal_double_maxVal_double_logstep(min_val, max_val, logstep) }.into_result().map(|x| types::PtrOfParamGrid { ptr: x })
}
}
// Generating impl for trait cv::ml::RTrees (trait)
/// The class implements the random forest predictor.
///
/// @sa @ref ml_intro_rtrees
pub trait RTrees : core::DTrees {
#[doc(hidden)] fn as_raw_RTrees(&self) -> *mut c_void;
// identifier: cv_ml_RTrees_getCalculateVarImportance_const
/// @see setCalculateVarImportance
fn get_calculate_var_importance(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_ml_RTrees_getCalculateVarImportance_const(self.as_raw_RTrees()) }.into_result()
}
// identifier: cv_ml_RTrees_setCalculateVarImportance_bool_val
/// @copybrief getCalculateVarImportance @see getCalculateVarImportance
fn set_calculate_var_importance(&mut self, val: bool) -> Result<()> {
unsafe { sys::cv_core_cv_ml_RTrees_setCalculateVarImportance_bool_val(self.as_raw_RTrees(), val) }.into_result()
}
// identifier: cv_ml_RTrees_getActiveVarCount_const
/// @see setActiveVarCount
fn get_active_var_count(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_RTrees_getActiveVarCount_const(self.as_raw_RTrees()) }.into_result()
}
// identifier: cv_ml_RTrees_setActiveVarCount_int_val
/// @copybrief getActiveVarCount @see getActiveVarCount
fn set_active_var_count(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_RTrees_setActiveVarCount_int_val(self.as_raw_RTrees(), val) }.into_result()
}
// identifier: cv_ml_RTrees_getTermCriteria_const
/// @see setTermCriteria
fn get_term_criteria(&self) -> Result<core::TermCriteria> {
unsafe { sys::cv_core_cv_ml_RTrees_getTermCriteria_const(self.as_raw_RTrees()) }.into_result().map(|x| core::TermCriteria { ptr: x })
}
// identifier: cv_ml_RTrees_setTermCriteria_TermCriteria_val
/// @copybrief getTermCriteria @see getTermCriteria
fn set_term_criteria(&mut self, val: &core::TermCriteria) -> Result<()> {
unsafe { sys::cv_core_cv_ml_RTrees_setTermCriteria_TermCriteria_val(self.as_raw_RTrees(), val.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_ml_RTrees_getVarImportance_const
/// Returns the variable importance array.
/// The method returns the variable importance vector, computed at the training stage when
/// CalculateVarImportance is set to true. If this flag was set to false, the empty matrix is
/// returned.
fn get_var_importance(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_RTrees_getVarImportance_const(self.as_raw_RTrees()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_RTrees_getVotes_const_Mat_samples_Mat_results_int_flags
/// Returns the result of each individual tree in the forest.
/// In case the model is a regression problem, the method will return each of the trees'
/// results for each of the sample cases. If the model is a classifier, it will return
/// a Mat with samples + 1 rows, where the first row gives the class number and the
/// following rows return the votes each class had for each sample.
/// ## Parameters
/// * samples: Array containing the samples for which votes will be calculated.
/// * results: Array where the result of the calculation will be written.
/// * flags: Flags for defining the type of RTrees.
fn get_votes(&self, samples: &core::Mat, results: &mut core::Mat, flags: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_RTrees_getVotes_const_Mat_samples_Mat_results_int_flags(self.as_raw_RTrees(), samples.as_raw_Mat(), results.as_raw_Mat(), flags) }.into_result()
}
}
impl<'a> RTrees + 'a {
// identifier: cv_ml_RTrees_create
/// Creates the empty model.
/// Use StatModel::train to train the model, StatModel::train to create and train the model,
/// Algorithm::load to load the pre-trained model.
pub fn create() -> Result<types::PtrOfRTrees> {
unsafe { sys::cv_core_cv_ml_RTrees_create() }.into_result().map(|x| types::PtrOfRTrees { ptr: x })
}
// identifier: cv_ml_RTrees_load_String_filepath_String_nodeName
/// Loads and creates a serialized RTree from a file
///
/// Use RTree::save to serialize and store an RTree to disk.
/// Load the RTree from this file again, by calling this function with the path to the file.
/// Optionally specify the node for the file containing the classifier
///
/// ## Parameters
/// * filepath: path to serialized RTree
/// * nodeName: name of node containing the classifier
///
/// ## C++ default parameters:
/// * node_name: String()
pub fn load(filepath: &str, node_name: &str) -> Result<types::PtrOfRTrees> {
string_arg!(filepath);
string_arg!(node_name);
unsafe { sys::cv_core_cv_ml_RTrees_load_String_filepath_String_nodeName(filepath.as_ptr(), node_name.as_ptr()) }.into_result().map(|x| types::PtrOfRTrees { ptr: x })
}
}
// Generating impl for trait cv::ml::SVM (trait)
/// Support Vector Machines.
///
/// @sa @ref ml_intro_svm
pub trait SVM : core::StatModel {
#[doc(hidden)] fn as_raw_SVM(&self) -> *mut c_void;
// identifier: cv_ml_SVM_getType_const
/// @see setType
fn get_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_SVM_getType_const(self.as_raw_SVM()) }.into_result()
}
// identifier: cv_ml_SVM_setType_int_val
/// @copybrief getType @see getType
fn set_type(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVM_setType_int_val(self.as_raw_SVM(), val) }.into_result()
}
// identifier: cv_ml_SVM_getGamma_const
/// @see setGamma
fn get_gamma(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_SVM_getGamma_const(self.as_raw_SVM()) }.into_result()
}
// identifier: cv_ml_SVM_setGamma_double_val
/// @copybrief getGamma @see getGamma
fn set_gamma(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVM_setGamma_double_val(self.as_raw_SVM(), val) }.into_result()
}
// identifier: cv_ml_SVM_getCoef0_const
/// @see setCoef0
fn get_coef0(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_SVM_getCoef0_const(self.as_raw_SVM()) }.into_result()
}
// identifier: cv_ml_SVM_setCoef0_double_val
/// @copybrief getCoef0 @see getCoef0
fn set_coef0(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVM_setCoef0_double_val(self.as_raw_SVM(), val) }.into_result()
}
// identifier: cv_ml_SVM_getDegree_const
/// @see setDegree
fn get_degree(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_SVM_getDegree_const(self.as_raw_SVM()) }.into_result()
}
// identifier: cv_ml_SVM_setDegree_double_val
/// @copybrief getDegree @see getDegree
fn set_degree(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVM_setDegree_double_val(self.as_raw_SVM(), val) }.into_result()
}
// identifier: cv_ml_SVM_getC_const
/// @see setC
fn get_c(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_SVM_getC_const(self.as_raw_SVM()) }.into_result()
}
// identifier: cv_ml_SVM_setC_double_val
/// @copybrief getC @see getC
fn set_c(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVM_setC_double_val(self.as_raw_SVM(), val) }.into_result()
}
// identifier: cv_ml_SVM_getNu_const
/// @see setNu
fn get_nu(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_SVM_getNu_const(self.as_raw_SVM()) }.into_result()
}
// identifier: cv_ml_SVM_setNu_double_val
/// @copybrief getNu @see getNu
fn set_nu(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVM_setNu_double_val(self.as_raw_SVM(), val) }.into_result()
}
// identifier: cv_ml_SVM_getP_const
/// @see setP
fn get_p(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_SVM_getP_const(self.as_raw_SVM()) }.into_result()
}
// identifier: cv_ml_SVM_setP_double_val
/// @copybrief getP @see getP
fn set_p(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVM_setP_double_val(self.as_raw_SVM(), val) }.into_result()
}
// identifier: cv_ml_SVM_getClassWeights_const
/// @see setClassWeights
fn get_class_weights(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_SVM_getClassWeights_const(self.as_raw_SVM()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_SVM_setClassWeights_Mat_val
/// @copybrief getClassWeights @see getClassWeights
fn set_class_weights(&mut self, val: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVM_setClassWeights_Mat_val(self.as_raw_SVM(), val.as_raw_Mat()) }.into_result()
}
// identifier: cv_ml_SVM_getTermCriteria_const
/// @see setTermCriteria
fn get_term_criteria(&self) -> Result<core::TermCriteria> {
unsafe { sys::cv_core_cv_ml_SVM_getTermCriteria_const(self.as_raw_SVM()) }.into_result().map(|x| core::TermCriteria { ptr: x })
}
// identifier: cv_ml_SVM_setTermCriteria_TermCriteria_val
/// @copybrief getTermCriteria @see getTermCriteria
fn set_term_criteria(&mut self, val: &core::TermCriteria) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVM_setTermCriteria_TermCriteria_val(self.as_raw_SVM(), val.as_raw_TermCriteria()) }.into_result()
}
// identifier: cv_ml_SVM_getKernelType_const
/// Type of a %SVM kernel.
/// See SVM::KernelTypes. Default value is SVM::RBF.
fn get_kernel_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_SVM_getKernelType_const(self.as_raw_SVM()) }.into_result()
}
// identifier: cv_ml_SVM_setKernel_int_kernelType
/// Initialize with one of predefined kernels.
/// See SVM::KernelTypes.
fn set_kernel(&mut self, kernel_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVM_setKernel_int_kernelType(self.as_raw_SVM(), kernel_type) }.into_result()
}
// identifier: cv_ml_SVM_setCustomKernel_PtrOfKernel__kernel
/// Initialize with custom kernel.
/// See SVM::Kernel class for implementation details
fn set_custom_kernel(&mut self, _kernel: &types::PtrOfKernel) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVM_setCustomKernel_PtrOfKernel__kernel(self.as_raw_SVM(), _kernel.as_raw_PtrOfKernel()) }.into_result()
}
// identifier: cv_ml_SVM_trainAuto_PtrOfTrainData_data_int_kFold_ParamGrid_Cgrid_ParamGrid_gammaGrid_ParamGrid_pGrid_ParamGrid_nuGrid_ParamGrid_coeffGrid_ParamGrid_degreeGrid_bool_balanced
/// Trains an %SVM with optimal parameters.
///
/// ## Parameters
/// * data: the training data that can be constructed using TrainData::create or
/// TrainData::loadFromCSV.
/// * kFold: Cross-validation parameter. The training set is divided into kFold subsets. One
/// subset is used to test the model, the others form the train set. So, the %SVM algorithm is
/// executed kFold times.
/// * Cgrid: grid for C
/// * gammaGrid: grid for gamma
/// * pGrid: grid for p
/// * nuGrid: grid for nu
/// * coeffGrid: grid for coeff
/// * degreeGrid: grid for degree
/// * balanced: If true and the problem is 2-class classification then the method creates more
/// balanced cross-validation subsets that is proportions between classes in subsets are close
/// to such proportion in the whole train dataset.
///
/// The method trains the %SVM model automatically by choosing the optimal parameters C, gamma, p,
/// nu, coef0, degree. Parameters are considered optimal when the cross-validation
/// estimate of the test set error is minimal.
///
/// If there is no need to optimize a parameter, the corresponding grid step should be set to any
/// value less than or equal to 1. For example, to avoid optimization in gamma, set `gammaGrid.step
/// = 0`, `gammaGrid.minVal`, `gamma_grid.maxVal` as arbitrary numbers. In this case, the value
/// `Gamma` is taken for gamma.
///
/// And, finally, if the optimization in a parameter is required but the corresponding grid is
/// unknown, you may call the function SVM::getDefaultGrid. To generate a grid, for example, for
/// gamma, call `SVM::getDefaultGrid(SVM::GAMMA)`.
///
/// This function works for the classification (SVM::C_SVC or SVM::NU_SVC) as well as for the
/// regression (SVM::EPS_SVR or SVM::NU_SVR). If it is SVM::ONE_CLASS, no optimization is made and
/// the usual %SVM with parameters specified in params is executed.
///
/// ## C++ default parameters:
/// * k_fold: 10
/// * cgrid: getDefaultGrid(C)
/// * gamma_grid: getDefaultGrid(GAMMA)
/// * p_grid: getDefaultGrid(P)
/// * nu_grid: getDefaultGrid(NU)
/// * coeff_grid: getDefaultGrid(COEF)
/// * degree_grid: getDefaultGrid(DEGREE)
/// * balanced: false
fn train_auto(&mut self, data: &types::PtrOfTrainData, k_fold: i32, cgrid: &core::ParamGrid, gamma_grid: &core::ParamGrid, p_grid: &core::ParamGrid, nu_grid: &core::ParamGrid, coeff_grid: &core::ParamGrid, degree_grid: &core::ParamGrid, balanced: bool) -> Result<bool> {
unsafe { sys::cv_core_cv_ml_SVM_trainAuto_PtrOfTrainData_data_int_kFold_ParamGrid_Cgrid_ParamGrid_gammaGrid_ParamGrid_pGrid_ParamGrid_nuGrid_ParamGrid_coeffGrid_ParamGrid_degreeGrid_bool_balanced(self.as_raw_SVM(), data.as_raw_PtrOfTrainData(), k_fold, cgrid.as_raw_ParamGrid(), gamma_grid.as_raw_ParamGrid(), p_grid.as_raw_ParamGrid(), nu_grid.as_raw_ParamGrid(), coeff_grid.as_raw_ParamGrid(), degree_grid.as_raw_ParamGrid(), balanced) }.into_result()
}
// identifier: cv_ml_SVM_trainAuto_Mat_samples_int_layout_Mat_responses_int_kFold_PtrOfParamGrid_Cgrid_PtrOfParamGrid_gammaGrid_PtrOfParamGrid_pGrid_PtrOfParamGrid_nuGrid_PtrOfParamGrid_coeffGrid_PtrOfParamGrid_degreeGrid_bool_balanced
/// Trains an %SVM with optimal parameters
///
/// ## Parameters
/// * samples: training samples
/// * layout: See ml::SampleTypes.
/// * responses: vector of responses associated with the training samples.
/// * kFold: Cross-validation parameter. The training set is divided into kFold subsets. One
/// subset is used to test the model, the others form the train set. So, the %SVM algorithm is
/// * Cgrid: grid for C
/// * gammaGrid: grid for gamma
/// * pGrid: grid for p
/// * nuGrid: grid for nu
/// * coeffGrid: grid for coeff
/// * degreeGrid: grid for degree
/// * balanced: If true and the problem is 2-class classification then the method creates more
/// balanced cross-validation subsets that is proportions between classes in subsets are close
/// to such proportion in the whole train dataset.
///
/// The method trains the %SVM model automatically by choosing the optimal parameters C, gamma, p,
/// nu, coef0, degree. Parameters are considered optimal when the cross-validation
/// estimate of the test set error is minimal.
///
/// This function only makes use of SVM::getDefaultGrid for parameter optimization and thus only
/// offers rudimentary parameter options.
///
/// This function works for the classification (SVM::C_SVC or SVM::NU_SVC) as well as for the
/// regression (SVM::EPS_SVR or SVM::NU_SVR). If it is SVM::ONE_CLASS, no optimization is made and
/// the usual %SVM with parameters specified in params is executed.
///
/// ## C++ default parameters:
/// * k_fold: 10
/// * cgrid: SVM::getDefaultGridPtr(SVM::C)
/// * gamma_grid: SVM::getDefaultGridPtr(SVM::GAMMA)
/// * p_grid: SVM::getDefaultGridPtr(SVM::P)
/// * nu_grid: SVM::getDefaultGridPtr(SVM::NU)
/// * coeff_grid: SVM::getDefaultGridPtr(SVM::COEF)
/// * degree_grid: SVM::getDefaultGridPtr(SVM::DEGREE)
/// * balanced: false
fn train_auto_1(&mut self, samples: &core::Mat, layout: i32, responses: &core::Mat, k_fold: i32, cgrid: &types::PtrOfParamGrid, gamma_grid: &types::PtrOfParamGrid, p_grid: &types::PtrOfParamGrid, nu_grid: &types::PtrOfParamGrid, coeff_grid: &types::PtrOfParamGrid, degree_grid: &types::PtrOfParamGrid, balanced: bool) -> Result<bool> {
unsafe { sys::cv_core_cv_ml_SVM_trainAuto_Mat_samples_int_layout_Mat_responses_int_kFold_PtrOfParamGrid_Cgrid_PtrOfParamGrid_gammaGrid_PtrOfParamGrid_pGrid_PtrOfParamGrid_nuGrid_PtrOfParamGrid_coeffGrid_PtrOfParamGrid_degreeGrid_bool_balanced(self.as_raw_SVM(), samples.as_raw_Mat(), layout, responses.as_raw_Mat(), k_fold, cgrid.as_raw_PtrOfParamGrid(), gamma_grid.as_raw_PtrOfParamGrid(), p_grid.as_raw_PtrOfParamGrid(), nu_grid.as_raw_PtrOfParamGrid(), coeff_grid.as_raw_PtrOfParamGrid(), degree_grid.as_raw_PtrOfParamGrid(), balanced) }.into_result()
}
// identifier: cv_ml_SVM_getSupportVectors_const
/// Retrieves all the support vectors
///
/// The method returns all the support vectors as a floating-point matrix, where support vectors are
/// stored as matrix rows.
fn get_support_vectors(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_SVM_getSupportVectors_const(self.as_raw_SVM()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_SVM_getUncompressedSupportVectors_const
/// Retrieves all the uncompressed support vectors of a linear %SVM
///
/// The method returns all the uncompressed support vectors of a linear %SVM that the compressed
/// support vector, used for prediction, was derived from. They are returned in a floating-point
/// matrix, where the support vectors are stored as matrix rows.
fn get_uncompressed_support_vectors(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_SVM_getUncompressedSupportVectors_const(self.as_raw_SVM()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_SVM_getDecisionFunction_const_int_i_Mat_alpha_Mat_svidx
/// Retrieves the decision function
///
/// ## Parameters
/// * i: the index of the decision function. If the problem solved is regression, 1-class or
/// 2-class classification, then there will be just one decision function and the index should
/// always be 0. Otherwise, in the case of N-class classification, there will be <span lang='latex'>N(N-1)/2</span>
/// decision functions.
/// * alpha: the optional output vector for weights, corresponding to different support vectors.
/// In the case of linear %SVM all the alpha's will be 1's.
/// * svidx: the optional output vector of indices of support vectors within the matrix of
/// support vectors (which can be retrieved by SVM::getSupportVectors). In the case of linear
/// %SVM each decision function consists of a single "compressed" support vector.
///
/// The method returns rho parameter of the decision function, a scalar subtracted from the weighted
/// sum of kernel responses.
fn get_decision_function(&self, i: i32, alpha: &mut core::Mat, svidx: &mut core::Mat) -> Result<f64> {
unsafe { sys::cv_core_cv_ml_SVM_getDecisionFunction_const_int_i_Mat_alpha_Mat_svidx(self.as_raw_SVM(), i, alpha.as_raw_Mat(), svidx.as_raw_Mat()) }.into_result()
}
}
impl<'a> SVM + 'a {
// identifier: cv_ml_SVM_getDefaultGrid_int_param_id
/// Generates a grid for %SVM parameters.
///
/// ## Parameters
/// * param_id: %SVM parameters IDs that must be one of the SVM::ParamTypes. The grid is
/// generated for the parameter with this ID.
///
/// The function generates a grid for the specified parameter of the %SVM algorithm. The grid may be
/// passed to the function SVM::trainAuto.
pub fn get_default_grid(param_id: i32) -> Result<core::ParamGrid> {
unsafe { sys::cv_core_cv_ml_SVM_getDefaultGrid_int_param_id(param_id) }.into_result().map(|x| core::ParamGrid { ptr: x })
}
// identifier: cv_ml_SVM_getDefaultGridPtr_int_param_id
/// Generates a grid for %SVM parameters.
///
/// ## Parameters
/// * param_id: %SVM parameters IDs that must be one of the SVM::ParamTypes. The grid is
/// generated for the parameter with this ID.
///
/// The function generates a grid pointer for the specified parameter of the %SVM algorithm.
/// The grid may be passed to the function SVM::trainAuto.
pub fn get_default_grid_ptr(param_id: i32) -> Result<types::PtrOfParamGrid> {
unsafe { sys::cv_core_cv_ml_SVM_getDefaultGridPtr_int_param_id(param_id) }.into_result().map(|x| types::PtrOfParamGrid { ptr: x })
}
// identifier: cv_ml_SVM_create
/// Creates empty model.
/// Use StatModel::train to train the model. Since %SVM has several parameters, you may want to
/// find the best parameters for your problem, it can be done with SVM::trainAuto.
pub fn create() -> Result<types::PtrOfSVM> {
unsafe { sys::cv_core_cv_ml_SVM_create() }.into_result().map(|x| types::PtrOfSVM { ptr: x })
}
// identifier: cv_ml_SVM_load_String_filepath
/// Loads and creates a serialized svm from a file
///
/// Use SVM::save to serialize and store an SVM to disk.
/// Load the SVM from this file again, by calling this function with the path to the file.
///
/// ## Parameters
/// * filepath: path to serialized svm
pub fn load(filepath: &str) -> Result<types::PtrOfSVM> {
string_arg!(filepath);
unsafe { sys::cv_core_cv_ml_SVM_load_String_filepath(filepath.as_ptr()) }.into_result().map(|x| types::PtrOfSVM { ptr: x })
}
}
// Generating impl for trait cv::ml::SVM::Kernel (trait)
pub trait SVM_Kernel : core::Algorithm {
#[doc(hidden)] fn as_raw_SVM_Kernel(&self) -> *mut c_void;
// identifier: cv_ml_SVM_Kernel_getType_const
fn get_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_SVM_Kernel_getType_const(self.as_raw_SVM_Kernel()) }.into_result()
}
// identifier: cv_ml_SVM_Kernel_calc_int_vcount_int_n_const_float_X_vecs_const_float_X_another_float_X_results
fn calc(&mut self, vcount: i32, n: i32, vecs: &f32, another: &f32, results: &mut f32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVM_Kernel_calc_int_vcount_int_n_const_float_X_vecs_const_float_X_another_float_X_results(self.as_raw_SVM_Kernel(), vcount, n, vecs, another, results) }.into_result()
}
}
impl<'a> SVM_Kernel + 'a {
}
// Generating impl for trait cv::ml::SVMSGD (trait)
/// \
/// Stochastic Gradient Descent SVM Classifier *
pub trait SVMSGD : core::StatModel {
#[doc(hidden)] fn as_raw_SVMSGD(&self) -> *mut c_void;
// identifier: cv_ml_SVMSGD_getWeights
/// @return the weights of the trained model (decision function f(x) = weights * x + shift).
fn get_weights(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_SVMSGD_getWeights(self.as_raw_SVMSGD()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_SVMSGD_getShift
/// @return the shift of the trained model (decision function f(x) = weights * x + shift).
fn get_shift(&mut self) -> Result<f32> {
unsafe { sys::cv_core_cv_ml_SVMSGD_getShift(self.as_raw_SVMSGD()) }.into_result()
}
// identifier: cv_ml_SVMSGD_setOptimalParameters_int_svmsgdType_int_marginType
/// Function sets optimal parameters values for chosen SVM SGD model.
/// ## Parameters
/// * svmsgdType: is the type of SVMSGD classifier.
/// * marginType: is the type of margin constraint.
///
/// ## C++ default parameters:
/// * svmsgd_type: SVMSGD::ASGD
/// * margin_type: SVMSGD::SOFT_MARGIN
fn set_optimal_parameters(&mut self, svmsgd_type: i32, margin_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVMSGD_setOptimalParameters_int_svmsgdType_int_marginType(self.as_raw_SVMSGD(), svmsgd_type, margin_type) }.into_result()
}
// identifier: cv_ml_SVMSGD_getSvmsgdType_const
/// @see setSvmsgdType
fn get_svmsgd_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_SVMSGD_getSvmsgdType_const(self.as_raw_SVMSGD()) }.into_result()
}
// identifier: cv_ml_SVMSGD_setSvmsgdType_int_svmsgdType
/// @copybrief getSvmsgdType @see getSvmsgdType
fn set_svmsgd_type(&mut self, svmsgd_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVMSGD_setSvmsgdType_int_svmsgdType(self.as_raw_SVMSGD(), svmsgd_type) }.into_result()
}
// identifier: cv_ml_SVMSGD_getMarginType_const
/// @see setMarginType
fn get_margin_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_SVMSGD_getMarginType_const(self.as_raw_SVMSGD()) }.into_result()
}
// identifier: cv_ml_SVMSGD_setMarginType_int_marginType
/// @copybrief getMarginType @see getMarginType
fn set_margin_type(&mut self, margin_type: i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVMSGD_setMarginType_int_marginType(self.as_raw_SVMSGD(), margin_type) }.into_result()
}
// identifier: cv_ml_SVMSGD_getMarginRegularization_const
/// @see setMarginRegularization
fn get_margin_regularization(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_ml_SVMSGD_getMarginRegularization_const(self.as_raw_SVMSGD()) }.into_result()
}
// identifier: cv_ml_SVMSGD_setMarginRegularization_float_marginRegularization
/// @copybrief getMarginRegularization @see getMarginRegularization
fn set_margin_regularization(&mut self, margin_regularization: f32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVMSGD_setMarginRegularization_float_marginRegularization(self.as_raw_SVMSGD(), margin_regularization) }.into_result()
}
// identifier: cv_ml_SVMSGD_getInitialStepSize_const
/// @see setInitialStepSize
fn get_initial_step_size(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_ml_SVMSGD_getInitialStepSize_const(self.as_raw_SVMSGD()) }.into_result()
}
// identifier: cv_ml_SVMSGD_setInitialStepSize_float_InitialStepSize
/// @copybrief getInitialStepSize @see getInitialStepSize
fn set_initial_step_size(&mut self, initial_step_size: f32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVMSGD_setInitialStepSize_float_InitialStepSize(self.as_raw_SVMSGD(), initial_step_size) }.into_result()
}
// identifier: cv_ml_SVMSGD_getStepDecreasingPower_const
/// @see setStepDecreasingPower
fn get_step_decreasing_power(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_ml_SVMSGD_getStepDecreasingPower_const(self.as_raw_SVMSGD()) }.into_result()
}
// identifier: cv_ml_SVMSGD_setStepDecreasingPower_float_stepDecreasingPower
/// @copybrief getStepDecreasingPower @see getStepDecreasingPower
fn set_step_decreasing_power(&mut self, step_decreasing_power: f32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVMSGD_setStepDecreasingPower_float_stepDecreasingPower(self.as_raw_SVMSGD(), step_decreasing_power) }.into_result()
}
// identifier: cv_ml_SVMSGD_getTermCriteria_const
/// @see setTermCriteria
fn get_term_criteria(&self) -> Result<core::TermCriteria> {
unsafe { sys::cv_core_cv_ml_SVMSGD_getTermCriteria_const(self.as_raw_SVMSGD()) }.into_result().map(|x| core::TermCriteria { ptr: x })
}
// identifier: cv_ml_SVMSGD_setTermCriteria_TermCriteria_val
/// @copybrief getTermCriteria @see getTermCriteria
fn set_term_criteria(&mut self, val: &core::TermCriteria) -> Result<()> {
unsafe { sys::cv_core_cv_ml_SVMSGD_setTermCriteria_TermCriteria_val(self.as_raw_SVMSGD(), val.as_raw_TermCriteria()) }.into_result()
}
}
impl<'a> SVMSGD + 'a {
// identifier: cv_ml_SVMSGD_create
/// Creates empty model.
/// Use StatModel::train to train the model. Since %SVMSGD has several parameters, you may want to
/// find the best parameters for your problem or use setOptimalParameters() to set some default parameters.
pub fn create() -> Result<types::PtrOfSVMSGD> {
unsafe { sys::cv_core_cv_ml_SVMSGD_create() }.into_result().map(|x| types::PtrOfSVMSGD { ptr: x })
}
// identifier: cv_ml_SVMSGD_load_String_filepath_String_nodeName
/// Loads and creates a serialized SVMSGD from a file
///
/// Use SVMSGD::save to serialize and store an SVMSGD to disk.
/// Load the SVMSGD from this file again, by calling this function with the path to the file.
/// Optionally specify the node for the file containing the classifier
///
/// ## Parameters
/// * filepath: path to serialized SVMSGD
/// * nodeName: name of node containing the classifier
///
/// ## C++ default parameters:
/// * node_name: String()
pub fn load(filepath: &str, node_name: &str) -> Result<types::PtrOfSVMSGD> {
string_arg!(filepath);
string_arg!(node_name);
unsafe { sys::cv_core_cv_ml_SVMSGD_load_String_filepath_String_nodeName(filepath.as_ptr(), node_name.as_ptr()) }.into_result().map(|x| types::PtrOfSVMSGD { ptr: x })
}
}
// Generating impl for trait cv::ml::StatModel (trait)
/// Base class for statistical models in OpenCV ML.
pub trait StatModel : core::Algorithm {
#[doc(hidden)] fn as_raw_StatModel(&self) -> *mut c_void;
// identifier: cv_ml_StatModel_getVarCount_const
/// Returns the number of variables in training samples
fn get_var_count(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_StatModel_getVarCount_const(self.as_raw_StatModel()) }.into_result()
}
// identifier: cv_ml_StatModel_empty_const
fn empty(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_ml_StatModel_empty_const(self.as_raw_StatModel()) }.into_result()
}
// identifier: cv_ml_StatModel_isTrained_const
/// Returns true if the model is trained
fn is_trained(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_ml_StatModel_isTrained_const(self.as_raw_StatModel()) }.into_result()
}
// identifier: cv_ml_StatModel_isClassifier_const
/// Returns true if the model is classifier
fn is_classifier(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_ml_StatModel_isClassifier_const(self.as_raw_StatModel()) }.into_result()
}
// identifier: cv_ml_StatModel_train_PtrOfTrainData_trainData_int_flags
/// Trains the statistical model
///
/// ## Parameters
/// * trainData: training data that can be loaded from file using TrainData::loadFromCSV or
/// created with TrainData::create.
/// * flags: optional flags, depending on the model. Some of the models can be updated with the
/// new training samples, not completely overwritten (such as NormalBayesClassifier or ANN_MLP).
///
/// ## C++ default parameters:
/// * flags: 0
fn train(&mut self, train_data: &types::PtrOfTrainData, flags: i32) -> Result<bool> {
unsafe { sys::cv_core_cv_ml_StatModel_train_PtrOfTrainData_trainData_int_flags(self.as_raw_StatModel(), train_data.as_raw_PtrOfTrainData(), flags) }.into_result()
}
// identifier: cv_ml_StatModel_train_Mat_samples_int_layout_Mat_responses
/// Trains the statistical model
///
/// ## Parameters
/// * samples: training samples
/// * layout: See ml::SampleTypes.
/// * responses: vector of responses associated with the training samples.
fn train_1(&mut self, samples: &core::Mat, layout: i32, responses: &core::Mat) -> Result<bool> {
unsafe { sys::cv_core_cv_ml_StatModel_train_Mat_samples_int_layout_Mat_responses(self.as_raw_StatModel(), samples.as_raw_Mat(), layout, responses.as_raw_Mat()) }.into_result()
}
// identifier: cv_ml_StatModel_calcError_const_PtrOfTrainData_data_bool_test_Mat_resp
/// Computes error on the training or test dataset
///
/// ## Parameters
/// * data: the training data
/// * test: if true, the error is computed over the test subset of the data, otherwise it's
/// computed over the training subset of the data. Please note that if you loaded a completely
/// different dataset to evaluate already trained classifier, you will probably want not to set
/// the test subset at all with TrainData::setTrainTestSplitRatio and specify test=false, so
/// that the error is computed for the whole new set. Yes, this sounds a bit confusing.
/// * resp: the optional output responses.
///
/// The method uses StatModel::predict to compute the error. For regression models the error is
/// computed as RMS, for classifiers - as a percent of missclassified samples (0%-100%).
fn calc_error(&self, data: &types::PtrOfTrainData, test: bool, resp: &mut core::Mat) -> Result<f32> {
unsafe { sys::cv_core_cv_ml_StatModel_calcError_const_PtrOfTrainData_data_bool_test_Mat_resp(self.as_raw_StatModel(), data.as_raw_PtrOfTrainData(), test, resp.as_raw_Mat()) }.into_result()
}
// identifier: cv_ml_StatModel_predict_const_Mat_samples_Mat_results_int_flags
/// Predicts response(s) for the provided sample(s)
///
/// ## Parameters
/// * samples: The input samples, floating-point matrix
/// * results: The optional output matrix of results.
/// * flags: The optional flags, model-dependent. See cv::ml::StatModel::Flags.
///
/// ## C++ default parameters:
/// * results: noArray()
/// * flags: 0
fn predict(&self, samples: &core::Mat, results: &mut core::Mat, flags: i32) -> Result<f32> {
unsafe { sys::cv_core_cv_ml_StatModel_predict_const_Mat_samples_Mat_results_int_flags(self.as_raw_StatModel(), samples.as_raw_Mat(), results.as_raw_Mat(), flags) }.into_result()
}
}
impl<'a> StatModel + 'a {
}
// Generating impl for trait cv::ml::TrainData (trait)
/// Class encapsulating training data.
///
/// Please note that the class only specifies the interface of training data, but not implementation.
/// All the statistical model classes in _ml_ module accepts Ptr\<TrainData\> as parameter. In other
/// words, you can create your own class derived from TrainData and pass smart pointer to the instance
/// of this class into StatModel::train.
///
/// @sa @ref ml_intro_data
pub trait TrainData {
#[doc(hidden)] fn as_raw_TrainData(&self) -> *mut c_void;
// identifier: cv_ml_TrainData_missingValue
fn missing_value(&mut self) -> Result<f32> {
unsafe { sys::cv_core_cv_ml_TrainData_missingValue(self.as_raw_TrainData()) }.into_result()
}
// identifier: cv_ml_TrainData_getLayout_const
fn get_layout(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_TrainData_getLayout_const(self.as_raw_TrainData()) }.into_result()
}
// identifier: cv_ml_TrainData_getNTrainSamples_const
fn get_n_train_samples(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_TrainData_getNTrainSamples_const(self.as_raw_TrainData()) }.into_result()
}
// identifier: cv_ml_TrainData_getNTestSamples_const
fn get_n_test_samples(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_TrainData_getNTestSamples_const(self.as_raw_TrainData()) }.into_result()
}
// identifier: cv_ml_TrainData_getNSamples_const
fn get_n_samples(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_TrainData_getNSamples_const(self.as_raw_TrainData()) }.into_result()
}
// identifier: cv_ml_TrainData_getNVars_const
fn get_n_vars(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_TrainData_getNVars_const(self.as_raw_TrainData()) }.into_result()
}
// identifier: cv_ml_TrainData_getNAllVars_const
fn get_n_all_vars(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_TrainData_getNAllVars_const(self.as_raw_TrainData()) }.into_result()
}
// identifier: cv_ml_TrainData_getSample_const_Mat_varIdx_int_sidx_float_X_buf
fn get_sample(&self, var_idx: &core::Mat, sidx: i32, buf: &mut f32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_TrainData_getSample_const_Mat_varIdx_int_sidx_float_X_buf(self.as_raw_TrainData(), var_idx.as_raw_Mat(), sidx, buf) }.into_result()
}
// identifier: cv_ml_TrainData_getSamples_const
fn get_samples(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getSamples_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getMissing_const
fn get_missing(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getMissing_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getTrainSamples_const_int_layout_bool_compressSamples_bool_compressVars
/// Returns matrix of train samples
///
/// ## Parameters
/// * layout: The requested layout. If it's different from the initial one, the matrix is
/// transposed. See ml::SampleTypes.
/// * compressSamples: if true, the function returns only the training samples (specified by
/// sampleIdx)
/// * compressVars: if true, the function returns the shorter training samples, containing only
/// the active variables.
///
/// In current implementation the function tries to avoid physical data copying and returns the
/// matrix stored inside TrainData (unless the transposition or compression is needed).
///
/// ## C++ default parameters:
/// * layout: ROW_SAMPLE
/// * compress_samples: true
/// * compress_vars: true
fn get_train_samples(&self, layout: i32, compress_samples: bool, compress_vars: bool) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getTrainSamples_const_int_layout_bool_compressSamples_bool_compressVars(self.as_raw_TrainData(), layout, compress_samples, compress_vars) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getTrainResponses_const
/// Returns the vector of responses
///
/// The function returns ordered or the original categorical responses. Usually it's used in
/// regression algorithms.
fn get_train_responses(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getTrainResponses_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getTrainNormCatResponses_const
/// Returns the vector of normalized categorical responses
///
/// The function returns vector of responses. Each response is integer from `0` to `<number of
/// classes>-1`. The actual label value can be retrieved then from the class label vector, see
/// TrainData::getClassLabels.
fn get_train_norm_cat_responses(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getTrainNormCatResponses_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getTestResponses_const
fn get_test_responses(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getTestResponses_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getTestNormCatResponses_const
fn get_test_norm_cat_responses(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getTestNormCatResponses_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getResponses_const
fn get_responses(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getResponses_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getNormCatResponses_const
fn get_norm_cat_responses(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getNormCatResponses_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getSampleWeights_const
fn get_sample_weights(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getSampleWeights_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getTrainSampleWeights_const
fn get_train_sample_weights(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getTrainSampleWeights_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getTestSampleWeights_const
fn get_test_sample_weights(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getTestSampleWeights_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getVarIdx_const
fn get_var_idx(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getVarIdx_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getVarType_const
fn get_var_type(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getVarType_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getVarSymbolFlags_const
fn get_var_symbol_flags(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getVarSymbolFlags_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getResponseType_const
fn get_response_type(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_TrainData_getResponseType_const(self.as_raw_TrainData()) }.into_result()
}
// identifier: cv_ml_TrainData_getTrainSampleIdx_const
fn get_train_sample_idx(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getTrainSampleIdx_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getTestSampleIdx_const
fn get_test_sample_idx(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getTestSampleIdx_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getValues_const_int_vi_Mat_sidx_float_X_values
fn get_values(&self, vi: i32, sidx: &core::Mat, values: &mut f32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_TrainData_getValues_const_int_vi_Mat_sidx_float_X_values(self.as_raw_TrainData(), vi, sidx.as_raw_Mat(), values) }.into_result()
}
// identifier: cv_ml_TrainData_getNormCatValues_const_int_vi_Mat_sidx_int_X_values
fn get_norm_cat_values(&self, vi: i32, sidx: &core::Mat, values: &mut i32) -> Result<()> {
unsafe { sys::cv_core_cv_ml_TrainData_getNormCatValues_const_int_vi_Mat_sidx_int_X_values(self.as_raw_TrainData(), vi, sidx.as_raw_Mat(), values) }.into_result()
}
// identifier: cv_ml_TrainData_getDefaultSubstValues_const
fn get_default_subst_values(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getDefaultSubstValues_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getCatCount_const_int_vi
fn get_cat_count(&self, vi: i32) -> Result<i32> {
unsafe { sys::cv_core_cv_ml_TrainData_getCatCount_const_int_vi(self.as_raw_TrainData(), vi) }.into_result()
}
// identifier: cv_ml_TrainData_getClassLabels_const
/// Returns the vector of class labels
///
/// The function returns vector of unique labels occurred in the responses.
fn get_class_labels(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getClassLabels_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getCatOfs_const
fn get_cat_ofs(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getCatOfs_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getCatMap_const
fn get_cat_map(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getCatMap_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_setTrainTestSplit_int_count_bool_shuffle
/// Splits the training data into the training and test parts
/// @sa TrainData::setTrainTestSplitRatio
///
/// ## C++ default parameters:
/// * shuffle: true
fn set_train_test_split(&mut self, count: i32, shuffle: bool) -> Result<()> {
unsafe { sys::cv_core_cv_ml_TrainData_setTrainTestSplit_int_count_bool_shuffle(self.as_raw_TrainData(), count, shuffle) }.into_result()
}
// identifier: cv_ml_TrainData_setTrainTestSplitRatio_double_ratio_bool_shuffle
/// Splits the training data into the training and test parts
///
/// The function selects a subset of specified relative size and then returns it as the training
/// set. If the function is not called, all the data is used for training. Please, note that for
/// each of TrainData::getTrain\* there is corresponding TrainData::getTest\*, so that the test
/// subset can be retrieved and processed as well.
/// @sa TrainData::setTrainTestSplit
///
/// ## C++ default parameters:
/// * shuffle: true
fn set_train_test_split_ratio(&mut self, ratio: f64, shuffle: bool) -> Result<()> {
unsafe { sys::cv_core_cv_ml_TrainData_setTrainTestSplitRatio_double_ratio_bool_shuffle(self.as_raw_TrainData(), ratio, shuffle) }.into_result()
}
// identifier: cv_ml_TrainData_shuffleTrainTest
fn shuffle_train_test(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_ml_TrainData_shuffleTrainTest(self.as_raw_TrainData()) }.into_result()
}
// identifier: cv_ml_TrainData_getTestSamples_const
/// Returns matrix of test samples
fn get_test_samples(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getTestSamples_const(self.as_raw_TrainData()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getNames_const_VectorOfString_names
/// Returns vector of symbolic names captured in loadFromCSV()
fn get_names(&self, names: &types::VectorOfString) -> Result<()> {
unsafe { sys::cv_core_cv_ml_TrainData_getNames_const_VectorOfString_names(self.as_raw_TrainData(), names.as_raw_VectorOfString()) }.into_result()
}
}
impl<'a> TrainData + 'a {
// identifier: cv_ml_TrainData_getSubVector_Mat_vec_Mat_idx
/// Extract from 1D vector elements specified by passed indexes.
/// ## Parameters
/// * vec: input vector (supported types: CV_32S, CV_32F, CV_64F)
/// * idx: 1D index vector
pub fn get_sub_vector(vec: &core::Mat, idx: &core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getSubVector_Mat_vec_Mat_idx(vec.as_raw_Mat(), idx.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_getSubMatrix_Mat_matrix_Mat_idx_int_layout
/// Extract from matrix rows/cols specified by passed indexes.
/// ## Parameters
/// * matrix: input matrix (supported types: CV_32S, CV_32F, CV_64F)
/// * idx: 1D index vector
/// * layout: specifies to extract rows (cv::ml::ROW_SAMPLES) or to extract columns (cv::ml::COL_SAMPLES)
pub fn get_sub_matrix(matrix: &core::Mat, idx: &core::Mat, layout: i32) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_ml_TrainData_getSubMatrix_Mat_matrix_Mat_idx_int_layout(matrix.as_raw_Mat(), idx.as_raw_Mat(), layout) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_ml_TrainData_create_Mat_samples_int_layout_Mat_responses_Mat_varIdx_Mat_sampleIdx_Mat_sampleWeights_Mat_varType
/// Creates training data from in-memory arrays.
///
/// ## Parameters
/// * samples: matrix of samples. It should have CV_32F type.
/// * layout: see ml::SampleTypes.
/// * responses: matrix of responses. If the responses are scalar, they should be stored as a
/// single row or as a single column. The matrix should have type CV_32F or CV_32S (in the
/// former case the responses are considered as ordered by default; in the latter case - as
/// categorical)
/// * varIdx: vector specifying which variables to use for training. It can be an integer vector
/// (CV_32S) containing 0-based variable indices or byte vector (CV_8U) containing a mask of
/// active variables.
/// * sampleIdx: vector specifying which samples to use for training. It can be an integer
/// vector (CV_32S) containing 0-based sample indices or byte vector (CV_8U) containing a mask
/// of training samples.
/// * sampleWeights: optional vector with weights for each sample. It should have CV_32F type.
/// * varType: optional vector of type CV_8U and size `<number_of_variables_in_samples> +
/// <number_of_variables_in_responses>`, containing types of each input and output variable. See
/// ml::VariableTypes.
///
/// ## C++ default parameters:
/// * var_idx: noArray()
/// * sample_idx: noArray()
/// * sample_weights: noArray()
/// * var_type: noArray()
pub fn create(samples: &core::Mat, layout: i32, responses: &core::Mat, var_idx: &core::Mat, sample_idx: &core::Mat, sample_weights: &core::Mat, var_type: &core::Mat) -> Result<types::PtrOfTrainData> {
unsafe { sys::cv_core_cv_ml_TrainData_create_Mat_samples_int_layout_Mat_responses_Mat_varIdx_Mat_sampleIdx_Mat_sampleWeights_Mat_varType(samples.as_raw_Mat(), layout, responses.as_raw_Mat(), var_idx.as_raw_Mat(), sample_idx.as_raw_Mat(), sample_weights.as_raw_Mat(), var_type.as_raw_Mat()) }.into_result().map(|x| types::PtrOfTrainData { ptr: x })
}
}
// boxed class cv::softdouble
#[allow(dead_code)]
pub struct softdouble {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::softdouble {
fn drop(&mut self) {
unsafe { sys::cv_delete_softdouble(self.ptr) };
}
}
impl core::softdouble {
#[doc(hidden)] pub fn as_raw_softdouble(&self) -> *mut c_void { self.ptr }
}
impl softdouble {
// identifier: cv_softdouble_softdouble_softdouble_c
/// Copy constructor
pub fn new(c: &core::softdouble) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_softdouble_softdouble_c(c.as_raw_softdouble()) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_softdouble_fromRaw_uint64_t_a
/// Construct from raw
///
/// Builds new value from raw binary representation
pub fn from_raw(a: u64) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_fromRaw_uint64_t_a(a) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_softdouble_softdouble_int_a
pub fn new_1(a: i32) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_softdouble_int_a(a) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_softdouble_softdouble_double_a
/// Construct from double
pub fn new_2(a: f64) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_softdouble_double_a(a) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_softdouble_isNaN_const
/// NaN state indicator
pub fn is_na_n(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_softdouble_isNaN_const(self.as_raw_softdouble()) }.into_result()
}
// identifier: cv_softdouble_isInf_const
/// Inf state indicator
pub fn is_inf(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_softdouble_isInf_const(self.as_raw_softdouble()) }.into_result()
}
// identifier: cv_softdouble_isSubnormal_const
/// Subnormal number indicator
pub fn is_subnormal(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_softdouble_isSubnormal_const(self.as_raw_softdouble()) }.into_result()
}
// identifier: cv_softdouble_getSign_const
/// Get sign bit
pub fn get_sign(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_softdouble_getSign_const(self.as_raw_softdouble()) }.into_result()
}
// identifier: cv_softdouble_setSign_const_bool_sign
/// Construct a copy with new sign bit
pub fn set_sign(&self, sign: bool) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_setSign_const_bool_sign(self.as_raw_softdouble(), sign) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_softdouble_getExp_const
/// Get 0-based exponent
pub fn get_exp(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_softdouble_getExp_const(self.as_raw_softdouble()) }.into_result()
}
// identifier: cv_softdouble_setExp_const_int_e
/// Construct a copy with new 0-based exponent
pub fn set_exp(&self, e: i32) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_setExp_const_int_e(self.as_raw_softdouble(), e) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_softdouble_getFrac_const
/// Get a fraction part
///
/// Returns a number 1 <= x < 2 with the same significand
pub fn get_frac(&self) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_getFrac_const(self.as_raw_softdouble()) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_softdouble_setFrac_const_softdouble_s
/// Construct a copy with provided significand
///
/// Constructs a copy of a number with significand taken from parameter
pub fn set_frac(&self, s: &core::softdouble) -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_setFrac_const_softdouble_s(self.as_raw_softdouble(), s.as_raw_softdouble()) }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_softdouble_zero
/// Zero constant
pub fn zero() -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_zero() }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_softdouble_inf
/// Positive infinity constant
pub fn inf() -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_inf() }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_softdouble_nan
/// Default NaN constant
pub fn nan() -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_nan() }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_softdouble_one
/// One constant
pub fn one() -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_one() }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_softdouble_min
/// Smallest normalized value
pub fn min() -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_min() }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_softdouble_eps
/// Difference between 1 and next representable value
pub fn eps() -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_eps() }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_softdouble_max
/// Biggest finite value
pub fn max() -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_max() }.into_result().map(|x| core::softdouble { ptr: x })
}
// identifier: cv_softdouble_pi
/// Correct pi approximation
pub fn pi() -> Result<core::softdouble> {
unsafe { sys::cv_core_cv_softdouble_pi() }.into_result().map(|x| core::softdouble { ptr: x })
}
}
// boxed class cv::softfloat
/// @addtogroup core_utils_softfloat
///
/// [SoftFloat](http://www.jhauser.us/arithmetic/SoftFloat.html) is a software implementation
/// of floating-point calculations according to IEEE 754 standard.
/// All calculations are done in integers, that's why they are machine-independent and bit-exact.
/// This library can be useful in accuracy-critical parts like look-up tables generation, tests, etc.
/// OpenCV contains a subset of SoftFloat partially rewritten to C++.
///
/// ### Types
///
/// There are two basic types: @ref softfloat and @ref softdouble.
/// These types are binary compatible with float and double types respectively
/// and support conversions to/from them.
/// Other types from original SoftFloat library like fp16 or fp128 were thrown away
/// as well as quiet/signaling NaN support, on-the-fly rounding mode switch
/// and exception flags (though exceptions can be implemented in the future).
///
/// ### Operations
///
/// Both types support the following:
/// - Construction from signed and unsigned 32-bit and 64 integers,
/// float/double or raw binary representation
/// - Conversions between each other, to float or double and to int
/// using @ref cvRound, @ref cvTrunc, @ref cvFloor, @ref cvCeil or a bunch of
/// saturate_cast functions
/// - Add, subtract, multiply, divide, remainder, square root, FMA with absolute precision
/// - Comparison operations
/// - Explicit sign, exponent and significand manipulation through get/set methods,
/// number state indicators (isInf, isNan, isSubnormal)
/// - Type-specific constants like eps, minimum/maximum value, best pi approximation, etc.
/// - min(), max(), abs(), exp(), log() and pow() functions
#[allow(dead_code)]
pub struct softfloat {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::softfloat {
fn drop(&mut self) {
unsafe { sys::cv_delete_softfloat(self.ptr) };
}
}
impl core::softfloat {
#[doc(hidden)] pub fn as_raw_softfloat(&self) -> *mut c_void { self.ptr }
}
impl softfloat {
// identifier: cv_softfloat_softfloat
/// Default constructor
pub fn new() -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_softfloat() }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_softfloat_softfloat_c
/// Copy constructor
pub fn new_1(c: &core::softfloat) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_softfloat_softfloat_c(c.as_raw_softfloat()) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_fromRaw_uint32_t_a
/// Construct from raw
///
/// Builds new value from raw binary representation
pub fn from_raw(a: u32) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_fromRaw_uint32_t_a(a) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_softfloat_int_a
pub fn new_2(a: i32) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_softfloat_int_a(a) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_softfloat_float_a
/// Construct from float
pub fn new_3(a: f32) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_softfloat_float_a(a) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_isNaN_const
/// NaN state indicator
pub fn is_na_n(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_softfloat_isNaN_const(self.as_raw_softfloat()) }.into_result()
}
// identifier: cv_softfloat_isInf_const
/// Inf state indicator
pub fn is_inf(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_softfloat_isInf_const(self.as_raw_softfloat()) }.into_result()
}
// identifier: cv_softfloat_isSubnormal_const
/// Subnormal number indicator
pub fn is_subnormal(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_softfloat_isSubnormal_const(self.as_raw_softfloat()) }.into_result()
}
// identifier: cv_softfloat_getSign_const
/// Get sign bit
pub fn get_sign(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_softfloat_getSign_const(self.as_raw_softfloat()) }.into_result()
}
// identifier: cv_softfloat_setSign_const_bool_sign
/// Construct a copy with new sign bit
pub fn set_sign(&self, sign: bool) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_setSign_const_bool_sign(self.as_raw_softfloat(), sign) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_getExp_const
/// Get 0-based exponent
pub fn get_exp(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_softfloat_getExp_const(self.as_raw_softfloat()) }.into_result()
}
// identifier: cv_softfloat_setExp_const_int_e
/// Construct a copy with new 0-based exponent
pub fn set_exp(&self, e: i32) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_setExp_const_int_e(self.as_raw_softfloat(), e) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_getFrac_const
/// Get a fraction part
///
/// Returns a number 1 <= x < 2 with the same significand
pub fn get_frac(&self) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_getFrac_const(self.as_raw_softfloat()) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_setFrac_const_softfloat_s
/// Construct a copy with provided significand
///
/// Constructs a copy of a number with significand taken from parameter
pub fn set_frac(&self, s: &core::softfloat) -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_setFrac_const_softfloat_s(self.as_raw_softfloat(), s.as_raw_softfloat()) }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_zero
/// Zero constant
pub fn zero() -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_zero() }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_inf
/// Positive infinity constant
pub fn inf() -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_inf() }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_nan
/// Default NaN constant
pub fn nan() -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_nan() }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_one
/// One constant
pub fn one() -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_one() }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_min
/// Smallest normalized value
pub fn min() -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_min() }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_eps
/// Difference between 1 and next representable value
pub fn eps() -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_eps() }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_max
/// Biggest finite value
pub fn max() -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_max() }.into_result().map(|x| core::softfloat { ptr: x })
}
// identifier: cv_softfloat_pi
/// Correct pi approximation
pub fn pi() -> Result<core::softfloat> {
unsafe { sys::cv_core_cv_softfloat_pi() }.into_result().map(|x| core::softfloat { ptr: x })
}
}
// Generating impl for trait cv::superres::FrameSource (trait)
/// Super Resolution
///
/// # Super Resolution
///
/// The Super Resolution module contains a set of functions and classes that can be used to solve the
/// problem of resolution enhancement. There are a few methods implemented, most of them are described in
/// the papers @cite Farsiu03 and @cite Mitzel09 .
pub trait FrameSource {
#[doc(hidden)] fn as_raw_FrameSource(&self) -> *mut c_void;
// identifier: cv_superres_FrameSource_nextFrame_Mat_frame
fn next_frame(&mut self, frame: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_superres_FrameSource_nextFrame_Mat_frame(self.as_raw_FrameSource(), frame.as_raw_Mat()) }.into_result()
}
// identifier: cv_superres_FrameSource_reset
fn reset(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_superres_FrameSource_reset(self.as_raw_FrameSource()) }.into_result()
}
}
impl<'a> FrameSource + 'a {
}
// Generating impl for trait cv::superres::SuperResolution (trait)
/// Base class for Super Resolution algorithms.
///
/// The class is only used to define the common interface for the whole family of Super Resolution
/// algorithms.
pub trait SuperResolution : core::Algorithm + core::FrameSource {
#[doc(hidden)] fn as_raw_SuperResolution(&self) -> *mut c_void;
// identifier: cv_superres_SuperResolution_setInput_PtrOfFrameSource_frameSource
/// Set input frame source for Super Resolution algorithm.
///
/// ## Parameters
/// * frameSource: Input frame source
fn set_input(&mut self, frame_source: &types::PtrOfFrameSource) -> Result<()> {
unsafe { sys::cv_core_cv_superres_SuperResolution_setInput_PtrOfFrameSource_frameSource(self.as_raw_SuperResolution(), frame_source.as_raw_PtrOfFrameSource()) }.into_result()
}
// identifier: cv_superres_SuperResolution_nextFrame_Mat_frame
/// Process next frame from input and return output result.
///
/// ## Parameters
/// * frame: Output result
fn next_frame(&mut self, frame: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_superres_SuperResolution_nextFrame_Mat_frame(self.as_raw_SuperResolution(), frame.as_raw_Mat()) }.into_result()
}
// identifier: cv_superres_SuperResolution_reset
fn reset(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_superres_SuperResolution_reset(self.as_raw_SuperResolution()) }.into_result()
}
// identifier: cv_superres_SuperResolution_collectGarbage
/// Clear all inner buffers.
fn collect_garbage(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_superres_SuperResolution_collectGarbage(self.as_raw_SuperResolution()) }.into_result()
}
// identifier: cv_superres_SuperResolution_getScale_const
/// @see setScale
fn get_scale(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_superres_SuperResolution_getScale_const(self.as_raw_SuperResolution()) }.into_result()
}
// identifier: cv_superres_SuperResolution_setScale_int_val
/// @copybrief getScale @see getScale
fn set_scale(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_superres_SuperResolution_setScale_int_val(self.as_raw_SuperResolution(), val) }.into_result()
}
// identifier: cv_superres_SuperResolution_getIterations_const
/// @see setIterations
fn get_iterations(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_superres_SuperResolution_getIterations_const(self.as_raw_SuperResolution()) }.into_result()
}
// identifier: cv_superres_SuperResolution_setIterations_int_val
/// @copybrief getIterations @see getIterations
fn set_iterations(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_superres_SuperResolution_setIterations_int_val(self.as_raw_SuperResolution(), val) }.into_result()
}
// identifier: cv_superres_SuperResolution_getTau_const
/// @see setTau
fn get_tau(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_superres_SuperResolution_getTau_const(self.as_raw_SuperResolution()) }.into_result()
}
// identifier: cv_superres_SuperResolution_setTau_double_val
/// @copybrief getTau @see getTau
fn set_tau(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_superres_SuperResolution_setTau_double_val(self.as_raw_SuperResolution(), val) }.into_result()
}
// identifier: cv_superres_SuperResolution_getLabmda_const
/// @see setLabmda
fn get_labmda(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_superres_SuperResolution_getLabmda_const(self.as_raw_SuperResolution()) }.into_result()
}
// identifier: cv_superres_SuperResolution_setLabmda_double_val
/// @copybrief getLabmda @see getLabmda
fn set_labmda(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_superres_SuperResolution_setLabmda_double_val(self.as_raw_SuperResolution(), val) }.into_result()
}
// identifier: cv_superres_SuperResolution_getAlpha_const
/// @see setAlpha
fn get_alpha(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_superres_SuperResolution_getAlpha_const(self.as_raw_SuperResolution()) }.into_result()
}
// identifier: cv_superres_SuperResolution_setAlpha_double_val
/// @copybrief getAlpha @see getAlpha
fn set_alpha(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_superres_SuperResolution_setAlpha_double_val(self.as_raw_SuperResolution(), val) }.into_result()
}
// identifier: cv_superres_SuperResolution_getKernelSize_const
/// @see setKernelSize
fn get_kernel_size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_superres_SuperResolution_getKernelSize_const(self.as_raw_SuperResolution()) }.into_result()
}
// identifier: cv_superres_SuperResolution_setKernelSize_int_val
/// @copybrief getKernelSize @see getKernelSize
fn set_kernel_size(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_superres_SuperResolution_setKernelSize_int_val(self.as_raw_SuperResolution(), val) }.into_result()
}
// identifier: cv_superres_SuperResolution_getBlurKernelSize_const
/// @see setBlurKernelSize
fn get_blur_kernel_size(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_superres_SuperResolution_getBlurKernelSize_const(self.as_raw_SuperResolution()) }.into_result()
}
// identifier: cv_superres_SuperResolution_setBlurKernelSize_int_val
/// @copybrief getBlurKernelSize @see getBlurKernelSize
fn set_blur_kernel_size(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_superres_SuperResolution_setBlurKernelSize_int_val(self.as_raw_SuperResolution(), val) }.into_result()
}
// identifier: cv_superres_SuperResolution_getBlurSigma_const
/// @see setBlurSigma
fn get_blur_sigma(&self) -> Result<f64> {
unsafe { sys::cv_core_cv_superres_SuperResolution_getBlurSigma_const(self.as_raw_SuperResolution()) }.into_result()
}
// identifier: cv_superres_SuperResolution_setBlurSigma_double_val
/// @copybrief getBlurSigma @see getBlurSigma
fn set_blur_sigma(&mut self, val: f64) -> Result<()> {
unsafe { sys::cv_core_cv_superres_SuperResolution_setBlurSigma_double_val(self.as_raw_SuperResolution(), val) }.into_result()
}
// identifier: cv_superres_SuperResolution_getTemporalAreaRadius_const
/// @see setTemporalAreaRadius
fn get_temporal_area_radius(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_superres_SuperResolution_getTemporalAreaRadius_const(self.as_raw_SuperResolution()) }.into_result()
}
// identifier: cv_superres_SuperResolution_setTemporalAreaRadius_int_val
/// @copybrief getTemporalAreaRadius @see getTemporalAreaRadius
fn set_temporal_area_radius(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_superres_SuperResolution_setTemporalAreaRadius_int_val(self.as_raw_SuperResolution(), val) }.into_result()
}
}
impl<'a> SuperResolution + 'a {
}
// boxed class cv::videostab::ColorAverageInpainter
#[allow(dead_code)]
pub struct ColorAverageInpainter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ColorAverageInpainter {
fn drop(&mut self) {
unsafe { sys::cv_delete_ColorAverageInpainter(self.ptr) };
}
}
impl core::ColorAverageInpainter {
#[doc(hidden)] pub fn as_raw_ColorAverageInpainter(&self) -> *mut c_void { self.ptr }
}
impl core::InpainterBase for ColorAverageInpainter {
#[doc(hidden)] fn as_raw_InpainterBase(&self) -> *mut c_void { self.ptr }
}
impl ColorAverageInpainter {
// identifier: cv_videostab_ColorAverageInpainter_inpaint_int_idx_Mat_frame_Mat_mask
pub fn inpaint(&mut self, idx: i32, frame: &core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_ColorAverageInpainter_inpaint_int_idx_Mat_frame_Mat_mask(self.as_raw_ColorAverageInpainter(), idx, frame.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
// boxed class cv::videostab::ColorInpainter
#[allow(dead_code)]
pub struct ColorInpainter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ColorInpainter {
fn drop(&mut self) {
unsafe { sys::cv_delete_ColorInpainter(self.ptr) };
}
}
impl core::ColorInpainter {
#[doc(hidden)] pub fn as_raw_ColorInpainter(&self) -> *mut c_void { self.ptr }
}
impl core::InpainterBase for ColorInpainter {
#[doc(hidden)] fn as_raw_InpainterBase(&self) -> *mut c_void { self.ptr }
}
impl ColorInpainter {
// identifier: cv_videostab_ColorInpainter_ColorInpainter_int_method_double_radius
///
/// ## C++ default parameters:
/// * method: INPAINT_TELEA
/// * radius: 2.
pub fn new(method: i32, radius: f64) -> Result<core::ColorInpainter> {
unsafe { sys::cv_core_cv_videostab_ColorInpainter_ColorInpainter_int_method_double_radius(method, radius) }.into_result().map(|x| core::ColorInpainter { ptr: x })
}
// identifier: cv_videostab_ColorInpainter_inpaint_int_idx_Mat_frame_Mat_mask
pub fn inpaint(&mut self, idx: i32, frame: &core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_ColorInpainter_inpaint_int_idx_Mat_frame_Mat_mask(self.as_raw_ColorInpainter(), idx, frame.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
// boxed class cv::videostab::ConsistentMosaicInpainter
#[allow(dead_code)]
pub struct ConsistentMosaicInpainter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ConsistentMosaicInpainter {
fn drop(&mut self) {
unsafe { sys::cv_delete_ConsistentMosaicInpainter(self.ptr) };
}
}
impl core::ConsistentMosaicInpainter {
#[doc(hidden)] pub fn as_raw_ConsistentMosaicInpainter(&self) -> *mut c_void { self.ptr }
}
impl core::InpainterBase for ConsistentMosaicInpainter {
#[doc(hidden)] fn as_raw_InpainterBase(&self) -> *mut c_void { self.ptr }
}
impl ConsistentMosaicInpainter {
// identifier: cv_videostab_ConsistentMosaicInpainter_ConsistentMosaicInpainter
pub fn new() -> Result<core::ConsistentMosaicInpainter> {
unsafe { sys::cv_core_cv_videostab_ConsistentMosaicInpainter_ConsistentMosaicInpainter() }.into_result().map(|x| core::ConsistentMosaicInpainter { ptr: x })
}
// identifier: cv_videostab_ConsistentMosaicInpainter_setStdevThresh_float_val
pub fn set_stdev_thresh(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_ConsistentMosaicInpainter_setStdevThresh_float_val(self.as_raw_ConsistentMosaicInpainter(), val) }.into_result()
}
// identifier: cv_videostab_ConsistentMosaicInpainter_stdevThresh_const
pub fn stdev_thresh(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_videostab_ConsistentMosaicInpainter_stdevThresh_const(self.as_raw_ConsistentMosaicInpainter()) }.into_result()
}
// identifier: cv_videostab_ConsistentMosaicInpainter_inpaint_int_idx_Mat_frame_Mat_mask
pub fn inpaint(&mut self, idx: i32, frame: &core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_ConsistentMosaicInpainter_inpaint_int_idx_Mat_frame_Mat_mask(self.as_raw_ConsistentMosaicInpainter(), idx, frame.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
// Generating impl for trait cv::videostab::DeblurerBase (trait)
pub trait DeblurerBase {
#[doc(hidden)] fn as_raw_DeblurerBase(&self) -> *mut c_void;
// identifier: cv_videostab_DeblurerBase_setRadius_int_val
fn set_radius(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_DeblurerBase_setRadius_int_val(self.as_raw_DeblurerBase(), val) }.into_result()
}
// identifier: cv_videostab_DeblurerBase_radius_const
fn radius(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_videostab_DeblurerBase_radius_const(self.as_raw_DeblurerBase()) }.into_result()
}
// identifier: cv_videostab_DeblurerBase_deblur_int_idx_Mat_frame
fn deblur(&mut self, idx: i32, frame: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_DeblurerBase_deblur_int_idx_Mat_frame(self.as_raw_DeblurerBase(), idx, frame.as_raw_Mat()) }.into_result()
}
// identifier: cv_videostab_DeblurerBase_setFrames_VectorOfMat_val
fn set_frames(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_DeblurerBase_setFrames_VectorOfMat_val(self.as_raw_DeblurerBase(), val.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_videostab_DeblurerBase_frames_const
fn frames(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_core_cv_videostab_DeblurerBase_frames_const(self.as_raw_DeblurerBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
// identifier: cv_videostab_DeblurerBase_setMotions_VectorOfMat_val
fn set_motions(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_DeblurerBase_setMotions_VectorOfMat_val(self.as_raw_DeblurerBase(), val.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_videostab_DeblurerBase_motions_const
fn motions(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_core_cv_videostab_DeblurerBase_motions_const(self.as_raw_DeblurerBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
// identifier: cv_videostab_DeblurerBase_setBlurrinessRates_VectorOffloat_val
fn set_blurriness_rates(&mut self, val: &types::VectorOffloat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_DeblurerBase_setBlurrinessRates_VectorOffloat_val(self.as_raw_DeblurerBase(), val.as_raw_VectorOffloat()) }.into_result()
}
// identifier: cv_videostab_DeblurerBase_blurrinessRates_const
fn blurriness_rates(&self) -> Result<types::VectorOffloat> {
unsafe { sys::cv_core_cv_videostab_DeblurerBase_blurrinessRates_const(self.as_raw_DeblurerBase()) }.into_result().map(|x| types::VectorOffloat { ptr: x })
}
}
impl<'a> DeblurerBase + 'a {
}
// boxed class cv::videostab::FastMarchingMethod
/// Describes the Fast Marching Method implementation.
///
/// See http://iwi.eldoc.ub.rug.nl/FILES/root/2004/JGraphToolsTelea/2004JGraphToolsTelea.pdf
#[allow(dead_code)]
pub struct FastMarchingMethod {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::FastMarchingMethod {
fn drop(&mut self) {
unsafe { sys::cv_delete_FastMarchingMethod(self.ptr) };
}
}
impl core::FastMarchingMethod {
#[doc(hidden)] pub fn as_raw_FastMarchingMethod(&self) -> *mut c_void { self.ptr }
}
impl FastMarchingMethod {
// identifier: cv_videostab_FastMarchingMethod_distanceMap_const
/// @return Distance map that's created during working of the method.
pub fn distance_map(&self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_FastMarchingMethod_distanceMap_const(self.as_raw_FastMarchingMethod()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
// boxed class cv::videostab::FromFileMotionReader
#[allow(dead_code)]
pub struct FromFileMotionReader {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::FromFileMotionReader {
fn drop(&mut self) {
unsafe { sys::cv_delete_FromFileMotionReader(self.ptr) };
}
}
impl core::FromFileMotionReader {
#[doc(hidden)] pub fn as_raw_FromFileMotionReader(&self) -> *mut c_void { self.ptr }
}
impl core::ImageMotionEstimatorBase for FromFileMotionReader {
#[doc(hidden)] fn as_raw_ImageMotionEstimatorBase(&self) -> *mut c_void { self.ptr }
}
impl FromFileMotionReader {
// identifier: cv_videostab_FromFileMotionReader_FromFileMotionReader_String_path
pub fn new(path: &str) -> Result<core::FromFileMotionReader> {
string_arg!(path);
unsafe { sys::cv_core_cv_videostab_FromFileMotionReader_FromFileMotionReader_String_path(path.as_ptr()) }.into_result().map(|x| core::FromFileMotionReader { ptr: x })
}
// identifier: cv_videostab_FromFileMotionReader_estimate_Mat_frame0_Mat_frame1_bool_X_ok
///
/// ## C++ default parameters:
/// * ok: 0
pub fn estimate(&mut self, frame0: &core::Mat, frame1: &core::Mat, ok: &mut bool) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_FromFileMotionReader_estimate_Mat_frame0_Mat_frame1_bool_X_ok(self.as_raw_FromFileMotionReader(), frame0.as_raw_Mat(), frame1.as_raw_Mat(), ok) }.into_result().map(|x| core::Mat { ptr: x })
}
}
// boxed class cv::videostab::GaussianMotionFilter
#[allow(dead_code)]
pub struct GaussianMotionFilter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::GaussianMotionFilter {
fn drop(&mut self) {
unsafe { sys::cv_delete_GaussianMotionFilter(self.ptr) };
}
}
impl core::GaussianMotionFilter {
#[doc(hidden)] pub fn as_raw_GaussianMotionFilter(&self) -> *mut c_void { self.ptr }
}
impl core::IMotionStabilizer for GaussianMotionFilter {
#[doc(hidden)] fn as_raw_IMotionStabilizer(&self) -> *mut c_void { self.ptr }
}
impl core::MotionFilterBase for GaussianMotionFilter {
#[doc(hidden)] fn as_raw_MotionFilterBase(&self) -> *mut c_void { self.ptr }
}
impl GaussianMotionFilter {
// identifier: cv_videostab_GaussianMotionFilter_GaussianMotionFilter_int_radius_float_stdev
///
/// ## C++ default parameters:
/// * radius: 15
/// * stdev: -1.f
pub fn new(radius: i32, stdev: f32) -> Result<core::GaussianMotionFilter> {
unsafe { sys::cv_core_cv_videostab_GaussianMotionFilter_GaussianMotionFilter_int_radius_float_stdev(radius, stdev) }.into_result().map(|x| core::GaussianMotionFilter { ptr: x })
}
// identifier: cv_videostab_GaussianMotionFilter_setParams_int_radius_float_stdev
///
/// ## C++ default parameters:
/// * stdev: -1.f
pub fn set_params(&mut self, radius: i32, stdev: f32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_GaussianMotionFilter_setParams_int_radius_float_stdev(self.as_raw_GaussianMotionFilter(), radius, stdev) }.into_result()
}
// identifier: cv_videostab_GaussianMotionFilter_radius_const
pub fn radius(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_videostab_GaussianMotionFilter_radius_const(self.as_raw_GaussianMotionFilter()) }.into_result()
}
// identifier: cv_videostab_GaussianMotionFilter_stdev_const
pub fn stdev(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_videostab_GaussianMotionFilter_stdev_const(self.as_raw_GaussianMotionFilter()) }.into_result()
}
// identifier: cv_videostab_GaussianMotionFilter_GaussianMotionFilter_int__radius_float__stdev
pub fn new_1(_radius: i32, _stdev: f32) -> Result<core::GaussianMotionFilter> {
unsafe { sys::cv_core_cv_videostab_GaussianMotionFilter_GaussianMotionFilter_int__radius_float__stdev(_radius, _stdev) }.into_result().map(|x| core::GaussianMotionFilter { ptr: x })
}
}
// Generating impl for trait cv::videostab::IDenseOptFlowEstimator (trait)
pub trait IDenseOptFlowEstimator {
#[doc(hidden)] fn as_raw_IDenseOptFlowEstimator(&self) -> *mut c_void;
// identifier: cv_videostab_IDenseOptFlowEstimator_run_Mat_frame0_Mat_frame1_Mat_flowX_Mat_flowY_Mat_errors
fn run(&mut self, frame0: &core::Mat, frame1: &core::Mat, flow_x: &mut core::Mat, flow_y: &mut core::Mat, errors: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_IDenseOptFlowEstimator_run_Mat_frame0_Mat_frame1_Mat_flowX_Mat_flowY_Mat_errors(self.as_raw_IDenseOptFlowEstimator(), frame0.as_raw_Mat(), frame1.as_raw_Mat(), flow_x.as_raw_Mat(), flow_y.as_raw_Mat(), errors.as_raw_Mat()) }.into_result()
}
}
impl<'a> IDenseOptFlowEstimator + 'a {
}
// Generating impl for trait cv::videostab::IFrameSource (trait)
pub trait IFrameSource {
#[doc(hidden)] fn as_raw_IFrameSource(&self) -> *mut c_void;
// identifier: cv_videostab_IFrameSource_reset
fn reset(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_IFrameSource_reset(self.as_raw_IFrameSource()) }.into_result()
}
// identifier: cv_videostab_IFrameSource_nextFrame
fn next_frame(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_IFrameSource_nextFrame(self.as_raw_IFrameSource()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
impl<'a> IFrameSource + 'a {
}
// Generating impl for trait cv::videostab::ILog (trait)
pub trait ILog {
#[doc(hidden)] fn as_raw_ILog(&self) -> *mut c_void;
}
impl<'a> ILog + 'a {
}
// Generating impl for trait cv::videostab::IMotionStabilizer (trait)
pub trait IMotionStabilizer {
#[doc(hidden)] fn as_raw_IMotionStabilizer(&self) -> *mut c_void;
}
impl<'a> IMotionStabilizer + 'a {
}
// Generating impl for trait cv::videostab::IOutlierRejector (trait)
pub trait IOutlierRejector {
#[doc(hidden)] fn as_raw_IOutlierRejector(&self) -> *mut c_void;
// identifier: cv_videostab_IOutlierRejector_process_Size_frameSize_Mat_points0_Mat_points1_Mat_mask
fn process(&mut self, frame_size: core::Size, points0: &core::Mat, points1: &core::Mat, mask: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_IOutlierRejector_process_Size_frameSize_Mat_points0_Mat_points1_Mat_mask(self.as_raw_IOutlierRejector(), frame_size, points0.as_raw_Mat(), points1.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
impl<'a> IOutlierRejector + 'a {
}
// Generating impl for trait cv::videostab::ISparseOptFlowEstimator (trait)
pub trait ISparseOptFlowEstimator {
#[doc(hidden)] fn as_raw_ISparseOptFlowEstimator(&self) -> *mut c_void;
// identifier: cv_videostab_ISparseOptFlowEstimator_run_Mat_frame0_Mat_frame1_Mat_points0_Mat_points1_Mat_status_Mat_errors
fn run(&mut self, frame0: &core::Mat, frame1: &core::Mat, points0: &core::Mat, points1: &mut core::Mat, status: &mut core::Mat, errors: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_ISparseOptFlowEstimator_run_Mat_frame0_Mat_frame1_Mat_points0_Mat_points1_Mat_status_Mat_errors(self.as_raw_ISparseOptFlowEstimator(), frame0.as_raw_Mat(), frame1.as_raw_Mat(), points0.as_raw_Mat(), points1.as_raw_Mat(), status.as_raw_Mat(), errors.as_raw_Mat()) }.into_result()
}
}
impl<'a> ISparseOptFlowEstimator + 'a {
}
// Generating impl for trait cv::videostab::ImageMotionEstimatorBase (trait)
/// Base class for global 2D motion estimation methods which take frames as input.
pub trait ImageMotionEstimatorBase {
#[doc(hidden)] fn as_raw_ImageMotionEstimatorBase(&self) -> *mut c_void;
// identifier: cv_videostab_ImageMotionEstimatorBase_estimate_Mat_frame0_Mat_frame1_bool_X_ok
///
/// ## C++ default parameters:
/// * ok: 0
fn estimate(&mut self, frame0: &core::Mat, frame1: &core::Mat, ok: &mut bool) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_ImageMotionEstimatorBase_estimate_Mat_frame0_Mat_frame1_bool_X_ok(self.as_raw_ImageMotionEstimatorBase(), frame0.as_raw_Mat(), frame1.as_raw_Mat(), ok) }.into_result().map(|x| core::Mat { ptr: x })
}
}
impl<'a> ImageMotionEstimatorBase + 'a {
}
// Generating impl for trait cv::videostab::InpainterBase (trait)
pub trait InpainterBase {
#[doc(hidden)] fn as_raw_InpainterBase(&self) -> *mut c_void;
// identifier: cv_videostab_InpainterBase_setRadius_int_val
fn set_radius(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_InpainterBase_setRadius_int_val(self.as_raw_InpainterBase(), val) }.into_result()
}
// identifier: cv_videostab_InpainterBase_radius_const
fn radius(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_videostab_InpainterBase_radius_const(self.as_raw_InpainterBase()) }.into_result()
}
// identifier: cv_videostab_InpainterBase_inpaint_int_idx_Mat_frame_Mat_mask
fn inpaint(&mut self, idx: i32, frame: &core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_InpainterBase_inpaint_int_idx_Mat_frame_Mat_mask(self.as_raw_InpainterBase(), idx, frame.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
// identifier: cv_videostab_InpainterBase_setFrames_VectorOfMat_val
fn set_frames(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_InpainterBase_setFrames_VectorOfMat_val(self.as_raw_InpainterBase(), val.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_videostab_InpainterBase_frames_const
fn frames(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_core_cv_videostab_InpainterBase_frames_const(self.as_raw_InpainterBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
// identifier: cv_videostab_InpainterBase_setMotions_VectorOfMat_val
fn set_motions(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_InpainterBase_setMotions_VectorOfMat_val(self.as_raw_InpainterBase(), val.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_videostab_InpainterBase_motions_const
fn motions(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_core_cv_videostab_InpainterBase_motions_const(self.as_raw_InpainterBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
// identifier: cv_videostab_InpainterBase_setStabilizedFrames_VectorOfMat_val
fn set_stabilized_frames(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_InpainterBase_setStabilizedFrames_VectorOfMat_val(self.as_raw_InpainterBase(), val.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_videostab_InpainterBase_stabilizedFrames_const
fn stabilized_frames(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_core_cv_videostab_InpainterBase_stabilizedFrames_const(self.as_raw_InpainterBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
// identifier: cv_videostab_InpainterBase_setStabilizationMotions_VectorOfMat_val
fn set_stabilization_motions(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_InpainterBase_setStabilizationMotions_VectorOfMat_val(self.as_raw_InpainterBase(), val.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_videostab_InpainterBase_stabilizationMotions_const
fn stabilization_motions(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_core_cv_videostab_InpainterBase_stabilizationMotions_const(self.as_raw_InpainterBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
}
impl<'a> InpainterBase + 'a {
}
// boxed class cv::videostab::InpaintingPipeline
#[allow(dead_code)]
pub struct InpaintingPipeline {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::InpaintingPipeline {
fn drop(&mut self) {
unsafe { sys::cv_delete_InpaintingPipeline(self.ptr) };
}
}
impl core::InpaintingPipeline {
#[doc(hidden)] pub fn as_raw_InpaintingPipeline(&self) -> *mut c_void { self.ptr }
}
impl core::InpainterBase for InpaintingPipeline {
#[doc(hidden)] fn as_raw_InpainterBase(&self) -> *mut c_void { self.ptr }
}
impl InpaintingPipeline {
// identifier: cv_videostab_InpaintingPipeline_pushBack_PtrOfInpainterBase_inpainter
pub fn push_back(&mut self, inpainter: &types::PtrOfInpainterBase) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_InpaintingPipeline_pushBack_PtrOfInpainterBase_inpainter(self.as_raw_InpaintingPipeline(), inpainter.as_raw_PtrOfInpainterBase()) }.into_result()
}
// identifier: cv_videostab_InpaintingPipeline_empty_const
pub fn empty(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_videostab_InpaintingPipeline_empty_const(self.as_raw_InpaintingPipeline()) }.into_result()
}
// identifier: cv_videostab_InpaintingPipeline_setRadius_int_val
pub fn set_radius(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_InpaintingPipeline_setRadius_int_val(self.as_raw_InpaintingPipeline(), val) }.into_result()
}
// identifier: cv_videostab_InpaintingPipeline_setFrames_VectorOfMat_val
pub fn set_frames(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_InpaintingPipeline_setFrames_VectorOfMat_val(self.as_raw_InpaintingPipeline(), val.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_videostab_InpaintingPipeline_setMotions_VectorOfMat_val
pub fn set_motions(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_InpaintingPipeline_setMotions_VectorOfMat_val(self.as_raw_InpaintingPipeline(), val.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_videostab_InpaintingPipeline_setStabilizedFrames_VectorOfMat_val
pub fn set_stabilized_frames(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_InpaintingPipeline_setStabilizedFrames_VectorOfMat_val(self.as_raw_InpaintingPipeline(), val.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_videostab_InpaintingPipeline_setStabilizationMotions_VectorOfMat_val
pub fn set_stabilization_motions(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_InpaintingPipeline_setStabilizationMotions_VectorOfMat_val(self.as_raw_InpaintingPipeline(), val.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_videostab_InpaintingPipeline_inpaint_int_idx_Mat_frame_Mat_mask
pub fn inpaint(&mut self, idx: i32, frame: &core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_InpaintingPipeline_inpaint_int_idx_Mat_frame_Mat_mask(self.as_raw_InpaintingPipeline(), idx, frame.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
// boxed class cv::videostab::KeypointBasedMotionEstimator
/// Describes a global 2D motion estimation method which uses keypoints detection and optical flow for
/// matching.
#[allow(dead_code)]
pub struct KeypointBasedMotionEstimator {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::KeypointBasedMotionEstimator {
fn drop(&mut self) {
unsafe { sys::cv_delete_KeypointBasedMotionEstimator(self.ptr) };
}
}
impl core::KeypointBasedMotionEstimator {
#[doc(hidden)] pub fn as_raw_KeypointBasedMotionEstimator(&self) -> *mut c_void { self.ptr }
}
impl core::ImageMotionEstimatorBase for KeypointBasedMotionEstimator {
#[doc(hidden)] fn as_raw_ImageMotionEstimatorBase(&self) -> *mut c_void { self.ptr }
}
impl KeypointBasedMotionEstimator {
// identifier: cv_videostab_KeypointBasedMotionEstimator_KeypointBasedMotionEstimator_PtrOfMotionEstimatorBase_estimator
pub fn new(estimator: &types::PtrOfMotionEstimatorBase) -> Result<core::KeypointBasedMotionEstimator> {
unsafe { sys::cv_core_cv_videostab_KeypointBasedMotionEstimator_KeypointBasedMotionEstimator_PtrOfMotionEstimatorBase_estimator(estimator.as_raw_PtrOfMotionEstimatorBase()) }.into_result().map(|x| core::KeypointBasedMotionEstimator { ptr: x })
}
// identifier: cv_videostab_KeypointBasedMotionEstimator_setDetector_PtrOfFeature2D_val
pub fn set_detector(&mut self, val: &types::PtrOfFeature2D) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_KeypointBasedMotionEstimator_setDetector_PtrOfFeature2D_val(self.as_raw_KeypointBasedMotionEstimator(), val.as_raw_PtrOfFeature2D()) }.into_result()
}
// identifier: cv_videostab_KeypointBasedMotionEstimator_detector_const
pub fn detector(&self) -> Result<types::PtrOfFeature2D> {
unsafe { sys::cv_core_cv_videostab_KeypointBasedMotionEstimator_detector_const(self.as_raw_KeypointBasedMotionEstimator()) }.into_result().map(|x| types::PtrOfFeature2D { ptr: x })
}
// identifier: cv_videostab_KeypointBasedMotionEstimator_estimate_Mat_frame0_Mat_frame1_bool_X_ok
///
/// ## C++ default parameters:
/// * ok: 0
pub fn estimate(&mut self, frame0: &core::Mat, frame1: &core::Mat, ok: &mut bool) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_KeypointBasedMotionEstimator_estimate_Mat_frame0_Mat_frame1_bool_X_ok(self.as_raw_KeypointBasedMotionEstimator(), frame0.as_raw_Mat(), frame1.as_raw_Mat(), ok) }.into_result().map(|x| core::Mat { ptr: x })
}
}
// boxed class cv::videostab::LogToStdout
#[allow(dead_code)]
pub struct LogToStdout {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::LogToStdout {
fn drop(&mut self) {
unsafe { sys::cv_delete_LogToStdout(self.ptr) };
}
}
impl core::LogToStdout {
#[doc(hidden)] pub fn as_raw_LogToStdout(&self) -> *mut c_void { self.ptr }
}
impl core::ILog for LogToStdout {
#[doc(hidden)] fn as_raw_ILog(&self) -> *mut c_void { self.ptr }
}
impl LogToStdout {
}
// boxed class cv::videostab::LpMotionStabilizer
#[allow(dead_code)]
pub struct LpMotionStabilizer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::LpMotionStabilizer {
fn drop(&mut self) {
unsafe { sys::cv_delete_LpMotionStabilizer(self.ptr) };
}
}
impl core::LpMotionStabilizer {
#[doc(hidden)] pub fn as_raw_LpMotionStabilizer(&self) -> *mut c_void { self.ptr }
}
impl core::IMotionStabilizer for LpMotionStabilizer {
#[doc(hidden)] fn as_raw_IMotionStabilizer(&self) -> *mut c_void { self.ptr }
}
impl LpMotionStabilizer {
// identifier: cv_videostab_LpMotionStabilizer_setFrameSize_Size_val
pub fn set_frame_size(&mut self, val: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_LpMotionStabilizer_setFrameSize_Size_val(self.as_raw_LpMotionStabilizer(), val) }.into_result()
}
// identifier: cv_videostab_LpMotionStabilizer_frameSize_const
pub fn frame_size(&self) -> Result<core::Size> {
unsafe { sys::cv_core_cv_videostab_LpMotionStabilizer_frameSize_const(self.as_raw_LpMotionStabilizer()) }.into_result()
}
// identifier: cv_videostab_LpMotionStabilizer_setTrimRatio_float_val
pub fn set_trim_ratio(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_LpMotionStabilizer_setTrimRatio_float_val(self.as_raw_LpMotionStabilizer(), val) }.into_result()
}
// identifier: cv_videostab_LpMotionStabilizer_trimRatio_const
pub fn trim_ratio(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_videostab_LpMotionStabilizer_trimRatio_const(self.as_raw_LpMotionStabilizer()) }.into_result()
}
// identifier: cv_videostab_LpMotionStabilizer_setWeight1_float_val
pub fn set_weight1(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_LpMotionStabilizer_setWeight1_float_val(self.as_raw_LpMotionStabilizer(), val) }.into_result()
}
// identifier: cv_videostab_LpMotionStabilizer_weight1_const
pub fn weight1(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_videostab_LpMotionStabilizer_weight1_const(self.as_raw_LpMotionStabilizer()) }.into_result()
}
// identifier: cv_videostab_LpMotionStabilizer_setWeight2_float_val
pub fn set_weight2(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_LpMotionStabilizer_setWeight2_float_val(self.as_raw_LpMotionStabilizer(), val) }.into_result()
}
// identifier: cv_videostab_LpMotionStabilizer_weight2_const
pub fn weight2(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_videostab_LpMotionStabilizer_weight2_const(self.as_raw_LpMotionStabilizer()) }.into_result()
}
// identifier: cv_videostab_LpMotionStabilizer_setWeight3_float_val
pub fn set_weight3(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_LpMotionStabilizer_setWeight3_float_val(self.as_raw_LpMotionStabilizer(), val) }.into_result()
}
// identifier: cv_videostab_LpMotionStabilizer_weight3_const
pub fn weight3(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_videostab_LpMotionStabilizer_weight3_const(self.as_raw_LpMotionStabilizer()) }.into_result()
}
// identifier: cv_videostab_LpMotionStabilizer_setWeight4_float_val
pub fn set_weight4(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_LpMotionStabilizer_setWeight4_float_val(self.as_raw_LpMotionStabilizer(), val) }.into_result()
}
// identifier: cv_videostab_LpMotionStabilizer_weight4_const
pub fn weight4(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_videostab_LpMotionStabilizer_weight4_const(self.as_raw_LpMotionStabilizer()) }.into_result()
}
}
// boxed class cv::videostab::MoreAccurateMotionWobbleSuppressor
#[allow(dead_code)]
pub struct MoreAccurateMotionWobbleSuppressor {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::MoreAccurateMotionWobbleSuppressor {
fn drop(&mut self) {
unsafe { sys::cv_delete_MoreAccurateMotionWobbleSuppressor(self.ptr) };
}
}
impl core::MoreAccurateMotionWobbleSuppressor {
#[doc(hidden)] pub fn as_raw_MoreAccurateMotionWobbleSuppressor(&self) -> *mut c_void { self.ptr }
}
impl core::WobbleSuppressorBase for MoreAccurateMotionWobbleSuppressor {
#[doc(hidden)] fn as_raw_WobbleSuppressorBase(&self) -> *mut c_void { self.ptr }
}
impl core::MoreAccurateMotionWobbleSuppressorBase for MoreAccurateMotionWobbleSuppressor {
#[doc(hidden)] fn as_raw_MoreAccurateMotionWobbleSuppressorBase(&self) -> *mut c_void { self.ptr }
}
impl MoreAccurateMotionWobbleSuppressor {
// identifier: cv_videostab_MoreAccurateMotionWobbleSuppressor_suppress_int_idx_Mat_frame_Mat_result
pub fn suppress(&mut self, idx: i32, frame: &core::Mat, result: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_MoreAccurateMotionWobbleSuppressor_suppress_int_idx_Mat_frame_Mat_result(self.as_raw_MoreAccurateMotionWobbleSuppressor(), idx, frame.as_raw_Mat(), result.as_raw_Mat()) }.into_result()
}
}
// Generating impl for trait cv::videostab::MoreAccurateMotionWobbleSuppressorBase (trait)
pub trait MoreAccurateMotionWobbleSuppressorBase : core::WobbleSuppressorBase {
#[doc(hidden)] fn as_raw_MoreAccurateMotionWobbleSuppressorBase(&self) -> *mut c_void;
// identifier: cv_videostab_MoreAccurateMotionWobbleSuppressorBase_setPeriod_int_val
fn set_period(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_MoreAccurateMotionWobbleSuppressorBase_setPeriod_int_val(self.as_raw_MoreAccurateMotionWobbleSuppressorBase(), val) }.into_result()
}
// identifier: cv_videostab_MoreAccurateMotionWobbleSuppressorBase_period_const
fn period(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_videostab_MoreAccurateMotionWobbleSuppressorBase_period_const(self.as_raw_MoreAccurateMotionWobbleSuppressorBase()) }.into_result()
}
}
impl<'a> MoreAccurateMotionWobbleSuppressorBase + 'a {
}
// Generating impl for trait cv::videostab::MotionEstimatorBase (trait)
/// Base class for all global motion estimation methods.
pub trait MotionEstimatorBase {
#[doc(hidden)] fn as_raw_MotionEstimatorBase(&self) -> *mut c_void;
// identifier: cv_videostab_MotionEstimatorBase_estimate_Mat_points0_Mat_points1_bool_X_ok
/// Estimates global motion between two 2D point clouds.
///
/// ## Parameters
/// * points0: Source set of 2D points (32F).
/// * points1: Destination set of 2D points (32F).
/// * ok: Indicates whether motion was estimated successfully.
/// @return 3x3 2D transformation matrix (32F).
///
/// ## C++ default parameters:
/// * ok: 0
fn estimate(&mut self, points0: &core::Mat, points1: &core::Mat, ok: &mut bool) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_MotionEstimatorBase_estimate_Mat_points0_Mat_points1_bool_X_ok(self.as_raw_MotionEstimatorBase(), points0.as_raw_Mat(), points1.as_raw_Mat(), ok) }.into_result().map(|x| core::Mat { ptr: x })
}
}
impl<'a> MotionEstimatorBase + 'a {
}
// boxed class cv::videostab::MotionEstimatorL1
/// Describes a global 2D motion estimation method which minimizes L1 error.
///
///
/// Note: To be able to use this method you must build OpenCV with CLP library support. :
#[allow(dead_code)]
pub struct MotionEstimatorL1 {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::MotionEstimatorL1 {
fn drop(&mut self) {
unsafe { sys::cv_delete_MotionEstimatorL1(self.ptr) };
}
}
impl core::MotionEstimatorL1 {
#[doc(hidden)] pub fn as_raw_MotionEstimatorL1(&self) -> *mut c_void { self.ptr }
}
impl core::MotionEstimatorBase for MotionEstimatorL1 {
#[doc(hidden)] fn as_raw_MotionEstimatorBase(&self) -> *mut c_void { self.ptr }
}
impl MotionEstimatorL1 {
// identifier: cv_videostab_MotionEstimatorL1_estimate_Mat_points0_Mat_points1_bool_X_ok
///
/// ## C++ default parameters:
/// * ok: 0
pub fn estimate(&mut self, points0: &core::Mat, points1: &core::Mat, ok: &mut bool) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_MotionEstimatorL1_estimate_Mat_points0_Mat_points1_bool_X_ok(self.as_raw_MotionEstimatorL1(), points0.as_raw_Mat(), points1.as_raw_Mat(), ok) }.into_result().map(|x| core::Mat { ptr: x })
}
}
// boxed class cv::videostab::MotionEstimatorRansacL2
/// Describes a robust RANSAC-based global 2D motion estimation method which minimizes L2 error.
#[allow(dead_code)]
pub struct MotionEstimatorRansacL2 {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::MotionEstimatorRansacL2 {
fn drop(&mut self) {
unsafe { sys::cv_delete_MotionEstimatorRansacL2(self.ptr) };
}
}
impl core::MotionEstimatorRansacL2 {
#[doc(hidden)] pub fn as_raw_MotionEstimatorRansacL2(&self) -> *mut c_void { self.ptr }
}
impl core::MotionEstimatorBase for MotionEstimatorRansacL2 {
#[doc(hidden)] fn as_raw_MotionEstimatorBase(&self) -> *mut c_void { self.ptr }
}
impl MotionEstimatorRansacL2 {
// identifier: cv_videostab_MotionEstimatorRansacL2_setMinInlierRatio_float_val
pub fn set_min_inlier_ratio(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_MotionEstimatorRansacL2_setMinInlierRatio_float_val(self.as_raw_MotionEstimatorRansacL2(), val) }.into_result()
}
// identifier: cv_videostab_MotionEstimatorRansacL2_minInlierRatio_const
pub fn min_inlier_ratio(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_videostab_MotionEstimatorRansacL2_minInlierRatio_const(self.as_raw_MotionEstimatorRansacL2()) }.into_result()
}
// identifier: cv_videostab_MotionEstimatorRansacL2_estimate_Mat_points0_Mat_points1_bool_X_ok
///
/// ## C++ default parameters:
/// * ok: 0
pub fn estimate(&mut self, points0: &core::Mat, points1: &core::Mat, ok: &mut bool) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_MotionEstimatorRansacL2_estimate_Mat_points0_Mat_points1_bool_X_ok(self.as_raw_MotionEstimatorRansacL2(), points0.as_raw_Mat(), points1.as_raw_Mat(), ok) }.into_result().map(|x| core::Mat { ptr: x })
}
}
// Generating impl for trait cv::videostab::MotionFilterBase (trait)
pub trait MotionFilterBase : core::IMotionStabilizer {
#[doc(hidden)] fn as_raw_MotionFilterBase(&self) -> *mut c_void;
}
impl<'a> MotionFilterBase + 'a {
}
// boxed class cv::videostab::MotionInpainter
#[allow(dead_code)]
pub struct MotionInpainter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::MotionInpainter {
fn drop(&mut self) {
unsafe { sys::cv_delete_MotionInpainter(self.ptr) };
}
}
impl core::MotionInpainter {
#[doc(hidden)] pub fn as_raw_MotionInpainter(&self) -> *mut c_void { self.ptr }
}
impl core::InpainterBase for MotionInpainter {
#[doc(hidden)] fn as_raw_InpainterBase(&self) -> *mut c_void { self.ptr }
}
impl MotionInpainter {
// identifier: cv_videostab_MotionInpainter_MotionInpainter
pub fn new() -> Result<core::MotionInpainter> {
unsafe { sys::cv_core_cv_videostab_MotionInpainter_MotionInpainter() }.into_result().map(|x| core::MotionInpainter { ptr: x })
}
// identifier: cv_videostab_MotionInpainter_setFlowErrorThreshold_float_val
pub fn set_flow_error_threshold(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_MotionInpainter_setFlowErrorThreshold_float_val(self.as_raw_MotionInpainter(), val) }.into_result()
}
// identifier: cv_videostab_MotionInpainter_flowErrorThreshold_const
pub fn flow_error_threshold(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_videostab_MotionInpainter_flowErrorThreshold_const(self.as_raw_MotionInpainter()) }.into_result()
}
// identifier: cv_videostab_MotionInpainter_setDistThreshold_float_val
pub fn set_dist_threshold(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_MotionInpainter_setDistThreshold_float_val(self.as_raw_MotionInpainter(), val) }.into_result()
}
// identifier: cv_videostab_MotionInpainter_distThresh_const
pub fn dist_thresh(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_videostab_MotionInpainter_distThresh_const(self.as_raw_MotionInpainter()) }.into_result()
}
// identifier: cv_videostab_MotionInpainter_setBorderMode_int_val
pub fn set_border_mode(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_MotionInpainter_setBorderMode_int_val(self.as_raw_MotionInpainter(), val) }.into_result()
}
// identifier: cv_videostab_MotionInpainter_borderMode_const
pub fn border_mode(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_videostab_MotionInpainter_borderMode_const(self.as_raw_MotionInpainter()) }.into_result()
}
// identifier: cv_videostab_MotionInpainter_inpaint_int_idx_Mat_frame_Mat_mask
pub fn inpaint(&mut self, idx: i32, frame: &core::Mat, mask: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_MotionInpainter_inpaint_int_idx_Mat_frame_Mat_mask(self.as_raw_MotionInpainter(), idx, frame.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
// boxed class cv::videostab::MotionStabilizationPipeline
#[allow(dead_code)]
pub struct MotionStabilizationPipeline {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::MotionStabilizationPipeline {
fn drop(&mut self) {
unsafe { sys::cv_delete_MotionStabilizationPipeline(self.ptr) };
}
}
impl core::MotionStabilizationPipeline {
#[doc(hidden)] pub fn as_raw_MotionStabilizationPipeline(&self) -> *mut c_void { self.ptr }
}
impl core::IMotionStabilizer for MotionStabilizationPipeline {
#[doc(hidden)] fn as_raw_IMotionStabilizer(&self) -> *mut c_void { self.ptr }
}
impl MotionStabilizationPipeline {
// identifier: cv_videostab_MotionStabilizationPipeline_pushBack_PtrOfIMotionStabilizer_stabilizer
pub fn push_back(&mut self, stabilizer: &types::PtrOfIMotionStabilizer) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_MotionStabilizationPipeline_pushBack_PtrOfIMotionStabilizer_stabilizer(self.as_raw_MotionStabilizationPipeline(), stabilizer.as_raw_PtrOfIMotionStabilizer()) }.into_result()
}
// identifier: cv_videostab_MotionStabilizationPipeline_empty_const
pub fn empty(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_videostab_MotionStabilizationPipeline_empty_const(self.as_raw_MotionStabilizationPipeline()) }.into_result()
}
}
// boxed class cv::videostab::NullDeblurer
#[allow(dead_code)]
pub struct NullDeblurer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::NullDeblurer {
fn drop(&mut self) {
unsafe { sys::cv_delete_NullDeblurer(self.ptr) };
}
}
impl core::NullDeblurer {
#[doc(hidden)] pub fn as_raw_NullDeblurer(&self) -> *mut c_void { self.ptr }
}
impl core::DeblurerBase for NullDeblurer {
#[doc(hidden)] fn as_raw_DeblurerBase(&self) -> *mut c_void { self.ptr }
}
impl NullDeblurer {
// identifier: cv_videostab_NullDeblurer_deblur_int_unnamed_arg_Mat_unnamed_arg_1
pub fn deblur(&mut self, unnamed_arg: i32, unnamed_arg_1: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_NullDeblurer_deblur_int_unnamed_arg_Mat_unnamed_arg_1(self.as_raw_NullDeblurer(), unnamed_arg, unnamed_arg_1.as_raw_Mat()) }.into_result()
}
}
// boxed class cv::videostab::NullFrameSource
#[allow(dead_code)]
pub struct NullFrameSource {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::NullFrameSource {
fn drop(&mut self) {
unsafe { sys::cv_delete_NullFrameSource(self.ptr) };
}
}
impl core::NullFrameSource {
#[doc(hidden)] pub fn as_raw_NullFrameSource(&self) -> *mut c_void { self.ptr }
}
impl core::IFrameSource for NullFrameSource {
#[doc(hidden)] fn as_raw_IFrameSource(&self) -> *mut c_void { self.ptr }
}
impl NullFrameSource {
// identifier: cv_videostab_NullFrameSource_reset
pub fn reset(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_NullFrameSource_reset(self.as_raw_NullFrameSource()) }.into_result()
}
// identifier: cv_videostab_NullFrameSource_nextFrame
pub fn next_frame(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_NullFrameSource_nextFrame(self.as_raw_NullFrameSource()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
// boxed class cv::videostab::NullInpainter
#[allow(dead_code)]
pub struct NullInpainter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::NullInpainter {
fn drop(&mut self) {
unsafe { sys::cv_delete_NullInpainter(self.ptr) };
}
}
impl core::NullInpainter {
#[doc(hidden)] pub fn as_raw_NullInpainter(&self) -> *mut c_void { self.ptr }
}
impl core::InpainterBase for NullInpainter {
#[doc(hidden)] fn as_raw_InpainterBase(&self) -> *mut c_void { self.ptr }
}
impl NullInpainter {
// identifier: cv_videostab_NullInpainter_inpaint_int_unnamed_arg_Mat_unnamed_arg_1_Mat_unnamed_arg_2
pub fn inpaint(&mut self, unnamed_arg: i32, unnamed_arg_1: &core::Mat, unnamed_arg_2: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_NullInpainter_inpaint_int_unnamed_arg_Mat_unnamed_arg_1_Mat_unnamed_arg_2(self.as_raw_NullInpainter(), unnamed_arg, unnamed_arg_1.as_raw_Mat(), unnamed_arg_2.as_raw_Mat()) }.into_result()
}
}
// boxed class cv::videostab::NullLog
#[allow(dead_code)]
pub struct NullLog {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::NullLog {
fn drop(&mut self) {
unsafe { sys::cv_delete_NullLog(self.ptr) };
}
}
impl core::NullLog {
#[doc(hidden)] pub fn as_raw_NullLog(&self) -> *mut c_void { self.ptr }
}
impl core::ILog for NullLog {
#[doc(hidden)] fn as_raw_ILog(&self) -> *mut c_void { self.ptr }
}
impl NullLog {
}
// boxed class cv::videostab::NullOutlierRejector
#[allow(dead_code)]
pub struct NullOutlierRejector {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::NullOutlierRejector {
fn drop(&mut self) {
unsafe { sys::cv_delete_NullOutlierRejector(self.ptr) };
}
}
impl core::NullOutlierRejector {
#[doc(hidden)] pub fn as_raw_NullOutlierRejector(&self) -> *mut c_void { self.ptr }
}
impl core::IOutlierRejector for NullOutlierRejector {
#[doc(hidden)] fn as_raw_IOutlierRejector(&self) -> *mut c_void { self.ptr }
}
impl NullOutlierRejector {
// identifier: cv_videostab_NullOutlierRejector_process_Size_frameSize_Mat_points0_Mat_points1_Mat_mask
pub fn process(&mut self, frame_size: core::Size, points0: &core::Mat, points1: &core::Mat, mask: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_NullOutlierRejector_process_Size_frameSize_Mat_points0_Mat_points1_Mat_mask(self.as_raw_NullOutlierRejector(), frame_size, points0.as_raw_Mat(), points1.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
// boxed class cv::videostab::NullWobbleSuppressor
#[allow(dead_code)]
pub struct NullWobbleSuppressor {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::NullWobbleSuppressor {
fn drop(&mut self) {
unsafe { sys::cv_delete_NullWobbleSuppressor(self.ptr) };
}
}
impl core::NullWobbleSuppressor {
#[doc(hidden)] pub fn as_raw_NullWobbleSuppressor(&self) -> *mut c_void { self.ptr }
}
impl core::WobbleSuppressorBase for NullWobbleSuppressor {
#[doc(hidden)] fn as_raw_WobbleSuppressorBase(&self) -> *mut c_void { self.ptr }
}
impl NullWobbleSuppressor {
// identifier: cv_videostab_NullWobbleSuppressor_suppress_int_idx_Mat_frame_Mat_result
pub fn suppress(&mut self, idx: i32, frame: &core::Mat, result: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_NullWobbleSuppressor_suppress_int_idx_Mat_frame_Mat_result(self.as_raw_NullWobbleSuppressor(), idx, frame.as_raw_Mat(), result.as_raw_Mat()) }.into_result()
}
}
// boxed class cv::videostab::OnePassStabilizer
#[allow(dead_code)]
pub struct OnePassStabilizer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::OnePassStabilizer {
fn drop(&mut self) {
unsafe { sys::cv_delete_OnePassStabilizer(self.ptr) };
}
}
impl core::OnePassStabilizer {
#[doc(hidden)] pub fn as_raw_OnePassStabilizer(&self) -> *mut c_void { self.ptr }
}
impl core::IFrameSource for OnePassStabilizer {
#[doc(hidden)] fn as_raw_IFrameSource(&self) -> *mut c_void { self.ptr }
}
impl core::StabilizerBase for OnePassStabilizer {
#[doc(hidden)] fn as_raw_StabilizerBase(&self) -> *mut c_void { self.ptr }
}
impl OnePassStabilizer {
// identifier: cv_videostab_OnePassStabilizer_OnePassStabilizer
pub fn new() -> Result<core::OnePassStabilizer> {
unsafe { sys::cv_core_cv_videostab_OnePassStabilizer_OnePassStabilizer() }.into_result().map(|x| core::OnePassStabilizer { ptr: x })
}
// identifier: cv_videostab_OnePassStabilizer_setMotionFilter_PtrOfMotionFilterBase_val
pub fn set_motion_filter(&mut self, val: &types::PtrOfMotionFilterBase) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_OnePassStabilizer_setMotionFilter_PtrOfMotionFilterBase_val(self.as_raw_OnePassStabilizer(), val.as_raw_PtrOfMotionFilterBase()) }.into_result()
}
// identifier: cv_videostab_OnePassStabilizer_motionFilter_const
pub fn motion_filter(&self) -> Result<types::PtrOfMotionFilterBase> {
unsafe { sys::cv_core_cv_videostab_OnePassStabilizer_motionFilter_const(self.as_raw_OnePassStabilizer()) }.into_result().map(|x| types::PtrOfMotionFilterBase { ptr: x })
}
// identifier: cv_videostab_OnePassStabilizer_reset
pub fn reset(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_OnePassStabilizer_reset(self.as_raw_OnePassStabilizer()) }.into_result()
}
// identifier: cv_videostab_OnePassStabilizer_nextFrame
pub fn next_frame(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_OnePassStabilizer_nextFrame(self.as_raw_OnePassStabilizer()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
// Generating impl for trait cv::videostab::PyrLkOptFlowEstimatorBase (trait)
pub trait PyrLkOptFlowEstimatorBase {
#[doc(hidden)] fn as_raw_PyrLkOptFlowEstimatorBase(&self) -> *mut c_void;
// identifier: cv_videostab_PyrLkOptFlowEstimatorBase_setWinSize_Size_val
fn set_win_size(&mut self, val: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_PyrLkOptFlowEstimatorBase_setWinSize_Size_val(self.as_raw_PyrLkOptFlowEstimatorBase(), val) }.into_result()
}
// identifier: cv_videostab_PyrLkOptFlowEstimatorBase_winSize_const
fn win_size(&self) -> Result<core::Size> {
unsafe { sys::cv_core_cv_videostab_PyrLkOptFlowEstimatorBase_winSize_const(self.as_raw_PyrLkOptFlowEstimatorBase()) }.into_result()
}
// identifier: cv_videostab_PyrLkOptFlowEstimatorBase_setMaxLevel_int_val
fn set_max_level(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_PyrLkOptFlowEstimatorBase_setMaxLevel_int_val(self.as_raw_PyrLkOptFlowEstimatorBase(), val) }.into_result()
}
// identifier: cv_videostab_PyrLkOptFlowEstimatorBase_maxLevel_const
fn max_level(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_videostab_PyrLkOptFlowEstimatorBase_maxLevel_const(self.as_raw_PyrLkOptFlowEstimatorBase()) }.into_result()
}
}
impl<'a> PyrLkOptFlowEstimatorBase + 'a {
}
// boxed class cv::videostab::RansacParams
/// Describes RANSAC method parameters.
#[allow(dead_code)]
pub struct RansacParams {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::RansacParams {
fn drop(&mut self) {
unsafe { sys::cv_delete_RansacParams(self.ptr) };
}
}
impl core::RansacParams {
#[doc(hidden)] pub fn as_raw_RansacParams(&self) -> *mut c_void { self.ptr }
}
impl RansacParams {
// identifier: cv_videostab_RansacParams_niters_const
/// @return Number of iterations that'll be performed by RANSAC method.
pub fn niters(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_videostab_RansacParams_niters_const(self.as_raw_RansacParams()) }.into_result()
}
}
// boxed class cv::videostab::SparsePyrLkOptFlowEstimator
#[allow(dead_code)]
pub struct SparsePyrLkOptFlowEstimator {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::SparsePyrLkOptFlowEstimator {
fn drop(&mut self) {
unsafe { sys::cv_delete_SparsePyrLkOptFlowEstimator(self.ptr) };
}
}
impl core::SparsePyrLkOptFlowEstimator {
#[doc(hidden)] pub fn as_raw_SparsePyrLkOptFlowEstimator(&self) -> *mut c_void { self.ptr }
}
impl core::ISparseOptFlowEstimator for SparsePyrLkOptFlowEstimator {
#[doc(hidden)] fn as_raw_ISparseOptFlowEstimator(&self) -> *mut c_void { self.ptr }
}
impl core::PyrLkOptFlowEstimatorBase for SparsePyrLkOptFlowEstimator {
#[doc(hidden)] fn as_raw_PyrLkOptFlowEstimatorBase(&self) -> *mut c_void { self.ptr }
}
impl SparsePyrLkOptFlowEstimator {
// identifier: cv_videostab_SparsePyrLkOptFlowEstimator_run_Mat_frame0_Mat_frame1_Mat_points0_Mat_points1_Mat_status_Mat_errors
pub fn run(&mut self, frame0: &core::Mat, frame1: &core::Mat, points0: &core::Mat, points1: &mut core::Mat, status: &mut core::Mat, errors: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_SparsePyrLkOptFlowEstimator_run_Mat_frame0_Mat_frame1_Mat_points0_Mat_points1_Mat_status_Mat_errors(self.as_raw_SparsePyrLkOptFlowEstimator(), frame0.as_raw_Mat(), frame1.as_raw_Mat(), points0.as_raw_Mat(), points1.as_raw_Mat(), status.as_raw_Mat(), errors.as_raw_Mat()) }.into_result()
}
}
// Generating impl for trait cv::videostab::StabilizerBase (trait)
pub trait StabilizerBase {
#[doc(hidden)] fn as_raw_StabilizerBase(&self) -> *mut c_void;
// identifier: cv_videostab_StabilizerBase_setLog_PtrOfILog_ilog
fn set_log(&mut self, ilog: &types::PtrOfILog) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_setLog_PtrOfILog_ilog(self.as_raw_StabilizerBase(), ilog.as_raw_PtrOfILog()) }.into_result()
}
// identifier: cv_videostab_StabilizerBase_log_const
fn log(&self) -> Result<types::PtrOfILog> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_log_const(self.as_raw_StabilizerBase()) }.into_result().map(|x| types::PtrOfILog { ptr: x })
}
// identifier: cv_videostab_StabilizerBase_setRadius_int_val
fn set_radius(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_setRadius_int_val(self.as_raw_StabilizerBase(), val) }.into_result()
}
// identifier: cv_videostab_StabilizerBase_radius_const
fn radius(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_radius_const(self.as_raw_StabilizerBase()) }.into_result()
}
// identifier: cv_videostab_StabilizerBase_setFrameSource_PtrOfIFrameSource_val
fn set_frame_source(&mut self, val: &types::PtrOfIFrameSource) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_setFrameSource_PtrOfIFrameSource_val(self.as_raw_StabilizerBase(), val.as_raw_PtrOfIFrameSource()) }.into_result()
}
// identifier: cv_videostab_StabilizerBase_frameSource_const
fn frame_source(&self) -> Result<types::PtrOfIFrameSource> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_frameSource_const(self.as_raw_StabilizerBase()) }.into_result().map(|x| types::PtrOfIFrameSource { ptr: x })
}
// identifier: cv_videostab_StabilizerBase_setMotionEstimator_PtrOfImageMotionEstimatorBase_val
fn set_motion_estimator(&mut self, val: &types::PtrOfImageMotionEstimatorBase) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_setMotionEstimator_PtrOfImageMotionEstimatorBase_val(self.as_raw_StabilizerBase(), val.as_raw_PtrOfImageMotionEstimatorBase()) }.into_result()
}
// identifier: cv_videostab_StabilizerBase_motionEstimator_const
fn motion_estimator(&self) -> Result<types::PtrOfImageMotionEstimatorBase> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_motionEstimator_const(self.as_raw_StabilizerBase()) }.into_result().map(|x| types::PtrOfImageMotionEstimatorBase { ptr: x })
}
// identifier: cv_videostab_StabilizerBase_setDeblurer_PtrOfDeblurerBase_val
fn set_deblurer(&mut self, val: &types::PtrOfDeblurerBase) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_setDeblurer_PtrOfDeblurerBase_val(self.as_raw_StabilizerBase(), val.as_raw_PtrOfDeblurerBase()) }.into_result()
}
// identifier: cv_videostab_StabilizerBase_deblurrer_const
fn deblurrer(&self) -> Result<types::PtrOfDeblurerBase> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_deblurrer_const(self.as_raw_StabilizerBase()) }.into_result().map(|x| types::PtrOfDeblurerBase { ptr: x })
}
// identifier: cv_videostab_StabilizerBase_setTrimRatio_float_val
fn set_trim_ratio(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_setTrimRatio_float_val(self.as_raw_StabilizerBase(), val) }.into_result()
}
// identifier: cv_videostab_StabilizerBase_trimRatio_const
fn trim_ratio(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_trimRatio_const(self.as_raw_StabilizerBase()) }.into_result()
}
// identifier: cv_videostab_StabilizerBase_setCorrectionForInclusion_bool_val
fn set_correction_for_inclusion(&mut self, val: bool) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_setCorrectionForInclusion_bool_val(self.as_raw_StabilizerBase(), val) }.into_result()
}
// identifier: cv_videostab_StabilizerBase_doCorrectionForInclusion_const
fn do_correction_for_inclusion(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_doCorrectionForInclusion_const(self.as_raw_StabilizerBase()) }.into_result()
}
// identifier: cv_videostab_StabilizerBase_setBorderMode_int_val
fn set_border_mode(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_setBorderMode_int_val(self.as_raw_StabilizerBase(), val) }.into_result()
}
// identifier: cv_videostab_StabilizerBase_borderMode_const
fn border_mode(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_borderMode_const(self.as_raw_StabilizerBase()) }.into_result()
}
// identifier: cv_videostab_StabilizerBase_setInpainter_PtrOfInpainterBase_val
fn set_inpainter(&mut self, val: &types::PtrOfInpainterBase) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_setInpainter_PtrOfInpainterBase_val(self.as_raw_StabilizerBase(), val.as_raw_PtrOfInpainterBase()) }.into_result()
}
// identifier: cv_videostab_StabilizerBase_inpainter_const
fn inpainter(&self) -> Result<types::PtrOfInpainterBase> {
unsafe { sys::cv_core_cv_videostab_StabilizerBase_inpainter_const(self.as_raw_StabilizerBase()) }.into_result().map(|x| types::PtrOfInpainterBase { ptr: x })
}
}
impl<'a> StabilizerBase + 'a {
}
// boxed class cv::videostab::ToFileMotionWriter
#[allow(dead_code)]
pub struct ToFileMotionWriter {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::ToFileMotionWriter {
fn drop(&mut self) {
unsafe { sys::cv_delete_ToFileMotionWriter(self.ptr) };
}
}
impl core::ToFileMotionWriter {
#[doc(hidden)] pub fn as_raw_ToFileMotionWriter(&self) -> *mut c_void { self.ptr }
}
impl core::ImageMotionEstimatorBase for ToFileMotionWriter {
#[doc(hidden)] fn as_raw_ImageMotionEstimatorBase(&self) -> *mut c_void { self.ptr }
}
impl ToFileMotionWriter {
// identifier: cv_videostab_ToFileMotionWriter_ToFileMotionWriter_String_path_PtrOfImageMotionEstimatorBase_estimator
pub fn new(path: &str, estimator: &types::PtrOfImageMotionEstimatorBase) -> Result<core::ToFileMotionWriter> {
string_arg!(path);
unsafe { sys::cv_core_cv_videostab_ToFileMotionWriter_ToFileMotionWriter_String_path_PtrOfImageMotionEstimatorBase_estimator(path.as_ptr(), estimator.as_raw_PtrOfImageMotionEstimatorBase()) }.into_result().map(|x| core::ToFileMotionWriter { ptr: x })
}
// identifier: cv_videostab_ToFileMotionWriter_estimate_Mat_frame0_Mat_frame1_bool_X_ok
///
/// ## C++ default parameters:
/// * ok: 0
pub fn estimate(&mut self, frame0: &core::Mat, frame1: &core::Mat, ok: &mut bool) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_ToFileMotionWriter_estimate_Mat_frame0_Mat_frame1_bool_X_ok(self.as_raw_ToFileMotionWriter(), frame0.as_raw_Mat(), frame1.as_raw_Mat(), ok) }.into_result().map(|x| core::Mat { ptr: x })
}
}
// boxed class cv::videostab::TranslationBasedLocalOutlierRejector
#[allow(dead_code)]
pub struct TranslationBasedLocalOutlierRejector {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::TranslationBasedLocalOutlierRejector {
fn drop(&mut self) {
unsafe { sys::cv_delete_TranslationBasedLocalOutlierRejector(self.ptr) };
}
}
impl core::TranslationBasedLocalOutlierRejector {
#[doc(hidden)] pub fn as_raw_TranslationBasedLocalOutlierRejector(&self) -> *mut c_void { self.ptr }
}
impl core::IOutlierRejector for TranslationBasedLocalOutlierRejector {
#[doc(hidden)] fn as_raw_IOutlierRejector(&self) -> *mut c_void { self.ptr }
}
impl TranslationBasedLocalOutlierRejector {
// identifier: cv_videostab_TranslationBasedLocalOutlierRejector_TranslationBasedLocalOutlierRejector
pub fn new() -> Result<core::TranslationBasedLocalOutlierRejector> {
unsafe { sys::cv_core_cv_videostab_TranslationBasedLocalOutlierRejector_TranslationBasedLocalOutlierRejector() }.into_result().map(|x| core::TranslationBasedLocalOutlierRejector { ptr: x })
}
// identifier: cv_videostab_TranslationBasedLocalOutlierRejector_setCellSize_Size_val
pub fn set_cell_size(&mut self, val: core::Size) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_TranslationBasedLocalOutlierRejector_setCellSize_Size_val(self.as_raw_TranslationBasedLocalOutlierRejector(), val) }.into_result()
}
// identifier: cv_videostab_TranslationBasedLocalOutlierRejector_cellSize_const
pub fn cell_size(&self) -> Result<core::Size> {
unsafe { sys::cv_core_cv_videostab_TranslationBasedLocalOutlierRejector_cellSize_const(self.as_raw_TranslationBasedLocalOutlierRejector()) }.into_result()
}
// identifier: cv_videostab_TranslationBasedLocalOutlierRejector_process_Size_frameSize_Mat_points0_Mat_points1_Mat_mask
pub fn process(&mut self, frame_size: core::Size, points0: &core::Mat, points1: &core::Mat, mask: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_TranslationBasedLocalOutlierRejector_process_Size_frameSize_Mat_points0_Mat_points1_Mat_mask(self.as_raw_TranslationBasedLocalOutlierRejector(), frame_size, points0.as_raw_Mat(), points1.as_raw_Mat(), mask.as_raw_Mat()) }.into_result()
}
}
// boxed class cv::videostab::TwoPassStabilizer
#[allow(dead_code)]
pub struct TwoPassStabilizer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::TwoPassStabilizer {
fn drop(&mut self) {
unsafe { sys::cv_delete_TwoPassStabilizer(self.ptr) };
}
}
impl core::TwoPassStabilizer {
#[doc(hidden)] pub fn as_raw_TwoPassStabilizer(&self) -> *mut c_void { self.ptr }
}
impl core::IFrameSource for TwoPassStabilizer {
#[doc(hidden)] fn as_raw_IFrameSource(&self) -> *mut c_void { self.ptr }
}
impl core::StabilizerBase for TwoPassStabilizer {
#[doc(hidden)] fn as_raw_StabilizerBase(&self) -> *mut c_void { self.ptr }
}
impl TwoPassStabilizer {
// identifier: cv_videostab_TwoPassStabilizer_TwoPassStabilizer
pub fn new() -> Result<core::TwoPassStabilizer> {
unsafe { sys::cv_core_cv_videostab_TwoPassStabilizer_TwoPassStabilizer() }.into_result().map(|x| core::TwoPassStabilizer { ptr: x })
}
// identifier: cv_videostab_TwoPassStabilizer_setMotionStabilizer_PtrOfIMotionStabilizer_val
pub fn set_motion_stabilizer(&mut self, val: &types::PtrOfIMotionStabilizer) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_TwoPassStabilizer_setMotionStabilizer_PtrOfIMotionStabilizer_val(self.as_raw_TwoPassStabilizer(), val.as_raw_PtrOfIMotionStabilizer()) }.into_result()
}
// identifier: cv_videostab_TwoPassStabilizer_motionStabilizer_const
pub fn motion_stabilizer(&self) -> Result<types::PtrOfIMotionStabilizer> {
unsafe { sys::cv_core_cv_videostab_TwoPassStabilizer_motionStabilizer_const(self.as_raw_TwoPassStabilizer()) }.into_result().map(|x| types::PtrOfIMotionStabilizer { ptr: x })
}
// identifier: cv_videostab_TwoPassStabilizer_setEstimateTrimRatio_bool_val
pub fn set_estimate_trim_ratio(&mut self, val: bool) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_TwoPassStabilizer_setEstimateTrimRatio_bool_val(self.as_raw_TwoPassStabilizer(), val) }.into_result()
}
// identifier: cv_videostab_TwoPassStabilizer_mustEstimateTrimaRatio_const
pub fn must_estimate_trima_ratio(&self) -> Result<bool> {
unsafe { sys::cv_core_cv_videostab_TwoPassStabilizer_mustEstimateTrimaRatio_const(self.as_raw_TwoPassStabilizer()) }.into_result()
}
// identifier: cv_videostab_TwoPassStabilizer_reset
pub fn reset(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_TwoPassStabilizer_reset(self.as_raw_TwoPassStabilizer()) }.into_result()
}
// identifier: cv_videostab_TwoPassStabilizer_nextFrame
pub fn next_frame(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_TwoPassStabilizer_nextFrame(self.as_raw_TwoPassStabilizer()) }.into_result().map(|x| core::Mat { ptr: x })
}
}
// boxed class cv::videostab::VideoFileSource
#[allow(dead_code)]
pub struct VideoFileSource {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::VideoFileSource {
fn drop(&mut self) {
unsafe { sys::cv_delete_VideoFileSource(self.ptr) };
}
}
impl core::VideoFileSource {
#[doc(hidden)] pub fn as_raw_VideoFileSource(&self) -> *mut c_void { self.ptr }
}
impl core::IFrameSource for VideoFileSource {
#[doc(hidden)] fn as_raw_IFrameSource(&self) -> *mut c_void { self.ptr }
}
impl VideoFileSource {
// identifier: cv_videostab_VideoFileSource_VideoFileSource_String_path_bool_volatileFrame
///
/// ## C++ default parameters:
/// * volatile_frame: false
pub fn new(path: &str, volatile_frame: bool) -> Result<core::VideoFileSource> {
string_arg!(path);
unsafe { sys::cv_core_cv_videostab_VideoFileSource_VideoFileSource_String_path_bool_volatileFrame(path.as_ptr(), volatile_frame) }.into_result().map(|x| core::VideoFileSource { ptr: x })
}
// identifier: cv_videostab_VideoFileSource_reset
pub fn reset(&mut self) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_VideoFileSource_reset(self.as_raw_VideoFileSource()) }.into_result()
}
// identifier: cv_videostab_VideoFileSource_nextFrame
pub fn next_frame(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_core_cv_videostab_VideoFileSource_nextFrame(self.as_raw_VideoFileSource()) }.into_result().map(|x| core::Mat { ptr: x })
}
// identifier: cv_videostab_VideoFileSource_width
pub fn width(&mut self) -> Result<i32> {
unsafe { sys::cv_core_cv_videostab_VideoFileSource_width(self.as_raw_VideoFileSource()) }.into_result()
}
// identifier: cv_videostab_VideoFileSource_height
pub fn height(&mut self) -> Result<i32> {
unsafe { sys::cv_core_cv_videostab_VideoFileSource_height(self.as_raw_VideoFileSource()) }.into_result()
}
// identifier: cv_videostab_VideoFileSource_count
pub fn count(&mut self) -> Result<i32> {
unsafe { sys::cv_core_cv_videostab_VideoFileSource_count(self.as_raw_VideoFileSource()) }.into_result()
}
// identifier: cv_videostab_VideoFileSource_fps
pub fn fps(&mut self) -> Result<f64> {
unsafe { sys::cv_core_cv_videostab_VideoFileSource_fps(self.as_raw_VideoFileSource()) }.into_result()
}
}
// boxed class cv::videostab::WeightingDeblurer
#[allow(dead_code)]
pub struct WeightingDeblurer {
#[doc(hidden)] pub ptr: *mut c_void
}
impl Drop for core::WeightingDeblurer {
fn drop(&mut self) {
unsafe { sys::cv_delete_WeightingDeblurer(self.ptr) };
}
}
impl core::WeightingDeblurer {
#[doc(hidden)] pub fn as_raw_WeightingDeblurer(&self) -> *mut c_void { self.ptr }
}
impl core::DeblurerBase for WeightingDeblurer {
#[doc(hidden)] fn as_raw_DeblurerBase(&self) -> *mut c_void { self.ptr }
}
impl WeightingDeblurer {
// identifier: cv_videostab_WeightingDeblurer_WeightingDeblurer
pub fn new() -> Result<core::WeightingDeblurer> {
unsafe { sys::cv_core_cv_videostab_WeightingDeblurer_WeightingDeblurer() }.into_result().map(|x| core::WeightingDeblurer { ptr: x })
}
// identifier: cv_videostab_WeightingDeblurer_setSensitivity_float_val
pub fn set_sensitivity(&mut self, val: f32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_WeightingDeblurer_setSensitivity_float_val(self.as_raw_WeightingDeblurer(), val) }.into_result()
}
// identifier: cv_videostab_WeightingDeblurer_sensitivity_const
pub fn sensitivity(&self) -> Result<f32> {
unsafe { sys::cv_core_cv_videostab_WeightingDeblurer_sensitivity_const(self.as_raw_WeightingDeblurer()) }.into_result()
}
// identifier: cv_videostab_WeightingDeblurer_deblur_int_idx_Mat_frame
pub fn deblur(&mut self, idx: i32, frame: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_WeightingDeblurer_deblur_int_idx_Mat_frame(self.as_raw_WeightingDeblurer(), idx, frame.as_raw_Mat()) }.into_result()
}
}
// Generating impl for trait cv::videostab::WobbleSuppressorBase (trait)
pub trait WobbleSuppressorBase {
#[doc(hidden)] fn as_raw_WobbleSuppressorBase(&self) -> *mut c_void;
// identifier: cv_videostab_WobbleSuppressorBase_setMotionEstimator_PtrOfImageMotionEstimatorBase_val
fn set_motion_estimator(&mut self, val: &types::PtrOfImageMotionEstimatorBase) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_WobbleSuppressorBase_setMotionEstimator_PtrOfImageMotionEstimatorBase_val(self.as_raw_WobbleSuppressorBase(), val.as_raw_PtrOfImageMotionEstimatorBase()) }.into_result()
}
// identifier: cv_videostab_WobbleSuppressorBase_motionEstimator_const
fn motion_estimator(&self) -> Result<types::PtrOfImageMotionEstimatorBase> {
unsafe { sys::cv_core_cv_videostab_WobbleSuppressorBase_motionEstimator_const(self.as_raw_WobbleSuppressorBase()) }.into_result().map(|x| types::PtrOfImageMotionEstimatorBase { ptr: x })
}
// identifier: cv_videostab_WobbleSuppressorBase_suppress_int_idx_Mat_frame_Mat_result
fn suppress(&mut self, idx: i32, frame: &core::Mat, result: &core::Mat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_WobbleSuppressorBase_suppress_int_idx_Mat_frame_Mat_result(self.as_raw_WobbleSuppressorBase(), idx, frame.as_raw_Mat(), result.as_raw_Mat()) }.into_result()
}
// identifier: cv_videostab_WobbleSuppressorBase_setFrameCount_int_val
fn set_frame_count(&mut self, val: i32) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_WobbleSuppressorBase_setFrameCount_int_val(self.as_raw_WobbleSuppressorBase(), val) }.into_result()
}
// identifier: cv_videostab_WobbleSuppressorBase_frameCount_const
fn frame_count(&self) -> Result<i32> {
unsafe { sys::cv_core_cv_videostab_WobbleSuppressorBase_frameCount_const(self.as_raw_WobbleSuppressorBase()) }.into_result()
}
// identifier: cv_videostab_WobbleSuppressorBase_setMotions_VectorOfMat_val
fn set_motions(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_WobbleSuppressorBase_setMotions_VectorOfMat_val(self.as_raw_WobbleSuppressorBase(), val.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_videostab_WobbleSuppressorBase_motions_const
fn motions(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_core_cv_videostab_WobbleSuppressorBase_motions_const(self.as_raw_WobbleSuppressorBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
// identifier: cv_videostab_WobbleSuppressorBase_setMotions2_VectorOfMat_val
fn set_motions2(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_WobbleSuppressorBase_setMotions2_VectorOfMat_val(self.as_raw_WobbleSuppressorBase(), val.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_videostab_WobbleSuppressorBase_motions2_const
fn motions2(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_core_cv_videostab_WobbleSuppressorBase_motions2_const(self.as_raw_WobbleSuppressorBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
// identifier: cv_videostab_WobbleSuppressorBase_setStabilizationMotions_VectorOfMat_val
fn set_stabilization_motions(&mut self, val: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_core_cv_videostab_WobbleSuppressorBase_setStabilizationMotions_VectorOfMat_val(self.as_raw_WobbleSuppressorBase(), val.as_raw_VectorOfMat()) }.into_result()
}
// identifier: cv_videostab_WobbleSuppressorBase_stabilizationMotions_const
fn stabilization_motions(&self) -> Result<types::VectorOfMat> {
unsafe { sys::cv_core_cv_videostab_WobbleSuppressorBase_stabilizationMotions_const(self.as_raw_WobbleSuppressorBase()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
}
impl<'a> WobbleSuppressorBase + 'a {
}