0.14.0 regenerate bindings
MODIFY
Cargo.toml
Cargo.toml
@@ -6,7 +6,7 @@ repository = "https://github.com/twistedfall/opencv-rust"
readme = "README.md"
keywords = [ "opencv", "vision" ]
license = "MIT"
-version = "0.13.1"
+version = "0.14.0"
edition = "2018"
authors = ["Mathieu Poumeyrol <kali@zoy.org>", "Pro <twisted.fall@gmail.com>"]
build = "build.rs"

MODIFY
src/hub/ccalib.rs
src/hub/ccalib.rs
@@ -476,6 +476,11 @@ impl MultiCameraCalibration {
unsafe { sys::cv_multicalib_MultiCameraCalibration_run(self.as_raw_MultiCameraCalibration()) }.into_result()
}
+ pub fn write_parameters(&mut self, filename: &str) -> Result<()> {
+ string_arg!(filename);
+ unsafe { sys::cv_multicalib_MultiCameraCalibration_writeParameters_std_string(self.as_raw_MultiCameraCalibration(), filename.as_ptr()) }.into_result()
+ }
+
}
// boxed class cv::multicalib::MultiCameraCalibration::edge

MODIFY
src/hub/core.rs
src/hub/core.rs
@@ -1234,6 +1234,11 @@ pub fn depth_to_string_(depth: i32) -> Result<String> {
unsafe { sys::cv_detail_depthToString__int(depth) }.into_result().map(crate::templ::receive_string)
}
+/// Returns string of cv::Mat depth value: CV_8UC3 -> "CV_8UC3" or cv::String()
+pub fn type_to_string_(_type: i32) -> Result<String> {
+ unsafe { sys::cv_detail_typeToString__int(_type) }.into_result().map(crate::templ::receive_string)
+}
+
/// Returns the determinant of a square floating-point matrix.
///
/// The function cv::determinant calculates and returns the determinant of the
@@ -1709,6 +1714,19 @@ pub fn get_build_information() -> Result<String> {
unsafe { sys::cv_getBuildInformation() }.into_result().map(crate::templ::receive_string)
}
+/// Returns list of CPU features enabled during compilation.
+///
+/// Returned value is a string containing space separated list of CPU features with following markers:
+///
+/// - no markers - baseline features
+/// - prefix `*` - features enabled in dispatcher
+/// - suffix `?` - features enabled but not available in HW
+///
+/// Example: `SSE SSE2 SSE3 *SSE4.1 *SSE4.2 *FP16 *AVX *AVX2 *AVX512-SKX?`
+pub fn get_cpu_features_line() -> Result<String> {
+ unsafe { sys::cv_getCPUFeaturesLine() }.into_result().map(crate::templ::receive_string_mut)
+}
+
/// Returns the number of CPU ticks.
///
/// The function returns the current number of CPU ticks on some architectures (such as x86, x64,
@@ -2948,6 +2966,71 @@ pub fn round_up_1(a: size_t, b: u32) -> Result<size_t> {
unsafe { sys::cv_roundUp_size_t_unsigned_int(a, b) }.into_result()
}
+/// Override search data path by adding new search location
+///
+/// Use this only to override default behavior
+/// Passed paths are used in LIFO order.
+///
+/// ## Parameters
+/// * path: Path to used samples data
+pub fn add_samples_data_search_path(path: &str) -> Result<()> {
+ string_arg!(path);
+ unsafe { sys::cv_samples_addSamplesDataSearchPath_String(path.as_ptr()) }.into_result()
+}
+
+/// Append samples search data sub directory
+///
+/// General usage is to add OpenCV modules name (`<opencv_contrib>/modules/<name>/samples/data` -> `<name>/samples/data` + `modules/<name>/samples/data`).
+/// Passed subdirectories are used in LIFO order.
+///
+/// ## Parameters
+/// * subdir: samples data sub directory
+pub fn add_samples_data_search_sub_directory(subdir: &str) -> Result<()> {
+ string_arg!(subdir);
+ unsafe { sys::cv_samples_addSamplesDataSearchSubDirectory_String(subdir.as_ptr()) }.into_result()
+}
+
+///
+/// ## C++ default parameters
+/// * silent_mode: false
+pub fn find_file_or_keep(relative_path: &str, silent_mode: bool) -> Result<String> {
+ string_arg!(relative_path);
+ unsafe { sys::cv_samples_findFileOrKeep_String_bool(relative_path.as_ptr(), silent_mode) }.into_result().map(crate::templ::receive_string_mut)
+}
+
+/// Try to find requested data file
+///
+/// Search directories:
+///
+/// 1. Directories passed via `addSamplesDataSearchPath()`
+/// 2. OPENCV_SAMPLES_DATA_PATH_HINT environment variable
+/// 3. OPENCV_SAMPLES_DATA_PATH environment variable
+/// If parameter value is not empty and nothing is found then stop searching.
+/// 4. Detects build/install path based on:
+/// a. current working directory (CWD)
+/// b. and/or binary module location (opencv_core/opencv_world, doesn't work with static linkage)
+/// 5. Scan `<source>/{,data,samples/data}` directories if build directory is detected or the current directory is in source tree.
+/// 6. Scan `<install>/share/OpenCV` directory if install directory is detected.
+///
+/// @see cv::utils::findDataFile
+///
+/// ## Parameters
+/// * relative_path: Relative path to data file
+/// * required: Specify "file not found" handling.
+/// If true, function prints information message and raises cv::Exception.
+/// If false, function returns empty result
+/// * silentMode: Disables messages
+/// ## Returns
+/// Returns path (absolute or relative to the current directory) or empty string if file is not found
+///
+/// ## C++ default parameters
+/// * required: true
+/// * silent_mode: false
+pub fn find_file(relative_path: &str, required: bool, silent_mode: bool) -> Result<String> {
+ string_arg!(relative_path);
+ unsafe { sys::cv_samples_findFile_String_bool_bool(relative_path.as_ptr(), required, silent_mode) }.into_result().map(crate::templ::receive_string_mut)
+}
+
/// 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
@@ -5453,6 +5536,11 @@ impl Mat {
unsafe { sys::cv_Mat_data(self.as_raw_Mat()) }.into_result().and_then(|x| unsafe { x.as_mut() }.ok_or_else(|| Error::new(core::StsNullPtr, format!("Function returned Null pointer"))))
}
+ /// pointer to the data
+ pub unsafe fn set_data(&mut self, val: &mut u8) -> Result<()> {
+ { sys::cv_Mat_set_data_uchar_X(self.as_raw_Mat(), val) }.into_result()
+ }
+
/// helper fields used in locateROI and adjustROI
pub fn datastart(&self) -> Result<&u8> {
unsafe { sys::cv_Mat_datastart_const(self.as_raw_Mat()) }.into_result().and_then(|x| unsafe { x.as_ref() }.ok_or_else(|| Error::new(core::StsNullPtr, format!("Function returned Null pointer"))))

MODIFY
src/hub/dnn.rs
src/hub/dnn.rs
@@ -155,6 +155,13 @@ pub fn clamp(ax: i32, dims: i32) -> Result<i32> {
unsafe { sys::cv_dnn_clamp_int_int(ax, dims) }.into_result()
}
+/// Returns Inference Engine VPU type.
+///
+/// See values of `CV_DNN_INFERENCE_ENGINE_VPU_TYPE_*` macros.
+pub fn get_inference_engine_vpu_type() -> Result<String> {
+ unsafe { sys::cv_dnn_getInferenceEngineVPUType() }.into_result().map(crate::templ::receive_string_mut)
+}
+
pub fn get_plane(m: &core::Mat, n: i32, cn: i32) -> Result<core::Mat> {
unsafe { sys::cv_dnn_getPlane_Mat_int_int(m.as_raw_Mat(), n, cn) }.into_result().map(|x| core::Mat { ptr: x })
}
@@ -1672,16 +1679,32 @@ impl LayerParams {
unsafe { sys::cv_dnn_LayerParams_blobs(self.as_raw_LayerParams()) }.into_result().map(|x| types::VectorOfMat { ptr: x })
}
+ pub fn set_blobs(&mut self, val: &types::VectorOfMat) -> Result<()> {
+ unsafe { sys::cv_dnn_LayerParams_set_blobs_VectorOfMat(self.as_raw_LayerParams(), val.as_raw_VectorOfMat()) }.into_result()
+ }
+
/// < List of learned parameters stored as blobs.
pub fn name(&mut self) -> Result<String> {
unsafe { sys::cv_dnn_LayerParams_name(self.as_raw_LayerParams()) }.into_result().map(crate::templ::receive_string_mut)
}
+ /// < List of learned parameters stored as blobs.
+ pub fn set_name(&mut self, val: &str) -> Result<()> {
+ string_arg!(mut val);
+ unsafe { sys::cv_dnn_LayerParams_set_name_String(self.as_raw_LayerParams(), val.as_ptr() as _) }.into_result()
+ }
+
/// < Name of the layer instance (optional, can be used internal purposes).
pub fn _type(&mut self) -> Result<String> {
unsafe { sys::cv_dnn_LayerParams_type(self.as_raw_LayerParams()) }.into_result().map(crate::templ::receive_string_mut)
}
+ /// < Name of the layer instance (optional, can be used internal purposes).
+ pub fn set_type(&mut self, val: &str) -> Result<()> {
+ string_arg!(mut val);
+ unsafe { sys::cv_dnn_LayerParams_set_type_String(self.as_raw_LayerParams(), val.as_ptr() as _) }.into_result()
+ }
+
}
// boxed class cv::dnn::MVNLayer

MODIFY
src/hub/features2d.rs
src/hub/features2d.rs
@@ -1159,7 +1159,7 @@ pub trait Feature2D : core::Algorithm {
///
/// ## C++ default parameters
/// * masks: noArray()
- fn detect_n(&mut self, images: &types::VectorOfMat, keypoints: &mut types::VectorOfVectorOfKeyPoint, masks: &types::VectorOfMat) -> Result<()> {
+ fn detect_multiple(&mut self, images: &types::VectorOfMat, keypoints: &mut types::VectorOfVectorOfKeyPoint, masks: &types::VectorOfMat) -> Result<()> {
unsafe { sys::cv_Feature2D_detect_VectorOfMat_VectorOfVectorOfKeyPoint_VectorOfMat(self.as_raw_Feature2D(), images.as_raw_VectorOfMat(), keypoints.as_raw_VectorOfVectorOfKeyPoint(), masks.as_raw_VectorOfMat()) }.into_result()
}
@@ -1842,3 +1842,4 @@ impl SimpleBlobDetector_Params {
}
+pub use crate::hub::manual::features2d::*;

MODIFY
src/hub/imgproc.rs
src/hub/imgproc.rs
@@ -3219,7 +3219,7 @@ pub fn good_features_to_track(image: &core::Mat, corners: &mut core::Mat, max_co
/// ## 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<()> {
+pub fn good_features_to_track_with_gradient(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_goodFeaturesToTrack_Mat_Mat_int_double_double_Mat_int_int_bool_double(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()
}
@@ -5096,7 +5096,7 @@ impl Subdiv2D {
///
/// 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<()> {
+ pub fn insert_multiple(&mut self, ptvec: &types::VectorOfPoint2f) -> Result<()> {
unsafe { sys::cv_Subdiv2D_insert_VectorOfPoint2f(self.as_raw_Subdiv2D(), ptvec.as_raw_VectorOfPoint2f()) }.into_result()
}

MODIFY
src/hub/objdetect.rs
src/hub/objdetect.rs
@@ -72,6 +72,22 @@ pub fn create_face_detection_mask_generator() -> Result<types::PtrOfMaskGenerato
unsafe { sys::cv_createFaceDetectionMaskGenerator() }.into_result().map(|x| types::PtrOfMaskGenerator { ptr: x })
}
+/// Decode QR code in image and return text that is encrypted in QR code.
+/// ## Parameters
+/// * in: Matrix of the type CV_8UC1 containing an image where QR code are detected.
+/// * points: Input vector of vertices of a quadrangle of minimal area that describes QR code.
+/// * decoded_info: String information that is encrypted in QR code.
+/// * straight_qrcode: Matrix of the type CV_8UC1 containing an binary straight QR code.
+///
+/// ## C++ default parameters
+/// * straight_qrcode: noArray()
+pub fn decode_qr_code(_in: &core::Mat, points: &types::VectorOfPoint, decoded_info: &mut String, straight_qrcode: &mut core::Mat) -> Result<bool> {
+ string_arg_output_send!(via decoded_info_via);
+ let out = unsafe { sys::cv_decodeQRCode_Mat_VectorOfPoint_std_string_Mat(_in.as_raw_Mat(), points.as_raw_VectorOfPoint(), &mut decoded_info_via, straight_qrcode.as_raw_Mat()) }.into_result();
+ string_arg_output_receive!(decoded_info_via => decoded_info);
+ return out;
+}
+
/// 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.
@@ -130,7 +146,7 @@ pub fn group_rectangles_levels(rect_list: &mut types::VectorOfRect, reject_level
///
/// ## C++ default parameters
/// * eps: 0.2
-pub fn group_rectangle_weights(rect_list: &mut types::VectorOfRect, weights: &mut types::VectorOfint, group_threshold: i32, eps: f64) -> Result<()> {
+pub fn group_rectangles_weights(rect_list: &mut types::VectorOfRect, weights: &mut types::VectorOfint, group_threshold: i32, eps: f64) -> Result<()> {
unsafe { sys::cv_groupRectangles_VectorOfRect_VectorOfint_int_double(rect_list.as_raw_VectorOfRect(), weights.as_raw_VectorOfint(), group_threshold, eps) }.into_result()
}
@@ -152,7 +168,7 @@ pub fn group_rectangle_weights(rect_list: &mut types::VectorOfRect, weights: &mu
///
/// ## C++ default parameters
/// * eps: 0.2
-pub fn group_rectangle(rect_list: &mut types::VectorOfRect, group_threshold: i32, eps: f64) -> Result<()> {
+pub fn group_rectangles(rect_list: &mut types::VectorOfRect, group_threshold: i32, eps: f64) -> Result<()> {
unsafe { sys::cv_groupRectangles_VectorOfRect_int_double(rect_list.as_raw_VectorOfRect(), group_threshold, eps) }.into_result()
}
@@ -173,7 +189,7 @@ pub fn group_rectangle(rect_list: &mut types::VectorOfRect, group_threshold: i32
/// cluster, the average rectangle is computed and put into the output rectangle list.
///
/// ## Overloaded parameters
-pub fn group_rectangle_levelweights(rect_list: &mut types::VectorOfRect, group_threshold: i32, eps: f64, weights: &mut types::VectorOfint, level_weights: &mut types::VectorOfdouble) -> Result<()> {
+pub fn group_rectangles_levelweights(rect_list: &mut types::VectorOfRect, group_threshold: i32, eps: f64, weights: &mut types::VectorOfint, level_weights: &mut types::VectorOfdouble) -> Result<()> {
unsafe { sys::cv_groupRectangles_VectorOfRect_int_double_VectorOfint_VectorOfdouble(rect_list.as_raw_VectorOfRect(), group_threshold, eps, weights.as_raw_VectorOfint(), level_weights.as_raw_VectorOfdouble()) }.into_result()
}
@@ -660,7 +676,7 @@ impl HOGDescriptor {
/// 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<()> {
+ pub fn set_svm_detector_mat(&mut self, _svmdetector: &core::Mat) -> Result<()> {
unsafe { sys::cv_HOGDescriptor_setSVMDetector_Mat(self.as_raw_HOGDescriptor(), _svmdetector.as_raw_Mat()) }.into_result()
}
@@ -934,6 +950,16 @@ impl HOGDescriptor {
unsafe { sys::cv_HOGDescriptor_gammaCorrection_const(self.as_raw_HOGDescriptor()) }.into_result()
}
+ /// coefficients for the linear SVM classifier.
+ pub fn svm_detector(&mut self) -> Result<types::VectorOffloat> {
+ unsafe { sys::cv_HOGDescriptor_svmDetector(self.as_raw_HOGDescriptor()) }.into_result().map(|x| types::VectorOffloat { ptr: x })
+ }
+
+ /// coefficients for the linear SVM classifier.
+ pub fn set_svm_detector(&mut self, val: &types::VectorOffloat) -> Result<()> {
+ unsafe { sys::cv_HOGDescriptor_set_svmDetector_VectorOffloat(self.as_raw_HOGDescriptor(), val.as_raw_VectorOffloat()) }.into_result()
+ }
+
/// Maximum number of detection window increases. Default value is 64
pub fn nlevels(&self) -> Result<i32> {
unsafe { sys::cv_HOGDescriptor_nlevels_const(self.as_raw_HOGDescriptor()) }.into_result()
@@ -991,8 +1017,36 @@ impl QRCodeDetector {
/// ## 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_QRCodeDetector_detect_const_Mat_Mat(self.as_raw_QRCodeDetector(), img.as_raw_Mat(), points.as_raw_Mat()) }.into_result()
+ pub fn detect(&self, img: &core::Mat, points: &mut types::VectorOfPoint) -> Result<bool> {
+ unsafe { sys::cv_QRCodeDetector_detect_const_Mat_VectorOfPoint(self.as_raw_QRCodeDetector(), img.as_raw_Mat(), points.as_raw_VectorOfPoint()) }.into_result()
+ }
+
+ /// Decodes QR code in image once it's found by the detect() method.
+ /// Returns UTF8-encoded output string or empty string if the code cannot be decoded.
+ ///
+ /// ## Parameters
+ /// * img: grayscale or color (BGR) image containing QR code.
+ /// * points: Quadrangle vertices found by detect() method (or some other algorithm).
+ /// * straight_qrcode: The optional output image containing rectified and binarized QR code
+ ///
+ /// ## C++ default parameters
+ /// * straight_qrcode: noArray()
+ pub fn decode(&mut self, img: &core::Mat, points: &types::VectorOfPoint, straight_qrcode: &mut core::Mat) -> Result<String> {
+ unsafe { sys::cv_QRCodeDetector_decode_Mat_VectorOfPoint_Mat(self.as_raw_QRCodeDetector(), img.as_raw_Mat(), points.as_raw_VectorOfPoint(), straight_qrcode.as_raw_Mat()) }.into_result().map(crate::templ::receive_string_mut)
+ }
+
+ /// Both detects and decodes QR code
+ ///
+ /// ## Parameters
+ /// * img: grayscale or color (BGR) image containing QR code.
+ /// * points: opiotnal output array of vertices of the found QR code quadrangle. Will be empty if not found.
+ /// * straight_qrcode: The optional output image containing rectified and binarized QR code
+ ///
+ /// ## C++ default parameters
+ /// * points: noArray()
+ /// * straight_qrcode: noArray()
+ pub fn detect_and_decode(&mut self, img: &core::Mat, points: &mut types::VectorOfPoint, straight_qrcode: &mut core::Mat) -> Result<String> {
+ unsafe { sys::cv_QRCodeDetector_detectAndDecode_Mat_VectorOfPoint_Mat(self.as_raw_QRCodeDetector(), img.as_raw_Mat(), points.as_raw_VectorOfPoint(), straight_qrcode.as_raw_Mat()) }.into_result().map(crate::templ::receive_string_mut)
}
}

MODIFY
src/hub/sys.rs
src/hub/sys.rs
@@ -128,6 +128,7 @@ pub fn cv_cv_abs_ushort(x: u16) -> cv_return_value_int;
pub fn cv_dct_Mat_Mat_int(src: *mut c_void, dst: *mut c_void, flags: i32) -> cv_return_value_void;
pub fn cv_depthToString_int(depth: i32) -> cv_return_value_const_char_X;
pub fn cv_detail_depthToString__int(depth: i32) -> cv_return_value_const_char_X;
+pub fn cv_detail_typeToString__int(_type: i32) -> cv_return_value_const_char_X;
pub fn cv_determinant_Mat(mtx: *mut c_void) -> cv_return_value_double;
pub fn cv_dft_Mat_Mat_int_int(src: *mut c_void, dst: *mut c_void, flags: i32, nonzero_rows: i32) -> cv_return_value_void;
pub fn cv_directx_getTypeFromD3DFORMAT_int(i_d3_dformat: i32) -> cv_return_value_int;
@@ -146,6 +147,7 @@ pub fn cv_findNonZero_Mat_Mat(src: *mut c_void, idx: *mut c_void) -> cv_return_v
pub fn cv_flip_Mat_Mat_int(src: *mut c_void, dst: *mut c_void, flip_code: i32) -> cv_return_value_void;
pub fn cv_gemm_Mat_Mat_double_Mat_double_Mat_int(src1: *mut c_void, src2: *mut c_void, alpha: f64, src3: *mut c_void, beta: f64, dst: *mut c_void, flags: i32) -> cv_return_value_void;
pub fn cv_getBuildInformation() -> cv_return_value_const_char_X;
+pub fn cv_getCPUFeaturesLine() -> cv_return_value_char_X;
pub fn cv_getCPUTickCount() -> cv_return_value_int64;
pub fn cv_getElemSize_int(_type: i32) -> cv_return_value_std_size_t;
pub fn cv_getHardwareFeatureName_int(feature: i32) -> cv_return_value_char_X;
@@ -216,6 +218,10 @@ pub fn cv_repeat_Mat_int_int_Mat(src: *mut c_void, ny: i32, nx: i32, dst: *mut c
pub fn cv_rotate_Mat_Mat_int(src: *mut c_void, dst: *mut c_void, rotate_code: i32) -> cv_return_value_void;
pub fn cv_roundUp_int_unsigned_int(a: i32, b: u32) -> cv_return_value_int;
pub fn cv_roundUp_size_t_unsigned_int(a: size_t, b: u32) -> cv_return_value_std_size_t;
+pub fn cv_samples_addSamplesDataSearchPath_String(path: *const c_char) -> cv_return_value_void;
+pub fn cv_samples_addSamplesDataSearchSubDirectory_String(subdir: *const c_char) -> cv_return_value_void;
+pub fn cv_samples_findFileOrKeep_String_bool(relative_path: *const c_char, silent_mode: bool) -> cv_return_value_char_X;
+pub fn cv_samples_findFile_String_bool_bool(relative_path: *const c_char, required: bool, silent_mode: bool) -> cv_return_value_char_X;
pub fn cv_scaleAdd_Mat_double_Mat_Mat(src1: *mut c_void, alpha: f64, src2: *mut c_void, dst: *mut c_void) -> cv_return_value_void;
pub fn cv_setBreakOnError_bool(flag: bool) -> cv_return_value_bool;
pub fn cv_setIdentity_Mat_Scalar(mtx: *mut c_void, s: core::Scalar) -> cv_return_value_void;
@@ -378,6 +384,7 @@ pub fn cv_Mat_dims_const(instance: *const c_void) -> cv_return_value_int;
pub fn cv_Mat_rows_const(instance: *const c_void) -> cv_return_value_int;
pub fn cv_Mat_cols_const(instance: *const c_void) -> cv_return_value_int;
pub fn cv_Mat_data(instance: *mut c_void) -> cv_return_value_unsigned_char_X;
+pub fn cv_Mat_set_data_uchar_X(instance: *mut c_void, val: *mut u8) -> cv_return_value_void;
pub fn cv_Mat_datastart_const(instance: *const c_void) -> cv_return_value_const_unsigned_char_X;
pub fn cv_Mat_dataend_const(instance: *const c_void) -> cv_return_value_const_unsigned_char_X;
pub fn cv_Mat_datalimit_const(instance: *const c_void) -> cv_return_value_const_unsigned_char_X;
@@ -666,6 +673,7 @@ pub fn cv_multicalib_MultiCameraCalibration_loadImages(instance: *mut c_void) ->
pub fn cv_multicalib_MultiCameraCalibration_initialize(instance: *mut c_void) -> cv_return_value_void;
pub fn cv_multicalib_MultiCameraCalibration_optimizeExtrinsics(instance: *mut c_void) -> cv_return_value_double;
pub fn cv_multicalib_MultiCameraCalibration_run(instance: *mut c_void) -> cv_return_value_double;
+pub fn cv_multicalib_MultiCameraCalibration_writeParameters_std_string(instance: *mut c_void, filename: *const c_char) -> cv_return_value_void;
#[doc(hidden)] pub fn cv_MultiCameraCalibration_edge_delete(ptr : *mut c_void);
pub fn cv_multicalib_MultiCameraCalibration_edge_edge_int_int_int_Mat(cv: i32, pv: i32, pi: i32, trans: *mut c_void) -> cv_return_value_void_X;
#[doc(hidden)] pub fn cv_MultiCameraCalibration_vertex_delete(ptr : *mut c_void);
@@ -735,6 +743,7 @@ pub fn cv_dnn_blobFromImages_VectorOfMat_Mat_double_Size_Scalar_bool_bool_int(im
pub fn cv_dnn_blobFromImages_VectorOfMat_double_Size_Scalar_bool_bool_int(images: *mut c_void, scalefactor: f64, size: core::Size, mean: core::Scalar, swap_rb: bool, crop: bool, ddepth: i32) -> cv_return_value_void_X;
pub fn cv_dnn_clamp_Range_int(r: *mut c_void, axis_size: i32) -> cv_return_value_void_X;
pub fn cv_dnn_clamp_int_int(ax: i32, dims: i32) -> cv_return_value_int;
+pub fn cv_dnn_getInferenceEngineVPUType() -> cv_return_value_char_X;
pub fn cv_dnn_getPlane_Mat_int_int(m: *mut c_void, n: i32, cn: i32) -> cv_return_value_void_X;
pub fn cv_dnn_imagesFromBlob_Mat_VectorOfMat(blob_: *mut c_void, images_: *mut c_void) -> cv_return_value_void;
pub fn cv_dnn_readNetFromCaffe_String_String(prototxt: *const c_char, caffe_model: *const c_char) -> cv_return_value_void_X;
@@ -841,8 +850,11 @@ pub fn cv_dnn_LayerFactory_unregisterLayer_String(_type: *const c_char) -> cv_re
#[doc(hidden)] pub fn cv_LayerParams_delete(ptr : *mut c_void);
pub fn cv_dnn_LayerParams_LayerParams() -> cv_return_value_void_X;
pub fn cv_dnn_LayerParams_blobs(instance: *mut c_void) -> cv_return_value_void_X;
+pub fn cv_dnn_LayerParams_set_blobs_VectorOfMat(instance: *mut c_void, val: *mut c_void) -> cv_return_value_void;
pub fn cv_dnn_LayerParams_name(instance: *mut c_void) -> cv_return_value_char_X;
+pub fn cv_dnn_LayerParams_set_name_String(instance: *mut c_void, val: *mut c_char) -> cv_return_value_void;
pub fn cv_dnn_LayerParams_type(instance: *mut c_void) -> cv_return_value_char_X;
+pub fn cv_dnn_LayerParams_set_type_String(instance: *mut c_void, val: *mut c_char) -> cv_return_value_void;
#[doc(hidden)] pub fn cv_MVNLayer_delete(ptr : *mut c_void);
pub fn cv_dnn_MVNLayer_create_LayerParams(params: *mut c_void) -> cv_return_value_void_X;
#[doc(hidden)] pub fn cv_MaxUnpoolLayer_delete(ptr : *mut c_void);
@@ -1670,6 +1682,7 @@ pub fn cv_ml_TrainData_create_Mat_int_Mat_Mat_Mat_Mat_Mat(samples: *mut c_void,
}
extern "C" {
pub fn cv_createFaceDetectionMaskGenerator() -> cv_return_value_void_X;
+pub fn cv_decodeQRCode_Mat_VectorOfPoint_std_string_Mat(_in: *mut c_void, points: *mut c_void, decoded_info: *mut *mut c_char, straight_qrcode: *mut c_void) -> cv_return_value_bool;
pub fn cv_detectQRCode_Mat_VectorOfPoint_double_double(_in: *mut c_void, points: *mut c_void, eps_x: f64, eps_y: f64) -> cv_return_value_bool;
pub fn cv_groupRectangles_VectorOfRect_VectorOfint_VectorOfdouble_int_double(rect_list: *mut c_void, reject_levels: *mut c_void, level_weights: *mut c_void, group_threshold: i32, eps: f64) -> cv_return_value_void;
pub fn cv_groupRectangles_VectorOfRect_VectorOfint_int_double(rect_list: *mut c_void, weights: *mut c_void, group_threshold: i32, eps: f64) -> cv_return_value_void;
@@ -1759,13 +1772,17 @@ pub fn cv_HOGDescriptor_winSigma_const(instance: *const c_void) -> cv_return_val
pub fn cv_HOGDescriptor_histogramNormType_const(instance: *const c_void) -> cv_return_value_int;
pub fn cv_HOGDescriptor_L2HysThreshold_const(instance: *const c_void) -> cv_return_value_double;
pub fn cv_HOGDescriptor_gammaCorrection_const(instance: *const c_void) -> cv_return_value_bool;
+pub fn cv_HOGDescriptor_svmDetector(instance: *mut c_void) -> cv_return_value_void_X;
+pub fn cv_HOGDescriptor_set_svmDetector_VectorOffloat(instance: *mut c_void, val: *mut c_void) -> cv_return_value_void;
pub fn cv_HOGDescriptor_nlevels_const(instance: *const c_void) -> cv_return_value_int;
pub fn cv_HOGDescriptor_signedGradient_const(instance: *const c_void) -> cv_return_value_bool;
#[doc(hidden)] pub fn cv_QRCodeDetector_delete(ptr : *mut c_void);
pub fn cv_QRCodeDetector_QRCodeDetector() -> cv_return_value_void_X;
pub fn cv_QRCodeDetector_setEpsX_double(instance: *mut c_void, eps_x: f64) -> cv_return_value_void;
pub fn cv_QRCodeDetector_setEpsY_double(instance: *mut c_void, eps_y: f64) -> cv_return_value_void;
-pub fn cv_QRCodeDetector_detect_const_Mat_Mat(instance: *const c_void, img: *mut c_void, points: *mut c_void) -> cv_return_value_bool;
+pub fn cv_QRCodeDetector_detect_const_Mat_VectorOfPoint(instance: *const c_void, img: *mut c_void, points: *mut c_void) -> cv_return_value_bool;
+pub fn cv_QRCodeDetector_decode_Mat_VectorOfPoint_Mat(instance: *mut c_void, img: *mut c_void, points: *mut c_void, straight_qrcode: *mut c_void) -> cv_return_value_char_X;
+pub fn cv_QRCodeDetector_detectAndDecode_Mat_VectorOfPoint_Mat(instance: *mut c_void, img: *mut c_void, points: *mut c_void, straight_qrcode: *mut c_void) -> cv_return_value_char_X;
#[doc(hidden)] pub fn cv_SimilarRects_delete(ptr : *mut c_void);
}
extern "C" {
@@ -2109,15 +2126,25 @@ pub fn cv_KalmanFilter_init_int_int_int_int(instance: *mut c_void, dynam_params:
pub fn cv_KalmanFilter_predict_Mat(instance: *mut c_void, control: *mut c_void) -> cv_return_value_void_X;
pub fn cv_KalmanFilter_correct_Mat(instance: *mut c_void, measurement: *mut c_void) -> cv_return_value_void_X;
pub fn cv_KalmanFilter_statePre(instance: *mut c_void) -> cv_return_value_void_X;
+pub fn cv_KalmanFilter_set_statePre_Mat(instance: *mut c_void, val: *mut c_void) -> cv_return_value_void;
pub fn cv_KalmanFilter_statePost(instance: *mut c_void) -> cv_return_value_void_X;
+pub fn cv_KalmanFilter_set_statePost_Mat(instance: *mut c_void, val: *mut c_void) -> cv_return_value_void;
pub fn cv_KalmanFilter_transitionMatrix(instance: *mut c_void) -> cv_return_value_void_X;
+pub fn cv_KalmanFilter_set_transitionMatrix_Mat(instance: *mut c_void, val: *mut c_void) -> cv_return_value_void;
pub fn cv_KalmanFilter_controlMatrix(instance: *mut c_void) -> cv_return_value_void_X;
+pub fn cv_KalmanFilter_set_controlMatrix_Mat(instance: *mut c_void, val: *mut c_void) -> cv_return_value_void;
pub fn cv_KalmanFilter_measurementMatrix(instance: *mut c_void) -> cv_return_value_void_X;
+pub fn cv_KalmanFilter_set_measurementMatrix_Mat(instance: *mut c_void, val: *mut c_void) -> cv_return_value_void;
pub fn cv_KalmanFilter_processNoiseCov(instance: *mut c_void) -> cv_return_value_void_X;
+pub fn cv_KalmanFilter_set_processNoiseCov_Mat(instance: *mut c_void, val: *mut c_void) -> cv_return_value_void;
pub fn cv_KalmanFilter_measurementNoiseCov(instance: *mut c_void) -> cv_return_value_void_X;
+pub fn cv_KalmanFilter_set_measurementNoiseCov_Mat(instance: *mut c_void, val: *mut c_void) -> cv_return_value_void;
pub fn cv_KalmanFilter_errorCovPre(instance: *mut c_void) -> cv_return_value_void_X;
+pub fn cv_KalmanFilter_set_errorCovPre_Mat(instance: *mut c_void, val: *mut c_void) -> cv_return_value_void;
pub fn cv_KalmanFilter_gain(instance: *mut c_void) -> cv_return_value_void_X;
+pub fn cv_KalmanFilter_set_gain_Mat(instance: *mut c_void, val: *mut c_void) -> cv_return_value_void;
pub fn cv_KalmanFilter_errorCovPost(instance: *mut c_void) -> cv_return_value_void_X;
+pub fn cv_KalmanFilter_set_errorCovPost_Mat(instance: *mut c_void, val: *mut c_void) -> cv_return_value_void;
pub fn cv_SparseOpticalFlow_calc_Mat_Mat_Mat_Mat_Mat_Mat(instance: *mut c_void, prev_img: *mut c_void, next_img: *mut c_void, prev_pts: *mut c_void, next_pts: *mut c_void, status: *mut c_void, err: *mut c_void) -> cv_return_value_void;
pub fn cv_SparsePyrLKOpticalFlow_getWinSize_const(instance: *const c_void) -> cv_return_value_SizeWrapper;
pub fn cv_SparsePyrLKOpticalFlow_setWinSize_Size(instance: *mut c_void, win_size: core::Size) -> cv_return_value_void;

MODIFY
src/hub/video.rs
src/hub/video.rs
@@ -1099,51 +1099,100 @@ impl KalmanFilter {
unsafe { sys::cv_KalmanFilter_statePre(self.as_raw_KalmanFilter()) }.into_result().map(|x| core::Mat { ptr: x })
}
+ pub fn set_state_pre(&mut self, val: &core::Mat) -> Result<()> {
+ unsafe { sys::cv_KalmanFilter_set_statePre_Mat(self.as_raw_KalmanFilter(), val.as_raw_Mat()) }.into_result()
+ }
+
/// < predicted state (x'(k)): x(k)=A*x(k-1)+B*u(k)
pub fn state_post(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_KalmanFilter_statePost(self.as_raw_KalmanFilter()) }.into_result().map(|x| core::Mat { ptr: x })
}
+ /// < predicted state (x'(k)): x(k)=A*x(k-1)+B*u(k)
+ pub fn set_state_post(&mut self, val: &core::Mat) -> Result<()> {
+ unsafe { sys::cv_KalmanFilter_set_statePost_Mat(self.as_raw_KalmanFilter(), val.as_raw_Mat()) }.into_result()
+ }
+
/// < corrected state (x(k)): x(k)=x'(k)+K(k)*(z(k)-H*x'(k))
pub fn transition_matrix(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_KalmanFilter_transitionMatrix(self.as_raw_KalmanFilter()) }.into_result().map(|x| core::Mat { ptr: x })
}
+ /// < corrected state (x(k)): x(k)=x'(k)+K(k)*(z(k)-H*x'(k))
+ pub fn set_transition_matrix(&mut self, val: &core::Mat) -> Result<()> {
+ unsafe { sys::cv_KalmanFilter_set_transitionMatrix_Mat(self.as_raw_KalmanFilter(), val.as_raw_Mat()) }.into_result()
+ }
+
/// < state transition matrix (A)
pub fn control_matrix(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_KalmanFilter_controlMatrix(self.as_raw_KalmanFilter()) }.into_result().map(|x| core::Mat { ptr: x })
}
+ /// < state transition matrix (A)
+ pub fn set_control_matrix(&mut self, val: &core::Mat) -> Result<()> {
+ unsafe { sys::cv_KalmanFilter_set_controlMatrix_Mat(self.as_raw_KalmanFilter(), val.as_raw_Mat()) }.into_result()
+ }
+
/// < control matrix (B) (not used if there is no control)
pub fn measurement_matrix(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_KalmanFilter_measurementMatrix(self.as_raw_KalmanFilter()) }.into_result().map(|x| core::Mat { ptr: x })
}
+ /// < control matrix (B) (not used if there is no control)
+ pub fn set_measurement_matrix(&mut self, val: &core::Mat) -> Result<()> {
+ unsafe { sys::cv_KalmanFilter_set_measurementMatrix_Mat(self.as_raw_KalmanFilter(), val.as_raw_Mat()) }.into_result()
+ }
+
/// < measurement matrix (H)
pub fn process_noise_cov(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_KalmanFilter_processNoiseCov(self.as_raw_KalmanFilter()) }.into_result().map(|x| core::Mat { ptr: x })
}
+ /// < measurement matrix (H)
+ pub fn set_process_noise_cov(&mut self, val: &core::Mat) -> Result<()> {
+ unsafe { sys::cv_KalmanFilter_set_processNoiseCov_Mat(self.as_raw_KalmanFilter(), val.as_raw_Mat()) }.into_result()
+ }
+
/// < process noise covariance matrix (Q)
pub fn measurement_noise_cov(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_KalmanFilter_measurementNoiseCov(self.as_raw_KalmanFilter()) }.into_result().map(|x| core::Mat { ptr: x })
}
+ /// < process noise covariance matrix (Q)
+ pub fn set_measurement_noise_cov(&mut self, val: &core::Mat) -> Result<()> {
+ unsafe { sys::cv_KalmanFilter_set_measurementNoiseCov_Mat(self.as_raw_KalmanFilter(), val.as_raw_Mat()) }.into_result()
+ }
+
/// < measurement noise covariance matrix (R)
pub fn error_cov_pre(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_KalmanFilter_errorCovPre(self.as_raw_KalmanFilter()) }.into_result().map(|x| core::Mat { ptr: x })
}
+ /// < measurement noise covariance matrix (R)
+ pub fn set_error_cov_pre(&mut self, val: &core::Mat) -> Result<()> {
+ unsafe { sys::cv_KalmanFilter_set_errorCovPre_Mat(self.as_raw_KalmanFilter(), val.as_raw_Mat()) }.into_result()
+ }
+
/// < priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)*At + Q)*/
pub fn gain(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_KalmanFilter_gain(self.as_raw_KalmanFilter()) }.into_result().map(|x| core::Mat { ptr: x })
}
+ /// < priori error estimate covariance matrix (P'(k)): P'(k)=A*P(k-1)*At + Q)*/
+ pub fn set_gain(&mut self, val: &core::Mat) -> Result<()> {
+ unsafe { sys::cv_KalmanFilter_set_gain_Mat(self.as_raw_KalmanFilter(), val.as_raw_Mat()) }.into_result()
+ }
+
/// < Kalman gain matrix (K(k)): K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R)
pub fn error_cov_post(&mut self) -> Result<core::Mat> {
unsafe { sys::cv_KalmanFilter_errorCovPost(self.as_raw_KalmanFilter()) }.into_result().map(|x| core::Mat { ptr: x })
}
+ /// < Kalman gain matrix (K(k)): K(k)=P'(k)*Ht*inv(H*P'(k)*Ht+R)
+ pub fn set_error_cov_post(&mut self, val: &core::Mat) -> Result<()> {
+ unsafe { sys::cv_KalmanFilter_set_errorCovPost_Mat(self.as_raw_KalmanFilter(), val.as_raw_Mat()) }.into_result()
+ }
+
}
// Generating impl for trait cv::SparseOpticalFlow (trait)

0.14.0 regenerate bindings