Translate

Matlab codes

Dividing an image into blocks or cells

img=imread('C:\Users\spider\Desktop\1.jpg');
C = mat2cell(img, [80 80 80],[80 80 80 80],3);
celldisp(C);

C{1,1};
C{1,2};
C{1,3};
C{2,1};


Converting color image to hsv image:

 I=imread('E:\images1\img3.jpg'); 
HSV=rgb2hsv(I);
H=HSV(:,:,1);
S=HSV(:,:,2); 
V=HSV(:,:,3);
figure(1), imshow(S)
figure(2),imshow(H)
figure(3),imshow(V)

Converting color image to hsv image:

 I=imread('E:\images1\img3.jpg'); 
HSV=rgb2hsv(I);
H=HSV(:,:,1);
S=HSV(:,:,2); 
V=HSV(:,:,3);
figure(1), imshow(S)
figure(2),imshow(H)
figure(3),imshow(V)

  Convert images into  avi video

a=avifile('E:\a1.avi');

for i = 1:500

    str = strcat('C:\Users\DELL\Documents\data\4b\img_000',int2str(i),'.bmp'); 

    img=imread(str);

    a=addframe(a,img);

% img  is the image file you need

end




ليست هناك تعليقات:

إرسال تعليق