Introduction
You need first to download the file TP.zip, to unzip it so that you have a directory named TP
containing two subdirectories src
(which contains a few necessary scilab commands for loading and displaying images) and im
(which contains images needed in the TP).
If you use Scilab you should add src
to the path by typing (replacing PATH by the correct path…) :
getd('PATH/src');
The comments are indicated by '%'in Matlab and by '//' in Scilab.
Load and display a color image. A color image \(u\) is made of three channels : red, green and blue. In Matlab and Scilab, a color image in \(\mathbb{R}^{N\times M}\) is stored as a \(N\times M\times 3\) matrix.
Matlab
imrgb = imread('im/parrot.bmp'); // load an image [nrow,ncol,nchan]=size(imrgb); imshow(imrgb); //display the color image
Scilab
imrgb = read_bmp_bg('im/parrot.bmp'); // load an image [nrow,ncol,nchan]=size(imrgb); ccview(imrgb); //display the color image