1 Reply Latest reply on May 24, 2017 3:58 PM by Intel Corporation

    how can I convert PXCPoint3DF32 * to cv::Mat ?

    MonaJalal

      As the question suggest I am trying to convert pos3D array which is the output of QueryVertices and is in PXCPoint3DF32 * format to xyzMap which is in cv::Mat format. How should I do so?

       

       

      Is this even remotely the correct way to do this?

       

       

      /**

        * Stores the (x,y,z) data of every point in the observable world.

        * Matrix type CV_32FC3

        */

      cv::Mat xyzMap;

       

       

      std::vector<cv::Point3f> xyzBuffer;

          for (int k = 0; k < num_pixels; k++) {
               xyzBuffer.push_back(cv::Point3f(pos3D[k].x, pos3D[k].y, pos3D[k].z));
          }

          xyzMap = cv::Mat(xyzBuffer);