Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   What Java code is required to run a USB camera? (http://www.chiefdelphi.com/forums/showthread.php?t=132606)

Cobra Commander 10-01-2015 21:50

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)

Joey1939 10-01-2015 21:52

Re: What Java code is required to run a USB camera?
 
http://www.chiefdelphi.com/forums/sh...35&postcount=6

Cobra Commander 10-01-2015 21:56

Re: What Java code is required to run a USB camera?
 
Quote:

Originally Posted by Joey1939 (Post 1425951)

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");
}

Joey1939 10-01-2015 22:12

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.

Cobra Commander 10-01-2015 22:16

Re: What Java code is required to run a USB camera?
 
Quote:

Originally Posted by Joey1939 (Post 1425968)
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.

Joey1939 10-01-2015 22:27

Re: What Java code is required to run a USB camera?
 
Quote:

Originally Posted by Cobra Commander (Post 1425973)
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).

Cobra Commander 10-01-2015 22:31

Re: What Java code is required to run a USB camera?
 
Quote:

Originally Posted by Joey1939 (Post 1425985)
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?

Joey1939 10-01-2015 22:39

Re: What Java code is required to run a USB camera?
 
1 Attachment(s)
This is the SmartDashboard. I have attached a photo of how to add the USB Webcam Viewer.

rpatel3001 10-01-2015 22:41

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.

Cobra Commander 10-01-2015 22:46

Re: What Java code is required to run a USB camera?
 
Quote:

Originally Posted by Joey1939 (Post 1425997)
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!


All times are GMT -5. The time now is 02:38.

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