[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN104637066B - 基于序贯细化的二值图像快速骨架提取方法 - Google Patents

基于序贯细化的二值图像快速骨架提取方法 Download PDF

Info

Publication number
CN104637066B
CN104637066B CN201510109355.9A CN201510109355A CN104637066B CN 104637066 B CN104637066 B CN 104637066B CN 201510109355 A CN201510109355 A CN 201510109355A CN 104637066 B CN104637066 B CN 104637066B
Authority
CN
China
Prior art keywords
pixel
point
value
row
index value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510109355.9A
Other languages
English (en)
Other versions
CN104637066A (zh
Inventor
郭斯羽
周卫方
周乐前
王耀南
李树涛
温和
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan University
Original Assignee
Hunan University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan University filed Critical Hunan University
Priority to CN201510109355.9A priority Critical patent/CN104637066B/zh
Publication of CN104637066A publication Critical patent/CN104637066A/zh
Application granted granted Critical
Publication of CN104637066B publication Critical patent/CN104637066B/zh
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

本发明公开了一种基于序贯细化操作的二值图像快速骨架提取方法。在对二值图像区域进行序贯细化的过程中,利用红黑树数据结构来记录和管理各步细化操作移除的区域点;在每步细化操作后,根据记录下来的被移除区域点的信息,对各被移除区域点的8‑邻域中的其他像素进行考察,并确定后续细化操作需要移除的区域点。本发明通过这种方式,最大限度地减少了确定细化操作移除的区域点的过程中的重复运算,减少管理待移除区域点所需的搜索时间,从而显著提高基于序贯细化的骨架提取方法的运行速度。

Description

基于序贯细化的二值图像快速骨架提取方法
技术领域
本发明涉及图像压缩、工业检测、农业生产与管理、交通、公共安全等应用领域,具体是一种基于序贯细化操作的二值图像快速骨架提取方法。
背景技术
区域骨架是区域形状的一种集约表示,被广泛用于图像压缩以及工农业生产检测、交通与公共安全检测等广泛领域的对象识别和图像理解任务之中。提取骨架(骨架化)的方法已有多种,主要包括迭代使用数学形态学细化的方法、基于最大球球心轨迹的中轴变换方法等不同技术途径。相比之下,基于序贯数学形态学细化的方法得到的骨架为区域的同伦骨架,即骨架的拓扑结构与原区域一致,从而在利用骨架进行对象表示和识别的应用中更为适用,而诸如基于最大球的其他方法在这一点上则无法保证。
标准的序贯细化骨架提取方法的原理简单,实现便捷,对于较小尺寸的二值图像十分实用。但当图像尺寸较大时,标准的序贯细化骨架提取方法的计算速度明显下降,常常无法适用于具有一定的交互响应要求的应用场合,更无法应用于实时应用。
因此,有必要找到一种改进的基于序贯细化的骨架提取方法,在保证所得骨架的同伦性的同时,有效提高骨架提取的速度,使之能适用于面向较大二值图像、交互响应性较高的应用场合,显著提升骨架提取方法的应用潜力。
发明内容
本发明所要解决的技术问题是在现有的基于序贯细化的骨架提取方法基础上,针对较大尺寸的图像,提供一种能够快速完成同伦骨架提取的方法。
为解决上述技术问题,本发明提出的解决方案为:利用红黑树数据结构高效地记录序贯细化过程中需要移除的区域点,并在每一步细化操作后将更新红黑树内容所需的考察范围限定在上一步移除的区域点的8邻域之中,从而最大程度地减少重复运算,以有效提高运算速度。具体包括以下步骤:
i.将待提取骨架的、高为H且宽为W的二值图像B在上、下、左、右四个方向上分别进行宽度为1个像素的延拓,得到高为(H+2)、宽为(W+2)的二值图像P,延拓部分的像素值置为逻辑0(黑色);
ii.初始化8个红黑树结构T0~T7,(红黑树的原理与实现可参考“T.H.Cormen,C.E.Leiserson,R.L.Rivest,C.Stein著,潘金贵,顾铁成,李成法,叶懋译,《算法导论》,北京:机械工业出版社,2006,第163-175页”)用于管理每轮细化中待移除的P中的区域点(逻辑值为1的点或白色点),置currentTree=0;
iii.初始化一个高为(H+2)、宽为(W+2)的矩阵L,L的元素为具有TreeIndex和Visited等两个字段的结构体;L的每个元素的TreeIndex字段初始化为0,Visited字段初始化为FALSE;
iv.遍历P中第1行(最顶部的一行为第0行)到第H行、第1列(最左侧的一列为第0列)到第W列范围内的每个像素点(i,j),其中i为行号,j为列号,判断该点是否是需要移除的区域点,若是,则将该点的索引值插入相应的红黑树Tk中,并置L(i,j).TreeIndex=k+1,其中L(i,j)为矩阵L中第i行第j列上的元素;像素点索引值可按认为方便的方式加以定义,例如当把P视为由左至右的各列像素由上至下首尾连接而成的一个一维数组时,则位于第i行第j列的像素点(i,j)的索引值可定义为ind=j(H+2)+i;
v.若T0~T7均为空,则抽取P的第1行到第H行、第1列到第W列所构成的子图像作为B的骨架二值图像S返回;否则,至第vi步;
vi.置round=0;
vii.若round=8,则至第v步;否则,至第viii步;
viii.获取TcurrentTree中的所有待移除区域点的索引值,并将它们存放于列表R中;清空TcurrentTree;置currentTree=currentTree+1,若currentTree=8,则置currentTree=0;
ix.根据R对P、L和T0~T7进行更新;
x.round=round+1;清空R;至第vii步。
所述的第iv步及第ix步中待移除区域点及其对应的红黑树索引的确定方法(方法A),其具体步骤如下:
(A.1)对于二值图像P中的像素点(i,j),如果其值P(i,j)为逻辑0,则当前像素点不是待移除的区域点,返回;
(A.2)根据当前像素点(i,j)所在的3×3邻域确定该像素点的查找表索引值v,v是一个9位无符号整型值,每一位对应(i,j)所在的3×3邻域中一个特定位置上的像素值;本发明中按如下约定计算查找表索引值:v的第0位(最低位)对应P(i-1,j-1)的值,第1位对应P(i,j-1)的值,第2位对应P(i+1,j-1)的值,第3位对应P(i-1,j)的值,第4位对应P(i,j)的值,第5位对应P(i+1,j)的值,第6位对应P(i-1,j+1)的值,第7位对应P(i,j+1)的值,第8位(最高位)对应P(i+1,j+1)的值;
(A.3)根据查找表索引值v,从如下数组TreeNum中读取当前像素点(i,j)所适用的红黑树数目TreeNum(v):
TreeNum[512]={
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,1,1,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,2,0,0,0,0,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,1,1,2,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,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,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,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,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,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,则当前像素点不是待移除的区域点,返回;
(A.4)若TreeNum(v)=1,则置当前像素点对应的红黑树索引值k=TreeInd1(v);若TreeNum(v)=2,且有currentTree>TreeInd1(v)及currentTree≤TreeInd2(v),则置k=TreeInd2(v);否则置k=TreeInd1(v);其中数组TreeInd1和TreeInd2分别如下:
TreeInd1[512]={
0,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,3,3,0,0,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,0,0,5,2,0,0,0,0,0,0,0,2,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,3,0,0,0,3,3,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,7,0,0,0,7,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,7,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,0,0,0,5,5,6,0,5,5,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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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,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,7,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,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
}。
所述的第ix步中P、L和红黑树的更新方法(方法B),其具体步骤如下:
(B.1)若R为空,则返回;
(B.2)对R中的每个像素点索引值ind,将其转换为对应的像素坐标(i,j);置P(i,j)=0;置L(i,j).TreeIndex=0,L(i,j).Visited=0;
(B.3)初始化一个空列表F以记录受影响的邻域点的坐标;
(B.4)再次遍历R,对其中每个像素点索引值ind所对应的像素坐标(i,j),考察其8-邻域中的像素(s,t),(s,t)∈{(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)};若对邻域点(s,t),有P(s,t)=1且L(s,t).Visited=FALSE,则置L(s,t).Visited=TRUE,并将(s,t)加入F;若同时还有d=L(s,t).TreeIndex≥0,则按所述第iv步中的方法计算像素点(s,t)的索引值ind,将ind由Td中删除;按所述方法A判断像素点(s,t)是否为待移除的区域点,若是,则获取其对应的红黑树索引值k,将ind加入Tk,并置L(s,t).TreeIndex=k+1;若(s,t)不是待移除的区域点,则置L(s,t).TreeIndex=0;
(B.5)当按步骤(B.4)遍历了R中所有像素点索引值后,遍历F中的像素点(s,t),置L(s,t).Visited=FALSE。
综上所述,本发明所提供的方法,能够有效减少序贯细化过程中的重复运算,并通过红黑树结构高效地管理序贯细化过程中移除的区域点的新增、查找和删除等操作,从而提高了骨架提取速度,能够针对较大的二值图像达到良好的响应速度性能。
附图说明
图1为本发明中所提方法的总体流程框图;
图2为所述待移除区域点及其对应的红黑树索引的确定方法(方法A)的流程框图;
图3为所述P、L和红黑树的更新方法(方法B)的流程框图;
图4为利用本发明所提方法与若干现有骨架提取方法在植物叶片实施例图像集上得到的运算时间比较结果;
图5为一幅植物叶片实施例图像;
图6为利用本发明中所提方法在如图5所示的实施例图像上得到的骨架提取结果;
图7为利用IMAT算法在如图5所示的实施例图像上得到的骨架提取结果;
图8为如图5所示的实施例图像的叶片左上角局部细节的放大图;
图9为如图6所示的利用本发明中所提方法提取的骨架的局部细节放大图;
图10为如图7所示的利用IMAT方法提取的骨架的局部细节放大图;
图11为利用本发明所提方法与若干现有骨架提取方法在自然场景实施例图像集上得到的运算时间比较结果。
具体实施方式
以下将结合附图和具体实施例对本发明做进一步详细说明。
本发明所提方法的总体流程框图如图1所示;所述待移除区域点及其对应的红黑树索引的确定方法(方法A)的流程框图如图2所示;所述P、L和红黑树的更新方法(方法B)的流程框图如图3所示。
在实施例中,将本发明所提方法(以BWSKEL表示)和标准的序贯细化骨架提取方法(直接利用MATLAB 7.1版本中提供的bwmorph(bw,‘skel’,inf)函数调用完成,以MORPH_S表示)、一种加速的序贯细化骨架提取方法(“M.Bao,S.Guo,Q.Tang,F.Zhang.Optimizationof the bwmorph function in the MATLAB Image Processing Toolbox for binaryskeleton computation.International Conference on Computational Intelligenceand Natural Computing,CINC‘09,2:273-276”,以MORPH_A表示)、基于整数中轴变换的最大球心轨迹骨架提取方法(“W.H.Hesselink,J.Roerdink.Euclidean skeletons ofdigital image and volume data in linear time by the Integer Medial AxisTransform,IEEE Trans.on Pattern Analysis and Machine Intelligence,2008,30(12):2204-2217”,以IMAT表示)等数种已有骨架提取方法,以MATLAB MEX编程的方式进行了实现,并在100张植物叶片图像和40张自然场景图像构成的两个实施例图像库上进行了对比。
如图4所示是利用BWSKEL、MORPH_S、MORPH_A和IMAT方法在植物叶片实施例图像集上得到的运算时间比较结果。图像的原始大小均为2548×3507像素,为真实的植物叶片按A4纸幅面、在300dpi分辨率下扫描所得的图像。IMAT和MORPH_S方法的运行时间与图像的完整大小有关,而MORPH_A和BWSKEL的运行时间主要与图像中白色区域的大小有关,因此为了更加真实合理地比较算法性能,所有植物叶片的二值图像均提取出刚好包括了整个植物叶片区域的子图像部分来进行实验。同时实验图像还按r=0.1,0.2,…,1.0的长宽尺寸缩放因子进行了比例缩放,以观察算法性能与图像大小间的关系。由图4可见,BWSKEL方法的运行时间在所有缩放比例下均明显少于MORPH_S和MORPH_A方法。虽然IMAT的运行速度由于BWSKEL方法,但即使在原始图像尺寸下,BWSKEL的平均运行时间也不到0.5s,这一时间性能已经足够良好,可供一般的交互应用使用了。
如图5所示是一幅植物叶片实施例图像;如图6所示是BWSKEL方法在图5上得到的骨架结果,同时由于BWSKEL方法与MORPH_S和MORPH_A在提取出的骨架上完全等价,因此图6也是MORPH_S和MORPH_A方法的提取结果;如图7所示是IMAT方法在图5上得到的骨架结果。其中骨架均以中等灰色叠加与原二值图像之上。对比图4和图5可见,基于序贯细化操作的骨架提取方法给出的骨架更为清晰自然,而IMAT方法给出的骨架、尤其是叶片分叉等相对细节部分的骨架则与直观感知的结果相去甚远。
如图8所示是图5中的叶片左上角局部细节的放大图;如图9所示是BWSKEL方法所得骨架的相应的局部细节放大图;如图10所示是IMAT方法所得骨架的相应的局部细节放大图。对比图9和图10可见,基于序贯细化操作的骨架提取方法很好地描述了这一细节的真实中轴,而IMAT方法的骨架不仅未能正确给出细节的中轴,而且甚至无法保持连通区域的骨架的连通性。
如图11是利用BWSKEL、MORPH_S和MORPH_A方法在自然场景实施例图像集上得到的运算时间比较结果。由于IMAT方法不能保证区域骨架的连通性,因此在这一对比中未使用该方法。这一图像集中的所有图像均为500万像素大小,经自动阈值分割后,对分割所得的二值图像提取骨架。由于这样得到的区域数量多,边界形状复杂,面积也可能很大,因此相比植物叶片图像而言,BWSKEL、MORPH_S和MORPH_A等方法的运行速度均有所下降,但BWSKEL的速度优势仍然十分明显,平均2s不到的运行时间也仍然是可以接受的。

Claims (2)

1.一种基于序贯细化操作的二值图像区域同伦骨架快速提取方法,其特征在于,包括以下步骤:
I.将待提取骨架的、高为H且宽为W的二值图像B在上、下、左、右四个方向上分别进行宽度为1个像素的延拓,得到高为(H+2)、宽为(W+2)的二值图像P,延拓部分的像素值置为逻辑0,即黑色;
II.初始化8个红黑树结构T0~T7,用于管理每轮细化中待移除的P中的区域点,即逻辑值为1的点或白色点,置currentTree=0;
III.初始化一个高为(H+2)、宽为(W+2)的矩阵L,L的元素为具有TreeIndex和Visited两个字段的结构体;L的每个元素的TreeIndex字段初始化为0,Visited字段初始化为FALSE;
IV.遍历P中第1行到第H行、第1列到第W列范围内的每个像素点(i,j),其中最顶部的一行为第0行,最左侧的一列为第0列,i为行号,j为列号,判断该点是否是需要移除的区域点,若是,则将该点的索引值插入相应的红黑树Tk中,并置L(i,j).TreeIndex=k+1,其中k表示该点对应的红黑树索引值;其中L(i,j)为矩阵L中第i行第j列上的元素;像素点索引值定义的方法如下:把P视为由左至右的各列像素由上至下首尾连接而成的一个一维数组时,则位于第i行第j列的像素点(i,j)的索引值可定义为ind=j(H+2)+i;
V.若T0~T7均为空,则抽取P的第1行到第H行、第1列到第W列所构成的子图像作为B的骨架二值图像S返回;否则,至第VI步;
VI.置round=0;
VII.若round=8,则至第V步;否则,至第VIII步;
VIII.获取TcurrentTree中的所有待移除区域点的索引值,并将它们存放于列表R中;清空TcurrentTree;置currentTree=currentTree+1,若currentTree=8,则置currentTree=0;
IX.根据R对P、L和T0~T7进行更新;
X.round=round+1;清空R;至第VII步;
第IV步及第IX步中待移除区域点及其对应的红黑树索引的确定方法,包括如下步骤:
步骤一.对于二值图像P中的像素点(i,j),如果其值P(i,j)为逻辑0,则当前像素点不是待移除的区域点,返回;
步骤二.根据当前像素点(i,j)所在的3×3邻域确定该像素点的查找表索引值v,v是一个9位无符号整型值,每一位对应(i,j)所在的3×3邻域中一个特定位置上的像素值;按如下约定计算查找表索引值:v的第0位对应P(i-1,j-1)的值,第1位对应P(i,j-1)的值,第2位对应P(i+1,j-1)的值,第3位对应P(i-1,j)的值,第4位对应P(i,j)的值,第5位对应P(i+1,j)的值,第6位对应P(i-1,j+1)的值,第7位对应P(i,j+1)的值,第8位对应P(i+1,j+1)的值;
步骤三.根据查找表索引值v,从如下数组TreeNum中读取当前像素点(i,j)所适用的红黑树数目TreeNum(v):
TreeNum[512]={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,1,1,0,0,1,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,2,0,0,0,0,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,1,1,2,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,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,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,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,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,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,则当前像素点不是待移除的区域点,返回;
步骤四.若TreeNum(v)=1,则置当前像素点对应的红黑树索引值k=TreeInd1(v);若TreeNum(v)=2,且有currentTree>TreeInd1(v)及currentTree≤TreeInd2(v),则置k=TreeInd2(v);否则置k=TreeInd1(v);其中数组TreeInd1和TreeInd2分别如下:
TreeInd1[512]={0,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,3,3,0,0,3,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,5,0,0,5,2,0,0,0,0,0,0,0,2,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,3,0,0,0,3,3,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,7,0,0,0,7,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,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,7,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,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,0,0,0,0,0,0,0,0,0,0,0,0,6,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,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,0,0,0,0,0,0,0,0,0,7,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,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}。
2.根据权利要求1所述的基于序贯细化操作的二值图像区域同伦骨架快速提取方法,其特征在于,第IX步中P、L和红黑树的更新方法包括如下步骤:
一)若R为空,则返回;
二)对R中的每个像素点索引值ind,将其转换为对应的像素坐标(i,j);置P(i,j)=0;置L(i,j).TreeIndex=0,L(i,j).Visited=0;
三)初始化一个空列表F以记录受影响的邻域点的坐标;
四)再次遍历R,对其中每个像素点索引值ind所对应的像素坐标(i,j),考察其8-邻域中的像素(s,t),(s,t)∈{(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)};若对邻域点(s,t),有P(s,t)=1且L(s,t).Visited=FALSE,则置L(s,t).Visited=TRUE,并将(s,t)加入F;若同时还有d=L(s,t).TreeIndex≥0,则按第IV步所述的方法计算像素点(s,t)的索引值ind,将ind由Td中删除;判断像素点(s,t)是否为待移除的区域点,若是,则获取其对应的红黑树索引值k,将ind加入Tk,并置L(s,t).TreeIndex=k+1;若(s,t)不是待移除的区域点,则置L(s,t).TreeIndex=0;
五)当按步骤四)遍历了R中所有像素点索引值后,遍历F中的像素点(s,t),置L(s,t).Visited=FALSE。
CN201510109355.9A 2015-03-12 2015-03-12 基于序贯细化的二值图像快速骨架提取方法 Active CN104637066B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510109355.9A CN104637066B (zh) 2015-03-12 2015-03-12 基于序贯细化的二值图像快速骨架提取方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510109355.9A CN104637066B (zh) 2015-03-12 2015-03-12 基于序贯细化的二值图像快速骨架提取方法

Publications (2)

Publication Number Publication Date
CN104637066A CN104637066A (zh) 2015-05-20
CN104637066B true CN104637066B (zh) 2017-06-16

Family

ID=53215772

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510109355.9A Active CN104637066B (zh) 2015-03-12 2015-03-12 基于序贯细化的二值图像快速骨架提取方法

Country Status (1)

Country Link
CN (1) CN104637066B (zh)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105046632B (zh) * 2015-06-29 2018-09-25 湖南大学 时空高效的二值图像二元逻辑运算方法
CN105528759B (zh) * 2016-02-03 2018-11-09 四川师范大学 一种基于动态规划的距离变换计算方法
CN105787911B (zh) * 2016-03-21 2019-02-12 中国林业科学研究院资源信息研究所 一种基于拓扑分形算法的图像腐蚀与膨胀处理方法
CN107194402B (zh) * 2017-04-02 2020-07-03 南京汇川图像视觉技术有限公司 一种并行细化骨架提取方法
CN108663026B (zh) * 2018-05-21 2020-08-07 湖南科技大学 一种振动测量方法
CN113791094B (zh) * 2021-09-13 2022-09-27 东南大学 基于等效球棍模型的沥青混合料三维骨架接触评价方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102005058A (zh) * 2010-11-30 2011-04-06 南京信息工程大学 一种针对opta图像细化算法的快速实现方法
CN103150741A (zh) * 2012-11-30 2013-06-12 常州大学 一种快速骨骼化二值数字图像中图形的方法
CN104408111A (zh) * 2014-11-24 2015-03-11 浙江宇视科技有限公司 一种删除重复数据的方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102005058A (zh) * 2010-11-30 2011-04-06 南京信息工程大学 一种针对opta图像细化算法的快速实现方法
CN103150741A (zh) * 2012-11-30 2013-06-12 常州大学 一种快速骨骼化二值数字图像中图形的方法
CN104408111A (zh) * 2014-11-24 2015-03-11 浙江宇视科技有限公司 一种删除重复数据的方法及装置

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Improved bwmorph function in the MATLAB Image Processing Toolbox for Fast Computation of Repeated Morphological Dilations and Erosions;Meihua Bao 等;《2009 Second International Conference on Intelligent Computation Technology and Automation》;20091231;全文 *
Optimization of the bwmorph Function in the MATLAB Image Processing Toolbox for Binary Skeleton Computation;Meihua Bao 等;《2009 International Conference on Computational Intelligence and Natural Computing》;20091231;摘要,正文第Ⅱ节第2段,第Ⅲ节第3段、倒数第1段,图1 *
红黑树算法及其应用;高庆 等;《软件导刊》;20080930;第7卷(第9期);摘要,正文第2.3节、第4.1节 *

Also Published As

Publication number Publication date
CN104637066A (zh) 2015-05-20

Similar Documents

Publication Publication Date Title
CN104637066B (zh) 基于序贯细化的二值图像快速骨架提取方法
US20210118144A1 (en) Image processing method, electronic device, and storage medium
Zhang et al. Hybrid region merging method for segmentation of high-resolution remote sensing images
CN102999886B (zh) 图像边缘检测器及标尺光栅栅线精度检测系统
CN110838105B (zh) 一种业务流程模型图像识别与再构方法
JP5854802B2 (ja) 画像処理装置、画像処理方法、及びコンピュータプログラム
CN112069985B (zh) 基于深度学习的高分辨率大田图像稻穗检测与计数方法
CN103870834B (zh) 基于分层分割的滑动窗搜索方法
WO2006102014A1 (en) Fast graph cuts: a weak shape assumption provides a fast, exact method for graph cuts segmentation
Havel et al. Efficient tree construction for multiscale image representation and processing
CN110807775A (zh) 基于人工智能的中医舌像分割装置、方法及存储介质
CN102930561A (zh) 一种基于Delaunay三角网的栅格地图矢量化方法
CN114120141B (zh) 一种可全天候遥感监测自动分析方法及其系统
CN111415352B (zh) 一种基于深度级联网络的癌转移全景病理切片分析方法
CN108765349A (zh) 一种带有水印的图像修复方法及系统
CN105261049A (zh) 一种图像连通区域快速检测方法
CN108090485A (zh) 基于多视角融合的图像前景自动提取方法
CN101510304A (zh) 一种分割获取前景图像的方法、装置和摄像头
CN106447656B (zh) 基于图像识别的渲染瑕疵图像检测方法
CN109242854A (zh) 一种基于flic超像素分割的图像显著性检测方法
CN110516592A (zh) 一种基于手写数字字符的识别方法
CN114419006A (zh) 一种随背景变化的灰度视频文字类水印去除方法及系统
CN111738310B (zh) 物料分类方法、装置、电子设备和存储介质
CN106056575B (zh) 一种基于似物性推荐算法的图像匹配方法
CN110322479B (zh) 一种基于时空显著性的双核kcf目标跟踪方法

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant