- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I tried running the basic hand program. All I wanted to do was print "Hey" if the camera saw a hand.
I copied this code right out of the SDK and added Console.WriteLine("HEY") .
On execution, the program kept on writing HEY even when there was no hand in front of it.
// Create an instance of the SenseManager. PXCMSenseManager sm=PXCMSenseManager.CreateInstance(); // Enable hand tracking sm.EnableHand(); // Get a hand instance here (or inside the AcquireFrame/ReleaseFrame loop) for querying features PXCMHandModule hand=sm.QueryHand(); ... // Initialize the pipeline sm.Init(); // Stream data while (sm.AcquireFrame(true)>=pxcmStatus.PXCM_STATUS_NO_ERROR) { // retrieve hand tracking results if ready PXCMHandModule hand2=sm.QueryHand(); if (hand2!=null) { Console.WriteLine("HEY") } // resume next frame processing sm.ReleaseFrame(); } // Clean up sm.Dispose();
Please Help
-Shaleen Sharda
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your code retrieves the instance of the hand module, it is simply acknowledging that the module is active in the pipeline.
You need to dig deeper into the returned data to get the tracking results.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
Thanks for the reply.
what editions can I make to check if the camera sees a hand ?
Thanks,
Shaleen Sharda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm not using hand recognition so I haven't looked into it too much. But I highly recommend the demo code that is in the SDK folder. There is a full demo app for each part of the camera, and it's fairly easy to take the class file they have created and modify it for your purposes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Okay...Also I tried the following code , it doesnt execute:
sm.EnableStream(PXCMImage.PixelFormat.PIXEL_FORMAT_RGB32,0,0);
it says it has some invalid arguments
Thanks
Shaleen Sharda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
well, it has invalid arguments...
It should be called like this:
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR, 640, 480 30);
Or just like this:
sm->EnableStream(PXCCapture::STREAM_TYPE_COLOR);
Take a look at the samples, this is thoroughly covered there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I think I've been trying this sample code, but I forget which one. Can you show me the page for downloading this sample?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
It is in almost every sample in the installed sdk.
Here for example:
Intel\RSSDK\sample\raw_streams\src\raw_streams.cpp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hi,
I am trying to get a simple hand detection code to work.
Does anyone have a sample code to show message when a hand appears in front of the camera?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Download the tutorial solution here https://software.intel.com/sites/default/files/managed/e0/5c/Tutorial_VisualStudioProjectSolution.zip
The 3_Hands_Tracking project display an alert when detecting your hand, you can add it in the handtracking_render.cpp in the NotifyAlerts function
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Here is some Java code that I am using that might help give you an idea of the steps required.
In the initialization of the device I do: senseManager.EnableHand(); PXCHandModule handModule = senseManager.QueryHand(); handData = handModule.CreateOutput(); PXCHandConfiguration handConfig = handModule.CreateActiveConfiguration(); TrackingModeType trackingMode = TrackingModeType.TRACKING_MODE_FULL_HAND; handConfig.SetTrackingMode(trackingMode); handConfig.EnableAllGestures(); handConfig.EnableAlert(AlertType.ALERT_HAND_DETECTED); handConfig.EnableAlert(AlertType.ALERT_HAND_NOT_DETECTED); handConfig.ApplyChanges(); For each frame: handData.Update(); for (int i = 0; i < handData.QueryFiredAlertsNumber(); i++) { PXCHandData.AlertData alertData = new PXCHandData.AlertData(); handData.QueryFiredAlertData(i, alertData); if (alertData.getLabel() == AlertType.ALERT_HAND_DETECTED) { log("HandTracking", "Detected hand, id: " + alertData.getHandId()); } else if (alertData.getLabel() == AlertType.ALERT_HAND_NOT_DETECTED) { log("HandTracking", "Hand lost, id: " + alertData.getHandId()); } }
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This seems like a good opportunity to highlight the method I posted a few days back for converting C# scripts in the SDK manual for use in Unity if anyone is planning on using the scripts in Unity for their project.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Shaleen,
For a simple app like this, take a look at my project:
https://github.com/andrecarlucci/SharpSenses
All that code can be replaced by:
var cam = Camera.Create();
cam.Start();
cam.LeftHand.Visible += () => Console.WriteLine("Hi");
Cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the replies.
I am stuck with another issue now. I am trying to get the no of faces detected. Here;s my code. it always prints 0.
PXCMSenseManager sm = PXCMSenseManager.CreateInstance(); sm.EnableFace(); sm.Init(); // face is a PXCMFaceModule instance while (sm.AcquireFrame()>= pxcmStatus.PXCM_STATUS_NO_ERROR ) { PXCMFaceModule face2 = sm.QueryFace(); PXCMFaceData fdata= face2.CreateOutput(); Int32 no = fdata.QueryNumberOfDetectedFaces(); Console.WriteLine(no); fdata.Dispose(); }

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page