[go: up one dir, main page]

CN100433016C - Image retrieval algorithm based on abrupt change of information - Google Patents

Image retrieval algorithm based on abrupt change of information Download PDF

Info

Publication number
CN100433016C
CN100433016C CNB200610113046XA CN200610113046A CN100433016C CN 100433016 C CN100433016 C CN 100433016C CN B200610113046X A CNB200610113046X A CN B200610113046XA CN 200610113046 A CN200610113046 A CN 200610113046A CN 100433016 C CN100433016 C CN 100433016C
Authority
CN
China
Prior art keywords
area
search
color
image
column
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.)
Expired - Fee Related
Application number
CNB200610113046XA
Other languages
Chinese (zh)
Other versions
CN1916906A (en
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.)
Beijing University of Technology
Original Assignee
Beijing University of Technology
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 Beijing University of Technology filed Critical Beijing University of Technology
Priority to CNB200610113046XA priority Critical patent/CN100433016C/en
Publication of CN1916906A publication Critical patent/CN1916906A/en
Application granted granted Critical
Publication of CN100433016C publication Critical patent/CN100433016C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

一种基于图像突变的图像检索方法,涉及图像检索领域。目前,复杂背景下图像的自动分割方法过于简单,且容易破坏图像内部语义的相关性。本发明的首先将用户上传的样例图像的颜色数据从GRB空间转换到HSV空间,并归一化处理;然后根据像素间的相关性和信息突变特性,对图像进行初始分割,并根据分割后的像素块间的相似性,进行循环合并,将图像分割为3×3子块;分别抽取9个区域的特征向量,即HSV颜色直方图、分块主色以及中心矩;由用户从9个区域中选取感兴趣区域,与待检索图像进行的进行相似性比较,得到进行图像检索结果。本发明在图像的检索过程中兼顾检索算法的低复杂度与图像语义贴合性,检索结果与人类认知具有良好的一致性。

Figure 200610113046

An image retrieval method based on image mutation, which relates to the field of image retrieval. At present, the automatic segmentation method of image under complex background is too simple, and it is easy to destroy the semantic correlation within the image. The present invention first converts the color data of the sample image uploaded by the user from the GRB space to the HSV space, and normalizes it; The similarity between the pixel blocks is combined in a loop, and the image is divided into 3×3 sub-blocks; the feature vectors of 9 regions are extracted respectively, that is, the HSV color histogram, the main color of the block, and the central moment; Select the region of interest in the region, compare the similarity with the image to be retrieved, and obtain the image retrieval result. In the image retrieval process, the invention takes into account the low complexity of the retrieval algorithm and the conformity of image semantics, and the retrieval result has good consistency with human cognition.

Figure 200610113046

Description

基于信息突变的图像检索方法 Image retrieval method based on information mutation

技术领域 technical field

本发明涉及图像检索领域,设计和实现了一种基于信息突变的图像检索方法。The invention relates to the field of image retrieval, and designs and implements an image retrieval method based on information mutation.

背景技术 Background technique

随着互联网上大规模图像数据的激增,传统的文本搜索引擎已远不能满足人们信息检索的需求,基于内容的检索技术逐渐成为目前多媒体信息检索、人工智能、数据库等领域中一个新的研究热点。With the surge of large-scale image data on the Internet, traditional text search engines are far from meeting the needs of people's information retrieval. Content-based retrieval technology has gradually become a new research hotspot in the fields of multimedia information retrieval, artificial intelligence, and databases. .

基于内容的图像检索方法涉及到两个关键技术:图像特征的提取、表示方式以及检索算法中相似性度量准则的设定。目前,基于内容的图像特征提取、表示多是从图像的颜色、形状、纹理等底层特征入手,利用颜色直方图、共生矩阵、形状不变矩等对图像进行描述与存储,但这些方法都有其固有的缺陷。颜色直方图计算简单,但丧失了图像的空间信息;共生矩阵虽然兼顾了颜色和空间两方面的信息,却带来了算法复杂度的增加。为解决以上问题,一些检索系统,如BlobWorld系统和Netra系统等,在特征提取前对图像进行预分割,获得图像不同的目标区域,然后再基于图像区域抽取特征,由此获得了比基于全局图像特征更好的检索结果。Content-based image retrieval methods involve two key technologies: image feature extraction, representation, and the setting of similarity measurement criteria in retrieval algorithms. At present, content-based image feature extraction and representation mostly start from the underlying features of the image such as color, shape, and texture, and use color histograms, co-occurrence matrices, and shape invariant moments to describe and store images, but these methods have its inherent flaws. The calculation of the color histogram is simple, but the spatial information of the image is lost; although the co-occurrence matrix takes into account both the information of color and space, it increases the complexity of the algorithm. In order to solve the above problems, some retrieval systems, such as BlobWorld system and Netra system, pre-segment the image before feature extraction to obtain different target areas of the image, and then extract features based on the image area, thus obtaining a better image than the global image. features for better retrieval results.

目前,复杂背景下图像的自动分割还是一个难点问题,而且即使得到这样的区域,要想对其正确表征需要抽取多维特征。对于大型图像数据库而言,高维向量的存储,以及高维空间中距离的计算,将导致算法复杂度成数量级增加。基于此,许多学者提出了一种提取图像的粗略区域的方法。其传统做法为:对图像进行固定子块的划分,提取各个子块的特征并进行检索。这种做法虽然考虑了图像的空间位置信息,但其分割方法过于简单,且容易破坏图像内部语义的相关性。因此,研究如何兼顾特征抽取、存储,检索算法的低复杂度与图像语义贴合性两方面的因素,将是一个有意义的尝试。At present, the automatic segmentation of images under complex backgrounds is still a difficult problem, and even if such regions are obtained, multi-dimensional features need to be extracted in order to correctly represent them. For large image databases, the storage of high-dimensional vectors and the calculation of distances in high-dimensional spaces will lead to an order of magnitude increase in algorithm complexity. Based on this, many scholars have proposed a method to extract the rough area of the image. The traditional method is: divide the image into fixed sub-blocks, extract the features of each sub-block and perform retrieval. Although this approach takes into account the spatial position information of the image, its segmentation method is too simple, and it is easy to destroy the semantic correlation within the image. Therefore, it will be a meaningful attempt to study how to take into account the two factors of feature extraction, storage, low complexity of retrieval algorithms and image semantic fit.

发明内容 Contents of the invention

本发明的目的是充分利用图像中所蕴含的丰富的颜色和空间信息,提出一种基于信息突变的图像检索方法。它根据图像特征制定相应的策略,通过粗略区域划分获得有意义的分割结果,并在此基础上抽取区域特征和设计相应的相似性度量算法,从而实现基于内容的图像检索。人类观察一幅图像时,总是依其颜色分布和目标物体形状进行识别。而目标物体边缘的局部小区域内往往对应着颜色信息的突变,因此,本发明把图像划分的关注点聚焦到颜色信息的突变上,并在此基础上制定相应的判别准则实现彩色图像自适应分割的目的。然后,分别抽取图像各个区域的HSV颜色直方图、分块主色以及中心矩,对图像区域特征进行刻画;在此基础上,本发明以直方图交叉距离为依据,利用分块主色对其进行加权后作为分子,用中心矩的差的平方作为分母,制定了图像的加权直方图距离实现对两幅图像进行相似性度量的目的。The purpose of the present invention is to make full use of the rich color and space information contained in the image, and propose an image retrieval method based on information mutation. It formulates corresponding strategies according to image features, obtains meaningful segmentation results through rough region division, and extracts region features and designs corresponding similarity measurement algorithms on this basis, so as to realize content-based image retrieval. When human beings observe an image, they always recognize it according to its color distribution and the shape of the target object. However, the local small area on the edge of the target object often corresponds to the sudden change of color information. Therefore, the present invention focuses on the sudden change of color information for image division, and formulates corresponding criteria on this basis to realize adaptive segmentation of color images. the goal of. Then, extract the HSV color histogram, block main color and central moment of each region of the image respectively, and describe the image region features; After weighting, it is used as the numerator, and the square of the central moment difference is used as the denominator, and the weighted histogram distance of the image is formulated to achieve the purpose of measuring the similarity of two images.

本发明的技术思路特征为:Technical thought feature of the present invention is:

1.在图像分割过程中,利用图像的目标物体边缘的局部小区域内对应颜色信息突变的特点,对图像进行初始分割。1. In the image segmentation process, the image is initially segmented by using the characteristics of sudden changes in color information in the local small area on the edge of the target object in the image.

2.在每一次块搜索的过程中,利用当前像素块与相邻行、列像素之间有相关性的特点,通过垂直、水平拓展(见图1),得到一个衡量颜色信息突变程度的拓展像素块,分别计算两者的颜色均值,相减后得到信息残差。2. In the process of each block search, using the characteristics of the correlation between the current pixel block and adjacent row and column pixels, through vertical and horizontal expansion (see Figure 1), an expansion that measures the degree of color information mutation is obtained For the pixel block, the color mean of the two is calculated respectively, and the information residual is obtained after subtraction.

3.根据以上得到的信息残差,与一经验阈值相比较(该阈值取值为8,是由大量实验获得的),若大于阈值则表示拓展像素块中存在颜色信息突变,本次块搜索结束,返回下一次块搜索的初始像素,重新开始块搜索;否则将继续进行本次块搜索,即继续向外拓展。3. According to the information residual obtained above, compare it with an empirical threshold (the threshold value is 8, which is obtained from a large number of experiments), if it is greater than the threshold, it means that there is a color information mutation in the expanded pixel block, and this block search End, return to the initial pixel of the next block search, and restart the block search; otherwise, continue this block search, that is, continue to expand outward.

4.在一个方向(图像的横向或竖向)上利用块搜索规则反复进行块搜索,直到到达图像边界(图像的宽或高),这样,将得到若干尺寸不等的像素块,将这样一次搜索定义为一次方向搜索(根据搜索方向不同分为横向搜索或竖向搜索)。根据这些得到的像素块,分别取其中具有最大或最小尺寸的像素块,将其对应尺寸作为本次方向搜索的最终分割的尺寸(见图2)。4. In one direction (horizontal or vertical of the image), use the block search rule to repeatedly perform block search until reaching the image boundary (width or height of the image), so that several pixel blocks with different sizes will be obtained. Search is defined as a directional search (horizontal search or vertical search according to different search directions). According to these obtained pixel blocks, the pixel block with the largest or smallest size is selected respectively, and its corresponding size is taken as the final segmentation size of this direction search (see FIG. 2 ).

5.在横、竖两个方向上分别反复进行方向搜索,直到到达图像边界,最终得到图像的初始分割方案(见图3(a))。5. Perform direction search repeatedly in the horizontal and vertical directions until reaching the image boundary, and finally obtain the initial segmentation scheme of the image (see Figure 3(a)).

6.在垂直、水平两个方向分别对图像的初始分割区域进行合并,不断合并区域距离最小的两个区域,直到图像被划分为3×3子块,即9个区域(见图3(b))。6. Merge the initial segmentation regions of the image in the vertical and horizontal directions, and continuously merge the two regions with the smallest distance between the regions until the image is divided into 3×3 sub-blocks, that is, 9 regions (see Figure 3(b )).

7.根据图像分割结果,分别抽取图像各个区域的HSV颜色直方图、分块主色以及中心矩,对区域特征进行刻画。7. According to the image segmentation results, extract the HSV color histogram, block main color and central moment of each region of the image to describe the regional characteristics.

8.在检索过程中,本发明以利用主色进行加权后的直方图交叉距离为分子,用中心矩的差的平方作为分母,制定了图像的加权直方图距离,实现对两幅图像进行相似性度量的目的。8. In the retrieval process, the present invention uses the weighted histogram intersection distance of the main color as the numerator, and uses the square of the difference between the central moments as the denominator to formulate the weighted histogram distance of the image, so as to realize the similarity between the two images. purpose of measurement.

9.综合考虑,本发明在图像分割、区域特征提取以及图像检索的各个环节都充分考虑到图像颜色和空间信息的综合利用。通过检测颜色信息突变的方法对图像进行分割处理,区分出图像的目标区域和背景,得到符合人类视觉感知的图像区域;加权颜色直方图距离的制定充分利用图像分割和区域特征提取所获得的信息,大幅提高了图像的查准率,具有很好的检索效果。9. Considering comprehensively, the present invention fully considers the comprehensive utilization of image color and spatial information in each link of image segmentation, region feature extraction and image retrieval. Segment the image by detecting the sudden change of color information, distinguish the target area and background of the image, and obtain the image area that conforms to human visual perception; the formulation of the weighted color histogram distance makes full use of the information obtained by image segmentation and regional feature extraction , which greatly improves the precision rate of the image and has a good retrieval effect.

本发明的技术方案流程图参见图4、图5。图4是本发明图像最大行距横向搜索方法的流程图,图5是本发明的整个检索方法的流程图。Refer to Fig. 4 and Fig. 5 for the flow chart of the technical solution of the present invention. Fig. 4 is a flow chart of the maximum line spacing horizontal search method for images of the present invention, and Fig. 5 is a flow chart of the entire retrieval method of the present invention.

一种基于信息突变的图像检索算法,其特征在于,包括下述步骤:A kind of image retrieval algorithm based on information mutation, it is characterized in that, comprises the following steps:

1)读入用户从外接数码相机中上传的或者读入计算机里储存的样例图像Sample,将其从RBG转换到HSV颜色空间,并将其中的色调H、饱和度S、亮度V三个分量按照公式(1)计算得到归一化分量L后,将L作为像素的颜色值;1) Read in the sample image Sample uploaded by the user from an external digital camera or stored in the computer, convert it from RBG to HSV color space, and convert the three components of hue H, saturation S, and brightness V After calculating the normalized component L according to the formula (1), use L as the color value of the pixel;

L=16H+4S+V    (1)L=16H+4S+V (1)

2)将图像左上角的像素P0(0,0)作为初始种子点,分别向下、向右扩展一行、一列像素,得到一正方形区域,计算该正方形区域内所有像素的颜色值的平均值,然后计算其与初始种子点颜色值的差值Dif,将Dif与阈值Thred=8相比较,若Dif>Thred则表示该区域中存在颜色信息突变;否则,仍以图像左上角的像素P0(0,0)为初始种子点,以刚搜索完的区域为基础,再分别向下、向右扩展一行、一列像素,得到一新的正方形区域,计算该区域的颜色均值arg(new),然后计算其与扩展前正方形区域的颜色均值arg(origin)的差值Dif,如(2)式所示:2) Take the pixel P 0 (0, 0) in the upper left corner of the image as the initial seed point, expand one row and one column of pixels downward and rightward respectively to obtain a square area, and calculate the average value of the color values of all pixels in the square area , and then calculate the difference Dif between it and the color value of the initial seed point, compare Dif with the threshold Thred=8, if Dif>Thred, it means that there is a sudden change in color information in this area; otherwise, the pixel P 0 in the upper left corner of the image is still used (0, 0) is the initial seed point, based on the area just searched, and then expand one row and one column of pixels downward and to the right respectively to obtain a new square area, and calculate the color mean value arg(new) of this area, Then calculate the difference Dif between it and the color mean arg(origin) of the square area before expansion, as shown in formula (2):

Dif=arg(origin)-arg(new)    (2)Dif=arg(origin)-arg(new) (2)

式中: arg ( origin ) = 1 ( k - 1 - br ) ( s - 1 - bc ) Σ i = br i = k - 1 Σ j = bc j = s - 1 P ij - - - ( 3 ) In the formula: arg ( origin ) = 1 ( k - 1 - br ) ( the s - 1 - bc ) Σ i = br i = k - 1 Σ j = bc j = the s - 1 P ij - - - ( 3 )

argarg (( newnew )) == 11 (( kk -- brbr )) (( sthe s -- bcbc )) ΣΣ ii == brbr ii == kk ΣΣ jj == bcbc jj == sthe s PP ijij -- -- -- (( 44 ))

其中,br是初始种子的行号、bc是其列号,它们的初始值都为0;k和s分别代表新得到的正方形区域的右下角像素的行号、列号;Pij表示第i行、第j列像素的颜色特征向量L的值;Among them, br is the row number of the initial seed, bc is its column number, and their initial value is 0; k and s respectively represent the row number and column number of the pixel in the lower right corner of the newly obtained square area; P ij represents the i-th The value of the color feature vector L of the pixel in row and column j;

再将Dif与阈值Thred相比较,直至Dif>Thred即该区域中存在颜色信息突变时,本次搜索结束,将刚搜索过的区域定义为一个块,将对该块的搜索定义为一个块搜索;Then compare Dif with the threshold Thred until Dif > Thred, that is, when there is a sudden change in color information in this area, this search ends, define the area just searched as a block, and define the search for this block as a block search ;

3)以2)为基础对图像进行多方位、多尺寸的方向搜索,搜索分4次进行,分别为最大行距横向搜索、最小行距横向搜索、最大列距竖向搜索及最小列距竖向搜索;3) On the basis of 2), the image is searched in multiple directions and in multiple sizes. The search is carried out in 4 times, namely horizontal search with maximum row spacing, horizontal search with minimum row spacing, vertical search with maximum column spacing, and vertical search with minimum column spacing. ;

横向搜索:Lateral search:

a1、重新定义2)中得到的块的右上角点的像素P1(i,j)为新的初始种子点;a1. Redefining the pixel P 1 (i, j) of the upper right corner point of the block obtained in 2) as a new initial seed point;

b1、以新定义的初始种子点为起点,分别向下、向右扩展一行、一列像素,得到一正方形区域,计算该正方形区域的颜色均值,然后计算其与新的初始种子点颜色值的差值Dif,将Dif与阈值Thred相比较,若Dif>Thred则表示该区域中存在颜色信息突变;否则,仍以新定义的初始种子点为初始种子点,以刚搜索完的区域为基础,再向外扩展一行、一列像素,得到一新的正方形区域,计算该区域的颜色均值,然后计算其与未扩展前正方形区域的颜色均值的差值Dif,直至Dif>Thred即该区域中存在颜色信息突变时,本次搜索结束;b1. Starting from the newly defined initial seed point, expand one row and one column of pixels downward and to the right respectively to obtain a square area, calculate the color mean value of the square area, and then calculate the difference between it and the color value of the new initial seed point value Dif, compare Dif with the threshold Thred, if Dif>Thred, it means that there is a color information mutation in this area; otherwise, the newly defined initial seed point is still used as the initial seed point, based on the area just searched, and then Expand one row and one column of pixels outward to get a new square area, calculate the color mean value of this area, and then calculate the difference Dif between it and the color mean value of the square area before the expansion, until Dif>Thred, that is, there is color information in this area When the mutation occurs, the search ends;

c1、重新定义b1中得到的块的右上角点的像素P1(i,j)为新的初始种子点;c1, redefining the pixel P 1 (i, j) of the upper right corner point of the block obtained in b1 as a new initial seed point;

d1、重复过程b1、c1,直至新定义的初始种子点超越图像的右边界,本次横向搜索结束,找出本次横向搜索过程中尺寸最大的像素块和尺寸最小的像素块,分别以它们的尺寸作为本次横向搜索的行间距,得到最大行距搜索区域和最小行距搜索区域;d1. Repeat the process b1 and c1 until the newly defined initial seed point exceeds the right boundary of the image. This horizontal search ends. Find out the pixel block with the largest size and the pixel block with the smallest size in this horizontal search process, and use them respectively The size of is used as the line spacing of this horizontal search, and the maximum line spacing search area and the minimum line spacing search area are obtained;

e1、将得到的最大行距搜索区域和最小行距搜索区域的左下角分别作为下次横向搜索的初始种子点,按照b1至d1的步骤分别开始下次的横向搜索,得到新的最大行距搜索区域和最小行距搜索区域,如此往复,直至新定义的初始种子点超越图像的下边界,横向搜索结束;e1. Use the lower left corners of the obtained maximum line-spacing search area and the minimum line-spacing search area as the initial seed points for the next horizontal search, respectively start the next horizontal search according to the steps b1 to d1, and obtain a new maximum line-spacing search area and The minimum line spacing search area, and so on, until the newly defined initial seed point exceeds the lower boundary of the image, and the horizontal search ends;

在搜索的过程中,最大行距搜索和最小行距搜索是分别独立进行的,以M表示经过最大行距搜索和最小行距搜索后得到的总的行搜索区域的数目;在搜索的过程中,每次新搜索的开始都是以刚得到的分割后区域的左下角像素作为初始种子点;In the process of searching, the maximum line spacing search and the minimum line spacing search are carried out independently, and M represents the number of the total line search area obtained after the maximum line spacing search and the minimum line spacing search; in the process of searching, each new At the beginning of the search, the pixel in the lower left corner of the segmented area just obtained is used as the initial seed point;

纵向搜索:Vertical search:

a2、重新定义2)中得到的块的左下角点的像素P11(i,j)为新的初始种子点;a2. Redefining the pixel P 11 (i, j) of the lower left corner point of the block obtained in 2) as a new initial seed point;

b2、以新定义的初始种子点为起点,分别向下、向右扩展一行、一列像素,得到一正方形区域,计算该正方形区域的颜色均值,然后计算其与新的初始种子点颜色值的差值Dif,将Dif与阈值Thred相比较,若Dif>Thred则表示该区域中存在颜色信息突变;否则,仍以新定义的初始种子点为初始种子点,以刚搜索完的区域为基础,再分别向下、向右扩展一行、一列像素,得到一新的正方形区域,计算该区域的颜色均值,然后计算其与扩展前正方形区域的颜色均值的差值Dif,直至Dif>Thred即该区域中存在颜色信息突变时,本次搜索结束;b2. Starting from the newly defined initial seed point, expand one row and one column of pixels downward and to the right respectively to obtain a square area, calculate the color mean value of the square area, and then calculate the difference between it and the color value of the new initial seed point value Dif, compare Dif with the threshold Thred, if Dif>Thred, it means that there is a color information mutation in this area; otherwise, the newly defined initial seed point is still used as the initial seed point, based on the area just searched, and then Expand one row and one column of pixels downward and rightward respectively to obtain a new square area, calculate the color mean value of this area, and then calculate the difference Dif between it and the color mean value of the square area before expansion, until Dif>Thred, that is, in the area When there is a sudden change in color information, the search ends;

c2、重新定义b2中得到的块的左下角点的像素P1(i,j)为新的初始种子点;c2, redefining the pixel P 1 (i, j) of the lower left corner point of the block obtained in b2 as a new initial seed point;

d2、重复b2、c2的过程,直至新定义的初始种子点超越图像的下边界,本次纵向搜索结束,找出本次纵向搜索过程中尺寸最大的像素块和尺寸最小的像素块,分别以它们的尺寸作为本次纵向搜索的列间距,得到最大列距搜索区域和最小列距搜索区域;d2. Repeat the process of b2 and c2 until the newly defined initial seed point exceeds the lower boundary of the image. This vertical search ends. Find out the pixel block with the largest size and the pixel block with the smallest size in this vertical search process. Their sizes are used as the column spacing of this vertical search, and the maximum column spacing search area and the minimum column spacing search area are obtained;

e2、将得到的最大列距搜索区域和最小列距搜索区域的右上角的像素分别作为下次搜索的初始种子点,按照b2至d2的步骤,分别开始下次的纵向搜索,如此往复,直至新定义的初始种子点超越图像的右边界,列搜索结束;e2. Use the pixels in the upper right corner of the search area with the maximum column distance and the search area with the minimum column distance as the initial seed points for the next search, and start the next vertical search according to the steps from b2 to d2, and so on, until The newly defined initial seed point exceeds the right boundary of the image, and the column search ends;

在搜索的过程中,最大列距搜索和最小列距搜索是分别独立进行的,以N表示经过最大列距搜索和最小列距搜索后得到的总的列搜索区域的数目;在搜索的过程中,每次新搜索的开始都是以刚得到的分割后区域的右上角像素作为初始种子点;During the search process, the maximum column distance search and the minimum column distance search are carried out independently, and N represents the number of the total column search area obtained after the maximum column distance search and the minimum column distance search; during the search process , the beginning of each new search is to use the upper right corner pixel of the segmented area just obtained as the initial seed point;

4)经过2)和3),任意一幅图像Sample在空间上被分割成M×N个子块,对分割结果进行区域合并,合并分别在垂直和水平方向上进行:4) After 2) and 3), any image Sample is spatially divided into M×N sub-blocks, and the segmentation results are merged, and the merge is performed in the vertical and horizontal directions respectively:

垂直方向的合并:Merge vertically:

根据公式(5)循环计算相邻的两个行搜索区域的区域距离,得到M-1个区域距离Dis,即:从第一个区域开始,计算第一个区域与第二个区域的区域距离、第二个区域与第三个区域的区域距离、第三个区域与第四个区域的区域距离,如此往复,直至计算出第M-1个区域与第M个区域的区域距离;According to the formula (5), the area distance between two adjacent row search areas is cyclically calculated, and M-1 area distances Dis are obtained, that is, starting from the first area, calculate the area distance between the first area and the second area , the area distance between the second area and the third area, the area distance between the third area and the fourth area, and so on, until the area distance between the M-1th area and the Mth area is calculated;

Disdis == nno ii ×× nno jj nno ii ++ nno jj ×× || argarg ii -- argarg jj || -- -- -- (( 55 ))

式中,argi,argj分别表示两个区域的颜色均值,ni,nj分别表示两个区域的总像素数;In the formula, arg i and arg j represent the color mean values of the two regions respectively, and n i and n j represent the total number of pixels in the two regions respectively;

从M-1个计算结果中选取最小值,并将该最小值对应的两个行区域合并,从而得到M-1个合并后的区域;对新得到的所有行区域再次循环计算新合并后的相邻行区域的区域距离Dis,从计算结果中选取新的最小值,并将该新的最小值对应的两个行区域合并,从而进一步得到M-2个行区域;如此往复,直到图像在垂直方向上被划分为3个区域;Select the minimum value from the M-1 calculation results, and merge the two row areas corresponding to the minimum value, so as to obtain M-1 merged areas; recycle and calculate the new merged area for all the newly obtained row areas The area distance Dis of the adjacent line area, select a new minimum value from the calculation result, and merge the two line areas corresponding to the new minimum value, so as to further obtain M-2 line areas; and so on, until the image is in It is divided into 3 areas in the vertical direction;

水平列方向的合并:Merge in the horizontal column direction:

根据公式(5)循环计算相邻的两个列搜索区域的区域距离,得到N-1个区域距离Dis,即:从第一个区域开始,计算第一个区域与第二个区域的区域距离、第二个区域与第三个区域的区域距离、第三个区域与第四个区域的区域距离,如此往复,直至计算出第N-1个区域与第N个区域的区域距离;从N-1个计算结果中选取最小值,并将该最小值对应的两个列区域合并,从而得到N-1个合并后的区域;对新得到的所有列区域再次循环计算新合并后的相邻列区域的区域距离Dis,从计算结果中选取新的最小值,并将该新的最小值对应的两个列区域合并,从而进一步得到N-2个列区域;如此往复,直到图像在水平方向上被划分为3个区域;According to the formula (5), the area distance of two adjacent column search areas is cyclically calculated to obtain N-1 area distances Dis, that is, starting from the first area, calculate the area distance between the first area and the second area , the area distance between the second area and the third area, the area distance between the third area and the fourth area, and so on, until the area distance between the N-1th area and the Nth area is calculated; from N Select the minimum value from -1 calculation results, and merge the two column areas corresponding to the minimum value, so as to obtain N-1 merged areas; recycle and calculate the newly merged adjacent areas for all the newly obtained column areas The area distance Dis of the column area, select a new minimum value from the calculation result, and merge the two column areas corresponding to the new minimum value, so as to further obtain N-2 column areas; and so on, until the image is in the horizontal direction is divided into 3 areas;

经过垂直方向的合并与水平方向的合并后,整个图像被划分为3×3子块;After vertical merging and horizontal merging, the entire image is divided into 3×3 sub-blocks;

5)分别抽取图像各个子块的HSV颜色直方图His={pt|0≤t<72}、分块主色Mc(c=1,2,3)以及中心矩σ,其中,分块主色Mc表示区域颜色概率值位于前三位最大值的三种颜色;区域的中心矩σ定义如下:5) Extract the HSV color histogram His={p t |0≤t<72}, block main color M c (c=1, 2, 3) and central moment σ of each sub-block of the image respectively, where block The main color M c represents the three colors whose color probability value of the area is at the top three maximum values; the central moment σ of the area is defined as follows:

&sigma;&sigma; == 11 nno &Sigma;&Sigma; qq == 00 nno -- 11 (( PP qq -- arvarv )) 22 -- -- -- (( 66 ))

式中,Pq表示该区域内某一点像素的颜色值,n表示该区域内的像素的总数,arv表示该区域内所有像素的颜色的平均值;In the formula, P q represents the color value of a certain point pixel in this area, n represents the total number of pixels in this area, and arv represents the average value of the colors of all pixels in this area;

6)由用户从9个子块中任意选取一块感兴趣区域A,设其颜色直方图为HisA={pt|0≤t<72},分块主色为MAc(c=1,2,3),中心矩为σA6) The user randomly selects an area of interest A from 9 sub-blocks, and sets its color histogram as His A = {p t |0≤t<72}, and the main color of the block as M Ac (c=1, 2 , 3), the central moment is σ A ;

7)从待检索的图像数据库中任取某一幅图像S,设其9个分割区域中的任意一个为B,其颜色直方图为HisB={pt|0≤t<72},分块主色为MBc(c=1,2,3),中心矩为σB,根据下式计算A与B的相似距离D(A,B),7) Randomly select an image S from the image database to be retrieved, set any one of its nine segmented regions as B, and its color histogram is His B ={p t |0≤t<72}, divide The main color of the block is M Bc (c=1, 2, 3), the central moment is σ B , and the similarity distance D(A, B) between A and B is calculated according to the following formula,

DD. (( AA ,, BB )) == 11 (( &sigma;&sigma; AA -- &sigma;&sigma; BB )) 22 &times;&times; WHisW His -- -- -- (( 77 ))

其中,in,

WHisW His == &Sigma;&Sigma; cc == 11 cc == 33 WW cc &times;&times; minmin (( AA tt == Mm AcAc ,, BB tt == Mm AcAc )) ++ &Sigma;&Sigma; tt == 00 ,, tt &NotEqual;&NotEqual; Mm AA 11 ,, Mm AA 22 ,, Mm AA 33 tt == 7171 minmin (( AA tt ,, BB tt )) WW 11 ++ WW 22 ++ WW 33 -- -- -- (( 88 ))

公式(8)表示以直方图交叉距离为依据,对感兴趣区的分块主色进行加权;Formula (8) represents that the main color of the block of the region of interest is weighted based on the histogram intersection distance;

在分子中,At,Bt分别表示A与B的72维颜色直方图中某一种颜色t的颜色分布概率值,min(At,Bt)表示将A与B的72个颜色概率值全部进行对应求最小值处理, min ( A t = M Ac , B t = M Ac ) 表示与A的三个分块主色值相等的3个颜色值所求得的最小值,在此基础上,用Wc进行加权,权值分别为W1=2.5,W2=2,W3=1.5,即如公式(8)中分子的前半部分所示;而对于A与B的72维颜色直方图中与A的三个分块主色值不相等的69个颜色值在进行对应求最小值处理后,对所得的最小值进行累加求和,而不进行加权,即如公式(8)中分子的后半部分所示;In the molecule, A t and B t respectively represent the color distribution probability value of a certain color t in the 72-dimensional color histogram of A and B, and min(A t , B t ) represents the 72 color probabilities of A and B All values are processed corresponding to the minimum value, min ( A t = m Ac , B t = m Ac ) Indicates the minimum value obtained from the three color values equal to the main color values of the three blocks of A. On this basis, W c is used for weighting, and the weight values are respectively W 1 =2.5, W 2 =2, W3 =1.5, as shown in the first half of the molecule in the formula (8); and for the 69 color values that are not equal to the three block main color values of A in the 72-dimensional color histogram of A and B, the corresponding calculation is carried out After the minimum value is processed, the minimum value obtained is accumulated and summed without weighting, as shown in the second half of the numerator in formula (8);

8)循环计算图象S的9个区域与样例图像Sample的感兴趣区A的相似距离,取相似距离最大区域的相似距离作为S与Sample的距离;8) cyclically calculate the similarity distance between 9 regions of the image S and the region of interest A of the sample image Sample, and take the similarity distance of the region with the largest similarity distance as the distance between S and Sample;

9)按照7)至8)计算数据库中所有图像与Sample的相似距离;9) according to 7) to 8) calculate the similarity distance of all images in the database and Sample;

10)将所有相似距离按从大到小排序,返回检索结果。10) Sort all similar distances in descending order, and return the search results.

本发明的原理为:通过对实际情况的考察,发现用户对一幅图像的关注点一般集中在图像的目标物体上,因此对检索效果的评价也以其是否更好地体现出目标物体为准。基于这个原因,可以考虑首先对图像进行处理,将目标物体从背景中划分出来,然后在此基础上基于用户的感兴趣区进行图像检索。The principle of the present invention is: through the investigation of the actual situation, it is found that the user's attention to an image is generally concentrated on the target object of the image, so the evaluation of the retrieval effect is also based on whether it better reflects the target object . For this reason, it can be considered to first process the image to separate the target object from the background, and then perform image retrieval based on the user's interest area on this basis.

在进行图像处理的过程中,通过观察发现,对于一般的图像,其目标物体边缘的局部小区域内往往对应着颜色信息的突变,通过探测这些信息的突变可以将图像的目标物体与背景分割开。本发明中,基于这一原理对图像进行图像分割,然后基于区域对图像进行特征的提取。不仅如此,本发明在特征提取和相似性度量因子的制定上都充分考虑了图像的颜色和空间信息,把图像的综合特征运用于图像的检索过程中。实验结果表明,该方法能有效的利用图像的颜色和空间特征,检索结果与人类认知具有良好的一致性。In the process of image processing, it is found through observation that for general images, the local small area on the edge of the target object often corresponds to a sudden change in color information. By detecting the sudden change of these information, the target object of the image can be separated from the background. In the present invention, the image is segmented based on this principle, and then the features of the image are extracted based on the region. Moreover, the present invention fully considers the color and space information of the image in the feature extraction and the formulation of the similarity measurement factor, and uses the comprehensive feature of the image in the image retrieval process. Experimental results show that the method can effectively use the color and space features of the image, and the retrieval results have a good consistency with human cognition.

附图说明 Description of drawings

图1是图像块搜索示意图;图中1:原像素块;2:拓展像素块;Figure 1 is a schematic diagram of image block search; in the figure 1: original pixel block; 2: expanded pixel block;

图2是图像最大行距横向搜索示意图(其它三种搜索方式同理);图中3:经过一次最大行距横向搜索后得到的分割区域;4:经过第二次最大行距横向搜索后得到的分割区域;5:经过第三次最大行距横向搜索后得到的分割区域;图3(a)是图像经过初始分割后的分割结果示意图;(b)是区域合并后的分割结果示意图;Figure 2 is a schematic diagram of the maximum line spacing horizontal search of the image (the other three search methods are the same); in the figure 3: the segmentation area obtained after a maximum line spacing horizontal search; 4: the segmentation area obtained after the second maximum line spacing horizontal search ; 5: the segmented region obtained after the third maximum line spacing horizontal search; Fig. 3 (a) is a schematic diagram of the segmentation result after the initial segmentation of the image; (b) is a schematic diagram of the segmentation result after the region is merged;

图4是本发明采用的最大行距横向搜索的分割方法的流程图(其它三种方式同理);Fig. 4 is the flow chart of the segmentation method of the maximum line spacing lateral search that the present invention adopts (other three modes are the same);

图5是本发明采用的整个图像检索方法的流程图;Fig. 5 is the flowchart of the whole image retrieval method that the present invention adopts;

图6是用户上传的样例图像sample;Figure 6 is a sample image sample uploaded by users;

图7(a)(b)(c)(d)分别是sample经过最大行距横向分割、最小行距横向分割、最大列距竖向分割以及最小列距竖向分割后得到的分割结果;Figure 7(a)(b)(c)(d) are the segmentation results of the sample after the horizontal segmentation of the maximum row spacing, the horizontal segmentation of the minimum row spacing, the vertical segmentation of the maximum column spacing, and the vertical segmentation of the minimum column spacing;

图8(a)是sample经过图像的初始分割后得到的分割结果;(b)是初始分割结果再经过区域合并后得到的最终的图像分割结果;Figure 8(a) is the segmentation result obtained after the initial image segmentation of the sample; (b) is the final image segmentation result obtained after the initial segmentation result is combined with regions;

图9是用户从sample的9个分割区域中选取的感兴趣区域;Figure 9 is the region of interest selected by the user from the 9 segmented regions of the sample;

图10是图像的检索结果;(a)为利用本发明提出的方法得到的检索结果;(b)为利用传统的基于全局颜色直方图的方法得到的检索结果。Fig. 10 is the retrieval result of the image; (a) is the retrieval result obtained by using the method proposed by the present invention; (b) is the retrieval result obtained by using the traditional method based on the global color histogram.

具体实施方式Detailed ways

在实际的使用当中,首先是由用户上传一幅样例图像sample(见图6)。具体实施中,在计算机中完成以下程序:In actual use, the user first uploads a sample image sample (see Figure 6). In the specific implementation, the following procedures are completed in the computer:

第一步:读入用户上传的样例图像。Step 1: Read in the sample image uploaded by the user.

第二步:将原始图像的颜色数据从RBG空间转换到HSV空间,并从其中提取L分量作为像素颜色值。The second step: convert the color data of the original image from RBG space to HSV space, and extract the L component from it as the pixel color value.

第三步:对图像分别进行最大行距横向分割(见图7(a))、最小行距横向分割(见图7(b))、最大列距竖向分割(见图7(c))以及最小列距竖向分割(见图7(d))。Step 3: Carry out horizontal segmentation of the maximum row spacing (see Figure 7(a)), horizontal segmentation of the minimum row spacing (see Figure 7(b)), vertical segmentation of the maximum column spacing (see Figure 7(c)) and minimum Column spacing is divided vertically (see Figure 7(d)).

第四步:根据初始分割结果(见图8(a))在垂直与水平方向分别进行图像合并,直到图像被划分成3×3区域(见图8(b))。Step 4: According to the initial segmentation results (see Figure 8(a)), the images are merged in the vertical and horizontal directions until the image is divided into 3×3 regions (see Figure 8(b)).

第五步:由用户从这9个区域中选取某一感兴趣区域A(见图9)。Step 5: The user selects a region A of interest from the nine regions (see FIG. 9 ).

第六步:读入用户选取的感兴趣区A,提取其HSV颜色直方图、分块主色以及中心矩。Step 6: Read in the region of interest A selected by the user, and extract its HSV color histogram, main color of the block, and central moment.

第七步:按顺序取出图像数据库中的图像。Step 7: Take out the images in the image database in order.

第八步:将库中图像的9个区域分别与感兴趣区域A进行相似性的度量,并将其中的最大值作为该图像与样例图像的相似距离。Step 8: Measure the similarity between the 9 regions of the image in the library and the region of interest A, and use the maximum value as the similarity distance between the image and the sample image.

第九步:依次计算图像数据库中所有图像与样例图像的相似距离,并按相似距离从大到小将数据库中图像排序,作为最终的检索结果返回给用户。Step 9: Calculate the similarity distances between all the images in the image database and the sample images in sequence, sort the images in the database from large to small according to the similar distances, and return them to the user as the final retrieval results.

为了验证本发明所提出的方法的性能,在一个由1000余幅各类古建筑风景图像组成的图像数据库上进行了大量试验,并将检索效果与一些经典算法进行了比较。这些图像的背景细节均较丰富,并且多存在目标物体与背景物体相互遮挡的情况。同时,为了增加实验的客观性,首先将这1000余幅图像根据其表现内容不同手工划分为不同的类别,包含:碑、塔、殿等。在比较中,主要从实际检索结果、检索准确度两个方面比较。实验条件如下:主机为P4 2.4 CPU,512M内存,编码采用JAVA语言,JDK1.4。检索结果如图10所示((a)为利用本发明提出的方法得到的检索结果;(b)为利用传统的基于全局颜色直方图的方法得到的检索结果),检索准确度如表1。In order to verify the performance of the method proposed by the present invention, a large number of experiments were carried out on an image database composed of more than 1000 various kinds of ancient building landscape images, and the retrieval effect was compared with some classical algorithms. The background details of these images are rich, and there are often cases where the target object and the background object occlude each other. At the same time, in order to increase the objectivity of the experiment, the more than 1,000 images were first manually divided into different categories according to their different content, including: steles, towers, halls, etc. In the comparison, it mainly compares from two aspects of actual retrieval results and retrieval accuracy. The experimental conditions are as follows: the host is P4 2.4 CPU, 512M memory, the code adopts JAVA language, JDK1.4. The retrieval results are shown in Figure 10 ((a) is the retrieval result obtained by using the method proposed by the present invention; (b) is the retrieval result obtained by using the traditional method based on global color histogram), and the retrieval accuracy is shown in Table 1.

从图10中可看出,对于感兴趣区域面积较小的图像,本发明的方法的检索效果要明显优于传统的基于全局颜色直方图的方法的检索效果。本发明中提出的图像自动分割算法通过对图像预处理,可以较精确的将图像中的目标物体与背景分割开,并通过提取相应的直方图、主色等特征对其进行标记。又由于在检索中对分块主色进行了加权,且通过遍历性匹配方式增加了方法的鲁棒性,因此,检索结果与样例图像的语义相关性很好。从表1可看出,本发明所提出的方法在检索的准确度上明显优于传统方法。It can be seen from FIG. 10 that for images with a small area of interest, the retrieval effect of the method of the present invention is significantly better than that of the traditional global color histogram-based method. The image automatic segmentation algorithm proposed in the present invention can more accurately separate the target object in the image from the background by preprocessing the image, and mark it by extracting the corresponding histogram, main color and other features. And because the main color of the block is weighted in the retrieval, and the robustness of the method is increased through the ergodic matching method, the semantic correlation between the retrieval result and the sample image is very good. It can be seen from Table 1 that the method proposed by the present invention is obviously superior to the traditional method in retrieval accuracy.

从实验结果中可以看出,本发明的方法与传统经典方法比较,整体检索效果最优,证明了本发明的有效性。It can be seen from the experimental results that compared with the traditional classic method, the method of the present invention has the best overall retrieval effect, which proves the effectiveness of the present invention.

表1、检索准确度比较Table 1. Comparison of retrieval accuracy

  图像类别 image category   全局颜色直方图法 Global color histogram method 固定分块颜色直方图法 Fixed block color histogram method 本发明提出的方法 The method proposed by the present invention     殿 Temple     71.1% 71.1%     69.2% 69.2%     83.6% 83.6%     寺庙 temple     72.6% 72.6%     75.3% 75.3%     82.8% 82.8%     河湖 Rivers and lakes     89.4% 89.4%     88.5% 88.5%     92.1% 92.1%     树木 trees     85.3% 85.3%     87.6% 87.6%     88.2% 88.2%

Claims (1)

1.一种基于信息突变的图像检索方法,其特征在于,包括下述步骤:1. an image retrieval method based on information mutation, is characterized in that, comprises the following steps: 1)读入用户从外接数码相机中上传的或者读入计算机里储存的样例图像Sample,将其从RBG转换到HSV颜色空间,并将其中的色调H、饱和度S、亮度V三个分量按照公式(1)计算得到归一化分量L后,将L作为像素的颜色值;1) Read in the sample image Sample uploaded by the user from an external digital camera or stored in the computer, convert it from RBG to HSV color space, and convert the three components of hue H, saturation S, and brightness V After calculating the normalized component L according to the formula (1), use L as the color value of the pixel; L=16H+4S+V                           (1)L=16H+4S+V (1) 2)将图像左上角的像素P0(0,0)作为初始种子点,分别向下、向右扩展一行、一列像素,得到一正方形区域,计算该正方形区域内所有像素的颜色值的平均值,然后计算其与初始种子点颜色值的差值Dif,将Dif与阈值Thred=8相比较,若Dif>Thred则表示该区域中存在颜色信息突变;否则,仍以图像左上角的像素P0(0,0)为初始种子点,以刚搜索完的区域为基础,再分别向下、向右扩展一行、一列像素,得到一新的正方形区域,计算该区域的颜色均值arg(new),然后计算其与扩展前正方形区域的颜色均值arg(origin)的差值Dif,如(2)式所示:2) Take the pixel P 0 (0, 0) in the upper left corner of the image as the initial seed point, expand one row and one column of pixels downward and rightward respectively to obtain a square area, and calculate the average value of the color values of all pixels in the square area , and then calculate the difference Dif between it and the color value of the initial seed point, compare Dif with the threshold Thred=8, if Dif>Thred, it means that there is a sudden change in color information in this area; otherwise, the pixel P 0 in the upper left corner of the image is still used (0, 0) is the initial seed point, based on the area just searched, and then expand one row and one column of pixels downward and to the right respectively to obtain a new square area, and calculate the color mean value arg(new) of this area, Then calculate the difference Dif between it and the color mean arg(origin) of the square area before expansion, as shown in formula (2): Dif=arg(origin)-arg(new)              (2)Dif=arg(origin)-arg(new) (2) 式中:In the formula: argarg (( originorigin )) == 11 (( kk -- 11 -- brbr )) (( sthe s -- 11 -- bcbc )) &Sigma;&Sigma; ii == brbr ii == kk -- 11 &Sigma;&Sigma; jj == bcbc jj == sthe s -- 11 PP ijij (3)(3) argarg (( newnew )) == 11 (( kk -- brbr )) (( sthe s -- bcbc )) &Sigma;&Sigma; ii == brbr ii == kk &Sigma;&Sigma; jj == bcbc jj == sthe s PP ijij (4)(4) 其中,br是初始种子的行号、bc是其列号,它们的初始值都为0;k和s分别代表新得到的正方形区域的右下角像素的行号、列号;Pij表示第i行、第j列像素的颜色特征向量L的值,Among them, br is the row number of the initial seed, bc is its column number, and their initial value is 0; k and s respectively represent the row number and column number of the pixel in the lower right corner of the newly obtained square area; P ij represents the i-th The value of the color feature vector L of the pixel in row and column j, 再将Dif与阈值Thred相比较,直至Dif>Thred即该区域中存在颜色信息突变时,本次搜索结束,将刚搜索过的区域定义为一个块,将对该块的搜索定义为一个块搜索;Then compare Dif with the threshold Thred until Dif > Thred, that is, when there is a sudden change in color information in this area, this search ends, define the area just searched as a block, and define the search for this block as a block search ; 3)以2)为基础对图像进行多方位、多尺寸的方向搜索,搜索分4次进行,分别为最大行距横向搜索、最小行距横向搜索、最大列距竖向搜索及最小列距竖向搜索;3) On the basis of 2), the image is searched in multiple directions and in multiple sizes. The search is carried out in 4 times, namely horizontal search with maximum row spacing, horizontal search with minimum row spacing, vertical search with maximum column spacing, and vertical search with minimum column spacing. ; 横向搜索:Lateral search: a1、重新定义2)中得到的块的右上角点的像素P1(i,j)为新的初始种子点;a1. Redefining the pixel P 1 (i, j) of the upper right corner point of the block obtained in 2) as a new initial seed point; b1、以新定义的初始种子点为起点,分别向下、向右扩展一行、一列像素,得到一正方形区域,计算该正方形区域的颜色均值,然后计算其与新的初始种子点颜色值的差值Dif,将Dif与阈值Thred相比较,若Dif>Thred则表示该区域中存在颜色信息突变;否则,仍以新定义的初始种子点为初始种子点,以刚搜索完的区域为基础,再向外扩展一行、一列像素,得到一新的正方形区域,计算该区域的颜色均值,然后计算其与未扩展前正方形区域的颜色均值的差值Dif,直至Dif>Thred即该区域中存在颜色信息突变时,本次搜索结束;b1. Starting from the newly defined initial seed point, expand one row and one column of pixels downward and to the right respectively to obtain a square area, calculate the color mean value of the square area, and then calculate the difference between it and the color value of the new initial seed point value Dif, compare Dif with the threshold Thred, if Dif>Thred, it means that there is a color information mutation in this area; otherwise, the newly defined initial seed point is still used as the initial seed point, based on the area just searched, and then Expand one row and one column of pixels outward to obtain a new square area, calculate the color mean value of this area, and then calculate the difference Dif between it and the color mean value of the square area before the expansion, until Dif>Thred, that is, there is color information in this area When the mutation occurs, the search ends; c1、重新定义b1中得到的块的右上角点的像素P1(i,j)为新的初始种子点;c1, redefining the pixel P 1 (i, j) of the upper right corner point of the block obtained in b1 as a new initial seed point; d1、重复过程b1、c1,直至新定义的初始种子点超越图像的右边界,本次横向搜索结束,找出本次横向搜索过程中尺寸最大的像素块和尺寸最小的像素块,分别以它们的尺寸作为本次横向搜索的行间距,得到最大行距搜索区域和最小行距搜索区域;d1. Repeat the process b1 and c1 until the newly defined initial seed point exceeds the right boundary of the image. This horizontal search ends. Find out the pixel block with the largest size and the pixel block with the smallest size in this horizontal search process, and use them respectively The size of is used as the line spacing of this horizontal search, and the maximum line spacing search area and the minimum line spacing search area are obtained; e1、将得到的最大行距搜索区域和最小行距搜索区域的左下角分别作为下次横向搜索的初始种子点,按照b1至d1的步骤分别开始下次的横向搜索,得到新的最大行距搜索区域和最小行距搜索区域,如此往复,直至新定义的初始种子点超越图像的下边界,横向搜索结束;e1. Use the lower left corners of the obtained maximum line-spacing search area and the minimum line-spacing search area as the initial seed points for the next horizontal search, respectively start the next horizontal search according to the steps b1 to d1, and obtain a new maximum line-spacing search area and The minimum line spacing search area, and so on, until the newly defined initial seed point exceeds the lower boundary of the image, and the horizontal search ends; 在搜索的过程中,最大行距搜索和最小行距搜索是分别独立进行的,以M表示经过最大行距搜索和最小行距搜索后得到的总的行搜索区域的数目;在搜索的过程中,每次新搜索的开始都是以刚得到的分割后区域的左下角像素作为初始种子点;In the process of searching, the maximum line spacing search and the minimum line spacing search are carried out independently, and M represents the number of the total line search area obtained after the maximum line spacing search and the minimum line spacing search; in the process of searching, each new At the beginning of the search, the pixel in the lower left corner of the segmented area just obtained is used as the initial seed point; 纵向搜索:Vertical search: a2、重新定义2)中得到的块的左下角点的像素P11(i,j)为新的初始种子点;a2. Redefining the pixel P 11 (i, j) of the lower left corner point of the block obtained in 2) as a new initial seed point; b2、以新定义的初始种子点为起点,分别向下、向右扩展一行、一列像素,得到一正方形区域,计算该正方形区域的颜色均值,然后计算其与新的初始种子点颜色值的差值Dif,将Dif与阈值Thred相比较,若Dif>Thred则表示该区域中存在颜色信息突变;否则,仍以新定义的初始种子点为初始种子点,以刚搜索完的区域为基础,再分别向下、向右扩展一行、一列像素,得到一新的正方形区域,计算该区域的颜色均值,然后计算其与扩展前正方形区域的颜色均值的差值Dif,直至Dif>Thred即该区域中存在颜色信息突变时,本次搜索结束;b2. Starting from the newly defined initial seed point, expand one row and one column of pixels downward and to the right respectively to obtain a square area, calculate the color mean value of the square area, and then calculate the difference between it and the color value of the new initial seed point value Dif, compare Dif with the threshold Thred, if Dif>Thred, it means that there is a color information mutation in this area; otherwise, the newly defined initial seed point is still used as the initial seed point, based on the area just searched, and then Expand one row and one column of pixels downward and rightward respectively to obtain a new square area, calculate the color mean value of this area, and then calculate the difference Dif between it and the color mean value of the square area before expansion, until Dif>Thred, that is, in the area When there is a sudden change in color information, the search ends; c2、重新定义b2中得到的块的左下角点的像素P1(i,j)为新的初始种子点;c2, redefining the pixel P 1 (i, j) of the lower left corner point of the block obtained in b2 as a new initial seed point; d2、重复b2、c2的过程,直至新定义的初始种子点超越图像的下边界,本次纵向搜索结束,找出本次纵向搜索过程中尺寸最大的像素块和尺寸最小的像素块,分别以它们的尺寸作为本次纵向搜索的列间距,得到最大列距搜索区域和最小列距搜索区域;d2. Repeat the process of b2 and c2 until the newly defined initial seed point exceeds the lower boundary of the image. This vertical search ends. Find out the pixel block with the largest size and the pixel block with the smallest size in this vertical search process. Their sizes are used as the column spacing of this vertical search, and the maximum column spacing search area and the minimum column spacing search area are obtained; e2、将得到的最大列距搜索区域和最小列距搜索区域的右上角的像素分别作为下次搜索的初始种子点,按照b2至d2的步骤,分别开始下次的纵向搜索,如此往复,直至新定义的初始种子点超越图像的右边界,列搜索结束;e2. Use the pixels in the upper right corner of the search area with the maximum column distance and the search area with the minimum column distance as the initial seed points for the next search, and start the next vertical search according to the steps from b2 to d2, and so on, until The newly defined initial seed point exceeds the right boundary of the image, and the column search ends; 在搜索的过程中,最大列距搜索和最小列距搜索是分别独立进行的,以N表示经过最大列距搜索和最小列距搜索后得到的总的列搜索区域的数目;在搜索的过程中,每次新搜索的开始都是以刚得到的分割后区域的右上角像素作为初始种子点;During the search process, the maximum column distance search and the minimum column distance search are carried out independently, and N represents the number of the total column search area obtained after the maximum column distance search and the minimum column distance search; during the search process , the start of each new search is to use the upper right corner pixel of the segmented area just obtained as the initial seed point; 4)经过2)和3),任意一幅图像Sample在空间上被分割成M×N个子块,对分割结果进行区域合并,合并分别在垂直和水平方向上进行;4) After 2) and 3), any image Sample is spatially divided into M×N sub-blocks, and the segmentation results are merged, and the merge is carried out in the vertical and horizontal directions respectively; 垂直方向的合并:Merge vertically: 根据公式(5)循环计算相邻的两个行搜索区域的区域距离,得到M-1个区域距离Dis,即:从第一个区域开始,计算第一个区域与第二个区域的区域距离、第二个区域与第三个区域的区域距离、第三个区域与第四个区域的区域距离,如此往复,直至计算出第M-1个区域与第M个区域的区域距离;According to the formula (5), the area distance between two adjacent row search areas is cyclically calculated, and M-1 area distances Dis are obtained, that is, starting from the first area, calculate the area distance between the first area and the second area , the area distance between the second area and the third area, the area distance between the third area and the fourth area, and so on, until the area distance between the M-1th area and the Mth area is calculated; Disdis == nno ii &times;&times; nno jj nno ii ++ nno jj &times;&times; || argarg ii -- argarg jj || -- -- -- (( 55 )) 式中,argi,argj分别表示两个区域的颜色均值,ni,nj分别表示两个区域的总像素数;In the formula, arg i and arg j represent the color mean values of the two regions respectively, and n i and n j represent the total number of pixels in the two regions respectively; 从M-1个计算结果中选取最小值,并将该最小值对应的两个行区域合并,从而得到M-1个合并后的区域;对新得到的所有行区域再次循环计算新合并后的相邻行区域的区域距离Dis,从计算结果中选取新的最小值,并将该新的最小值对应的两个行区域合并,从而进一步得到M-2个行区域;如此往复,直到图像在垂直方向上被划分为3个区域;Select the minimum value from the M-1 calculation results, and merge the two row regions corresponding to the minimum value to obtain M-1 merged regions; recycle and calculate the new merged region for all the newly obtained row regions The area distance Dis of the adjacent line area, select a new minimum value from the calculation result, and merge the two line areas corresponding to the new minimum value, so as to further obtain M-2 line areas; and so on, until the image is in It is divided into 3 areas in the vertical direction; 水平列方向的合并:Merge in the horizontal column direction: 根据公式(5)循环计算相邻的两个列搜索区域的区域距离,得到N-1个区域距离Dis,即:从第一个区域开始,计算第一个区域与第二个区域的区域距离、第二个区域与第三个区域的区域距离、第三个区域与第四个区域的区域距离,如此往复,直至计算出第N-1个区域与第N个区域的区域距离;从N-1个计算结果中选取最小值,并将该最小值对应的两个列区域合并,从而得到N-1个合并后的区域;对新得到的所有列区域再次循环计算新合并后的相邻列区域的区域距离Dis,从计算结果中选取新的最小值,并将该新的最小值对应的两个列区域合并,从而进一步得到N-2个列区域;如此往复,直到图像在水平方向上被划分为3个区域;According to the formula (5), the area distance of two adjacent column search areas is cyclically calculated, and N-1 area distances Dis are obtained, that is, starting from the first area, calculate the area distance between the first area and the second area , the area distance between the second area and the third area, the area distance between the third area and the fourth area, and so on, until the area distance between the N-1th area and the Nth area is calculated; from N Select the minimum value from -1 calculation results, and merge the two column areas corresponding to the minimum value, so as to obtain N-1 merged areas; recycle and calculate the newly merged adjacent areas for all the newly obtained column areas The area distance Dis of the column area, select a new minimum value from the calculation result, and merge the two column areas corresponding to the new minimum value, so as to further obtain N-2 column areas; and so on, until the image is in the horizontal direction is divided into 3 areas; 经过垂直方向的合并与水平方向的合并后,整个图像被划分为3×3子块;After vertical merging and horizontal merging, the entire image is divided into 3×3 sub-blocks; 5)分别抽取图像各个子块的HSV颜色直方图His={pt|0≤t<72}、分块主色Mc,c=1,2,3,以及中心矩σ,其中,分块主色Mc表示区域颜色概率值位于前三位最大值的三种颜色;区域的中心矩σ定义如下:5) Extract the HSV color histogram His={p t |0≤t<72} of each sub-block of the image, the block main color M c , c=1, 2, 3, and the central moment σ, where, block The main color M c represents the three colors whose color probability value of the area is at the top three maximum values; the central moment σ of the area is defined as follows: &sigma;&sigma; == 11 nno &Sigma;&Sigma; qq == 00 nno -- 11 (( PP qq -- arvarv )) 22 -- -- -- (( 66 )) 式中,Pq表示该区域内某一点像素的颜色值,n表示该区域内的像素的总数,arv表示该区域内所有像素的颜色的平均值;In the formula, P q represents the color value of a certain point pixel in this area, n represents the total number of pixels in this area, and arv represents the average value of the colors of all pixels in this area; 6)由用户从9个子块中任意选取一块感兴趣区域A,设其颜色直方图为HisA={pt|0≤t<72},分块主色为MAc,c=1,2,3,中心矩为σA6) The user randomly selects an area of interest A from 9 sub-blocks, and sets its color histogram as His A ={p t |0≤t<72}, the main color of the block is M Ac , c=1,2 , 3, the central moment is σ A ; 7)从待检索的图像数据库中任取某一幅图像S,设其9个分割区域中的任意一个为B,其颜色直方图为HisB={pt|0≤t<72},分块主色为MBc,c=1,2,3,中心矩为σB,根据下式计算A与B的相似距离D(A,B),7) Randomly select an image S from the image database to be retrieved, set any one of its nine segmented regions as B, and its color histogram is His B ={p t |0≤t<72}, divide The main color of the block is M Bc , c=1, 2, 3, the central moment is σ B , and the similarity distance D(A, B) between A and B is calculated according to the following formula, DD. (( AA ,, BB )) == 11 (( &sigma;&sigma; AA -- &sigma;&sigma; BB )) 22 &times;&times; WHisW His -- -- -- (( 77 )) 其中,in, WHisW His == &Sigma;&Sigma; cc == 11 cc == 33 WW cc &times;&times; minmin (( AA tt == Mm AcAc ,, BB tt == Mm AcAc )) ++ &Sigma;&Sigma; tt == 00 ,, tt &NotEqual;&NotEqual; Mm AA 11 ,, Mm AA 22 ,, Mm AA 33 tt == 7171 minmin (( AA tt ,, BB tt )) WW 11 ++ WW 22 ++ WW 33 -- -- -- (( 88 )) 公式(8)表示以直方图交叉距离为依据,对感兴趣区的分块主色进行加权;Formula (8) represents that the main color of the block of the region of interest is weighted based on the histogram intersection distance; 在分子中,At,Bt分别表示A与B的72维颜色直方图中某一种颜色t的颜色分布概率值,min(At,Bt)表示将A与B的72个颜色概率值全部进行对应求最小值处理, min ( A t = M Ac , B t = M Ac ) 表示与A的三个分块主色值相等的3个颜色值所求得的最小值,在此基础上,用Wc进行加权,权值分别为W1=2.5,W2=2,W3=1.5,即如公式(8)中分子的前半部分所示;而对于A与B的72维颜色直方图中与A的三个分块主色值不相等的69个颜色值在进行对应求最小值处理后,对所得的最小值进行累加求和,而不进行加权,即如公式(8)中分子的后半部分所示;In the molecule, A t and B t respectively represent the color distribution probability value of a certain color t in the 72-dimensional color histogram of A and B, and min(A t , B t ) represents the 72 color probabilities of A and B All values are processed corresponding to the minimum value, min ( A t = m Ac , B t = m Ac ) Indicates the minimum value obtained from the three color values equal to the main color values of the three blocks of A. On this basis, W c is used for weighting, and the weight values are respectively W 1 =2.5, W 2 =2, W 3 =1.5, that is, as shown in the first half of the numerator in formula (8); and for the 69 color values that are not equal to the three block main color values of A in the 72-dimensional color histogram of A and B, corresponding After the minimum value processing, the minimum value obtained is accumulated and summed without weighting, as shown in the second half of the numerator in formula (8); 8)循环计算图象S的9个区域与样例图像Sample的感兴趣区A的相似距离,取相似距离最大区域的相似距离作为S与Sample的距离;8) cyclically calculate the similarity distance between 9 regions of the image S and the region of interest A of the sample image Sample, and take the similarity distance of the region with the largest similarity distance as the distance between S and Sample; 9)按照7)至8)计算数据库中所有图像与Sample的相似距离;9) According to 7) to 8), calculate the similar distance between all images in the database and Sample; 10)将所有相似距离按从大到小排序,返回检索结果。10) Sort all similar distances in descending order, and return the search results.
CNB200610113046XA 2006-09-08 2006-09-08 Image retrieval algorithm based on abrupt change of information Expired - Fee Related CN100433016C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB200610113046XA CN100433016C (en) 2006-09-08 2006-09-08 Image retrieval algorithm based on abrupt change of information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB200610113046XA CN100433016C (en) 2006-09-08 2006-09-08 Image retrieval algorithm based on abrupt change of information

Publications (2)

Publication Number Publication Date
CN1916906A CN1916906A (en) 2007-02-21
CN100433016C true CN100433016C (en) 2008-11-12

Family

ID=37737904

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB200610113046XA Expired - Fee Related CN100433016C (en) 2006-09-08 2006-09-08 Image retrieval algorithm based on abrupt change of information

Country Status (1)

Country Link
CN (1) CN100433016C (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101299268B (en) * 2008-07-01 2010-08-11 上海大学 Semantic object dividing method suitable for low depth image
JP5414673B2 (en) * 2008-07-07 2014-02-12 三菱電機株式会社 Vehicle running environment detection device
CN101655978B (en) * 2008-08-21 2012-11-28 英华达(上海)电子有限公司 Method and device for image analysis
CN101520894B (en) * 2009-02-18 2011-03-30 上海大学 Salient Object Extraction Method Based on Regional Saliency
CN102122389A (en) * 2010-01-12 2011-07-13 阿里巴巴集团控股有限公司 Method and device for judging image similarity
CN102376095B (en) * 2010-08-25 2014-01-01 北京中科亚创科技有限责任公司 Method and device for obtaining image closing area
CN101980247A (en) * 2010-10-21 2011-02-23 西北工业大学 Valueless Image Interpretation Method Based on Texture Spectrum Similarity in Massive Remote Sensing Images
US8553981B2 (en) * 2011-05-17 2013-10-08 Microsoft Corporation Gesture-based visual search
CN102509099B (en) * 2011-10-21 2013-02-27 清华大学深圳研究生院 Detection method for image salient region
CN102915521A (en) * 2012-08-30 2013-02-06 中兴通讯股份有限公司 Method and device for processing mobile terminal images
CN105160029B (en) * 2015-09-30 2019-04-16 努比亚技术有限公司 Image retrieving apparatus and method
CN108733679B (en) * 2017-04-14 2021-10-26 华为技术有限公司 Pedestrian retrieval method, device and system
CN111862100A (en) * 2020-06-29 2020-10-30 浪潮电子信息产业股份有限公司 An image segmentation method, device, equipment and storage medium
CN117152687B (en) * 2023-10-31 2024-01-26 中国通信建设第三工程局有限公司 Communication line state monitoring system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1207532A (en) * 1997-07-31 1999-02-10 三星电子株式会社 Device and method for retrieving image information in computer
WO2001013263A2 (en) * 1999-08-17 2001-02-22 Koninklijke Philips Electronics N.V. System and method for performing region-based image retrieval using color-based segmentation.
CN1365067A (en) * 2001-01-09 2002-08-21 三星电子株式会社 Image retrieval method based on color and image characteristic combination
WO2002077870A2 (en) * 2001-03-23 2002-10-03 Intel Corporation (A Delaware Corporation) Image retrieval using distance measure
WO2005086092A1 (en) * 2004-03-03 2005-09-15 Nec Corporation Image similarity calculation system, image search system, image similarity calculation method, and image similarity calculation program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1207532A (en) * 1997-07-31 1999-02-10 三星电子株式会社 Device and method for retrieving image information in computer
WO2001013263A2 (en) * 1999-08-17 2001-02-22 Koninklijke Philips Electronics N.V. System and method for performing region-based image retrieval using color-based segmentation.
CN1365067A (en) * 2001-01-09 2002-08-21 三星电子株式会社 Image retrieval method based on color and image characteristic combination
WO2002077870A2 (en) * 2001-03-23 2002-10-03 Intel Corporation (A Delaware Corporation) Image retrieval using distance measure
WO2005086092A1 (en) * 2004-03-03 2005-09-15 Nec Corporation Image similarity calculation system, image search system, image similarity calculation method, and image similarity calculation program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
文化遗产图像检索系统实现及关键技术研究. 贾克斌,高明珠,王妍,刘鹏宇.北京工业大学学报,第32卷第5期. 2006 *

Also Published As

Publication number Publication date
CN1916906A (en) 2007-02-21

Similar Documents

Publication Publication Date Title
CN100433016C (en) Image retrieval algorithm based on abrupt change of information
CN107679250B (en) A Multi-task Hierarchical Image Retrieval Method Based on Deep Autoencoder Convolutional Neural Networks
Feng et al. Global correlation descriptor: a novel image representation for image retrieval
CN101551823B (en) Comprehensive multi-feature image retrieval method
CN103049446B (en) A kind of image search method and device
CN103761295B (en) Automatic picture classification based customized feature extraction method for art pictures
CN112101150A (en) A multi-feature fusion pedestrian re-identification method based on orientation constraints
CN104239522B (en) Inter-image content constraint-based ultra-pixel coding image retrieval method
CN106649487A (en) Image retrieval method based on interest target
CN103473327A (en) Image retrieval method and image retrieval system
CN101706780A (en) Image semantic retrieving method based on visual attention model
Atlam et al. Integration of color and texture features in CBIR system
CN109934258B (en) Image retrieval method based on feature weighting and region integration
CN105868706A (en) Method for identifying 3D model based on sparse coding
Li et al. Place recognition based on deep feature and adaptive weighting of similarity matrix
CN108009191A (en) A kind of image search method
CN105205135A (en) 3D (three-dimensional) model retrieving method based on topic model and retrieving device thereof
CN102915451A (en) Dynamic texture identification method based on chaos invariant
CN105320764A (en) 3D model retrieval method and 3D model retrieval apparatus based on slow increment features
CN109213886A (en) Image retrieval method and system based on image segmentation and fuzzy pattern recognition
CN103336835A (en) Image retrieval method based on weight color-sift characteristic dictionary
CN103399863B (en) Image search method based on the poor characteristic bag of edge direction
CN115937532A (en) Mask perception vehicle weight identification method and system based on counterfactual attention mechanism
CN112182264B (en) Method, device and equipment for determining landmark information and readable storage medium
Sadique et al. Content-based image retrieval using color layout descriptor, gray-level co-occurrence matrix and k-nearest neighbors

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20081112

Termination date: 20100908