How to get the threshold values so i can just get my hand in the binary image?

1 次查看(过去 30 天)
I am trying to count the number of fingers shown by the user's hand for which i need a binary image with just the hand and other things removed.How should i find the threshold values to get something like this?
Image.png

回答(1 个)

KALYAN ACHARJYA
KALYAN ACHARJYA 2019-9-13
编辑:KALYAN ACHARJYA 2019-9-13
Hi Akshat,
In your image the object (ROI) and image is clearly separable, you can directly apply the imbinirize function on the input image.
result=imbinrize(gray_image);
By default it uses the otshu method to find the threshold value. see other methods detail
Also you can set the threshold own limit (range 0 to 1, say 0.4 etc), and see the results, test with different threshold values and check the best result in your case. In addition after binary operation, you can do some morphological operation to smoth the boundary and segment ROI blobs on binirize image to extract the region of interest (not always).
Already I have mentioned, in your case the hand is clearly separable, just try it. If you will find any difficulty, let me know.
Good Wishes!

Community Treasure Hunt

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

Start Hunting!

Translated by