anqixu / ueye_cam

A ROS nodelet and node that wraps the driver API for UEye cameras by IDS Imaging Development Systems GMBH.
Other
60 stars 102 forks source link

image stream is not the right size when cropping area of interest #5

Closed anuppari closed 10 years ago

anuppari commented 10 years ago

When cropping the image (i.e. setting image_width and image_height smaller than the camera resolution), the actual size of the image on the /camera/image_raw topic is the same size as the camera resolution, just with padded zeros. For example, if the camera resolution is 752x480 and the image is cropped to 640x480, the size of the data on the image_raw topic is still 752x480, with columns 641 through 752 equal to zeros. The correct information is displayed in the camera_info topic (i.e. 640x480). This causes rviz to be unable to display cropped images, because the camera_info topic and the actual image_raw image size do not match.

anqixu commented 10 years ago

Hi anuppari:

I just tried what you had described using ueye_cam/launch/rgb8.launch and rqt_reconfigure, but I could not replicate this error. Please provide these additional information for debugging:

Anqi

anuppari commented 10 years ago

-Github won't let me upload the bag files. How can I send them to you? -I'm using a UEye UI-1226LE-M-GL. -I'm not sure which git changeset (or where to find this) but I just cloned the repo a few days ago, so it should be up to date. -Lubuntu 14.04. (I've also had the same issue on Ubuntu 12.04) -ROS Indigo (I've also had the same issue on ROS Hydro) -I use a modified version of rgb8.launch. The only things I change are auto_exposure, auto_frame_rate, (though I've had the same issue with those off) and image_width. -I have not calibrated the camera yet. However, when I ran into this issue before on the 12.04 machine the camera was calibrated and using the calibration file

Run at camera resolution: Width: 752 Height: 480 Left Pos.: -1 Top Pos.: -1 Color Mode: rgb8 Subsampling: 1 Binning: 1 Sensor Scaling: 1 Auto Gain: 0 Master Gain: 0 Red Gain: 0 Green Gain: 1 Blue Gain: 16 Gain Boost: 0 Auto Exposure: 1 Exposure (ms): 33 Auto White Balance: 1 WB Red Offset: 0 WB Blue Offset: 0 Flash Delay (us): 0 Flash Duration (us): 1000 Ext Trigger Mode: 0 Auto Frame Rate: 1 Frame Rate (Hz): 30 Pixel Clock (MHz): 25 Mirror Image Upside Down: 0 Mirror Image Left Right: 0

Run at cropped resolution: Width: 640 Height: 480 Left Pos.: -1 Top Pos.: -1 Color Mode: rgb8 Subsampling: 1 Binning: 1 Sensor Scaling: 1 Auto Gain: 0 Master Gain: 0 Red Gain: 0 Green Gain: 1 Blue Gain: 16 Gain Boost: 0 Auto Exposure: 1 Exposure (ms): 33 Auto White Balance: 1 WB Red Offset: 0 WB Blue Offset: 0 Flash Delay (us): 0 Flash Duration (us): 1000 Ext Trigger Mode: 0 Auto Frame Rate: 1 Frame Rate (Hz): 30 Pixel Clock (MHz): 25 Mirror Image Upside Down: 0 Mirror Image Left Right: 0

anqixu commented 10 years ago

Please upload the bag to my_github_name (at) cim (dot) mcgill (dot) ca. I just checked it again on ROS hydro in 12.04 and couldn't replicate the issue. I'll try on (Ubuntu) 14.04 and Indigo later today.

Are you certain that the black borders you are seeing in rviz are due to actual padding in the image? I see black borders in rviz too when I open the view, but that's only because rviz's image view has a different aspect ratio than that of the image. For instance, image_view doesn't show those black borders for me. Also, checking the actual message, the stepsize should be width * # of byte channels.

Finally, it appears that your camera is a monochrome one, and unfortunately I don't have one lying around. Could you also try explicitly setting the color_mode rosparam to mono8, and see whether the bug goes away?

anuppari commented 10 years ago

What is the username for "at cim dot mcgill dot ca"?

anqixu commented 10 years ago

my github username

anuppari commented 10 years ago

image view works fine (without black borders), however rviz spits out an error about the image not being the expected size.

Also, the length of the data field is the same regardless of i'm doing 752x480 or 640x480. Same with the step.

anuppari commented 10 years ago

I just tried using mono8 and the issue is still present.

I sent you the rosbag files

anqixu commented 10 years ago

The concern appears to be that your camera prefers to use max-width buffer at the IDS API layer, for one reason or another. 703e25e9a5edcfd21b5d97d9bdadeec032aaf272 now checks for this mismatch in step size, and will attempt to manually copy out the correct amount of content, row-by-row.

Thank you for reporting this issue. Please confirm fix + close report as appropriate.

anuppari commented 10 years ago

Thanks for your help.