MikeW
MikeW

Reputation: 119

Object gesture recognition. OpenCV C++

I'm working on a project in OpenCV for school that is supposed to detect an object(green ball in my case) and after I do some kind of gesture using that object the program should take some action, i.e if I make a 'C' shape with the object then program should allow me to change contrast.

I've worked out the object tracking and even got the x and y coordinates of the object but I've yet to do the gesture recognition. I was thinking about something like detecting turns when moving an object and based on the number of turns and their direction. I can more or less recognize the motion that the user wants to make, i.e in the 'C' letter I start in the upper right corner of the letter and according to this if I detect that my 'x' is decreasing while my 'y' is increasing and then I detect that my 'x' is increasing while 'y' is also increasing I could detect some kind of a 'C' shape motion. like shape(something like a japanese 'く' character).

My question is, Is there some other way to do this? Maybe OpenCV already has some kind of functions that can do this? I've tried looking here and on google but I only get hand recognition topics.

Every bit of information is appreciated.

Upvotes: 2

Views: 741

Answers (1)

Catree
Catree

Reputation: 2517

From my knowledge, OpenCV does not provide a built-in function that performs gesture recognition.

To achieve gesture recognition, you can search about:

But I recommend you to use the $1 Unistroke Recognizer which is a simple and effective method to perform gesture recognition on touchscreen. There is an online demo on their website and the source code is available. You can also look for the other projects on their website for more methods about gesture recognition.

What you could do is to store the 2D location of the object in a buffer and start the gesture recognition when you have enough data. You can also delimit your gesture in time by detecting the starting and ending time of your gesture (by defining a region of interest for example).

Upvotes: 1

Related Questions