Hello ; this is my simple code for leaf disease , I find the disease on leaf. I just want to show the disease and remove other noises, could you help me guys? thanks!
1 次查看(过去 30 天)
显示 更早的评论
close all;
clear all;
pic = imread('LEAF_0334.jpg');
I = imadjust(pic,stretchlim(pic));
g_im = rgb2gray(I);
eg = edge(g_im,'canny',0.3);
eg_1 = bwareaopen(eg,300);
bw = im2bw(eg);
se = strel('disk',3);
bw = imdilate(bw,se);
bw2 = imfill(bw,'holes');
r = bwlabel(bw2);
subplot(3,3,1),imshow(pic),title('original');
subplot(3,3,2),imshow(I),title('adjust');
subplot(3,3,3),imshow(g_im),title('grayscale');
subplot(3,3,4),imshow(eg_1),title('canny');
subplot(3,3,5),imshow(bw),title('dilate');
subplot(3,3,6),imshow(bw2),title('fill');
subplot(3,3,7),imshow(r),title('label');
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/667130/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/667135/image.png)
2 个评论
Image Analyst
2021-6-27
编辑:Image Analyst
2021-6-27
You forgot to attach 'LEAF_0334.jpg', or even a screenshot of your final figure, so what can we say?
Here's another chance to read the posting tips:
And edit your post to format the code as code. Highlight it and click the code icon.
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!