OpenCV--学习笔记01
来源:互联网 发布:java注册登录代码 编辑:程序博客网 时间:2024/06/06 11:16
/* * * cvout_sample just demonstrates the serial out capabilities of cv::Mat * That is, cv::Mat M(...); cout << M; Now works. * */#include "opencv2/core/core.hpp"#include <iostream>using namespace std;using namespace cv;static void help(){ cout << "\n------------------------------------------------------------------\n" << " This program shows the serial out capabilities of cv::Mat\n" << "That is, cv::Mat M(...); cout << M; Now works.\n" << "Output can be formated to OpenCV, matlab, python, numpy, csv and \n" << "C styles Usage:\n" << "./cvout_sample\n" << "------------------------------------------------------------------\n\n" << endl;}int main(int argc, char** argv){ cv::CommandLineParser parser(argc, argv, "{help h||}"); if (parser.has("help")) { help(); return 0; } Mat I = Mat::eye(4, 4, CV_64F); I.at<double>(1,1) = CV_PI; cout << "I = \n" << I << ";" << endl << endl; Mat r = Mat(10, 3, CV_8UC3); randu(r, Scalar::all(0), Scalar::all(255)); cout << "r (default) = \n" << r << ";" << endl << endl; cout << "r (matlab) = \n" << format(r, Formatter::FMT_MATLAB) << ";" << endl << endl; cout << "r (python) = \n" << format(r, Formatter::FMT_PYTHON) << ";" << endl << endl; cout << "r (numpy) = \n" << format(r, Formatter::FMT_NUMPY) << ";" << endl << endl; cout << "r (csv) = \n" << format(r, Formatter::FMT_CSV) << ";" << endl << endl; cout << "r (c) = \n" << format(r, Formatter::FMT_C) << ";" << endl << endl; Point2f p(5, 1); cout << "p = " << p << ";" << endl; Point3f p3f(2, 6, 7); cout << "p3f = " << p3f << ";" << endl; vector<float> v; v.push_back(1); v.push_back(2); v.push_back(3); cout << "shortvec = " << Mat(v) << endl; vector<Point2f> points(20); for (size_t i = 0; i < points.size(); ++i) points[i] = Point2f((float)(i * 5), (float)(i % 7)); cout << "points = " << points << ";" << endl; return 0;}
阅读全文
0 0
- OpenCV--学习笔记01
- 《学习OpenCV》 学习笔记
- OpenCV学习笔记01: Using OpenCV with gcc and CMake
- opencv学习笔记-01 显示图像
- OpenCV学习笔记
- OpenCV 学习笔记
- 学习笔记-----opencv
- OpenCV学习笔记(1)
- OpenCV 学习笔记
- OpenCV学习笔记
- OpenCV学习笔记
- OpenCV学习笔记系列
- OpenCV学习笔记 收藏
- opencv学习笔记
- OPENCV学习笔记(1)
- OPENCV学习笔记(2)
- OpenCV学习笔记-形态学
- OpenCV学习笔记-卷积
- 初学者接触service
- 1.5-Java-switch语句-case穿透
- AT91SAM9x5 如果通过VMware实现NFS
- SQL语句的分类
- Window7 64位 安装TensorFlow(GPU)版本
- OpenCV--学习笔记01
- c/c++调用约定
- Android HTTP下载文件并显示
- jquery实现点击一个tab页,填充整个表单。点击出现事件(二)。
- SimpleFormController的工作流程以及表单的验证
- 集成模型分类
- HDU-5538 House Building
- 使用DexClassLoader的简单例子
- mysql密码设置为空无法访问后怎么解决