View Single Post
  #31   Spotlight this post!  
Unread 03-02-2015, 11:18
brk brk is offline
Registered User
FRC #0180
 
Join Date: Feb 2013
Location: Florida
Posts: 11
brk is an unknown quantity at this point
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.