
C++
程序员正茂
好好干活
展开
-
C++ STL仿函数在vector中自定义查找
1.find_if仿函数。原创 2024-02-23 09:26:49 · 278 阅读 · 0 评论 -
CMake+VS2017编译OSGEarth(无需编译OSG)
本文写作于2023年8月18日,按以下步骤编译了再次,都可正常运行。无需编译OSG,直接编译OSGEarth。工具版本:CMake 3.27.3, VS2017(安装C++开发组件)原创 2023-08-18 17:45:24 · 1265 阅读 · 14 评论 -
OpenCV使用warpPerspective变换单个点
【代码】OpenCV使用warpPerspective变换单个点。原创 2023-05-06 18:46:14 · 368 阅读 · 1 评论 -
OpenCV Matl转MFC CImage显示在PictureBox上
重点:绘图前必须调用SetStretchBltMode函数(设置缩放模式),否则失真严重。2.将CImage显示到PictureBox上。3.Mat转CImage函数实现。1. Mat转CImage。原创 2023-05-05 17:02:49 · 453 阅读 · 0 评论 -
CMake+VS2019编译ViSP工程(可用于Apriltag识别)
官方安装教程:https://visp-doc.inria.fr/doxygen/visp-daily/tutorial-install-win10-msvc16-uwp.html一、安装VS2019、CMake、git1.安装VS2019。在【工作负载】选中【使用C++的桌面开发】,在【单个组件】中选中【用于Windows的C++ CMake工具】。2.安装CMake。从官网获取后点击下一步安装即可。安装后从将CMake.exe所在路径添加到环境变量,这样才能在cmd命令行中使用CMa原创 2020-05-26 11:56:15 · 1369 阅读 · 0 评论 -
判断两个矩形是否相交最简单算法
第一个矩形:(x1,y1),(x2,y2)第二个矩形:(x3,y3),(x4,y4)如果满足max(x1,x3)<=min(x2,x4)&&max(y1,y3)<=min(y2,y4),则相交。原创 2019-09-14 17:22:01 · 2713 阅读 · 3 评论 -
opencv移动物体检测(自动更新背景)
#include "pch.h"#include <iostream>#include <opencv2\opencv.hpp>#include <vector>using namespace cv;using namespace std;int main(){ VideoCapture capture(0);//capture("D:\\...原创 2019-01-04 14:20:39 · 1857 阅读 · 0 评论 -
opencv柱面投影
在做全景拼接的时候,为了保持图片中的空间约束与视觉的一致性,需要进行柱面投影,否则离中心图像距离越远的图像拼接后变形越大。柱面投影公式为变换效果如下:int main(){ cv::Mat image1 = cv::imread("images/1.jpg", 1); if (!image1.data) return 0; imshow("image1", i...原创 2018-12-21 18:17:33 · 4214 阅读 · 6 评论 -
opencv 图像拼接
左右图单应性变换原理图1.SURF特征点提取#include "pch.h"#include <opencv2\opencv.hpp>#include <opencv2\xfeatures2d.hpp>#include <iostream>#include "StitcherTest.h"using namespace cv;usi...原创 2018-11-19 17:12:27 · 739 阅读 · 0 评论 -
opencv文件的读写
void WriteCvRectList(const list<CvRect>& listRect){ FileStorage fs(SAVE_FILE_NAME, FileStorage::WRITE); //创建XML文件 if (!fs.isOpened()) { cerr << "failed to open " << SAVE_...原创 2018-07-30 14:33:55 · 610 阅读 · 0 评论 -
C++ 自定义仿函数删除元素
struct EqualCvRect : public binary_function<CvRect, CvRect, bool>{public: bool operator()(const CvRect& rect1, const CvRect& rect2) const { if (rect1.x == rect2.x && rect...原创 2018-07-22 16:44:06 · 257 阅读 · 0 评论 -
opencv 特征匹配
#include "stdafx.h"#include <opencv2\opencv.hpp>#include <opencv2\xfeatures2d.hpp>#include <iostream>using namespace cv;using namespace cv::xfeatures2d;using namespace std;...原创 2018-04-23 15:36:26 · 518 阅读 · 0 评论 -
C++获取CPU序列号和C盘卷标号
主要用到两个类win32_Processor、win32_logicaldisk在MSDN中可以查看到用法和示例,这里是根据示例修改的。#define _WIN32_DCOM#include using namespace std;#include #include # pragma comment(lib, "wbemuuid.lib")int main(int ar原创 2016-11-18 15:55:02 · 7960 阅读 · 0 评论