|
Re: OpenCV for RoboRio - Release
To encode the JPEG, i have:
unsigned int SPAMVision::_encodeJpeg(std::vector<uchar> & dst, cv::Mat src, int quality)
{
std::vector<int> param = std::vector<int>(2);
param[0] = CV_IMWRITE_JPEG_QUALITY;
param[1] = quality;
cv::imencode(".jpg", src, dst, param);
return dst.size();
}
And I use this in something very similar to the CameraServer class.
|