Reading images

The first and basic operation we will cover is reading and writing the images returned by Open CV functions.

Note that in order to load or save the image, you need to provide a full path to the file.

We start the example with introducing the location to OpenCV library and proceed with the imread function, which is part of the OpenCV package:

filename = joinpath(pwd(), "sample-images", "cat-3352842_640.jpg");img = imread(filename);

After a successful run, you will have the img variable consisting of the OpenCV Mat image. It is no Julia image that you have worked with, and any of the transformations you have learned won't work.

Be aware of the semicolon at the end of the imread function. It is very important to put it after every ...

Get Hands-On Computer Vision with Julia now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.