Open
Description
- Operating system
Ubuntu Gnome X11 - The way you installed OpenCV: package, official binary distribution, manual compilation, etc.
OpenCV installed via cargo package - OpenCV version
opencv = "0.94.2" - rustc version (
rustc --version
)
rustc 1.82.0 (2024-10-15) - Attach the full output of the following command from your project directory:
shell script RUST_BACKTRACE=full cargo build -vv
cargo run RUST_BACKTRACE=full cargo build -vv
target/debug/opencvx: symbol lookup error: /snap/core20/current/lib/x86_64-linux-gnu/libpthread.so.0: undefined symbol: __libc_pthread_init, version GLIBC_PRIVATE
My code:
use opencv::prelude::*;
use opencv::{highgui, videoio, Result};
fn main() -> Result<()> {
let window = "video capture";
highgui::named_window(window, highgui::WINDOW_AUTOSIZE)?;
let mut cam = videoio::VideoCapture::new(0, videoio::CAP_ANY)?;
let opened = videoio::VideoCapture::is_opened(&cam)?;
if !opened {
panic!("Unable to open default camera!");
}
loop {
let mut frame = Mat::default();
cam.read(&mut frame)?;
if frame.size()?.width > 0 {
highgui::imshow(window, &frame)?;
}
let key = highgui::wait_key(10)?;
if key > 0 && key != 255 {
break;
}
}
// Очистка
highgui::destroy_all_windows()?;
Ok(())
}
Metadata
Metadata
Assignees
Labels
No labels