I use OpenCV to compress binary images from the camera:
vector<int> p;
p.push_back(CV_IMWRITE_JPEG_QUALITY);
p.push_back(75);
vector<unsigned char> jpegBuf;
cv::imencode(".jpg", fIplImageHeader, jpegBuf, p);
The code above compresses the RGB binary image stored in the fIplImageHeader file into a JPEG image. For an image of 640 * 480, it takes about 0.25 seconds to complete the five lines above.
Is there any way to make this faster? I really need to repeat the compression more than 4 times per second.
source
share