Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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 i[48400]; img= imread("lena.png"); cvtColor(img,gimg,COLOR_RGB2GRAY); Mat gimg(220, 220, CV_16UC1, i);

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 i[48400]; i[48400];

img= imread("lena.png");
  cvtColor(img,gimg,COLOR_RGB2GRAY);
 

Mat gimg(220, 220, CV_16UC1, i);

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 i[48400];

img= imread("lena.png");

cvtColor(img,gimg,COLOR_RGB2GRAY);

Mat gimg(220, 220, CV_16UC1, i);

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 i[48400];pixellist[48400];

img= imread("lena.png");

cvtColor(img,gimg,COLOR_RGB2GRAY);

Mat gimg(220, 220, CV_16UC1, i);unsigned char* dataMat = gimg.data;

how can I get dataMat into pixellist ? without for loops???

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];

img= imread("lena.png");

cvtColor(img,gimg,COLOR_RGB2GRAY);

unsigned char* dataMat = gimg.data;

how can I get dataMat into pixellist ? without for loops???loops??? or are there any other method to convert Mat to unsigned short array???

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];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???