FRCVision on Raspberry Pi: Help Accessing OpenCV

I can access the Web interface, but cannot get opencv code to work. How can I edit the python example program to output a opencv image? Any help would be appreciated.

https://docs.wpilib.org/en/latest/docs/software/vision-processing/raspberry-pi/the-raspberry-pi-frc-console.html#vision-workflows Has some helpful information.

To create a stream in Python, do this:

stream = CameraServer.getInstance().putVideo("Stream 2", WIDTH, HEIGHT)

To put a new image to the stream, do this:

stream.putFrame(frame)

Finally, you can view this stream at http://frcvision.local:1182

Since the Python stuff on the FRCVision uses RobotPy, take a look at the RobotPy documentation on CameraServer: https://robotpy.readthedocs.io/en/stable/vision/code.html

1 Like