September 2018
Intermediate to advanced
380 pages
9h 40m
English
In the preceding program, the second argument for imread is specified as 0, which means that it will read an image as a grayscale image. Suppose you want to read any color image. To do this, you can change the imread command in the following way:
Mat img = imread("images/autumn.tif",1);
The second argument is specified as 1, which means that it will read an image in BGR form. It is important to note that OpenCV's imread and imshow use BGR format for color images, which is different from the RGB format used by MATLAB and other image processing tools. The output after changing imread is as follows:

The same ...
Read now
Unlock full access