1

I want to use openCV to detect when a person raises or lowers a hand or both hands. I have looked through the tutorials provided by python opencv and none of them seem to do the job. There is a camera that sits in front of the 2 persons, about 50cm away from them(so you see them from the waist up). The person is able to raise or lower each arm, or both of the arms and I have to detect when they do that.(the camera is mounted on the bars of the rollercoaster; this implies that the background is always changing)

How can I detect this in the fastest time possible? It does not have to be real time detection but it does not have to be more than 0.5seconds. The whole image is 640x480. Now, since the hands can appear only in the top of the image, this would reduce the search area by half => 640x240. This would reduce to the problem of searching a certain object(the hands) in a constantly changing background.

Thank you, Stefan F.

2
  • Could you perhaps elaborate what you are missing in for example the Google results? Commented Oct 26, 2011 at 14:26
  • Hello. Yes. The algorithm presented works with skin color detection in HSV color space, but i need to detect the whole hand + arm, not just the hand gestures. Sometimes I may have a colored hand, other times the person might be wearing gloves. Commented Oct 27, 2011 at 15:42

1 Answer 1

1

You can try the very basic but so effective and fast solution: on the upper half of the image:

  1. canny edge detection
  2. morphologyEx with adequate Structuring element(also simple combination of erode/dilate may be enough)
  3. convert to BW using adaptive threshold
  4. Xor the result with a mask representing the expected covered area.
  5. The number of ones returned by xor in each area of the mask is the index that you should use.

This is extremely fast, you can make more than one iteration within the 0.5 sec and use the average. also you may detect faces and use them to adapt the position of your mask, but this will be more expensive :)

hope that helps

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.