Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A=imread('C:\Users\samsung\Desktop\modelowanie\image1.jpg')
- B=imread('C:\Users\samsung\Desktop\modelowanie\image2.jpg')
- C=imread('C:\Users\samsung\Desktop\modelowanie\image3.jpg')
- subplot(2,3,1)
- imshow(A);
- subplot(2,3,2)
- imshow(B);
- subplot(2,3,3)
- imshow(C);
- grA=rgb2gray(A);
- % figure
- % imshow(grA);
- grB=rgb2gray(B);
- % figure
- % imshow(grB);
- grC=rgb2gray(C);
- % figure
- % imshow(grC);
- % ad=imadjust(gr);
- % figure
- % imshow(ad);
- binA=grA>125;
- %figure
- %imshow(bin);
- binB=grB>125;
- % figure
- % imshow(bin);
- binC=grC>125;
- % figure
- % imshow(bin);
- % filt=medfilt2(bin,[3,3]);
- % filt=medfilt2(bin,[3,3]);
- % figure
- % imshow(filt);
- % bw=im2bw(filt);
- % figure
- % imshow(bw);
- elemstr = strel('disk',2);
- erodeobrA = imerode(binA,elemstr);
- dilateobrA = imdilate(erodeobrA,elemstr);
- elemstr = strel('disk',1);
- erodeobrB = imerode(binB,elemstr);
- dilateobrB = imdilate(erodeobrB,elemstr);
- % elemstr = strel('disk',1);
- % erodeobrC = imerode(binC,elemstr);
- % dilateobrC = imdilate(erodeobrC,elemstr);
- %B
- % figure
- % imshow(dilateobr);
- filtrA=medfilt2(dilateobrA,[3,3]);
- filtrA = bwmorph(filtrA,'clean');
- % figure
- % imshow(filtrA);
- filtrB=medfilt2(dilateobrB,[3,3]);
- filtrB = bwmorph(filtrB,'clean');
- % figure
- % imshow(filtrB);
- filtrC=medfilt2(binC,[3,3]);
- filtrC = bwmorph(filtrC,'clean');
- filtrC = bwmorph(filtrC,'erode');
- % figure
- % imshow(filtrC);
- filtr2A=medfilt2(filtrA,[3,3]);
- subplot(2,3,4);
- imshow(filtr2A);
- filtr2B=medfilt2(filtrB,[3,3]);
- subplot(2,3,5);
- imshow(filtr2B);
- filtr2C=medfilt2(filtrC,[3,3]);
- subplot(2,3,6);
- imshow(filtr2C);
- SA=numel(filtrA);
- JA=nnz(filtrA);
- wartA=JA/SA;
- SB=numel(filtrB);
- JB=nnz(filtrB);
- wartB=JB/SB;
- SC=numel(filtrC);
- JC=nnz(filtrC);
- wartC=JC/SC;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement