0, 0, 0, 0, 1,0, 0, 0, 1,0, 0 ,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,2, 0, 1,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,0, 0, 0, 1,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0, 0, 0, 1,1,1,0, 2, 1,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,1,0, 0, 0, 0 ,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,0, 0, 0, 2, 0, 1,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,0, 0, 0, 0, 0, 0, 0, 2, 1,0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ,0, 0, 0, 0, 0, 2, 0, 0, 0, 1,0, 0, 0, 1,0, 0, 0, 0, 0, 0, 0} 若TreeNum(v) = 0,則當(dāng)前像素點(diǎn)不是待移除的區(qū)域點(diǎn),返回; d.若TreeNum(v) = 1,則置當(dāng)前像素點(diǎn)對(duì)應(yīng)的紅黑樹索引值k = TreeIndi(v);若 TreeNum(v) = 2,且有 currentTree〉TreeIndi (V)及 currentTree《Treeinda (V),卯遇 k = TreelndgW ;否則置 k = TreeIndi(v);其中數(shù)組 Treeindi和 Treelndg分別如下: Treeindi [512] = {0, 0, 0, 0, 0, 0, 0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步中P、L和紅黑樹的更新方法,其特征在于如下步驟: a. 若R為空,則返回; b. 對(duì)R中的每個(gè)像素點(diǎn)索引值ind,將其轉(zhuǎn)換為對(duì)應(yīng)的像素坐標(biāo)(i,j);置P(i,j)= 0 ;置 L(i, j). Treeindex = 0, L(i, j). Visited = 0 ; c. 初始化一個(gè)空列表F W記錄受影響的鄰域點(diǎn)的坐標(biāo); d. 再次遍歷R,對(duì)其中每個(gè)像素點(diǎn)索引值ind所對(duì)應(yīng)的像素坐標(biāo)(i,j),考察其8-鄰 域中的像素(S, t),(S, t) G {(i-1, j-1), (i, j-1), (i+1, j-1), (i-1, j), (i+1, j), (i-1, j+1) ,(i,j+1),(i+1,j+1)};若對(duì)鄰域點(diǎn)(s,t),有 P(s,t) = 1 且1(3,*).¥131*6(1 =尸41^56,則 置 L(s, t). Visited = TR肥,并將(s, t)加入 F ;若同時(shí)還有 d = L(s, t). Treeindex > 0, 則按權(quán)利要求1中第iv步所述的方法計(jì)算像素點(diǎn)(s,t)的索引值ind。,將ind。由T d中刪 除;按權(quán)利要求2中所述的方法,判斷像素點(diǎn)(S,t)是否為待移除的區(qū)域點(diǎn),若是,則獲取其 對(duì)應(yīng)的紅黑樹索引值k,將ind。加入Tk,并置L(s,t).TreeIndex = k+l;若(s,t)不是待移 除的區(qū)域點(diǎn),則置L(s, t). Treeindex = 0 ; e. 當(dāng)按步驟d遍歷了 R中所有像素點(diǎn)索引值后,遍歷F中的像素點(diǎn)(s,t),置L(s,t). Visited = FALSE。
【專利摘要】本發(fā)明公開了一種基于序貫細(xì)化操作的二值圖像快速骨架提取方法。在對(duì)二值圖像區(qū)域進(jìn)行序貫細(xì)化的過程中,利用紅黑樹數(shù)據(jù)結(jié)構(gòu)來記錄和管理各步細(xì)化操作移除的區(qū)域點(diǎn);在每步細(xì)化操作后,根據(jù)記錄下來的被移除區(qū)域點(diǎn)的信息,對(duì)各被移除區(qū)域點(diǎn)的8-鄰域中的其他像素進(jìn)行考察,并確定后續(xù)細(xì)化操作需要移除的區(qū)域點(diǎn)。本發(fā)明通過這種方式,最大限度地減少了確定細(xì)化操作移除的區(qū)域點(diǎn)的過程中的重復(fù)運(yùn)算,減少管理待移除區(qū)域點(diǎn)所需的搜索時(shí)間,從而顯著提高基于序貫細(xì)化的骨架提取方法的運(yùn)行速度。
【IPC分類】G06T7-00
【公開號(hào)】CN104637066
【申請(qǐng)?zhí)枴緾N201510109355
【發(fā)明人】郭斯羽, 周衛(wèi)方, 周樂前, 王耀南, 李樹濤, 溫和
【申請(qǐng)人】湖南大學(xué)
【公開日】2015年5月20日
【申請(qǐng)日】2015年3月12日