extract only data with open cv?
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);
As said in previous post C interface is deprecated. You can watch this video. If you are not agree with send message to the author.
Try to work with opencv 3.1 :
full video link to save you the trouble of registering
I work with c nt c++ so MAT is for version c++ oki I have another question ,how I can access to pixel in image binary?
in opencv 3.1 method is at