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');

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Agriculture 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by