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

Gumstix, uvc_camera and cv_capture

asked 2011-02-14 16:36:20 -0600

Tully gravatar image

I've observed something surprising with a small UVC camera on the gumstix overo. If I use the camera_node from uvc_camera, I get barely 2 fps in 640x480. On the other hand, if I make a small application using the opencv cvCapture function, I get close to 10fps at the same resolution.

Here is the cv code in all its complexity:

       CvCapture* capture = 0;
       capture = cvCaptureFromCAM( -1 );
       IplImage *cv_image = NULL;
       ros::Rate loop_rate(10);
       while (ros::ok())
       {
           cv_image = cvQueryFrame(capture);
           try {
               image_pub_.publish(bridge_.cvToImgMsg(cv_image, "bgr8"));
           } catch (sensor_msgs::CvBridgeException error) {
               ROS_ERROR("error");
           }
           ros::spinOnce();
           loop_rate.sleep();
       }

       cvReleaseCapture(&capture);

On the same camera on my laptop, both cv_capture and uvc_camera publish at 10 fps.

I guess that means there is something that would need optimisation in the uvc_camera/camera_node, but for now I'll be fine with just reporting :-)

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2011-02-14 16:36:56 -0600

tfoote gravatar image

I've seen similar discrepancies in performance from the driver based on computer as well. See http://code.ros.org/lurker/message/20110105.220655.b7e05812.en.html (though in that situation, all of the computers in question had enough CPU horsepower to not drop the framerate).

Could you report which camera you are using? Also, no idea if you can get a monitor on the overo, but if you can, you could use guvcview to see if that also experiences a slow down in frame rate when you try to use similar settings to the uvc_camera driver.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-02-14 16:36:20 -0600

Seen: 652 times

Last updated: Feb 14 '11