1

I wish to convert a mat image into a JPG image in the memory. I know I can use CvSaveImage for this, that creates a jpg file, I read it again and then stream it over the network. I wish to avoid this extra disk write-read operation. If you have any ideas, it would really help. There's a similar question on StackOverflow, but they ask how in C#, I need assistance with the C++ openCV library.

BenjaminFranklin
  • 798
  • 4
  • 13
  • 23
  • http://stackoverflow.com/questions/801199/opencv-to-use-in-memory-buffers-or-file-pointers – Warty Dec 08 '13 at 22:16

1 Answers1

4

imencode/imdecode


(and again, CvSaveImage is C, not C++. avoid the whole outdated opencv C api, if you can. there' ll be no support for it in the near future)

berak
  • 39,159
  • 9
  • 91
  • 89