Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function [binarisasiImage, binarisasiImageLabel] = BinarisasiSegProcess(I)
- img_bin = I;
- % pic_grey = rgb2gray(pic);
- % imshow(pic_grey);
- img_bin1 = adaptivethreshold(img_bin,150,0.04,0);
- figure, imshow(img_bin1);
- img_bin2 = ~img_bin1;
- figure, imshow(img_bin2);
- img_bin3 = bwareaopen(img_bin2,50);
- figure, imshow(img_bin3);
- se_bin = strel('disk',5);
- img_bin4 = imclose(img_bin3, se_bin);
- figure, imshow(img_bin4);
- img_bin5 = imfill(img_bin4,'holes');
- figure, imshow(img_bin5);
- binarisasiImage = bwareaopen(img_bin5,200);
- figure, imshow(binarisasiImage);
- binarisasiImageLabel = bwlabel(binarisasiImage);
Add Comment
Please, Sign In to add comment