Ros under Monocular camera correction

Source: Internet
Author: User

1. Install the appropriate driver and package.

Image corresponding package http://wiki.ros.org/camera_calibration in Gitbub download image_pipeline:https://github.com/ros-perception/i Mage_pipeline

Install the appropriate driver

1) Uvc_camera Ktossell/camera_umd sudo apt-get install ros-indigo-xxx XX (CAMERA_UMD jpeg_streamer uvc_camera)

2) Usb_cam Http://wiki.ros.org/usb_cam bosch-ros-pkg/Usb_cam

2. Steps for Camera Calibration

1) Start the camera Uvc_camera or Usb_cam

Roslaunch Usb_cam Camera.launch (personal camera.launch) Rviz specific documents see later. (You can also open Rviz to add topic after saving, and then directly call the saved. Rviz)

Camera.launch

<launch><node pkg= "Rviz" type= "Rviz" name= "Rviz" args= "-D $ (Find Usb_cam)/launch/camera.rviz"/><node Name= "Usb_cam" pkg= "Usb_cam" type= "Usb_cam_node" respawn= "false" output= "log" ><param name= "Video_device" type= "String" value= "/dev/video0"/><param name= "camera_frame_id" type= "string" value= "Usb_cam"/><param name= "Framerate" type= "int" value= "/><param name=" Io_method "type=" string "value=" mmap "/><param name=" Image_width "type=" int "value=" 640 "/><param name=" image_height "type=" int "value=" 480 "/><param name=" Pixel_format "type=" string "value=" Yuyv "/></node></launch>

2) Start the calibration program

See Tutorial Http://wiki.ros.org/camera_calibration/Tutorials/MonocularCalibration

[Email protected]:~$ rostopic List/usb_cam/camera_info/usb_cam/image_raw     ################################/usb _cam/image_raw/compressed/usb_cam/image_raw/compressed/parameter_descriptions/usb_cam/image_raw/compressed/ Parameter_updates/usb_cam/image_raw/compresseddepth


Rosrun camera_calibration cameracalibrator.py--size 8x6--square 0.0245 image:=/usb_cam/image_raw Camera:=/camera

Error: The following
(' Waiting for service ', '/camera/set_camera_info ', ' ... ')
Service not found

Run the following statement: Corner count Checkerboard Size topic map
rosrun camera_calibration cameracalibrator.py--size 8x6--square 0.0245 image:=/usb_cam/image_raw Camera:=/camera --no-service-check

Note: The correction acquisition corner image to be more, the number reached a certain effect, the calibration button will lighten, click can be corrected operation, the results are displayed in the terminal, you can also choose to save.

Correct the output result:

(' D = ', [-0.1976212648687889, 0.1688022413942262, 0.0124442419926021, 0.005870906198680583, 0.0]) (' K = ', [485.5897704187133, 0.0, 297.2537641560215, 0.0, 491.6813624489518, 296.2003190013238, 0.0, 0.0, 1.0]) (' R = ', [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0])  (' P = ', [462.4408874511719, 0.0, 301.47298442859574, 0.0, 0.0, 469.7864074707031, 301.54598383033044, 0.0, 0.0, 0.0, 1.0, 0.0]) none# OST version 5.0 Parameters[image]width640height480[narrow_stereo]camera matrix485.589770 0.000000 297.2537640.000000 491.681362 296.2003190.000000 0.000000 1.000000distortion-0.197621 0.168802 0.012444 0.005871 0.000000rectification1.000000 0.000000 0.0000000.000000 1.000000 0.0000000.000000 0.000000 1.000000projection462.440887 0.000000 301.472984 0.0000000.000000 469.786407 301.545984 0.0000000.000000 0.000000 1.000000 0.000000

3. Launch the ROS camera corresponding node release image topic

Carmera_haved_calibrated.launch

<launch><node pkg= "Rviz" type= "Rviz" name= "Rviz" args= "-D $ (Find Usb_cam)/launch/camera.rviz"/><node Name= "Usb_cam" pkg= "Usb_cam" type= "Usb_cam_node" respawn= "false" output= "log" ><param name= "Video_device" type= "String" value= "/dev/video0"/><param name= "camera_frame_id" type= "string" value= "Usb_cam"/><param name= "Io_method" type= "string" value= "mmap"/><param name= "image_width" type= "int" value= "640"/><param name= " Image_height "type=" int "value=" 480 "/><param name=" Pixel_format "type=" string "value=" Yuyv "/><rosparam Param= "D" >[-0.1976212648687889, 0.1688022413942262, 0.0124442419926021, 0.005870906198680583, 0.0]</rosparam ><rosparam param= "K" >[485.5897704187133, 0.0, 297.2537641560215, 0.0, 491.6813624489518, 296.2003190013238, 0.0, 0.0, 1.0]</rosparam><rosparam param= "R" >[1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0]&LT;/ROSPARAM&GT;&L T;rosparam param= "P" >[462.4408874511719, 0.0, 301.47298442859574, 0.0, 0.0, 469.7864074707031, 301.54598383033044, 0.0, 0.0, 0.0, 1.0, 0.0]</rosparam></node></launch> 



------------------------------------------------------------attached------------------------------------------------------------ --------------------------------------------------------------------------
<pre name= "code" class= "HTML" >$ (find Usb_cam)/launch/camera.rviz file

Panels:-Class:rviz/displays Help height:78 Name:displays Property tree widget:expanded: ~ Splitter ratio:0.5 Tree H Eight:144-class:rviz/selection name:selection-class:rviz/tool Properties Expanded:-/2d Pose Estimate1-/2d Nav Goal1-/publish Point1 name:tool Properties Splitter ratio:0.588679-class:rviz/views Expanded:-/current View1 Name : Views Splitter ratio:0.5-class:rviz/time experimental:false name:time syncmode:0 syncsource:imagevisualization M Anager:class: "Displays:-alpha:0.5 Cell size:1 Class:rviz/grid color:160; 160; 164 Enabled:true Line Style:line width:0.03 value:lines name:grid Normal Cell count:0 offset:x: 0 y:0 z:0 Plane: XY Plane Cell count:10 Reference Frame: <fixed frame> value:true-class:rviz/image enabled:true Image Topic:/u Sb_cam/image_raw Max value:1 Median window:5 Min value:0 name:image Normalize range:true Queue size:2 Transport Hint : Raw Value:true-class:rviz/image enabled:true ImageTopic:/slam/raw_flip_image Max value:1 Median window:5 Min value:0 name:image Normalize range:true Queue size:2 Tra Nsport hint:raw value:true-class:rviz/image enabled:true Image Topic:/detect_qr/qr_img Max value:1 Median window: 5 Min value:0 name:image Normalize range:true Queue size:2 Transport hint:raw value:true-class:rviz/image Enabled : True Image Topic:/slam/qrslam/slam_map Max value:1 Median window:5 Min value:0 name:image Normalize range:true Que UE size:2 Transport hint:raw value:true enabled:true Global options:background color:48; 48; Fixed frame:odom Frame rate:30 name:root Tools:-class:rviz/interact Hide Inactive Objects:true-class:rviz/mov Ecamera-class:rviz/select-class:rviz/focuscamera-class:rviz/measure-class:rviz/setinitialpose Topic:/initialp Ose-class:rviz/setgoal Topic:/move_base_simple/goal-class:rviz/publishpoint single click:true Topic:/clicked_poin T Value:true views:current:class:rviz/orbit distance:15.7352 Enable Stereo rendering:stereo eye separation:0.06 Stereo Focal distance:1 Swap Stereo eyes:false V Alue:false Focal point:x: 0 y:0 z:0 name:current View near Clip distance:0.01 pitch:0.825398 Target Frame: <fixe D frame> value:orbit (Rviz) yaw:1.5604 Saved: ~window Geometry:Displays:collapsed:false height:718 Hide left Dock : false Hide Right Dock:false Image:collapsed:false Qmainwindow state:000000ff00000000fd00000004000000000000039d00000 247fc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006400fffffffb0000001e0054006f006f006c 002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f0 06f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f007000650072007400690065007300320300000288 0000011d000002210000017afc000000280000011f000000dd00fffffffa000000010100000002fb0000000a0049006d00610067006502000007ce000 001680000073200000279fb000000100044006900730070006c00610079007301000000000000039d0000010f00fffffffb0000002000730065006c0065006300740069006f006e0020006 2007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000 d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d00610067006501000 0014d000001220000001600ffffff000000010000037600000247fc0200000005fb0000001e0054006f006f006c002000500072006f00700065007200 740069006500730100000041000000780000000000000000fb0000000a005600690065007700730100000028000000b0000000b000fffffffb0000000 A0049006d00610067006501000000de000000c60000001600fffffffb0000000a0049006d00610067006501000001aa000000c50000001600fffffffb 0000001200530065006c0065006300740069006f006e010000025a000000b2000000000000000000000002000004b0000000a9fc0100000001fb00000 00a00560069006500770073030000004e00000080000002e100000197000000030000073f0000003bfc0100000002fb0000000800540069006d006501 000000000000073f000002f600fffffffb0000000800540069006d00650100000000000004500000000000000000000000200000024700000004000000040000000800000008fc00000001000 00002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 Selection:collapsed:false Time: Collapsed:false Tool Properties:collapsed:false Views:collapsed:false width:1855 x:90 y:153

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Ros under Monocular camera correction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.