0.10.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.9.0"
+version = "0.10.0"
edition = "2018"
authors = ["Mathieu Poumeyrol <kali@zoy.org>"]
build = "build.rs"

MODIFY
src/hub/calib3d.rs
src/hub/calib3d.rs
@@ -1925,7 +1925,7 @@ pub fn project_points(object_points: &core::Mat, rvec: &core::Mat, tvec: &core::
///
/// ## 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> {
+pub fn recover_pose_camera_with_points(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_recoverPose_Mat_Mat_Mat_Mat_Mat_Mat_Mat(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()
}
@@ -1997,7 +1997,7 @@ pub fn recover_pose_matrix(e: &core::Mat, points1: &core::Mat, points2: &core::M
/// ## C++ default parameters
/// * mask: noArray()
/// * triangulated_points: noArray()
-pub fn recover_pose(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> {
+pub fn recover_pose_camera(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_recoverPose_Mat_Mat_Mat_Mat_Mat_Mat_double_Mat_Mat(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()
}
@@ -2078,7 +2078,7 @@ pub fn recover_pose(e: &core::Mat, points1: &core::Mat, points2: &core::Mat, cam
/// * focal: 1.0
/// * pp: Point2d(0, 0)
/// * mask: noArray()
-pub fn recover_pose_1(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> {
+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_recoverPose_Mat_Mat_Mat_Mat_Mat_double_Point2d_Mat(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()
}
@@ -2489,7 +2489,7 @@ pub fn solve_pnp(object_points: &core::Mat, image_points: &core::Mat, camera_mat
/// ## 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> {
+pub fn stereo_calibrate_camera_with_errors(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_stereoCalibrate_VectorOfMat_VectorOfMat_VectorOfMat_Mat_Mat_Mat_Mat_Size_Mat_Mat_Mat_Mat_Mat_int_TermCriteria(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()
}
@@ -2497,7 +2497,7 @@ pub fn stereo_calibrate_1(object_points: &types::VectorOfMat, image_points1: &ty
/// ## 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> {
+pub fn stereo_calibrate_camera(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_stereoCalibrate_VectorOfMat_VectorOfMat_VectorOfMat_Mat_Mat_Mat_Mat_Size_Mat_Mat_Mat_Mat_int_TermCriteria(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()
}
@@ -2624,7 +2624,7 @@ pub fn stereo_rectify_uncalibrated(points1: &core::Mat, points2: &core::Mat, f:
/// * 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<()> {
+pub fn stereo_rectify_camera(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_stereoRectify_Mat_Mat_Mat_Mat_Size_Mat_Mat_Mat_Mat_Mat_Mat_Mat_int_double_Size_Rect_X_Rect_X(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()
}

MODIFY
src/hub/core.rs
src/hub/core.rs
@@ -246,7 +246,7 @@ pub const LOG_LEVEL_SILENT: i32 = 0;
pub const LOG_LEVEL_VERBOSE: i32 = 6;
pub const LOG_LEVEL_WARNING: i32 = 3;
pub const MaskIsTiled: i32 = -26;
-pub const Mat_AUTO_STEP: i32 = 0;
+pub const Mat_AUTO_STEP: usize = 0;
pub const Mat_DEPTH_MASK: i32 = 7;
pub const Mat_MAGIC_MASK: i32 = 0xFFFF0000;
pub const Mat_MAGIC_VAL: i32 = 0x42FF0000;
@@ -3230,7 +3230,7 @@ pub fn sort(src: &core::Mat, dst: &mut core::Mat, flags: i32) -> Result<()> {
/// reallocated, if needed.
/// ## See also
/// merge, mixChannels, cvtColor
-pub fn split_at(src: &core::Mat, mvbegin: &core::Mat) -> Result<()> {
+pub fn split_at(src: &core::Mat, mvbegin: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_split_Mat_Mat(src.as_raw_Mat(), mvbegin.as_raw_Mat()) }.into_result()
}
@@ -5385,36 +5385,36 @@ impl Mat {
///
/// ## C++ default parameters
/// * i0: 0
- pub fn at_mut<T: core::ValidMatElement>(&mut self, i0: i32) -> Result<&mut T> { self._at_mut(i0) }
+ pub fn at_mut<T: core::DataType>(&mut self, i0: i32) -> Result<&mut T> { self._at_mut(i0) }
/// ## 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) }
+ pub fn at<T: core::DataType>(&self, i0: i32) -> Result<&T> { self._at(i0) }
/// ## 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) }
+ pub fn at_2d_mut<T: core::DataType>(&mut self, row: i32, col: i32) -> Result<&mut T> { self._at_2d_mut(row, col) }
/// ## 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) }
+ pub fn at_2d<T: core::DataType>(&self, row: i32, col: i32) -> Result<&T> { self._at_2d(row, col) }
/// ## 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) }
+ pub fn at_3d_mut<T: core::DataType>(&mut self, i0: i32, i1: i32, i2: i32) -> Result<&mut T> { self._at_3d_mut(i0, i1, i2) }
/// ## 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) }
+ pub fn at_3d<T: core::DataType>(&self, i0: i32, i1: i32, i2: i32) -> Result<&T> { self._at_3d(i0, i1, i2) }
pub fn update_continuity_flag(&mut self) -> Result<()> {
unsafe { sys::cv_Mat_updateContinuityFlag(self.as_raw_Mat()) }.into_result()

MODIFY
src/hub/dnn.rs
src/hub/dnn.rs
@@ -1667,11 +1667,19 @@ impl Net {
///
/// ## C++ default parameters
/// * output_name: String()
- pub fn forward_to(self, output_blobs: &mut types::VectorOfMat, output_name: &str) -> Result<()> {
+ pub fn forward_layer(self, output_blobs: &mut types::VectorOfMat, output_name: &str) -> Result<()> {
string_arg!(output_name);
unsafe { sys::cv_dnn_Net_forward_VectorOfMat_String(self, output_blobs.as_raw_VectorOfMat(), output_name.as_ptr()) }.into_result()
}
+ /// 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_first_outputs(self, output_blobs: &mut types::VectorOfMat, out_blob_names: &types::VectorOfString) -> Result<()> {
+ unsafe { sys::cv_dnn_Net_forward_VectorOfMat_VectorOfString(self, output_blobs.as_raw_VectorOfMat(), out_blob_names.as_raw_VectorOfString()) }.into_result()
+ }
+
/// 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.

MODIFY
src/hub/features2d.rs
src/hub/features2d.rs
@@ -288,7 +288,7 @@ pub fn draw_vector_matches(img1: &core::Mat, keypoints1: &types::VectorOfKeyPoin
///
/// ## 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<()> {
+pub fn evaluate_feature_detector(img1: &core::Mat, img2: &core::Mat, h1to2: &core::Mat, keypoints1: &mut types::VectorOfKeyPoint, keypoints2: &mut types::VectorOfKeyPoint, repeatability: f32, corresp_count: i32, fdetector: &types::PtrOfFeature2D) -> Result<()> {
unsafe { sys::cv_evaluateFeatureDetector_Mat_Mat_Mat_VectorOfKeyPoint_VectorOfKeyPoint_float_int_PtrOfFeature2D(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()
}
@@ -597,7 +597,7 @@ impl BOWImgDescriptorExtractor {
/// ## 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<()> {
+ pub fn compute_desc(&mut self, image: &core::Mat, keypoints: &types::VectorOfKeyPoint, img_descriptor: &mut core::Mat, point_idxs_of_clusters: &mut types::VectorOfVectorOfint, descriptors: &mut core::Mat) -> Result<()> {
unsafe { sys::cv_BOWImgDescriptorExtractor_compute_Mat_VectorOfKeyPoint_Mat_VectorOfVectorOfint_Mat(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()
}
@@ -610,7 +610,7 @@ impl BOWImgDescriptorExtractor {
///
/// ## 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<()> {
+ pub fn compute(&mut self, keypoint_descriptors: &core::Mat, img_descriptor: &mut core::Mat, point_idxs_of_clusters: &mut types::VectorOfVectorOfint) -> Result<()> {
unsafe { sys::cv_BOWImgDescriptorExtractor_compute_Mat_Mat_VectorOfVectorOfint(self.as_raw_BOWImgDescriptorExtractor(), keypoint_descriptors.as_raw_Mat(), img_descriptor.as_raw_Mat(), point_idxs_of_clusters.as_raw_VectorOfVectorOfint()) }.into_result()
}

MODIFY
src/hub/imgcodecs.rs
src/hub/imgcodecs.rs
@@ -83,7 +83,7 @@ pub fn decode(buf: &core::Mat, flags: i32) -> Result<core::Mat> {
/// * 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> {
+pub fn decode_to(buf: &core::Mat, flags: i32, dst: &mut core::Mat) -> Result<core::Mat> {
unsafe { sys::cv_imdecode_Mat_int_Mat(buf.as_raw_Mat(), flags, dst.as_raw_Mat()) }.into_result().map(|x| core::Mat { ptr: x })
}

MODIFY
src/hub/objdetect.rs
src/hub/objdetect.rs
@@ -173,7 +173,7 @@ pub fn group_rectangle(rect_list: &types::VectorOfRect, group_threshold: i32, ep
/// cluster, the average rectangle is computed and put into the output rectangle list.
///
/// ## Overloaded parameters
-pub fn group_rectangle_levelweights(rect_list: &types::VectorOfRect, group_threshold: i32, eps: f64, weights: &types::VectorOfint, level_weights: &types::VectorOfdouble) -> Result<()> {
+pub fn group_rectangle_levelweights(rect_list: &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()
}

MODIFY
src/hub/sys.rs
src/hub/sys.rs
@@ -86,7 +86,7 @@ pub type cv_return_value_unsigned_long_long = cv_return_value<u64>;
// void
pub type cv_return_value_void = cv_return_value<crate::types::Unit, ()>;
-// cv::Mat
+// Ptr<BaseCascadeClassifier::MaskGenerator>
pub type cv_return_value_void_X = cv_return_value<*mut c_void>;
extern "C" {
@@ -722,6 +722,7 @@ extern "C" {
#[doc(hidden)] pub fn cv_dnn_Net_setInputsNames_VectorOfString(instance: crate::dnn::Net, input_blob_names: *mut c_void) -> cv_return_value_void;
#[doc(hidden)] pub fn cv_dnn_Net_forward_String(instance: crate::dnn::Net, output_name: *const c_char) -> cv_return_value_void_X;
#[doc(hidden)] pub fn cv_dnn_Net_forward_VectorOfMat_String(instance: crate::dnn::Net, output_blobs: *mut c_void, output_name: *const c_char) -> cv_return_value_void;
+#[doc(hidden)] pub fn cv_dnn_Net_forward_VectorOfMat_VectorOfString(instance: crate::dnn::Net, output_blobs: *mut c_void, out_blob_names: *mut c_void) -> cv_return_value_void;
#[doc(hidden)] pub fn cv_dnn_Net_forward_VectorOfVectorOfMat_VectorOfString(instance: crate::dnn::Net, output_blobs: *mut c_void, out_blob_names: *mut c_void) -> cv_return_value_void;
#[doc(hidden)] pub fn cv_dnn_Net_setHalideScheduler_String(instance: crate::dnn::Net, scheduler: *const c_char) -> cv_return_value_void;
#[doc(hidden)] pub fn cv_dnn_Net_setPreferableBackend_int(instance: crate::dnn::Net, backend_id: i32) -> cv_return_value_void;

0.10.0 regenerate bindings