How to make this jpeg compression faster
Posted
by
Richard Knop
on Stack Overflow
See other posts from Stack Overflow
or by Richard Knop
Published on 2010-12-27T11:23:11Z
Indexed on
2010/12/27
11:53 UTC
Read the original article
Hit count: 203
I am using OpenCV to compress binary images from a camera:
vector<int> p;
p.push_back(CV_IMWRITE_JPEG_QUALITY);
p.push_back(75); // JPG quality
vector<unsigned char> jpegBuf;
cv::imencode(".jpg", fIplImageHeader, jpegBuf, p);
The code above compresses a binary RGB image stored in fIplImageHeader to a JPEG image. For a 640*480 image it takes about 0.25 seconds to execute the five lines above.
Is there any way I could make it faster? I really need to repeat the compression more than 4 times a second.
© Stack Overflow or respective owner