Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- img1 = imread('image1.jpg'); %wczytanie obrazu
- img1 = double(img1)/255;
- img2 = imadjust(img1,[0.3 0.7],[]); %kontrast
- bound = 0.5;
- img3 = img2 > bound; %binaryzacja
- se = strel('square', 3);
- img4 = imdilate(img3, se); %dylatacja
- img5 = imerode(img4,se); %erozja
- [tabheight, tabWidth] = size(L5)
- disp(tabheight);
- mart = 0;
- for i = 1:256 for j = 1:tabheight
- if L5(i,j) == 1
- mart = mart + 1;
- end
- end
- end
- result = 256 * 369;
- finalResult = (mart / result) * 100;
- disp(finalResult);
- figure;
- imshow([img1 img2 img3 img4 img5]) %wyswietlanie
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement