Image Processing Reference
In-Depth Information
disp('The dimensions of the array are')
size(pic)
%now let's invoke a routine that inverts the image
inverted_pic=invert(pic);
%Let's print it out to check it
disp('When we invert it by subtracting each point from the
maximum, we get')
inverted_pic
%And view it
disp('And when viewed as an image, we see')
disp('When you are ready to move on, press RETURN')
imagesc(inverted_pic);
%Let's hold a while so we can view it pause;
disp('We shall now read in a bitmap image, and view it')
disp('When you are ready to move on, press RETURN')
face=imread('rhdark.bmp','bmp');
imagesc(face);
pause;
%Change from unsigned integer(unit8) to double precision so we can
process it
face=double(face);
disp('Now we shall invert it, and view the inverted image')
inverted_face=invert(face);
imagesc(inverted_face);
disp('So we now know how to process images in Matlab. We shall be
using this later!')
Code 1.6
Matlab script for chapter 1
1
50
40
30
20
10
0
8
2
3
4
5
6
6
4
7
2
8
7
6
5
8
4
0
3
2
1
1
2
3
4
5
6
7
8
(a) Matlab surface plot
(b) Matlab image
Figure 1.16
Matlab image visualisation
Search WWH ::




Custom Search