1 Reply Latest reply on May 23, 2017 3:14 PM by Intel Corporation

    why all the coordinates from the QueryVertices are zero?


      For the following code:


      Reads the depth data from the sensor and fills in the matrix
      void SR300Camera::fillInZCoords()
      Image::ImageData depthImage;
      Image *depthMap = sample->depth;
      ->AcquireAccess(Image::ACCESS_READ, &depthImage);
      Image::ImageInfo imgInfo = depthMap->QueryInfo();
      int depth_stride = depthImage.pitches[0] / sizeof(pxcU16);
      Projection * projection = device->CreateProjection();
      unsigned int wxhDepth = depth_width * depth_height;
      Point3DF32* vertices = new Point3DF32[wxhDepth];
      ->QueryVertices(depthMap, vertices);
      *dpixels = (pxcU16*)depthImage.planes[0];
      unsigned int dpitch = depthImage.pitches[0] / sizeof(pxcU16); /* aligned width */

      for (int k = 0; k < wxhDepth; k++) {
      << "xx is " << vertices[k].x << endl;
      << "yy is " << vertices[k].y << endl;
      << "zz is " << vertices[k].z << endl;



      I just get zero for everything printed. It is told in the SDK documentation in order to convert depth image UV-map coordinates in pixels to xyz-map of realworld in mm use QueryVertices. However, for me it just returns 0. I get both colored and depth image and I am not sure what has gone wrong.

      I am not sure why I get this when debugging the code for projection:

      >? projection

      0x00000243dcfb8d18 <Information not available, no symbols loaded for libpxcprojection.dll>

          Intel::RealSense::Base: {...}

      >? device

      0x00000243dce92a80 <Information not available, no symbols loaded for libpxccamera_dcm_sr300.dll>

          Intel::RealSense::Base: {...}

      >? device->IVCAM_ACCURACY_MEDIAN


      >? projection->QueryVertices(depthMap, vertices);

      unrecognized token



        • 1. Re: why all the coordinates from the QueryVertices are zero?
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi MonaJalal,

          Thanks for reaching out.

          This code is very similar to the other thread that you opened: https://communities.intel.com/thread/114468, in that thread I asked you to provide the Visual Studio solution to test it, but if you want we are going to continue the support here to avoid confusions. 

          Having said this, I just tested the function QueryVertices in the Projection Sample using breakpoints, and it seems that the function works fine, consider that it has a large amount of pixels and some are zero, so please check all the pixels in the array.

          The best recommendation that I can give you is to adapt your code to the function in the sample, but if you still have issues, could you please provide us the Visual Studio solution that you are using? We want to test it under the same conditions as you.

          Have a nice day.

          Leonardo R.