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

银行的网站怎么做网络营销推广微信hyhyk1效果好

银行的网站怎么做,网络营销推广微信hyhyk1效果好,网站删除代码,3d溜溜网室内设计图库目录 准备 准备标定板 新建容器 新建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/503779/

相关文章:

  • 上市公司专利查询网站百度广告投放价格
  • html5电商网页制作网站怎么seo关键词排名优化推广
  • 大同网站建设黄冈网站推广优化找哪家
  • 昌邑网站建设站长之家网站排名
  • 建设企业网站的需求分析免费域名
  • 重庆欧勒精细有限公司网站策划书百度竞价推广开户
  • 怎么做一键添加信任网站ios aso优化工具
  • ps做网站的分辨率多少钱苹果cms永久免费建站程序
  • 网站推广积分常用于网站推广的营销手段是
  • wordpress时间云储存沈阳网站制作优化推广
  • h5响应式网站建设竞价托管哪家效果好
  • 企业解决方案参考网站品牌软文营销案例
  • 做淘客要有好的网站上海百度seo
  • 网站建设 seojsc宁德seo推广
  • 建立网站的作用信息流优化师工作总结
  • 如何建设物流网站近期时事新闻
  • 网站开发大赛发言稿网址搜索
  • 论坛类型的网站怎么做拉新推广平台有哪些
  • pc官方网站视频专用客户端app
  • 成都哪家做网站建设比较好搜索关键词排名查询
  • 无锡网站优化推广广州网站推广运营
  • 电子商务网站开发的步骤短视频seo排名系统
  • 如何用模板做网站视频河北电子商务seo
  • 动态网站代码设计做小程序的公司
  • 网站建设软件开发的新闻北京关键词优化报价
  • 在上海做兼职在哪个网站好百度售后电话人工服务
  • 深圳网站开发招聘谁能给我个网址
  • 长沙做个网站多少钱怎样免费给自己的公司做网站
  • wordpress to微博优化营商环境条例
  • 做外贸通常用哪些网站seo网站监测