[go: up one dir, main page]

CN114627289B - Industrial part instance segmentation method based on voting mechanism - Google Patents

Industrial part instance segmentation method based on voting mechanism Download PDF

Info

Publication number
CN114627289B
CN114627289B CN202210176960.8A CN202210176960A CN114627289B CN 114627289 B CN114627289 B CN 114627289B CN 202210176960 A CN202210176960 A CN 202210176960A CN 114627289 B CN114627289 B CN 114627289B
Authority
CN
China
Prior art keywords
image
segmentation
pixel
foreground
background
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210176960.8A
Other languages
Chinese (zh)
Other versions
CN114627289A (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.)
Shenyang Intelligent Robot Innovation Center Co ltd
Shenyang Intelligent Robot National Research Institute Co ltd
Shenyang Institute of Automation of CAS
Original Assignee
Shenyang Intelligent Robot Innovation Center Co ltd
Shenyang Intelligent Robot National Research Institute Co ltd
Shenyang Institute of Automation of CAS
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 Shenyang Intelligent Robot Innovation Center Co ltd, Shenyang Intelligent Robot National Research Institute Co ltd, Shenyang Institute of Automation of CAS filed Critical Shenyang Intelligent Robot Innovation Center Co ltd
Priority to CN202210176960.8A priority Critical patent/CN114627289B/en
Publication of CN114627289A publication Critical patent/CN114627289A/en
Application granted granted Critical
Publication of CN114627289B publication Critical patent/CN114627289B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/259Fusion by voting
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Image Analysis (AREA)

Abstract

本发明涉及基于投票机制的工业零件实例分割方法。其步骤为:选定三种图像分割方法,即为Graph Cut,GrabCut和OneCut;输入待分割工业零件图片后分别初始化Graph Cut,GrabCut和OneCut三种图像分割模型的初始参数;根据图像的灰度直方图、RGB三通道高斯混合模型和全图前景和背景的L1‑norm定义能量函数;最小化能量函数,输出三幅分割二值图;基于三幅分割二值图,引入投票机制,对三幅图像的每个像素点进行投票,输出最终分割图。本发明方法在不同工业环境下均能实现对零件精确且稳定的分割,精度高,鲁棒性强;而且,本发明可以直接部署在普通PC机上,无需消耗GPU资源,实现简单,实用性强。

The present invention relates to an industrial part instance segmentation method based on a voting mechanism. The steps are: select three image segmentation methods, namely Graph Cut, GrabCut and OneCut; input the industrial part picture to be segmented and initialize the initial parameters of the three image segmentation models of Graph Cut, GrabCut and OneCut respectively; define the energy function according to the grayscale histogram of the image, the RGB three-channel Gaussian mixture model and the L1-norm of the foreground and background of the whole image; minimize the energy function and output three segmentation binary images; based on the three segmentation binary images, introduce a voting mechanism, vote for each pixel of the three images, and output the final segmentation image. The method of the present invention can realize accurate and stable segmentation of parts in different industrial environments, with high precision and strong robustness; moreover, the present invention can be directly deployed on an ordinary PC without consuming GPU resources, and is simple to implement and highly practical.

Description

基于投票机制的工业零件实例分割方法Industrial parts instance segmentation method based on voting mechanism

技术领域Technical Field

本发明涉及机器学习和计算机视觉技术领域,具体的说是基于投票机制的工业零件实例分割方法。The present invention relates to the technical field of machine learning and computer vision, and in particular to an industrial part instance segmentation method based on a voting mechanism.

背景技术Background technique

中国工业正在向自动化、智能化方向转型,具有视觉的智能化工业机器人逐渐成为制造企业未来发展的主方向。在许多工业机器人应用场景中,工业零件的精确分割是智能化视觉机器人实现各种工业任务的必要前提。因此,实现一种高精度工业零件分割方法对于工业自动化和智能化发展具有重要意义。China's industry is transforming towards automation and intelligence, and intelligent industrial robots with vision are gradually becoming the main direction of future development for manufacturing companies. In many industrial robot application scenarios, accurate segmentation of industrial parts is a necessary prerequisite for intelligent visual robots to achieve various industrial tasks. Therefore, realizing a high-precision industrial parts segmentation method is of great significance to the development of industrial automation and intelligence.

现阶段传统的图像分割算法对于工业零件分割不具备高精度强鲁棒性的特点,很容易受到背景环境的影响,使得算法在不同情况下表现得分割效果有很大的差异。近年来深度学习相关算法被大量研究,该类算法拥有较高的分割精度和较强的鲁棒性,但是神经网络的训练十分消耗计算资源,且对硬件资源要求较高,增大了训练成本和经济成本。At present, traditional image segmentation algorithms do not have the characteristics of high accuracy and strong robustness for industrial parts segmentation, and are easily affected by the background environment, which makes the segmentation effect of the algorithm vary greatly under different circumstances. In recent years, deep learning related algorithms have been widely studied. Such algorithms have high segmentation accuracy and strong robustness, but the training of neural networks consumes a lot of computing resources and has high requirements for hardware resources, which increases the training cost and economic cost.

发明内容Summary of the invention

针对现有技术中的缺点,本发明实现了一种基于投票机制的工业零件实例分割方法。该方法基于图割理论,引入投票机制,将三个弱分割器转化为一个强分割器,实现工业零件的精准分割。和传统分割算法相比具有更高的分割效果和更强的鲁棒性,和深度学习相关算法相比,具有更高的实用性。In view of the shortcomings of the prior art, the present invention implements an industrial parts instance segmentation method based on a voting mechanism. The method is based on graph cut theory and introduces a voting mechanism to transform three weak segmenters into a strong segmenter to achieve accurate segmentation of industrial parts. Compared with traditional segmentation algorithms, it has higher segmentation effect and stronger robustness, and compared with deep learning related algorithms, it has higher practicality.

本发明为实现上述目的所采用的技术方案是:基于投票机制的工业零件实例分割方法,包括以下步骤:The technical solution adopted by the present invention to achieve the above-mentioned purpose is: an industrial part instance segmentation method based on a voting mechanism, comprising the following steps:

采集工业零件原始图像;Collect original images of industrial parts;

基于图像分割方法Graph Cut、GrabCut和OneCut构造强分割器对原始图像进行处理,识别前景和背景区域输出三幅二值图像;Based on the image segmentation methods Graph Cut, GrabCut and OneCut, a strong segmenter is constructed to process the original image, identify the foreground and background areas and output three binary images;

基于投票机制逐像素融合优化,制作掩膜图像;Based on the voting mechanism, pixel-by-pixel fusion optimization is performed to produce mask images;

对原始图像进行掩膜操作,得到工业零件分割图。Perform mask operation on the original image to obtain the industrial parts segmentation map.

所述基于图像分割方法Graph Cut、GrabCut和OneCut构造强分割器的步骤,包括:The step of constructing a strong segmenter based on the image segmentation methods Graph Cut, GrabCut and OneCut comprises:

1)定义能量函数:基于图像的灰度直方图定义Graph Cut能量函数E(L),基于图像RGB高斯混合模型GMM定义GrabCut能量函数E(α,k,θ,z),基于全图前景和背景的L1-norm定义OneCut能量函数E(S),用于衡量图像中前景区域、背景区域和前景和背景交界处的相似性,从而实现图像分割;1) Define energy function: define Graph Cut energy function E(L) based on the grayscale histogram of the image, define GrabCut energy function E(α, k, θ, z) based on the image RGB Gaussian mixture model GMM, and define OneCut energy function E(S) based on the L1-norm of the foreground and background of the whole image, which is used to measure the similarity of the foreground area, background area and the junction of the foreground and background in the image, so as to achieve image segmentation;

2)初始化三种图分割方法的模型参数,将原始图像中目标前景或背景的像素特征分别输入给三个能量函数;2) Initialize the model parameters of the three image segmentation methods, and input the pixel features of the target foreground or background in the original image into the three energy functions respectively;

3)执行最小化能量函数的计算过程,用于将前景和背景分离;3) Execute the calculation process of minimizing the energy function to separate the foreground and background;

4)输出对应的三幅分割二值图。4) Output the corresponding three segmentation binary images.

所述三种能量函数定义如下:The three energy functions are defined as follows:

其中,L为图像像素的类别标签,可表示为L={l1,l2,...,ln},li∈{0,1},0表示当前像素属于背景,1表示当前像素属于前景,R(L)为区域项,B(L)为边界项,a∈[0,1]为影响因子,表示对能量函数的影响程度;α∈{0,1},表示是背景模型的GMM分量还是前景模型的GMM分量,k为GMM高斯分量参数,k∈{1,2,...,K};θ为对应各个像素的GMM参数;U(α,k,θ,z)表示区域项,V(α,z)表示边界项,z为图像中像素的值;β,λ为可调参数,S表示前景点的集合,θS表示前景点的颜色直方图,表示背景点的颜色直方图,/>表示区域项,/>是边界项。Wherein, L is the category label of the image pixel, which can be expressed as L={ l1 , l2 ,..., ln }, l i ∈{0,1}, 0 indicates that the current pixel belongs to the background, 1 indicates that the current pixel belongs to the foreground, R(L) is the region term, B(L) is the boundary term, a∈[0,1] is the influence factor, indicating the degree of influence on the energy function; α∈{0,1}, indicating whether it is the GMM component of the background model or the GMM component of the foreground model, k is the GMM Gaussian component parameter, k∈{1,2,...,K}; θ is the GMM parameter corresponding to each pixel; U(α,k,θ,z) represents the region term, V(α,z) represents the boundary term, z is the value of the pixel in the image; β, λ are adjustable parameters, S represents the set of foreground points, θ S represents the color histogram of the foreground points, Represents the color histogram of background points,/> Indicates a region item, /> is a boundary term.

基于投票机制逐像素融合优化为对三幅相同大小的分割二值图的相同位置的像素点进行投票,确定该像素点的值。The pixel-by-pixel fusion optimization based on the voting mechanism is to vote for the pixels at the same position of three segmented binary images of the same size to determine the value of the pixel.

所述掩膜操作是根据二值图将原待分割图像中目标区域提取出来的操作。The mask operation is an operation of extracting the target area in the original image to be segmented according to the binary image.

所述该方法还采用评价指标MIoU对输出的分割图像与标准图像进行评价;The method also uses the evaluation index MIoU to evaluate the output segmented image and the standard image;

其中,N为测试样本数量,A,B为按照本方法获取的分割图像和制作的标准图像中目标区域,所述标准图像为对原始图像逐像素进行标注用于区分当前像素为前景或背景,A∩B为两区域交集,A∪B为两区域并集。Wherein, N is the number of test samples, A and B are the target areas in the segmented image obtained according to this method and the standard image produced, the standard image is annotated pixel by pixel in the original image to distinguish the current pixel as the foreground or background, A∩B is the intersection of the two areas, and A∪B is the union of the two areas.

本发明具有以下有益效果及优点:The present invention has the following beneficial effects and advantages:

1.本发明所述的一种基于投票机制的工业零件实例分割方法能有效地实现对不同场景下工业零件的精确分割,具有强鲁棒性。1. The industrial part instance segmentation method based on the voting mechanism described in the present invention can effectively realize the accurate segmentation of industrial parts in different scenarios and has strong robustness.

2.本发明所述的一种基于投票机制的工业零件实例分割方法能够实现高精度分割,分割效果好,相对误差小。2. The industrial part instance segmentation method based on the voting mechanism described in the present invention can achieve high-precision segmentation, good segmentation effect and small relative error.

3.本发明所述的一种基于投票机制的工业零件实例分割方法可以部署在普通PC机上,无需GPU资源,节约了计算资源,实现简单,具有更高实用性。3. The industrial part instance segmentation method based on the voting mechanism described in the present invention can be deployed on an ordinary PC, does not require GPU resources, saves computing resources, is simple to implement, and has higher practicality.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1为本发明方法流程图;Fig. 1 is a flow chart of the method of the present invention;

图2为本发明投票机制示意图。(a)为原图中目标所占区域,(b)、(c)、(d)分别为三种方法输出的分割图,(e)为最终输出的分割图。Figure 2 is a schematic diagram of the voting mechanism of the present invention. (a) is the area occupied by the target in the original image, (b), (c), and (d) are the segmentation maps output by the three methods respectively, and (e) is the final output segmentation map.

图3为本发明方法及其对比方法在11种不同工业环境下分割得到的二值图;第一列为输入图像,第二列为人为标注的标准图像,第3列为为本发明方法输出的二值分割图。FIG3 is a binary image obtained by segmenting the method of the present invention and its comparative method in 11 different industrial environments; the first column is the input image, the second column is the manually labeled standard image, and the third column is the binary segmentation image output by the method of the present invention.

图4为本发明方法及其对比方法在11种不同工业环境下分割得到的最终效果图。第一行为输入图像,第二行为标准图像转化成的分割图,第三行为本发明采用方法输出的最终分割效果图。Figure 4 shows the final segmentation results obtained by the method of the present invention and its comparative method in 11 different industrial environments. The first line is the input image, the second line is the segmentation map converted from the standard image, and the third line is the final segmentation effect map output by the method of the present invention.

具体实施方式Detailed ways

为使本发明的上述目的、特征和优点能够更加明显易懂,下面结合附图对本发明的具体实施方法做详细的说明。在下面的描述中阐述了很多具体细节以便于充分理解本发明。但本发明能够以很多不同于在此描述的其他方式来实施,本领域技术人员可以在不违背发明内涵的情况下做类似改进,因此本发明不受下面公开的具体实施的限制。In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific implementation method of the present invention is described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the invention, so the present invention is not limited by the specific implementation disclosed below.

除非另有定义,本文所使用的所有技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中在发明的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本发明。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the invention herein are only for the purpose of describing specific embodiments and are not intended to limit the present invention.

如图1所示,本发明方法主要包含以下步骤:As shown in Figure 1, the method of the present invention mainly comprises the following steps:

步骤1:给定待分割图像,利用Labelme软件制作图像的标签文件并转换成二值分割图作为标准图像。其中,标签文件定义了图像中前景的位置信息,用于生成白色前景,黑色背景的二值图标准图像;在使用本发明提出的方法得到最终的分割图后,需要和标准图像计算评价指标MIoU。Step 1: Given an image to be segmented, use Labelme software to create a label file for the image and convert it into a binary segmentation map as a standard image. The label file defines the location information of the foreground in the image and is used to generate a binary standard image with a white foreground and a black background. After the final segmentation map is obtained using the method proposed in the present invention, the evaluation index MIoU needs to be calculated with the standard image.

步骤2:基于图分割理论,选定三种图分割图像分割方法Graph Cut,GrabCut和OneCut。Step 2: Based on graph segmentation theory, three graph segmentation image segmentation methods Graph Cut, GrabCut and OneCut are selected.

定义Graph Cut,GrabCut和OneCut的能量函数。包括:基于图像的灰度直方图定义Graph Cut能量函数E(L);基于图像的RGB三通道高斯混合模型定义GrabCu能量函数E(α,k,θ,z);基于图像全局前景和背景的L1-norm定义OneCut能量函数E(S)。三种能量函数定义如下:Define the energy functions of Graph Cut, GrabCut and OneCut. Including: define the Graph Cut energy function E(L) based on the grayscale histogram of the image; define the GrabCu energy function E(α, k, θ, z) based on the RGB three-channel Gaussian mixture model of the image; define the OneCut energy function E(S) based on the L1-norm of the global foreground and background of the image. The three energy functions are defined as follows:

其中,L为图像像素的类别标签,可表示为L={l1,l2,...,ln},li∈{0,1},0表示当前像素属于背景,1表示当前像素属于前景。R(L)为区域项,B(L)为边界项,a∈[0,1]为影响因子,表示对能量函数的影响程度;Where L is the category label of the image pixel, which can be expressed as L = {l 1 ,l 2 ,...,l n }, l i ∈ {0,1}, 0 means the current pixel belongs to the background, 1 means the current pixel belongs to the foreground. R(L) is the region term, B(L) is the boundary term, a∈[0,1] is the influence factor, indicating the degree of influence on the energy function;

α∈{0,1},表示是背景模型的GMM分量还是前景模型的GMM分量,k为GMM高斯分量参数,k∈{1,2,...,K};θ为对应各个像素的GMM参数;U(α,k,θ,z)表示区域项,V(α,z)表示边界项,z为图像中像素的值;α∈{0,1}, indicating whether it is the GMM component of the background model or the GMM component of the foreground model, k is the GMM Gaussian component parameter, k∈{1,2,...,K}; θ is the GMM parameter corresponding to each pixel; U(α,k,θ,z) represents the region term, V(α,z) represents the boundary term, and z is the value of the pixel in the image;

β,λ为可调参数,S表示前景点的集合,θS表示前景点的颜色直方图,表示背景点的颜色直方图,/>表示区域项,/>是边界项。β, λ are adjustable parameters, S represents the set of foreground points, θ S represents the color histogram of the foreground points, Represents the color histogram of background points,/> Indicates a region item, /> is a boundary term.

灰度直方图是将数字图像中的所有像素,按照灰度值的大小,统计其出现的频率得来的。The grayscale histogram is obtained by counting the frequency of occurrence of all pixels in a digital image according to the size of their grayscale values.

RGB高斯混合模型是基于图像像素的RGB值来构建高斯混合模型,高斯混合模型即为使用高斯概率密度函数(正态分布曲线)精确地量化事物,它是一个将事物分解为若干的基于高斯概率密度函数(正态分布曲线)形成的模型。The RGB Gaussian mixture model is a Gaussian mixture model constructed based on the RGB values of image pixels. The Gaussian mixture model uses the Gaussian probability density function (normal distribution curve) to accurately quantify things. It is a model that decomposes things into several Gaussian probability density functions (normal distribution curves).

L1-norm是指图像中像素值的绝对差值,定义如下:L1-norm refers to the absolute difference of pixel values in an image and is defined as follows:

其中,xi,xj表示像素值,(i,j)表示像素对,n为像素对个数。Among them, x i , x j represent pixel values, (i, j) represents a pixel pair, and n is the number of pixel pairs.

步骤3:初始化Graph Cut,GrabCut和OneCut模型参数。通过在程序中或人机交互的方式在运行程序时通过鼠标在图像上点选的方式来指定图像中部分的目标前景像素点和目标背景像素点,使得三种能量函数能获得目标前景或背景的像素特征(即,E(L)中的L={l1,l2,...,ln}部分项,E(α,k,θ,z)中的像素值z,E(S)中的前景点S),使得能量函数最小化,获取三幅最小化时对应的二值图像。Step 3: Initialize the parameters of the Graph Cut, GrabCut and OneCut models. By clicking on the image with the mouse in the program or in a human-computer interactive way when running the program, specify some of the target foreground pixels and target background pixels in the image, so that the three energy functions can obtain the pixel features of the target foreground or background (i.e., the L={l 1 ,l 2 ,...,l n } part of E(L), the pixel value z in E(α,k,θ,z), and the foreground point S in E(S)), minimize the energy function, and obtain the three corresponding binary images when minimized.

最小化能量函数。Minimize the energy function.

所述基于图割理论的图像分割方法的基本思想是将图像映射为带权无向图,把像素视作节点,节点之间所连边的权重对应于两个像素间的相似性度量,割的容量对应能量函数。通过最小化能量函数实现图像分割。The basic idea of the image segmentation method based on graph cut theory is to map the image into a weighted undirected graph, regard pixels as nodes, the weight of the edge between nodes corresponds to the similarity measure between two pixels, and the capacity of the cut corresponds to the energy function. Image segmentation is achieved by minimizing the energy function.

能量函数定义中,包括边界项和区域项,其中区域项是基于定义能量函数的依据,即灰度直方图、RGB高斯混合模型和全局前景和背景的L1-norm。区域项表示的是对于一个像素分配类别标签(前景或背景)的惩罚,当对所有像素均分类正确时,区域项项最小,惩罚最小,能量函数最小。边界项反映的是相邻像素对的相似程度,当相邻两像素的相似度越高时,相邻像素同为前景或背景的几率更大;反之,则相邻像素处于前景和背景的交界处概率更大,此时边界项最小,从而最小化能量函数。The definition of the energy function includes boundary terms and region terms, where the region term is based on the basis for defining the energy function, namely the grayscale histogram, the RGB Gaussian mixture model, and the L1-norm of the global foreground and background. The region term represents the penalty for assigning a category label (foreground or background) to a pixel. When all pixels are correctly classified, the region term is the smallest, the penalty is the smallest, and the energy function is the smallest. The boundary term reflects the similarity between adjacent pixel pairs. When the similarity between two adjacent pixels is higher, the probability that the adjacent pixels are both foreground or background is greater; conversely, the probability that the adjacent pixels are at the junction of the foreground and background is greater. At this time, the boundary term is the smallest, thereby minimizing the energy function.

步骤4:输出二值图。最小化能量函数后,实现Graph Cut、GrabCut和OneCut的最小割,输出对应的分割二值图。此时,图像中像素点x被分为前景和背景两种类别,像素值p满足以下关系:Step 4: Output binary image. After minimizing the energy function, the minimum cut of Graph Cut, GrabCut and OneCut is achieved, and the corresponding segmented binary image is output. At this point, the pixel point x in the image is divided into two categories: foreground and background, and the pixel value p satisfies the following relationship:

步骤5:引入投票机制。所述投票机制是集成学习中针对分类问题的一种结合策略。其是一种遵循少数服从多数原则的集成学习模型,通过多个模型的集成降低方差,从而提高模型的鲁棒性。在理想情况下,投票法的预测效果应当优于任何一个基模型的预测效果。示意图如图2所示,对于步骤5中得到的三幅分割二值图,使用投票机制对于三幅图像中相同位置的像素点的值进行投票,得出最终的值。根据投票机制的原理,投票后的值要更贴近像素点的真实类别,同时可以提高模型的鲁棒性。投票过程如下:Step 5: Introduce a voting mechanism. The voting mechanism is a combination strategy for classification problems in ensemble learning. It is an ensemble learning model that follows the principle of majority rule, which reduces variance by integrating multiple models, thereby improving the robustness of the model. Ideally, the prediction effect of the voting method should be better than that of any base model. As shown in Figure 2, for the three segmented binary images obtained in step 5, a voting mechanism is used to vote on the values of the pixels at the same position in the three images to obtain the final value. According to the principle of the voting mechanism, the value after voting should be closer to the true category of the pixel, and at the same time, the robustness of the model can be improved. The voting process is as follows:

(1)给定三张分割二值图,g1,g2,g3;(1) Given three segmentation binary images, g1, g2, g3;

(2)归一化图像,将g1,g2,g3中每个像素点的值除以255,使得像素值为0或者1;(2) Normalize the image and divide the value of each pixel in g1, g2, and g3 by 255 so that the pixel value is 0 or 1;

(3)对于相同位置的三个像素点g1,p2,p3,求得三者的和p;(3) For the three pixels g1, p2, and p3 at the same position, find their sum p;

(4)如果满足p≥2,则将1赋值给最终输出的分割图上对应的像素点;否则,将0赋值给最终输出的分割图上对应的像素点,得到图 (4) If p ≥ 2, assign 1 to the corresponding pixel on the final output segmentation map; otherwise, assign 0 to the corresponding pixel on the final output segmentation map, and obtain

(5)将中每个像素点的值乘以255,得到分割二值图g。(5) The value of each pixel in is multiplied by 255 to obtain the segmentation binary image g.

步骤6:输出最终分割图。通过掩膜操作,将步骤4中得到的二值图转化为分割图,结合原图像和分割二值图,将原图中工业零件部分单独提取出来,实现分割,具体实现步骤如下:Step 6: Output the final segmentation map. Through mask operation, the binary image obtained in step 4 is converted into a segmentation map. The original image and the segmentation binary image are combined to extract the industrial parts in the original image separately to achieve segmentation. The specific implementation steps are as follows:

(1)给定最终分割二值图g和原输入图像S;(1) Given the final segmentation binary image g and the original input image S;

(2)将分割二值图g中每个像素点的像素值除以255,得到图g1(2) Divide the pixel value of each pixel in the segmented binary image g by 255 to obtain image g 1 ;

(3)将g1与原输入图像S相乘,使得背景部分像素值为0,前景部分像素值保持不变;(3) Multiply g1 by the original input image S so that the pixel values of the background part are 0 and the pixel values of the foreground part remain unchanged;

(4)输出最终分割图G。(4) Output the final segmentation map G.

为了验证本发明基于投票机制的工业零件分割方法的性能,对11种不同工业环境和不同工业零件随机组合的图像进行测试。从图3和图4中可以看出,本发明的算法能够综合考量其他算法的优点,加强了算法在边界处的响应从而实现更加精确的分割,MIoU可达0.985。而且,在11种不同环境下,VotingCut均能保持较高的分割精度和分割效果,说明本发明的方法具有强鲁棒性的优点。其中,评价指标MIoU如下:In order to verify the performance of the industrial parts segmentation method based on the voting mechanism of the present invention, images of 11 different industrial environments and different random combinations of industrial parts were tested. As can be seen from Figures 3 and 4, the algorithm of the present invention can comprehensively consider the advantages of other algorithms, strengthen the response of the algorithm at the boundary, and thus achieve more accurate segmentation, and the MIoU can reach 0.985. Moreover, in 11 different environments, VotingCut can maintain a high segmentation accuracy and segmentation effect, indicating that the method of the present invention has the advantage of strong robustness. Among them, the evaluation index MIoU is as follows:

其中,N为测试样本数量,A,B为按照本方法获取的分割图像和Labelme软件制作的标准图像中目标区域。A∩B为两区域交集,A∪B为两区域并集。Where N is the number of test samples, A and B are the target areas in the segmented image obtained by this method and the standard image produced by Labelme software. A∩B is the intersection of the two areas, and A∪B is the union of the two areas.

以上所述是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明所述原理的前提下,还可以做出若干改进和润饰,这些改进和润饰应视为本发明的保护范围。The above is a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should be regarded as within the scope of protection of the present invention.

Claims (4)

1. The industrial part example segmentation method based on the voting mechanism is characterized by comprising the following steps of:
Step 1, collecting an original image of an industrial part;
Step 2, constructing a strong divider based on an image dividing method Graph Cut, grabCut and OneCut to process an original image, and recognizing foreground and background areas to output three binary images;
The step of constructing a strong segmenter based on the image segmentation methods Graph Cut, grabCut and OneCut comprises the following steps:
Step 21) defining an energy function: defining a Graph Cut energy function E (L) based on a gray histogram of an image, defining a GrabCut energy function E (alpha, k, theta, z) based on an image RGB Gaussian mixture model GMM, and defining OneCut an energy function E (S) based on L1-norm of a full-image foreground and a full-image background, wherein the energy function E (S) is used for measuring similarity of foreground areas, background areas and foreground and background junctions in the image so as to realize image segmentation; the three energy functions are defined as follows:
Wherein L is a class label of an image pixel, which can be expressed as l= { L 1,l2,...,ln},li e {0,1},0 represents that the current pixel belongs to the background, 1 represents that the current pixel belongs to the foreground, R (L) is a region term, B (L) is a boundary term, a e [0,1] is an influence factor, and represents the influence degree on an energy function; alpha epsilon {0,1}, whether the model is a GMM component of a background model or a GMM component of a foreground model, K is a GMM Gaussian component parameter, and K epsilon {1, 2., K }; θ is the GMM parameter corresponding to each pixel; u (α, k, θ, z) represents a region term, V (α, z) represents a boundary term, and z is a value of a pixel in the image; beta, lambda is an adjustable parameter, S represents a set of foreground points, theta S represents a color histogram of the foreground points, represents a color histogram of the background points,/> represents a region term, is a boundary term
Step 22), initializing model parameters of three graph segmentation methods, and respectively inputting pixel characteristics of a target foreground or background in an original image into three energy functions;
Step 23) performing a calculation procedure of minimizing an energy function for separating the foreground and the background;
Step 24), outputting corresponding three segmentation binary images;
step 3, performing pixel-by-pixel fusion optimization based on a voting mechanism, and manufacturing a mask image;
And 4, performing mask operation on the original image to obtain an industrial part segmentation map.
2. The voting mechanism-based industrial part instance segmentation method according to claim 1, wherein the voting mechanism is based on pixel-by-pixel fusion optimization to vote on a pixel point at the same position of three segmentation binary images with the same size, and a value of the pixel point is determined.
3. The voting mechanism-based industrial part instance segmentation method according to claim 1, wherein the masking operation is an operation of extracting a target region in an original image to be segmented according to a binary image.
4. The voting mechanism-based industrial part example segmentation method according to claim 1, further comprising the step of evaluating the output segmented image with a standard image by using an evaluation index MIoU;
N is the number of test samples, A and B are target areas in the segmented image and the manufactured standard image obtained according to the method, the standard image is obtained by marking the original image pixel by pixel for distinguishing the current pixel as a foreground or a background, A N B is the intersection of two areas, and A U B is the union of the two areas.
CN202210176960.8A 2022-02-25 2022-02-25 Industrial part instance segmentation method based on voting mechanism Active CN114627289B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210176960.8A CN114627289B (en) 2022-02-25 2022-02-25 Industrial part instance segmentation method based on voting mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210176960.8A CN114627289B (en) 2022-02-25 2022-02-25 Industrial part instance segmentation method based on voting mechanism

Publications (2)

Publication Number Publication Date
CN114627289A CN114627289A (en) 2022-06-14
CN114627289B true CN114627289B (en) 2024-04-16

Family

ID=81899639

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210176960.8A Active CN114627289B (en) 2022-02-25 2022-02-25 Industrial part instance segmentation method based on voting mechanism

Country Status (1)

Country Link
CN (1) CN114627289B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117252885B (en) * 2023-09-05 2025-06-06 无锡科技职业学院 Automatic segmentation method of salient regions in industrial X-ray images

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105787948A (en) * 2016-03-23 2016-07-20 华中科技大学 Quick graph cutting method based on multiple deformation resolutions
CN107194949A (en) * 2017-05-18 2017-09-22 华中科技大学 A kind of interactive video dividing method and system for being matched based on block and strengthening Onecut
CN109117822A (en) * 2018-08-31 2019-01-01 贵州大学 A kind of part case segmentation recognition method based on deep learning
CN110738676A (en) * 2019-09-17 2020-01-31 湖南大学 A GrabCut Automatic Segmentation Algorithm Combining RGBD Data

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105787948A (en) * 2016-03-23 2016-07-20 华中科技大学 Quick graph cutting method based on multiple deformation resolutions
CN107194949A (en) * 2017-05-18 2017-09-22 华中科技大学 A kind of interactive video dividing method and system for being matched based on block and strengthening Onecut
CN109117822A (en) * 2018-08-31 2019-01-01 贵州大学 A kind of part case segmentation recognition method based on deep learning
CN110738676A (en) * 2019-09-17 2020-01-31 湖南大学 A GrabCut Automatic Segmentation Algorithm Combining RGBD Data

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A Parallel Version of the OneCut Image Segmentation Algorithm;Pruncu, A 等;《21st International Conference on Control Systems and Computer Science (CSCS)》;20181228;全文 *
基于图割的交互式彩色图像目标提取方法;徐秋平;《光电子·激光》;20191215;全文 *
基于非归一化直方图的GrabCut图像分割算法改进;孔显等;《计算机应用研究》;20190314;全文 *

Also Published As

Publication number Publication date
CN114627289A (en) 2022-06-14

Similar Documents

Publication Publication Date Title
Zhao et al. Recognition of building group patterns using graph convolutional network
CN113449594A (en) Multilayer network combined remote sensing image ground semantic segmentation and area calculation method
CN108305260B (en) Method, device and device for detecting corner points in an image
CN109446894B (en) A Multispectral Image Change Detection Method Based on Probabilistic Segmentation and Gaussian Mixture Clustering
CN106778821A (en) Classification of Polarimetric SAR Image method based on SLIC and improved CNN
CN111428762A (en) Interpretable remote sensing image feature classification method combining deep data learning and ontology knowledge reasoning
CN110633708A (en) Deep network significance detection method based on global model and local optimization
CN114037891A (en) Method and device for building extraction from high-resolution remote sensing images based on U-shaped attention control network
CN106611420A (en) SAR image segmentation method based on deconvolution network and sketch direction constraint
CN109284779A (en) Object detection method based on deep full convolution network
CN109829426B (en) Railway construction temporary building monitoring method and system based on high-resolution remote sensing image
CN118279320A (en) Method for establishing object instance segmentation model based on automatic hint learning and its application
CN108492298A (en) Based on the multispectral image change detecting method for generating confrontation network
CN115861715A (en) Knowledge representation enhancement-based image target relation recognition algorithm
CN110910497B (en) Method and system for realizing augmented reality map
CN112784757A (en) Marine SAR ship target significance detection and identification method
CN111080649A (en) An image segmentation processing method and system based on Riemannian manifold space
CN118155196A (en) Cross-scale retrieval algorithm for instrument panel recognition
CN114627289B (en) Industrial part instance segmentation method based on voting mechanism
CN104008376A (en) Multispectral remote-sensing image mixed pixel decomposition method based on possibility center point clustering
Chang et al. Method for building segmentation and extraction from high-resolution remote sensing images based on improved YOLOv5ds
CN119992494A (en) A road segmentation method based on LC-HRNet pixel-level fusion
CN116503591A (en) Image Segmentation Method Based on Weakly Supervised Neural Networks with Few Samples
CN112580509B (en) Logical reasoning pavement detection method and system
CN114882292A (en) Remote sensing image ocean target identification method based on cross-sample attention mechanism diagram neural network

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
GR01 Patent grant
GR01 Patent grant