【发布时间】:2017-01-16 09:05:55
【问题描述】:
我有一个 32 位整数数组,其中包含我想用来创建 Mat 图像的 3450x3450 图像的像素值。尝试了以下方法:
int *image_array;
image_array = (int *)malloc( 3450*3450*sizeof(int) );
memset( (char *)image_array, 0, sizeof(int)*3450*3450 );
image_array[0] = intensity_of_first_pixel;
...
image_array[11902499] = intensity_of_last_pixel;
Mat M(3450, 3450, CV_32FC1, image_array);
并在显示图像时出现黑屏。我还应该注意该数组包含一个 16 位灰度图像。
【问题讨论】:
-
image_array指向什么?你能提供一个Minimal, Complete, and Verifiable 的例子吗?
标签: c++ opencv image-processing