Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Mat array[20] to unsigned short array

hi, I am using following method to convert image pixel values to unsigned short array. ////////////////// unsigned short *yc_in;

yc_in=( unsigned short )malloc(442368sizeof( unsigned short));

if (!yc_in ) { if (yc_in) free(yc_in); }

Mat gimg(576,768,CV_16UC1,yc_in);
image.convertTo(gimg,CV_16UC1); /////////////////////////////////////

how can I do the same thing with array of image efficiently. for example image[20]. ??? (I cannot use vector operations)

click to hide/show revision 2
None

updated 2019-07-22 04:12:50 -0600

berak gravatar image

Mat array[20] to unsigned short array

hi, I am using following method to convert image pixel values to unsigned short array. array.

//////////////////
unsigned short *yc_in;

*yc_in;

yc_in=( unsigned short )malloc(442368sizeof( *)malloc(442368*sizeof( unsigned short));

short));

if (!yc_in ) { if (yc_in) free(yc_in); }

}

Mat gimg(576,768,CV_16UC1,yc_in);
image.convertTo(gimg,CV_16UC1); /////////////////////////////////////

/////////////////////////////////////

how can I do the same thing with array of image efficiently. for example image[20]. ??? (I cannot use vector operations)

Mat array[20] to unsigned short array

hi, I am using following method to convert image pixel values to unsigned short array.

//////////////////
unsigned short *yc_in;

yc_in=( unsigned short *)malloc(442368*sizeof( unsigned short));

if (!yc_in  ) {
              if (yc_in) free(yc_in);
         }

Mat gimg(576,768,CV_16UC1,yc_in);  
image.convertTo(gimg,CV_16UC1);
/////////////////////////////////////

how can I do the same thing with array of image efficiently. for example image[20]. ??? (I cannot use vector operations)