convertProjToRealCoords crashing programm

Hello everyone,

Everytime I try to use convertProjToRealCoords from DepthSensor it crashes my program. Here is my bit of code

auto depthTracker = DepthSensor::create();
DepthFrame::Ptr frame = depthTracker->getDepthFrame();

if (depthTracker != nullptr) {
    if (frame != nullptr) {
        Vector3 point = depthTracker->convertProjToRealCoords(28, 13, frame->getData()[13 * depthTracker->getOutputMode().xres + 28]);

As you can see, nothing too complicated. What am I doing wrong ?

I was getting some unhandled Exception errors aswell. What worked for me was to make sure that the used resolution matched the resolution of the frame the Sensor was outputting.
Hope thats the problem in your case aswell and i could help.

1 Like