- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 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);
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi MonaJalal,
Thanks for reaching out!
Personally, I have not done a conversion like that, however, I have been investigating and I found information that you may find useful. First, I'd recommend you to watch this video: https://www.youtube.com/watch?v=wIkIdjN6Oyw https://www.youtube.com/watch?v=wIkIdjN6Oyw, there you'll find an explanation of how to convert RealSense images to OpenCV images. In addition to that, in this other site: https://software.intel.com/en-us/forums/realsense/topic/544860 Realsense ImageData to OpenCV Mat, you can find a snippet code to convert a color image to OpenCV image. I believe you can use that information as a reference to reach what you need.
I hope you find this information useful.
Regards,
-Yermi A.
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi MonaJalal,
Thanks for reaching out!
Personally, I have not done a conversion like that, however, I have been investigating and I found information that you may find useful. First, I'd recommend you to watch this video: https://www.youtube.com/watch?v=wIkIdjN6Oyw https://www.youtube.com/watch?v=wIkIdjN6Oyw, there you'll find an explanation of how to convert RealSense images to OpenCV images. In addition to that, in this other site: https://software.intel.com/en-us/forums/realsense/topic/544860 Realsense ImageData to OpenCV Mat, you can find a snippet code to convert a color image to OpenCV image. I believe you can use that information as a reference to reach what you need.
I hope you find this information useful.
Regards,
-Yermi A.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page