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
please add relevant code snippet, and maybe, a smallish example image.