mtschirs/js-objectdetect

example for fist or hand

Closed this issue · 8 comments

I am unable to get the objectdetect.handfist.js to work, Can you add an example on how to use this.

Please download the updated version of js-objectdetect and try again, the last commit introduced a bug in the grayscale conversion. This is now fixed, sorry for the inconvenience.

Thanks . Can you add the gesture control example , that looks great and the code can be used in a lot of places

Is this the correct usage for the handfist, It does not seem to be stable and the position keeps moving even if the fist is in one place , what am I missing here

      if (video.readyState === video.HAVE_ENOUGH_DATA) {
            $(video).objectdetect("all", {  classifier: objectdetect.handfist}, function(coords) {
                if (coords[0]) {
                    var canvas = document.getElementById('can');
                    var ctx=canvas.getContext('2d');
                    ctx.clearRect(0,0,320,240);
                    ctx.strokeStyle="rgba(0,0,0,1)";
                    //console.log ( coords[0] );
                    var x = ~~(coords[0][0] + coords[0][2] );
                    var y = ~~(coords[0][1] + coords[0][3] );
                    ctx.strokeRect(x , y ,20,20);
                } else {
                          //                        
                }
            });

Hi mkirank,
the gesture control example shown in the video is not compatible with the js-objectdetect code published here. I am a bit under pressure these weeks, but once I have some free time again I will try to make it available (including perf. updates to js-objectdetect).

I must also say that it would be awesome to get a look at the gesture control code!

gr0g commented

+1 for the gesture control code

+1 for the gesture control code

Two gesture control examples have been added, checkout the example section in the readme.