[go: up one dir, main page]

CN104657980A - Improved multi-channel image partitioning algorithm based on Meanshift - Google Patents

Improved multi-channel image partitioning algorithm based on Meanshift Download PDF

Info

Publication number
CN104657980A
CN104657980A CN201410818125.5A CN201410818125A CN104657980A CN 104657980 A CN104657980 A CN 104657980A CN 201410818125 A CN201410818125 A CN 201410818125A CN 104657980 A CN104657980 A CN 104657980A
Authority
CN
China
Prior art keywords
image
pixel
interest
meanshift
target
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.)
Pending
Application number
CN201410818125.5A
Other languages
Chinese (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.)
Jiangnan University
Original Assignee
Jiangnan 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 Jiangnan University filed Critical Jiangnan University
Priority to CN201410818125.5A priority Critical patent/CN104657980A/en
Publication of CN104657980A publication Critical patent/CN104657980A/en
Pending legal-status Critical Current

Links

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

一种改进的基于Meanshift的多通道图像分割算法,包括以下步骤:输入RGB图像矩阵并统计像素值;对其像素样本做Meanshift聚类运算;在三个子图像中查找并记录灰度落入兴趣目标区域的灰度区间的像素,查找并记录兴趣目标像素的聚类中心;对兴趣目标像素及其聚类中心做可靠性计算,筛选出可靠性高的兴趣目标像素,并将目标像素赋值1,其他0,产生分割后的图像逻辑矩阵;对此矩阵做逻辑“或”运算融合得到最终的兴趣目标区域;输出图像,即为分割获得的兴趣目标图像。本发明充分利用RGB图像的色彩信息,当目标与背景比较接近时,能够有效的分割出兴趣目标区域对象且聚类数目是自动生成的。该算法的误分率低,分割效果好。

An improved Meanshift-based multi-channel image segmentation algorithm, including the following steps: input RGB image matrix and count pixel values; perform Meanshift clustering operation on its pixel samples; find and record the grayscale falling into the target of interest in three sub-images Find and record the clustering center of the pixel of interest in the grayscale interval of the region; calculate the reliability of the pixel of interest and its clustering center, filter out the pixel of interest with high reliability, and assign the target pixel a value of 1, Other 0, generate a segmented image logical matrix; perform logical "OR" operation on this matrix to obtain the final target area of interest; output image is the target image of interest obtained by segmentation. The invention makes full use of the color information of the RGB image, and can effectively segment the target area object of interest when the target is relatively close to the background, and the number of clusters is automatically generated. The algorithm has low misclassification rate and good segmentation effect.

Description

一种改进的基于Meanshift的多通道图像分割算法An Improved Multi-Channel Image Segmentation Algorithm Based on Meanshift

技术领域technical field

本发明涉及的是一种图像处理技术领域的方法,具体是一种改进的基于Meanshift的多通道图像分割算法。The invention relates to a method in the technical field of image processing, in particular to an improved Meanshift-based multi-channel image segmentation algorithm.

背景技术Background technique

图像分割是指把一幅图像分成几个互不重叠的各具特征的区域,并提取出感兴趣的区域作为目标。图像分割是从图像处理到图像分析的关键步骤,图像分割结果的好坏直接影响到后期的图像分析。图像分割技术最早应用在灰度图像上,灰度图像提供的信息比较单一。随着图像处理技术的应用越来越广泛,灰度图像的分割已经不能满足应用需要,彩色图像能提供比灰度图像更多的信息,因此对彩色图像分割的研究越来越多。Image segmentation refers to dividing an image into several non-overlapping regions with different characteristics, and extracting the region of interest as the target. Image segmentation is a key step from image processing to image analysis, and the quality of image segmentation results directly affects the later image analysis. Image segmentation technology was first applied to grayscale images, and the information provided by grayscale images is relatively simple. With the application of image processing technology more and more widely, the segmentation of grayscale image can no longer meet the application needs, and color image can provide more information than grayscale image, so more and more researches on color image segmentation.

彩色图像中的目标对象与背景对象的灰度值比较接近时,对目标对象进行有效的分割一直是难点问题。目前的彩色图像分割算法主要有直方图阈值方法、边缘提取法、分水岭分割法及特征空间聚类分割法等。其中最常用的是直方图阈值分割方法。直方图阈值分割方法广泛应用于灰度图像的分割。当分割彩色图像时,只适用于有明显峰值的彩色图像,当图像的峰值不明显时,分割效果不好,容易出现较大的误差。边缘提取法在分割图像时,当区域对比明显时,分割效果好,反之,较差。而在分水岭分割方法中,当标记选取不当时会导致图像过分割。聚类分割算法是近年来研究的比较多的算法。而常用的聚类分割方法如模糊C均值聚类,存在一定的局限性。该算法要求先确定目标对象的分类数目以及聚类的初始中心,妨碍了目标对象分类的自动实现,分类数目不同,分类结果也不同,初始的聚类中心不同,聚类结果往往也不同,聚类结果缺乏必要的可靠性。When the gray value of the target object in the color image is relatively close to that of the background object, it is always a difficult problem to effectively segment the target object. The current color image segmentation algorithms mainly include histogram threshold method, edge extraction method, watershed segmentation method and feature space clustering segmentation method and so on. One of the most commonly used is the histogram threshold segmentation method. The histogram threshold segmentation method is widely used in grayscale image segmentation. When segmenting color images, it is only suitable for color images with obvious peaks. When the peaks of the image are not obvious, the segmentation effect is not good, and large errors are prone to occur. When the edge extraction method is used to segment the image, when the area contrast is obvious, the segmentation effect is good, otherwise, it is poor. In the watershed segmentation method, when the marker is not selected properly, the image will be over-segmented. Clustering segmentation algorithm is a more researched algorithm in recent years. However, the commonly used clustering segmentation methods such as fuzzy C-means clustering have certain limitations. The algorithm requires to determine the classification number of the target object and the initial center of the cluster first, which hinders the automatic realization of the classification of the target object. The classification number is different, the classification result is also different, the initial cluster center is different, and the clustering result is often different. Class results lack the necessary reliability.

发明内容Contents of the invention

本发明针对现有技术存在的不足,提出一种改进的基于Meanshift的多通道图像聚类分割算法。本发明充分利用RGB图像的色彩信息,对于目标与背景比较接近的情况,能够有效的分割出兴趣目标区域对象,并且聚类数目是自动生成的。该算法的误分率低,分割效果好。Aiming at the deficiencies in the prior art, the present invention proposes an improved Meanshift-based multi-channel image clustering and segmentation algorithm. The invention makes full use of the color information of the RGB image, and can effectively segment the target area object of interest for the situation that the target is relatively close to the background, and the number of clusters is automatically generated. The algorithm has low misclassification rate and good segmentation effect.

本发明是通过以下技术方案实现的,本发明包括以下步骤:The present invention is achieved through the following technical solutions, and the present invention comprises the following steps:

第一步,输入RGB图像矩阵。In the first step, input the RGB image matrix.

第二步,统计图像矩阵的像素值,统计Meanshift聚类的样本数。In the second step, the pixel values of the image matrix are counted, and the number of samples clustered by Meanshift is counted.

第三步,根据RGB图像的三通道对颜色的敏感性差异,分别对R,G,B三个子图像的样本进行MeanShift聚类运算以获取初步的聚类结果。In the third step, according to the color sensitivity difference of the three channels of the RGB image, the MeanShift clustering operation is performed on the samples of the three sub-images of R, G, and B to obtain preliminary clustering results.

第四步,在步骤1输入的图像矩阵的R,G,B子图像中查找并记录灰度落入兴趣目标区域的灰度区间的像素,得到三个子图像中的兴趣目标区域。The fourth step is to find and record the pixels whose grayscale falls in the grayscale interval of the target area of interest in the R, G, and B subimages of the image matrix input in step 1, and obtain the target area of interest in the three subimages.

第五步,查找并记录步骤4中兴趣目标像素的聚类中心。The fifth step is to find and record the cluster center of the target pixel of interest in step 4.

第六步,对步骤4和5中的兴趣目标像素及其聚类中心进行可靠性计算,即做灰度相似性判断,筛选出可靠性高的兴趣目标像素,并将目标像素赋值“1”,其他为“0”,从而产生分割后的图像逻辑矩阵。The sixth step is to calculate the reliability of the target pixels of interest and their cluster centers in steps 4 and 5, that is, to judge the gray similarity, select the target pixels of interest with high reliability, and assign the target pixel a value of "1" , and the others are "0", resulting in a logical matrix of the segmented image.

所述的可靠性计算通过引入可靠性因子λ评价目标像素与聚类中心灰度的距离来实现的,具体是:The reliability calculation is realized by introducing the reliability factor λ to evaluate the distance between the target pixel and the gray scale of the cluster center, specifically:

λλ == || ZZ -- ZZ ′′ ZZ ′′ || -- -- -- (( 11 ))

式中,Z是像素灰度,Z'是聚类中心的像素灰度。即计算并判断像素与其聚类中心的欧氏距离是否小于等于阈值δ,筛选出可靠性高的目标像素。In the formula, Z is the pixel gray level, and Z' is the pixel gray level of the cluster center. That is to calculate and judge whether the Euclidean distance between the pixel and its cluster center is less than or equal to the threshold δ, and select the target pixel with high reliability.

第七步,对步骤6得到的图像逻辑矩阵做逻辑“或”运算融合得到最终的兴趣目标区域。In the seventh step, the logical "OR" operation is performed on the image logic matrix obtained in step 6 to obtain the final target area of interest.

所述的逻辑“或”运算,具体是:The logical "or" operation is specifically:

b0(i,j)=b1(i,j)|b2(i,j)|b3(i,j)  (2)b 0 (i,j)=b 1 (i,j)|b 2 (i,j)|b 3 (i,j) (2)

式中,b(i,j)表示图像逻辑矩阵中的第i行第j列的像素,″|″表示逻辑或运算。In the formula, b(i, j) represents the pixel in row i and column j in the image logic matrix, and "|" represents a logical OR operation.

第八步,输出图像,即为分割获得的兴趣目标区域图像。The eighth step is to output the image, which is the image of the target area of interest obtained by segmentation.

与现有技术相比,本发明的有益效果是:充分利用RGB图像的色彩信息,对于目标与背景比较接近的情况,能够有效的分割出兴趣目标区域对象,并且聚类数目是自动生成的。该算法的误分率低,分割效果好。Compared with the prior art, the beneficial effect of the present invention is that the color information of the RGB image is fully utilized, and the object of the target area of interest can be effectively segmented for the situation that the target is relatively close to the background, and the number of clusters is automatically generated. The algorithm has low misclassification rate and good segmentation effect.

附图说明Description of drawings

图1是算法流程图。Figure 1 is a flowchart of the algorithm.

图2是实施例的原始图像。Figure 2 is the original image of the example.

图3是hs=12,hr=12三通道各自的聚类结果及最后的分割结果。Fig. 3 shows the respective clustering results and final segmentation results of the three channels h s =12 and h r =12.

图4是hs=6,hr=12三通道各自的聚类结果及最后的分割结果。Fig. 4 is the respective clustering results and final segmentation results of the three channels h s =6, hr =12.

图5可靠性因子λ的对比实验:(a)为未引入可靠性因子λ的实验结果,(b)为引入可靠性因子λ的实验结果。Fig. 5 Comparative experiment of reliability factor λ: (a) is the experimental result without reliability factor λ, (b) is the experimental result of introducing reliability factor λ.

图6是云团区域1,2,3,4。Figure 6 is cloud area 1,2,3,4.

图7是云团区域分割结果的数据对比。Figure 7 is a data comparison of the cloud region segmentation results.

具体实施方式Detailed ways

下面结合附图对本发明的实施例作详细说明:本实施例在以本发明技术方案为前提下进行实施,给出了详细的实施方式和过程,但本发明的保护范围不限于下述的实施例。The embodiments of the present invention are described in detail below in conjunction with the accompanying drawings: the present embodiment is implemented on the premise of the technical solution of the present invention, and detailed implementation methods and processes are provided, but the protection scope of the present invention is not limited to the following implementations example.

实施例Example

本实施例是分割出卫星云图中的云团区域,因卫星云图中的沙漠、冰川等区域与云团的色彩值比较接近。本实施例选取我国自行研制的第一代地球静止轨道气象卫星---风云二号气象卫星(FY-2)云图进行云团分割,选用2014年05月22日12:30分(北京时间)的卫星云图,如图2所示。In this embodiment, the cloud cluster area in the satellite cloud image is segmented, because the color values of the desert, glacier and other regions in the satellite cloud image are relatively close to the cloud cluster. In this embodiment, the first generation of geostationary meteorological satellite developed by my country --- Fengyun No. 2 meteorological satellite (FY-2) cloud image is selected for cloud segmentation, and the cloud image is selected at 12:30 on May 22, 2014 (Beijing time) The satellite cloud image of , as shown in Figure 2.

第一步,输入RGB图像矩阵A,A是n×m阶的三维数组,其行规模是m,列规模是n,A={ai|i=1,2,3},i=1,2,3分别表示图像的R,G,B三通道。The first step is to input the RGB image matrix A, A is a three-dimensional array of order n×m, its row size is m, column size is n, A={a i |i=1,2,3}, i=1, 2 and 3 respectively represent the R, G, and B channels of the image.

第二步,统计图像矩阵的像素值,统计Meanshift聚类样本数。统计矩阵A中的像素值Data,统计Meanshift聚类数(0≤Data≤255,图像的灰度值区间);In the second step, the pixel values of the image matrix are counted, and the number of Meanshift clustering samples is counted. Count the pixel value Data in the matrix A, and count the number of Meanshift clusters (0≤Data≤255, the gray value interval of the image);

第三步,根据RGB图像的三通道对颜色的敏感性差异,分别对R,G,B三个子图像的样本进行MeanShift聚类运算以获取初步的聚类结果。可将输入的数据集Data聚为m类,输出聚类的m个中心点。In the third step, according to the color sensitivity difference of the three channels of the RGB image, the MeanShift clustering operation is performed on the samples of the three sub-images of R, G, and B to obtain preliminary clustering results. The input data set Data can be clustered into m classes, and the m center points of the clusters are output.

第四步,在步骤1输入的图像矩阵的R,G,B子图像中查找并记录灰度落入兴趣目标区域的灰度区间的像素,得到三个子图像中的兴趣目标区域。设矩阵ai(i=1,2,3)中的元素值为Xn,m,查找相应的满足|Xn,m-{Xi|P1<Xi<P2}|<ε的像素,并标为X'n,m,其中ε无限趋近于0,i是各个单通道的像素的总数;其中(P1<Xi<P2)是根据先验知识得到兴趣目标区域的灰度范围。The fourth step is to find and record the pixels whose grayscale falls in the grayscale interval of the target area of interest in the R, G, and B subimages of the image matrix input in step 1, and obtain the target area of interest in the three subimages. Let the value of the element in the matrix a i (i=1,2,3) be X n,m , find the corresponding satisfying |X n,m -{X i |P 1 <X i <P 2 }|<ε Pixels, and marked as X' n,m , where ε is infinitely close to 0, i is the total number of pixels of each single channel; where (P 1 <X i <P 2 ) is the target area of interest obtained based on prior knowledge grayscale range.

第五步,查找并记录步骤4中兴趣目标像素的聚类中心。即查找X'n,m的某个聚类中心Cm,其灰度值用Center(C)来表示。The fifth step is to find and record the cluster center of the target pixel of interest in step 4. That is to find a certain cluster center C m of X' n,m , and its gray value is represented by Center(C).

第六步,对步骤4和5中的兴趣目标像素及其聚类中心进行可靠性计算,即做灰度相似性判断,筛选出可靠性高的兴趣目标像素,并将目标像素赋值“1”,其他为“0”,从而产生分割后的逻辑矩阵。The sixth step is to calculate the reliability of the target pixels of interest and their cluster centers in steps 4 and 5, that is, to judge the gray similarity, select the target pixels of interest with high reliability, and assign the target pixel a value of "1" , and others are "0", resulting in a divided logical matrix.

所述的可靠性计算通过引入可靠性因子λ评价目标像素与聚类中心灰度的距离来实现的,具体是:The reliability calculation is realized by introducing the reliability factor λ to evaluate the distance between the target pixel and the gray scale of the cluster center, specifically:

&lambda;&lambda; == || ZZ -- ZZ &prime;&prime; ZZ &prime;&prime; || -- -- -- (( 33 ))

式中,Z是像素灰度,Z'是聚类中心的像素灰度。即计算并判断像素与其聚类中心的欧氏距离是否小于等于阈值δ,筛选出可靠性高的目标像素。In the formula, Z is the pixel gray level, and Z' is the pixel gray level of the cluster center. That is to calculate and judge whether the Euclidean distance between the pixel and its cluster center is less than or equal to the threshold δ, and select the target pixel with high reliability.

在本实施例中的可靠性计算是通过引入可靠性因子λ评价目标像素X'n,m与聚类中心Cm灰度的距离来实现的,判断|X'n,m-Center(C)|≤δ并筛选出可靠性高的兴趣目标像素Yn,m,并将目标像素赋值“1”,其他为“0”,从而产生分割后的图像逻辑矩阵b1,b2,b3The reliability calculation in this embodiment is realized by introducing the reliability factor λ to evaluate the distance between the target pixel X' n, m and the gray level of the cluster center C m , judging |X' n, m -Center(C) |≤δ and screen out the highly reliable target pixel Y n,m of interest, and assign the target pixel a value of "1" and the others as "0", thereby generating the segmented image logical matrix b 1 , b 2 , b 3 .

第七步,对步骤六得到的图像逻辑矩阵b1,b2,b3做逻辑“或”运算融合得到最终的兴趣目标区域,其矩阵用b0表示。In the seventh step, the logical "OR" operation is performed on the image logic matrices b 1 , b 2 , and b 3 obtained in the step 6 to obtain the final target area of interest, and its matrix is denoted by b 0 .

所述的逻辑“或”运算,具体是:The logical "or" operation is specifically:

b0(i,j)=b1(i,j)|b2(i,j)|b3(i,j)(4)b 0 (i,j)=b 1 (i,j)|b 2 (i,j)|b 3 (i,j)(4)

式中,b(i,j)表示图像逻辑矩阵中的第i行第j列的像素,"|"表示逻辑或运算。In the formula, b(i, j) represents the pixel in row i and column j in the image logic matrix, and "|" represents a logical OR operation.

第八步,输出图像B,即为分割获得的兴趣目标区域图像。The eighth step is to output image B, which is the image of the target area of interest obtained by segmentation.

所述的Meanshift均值偏移算法的均值偏移向量,具体是:The mean shift vector of the Meanshift mean shift algorithm, specifically:

Mm hh (( xx )) == &Sigma;&Sigma; ii == 11 nno GG (( xx ii -- xx hh )) ww (( xx ii )) xx ii &Sigma;&Sigma; ii == 11 nno GG (( xx ii -- xx hh )) ww (( xx ii )) -- xx -- -- -- (( 55 ))

式中,xi是数字图像X的像素,Mh(x)是x点的扩展形式的均值偏移向量,G为核函数,w是权重。均值偏移向量的方向和核函数的概率密度梯度方向是一致的,Comaniciu已经证明MeanShift算法在满足一定条件下,一定可以收敛到最近的一个概率密度函数的稳态点。因此,沿着均值偏移向量的方向不断移动核函数的中心位置直至收敛,就找到了邻近的模值点的位置。In the formula, x i is the pixel of the digital image X, M h (x) is the mean offset vector of the extended form of point x, G is the kernel function, and w is the weight. The direction of the mean shift vector is consistent with the direction of the probability density gradient of the kernel function. Comaniciu has proved that the MeanShift algorithm can converge to the nearest steady-state point of the probability density function under certain conditions. Therefore, the center position of the kernel function is continuously moved along the direction of the mean shift vector until it converges, and the position of the adjacent modulus point is found.

在彩色图像分割中,均值偏移算法的特征空间通常包括二维的空间域和三维的值域。因此在彩色图像分割中,均值偏移的核函数可定义为In color image segmentation, the feature space of the mean shift algorithm usually includes a two-dimensional space domain and a three-dimensional value domain. Therefore, in color image segmentation, the kernel function of mean shift can be defined as

KK hh sthe s ,, hh rr == CC hh sthe s 22 hh rr 33 kk (( || || xx sthe s hh ww || || )) kk (( || || xx rr hh rr || || 22 )) -- -- -- (( 66 ))

式中,xs表示二维空间中的位置坐标,xr表示三维值域中的三维彩色特征向量,hs为空域窗宽,hr为值域窗宽,C是一个归一化常数。通过对图像各像素点运用均值偏移算法进行不断的偏移直至收敛就得到了各自的模式,即实现了对彩色图像的像素点特征空间的聚类,从而获得分割图像。In the formula, x s represents the position coordinates in the two-dimensional space, x r represents the three-dimensional color feature vector in the three-dimensional range, h s is the window width of the space domain, h r is the window width of the range, and C is a normalization constant. By applying the mean shift algorithm to each pixel of the image to continuously shift until it converges, the respective patterns are obtained, that is, the clustering of the pixel feature space of the color image is realized, and the segmented image is obtained.

实施效果Implementation Effect

根据Meanshift分割算法,采用不同的hs和hr,分割的效果也不尽相同。根据云团的特性,利用以下的图像分割评价方法对上述情况的云团区域的分割结果做分割评价,其误分率为According to the Meanshift segmentation algorithm, different h s and h r are used, and the segmentation effects are also different. According to the characteristics of cloud clusters, use the following image segmentation evaluation method to segment and evaluate the segmentation results of the cloud cluster area in the above situation, and the error rate is

i-区域编号i-area number

M-手动标准分割云图区域的像素值M - pixel value of manual standard segmentation cloud image area

N-算法进行云团区域分割的像素值Pixel value of N-algorithm for segmenting cloud area

图3和图4分别是hs=12,hr=12和hs=6,hr=12三通道各自的聚类结果及最后的分割结果,图5是未引入可靠性因子与引入可靠性因子的云团分割结果对比。由于得到的云团的区域数目较多,且偏小,故选择图6中所标示的云团区域1,2,3,4进行分割评价,图7表示云团区域分割结果的对比,图7中的像素数统计是在图像大小为226×173的情况下统计的。Figure 3 and Figure 4 are respectively the clustering results and the final segmentation results of the three channels of h s =12, h r =12 and h s =6, h r =12. Comparison of the cloud cluster segmentation results of the sex factor. Since the number of cloud cluster regions obtained is large and relatively small, the cloud cluster regions 1, 2, 3, and 4 marked in Figure 6 are selected for segmentation evaluation. Figure 7 shows the comparison of cloud cluster region segmentation results. Figure 7 The statistics of the number of pixels in are calculated when the image size is 226×173.

由上述误分率的定义,计算可得当hs=6,hr=12,区域1,2,3,4的误分率分别为0.597%,0.095%,0.013%,0。当hs=12,hr=12区域1,2,3,4的误分率分别为1.575%,0,0,0.298%。当hs=12,hr=12时,未引入可靠性因子的误分率分别为4.249%,0.488%,1.113%,0.869%。From the above definition of misclassification rate, it can be calculated that h s =6, h r =12, and the misclassification rates of regions 1, 2, 3, and 4 are 0.597%, 0.095%, 0.013%, and 0, respectively. When h s =12, h r =12, the misclassification rates of regions 1, 2, 3, and 4 are 1.575%, 0, 0, and 0.298%, respectively. When h s =12 and h r =12, the misclassification rates without introducing reliability factors are 4.249%, 0.488%, 1.113%, and 0.869%, respectively.

由图7的误分率和统计的云团总像素数,并对比图3图4的分割结果,可以看出,本实施例的算法的云团总像素数更接近于手动标准分割的云团总像素数;并且本实施例的算法的两组参数下的误分率都较低且明显低于未引入可靠性因子的算法的误分率。采用本实施例中的算法,对于彩色卫星云图中云团区域与沙漠、冰川等相近的情况下,云团区域有较好的分割效果,其误分率较低,分割结果更加准确,可靠性高,云团完全分离于与其色彩值相近的沙漠、冰川。From the misclassification rate in Figure 7 and the total number of pixels in the cloud cluster, and comparing the segmentation results in Figure 3 and Figure 4, it can be seen that the total number of pixels in the cloud cluster by the algorithm of this embodiment is closer to the cloud cluster of manual standard segmentation The total number of pixels; and the misclassification rate of the algorithm of this embodiment under the two sets of parameters are all low and significantly lower than the misclassification rate of the algorithm that does not introduce the reliability factor. Using the algorithm in this embodiment, when the cloud area in the color satellite cloud image is similar to deserts, glaciers, etc., the cloud area has a better segmentation effect, the error rate is lower, and the segmentation result is more accurate and reliable. High, the clouds are completely separated from deserts and glaciers with similar color values.

本实施例算法充分利用RGB图像的色彩信息,对于目标与背景比较接近的情况,能够有效的分割出兴趣目标区域对象,并且聚类数目是自动生成的。该算法的误分率低,分割效果好。The algorithm of this embodiment makes full use of the color information of the RGB image, and can effectively segment the object of the target area of interest when the target is relatively close to the background, and the number of clusters is automatically generated. The algorithm has low misclassification rate and good segmentation effect.

Claims (5)

1.一种改进的基于Meanshift的多通道图像分割算法,其特征在于,包括以下步骤:1. an improved multi-channel image segmentation algorithm based on Meanshift, is characterized in that, comprises the following steps: 第一步,输入RGB图像矩阵;In the first step, input the RGB image matrix; 第二步,统计图像矩阵的像素值,统计Meanshift聚类的样本数;The second step is to count the pixel values of the image matrix and count the number of samples clustered by Meanshift; 第三步,根据RGB图像的三通道对颜色的敏感性差异,分别对R,G,B三个子图像的样本进行MeanShift聚类运算以获取初步的聚类结果;In the third step, according to the color sensitivity difference of the three channels of the RGB image, the MeanShift clustering operation is performed on the samples of the three sub-images of R, G, and B to obtain preliminary clustering results; 第四步,在步骤1输入的图像矩阵的R,G,B子图像中查找并记录灰度落入兴趣目标区域的灰度区间的像素,得到三个子图像中的兴趣目标区域;The 4th step, in the R of the image matrix input in step 1, G, B sub-image, search and record the pixel whose grayscale falls into the gray-scale interval of the target area of interest, obtain the target area of interest in the three sub-images; 第五步,查找并记录步骤4中兴趣目标像素的聚类中心;The fifth step is to find and record the cluster center of the target pixel of interest in step 4; 第六步,对步骤4和5中的兴趣目标像素及其聚类中心进行可靠性计算,即做灰度相似性判断,筛选出可靠性高的兴趣目标像素,并将目标像素赋值“1”,其他为“0”,从而产生分割后的图像逻辑矩阵;The sixth step is to calculate the reliability of the target pixels of interest and their cluster centers in steps 4 and 5, that is, to judge the gray similarity, select the target pixels of interest with high reliability, and assign the target pixel a value of "1" , and the others are "0", thus generating a logical matrix of the segmented image; 第七步,对步骤六得到的图像逻辑矩阵做逻辑“或”运算融合得到最终的兴趣目标区域;The seventh step is to perform logical "or" operation fusion on the image logic matrix obtained in step six to obtain the final target area of interest; 第八步,输出图像,即为分割获得的兴趣目标区域图像。The eighth step is to output the image, which is the image of the target area of interest obtained by segmentation. 2.根据权利要求1所述的改进的基于Meanshift的多通道图像分割算法,其特征是,所述的Meanshift均值偏移算法的均值偏移向量,具体是:2. the improved multi-channel image segmentation algorithm based on Meanshift according to claim 1, is characterized in that, the mean shift vector of described Meanshift mean shift algorithm, specifically: Mm hh (( xx )) == &Sigma;&Sigma; ii == 11 nno GG (( xx ii -- xx hh )) ww (( xx ii )) xx ii &Sigma;&Sigma; ii == 11 nno GG (( xx ii -- xx hh )) ww (( xx ii )) -- xx 式中,xi是数字图像X的像素,Mh(x)是x点的扩展形式的均值偏移向量,G为核函数,w是权重。均值偏移向量的方向和核函数的概率密度梯度方向是一致的,Comaniciu已经证明MeanShift算法在满足一定条件下,一定可以收敛到最近的一个概率密度函数的稳态点。因此,沿着均值偏移向量的方向不断移动核函数的中心位置直至收敛,就找到了邻近的模值点的位置。In the formula, x i is the pixel of the digital image X, M h (x) is the mean offset vector of the extended form of point x, G is the kernel function, and w is the weight. The direction of the mean shift vector is consistent with the direction of the probability density gradient of the kernel function. Comaniciu has proved that the MeanShift algorithm can converge to the nearest steady-state point of the probability density function under certain conditions. Therefore, the center position of the kernel function is continuously moved along the direction of the mean shift vector until it converges, and the position of the adjacent modulus point is found. 3.根据权利要求1所述的改进的基于Meanshift的多通道图像分割算法,其特征是,所述的可靠性计算通过引入可靠性因子λ评价目标像素与聚类中心灰度的距离来实现的,具体是:3. the improved multi-channel image segmentation algorithm based on Meanshift according to claim 1, wherein said reliability calculation is realized by introducing reliability factor λ to evaluate the distance of target pixel and cluster center gray scale ,specifically is: &lambda;&lambda; == || ZZ -- ZZ &prime;&prime; ZZ &prime;&prime; || 式中,Z是像素灰度,Z'是聚类中心的像素灰度。即计算并判断像素与其聚类中心的欧氏距离是否小于等于阈值δ,筛选出可靠性高的目标像素。In the formula, Z is the pixel gray level, and Z' is the pixel gray level of the cluster center. That is to calculate and judge whether the Euclidean distance between the pixel and its cluster center is less than or equal to the threshold δ, and select the target pixel with high reliability. 4.根据权利要求1所述的改进的基于Meanshift的多通道图像分割算法,其特征是,所述的逻辑“或”运算,具体是:4. the improved multi-channel image segmentation algorithm based on Meanshift according to claim 1, is characterized in that, described logic " or " operation, specifically: b0(i,j)=b1(i,j)|b2(i,j)|b3(i,j)b 0 (i,j)=b 1 (i,j)|b 2 (i,j)|b 3 (i,j) 式中,b(i,j)表示图像逻辑矩阵中的第i行第j列的像素,"|"表示逻辑或运算。In the formula, b(i, j) represents the pixel in row i and column j in the image logic matrix, and "|" represents a logical OR operation. 5.根据权利要求2所述的Meanshift均值偏移算法,其特征是,所述的核函数,具体是:5. Meanshift mean shifting algorithm according to claim 2, is characterized in that, described kernel function, specifically: KK hh sthe s ,, hh rr == GG hh sthe s 22 hh rr 33 kk (( || || xx sthe s hh sthe s || || 22 )) kk (( || || xx rr hh rr || || 22 )) 式中,xs表示二维空间中的位置坐标,xr表示三维值域中的三维彩色特征向量,hs为空域窗宽,hr为值域窗宽,C是一个归一化常数。通过对图像各像素点运用均值偏移算法进行不断的偏移直至收敛就得到了各自的模式,即实现了对彩色图像的像素点特征空间的聚类,从而获得分割图像。In the formula, x s represents the position coordinates in the two-dimensional space, x r represents the three-dimensional color feature vector in the three-dimensional range, h s is the window width of the space domain, h r is the window width of the range, and C is a normalization constant. By applying the mean shift algorithm to each pixel of the image to continuously shift until it converges, the respective patterns are obtained, that is, the clustering of the pixel feature space of the color image is realized, and the segmented image is obtained.
CN201410818125.5A 2014-12-24 2014-12-24 Improved multi-channel image partitioning algorithm based on Meanshift Pending CN104657980A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410818125.5A CN104657980A (en) 2014-12-24 2014-12-24 Improved multi-channel image partitioning algorithm based on Meanshift

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410818125.5A CN104657980A (en) 2014-12-24 2014-12-24 Improved multi-channel image partitioning algorithm based on Meanshift

Publications (1)

Publication Number Publication Date
CN104657980A true CN104657980A (en) 2015-05-27

Family

ID=53249056

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410818125.5A Pending CN104657980A (en) 2014-12-24 2014-12-24 Improved multi-channel image partitioning algorithm based on Meanshift

Country Status (1)

Country Link
CN (1) CN104657980A (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105761237A (en) * 2015-12-15 2016-07-13 江南大学 Mean shift-based chip X-ray image layer segmentation
CN105955754A (en) * 2016-05-18 2016-09-21 青岛海信移动通信技术股份有限公司 Method and device for displaying characters of user interface
CN107766863A (en) * 2016-08-19 2018-03-06 阿里巴巴集团控股有限公司 Image-characterization methods and server
CN109729090A (en) * 2019-01-03 2019-05-07 湖南大学 A Slow Denial of Service Attack Detection Method Based on WEDMS Clustering
CN109886983A (en) * 2018-12-27 2019-06-14 新绎健康科技有限公司 A kind of image tongue body dividing method, device and computer equipment
CN111210452A (en) * 2019-12-30 2020-05-29 西南交通大学 A Portrait Segmentation Method Based on Graph Cut and Mean Shift
CN111783656A (en) * 2020-06-30 2020-10-16 哈工程先进技术研究院(招远)有限公司 An adaptive infrared small target detection method based on statistical characteristics pre-segmentation
CN112418147A (en) * 2020-12-02 2021-02-26 中国人民解放军军事科学院国防科技创新研究院 Track \30758identificationmethod and device based on aerial images
CN114332059A (en) * 2021-12-30 2022-04-12 中元汇吉生物技术股份有限公司 Serum sample analysis method, device, equipment and medium based on test tube image
CN114648531A (en) * 2022-05-20 2022-06-21 领伟创新智能系统(浙江)有限公司 Solar panel surface dust identification method based on color channel brightness distribution
US11587236B2 (en) 2020-10-30 2023-02-21 International Business Machines Corporation Refining lesion contours with combined active contour and inpainting
US11694329B2 (en) 2020-10-30 2023-07-04 International Business Machines Corporation Logistic model to determine 3D z-wise lesion connectivity

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102005034A (en) * 2010-12-01 2011-04-06 南京大学 Remote sensing image segmentation method based on region clustering
CN102938161A (en) * 2012-09-24 2013-02-20 西北工业大学 Three-dimensional shape automatic partition method based on Mean Shift

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102005034A (en) * 2010-12-01 2011-04-06 南京大学 Remote sensing image segmentation method based on region clustering
CN102938161A (en) * 2012-09-24 2013-02-20 西北工业大学 Three-dimensional shape automatic partition method based on Mean Shift

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
何恒攀 等: "基于meanshift算法的图像边缘检测", 《重庆工学院学报》 *
依玉峰 等: "基于MeanShift随机游走图像分割算法", 《计算机辅助设计与图形学学报》 *
王新华 等: "MeanShift算法在图像分割中的应用研究", 《微计算机信息》 *
许晓丽 等: "改进近邻传播聚类的彩色图像分割", 《计算机辅助设计与图形学学报》 *
诸葛振荣 等: "基于MeanShift的织物图像分割算法", 《纺织学报》 *

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105761237B (en) * 2015-12-15 2019-02-12 江南大学 Hierarchical segmentation of chip X-ray images based on mean shift
CN105761237A (en) * 2015-12-15 2016-07-13 江南大学 Mean shift-based chip X-ray image layer segmentation
CN105955754A (en) * 2016-05-18 2016-09-21 青岛海信移动通信技术股份有限公司 Method and device for displaying characters of user interface
CN105955754B (en) * 2016-05-18 2019-09-17 青岛海信移动通信技术股份有限公司 A kind of user interface character displaying method and device
CN107766863A (en) * 2016-08-19 2018-03-06 阿里巴巴集团控股有限公司 Image-characterization methods and server
CN109886983A (en) * 2018-12-27 2019-06-14 新绎健康科技有限公司 A kind of image tongue body dividing method, device and computer equipment
CN109729090B (en) * 2019-01-03 2021-06-01 湖南大学 Slow denial of service attack detection method based on WEDMS clustering
CN109729090A (en) * 2019-01-03 2019-05-07 湖南大学 A Slow Denial of Service Attack Detection Method Based on WEDMS Clustering
CN111210452A (en) * 2019-12-30 2020-05-29 西南交通大学 A Portrait Segmentation Method Based on Graph Cut and Mean Shift
CN111210452B (en) * 2019-12-30 2023-04-07 西南交通大学 Certificate photo portrait segmentation method based on graph segmentation and mean shift
CN111783656A (en) * 2020-06-30 2020-10-16 哈工程先进技术研究院(招远)有限公司 An adaptive infrared small target detection method based on statistical characteristics pre-segmentation
CN111783656B (en) * 2020-06-30 2024-03-08 哈尔滨工程大学 Self-adaptive infrared small target detection method based on statistical characteristic pre-segmentation
US11587236B2 (en) 2020-10-30 2023-02-21 International Business Machines Corporation Refining lesion contours with combined active contour and inpainting
US11694329B2 (en) 2020-10-30 2023-07-04 International Business Machines Corporation Logistic model to determine 3D z-wise lesion connectivity
CN112418147A (en) * 2020-12-02 2021-02-26 中国人民解放军军事科学院国防科技创新研究院 Track \30758identificationmethod and device based on aerial images
CN114332059A (en) * 2021-12-30 2022-04-12 中元汇吉生物技术股份有限公司 Serum sample analysis method, device, equipment and medium based on test tube image
CN114648531A (en) * 2022-05-20 2022-06-21 领伟创新智能系统(浙江)有限公司 Solar panel surface dust identification method based on color channel brightness distribution

Similar Documents

Publication Publication Date Title
CN104657980A (en) Improved multi-channel image partitioning algorithm based on Meanshift
CN109522908B (en) Image Saliency Detection Method Based on Region Label Fusion
Schwarz et al. RGB-D object recognition and pose estimation based on pre-trained convolutional neural network features
CN111738318B (en) A Large Image Classification Method Based on Graph Neural Network
CN109636784B (en) Image saliency object detection method based on maximum neighborhood and superpixel segmentation
CN107229917B (en) A common salient target detection method for multiple remote sensing images based on iterative clustering
CN105184772B (en) A kind of self-adaption colorful image partition method based on super-pixel
CN104715251B (en) A kind of well-marked target detection method based on histogram linear fit
WO2017181892A1 (en) Foreground segmentation method and device
CN101964060B (en) SAR variant target identification method based on local textural feature
EP3073443A1 (en) 3D Saliency map
CN106056139A (en) Forest fire smoke/fog detection method based on image segmentation
CN103971367B (en) Hydrologic data image segmenting method
CN104809245A (en) Image retrieval method
WO2017135120A1 (en) Computationally efficient frame rate conversion system
CN107742113A (en) A SAR image cluster target detection method based on target number posterior
US8000535B2 (en) Methods and systems for refining text segmentation results
CN106529472B (en) Object detection method and device based on large scale high-resolution high spectrum image
CN107016680B (en) A kind of pest image background minimizing technology based on conspicuousness detection
CN106846343A (en) A kind of pathological image feature extracting method based on cluster super-pixel segmentation
CN107818341A (en) A kind of color extraction method based on improvement K means algorithms
CN107704864B (en) Salient object detection method based on image object semantic detection
Hambali et al. A rule-based segmentation method for fruit images under natural illumination
Jin et al. A color image segmentation method based on improved k-means clustering algorithm
CN104143191A (en) A Method of Change Detection in Remote Sensing Image Based on Texture Element

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20150527

WD01 Invention patent application deemed withdrawn after publication