eos 1.4.0
Loading...
Searching...
No Matches
Functions
cv Namespace Reference

Serialisation of OpenCV cv::Mat matrices for the serialisation library cereal (http://uscilab.github.io/cereal/index.html). More...

Functions

template<class Archive , cereal::traits::DisableIf< cereal::traits::is_text_archive< Archive >::value > = cereal::traits::sfinae>
void save (Archive &ar, const cv::Mat &mat)
 Serialise a cv::Mat using cereal.
 
template<class Archive , cereal::traits::DisableIf< cereal::traits::is_text_archive< Archive >::value > = cereal::traits::sfinae>
void load (Archive &ar, cv::Mat &mat)
 De-serialise a cv::Mat using cereal.
 
template<class Archive >
void serialize (Archive &ar, cv::Vec2f &vec)
 Serialisation of a cv::Vec2f using cereal.
 

Detailed Description

Serialisation of OpenCV cv::Mat matrices for the serialisation library cereal (http://uscilab.github.io/cereal/index.html).

Contains serialisation for cv::Mat matrices to binary archives, and serialisation of cv::Vec2f.

Contains also an experimental serialisation to save/load cv::Mat's from JSON.

Function Documentation

◆ load()

template<class Archive , cereal::traits::DisableIf< cereal::traits::is_text_archive< Archive >::value > = cereal::traits::sfinae>
void cv::load ( Archive &  ar,
cv::Mat &  mat 
)

De-serialise a cv::Mat using cereal.

De-serialise a cv::Mat using cereal, for text archives (JSON specifically).

Supports all types of matrices as well as non-contiguous ones.

Parameters
[in]arThe archive to deserialise from.
[in]matThe matrix to deserialise into.

Experimental: This specialisation is enabled for text archives (e.g. XML, JSON), and was created to convert the JSON output from the BFM Matlab converter script to a cereal binary model. See the notes of the save() method!

Parameters
[in]arThe archive to deserialise from.
[in]matThe matrix to deserialise into.

◆ save()

template<class Archive , cereal::traits::DisableIf< cereal::traits::is_text_archive< Archive >::value > = cereal::traits::sfinae>
void cv::save ( Archive &  ar,
const cv::Mat &  mat 
)

Serialise a cv::Mat using cereal.

Serialise a cv::Mat using cereal, for text archives (JSON specifically).

Supports all types of matrices as well as non-contiguous ones.

Parameters
[in]arThe archive to serialise to.
[in]matThe matrix to serialise.

Experimental: This specialisation is enabled for text archives (e.g. XML, JSON), and was created to convert the JSON output from the BFM Matlab converter script to a cereal binary model.

Notes:

  • Only for 2-dim matrices, and float values, i.e. CV_32FC1 cv::Mat's. Actually, only 32FC1, because of the load() method. In fact, maybe we should store the type, since we're storing cv::Mat's.
  • Writes the data row-wise to a json array? or a json object?
Parameters
[in]arThe archive to serialise to.
[in]matThe matrix to serialise.

◆ serialize()

template<class Archive >
void cv::serialize ( Archive &  ar,
cv::Vec2f &  vec 
)

Serialisation of a cv::Vec2f using cereal.

Parameters
[in]arThe archive to (de)serialise.
[in]vecThe vector to (de)serialise.