Page 299 -
P. 299

plot(-5,5,'*')
                                hold on
                                G=[2 6 5 3 2; 1 1 3 3 1;1 1 1 1 1];
                                plot(G(1,:),G(2,:),'b')
                                T=[1 0 5;0 1 -5;0 0 1];
                                G1=T*G;
                                plot(G1(1,:),G1(2,:), 'r')
                                R=[cos(pi/4) -sin(pi/4) 0;sin(pi/4) cos(pi/4) 0;...
                                   0 0 1];
                                G2=R*G1;
                                plot(G2(1,:),G2(2,:),'g')
                                G3=inv(T)*G2;
                                plot(G3(1,:),G3(2,:),'k')
                                axis([-12 12 -12 12])
                                axis square
                                hold off





                             9.3  Manipulation of 2-D Images

                             Currently more and more images are being stored or transmitted in digital
                             form. What does this mean?
                              To simplify the discussion, consider a black and white image and assume
                             that it has a square boundary. The digital image is constructed by the optics
                             of the detecting system (i.e., the camera) to form on a plane containing a 2-D
                             array of detectors, instead of the traditional photographic film. Each of these
                             detectors, called a pixel (picture element), measures the intensity of light fall-
                             ing on it. The image is then represented by a matrix having the same size as
                             the detectors’ 2-D array structure, and such that the value of each of the
                             matrix elements is proportional to the intensity of the light falling on the
                             associated detector element. Of course, the resolution of the picture increases
                             as the number of arrays increases.


                             9.3.1  Geometrical Manipulation of Images
                             Having the image represented by a matrix, it is now possible to perform all
                             kinds of manipulations on it in MATLAB. For example, we could flip it in
                             the left/right directions (fliplr), or in the up/down direction (flipud),
                             or rotate it by 90° (rot90), or for that matter transform it by any matrix
                             transformation. In the remainder of this section, we explore some of the


                             © 2001 by CRC Press LLC
   294   295   296   297   298   299   300   301   302   303   304