ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

reduction in image quality in ROS

asked 2012-03-22 03:30:31 -0500

nandhini gravatar image

updated 2014-04-20 14:09:25 -0500

ngrennan gravatar image

Hi, I am working on iball 12MP camera in ubuntu . The quality of image is good when i view the video using guvcview software. When i launch the camera.launch file and view raw image, the video quality is degrading badly in the raw image. Has anyone faced the same problem? I'm working on face detection and recognition program, the input video quality is very bad, since the video goes into ROS and OpenCV. The final output also degrades. So please post your views.

my launch file

<node name="uvc_cam_node" pkg="uvc_cam" type="uvc_cam_node" output="screen"> 
    <param name="device" value="/dev/video0" /> 
    <param name="width" value="640" /> 
    <param name="height" value="480" /> 
    <param name="frame_rate" value="60" /> 

i have attatched 2 images from guvcview and uvc_cam driver below

image description image description

edit retag flag offensive close merge delete



What ROS camera driver are you using? What driver parameters?

joq gravatar image joq  ( 2012-03-22 04:53:42 -0500 )edit

i'm using the driver given in the link

nandhini gravatar image nandhini  ( 2012-03-22 21:17:23 -0500 )edit

Please update your question to include the camera launch file you are using. When you view it in guvcview, what are the parameters set to (e.g. fps, width, height, auto_exposure) and are they the same in the camera launch file?

Eric Perko gravatar image Eric Perko  ( 2012-03-23 04:42:29 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2012-03-26 13:34:40 -0500

Eric Perko gravatar image

Since you are not setting the camera parameters manually in the launch file, they are getting set to the default in the driver. Note that the driver's defaults are NOT initialized to the current settings on the camera (they are specified either in the driver code or in the UVCCam.cfg file), so whatever parameters you set in guvcview are not what is being set by uvc_cam. This could result in very dark images, as that is the desired behavior for the use case the driver forked for.

See my answer to Logitech webcams very "dark" when using uvc_cam for details on how to "undarken" your image when using my uvc_cam driver.

Your best bet is to find the set of parameters you like using the guvcview program, record them, set them with dynamic_reconfigure's reconfigure_gui while the uvc_cam driver is running (or in the launch file before starting up) and then any values you changed from default you should set in your launch file. Note that setting any unsupported modes in the reconfigure_gui may crash the driver or cause the camera to lock up and need power-cycled (Usually this is only if you try to change the resolution, as the reconfigure_gui doesn't wait to get both a width and height pair before reconfiguring the driver. I suggest setting the width and height in the launch file beforehand.)

If your problem is not a very dark image, then I suggest you include both an image from while guvcview is running and an image of the same scene with the uvc_cam driver so that we can understand the type of degradation you are seeing.

edit flag offensive delete link more


Eric, thank you. soon i will attatch those 2 images for u to compare...

nandhini gravatar image nandhini  ( 2012-03-26 20:36:55 -0500 )edit

From your launch file, you aren't setting things like saturation, gain or contrast. I believe the defaults for those result in crappy color images like the ones you see. Try using the reconfigure_gui to play with the values or just set them in the launch file to whatever it's set to in guvcview.

Eric Perko gravatar image Eric Perko  ( 2012-03-27 05:25:33 -0500 )edit

Thank you Eric! I will do

nandhini gravatar image nandhini  ( 2012-03-27 19:59:23 -0500 )edit

is it possible to launch stereo view in uvc_cam?

nandhini gravatar image nandhini  ( 2012-03-29 23:24:37 -0500 )edit

uvc_cam only supports streaming from one camera at a time, per instance of the driver. You could run two uvc_cam nodes, each connected to a different camera (with each pushed down into a namespace) to view two cameras at the same time. However, there wouldn't be any explicit synchronization.

Eric Perko gravatar image Eric Perko  ( 2012-03-30 06:52:02 -0500 )edit

answered 2012-03-25 19:09:28 -0500

nandhini gravatar image

this is my launch file. <launch> <node name="uvc_cam_node" pkg="uvc_cam" type="uvc_cam_node" output="screen"> </node> yes all the parameters are same.

edit flag offensive delete link more



You should edit your original question to reflect this new information instead of posting it as an answer. Answers may be reordered by votes or age, so it will not necessarily make sense to the next person with this problem.

Eric Perko gravatar image Eric Perko  ( 2012-03-26 13:18:46 -0500 )edit

ok. i have put the launch file with all the parameters. i don know why it is not getting displayed. i have updated my question by your advice. my parameters(width-640, ht-480, fps-60) are not getting displayed there also..

nandhini gravatar image nandhini  ( 2012-03-26 20:03:03 -0500 )edit

You needed to put them in a "code" block in the question (otherwise I assume they were being interpreted as HTML or something). I edited your question to fix that.

Eric Perko gravatar image Eric Perko  ( 2012-03-27 05:23:04 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2012-03-22 03:30:31 -0500

Seen: 1,209 times

Last updated: Mar 27 '12