Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Accessing camera output (http://www.chiefdelphi.com/forums/showthread.php?t=110919)

Warhawks 01-10-2013 03:06 PM

Accessing camera output
 
We want to access the camera output in order to draw lines on the video.
Is there any way to do this so that the drawings appear on the driver station as the video is shown in realtime?

Notes:
-Using Java.
-The shapes do not cover the whole picture, only a small portion. The rest of the video should still be playing in realtime.

Warhawks 01-11-2013 08:36 PM

Re: Accessing camera output
 
Any ideas?

Johnbot 01-11-2013 09:19 PM

Re: Accessing camera output
 
Your best bet is to just edit your dashboard and just add a line to the display. Are you using the Smart Dashboard (gray in color) or the Labview Dashboard (Blackish in color)?

sretter 01-12-2013 04:13 AM

Re: Accessing camera output
 
If you are using Java I'll assume you are suing the SmartDashboard, then you can make a extension which extends the WPICameraExtension, and then you can overide the process image method- using rawImage.drawPolygon(I think there a more methods you can use tlike drawLine or drawRectangle) and then return the new rawImage.
This way you will have whatever shape you pick on the camera Image and the video running behind it :)

Warhawks 01-12-2013 08:08 PM

Re: Accessing camera output
 
Quote:

Originally Posted by Johnbot (Post 1213341)
Your best bet is to just edit your dashboard and just add a line to the display. Are you using the Smart Dashboard (gray in color) or the Labview Dashboard (Blackish in color)?

I am using the SmartDashboard.

Warhawks 01-12-2013 08:10 PM

Re: Accessing camera output
 
Quote:

Originally Posted by sretter (Post 1213530)
If you are using Java I'll assume you are suing the SmartDashboard, then you can make a extension which extends the WPICameraExtension, and then you can overide the process image method- using rawImage.drawPolygon(I think there a more methods you can use tlike drawLine or drawRectangle) and then return the new rawImage.
This way you will have whatever shape you pick on the camera Image and the video running behind it :)

I am new programmer for the team, I can't find "WPICameraExtension", and please provide more details. Thanx.

Johnbot 01-13-2013 12:26 AM

Re: Accessing camera output
 
You need to install http://firstforge.wpi.edu/sf/frs/do/.../frs.installer

And then import everything under
C:\Program Files\SmartDashboard
and
C:\Program Files\SmartDashboard\extensions
and
C:\Program Files\SmartDashboard\extensions\lib
into your Java Class Library (a type of project you can start in Netbeans)
You will want to have your extension class extend WPICameraExtension.
You will also want to override the method processImage, as sretter has said.

Warhawks 01-13-2013 08:02 PM

Re: Accessing camera output
 
Quote:

Originally Posted by Johnbot (Post 1214122)
You need to install http://firstforge.wpi.edu/sf/frs/do/.../frs.installer

And then import everything under
C:\Program Files\SmartDashboard
and
C:\Program Files\SmartDashboard\extensions
and
C:\Program Files\SmartDashboard\extensions\lib
into your Java Class Library (a type of project you can start in Netbeans)
You will want to have your extension class extend WPILaptopCameraExtension.
You will also want to override the method processImage, as sretter has said.

Thank you for clearing things up, I have imported the .jar files in these folders but when I try to use the classes in these files I get compile time errors such as: "cannot find symbol symbol: class WPILaptopCameraExtension", although when editing the class the IDE (NetBeans 7.2) doesn't give these errors. I have checked "java sources classpath" multiple times but still the same.

Johnbot 01-13-2013 08:50 PM

Re: Accessing camera output
 
Did you tell NetBeans to include the SmartDashboard jars as libraries?
Right-click your project, click Properties, click Libraries, and hit "Add JAR/Folder" and the choose SmartDashboard.jar, and then repeat for WPICameraExtension.jar, WPIJavaCV.jar, javacpp.jar, javac-windows-x(VERSION).jar, and javac.jar.

Warhawks 01-13-2013 10:33 PM

Re: Accessing camera output
 
Quote:

Originally Posted by Johnbot (Post 1214621)
Did you tell NetBeans to include the SmartDashboard jars as libraries?
Right-click your project, click Properties, click Libraries, and hit "Add JAR/Folder" and the choose SmartDashboard.jar, and then repeat for WPICameraExtension.jar, WPIJavaCV.jar, javacpp.jar, javac-windows-x(VERSION).jar, and javac.jar.

yes i did, still the same error(s)

Johnbot 01-13-2013 10:57 PM

Re: Accessing camera output
 
Oops, the mistake is on my part. I told you to extend the widget for accessing the computer's camera instead of the Axis Camera.
You should be extending WPICameraExtension, not WPILaptopCameraExtension, my apologies.

Warhawks 01-13-2013 11:30 PM

Re: Accessing camera output
 
Quote:

Originally Posted by Johnbot (Post 1214743)
Oops, the mistake is on my part. I told you to extend the name of the jar containing the default camera widget.
You should be extending WPICameraExtension, not WPILaptopCameraExtension, my apologies.

that is not the actual problem here, the compiler somehow cannot read the libraries that I imported, for example after I changed it to "WPICameraExtenion", I still get the same error: package edu.wpi.first.smartdashboard.camera does not exist
import edu.wpi.first.smartdashboard.camera.*;
this error occurs only during compile time, mean while, when I am editing the code, I don't get the this error. God, I have been spoiled with Visual Studio and C#.

Warhawks 01-14-2013 10:34 PM

Re: Accessing camera output
 
Solved the problem, thanks to everyone who corresponded:D

notmattlythgoe 01-15-2013 10:45 AM

Re: Accessing camera output
 
Quote:

Originally Posted by Warhawks (Post 1215481)
Solved the problem, thanks to everyone who corresponded:D

What was the solution to the problem?


All times are GMT -5. The time now is 07:45 AM.

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