Go to Post You don't become great because of your sponsors, you become sponsored because of your greatness. - Bdf809 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rating: Thread Rating: 3 votes, 2.33 average. Display Modes
  #1   Spotlight this post!  
Unread 10-01-2015, 21:50
Cobra Commander's Avatar
Cobra Commander Cobra Commander is offline
Registered User
FRC #0498 (Cobra Commanders)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2001
Location: Glendale, AZ
Posts: 30
Cobra Commander is on a distinguished road
Question What Java code is required to run a USB camera?

We have a Logitech c270 web cam, the WebViewer does detect the camera but I can not find sample code of what needs to accompany our new camera. (Java by the way)
  #2   Spotlight this post!  
Unread 10-01-2015, 21:52
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 144
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
Re: What Java code is required to run a USB camera?

http://www.chiefdelphi.com/forums/sh...35&postcount=6
  #3   Spotlight this post!  
Unread 10-01-2015, 21:56
Cobra Commander's Avatar
Cobra Commander Cobra Commander is offline
Registered User
FRC #0498 (Cobra Commanders)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2001
Location: Glendale, AZ
Posts: 30
Cobra Commander is on a distinguished road
Re: What Java code is required to run a USB camera?

Quote:
Originally Posted by Joey1939 View Post
I already I saw this post I put it in our code but it still didn't work.

This is the initialization code copied exactly from our robot. I did verify that it is called "cam0".

public void robotInit() {
CameraServer server = CameraServer.getInstance();
server.setQuality(50);
server.startAutomaticCapture("cam0");
}
  #4   Spotlight this post!  
Unread 10-01-2015, 22:12
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 144
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
Re: What Java code is required to run a USB camera?

What do you mean by "the WebViewer does detect the camera"? Do you mean SmartDashboard? Is there a specific error? Pictures are always helpful.
  #5   Spotlight this post!  
Unread 10-01-2015, 22:16
Cobra Commander's Avatar
Cobra Commander Cobra Commander is offline
Registered User
FRC #0498 (Cobra Commanders)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2001
Location: Glendale, AZ
Posts: 30
Cobra Commander is on a distinguished road
Re: What Java code is required to run a USB camera?

Quote:
Originally Posted by Joey1939 View Post
What do you mean by "the WebViewer does detect the camera"? Do you mean SmartDashboard? Is there a specific error? Pictures are always helpful.
No I don't mean SmartDashboard.
http://imgur.com/jzLsbAJ
I have no errors because it does not appear.
The roboRIO is detecting it I know this by looking at the 172.22.11.2 page.

Last edited by Cobra Commander : 10-01-2015 at 22:20.
  #6   Spotlight this post!  
Unread 10-01-2015, 22:27
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 144
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
Re: What Java code is required to run a USB camera?

Quote:
Originally Posted by Cobra Commander View Post
No I don't mean SmartDashboard.
http://imgur.com/jzLsbAJ
I have no errors because it does not appear.
The roboRIO is detecting it I know this by looking at the 172.22.11.2 page.
I am assuming your question is how to view the camera feed. The Webdashboard only shows connected devices. How we saw the actual feed was by opening SmartDashboard and clicking View->Add->USB Camera (Something like that).
  #7   Spotlight this post!  
Unread 10-01-2015, 22:31
Cobra Commander's Avatar
Cobra Commander Cobra Commander is offline
Registered User
FRC #0498 (Cobra Commanders)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2001
Location: Glendale, AZ
Posts: 30
Cobra Commander is on a distinguished road
Re: What Java code is required to run a USB camera?

Quote:
Originally Posted by Joey1939 View Post
I am assuming your question is how to view the camera feed. The Webdashboard only shows connected devices. How we saw the actual feed was by opening SmartDashboard and clicking View->Add->USB Camera (Something like that).
The WebDashboard was just proof that it was being detected we are trying to view it from the Driver Station. What "View" tab are you talking about?
  #8   Spotlight this post!  
Unread 10-01-2015, 22:39
Joey1939's Avatar
Joey1939 Joey1939 is offline
Registered User
AKA: Joey Holliday
FRC #1939 (Kuhnigits)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2014
Location: Kansas City, Missouri
Posts: 144
Joey1939 has a spectacular aura aboutJoey1939 has a spectacular aura aboutJoey1939 has a spectacular aura about
Re: What Java code is required to run a USB camera?

This is the SmartDashboard. I have attached a photo of how to add the USB Webcam Viewer.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2015-01-10 at 9.38.41 PM.png
Views:	237
Size:	115.5 KB
ID:	17804  
  #9   Spotlight this post!  
Unread 10-01-2015, 22:41
rpatel3001's Avatar
rpatel3001 rpatel3001 is offline
former programming/electrical chair
AKA: Rajan
FRC #1089 (Team Mercury)
Team Role: Alumni
 
Join Date: Apr 2013
Rookie Year: 2012
Location: East Windsor
Posts: 9
rpatel3001 is just really nicerpatel3001 is just really nicerpatel3001 is just really nicerpatel3001 is just really nicerpatel3001 is just really nice
Re: What Java code is required to run a USB camera?

How are you trying to access the camera feed? You will need to open the smart dashboard and add a USB camera viewer widget, or open the LabVIEW dashboard and switch the camera type to USB.
  #10   Spotlight this post!  
Unread 10-01-2015, 22:46
Cobra Commander's Avatar
Cobra Commander Cobra Commander is offline
Registered User
FRC #0498 (Cobra Commanders)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2001
Location: Glendale, AZ
Posts: 30
Cobra Commander is on a distinguished road
Re: What Java code is required to run a USB camera?

Quote:
Originally Posted by Joey1939 View Post
This is the SmartDashboard. I have attached a photo of how to add the USB Webcam Viewer.
We didn't do what you said, but it's working now. Not sure what happened. Thanks for your help though!
Closed Thread


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 02:51.

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