Quote:
Originally Posted by thblackhelmetma
Thanks for your input. Is there any particular way to intercept the images when using a USB camera?
|
Yes. Since the SmartDashboard is in Java, it is easily decompileable with tools like
JD-GUI. I looked at how the USB camera widget worked and made a public static function in it that allowed me to get the latest frame. In another widget, I had it call that function to get the image and then process it with OpenCV. If you have questions throughout the process, don't be afraid to PM me. It's taken about two seasons but I think I've finally got a grasp on how SmartDashboard's extension system works.
To start off, your SmartDashboard will probably be in C:/Users/<username>/wpilib/tools/SmartDashboard.jar. Open it up in JD-GUI and start poking around for something that resembles the USB camera widget. You'll know it when you find it:
Code:
public static final NAME = "USB Webcam Viewer";