Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %zad1
- %clear all;
- f=imread('11.bmp');
- c = rgb2gray(f);
- %th = 100;
- %d = c<th;
- %e=imhist(c);
- %bar(e);
- %otsu = graythresh(f);
- %imshow(otsu);
- %zad2
- %a=cv.cvtColor(f, 'RGB2XYZ');
- %imshowpair(f,a, 'montage');
- %IZ = a(:,:,3);
- %figure;
- %imshow(IZ);
- %d = c<100;
- %e = c<90;
- %imshowpair(d,e, 'montage');
- %wynik=bitxor(d,e);
- %figure;
- %imshow(wynik);
- %suma=sum(wynik(:));
- %zad3
- %Mean_Method = cv.adaptiveThreshold(c, 'MaxValue', 255, 'Method', 'Mean', 'Type', 'Binary','BlockSize', 3, 'C',2);
- %Gaussian_Method = cv.adaptiveThreshold(c, 'MaxValue', 255, 'Method', 'Gaussian', 'Type', 'Binary', 'BlockSize', 3, 'C',2);
- %figure;
- %imshowpair(Mean_Method,Gaussian_Method, 'montage')
- %wynik_zad3 = bitxor(Mean_Method, Gaussian_Method);
- %figure;
- %imshow(wynik_zad3);
- %zad4
- szumienie_solipieprz = imnoise(c, 'salt & pepper');
- szumienie_gaussian = imnoise(c, 'gaussian');
- imshowpair(szumienie_solipieprz, szumienie_gaussian, 'montage');
- wynik_zad4 = bitxor(Mean_Method, Gaussian_Method);
- figure;
- imshow(wynik_zad4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement