problem in camera caliblration
HI guys
I tried to calibrate my camera with ptam . but when I ran my camera's node to send image to ptam calibration and I got this err:
[FATAL] [1405423151.652879650]: ASSERTION FAILED
file = /home/hamid/Desktop/catkin_ws/src/ethzasl_ptam/ptam/src/CameraCalibrator.cc
line = 59
cond = img->encoding == sensor_msgs::image_encodings::MONO8 && img->step == img->width
this is my camera class to send image:
CameraDriver::CameraDriver()
{
ros::NodeHandle n;
n.param( "camera_index", id_camera, -1);
n.param( "fps", fps , 30 );
cvi.header.frame_id = "image";
it = new image_transport::ImageTransport(n);
pub=it->advertise("/camera/image_raw",1);
if(id_camera == -1)
{
ROS_WARN("camera's id has not recived");
ROS_WARN("I will open every camera that I find :P ");
}
input_video.open(id_camera);
input_video.set(CV_CAP_PROP_FPS,fps);
if(!input_video.isOpened())
{
ROS_ERROR("Couldn't Open The Camera !");
ROS_ERROR("Babay :(");
ros::shutdown();
}
ros::Rate loop_rate(fps);
cvi.encoding = sensor_msgs::image_encodings::MONO8;
while (ros::ok())
{
input_video.read(frame);
cvi.image=frame;
cvi.header.stamp = ros::Time::now();
pub.publish(cvi.toImageMsg());
loop_rate.sleep();
}
}
any suggestion about my problem?
I have no idae about this.
Thanks alot
Hamid