Serializing OpenCV Mat_

前端 未结 7 1230
刺人心
刺人心 2020-11-30 05:29

I\'m working on a robotics research project where I need to serialize 2D matrices of 3D points: basically each pixel is a 3-vector of floats. These pixels are saved in an Op

7条回答
  •  没有蜡笔的小新
    2020-11-30 05:44

    You could use boost::serialization for that. It's heavily optimized and is pretty easy to integrate.

    Possible speed-ups for your case include serializing each object as a raw binary block (see boost::serialization::make_binary) and disabling version tracking (BOOST_SERIALIZATION_DISABLE_TRACKING).

    Also, you can experiment with adding compression into your serialization routines to save space (and time in case of data that is easily compressable). This can be implemented with boost::iostreams, for example.

提交回复
热议问题