Hi I was wondering if you could help me with a question on image
processing. I am using c++to process the image.I have a raw file, and I have read it by creating an fstream, and have saved the length of
the file in variable end.
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
using namespace std;
int file_length(ifstream *is)
{
int end;
// get length of file:
is->seekg (0, ios::end);
end = is->tellg();
is->seekg (0, ios::beg);
}
int main()
{
char * buffer;
//unsigned char buffer[128][128];
ifstream myfile("Baboon.raw", ifstream::in); //the file size 4x9x54
int end;
end = file_length(&myfile);
cout << end << "\n";
buffer = (char*) malloc (end);
/*
* returns the length of a file (in bytes)
*/
}
I now have to store the image into a matrix and create code to
process the image into a bmp file.
Any suggestions?
Thanks