Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

for 32-bit floating values through Opencv .exr format is also another alternative except cv::Filestorage. If you want your values also in .txt file you can have a look at the cv::formater, there is an example described here. However, my experience shows that both Filestorage and and formater are not feasible for big files and .exr format works better. The way you can save and read .exr files is as follows:

Read:

Mat matrix = imread("filename.exr", IMREAD_ANYCOLOR | IMREAD_ANYDEPTH);

and Write:

imwrite("filename.exr", matrix);