I have a pointer to an image buffer (byte array) and I know the number of rows and columns. What is the fastest way of displaying this image data in opencv. See details below.
int rows, cols;
unsigned char *ImageBuffer;
if (err = WFS_GetSpotfieldImage(instr.handle, &ImageBuffer, &rows, &cols))
handle_errors(err);
// what goes here to construct "MAT image" using the "ImageBuffer" which is a pointer?
Mat image(rows, cols, CV_8UC3, Scalar(255, 0, 0));
cv::namedWindow("Spot Field", cv::WINDOW_AUTOSIZE);
cv::imshow("Spot Field", image);