Image manipulation in Julia

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?**

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.

1 Like

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

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

1 Like

As a site note:

In near future, with the new and shiny images ecosystem, this will be a little nicer still using channelview. see Views · ImageCore

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: Home · JuliaImages

3 Likes