
c++
孙俏俏
这个作者很懒,什么都没留下…
展开
-
c++一维数组的创建和排序
bool FeatureCmp(Keypoint& f1, Keypoint& f2) { return f1.scale > f2.scale; } int main() { //创建一维数组 size_t m=3; //假定数组长度为m double *matched; matched = new double[m]; //动态分配空间 //一...原创 2018-12-19 17:41:26 · 1067 阅读 · 0 评论 -
img.jpg open error!
原:Mat img = imread("E:\\testpictures\\0\\5(55).jpg"); 改:Mat img1= imread("E:\\testpictures\\0\\5\\55.jpg"); \\读入图像时括号会出错原创 2019-01-08 20:04:00 · 472 阅读 · 0 评论 -
使用vector出现的错误 subscript out of range(给vector<struct>赋值)
#include <iostream> #include <fstream> #include "opencv2/highgui/highgui.hpp" #include "opencv2/stitching/stitcher.hpp" #include "opencv2/opencv.hpp" using namespace std; using nam...原创 2018-12-25 19:03:25 · 1409 阅读 · 0 评论 -
c++函数调用过程中,形参的值发生了改变,实参的值却没变
出错代码: int desideK(int K) {K=3; return K; } void main() { int K=0; desideK(K); cout << "K=" << K << endl; } 修改一: int desideK(int K) {K=3; return K; } void m...原创 2018-12-25 16:36:43 · 2467 阅读 · 1 评论 -
sift(c++)自写程序读入两张图像提特征,第二张提到的极值点、关键点、稳定点和第一张都一模一样
我之前把 extern vector<Mat> gauss_pyr; //声明全局变量gauss_pyr extern vector<Mat> dog_pyr; //声明全局变量dog_pyr extern struct K...原创 2018-12-28 15:49:56 · 203 阅读 · 0 评论 -
c++:struct变量中的某一项赋值给一个多维数组的例子
#include <stdlib.h> #include <iostream> #include <fstream> #include <stdio.h> #include <math.h> #include <cv.h> #include <highgui.h> #include<cstdlib&a原创 2018-12-17 16:48:42 · 458 阅读 · 0 评论 -
c++:多维数组的新建(new)和释放(delete)
一维: int *array1D; //假定数组长度为m //动态分配空间 array1D = new int [m]; //释放 delete [] array1D; 二维: int **array2D; //假定数组第一维长度为m, 第二维长度为n //动态分配空间 array2D = new int *[m]; for( int i=0; i<m; i++ ) { a...转载 2018-12-17 15:53:25 · 557 阅读 · 0 评论 -
直线连接一幅图像中的两个坐标点,显示并保存
#include <iostream> #include <fstream> #include "opencv2/highgui/highgui.hpp" #include "opencv2/stitching/stitcher.hpp" #include "opencv2/opencv.hpp" using namespace std; using nam...原创 2018-12-20 17:48:48 · 784 阅读 · 0 评论 -
c++(opencv)拼接两幅尺寸不同的图像
#include <iostream> #include <fstream> #include "opencv2/highgui/highgui.hpp" #include "opencv2/stitching/stitcher.hpp" #include "opencv2/opencv.hpp" using namespace std; using n...原创 2018-12-20 15:48:57 · 1956 阅读 · 2 评论 -
c++一维数组升序排序后返回原索引值
#include<stdio.h> #include<malloc.h> #include <stdlib.h> int *sortIndex(int b[], int n) { int *m; int temp; m = (int*)malloc(sizeof(int)*n); for (int i = 0; i < n;...原创 2018-12-19 19:11:18 · 2561 阅读 · 0 评论 -
if(dot[k]>1){输出dot[k]的值;}输出的结果却是dot[k]=1
double dot[k]; if(dot[k]>1) {cout<<“dot[k]=”<<dot[k]<<endl;} 输出的结果却是dot[k]=1 是因为之前有一大堆计算得出dot[k],而我设置的dot[k]是double类型16位的,所以就算它输出的是1,其实可能是1.000000000000001,而输出只显示小数点后6位,所...原创 2019-01-21 16:45:34 · 172 阅读 · 0 评论