Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Displaying images from 1D double array

I have a 1D double array that represents a grayscale image. How can I create a Mat using this array to display the image using imshow?

Thanks in advance.

Displaying images from 1D double array

I have a 1D double array that represents a grayscale image. How can I create a Mat using this array to display the image using imshow?

Mat img = imread("input.jpg",0);
double outImg[224932];
imgProcessing(src.data,outImg);

Thanks in advance.

Displaying images from 1D double array

I have a 1D double array that represents a grayscale image. How can I create a Mat using this array to display the image using imshow?

Mat img = imread("input.jpg",0);
double outImg[224932];
imgProcessing(src.data,outImg);

The following is the processing fuctions:

static double* imgProcessing(unsigned char* data)
{
    double *img = filter(data);
    return img ;
}

double* filter(const unsigned char imageName[680028])
{
  int i0;
  static double img[680028];
  static double img_x[680028];
  static double img_y[680028];
  static double img_sqr[680028];

  static double test[680028];
  for (i0 = 0; i0 < 680028; i0++) {
    img[i0] = (double)imageName[i0] / 255.0;
  }

  imfilter(img, img_x);
  b_imfilter(img, img_y);
  power(img_x, img_sqr);
  power(img_y, img);
  for (i0 = 0; i0 < 680028; i0++) {
    imgl_sqr[i0] += img[i0];
  }

  b_sqrt(img_sqr);
  return img_sqr;
 }

Thanks in advance.

Displaying images from 1D double array

I have a 1D double array that represents a grayscale image. How can I create a Mat using this array to display the image using imshow?

Mat img = imread("input.jpg",0);
double outImg[224932];
imgProcessing(src.data,outImg);

The following is are the processing fuctions:

static double* imgProcessing(unsigned char* data)
{
    double *img = filter(data);
    return img ;
}

double* filter(const unsigned char imageName[680028])
{
  int i0;
  static double img[680028];
  static double img_x[680028];
  static double img_y[680028];
  static double img_sqr[680028];

  static double test[680028];
  for (i0 = 0; i0 < 680028; i0++) {
    img[i0] = (double)imageName[i0] / 255.0;
  }

  imfilter(img, img_x);
  b_imfilter(img, img_y);
  power(img_x, img_sqr);
  power(img_y, img);
  for (i0 = 0; i0 < 680028; i0++) {
    imgl_sqr[i0] += img[i0];
  }

  b_sqrt(img_sqr);
  return img_sqr;
 }

Thanks in advance.

Displaying images from 1D double array

I have a 1D double array that represents a grayscale image. How can I create a Mat using this array to display the image using imshow?

Mat img = imread("input.jpg",0);
double outImg[224932];
imgProcessing(src.data,outImg);

The following are the processing fuctions:

static double* imgProcessing(unsigned char* data)
{
    double *img = filter(data);
    return img ;
}

double* filter(const unsigned char imageName[680028])
{
  int i0;
  static double img[680028];
  static double img_x[680028];
  static double img_y[680028];
  static double img_sqr[680028];

  static double test[680028];
  for (i0 = 0; i0 < 680028; i0++) {
    img[i0] = (double)imageName[i0] / 255.0;
  }

  imfilter(img, img_x);
  b_imfilter(img, img_y);
  power(img_x, img_sqr);
  power(img_y, img);
  for (i0 = 0; i0 < 680028; i0++) {
    imgl_sqr[i0] += img[i0];
  }

  b_sqrt(img_sqr);
  return img_sqr;
 }

Thanks in advance.