From b5b55a21b7abf58100e65bea7703543a950f85a8 Mon Sep 17 00:00:00 2001 From: Petr Kubiznak Date: Fri, 16 Apr 2010 22:56:39 +0200 Subject: [PATCH] Small edit due to changes in the conversion library. --- src/camera/rozkuk/clr2float_conv.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/camera/rozkuk/clr2float_conv.cxx b/src/camera/rozkuk/clr2float_conv.cxx index 20631488..31102435 100644 --- a/src/camera/rozkuk/clr2float_conv.cxx +++ b/src/camera/rozkuk/clr2float_conv.cxx @@ -55,6 +55,7 @@ int processFile(const char *filename, unsigned char threshold) { FILE *pInput, *pOutput; char destFilename[100]; IplImage *clrImage = NULL; + CvMat *outputMat = NULL; float *output = NULL; int outputLen, writtenLen; @@ -76,12 +77,13 @@ int processFile(const char *filename, unsigned char threshold) { // 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); @@ -99,7 +101,7 @@ int processFile(const char *filename, unsigned char threshold) { /** 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) { -- 2.39.2