- 博客(16)
- 资源 (1)
- 问答 (1)
- 收藏
- 关注
原创 获取当前路径GetCurrentPath
char* GetCurrentPath() { char currentPath[MAX_PATH] = { 0 }; int n = GetModuleFileNameA(NULL, currentPath, MAX_PATH); currentPath[strrchr(currentPath, '\\') - currentPath + 1] = 0;//将最后一个"\\"后的字符置为0 ...
2018-06-04 11:12:21
2590
原创 opencv mat互转byte
byte * matToBytes(Mat image){ int size = image.total() * image.elemSize(); byte * bytes = new byte[size]; // you will have to delete[] that later std::memcpy(bytes,image.data,size * sizeof(byte...
2018-04-13 10:26:13
10069
2
原创 resize图片到指定分辨率
#include #include #include #include #include "math.h" #include #include #include #include #include #include using namespace std; using namespace cv; namespace fs = std::experi
2018-02-01 09:41:30
2745
原创 c++模板
模板是C++支持参数化多态的工具,使用模板可以使用户为类或者函数声明一种一般模式,使得类中的某些数据成员或者成员函数的参数、返回值取得任意类型。 模板的声明或定义只能在全局,命名空间或类范围内进行。即不能在局部范围,函数内进行,比如不能在main函数中声明或定义一个模板。 模版可以分为两类,一个是函数模版,另外一个是类模版。 函数模板通用格式: template 返回类型 函
2017-12-28 14:09:32
247
原创 防止运行后一闪就退出
可以在cpp里的main函数return之间加入getchar()防止运行后一闪就退出,加上system("pause")或者直接ctrl+F5也行。
2017-11-01 09:37:37
514
原创 图像拼接之透视矩阵
透视矩阵 透视矩阵实际上是一个3x3维的矩阵,图像经过它的变换后(即用图像像素矩阵乘以该透视矩阵),可以呈现出各种透视和仿射效果: 仿射变换可以把图像放大、缩小、旋转、或者是变成平行四边形,而透视变换除了获得仿射变换的这些效果之外,还能将图片变成梯形。 一般表达形式为: 只是我们在计算完透视矩阵之后都会把H矩阵的所有元素都除以a33,
2017-07-21 10:11:21
1209
原创 冒泡排序
1. static void bubble_sort_up(T *array,const int size) 2. { 3. if(NULL==array) 4. throw; 5. 6. if(0>=size) 7. return; 8.
2017-07-17 15:02:50
245
原创 提示libface.dll找不到
重点 提示libface.dll找不到,把这个文件放到release下面,也就是要和.exe文件放一起。 矩阵赋值要用copyto或者clone()
2017-07-17 15:01:26
10374
原创 图像拼接实现
#include #include #include #include usingnamespace std; usingnamespace cv; intmain() { //cv::Mat a =(cv::Mat_(2,2) //cv::Mat b =(cv::Mat_(2,2) //cv::Mat c =(cv::Mat_(2,2) //cv::Mat d = (cv:
2017-07-17 15:00:53
1209
原创 IplImage,CvMat和Mat相互转换
1, IplImage,CvMat和Mat相互转换 1 2 3 4 5 IplImage* img = cvLoadImage("lena.jpg", 1); Mat mtx(img); // IplImage* -> Mat IplImage* img1 = mtx; //Mat -> IplImage* CvMat oldmat = mtx
2017-07-17 14:58:37
400
TA创建的收藏夹 TA关注的收藏夹
TA关注的人