5

I am working on a project with gesture recognition. Now I want to prepare a presentation in which I can only show images. I have a series of images defining a gesture, and I want to show them in a single image just like motion history images are shown in literature.

My question is simple, which functions in opencv can I use to make a motion history image using lets say 10 or more images defining the motion of hand.

As an example I have the following image, and I want to show hand's location (opacity directly dependent on time reference).

an example image

I tried using GIMP to merge layers with different opacity to do the same thing, however the output is not good. output with gimp

masad
  • 1,547
  • 1
  • 18
  • 40
  • 3
    I'm new to opencv, so not sure this is the best way to tackle this, but maybe you could try to loop over multiple images and adding into a single resulting one using [addWeighted](http://opencv.willowgarage.com/documentation/cpp/operations_on_arrays.html#cv-addweighted). Another idea that comes to mind is to play with a [background subtractor](http://www710.univ-lyon1.fr/~eguillou/documentation/opencv2/classcv_1_1_background_subtractor_m_o_g2.html) and the history size of it's learned background. – George Profenza Aug 20 '12 at 05:40

1 Answers1

5

You could use cv::updateMotionHistory
Actually OpenCV also demonstrates the usage in samples/c/motempl.c

vinjn
  • 106
  • 4
  • updateMotionHistory only works for single channel images. I was able to do this using addWeighted function. – masad Aug 21 '12 at 17:57
  • It seems what you want is simply alpha blending all the images. updateMotionHistory can do more than that, it can extract the direction of motion. – vinjn Aug 27 '12 at 01:34