Go to Post We should have a 'Steps Taken For FIRST' contest. Everyone wear a pedometer and keep a log of how many miles you walked at the St. Louis Championship. That could be a lot of fun. Do they make pedometers for robot carts? - JaneYoung [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 06-02-2017, 14:53
3205patriots 3205patriots is offline
Registered User
FRC #3205
 
Join Date: Jan 2016
Location: Concord
Posts: 7
3205patriots is an unknown quantity at this point
Changing camera settings on the Microsoft Lifecam in code

When instantiating the cameraServer, I tried to set the resolution of the camera and other aspects, to no effect. The CameraStream Viewer on the SmartDashboard doesn't seem to change in accordance to my code.
Note: I am using the Microsoft Lifecam HD-3000 and Java.

Code:
public void cameraInit(){
            serverOne = CameraServer.getInstance();
        //serverOne.startAutomaticCapture();
        //serverOne.startAutomaticCapture(0);
        camera = serverOne.startAutomaticCapture(0);
        camera.setResolution(RobotMap.IMG_WIDTH, RobotMap.IMG_HEIGHT);
        camera.setBrightness(50);
        camera.setExposureManual(50); 

    }
The errors that appear in the driver station are as follows:
Code:
  ERROR: ioctl VIDIOC_S_FMT failed at UsbCameraImpl.cpp:756: Device or resource busy (UsbUtil.cpp:122) 
    WARNING: USB Camera 0: could not set format 1 res 320x240 (UsbCameraImpl.cpp:758) 
    ERROR: ioctl VIDIOC_S_FMT failed at UsbCameraImpl.cpp:756: Device or resource busy (UsbUtil.cpp:122) 
    WARNING: USB Camera 0: could not set format 1 res 320x240 (UsbCameraImpl.cpp:758) 
    ERROR: ioctl VIDIOC_S_PARM failed at UsbCameraImpl.cpp:777: Device or resource busy (UsbUtil.cpp:122) 
    WARNING: USB Camera 0: could not set FPS to 30 (UsbCameraImpl.cpp:778)
How I'm accessing the method is through a Vision subsystem, in which I set a certain command as a default command to run that method through the initialize() method.

Another question I have was whether or not to use OpenCV to change the camera settings on the image such as brightness and exposure.
Any help is appreciated.

Last edited by 3205patriots : 06-02-2017 at 14:55. Reason: Had another question
Reply With Quote
  #2   Spotlight this post!  
Unread 06-02-2017, 17:32
MuskieProgramme MuskieProgramme is online now
Registered User
FRC #6420
Team Role: Programmer
 
Join Date: Dec 2016
Rookie Year: 2014
Location: Muscatine, IA
Posts: 36
MuskieProgramme is an unknown quantity at this point
Re: Changing camera settings on the Microsoft Lifecam in code

If you notice, your errors all include "Device or resource busy". This can occur if you are using settings that are too high for USB to support (especially with multiple cameras).
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:44.

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