简体   繁体   中英

Compressing a raw image buffer

I capture a raw image from a grayscale camera. When I transfer the image to OpenCV's IplImage and use cvSaveImage("image.jpg",image) , the image is saved with a size of around 160K. Whereas, if I use fwrite function in C to save the image buffer in .pgm format, the saved image size is 1.4M.

My question is:

Does cvSaveImage() compress the image into the specified format while saving? Actually, I am working on a smart camera with ARM platform and I want to avoid the overhead of cross-compiling OpenCV for ARM. How can I compress this image to .jpg without using cvSaveImage , but rather using C functions?

我相信嵌入式JPEG可能就是您想要的。

Or try the Independent JPEG Group source code.

http://www.ijg.org/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM