fts2blocks.c File Reference

#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <math.h>
#include <string.h>
#include <unistd.h>
#include <ppm.h>
#include "extract_features.proto"

Go to the source code of this file.

Defines

#define numH   18
#define numS   3
#define numV   3
#define numGrey   4

Functions

int main (int argc, char *argv[])


Define Documentation

#define numGrey   4

Definition at line 14 of file fts2blocks.c.

#define numH   18

Definition at line 11 of file fts2blocks.c.

#define numS   3

Definition at line 12 of file fts2blocks.c.

#define numV   3

Definition at line 13 of file fts2blocks.c.


Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 16 of file fts2blocks.c.

References fts2blocks(), and init_feature_variables().

00016                                  {
00017 
00018   char *in_fname, *out_fname;
00019   char *point_pos;
00020   enum file_types ppm_type;
00021   enum ppm_error the_error;
00022  
00023   switch(argc) {
00024   case 2:
00025     in_fname = argv[1];
00026     break;
00027   default:
00028     fprintf(stderr, "Usage: %s fts_file \n\n", argv[0]);
00029     exit(1);
00030     break;
00031   }
00032 
00033   /* now get the filename prefix */
00034   out_fname = (char *)malloc((strlen(in_fname) + 10)*sizeof(char));
00035   if ((point_pos = strchr(in_fname, '.')) == NULL) {
00036     fprintf(stderr, "File %s has no ""."" - can't generate features filename\n\n", in_fname);
00037     exit(1);
00038   }
00039   else {
00040     strncpy(out_fname, in_fname, (int)(point_pos - in_fname));
00041     strcat(out_fname, ".fts");
00042   }
00043   
00044 
00045   /* initialise the variables required for the feature extraction */
00046   init_feature_variables(18*3*3+4);
00047 
00048   fts2blocks(in_fname);
00049 
00050   exit(0);
00051 }


Generated on Wed Jan 7 00:30:50 2009 for Gift by  doxygen 1.5.6