Asus extrinsic calibration failing on ir image [closed]
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.
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
Yes, I use opencv for that. I'll put the code in my question.
Thanks alot, I'll give it a try in the morning
Did you manage to cope with this problem without image transformation ??
No I still use the transformation for calibration.
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 ?
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.
Thank you so much for your answer and help !!