Save matrix of double values ​​in OpenCV

I have a dual (CV_32F) OpenCV matrix. I would like to save it to disk. I know, I could convert it to a single-channel 8-bit IplImage and save it. But in this way I lose accuracy. Is there a way to save it directly in 32-bit format without having to convert it first? It would also be nice if the resulting file had an image format, so I can view the result as an image.

+3
source share
3 answers

You can always save any "object" (CvMat, IplImage, anything ..) from OpenCV "as is" using cvSave () and loading it with cvLoad (). As for my experience, most floating point images do not work correctly, I usually save floating point data this way. However, you cannot directly view the saved data.

, , OpenEXR. , , EXR . , OpenCV OpenEXR, , , , / . fp- *.exr, , .

+3

. , , PPM. , , 0-255.

0

, , .

, , Portable Float Map (PFM). , float , , . . , HDR.

, "" , 8- , . Matlab ( imshow), .

EXR HDR HDR Photomatix, , . HDR , , " ", .

0
source

Source: https://habr.com/ru/post/1746731/


All Articles