unsigned short 1D array of gray image
hi, I know this sound very small problem, But I have been searching google answer for this, basically what I need is convert 2d array of gray image into 1d unsigned short array. I tried following code, but I could not get what I need.
unsigned short pixellist[48400];//image size 220x220
img= imread("lena.png");
cvtColor(img,gimg,COLOR_RGB2GRAY);
unsigned char* dataMat = gimg.data;
how can I get dataMat into pixellist ? without for loops??? or are there any other method to convert Mat to unsigned short array???
use convertto and reshape