iconChordizm

RxCV

RxCV provide Rust programming experience to OpenCV.

Features

  • Open Source
  • Type & Format & Memory safety.
GitHub

use rxcv::{

imgcodecs::Decode,

imgproc::{Threshold, ThresholdTypes},

Mat,

};

let data:&[u8] = &[1, 2, 3, 4, 5, 6];

let src = Mat::<u8, 3>::decode(data).unwrap();

/**

Not implemented threshold on Mat::<u8, 3>

let (thresh, dst) = src.threshold(

0,

255,

ThresholdTypes::THRESH_BINARY | ThresholdTypes::THRESH_OTSU

);

*/

// Convert Color;

let src = src.cvt_color_bgr2gray().unwrap();

let (thresh, dst) = src.threshold(

0,

255,

ThresholdTypes::THRESH_BINARY | ThresholdTypes::THRESH_OTSU

).unwrap();