且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

矩阵OpenCV的大小

更新时间:2021-11-19 04:06:21

cv:Mat mat;
int rows = mat.rows;
int cols = mat.cols;

cv::Size s = mat.size();
rows = s.height;
cols = s.width;

还要注意步幅> = cols;这意味着该行的实际大小可以大于元素大小x cols.这与连续Mat的问题不同,并且与数据对齐有关.

Also note that stride >= cols; this means that actual size of the row can be greater than element size x cols. This is different from the issue of continuous Mat and is related to data alignment.