这篇文章给大家介绍如何进行OpenCV vector 测试,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。#include <iOStream>#include <cv.h>#
这篇文章给大家介绍如何进行OpenCV vector 测试,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。
#include <iOStream>#include <cv.h>#include <cxcore.h>#include <highgui.h>using namespace std;using namespace cv;int main( ) { #if 1 //声明一个2维点向量,2列,自定义行数 vector<Point2f> vp2f; //二维点向量赋值 vp2f.push_back(Point2f(3, 3)); cout << "【二维点向量】" << endl << vp2f << endl; //定义4*2的矩阵,并赋值,若没有赋值,则默认为0 vector<Point2f> corners(4); corners[0] = Point2f(0,0); corners[1] = Point2f(200-1,0); corners[2] = Point2f(0,300-1); corners[3] = Point2f(200-1,300-1); cout << "【corners(4)】" << endl << corners << endl; //定义一个5*2的矩阵,未赋值,默认为0 vector<Point2f> corners_trans(5); cout << "【corners_trans(5)】" << endl << corners_trans << endl; //定义20*3的矩阵,并赋值 vector<Point3f> vp3f(20); for (size_t i = 0; i < vp3f.size(); i++) { vp3f[i] = Point3f((float)(i + i), (float)(i * i), (float)(i + 1)); } cout << "【三维点向量】" << endl << vp3f << endl; #endif system("pause"); cvWaiTKEy(50000); return 0; }
关于如何进行opencv vector 测试就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。
--结束END--
本文标题: 如何进行opencv vector 测试
本文链接: https://www.lsjlt.com/news/237954.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
2024-05-14
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0