Saturday 15 January 2011

matlab - How to choose correct value range of green colour from histogram charts -



matlab - How to choose correct value range of green colour from histogram charts -

i tried segment leaves plant image. spend 2 weeks googling how extract right range value greenish colour histogram of hue, saturation , value colour space. used next codes:

hsv=rgb2hsv(insum); h1=hsv(:,:,1); figure, imshow(h1); h2=hsv(:,:,2); figure, imshow(h2); h3=hsv(:,:,3); figure, imshow(h3) h1(h1(:)==0)=[]; h2(h2(:)==0)=[]; h3(h3(:)==0)=[]; figure,imhist(h1); figure,imhist(h2); figure,imhist(h3); limitupperh = 0.3; limitlowerh = 0.19; limituppers = 1; limitlowers = 0.95; limitupperv = 0.6; limitlowerv = 0.02; logich = (hsv(:,:,1)<limitupperh) & (hsv(:,:,1)>limitlowerh); logics = (hsv(:,:,2)<limituppers) & (hsv(:,:,2)>limitlowers); logicv = (hsv(:,:,3)<limitupperv) & (hsv(:,:,3)>limitlowerv); logic = logich & logics & logicv; figure() imshow(logic);

i take limitupper , limitlower h, s , v works 1 image trial , error , give result 1 image, when apply these values on other images doesn’t work.

i read many things , saw many examples hsv , image histogram none how extract greenish range of h, s , v histogram chart. can 1 help me?

matlab image-processing

No comments:

Post a Comment