Here's 832's brand new OpenCV code using python and pynetworktables:
https://github.com/oscarrobotics/VisionOnPi2016
If you're using the Pi for Vision Processing, you can also just copy the whole thing, as long as you follow the instructions in the README