How can I show camera frame in my Unity Project with Nuitrack Sdk?

Hi all,

I am using Orbbec Astra as a sensor. Orbbec SDK does contain a sample scene where they have shown camera frame showing what is being faced by camera but when I integrate Nuitrack’s NuitrackScript prefab it doesn’t work. Any idea how can I implement camera frame using Nuitrack’s code without help of any object from Orbbec’s sdk?

Thanks,
Nitish

if you are using the Astra Pro - you need to set the id of the usb camera in the nuitrack.config - then open the color stream from nuitrack

if you are using the astra or astra s - you just open the color stream nuitrack does the rest

Westa

Thanks Westa for your reply.
I am using Astra Pro and developing my app on Unity.
Where can I find ID of usb camera? And do i need to change the following CameraID variable?
“AstraProPerseeDepthProvider”: {
“Windows”: {
“CameraID”: -1
},
What do you mean by open color stream, do you mean the allModulesScene sample scene?

Yes the USB ID of the Astra Pro needs to be loaded into there - have a look at the orbbec sdk samples you should be able to find the usb id.

Then in unity - set - Color Module On - in the nuitrack manager
Then have a look at the 3D Point Cloud example - it shows how to look at the Color Frame

Westa

I went through all the scripts within Orbbec sdk samples, but wan’t able to locate the USB Id. Maybe I am missing something. Could you please tell where exactly it is located? Also is this CameraID same for all Astra Pros for each Astra Pro has a unique Camera ID?
Thanks for your help!

Nitish

The id’s are specific to each setup as far as im aware. Have a look at this thread on the orbbec site:

Westa

In mentioned post tgoodall have fetched the devices list in C++, but in unity I am unable to find OpenNI namespace to enumerate devices. Any idea how can I fetch device list in unity?

Thanks,
Nitish

HI,

In case someone else is facing the same issue. I used unity’s build in class to mirror webcam on UI element with below code:

public class WebCamTextureOnUI : MonoBehaviour
{
public RawImage rawimage;
void Start ()
{
WebCamTexture webcamTexture = new WebCamTexture();
rawimage.texture = webcamTexture;
rawimage.material.mainTexture = webcamTexture;
webcamTexture.Play();
}
}

Thanks,
Nitish

Hi,

In case of Orbbec Astra PRO and Windows platform you should enable color stream manually:

  1. open %NUITRACK_HOME%/data/nuitrack.config in a text editor;
  2. set “AstraProPerseeDepthProvider.Windows.CameraID” value to your camera ID (it’s 0 usually, if it doesn’t work try 1,2,… and so on).

Thanks,
Nitish