- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
1.Enable streams
var sm = session.CreateSenseManager();
var mColorReader = SampleReader.Activate(sm);
var mColorReader.EnableStream(StreamType.STREAM_TYPE_COLOR, 1920, 1080);
var mColorReader.EnableStream(StreamType.STREAM_TYPE_DEPTH, 640, 480);
2. Enable hand tracking
HandModule handModule = HandModule.Activate(sm);
// Create the hand data instance
var handData = handModule.CreateOutput();
3.Access hand data
handData.update();
IHand hand;
var HandData.QueryHandData(AccessOrderType.ACCESS_ORDER_BY_TIME, 0, out hand);
var wristJointData = hand.TrackedJoints[JointType.JOINT_WRIST];
var position = wristJointData.positionImage;
Then how to show wrist point in color space(1920x1080)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,I figure it out by take a look at the Projection(c++) sample.
I translate it to c# .
var wrist = hand.TrackedJoints[JointType.JOINT_WRIST];
ImageData ddata;
if (sample.Depth.AcquireAccess(ImageAccess.ACCESS_READ, PixelFormat.PIXEL_FORMAT_DEPTH, out ddata) >= Status.STATUS_NO_ERROR)
{
unsafe
{
short* ptr = (short*)(ddata.planes[0] + (int)wrist.positionImage.y * ddata.pitches[0]).ToPointer();
float z = (float)ptr[(int)wrist.positionImage.x];
// Point3DF32[] depthPoints = new Point3DF32[] { new Point3DF32(wrist.positionImage.x, wrist.positionImage.y, wrist.positionImage.z) }; this line doesn't work ,strange?
Point3DF32[] depthPoints = new Point3DF32[] { new Point3DF32(wrist.positionImage.x, wrist.positionImage.y, z) };
PointF32[] colorPoints = new PointF32[] { new PointF32(-1, -1) };
projection.MapDepthToColor(depthPoints, colorPoints);
}
sample.Depth.ReleaseAccess(ddata);
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Qule,
Thank you for contacting us.
I didn't quite understand your issue, but take a look at the SDK R2 documentation: https://software.intel.com/sites/landingpage/realsense/camera-sdk/v1.1/documentation/html/index.html?sample_hands_viewer_javascript.html, you can use this sample as reference.
You can check this link too: https://software.intel.com/en-us/articles/blend-the-intel-realsense-camera-and-the-intel-edison-board-with-javascript, it also uses the same sample that I think it is what you are trying to do.
I hope you find this helpful.
Have a nice day.
Regards,
-Leonardo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks,I figure it out by take a look at the Projection(c++) sample.
I translate it to c# .
var wrist = hand.TrackedJoints[JointType.JOINT_WRIST];
ImageData ddata;
if (sample.Depth.AcquireAccess(ImageAccess.ACCESS_READ, PixelFormat.PIXEL_FORMAT_DEPTH, out ddata) >= Status.STATUS_NO_ERROR)
{
unsafe
{
short* ptr = (short*)(ddata.planes[0] + (int)wrist.positionImage.y * ddata.pitches[0]).ToPointer();
float z = (float)ptr[(int)wrist.positionImage.x];
// Point3DF32[] depthPoints = new Point3DF32[] { new Point3DF32(wrist.positionImage.x, wrist.positionImage.y, wrist.positionImage.z) }; this line doesn't work ,strange?
Point3DF32[] depthPoints = new Point3DF32[] { new Point3DF32(wrist.positionImage.x, wrist.positionImage.y, z) };
PointF32[] colorPoints = new PointF32[] { new PointF32(-1, -1) };
projection.MapDepthToColor(depthPoints, colorPoints);
}
sample.Depth.ReleaseAccess(ddata);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Qule,
That's great, it is good to know that you figured it out.
Don't doubt to contact us when you have issues.
I hope you have a nice day.
Regards,
-Leonardo
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page