Opencv_Mat操作

参考:https://blog.csdn.net/qq_18150255/article/details/90648407?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task

 

Mat理解:

Mat头和数据区域

浅复制:

Mat A, C;                          // creates just the header parts
A = imread(argv[1], IMREAD_COLOR); // here we'll know the method used (allocate matrix)
Mat B(A);                                 // Use the copy constructor
C = A;                                    // Assignment operator
Mat D (A, Rect(10, 10, 100, 100) ); // using a rectangle
Mat E = A(Range::all(), Range(1,3)); // using row and column boundaries

深复制:

Mat F = A.clone();
Mat G;
A.copyTo(G);

 

Mat初始化操作

 

 Opencv_Mat操作_第1张图片

Opencv_Mat操作_第2张图片

Opencv_Mat操作_第3张图片

 

 

 Mat输出

Opencv_Mat操作_第4张图片

 其它数据操作(Point2f )

Opencv_Mat操作_第5张图片

你可能感兴趣的:(Opencv)