Asus extrinsic calibration failing on ir image [closed]

asked 2013-02-18 04:57:32 -0600

WLemkens gravatar image

updated 2014-01-28 17:15:18 -0600

ngrennan gravatar image

I am trying to follow the camera_pose_calibration 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 image_view, 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 camera_pose_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 image_view. The image in the camera_pose_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.

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2015-10-30 17:54:42.067690

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

K_Yousif gravatar image K_Yousif  ( 2013-02-18 13:54:50 -0600 )edit

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

WLemkens gravatar image WLemkens  ( 2013-02-18 23:15:01 -0600 )edit

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

K_Yousif gravatar image K_Yousif  ( 2013-02-19 00:07:58 -0600 )edit

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

CHz gravatar image CHz  ( 2013-03-31 20:16:04 -0600 )edit

No I still use the transformation for calibration.

WLemkens gravatar image WLemkens  ( 2013-04-01 00:01:40 -0600 )edit

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 ?

CHz gravatar image CHz  ( 2013-04-06 14:12:39 -0600 )edit

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.

WLemkens gravatar image WLemkens  ( 2013-04-07 02:28:44 -0600 )edit

Thank you so much for your answer and help !!

CHz gravatar image CHz  ( 2013-04-09 01:45:30 -0600 )edit