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

 Respuesta aceptada

Image Analyst
Image Analyst el 23 de Sept. de 2016
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 comentarios

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 el 24 de Sept. de 2016
Editada: Image Analyst el 25 de Sept. de 2016
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 el 25 de Sept. de 2016
Editada: parul mittal el 25 de Sept. de 2016
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.
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.
Do you have a leaf on a pink gradient background that you want to post?
Yes sr I do have.. Once I Complete project with white background than il post it. Thnx sr

Iniciar sesión para comentar.

Más respuestas (1)

waqar ismail
waqar ismail el 4 de Feb. de 2018
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

Categorías

Más información sobre Agriculture en Centro de ayuda y File Exchange.

Preguntada:

el 23 de Sept. de 2016

Respondida:

el 4 de Feb. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by