I am performing Plant disease detection.so I want to identify the mostly green colored pixels. After that, based on specified threshold value that is computed for these pixels, the mostly green pixels i want to masked as follows: if the green component of the pixel intensity is less than the pre-computed threshold value, the red, green and blue components of the this pixel is assigned to a value of zero. pleae give me solution for Masking the green pixels

댓글 수: 2

Geoff Hayes
Geoff Hayes 2014년 10월 26일
It seems that you have a good idea on what has to be done. What have you tried so far?
Jagdish kamble
Jagdish kamble 2014년 10월 26일
I does not know to find threshold value .

댓글을 달려면 로그인하십시오.

답변 (2개)

Image Analyst
Image Analyst 2014년 10월 26일
편집: Image Analyst 2015년 10월 27일

2 개 추천

See my "color detection by hue" tutorial in my File Exchange http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862 It can do this. Simply adapt the thresholds, by looking at the histograms, to select green instead of yellow.

댓글 수: 8

Jagdish kamble
Jagdish kamble 2014년 10월 27일
편집: Image Analyst 2014년 10월 27일
Thank you sir for your replying.
Sir i am confusing about threshold value to select green colors.Is it standard value or randomly you selected. I am nebwie in MATLAb please help me
hueThresholdLow = 0;
hueThresholdHigh = graythresh(hImage);
saturationThresholdLow = graythresh(sImage);
saturationThresholdHigh = 1.0;
valueThresholdLow = graythresh(vImage);
valueThresholdHigh = 1.0;
Image Analyst
Image Analyst 2014년 10월 27일
There's no way graythresh() will know that green is the color you want out of all the thousands of colors in that image. You have to manually set them, just as I did in my code. Pick a hue range around .4 to .6 or so and see how that works. Like low=.4 and high=.6 or something like that. Tweak the numbers until you get what you need.
Image Analyst
Image Analyst 2014년 10월 27일
편집: Image Analyst 2014년 10월 27일
Alright I updated my demo to let you find green, yellow, red, white - whatever you specify. See attached code. Updated code should be in my File Exchange tomorrow.... http://www.mathworks.com/matlabcentral/fileexchange/28512-simple-color-detection-by-hue
Jagdish kamble
Jagdish kamble 2014년 10월 28일
Sir,value that are set fro green work for Demo images when i pick up and apply that value for thersholding its not goes as i want. i will give a snapshot a how i require the result as.... i want to extract infected region only.hope positive response from you
Jagdish kamble
Jagdish kamble 2014년 10월 28일
This is also i had done and also doing lot of different thing to extract infected region form image
rgbImage=imread('plant1.jpg');
yd = double(rgbImage)/255;
greenness = yd(:,:,2).*(yd(:,:,2)-yd(:,:,1)).*(yd(:,:,2)-yd(:,:,3));
% Threshold the greenness value
thresh = 0.3*mean(greenness(greenness>0));
mask = greenness > thresh;
imshow(mask);
Image Analyst
Image Analyst 2014년 10월 28일
My code should be able to pick out the green pixels but you may have to adjust the parameters to correspond what part of the color spectrum you consider to be green. Finding disease is not just color - as you can see there are many background pixels that are of a different color but are not on leaves and so they should be counted as background, not disease. You have to locate the leaves first. Then find the non-green pixels on them.
Search Vision Bib http://www.visionbib.com/bibliography/contents.html for plant disease - there are several papers on it.
Jagdish kamble
Jagdish kamble 2014년 10월 28일
Thank you sir
saed makhool
saed makhool 2015년 10월 27일
THANKS ALOT

댓글을 달려면 로그인하십시오.

Matt Tearle
Matt Tearle 2014년 10월 27일

0 개 추천

At the risk of being accused of shameless self-promotion... I blogged about a similar problem on Steve Eddins's Image Processing blog. Perhaps some of my experiences might be of use?

카테고리

도움말 센터 및 File Exchange에서 Agriculture에 대해 자세히 알아보기

질문:

2014년 10월 26일

편집:

2015년 10월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by