Advertisement
Guest User

Untitled

a guest
Oct 10th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. clear all;
  2. close all;
  3.  
  4. p = imread("Tygrys.bmp");
  5. I = cv.cvtColor(p,'RGB2XYZ');
  6. IZ = I(:,:,2);
  7. th = graythresh(IZ) * 255;
  8. B = IZ < th;
  9. imshow(B);
  10. IG = cv.cvtColor(p,'RGB2GRAY');
  11. th = graythresh(IG) * 255;
  12. C = IG < th;
  13.  
  14. figure;
  15. imshow(C);
  16.  
  17. D = bitxor(B,C);
  18. figure;
  19. imshow(D);
  20.  
  21. sum(D(:));
  22. IMGmean = cv.adaptiveThreshold(IG);
  23. IMGgaussian = cv.adaptiveThreshold(IG, 'Method', 'Gaussian');
  24.  
  25. figure;
  26. imshow(IMGmean);
  27. figure;
  28. imshow(IMGgaussian);
  29.  
  30. IMGNgaussian = imnoise(IG, 'gaussian');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement