Skip to content

Commit

Permalink
Prepare for publish #1
Browse files Browse the repository at this point in the history
  • Loading branch information
rcastill committed Aug 12, 2022
1 parent e096da7 commit 2235666
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
name = "mat2image"
version = "0.1.0"
edition = "2021"
license = "MIT"
description = "Utilities to convert opencv::Mat to image::DynamicImage"
repository = "https://github.com/rcastill/mat2image"
exclude = [
"examples/*",
"Makefile"
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

Expand Down
17 changes: 6 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,6 @@ is painfully slow. Then `Mat::to_image_unsafe` is implemented using
[Mat::data](https://docs.rs/opencv/latest/opencv/core/trait.MatTraitConstManual.html#method.data)
accessing the raw data.

## TODO

- [x] Refactor unsafe with
[data_bytes](https://docs.rs/opencv/latest/opencv/core/trait.MatTraitManual.html#method.data_bytes) and
[data_bytes_mut](https://docs.rs/opencv/latest/opencv/core/trait.MatTraitManual.html#method.data_bytes_mut)
- [ ] Can we convert BGR to RGB cheaply?
- Seems like it can't be done: [image#1723](https://github.com/image-rs/image/issues/1723)
- [x] Do we collide with
[cv-convert](https://docs.rs/cv-convert/latest/cv_convert/)
- No implementation for Mat -> DynamicImage yet

## Running examples

### Save as
Expand Down Expand Up @@ -61,3 +50,9 @@ Then load it in [Firefox Profiler](https://profiler.firefox.com).

- [Rust profiling](https://nnethercote.github.io/perf-book/profiling.html)
- [Firefox Profiler Guide](https://github.com/firefox-devtools/profiler/blob/main/docs-user/guide-perf-profiling.md)

## Notes

- Can we convert BGR to RGB cheaply? - Seems like it can't be done: [image#1723](https://github.com/image-rs/image/issues/1723)
- [cv-convert](https://docs.rs/cv-convert/latest/cv_convert/) does not have implementation for Mat -> DynamicImage
yet. There is an [issue](https://github.com/jerry73204/rust-cv-convert/issues/10) raised to merge this code into cv_convert.
3 changes: 3 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//! Utilities to convert [Mat](https://docs.rs/opencv/latest/opencv/core/struct.Mat.html) to
//! [DynamicImage](https://docs.rs/image/latest/image/enum.DynamicImage.html)

use image::{DynamicImage, RgbImage};
use opencv::{
core::{Mat, MatTraitConst, CV_8UC3},
Expand Down

0 comments on commit 2235666

Please sign in to comment.