- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey.
So I plan to process depth frames using OpenCV offline. I want to save a particular depth stream frame as an image openCV can interpret. This is later to be processed in OpenCV and converted into a PXCImage again for constructing point clouds.
I have functions to convert my PXCImage to CV_16U image mats (and back again). The conversion back to PXCImage works if I do it on the fly so I know these work. Also the saved image looks similar to my depth stream. However, if I first save to disk then try and load that image later on I get weird results.
I am saving my image in PGM format (said to be uncompressed) using
cv::imwrite("output.pgm", outputMat);
I load my image back using
cv::imread("output.pgm", -1);
But when I convert back to PXCImage and try to show, I just get a bunch of diagonal lines. Is the type somehow getting messed up here?
Any help much appreciated!
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sorry I was able to get things to work. I use imread with the flag CV_LOAD_IMAGE_ANYDEPTH. Things are all good :).

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page