| Crates.io | simple_image_interface |
| lib.rs | simple_image_interface |
| version | 0.1.7 |
| created_at | 2021-09-05 09:55:13.730805+00 |
| updated_at | 2025-03-18 09:46:02.437998+00 |
| description | Simple image interface with pictures, video, and camera. |
| homepage | |
| repository | https://github.com/scepter914/simple_image_interface |
| max_upload_size | |
| id | 447089 |
| size | 55,855 |
This repository is simple image interface library for rust. By using this library you can change easily between images, videos, and camera input. This may be useful for debug like robotics vision area.
sudo apt install libv4l-dev
sudo apt install -y clang libavcodec-dev libavformat-dev libavutil-dev pkg-config libavdevice-dev
"simple_image_interface" = "0.1.6"
use simple_image_interface::simple_image_interface::SimpleImageInterface;
fn main() {
if args.len() < 2 || &args[1] == "pic" {
interface = SimpleImageInterface::new_picture("./data/from_raw.png");
} else if &args[1] == "video" {
interface = SimpleImageInterface::new_video("./data/random_ball.mp4");
} else {
interface = SimpleImageInterface::new_camera("/dev/video0", 640, 360, 330);
// width, height, fps
}
let mut frame_index = 0;
loop {
frame_index += 1;
let input_image = interface.get_frame();
if input_image.is_none() {
break;
}
my_image_proc(&input_image.unwrap(), frame_index);
}
}
# Run for picture
cargo run --release --example example pic
# Run for video
cargo run --release --example example video
Simple_image_interface do not use trait object but lapper struct to improve execution speedsimple_image_interface