Ask Your Question

jai's profile - activity

2015-05-14 03:54:18 -0600 received badge  Editor (source)
2015-05-14 03:52:17 -0600 asked a question write / display binary data

HI ALL

i have read binary data using read function. Assigned this data to Mat object say image. If i am printing this image using image.at<short>. i ; i am getting the desired elements values.

But now if i am trying to show it using imshow , i am getting a blank image. and if i am trying to write it imwrite , i am getting 0 byte data

please help to resolve this.

short *data;
int size= 512*512;
FILE *f=NULL;

read(f, size, sizeof(short));

Mat image(512,512,3,data);
for(int i=0; i<512; i++)
printf("%d", image.at<short>.i);

imshow("image",image); //Blank\
imwrite ()// blank