Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %1
- RGB = imread('lena.jpg');
- RGB1 = imread('lena.bmp');
- figure(1)
- imshow(RGB1)
- figure(2)
- imshow(RGB)
- I = rgb2gray(RGB)
- figure(3)
- imshow(I)
- imwrite(I,'obrazy/lena_gray.bmp')
- figure(4)
- colormap gray
- mesh(I)
- figure(5)
- plot(I(10,:));
- figure(6)
- plot(I(:,10));
- %2
- A1 = imread('lena_gray.bmp')
- figure(1)
- imshow(A1)
- figure(2)
- I = imhist(A1)
- plot(I)
- figure(3)
- I1 = cumsum(I)
- plot(I1)
- figure(4)
- A2= imbinarize(A1)
- imshow(A2)
- %3
- A1 = imread('lena_gray.bmp')
- [X, map] = gray2ind(A1,256);
- figure(1)
- imshow(X,map)
- figure(2)
- colormap winter
- image(A1)
- %4
- lena=imread('lena.bmp')
- R = lena(:,:,1); G = lena(:,:,2); B = lena(:,:,3);
- figure(1);
- subplot(2,2,1);
- imshow(lena);
- title('Oryginal');
- subplot(2,2,2);
- imshow(R);
- title('R');
- subplot(2,2,3);
- imshow(G);
- title('G');
- subplot(2,2,4);
- imshow(B);
- title('B');
- lena1=rgb2hsv(lena)
- H = lena1(:,:,1); S = lena1(:,:,2); V = lena1(:,:,3);
- figure(2);
- subplot(2,2,1);
- imshow(lena1);
- title('Oryginal');
- subplot(2,2,2);
- imshow(H);
- title('H');
- subplot(2,2,3);
- imshow(S);
- title('S');
- subplot(2,2,4);
- imshow(V);
- title('V');
- lena2=rgb2ycbcr(lena)
- Y = lena2(:,:,1); CB = lena2(:,:,2); CR = lena2(:,:,3);
- figure(3);
- subplot(2,2,1);
- imshow(lena2);
- title('Oryginal');
- subplot(2,2,2);
- imshow(Y);
- title('Y');
- subplot(2,2,3);
- imshow(CB);
- title('Cb');
- subplot(2,2,4);
- imshow(CR);
- title('Cr');
Advertisement
Add Comment
Please, Sign In to add comment