![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
自省自知
好好学习,天天向上。
展开
-
C++ 11之后的数组名与首地址的区别
数组名作为形参传入函数后,其所占字节数会发生变换,因为此时其已经退化为一个指针变量,而任何指针变量所占内存都一样。原创 2022-09-01 16:24:11 · 459 阅读 · 0 评论 -
总结调用PCL库函数出现的各种报错
错误 C2913 显式专用化;“boost::type_of::id2type_impl”不是类模板的专用化 d:\program files\pcl 1.8.1\3rdparty\boost\include\boost-1_64\boost\typeof\msvc\typeof_impl.hpp 125 报错的位置如下:struct id2type_impl<true> //VC8.0 specific bugfeature参照博客在boost-1_64版本中,boost\ty.原创 2022-02-10 18:17:25 · 1165 阅读 · 0 评论 -
error C4996: ‘pcl::SAC_SAMPLE_SIZE‘
问题:pcl-1.8\pcl\sample_consensus\model_types.h(99): error C4996: ‘pcl::SAC_SAMPLE_SIZE’: This map is deprecated and is kept only to prevent breaking existing user code. Starting from PCL 1.8.0 model sample size is a protected member of the SampleConsensusMo原创 2022-01-10 22:28:22 · 420 阅读 · 0 评论 -
Eigen库非常见报错
C++ Eigen库非常见报错。1.内存问题。出错文件:C:\ProgramCode\CommonLib\ceres_win10_vs2017_x64\eigen3\include\eigen3\Eigen\src\Core\util\Memory.h//出错位置。EIGEN_DEVICE_FUNC inline void throw_std_bad_alloc(){ #ifdef EIGEN_EXCEPTIONS throw std::bad_alloc(); #else原创 2021-12-07 10:33:11 · 2055 阅读 · 0 评论 -
命令行错误:通过 --current_directory选项指定的目录不是目录
利用bat文件启动vs解决方案,在编辑器中出现以下提示。解决方法:关闭当前解决方案,在解决方案所在目录下找到隐藏文件夹“.vs”,将其删除,然后用bat文件重新启动该解决方案,问题既消失。原因:如下图所示,.vs文件夹中包含了很多文件配置信息,因为我是将原来的工程修改成如今的名字的,因此,不知道是不是先前工程名的信息被保存在这里了,反正将这个文件夹删除后,重新生成一个就没问题了。...原创 2021-11-08 17:52:22 · 1295 阅读 · 0 评论 -
Visual studio中展开和折叠代码快捷键
[转]VS中展开和折叠代码VS2005代码编辑器的展开和折叠代码确实很方便和实用。以下是展开代码和折叠代码所用到的快捷键,很常用:Ctrl + M + O: 折叠所有方法Ctrl + M + M: 折叠或者展开当前方法Ctrl + M + L: 展开所有方法解决VS2010中工具箱的的不见的问题:按快捷键Ctrl+Alt+X全屏:Shift+Alt+Enter注释选定内容:Ctrl+E+C/Crtr+E+U代码格式化:ctrl+E+F===========================原创 2021-09-13 18:32:44 · 6891 阅读 · 0 评论 -
C++中引用导致的问题
C++中引用导致的问题,如下ScanLIne(const cv::Mat& img_roi, const cv::Mat& cld_roi, cv::Mat& amimg_roi){// 如果这样写amimg_roi=img_roi;对amimg_roi修改,img_roi也会变化。}原创 2021-09-07 14:56:37 · 162 阅读 · 0 评论 -
boost创建文件夹
利用boost获取文件路径及其创建文件夹#include<boost/filesystem.hpp> ……// 获取应用程序所在的路径;std::string exePath = boost::filesystem::initial_path<boost::filesystem::path>().string();std::string file_path=exePath+"/jkjk";// 检测文件夹是否存在,如果不存在就创建该文件夹;if(boost::files原创 2021-08-23 14:52:32 · 723 阅读 · 0 评论 -
C++中algorithm中的nth_element函数
template inlinevoid nth_element(_RanIt _First, _RanIt _Nth, _RanIt _Last){ // order Nth element, using operator<_STD nth_element(_First, _Nth, _Last, less<>());}原创 2021-08-20 12:16:37 · 130 阅读 · 0 评论 -
关于OpenCV4.5.1中的函数findHomography调用出现异常的问题
findHomography()Mat cv::findHomography ( InputArray srcPoints,InputArray dstPoints,int method = 0,double ransacReprojThreshold = 3,OutputArray mask = noArray(),const int maxIters = 2000,const double confidence = 0.995)当srcPoints和dstPoints的值原创 2021-08-19 17:11:10 · 720 阅读 · 0 评论 -
关于opencv4.5.1中CV_RANSAC未定义的问题
ransac算法已经被重新定义在命名空间cv中,因此使用ransac时直接使用cv::RANSAC即可。原创 2021-08-16 16:29:25 · 3375 阅读 · 2 评论 -
drawContours()
drawContours()void cv::drawContours ( InputOutputArray image,InputArrayOfArrays contours,int contourIdx,const Scalar & color,int thickness = 1,int lineType = LINE_8,InputArray hierarchy = noArray(),int maxLevel = INT_MAX,Point offset原创 2021-08-13 15:09:02 · 406 阅读 · 0 评论 -
An example program illustrates the use of cv::findContours and cv::drawContours
An example program illustrates the use of cv::findContours and cv::drawContoursWindowsQtContoursOutput.pngScreenshot of the program#include “opencv2/imgproc.hpp”#include “opencv2/highgui.hpp”#include <math.h>#include using namespace cv;using原创 2021-08-13 14:59:43 · 205 阅读 · 0 评论 -
Erosion and Dilation sample code
Erosion and Dilation sample codeMorphology_1_Tutorial_Erosion_Result.jpgSample Screenshot-ErosionMorphology_1_Tutorial_Dilation_Result.jpgSample Screenshot-DilationCheck the corresponding tutorial for more details#include “opencv2/imgproc.hpp”#inclu原创 2021-08-13 14:58:52 · 157 阅读 · 0 评论 -
C++利用Opencv创建单/三通道图像
1.彩色图像// 示例代码cv::Size smallSize;smallSize.height = h;smallSize.width = w;cv::Mat projImg = cv::Mat(smallSize, CV_8UC3, cv::Scalar(0, 0, 0));// 创建三通道黑色图像。cv::Mat projGreyImg = cv::Mat(smallSize, CV_8U, cv::Scalar(0));// 创建单通道黑色图像。 ... ... ...unsig原创 2021-08-06 10:35:17 · 4794 阅读 · 0 评论 -
C++中acos,asin,atan的值域,以及log函数
++中acos,asin,atan的值域acos:Principal arc cosine of x, in the interval [0,pi] radians.asin:Principal arc sine of x, in the interval [-pi/2,+pi/2] radians.atan:Principal arc tangent of x, in the interval [-pi/2,+pi/2] radians.One radian is equivalent to原创 2021-08-02 11:27:21 · 707 阅读 · 0 评论 -
C++函数的类型及其返回值
例如using namespace std;string heh(){ string hah="example"; return hah;}string& hh(){ string hah="example"; return hah;}....int main(){ string en=hh();// en的值为null;在函数结束后,函数内部的值都被清除了,故引用的值无法获取。 string enen=heh();// enen的值为原创 2021-07-28 18:02:54 · 1725 阅读 · 0 评论 -
C++中map的使用方法
map下标运算符接受一个索引(即,一个关键字,first指向的值),获取与此关键字相关联的值(second指向的值)。但是,与其他下标运算符不同的是,如果关键字并不在map中,会为它创建一个元素并插入到map中,关联值将进行值初始化。如map<string,size_t> word_count;//empty mapworld_count["Anna"]=1;将会在word_count中增加<“Anna”,1>的值。...原创 2021-07-28 15:15:43 · 186 阅读 · 0 评论 -
Eigen库中矩阵的创建、初始化和赋值
Eigen::Matrix4d rot;// 创建4行4列的double型矩阵(方阵)rotate_1 << 1.0, 0.0, 0.0, 0.0, 0.0, cos(p), -sin(p), 0.0, 0.0, sin(p), cos(p), 0.0, 0.0, 0.0, 0.0, 1.0;Eigen::MatrixXd rot(10,3);// 创建10行3列的double型矩阵for(int i=0;i<10;++i){ // 对矩阵进行初始化 ro原创 2021-07-26 14:26:41 · 35657 阅读 · 3 评论 -
在C++中使用预定义好的常用量的方法
在C++中使用 pi值,操作如下:在.h或.cpp文件中,将以下宏定义放在#include<math.h>之前。#define _USE_MATH_DEFINES#include <math.h>原创 2021-05-06 17:18:23 · 129 阅读 · 0 评论 -
C++程序接口封装
C++程序接口封装总结总结1.在输出类中不能用命名空间包含,不然在源文件中无法实例化,在输出类头文件中声明的类。原创 2021-01-19 16:31:20 · 452 阅读 · 0 评论