ros下单目相机校正
1. 安装对应的驱动与程序包。
图像对应包 http://wiki.ros.org/camera_calibration 在gitbub下载image_pipeline : https://github.com/ros-perception/image_pipeline
安装对应的驱动
1)uvc_camera ktossell/camera_umd
sudo apt-get install ros-indigo-xxxxx ( camera_umd jpeg_streamer uvc_camera )
2)usb_cam http://wiki.ros.org/usb_cam
bosch-ros-pkg/usb_cam
2. 相机校正的步骤
1) 启动相机 uvc_camera 或者 usb_cam
roslaunch usb_cam camera.launch (个人的 camera.launch) rviz 详细文件见后。(也能够自己先打开rviz 加入topic后保存,以后直接调用保存的.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="30"/>
<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) 启动校正程序
參见教程 http://wiki.ros.org/camera_calibration/Tutorials/MonocularCalibration
yhzhao@yhzhao:~$ 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
出错:例如以下
('Waiting for service', '/camera/set_camera_info', '...')
Service not found
执行例如以下语句: 角点数 棋盘格大小 topic映射
rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.0245 image:=/usb_cam/image_raw camera:=/camera --no-service-check
注意:校正採集的角点图像要多。数量达到一定效果时,calibration button会变亮,点击就可以进行校正运算。结果在终端有显示,也能够选择保存。
校正输出结果:
('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] width
640 height
480 [narrow_stereo] camera matrix
485.589770 0.000000 297.253764
0.000000 491.681362 296.200319
0.000000 0.000000 1.000000 distortion
-0.197621 0.168802 0.012444 0.005871 0.000000 rectification
1.000000 0.000000 0.000000
0.000000 1.000000 0.000000
0.000000 0.000000 1.000000 projection
462.440887 0.000000 301.472984 0.000000
0.000000 469.786407 301.545984 0.000000
0.000000 0.000000 1.000000 0.000000
3. 启动 ros 相机相应节点公布图像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]</rosparam>
<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>
------------------------------------------------------------附--------------------------------------------------------------------------------------------------------------------------------------
<pre name="code" class="html">$(find usb_cam)/launch/camera.rviz文件
Panels:
- Class: rviz/Displays
Help Height: 78
Name: Displays
Property Tree Widget:
Expanded: ~
Splitter Ratio: 0.5
Tree Height: 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: Image
Visualization Manager:
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: /usb_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
Image Topic: /slam/raw_flip_image
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: /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
Queue Size: 2
Transport Hint: raw
Value: true
Enabled: true
Global Options:
Background Color: 48; 48; 48
Fixed Frame: odom
Frame Rate: 30
Name: root
Tools:
- Class: rviz/Interact
Hide Inactive Objects: true
- Class: rviz/MoveCamera
- Class: rviz/Select
- Class: rviz/FocusCamera
- Class: rviz/Measure
- Class: rviz/SetInitialPose
Topic: /initialpose
- Class: rviz/SetGoal
Topic: /move_base_simple/goal
- Class: rviz/PublishPoint
Single click: true
Topic: /clicked_point
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
Value: false
Focal Point:
X: 0
Y: 0
Z: 0
Name: Current View
Near Clip Distance: 0.01
Pitch: 0.825398
Target Frame: <Fixed 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: 000000ff00000000fd00000004000000000000039d00000247fc0200000009fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006400fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afc000000280000011f000000dd00fffffffa000000010100000002fb0000000a0049006d00610067006502000007ce000001680000073200000279fb000000100044006900730070006c00610079007301000000000000039d0000010f00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d006100670065010000014d000001220000001600ffffff000000010000037600000247fc0200000005fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a005600690065007700730100000028000000b0000000b000fffffffb0000000a0049006d00610067006501000000de000000c60000001600fffffffb0000000a0049006d00610067006501000001aa000000c50000001600fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b2000000000000000000000002000004b0000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073f0000003bfc0100000002fb0000000800540069006d006501000000000000073f000002f600fffffffb0000000800540069006d00650100000000000004500000000000000000000000200000024700000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
Selection:
collapsed: false
Time:
collapsed: false
Tool Properties:
collapsed: false
Views:
collapsed: false
Width: 1855
X: 90
Y: 153
ros下单目相机校正的更多相关文章
- 基于OpenCV单目相机的快速标定--源码、工程、实现过程
相机的标定是所有人走进视觉世界需要做的第一件事,辣么多的视觉标定原理解释你可以随便在网上找到,这里只讲到底如何去实现,也算是给刚入门的朋友做个简单的分享. 1.单目相机标定的工程源码 首先请到同性交友 ...
- ROS与深度相机入门教程-在ROS使用kinect v1摄像头
ROS与深度相机入门教程-在ROS使用kinect v1摄像头 说明: 介绍在ros安装和使用kinect v1摄像头 介绍freenect包 安装驱动 deb安装 $ sudo apt-get in ...
- ROS标定IDS相机
参考 ROS 相机标定http://blog.csdn.net/ArtistA/article/details/51125560 ROS里的标定程序只要使用了OPNCV的标定程序: opencv 相机 ...
- matlab单目相机标定——标定步骤以及参数含义
参考博客园的一篇文章: https://www.cnblogs.com/flyinggod/p/8470407.html#commentform
- 双目相机标定以及立体测距原理及OpenCV实现
单目相机标定的目标是获取相机的内参和外参,内参(1/dx,1/dy,Cx,Cy,f)表征了相机的内部结构参数,外参是相机的旋转矩阵R和平移向量t.内参中dx和dy是相机单个感光单元芯片的长度和宽度,是 ...
- ZED 相机 && ORB-SLAM2安装环境配置与ROS下的调试
注:1. 对某些地方进行了更新(红色标注),以方便进行配置. 2. ZED ROS Wrapper官方github已经更新,根据描述新的Wrapper可能已经不适用与Ros Indigo了,如果大家想 ...
- ORB-SLAM2实现(kinect V1/ROS)
实验室电脑环境ubuntu14.04和ROS indigo已经装好. 1. 构建工作空间[非常重要的一步] mkdir -p ~/catkin_ws/src cd ~/catkin_ws/ catki ...
- 单目、双目和RGB-D视觉SLAM初始化比较
无论单目.双目还是RGB-D,首先是将从摄像头或者数据集中读入的图像封装成Frame类型对象: 首先都需要将彩色图像处理成灰度图像,继而将图片封装成帧. (1) 单目 mCurrentFrame = ...
- 三维重建:深度相机方案对比-KinectFusion的基本原理(尺度)
算法原理请参考此文: kinect fusion 3D重建基本算法 http://log.csdn.net/xiaohu50/article/details/51592503 三维重建为三维空间实 ...
随机推荐
- react-native 初始化 各种报错 及 解决方案
1.Unable to load script from assets 'index.android.bundle'. curl -k "http://localhost:8081/inde ...
- 訪问控制 protected, public, private 对照
OOP 3大特性:数据抽象,继承,动态绑定 3中訪问标号 protected, public, private 对照 用类进行数据抽象:用继承类继承基类的成员,实现继承.通过将基类对应函数声明为vir ...
- 按“开始”-“运行”,或按WIN+R,在[运行]窗口中输入
command--------CMD命令提示符 ipconfig查看本机IP chkdsk.exe-----Chkdsk磁盘检查 certmgr.msc----证书管理实用程序 calc--- ...
- git 4种对象的理解
git中有四种基本对象类型,可以说Git的所有操作都是通过这四种对象完成的.下图是<Git版本控制管理>中文第二版的原话,顺便吐槽一下,这本书真的翻译的一般.. 下面说下我的理解吧,首先b ...
- 转MQTT--Python进行发布、订阅测试
前言 使用python编写程序进行测试MQTT的发布和订阅功能.首先要安装:pip install paho-mqtt 测试发布(pub) 我的MQTT部署在阿里云的服务器上面,所以我在本机上编写 ...
- Android项目:使用pulltorefresh开源项目扩展为下拉刷新上拉加载更多的处理方法,监听listview滚动方向
很多android应用的下拉刷新都是使用的pulltorefresh这个开源项目,但是它的扩展性在下拉刷新同时又上拉加载更多时会有一定的局限性.查了很多地方,发现这个开源项目并不能很好的同时支持下拉刷 ...
- IDEA下配置Spring Boot的热部署
© 版权声明:本文为博主原创文章,转载请注明出处 devtools简介 spring-boot-devtools会监听classpath下的文件变动,并且会立即重启应用(发生在保存时机),因为其采用的 ...
- eclipse 创建maven web错误Cannot change version of project facet Dynamic web module to 3.1解决方案
Dynamic Web Module 选择“3.1”,java选择“1.8”,报错:Cannot change version of project facet Dynamic web module ...
- CSS基础2——选择器
前面说过样式规则.也知道了样式规则语法形式为:选择器+声明块 如:div{ color:black:padding:10px; } div即表示选择器(此处是元素选择器),花括号里的内容就是声明块 ...
- NHibernate 映射基础(第三篇) 简单映射、联合主键
NHibernate 映射基础(第三篇) 简单映射.联合主键 NHibernate完全靠配置文件获取其所需的一切信息,其中映射文件,是其获取数据库与C#程序关系的所有信息来源. 一.简单映射 下面先来 ...