hey friends I tried to convert greyscale image to binary image , but now I want see only data without header ? how I can extract header only and data only ? after I want save header in file and data to in other file?
1 | initial version |
hey friends I tried to convert greyscale image to binary image , but now I want see only data without header ? how I can extract header only and data only ? after I want save header in file and data to in other file?
2 | No.2 Revision |
hey friends
I tried to convert greyscale image to binary image , but now I want see only data without header ?
how I can extract header only and data only ? after I want save header in file and data to in other file?file?
nota:visual studio 2010 , opencv 2.4.9 , c programming
3 | No.3 Revision |
hey friends I tried to convert greyscale image to binary image , but now I want see only data without header ? how I can extract header only and data only ? after I want save header in file and data to in other file? nota:visual studio 2010 , opencv 2.4.9 , c programming
int _tmain(int argc, _TCHAR* argv[])
{
//load image
IplImage* im_gray = cvLoadImage("image1.pgm",CV_LOAD_IMAGE_GRAYSCALE);
//convert to grey
//IplImage *im_rgb = cvLoadImage("image.jpg");
//cvCvtColor(im_rgb,im_gray,CV_RGB2GRAY);
//convert to binary
IplImage* im_bw = cvCreateImage(cvGetSize(im_gray),IPL_DEPTH_8U,1);
cvThreshold(im_gray, im_bw, 128, 255, CV_THRESH_BINARY | CV_THRESH_OTSU);
//save to disk
cvSaveImage("image_final2.pgm",im_bw);