![]() |
Drawing on the live camera feed?
How would I go about drawing stuff on the live camera feed on the dashboard?
I'm programming in java. |
Re: Drawing on the live camera feed?
First things first, you have to create a SmartDashboard extension with a class extending WPICameraExtension. From there you have two options: either you can override the processImage() function and use WPIJavaCV or OpenCV functions to draw on the image, or you can override paintComponent() (if you choose the latter route, make sure to call super.paintComponent() in order to actually draw the feed image). The processImage() method is what I prefer, because if you're drawing based off of the information in the image, there's no need to keep that data around for paintComponent(). However, paintComponent() provides the flexibility of the entire Swing drawing API, so it's a matter of what you want to do with it.
|
| All times are GMT -5. The time now is 10:09. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi