发布网友 发布时间:2022-04-23 08:43
共1个回答
热心网友 时间:2022-06-18 12:39
/** Serialization support for cv::Mat */
template<class Archive>
void save(Archive & ar, const ::cv::Mat& m, const unsigned int version)
{
size_t elem_size = m.elemSize();
size_t elem_type = m.type();
ar & m.cols;
ar & m.rows;
ar & elem_size;
ar & elem_type;
const size_t data_size = m.cols * m.rows * elem_size;
ar & boost::serialization::make_array(m.ptr(), data_size);
}