Robotics StackExchange | Archived questions

Asus extrinsic calibration failing on ir image

I am trying to follow the cameraposecalibration guidelines as in ExtrinsicCalibration for the Asus Xtion Pro Live. (Using Fuerte)

The checkerboard on the colour images are detected, but on my IR images it doesn't do anything. One thing I noticed was that if I open the IR stream in imageview, it is completely black. It stays black, even if I point a halogen lamp directly at the camera. However, right-clicking saves me a nice picture of the scene. The viewer for camerapose_calibration however, shows a nice image of the IR (but it doesn't detect a checkerboard).

I have written a node that takes the IR image, and increases the contrast (multiplies everything by 256). The image now becomes visible in imageview. The image in the camerapose_calibration is completely white, but the pattern seems to be detected. (I still get "Couldn't get measurement in interval", but I'm not sure that it is related to this problem)

Can it be that there is a conversion error somewhere? I noticed the IR image is mono16 in the messages. By multiplying it by 256 I actually shifted it by 8 bit.

Here is the callback I use to transform the image:

void imageCallback(const sensor_msgs::Image::ConstPtr& msg)
{
  cv_bridge::CvImagePtr cv_ptr;
  try
  {
    cv_ptr = cv_bridge::toCvCopy(msg);
    cv_ptr->image.convertTo(cv_ptr->image, -1, alpha, beta);
  }
  catch (cv_bridge::Exception& e)
  {
    ROS_ERROR("cv_bridge exception: %s", e.what());
    return;
  }
  image_pub.publish(cv_ptr->toImageMsg());  
}

You can download the node for the workaround here and see a short explanation of it here.

Asked by WLemkens on 2013-02-18 05:57:32 UTC

Comments

I'm getting very similar ir images to what you posted (black image in image_view but a viewable image when viewing in rviz). May I ask, did you convert the ir image into a opencv type using cv_bridge to increase the contrast in ur node?I am getting an error when I try converting it to a cvImage

Asked by K_Yousif on 2013-02-18 14:54:50 UTC

Yes, I use opencv for that. I'll put the code in my question.

Asked by WLemkens on 2013-02-19 00:15:01 UTC

Thanks alot, I'll give it a try in the morning

Asked by K_Yousif on 2013-02-19 01:07:58 UTC

Did you manage to cope with this problem without image transformation ??

Asked by CHz on 2013-03-31 20:16:04 UTC

No I still use the transformation for calibration.

Asked by WLemkens on 2013-04-01 00:01:40 UTC

I am also using your method. But could you please tell me in what topic name you are publishing it ? When we call ; roslaunch camera_pose_calibration calibrate_2_camera.launch camera1_ns:=/camera/rgb_bag camera2_ns:=/camera/ir How do you set camera2_n ?

Asked by CHz on 2013-04-06 14:12:39 UTC

I created a node that listened on /camera/ir and published on /camera/ir_augmented. I have added a download link for the workaround at the end of the question so you can see exactly what I did.

Asked by WLemkens on 2013-04-07 02:28:44 UTC

Thank you so much for your answer and help !!

Asked by CHz on 2013-04-09 01:45:30 UTC

In order to be able to use calibration routines I did following changes; 1- question/43035/errors-on-camera_pose_calibration-startup/

And now thanks to you, I see green lines under both images. But routine does not save any bag file ? Did you come across this problem as well ?

Asked by CHz on 2013-04-10 00:03:10 UTC

Yes, I had that problem sometimes too. It seems sensitive to the order of execution. For me it worked when I did everything in exact the following order: roscore, sim_time false, camera_launch, record bag, stop camera, sim_time true, camera_launch, contrast node, play bag, calibration.

Asked by WLemkens on 2013-04-10 00:16:51 UTC

I did manage to do as well with your help. I really appreciate for this. Now I have positions for orientations for both cameras inside I believe. Can you help me to visualize this on rviz ? Do I have relative poses of cameras ?

Asked by CHz on 2013-04-10 01:36:29 UTC

For me it further worked as the tutorial described.

If you launch your camera as the tutorial presents (with the transform publisher in the launchfile) it should show the colored pointcloud in rviz when you display a PointCloud2 with topic /camera/depth_registered/points.

Asked by WLemkens on 2013-04-10 01:48:28 UTC

Answers