fork download
  1. #include "stdafx.h"
  2. #include "highgui.h"
  3. #include "iostream"
  4. #include <cv.h>
  5. #include <highgui.h>
  6. #include <stdio.h>
  7.  
  8. using namespace std;
  9.  
  10. int main() {
  11. IplImage *InImage;
  12. FILE *fp_raw;
  13.  
  14. InImage = cvLoadImage("66DK.png",-1);
  15. short *source =NULL;
  16. if(InImage==0)
  17. {
  18. cout<<"Error:couldn't open the image"<<endl;
  19. system("PAUSE");
  20. return 0;
  21. }
  22.  
  23. CvScalar s;
  24. source = new short[(InImage->width)*(InImage->height)];
  25. for(int i=0;i<(InImage->width)*(InImage->height);i++)
  26. {
  27. s= cvGet1D(InImage,i);
  28. short temp1= (short)s.val[0] & 0x000F;
  29. short temp2= (short)s.val[0] & 0xFFF0;
  30. short real_value = (temp1<<12)+(temp2>>4);
  31. source[i]=real_value;
  32. }
  33.  
  34. fp_raw=fopen("DK66.raw","wb");
  35. fwrite(source,sizeof(short),(InImage->width)*(InImage->height),fp_raw);
  36.  
  37. delete []source;
  38. fclose(fp_raw);
  39. return 0;
  40. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:20: fatal error: stdafx.h: No such file or directory
 #include "stdafx.h"
                    ^
compilation terminated.
stdout
Standard output is empty