Tuesday 15 July 2014

c++ - Image loading function not working -


OK, so I'm working on a project, and it has come to this problem. I get this message when my program is run:

  Programming programming. Exempted on 0x76fa15de in XX: 0xC0000005: access violation space 0x00000000   < P> There are code errors which Visual Studio says:  
  float ** load img (const char * filename) {float ** data = {0}; Char * buf = new four [32]; Std :: string buf2; Std :: ifstream filebuf (filename); Filebuf.getline (Buff, 32); // Repeat on every pixel, very inefficient, need to be fixed (int x = 0; x & lt; (IMAGE_SIZE_X - 1); x ++) {for (int y = 0; y & lt; (IMAGE_SIZE_Y - 1); y ++) {filebuf.getline (buf, 32); // To copy only the values ​​(Int i = 8; i <32; i ++) {if (buf [i]! = '\ T' and Buff [i]! = '') {Buf2 + = buf [i]; }} // Set the value of the pixel data [x] [y] = (float) strobe bond (buf2); }} Filebuf.close (); Return data; } Here is a sample format that I am trying to read:  
  xy value 1 1 0 1 2 0 1 3 0 1 4 0 1 5 10.159 1 6 5.225 1 7 1.337 1 8 0 1 90 1 10 0   

I have to load the appropriate field in the appropriate pixel (X, Y).

Edit: IMAGE_SIZE_X and IMAGE_SIZE_Y are static for the size of the bus I & rsquo; Image (97x56).

You have declared data as an indicator an indicator, and You are using data , but you have never allocated a location and have set data to indicate

No comments:

Post a Comment