Created
November 14, 2021 11:14
-
-
Save rajeshpachaikani/949652fe9fac4b246d68fd3f301019df to your computer and use it in GitHub Desktop.
Rust opencv demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Author: Rajesh Pachaikani | |
Contact: [email protected] | |
*/ | |
use opencv::{highgui, prelude::*, videoio, Result}; | |
fn main() -> Result<()> { | |
let mut cam = videoio::VideoCapture::new(0, videoio::CAP_ANY)?; | |
highgui::named_window("window", highgui::WINDOW_FULLSCREEN)?; | |
let mut frame = Mat::default(); | |
loop{ | |
cam.read(&mut frame)?; | |
highgui::imshow("window", &frame)?; | |
let key = highgui::wait_key(1)?; | |
if key == 113{ | |
break; | |
} | |
} | |
Ok(()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This rust tutorial is mindblowing. Thanks a lot.
If you encountered a
libclang.dylib' (no such file)
error on macos.Then install
xcode
andopencv
and link the lib