Latest SDK v2.0.7 - Help find any example or instructions of using c# wrapper

This is just awesome! Thanks again Andrew. Really really appreciate your help!

I solved my problem.
I was trying to use wrong OrbbecBodyTracking.dll for x86 Plugins.
Just downloaded SDK for x86 and linked the correct dll.

Hi Andrew,
thanks for this demo. i have a two issue while running application .

  1. once i run the application and select a checkbox with Body tracking and click on “Open body sensor #1” is gives “Cannot open depth sensor #1 astra_imagestream_request_modes_invalid operation” error.

  2. if i select with body trachking checkbox and click on “Open body sensor #0” button then it open black box with no data. please help me understand this.

Thanks in advance

Hello,

click on “Open body sensor #1” is gives “Cannot open depth sensor #1 astra_imagestream_request_modes_invalid operation” error.

If you have only one sensor, connected to PC, you have to use “Open Sensor #0”.

if i select with body trachking checkbox and click on “Open body sensor #0” button then it open black box with no data. please help me understand this.

Hm. If you don’t check “With body tracking”, can you see depth map?

Also, you can run application under debugger and check content of “Output Window”. May be something interesting is reported by Astra SDK there.

UPDATE: OMG! I forgot to set copying to output directory for OrbbecBodyTracking.dll in project settings. Sorry for that. Please, use the latest version from github (I’v just fixed this issue).

Has anyone some example of how to open more than one Astra pro sensor in the same computer using C# wrapper?

Has anyone some example of how to open more than one Astra pro sensor in the same computer using C# wrapper?

Hm. This sample supports two Astra Pro sensors connected to one and the same PC:

  • connect two sensors to one PC
  • build and execute sample (Ctrlt+F5 from Visual Studio)
  • click on button “Open sensor #0” to show streams from the first sensor
  • than switch back to main window (without closing of “Sensor #0” window) and click “Open sensor #1” button
  • streams from the second sensor will be shown on other window - “Sensor #1
  • manually resize and align windows “Sensor #0” and “Sensor #1” to see them simultaneously

But be aware that inside Astra SDK there are a few issues with multiple sensors support.

Thank you very much @andrew you are a rock star.

Hi @andrew Andrew,
we are working on Robot project and once a person come close to robot (within 1 meter distance) then robot start face recognition and greet the person. But there is issue with current body sensor , we calculate distance between object and camera (object means anything)

but now we want that using body tracking or Depth tracking i want to detect person first (only person, body sensor should know person standing is human not a chair or other object) and want to calculate the distance between camera and person . Please help how it is possible using this source code …

Hello @ratneshkumarcs Ratnesh,

I updated my sample to show 3D coordinates for one spine joint:

See method DrawJointLabel of BodyVisualizer class.

To solve your task you can monitor all bodies with Status == Astra.BodyStatus.Tracking, and analyze Z-coordinate (depth) for one particular (or for all tracked) joint(s). 3D world coordinates are in millimeters. But be aware that body tracking works only starting from some distance.

Thanks @andrew,
This is working perfect.

Hi @andrew Andrew,
It is possible to recognize some body gesture like Hands up pose, cross hand and stop pose using ORBBEC sensor, Please guide if there is any good resource to study and any sample source for this.

Gesture tracking is usually built on top of skeleton tracking.

But the kind of gestures you want to track are not difficult:

Keep a queue of the last 100 skeletons captured, and for every new skeleton you get, add it to the queue and remove the oldest one, and reprocess the queue:

If the most recent 20 frames of the queue had the hands over the head, and the previous frames had the hands below the head, you can effectively say you got a “raised hands” gesture detected. The same for everything else.

@andrew I’m trying to run the code but get an exception:

Exception thrown: ‘System.IO.FileLoadException’ in mscorlib.dll
Additional information: Could not load file or assembly ‘file:///C:\Users\wayne.smith\Desktop\ORBBEC resources\AstraDotNetDemo-master\AstraTestWpf\bin\Debug\Astra\amd64\AstraDotNet.dll’ or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) occurred

Do you know what might be causing this? Thanks in advance!

Hi folks,

Im testing body tracking with the latest sdk v2.0.8 on AstraDotNetDemo and the sensor only detect 2 bodies simultaneously.

Did someone find also problems with this feature?
I also tried with SimpleBodyViewer-SFML.exe distributted with the SDK and i have the same problem, only two tracked bodies.

@andrew, any suggestion?

Thanks in advance.

As far as I know this is the expected behavior. If I’m correct with the current SDK, only two skeletons can be tracked at the same time.

the original Kinect SDK had a mechanism so you could tell the tracking system which two persons to track. I don’t know if Orbbec SDK has such feature.

@victorsbd I have the same issue

Hay @andrew,

maybe you can help me!

Im trying to use Orbbec Astra in a project, but something seems to fail on initialization. I cant access AvailableModes as in Line 49 due to errors in the stream object.
Any idea on what is wrong?

Kind regards,

Simon

Hi Andrew
Thanks for the excellent example. I’m having trouble registering depth and color to get them synced.
I tried using the NiWrapper.Net but failed.
I am looking for code to achieve something like this (taken from the AstraViewer C++ example):

bool CRGBDCamera::toggleRegister(bool setRegister)
{
if (m_device.isImageRegistrationModeSupported(openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR))
{
if (setRegister){
m_device.setImageRegistrationMode(openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR);
}
else{
m_device.setImageRegistrationMode(openni::IMAGE_REGISTRATION_OFF);
}

    return true;
}
else
{
    return false;
}

}

Can you please add an example for that to the code?
Thanks
Guy

An update - while I was unable to use the hardware depth-rgb calibration, I managed to write code to do the synchronization. I am attaching the class here. This class is created for the AstraDotNetDemo. For example, when mapping depth to color, I use z * 8, because the demo code uses >>3 on the value captured from the depth sensor.
For obtaining the camera_params.ini file, you can use the AstraCalibration tool.

Translate.txt (8.3 KB)

Is there a Ubuntu Linux/Persee version of this sample by any chance?