descriptor.c

来自「feret人脸图象数据库处理代码」· C语言 代码 · 共 103 行

C
103
字号
/*----------------------------------------------------------------------PROGRAM: descriptor.cDATE:    6/2/94AUTHOR:  Baback Moghaddam, baback@media.mit.edu------------------------------------------------------------------------   This program reads a descriptor file from indir and prints out   its contents. It's meant as a diagnostic routine.---------------------------------------------------------------------- */#include <stdio.h>#include <stdlib.h>#include <string.h>#include <math.h>#include <float.h>#include "util.h"#include "io.h"#include "matrix.h"#include "filter.h"/* ----------- Command-Line Parsing Stuff ------- */extern int optind;extern char *optarg;char *progname;          /* used to store the name of the program  */char comline[256];       /* used to store the entire command line  */#define OPTIONS "i:"char *usage = "-i indir\n";#define MAX_CHARS  256/*----------------------------------------------------------------------*/main(int argc, char **argv){   register int i,j,k,l,ii,jj;  int f, c, nframe, sets, bytes_pixel;  int nrow, ncol, out_nrow, out_ncol, M, N;  char command[MAX_CHARS],indir[MAX_CHARS],listfile[MAX_CHARS], \    infile[MAX_CHARS], outdir[MAX_CHARS], \      filename[MAX_CHARS], line[MAX_CHARS];  /* required input flags */    int err_flag   = 0;  int in_flag    = 0;  progname = argv[0];  for (i=0; i<argc; i++)    strcat(comline, argv[i]),strcat(comline, " ");      /* ----------------------  Command Line Parse ------------------------ */    while ((c = getopt(argc, argv, OPTIONS)) != EOF)    switch (c) {          case 'i':      strcpy(indir, optarg);      in_flag = 1;      break;    case '?':      err_flag = 1;      break;    }    /* command line error check */    if (err_flag || !in_flag) {    fprintf(stderr,"\nUSAGE: %s %s\n\n", progname, usage);    exit(1);  }  /* ----  read indir descriptor -------- */    read_descriptor(indir, &nframe, &sets, &bytes_pixel, &ncol, &nrow);    printf("\n");  printf("data_files  = %d\n", nframe);  printf("data_sets   = %d\n", sets);  printf("dimensions  = %d %d\n", nrow, ncol);  printf("bytes_pixel = %d\n", bytes_pixel);  printf("\n");  return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?