I have already asked this question on another topic but I guess it would be a good idea to open a new Topic on it.
I am using Astra Pro camera on Windows 64 bit OS. I know, currently, only Depth stream is accessible through OpenNi. Color Stream is available through UVC class which might be read with OpenCV for example.
I would like to get access to IR stream. Does anyone have a clue to do that ?
This will work on Astra - donāt know if it works on Pro version.
Download the OpenNI-2-Window-X86-Orbbec3D from Orbbec website.
Unzip and navigate to \OpenNI2\Tools. Run NiViewer.exe.
I can view RGB& depth straight away. If you like to view infrared, then right click on NiViewer window: Device>Streams>Colour>On/Off. That will turn off colour.
To turn on infrared, right click on NiViewer window: Device>Streams>IR>On/Off. Then right click on NiViewer window: Device>Streams>IR>Video Mode and select any resolution that is 640x480 or 1280x1024.
It works fine, I was able to see the IR stream.
My mistake, I was talking about coding this stream like :
openni::Status state = openni::STATUS_OK;
state = openni::OpenNI::initialize();
if (state == openni::STATUS_ERROR)
std::cout << openni::OpenNI::getExtendedError();
//const char* URI = openni::ANY_DEVICE;
state = Device.open(openni::ANY_DEVICE);
if (state == openni::STATUS_OK)
{
state = IRStream.create(Device, openni::SENSOR_IR);
if (state == openni::STATUS_OK)
{
state = IRStream.start();
if (state == openni::STATUS_OK)
{
openni::VideoFrameRef Frame;
state = IRStream.readFrame(&Frame);
if (state == openni::STATUS_OK)
{
std::cout << "Get an Image" << std::endl;
}
}
}
}
EDIT: This runs fine but it does not go further than āreadFrame(&Frame)ā. It is still waiting an image event⦠I may forget to compute a control there.
@josh Do you have any information, clue or chunk of line code which could help me with this.
It should be quite straightforward to read frame from the IR sensor but, seemingly I am not able to do it ā¦
@Victor I just confirmed that in Astra SDK v0.4, with Astra Pro, if you run the SimpleStreamViewer-SFML sample, it will initially show just a blank window*. But if you then press āiā to switch to infrared view, you should see it. You can look at the SimpleStreamViewer source code to see how it accesses infrared.
When coding this in your app, for both Astra SDK and OpenNI, make sure in your code to set the resolution of the infrared stream to 640x480 or 1280x1024.
It is blank because itās waiting for a matching color frame for the depth frames, and currently Astra Pro color isnāt supported with the SDK. If you run SimpleDepthViewer-SFML it will show Astra Pro depth.
But this solution is not really usable since you need to have a specific wrapper to get the data out. @josh is there any link between this file and OpenNi way of working ? I mean in others examples those lines are commented (with "; ") before ā¦
Then, I used the Astra Pro SDK as in the example and ⦠it works !
My Mistake: The resolution was not set properly i believe.
You can also set the IR (and other streams) resolution in code in OpenNI. Check the OpenNI2 samples or dev guide. The orbbec.ini just specifies the default when the app loads.