且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在内存缓冲区或文件指针中使用的 OpenCV

更新时间:2022-06-12 00:03:37

在库的 SVN 版本中有几个未公开的函数:

There are a couple of undocumented functions in the SVN version of the libary:

CV_IMPL CvMat* cvEncodeImage( const char* ext, 
                              const CvArr* arr, const int* _params )

CV_IMPL IplImage* cvDecodeImage( const CvMat* _buf, int iscolor )

最新签入消息指出它们用于 bmp、png、ppm 和 tiff(仅编码)的本机编码/解码.

Latest check in message states that they are for native encoding/decoding for bmp, png, ppm and tiff (encoding only).

或者,您可以使用标准图像编码库(例如 libjpeg)并操作 IplImage 中的数据以匹配编码库的输入结构.

Alternatively you could use a standard image encoding library (e.g. libjpeg) and manipulate the data in the IplImage to match the input structure of the encoding library.