Effacer les filtres
Effacer les filtres

how to remove green pixels?

8 vues (au cours des 30 derniers jours)
Yoon ThiriZaw
Yoon ThiriZaw le 20 Juil 2018
Modifié(e) : Yoon ThiriZaw le 23 Juil 2018
i do plant disease detection and classification.i need a code to remove green pixels in matlab.i have done background removal using color thresholder app in matlab. I mean green pixels remove- " the pixels where the level of green is higher than red and blue are identified and remove by application of the mask.These green pixels most probably represent healthy areas in the leaves. Thus,after removing the background and green pixels,the region left in an image is the region of our interest" said in my thesis reference paper. If i get this green pixels remove, then i will do feature extraction using GLCM. So, how do i continue to remove green pixels? My code is given in the following:
% Title : Potato Leaf Diseases Detection based on Multiclass 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);
This is my image after background masking using color thresholder app in matlab; then, how to remove green pixels ? I want to get only disease leaf area.

Réponse acceptée

Matt J
Matt J le 20 Juil 2018
val= max(rgb,[],3);
mask=uint8(rgb(:,:,2)~=val);
imshow(rgb.*mask);
  11 commentaires
Image Analyst
Image Analyst le 23 Juil 2018
You fix the bug that is giving you false. graycomatrix() and graycoprops() do not return false.
Yoon ThiriZaw
Yoon ThiriZaw le 23 Juil 2018
Modifié(e) : Yoon ThiriZaw le 23 Juil 2018
Can you give me code as an feature extraction example? I don't know how to explain when my presentation this segmentatin step bsxfun.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Agriculture dans Help Center et File Exchange

Produits


Version

R2014a

Community Treasure Hunt

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

Start Hunting!

Translated by