Detecting Hand Gestures

Mike's icon

Hi all,
I'm beginning an interactive project for which I will need to detect hand position/gestures in three dimensions with multiple spaced isight cameras. I've done a bit of preliminary research and determined that the cv.jit library is going to be extremely useful, particularly the cv.jit.moments object, but I would like to know more before I just plow into this project and blindly start testing things. Does anyone know of any good references on this topic?

Cheers,
Mike

Wesley Smith's icon

Have a look at the OpenCV library
(http://opencvlibrary.sourceforge.net/). There is some example code
to help you on that site as well as some nice functions for doing this
sort of thing. If you need an example of how to wrap an OpenCV
function into a jitter object, let me know. It's actually quite easy.
I have a number of examples on how to do this.

wes

On 8/23/06, Mike Sayre wrote:
>
> Hi all,
> I'm beginning an interactive project for which I will need to detect hand position/gestures with multiple spaced isight cameras. I've done a bit of preliminary research and determined that the cv.jit library is going to be extremely useful, particularly the cv.jit.moments object, but I would like to know more before I just plow into this project and blindly start testing things. Does anyone know of any good references on this topic?
>
> Cheers,
> Mike
>
>

joshua goldberg's icon

i would love you to post some examples, yes please!

On Aug 24, 2006, at 3:17 AM, Wesley Smith wrote:

> Have a look at the OpenCV library
> (http://opencvlibrary.sourceforge.net/). There is some example code
> to help you on that site as well as some nice functions for doing this
> sort of thing. If you need an example of how to wrap an OpenCV
> function into a jitter object, let me know. It's actually quite easy.
> I have a number of examples on how to do this.
>
> wes
>
> On 8/23/06, Mike Sayre wrote:
>>
>> Hi all,
>> I'm beginning an interactive project for which I will need to
>> detect hand position/gestures with multiple spaced isight
>> cameras. I've done a bit of preliminary research and determined
>> that the cv.jit library is going to be extremely useful,
>> particularly the cv.jit.moments object, but I would like to know
>> more before I just plow into this project and blindly start
>> testing things. Does anyone know of any good references on this
>> topic?
>>
>> Cheers,
>> Mike
>>
>>
>

Mike's icon

Thanks for the great link! I would be interested in any examples you could offer.

Gracias,
Mike

Mattijs's icon

Did you try 25jColorTracking.pat in the jitter 1.6 documentation?

Mattijs

Wesley Smith's icon

Ok, here are 3 projects for externals made using OpenCV. I haven't made any
really fancy OpenCV jitter objects, just a few quickies to see how
hard it was. The most compilcated one does a histogram backprojection
and is able to use an image to find similar objects in a video stream
based on hue. Attached are the xcode projects. You'll need Jitter
1.6 and the new SDK. You'll also have to build OpenCV for OSX on your
machine for this to work. I imaging you'll also have to do some
tweaking of the xcode project settings. If you're familiar with
building open source libraries and developing jitter externals this
shouldn't be as much work as it sounds. I got OpenCV to build the
first time with no issues. Just make sure you get it from the
repository.

I haven't tried any of this stuff on windows, so you're on your own
as far as setting
up a project goes. The code should be exactly the same however.

One note about the OpenCV jitter projects though is that you will get
one error when you try and build the first time. This will be due to
a redefinition of the typedef uchar in the OpenCV header files.
Jitter makes the same typedef. Just comment out the typedef in the
OpenCV files and everything should work fine. At least it did for me.

wes

Mike's icon

Wes,
I've been experimenting with the externals you provided, just trying to recompile them in my environment, which is WinXP, to make sure I've got everything set up correctly. Here are the errors I get.

jit.morph.obj : error LNK2019: unresolved external symbol _cvInitMatHeader referenced in function _xray_jit_morphology_matrix_calc
jit.morph.obj : error LNK2019: unresolved external symbol _cvMorphologyEx referenced in function _xray_jit_morphology_calculate_ndim
jit.morph.obj : error LNK2019: unresolved external symbol _cvDilate referenced in function _xray_jit_morphology_calculate_ndim
jit.morph.obj : error LNK2019: unresolved external symbol _cvErode referenced in function _xray_jit_morphology_calculate_ndim
jit.morph.obj : error LNK2019: unresolved external symbol _cvCreateStructuringElementEx referenced in function _xray_jit_morphology_kernel_new
jit.morph.obj : error LNK2019: unresolved external symbol _cvReleaseStructuringElement referenced in function _xray_jit_morphology_kernel_free
jit.morph.obj : error LNK2019: unresolved external symbol _cvCreateMat referenced in function _xray_jit_morphology_new
jit.morph.obj : error LNK2019: unresolved external symbol _cvReleaseMat referenced in function _xray_jit_morphology_free
....sysbuildwin_debugexternalsjitter-externalsjit.morph.mxe : fatal error LNK1120: 8 unresolved externals

So obviously I've done something wrong, but I included both the cv/include and cxcore/include directories - which is all I thought I needed. I commented out the uchar definition as well. Did you have this problem or am I just 'gifted'?

Cheers,
Mike

Wesley Smith's icon

Hi Mike,
These are all linker errors that have to do with the OpenCV library
itself. You mentioned you put the include (i.e. .h headers) in the
search path, but this is only the first part of the 2 step compilation
process. First things are compiled, then things are linked together.
You need to setup your linker paths correctly. Often this is also
called the library path is in Visual Studio is generally an entirely
different set of configuration settings that need to be taken care of.
From what I can tell, if you set your linker/library paths to include
the directory that the OpenCV library is in, you'll have no more
errors compiling this thing.

wes

On 9/13/06, Mike Sayre wrote:
>
> Wes,
> I've been experimenting with the externals you provided, just trying to recompile them in my environment, which is WinXP, to make sure I've got everything set up correctly. Here are the errors I get.
>
> jit.morph.obj : error LNK2019: unresolved external symbol _cvInitMatHeader referenced in function _xray_jit_morphology_matrix_calc
> jit.morph.obj : error LNK2019: unresolved external symbol _cvMorphologyEx referenced in function _xray_jit_morphology_calculate_ndim
> jit.morph.obj : error LNK2019: unresolved external symbol _cvDilate referenced in function _xray_jit_morphology_calculate_ndim
> jit.morph.obj : error LNK2019: unresolved external symbol _cvErode referenced in function _xray_jit_morphology_calculate_ndim
> jit.morph.obj : error LNK2019: unresolved external symbol _cvCreateStructuringElementEx referenced in function _xray_jit_morphology_kernel_new
> jit.morph.obj : error LNK2019: unresolved external symbol _cvReleaseStructuringElement referenced in function _xray_jit_morphology_kernel_free
> jit.morph.obj : error LNK2019: unresolved external symbol _cvCreateMat referenced in function _xray_jit_morphology_new
> jit.morph.obj : error LNK2019: unresolved external symbol _cvReleaseMat referenced in function _xray_jit_morphology_free
> ....sysbuildwin_debugexternalsjitter-externalsjit.morph.mxe : fatal error LNK1120: 8 unresolved externals
>
> So obviously I've done something wrong, but I included both the cv/include and cxcore/include directories - which is all I thought I needed. I commented out the uchar definition as well. Did you have this problem or am I just 'gifted'?
>
> Cheers,
> Mike
>

Mike's icon

Wes,
Thanks for the speedy reply. I did try adding the openCVlib directory to my linker's dependency path, but that didn't seem to solve the problem. By browsing through the classes for some of the unresolved external symbols, I thought I had traced the missing stuff to this directory. Is there another library somewhere that I'm missing?

Thanks,
Mike

Mike's icon

Ah, Prob solved. VS didn't like that the linked libraries were on another drive, which was the default install directory for OpenCV. Once I installed them in a folder with a relative path, it worked. Do you have any other tips for modifying openCV code? I'm going to start working on getting the Haar-like Features alrorithms into a Jitter object.

Thanks,
Mike

Wesley Smith's icon

Ah, good to know. There's really no reason to modify the OpenCV code
exccept for that one uchar thing. The more you modify it, the more
out of sync you will be with future releases. You'll just want to
make your Jitter wrappers as flexible as possible. Have fun.

wes

Krapola_uxs@yahoo.com's icon

Hi folks!

" Did you try 25jColorTracking.pat in the jitter 1.6 documentation?"

Just wondering if you find this in jitter v. 1.5?

Gracias!!!!

Fernnadox