Software Archive
Read-only legacy content
17061 Discussions

Hand is going to different direction [JavaScript]

Yuval_Ben_Zvi
Beginner
371 Views

Hand is going to different direction

Tested on the example  (SDK version  3.0.1).

from    (RSSDK_DIR)/framework/JavaScript/hands_viewer.html)

I am facing some issues when using this hands_viewer:

when I move my hand to left the hand image on the screen is going to the right

it looks like a Mirror behavior

the attach file contain the screen capture.

you can see that the hand image is on right side of the screen while I move my hand to the left side.

0 Kudos
6 Replies
DMaio
Beginner
371 Views

Yes, this is happened to me too. I've found a workaround[1] for this, is pretty easy, just need to make the X position negative.
Something like:

posX = -1*point.image.x+canvas.width;

 

[1] https://software.intel.com/en-us/blogs/2014/12/08/realsense-your-face-as-a-controller-using-javascript

 

Regards,
Daniele.

0 Kudos
Jonathan_M_Intel
Employee
371 Views

You can also try changing the MirrorMode setting on your device.  The below snippet will toggle the mirror function on your device, which is applied before any hand position or any other algorithms are applied.  Good luck!

PXCCapture::Device::MirrorMode mode = senseManager->QueryCaptureManager()->QueryDevice()->QueryMirrorMode();
if(mode == PXCCapture::Device::MirrorMode::MIRROR_MODE_DISABLED) {
	senseManager->QueryCaptureManager()->QueryDevice()->SetMirrorMode(PXCCapture::Device::MirrorMode::MIRROR_MODE_HORIZONTAL);
} else {
	senseManager->QueryCaptureManager()->QueryDevice()->SetMirrorMode(PXCCapture::Device::MirrorMode::MIRROR_MODE_DISABLED);
}

 

0 Kudos
DMaio
Beginner
371 Views

Jonathan T. (Intel) wrote:

You can also try changing the MirrorMode setting on your device.  The below snippet will toggle the mirror function on your device, which is applied before any hand position or any other algorithms are applied.  Good luck!

PXCCapture::Device::MirrorMode mode = senseManager->QueryCaptureManager()->QueryDevice()->QueryMirrorMode();
if(mode == PXCCapture::Device::MirrorMode::MIRROR_MODE_DISABLED) {
	senseManager->QueryCaptureManager()->QueryDevice()->SetMirrorMode(PXCCapture::Device::MirrorMode::MIRROR_MODE_HORIZONTAL);
} else {
	senseManager->QueryCaptureManager()->QueryDevice()->SetMirrorMode(PXCCapture::Device::MirrorMode::MIRROR_MODE_DISABLED);
}

 

Yes, but he's talking about JavaScript. There is any way to do it in JavaScript? As far as I see from the docs the setMirrorMode is not yet supported in JavaScript, am I wrong?

0 Kudos
Yuval_Ben_Zvi
Beginner
371 Views

Thanks everyone

I use the Daniele workaround

yuval

0 Kudos
Anthony_A_
Beginner
371 Views

I believe the latest JS release supports the namespace necessary to change the mirror setting. Can anyone provide a code sample of mirroring the camera in JS?

0 Kudos
Anthony_A_
Beginner
371 Views

I believe the latest JS release supports the namespace necessary to change the mirror setting. Can anyone provide a code sample of mirroring the camera in JS?

0 Kudos
Reply