Quote:
Originally Posted by Peter Johnson
That code as-is should work fine with SmartDashboard, as it appears to be serving up just a standard MJPEG over HTTP stream. For competition you'll want to change the port number from 9090 to one of the ones allowed through the field radio. You'll need to use the mjpg streamer widget rather than the CameraServer widget, and put in the URL manually (e.g. http://10.x.y.z:9090/stream.mjpg), as the CameraServer widget uses information from NetworkTables to find the camera stream URL, and that won't be present in this instance (unless you put it there).
Note this code is inefficient in that it's decompressing and recompressing the image from the camera. The Raspberry Pi likely has enough horsepower to do this, particularly at lower resolutions, but I wanted to note this fact because you'll see more CPU use of this approach versus others for this reason.
|
Its pretty useful to edit the images before you send them. You can draw the OpenCV contours on them, put data on them, etc.