随笔分类 - C++
摘要:c++有编码问题,char无法直接转int,转换方法很多,下面介绍一个比较简单明了的: char x='8'; int y=x-'0'; string 转 int string a = "20210629"; string s = a.substr(0, 4); int y = atoi(s.c_s
阅读全文
摘要:主函数Mat::at<_Tp> public method _Tp& at<_Tp>(int row, int col) in class Mat Params row: Index along the dimension 0 col: Index along the dimension 1 Mat
阅读全文
摘要:windows下cloudcompare是不自带pcl库的,无法加载.pcd文件,装上PCL后依然无法正常加载,找了半天。 根据官方提示原来是使用官方共享版本的PCL进行编译的问题,必须将相应的DLL复制到CloudCompare的可执行文件旁边。 现在版本pcl1.11.1基本的dll在编译的时候
阅读全文
摘要:严重性 代码 说明 项目 文件 行 禁止显示状态 错误 MSB3073 命令“setlocal "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake if %errorlevel% neq
阅读全文
摘要:#include<iostream> #include<fstream> #include <string> #include <vector> #include <pcl/io/pcd_io.h> #include <pcl/point_types.h> #include <pcl/visuali
阅读全文
摘要:理论依据 假设我们得到了一个点云, 我们想要找到并分割。 假设我们使用Kd-tree结构来查找最近的邻居,算法步骤是: 代码 算法的关键在于设置合理提取的阈值 ,如果取很小的值,它可能把一个对象可以看作是多个群集。 反之,如果将值设置得太高,则可能会发生多个对象被视为一个集群。 pcl::Eucli
阅读全文
摘要:在写相机接口的时候,经常需要把byte*类型转成OpenCV mat类型进行图像运算,下面给出两者互相转换的函数 Byte *->Mat bool ByteToMat(BYTE* pImg, int nH, int nW, int nChannel, cv::Mat& out_img) { if (
阅读全文
摘要:pcl转深度图主要是createFromPointCloud()函数,参数配置基本可以不变,照这个写就行.保存主要是两个函数getVisualImage(),saveRgbPNGFile()没什么难度,头写对了就没问题 #include <stdio.h> #include <stdlib.h> #
阅读全文
摘要:在C/C中有可以直接测试程序运行时间的函数,在<time.h>/头文件中,非常方便和实用。 clock()是C/C中的计时函数,而与其相关的数据类型是clock_t。 该函数计时是以毫秒(ms)为单位的,需要除以一个常量1000才是以秒为计时单位,可以使用头文件中声明好的常量CLOCKS_PRE_S
阅读全文
摘要:其中.lib为文件名后缀,0.txt为写入文件 ```bash dir /b *.lib >0.txt ``` 附0.txt分离代码,可将奇数行和偶数行分离,仅供参考 ```c++ #include #include #include #include using namespace std; in
阅读全文
摘要:增加头文件: #include<iostream>
阅读全文