MATLAB: How to choose threshold while segmenting leaf from background

digital image processingImage Processing Toolboximage segmentationleafleaf segmentation

@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

Best Answer

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.