我有一张RGB图像。我使用:
在opencv中加载它Mat image;
image = imread(argv[1], CV_LOAD_IMAGE_COLOR); // Read the file
现在我需要从图像数据创建一个uchar *数组。 我该怎么做?
答案 0 :(得分:1)
uchar* cv::Mat::data
pointer to the data
并且不要忘记Mat
实际行大小可能与width * sizeof(element)不同:
cv::Mat::step is needed because the matrix can be a part of another matrix
or because there can some padding space in the end of each row for a proper
alignment.