How to make this jpeg compression faster
- by Richard Knop
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.