Reputation: 683
I have a RGB image. I load it in opencv using:
Mat image;
image = imread(argv[1], CV_LOAD_IMAGE_COLOR); // Read the file
Now I need to create an uchar *array from the image data. How do i do it?
Upvotes: 0
Views: 795
Reputation: 80187
uchar* cv::Mat::data
pointer to the data
And don't forget that Mat
actual row size might differ from 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.
Upvotes: 1