Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- close all
- I = imread('coins.png');
- figure;
- subplot(2,1,1);
- imshow(I);
- subplot(2,1,2);
- imhist(I);
- figure;
- I = im2bw(I,80/255);
- imshow(I)
- I = imread('figura.tif');
- figure
- subplot(3,1,1);
- imshow(I);
- subplot(3,1,2);
- imhist(I);
- subplot(3,1,3);
- I = im2bw(I,76/255);
- imshow(I);
- %%Nie trudno
- I = imread('figura2.tif');
- figure
- subplot(3,1,1);
- imshow(I);
- subplot(3,1,2);
- imhist(I);
- subplot(3,1,3);
- I = im2bw(I,76/255);
- imshow(I);
- %%Tlo stracilo swoją jednolitość, został zwiekszony przedział jasnosci na histogramie
- I = imread('figura3.tif');
- figure
- subplot(3,1,1);
- imshow(I);
- subplot(3,1,2);
- imhist(I);
- subplot(3,1,3);
- I = im2bw(I,76/255);
- imshow(I);
- %%Figura stracila swoja jednolitosc, jednak jej ksztalt jest dalej czytelny
- I = imread('figura4.tif');
- figure
- subplot(3,1,1);
- imshow(I);
- subplot(3,1,2);
- imhist(I);
- subplot(3,1,3);
- I = im2bw(I,76/255);
- imshow(I);
- %% Binaryzacja jest niemozliwa, figura stracila swoj ksztalt
- figure;
- I = imread('coins.png');
- subplot(2,3,1);
- imshow(I);
- subplot(2,3,2);
- imhist(I);
- subplot(2,3,3);
- imshow(im2bw(I,80/255));
- title(['Bin. reczna: ',num2str(80/255)]);
- subplot(2,3,4);
- imshow(im2bw(I,graythresh(I)));
- title(['Bin. graythresh: ',num2str(graythresh(I))]);
- subplot(2,3,5);
- imshow(im2bw(I,clusterKittler(I)/255));
- title(['Bin. kittler: ',num2str(clusterKittler(I)/255)]);
- subplot(2,3,6);
- imshow(im2bw(I,entropyYen(I)/255));
- title(['Bin. yen: ',num2str(entropyYen(I)/255)]);
- figure
- I = imread('rice.png');
- subplot(4,2,1);
- imshow(im2bw(I,106/255));
- title(['Bin. reczna: ',num2str(80/255)]);
- subplot(4,2,2);
- imshow(im2bw(I,entropyYen(I)/255));
- title(['Bin. yen: ',num2str(entropyYen(I)/255)]);
- I = imread('tekst.bmp');
- subplot(4,2,3);
- imshow(im2bw(I,182/255));
- title(['Bin. reczna: ',num2str(182/255)]);
- subplot(4,2,4);
- imshow(im2bw(I,entropyYen(I)/255));
- title(['Bin. gray: ',num2str(graythresh(I))]);
- I = imread('obiekty.bmp');
- subplot(4,2,5);
- imshow(im2bw(I,161/255));
- title(['Bin. reczna: ',num2str(181/255)]);
- subplot(4,2,6);
- imshow(im2bw(I,entropyYen(I)/255));
- title(['Bin. Kittler: ',num2str(clusterKittler(I)/255)]);
- I = imread('katalog.bmp');
- subplot(4,2,7);
- imshow(im2bw(I,161/255));
- title(['Bin. reczna: ',num2str(161/255)]);
- subplot(4,2,8);
- imshow(im2bw(I,graythresh(I/255)));
- title(['Bin. gray: ',num2str(graythresh(I))]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement