필터 지우기
필터 지우기

How to create histogram for finding the threshold for object detection?

조회 수: 2 (최근 30일)
Hi, i'm doing my project on hand gesture recognition. And trying to find out the threshold value for segmenting the hand region. Anyone, can you please tell me how to find out the threshold value using histogram based method?

채택된 답변

Image Analyst
Image Analyst 2015년 1월 21일
I'd take the histogram of your image and then plot it and look at the shape to determine how to threshold. There are many, many ways.
% Let's compute and display the histogram.
[pixelCount, grayLevels] = imhist(grayImage);
bar(grayLevels, pixelCount);
grid on;
title('Histogram of original image', 'FontSize', fontSize);
xlim([0 grayLevels(end)]); % Scale x axis manually.
  댓글 수: 5
Image Analyst
Image Analyst 2015년 1월 22일
I think you're also confused about what would be the best kind of background to use. Why are you using a colored, patterned background instead of something like black velvet, or at the very least a colored background that has no pattern and a very much different color than the hand? So your first step is to fix your image capture problem. Then finding the threshold will be much, much simpler. Otherwise you'll have to do color segmentation and the patterns will not let you get a very good boundary to your hand.
Nafeesath Musfira
Nafeesath Musfira 2015년 1월 22일
Yup, that's true sir. I'll try with simpler background. Thank you sir.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by