Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %lab4 zad1
- clearvars;
- close all;
- clc;
- I1 = imread('lena1.bmp');
- I2 = imread('lena2.bmp');
- I3 = imread('lena3.bmp');
- I4 = imread('lena4.bmp');
- figure(1);
- subplot(4,2,1);
- imshow(I1);
- subplot(4,2,2);
- imshow(I2);
- subplot(4,2,3);
- imshow(I3);
- subplot(4,2,4);
- imshow(I4);
- subplot(4,2,5);
- imhist(I1, 256);
- subplot(4,2,6);
- imhist(I2, 256);
- subplot(4,2,7);
- imhist(I3, 256);
- subplot(4,2,8);
- imhist(I4, 256);
- I5 = imread('hist1.bmp');
- figure(2);
- subplot(2,1,1);
- imshow(I5);
- subplot(2,1,2);
- imhist(I5, 256);
- I6=imadjust(I5);
- figure(3);
- subplot(1,2,1);
- imshow(I6);
- subplot(1,2,2);
- imhist(I6,256);
- [H,x] = imhist(I6);
- C = cumsum(H);
- k=max(C)./max(H);
- C2=C./k;
- figure(4);
- hold on;
- plot(x,H);
- plot(x,C2);
- hold off;
- [H,x] = imhist(I5);
- C3 = cumsum(H);
- k=max(C3)./max(H);
- C4=C3./k;
- figure(5);
- hold on;
- plot(x,H);
- plot(x,C4);
- hold off;
- [H,x] = imhist(I5,256);
- lut = intlut(I5, uint8(255*C2/max(C2)));
- [H2,x2]=imhist(lut,256);
- Ch = cumsum(H2);
- k=max(Ch)./max(H2);
- Ch2=Ch./k;
- figure(6);
- subplot(2,1,1);
- imshow(lut);
- subplot(2,1,2);
- hold on;
- plot(x,H);
- plot(x2,Ch2);
- hold off;
- A = histeq(I5, 256);
- figure(7);
- imshow(A);
- B = adapthisteq(I5 );
- figure(8);
- imshow(B);
- %lab4 zad 2
- clearvars;
- close all;
- clc;
- I1 = imread('phobos.bmp');
- subplot(1,2,1);
- imshow(I1);
- A = histeq(I1, 256);
- subplot(1,2,2);
- imshow(A)
- load histogramZadany;
- figure(2);
- plot(histogramZadany);
- A1 = histeq(I1, histogramZadany);
- subplot(1,2,1);
- imshow(I1);
- subplot(1,2,2);
- imshow(A1);
- figure(3);
- A2 = imadjust(I1);
- subplot(1,2,1);
- imshow(A2);
- A3 = adapthisteq(I1);
- subplot(1,2,2);
- imshow(A3);
- %lab4 zad3
- clearvars;
- close all;
- clc;
- I1 = imread('lenaRGB.bmp');
- figure(1);
- imshow(I1);
- lenaR = I1(:,:,1);
- lenaG = I1(:,1,:);
- lenaB = I1(1,:,:);
- figure(2);
- subplot(1,3,1);
- imhist(lenaR);
- subplot(1,3,2);
- imhist(lenaG);
- subplot(1,3,3);
- imhist(lenaB);
- A = histeq(lenaR, 256);
- B = histeq(lenaG, 256);
- C = histeq(lenaB, 256);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement