JPEG image in OpenCV format in memory

Is it possible to save the image in a line instead of a file with OpenCV?

I found exactly this function in the docs:

int cvSaveImage(const char* filename, const CvArr* image)

And it can only be saved in files.

+3
source share
2 answers

How do you want to encode an image in a string?
You could just save the red, green, blue values ​​as comma-separated strings, but encoding a binary image as something like base64 would be more compact.

Edit: if you mean the jpeq format in memory, see - OpenCV for use in memory buffers or file pointers

+1
source

, char * IplImage? , , imageData, imageDataOrigin ..

, , , .

opencv - , opencv savefile,

+1

Source: https://habr.com/ru/post/1776037/


All Articles