Image manipulation in Julia

package
images

#1

I’ve been programming for more than a decade but I’m new to Julia lang and Computer Vision in general. I’ve Julia language, Jupyter notebooks and Juno/Atom IDE environment setup and running. However, I’m finding it difficult to get basic Computer Vision tasks done using Julia lang. Can somebody suggest any Julia tutorials/books for image processing?
Computer Vision courses online either make use of Matlab/Octave syntax or Python or C++ for image/video processing. I’m finding it very difficult to find tutorials to do Computer Vision tasks in Julia lang idiomatic image/video processing. Say for example

imgreen = im(:,:,2)```

The above Matlab code takes the green channel out of the loaded `peppers.png` image. **How can this be done in idiomatic Julia lang without converting loaded image to an array?**

#2

See https://github.com/timholy/Images.jl

If I remember correctly, I think you can do

using Images
im = imread("peppers.png")
imgreen = map(c -> c.g, im)

to extract the green channel of an RGB image.


#3

imgreen = map(ColorTypes.green, im) would also do the trick, and is a bit more legible.


#4

You could also do imgreen = ColorTypes.green.(im) (a 0.5-style vectorized “dot call”).


#5

As a site note:

In near future, with the new and shiny images ecosystem, this will be a little nicer still using channelview. see https://juliaimages.github.io/ImageCore.jl/latest/views.html#View-types-defined-in-ImageCore-1

you can try out the new way by following this discussion: https://github.com/timholy/Images.jl/issues/542#issuecomment-254059092

More documentation for the new ecosystem: http://juliaimages.github.io/latest/index.html