Function mrpt::img::fromOpenCVMat

Function Documentation

inline CImage mrpt::img::fromOpenCVMat(const cv::Mat &mat)

Copies pixel data from a cv::Mat into a newly allocated CImage.

Supported types: CV_8UC1 (→ CH_GRAY), CV_8UC3 (→ CH_RGB), CV_8UC4 (→ CH_RGBA). The image data is deep-copied; the returned CImage is independent of mat.