]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
Small edit due to changes in the conversion library.
authorPetr Kubiznak <kubizpet@fel.cvut.cz>
Fri, 16 Apr 2010 20:56:39 +0000 (22:56 +0200)
committerPetr Kubiznak <kubizpet@fel.cvut.cz>
Fri, 16 Apr 2010 20:56:39 +0000 (22:56 +0200)
src/camera/rozkuk/clr2float_conv.cxx

index 20631488cb7710f16eb77452c032c382cdf2a2b7..31102435298e891605d19e7bb3bd1062ce38f4ed 100644 (file)
@@ -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) {