OpenCV to use in memory buffers or file pointers

前端 未结 6 735
悲&欢浪女
悲&欢浪女 2020-12-02 21:25

The two functions in openCV cvLoadImage and cvSaveImage accept file path\'s as arguments.

For example, when saving a image it\'s cvSaveImage(\"/tmp/output.j

6条回答
  •  盖世英雄少女心
    2020-12-02 21:39

    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 )
    

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

    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.

提交回复
热议问题