Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. %zad1
  2. %clear all;
  3. f=imread('11.bmp');
  4. c = rgb2gray(f);
  5. %th = 100;
  6. %d = c<th;
  7. %e=imhist(c);
  8. %bar(e);
  9. %otsu = graythresh(f);
  10. %imshow(otsu);
  11.  
  12. %zad2
  13. %a=cv.cvtColor(f, 'RGB2XYZ');
  14. %imshowpair(f,a, 'montage');
  15. %IZ = a(:,:,3);
  16. %figure;
  17. %imshow(IZ);
  18.  
  19. %d = c<100;
  20. %e = c<90;
  21. %imshowpair(d,e, 'montage');
  22. %wynik=bitxor(d,e);
  23. %figure;
  24. %imshow(wynik);
  25. %suma=sum(wynik(:));
  26.  
  27. %zad3
  28. %Mean_Method = cv.adaptiveThreshold(c, 'MaxValue', 255, 'Method', 'Mean', 'Type', 'Binary','BlockSize', 3, 'C',2);
  29. %Gaussian_Method = cv.adaptiveThreshold(c, 'MaxValue', 255, 'Method', 'Gaussian', 'Type', 'Binary', 'BlockSize', 3, 'C',2);
  30. %figure;
  31. %imshowpair(Mean_Method,Gaussian_Method, 'montage')
  32. %wynik_zad3 = bitxor(Mean_Method, Gaussian_Method);
  33. %figure;
  34. %imshow(wynik_zad3);
  35.  
  36. %zad4
  37. szumienie_solipieprz = imnoise(c, 'salt & pepper');
  38. szumienie_gaussian = imnoise(c, 'gaussian');
  39. imshowpair(szumienie_solipieprz, szumienie_gaussian, 'montage');
  40. wynik_zad4 = bitxor(Mean_Method, Gaussian_Method);
  41. figure;
  42. imshow(wynik_zad4);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement