Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Display Mat Images On SmartDashboard? (http://www.chiefdelphi.com/forums/showthread.php?t=152692)

JDub 15-12-2016 16:04

Display Mat Images On SmartDashboard?
 
I'm investigating having the team do some vision processing this year. GRIP seems like a great tool. It looks like we could use the VideoCapture class to grab an image from the camera and then run it through the image processing pipeline generated from GRIP. As a debug aid, I've found examples of how to overlay bounding rectangles and such onto the processed image, but it's not clear to me how to display the image with the overlayed info on the SmartDashboard. FRC ScreenStepsLive says to use the CameraServer class, but it uses the NIVision.Image class to represent images, not OpenCV's Mat class that is used by GRIP. Is there a way to display a Mat image on the SmartDashboard, or does anyone know of a method to convert a Mat image to a NIVision.Image image? Thanks.

euhlmann 15-12-2016 17:23

Re: Display Mat Images On SmartDashboard?
 
Converting Mat to NIVision.Image is probably too much work. Instead, you should create your own version of CameraServer that calls Imgcodecs.imencode() to create a jpeg instead of imaqFlatten().

Thad House 15-12-2016 17:37

Re: Display Mat Images On SmartDashboard?
 
If you can wait until kickoff, expect some changes then that will make this a whole lot easier. ;)

Otherwise, as euhlmann said you'd probably have to implement your own CameraServer if you want to be able to do this now.

virtuald 15-12-2016 18:48

Re: Display Mat Images On SmartDashboard?
 
If you really don't want to wait until kickoff, github is a great place to find cool new things.

JDub 15-12-2016 20:29

Re: Display Mat Images On SmartDashboard?
 
I can wait for kickoff. Thanks for the feedback everyone.


All times are GMT -5. The time now is 10:31.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi