结构类型 | 数据类型 | 数据点表示实例 | 空间大小 | MIN | MAX |
---|---|---|---|---|---|
单通道 | |||||
CV_8UC1 | uchar | Mat.at<uchar>(rows, cols) | 8bits | 0 | 255 |
CV_8SC1 | char | Mat.at<char>(rows, cols) | 8bits | -128 | 127 |
CV_16UC1 | ushort | Mat.at<ushort>(rows, cols) | 16bits | 0 | 65535 |
CV_16SC1 | short | Mat.at<short>(rows, cols) | 16bits | -32768 | 32767 |
CV_32SC1 | int | Mat.at<int>(rows, cols) | 32bits | 2147483648 | 2147483647 |
CV_32FC1 | float | Mat.at<float>(rows, cols) | 32bits | -3.40* 1 0 38 10^{38} 1038 | 3.40* 1 0 38 10^{38} 1038 |
CV_64FC1 | double | Mat.at<double>(rows, cols) | 64bits | -1.79* 1 0 308 10^{308} 10308 | 1.79* 1 0 308 10^{308} 10308 |
三通道 | |||||
CV_8UC3 | Vec3b | Mat.at<Vec3b>(rows, cols) | 8bits | 0 | 255 |
CV_8SC3 | Vec3b | Mat.at<Vec3b>(rows, cols) | 8bits | -128 | 127 |
CV_16UC3 | Vec3w | Mat.at<Vec3w>(rows, cols) | 16bits | 0 | 65535 |
CV_16SC3 | Vec3s | Mat.at<Vec3s>(rows, cols) | 16bits | -32768 | 32767 |
CV_32SC3 | Vec3i | Mat.at<Vec3i>(rows, cols) | 32bits | 2147483648 | 2147483647 |
CV_32FC3 | Vec3f | Mat.at<Vec3f>(rows, cols) | 32bits | -3.40* 1 0 38 10^{38} 1038 | 3.40* 1 0 38 10^{38} 1038 |
CV_64FC3 | Vec3d | Mat.at<Vec3d>(rows, cols) | 64bits | -1.79* 1 0 308 10^{308} 10308 | 1.79* 1 0 308 10^{308} 10308 |
注:
Height = Mat.rows;
Width = Mat.cols;
在调用相机时,可以按照如下方式设置摄像头相关参数:
capture.open("v4l2src device=/dev/video0 ! video/x-raw,width=1920,height=1080,framerate=30/1 ! videoconvert ! appsink");