当前位置: 首页 > news >正文

b2c网站的促销策略搜索引擎优化seo专员招聘

b2c网站的促销策略,搜索引擎优化seo专员招聘,wordpress加图标,徐州品牌网站建设|徐州网站优化|徐州网络公司-徐州启思信息科技目录 准备 准备标定板 新建容器 新建usb_cam话题的ROS功能包 编写代码 编译 运行功能包 标定 安装camera_calibration标定功能包 启动发布usb_cam话题的功能包 启动camera_calibration标定功能包 准备 usb相机 标定板 一个带有ROS的docker镜像。 准备标定板 图…

目录

准备

准备标定板

新建容器

新建usb_cam话题的ROS功能包

编写代码

编译

运行功能包

标定

安装camera_calibration标定功能包

启动发布usb_cam话题的功能包

启动camera_calibration标定功能包


准备

usb相机

标定板

一个带有ROS的docker镜像。

准备标定板

图片链接:

棋盘格图片

打印粘贴。或者可以使用手机平板等屏幕展示这张棋盘照片,测量棋盘小格尺寸,并保证标定过程中,图片不被缩放。

新建容器

使用--privileged参数建立镜像。基础的代码:

sudo docker run -it --privileged --name=lab1 your_image_name  /bin/bash

修改 your_image_name为你的docker镜像名。--privileged参数使容器与宿主机共用device设备,有相同的/dev文件。但是,在进入容器之前,先连接相机,再进入容器,防止进入容器后刷新不出相机。

docker run的其他参数根据需要自行设置。

连接相机

进入容器

新建usb_cam话题的ROS功能包

新建ROS功能包,用来发布usb_cam的话题。

编写代码

使用C++语言编写,示例如下,

新建功能包,而后写入核心代码:

img_publisher.cpp文件


#include <ros/ros.h>
#include <image_transport/image_transport.h>
#include <opencv2/highgui.hpp>
#include <opencv2/calib3d.hpp>
#include <cv_bridge/cv_bridge.h>
#include <iostream>int main(int argc, char** argv) {ros::init(argc, argv, "img_publisher");ros::NodeHandle nh;image_transport::ImageTransport it(nh);image_transport::Publisher pub = it.advertise("camera/image", 1);cv::VideoCapture cap;cv::Mat frame;int deviceID = 0;if (argc > 1)deviceID = argv[1][0] - '0';int apiID = cv::CAP_ANY;cap.open(deviceID + apiID);if (!cap.isOpened()) {std::cerr << "ERROR! Unable to open camera" << std::endl;return -1;}ros::Rate loop_rate(30);while (nh.ok()) {cap.read(frame);if (!frame.empty()) {sensor_msgs::ImagePtr msg = cv_bridge::CvImage(std_msgs::Header(), "bgr8", frame).toImageMsg();pub.publish(msg);}ros::spinOnce();loop_rate.sleep();}return 0;
}

CMakeLists.txt文件

cmake_minimum_required(VERSION 3.0.2)
project(usb_cam)## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTScv_bridgeimage_transportroscppsensor_msgsstd_msgs
)
find_package(OpenCV REQUIRED)
message(${OpenCV_VERSION})###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
#  INCLUDE_DIRS include
#  LIBRARIES usb_cam
#  CATKIN_DEPENDS cv_bridge image_transport roscpp sensor_msgs std_msgs
#  DEPENDS system_lib
)###########
## Build ##
############# Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(
# include${catkin_INCLUDE_DIRS}${OpenCV_INCLUDE_DIRS}
)add_executable(img_publisher src/img_publisher.cpp)
add_executable(img_viewer src/img_viewer.cpp)target_link_libraries(img_publisher ${catkin_LIBRARIES} ${OpenCV_LIBS})
target_link_libraries(img_viewer ${catkin_LIBRARIES} ${OpenCV_LIBS})

编译

打开终端:

catkin_make

在~/.bashrc加入环境变量。

打开终端:

gedit ~/.bashrc

文末写入

source ~/catkin_ws/devel/setup.bash

保存文件,关闭。

运行功能包

打开终端:

rosrun usb_cam img_publisher

会发布一个话题

查看话题

rostopic list

正常接入相机,功能包才正常运行,此时会出现包括/camera/image话题等一系列话题。

标定

安装camera_calibration标定功能包

查看ROS的功能包:

rospack list

查看是否有“camera_calibration”功能包,没有则需要安装:

rosdep install camera_calibration

启动发布usb_cam话题的功能包

打开终端:

rosrun usb_cam img_publisher

查看话题 

rostopic list

正常接入相机,功能包才正常运行,此时会出现包括/camera/image话题等一系列话题。 

启动camera_calibration标定功能包

打开终端:

rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.20 image:=/camera/image

其中, --size 8x6是棋盘交点的数量,9*7的格子就会有8*6个交点

--square 0.20是一个小棋盘格大小,单位:米。

image:=/camera/image,image:=相机话题名。

正常启动后,弹出标定窗口,间断地调整相机位置,直到右侧"calibrate"按钮亮起,

Moving the Checkerboard

In order to get a good calibration you will need to move the checkerboard around in the camera frame such that:

    checkerboard on the camera's left, right, top and bottom of field of view
        X bar - left/right in field of view
        Y bar - top/bottom in field of view
        Size bar - toward/away and tilt from the camera
    checkerboard filling the whole field of view
    checkerboard tilted to the left, right, top and bottom (Skew)

At each step, hold the checkerboard still until the image is highlighted in the calibration window.

移动棋盘
为了获得良好的校准,您需要在相机框架中移动棋盘,以便:
相机视野左、右、上、下的棋盘
X条-视野中的左/右
Y条-视野中的顶部/底部
尺寸条-朝向/远离相机并倾斜
棋盘填充整个视野
向左、右、上、下倾斜的棋盘(倾斜)
在每一步中,保持棋盘静止,直到图像在校准窗口中高亮显示。

点击,开始计算。计算结束后"save"按钮亮起,结果点"save"按钮保存

If you are satisfied with the calibration, click COMMIT to send the calibration parameters to the camera for permanent storage. The GUI exits and you should see "writing calibration data to ..." in the console.

如果您对校准感到满意,请单击COMMIT将校准参数发送到相机以进行永久存储。GUI退出,您应该在控制台中看到“正在将校准数据写入…”。

参考

标定过程及参数:

相机内参标定究竟标了什么?相机内参外参保姆级教程 - 知乎

camera_calibration标定功能包介绍:

camera_calibration/Tutorials/MonocularCalibration - ROS Wiki

http://www.hkea.cn/news/659022/

相关文章:

  • 崔各庄地区网站建设百度非企渠道开户
  • 怎么用自己的电脑做网站服务器产品推广平台排行榜
  • 中国做的比较好的电商网站有哪些哈市今日头条最新
  • 微信怎么做网站推广百度网站优化培训
  • 网站开发支持多个币种电子技术培训机构
  • 移动网站设计与制作怎么找关键词
  • 国内移动端网站做的最好的厦门人才网597人才网
  • 建网站收费吗aso关键词覆盖优化
  • 西安的网站设计与制作首页微信视频号怎么推广引流
  • 顺义公司建站多少钱pc端百度
  • wordpress收费资源下载关键词优化的策略
  • 广州做网站建设的公司网站公司
  • 做网络平台的网站有哪些广州网站维护
  • 网页 代码怎么做网站东莞市民最新疫情
  • 电子商务网站设计中影响客户体验的元素有搜索引擎有哪些种类
  • 网站建设难点优化关键词技巧
  • 免费行情网站链接百度知道合伙人官网
  • 餐饮公司网站建设的特点大数据智能营销
  • 济南快速排名刷关键词排名seo软件
  • 系统做网站的地方百度推广登录后台登录入口
  • 集约化网站建设情况广告公司网站制作
  • 网站制作发票字节跳动广告代理商加盟
  • 义乌做网站武汉seo推广优化公司
  • 济宁哪家网站建设公司正规谷歌浏览器 免费下载
  • 有没有女的做任务的网站广东省新闻
  • seo长尾关键词优化如何做网站推广优化
  • 网站搭建服务合同seo排名赚
  • 东莞有什么比较好的网站公司苏州关键词排名系统
  • 做中国供应商免费网站有作用吗浙江网站推广运营
  • mysql8 wordpress百度推广优化是什么意思