Go to Post I can't wait to be one of those old kids who can say "Yeah, I remember the days before districts." and then watch the kid's eyes widen when I explain the days of regionals.. - rachelholladay [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-01-2013, 15:06
Warhawks Warhawks is offline
Registered User
FRC #2554
 
Join Date: Jan 2013
Location: New Jersey
Posts: 9
Warhawks is an unknown quantity at this point
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.
Reply With Quote
  #2   Spotlight this post!  
Unread 11-01-2013, 20:36
Warhawks Warhawks is offline
Registered User
FRC #2554
 
Join Date: Jan 2013
Location: New Jersey
Posts: 9
Warhawks is an unknown quantity at this point
Re: Accessing camera output

Any ideas?
Reply With Quote
  #3   Spotlight this post!  
Unread 11-01-2013, 21:19
Johnbot's Avatar
Johnbot Johnbot is offline
Es Brokein!
AKA: John Westhoff
FRC #4791 (Pandroids)
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2010
Location: Horsham, PA
Posts: 92
Johnbot is just really niceJohnbot is just really niceJohnbot is just really niceJohnbot is just really niceJohnbot is just really nice
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)?
__________________

2011-2014 - FRC 2607 - Student
2012-2012 - FLL 2249 - Coach
2015- ???? - FRC 4791 - Mentor
Reply With Quote
  #4   Spotlight this post!  
Unread 12-01-2013, 04:13
sretter's Avatar
sretter sretter is offline
Registered User
AKA: Shaked
FRC #2231 (OnyxTronix)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Shoham
Posts: 33
sretter is on a distinguished road
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
Reply With Quote
  #5   Spotlight this post!  
Unread 12-01-2013, 20:08
Warhawks Warhawks is offline
Registered User
FRC #2554
 
Join Date: Jan 2013
Location: New Jersey
Posts: 9
Warhawks is an unknown quantity at this point
Re: Accessing camera output

Quote:
Originally Posted by Johnbot View Post
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.
Reply With Quote
  #6   Spotlight this post!  
Unread 12-01-2013, 20:10
Warhawks Warhawks is offline
Registered User
FRC #2554
 
Join Date: Jan 2013
Location: New Jersey
Posts: 9
Warhawks is an unknown quantity at this point
Re: Accessing camera output

Quote:
Originally Posted by sretter View Post
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.
Reply With Quote
  #7   Spotlight this post!  
Unread 13-01-2013, 00:26
Johnbot's Avatar
Johnbot Johnbot is offline
Es Brokein!
AKA: John Westhoff
FRC #4791 (Pandroids)
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2010
Location: Horsham, PA
Posts: 92
Johnbot is just really niceJohnbot is just really niceJohnbot is just really niceJohnbot is just really niceJohnbot is just really nice
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.
__________________

2011-2014 - FRC 2607 - Student
2012-2012 - FLL 2249 - Coach
2015- ???? - FRC 4791 - Mentor

Last edited by Johnbot : 13-01-2013 at 22:58. Reason: Fixed misinformation
Reply With Quote
  #8   Spotlight this post!  
Unread 13-01-2013, 20:02
Warhawks Warhawks is offline
Registered User
FRC #2554
 
Join Date: Jan 2013
Location: New Jersey
Posts: 9
Warhawks is an unknown quantity at this point
Re: Accessing camera output

Quote:
Originally Posted by Johnbot View Post
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.
Reply With Quote
  #9   Spotlight this post!  
Unread 13-01-2013, 20:50
Johnbot's Avatar
Johnbot Johnbot is offline
Es Brokein!
AKA: John Westhoff
FRC #4791 (Pandroids)
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2010
Location: Horsham, PA
Posts: 92
Johnbot is just really niceJohnbot is just really niceJohnbot is just really niceJohnbot is just really niceJohnbot is just really nice
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.
__________________

2011-2014 - FRC 2607 - Student
2012-2012 - FLL 2249 - Coach
2015- ???? - FRC 4791 - Mentor
Reply With Quote
  #10   Spotlight this post!  
Unread 13-01-2013, 22:33
Warhawks Warhawks is offline
Registered User
FRC #2554
 
Join Date: Jan 2013
Location: New Jersey
Posts: 9
Warhawks is an unknown quantity at this point
Re: Accessing camera output

Quote:
Originally Posted by Johnbot View Post
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)
Reply With Quote
  #11   Spotlight this post!  
Unread 13-01-2013, 22:57
Johnbot's Avatar
Johnbot Johnbot is offline
Es Brokein!
AKA: John Westhoff
FRC #4791 (Pandroids)
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2010
Location: Horsham, PA
Posts: 92
Johnbot is just really niceJohnbot is just really niceJohnbot is just really niceJohnbot is just really niceJohnbot is just really nice
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.
__________________

2011-2014 - FRC 2607 - Student
2012-2012 - FLL 2249 - Coach
2015- ???? - FRC 4791 - Mentor

Last edited by Johnbot : 14-01-2013 at 16:19.
Reply With Quote
  #12   Spotlight this post!  
Unread 13-01-2013, 23:30
Warhawks Warhawks is offline
Registered User
FRC #2554
 
Join Date: Jan 2013
Location: New Jersey
Posts: 9
Warhawks is an unknown quantity at this point
Re: Accessing camera output

Quote:
Originally Posted by Johnbot View Post
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#.
Reply With Quote
  #13   Spotlight this post!  
Unread 14-01-2013, 22:34
Warhawks Warhawks is offline
Registered User
FRC #2554
 
Join Date: Jan 2013
Location: New Jersey
Posts: 9
Warhawks is an unknown quantity at this point
Re: Accessing camera output

Solved the problem, thanks to everyone who corresponded
Reply With Quote
  #14   Spotlight this post!  
Unread 15-01-2013, 10:45
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,715
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Accessing camera output

Quote:
Originally Posted by Warhawks View Post
Solved the problem, thanks to everyone who corresponded
What was the solution to the problem?
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 09:58.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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