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

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

?? slice.c

?? NIST Handwriting OCR Testbed
?? C
字號:
/*# proc: slice_widths_hori_nb - traverses a predefined set of horizontal line points and# proc:              locates the top and bottom of the intersecting vertical run of# proc:              black pixels (slice).# proc: slice_width_hori - locates the top and bottom of a vertical run of contiguously# proc:                    black pixels that overlap (or are very close) to the specified# proc:                    starting point.# proc: erase_slices_hori_ml - erases vertical slices along a predefined set of horizontal# proc:              line points based on a vector of locally dynamic median line widths.# proc: erase_slice_hori - erases the pixels along a specified vertical slice.# proc:# proc: draw_slice_hori - writes a given 8-bit pixel value along a specified vertical slice.# proc:# proc: erase_fuzzy_slices_hori_ml - erases vertical slices along a predefined set of# proc:              of horizontal line points based on "fuzzy" line conditions.*/#include <stdio.h>#include <defs.h>#include <rmline.h>#include <mytrace.h>/***************************************************************************//* slice_widths_hori - traverses the line spanning two specified endpoints *//* and locates the top and bottom of the intersecting (or very close)      *//* vertical run of black pixels (called a slice). A slice is located and   *//* its statistics stored (width, top, and bottom) at each point along the  *//* line. These slices are used to get line width statistics and to         *//* identify places where charcter data intersect with the line.            *//***************************************************************************//***************************************************************************/slice_widths_hori_nb(sw, fsy, tsy, nsw, ptsx, ptsy, npts, cdata, w, h)int **sw, **fsy, **tsy, *nsw, w, h;int *ptsx, *ptsy, npts;unsigned char *cdata;{   int i;   int tsw, nfsy, ntsy, j;   /* the resulting line cannot be longer than the width of the image */   /* however, the line can be shorter than the width of the image    */   /* if it is sufficiently sloped to intersect with the top and / or */   /* bottom of the image, rather than the sides.                     */   if(npts > w)      fatalerr("slice_widths_hori_nb",               "line projection longer than image width", NULL);    /* allocate memory for slice statistics the width of the image */   calloc_int(sw, w, "slice_widths_hori_nb : sw");   calloc_int(fsy, w, "slice_widths_hori_nb : fsy");   calloc_int(tsy, w, "slice_widths_hori_nb : tsy");   /* for each point along the line, locate and compute slice statistics. */   for(i = 0, j = ptsx[0]; i < npts; i++, j++){      slice_width_hori(&tsw, &nfsy, &ntsy, ptsx[i], ptsy[i], cdata, w, h);      /* the slices statistics are stored according to their column raster location */      /* in the image, NOT according to their index along the interpolated line.    */      (*sw)[j] = tsw;      (*fsy)[j] = nfsy;      (*tsy)[j] = ntsy;   }   /* this way the number of slices will always equal the width of the image. */   /* locations along the line that fall off the image have slice widths of 0 */   /* which (by convention) will be ignored and flagged as being erased       */   *nsw = w;}/***************************************************************************//* slice_width_hori - locates top and bottom of a vertical run of conti-   *//* guously black pixels that either overlap (or are very close) to the     *//* specified starting point.                                               *//***************************************************************************/slice_width_hori(sw, fsy, tsy, x, y, cdata, w, h)int *sw, *fsy, *tsy;int x, y, w, h;unsigned char *cdata;{   unsigned char *sptr;   int cy, sy, s1, n1, max_y;   int nfound, ndist, sfound, sdist;   sy = y;   sptr = cdata + (sy*w) + x;   /* if starting search on a white pixel ... */   if(*sptr == 0){      /* this part is necessary when there is sufficient warping of */      /* the line in the image that it does not hold true to the    */      /* detected theoretical line that is perfectly straight in    */      /* raster space with line width of exactly one pixel. this    */      /* deviation can be introduced by printing, page, and scanner */      /* annomalies. this occurs more frequently along lines of     */      /* longer length where the likihood of deviations and their   */      /* propogation is increase.                                   */       /* look south and north for a black pixel */      /* was a black pixel found to the south? */      if((s1 = find_pix_south(BLACK_PIX, x, y, cdata, w, h)) == NOT_FOUND)         sfound = FALSE;      else         sfound = TRUE;      /* was a black pixel found to the north? */      if((n1 = find_pix_north(BLACK_PIX, x, y, cdata, w, h)) == NOT_FOUND)         nfound = FALSE;      else         nfound = TRUE;      /* if black not found in both directions */      if(!nfound && !sfound){         *fsy = y;         *tsy = y;         *sw = 0;         return;      }      /* if north found, but not south, use north */      else if(nfound && !sfound)         sy = n1;      /* if south found, but not north, use south */      else if(!nfound && sfound)         sy = s1;      /* if black found in both directions ... */      else{         ndist = y - n1;         sdist = s1 - y;         /* if distance to north and south points equal ... */         if(ndist == sdist){            /* if point on line is closer to top then use north */            if(y < (h - y))               sy = n1;            /* if point on line is closer to bottom then use south */            else               sy = s1;         }         /* otherwise choose the closer black pixel */         else if(ndist < sdist)            sy = n1;         else            sy = s1;      }      /* if distance to new y is too big ... */      if(abs(y - sy) > SMALL_NOISE){         *fsy = y;         *tsy = y;         *sw = 0;         return;      }   }   max_y = h - 1;   /* at this point, sy should be pointing to a black pixel */   /* find first white pixel to the north */   if((cy = find_pix_north(WHITE_PIX, x, sy, cdata, w, h)) == NOT_FOUND)      *fsy = 0;   else      /* if white pixel found, then move back one pixel to black */      *fsy = min(cy+1, max_y);   /* find first white pixel to the south */   if((cy = find_pix_south(WHITE_PIX, x, sy, cdata, w, h)) == NOT_FOUND)      *tsy = max_y;   else      /* if white pixel found, then move back one pixel to black */      *tsy = max(0, cy-1);   /* compute the slice width */   *sw = (*tsy) - (*fsy) + 1;}/***************************************************************************//* erase_slices_hori - erases vetical slices along a horizontal line       *//* based on a specified threshold.                                         *//***************************************************************************//***************************************************************************/erase_slices_hori_ml(ebin, msws, sw, fsy, tsy, nsw, cdata, w, h)int **ebin, *msws, *sw, *fsy, *tsy, nsw;unsigned char *cdata;int w, h;{   int i;   /* allocate a logical vector for keeping track of which slices */   /* have been erased */   calloc_int(ebin, nsw, "erase_slices_hori_ml : ebin");   for(i = 0; i < nsw; i++){      /* if slice width is <= threshold, then erase the slice */      if(sw[i] <= msws[i]+SMALLER_NOISE)         erase_slice_hori((*ebin), sw, i, fsy[i], tsy[i], cdata, w, h);   }}/***************************************************************************//* erase_slice_hori - erases the pixels along a specified vetical slice.   *//***************************************************************************/erase_slice_hori(ebin, sw, x, fsy, tsy, cdata, w, h)int *ebin, *sw, x, fsy, tsy, w, h;unsigned char *cdata;{   if(sw[x] != 0)   /* fill in the vertical slice with zeros */      draw_slice_hori(0, x, fsy, tsy, cdata, w, h);   ebin[x] = ERASED;}/***************************************************************************//* draw_slice_hori - writes a given pixel value along a specified vertical *//* slice.                                                                  *//***************************************************************************/draw_slice_hori(pix, x, fsy, tsy, cdata, w, h)int pix, x, fsy, tsy, w, h;unsigned char *cdata;{   int y, max_y;   unsigned char *cptr;   if(!(is_in_range(pix, 0, 255)))      fatalerr("draw_slice_hori", "pixel values must be [0..255]", NULL);   max_y = h - 1;   if((!is_in_range(x, 0, w-1)) ||      (!is_in_range(fsy, 0, max_y)) ||      (!is_in_range(tsy, 0, max_y)))      fatalerr("draw_slice_hori", "coordinates exceed image dimensions", NULL);   cptr = cdata + (fsy*w) + x;   for(y = fsy; y <= tsy; y++){      *cptr = pix;      cptr += w;   }}/***************************************************************************//* erase_fuzzy_slices_hori - erases vetical slices along a horizontal line *//* based on fuzzy line conditions to account for scanner jitter and line   *//* width variations, all the while preserving pieces of intersecting       *//* characters.                                                             *//***************************************************************************//***************************************************************************/erase_fuzzy_slices_hori_ml(ebin, smsw, msws, sw, fsy, tsy, nsw, cdata, w, h)int *ebin, smsw, *msws, *sw, *fsy, *tsy, nsw;unsigned char *cdata;int w, h;{   int i, j, rs, omsw;   int slimit, sw1_limit, sw2_limit, longer_run;   int turned_on, from_erase;   int min_sw, max_sw;   my_trace("entered erase_fuzzy_slices_hori_ml\n");   /* softer limit based on median line width */   sw1_limit = step_limit(smsw);   /* harder limit based on median line width */   sw2_limit = step_limit2(smsw);   /* longer limit on the number of slices to be erased in a single run */   longer_run = SLICE_FCTR*smsw;   omsw = smsw;   /* flag to determine if current run of slices are to be erased */   turned_on = FALSE;   /* flag to determine if the current run of slices to be erased */   /* began from a point of erasure */   from_erase = TRUE;   /* initialize to the softer limit */   slimit = sw1_limit;   i = 0;   /* search the list of line slices ... */   while(i < nsw){      /* if median slice width changes, then update thresholds */      if(omsw != msws[i]){         /* softer limit based on median line width */         sw1_limit = step_limit(msws[i]);         /* harder limit based on median line width */         sw2_limit = step_limit2(msws[i]);         /* longer limit on the number of slices to be erased in a single run */         longer_run = SLICE_FCTR*msws[i];         omsw = msws[i];      }      /* if the current slice has been erased ... */      if (ebin[i] == ERASED){         /* if there is a run of slices to be potentially erased ... */         if(turned_on){            /* if the run begins and ends at points of erasure and not from char pieces ... */            if((from_erase) ||               /* OR the run is sufficiently long to get some line statistics (history) */               ((i - rs) > SLICES_FOR_LINE)){               my_trace("hit point of erasure\n");               my_trace2("erasing slices from %d to %d\n", rs, i-1);               /* erase slices from rs to i-1 */               for(j = rs; j < i; j++)                  erase_slice_hori(ebin, sw, j, fsy[j], tsy[j], cdata, w, h);            }            /* turn the erase flag to off */            turned_on = FALSE;         }         /* else there is nothing to erase, so continue to the next slice */      }      /* if the current slice is unerased and too long to be a part of the line ... */      else if (sw[i] >= slimit){         /* if there is a run of slices to be potentially erased ... */         if(turned_on){            /* don't erase the run unless VERY sure: */            /* if the run did not start from a point of erasure, but from a char peice ... */            if((!from_erase) &&               /* AND if the run is more sufficiently long ... */               ((i - rs) > longer_run) &&               /* AND if variation of run's slices shows only a small amount of jitter ... */               ((max_sw - min_sw) <= SMALLER_NOISE)){               /* then erase slices from rs to i-1 */               my_trace("hit point where slice is too big\n");               my_trace2("erasing slices from %d to %d\n", rs, i-1);               for(j = rs; j < i; j++)                  erase_slice_hori(ebin, sw, j, fsy[j], tsy[j], cdata, w, h);            }            /* turn the erase flag to off */            turned_on = FALSE;         }         /* there is nothing to erase, so continue to the next slice */      }      /* if the current slice is unerased and short enough to be a part of the line ... */      else {         /* if a run of slices to be erased is not in process, then initialize a run */         if(!turned_on){            /* keep track of min and max slice widths in the current run */            min_sw = sw[i];            max_sw = sw[i];            /* turn the erase flag on */            turned_on = TRUE;            /* mark the start of the run */            rs = i;            /* treat the first line slice a starting from a point of erasure */            if((i == 0) ||               /* OR if starting the run from a point of erasure ... */               ((i > 0) && (ebin[i-1] == ERASED))){               /* set flag to TURE */               from_erase = TRUE;               /* use the softer limit */               slimit = sw1_limit;            }            /* if starting the run from a piece of character ... */            else{               /* set flag to FALSE */               from_erase = FALSE;               /* use the harder limit */                slimit = sw2_limit;            }         }         /* if the current slice is short enough and a run is in process ... */         else{            /* update run's slice statistics */            if(min_sw > sw[i])               min_sw = sw[i];            if(max_sw < sw[i])               max_sw = sw[i];            /* if the run fluctuates too much ... */            if((max_sw - min_sw) > SMALL_NOISE){               my_trace("hit point where slice variation is too big\n");               my_trace2("skipping run from %d to %d\n", rs, i-1);               /* then don't erase slices to this point and */               /* restart the run from the current slice */               min_sw = sw[i];               max_sw = sw[i];               rs = i;               /* restarting the run from a piece of character, so ... */               /* set flag to FALSE */               from_erase = FALSE;               /* use the harder limit */                slimit = sw2_limit;            }         }      }      /* next slice */      i++;   }   my_trace("finished erase_fuzzy_slices_hori_ml\n");}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品久久99久久久久| 亚洲国产精品成人久久综合一区| 亚洲午夜影视影院在线观看| 91久久线看在观草草青青| 亚洲精品国产一区二区精华液 | 欧美一级夜夜爽| 亚洲欧美成人一区二区三区| 成人av电影在线网| 久久免费美女视频| 国产美女精品一区二区三区| 日韩一区二区电影网| 天堂av在线一区| 国产麻豆精品theporn| 99综合电影在线视频| 中文字幕精品在线不卡| 国产成人午夜99999| 亚洲乱码中文字幕| 91传媒视频在线播放| 欧美精品一区二区三区四区| 99在线精品一区二区三区| 欧美国产乱子伦| 色老头久久综合| 五月天久久比比资源色| 欧美欧美欧美欧美首页| 国产乱码精品一区二区三| 久久精子c满五个校花| 久久精品国产免费看久久精品| 久久精品无码一区二区三区| 国产aⅴ精品一区二区三区色成熟| 欧美一级黄色大片| 青青草国产精品亚洲专区无| 欧美午夜视频网站| 国产九色sp调教91| 亚洲欧美怡红院| 欧美性感一类影片在线播放| 国产精品1区二区.| 亚洲欧洲精品天堂一级| 欧美一卡二卡在线观看| 国产福利一区二区三区视频在线 | 日本亚洲欧美天堂免费| 亚洲国产精华液网站w| 99国产精品一区| 国产午夜一区二区三区| 欧美日韩亚洲综合| 精品一区二区三区视频在线观看| 亚洲美女视频在线| 欧美日韩激情一区二区三区| 久久99久久99精品免视看婷婷| 亚洲精品国产a| 欧美一区二区三区四区高清| 自拍偷在线精品自拍偷无码专区| 欧美精品在线观看一区二区| 国产成人夜色高潮福利影视| 亚洲一区二区三区爽爽爽爽爽| 91精品国产欧美一区二区| 大白屁股一区二区视频| 五月天网站亚洲| 国产免费成人在线视频| 欧美丝袜自拍制服另类| 国产乱人伦精品一区二区在线观看 | 久久国产精品色婷婷| 国产精品福利一区二区三区| 欧美日韩激情在线| 高清不卡一二三区| 国产精品美女久久久久久| 国产在线观看免费一区| 亚洲主播在线观看| 国产欧美一区视频| 欧美丰满少妇xxxxx高潮对白| 国产综合色视频| 亚洲成人av中文| 国产精品欧美一级免费| 日韩一区二区影院| 91精彩视频在线观看| 国产精品18久久久久久久久| 亚洲精品欧美激情| 欧美国产日韩亚洲一区| 欧美成人乱码一区二区三区| 色国产综合视频| 成人丝袜18视频在线观看| 美腿丝袜亚洲综合| 亚洲va在线va天堂| 亚洲视频中文字幕| 国产色产综合色产在线视频 | 亚洲va韩国va欧美va精品| 国产亚洲福利社区一区| 制服视频三区第一页精品| 99久久99久久久精品齐齐| 蜜臀国产一区二区三区在线播放| 一区二区三区四区乱视频| 国产清纯在线一区二区www| 日韩欧美高清dvd碟片| 色婷婷香蕉在线一区二区| 成人性生交大片免费看在线播放| 激情伊人五月天久久综合| 欧美激情在线看| 日韩一区二区三区在线| 欧美精品黑人性xxxx| 欧美三级三级三级| 色综合色狠狠天天综合色| 99久久er热在这里只有精品15| 国产成人免费视频网站| 国产精品一区三区| 国产福利不卡视频| 国产成人丝袜美腿| 成人免费高清在线观看| 蜜桃视频免费观看一区| 一本色道久久综合狠狠躁的推荐| 蜜桃视频在线观看一区二区| 日产精品久久久久久久性色| 午夜久久久久久久久| 亚洲成av人**亚洲成av**| 一区二区三国产精华液| 一区二区三区在线免费| 亚洲午夜私人影院| 天天亚洲美女在线视频| 日韩中文字幕区一区有砖一区| 偷拍与自拍一区| 韩国精品一区二区| 粉嫩av亚洲一区二区图片| 国产综合成人久久大片91| 国产精品一卡二| 欧美福利视频一区| 精品久久久久香蕉网| 亚洲综合小说图片| 国产清纯美女被跳蛋高潮一区二区久久w| 国产丝袜欧美中文另类| 国产精品国产自产拍在线| 一区二区三区欧美在线观看| 亚洲成人1区2区| 国内精品在线播放| 午夜精品福利一区二区三区蜜桃| 亚洲成人黄色影院| 日本不卡免费在线视频| av午夜精品一区二区三区| 欧美午夜宅男影院| 久久久久久久久久久99999| 国产日韩精品一区二区三区在线| 最新国产成人在线观看| 亚洲国产精品自拍| 国产一区视频在线看| 99精品桃花视频在线观看| 91精品啪在线观看国产60岁| 久久久久成人黄色影片| 亚洲另类在线制服丝袜| 五月激情综合色| 国产乱理伦片在线观看夜一区| 免费看日韩精品| 9人人澡人人爽人人精品| www成人在线观看| 亚洲国产日韩a在线播放性色| 国产美女娇喘av呻吟久久| 在线观看亚洲成人| 久久久精品免费观看| 国产不卡视频在线播放| 欧美精品黑人性xxxx| 亚洲精品国产成人久久av盗摄| 蜜臀av一区二区| 91丝袜呻吟高潮美腿白嫩在线观看| 精品国产一区二区三区av性色| 日韩免费视频一区| 国产精品无码永久免费888| 国产精品狼人久久影院观看方式| 亚洲码国产岛国毛片在线| 亚洲永久免费av| 日韩电影免费在线看| 成人免费高清在线观看| 欧美日韩中文字幕一区| 久久久久久久精| 亚洲人成人一区二区在线观看| 日本在线不卡视频| 在线观看不卡一区| 国产精品久久精品日日| 国产麻豆欧美日韩一区| 8x8x8国产精品| 亚洲一卡二卡三卡四卡五卡| hitomi一区二区三区精品| 精品粉嫩aⅴ一区二区三区四区| 一区二区成人在线观看| 成人97人人超碰人人99| 91精品国产一区二区三区| 国产精品美女久久久久久| 国产老妇另类xxxxx| 欧美大片顶级少妇| 午夜欧美在线一二页| 日本精品一区二区三区高清 | 亚洲人妖av一区二区| 国产一区 二区| 国产午夜精品一区二区| 国产在线精品一区二区夜色| 666欧美在线视频| 亚洲国产欧美一区二区三区丁香婷| 99热精品一区二区| 中文一区在线播放| 国产a精品视频| 国产精品免费看片| eeuss鲁片一区二区三区在线看| 中文字幕欧美国产| 成a人片国产精品| 亚洲欧美日韩国产手机在线|