ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

problem in camera caliblration

asked 2014-07-15 06:27:36 -0600

Hamid Didari gravatar image

updated 2014-07-15 06:37:02 -0600

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-12-11 01:51:22 -0600

SonOfDamage gravatar image

This is because the video stream you had tried to convert was in BGR8, while the actual stream the camera calibrator node needs is a MONO8 stream(grayscale). Tried a grayscale converter??

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2014-07-15 06:27:36 -0600

Seen: 397 times

Last updated: Dec 11 '14