Ask Your Question

yagami_md's profile - activity

2016-06-14 05:21:06 -0600 commented question extract only data with open cv?

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?

2016-06-13 05:03:43 -0600 received badge  Editor (source)
2016-06-13 05:02:28 -0600 asked a question 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);
2016-06-12 16:51:34 -0600 asked a question oprncv with c tuorial..??

hey guys please I want tutorial with visual studio 2010 c programming , to convert image to black and white!!!!!

2016-06-11 07:36:45 -0600 commented question convert pgm to pbm format?

please answer me ?,

2016-06-10 18:57:03 -0600 commented question convert pgm to pbm format?

include <stdio.h>

#include <io.h>
#include <ctype.h>

// ...

FILE *pFile = fopen("result.pbm", "rb");
// NOTE: With Microsoft compilers these functions might require a 
//  leading under score (_filelength, _fileno)
long file_len = filelength(fileno(pFile));
unsigned char *buffer = (unsigned char *)malloc(file_len);
fread(buffer, 1, file_len, pFile);
fclose(pFile);

const char *header = (const char *)buffer;

// Skip magic number "P4"
while (isalnum(*header)) header++;
// Skip white spaces
while (isspace(*header)) header++;
// Get width
int width = atoi(header);
// Skip width
while (isdigit(*header)) header++;
// Skip whitespace
while (isspace(*header)) header++;
int height = atoi(header);
// Skip height
while (isdigit(*header)) header++;
// Skip single whitespace
header++;

// Point
2016-06-10 09:23:11 -0600 asked a question convert pgm to pbm format?

hey friends I need to convert pgm format to pbm format , I need to read the image in binary just 0 or 1 black or white , I tried to convert in C visual studio 2010