
C++
小球球plus
wechat:lbb1124521521
展开
-
用Stringstream字符串流从文件中读写多个字符串
用Stringstream字符串流从文件中读写多个字符串原创 2021-12-14 10:07:27 · 1222 阅读 · 0 评论 -
linux查询摄像头,出现无法访问‘/dev/video*‘: 没有那个文件或目录
查询linux系统安装时间ls -lact --full-time /etc | tail -1 | awk ‘{print $6,$7}’原创 2021-10-21 20:38:06 · 2436 阅读 · 3 评论 -
opencv分段保存视频
/** * @author liangbeibei * @brief 从usb相机读取视频保存到本地,分段保存视频,每10分钟生成一个新视频*/#include <iostream>#include <opencv2/opencv.hpp>#include <opencv2/core/core.hpp>#include <boost/date_time/posix_time/posix_time.hpp> /** * @brief 获取当前原创 2021-10-18 10:32:38 · 677 阅读 · 0 评论 -
opencv的aruco检测二维码marker
opencv的aruco检测二维码marker#include <opencv2/opencv.hpp>#include <opencv2/aruco.hpp>#include <opencv2/calib3d/calib3d.hpp>#include "opencv2/core/core.hpp"#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.h原创 2021-03-25 08:44:13 · 1018 阅读 · 0 评论 -
用opencv的aruco库生成二维码marker标记
用opencv的aruco库生成二维码marker标记代码来源于官方提供的完整的工作实例create_marker.cpp。在opencv源码中的位置为opencv_contrib-4.4.0/modules/aruco/samples/create_marker.cpp。#include <opencv2/highgui.hpp>#include <opencv2/aruco.hpp>#include <iostream>using namespace cv原创 2021-03-20 11:25:51 · 1197 阅读 · 0 评论 -
ubuntu16.04 opencv打开摄像头失败
ubuntu16.04 opencv打开摄像头失败按照opencv检测AruCo标记教程,运行程序时打开摄像头失败,使用的相机是Intel RealSense D435。发生问题的代码如下。 // 打开相机 cv::VideoCapture inputVideo; inputVideo.open(0);程序运行时给出的错误提示如下。[ WARN:0] global /home/liangbeibei/image_envirment/opencv-4.4/opencv-4.4.0/原创 2021-03-18 08:59:41 · 3625 阅读 · 7 评论 -
c/c++判断文件是否存在
c/c++判断文件是否存在stat#include <sys/stat.h>bool isFileExist(const std::string name) { struct stat buffer; return (stat (name.c_str(), &buffer) == 0);}access#include <unistd.h>#include <fcntl.h>bool isFileExist(const s原创 2021-02-23 17:33:51 · 359 阅读 · 0 评论 -
setPreferableBackend和setPreferableTarget
setPreferableBackend和setPreferableTarget环境opencv4.4.0setPreferableBackend()函数原型/** * @brief Ask network to use specific computation backend where it supported. * @param[in] backendId backend identifier. * @see Backend * * If OpenCV is compiled w原创 2021-02-23 16:53:44 · 4293 阅读 · 0 评论 -
yolo目标检测环境(二):ubuntu16.04安装cudnn
ubuntu16.04安装cudnn一、环境操作系统:ubuntu16.04内核:4.4.0-98-genericnvidia显卡驱动版本:450.66CUDA版本:10.2.89二、下载cudnn各版本选择最新的8.0.5版本。三、安装sudo dpkg -i libcudnn8_8.0.5.39-1+cuda10.2_amd64.debsudo dpkg -i libcudnn8-dev_8.0.5.39-1+cuda10.2_amd64.debsudo dpkg -i lib原创 2021-02-18 09:46:26 · 199 阅读 · 0 评论 -
yolo目标检测环境(一):ubuntu16.04安装cuda10.2步骤
ubuntu16.04安装cuda参考:https://docs.nvidia.com/cuda/cuda-installation-guide-linux/#introduction安装之前确认系统是否具有支持CUDA的GPU。确认系统正在运行受支持的Linux版本。验证系统已安装gcc。验证系统是否安装了正确的内核头文件和开发包。下载NVIDIA CUDA工具包。处理冲突的安装方法。...原创 2021-02-08 17:12:21 · 401 阅读 · 0 评论 -
ROS发布栅格地图nav_msgs/OccupancyGrid数据并在rviz中显示
ROS发布栅格地图nav_msgs/OccupancyGrid数据并在rviz中显示wiki:DisplayTypes/Map实验环境Ubuntu20.04 ROS(noetic)1.新建工程mkdir -p catkin_ws/srccd catkin_ws/srccatkin_create_pkg map_demo roscpp rospy nav_msgscd ..catkin_make 2.编辑主函数路径:map_demo/src/mappublish.cpptopic名字原创 2020-12-17 10:13:19 · 4346 阅读 · 5 评论 -
rviz用History Length显示PointStamped点的运动轨迹
rviz用History Length显示PointStamped点的运动轨迹1.发送节点发布PointStamped数据到topic。创建工程的方法见ROS发布话题PointStamped数据并在rviz中显示#include <ros/ros.h> #include <geometry_msgs/PointStamped.h>int main (int argc, char **argv) { // 初始化ROS节点 节点名字 ros::init (a原创 2020-12-15 09:39:50 · 340 阅读 · 0 评论 -
rviz错误:The minimum corner of the box must be less than or equal to maximum corner
使用rviz的Path插件报错操作rviz使用Path插件时,将Pose Style属性修改为Axes,rviz异常退出。错误提示rviz: /build/ogre-1.9-kiU5_5/ogre-1.9-1.9.0+dfsg1/OgreMain/include/OgreAxisAlignedBox.h:251:void Ogre::AxisAlignedBox::setExtents(const Ogre::Vector3&, const Ogre::Vector3&): 假设 ‘原创 2020-12-14 17:05:21 · 1824 阅读 · 0 评论 -
ROS发布多边形话题PolygonStamped数据并在rviz中显示
ROS发布PointStamped话题数据并在rviz中显示wiki:rvizDisplayTypesPolygon实验环境Ubuntu20.04 ROS(noetic)1.新建工程mkdir -p catkin_ws/srccd catkin_ws/srccatkin_create_pkg polygon_demo roscpp geometry_msgs cd ..catkin_make 2.编辑主函数路径:polygon_demo/src/publisher.cpptopic原创 2020-12-07 16:48:59 · 5167 阅读 · 5 评论 -
ROS发布点话题PointStamped数据并在rviz中显示
ROS创建PointStamped数据并在rviz中显示实验环境Ubuntu16.04 ROS(kinetic)1.新建工程mkdir -p catkin_ws/srccd catkin_ws/srccatkin_create_pkg point_demo roscpp rospy geometry_msgs std_msgscd ..catkin_make 2.编辑主函数路径:point_demo/src/create.cpptopic名字为outputframe_id为map原创 2020-09-09 16:57:11 · 3101 阅读 · 0 评论 -
linux进程间通信文件锁fcntl函数用法实例
linux文件锁fcntl函数用法实例1.fileoperation.h头文件#include <fstream>#include <iostream>#include <vector>#include <sys/stat.h>#include <sys/types.h>#include <cstddef>#include <stdlib.h> #include <math.h>#inclu原创 2020-10-28 11:37:28 · 367 阅读 · 0 评论 -
linux系统c读写文件函数open write read lseek用法实例
linux系统c读写文件函数open write read lseek用法实例原创 2020-10-27 11:23:23 · 1461 阅读 · 0 评论 -
linux系统c/c++中的inf和nan
linux系统c/c++中的inf测试环境:Ubuntu16.04inf表示无穷大的数。判断表达式的结果是否为inf#include<iostream>#include <math.h>int main(){ float a; a = INFINITY; std::cout << "a:" <<a << std::endl; // 方式一 if(isfinite(a)) { std::cout << "原创 2020-10-22 21:44:50 · 1885 阅读 · 0 评论