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

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

?? phrasmap.c

?? NIST Handwriting OCR Testbed
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*# proc: build_phrase_map - generate an image map of the central mass of each line of# proc:                    of handprint.# proc: phrases_from_map - sort blobs into phrase lines using the map.# proc:# proc: norm_small_tall_lists - sort blobs into categories of normal, small, and tall.# proc:# proc: pi_lines_from_map - generate lists of blob indices sorting the blobs# prod:                     into lines.# proc: should_split_tall - test to determine if a tall character should be split# proc:                     across multiple lines of handprint.# proc: tst_phrase_overlap - tests the amount of character overlap with a line in the# proc:                      phrase map.# proc: split_across_lines - horizontally splits a character across multiple lines.# proc:# proc: find_closest_line_in_map - finds the closest line in the phrase map to a# proc:                      specified blob.# proc: hist_blob_colors - generates a histogram from the black pixels in a blob# proc:                    that overlap 0 or more lines in the phrase map.# proc: draw_phrase_map - actually construct the phrase map image.# proc:# proc: short_phrases_to_problems - removes and appends too short phrases to the# proc:                   problem list.*/#include <stdio.h>#include <blobls.h>#include <ihead.h>#include <mis.h>#include <phrase.h>#include <segchars.h>#include <defs.h>/***************************************************************************//*     Phase I - Build the phrase region map                               *//***************************************************************************/build_phrase_map(mcdata, w, h, nphrases, blobls, esw, charh)unsigned char **mcdata;int w, h, *nphrases;BLOBLS *blobls;int esw, charh;{   int **pi_lists, *pi_lens, sum;   int *problems, nprob, aprob;   int *nis, nnum, *sis, snum, *tis, tnum;   int *mxs, *mys;   int i,j;   float hmean;   /* extract "normal" sized blobs, pruning small and tall ones */   norm_small_tall_lists(&nis, &nnum, &sis, &snum, &tis, &tnum, blobls, esw, charh);   /* throw away too short and too tall blobs */   free(sis);   free(tis);   /* if no normal sized blobs, then paragraph is empty */   if(nnum == 0){      free(nis);      return(FALSE);   }   malloc_int(&mxs, nnum, "build_phrase_map : mxs");   malloc_int(&mys, nnum, "build_phrase_map : mys");   sum = 0;   for(i = 0; i < nnum; i++){      mxs[i] = blobls->blobs[nis[i]]->cx;      mys[i] = blobls->blobs[nis[i]]->cy;      sum += blobls->blobs[nis[i]]->h;   }   hmean = sum / (float)nnum;   /* build phrase lists from "normal" size blobs */   build_pi_lists_Rel2(&pi_lists, &pi_lens, nphrases, &problems, &nprob,                   hmean, mxs, mys, nnum);   free(mxs);   free(mys);   /* move points in too short phrases to problem list */   aprob = nprob;   short_phrases_to_problems(&problems, &nprob, &aprob,                             pi_lists, pi_lens, nphrases);   /* throw away problem blobs */   free(problems);   /* if no phrases remain, then paragraph is empty */   if(*nphrases == 0){      free(nis);      free(pi_lists);      free(pi_lens);      return(FALSE);   }   /* remove 1 level of indirection */   for(i = 0; i < *nphrases; i++){      for(j = 0; j < pi_lens[i]; j++){         (pi_lists[i])[j] = nis[(pi_lists[i])[j]];      }    }    free(nis);   /* draw phrase region map */   draw_phrase_map(mcdata, w, h, blobls, pi_lists, pi_lens, *nphrases);   for(i = 0; i < *nphrases; i++)      free(pi_lists[i]);   free(pi_lists);   free(pi_lens);   return(TRUE);}/***************************************************************************//*     Phase II - Construct phrases using the region map                   *//***************************************************************************/phrases_from_map(pi_lists, pi_lens, nphrases, blobls, esw, charh,                    mcdata, w, h)int ***pi_lists, **pi_lens, nphrases;BLOBLS *blobls;int esw, charh;unsigned char *mcdata;int w, h;{   int i, *pi_alens, alen;   malloc_dbl_int_l1(pi_lists, nphrases, "phrases_from_map : pi_lists");   malloc_int(&pi_alens, nphrases, "phrases_from_map : pi_alens");   alen = PHRASE_LEN_CHUNKS;   for(i = 0; i < nphrases; i++){      malloc_int(&((*pi_lists)[i]), alen, "phrases_from_map : pi_lists[i]");      pi_alens[i] = alen;   }   calloc_int(pi_lens, nphrases,  "phrases_from_map : pi_lens");   /* reconstruct lines from phrase region map */   pi_lines_from_map(*pi_lists, *pi_lens, pi_alens, nphrases, blobls, esw, charh,                      mcdata, w, h);   free(pi_alens);}/***************************************************************************/norm_small_tall_lists(nis, nnum, sis, snum, tis, tnum, blobls, esw, charh)BLOBLS *blobls;int **nis, *nnum, **sis, *snum, **tis, *tnum;int esw, charh;{   int i, too_tall, head;   malloc_int(nis, blobls->num, "norm_small_tall_lists : nis");   malloc_int(sis, blobls->num, "norm_small_tall_lists : sis");   malloc_int(tis, blobls->num, "norm_small_tall_lists : tis");   /* prune out too small blobs */   *nnum = 0;   *snum = 0;   for(i = 0; i < blobls->num; i++){      /* store non-dot sized blob height */      if(!is_dot_blob(blobls->blobs[i], esw)){         (*nis)[*nnum] = i;         (*nnum)++;      }      /* otherwise skip too small blob */      else         (*sis)[(*snum)++] = i;   }   /* prune out too tall blobs */   too_tall = sround(charh * TALL_FACTOR);   head = 0;   *tnum = 0;   for(i = 0; i < *nnum; i++){      if(blobls->blobs[(*nis)[i]]->h < too_tall){         /* if not copying itself */         if(head != i)            (*nis)[head] = (*nis)[i];         head++;      }      /* otherwise skip too tall blob */      else         (*tis)[(*tnum)++] = (*nis)[i];   }   *nnum = head;}/***************************************************************************/pi_lines_from_map(pi_lists, pi_lens, pi_alens, nphrases, blobls, esw, charh,                  mcdata, w, h)int **pi_lists, *pi_lens, *pi_alens, nphrases;BLOBLS *blobls;unsigned char *mcdata;int w, h, esw, charh;{   int i, map_i, max_v, pi, *mxs;   int *color_hist, hnum, hsize;   int *xphrases, nx, lastblob;   hnum = nphrases + 1;   malloc_int(&color_hist, hnum, "pi_lines_from_map : color_hist");   hsize = hnum * sizeof(int);   malloc_int(&xphrases, nphrases, "pi_lines_from_map : xphrases");   lastblob = blobls->num;   for(i = 0; i < lastblob; i++){      memset(color_hist, '\0', hsize);      hist_blob_colors(color_hist, hnum, blobls->blobs[i], mcdata, w, h);      /* if blob is too tall */      if((blobls->blobs[i]->h > charh) &&         (should_split_tall(xphrases, &nx, blobls->blobs[i], color_hist, hnum,                               mcdata, w, h))){         split_across_lines(i, blobls, esw, pi_lists, pi_lens, pi_alens, nphrases,                            mcdata, w, h, xphrases, nx);      }      /* if tall but not split, then treat as any other blob */      else{         /* find max phrase region overlap */         find_first_max_forward(color_hist, 0, hnum, &map_i, &max_v);         /* if no overlap with a phrase region ... */         if(max_v == 0){            /* then assign to closest */            if((map_i = find_closest_line_in_map(blobls->blobs[i],                             mcdata, w, h)) == NOT_FOUND)               fatalerr("pi_lines_from_map", "no line found in map", NULL);         }         pi = map_i - 1;         /* add blob to appropriate pi_list */         add_pi_list(&(pi_lists[pi]), &(pi_lens[pi]), &(pi_alens[pi]), i);      }   }   free(color_hist);   free(xphrases);   /* sort the blobs in each line on cx's */   malloc_int(&mxs, blobls->num, "pi_lines_from_map : mxs");   for(i = 0; i < blobls->num; i++)      mxs[i] = blobls->blobs[i]->cx;   for(i = 0; i < nphrases; i++){      sort_pi_list_on_x(pi_lists[i], pi_lens[i], mxs, blobls->num);   }   free(mxs);}/***************************************************************************/should_split_tall(xphrases, nx, blob, color_hist, hnum, mcdata, w, h)BLOB *blob;int *color_hist, hnum;unsigned char *mcdata;int w, h;int *xphrases, *nx;{   int i, max1 = -1, max2 = -1;   float pb;   *nx = 0;   for(i = 1; i < hnum; i++){      if(color_hist[i] != 0){         xphrases[*nx] = i-1;         (*nx)++;         if(color_hist[i] > max1){            max2 = max1;            max1 = color_hist[i];         }         else if(color_hist[i] > max2){            max2 = color_hist[i];         }      }   }   if(*nx < 2)      return(FALSE);   pb = max2 / (float)blob->pixcnt;   if(pb < MIN_2ND_OVER)       return(FALSE);   if(tst_phrase_overlap(xphrases[(*nx-1)]+1, blob, mcdata, w, h, PRCT_OVERLAP))      return(TRUE);   else{      /* remove last overlapping phrase */      (*nx)--;      if(*nx < 2)         return(FALSE);      else         return(TRUE);   }}/***************************************************************************/tst_phrase_overlap(pi, blob, mcdata, w, h, thresh)int pi;BLOB *blob;unsigned char *mcdata;int w, h;float thresh;{   int x, y, found, sy, ty, by, pwidth, bover;   unsigned char *sbptr, *bptr, *smptr, *mptr;   int min_x = -1, min_y = -1, max_x = -1, max_y = -1;   float pover;   /* find range of blob overlap with phrase region */   /* start by finding top of range */   bptr = blob->data;   smptr = mcdata + (blob->y1 * w) + blob->x1;   for(y = 0, found = 0; (y < blob->h) && (!found); y++){      mptr = smptr;      for(x = 0; x < blob->w; x++){         if(*bptr && (*mptr == pi)){            min_y = y;            min_x = x;            found = 1;            break;         }         bptr++;         mptr++;      }      smptr += w;   }   if(!found)      return(FALSE);   /* now find bottom of overlap range */   sbptr = blob->data + ((blob->h-1) * blob->w);   smptr = mcdata + (blob->y2 * w) + blob->x1;   for(y = blob->h-1, found = 0; (y >= 0) && (!found); y--){      mptr = smptr;      bptr = sbptr;      for(x = 0; x < blob->w; x++){         if(*bptr && (*mptr == pi)){            max_y = y;            max_x = x;            found = 1;            break;         }         bptr++;         mptr++;      }      smptr -= w;      sbptr -= blob->w;   }   if(!found)      fatalerr("tst_phrase_overlap",               "map pixel not found when locating bottom of overlap", NULL);   bover = max_y - min_y + 1;   /* find phrase band width */   sy = blob->y1 + max_y;   smptr = mcdata + (sy * w) + blob->x1 + max_x;   ty = sy;   mptr = smptr;   while((ty >= 0) && (*mptr == pi)){      ty--;      mptr-=w;   }   by = sy;   mptr = smptr;   while((by < h) && (*mptr == pi)){      by++;      mptr+=w;   }   pwidth = by - ty + 1;   /* if percent overlap large enough */   pover = bover / (float)pwidth;   if(pover < thresh)      return(FALSE);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产在线播放一区| 精品在线免费视频| 国产精品一区久久久久| 欧美视频三区在线播放| 国产欧美精品日韩区二区麻豆天美| 午夜精品视频在线观看| av电影一区二区| 久久久蜜桃精品| 久久激情五月激情| 欧美日韩一区小说| 亚洲丝袜制服诱惑| 国产精品中文字幕日韩精品 | 亚洲成人免费视频| 成人免费av网站| 亚洲精品一区二区精华| 香蕉影视欧美成人| 色88888久久久久久影院按摩| 久久久久久久综合狠狠综合| 性久久久久久久久| 欧美最新大片在线看| 国产精品国产三级国产普通话蜜臀| 久久69国产一区二区蜜臀| 欧美日产国产精品| 一区二区在线观看视频| 国产91在线观看| 久久综合九色综合97婷婷| 日韩成人免费看| 欧美美女激情18p| 亚洲成人av中文| 欧美色精品天天在线观看视频| 亚洲蜜臀av乱码久久精品蜜桃| 99久久综合99久久综合网站| 欧美激情一区二区三区不卡 | 久久av老司机精品网站导航| 欧美另类一区二区三区| 亚洲成人免费视| 欧美日韩精品一区视频| 亚洲大型综合色站| 欧美日韩一区国产| 日韩精品午夜视频| 欧美一区二区三级| 日本强好片久久久久久aaa| 欧美精品丝袜久久久中文字幕| 亚洲aⅴ怡春院| 91精品中文字幕一区二区三区| 日本中文字幕不卡| 91精品国产综合久久久久久久| 日本在线不卡一区| 日韩色在线观看| 精品无码三级在线观看视频 | 欧美性一区二区| 亚洲国产日韩综合久久精品| 欧美视频一区二区三区| 日日夜夜免费精品视频| 欧美大片一区二区| 狠狠色狠狠色综合系列| 国产午夜精品在线观看| 岛国精品在线观看| 日韩美女啊v在线免费观看| 91福利视频网站| 视频在线观看一区二区三区| 日韩三级.com| 豆国产96在线|亚洲| 亚洲美女偷拍久久| 91精品国产综合久久久久久久| 久久99久久99小草精品免视看| 久久精品日韩一区二区三区| 99精品国产一区二区三区不卡| 亚洲一区二区三区视频在线| 欧美一区二区三区色| 韩国女主播成人在线| 国产精品免费观看视频| 91国偷自产一区二区三区成为亚洲经典 | 91超碰这里只有精品国产| 日韩高清不卡一区| 久久久蜜桃精品| 99在线精品免费| 天天操天天干天天综合网| 欧美成人高清电影在线| 成人网在线免费视频| 亚洲高清不卡在线观看| 欧美精品一区二区三区很污很色的| 懂色中文一区二区在线播放| 亚洲一区二区三区四区在线观看| 欧美sm美女调教| 99久久精品国产麻豆演员表| 日韩高清一区在线| 中文字幕成人网| 5858s免费视频成人| 国产精品综合在线视频| 亚洲精品成人天堂一二三| 日韩精品一区二区在线| 91亚洲精品久久久蜜桃网站 | 中文字幕亚洲一区二区va在线| 欧美日韩综合不卡| 国产精品白丝jk黑袜喷水| 亚洲精品乱码久久久久久| 日韩欧美一二三| 91丝袜呻吟高潮美腿白嫩在线观看| 日韩综合小视频| 亚洲欧洲美洲综合色网| 91精品国产综合久久国产大片| 成人av资源在线| 久久er精品视频| 亚洲一二三四区| 欧美激情综合五月色丁香| 欧美日韩成人高清| 成人免费va视频| 久久99国产精品久久99果冻传媒| 一区二区三区日韩精品| 久久久精品人体av艺术| 欧美日韩免费一区二区三区视频| 大胆亚洲人体视频| 美国毛片一区二区| 一区二区三区四区激情| 欧美国产精品中文字幕| 日韩欧美国产麻豆| 欧美日韩一级片在线观看| 成人高清伦理免费影院在线观看| 蜜桃视频免费观看一区| 亚洲午夜一区二区三区| 18成人在线观看| 久久综合色之久久综合| 91精品婷婷国产综合久久竹菊| 色综合久久久久综合体桃花网| 国产成人免费在线观看| 久久99最新地址| 秋霞电影网一区二区| 亚洲午夜久久久久| 亚洲人成影院在线观看| 国产三区在线成人av| 欧美va亚洲va| 欧美一区二区在线播放| 欧美日韩精品一区二区在线播放| 91视频免费播放| 9人人澡人人爽人人精品| 粗大黑人巨茎大战欧美成人| 精品亚洲porn| 久久精品99国产国产精| 日韩专区在线视频| 亚洲va国产va欧美va观看| 亚洲综合色成人| 亚洲天堂网中文字| 亚洲欧美一区二区视频| 中文字幕欧美日韩一区| 国产欧美精品区一区二区三区| 久久精品亚洲精品国产欧美| 精品成人私密视频| 欧美变态口味重另类| 欧美tickle裸体挠脚心vk| 日韩午夜在线影院| 日韩三级免费观看| 欧美一区在线视频| 日韩亚洲欧美在线| 日韩欧美中文一区| 欧美xxxxx牲另类人与| 欧美电影免费观看高清完整版在线观看 | caoporm超碰国产精品| 成人毛片老司机大片| 成人激情午夜影院| 不卡av免费在线观看| av男人天堂一区| 91免费观看国产| 在线观看网站黄不卡| 欧美视频一区二区三区四区| 欧美嫩在线观看| 日韩你懂的电影在线观看| 26uuu国产在线精品一区二区| 久久久久久久综合| 日本一二三不卡| 亚洲免费电影在线| 亚洲成av人片| 麻豆传媒一区二区三区| 国产美女一区二区| 成人伦理片在线| 在线精品视频一区二区| 欧美精品亚洲一区二区在线播放| 337p亚洲精品色噜噜| 666欧美在线视频| 日韩精品一区二区三区视频在线观看 | 国产精品中文字幕一区二区三区| 懂色av一区二区三区蜜臀 | 狠狠色丁香婷婷综合久久片| 国产电影精品久久禁18| www.综合网.com| 在线观看区一区二| 欧美一区二区三区啪啪| 久久精品亚洲一区二区三区浴池| 亚洲欧洲日韩女同| 一区二区三区高清| 美腿丝袜在线亚洲一区| 国产91在线观看| 欧美午夜精品久久久| 欧美不卡一区二区三区| 国产精品久久精品日日| 天堂va蜜桃一区二区三区| 国产精品一区在线| 在线观看av一区二区| 欧美成人乱码一区二区三区| 1区2区3区欧美|