FILE *pInput, *pOutput;
char destFilename[100];
IplImage *clrImage = NULL;
+ CvMat *outputMat = NULL;
float *output = NULL;
int outputLen, writtenLen;
// load input image and generate a float <-1,1> format
clrImage = cvLoadImage(filename);
if(!clrImage) return 1;
- if(!(outputLen=clr2float(clrImage, &output, threshold, NULL))) {
+ if(!(outputLen=clr2float(clrImage, &outputMat, threshold, NULL))) {
cvReleaseImage(&clrImage);
fclose(pInput);
fclose(pOutput);
}
// write the data to the file
+ output = outputMat->data.fl;
writtenLen = fwrite(output, sizeof(output[0]), outputLen, pOutput);
if(writtenLen != outputLen)
fprintf(stderr, "File \"%s\" processed, but an error occured when writting the output to \"%s\".\n", filename, destFilename);
/** Processes the program arguments and for every input generates converted output. */
int main(int argc, char *argv[]) {
char opt;
- int thr=100; //some default value of threshold
+ int thr=130; //some default value of threshold
// scan for program arguments
while ((opt = getopt(argc, argv, "t:")) != -1) {