GitXplorerGitXplorer
s

simple-image-interface-rs

public
3 stars
2 forks
0 issues

Commits

List of commits on branch main.
Unverified
7f87c23e74a2e1b127674abc41c6addb558831dc

update README

sscepter914 committed 8 months ago
Unverified
d2cd57b5493d731cca4103833f67bdc4ab8985c6

update edition

sscepter914 committed 8 months ago
Unverified
6217d905f05d0dff02ebc20015404366071c3484

update version

sscepter914 committed 8 months ago
Unverified
ee11d60621f14ee36c5840c91413efbfe5b02e9b

fix directory missing in example code

sscepter914 committed 8 months ago
Verified
48012e3545213cf54401c38d8e53714fc94d900a

Merge pull request #2 from thomasarmel/main

sscepter914 committed 8 months ago
Unverified
6b58dc6ffe0f6242b56687977745dbe93b3e65bf

Update dependencies and fix some warnings

committed 8 months ago

README

The README file for this repository.

simple_image_interface

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.

  • Document
  • Supported image interface
    • Camera
      • [x] Web Camera (v4l2)
      • [ ] Realsense
      • [ ] Basler Camera
    • Video
      • [x] mp4
    • Image
      • [x] png
      • [x] jpeg

Get started

Install

  • Install for rscam
sudo apt install libv4l-dev
  • Install for ffmpeg-next
sudo apt install -y clang libavcodec-dev libavformat-dev libavutil-dev pkg-config libavdevice-dev
  • Cargo.toml
"simple_image_interface" = "0.1.6"

Example code

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);
    }
}
  • Example code execution
# Run for picture
cargo run --release --example example pic

# Run for video
cargo run --release --example example video

Note

  • Simple_image_interface do not use trait object but lapper struct to improve execution speed

History

  • For new release
    • Updated README
    • Updated Rust edition
  • v0.1.6
  • v0.1.5
    • Refactored
    • [caution!!] Changed module architecture
  • v0.1.4
    • Renamed repository name
  • v0.1.3
    • Refactored
  • v0.1.2
  • v0.1.1
    • Fixed bug
  • v0.1.0
    • Published simple_image_interface

Reference