View Single Post
  #35   Spotlight this post!  
Unread 04-02-2015, 19:31
jreneew2's Avatar
jreneew2 jreneew2 is online now
Alumni of Team 2053 Tigertronics
AKA: Drew Williams
FRC #2053 (TigerTronics)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Vestal, NY
Posts: 213
jreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura about
Re: OpenCV for RoboRio - Release

Hello there! We are up to the point where we can grab image data from the camera and process it using OpenCV. However, we can't figure out how to get that jpeg data on the smartdashboard via CameraServer.

Here is what we have:
Code:
	std::string videoStreamAddress = "http://169.254.149.22/mjpg/video.mjpg";
	Mat frame;

	VideoCapture vidcap;
	vidcap.open(videoStreamAddress);
	vidcap >> frame;

	vector<int> param = vector<int>(2);
	param[0] = CV_IMWRITE_JPEG_QUALITY;
	param[1] = 80;
	vector<uchar> img_data;
	imencode(".jpg", frame, img_data, param);

        // This is where we're stuck :)
	RobotMap::cam_server->SetImage();
SetImage seems to take a Image object. We cannot find any real documentation on how to use this object. Any help would be most appreciated.

Thanks,
Team 2053