Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Some problem about displaying a raw image file

hello every body, last time I posted this question. I have a raw image of 256 by 256 with 8 bits per pixels. The image is a gray scale image. As per answer, I wrote the following code:

/*************

include <opencv\cv.h>

include <opencv\highgui.h>

include <math.h>

using namespace cv;

int main(int argc, char** argv){

Mat img = Mat(256, 256, CV_8UC1);
img = imread("1.IMG", 1); 
namedWindow( "RawImage", 1 );
imshow( "RawImage", img );
cvWaitKey();

return 0;

}

/**************/

But I can't display the image. abort is called. Could anyone help me figure out the problem?

Thanks in advance.

click to hide/show revision 2
No.2 Revision

updated 2013-05-24 01:39:44 -0600

berak gravatar image

Some problem about displaying a raw image file

hello every body, last time I posted this question. I have a raw image of 256 by 256 with 8 bits per pixels. The image is a gray scale image. As per answer, I wrote the following code:

/*************

/*******************************************
 

include <opencv\cv.h>

#include <opencv\cv.h> #include <opencv\highgui.h> #include <math.h>

include <opencv\highgui.h>

include <math.h>

using namespace cv;

cv;

int main(int argc, char** argv){

argv){
 Mat img = Mat(256, 256, CV_8UC1);
 img = imread("1.IMG", 1); 
 namedWindow( "RawImage", 1 );
 imshow( "RawImage", img );
 cvWaitKey();

 return 0;
}


/**********************************************/

}

/**************/

But I can't display the image. abort is called. Could anyone help me figure out the problem?

Thanks in advance.

click to hide/show revision 3
No.3 Revision

updated 2013-05-24 01:40:55 -0600

berak gravatar image

Some problem about displaying a raw image file

hello every body, last time I posted this question. I have a raw image of 256 by 256 with 8 bits per pixels. The image is a gray scale image. As per answer, I wrote the following code:

/*******************************************
/*******************************************/



#include <opencv\cv.h>
#include <opencv\highgui.h>
#include <math.h>

using namespace cv;

int main(int argc, char** argv){

    Mat img = Mat(256, 256, CV_8UC1);
    img = imread("1.IMG", 1); 
    namedWindow( "RawImage", 1 );
    imshow( "RawImage", img );
    cvWaitKey();

    return 0;
}


/**********************************************/

But I can't display the image. abort is called. Could anyone help me figure out the problem?

Thanks in advance.