0.61.0 Regenerate bindings
MODIFY
CHANGES.md
CHANGES.md
+* 0.61.0
+ * The QR code decoding function in `objdetect` module are now returning `Vec<u8>` instead of `String` because the codes can
+ contain binary raw binary data and are not always UTF-8.
+ * You can now iterate over `Mat` using `for` loop. The iterator will yield elements of type `(Point, T)`, a position and an
+ element.
+
* 0.60.0
* The features for OpenCV module selections now have inter-dependencies so that you can't exclude a module that's needed for
some other one.

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.60.0"
+version = "0.61.0"
edition = "2018"
authors = ["Pro <twisted.fall@gmail.com>", "Mathieu Poumeyrol <kali@zoy.org>"]
autoexamples = false # not all examples compile on just any system
@@ -198,7 +198,7 @@ xphoto = ["photo"]
wechat_qrcode = []
[build-dependencies]
-binding-generator = { package = "opencv-binding-generator", version = "0.35.0", path = "binding-generator" }
+binding-generator = { package = "opencv-binding-generator", version = "0.36.0", path = "binding-generator" }
cc = { version = "1.0", features = ["parallel"] }
clang = { version = "1.0", features = ["clang_6_0"] }
dunce = "1.0"

MODIFY
binding-generator/Cargo.toml
binding-generator/Cargo.toml
name = "opencv-binding-generator"
description = "Binding generator for opencv crate"
repository = "https://github.com/twistedfall/opencv-rust"
-version = "0.35.0"
+version = "0.36.0"
license = "MIT"
authors = ["Pro <twisted.fall@gmail.com>"]
edition = "2018"

MODIFY
src/opencv/hub/core.rs
src/opencv/hub/core.rs
@@ -24111,7 +24111,7 @@ pub trait BufferTrait: core::BufferTraitConst {
/// * target: ARRAY_BUFFER
/// * auto_release: false
#[inline]
- fn create_1(&mut self, asize: core::Size, atype: i32, target: core::Buffer_Target, auto_release: bool) -> Result<()> {
+ fn create_size(&mut self, asize: core::Size, atype: i32, target: core::Buffer_Target, auto_release: bool) -> Result<()> {
let ret = unsafe { sys::cv_ogl_Buffer_create_Size_int_Target_bool(self.as_raw_mut_Buffer(), asize.opencv_as_extern(), atype, target, auto_release) }.into_result()?;
Ok(ret)
}

MODIFY
src/opencv/hub/objdetect.rs
src/opencv/hub/objdetect.rs
@@ -1914,25 +1914,6 @@ pub trait QRCodeDetectorTraitConst {
Ok(ret)
}
- /// Both detects and decodes QR codes
- /// ## Parameters
- /// * img: grayscale or color (BGR) image containing QR codes.
- /// * decoded_info: UTF8-encoded output vector of string or empty vector of string if the codes cannot be decoded.
- /// * points: optional output vector of vertices of the found QR code quadrangles. Will be empty if not found.
- /// * straight_qrcode: The optional output vector of images containing rectified and binarized QR codes
- ///
- /// ## C++ default parameters
- /// * points: noArray()
- /// * straight_qrcode: noArray()
- #[inline]
- fn detect_and_decode_multi(&self, img: &dyn core::ToInputArray, decoded_info: &mut core::Vector<String>, points: &mut dyn core::ToOutputArray, straight_qrcode: &mut dyn core::ToOutputArray) -> Result<bool> {
- input_array_arg!(img);
- output_array_arg!(points);
- output_array_arg!(straight_qrcode);
- let ret = unsafe { sys::cv_QRCodeDetector_detectAndDecodeMulti_const_const__InputArrayR_vector_string_R_const__OutputArrayR_const__OutputArrayR(self.as_raw_QRCodeDetector(), img.as_raw__InputArray(), decoded_info.as_raw_mut_VectorOfString(), points.as_raw__OutputArray(), straight_qrcode.as_raw__OutputArray()) }.into_result()?;
- Ok(ret)
- }
-
}
pub trait QRCodeDetectorTrait: crate::objdetect::QRCodeDetectorTraitConst {
@@ -1969,12 +1950,12 @@ pub trait QRCodeDetectorTrait: crate::objdetect::QRCodeDetectorTraitConst {
/// ## C++ default parameters
/// * straight_qrcode: noArray()
#[inline]
- fn decode(&mut self, img: &dyn core::ToInputArray, points: &dyn core::ToInputArray, straight_qrcode: &mut dyn core::ToOutputArray) -> Result<String> {
+ fn decode(&mut self, img: &dyn core::ToInputArray, points: &dyn core::ToInputArray, straight_qrcode: &mut dyn core::ToOutputArray) -> Result<Vec<u8>> {
input_array_arg!(img);
input_array_arg!(points);
output_array_arg!(straight_qrcode);
let ret = unsafe { sys::cv_QRCodeDetector_decode_const__InputArrayR_const__InputArrayR_const__OutputArrayR(self.as_raw_mut_QRCodeDetector(), img.as_raw__InputArray(), points.as_raw__InputArray(), straight_qrcode.as_raw__OutputArray()) }.into_result()?;
- let ret = unsafe { String::opencv_from_extern(ret) };
+ let ret = unsafe { Vec::<u8>::opencv_from_extern(ret) };
Ok(ret)
}
@@ -1989,12 +1970,12 @@ pub trait QRCodeDetectorTrait: crate::objdetect::QRCodeDetectorTraitConst {
/// ## C++ default parameters
/// * straight_qrcode: noArray()
#[inline]
- fn decode_curved(&mut self, img: &dyn core::ToInputArray, points: &dyn core::ToInputArray, straight_qrcode: &mut dyn core::ToOutputArray) -> Result<String> {
+ fn decode_curved(&mut self, img: &dyn core::ToInputArray, points: &dyn core::ToInputArray, straight_qrcode: &mut dyn core::ToOutputArray) -> Result<Vec<u8>> {
input_array_arg!(img);
input_array_arg!(points);
output_array_arg!(straight_qrcode);
let ret = unsafe { sys::cv_QRCodeDetector_decodeCurved_const__InputArrayR_const__InputArrayR_const__OutputArrayR(self.as_raw_mut_QRCodeDetector(), img.as_raw__InputArray(), points.as_raw__InputArray(), straight_qrcode.as_raw__OutputArray()) }.into_result()?;
- let ret = unsafe { String::opencv_from_extern(ret) };
+ let ret = unsafe { Vec::<u8>::opencv_from_extern(ret) };
Ok(ret)
}
@@ -2009,12 +1990,12 @@ pub trait QRCodeDetectorTrait: crate::objdetect::QRCodeDetectorTraitConst {
/// * points: noArray()
/// * straight_qrcode: noArray()
#[inline]
- fn detect_and_decode(&mut self, img: &dyn core::ToInputArray, points: &mut dyn core::ToOutputArray, straight_qrcode: &mut dyn core::ToOutputArray) -> Result<String> {
+ fn detect_and_decode(&mut self, img: &dyn core::ToInputArray, points: &mut dyn core::ToOutputArray, straight_qrcode: &mut dyn core::ToOutputArray) -> Result<Vec<u8>> {
input_array_arg!(img);
output_array_arg!(points);
output_array_arg!(straight_qrcode);
let ret = unsafe { sys::cv_QRCodeDetector_detectAndDecode_const__InputArrayR_const__OutputArrayR_const__OutputArrayR(self.as_raw_mut_QRCodeDetector(), img.as_raw__InputArray(), points.as_raw__OutputArray(), straight_qrcode.as_raw__OutputArray()) }.into_result()?;
- let ret = unsafe { String::opencv_from_extern(ret) };
+ let ret = unsafe { Vec::<u8>::opencv_from_extern(ret) };
Ok(ret)
}
@@ -2029,12 +2010,12 @@ pub trait QRCodeDetectorTrait: crate::objdetect::QRCodeDetectorTraitConst {
/// * points: noArray()
/// * straight_qrcode: noArray()
#[inline]
- fn detect_and_decode_curved(&mut self, img: &dyn core::ToInputArray, points: &mut dyn core::ToOutputArray, straight_qrcode: &mut dyn core::ToOutputArray) -> Result<String> {
+ fn detect_and_decode_curved(&mut self, img: &dyn core::ToInputArray, points: &mut dyn core::ToOutputArray, straight_qrcode: &mut dyn core::ToOutputArray) -> Result<Vec<u8>> {
input_array_arg!(img);
output_array_arg!(points);
output_array_arg!(straight_qrcode);
let ret = unsafe { sys::cv_QRCodeDetector_detectAndDecodeCurved_const__InputArrayR_const__OutputArrayR_const__OutputArrayR(self.as_raw_mut_QRCodeDetector(), img.as_raw__InputArray(), points.as_raw__OutputArray(), straight_qrcode.as_raw__OutputArray()) }.into_result()?;
- let ret = unsafe { String::opencv_from_extern(ret) };
+ let ret = unsafe { Vec::<u8>::opencv_from_extern(ret) };
Ok(ret)
}

MODIFY
src/opencv/hub/sys.rs
src/opencv/hub/sys.rs
@@ -4934,7 +4934,6 @@ mod objdetect_sys {
pub fn cv_QRCodeDetector_detectAndDecodeCurved_const__InputArrayR_const__OutputArrayR_const__OutputArrayR(instance: *mut c_void, img: *const c_void, points: *const c_void, straight_qrcode: *const c_void) -> Result<*mut c_void>;
pub fn cv_QRCodeDetector_detectMulti_const_const__InputArrayR_const__OutputArrayR(instance: *const c_void, img: *const c_void, points: *const c_void) -> Result<bool>;
pub fn cv_QRCodeDetector_decodeMulti_const_const__InputArrayR_const__InputArrayR_vector_string_R_const__OutputArrayR(instance: *const c_void, img: *const c_void, points: *const c_void, decoded_info: *mut c_void, straight_qrcode: *const c_void) -> Result<bool>;
- pub fn cv_QRCodeDetector_detectAndDecodeMulti_const_const__InputArrayR_vector_string_R_const__OutputArrayR_const__OutputArrayR(instance: *const c_void, img: *const c_void, decoded_info: *mut c_void, points: *const c_void, straight_qrcode: *const c_void) -> Result<bool>;
pub fn cv_SimilarRects_getPropEps_const(instance: *const c_void) -> f64;
pub fn cv_SimilarRects_setPropEps_double(instance: *mut c_void, val: f64);
pub fn cv_SimilarRects_SimilarRects_double(_eps: f64) -> Result<*mut c_void>;

0.61.0 Regenerate bindings