How to match depth frame with RGB frame in astra stereo s u3?

Good day everyone!

I’m using the astra SDK in visual studio 2019 and I’m modifying it to detect via vision and opencv some markers. My problem comes when trying to match the depth frame to the RGB frame. I notice the first one is at 640x400, while the second one at 640x480. I’ve tried to rescale the RGB frame by diving Y position of the marker by 1.2, but it doesn’t match.

Does anyone know how to pair them?

Thank you!

Why is your depth stream resolution 640x400? You should set it to 640x480. You can do it with setResolution(int resolutionX, int resolutionY). Then use setImageRegistrationMode(openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR) if you want the depth steam to align with the color stream.

Thank you for your answer!

Should I set it to 640x480 even if its specifications say that depth sensor works at 640x400?

Another issue is that I had trouble compiling opencv with OpenNI and therefore I’m just using the Astra SDK in Visual Studio in C++

Wait! If the spec says 640x400 you better leave it at that. You can reduce the color stream resolution that way and the align the two streams.

That didn’t work either. I contacted orbbec support and they told me to enable registration mode. It works, but now it has an offset in the XY position.

Did you use setImageRegistrationMode(openni::IMAGE_REGISTRATION_DEPTH_TO_COLOR)? Other than that I cannot think of any other reason why this mismatch between the depth stream and the color steam should happen.

If it’s still relevant view my comment about this problem here

Let me know if it works :slight_smile: