Giter Club home page Giter Club logo

ndarray-vision's Introduction

Rust Computer Vision

Rust CV is a project to implement computer vision algorithms in Rust.

What is computer vision

Many people are familiar with covolutional neural networks and machine learning in computer vision, but computer vision is much more than that. One of the first things that Rust CV focused on was algorithms in the domain of Multiple-View Geometry (MVG). Today, Rust now has enough MVG algorithms to perform relatively simple camera tracking and odometry tasks. Weakness still exists within image processing and machine learning domains.

Goals

Here are some of the domains of computer vision that Rust CV intends to persue along with examples of the domain (not all algorithms below live within the Rust CV organization, and some of these may exist and are unknown):

To support computer vision tooling, the following will be implemented:

ndarray-vision's People

Contributors

daniel-emotech avatar dependabot-preview[bot] avatar jmetz avatar rahuldas-dev avatar stefan-k avatar tdk-meta avatar vadixidav avatar volks73 avatar xd009642 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ndarray-vision's Issues

canny_edges function works for a long time

Your example ndarray-vision/examples/edges.rs  built canny in 36 seconds
Library imageproc built canny in 2 seconds 
    let now = std::time::Instant::now();
    let im = image::open("images/lena.png").unwrap().to_luma();
    imageproc::edges::canny(&im, 1.0, 30.0).save("images/lena-canny.png");
    println!("{} sec", now.elapsed().as_secs());// 2 sec !!!

Error: linking with `link.exe` failed: exit code: 1120

Hi ,

I copy & paste the Example code provided in here and then did cargo run .
Found Following Error error: linking with link.exe failed: exit code: 1120

MY Cargo.toml
image

Error Screen Shot
image

Here is the complete error Log
nd-array-vision-error.txt

Rust Version - rustc 1.57.0 (f1edd0429 2021-11-29)
Cargo Version - cargo 1.57.0 (b2e52d7ca 2021-10-21)
Operating System -Windows, version 10.0.19042 X64

I would greatly appreciate your assistance if I am missing something.

Generic Colour Model

Sometimes image data might be converted into a format that doesn't follow a colour model this issue would involve implementing the Generic (or model-less) conversions. This generally involves either a straight copying of the data or adding/removing channels from the image data.

Add separate apply and calculate threshold methods

The image processing threshold methods are defined as traits for the ArrayBase and Image types that use the Otsu and Mean algorithms for calculating a threshold value and immediately applying the threshold. It could be useful to break out the one defined method into an "apply" and "calculate" methods, so that the threshold value could be calculated and obtained without immediately applying it to the image or array.

For example, the fn threshold_otsu would become:

...
fn threshold_calculate_otsu(&self) -> Result<f64, Error>;

fn threshold_apply_otsu(&self) -> Result<Self::Output, Error>;
...

The threshold_apply_otsu would be the same as the current threshold_otsu method, but the threshold_calculate_otsu method would simply return the threshold value, which could be used to do additional image processing or explicitly applied to an image using the new-ish threshold_apply method from PR #56.

Affine reflection

With all the permutations of reflection should just a simple X, Y reflection just be supported for more complicated ones like reflecting along the line y=-x? Answer this question and implement the decision

Allow images to be 2D or 3D

Currently just using Ix3 as image dimensions to easily allow other colour channels. Usability may be improved by making it easy to drop the extra dimension when it's just a single channel image

Use ndarray Data trait more

A lot of my extension traits are using ArrayN<T> instead of ArrayBase<U, _> where U: Data<Elem=T>. Change things into using the Data trait and see if that adds an easy way to have the core Image struct not own it's data

Compatibility with ndarray 0.13.1

Using:

let y = Array3::zeros((100, 100, 3));
let x = Image::from_data(y);

I get:

error[E0308]: mismatched types
   --> src/main.rs:347:30
    |
347 |     let x = Image::from_data(y);
    |                              ^ expected struct `ndarray::ArrayBase`, found a different struct `ndarray::ArrayBase`
    |
    = note: expected struct `ndarray::ArrayBase<ndarray::OwnedRepr<_>, ndarray::dimension::dim::Dim<[usize; 3]>>`
               found struct `ndarray::ArrayBase<ndarray::OwnedRepr<_>, ndarray::Dim<[usize; 3]>>`
    = note: perhaps two different versions of crate `ndarray` are being used?

Cargo.toml:

[dependencies]
ndarray = { version = "0.13.1", features = ["blas"] }
ndarray-linalg = { version = "0.12"}
ndarray-stats = { version = "0.3"}
ndarray-vision = { version = "0.1.1"}
blas-src = { version = "0.2.0", default-features = false, features = ["openblas"] }
openblas-src = { version = "0.6.0", default-features = false, features = ["cblas", "system"] }
fftw-src = { version = "0.3.0"}
fftw = { version = "0.6.0"}

Downgrading ndarray to 0.12 helped, but then I lost some functionality in other places, which was undesirable. Is there any way around this without downgrading?

Sobel Operator

The vertical and horizontal filters have been implemented, it's just a case of implementing something to do the following step sqrt(vert^2 +horz^2) where vert is the result of the vertical edge filter and horz is the result of the horizontal edge filter.

docs failing for the latest release

It seems that docs are failing for the latest release 0.5.0, and for a lot of the previous releases as well. The last version for which the docs are visible is 0.1.1

Hough Transform

Implement a means for Hough transforms to detect lines - or other shapes (Circles or ideally any arbitrary shape)

docs.rs build failed for 0.2

I was just looking up some of the documentation for this crate on docs.rs, and it looks like the build has failed for the most recent version of 0.2. I think the crates.io build has worked, though, so not sure why it's happening. Just figured you might want to know!

benchmarking

Add benchmarking for the crate (preferably criterion)

PPM encoding/decoding

I found during my median filter implementation that there is some issue in ppm encoding/decoding. This may be due to 16 bit width PPMs or other extensions. Or mishandling of the format.

Issues seems to partially be down to the ppm being larger than the header suggested it should be. Which is now sorted. However, there are still some issues with this random ppm I've downloaded that I've not encountered before - but could be related to the fact it's 1 byte too large.

Convolution: center of kernel in the upper left corner

Hi,

thanks for this crate!
I tried to use the convolution and I noticed that the center of the kernel is not at the actual center but rather at the top left corner. This leads to a shift of the image to the upper left proportional to the size of the kernel. Furthermore some rows at the bottom and some columns on the right appear unprocessed (probably a problem with the boundary handling). I've attached two images to illustrate the problem: one without filter:
phantom_nofilter
and the same with a 15x15 pixel BoxLinearFilter:
phantom_filter

Affine Transformations

Be able to apply affine transformations to images

  • Reflection
  • Scale
  • Rotate
  • Shear
  • translate

Serde support

I was starting to play around with this crate and others in the "ndarray family" to become more familiar with using Rust for CV and ML applications. In my adventure, I have a need to (de)serialize images to pass between processes. Constantly decoding/encoding into an image format seems excessive, but maybe this is the ultimate solution. So, I saw that the ndarray crate has an optional serde feature, but the core, ImageBase type in this crate does not implement the Serialize or Deserialize traits and there is no similar optional feature.

Is there interest in adding Serde support to this crate as a similar optional feature so ImageBase can be (de)serialized?

Documentation + tidyup

Doc comments for everything released in 0.1.0. Also move re-exports into a prelude file to avoid unnecessary faff at start of module docs.

Add thresholding algorithms submodule

Ideas for algorithms to add could come from Matlab/Scikit-image/ImageJ threshold algorithms.

To start we could add some a couple of standard ones - I've been working on mean and Otsu's method implementations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.