Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
  • if your opencv libs were compiled with openexr support (check cv::getBuildInformation()), you can save the image as .exr or .hdr . this is the only way with imread/imwrite.
  • you can save it as a text file, using FileStorage:

    Mat floatImg = ... FileStorage fs("my.yml", FileStorage::WRITE); fs << "myimg" << floatImg; fs.release();

    Mat floatImg; FileStorage fs("my.yml", FileStorage::READ); fs["myimg"] >> floatImg; fs.release();

  • if your opencv libs were compiled with openexr support (check cv::getBuildInformation()), you can save the image as .exr or .hdr . this is the only way with imread/imwrite.
  • you can save it as a text file, using FileStorage:


 Mat floatImg = ...
 FileStorage fs("my.yml", FileStorage::WRITE);
 fs << "myimg" << floatImg;
 fs.release();

fs.release();

Mat floatImg; FileStorage fs("my.yml", FileStorage::READ); fs["myimg"] >> floatImg; fs.release();

fs.release();