Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usb_cam_test: explicitly configure contrast and saturation #17

Merged
merged 1 commit into from
Nov 18, 2014

Conversation

rjw57
Copy link
Member

@rjw57 rjw57 commented Nov 18, 2014

In commit ros-drivers/usb_cam@b25c2938, contrast and saturation
parameters were added to usb_cam. Unfortunately these were hard-coded to
somewhat strange values. Both were turned down towards the bottom of the
range explaining the low-contrast, low-saturation images.

In the same commit, the default focus was set at a very near value
leading to blurry images.

The combination of these factors lead to the appearance of a very broken
webcam indeed.

Set the contrast, saturation and focus explicitly in the launch file and
add a comment explaining their presence. Launch files which use the
usb_cam node should probably explicitly set contrast and saturation from
now on.

In commit ros-drivers/usb_cam@b25c2938, contrast and saturation
parameters were added to usb_cam. Unfortunately these were hard-coded to
somewhat strange values. Both were turned down towards the bottom of the
range explaining the low-contrast, low-saturation images.

In the same commit, the default focus was set at a very near value
leading to blurry images.

The combination of these factors lead to the appearance of a very broken
webcam indeed.

Set the contrast, saturation and focus explicitly in the launch file and
add a comment explaining their presence. Launch files which use the
usb_cam node should probably explicitly set contrast and saturation from
now on.
@rjw57
Copy link
Member Author

rjw57 commented Nov 18, 2014

@hutchinsonjack, @DuongLe, this should fix the webcam issue. Could you confirm if this is the case and, if so, merge? Thanks.

@rjw57
Copy link
Member Author

rjw57 commented Nov 18, 2014

Note that the commit which added this problem is only 21 days old. This probably explains why the problem does not happen on the desktop. Since the Docker image on that machine is older than 21 days and has not been invalidated via the --no-cache option, the version of the usb_cam node on that machine is too old to exhibit this problem.

Should this PR address our issue, I suggest than an issue be opened upstream explaining our problem, pointing them to this PR and asking that, at the very least, their documentation be updated to note the presence of these parameters. I only discovered them by poking at the source code.

rjw57 added a commit to rjw57/usb_cam that referenced this pull request Nov 18, 2014
The contrast, saturation, brightness, sharpness and focus parameters
were recently added to usb_cam. This caused a regression
(sigproc/robotic_surgery#17) whereby the default settings for a webcam
are overridden in all cases by the hard-coded defaults in usb_cam.

In the absence of a know good set of "default" values, leave the
parameters unset unless the user has explicitly set them in the launch
file.
@rjw57
Copy link
Member Author

rjw57 commented Nov 18, 2014

I fixed the documentation at http://wiki.ros.org/usb_cam to actually mention these parameters. I opened ros-drivers/usb_cam#24 to stop this happening to anyone else.

DuongLe added a commit that referenced this pull request Nov 18, 2014
usb_cam_test: explicitly configure contrast and saturation
@DuongLe DuongLe merged commit 95c66ca into sigproc:master Nov 18, 2014
@DuongLe
Copy link
Contributor

DuongLe commented Nov 18, 2014

It works nice and perfectly 😃
screenshot from 2014-11-18 18 39 29

@rjw57
Copy link
Member Author

rjw57 commented Nov 18, 2014

Excellent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants