CN111583279A - A Superpixel Image Segmentation Method Based on PCBA - Google Patents
A Superpixel Image Segmentation Method Based on PCBA Download PDFInfo
- Publication number
- CN111583279A CN111583279A CN202010397755.5A CN202010397755A CN111583279A CN 111583279 A CN111583279 A CN 111583279A CN 202010397755 A CN202010397755 A CN 202010397755A CN 111583279 A CN111583279 A CN 111583279A
- Authority
- CN
- China
- Prior art keywords
- superpixel
- image
- segmentation
- value
- color
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
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
本发明公开了一种基于PCBA的超像素图像分割方法,包括:获取原始图像;提升原始图像的对比度得到输入图像;计算输入图像的显著值并生成显著图;对显著图进行超像素分割,并获取超像素标签;基于超像素标签创建超像素图像,超像素图像中的每个像素的像素值为对应超像素块的平均灰度值;基于最佳分割阈值将原始图像分割为目标区域和背景区域,生成由目标区域与背景区域组成的分割图。针对PCBA颜色信息简单,没有包含复杂的背景信息的特点,本发明在进行最终的分割之前,先利用超像素标签生成超像素图像,这样,既保留了原图的边缘等重要信息,不会造成目标的遗漏,又减少了需要处理的图像的像素,进而减少了计算成本,提高了分割的效率。
The invention discloses a superpixel image segmentation method based on PCBA, comprising: obtaining an original image; improving the contrast of the original image to obtain an input image; calculating the saliency value of the input image and generating a saliency map; performing superpixel segmentation on the saliency map, and Obtain the superpixel label; create a superpixel image based on the superpixel label, the pixel value of each pixel in the superpixel image is the average gray value of the corresponding superpixel block; divide the original image into the target area and the background based on the optimal segmentation threshold region, and generate a segmentation map consisting of the target region and the background region. Aiming at the characteristics that the color information of PCBA is simple and does not contain complex background information, the present invention uses superpixel labels to generate superpixel images before final segmentation. The omission of the target reduces the pixels of the image to be processed, thereby reducing the computational cost and improving the efficiency of segmentation.
Description
技术领域technical field
本发明属于图像处理领域,具体涉及一种基于PCBA的超像素图像分割方法。The invention belongs to the field of image processing, and in particular relates to a PCBA-based superpixel image segmentation method.
背景技术Background technique
超像素属于图像分割技术,是指具有相似纹理、颜色、亮度等特征的相邻像素构成的有一定视觉意义的不规则像素块。超像素分割算法是一种重要的减少计算的预处理工具,被广泛应用于目标跟踪,目标识别,3D重建,图像分割以及显著性特征提取等领域。超像素相对于像素可以去除冗余信息,提高运算速度,在显著性检测里可以作为预处理的一个常用手段,可以在尽量保存边缘信息的同时大幅提高运算效率。目前,超像素算法可以简单的分为基于梯度下降的算法和基于聚类的算法。Superpixels belong to image segmentation technology, which refers to irregular pixel blocks with certain visual significance composed of adjacent pixels with similar texture, color, brightness and other characteristics. The superpixel segmentation algorithm is an important preprocessing tool that reduces computation and is widely used in object tracking, object recognition, 3D reconstruction, image segmentation, and saliency feature extraction. Compared with pixels, superpixels can remove redundant information and improve the operation speed. It can be used as a common method of preprocessing in saliency detection, which can greatly improve the operation efficiency while saving edge information as much as possible. At present, superpixel algorithms can be simply divided into gradient descent-based algorithms and clustering-based algorithms.
分水岭算法和Mean-Shift算法都是经典的梯度下降算法。分水岭算法利用梯度下降法获取像素间的相似性来产生一个闭合的轮廓。Mean-Shift算法则是一个迭代过程,寻找当前像素的平均移动向量,移动到该向量位置后继续搜索,直到满足一定条件。尽管分水岭算法有较快的运算速度,但是容易过分割,Mean-Shift则相反。K均值聚类(K-means)算法,线性光谱聚类(Linear Spectral Clustering,LSC)算法,简单线性迭代(SimpleLinear Iterative Clustering,SLIC)算法以及简单非迭代聚类(Simple Non-IterativeClustering)算法都是经典的聚类算法。LSC算法,SLIC算法以及SNIC算法都是基于K-means算法的改进。K-means算法随机选择k个目标作为初始聚类中心,然后计算每个目标到初始中心的距离,并把每个目标分类到最近的一个中心点。K-means算法需要初始化中心,且迭代次数依据于输入图片。SNIC算法则不需要迭代,也只需要很少的内存,速度也优于SLIC算法与LSC算法。Both the watershed algorithm and the Mean-Shift algorithm are classic gradient descent algorithms. The watershed algorithm uses gradient descent to obtain the similarity between pixels to generate a closed contour. The Mean-Shift algorithm is an iterative process, looking for the average moving vector of the current pixel, moving to the vector position and continuing to search until a certain condition is met. Although the watershed algorithm has a faster operation speed, it is easy to over-segment, and Mean-Shift is the opposite. K-means clustering (K-means) algorithm, Linear Spectral Clustering (LSC) algorithm, Simple Linear Iterative Clustering (SLIC) algorithm and Simple Non-Iterative Clustering (Simple Non-Iterative Clustering) algorithm are all Classic clustering algorithm. The LSC algorithm, the SLIC algorithm and the SNIC algorithm are all improvements based on the K-means algorithm. The K-means algorithm randomly selects k targets as the initial cluster center, then calculates the distance from each target to the initial center, and classifies each target to the nearest center point. The K-means algorithm needs to initialize the center, and the number of iterations depends on the input image. The SNIC algorithm does not require iteration, requires only a small amount of memory, and is faster than the SLIC algorithm and the LSC algorithm.
尽管上述算法在针对自然图像时有比较好的分割结果,但是在对PCBA图像进行分割时会遗漏掉一些目标。Although the above algorithms have good segmentation results for natural images, some objects are missed when segmenting PCBA images.
发明内容SUMMARY OF THE INVENTION
针对现有技术中存在的上述不足,本发明实际需要解决的问题是:如何避免在对PCBA图像进行分割时遗漏目标。In view of the above deficiencies in the prior art, the actual problem to be solved by the present invention is: how to avoid missing targets when segmenting the PCBA image.
为解决上述技术问题,本发明采用了如下的技术方案:In order to solve the above-mentioned technical problems, the present invention adopts the following technical solutions:
一种基于PCBA的超像素图像分割方法,包括:A PCBA-based superpixel image segmentation method, comprising:
S1、获取原始图像;S1. Obtain the original image;
S2、提升所述原始图像的对比度得到输入图像;S2, enhancing the contrast of the original image to obtain an input image;
S3、将所述输入图像的RGB颜色通道量化为m个不同的颜色,并选择输入图像中出现频率最高的n个颜色作为高频颜色代表所有的输入颜色,计算所述输入图像的显著值并生成显著图;S3, quantize the RGB color channels of the input image into m different colors, and select the n colors with the highest frequency in the input image as high-frequency colors to represent all input colors, calculate the significant value of the input image and generate a saliency map;
S4、对所述显著图进行超像素分割,并获取超像素标签;S4, performing superpixel segmentation on the saliency map, and obtaining superpixel labels;
S5、基于超像素标签创建超像素图像,所述超像素图像中的每个像素的像素值为对应超像素块的平均灰度值;S5, create a superpixel image based on the superpixel label, and the pixel value of each pixel in the superpixel image is the average gray value of the corresponding superpixel block;
S6、对所述超像素图像采用最大阈值分割法求得最佳分割阈值,基于所述最佳分割阈值将所述原始图像分割为目标区域和背景区域,生成由目标区域与背景区域组成的分割图。S6, using the maximum threshold segmentation method for the superpixel image to obtain the optimal segmentation threshold, and dividing the original image into a target area and a background area based on the optimal segmentation threshold, and generating a segmentation consisting of the target area and the background area. picture.
优选地,步骤S3中显著值的计算公式如下:Preferably, the calculation formula of the significant value in step S3 is as follows:
式中,S(c)为输入颜色c的显著值,ci为输入颜色c的第i个最近邻颜色,k为最近邻颜色的个数,S(ci)为ci对应的初始显著值,Pj为输入颜色c的第j个最近邻颜色的概率,D(ci,cj)输入颜色c的第i个最近邻颜色和第j个最近邻颜色在LAB颜色空间内的距离,D为输入颜色c与其k个最近邻颜色的距离之和, In the formula, S(c) is the saliency value of the input color c, c i is the ith nearest neighbor color of the input color c, k is the number of nearest neighbor colors, and S(ci ) is the initial saliency corresponding to c i . value, P j is the probability of the jth nearest neighbor color of the input color c, D( ci ,c j ) The distance between the ith nearest neighbor color and the jth nearest neighbor color of the input color c in the LAB color space, D is the sum of the distances of the input color c and its k nearest neighbors,
优选地,步骤S4中,利用SNIC超像素分割算法对所述显著图进行超像素分割。Preferably, in step S4, the SNIC superpixel segmentation algorithm is used to perform superpixel segmentation on the saliency map.
优选地,步骤S6包括:Preferably, step S6 includes:
S601、计算初始分割阈值,所述初始分割阈值等于所述超像素图像的灰度值的最大值与最小值的均值;S601, calculate the initial segmentation threshold, the initial segmentation threshold is equal to the mean value of the maximum value and the minimum value of the gray value of the superpixel image;
S602、基于所述初始分割阈值将所述超像素图像分割为超像素目标区域与超像素背景区域,通过信息熵公式迭代更新初始分割阈值,得到最佳分割阈值;S602, based on the initial segmentation threshold, the superpixel image is divided into a superpixel target area and a superpixel background area, and the initial segmentation threshold is iteratively updated by an information entropy formula to obtain an optimal segmentation threshold;
S603、基于所述最佳分割阈值将所述原始图像分割为目标区域和背景区域;S603, dividing the original image into a target area and a background area based on the optimal segmentation threshold;
S604、生成由目标区域与背景区域组成的分割图。S604. Generate a segmentation map composed of the target area and the background area.
优选地,还包括:Preferably, it also includes:
S7、将分割图中目标面积小于过滤阈值的区域过滤为背景区域。S7. Filter the area where the target area in the segmentation map is smaller than the filtering threshold as the background area.
综上所述,本发明公开了一种基于PCBA的超像素图像分割方法,包括:S1、获取原始图像;S2、提升所述原始图像的对比度得到输入图像;S3、将所述输入图像的RGB颜色通道量化为m个不同的颜色,并选择输入图像中出现频率最高的n个颜色作为高频颜色代表所有的输入颜色,计算所述输入图像的显著值并生成显著图;S4、对所述显著图进行超像素分割,并获取超像素标签;S5、基于超像素标签创建超像素图像,所述超像素图像中的每个像素的像素值为对应超像素块的平均灰度值;S6、对所述超像素图像采用最大阈值分割法求得最佳分割阈值,基于所述最佳分割阈值将所述原始图像分割为目标区域和背景区域,生成由目标区域与背景区域组成的分割图。In summary, the present invention discloses a PCBA-based superpixel image segmentation method, including: S1, obtaining an original image; S2, improving the contrast of the original image to obtain an input image; S3, converting the RGB of the input image The color channels are quantized into m different colors, and the n colors with the highest frequency in the input image are selected as high-frequency colors to represent all the input colors, the saliency value of the input image is calculated, and a saliency map is generated; S4. The saliency map is divided into superpixels, and superpixel labels are obtained; S5, a superpixel image is created based on the superpixel labels, and the pixel value of each pixel in the superpixel image is the average gray value of the corresponding superpixel block; S6, The maximum threshold segmentation method is used for the superpixel image to obtain an optimal segmentation threshold, and based on the optimal segmentation threshold, the original image is segmented into a target area and a background area, and a segmentation map composed of the target area and the background area is generated.
与现有的超像素分割算法相比较,本发明具有以下有益效果:Compared with the existing superpixel segmentation algorithm, the present invention has the following beneficial effects:
本发明首先提出一种超像素标签图像方法,来提高分割图像的效率。同时视觉系统对于视觉信号的对比度比较敏感,基于直方图对比度来提取显著特征效果比较明显,且SNIC超像素分割算法利用了颜色与空间信息来进行图像的初分割,虽然是聚类的方法,但是不需要迭代,速度优于一般的聚类算法,所以拟采用直方图对比度进行显著特征提取,再进行超像素分割,结合本发明的超像素标签图像生成法,提取新图像的信息熵进行阈值分割,最后进行目标与背景区域的微调,得到最终的分割图。The present invention first proposes a superpixel label image method to improve the efficiency of image segmentation. At the same time, the visual system is sensitive to the contrast of visual signals, and the extraction of salient features based on the histogram contrast is more effective, and the SNIC superpixel segmentation algorithm uses color and space information to perform initial image segmentation, although it is a clustering method, but It does not need iteration, and the speed is better than the general clustering algorithm, so it is proposed to use the histogram contrast to extract salient features, and then perform superpixel segmentation. Combined with the superpixel label image generation method of the present invention, the information entropy of the new image is extracted for threshold segmentation. , and finally fine-tune the target and background regions to obtain the final segmentation map.
附图说明Description of drawings
图1为本发明公开的一种基于PCBA的超像素图像分割方法的一种具体实施方式的流程图;1 is a flowchart of a specific implementation of a PCBA-based superpixel image segmentation method disclosed in the present invention;
图2为本发明中的显著图示例;Fig. 2 is the salient figure example in the present invention;
图3为本发明中的超像素分割图示例;3 is an example of a superpixel segmentation diagram in the present invention;
图4为超像素图像生成过程示意图;4 is a schematic diagram of a superpixel image generation process;
图5为不同最佳分割阈值的分割结果图;Fig. 5 is a segmentation result diagram of different optimal segmentation thresholds;
图6为过滤目标区域面积小于70后的最终分割结果图;Fig. 6 is the final segmentation result graph after filtering target area area is less than 70;
图7为不同算法的显著图对比结果,行(a)为原始图片,行(b)为Ground Truth,(c)-(h)分别为Watershed,SNIC,Mean-Shift,LSC,SLIC以及K-means算法的结果图,(i)为本发明的结果图;Figure 7 shows the comparison results of saliency maps of different algorithms, row (a) is the original image, row (b) is Ground Truth, (c)-(h) are Watershed, SNIC, Mean-Shift, LSC, SLIC and K- The result graph of means algorithm, (i) is the result graph of the present invention;
图8为不同算法的PR曲线对比图;Fig. 8 is the PR curve comparison diagram of different algorithms;
图9为不同算法的ROC曲线对比图。Figure 9 is a comparison chart of ROC curves of different algorithms.
具体实施方式Detailed ways
下面结合附图对本发明作进一步的详细说明。The present invention will be further described in detail below in conjunction with the accompanying drawings.
如图1所示,本发明公开了一种基于PCBA的超像素图像分割方法,包括:As shown in Figure 1, the present invention discloses a method for superpixel image segmentation based on PCBA, including:
S1、获取原始图像;S1. Obtain the original image;
因为初始的PCBA图片由工业相机拍摄,平均像素在2777*2138左右,为了便于后续的计算,可将原始图像进行裁剪,例如,可裁剪为常用图像处理尺寸512*512大小。Because the initial PCBA picture is taken by an industrial camera, the average pixel is about 2777*2138. In order to facilitate subsequent calculations, the original image can be cropped, for example, it can be cropped to a common image processing size of 512*512.
S2、提升所述原始图像的对比度得到输入图像;S2, enhancing the contrast of the original image to obtain an input image;
为了便于后续的特征提取,因此可先对原始图像进行图像预处理,可直接使用的Matlab软件中的stretchlim函数来自适应的找到一个分割阈值向量来改变一幅图像的对比度,可得到一个灰度变换自适应最佳阈值。In order to facilitate subsequent feature extraction, image preprocessing can be performed on the original image first, and the stretchlim function in the Matlab software can be directly used to adaptively find a segmentation threshold vector to change the contrast of an image, and a grayscale transformation can be obtained. Adaptive optimal threshold.
S3、将所述输入图像的RGB颜色通道量化为m个不同的颜色,并选择输入图像中出现频率最高的n个颜色作为高频颜色代表所有的输入颜色,计算所述输入图像的显著值并生成显著图;S3, quantize the RGB color channels of the input image into m different colors, and select the n colors with the highest frequency in the input image as high-frequency colors to represent all input colors, calculate the significant value of the input image and generate a saliency map;
具体的,可将12个不同的颜色,选择85个高频颜色代表所有的输入颜色。视觉系统对于视觉信号的对比度比较敏感,因此,基于直方图对比度来提取显著特征效果比较明显。Specifically, 12 different colors can be selected, and 85 high-frequency colors can be selected to represent all input colors. The visual system is more sensitive to the contrast of visual signals, therefore, it is more effective to extract salient features based on histogram contrast.
S4、对所述显著图进行超像素分割,并获取超像素标签;S4, performing superpixel segmentation on the saliency map, and obtaining superpixel labels;
S5、基于超像素标签创建超像素图像,所述超像素图像中的每个像素的像素值为对应超像素块的平均灰度值;S5, create a superpixel image based on the superpixel label, and the pixel value of each pixel in the superpixel image is the average gray value of the corresponding superpixel block;
如图4所示,为了计算的简洁,本发明中提出了一种利用标签信息生成新的超像素图像的方法,其中,超像素图像的每个像素值为超像素块的平均灰度值,计算公式如下所示:As shown in Figure 4, for the sake of simplicity of calculation, a method for generating a new superpixel image using label information is proposed in the present invention, wherein each pixel value of the superpixel image is the average gray value of the superpixel block, The calculation formula is as follows:
I(i)=f(O(i)),i=1,2,…,LI(i)=f(O(i)), i=1,2,...,L
其中,f为均值函数,X和Y为标签label=i的坐标集合,g(x,y)为(x,y)的像素值,O(i)为第i个标签对应的像素块的灰度值,即所有属于第i个标签的像素点灰度值之和。将这些新的像素值按从原始位置左到右顺序排列为一个28*28的矩阵,构成新图。Among them, f is the mean function, X and Y are the coordinate set of the label label=i, g(x, y) is the pixel value of (x, y), and O(i) is the gray of the pixel block corresponding to the ith label The degree value, that is, the sum of the gray values of all pixels belonging to the ith label. Arrange these new pixel values into a 28*28 matrix from the original position left to right to form a new image.
现有技术一般是直接对原图进行操作,通过获取原图的信息熵之类的来分割图像,或者直接利用SNIC算法直接分割,目前还没有看到利用超像素标签生成超像素图像,因为超像素图像像素大小很小,但是却保留了原图的边缘等重要信息,计算速度上就有很大的提升,利用这个方法来计算信息熵速度更快,且信息丢失的影响很小。In the prior art, the original image is generally operated directly, and the image is segmented by obtaining the information entropy of the original image, or the SNIC algorithm is directly used for direct segmentation. The pixel size of the pixel image is small, but it retains important information such as the edge of the original image, and the calculation speed is greatly improved. Using this method to calculate the information entropy is faster, and the impact of information loss is small.
S6、对所述超像素图像采用最大阈值分割法求得最佳分割阈值,基于所述最佳分割阈值将所述原始图像分割为目标区域和背景区域,生成由目标区域与背景区域组成的分割图。S6, using the maximum threshold segmentation method for the superpixel image to obtain the optimal segmentation threshold, and dividing the original image into a target area and a background area based on the optimal segmentation threshold, and generating a segmentation consisting of the target area and the background area. picture.
与现有技术相比,针对PCBA颜色信息简单,没有包含复杂的背景信息的特点,本发明在进行最终的分割之前,先利用超像素标签生成超像素图像,这样,既保留了原图的边缘等重要信息,不会造成目标的遗漏,又减少了需要处理的图像的像素,进而减少了计算成本,提高了分割的效率。Compared with the prior art, in view of the characteristics that the color information of the PCBA is simple and does not contain complex background information, the present invention uses the superpixel label to generate a superpixel image before the final segmentation, so that the edges of the original image are preserved. and other important information, it will not cause the omission of the target, and reduce the pixels of the image to be processed, thereby reducing the computational cost and improving the efficiency of segmentation.
如图2所示,具体实施时,步骤S3中显著值的计算公式如下:As shown in Figure 2, when implementing, the calculation formula of the significant value in step S3 is as follows:
式中,S(c)为输入颜色c的显著值,ci为输入颜色c的第i个最近邻颜色,k为最近邻颜色的个数,S(ci)为ci对应的初始显著值,Pj为输入颜色c的第j个最近邻颜色cj的概率,即灰度值为第j个最近邻颜色cj对应的灰度值的像素点数量占输入图像的像素点总数量的比重,D(ci,cj)输入颜色c的第i个最近邻颜色和第j个最近邻颜色在LAB颜色空间内的距离,D为输入颜色c与其k个最近邻颜色的距离之和, In the formula, S(c) is the saliency value of the input color c, c i is the ith nearest neighbor color of the input color c, k is the number of nearest neighbor colors, and S(ci ) is the initial saliency corresponding to c i . value, P j is the probability of the j-th nearest neighbor color c j of the input color c, that is, the ratio of the number of pixels with the gray value of the gray value corresponding to the j-th nearest neighbor color c j to the total number of pixels in the input image , D(c i , c j ) the distance between the ith nearest neighbor color and the jth nearest neighbor color of the input color c in the LAB color space, D is the sum of the distances between the input color c and its k nearest neighbor colors,
可将RGB颜色通道量化得到12个不同值,选出高频颜色,且选出的颜色覆盖95%以上的像素,高频颜色个数可取为85。The RGB color channel can be quantized to obtain 12 different values, and the high-frequency color is selected, and the selected color covers more than 95% of the pixels, and the number of high-frequency colors can be taken as 85.
颜色覆盖95%以上是指选出来颜色像素值占整幅图像颜色像素值的95%以上,选取出来代替整幅图像颜色可以减少计算量。The color coverage of more than 95% means that the selected color pixel value accounts for more than 95% of the color pixel value of the entire image, and selecting the color to replace the entire image can reduce the amount of calculation.
如图3所示,具体实施时,步骤S4中,利用SNIC超像素分割算法对所述显著图进行超像素分割。As shown in FIG. 3 , during specific implementation, in step S4 , the SNIC superpixel segmentation algorithm is used to perform superpixel segmentation on the saliency map.
对显著图的超像素分割,可采用SLIC算法及SNIC算法,利用SNIC算法对获取的显著图进行超像素分割,SNIC算法在每一次加入新的像素到超像素块中时,重新计算每个超像素块的平均值,并更换像素块的中心值,不需要迭代,速度优于一般的聚类算法。此外,SNIC算法的搜索范围为每个中心点的4或8个邻域,这样可以避免某些像素由于距离超像素块中心点的距离较近而被误划分到该超像素块中的现象,提高了分割精度。For the superpixel segmentation of the saliency map, the SLIC algorithm and the SNIC algorithm can be used. The SNIC algorithm is used to perform superpixel segmentation on the acquired saliency map. The SNIC algorithm recalculates each superpixel every time a new pixel is added to the superpixel block. The average value of the pixel block, and the center value of the pixel block is replaced, no iteration is required, and the speed is better than the general clustering algorithm. In addition, the search range of the SNIC algorithm is 4 or 8 neighborhoods of each center point, which can avoid the phenomenon that some pixels are mistakenly divided into the superpixel block due to the short distance from the center point of the superpixel block. Improved segmentation accuracy.
超像素距离计算公式如下:The superpixel distance calculation formula is as follows:
其中dlab为LAB颜色空间的颜色距离,dxy为两个像素间的颜色距离,l、a和b分别为LAB颜色空间的3个颜色特征分量,x和y为坐标位置分量,为平衡因子,N为输入图像像素数量,L为超像素个数,M为平衡因子。具体可取平衡因子M=20,超像素个数L=800。where d lab is the color distance in the LAB color space, d xy is the color distance between two pixels, l, a, and b are the three color feature components in the LAB color space, respectively, and x and y are the coordinate position components, is the balance factor, N is the number of pixels in the input image, L is the number of superpixels, and M is the balance factor. Specifically, the balance factor M=20, and the number of superpixels L=800.
如图5所示,具体实施时,步骤S6包括:As shown in FIG. 5 , during specific implementation, step S6 includes:
S601、计算初始分割阈值,所述初始分割阈值等于所述超像素图像的灰度值的最大值与最小值的均值;S601, calculate the initial segmentation threshold, the initial segmentation threshold is equal to the mean value of the maximum value and the minimum value of the gray value of the superpixel image;
S602、基于所述初始分割阈值将所述超像素图像分割为超像素目标区域与超像素背景区域,通过信息熵公式迭代更新初始分割阈值,得到最佳分割阈值;S602, based on the initial segmentation threshold, the superpixel image is divided into a superpixel target area and a superpixel background area, and the initial segmentation threshold is iteratively updated by an information entropy formula to obtain an optimal segmentation threshold;
S603、基于所述最佳分割阈值将所述原始图像分割为目标区域和背景区域;S603, dividing the original image into a target area and a background area based on the optimal segmentation threshold;
S604、生成由目标区域与背景区域组成的分割图。S604. Generate a segmentation map composed of the target area and the background area.
信息熵计算公式如下:The information entropy calculation formula is as follows:
其中,Ho和Hb分别为目标区域和背景区域的信息熵,HI为图片的信息熵,当HI在迭代之后达到最大值时获得最佳分割阈值,(q,r)为最佳分割阈值Tmax的坐标,和分别为目标区域和背景区域的总概率和,且Pb=1-Po,p(i,j)为直方图中像素点(i,j)的概率。依据获得的最佳分割阈值对原始图像进行阈值分割,得到分割图。Among them, H o and H b are the information entropy of the target area and the background area, respectively, H I is the information entropy of the picture, when H I reaches the maximum value after iteration, the optimal segmentation threshold is obtained, (q, r) is the best the coordinates of the segmentation threshold T max , and are the total probability sum of the target area and the background area, respectively, and P b =1-P o , p(i,j) is the probability of the pixel point (i,j) in the histogram. Perform threshold segmentation on the original image according to the obtained optimal segmentation threshold to obtain a segmentation map.
如图6所示,具体实施时,还包括:As shown in Figure 6, when implemented, it also includes:
S7、将分割图中目标面积小于过滤阈值的区域过滤为背景区域。S7. Filter the area where the target area in the segmentation map is smaller than the filtering threshold as the background area.
对于本发明公开的基于PCBA的超像素图像分割方法的效果,可用以下性能参考指标进行评价:For the effect of the PCBA-based superpixel image segmentation method disclosed in the present invention, the following performance reference indicators can be used to evaluate:
其中,S表示归一化为[0,1]之间的显著性估计结果,G表示显著性真值标定,W和H为对应图像的宽和高,MAE值越小,算法性能越好,TP表示二值显著性结果中目标区域与真值显著性标定中一致的像素个数,TN表示二值显著性结果中背景区域与真值显著性标定中一致的像素个数,FP表示二值显著性结果中被错误划分为目标的像素的个数,FN表示二值显著性结果中被错误划分为背景的像素的个数,Precision为查准率,是指在算法生成的所有前景像素中被正确标定的像素的比率,Recall为查全率,是指在实际真值标定的前景像素中被算法正确标定的像素的比率,以查全率为横轴,查准率为纵轴,可得到PR曲线,曲线越靠近右上角,算法性能越好,β2=0.3,Fβ(F-measure)同时考虑了查准率和查全率,算法性能与Fβ的值成正比,FPR为假阳性概率(False Positive Rate),作横轴,TPR为真阳性概率(True Positive Rate),作纵轴,绘制出的ROC曲线越靠近左上角,表示算法性能越好,AUC指标(the Area Under the receiver operating characteristic Curve),即ROC曲线下的面积,值越大算法性能越好。Among them, S represents the saliency estimation result normalized to [0, 1], G represents the true saliency calibration, W and H are the width and height of the corresponding image, the smaller the MAE value, the better the algorithm performance. TP represents the number of pixels in the target area in the binary saliency result that are consistent with the true value saliency calibration, TN represents the number of pixels in the background area in the binary saliency result that are consistent with the true value saliency calibration, and FP represents the binary saliency The number of pixels that are wrongly classified as the target in the saliency result, FN represents the number of pixels that are wrongly classified as the background in the binary saliency result, and Precision is the precision rate, which refers to all foreground pixels generated by the algorithm. The ratio of correctly calibrated pixels, Recall is the recall ratio, which refers to the ratio of the pixels correctly calibrated by the algorithm in the foreground pixels calibrated by the actual true value. The recall is the horizontal axis and the precision is the vertical axis. The PR curve is obtained. The closer the curve is to the upper right corner, the better the algorithm performance. β 2 =0.3, F β (F-measure) takes both precision and recall into account, and the algorithm performance is proportional to the value of F β . FPR is False Positive Rate, on the horizontal axis, TPR is True Positive Rate, on the vertical axis, the closer the drawn ROC curve is to the upper left corner, the better the algorithm performance is. The AUC indicator (the Area Under the receiver operating characteristic Curve), that is, the area under the ROC curve, the larger the value, the better the algorithm performance.
以原始图像尺寸为512*512,将RGB颜色通道量化得到12个不同值,高频颜色数取85,M=20,L=800为例,则标签数量为784,超像素图片大小为28*28。表1为不同过滤阈值下的MAE值与运行时间对比。Taking the original image size as 512*512, quantizing the RGB color channels to obtain 12 different values, the number of high-frequency colors is 85, M=20, L=800 as an example, the number of labels is 784, and the size of the superpixel image is 28* 28. Table 1 shows the comparison of MAE value and running time under different filtering thresholds.
表1不同过滤阈值下的评价指标对比表Table 1 Comparison of evaluation indicators under different filtering thresholds
从表1可以看出,当过滤阈值为70时,MAE的值趋于平稳,运行时间也趋于平稳,因此选择70作为本发明的过滤阈值。It can be seen from Table 1 that when the filtering threshold is 70, the value of MAE tends to be stable, and the running time also tends to be stable, so 70 is selected as the filtering threshold of the present invention.
在完成图像分割之后,统计得到实验中的显著图,MAE,F-measure,PR曲线,ROC曲线以及运行时间,作为有效的模型性能参考指标,表2为不同算法下的MAE、F-measure与运行时间的对比。After the image segmentation is completed, the statistical significance map, MAE, F-measure, PR curve, ROC curve and running time in the experiment are obtained, which are used as effective model performance reference indicators. Table 2 shows the MAE, F-measure and Comparison of running time.
表2不同算法下的定量对比表Table 2 Quantitative comparison table under different algorithms
从表2可以看出,本发明拥有最高的F-measure值与最低的MAE值,尽管运行时间比Watershed算法低,但其他的指标远优于Watershed算法。It can be seen from Table 2 that the present invention has the highest F-measure value and the lowest MAE value. Although the running time is lower than that of the Watershed algorithm, other indicators are far better than the Watershed algorithm.
如图7至图9所示,从以上实验可以看出,针对传统图像超像素分割算法对PCBA图像分割时存在一些欠分割现象,提出了一种基于PCBA的超像素图像分割算法,同时兼顾了算法效率与准确率。利用梯度直方图对比度算法提取显著性特征,再利用超像素分割算法分割显著图,利用分割算法得到的超像素标签生成新的图像,并提取新图的信息熵,利用信息熵阈值分割原图,并过滤掉分割图中目标面积小于70的区域,得到最终的分割结果图,最终的F-measure值为0.7979,MAE值为0.040567,优于其他六种算法。As shown in Figures 7 to 9, it can be seen from the above experiments that there are some under-segmentation phenomena in the traditional image superpixel segmentation algorithm when segmenting PCBA images, a superpixel image segmentation algorithm based on PCBA is proposed, which takes into account the Algorithm efficiency and accuracy. Use the gradient histogram contrast algorithm to extract the saliency features, and then use the superpixel segmentation algorithm to segment the saliency map, use the superpixel labels obtained by the segmentation algorithm to generate a new image, extract the information entropy of the new image, and use the information entropy threshold to segment the original image. And filter out the areas where the target area is less than 70 in the segmentation map, and get the final segmentation result map. The final F-measure value is 0.7979, and the MAE value is 0.040567, which is better than the other six algorithms.
以上仅是本发明优选的实施方式,需指出是,对于本领域技术人员在不脱离本技术方案的前提下,还可以做出若干变形和改进,上述变形和改进的技术方案应同样视为落入本申请要求保护的范围。The above are only the preferred embodiments of the present invention. It should be pointed out that for those skilled in the art, without departing from the technical solution, some deformations and improvements can be made, and the technical solutions of the above-mentioned deformations and improvements should also be regarded as falling into the scope of protection claimed in this application.
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010397755.5A CN111583279A (en) | 2020-05-12 | 2020-05-12 | A Superpixel Image Segmentation Method Based on PCBA |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010397755.5A CN111583279A (en) | 2020-05-12 | 2020-05-12 | A Superpixel Image Segmentation Method Based on PCBA |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111583279A true CN111583279A (en) | 2020-08-25 |
Family
ID=72112172
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010397755.5A Pending CN111583279A (en) | 2020-05-12 | 2020-05-12 | A Superpixel Image Segmentation Method Based on PCBA |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111583279A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108447050A (en) * | 2018-03-07 | 2018-08-24 | 湘潭大学 | A kind of Surface Flaw dividing method based on super-pixel |
CN112085749A (en) * | 2020-09-10 | 2020-12-15 | 桂林电子科技大学 | Multi-scale non-iterative superpixel segmentation method |
CN113205525A (en) * | 2021-03-23 | 2021-08-03 | 中国科学院南京土壤研究所 | Soil image segmentation and extraction method based on super-green index and super-pixel |
CN113409338A (en) * | 2021-06-24 | 2021-09-17 | 西安交通大学 | Super-pixel method based on probability distribution |
CN113506266A (en) * | 2021-07-09 | 2021-10-15 | 平安科技(深圳)有限公司 | Method, device and equipment for detecting tongue greasy coating and storage medium |
CN113593008A (en) * | 2021-07-06 | 2021-11-02 | 四川大学 | True 3D image significant reconstruction method under complex scene |
CN113808206A (en) * | 2021-09-14 | 2021-12-17 | 广东三水合肥工业大学研究院 | Typesetting system and method based on visual tracking robot |
CN114049360A (en) * | 2022-01-13 | 2022-02-15 | 南通海恒纺织设备有限公司 | Textile dyeing toner mixing control method and system based on graph cut algorithm |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105261037A (en) * | 2015-10-08 | 2016-01-20 | 重庆理工大学 | Moving object detection method capable of automatically adapting to complex scenes |
CN105809651A (en) * | 2014-12-16 | 2016-07-27 | 吉林大学 | Image saliency detection method based on edge non-similarity comparison |
CN106296695A (en) * | 2016-08-12 | 2017-01-04 | 西安理工大学 | Adaptive threshold natural target image based on significance segmentation extraction algorithm |
CN106447679A (en) * | 2016-10-17 | 2017-02-22 | 大连理工大学 | Obviousness detection method based on grabcut and adaptive cluster clustering |
CN106981068A (en) * | 2017-04-05 | 2017-07-25 | 重庆理工大学 | A kind of interactive image segmentation method of joint pixel pait and super-pixel |
CN107229917A (en) * | 2017-05-31 | 2017-10-03 | 北京师范大学 | A kind of several remote sensing image general character well-marked target detection methods clustered based on iteration |
CN107967480A (en) * | 2016-10-19 | 2018-04-27 | 北京联合大学 | A kind of notable object extraction method based on label semanteme |
CN108921820A (en) * | 2018-05-30 | 2018-11-30 | 咸阳师范学院 | A kind of saliency object detection method based on feature clustering and color contrast |
CN109636784A (en) * | 2018-12-06 | 2019-04-16 | 西安电子科技大学 | Saliency object detection method based on maximum neighborhood and super-pixel segmentation |
CN109685806A (en) * | 2018-11-14 | 2019-04-26 | 武汉科技大学 | Image significance detection method and device |
CN109829423A (en) * | 2019-01-18 | 2019-05-31 | 电子科技大学 | A kind of icing lake infrared imaging detection method |
CN109886267A (en) * | 2019-01-29 | 2019-06-14 | 杭州电子科技大学 | A saliency detection method for low-contrast images based on optimal feature selection |
CN110428371A (en) * | 2019-07-03 | 2019-11-08 | 深圳大学 | Image defogging method, system, storage medium and electronic equipment based on super-pixel segmentation |
CN110866896A (en) * | 2019-10-29 | 2020-03-06 | 中国地质大学(武汉) | Image saliency object detection method based on k-means and level set superpixel segmentation |
-
2020
- 2020-05-12 CN CN202010397755.5A patent/CN111583279A/en active Pending
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105809651A (en) * | 2014-12-16 | 2016-07-27 | 吉林大学 | Image saliency detection method based on edge non-similarity comparison |
CN105261037A (en) * | 2015-10-08 | 2016-01-20 | 重庆理工大学 | Moving object detection method capable of automatically adapting to complex scenes |
CN106296695A (en) * | 2016-08-12 | 2017-01-04 | 西安理工大学 | Adaptive threshold natural target image based on significance segmentation extraction algorithm |
CN106447679A (en) * | 2016-10-17 | 2017-02-22 | 大连理工大学 | Obviousness detection method based on grabcut and adaptive cluster clustering |
CN107967480A (en) * | 2016-10-19 | 2018-04-27 | 北京联合大学 | A kind of notable object extraction method based on label semanteme |
CN106981068A (en) * | 2017-04-05 | 2017-07-25 | 重庆理工大学 | A kind of interactive image segmentation method of joint pixel pait and super-pixel |
CN107229917A (en) * | 2017-05-31 | 2017-10-03 | 北京师范大学 | A kind of several remote sensing image general character well-marked target detection methods clustered based on iteration |
CN108921820A (en) * | 2018-05-30 | 2018-11-30 | 咸阳师范学院 | A kind of saliency object detection method based on feature clustering and color contrast |
CN109685806A (en) * | 2018-11-14 | 2019-04-26 | 武汉科技大学 | Image significance detection method and device |
CN109636784A (en) * | 2018-12-06 | 2019-04-16 | 西安电子科技大学 | Saliency object detection method based on maximum neighborhood and super-pixel segmentation |
CN109829423A (en) * | 2019-01-18 | 2019-05-31 | 电子科技大学 | A kind of icing lake infrared imaging detection method |
CN109886267A (en) * | 2019-01-29 | 2019-06-14 | 杭州电子科技大学 | A saliency detection method for low-contrast images based on optimal feature selection |
CN110428371A (en) * | 2019-07-03 | 2019-11-08 | 深圳大学 | Image defogging method, system, storage medium and electronic equipment based on super-pixel segmentation |
CN110866896A (en) * | 2019-10-29 | 2020-03-06 | 中国地质大学(武汉) | Image saliency object detection method based on k-means and level set superpixel segmentation |
Non-Patent Citations (3)
Title |
---|
ACHANTA R等: "Superpixels and polygons using simple non-iterative clustering", 《CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION》, pages 19 - 23 * |
廖苗 等: "一种新的图像超像素分割方法", 《电子与信息学报》 * |
李然 等 * |
Cited By (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108447050A (en) * | 2018-03-07 | 2018-08-24 | 湘潭大学 | A kind of Surface Flaw dividing method based on super-pixel |
CN112085749A (en) * | 2020-09-10 | 2020-12-15 | 桂林电子科技大学 | Multi-scale non-iterative superpixel segmentation method |
CN112085749B (en) * | 2020-09-10 | 2022-07-05 | 桂林电子科技大学 | Multi-scale non-iterative superpixel segmentation method |
CN113205525A (en) * | 2021-03-23 | 2021-08-03 | 中国科学院南京土壤研究所 | Soil image segmentation and extraction method based on super-green index and super-pixel |
CN113409338A (en) * | 2021-06-24 | 2021-09-17 | 西安交通大学 | Super-pixel method based on probability distribution |
CN113593008A (en) * | 2021-07-06 | 2021-11-02 | 四川大学 | True 3D image significant reconstruction method under complex scene |
CN113506266A (en) * | 2021-07-09 | 2021-10-15 | 平安科技(深圳)有限公司 | Method, device and equipment for detecting tongue greasy coating and storage medium |
CN113808206A (en) * | 2021-09-14 | 2021-12-17 | 广东三水合肥工业大学研究院 | Typesetting system and method based on visual tracking robot |
CN113808206B (en) * | 2021-09-14 | 2024-02-02 | 广东三水合肥工业大学研究院 | Typesetting system and method based on vision tracking robot |
CN114049360A (en) * | 2022-01-13 | 2022-02-15 | 南通海恒纺织设备有限公司 | Textile dyeing toner mixing control method and system based on graph cut algorithm |
CN114049360B (en) * | 2022-01-13 | 2022-03-22 | 南通海恒纺织设备有限公司 | Textile dyeing toner mixing control method and system based on graph cut algorithm |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111583279A (en) | A Superpixel Image Segmentation Method Based on PCBA | |
CN107016677B (en) | A cloud image segmentation method based on FCN and CNN | |
CN105574534B (en) | Conspicuousness object detection method based on sparse subspace clustering and low-rank representation | |
CN105761266B (en) | The method that Rectangle building is extracted from remote sensing images | |
CN111340824B (en) | An Image Feature Segmentation Method Based on Data Mining | |
CN108629783B (en) | Image segmentation method, system and medium based on image feature density peak search | |
CN107229917B (en) | A common salient target detection method for multiple remote sensing images based on iterative clustering | |
CN115861135A (en) | Image enhancement and identification method applied to box panoramic detection | |
CN104778457B (en) | Video face identification method based on multi-instance learning | |
CN109325507B (en) | Image classification method and system combining super-pixel saliency features and HOG features | |
CN102542571B (en) | Moving target detecting method and device | |
CN106991686B (en) | A kind of level set contour tracing method based on super-pixel optical flow field | |
CN106447676A (en) | Image segmentation method based on rapid density clustering algorithm | |
CN105528794A (en) | Moving object detection method based on Gaussian mixture model and superpixel segmentation | |
CN110569782A (en) | A target detection method based on deep learning | |
CN108846844A (en) | A kind of sea-surface target detection method based on sea horizon | |
CN115147746B (en) | Saline-alkali geological identification method based on unmanned aerial vehicle remote sensing image | |
CN114359323B (en) | Image target area detection method based on visual attention mechanism | |
CN113657225B (en) | A target detection method | |
CN115937160A (en) | Explosion fireball contour detection method based on convex hull algorithm | |
CN106529472B (en) | Object detection method and device based on large scale high-resolution high spectrum image | |
CN117372463A (en) | Image segmentation optimization method for power component image | |
CN112101283A (en) | Intelligent identification method and system for traffic signs | |
CN104268845A (en) | Self-adaptive double local reinforcement method of extreme-value temperature difference short wave infrared image | |
CN108491883B (en) | Saliency detection optimization method based on conditional random field |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200825 |
|
RJ01 | Rejection of invention patent application after publication |