how to choose threshold while segmenting leaf from background?

@ImageAnalyst sr I want to know how to choose segmentation threshold. As I m working on plant identification from leaf and in my database there are different images it's quite possible threshold for one image not works for another. Sr how to choose it. Kindly reply sr. Thanks

 採用された回答

Image Analyst
Image Analyst 2016 年 9 月 23 日

0 投票

Yes, that's true. If you have just random arbitrary pictures then it may not be possible to do what you want. For example if you have a photo of a forest with dozens of trees in it, then finding and classifying every type of leaf in the photo will not be possible. It's best if you can get a single leaf on a uniform background. Then you can look at the hue, saturation, and lightness histograms to come up with a scheme that works. Personally I'm a fan of triangle thresholding.

6 件のコメント

parul mittal
parul mittal 2016 年 9 月 24 日
Thanks for considering my query sr.in my data set I have leaves on uniform background only but the background colour varies some have pink and other white background. How to choose threshold for segmenting them at a time. And how to choose which colour space we should choose for segmentation hsi, rgb,hsv.
Thanks sr, kindly reply.
Image Analyst
Image Analyst 2016 年 9 月 24 日
編集済み: Image Analyst 2016 年 9 月 25 日
I'd use hsv. Have you seen my HSV color segmentation demo in my File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/?term=authorid%3A31862
Have you tried using im2bw() on each color channel individually and then ANDing or ORing them together?
Segmenting leaves on a white background is, for some reason, something that trillions of people want to do. Search on the "leaf" tag in this forum and you might find code I've posted before.
parul mittal
parul mittal 2016 年 9 月 25 日
編集済み: parul mittal 2016 年 9 月 25 日
Thanx sr, yes sr I have went through your demo files. I m going to try ur suggestions. Thanx for help. Il get back with the results.
parul mittal
parul mittal 2016 年 9 月 25 日
Thanx sr for ur kind help. And of rgb image components worked for white background, segmenting those in a loop. Il post image on pink background in that there is uneven illumination. Kindly give me it's solution also wn il post it. Once again thanks sr for kind help.
Image Analyst
Image Analyst 2016 年 9 月 25 日
Do you have a leaf on a pink gradient background that you want to post?
parul mittal
parul mittal 2016 年 10 月 6 日
Yes sr I do have.. Once I Complete project with white background than il post it. Thnx sr

サインインしてコメントする。

その他の回答 (1 件)

waqar ismail
waqar ismail 2018 年 2 月 4 日

0 投票

i need dataset of plant.. that u are using please sent me with segmentation code. it is part of my project.. mail me at waqar.ismail001@gmail.com

カテゴリ

ヘルプ センター および File ExchangeAgriculture についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by