Is my feature extraction using glcm is true or false? Please!!!

2 次查看(过去 30 天)
i am doing plant disease detection and classification. i do the following steps:
  1. preprocessing using median filtering
  2. image segmentation using color thresholder app in matlab
  3. feature extraction using GLCM
  4. classification using SVM
In this, i have done step 3 but i'm not certain it is true. So, i want to check up my code in feature extraction don't call function. How can i check up?(Eg. if i get energy=0.5, how to calculate to get 0.5 by handwritten without using mathlab function?)
My code is given in the following:
% Title : Potato Leaf Disease Detection using SVM
clc
close all
clear all
[filename, pathname] = uigetfile({'*.*';'*.bmp';'*.jpg';'*.gif'},
'Pick a Leaf Image File');
I = imread([pathname,filename]);
I = imresize(I,[256,256]);
%figure, imshow(I); title('Input Leaf Image');
%Preprocessing using median filtering
I1 = rgb2gray(I);
I2 = medfilt2(I1,[3 3]);
imshow(I2);title('Filtered Image');
%%Image Segmentation
%Background Removing using Color Thresholder app
[bw,rgb] = background_removal(I);
%Masking Green_Pixels
mask = (rgb(:,:,2)>rgb(:,:,1))&(rgb(:,:,2)>rgb(:,:,3));
seg_img=bsxfun(@times,rgb,cast(imcomplement(mask),'like',rgb));
imshow(seg_img);
%%Feature Extraction
% Convert to grayscale if image is RGB
img = rgb2gray(seg_img);
% Create the Gray Level Cooccurance Matrices (GLCMs)
glcms = graycomatrix(img);
%Evaluate 10 features from the disease affected region only
% Derive Statistics from GLCM
stats = graycoprops(glcms,'Contrast Correlation Energy Homogeneity');
Contrast = stats.Contrast;
Correlation = stats.Correlation;
Energy = stats.Energy;
Homogeneity = stats.Homogeneity;
Mean = mean2(seg_img);
Standard_Deviation = std2(seg_img);
Entropy = entropy(seg_img);
RMS = mean2(rms(seg_img));
%Skewness = skewness(img)
Kurtosis = kurtosis(double(seg_img(:)));
Skewness = skewness(double(seg_img(:)));
% Put the 10 features in an array
feat_disease = [Contrast,Correlation,Energy,Homogeneity, Mean, Standard_Deviation, Entropy, RMS, Kurtosis, Skewness];
Someone can tell me my code is true or false?
  5 个评论
Yoon ThiriZaw
Yoon ThiriZaw 2018-6-25
编辑:Image Analyst 2018-10-16
Yes, Image Analyst, I have done. where it's false in segmentation or feature extraction? Can you answer me because it is important for me. Please!

请先登录,再进行评论。

回答(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