How do I make the motion of the detected hand and fingertips interact with the Qt GUI like a mouse?

I am making this finger driven application (OpenCV 2.3.2 + Qt 4.7 is being developed in Visual Studio 2010) in which I would like to use the Qt GUI, especially its dialogs. Finger position will be detected and tracked through VideoCapture. Imagine using Microsoft Windows paint with just one fingertip. I was thinking about the following options:

  • subclassing QEvent and setting eventFilter to widget to filter unnecessary events
  • subclassing QCursor if mouse events depend on cursor positions.
  • making my own color picker and other input dialogs that don't subclass any of Qt's specialized dialogs, which is what I'll probably end up doing if none of the above are feasible. I have looked through the source code of QColorDialog and found QColorWell and QColorLuminancePicker and now I am thinking of the least tedious way to create similar widgets.

What could be the most practical and least time consuming way to do this? Sorry if my English was not clear or confusing. Thanks in advance.


source to share

1 answer

You can simulate this behavior by implementing a QTouchEvent and simultaneously raising the event with a possible image processing thread. You just need to generate the parameters needed by the QTouchEvent (touch points, locations, etc.) according to your image processing algorithm.



All Articles