[英]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. 当我将图像传输到OpenCV的IplImage并使用
cvSaveImage("image.jpg",image)
,图像保存的大小约为160K。 Whereas, if I use fwrite
function in C to save the image buffer in .pgm
format, the saved image size is 1.4M. 而如果我在C中使用
fwrite
函数将图像缓冲区保存为.pgm
格式,则保存的图像大小为1.4M。
My question is: 我的问题是:
Does cvSaveImage()
compress the image into the specified format while saving? cvSaveImage()
是否将图像压缩为指定格式? Actually, I am working on a smart camera with ARM platform and I want to avoid the overhead of cross-compiling OpenCV for ARM. 实际上,我正在使用ARM平台开发智能相机,并且希望避免为ARM交叉编译OpenCV的开销。 How can I compress this image to
.jpg
without using cvSaveImage
, but rather using C functions? 如何不使用
cvSaveImage
而是使用C函数将该图像压缩为.jpg
?
我相信嵌入式JPEG可能就是您想要的。
Or try the Independent JPEG Group source code. 或尝试使用独立JPEG组源代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.