Mat, vectorpoint2f,Point3d Iplimage等等常见类型转换
在mfc c++ 以及opencv 編寫程序當中,很多常用的類型轉換,現在總結一下。(注意加相應的頭文件,這里不羅嗦)
提綱:
1. Mat?---> Iplimage
2. Iplimage??--->? CvvImage
3.?Mat??---> vector<Point2f> or vector<Point3f>
4. vector<Point2f> or vector<Point3f>??--->? vector<vector<Point2f>> or vector<vector<Point3f>>
5. vector<vector<Point2f>> or vector<vector<Point3f>>??---> Mat
6. vector<Point2f> or vector<Point3f>? --->? Mat
?
圖像類
1. Mat?---> Iplimage :直接賦值?
[cpp]?view plaincopy
2. Iplimage??--->? CvvImage :用“Copyof?”
[cpp]?view plaincopy
數據類
3.?Mat??---> vector<Point2f> or vector<Point3f> :用“Mat_<Point2f>“ ,“Mat_<Point3f>”
[cpp]?view plaincopy
4. vector<Point2f> or vector<Point3f>??--->? vector<vector<Point2f>> or vector<vector<Point3f>> :用“pushback”
5. vector<vector<Point2f>> or vector<vector<Point3f>>??---> Mat
6. vector<Point2f> or vector<Point3f>? --->? Mat :用“Mat(Point3f)"
總結
以上是生活随笔為你收集整理的Mat, vectorpoint2f,Point3d Iplimage等等常见类型转换的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C++ Vector用法深入剖析
- 下一篇: MATLAB中inputdlg的使用