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

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

?? canny.c

?? feret人臉圖象數據庫處理代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
float convert(char i){  if (i>=0) return (float)i;  else return((float)(i+256));}float fconv(register float *x, register float *y, register int n){  float sum=0;    if (n>0) {    do {      sum+= *x++ * *y;      y++;    } while (--n>0);  }  return(sum);}/* This function takes a pointer to a float array as argument and   scales the array to be less than 255 */void scaler(float **f_array, int vert_size, int horiz_size){  float scale, max=0;  register row, col;    for(row=0; row < vert_size; row++)    for(col=0; col < horiz_size; col++) {      /*	printf("%e\n",f_array[row][col]);  */      if (f_array[row][col] > max)	max = f_array[row][col];    }    scale = max / 255.0;  if (scale == 0) {    fprintf(stderr, "Div by zero\n");    exit(1); }    for(row=0; row < vert_size; row++)    for(col=0; col < horiz_size; col++)       f_array[row][col] /= scale;}void magedges(float **imgarray, char **edgearray, int vert_size, int horiz_size){  register int row, col;    for(row = 0; row < vert_size; row++)    for(col = 0; col < horiz_size; col++)      if (edgearray[row][col] == 0)	imgarray[row][col] = 0;    scaler(imgarray, vert_size, horiz_size);    /* scale to 255 */}/*===========================================================================*//* Arguments: gradient magnitude array (float), map of local maximums   (char), value for high threshold (float), number of passes for   'growing', and two arrays for workspace.    The function first creates an array of points above the low threshold    (thresfactor times the high threshold).   Then the map of local maximums is run through the high threshold -THIS   IS A MUTATION. Next, for every point above the high threshold, the   eight nearest neighbors are checked to see if they are above the low   threshold. If so, they are marked (and the edge array is mutated again).   Thus, the edges are 'grown'. The number of passes defines how many   times this growing routine is run. */void threshold(float **mag, char **edges, 	  float hthreshold, float thresfactor, int passes, 	  char **low, char **wk_space,	  int vert_size, int horiz_size){  register int row, col;  float lthreshold;  int n;    lthreshold = hthreshold * thresfactor;    /* create an array of points above low threshold */    for(row = 0; row < vert_size; row++)    for(col = 0; col < horiz_size; col++) {            if ((edges[row][col]) && (mag[row][col] > lthreshold)) 	low[row][col] = 255; /* edges[row][col] */      /* indicates local maximum   */	      else 	low[row][col] = 0;    }	    /* now I must create an array of pts above the high threshold */  /* do this by changing edges */  for(row = 0; row < vert_size; row++)    for(col = 0; col < horiz_size; col++) {            if ((edges[row][col]) && (mag[row][col] > hthreshold))	edges[row][col] = 255;            else	edges[row][col] = 0;    }    /* now I have low and high pts */  for(n=0; n < passes; n++)     grow(edges, low, wk_space, vert_size, horiz_size);}void grow(char **r_array, char **chk_array, char **w_array,     int vert_size, int horiz_size){  register int row, col, i, j;    /* copy edge array of high points to workspace */    for(row=0; row < vert_size; row++)    for(col=0; col < horiz_size; col++)      w_array[row][col] = r_array[row][col];    /* now to add more points appropriately */    for(row=1; row < vert_size - 1; row++)    for(col=1; col < horiz_size - 1; col++)             if(w_array[row][col])  /** if high point **/		for(i = -1; i <= 1; i++)	  for(j = -1; j <= 1; j++)	    	    r_array[(row + i)][(col + j)] =	      chk_array[(row + i)][(col + j)];	}/*===========================================================================*//* This function takes as arguments: x and y derivative arrays (float),   histogram percentile, and a work space array (float). The function returns   an estimate of the maximum noise level in the picture.*/float find_thres(float **xdir, float **ydir, float percentile,		 float **h_val, int vert_size, int horiz_size){  int histogram[HISTOGRAM_SIZE];  float x2dx, y2dy, division_size, hthreshold, max;  int bucket, sumpts, total_points, ppt;  register int row, col;    /* initialize histogram */  for(bucket = 0; bucket < HISTOGRAM_SIZE; bucket++)    histogram[bucket] = 0;    /* run 2nd derivative operator in x and y directions */  /* also note the maximum value */  /* remember that the edges are garbage */  for(row = 1, max = 0; row < vert_size - 2; row ++)    for(col = 1; col < horiz_size - 2; col++) {      x2dx = xdir[row][col] * (-2) + xdir[row][(col - 1)]	+ xdir[row][(col + 1)];      y2dy = ydir[row][col] * (-2) + ydir[(row - 1)][col]	+ ydir[(row + 1)][col];            /* square 2nd derivate and store in work space */            h_val[row][col] = x2dx * x2dx + y2dy * y2dy;            if(h_val[row][col] > max)	max = h_val[row][col];    }    /* fill buckets */  for(row = 1; row < vert_size - 2 ; row++)    for(col = 1; col < horiz_size - 2 ; col++) {            if(h_val[row][col] == max)	bucket = HISTOGRAM_SIZE - 1;      else	bucket = (int)(floor((h_val[row][col] / max) *			     HISTOGRAM_SIZE));      (histogram[bucket])++;    }    total_points = (horiz_size - 3) * (vert_size - 3);    division_size = max / HISTOGRAM_SIZE;    ppt = (percentile / 100) * total_points; /* percent to pts  */    for(bucket = 0, sumpts = 0; sumpts < ppt; bucket++)    sumpts += histogram[bucket];    /* calculate the value at percentile and take sqrt */    hthreshold = ((bucket + bucket - 1) / 2) * division_size;    hthreshold = sqrt(hthreshold) * MAGIC_SCALE_FACTOR;    return(hthreshold);}/*===========================================================================*//* This function takes as arguments an array to operate on, and threearrays to fill with results.  The function differentiates the sourcearray in the x and y directions (over a four element window) and stores these results in two of the destination arrays (float).The function also computes the magnitude of the gradient at each point and returns this result in the source array. NOTE: THIS MUTATES THE SOURCE ARRAY.The map of the local maximums of the gradient magnitude array is storedin the third array (character array).Note: Realize that the last row and column of the x derivative, yderivative, and magnitude arrays contain garbage. Sizes of arrays are defined in the include file gdef.h. */void gradmax(float **img_array, float **xdir, float **ydir, char **edges,	int vert_size, int horiz_size){  register int row, col;  int x0y0, x0y1, x1y0, x1y1;  float front, back;	/* temporary storage for max check */  float mag2;    /* start gradient computation */    for(row=0; row < vert_size-1; row++) /* rt and bt edge */    for(col=0; col < horiz_size-1; col++) {            x0y1 = img_array[row][col];      x1y1 = img_array[row][(col + 1)];      x0y0 = img_array[(row + 1)][col];      x1y0 = img_array[(row + 1)][(col + 1)];            xdir[row][col]= x1y1 + x1y0 - x0y0 - x0y1;      ydir[row][col]= x0y1 + x1y1 - x0y0 - x1y0;            /*   compute magnitude and store in original */            mag2 = xdir[row][col] * xdir[row][col] +	ydir[row][col] * ydir[row][col];            img_array[row][col] = sqrt(mag2);		          }      /* Points in the gradient magnitude array are tested to see if they are     local maximums.     Definitions:        front--nearest pixel in the direction defined by the gradient        back---nearest pixel in the direction opposite that defined by               the gradient     If the gradient magnitude at a point is greater than that at the front     and greater than that at the back, it is marked as local maximum.      If the gradient does not point directly at a pixel, linear interpolation     is performed. Note: this is called 'non-maximum suppression' in the      literature. */  /* non-max suppression */  /* remember that edges of arrays are garbage */  for(row = 1; row < vert_size - 2; row++)    for(col = 1; col < horiz_size - 2; col++) {            if(xd==0 && yd==0)	edges[row][col]=0;            /* quadrants I and III */            else if ((xd >= 0 && yd >= 0) || (xd <= 0 && yd <= 0)) {		if ( fabs(yd) >= fabs(xd) ) {	  front = v3 + (xd / yd) * (v2 - v3); /* octant 2 */	  back = v7 + (xd / yd) * (v6 - v7);  /* octant 6 */	  if (V > front && V > back)	    edges[row][col] = 255; /* mark edge */	  else	    edges[row][col] = 0; /* no edge */ }		else if( fabs(yd) <= fabs(xd) ) {	  front = v1 + (yd / xd) * (v2 - v1);  /* octant 1 */	  back = v5 + (yd / xd) * (v6 - v5);   /* octant 5 */	  if (V > front && V > back)	    edges[row][col] = 255; /* mark edge */	  else	    edges[row][col] = 0; /* no edge */ }		else	  printf("Error: nms\n");      }            /* quadrants II and IV */            else if ((xd >= 0 && yd <= 0) || (xd <= 0 && yd >= 0)) {		if ( fabs(yd) >= fabs(xd) ) {	  front = v3 - (xd / yd) * (v4 - v3); /* octant 3 */	  back = v7 - (xd / yd) * (v8 - v7);  /* octant 7 */	  if (V > front && V > back)	    edges[row][col] = 255; /* mark edge */	  else	    edges[row][col] = 0; /* no edge */ }		else if( fabs(yd) <= fabs(xd) ) {	  front = v1 - (yd / xd) * (v8 - v1);  /* octant 8 */	  back = v5 - (yd / xd) * (v4 - v5);   /* octant 4 */	  if (V > front && V > back)	    edges[row][col] = 255; /* mark edge */	  else	    edges[row][col] = 0; /* no edge */ }		else 	  printf("Error: nms\n"); }            else 	printf("Error: non-maximum suppression\n");    }	    /* fill non-valid parts */    for(row = 0; row < vert_size; row++) {  /* fill columns */    edges[row][0] = 0;    edges[row][horiz_size-2] = 0;    edges[row][horiz_size-1] = 0;  }    for(col = 0; col < horiz_size; col++) {  /* fill rows */    edges[0][col] = 0;    edges[vert_size-2][col] = 0;    edges[vert_size-1][col] = 0;  }}/*===========================================================================*//* This function takes as arguments a pointer to a 2-D array of float (the horizontal dimension is defined in the include file gdef.h) anda float value representing the sigma for a gaussian filter. The functionmutates the array by convolving it with the gaussian filter. */void gsmooth(float **img_array, float sigma, int vert_size, int horiz_size){  float gauss[MAX_GAUSS];    /* for filter coefficients */  float worksp[WORKSIZE];    /* for workspace */    register int row, col;  float scale;  int n, gwidth, i, index;  int count, wksprpt, wksplpt, wksptpt, wkspbpt;    /* determine width */  n = (int)(ceil(sqrt(-log(CUTOFF) * 2) * sigma)); /* max n */  gwidth = 2 * n + 1; 	/* gaussian width */    wksplpt= n;	  		/* left end of workspace */  wksprpt= (horiz_size -1) + n;	/* right end of workspace */  wksptpt= n;			/* top of workspace */  wkspbpt= (vert_size - 1) + n;	/* bottom of workspace */  /* calculate scale factor */    scale = 0;  		/* initialize */  for(i = -n; i <= n ; i++) {    scale += exp(-(i*i)/(2 * sigma * sigma));}  /* fill gaussian */    for(i = -n; i <= n; i++) {    index = i + n;    gauss[index] = (exp(-(i*i)/(2 * sigma * sigma)))/scale;}  /* convolve rows */    for(row=0; row < vert_size; row++) {        for(col=0; col < horiz_size; col++)      worksp[(col+n)]=img_array[row][col];        for(count=1; count<=n ; count++) {      worksp[(wksplpt-count)]=worksp[(wksplpt+count)];      worksp[(wksprpt+count)]=worksp[(wksprpt-count)]; }        for(col=0; col < horiz_size; col++)      img_array[row][col] = fconv(gauss,				  &worksp[col],gwidth); }    /* convolve columns */    for(col=0; col < horiz_size ; col++) {        for(row=0; row < vert_size; row++)      worksp[(row+n)]=img_array[row][col];        for(count=1; count<=n; count++) {      worksp[(wksptpt-count)]=worksp[(wksptpt+count)];      worksp[(wkspbpt+count)]=worksp[(wkspbpt-count)]; }    for(row=0; row < vert_size ; row++)      img_array[row][col]= fconv(gauss,					 &worksp[row],gwidth);}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线观看亚洲精品| 麻豆成人免费电影| 日韩欧美在线影院| 99久久国产综合精品女不卡| 亚洲aaa精品| 国产精品午夜在线观看| 欧美一区二区女人| 六月丁香综合在线视频| 亚洲一区二区三区四区在线 | 亚洲人成影院在线观看| 久久这里只有精品首页| 成人视屏免费看| 精品一区二区三区影院在线午夜| 日韩av一级电影| 亚洲影视在线播放| 亚洲免费观看在线视频| 亚洲国产成人午夜在线一区| 337p粉嫩大胆噜噜噜噜噜91av| 在线观看日韩av先锋影音电影院| 成人av电影在线| 丁香啪啪综合成人亚洲小说 | 色综合激情五月| 精品一区二区国语对白| 一区二区三区高清在线| 国产精品人妖ts系列视频| 久久婷婷成人综合色| 日韩精品一区二区在线| 欧美日韩国产综合久久| 成人不卡免费av| 成人免费高清视频在线观看| 免费看欧美美女黄的网站| 亚洲精品va在线观看| 亚洲伦在线观看| 亚洲女人的天堂| 欧美精品色综合| 欧美日本一区二区在线观看| 欧美专区亚洲专区| 欧美精选一区二区| 欧美精品一二三四| 欧美片在线播放| 91精品国模一区二区三区| 欧美人牲a欧美精品| 欧美猛男超大videosgay| 在线精品视频免费观看| 欧美日韩极品在线观看一区| 欧美视频三区在线播放| 欧美性xxxxx极品少妇| 欧美日韩视频一区二区| 日韩欧美国产综合在线一区二区三区| 日韩精品一区二区三区中文不卡 | 日韩欧美一卡二卡| 久久综合九色综合97婷婷女人 | 久久久精品黄色| 国产精品网站在线| 亚洲乱码一区二区三区在线观看| 亚洲午夜av在线| 久久精品国内一区二区三区| 国产成人av网站| 成人精品视频.| 欧美日韩免费不卡视频一区二区三区| 欧美日韩综合在线| 欧美精品一区二区精品网| 国产日韩欧美综合在线| 亚洲你懂的在线视频| 首页亚洲欧美制服丝腿| 91久久香蕉国产日韩欧美9色| 国产亚洲欧美色| 奇米色777欧美一区二区| 欧美男同性恋视频网站| 亚洲va国产va欧美va观看| 91传媒视频在线播放| 国产精品盗摄一区二区三区| 成人中文字幕合集| 国产亚洲婷婷免费| 国产成人av影院| 国产精品久久久久影院色老大 | 成人视屏免费看| 国产欧美日韩中文久久| 国产精品一区二区久激情瑜伽| 日韩欧美第一区| 九一久久久久久| 精品国产亚洲在线| 国产精品99久久久久久久女警 | 亚洲蜜臀av乱码久久精品蜜桃| 97久久超碰国产精品| 亚洲精品一二三| 成+人+亚洲+综合天堂| 国产精品网站在线播放| 972aa.com艺术欧美| 欧美国产综合色视频| 99久久婷婷国产综合精品电影| ...xxx性欧美| 欧美色图第一页| 秋霞国产午夜精品免费视频| 日韩三级.com| 成人午夜精品在线| 一区二区三区国产精品| 日韩欧美国产一二三区| 国产suv精品一区二区883| 日韩毛片一二三区| 欧美精品久久久久久久久老牛影院| 另类小说图片综合网| 国产拍揄自揄精品视频麻豆| 94-欧美-setu| 日韩精彩视频在线观看| 久久久久久久av麻豆果冻| 97久久人人超碰| 麻豆成人91精品二区三区| 久久―日本道色综合久久| 94-欧美-setu| 黄网站免费久久| 亚洲激情综合网| 精品久久久久久久一区二区蜜臀| 成人h精品动漫一区二区三区| 夜夜嗨av一区二区三区网页| 精品久久久久久久久久久久久久久久久 | 国产乱国产乱300精品| 亚洲人成电影网站色mp4| 日韩精品在线网站| 91黄色免费网站| av电影在线观看完整版一区二区| 免费成人在线影院| 麻豆91在线看| 日韩毛片一二三区| 国产欧美一区二区精品久导航| 欧美日韩三级一区| 91在线视频播放| 国产一区二区精品久久91| 视频在线观看一区| 亚洲精选视频在线| 国产精品久久久久一区二区三区 | 欧美国产国产综合| 日韩精品一区二区三区swag| 91官网在线免费观看| 成人午夜视频在线观看| 久久99精品久久久久久| 日韩电影免费一区| 国产精品美女久久久久久久| 精品国产乱码久久久久久久久 | 精品捆绑美女sm三区| 色综合久久88色综合天天免费| 国产suv精品一区二区三区| 久久99精品国产.久久久久久| 午夜一区二区三区在线观看| 亚洲在线一区二区三区| 亚洲少妇屁股交4| 亚洲欧美经典视频| 亚洲免费视频中文字幕| 亚洲人成在线观看一区二区| 亚洲三级小视频| 一区二区三区在线视频观看| 亚洲欧美日韩综合aⅴ视频| 国产精品麻豆视频| 自拍偷拍欧美精品| 亚洲精品少妇30p| 亚洲电影第三页| 美女被吸乳得到大胸91| 久草在线在线精品观看| 国产精品538一区二区在线| 国产成人av自拍| 91麻豆蜜桃一区二区三区| 在线免费观看视频一区| 欧美美女一区二区| 日韩一区二区麻豆国产| 久久伊人蜜桃av一区二区| 国产女人18水真多18精品一级做| 久久久美女艺术照精彩视频福利播放| 国产女同性恋一区二区| 中文字幕一区二区三区蜜月| 亚洲欧洲av在线| 亚洲mv在线观看| 国产一区二区不卡在线 | 日韩专区欧美专区| 国产主播一区二区三区| 成人免费视频播放| 欧美日韩一区二区三区视频| 欧美一级黄色录像| 国产精品人人做人人爽人人添| 亚洲一卡二卡三卡四卡无卡久久| 美国欧美日韩国产在线播放| 国产成人av影院| 欧美日本在线播放| 欧美国产精品一区二区三区| 亚洲一区免费视频| 国产精品12区| 欧美日韩另类一区| 国产亚洲欧美在线| 亚瑟在线精品视频| 国产麻豆精品在线观看| 在线看不卡av| 国产拍欧美日韩视频二区| 午夜精品久久久久久久久久久| 国产精品 欧美精品| 欧美丝袜丝nylons| 国产精品视频麻豆| 六月丁香综合在线视频| 欧美一区二区三区在| 中文字幕亚洲在| 国产一区二区三区日韩| 精品视频一区三区九区|