Page 163 - Algorithm Collections for Digital Signal Processing Applications using MATLAB
P. 163

152                                                        Chapter 4

           4.2      M-program for Binary Image Rotation
                    with 45 Degree Anticlockwise Direction

              ___________________________________________________________

              binimrotationgv.m

              A=imread(selectfig8','bmp');
              TM=[0.7071 0.7071;-0.7071 0.7071];
              [X Y]=find(A==0);
              VECT=[X Y];
              TRANSVECT=TM*VECT';
              TRANSVECT=round(TRANSVECT-min(min(TRANSVECT))+1);
              m=max(max(TRANSVECT));
              B=ones (m, m);
              for k=1:1:length(TRANSVECT)
                  B(TRANSVECT(1,k),TRANSVECT(2,k))=0;
              end
              figure
              subplot(2,1,1)
              imshow(A)
              title('ORIGINAL IMAGE')
              subplot(2,1,2)
              imshow(B)
              title('IMAGE AFTER 45 degree ROTATION')
              ___________________________________________________________


           5.       CLUSTERING TEXTURE IMAGES USING
                    K-MEANS ALGORITHM


           To retrieve the similar images from the database, sample image looking like

           the same is used as the key. The low level features extracted from the key
           ima  ge  is  used  as  the  index  for  searching.  So  the  data  base  has  to  be

           maintained based on the low level feature vectors derived from the images.
   158   159   160   161   162   163   164   165   166   167   168