IR output very dark without performing scaling



I am using the Structure Sensor with OpenNI on Windows. I have built an application which outputs the IR data from the Structure Sensor as a cv::Mat via OpenCV. However, the outputted IR image is very dark (almost completely black unless pointing it directly at a light in which case you see the dim outlines of the light). By scaling each pixel’s grayscale value by say 25x, it begins to resemble what you’d expect a proper IR image to look like (i.e. clearly defined objects, etc.).

Without Scaling:

With Scaling:

I have tried my same application with the Kinect v1 and it works as expected without any scaling performed. For the record, I have tried the Structure IR sensor with both PIXEL_FORMAT_RGB888 and PIXEL_FORMAT_GRAY16, both output the same.

Kinect V1 Without Scaling:

What is going on here?

Cheers, Matt


In the Kinect example you show, the IR projector is on, emitting a lot of light into the scene. But in the Structure Sensor example you show, the IR projector is off. This is the main difference I see in your screenshots. Try using a depth + IR mode and you should see the IR image with projector on.



Thanks for your reply. OK, that’s interesting. I’m not sure what you mean by depth + IR mode however, as far as I can see however in OpenNI I can only grab from one sensor at a time, not simultaneously. Do you mean I should read a frame from the depth stream and then immediately afterwards read a frame from the IR stream?

Cheers, Matt


Aha! There we go, that was the correct thing to do. Reading a depth frame before the IR frame worked and turned on the IR projector as you said. The images now look like the Kinect V1 images.

Is there any specific ordering/timing that is needed in order to get the IR projector to turn on? i.e. Do I need to read a depth frame directly before an IR frame, or does the IR frame just need to be the next thing that is read after a depth frame and the depth read operation could be ages before the IR read operation in terms of the program execution? etc.

Cheers for your help, Matt