亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? canny.c

?? feret人臉圖象數據庫處理代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*----------------------------------------------------------------------PROGRAM: canny.cDATE:    11/15/94AUTHOR:  Baback Moghaddam, baback@media.mit.edu------------------------------------------------------------------------   This routine reads in an ASCII file of the format   filename     .   .   .   and applies the canny edge detector to each image in the input directory,   the resulting magnitude and thresholded images are written to the specified   output directoryies under the same names.      Canny code is from the AI-lab ---------------------------------------------------------------------- */#include <stdio.h>#include <stdlib.h>#include <string.h>#include <math.h>#include <float.h>#include "util.h"#include "io.h"#include "canny.h"  #define MAX_CHARS  256/* ----------- Command-Line Parsing Stuff ------- */extern int optind;extern char *optarg;char *progname;            /* used to store the name of the program  */char comline[MAX_CHARS];   /* used to store the entire command line  */#define OPTIONS "i:l:e:m:s:h:f:n:"char *usage = "\t-i indir -l list -e edge_outdir -m mag_outdir\n\\t\t[-s sigma] [-h high_thresh] [-f thr_factor] [-n iterations]\n\n";char *help="\Canny edge-detection on a set of images\n\n\-i indir       \t input directory (containing raw files + descriptor)\n\-l listfile    \t ASCII list of files in indir to process (one per line)\n\-e edge_outdir \t output directory for binary edge images\n\-m mag_outdir  \t output directory for edge magnitude images\n\-s float       \t Canny sigma parameter            (default = 1)\n\-h float       \t Canny high threshold   (0 - 100) (default = 30)\n\-f float       \t Canny threshold factor (0 - 1)   (default = 0.1)\n\-n int         \t Canny grow iterations            (default = 30)\n\n";/*----------------------------------------------------------------------*/main(int argc, char **argv){   register int i,j,k,l,ii,jj;  int f, c, nframe, nfeatures, sets, bytes_pixel;  int nrow, ncol, M, N;  char command[MAX_CHARS],indir[MAX_CHARS],listfile[MAX_CHARS], \    infile[MAX_CHARS], filterfile[MAX_CHARS],outdir[MAX_CHARS], \      filename[MAX_CHARS], line[MAX_CHARS], line_outdir[MAX_CHARS],      mag_outdir[MAX_CHARS];  float **image_in, **image_out;  unsigned char **uchar_image;  float fval1, fval2, fval;  FILE *fp, *fp2;         /* for output values dump */  /* ---- Canny stuff ---- */  float h_threshold;  int bytes;  int vert_size, horiz_size;  float **picture, **xdirection, **ydirection, **hgrm_working_space;  char *im, **edges, **w1space, **w2space;  /* required input flags */  int errflag   = 0;  int inflag    = 0;  int listflag  = 0;  int outflag   = 0;  /* command line defaults */  int line_outdir_select = 0;  int mag_outdir_select  = 0;  /* This is the default for smoothing (must be > 0) */  float sigma = CANNY_SIGMA_DEF;  /* This is the default for 'growing' (must be >= 0) */  int passes = CANNY_PASSES_DEF;  /* This is the default for thresholding (must be 0 < hp < 100) */  float h_percent = CANNY_H_PERC_DEF;  /* This is the default for thresholding (must be 0 < tf < 1 */  float thr_factor = CANNY_THR_FACTOR;  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);      inflag = 1;      break;    case 'l':      strcpy(listfile, optarg);      listflag = 1;      break;          case 'e':      strcpy(line_outdir, optarg);      line_outdir_select = outflag = 1;      break;    case 'm':      strcpy(mag_outdir, optarg);      mag_outdir_select = outflag = 1;      break;    case 's':      sigma = atof(optarg);      break;    case 'h':      h_percent = atof(optarg);      break;    case 'f':      thr_factor = atof(optarg);      break;        case 'n':      passes = atoi(optarg);      break;    case '?':      errflag = 1;      break;    }    /* command line error check */    if (errflag || !inflag || !outflag || !listflag) {    fprintf(stderr,"\nUSAGE: %s %s\n%s\n", progname, usage, help);    /*print_documentation(sigma, h_percent, thr_factor, passes);*/    exit(-1);  }  /* ----  read indir descriptor file -------- */    read_descriptor(indir, &nframe, &sets, &bytes_pixel, &ncol, &nrow);  if (sets>1)     myerror("Input files must be single-set DAT files!");  if (bytes_pixel>1)     myerror("Input files must be unsigned char!");  vert_size  = nrow;  horiz_size = ncol;    /* ---- allocate memory for Canny code data ------*/  picture = (float **) matrix(0, vert_size-1, 0, horiz_size-1);  xdirection = (float **) matrix(0, vert_size-1, 0, horiz_size-1);  ydirection = (float **) matrix(0, vert_size-1, 0, horiz_size-1);  hgrm_working_space = (float **) matrix(0, vert_size-1, 0, horiz_size-1);  edges = scmatrix(0, vert_size-1, 0, horiz_size-1);  w1space = scmatrix(0, vert_size-1, 0, horiz_size-1);  w2space = scmatrix(0, vert_size-1, 0, horiz_size-1);    /* ----- allocate memory for my stuff ------- */  image_in   = matrix(1, nrow, 1, ncol);  image_out  = matrix(1, nrow, 1, ncol);  uchar_image = cmatrix(1, nrow, 1, ncol);  /* ---- loop over input list file and warp ------- */  if ((fp = fopen(listfile, "r")) == NULL) {    fprintf(stderr,"ERROR: Could not open input file %s \n\n", listfile);    exit(1);  }  nframe = 0;  while (fgets(line, MAX_CHARS, fp)) {    if (strncmp(line, "#", 1) != 0 && strlen(line)>1) {      nframe++;            /* ------- read image ------- */             sscanf(line,"%s",infile);        sprintf(filename,"%s/%s", indir, infile);      read_RAW(filename, image_in, nrow, ncol);      fprintf(stdout,"Read  %d-by-%d uchar input image file %s\n",	      nrow, ncol, filename);       convert_1f_to_0f(image_in, picture, vert_size, horiz_size);     	      /* gsmooth smooths an array with a gaussian filter */            gsmooth(picture, sigma, vert_size, horiz_size);            /* gradmax takes the smoothed picture and replaces it	 with the gradient magnitude (a mutation). It also	 returns the x and y derivatives, and it returns the 	 map of local maximums. */            gradmax(picture, xdirection, ydirection, edges, vert_size, horiz_size);            /* find_thres takes the x derivative and y derivative	 arrays, a histogram percentile value, and an array	 (as working space) to estimate the high threshold	 for thresholding */            h_threshold = find_thres(xdirection, ydirection, h_percent,			       hgrm_working_space,vert_size, horiz_size);            /* threshold takes arguments: gradient magnitude array,	 map of local maximums, a value for high threshold,	 the number of passes for 'growing', and two arrays	 for work space. It returns the final edge map in	 the array of local maximums (a mutation). */            threshold(picture, edges, h_threshold, thr_factor, passes,		w1space, w2space, vert_size, horiz_size);            /* write edge map and magnitude of gradient at edges */        if (line_outdir_select) {	convert_0c_to_1uc(edges, uchar_image, vert_size, horiz_size);	sprintf(filename,"%s/%s", line_outdir, infile);	write_RAW(filename, uchar_image, vert_size, horiz_size);	fprintf(stdout,"Wrote %d-by-%d binary edge output file %s\n", 		nrow, ncol, filename);      }      if (mag_outdir_select) {	magedges(picture, edges, vert_size, horiz_size);	convert_0f_to_1uc(picture, uchar_image, vert_size, horiz_size);	sprintf(filename,"%s/%s", mag_outdir, infile);	write_RAW(filename, uchar_image, vert_size, horiz_size);	fprintf(stdout,"Wrote %d-by-%d edge-magnitude output file %s\n", 		nrow, ncol, filename);      }            fprintf(stdout,"\n");    }  }   /* --- write output descriptor file in outdir ------ */  if (line_outdir_select)      write_descriptor(line_outdir, nframe, ncol, nrow, 1, comline);  if (mag_outdir_select)      write_descriptor(mag_outdir, nframe, ncol, nrow, 1, comline);  fclose(fp);   /* ---- free Canny memory ---- */  free_matrix(picture, 0, vert_size-1, 0, horiz_size-1);  free_matrix(xdirection, 0, vert_size-1, 0, horiz_size-1);  free_matrix(ydirection, 0, vert_size-1, 0, horiz_size-1);  free_matrix(hgrm_working_space, 0, vert_size-1, 0, horiz_size-1);  free_scmatrix(edges, 0, vert_size-1, 0, horiz_size-1);  free_scmatrix(w1space, 0, vert_size-1, 0, horiz_size-1);  free_scmatrix(w2space, 0, vert_size-1, 0, horiz_size-1);  /* --- free my stuff ---- */  free_matrix(image_in, 1, nrow, 1, ncol);  free_matrix(image_out, 1, nrow, 1, ncol);  free_cmatrix(uchar_image, 1, nrow, 1, ncol);  return 0;}/* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% */void convert_1f_to_0f(float **in, float **out, int nrow, int ncol)/* copies in[1..nrow][1..ncol] to out[0...(nrow-1)][0..(ncol-1)] */{  register int i,j;  for (i=1; i<=nrow; i++)    for (j=1; j<=ncol; j++)      out[i-1][j-1] = in[i][j];}void convert_0c_to_1uc(char **in, unsigned char **out,		      int nrow, int ncol)/* copies in[0...(nrow-1)][0..(ncol-1)] to out[1..nrow][1..ncol] */{  register int i,j;  for (i=0; i<nrow; i++)    for (j=0; j<ncol; j++)      out[i+1][j+1] = in[i][j];}void convert_0f_to_1uc(float **in, unsigned char **out,		      int nrow, int ncol)/* copies in[0...(nrow-1)][0..(ncol-1)] to out[1..nrow][1..ncol] */{  register int i,j;  for (i=0; i<nrow; i++)    for (j=0; j<ncol; j++)      out[i+1][j+1] = (unsigned char) in[i][j];}/*===========================================================================*/void print_documentation(float s, float h, float l, int i){  char *message = "\Canedge is a simplified version of an edge detector developed by \\nJohn Canny at MIT's Artificial Intelligence laboratory. The detector\\nfirst smooths an image using a gaussian shaped low pass filter. \\nThen the gradient magnitude of the smoothed image is non-maximum\\nsuppressed in the direction of the gradient.  These maxima are then\\nthresholded at a high threshold, and again at a low threshold (which\\nis some fraction of the high threshold).  Every maxima above the\\nhigh threshold is an edge.  The next step is called edge 'growing'.\\nEvery point above the low threshold (but not above the high threshold)\\nis marked as an edge if it is next to a point above the high threshold.\\nThis process is repeated several times and thus, the edges are\\n'grown'.\n";  printf("\nusage: canedge [-s float] [-h float] [-l float] [-i int] in_im line_im mag_im\n\n");  printf("-s float : smoothing sigma\n");  printf("           Default: %f\n",s);  printf("-h float : high threshold\n");  printf("           Default: %f\n",h);  printf("-l float : low threshold\n");  printf("           Default: %f\n",l);  printf("-i int   : growing iterations\n");  printf("           Default: %d\n",i);    printf("\n%s\n",message);}/*===========================================================================*/void parse_options(int argc, char *argv[], 		   float *s, float *h, float *l, int *i, 		   char *indir, char *line_outdir, char *mag_outdir){  int errflag = 0;  int fileloc = 0;  char c; while ((c = getopt(argc, argv, OPTIONS)) != EOF)   switch (c) {   case 's':      *s = atof(optarg);      fileloc += 2;      break;    case 'l':      *l = atof(optarg);      fileloc += 2;      break;    case 'i':      *i = atoi(optarg);      fileloc += 2;      break;    case '?':      errflag = 1;      break;    }  if (argc != fileloc + 4) {    print_documentation(*s, *h, *l, *i);    exit(-1); }    fprintf(stderr,"%d s %s \n", fileloc, argv[fileloc+1]);  strcpy(indir, argv[fileloc+1]);  strcpy(line_outdir, argv[fileloc+2]);  strcpy(mag_outdir, argv[fileloc+3]);}/*===========================================================================*//* These functions are part of my first version of a float gaussian   smoother.  The include file sizes.h contains size information. */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品国产品国语在线app| 欧美视频中文一区二区三区在线观看| 精品久久久久久久一区二区蜜臀| 欧美bbbbb| 日韩精品一区国产麻豆| 经典三级一区二区| 久久久久国产成人精品亚洲午夜| 国产jizzjizz一区二区| 亚洲欧美中日韩| 欧美亚日韩国产aⅴ精品中极品| 午夜影视日本亚洲欧洲精品| 91精品午夜视频| 国产精品99久久久久久有的能看| 国产精品女同互慰在线看| 色域天天综合网| 天堂久久久久va久久久久| 精品日韩欧美一区二区| 国产91精品露脸国语对白| 一区二区三区欧美日韩| 日韩美女主播在线视频一区二区三区 | 91网站在线播放| 午夜精品久久久久久久久久久| 日韩女优制服丝袜电影| 成人性生交大片免费看中文 | 日本不卡一二三区黄网| 国产偷v国产偷v亚洲高清| 一本一道波多野结衣一区二区| 日韩精品午夜视频| 国产精品久久久久久久午夜片| 欧美天堂亚洲电影院在线播放| 国产一区二区三区免费观看| 夜夜嗨av一区二区三区四季av | 日韩电影网1区2区| 国产精品成人免费在线| 欧美一区二区精品久久911| 成人网在线免费视频| 天天综合色天天综合| 国产精品家庭影院| 日韩精品一区二区三区中文精品| 91一区二区在线观看| 激情综合网最新| 亚洲综合丁香婷婷六月香| 国产亚洲一本大道中文在线| 91麻豆精品国产91久久久更新时间| 成人午夜精品一区二区三区| 日本美女一区二区三区| 亚洲人午夜精品天堂一二香蕉| 精品福利一二区| 欧美理论在线播放| 91视频免费播放| 粉嫩aⅴ一区二区三区四区五区| 麻豆精品视频在线观看免费| 亚洲一区二区在线免费观看视频| 国产精品素人一区二区| 欧美成人一区二区三区在线观看 | eeuss国产一区二区三区| 麻豆国产91在线播放| 亚洲午夜三级在线| 国产精品蜜臀在线观看| 久久这里只有精品首页| 日韩三级视频在线看| 欧美妇女性影城| 欧美撒尿777hd撒尿| 一本在线高清不卡dvd| 成人sese在线| 成人精品视频网站| 国产精品亚洲一区二区三区妖精| 美日韩黄色大片| 日本网站在线观看一区二区三区 | 蜜乳av一区二区三区| 视频一区视频二区中文| 亚洲小少妇裸体bbw| 一区二区三区在线视频观看| 亚洲少妇中出一区| 亚洲欧洲另类国产综合| 国产精品久久久久久亚洲伦| 国产精品伦理在线| 国产精品美女久久久久久久久久久| 久久精品人人做人人综合| 久久在线观看免费| 中文字幕的久久| 国产精品久久一卡二卡| 亚洲日本在线观看| 一区二区三区毛片| 亚洲午夜电影在线| 日韩在线播放一区二区| 久色婷婷小香蕉久久| 国产精品自拍三区| 懂色av一区二区夜夜嗨| 99亚偷拍自图区亚洲| 色狠狠桃花综合| 制服.丝袜.亚洲.另类.中文| 日韩精品一区二区三区视频在线观看 | 九九国产精品视频| 激情欧美一区二区| 国产高清在线精品| 99热国产精品| 欧美福利一区二区| 久久午夜羞羞影院免费观看| 欧美激情一区在线| 一区二区三区在线免费播放| 日本不卡1234视频| 国产成人精品免费网站| 色妹子一区二区| 欧美一区二区三区免费大片| 国产色一区二区| 亚洲精品亚洲人成人网| 日本欧美一区二区三区乱码 | 尤物视频一区二区| 日韩中文字幕av电影| 国产在线不卡视频| 99国产精品久久久久久久久久| 91.com视频| 国产精品美女一区二区三区| 亚洲a一区二区| 国产精品99久久久久久久女警 | 91精品视频网| 国产精品色在线| 亚洲成av人片一区二区梦乃| 国产高清在线精品| 欧美人妖巨大在线| 国产精品久久久久久久久免费桃花| 水野朝阳av一区二区三区| 国产成人免费在线| 欧美日韩国产成人在线免费| 亚洲国产精品精华液ab| 日韩成人精品在线| 成人晚上爱看视频| 日韩亚洲欧美一区| 亚洲免费资源在线播放| 国产一区激情在线| 欧美日韩亚洲综合| 中文字幕在线一区二区三区| 久久成人麻豆午夜电影| 色悠悠亚洲一区二区| 国产亚洲一区二区三区在线观看| 亚洲成年人影院| 91丨porny丨中文| 久久久三级国产网站| 免费在线观看一区| 欧美在线观看禁18| 亚洲欧美综合色| 不卡的av在线| 国产亚洲成年网址在线观看| 日韩**一区毛片| 欧美中文字幕亚洲一区二区va在线| 中文字幕精品一区二区精品绿巨人| 久久97超碰国产精品超碰| 欧美精品99久久久**| 亚洲一区精品在线| 色哟哟亚洲精品| 国产精品白丝在线| 成人精品国产免费网站| 国产欧美日韩视频一区二区| 韩国女主播一区| 日韩欧美高清一区| 美女脱光内衣内裤视频久久网站| 欧美日韩一区二区三区四区| 一区二区三区毛片| 欧美综合天天夜夜久久| 亚洲精品成人精品456| 91麻豆成人久久精品二区三区| 国产精品国产三级国产aⅴ中文| 成人在线综合网站| 国产精品妹子av| 99re在线视频这里只有精品| 中文字幕日本不卡| 91亚洲精品乱码久久久久久蜜桃| 国产精品色哟哟| 91在线免费播放| 亚洲美女免费视频| 一本到高清视频免费精品| 一区二区三区四区高清精品免费观看| 色偷偷久久一区二区三区| 亚洲一区成人在线| 在线播放视频一区| 免费三级欧美电影| 久久女同性恋中文字幕| 国产成人综合在线| 亚洲欧美一区二区三区极速播放| 97久久超碰国产精品| 亚洲一区在线观看免费| 日韩亚洲欧美成人一区| 精品一区二区影视| 国产精品无圣光一区二区| 91在线精品一区二区| 亚洲线精品一区二区三区| 日韩免费性生活视频播放| 福利电影一区二区三区| 亚洲日本中文字幕区| 制服丝袜成人动漫| 国产成人精品影视| 一区二区视频在线| 欧美一级久久久久久久大片| 国产91精品一区二区| 亚洲一区二区3| 国产视频一区在线播放| 91久久线看在观草草青青| 日本大胆欧美人术艺术动态| 国产日韩高清在线|