Nothing Special   »   [go: up one dir, main page]

CN118570072A - Burr detection method and system in titanium metal processing process - Google Patents

Burr detection method and system in titanium metal processing process Download PDF

Info

Publication number
CN118570072A
CN118570072A CN202411046065.XA CN202411046065A CN118570072A CN 118570072 A CN118570072 A CN 118570072A CN 202411046065 A CN202411046065 A CN 202411046065A CN 118570072 A CN118570072 A CN 118570072A
Authority
CN
China
Prior art keywords
edge line
target
burr
pixel point
processing
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.)
Granted
Application number
CN202411046065.XA
Other languages
Chinese (zh)
Other versions
CN118570072B (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.)
Baoji Top Titanium Industry Co ltd
Original Assignee
Baoji Top Titanium Industry Co ltd
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 Baoji Top Titanium Industry Co ltd filed Critical Baoji Top Titanium Industry Co ltd
Priority to CN202411046065.XA priority Critical patent/CN118570072B/en
Publication of CN118570072A publication Critical patent/CN118570072A/en
Application granted granted Critical
Publication of CN118570072B publication Critical patent/CN118570072B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30136Metal
    • 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)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

本发明涉及图像分析领域,具体涉及一种钛金属加工过程中毛刺检测方法及系统。该方法首先获取待测加工钛金属表面的灰度图像,并进行边缘检测,获得灰度图像中的加工边缘线、疑似毛刺边缘线和纹理边缘线,根据疑似毛刺边缘线上各像素点灰度的变化,以及与加工边缘线上像素点灰度变化差异,获得疑似毛刺边缘线的毛刺可能性,分析疑似毛刺边缘线的参考纹理边缘线上各像素点的梯度值,获得疑似毛刺边缘线的毛刺模糊因子,进而基于获取的噪声影响因子对每个疑似毛刺边缘线进行滤波,获得增强图像,并对增强图像进行边缘检测,获得增强图像中的毛刺部位。本发明消除了噪声对毛刺检测的干扰,提高了对钛金属加工表面毛刺的检测精度。

The present invention relates to the field of image analysis, and in particular to a method and system for detecting burrs in a titanium metal processing process. The method first obtains a grayscale image of the surface of the titanium metal to be processed, and performs edge detection to obtain processing edge lines, suspected burr edge lines and texture edge lines in the grayscale image, obtains the burr possibility of the suspected burr edge line according to the change of the grayscale of each pixel point on the suspected burr edge line, and the difference in the grayscale change of the pixel point on the processing edge line, analyzes the gradient value of each pixel point on the reference texture edge line of the suspected burr edge line, obtains the burr fuzzy factor of the suspected burr edge line, and then filters each suspected burr edge line based on the obtained noise influence factor to obtain an enhanced image, and performs edge detection on the enhanced image to obtain the burr position in the enhanced image. The present invention eliminates the interference of noise on burr detection and improves the detection accuracy of burrs on the titanium metal processing surface.

Description

一种钛金属加工过程中毛刺检测方法及系统A burr detection method and system during titanium metal processing

技术领域Technical Field

本发明涉及图像分析领域,具体涉及一种钛金属加工过程中毛刺检测方法及系统。The invention relates to the field of image analysis, and in particular to a burr detection method and system in a titanium metal processing process.

背景技术Background Art

在钛金属切削加工过程中,由于刀具的推进力作用,部分材料被挤压、拉伸而形成较为突出的毛刺,毛刺的存在会增加后续加工工序的难度和成本,影响钛金属制品的性能,因此需要对钛金属加工过程中出现的毛刺进行检测,以保证钛金属制品的质量。During the titanium metal cutting process, due to the thrust of the tool, part of the material is squeezed and stretched to form relatively prominent burrs. The presence of burrs will increase the difficulty and cost of subsequent processing steps and affect the performance of titanium metal products. Therefore, it is necessary to detect the burrs that appear during the titanium metal processing process to ensure the quality of titanium metal products.

相关技术中,通常使用机器视觉检测技术对钛金属加工表面图像的毛刺部位进行检测,但由于图像中噪声的存在会引起像素点灰度值的变化,导致现有方法无法准确的区分噪声和毛刺,从而无法有效去除图像中的噪声,降低对钛金属加工表面毛刺的检测精度。In the related technology, machine vision detection technology is usually used to detect the burr parts of titanium metal processing surface images. However, the presence of noise in the image will cause changes in the grayscale value of the pixel points, resulting in the inability of existing methods to accurately distinguish between noise and burrs, thereby failing to effectively remove the noise in the image, thereby reducing the detection accuracy of burrs on the titanium metal processing surface.

发明内容Summary of the invention

为了解决现有方法无法准确的区分噪声和毛刺,从而无法有效去除图像中的噪声,降低对钛金属加工表面毛刺的检测精度的技术问题,本发明的目的在于提供一种钛金属加工过程中毛刺检测方法及系统,所采用的技术方案具体如下:In order to solve the technical problem that the existing methods cannot accurately distinguish between noise and burrs, thus cannot effectively remove noise in the image, and reduce the detection accuracy of burrs on the titanium metal processing surface, the purpose of the present invention is to provide a burr detection method and system in the titanium metal processing process, and the technical scheme adopted is as follows:

本发明提出了一种钛金属加工过程中毛刺检测方法,所述方法包括:The present invention proposes a method for detecting burrs in a titanium metal processing process, the method comprising:

获取待测加工钛金属表面的灰度图像,对灰度图像进行边缘检测,获得灰度图像中的加工边缘线、疑似毛刺边缘线和纹理边缘线;Obtain a grayscale image of the titanium metal surface to be processed, perform edge detection on the grayscale image, and obtain processing edge lines, suspected burr edge lines, and texture edge lines in the grayscale image;

根据以每个像素点为中心的预设邻域内各像素点的灰度值的分布,获得每个像素点的灰度变化因子;将任意一个疑似毛刺边缘线作为目标边缘线,将与目标边缘线相邻的两个加工边缘线作为目标边缘线的参考加工边缘线,根据目标边缘线上各像素点的所述灰度变化因子,以及目标边缘线与参考加工边缘线之间像素点的灰度变化因子的差异,获得目标边缘线的毛刺可能性;According to the distribution of the grayscale values of each pixel point in a preset neighborhood centered on each pixel point, a grayscale variation factor of each pixel point is obtained; any suspected burr edge line is used as a target edge line, and two processed edge lines adjacent to the target edge line are used as reference processed edge lines of the target edge line, and according to the grayscale variation factor of each pixel point on the target edge line, and the difference in the grayscale variation factor of the pixel point between the target edge line and the reference processed edge line, the burr possibility of the target edge line is obtained;

获取目标边缘线和每个纹理边缘线的质心,将目标边缘线与每个纹理边缘线之间所述质心的距离,作为每个纹理边缘线的距离参数;选取预设数量个所述距离参数最小的纹理边缘线作为目标边缘线的参考纹理边缘线;根据每个参考纹理边缘线上各像素点的梯度值,以及每个参考纹理边缘线的所述距离参数,获得目标边缘线的毛刺模糊因子;Obtain the centroid of the target edge line and each texture edge line, and use the distance between the centroid of the target edge line and each texture edge line as the distance parameter of each texture edge line; select a preset number of texture edge lines with the smallest distance parameters as reference texture edge lines of the target edge line; obtain the burr fuzzy factor of the target edge line according to the gradient value of each pixel point on each reference texture edge line and the distance parameter of each reference texture edge line;

根据目标边缘线的所述毛刺可能性和所述毛刺模糊因子的差异,获得目标边缘线的噪声影响因子;基于每个疑似毛刺边缘线的所述噪声影响因子,对灰度图像进行滤波,获得增强图像;According to the difference between the burr possibility and the burr fuzzy factor of the target edge line, a noise impact factor of the target edge line is obtained; based on the noise impact factor of each suspected burr edge line, a grayscale image is filtered to obtain an enhanced image;

对增强图像进行边缘检测,获得增强图像中的毛刺部位。Perform edge detection on the enhanced image to obtain the burr location in the enhanced image.

进一步地,所述获得灰度图像中的加工边缘线、疑似毛刺边缘线和纹理边缘线包括:Furthermore, obtaining the processed edge lines, suspected burr edge lines and texture edge lines in the grayscale image includes:

基于边缘检测算法,对灰度图像进行边缘检测,获得灰度图像中的加工边缘线和纹理边缘线;Based on the edge detection algorithm, edge detection is performed on the grayscale image to obtain the processing edge line and texture edge line in the grayscale image;

将所述加工边缘线和预设加工轨迹进行对比,将所述加工边缘线相对于预设加工轨迹所缺失的部分,作为疑似毛刺边缘线。The processing edge line is compared with a preset processing trajectory, and a missing portion of the processing edge line relative to the preset processing trajectory is used as a suspected burr edge line.

进一步地,所述获得每个像素点的灰度变化因子包括:Furthermore, obtaining the grayscale change factor of each pixel includes:

将灰度图像中的任意一个像素点作为目标像素点,将以目标像素点为中心的预设邻域内的任意一个像素点,作为待测像素点;若待测像素点的灰度值大于或等于以待测像素点为中心的预设窗口中所有像素点的灰度值,则将待测像素点标记为极大像素点,并获取预设邻域内的所有极大像素点;Any pixel in the grayscale image is taken as the target pixel, and any pixel in the preset neighborhood centered on the target pixel is taken as the pixel to be tested; if the grayscale value of the pixel to be tested is greater than or equal to the grayscale values of all pixels in the preset window centered on the pixel to be tested, the pixel to be tested is marked as a maximum pixel, and all maximum pixels in the preset neighborhood are obtained;

将任意一个极大像素点作为目标极大像素点,将距离目标极大像素点最近的其他极大像素点,作为目标极大像素点的参考极大像素点;Take any maximum pixel as the target maximum pixel, and take other maximum pixels closest to the target maximum pixel as reference maximum pixels of the target maximum pixel;

将目标极大像素点与对应的参考极大像素点的灰度值的平均值,作为目标极大像素点的第一灰度参数;对目标极大像素点与对应的参考极大像素点之间连线上的所有像素点的灰度值的整体水平进行分析,获得目标极大像素点的第二灰度参数;根据所述第一灰度参数和所述第二灰度参数,获取目标极大像素点的初始灰度变化参数,所述初始灰度变化参数与所述第一灰度参数呈正相关,所述初始灰度变化参数与所述第二灰度参数成负相关;The average value of the grayscale values of the target maximum pixel and the corresponding reference maximum pixel is used as the first grayscale parameter of the target maximum pixel; the overall level of the grayscale values of all pixels on the line between the target maximum pixel and the corresponding reference maximum pixel is analyzed to obtain the second grayscale parameter of the target maximum pixel; according to the first grayscale parameter and the second grayscale parameter, an initial grayscale change parameter of the target maximum pixel is obtained, wherein the initial grayscale change parameter is positively correlated with the first grayscale parameter, and the initial grayscale change parameter is negatively correlated with the second grayscale parameter;

对目标极大像素点与对应的参考极大像素点之间的距离进行负相关映射,获得目标极大像素点的第一距离权重,利用目标极大像素点的所述第一距离权重,对所述初始灰度变化参数进行加权,获得目标极大像素点的真实灰度变化参数;Performing negative correlation mapping on the distance between the target maximum pixel and the corresponding reference maximum pixel to obtain a first distance weight of the target maximum pixel, and using the first distance weight of the target maximum pixel to weight the initial grayscale change parameter to obtain a true grayscale change parameter of the target maximum pixel;

对预设邻域内的所有极大像素点的所述真实灰度变化参数的整体水平进行分析后并进行归一化处理,获得目标像素点的灰度变化因子。The overall level of the true grayscale change parameters of all maximum pixel points in a preset neighborhood is analyzed and normalized to obtain the grayscale change factor of the target pixel point.

进一步地,所述获得目标边缘线的毛刺可能性包括:Furthermore, the possibility of obtaining the burr of the target edge line includes:

对目标边缘线或每个参考加工边缘线上的所有像素点的所述灰度变化因子的整体水平进行分析,获得目标边缘线或每个参考加工边缘线的整体灰度变化因子;Analyzing the overall level of the grayscale change factor of all pixels on the target edge line or each reference processed edge line to obtain the overall grayscale change factor of the target edge line or each reference processed edge line;

根据目标边缘线与每个参考加工边缘线之间所述整体灰度变化因子的差异,获得每个参考加工边缘线的灰度变化差异值,将所有参考加工边缘线的所述灰度变化差异值的最大值,作为目标边缘线的灰度变化特征值;According to the difference of the overall grayscale change factor between the target edge line and each reference processed edge line, a grayscale change difference value of each reference processed edge line is obtained, and the maximum value of the grayscale change difference values of all reference processed edge lines is used as the grayscale change characteristic value of the target edge line;

根据目标边缘线的所述整体灰度变化因子和所述灰度变化特征值,获得目标边缘线的毛刺可能性,所述毛刺可能性与目标边缘线的所述灰度变化特征值呈正相关,所述毛刺可能性与目标边缘线的所述整体灰度变化因子呈负相关,所述毛刺可能性是归一化处理后的数值。According to the overall grayscale change factor and the grayscale change characteristic value of the target edge line, the burr possibility of the target edge line is obtained, and the burr possibility is positively correlated with the grayscale change characteristic value of the target edge line, and the burr possibility is negatively correlated with the overall grayscale change factor of the target edge line. The burr possibility is a normalized value.

进一步地,所述获得目标边缘线的毛刺模糊因子包括:Furthermore, obtaining the burr fuzzy factor of the target edge line includes:

对每个纹理边缘线上的所有像素点的梯度值的整体水平进行分析,获得每个纹理边缘线的梯度分布值,对所有纹理边缘线的所述梯度分布值的整体水平进行分析,获得整体梯度分布参数;Analyzing the overall level of the gradient values of all pixels on each texture edge line to obtain the gradient distribution value of each texture edge line, and analyzing the overall level of the gradient distribution values of all texture edge lines to obtain the overall gradient distribution parameter;

根据所述整体梯度分布参数和每个参考纹理边缘线的所述梯度分布值,获得每个参考纹理边缘线的初始梯度特征值;所述初始梯度特征值与所述整体梯度分布参数呈正相关,所述初始梯度特征值与每个参考纹理边缘线的所述梯度分布值成负相关;According to the overall gradient distribution parameter and the gradient distribution value of each reference texture edge line, an initial gradient characteristic value of each reference texture edge line is obtained; the initial gradient characteristic value is positively correlated with the overall gradient distribution parameter, and the initial gradient characteristic value is negatively correlated with the gradient distribution value of each reference texture edge line;

对每个参考纹理边缘线的所述距离参数进行负相关映射,获得每个参考纹理边缘线的第二距离权重;利用每个参考纹理边缘线的所述第二距离权重,对每个参考纹理边缘线的初始梯度特征值进行加权,获得每个参考纹理边缘线的真实梯度特征值;Performing negative correlation mapping on the distance parameter of each reference texture edge line to obtain a second distance weight of each reference texture edge line; using the second distance weight of each reference texture edge line, weighting the initial gradient eigenvalue of each reference texture edge line to obtain a true gradient eigenvalue of each reference texture edge line;

对所有参考纹理边缘线的所述真实梯度特征值的整体水平进行分析后并进行归一化处理,获得目标边缘线的毛刺模糊因子。The overall level of the true gradient feature values of all reference texture edge lines is analyzed and normalized to obtain the burr fuzzy factor of the target edge line.

进一步地,所述获得目标边缘线的噪声影响因子包括:Furthermore, the noise impact factor of obtaining the target edge line includes:

对根据目标边缘线的所述毛刺可能性和所述毛刺模糊因子的差异进行归一化处理,获得目标边缘线的噪声影响因子。The difference between the burr possibility and the burr fuzzy factor according to the target edge line is normalized to obtain the noise impact factor of the target edge line.

进一步地,所述获得增强图像包括:Further, obtaining the enhanced image includes:

将每个疑似毛刺边缘线的所述噪声影响因子作为维纳滤波算法所使用的比例因子,并基于维纳滤波算法,对灰度图像中每个疑似毛刺边缘线的最小外接圆所在区域进行滤波,获得增强图像。The noise impact factor of each suspected burr edge line is used as a scale factor used by the Wiener filtering algorithm, and based on the Wiener filtering algorithm, the area where the minimum circumscribed circle of each suspected burr edge line in the grayscale image is located is filtered to obtain an enhanced image.

进一步地,所述对增强图像进行边缘检测,获得增强图像中的毛刺部位包括:Furthermore, the performing edge detection on the enhanced image to obtain the burr location in the enhanced image includes:

对增强图像进行边缘检测,获得增强图像中的优化加工边缘线;Perform edge detection on the enhanced image to obtain the optimized processed edge line in the enhanced image;

将所述优化加工边缘线和预设加工轨迹进行对比,将所述优化加工边缘线相对于预设加工轨迹所缺失的部分,作为增强图像中的毛刺部位。The optimized processing edge line is compared with the preset processing trajectory, and the missing part of the optimized processing edge line relative to the preset processing trajectory is used as the burr part in the enhanced image.

进一步地,所述预设数量的取值范围为10~30的整数。Furthermore, the preset number is in the range of 10 to 30 integers.

本发明还提出了一种钛金属加工过程中毛刺检测系统,所述系统包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现任意一项一种钛金属加工过程中毛刺检测方法的步骤。The present invention also proposes a burr detection system during titanium metal processing, the system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements any one of the steps of a burr detection method during titanium metal processing when executing the computer program.

本发明具有如下有益效果:The present invention has the following beneficial effects:

本发明考虑到图像中噪声的存在会引起像素点灰度值的变化,导致现有方法无法准确的区分噪声和毛刺,从而无法有效去除图像中的噪声,降低对钛金属加工表面毛刺的检测精度,因此本发明首先获取待测加工钛金属表面的灰度图像,并对灰度图像进行边缘检测,从而获得灰度图像中的加工边缘线、疑似毛刺边缘线和纹理边缘线,考虑到灰度图像中出存在的噪声和毛刺都会导致局部区域像素点灰度值的变化,因此可通过灰度变化因子反映每个像素点的局部灰度值的变化特征,为后续区分噪声和毛刺提供数据基础,相对于由噪声而形成的疑似毛刺边缘线,在由毛刺而形成的疑似毛刺边缘线上,其像素点的灰度变化因子较小,并且与参考加工边缘线上的像素点的灰度变化因子的差异较大,因此可通过毛刺可能性反映目标边缘线上存在毛刺的可能性,由于光照会降低毛刺周围区域的对比度,使得周围区域的视觉效果较为模糊,导致其周围区域的纹理边缘线上的像素点梯度值变小,而由噪声而形成的疑似毛刺边缘线周围区域的纹理边缘线上像素点梯度值不会发生较大的变化,因此可通过获取的毛刺模糊因子反映目标边缘线受到毛刺而非噪声影响的可能性,同时噪声的存在会导致目标边缘线的毛刺可能性和毛刺模糊因子出现较大的差异,因此可通过获取的噪声影响因子反映目标边缘线受到噪声影响的程度,进而对灰度图像进行滤波,消除灰度图像中噪声对毛刺检测的干扰,提高对钛金属加工表面毛刺的检测精度。The present invention takes into account that the presence of noise in an image may cause changes in the grayscale values of pixels, resulting in the inability of existing methods to accurately distinguish between noise and burrs, thereby failing to effectively remove noise in the image and reducing the detection accuracy of burrs on the titanium metal processing surface. Therefore, the present invention first obtains a grayscale image of the titanium metal surface to be processed, and performs edge detection on the grayscale image to obtain processing edge lines, suspected burr edge lines and texture edge lines in the grayscale image. Considering that the noise and burrs existing in the grayscale image will cause changes in the grayscale values of pixels in the local area, the grayscale change factor can be used to reflect the change characteristics of the local grayscale value of each pixel, thereby providing a data basis for the subsequent distinction between noise and burrs. Compared with the suspected burr edge line formed by noise, the grayscale change factor of the pixel on the suspected burr edge line formed by the burr is smaller, and is consistent with the pixel on the reference processing edge line. The difference in the grayscale change factors of the points is large, so the burr possibility can be used to reflect the possibility of the existence of burrs on the target edge line. Since light will reduce the contrast of the area around the burr, the visual effect of the surrounding area is blurred, resulting in the decrease of the pixel gradient value on the texture edge line in the surrounding area, while the pixel gradient value on the texture edge line in the area around the suspected burr edge line formed by noise will not change significantly. Therefore, the burr fuzzy factor obtained can be used to reflect the possibility that the target edge line is affected by burrs rather than noise. At the same time, the presence of noise will cause a large difference between the burr possibility and the burr fuzzy factor of the target edge line. Therefore, the noise influence factor obtained can be used to reflect the degree to which the target edge line is affected by noise, and then the grayscale image is filtered to eliminate the interference of noise in the grayscale image on burr detection, thereby improving the detection accuracy of burrs on the titanium metal processing surface.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例或现有技术中的技术方案和优点,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它附图。In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

图1为本发明一个实施例所提供的一种钛金属加工过程中毛刺检测方法流程图;FIG1 is a flow chart of a method for detecting burrs in a titanium metal processing process provided by an embodiment of the present invention;

图2为本发明一个实施例所提供的一种加工边缘线、疑似毛刺边缘线和纹理边缘线的分布示意图;FIG2 is a schematic diagram showing the distribution of a processing edge line, a suspected burr edge line and a texture edge line provided by an embodiment of the present invention;

图3为本发明一个实施例所提供的目标边缘线的毛刺可能性的获取方法流程图;FIG3 is a flow chart of a method for obtaining the possibility of burrs on a target edge line provided by one embodiment of the present invention;

图4为本发明一个实施例所提供的目标边缘线的毛刺模糊因子的获取方法流程图。FIG. 4 is a flow chart of a method for obtaining a burr fuzzy factor of a target edge line provided by an embodiment of the present invention.

具体实施方式DETAILED DESCRIPTION

为了更进一步阐述本发明为达成预定发明目的所采取的技术手段及功效,以下结合附图及较佳实施例,对依据本发明提出的一种钛金属加工过程中毛刺检测方法及系统,其具体实施方式、结构、特征及其功效,详细说明如下。在下述说明中,不同的“一个实施例”或“另一个实施例”指的不一定是同一实施例。此外,一或多个实施例中的特定特征、结构或特点可由任何合适形式组合。In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of a burr detection method and system in the titanium metal processing process proposed by the present invention, its specific implementation, structure, characteristics and effects, in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

下面结合附图具体的说明本发明所提供的一种钛金属加工过程中毛刺检测方法及系统的具体方案。The specific scheme of a burr detection method and system in titanium metal processing provided by the present invention is described in detail below with reference to the accompanying drawings.

请参阅图1,其示出了本发明一个实施例提供的一种钛金属加工过程中毛刺检测方法流程图,该方法包括:Please refer to FIG. 1 , which shows a flow chart of a burr detection method during titanium metal processing provided by one embodiment of the present invention. The method comprises:

步骤S1:获取待测加工钛金属表面的灰度图像,对灰度图像进行边缘检测,获得灰度图像中的加工边缘线、疑似毛刺边缘线和纹理边缘线。Step S1: obtaining a grayscale image of the titanium metal surface to be processed, performing edge detection on the grayscale image, and obtaining processing edge lines, suspected burr edge lines, and texture edge lines in the grayscale image.

在钛金属切削加工过程中,由于刀具的推进力作用,部分材料被挤压、拉伸而形成较为突出的毛刺,毛刺的存在会增加后续加工工序的难度和成本,影响钛金属制品的性能,因此需要对钛金属加工过程中出现的毛刺进行检测,以保证钛金属制品的质量,相关技术中,通常使用例如边缘检测或阈值分割等机器视觉检测技术对钛金属加工表面图像的毛刺部位进行检测,但由于图像中噪声的存在会引起像素点灰度值的变化,导致现有方法无法准确的区分噪声和毛刺,从而无法有效去除图像中的噪声,降低对钛金属加工表面毛刺的检测精度,因此本发明实施例提出一种钛金属加工过程中毛刺检测方法,以解决该问题。During the titanium metal cutting process, due to the thrust of the tool, part of the material is squeezed and stretched to form relatively prominent burrs. The presence of burrs will increase the difficulty and cost of subsequent processing steps and affect the performance of titanium metal products. Therefore, it is necessary to detect the burrs appearing in the titanium metal processing process to ensure the quality of titanium metal products. In the related art, machine vision detection technologies such as edge detection or threshold segmentation are usually used to detect the burr parts of the titanium metal processing surface image. However, the presence of noise in the image will cause the grayscale value of the pixel to change, resulting in the inability of the existing method to accurately distinguish between noise and burrs, thereby failing to effectively remove the noise in the image, thereby reducing the detection accuracy of burrs on the titanium metal processing surface. Therefore, an embodiment of the present invention proposes a burr detection method in the titanium metal processing process to solve this problem.

本发明实施例首先使用工业相机采集待测加工钛金属表面的原始图像,由于原始图像一般为多通道图像,会增加后续计算的复杂度,因此,为了降低后续图像处理的计算量,提高处理速度,在本发明的一个实施例中将采集到的原始图像进行灰度化处理,转化为单通道的灰度图像。需要说明的是,灰度化处理是本领域技术人员熟知的技术手段,在此不再赘述。The embodiment of the present invention first uses an industrial camera to collect the original image of the titanium metal surface to be processed. Since the original image is generally a multi-channel image, it will increase the complexity of subsequent calculations. Therefore, in order to reduce the amount of calculation of subsequent image processing and improve the processing speed, in one embodiment of the present invention, the collected original image is grayed and converted into a single-channel gray image. It should be noted that graying is a technical means well known to those skilled in the art and will not be described in detail here.

由于在对钛金属进行切削加工的过程中,会导致切削加工后所形成的边缘上的某些局部位置处出现毛刺现象,而由于毛刺表面较为粗糙,导致灰度图像在毛刺的位置处所呈现出的切削加工边缘特征被掩盖,也就是说,毛刺位置处的切削加工边缘特征不是特别明显,基于这一特点,可对灰度图像进行边缘检测,获得灰度图像中的加工边缘线和疑似毛刺边缘线,同时钛金属表面存在纹理特征,因此经过边缘检测后还可获取到其表面的纹理边缘线,后续可进一步对疑似毛刺边缘线和加工边缘线以及纹理边缘线进行分析,有效去除灰度图像中的噪声,提高对毛刺的检测精度,需要说明的是,由于图像中存在的噪声也会掩盖切削加工后的边缘特征,因此疑似毛刺边缘线的形成因素有两种,一种是由毛刺本身而形成的疑似毛刺边缘线,另一种是由噪声而形成的疑似毛刺边缘线。During the cutting process of titanium metal, burrs will appear at certain local positions on the edge formed after cutting. Since the burr surface is relatively rough, the cutting edge features presented in the grayscale image at the burr position are masked. In other words, the cutting edge features at the burr position are not particularly obvious. Based on this feature, edge detection can be performed on the grayscale image to obtain the processing edge line and suspected burr edge line in the grayscale image. At the same time, there are texture features on the surface of titanium metal. Therefore, after edge detection, the texture edge line of its surface can also be obtained. Subsequently, the suspected burr edge line, the processing edge line and the texture edge line can be further analyzed to effectively remove the noise in the grayscale image and improve the detection accuracy of the burr. It should be noted that since the noise in the image will also mask the edge features after cutting, there are two factors that form the suspected burr edge line. One is the suspected burr edge line formed by the burr itself, and the other is the suspected burr edge line formed by noise.

优选地,在本发明的一个实施例中灰度图像中的加工边缘线、疑似毛刺边缘线和纹理边缘线的获取方法具体包括:Preferably, in one embodiment of the present invention, the method for obtaining the processed edge line, the suspected burr edge line and the texture edge line in the grayscale image specifically includes:

基于边缘检测算法,例如Canny边缘检测算法或其他边缘检测方法,对灰度图像进行边缘检测,获得灰度图像中的加工边缘线和纹理边缘线,由于灰度图像中存在的毛刺和噪声,都会掩盖切削加工过程中所形成的边缘特征,导致在加工过程中所形成的边缘并不是连续的,也就是说,通过边缘检测算法能够检测出多个加工边缘线,而各加工边缘线之间存在的断开缺失现象,便是由于毛刺和噪声所导致的,因此可将加工边缘线和预设加工轨迹进行对比,将加工边缘线相对于预设加工轨迹所缺失的部分,作为疑似毛刺边缘线,其中,预设加工轨迹是对钛金属加工之前所设计的已知的加工轨迹,在不存在毛刺和噪声的理想情况下,钛金属经过加工后所形成的边缘线是完整的,并且与预设加工轨迹相同,请参阅图2,其示出了本发明一个实施例提供的一种加工边缘线、疑似毛刺边缘线和纹理边缘线的分布示意图,其中,线条A~F为加工边缘线,线条a~f为疑似毛刺边缘线,线条1~7为纹理边缘线。Based on an edge detection algorithm, such as the Canny edge detection algorithm or other edge detection methods, edge detection is performed on the grayscale image to obtain processing edge lines and texture edge lines in the grayscale image. Since the burrs and noise in the grayscale image will mask the edge features formed during the cutting process, the edges formed during the processing are not continuous. That is to say, multiple processing edge lines can be detected by the edge detection algorithm, and the disconnection and missing phenomenon between the processing edge lines is caused by the burrs and noise. Therefore, the processing edge line can be compared with the preset processing trajectory, and the missing part of the processing edge line relative to the preset processing trajectory is taken as a suspected burr edge line, wherein the preset processing trajectory is a known processing trajectory designed before the titanium metal is processed. In the ideal case where there are no burrs and noise, the edge line formed by the titanium metal after processing is complete and the same as the preset processing trajectory. Please refer to Figure 2, which shows a distribution diagram of a processing edge line, a suspected burr edge line and a texture edge line provided by an embodiment of the present invention, wherein lines A~F are processing edge lines, lines a~f are suspected burr edge lines, and lines 1~7 are texture edge lines.

步骤S2:根据以每个像素点为中心的预设邻域内各像素点的灰度值的分布,获得每个像素点的灰度变化因子;将任意一个疑似毛刺边缘线作为目标边缘线,将与目标边缘线相邻的两条加工边缘线作为目标边缘线的参考加工边缘线,根据目标边缘线上各像素点的灰度变化因子,以及目标边缘线与参考加工边缘线之间像素点的灰度变化因子的差异,获得目标边缘线的毛刺可能性。Step S2: according to the distribution of grayscale values of each pixel point in a preset neighborhood centered on each pixel point, obtain the grayscale variation factor of each pixel point; take any suspected burr edge line as the target edge line, and take the two processed edge lines adjacent to the target edge line as the reference processed edge lines of the target edge line, and according to the grayscale variation factor of each pixel point on the target edge line, and the difference in the grayscale variation factor of the pixel point between the target edge line and the reference processed edge line, obtain the burr possibility of the target edge line.

由上述分析可知,在得到的所有疑似毛刺边缘线中存在两种类型,一种是由毛刺而形成的疑似毛刺边缘线,另一种是由噪声而形成的疑似毛刺边缘线,导致噪声会影响到对毛刺的准确检测,相对于毛刺,噪声的随机性更强,由噪声所引起的局部像素点灰度值的变化程度更大,导致两种疑似毛刺边缘线上像素点灰度值的局部分布特征存在差异,并且两种疑似毛刺边缘线与加工边缘线之间的像素点灰度值的局部分布特征也不同,因此可首先对以每个像素点为中心的预设邻域内各像素点的灰度值的分布情况进行分析,通过获取的灰度变化因子反映每个像素点的局部灰度变化特征,为后续区分噪声和毛刺提供数据基础,其中,预设邻域的尺寸一般为大于3的奇数,在本发明的一个实施例中将预设邻域的尺寸设置为5,即预设邻域是一个的区域,预设邻域的具体尺寸也可根据具体实施场景由实施者自行设置,在此不作限定。From the above analysis, it can be seen that there are two types of suspected burr edge lines among all the obtained suspected burr edge lines, one is the suspected burr edge line formed by burrs, and the other is the suspected burr edge line formed by noise, which causes noise to affect the accurate detection of burrs. Compared with burrs, noise is more random, and the degree of change in the grayscale value of local pixels caused by noise is greater, resulting in differences in the local distribution characteristics of the grayscale values of pixels on the two suspected burr edge lines, and the local distribution characteristics of the grayscale values of pixels between the two suspected burr edge lines and the processed edge lines are also different. Therefore, the distribution of the grayscale values of each pixel in a preset neighborhood centered on each pixel can be analyzed first, and the local grayscale change characteristics of each pixel can be reflected by the obtained grayscale change factor, so as to provide a data basis for the subsequent distinction between noise and burrs, wherein the size of the preset neighborhood is generally an odd number greater than 3. In one embodiment of the present invention, the size of the preset neighborhood is set to 5, that is, the preset neighborhood is a The specific size of the preset neighborhood can also be set by the implementer according to the specific implementation scenario and is not limited here.

优选地,在本发明的一个实施例中每个像素点的灰度变化因子的获取方法具体包括:Preferably, in an embodiment of the present invention, the method for obtaining the grayscale variation factor of each pixel point specifically includes:

首先,将灰度图像中的任意一个像素点作为目标像素点,将以目标像素点为中心的预设邻域内的任意一个像素点,作为待测像素点;若待测像素点的灰度值大于或等于以待测像素点为中心的预设窗口中所有像素点的灰度值,则将待测像素点标记为极大像素点,并获取预设邻域内的所有极大像素点,其中,预设窗口的尺寸需要小于预设邻域的尺寸,在本发明的一个实施例将预设窗口的尺寸设置为3,预设窗口的具体尺寸也可根据具体实施场景由实施者自行设置,在此不作限定。First, any pixel point in the grayscale image is taken as the target pixel point, and any pixel point in the preset neighborhood centered on the target pixel point is taken as the pixel point to be tested; if the grayscale value of the pixel point to be tested is greater than or equal to the grayscale values of all pixels in the preset window centered on the pixel point to be tested, the pixel point to be tested is marked as a maximum pixel point, and all maximum pixels in the preset neighborhood are obtained, wherein the size of the preset window needs to be smaller than the size of the preset neighborhood. In one embodiment of the present invention, the size of the preset window is set to 3, and the specific size of the preset window can also be set by the implementer according to the specific implementation scenario, which is not limited here.

需要说明的是,对于预设邻域边界处的像素点,无法以其为中心建立预设窗口,此时,可对预设邻域进行边界扩展,例如,在本发明的一个实施例中,预设邻域的尺寸为5,预设窗口的尺寸为3,此时可将预设邻域的尺寸扩展为7,其中扩展的像素点并不属于预设邻域,只是方便能够以预设邻域边界处的像素点为中心建立预设窗口,便于分析能够顺利进行。It should be noted that, for the pixel points at the boundary of the preset neighborhood, it is impossible to establish a preset window with them as the center. In this case, the boundary of the preset neighborhood can be expanded. For example, in one embodiment of the present invention, the size of the preset neighborhood is 5, and the size of the preset window is 3. In this case, the size of the preset neighborhood can be expanded to 7, wherein the expanded pixel points do not belong to the preset neighborhood, but are just convenient for establishing a preset window with the pixel points at the boundary of the preset neighborhood as the center, so that the analysis can proceed smoothly.

然后,将任意一个极大像素点作为目标极大像素点,将距离目标极大像素点最近的其他极大像素点,作为目标极大像素点的参考极大像素点;将目标极大像素点与对应的参考极大像素点的灰度值的平均值,作为目标极大像素点的第一灰度参数;对目标极大像素点与对应的参考极大像素点之间连线上的所有像素点的灰度值的整体水平进行分析,获得目标极大像素点的第二灰度参数,目标极大像素点的第一灰度参数相对于第二灰度参数越大,说明目标极大像素点与参考极大像素点之间像素点灰度值的变化程度越大,因此可根据第一灰度参数和第二灰度参数,获取目标极大像素点的初始灰度变化参数,初始灰度变化参数与第一灰度参数呈正相关,初始灰度变化参数与第二灰度参数成负相关,初始灰度变化参数越大,说明目标极大像素点与参考极大像素点之间像素点灰度值的变化程度越大。Then, any maximum pixel point is taken as the target maximum pixel point, and the other maximum pixel points closest to the target maximum pixel point are taken as the reference maximum pixel points of the target maximum pixel point; the average value of the grayscale value of the target maximum pixel point and the corresponding reference maximum pixel point is taken as the first grayscale parameter of the target maximum pixel point; the overall level of the grayscale values of all pixels on the line between the target maximum pixel point and the corresponding reference maximum pixel point is analyzed to obtain the second grayscale parameter of the target maximum pixel point. The larger the first grayscale parameter of the target maximum pixel point is relative to the second grayscale parameter, the greater the degree of change of the grayscale value of the pixel point between the target maximum pixel point and the reference maximum pixel point. Therefore, the initial grayscale change parameter of the target maximum pixel point can be obtained according to the first grayscale parameter and the second grayscale parameter. The initial grayscale change parameter is positively correlated with the first grayscale parameter, and the initial grayscale change parameter is negatively correlated with the second grayscale parameter. The larger the initial grayscale change parameter is, the greater the degree of change of the grayscale value of the pixel point between the target maximum pixel point and the reference maximum pixel point.

在本发明实施例中可将目标极大像素点与对应的参考极大像素点之间连线上的所有像素点的灰度值的平均值或中位数,作为目标极大像素点的第二灰度参数,实现对目标极大像素点与对应的参考极大像素点之间连线上的所有像素点的灰度值的整体水平的分析,在此不作限定。In an embodiment of the present invention, the average or median of the grayscale values of all pixels on the line between the target maximum pixel and the corresponding reference maximum pixel can be used as the second grayscale parameter of the target maximum pixel to achieve an overall level analysis of the grayscale values of all pixels on the line between the target maximum pixel and the corresponding reference maximum pixel, which is not limited here.

在本发明的一个实施例中可将目标极大像素点的第一灰度参数作分子,将目标极大像素点的第二灰度参数作分母,将比值作为目标极大像素点的初始灰度变化参数。In one embodiment of the present invention, the first grayscale parameter of the target maximum pixel point can be used as the numerator, the second grayscale parameter of the target maximum pixel point can be used as the denominator, and the ratio can be used as the initial grayscale change parameter of the target maximum pixel point.

最后,考虑到目标极大像素点与对应的参考极大像素点之间的距离越近,二者之间像素点灰度值变化的越快,因此可对目标极大像素点与对应的参考极大像素点之间的距离进行负相关映射,获得目标极大像素点的第一距离权重,并利用目标极大像素点的第一距离权重,对初始灰度变化参数进行加权,获得目标极大像素点的真实灰度变化参数,通过上述相同的方法便可得到预设邻域内每个极大像素点的真实灰度变化参数,真实灰度变化参数越大,说明极大像素点与参考极大像素点之间像素点灰度值变化的越剧烈,进而对预设邻域内的所有极大像素点的真实灰度变化参数的整体水平进行分析后并进行归一化处理,获得目标像素点的灰度变化因子,灰度变化因子越大,说明目标像素点的预设邻域内的像素点灰度值变化的程度越大。Finally, considering that the closer the distance between the target maximum pixel and the corresponding reference maximum pixel is, the faster the grayscale value of the pixel between the two changes, the distance between the target maximum pixel and the corresponding reference maximum pixel can be negatively correlated to obtain the first distance weight of the target maximum pixel, and the initial grayscale change parameter is weighted using the first distance weight of the target maximum pixel to obtain the real grayscale change parameter of the target maximum pixel. The real grayscale change parameter of each maximum pixel in the preset neighborhood can be obtained by the same method as above. The larger the real grayscale change parameter, the more drastic the change in the grayscale value of the pixel between the maximum pixel and the reference maximum pixel. Then, the overall level of the real grayscale change parameters of all the maximum pixels in the preset neighborhood is analyzed and normalized to obtain the grayscale change factor of the target pixel. The larger the grayscale change factor, the greater the degree of change in the grayscale value of the pixel in the preset neighborhood of the target pixel.

在本发明实施例中可使用反比例函数等负相关函数进行负相关映射,在此不作限定。In the embodiment of the present invention, a negative correlation function such as an inverse proportional function may be used to perform negative correlation mapping, which is not limited herein.

在本发明实施例中可将预设邻域内的所有极大像素点的真实灰度变化参数的平均值或中位数,作为目标像素点的灰度变化因子,实现对预设邻域内的所有极大像素点的真实灰度变化参数的整体水平的分析,在此不作限定。In an embodiment of the present invention, the average value or median of the true grayscale change parameters of all maximum pixels in a preset neighborhood can be used as the grayscale change factor of the target pixel to achieve an overall level analysis of the true grayscale change parameters of all maximum pixels in a preset neighborhood, which is not limited here.

在本发明的一个实施例中,归一化处理可以具体例如为最大最小值归一化处理,并且,后续步骤中的归一化均可以采用最大最小值归一化处理,在本发明的其他实施例中可以根据数值具体范围选择其他归一化方法,对此不再赘述。In one embodiment of the present invention, the normalization processing can be specifically, for example, maximum and minimum value normalization processing, and the normalization in subsequent steps can all adopt maximum and minimum value normalization processing. In other embodiments of the present invention, other normalization methods can be selected according to the specific range of numerical values, which will not be described in detail.

目标像素点的灰度变化因子的表达式可以具体例如为:The expression of the grayscale change factor of the target pixel point can be specifically, for example, as follows:

其中,表示目标像素点的灰度变化因子;表示以目标像素点为中心的预设邻域内第个极大像素点的第一灰度参数;表示以目标像素点为中心的预设邻域内第个极大像素点的第二灰度参数;表示以目标像素点为中心的预设邻域内第个极大像素点的初始灰度变化参数;表示预设邻域内第个极大像素点与对应的参考极大像素点之间的距离,可具体使用欧式距离进行计算;表示以目标像素点为中心的预设邻域内第个极大像素点的第一距离权重;表示以目标像素点为中心的预设邻域内第个极大像素点的真实灰度变化参数;表示以目标像素点为中心的预设邻域内极大像素点的数量;表示归一化函数。in, Indicates the grayscale change factor of the target pixel; Indicates the first The first grayscale parameter of the maximum pixel; Indicates the first The second grayscale parameter of the maximum pixel; Indicates the first The initial grayscale change parameter of the maximum pixel; Indicates the first The distance between a maximum pixel and the corresponding reference maximum pixel can be calculated using the Euclidean distance; Indicates the first The first distance weight of the maximum pixel; Indicates the first The real grayscale change parameter of the maximum pixel point; Indicates the number of maximum pixels in a preset neighborhood centered on the target pixel; Represents the normalization function.

通过上述相同的方法便可得到灰度图像中每个像素点的灰度变化因子。The grayscale change factor of each pixel in the grayscale image can be obtained by the same method as above.

由上述分析可知,相对于毛刺,噪声的随机性更强,由噪声所引起的局部像素点灰度值的变化程度更大,导致两种疑似毛刺边缘线上像素点灰度值的局部分布特征存在差异,同时加工边缘线上像素点的局部区域的灰度值分布较为均匀和平滑,则两种疑似毛刺边缘线与加工边缘线之间的像素点灰度值的局部分布特征也不同,具体表现为:相对于由噪声而形成的疑似毛刺边缘线,由毛刺而形成的疑似毛刺边缘线上像素点的局部灰度值变化的程度较小,并且与加工边缘线上的像素点的局部灰度值的变化情况的差异较大,因此在后续中可针对任意一个疑似毛刺边缘线,首先将任意一个疑似毛刺边缘线作为目标边缘线,并将与目标边缘线相邻的两个加工边缘线作为目标边缘线的参考加工边缘线,便于后续进行对比分析,请参阅图2,假设疑似毛刺边缘线a为目标边缘线,则加工边缘线A和F为疑似毛刺边缘线a的参考加工边缘线,进而对目标边缘线上各像素点的灰度变化因子,以及目标边缘线与参考加工边缘线之间像素点的灰度变化因子的差异进行分析,通过获取的毛刺可能性反映目标边缘线是由毛刺而形成的可能性,毛刺可能性越大,则说明目标边缘线上存在毛刺的可能性越大,后续可基于毛刺可能性做出进一步的分析,从而有效去除灰度图像中存在的噪声,提高对钛金属加工表面毛刺检测的精度。From the above analysis, it can be seen that compared with burrs, noise is more random, and the degree of change in the grayscale value of local pixels caused by noise is greater, resulting in differences in the local distribution characteristics of the grayscale values of pixels on the two suspected burr edge lines. At the same time, the grayscale value distribution of the local area of the pixels on the processed edge line is relatively uniform and smooth, so the local distribution characteristics of the grayscale values of the pixels between the two suspected burr edge lines and the processed edge line are also different, which is specifically manifested as follows: compared with the suspected burr edge line formed by noise, the degree of change in the local grayscale value of the pixels on the suspected burr edge line formed by burrs is smaller, and the difference in the change of the local grayscale value of the pixels on the processed edge line is larger. Therefore, in the subsequent process, any suspected burr edge line can be targeted first. The target edge line is marked, and the two processed edge lines adjacent to the target edge line are used as the reference processed edge lines of the target edge line, so as to facilitate the subsequent comparative analysis. Please refer to Figure 2. Assuming that the suspected burr edge line a is the target edge line, the processed edge lines A and F are the reference processed edge lines of the suspected burr edge line a. Then, the grayscale change factor of each pixel point on the target edge line and the difference in the grayscale change factor of the pixel point between the target edge line and the reference processed edge line are analyzed. The burr possibility obtained reflects the possibility that the target edge line is formed by a burr. The greater the burr possibility, the greater the possibility that there is a burr on the target edge line. Further analysis can be made based on the burr possibility, thereby effectively removing the noise in the grayscale image and improving the accuracy of burr detection on the titanium metal processing surface.

优选地,在本发明的一个实施例中目标边缘线的毛刺可能性的获取方法具体包括:Preferably, in one embodiment of the present invention, the method for obtaining the burr possibility of the target edge line specifically includes:

请参阅图3,其示出了本发明一个实施例提供的目标边缘线的毛刺可能性的获取方法流程图。Please refer to FIG. 3 , which shows a flow chart of a method for obtaining the burr possibility of a target edge line provided by an embodiment of the present invention.

步骤S201:分别对目标边缘线和每个参考加工边缘线上的所有像素点的灰度变化因子的整体水平进行分析,获得目标边缘线和每个参考加工边缘线的整体灰度变化因子。Step S201: Analyze the overall level of the grayscale variation factor of all pixels on the target edge line and each reference processed edge line respectively to obtain the overall grayscale variation factor of the target edge line and each reference processed edge line.

由上述分析可知,相对于由噪声而形成的疑似毛刺边缘线,由毛刺而形成的疑似毛刺边缘线上像素点的局部灰度值变化的程度较小,并且与加工边缘线上的像素点的局部灰度值的变化情况的差异较大,因此可首先分别对目标边缘线和每个参考加工边缘线上的所有像素点的灰度变化因子的整体水平进行分析,获得目标边缘线和每个参考加工边缘线的整体灰度变化因子,目标边缘线或每个参考加工边缘线的整体灰度变化因子越大,说明目标边缘线或每个参考加工边缘线上像素点的局部灰度变化的程度越大,为后续计算分析目标边缘线的毛刺可能性提供数据基础。From the above analysis, it can be seen that compared with the suspected burr edge line formed by noise, the degree of change of the local grayscale value of the pixels on the suspected burr edge line formed by burrs is smaller, and the difference with the change of the local grayscale value of the pixels on the processed edge line is larger. Therefore, the overall level of the grayscale change factor of all pixels on the target edge line and each reference processed edge line can be analyzed respectively to obtain the overall grayscale change factor of the target edge line and each reference processed edge line. The larger the overall grayscale change factor of the target edge line or each reference processed edge line, the greater the degree of local grayscale change of the pixels on the target edge line or each reference processed edge line, which provides a data basis for the subsequent calculation and analysis of the possibility of burrs on the target edge line.

在本发明实施例中,可将目标边缘线或每个参考加工边缘线上的所有像素点的灰度变化因子的平均值或中位数,作为目标边缘线或每个参考加工边缘线的整体灰度变化因子,实现对目标边缘线或每个参考加工边缘线上的所有像素点的灰度变化因子的整体水平的分析,在此不作限定,具体为:将目标边缘线上的所有像素点的灰度变化因子的平均值或中位数,作为目标边缘线的整体灰度变化因子,将每个参考加工边缘线上的所有像素点的灰度变化因子的平均值或中位数,作为每个参考加工边缘线的整体灰度变化因子。In an embodiment of the present invention, the average value or median of the grayscale change factors of all pixels on the target edge line or each reference processing edge line can be used as the overall grayscale change factor of the target edge line or each reference processing edge line, so as to realize the overall level analysis of the grayscale change factors of all pixels on the target edge line or each reference processing edge line. No limitation is made here, and specifically: the average value or median of the grayscale change factors of all pixels on the target edge line is used as the overall grayscale change factor of the target edge line, and the average value or median of the grayscale change factors of all pixels on each reference processing edge line is used as the overall grayscale change factor of each reference processing edge line.

步骤S202:根据目标边缘线与每个参考加工边缘线之间整体灰度变化因子的差异,获得每个参考加工边缘线的灰度变化差异值,将所有参考加工边缘线的灰度变化差异值的最大值,作为目标边缘线的灰度变化特征值。Step S202: According to the difference in the overall grayscale change factor between the target edge line and each reference processed edge line, the grayscale change difference value of each reference processed edge line is obtained, and the maximum value of the grayscale change difference values of all reference processed edge lines is used as the grayscale change characteristic value of the target edge line.

由毛刺而形成的疑似毛刺边缘线上的像素点,与加工边缘线上的像素点的局部灰度值的变化情况的差异较大,具体表现为:由毛刺而形成的疑似毛刺边缘线与加工边缘线之间的整体灰度变化因子的差异较大,因此可根据目标边缘线与每个参考加工边缘线之间整体灰度变化因子的差异,获得每个参考加工边缘线的灰度变化差异值,灰度变化差异值越大,说明每个参考加工边缘线与目标边缘线之间像素点的局部灰度值变化情况的差异越大,并将所有参考加工边缘线的灰度变化差异值的最大值,作为目标边缘线的灰度变化特征值,灰度变化特征值越大,说明目标边缘线上的像素点,与参考加工边缘线上的像素点的局部灰度值的变化情况的差异较大,进而说明目标边缘线上越可能存在毛刺。The pixel points on the suspected burr edge line formed by the burrs have a large difference in the change of local grayscale values from the pixel points on the processed edge line. Specifically, the difference in the overall grayscale change factor between the suspected burr edge line formed by the burrs and the processed edge line is large. Therefore, the grayscale change difference value of each reference processed edge line can be obtained according to the difference in the overall grayscale change factor between the target edge line and each reference processed edge line. The larger the grayscale change difference value, the greater the difference in the change of local grayscale values of the pixel points between each reference processed edge line and the target edge line. The maximum value of the grayscale change difference values of all reference processed edge lines is used as the grayscale change characteristic value of the target edge line. The larger the grayscale change characteristic value, the greater the difference in the change of local grayscale values between the pixel points on the target edge line and the pixel points on the reference processed edge line, which further indicates that burrs are more likely to exist on the target edge line.

在本发明的一个实施例中,可将目标边缘线与每个参考加工边缘线之间整体灰度变化因子的差值的绝对值,作为每个参考加工边缘线的灰度变化差异值,实现对目标边缘线与每个参考加工边缘线之间整体灰度变化因子的差异的分析。In one embodiment of the present invention, the absolute value of the difference in the overall grayscale change factor between the target edge line and each reference processing edge line can be used as the grayscale change difference value of each reference processing edge line, thereby realizing the analysis of the difference in the overall grayscale change factor between the target edge line and each reference processing edge line.

步骤S203:根据目标边缘线的整体灰度变化因子和灰度变化特征值,获得目标边缘线的毛刺可能性,毛刺可能性与目标边缘线的灰度变化特征值呈正相关,毛刺可能性与目标边缘线的整体灰度变化因子呈负相关,毛刺可能性是归一化处理后的数值。Step S203: According to the overall grayscale change factor and grayscale change characteristic value of the target edge line, the burr possibility of the target edge line is obtained. The burr possibility is positively correlated with the grayscale change characteristic value of the target edge line, and negatively correlated with the overall grayscale change factor of the target edge line. The burr possibility is a normalized value.

相对于由噪声而形成的疑似毛刺边缘线,由毛刺而形成的疑似毛刺边缘线上像素点的局部灰度值变化的程度较小,并且与加工边缘线上的像素点的局部灰度值的变化情况的差异较大,因此上述获取的目标边缘线的整体灰度变化因子越小,并且目标边缘线的灰度变化特征值越大,说明目标边缘线越可能是由毛刺而形成的,则目标边缘线上越可能存在毛刺,越不可能存在噪声,因此可根据目标边缘线的整体灰度变化因子和灰度变化特征值,获得目标边缘线的毛刺可能性,其中,毛刺可能性与目标边缘线的灰度变化特征值呈正相关,毛刺可能性与目标边缘线的整体灰度变化因子呈负相关,毛刺可能性是归一化处理后的数值。Compared with the suspected burr edge line formed by noise, the degree of change of the local grayscale value of the pixel points on the suspected burr edge line formed by burrs is smaller, and the difference with the change of the local grayscale value of the pixel points on the processed edge line is larger. Therefore, the smaller the overall grayscale change factor of the target edge line obtained above and the larger the grayscale change characteristic value of the target edge line, the more likely the target edge line is formed by burrs, and the more likely burrs are present on the target edge line, and the less likely noise is present. Therefore, the burr possibility of the target edge line can be obtained according to the overall grayscale change factor and grayscale change characteristic value of the target edge line, wherein the burr possibility is positively correlated with the grayscale change characteristic value of the target edge line, and the burr possibility is negatively correlated with the overall grayscale change factor of the target edge line, and the burr possibility is the normalized value.

在本发明的一个实施例中,可将目标边缘线的灰度变化特征值作分子,将目标边缘线的整体灰度变化因子作分母,将比值作为目标边缘线的毛刺参数,并对目标边缘线的毛刺参数进行归一化处理,得到目标边缘线的毛刺可能性。In one embodiment of the present invention, the grayscale change characteristic value of the target edge line can be used as the numerator, the overall grayscale change factor of the target edge line can be used as the denominator, the ratio can be used as the burr parameter of the target edge line, and the burr parameter of the target edge line can be normalized to obtain the burr possibility of the target edge line.

目标边缘线的毛刺可能性的表达式可以具体例如为:The expression of the burr possibility of the target edge line can be specifically expressed as:

其中,表示目标边缘线的毛刺可能性;表示目标边缘线的整体灰度变化因子;表示目标边缘线的第一个参考加工边缘线的整体灰度变化因子;表示目标边缘线的第二个参考加工边缘线的整体灰度变化因子;表示第一个参考加工边缘线的灰度变化差异值;表示第二个参考加工边缘线的灰度变化差异值;表示目标边缘线的灰度变化特征值;表示目标边缘线的毛刺参数;表示取最大值的函数;表示归一化函数。in, Indicates the possibility of burr on the edge line of the target; Represents the overall grayscale change factor of the target edge line; Represents the overall grayscale change factor of the first reference processed edge line of the target edge line; The overall grayscale variation factor of the second reference processed edge line representing the target edge line; Indicates the grayscale change difference value of the first reference processed edge line; Indicates the grayscale change difference value of the second reference processed edge line; Represents the grayscale change characteristic value of the target edge line; Indicates the burr parameter of the target edge line; represents the function of taking the maximum value; Represents the normalization function.

至此,获得了目标边缘线的毛刺可能性,后续可基于目标边缘线的毛刺可能性,分析目标边缘线受到噪声影响的程度,进而有效去除灰度图像中的噪声,提高对钛金属加工表面毛刺的检测精度。At this point, the burr possibility of the target edge line is obtained. Subsequently, based on the burr possibility of the target edge line, the degree to which the target edge line is affected by noise can be analyzed, thereby effectively removing the noise in the grayscale image and improving the detection accuracy of burrs on the titanium metal processing surface.

步骤S3:获取目标边缘线和每个纹理边缘线的质心,将目标边缘线与每个纹理边缘线之间质心的距离,作为每个纹理边缘线的距离参数;选取预设数量个距离参数最小的纹理边缘线作为目标边缘线的参考纹理边缘线;根据每个参考纹理边缘线上各像素点的梯度值,以及每个参考纹理边缘线的距离参数,获得目标边缘线的毛刺模糊因子。Step S3: Obtain the centroid of the target edge line and each texture edge line, and use the distance between the centroid of the target edge line and each texture edge line as the distance parameter of each texture edge line; select a preset number of texture edge lines with the smallest distance parameters as reference texture edge lines for the target edge line; obtain the burr fuzzy factor of the target edge line according to the gradient value of each pixel point on each reference texture edge line and the distance parameter of each reference texture edge line.

由于毛刺比较突出,受到光照时,光照会降低毛刺周围区域的对比度,使得毛刺周围区域的视觉效果较为模糊,进而导致其周围区域的纹理边缘线上的像素点梯度值变小,因此,由毛刺而形成的疑似毛刺边缘线周围区域的纹理边缘线上像素点梯度值相对较小,但由噪声而形成的疑似毛刺边缘线周围区域的纹理边缘线上像素点梯度值不会发生较大的变化,因此可首先获取目标边缘线和每个纹理边缘线的质心,其中,图像中边缘线的质心的获取方法是本领域技术人员熟知的技术手段,在此不做赘述,将目标边缘线与每个纹理边缘线之间质心的距离,作为每个纹理边缘线的距离参数,质心之间的距离可具体为欧式距离,进而选取预设数量个距离参数最小的纹理边缘线,作为处于目标边缘线周围区域的参考纹理边缘线,后续可基于参考纹理边缘线上的像素点梯度值,对目标边缘线的毛刺模糊因子进行计算分析。Since the burrs are relatively prominent, when illuminated, the illumination will reduce the contrast of the area around the burrs, making the visual effect of the area around the burrs more blurred, thereby causing the pixel gradient value on the texture edge line of the surrounding area to become smaller. Therefore, the pixel gradient value on the texture edge line of the area around the suspected burr edge line formed by the burrs is relatively small, but the pixel gradient value on the texture edge line of the area around the suspected burr edge line formed by noise will not change significantly. Therefore, the target edge line and the centroid of each texture edge line can be obtained first, wherein the method for obtaining the centroid of the edge line in the image is a technical means well known to those skilled in the art, which will not be elaborated here. The distance between the centroid of the target edge line and each texture edge line is used as the distance parameter of each texture edge line. The distance between the centroids can be specifically the Euclidean distance, and then a preset number of texture edge lines with the smallest distance parameters are selected as reference texture edge lines in the area around the target edge line. Subsequently, the burr fuzziness factor of the target edge line can be calculated and analyzed based on the pixel gradient value on the reference texture edge line.

其中,预设数量的取值范围为10~30的整数,在本发明的一个实施例中将预设数量设置为20,预设数量的具体数值也可根据具体实施场景由实施者自行设置,在此不作限定。The preset number has a value range of integers from 10 to 30. In one embodiment of the present invention, the preset number is set to 20. The specific value of the preset number can also be set by the implementer according to the specific implementation scenario and is not limited here.

由上述分析可知,由毛刺而形成的疑似毛刺边缘线周围区域的纹理边缘线上像素点梯度值相对较小,但由噪声而形成的疑似毛刺边缘线周围区域的纹理边缘线上像素点梯度值不会发生较大的变化,因此可对每个参考纹理边缘线上各像素点的梯度值进行分析,同时结合每个参考纹理边缘线的距离参数,获得目标边缘线的毛刺模糊因子,通过毛刺模糊因子反映目标边缘线受到毛刺而非噪声影响的可能性,后续基于目标边缘线的毛刺模糊因子以及上述获取的毛刺可能性,分析噪声对目标边缘线的影响程度。From the above analysis, it can be seen that the gradient value of the pixel points on the texture edge line in the area around the suspected burr edge line formed by the burrs is relatively small, but the gradient value of the pixel points on the texture edge line in the area around the suspected burr edge line formed by the noise will not change significantly. Therefore, the gradient value of each pixel point on each reference texture edge line can be analyzed, and the burr fuzzy factor of the target edge line can be obtained by combining the distance parameter of each reference texture edge line. The burr fuzzy factor reflects the possibility that the target edge line is affected by burrs rather than noise. Subsequently, based on the burr fuzzy factor of the target edge line and the burr possibility obtained above, the degree of influence of noise on the target edge line is analyzed.

优选地,在本发明的一个实施例中目标边缘线的毛刺可能性的获取方法具体包括:Preferably, in one embodiment of the present invention, the method for obtaining the burr possibility of the target edge line specifically includes:

请参阅图4,其示出了本发明一个实施例提供的目标边缘线的毛刺模糊因子的获取方法流程图。Please refer to FIG. 4 , which shows a flow chart of a method for obtaining a burr fuzzy factor of a target edge line provided by an embodiment of the present invention.

步骤S301:对每个纹理边缘线上的所有像素点的梯度值的整体水平进行分析,获得每个纹理边缘线的梯度分布值,对所有纹理边缘线的梯度分布值的整体水平进行分析,获得整体梯度分布参数。Step S301: Analyze the overall level of the gradient values of all pixels on each texture edge line to obtain the gradient distribution value of each texture edge line, and analyze the overall level of the gradient distribution values of all texture edge lines to obtain the overall gradient distribution parameter.

首先,对每个纹理边缘线上的所有像素点的梯度值的整体水平进行分析,获得每个纹理边缘线的梯度分布值,通过梯度分布值反映每个纹理边缘线上各像素点梯度值的整体分布情况,其中,像素点的梯度值可通过现有的Sobel算子或Scharr算子等梯度算子进行计算,在此不做赘述,并进一步对所有纹理边缘线的梯度分布值的整体水平进行分析,获得整体梯度分布参数,通过整体梯度分布参数反映各纹理边缘线的梯度分布情况,为后续的计算提供数据基础。First, the overall level of the gradient values of all pixels on each texture edge line is analyzed to obtain the gradient distribution value of each texture edge line. The gradient distribution value reflects the overall distribution of the gradient values of each pixel on each texture edge line. The gradient value of the pixel can be calculated by existing gradient operators such as the Sobel operator or the Scharr operator, which will not be elaborated here. The overall level of the gradient distribution values of all texture edge lines is further analyzed to obtain the overall gradient distribution parameters. The overall gradient distribution parameters reflect the gradient distribution of each texture edge line, providing a data basis for subsequent calculations.

在本发明实施例中可将每个纹理边缘线上的所有像素点的梯度值的平均值或中位数,作为每个纹理边缘线的梯度分布值,实现对每个纹理边缘线上的所有像素点的梯度值的整体水平的分析,在此不作限定。In an embodiment of the present invention, the average or median of the gradient values of all pixels on each texture edge line can be used as the gradient distribution value of each texture edge line to achieve an overall level analysis of the gradient values of all pixels on each texture edge line, which is not limited here.

在本发明实施例中可将所有纹理边缘线的梯度分布值的平均值或中位数,作为整体梯度分布参数,实现对所有纹理边缘线的梯度分布值的整体水平的分析,在此不作限定。In the embodiment of the present invention, the average value or median of the gradient distribution values of all texture edge lines can be used as the overall gradient distribution parameter to implement the overall level analysis of the gradient distribution values of all texture edge lines, which is not limited here.

步骤S302:根据整体梯度分布参数和每个参考纹理边缘线的梯度分布值,获得每个参考纹理边缘线的初始梯度特征值;初始梯度特征值与整体梯度分布参数呈正相关,初始梯度特征值与每个参考纹理边缘线的梯度分布值成负相关。Step S302: obtaining an initial gradient eigenvalue of each reference texture edge line according to the overall gradient distribution parameter and the gradient distribution value of each reference texture edge line; the initial gradient eigenvalue is positively correlated with the overall gradient distribution parameter, and the initial gradient eigenvalue is negatively correlated with the gradient distribution value of each reference texture edge line.

由毛刺而形成的疑似毛刺边缘线周围区域的纹理边缘线上像素点梯度值相对较小,因此目标边缘线的每个参考纹理边缘线的梯度分布值相对于整体梯度分布参数越小,说明目标边缘线周围区域的纹理边缘线上像素点梯度值相对较小,进而说明目标边缘线由于存在毛刺导致周围区域的纹理边缘线的梯度值降低的可能性越大,因此可根据整体梯度分布参数和每个参考纹理边缘线的梯度分布值,获得每个参考纹理边缘线的初始梯度特征值;初始梯度特征值与整体梯度分布参数呈正相关,初始梯度特征值与每个参考纹理边缘线的梯度分布值成负相关。The pixel gradient values on the texture edge lines in the area surrounding the suspected burr edge lines formed by the burrs are relatively small. Therefore, the smaller the gradient distribution value of each reference texture edge line of the target edge line is relative to the overall gradient distribution parameter, the smaller the pixel gradient values on the texture edge lines in the area surrounding the target edge line are, which further indicates that the possibility that the gradient value of the texture edge lines in the surrounding area is reduced due to the presence of burrs on the target edge line is greater. Therefore, the initial gradient eigenvalue of each reference texture edge line can be obtained according to the overall gradient distribution parameter and the gradient distribution value of each reference texture edge line; the initial gradient eigenvalue is positively correlated with the overall gradient distribution parameter, and the initial gradient eigenvalue is negatively correlated with the gradient distribution value of each reference texture edge line.

在本发明的一个实施例,可将整体梯度分布参数作分子,将每个参考纹理边缘线的梯度分布值作分母,将比值作为每个参考纹理边缘线的初始梯度特征值。In one embodiment of the present invention, the overall gradient distribution parameter may be used as the numerator, the gradient distribution value of each reference texture edge line may be used as the denominator, and the ratio may be used as the initial gradient feature value of each reference texture edge line.

步骤S303:对每个参考纹理边缘线的距离参数进行负相关映射,获得每个参考纹理边缘线的第二距离权重;利用每个参考纹理边缘线的第二距离权重,对每个参考纹理边缘线的初始梯度特征值进行加权,获得每个参考纹理边缘线的真实梯度特征值。Step S303: negatively correlate the distance parameters of each reference texture edge line to obtain a second distance weight for each reference texture edge line; and weight the initial gradient eigenvalue of each reference texture edge line using the second distance weight for each reference texture edge line to obtain a true gradient eigenvalue for each reference texture edge line.

考虑到每个参考纹理边缘线的质心与目标边缘线的质心之间的距离越小,说明该参考纹理边缘线的参考价值越大,因此可对每个参考纹理边缘线的距离参数进行负相关映射,获得每个参考纹理边缘线的第二距离权重,进而利用每个参考纹理边缘线的第二距离权重,对每个参考纹理边缘线的初始梯度特征值进行加权,获得每个参考纹理边缘线的真实梯度特征值,后续可基于所有参考纹理边缘线的真实梯度特征值,对目标边缘线的毛刺模糊因子进行分析。Considering that the smaller the distance between the centroid of each reference texture edge line and the centroid of the target edge line, the greater the reference value of the reference texture edge line, the distance parameter of each reference texture edge line can be negatively correlated mapped to obtain the second distance weight of each reference texture edge line, and then the second distance weight of each reference texture edge line can be used to weight the initial gradient eigenvalue of each reference texture edge line to obtain the true gradient eigenvalue of each reference texture edge line. Subsequently, the burr fuzzy factor of the target edge line can be analyzed based on the true gradient eigenvalues of all reference texture edge lines.

步骤S304:对所有参考纹理边缘线的真实梯度特征值的整体水平进行分析后并进行归一化处理,获得目标边缘线的毛刺模糊因子。Step S304: Analyze and normalize the overall level of the true gradient feature values of all reference texture edge lines to obtain the burr fuzzy factor of the target edge line.

参考纹理边缘线的真实梯度特征值越大,说明目标边缘线由于存在毛刺导致周围区域的纹理边缘线的梯度值降低的可能性越大,即目标边缘线上由于毛刺的存在使得周围区域的视觉效果较为模糊,因此可对目标边缘线的所有参考纹理边缘线的真实梯度特征值的整体水平进行分析后并进行归一化处理,获得目标边缘线的毛刺模糊因子。The larger the true gradient eigenvalue of the reference texture edge line is, the greater the possibility that the gradient value of the texture edge line in the surrounding area is reduced due to the presence of burrs on the target edge line, that is, the visual effect of the surrounding area is blurred due to the presence of burrs on the target edge line. Therefore, the overall level of the true gradient eigenvalues of all reference texture edge lines of the target edge line can be analyzed and normalized to obtain the burr fuzziness factor of the target edge line.

在本发明实施例中可通过计算目标边缘线的所有参考纹理边缘线的真实梯度特征值的平均值或中位数,实现对目标边缘线的所有参考纹理边缘线的真实梯度特征值的整体水平的分析,在此不作限定。In the embodiment of the present invention, the overall level analysis of the true gradient eigenvalues of all reference texture edge lines of the target edge line can be achieved by calculating the average or median of the true gradient eigenvalues of all reference texture edge lines of the target edge line, which is not limited here.

目标边缘线的毛刺模糊因子的表达式可以具体例如为:The expression of the burr fuzzy factor of the target edge line can be specifically, for example, as follows:

其中,表示目标边缘线的毛刺模糊因子;表示目标边缘线的第个参考纹理边缘线的距离参数;表示目标边缘线的第个参考纹理边缘线的第二距离权重;表示整体梯度分布参数;表示目标边缘线的第个参考纹理边缘线的梯度分布值;表示目标边缘线的第个参考纹理边缘线的初始梯度特征值;表示目标边缘线的第个参考纹理边缘线的真实梯度特征值;表示归一化函数。in, Indicates the burr fuzziness factor of the target edge line; The target edge line The distance parameter of the reference texture edge line; The target edge line A second distance weight for a reference texture edge line; represents the overall gradient distribution parameter; The target edge line The gradient distribution value of the reference texture edge line; The target edge line The initial gradient eigenvalues of the reference texture edge lines; The target edge line The true gradient feature value of the reference texture edge line; Represents the normalization function.

至此,获得了每个目标边缘线的毛刺模糊因子。So far, the burr fuzziness factor of each target edge line is obtained.

步骤S4:根据目标边缘线的毛刺可能性和毛刺模糊因子的差异,获得目标边缘线的噪声影响因子;基于每个疑似毛刺边缘线的噪声影响因子,对灰度图像进行滤波,获得增强图像。Step S4: according to the difference between the burr possibility and the burr fuzziness factor of the target edge line, the noise impact factor of the target edge line is obtained; based on the noise impact factor of each suspected burr edge line, the grayscale image is filtered to obtain an enhanced image.

在不受到噪声影响的理想情况下,目标边缘线的毛刺可能性和毛刺模糊因子会存在正相关性,而噪声会打破这种正相关性,使得目标边缘线的毛刺可能性和毛刺模糊因子存在差异,因此可对目标边缘线的毛刺可能性和毛刺模糊因子的差异进行分析,通过获取的噪声影响因子反映目标边缘线的受到噪声的影响程度,便于后续基于噪声影响因子对各疑似毛刺边缘线进行不同强度的滤波处理,从而去除噪声的影响。Under ideal conditions without being affected by noise, there will be a positive correlation between the burr possibility and the burr fuzzy factor of the target edge line, but noise will break this positive correlation, resulting in a difference between the burr possibility and the burr fuzzy factor of the target edge line. Therefore, the difference between the burr possibility and the burr fuzzy factor of the target edge line can be analyzed, and the noise influence factor obtained can be used to reflect the degree to which the target edge line is affected by noise, so as to facilitate subsequent filtering of different intensities on each suspected burr edge line based on the noise influence factor, thereby removing the influence of noise.

优选地,在本发明的一个实施例中目标边缘线的噪声影响因子的获取方法具体包括:Preferably, in one embodiment of the present invention, the method for obtaining the noise impact factor of the target edge line specifically includes:

噪声对目标边缘线的影响越大,导致目标边缘线的毛刺可能性和毛刺模糊因子的差异越大,因此可对根据目标边缘线的毛刺可能性和毛刺模糊因子的差异进行归一化处理,获得目标边缘线的噪声影响因子。The greater the impact of noise on the target edge line, the greater the difference between the burr possibility and the burr fuzzy factor of the target edge line. Therefore, the difference between the burr possibility and the burr fuzzy factor of the target edge line can be normalized to obtain the noise impact factor of the target edge line.

在本发明的一个实施例中可通过计算目标边缘线的毛刺可能性和毛刺模糊因子的差值的绝对值,实现对二者的差异分析。In one embodiment of the present invention, the difference analysis between the burr possibility of the target edge line and the burr fuzzy factor can be realized by calculating the absolute value of the difference between the two.

目标边缘线的噪声影响因子的表达式可以具体例如为:The expression of the noise impact factor of the target edge line can be specifically expressed as:

其中,表示目标边缘线的噪声影响因子;表示目标边缘线的毛刺可能性;表示目标边缘线的毛刺模糊因子;表示归一化函数。in, Represents the noise impact factor of the target edge line; Indicates the possibility of burr on the edge line of the target; Indicates the burr fuzziness factor of the target edge line; Represents the normalization function.

通过上述相同的方法便可得到每个疑似毛刺边缘线的噪声影响因子,每个疑似毛刺边缘线的噪声影响因子越大,说明该疑似毛刺边缘线受到噪声的影响程度越大,因此可基于每个疑似毛刺边缘线的噪声影响因子,对灰度图像进行滤波,获得增强图像,消除噪声对毛刺检测的干扰,提高后续对钛金属加工表面毛刺的检测精度。The noise influence factor of each suspected burr edge line can be obtained by the same method as mentioned above. The larger the noise influence factor of each suspected burr edge line is, the greater the degree of influence of noise on the suspected burr edge line is. Therefore, based on the noise influence factor of each suspected burr edge line, the grayscale image can be filtered to obtain an enhanced image, eliminate the interference of noise on burr detection, and improve the subsequent detection accuracy of burrs on the titanium metal processing surface.

优选地,在本发明的一个实施例中增强图像的获取方法具体包括:Preferably, in one embodiment of the present invention, the method for acquiring an enhanced image specifically includes:

本发明实施例选用信息保留能力较好的维纳滤波算法对灰度图像进行滤波,由于噪声影响因子越大,说明该疑似毛刺边缘线受到噪声的影响程度越大,因此可将每个疑似毛刺边缘线的噪声影响因子作为维纳滤波算法所使用的比例因子,并基于维纳滤波算法,对灰度图像中每个疑似毛刺边缘线的最小外接圆所在区域进行滤波,获得增强图像,使得对受到不同噪声影响程度的目标边缘线进行不同强度的滤波,在去除噪声的同时尽可能保留毛刺的特征,提高后续对钛金属加工表面毛刺的检测精度,维纳滤波算法是本领域技术人员熟知的技术手段,在此不做赘述。The embodiment of the present invention selects a Wiener filtering algorithm with good information retention capability to filter the grayscale image. Since the larger the noise impact factor, the greater the degree to which the suspected burr edge line is affected by the noise, the noise impact factor of each suspected burr edge line can be used as the proportional factor used by the Wiener filtering algorithm. Based on the Wiener filtering algorithm, the area where the minimum circumscribed circle of each suspected burr edge line in the grayscale image is located is filtered to obtain an enhanced image, so that the target edge lines affected by different degrees of noise are filtered with different intensities, while removing the noise and retaining the characteristics of the burr as much as possible, thereby improving the subsequent detection accuracy of burrs on the titanium metal processing surface. The Wiener filtering algorithm is a technical means well known to those skilled in the art and will not be elaborated here.

至此,得到了质量更好的增强图像,后续可在增强图像中准确检测出存在的毛刺部位。At this point, an enhanced image with better quality is obtained, and the burr locations can be accurately detected in the enhanced image later.

步骤S5:对增强图像进行边缘检测,获得增强图像中的毛刺部位。Step S5: Perform edge detection on the enhanced image to obtain the burr location in the enhanced image.

由于增强图像中的噪声得到了有效去除,因此便可对增强图像进行边缘检测,获得增强图像中的毛刺部位,提高对钛金属加工表面毛刺的检测精度。Since the noise in the enhanced image is effectively removed, the edge detection of the enhanced image can be performed to obtain the burr location in the enhanced image, thereby improving the detection accuracy of burrs on the titanium metal processing surface.

优选地,在本发明的一个实施例中毛刺部位的获取方法具体包括:Preferably, in one embodiment of the present invention, the method for obtaining the burr location specifically includes:

基于Canny边缘检测算法等边缘检测算法,对增强图像进行边缘检测,获得增强图像中的优化加工边缘线,由于增强图像中的噪声得到了有效去除,因此优化加工边缘线中出现的断开缺失现象是由毛刺所引起的,因此可将优化加工边缘线和预设加工轨迹进行对比,将优化加工边缘线相对于预设加工轨迹所缺失的部分,作为增强图像中的毛刺部位。Based on edge detection algorithms such as the Canny edge detection algorithm, edge detection is performed on the enhanced image to obtain the optimized processing edge line in the enhanced image. Since the noise in the enhanced image has been effectively removed, the disconnection and missing phenomenon in the optimized processing edge line is caused by burrs. Therefore, the optimized processing edge line can be compared with the preset processing trajectory, and the missing part of the optimized processing edge line relative to the preset processing trajectory is taken as the burr location in the enhanced image.

本发明一个实施例提供了一种钛金属加工过程中毛刺检测系统,该系统包括存储器、处理器和计算机程序,其中存储器用于存储相应的计算机程序,处理器用于运行相应的计算机程序,计算机程序在处理器中运行时能够实现步骤S1~S5所描述的方法。An embodiment of the present invention provides a burr detection system during titanium metal processing, the system comprising a memory, a processor and a computer program, wherein the memory is used to store the corresponding computer program, the processor is used to run the corresponding computer program, and when the computer program runs in the processor, the method described in steps S1 to S5 can be implemented.

综上所述,本发明实施例首先获取待测加工钛金属表面的灰度图像,对灰度图像进行边缘检测,获得灰度图像中的加工边缘线、疑似毛刺边缘线和纹理边缘线;根据以每个像素点为中心的预设邻域内各像素点的灰度值的分布,获得每个像素点的灰度变化因子;将任意一个疑似毛刺边缘线作为目标边缘线,将与目标边缘线相邻的两个加工边缘线作为目标边缘线的参考加工边缘线,根据目标边缘线上各像素点的灰度变化因子,以及目标边缘线与参考加工边缘线之间像素点的灰度变化因子的差异,获得目标边缘线的毛刺可能性;获取目标边缘线和每个纹理边缘线的质心,将目标边缘线与每个纹理边缘线之间质心的距离,作为每个纹理边缘线的距离参数;选取预设数量个距离参数最小的纹理边缘线作为目标边缘线的参考纹理边缘线;根据每个参考纹理边缘线上各像素点的梯度值,以及每个参考纹理边缘线的距离参数,获得目标边缘线的毛刺模糊因子;根据目标边缘线的毛刺可能性和毛刺模糊因子的差异,获得目标边缘线的噪声影响因子;基于每个疑似毛刺边缘线的噪声影响因子,对灰度图像进行滤波,获得增强图像;对增强图像进行边缘检测,获得增强图像中的毛刺部位。In summary, the embodiment of the present invention first obtains a grayscale image of the titanium metal surface to be processed, performs edge detection on the grayscale image, and obtains processing edge lines, suspected burr edge lines, and texture edge lines in the grayscale image; obtains the grayscale variation factor of each pixel point according to the distribution of the grayscale values of each pixel point in a preset neighborhood centered on each pixel point; takes any suspected burr edge line as the target edge line, and takes the two processing edge lines adjacent to the target edge line as the reference processing edge lines of the target edge line; obtains the burr possibility of the target edge line according to the grayscale variation factor of each pixel point on the target edge line and the difference in the grayscale variation factor of the pixel point between the target edge line and the reference processing edge line; obtains the target edge line The target edge line is compared with the centroid of each texture edge line, and the distance between the centroid of the target edge line and each texture edge line is used as the distance parameter of each texture edge line; a preset number of texture edge lines with the smallest distance parameters are selected as the reference texture edge lines of the target edge line; the burr fuzzy factor of the target edge line is obtained according to the gradient value of each pixel point on each reference texture edge line and the distance parameter of each reference texture edge line; the noise influence factor of the target edge line is obtained according to the difference between the burr possibility of the target edge line and the burr fuzzy factor; based on the noise influence factor of each suspected burr edge line, the grayscale image is filtered to obtain an enhanced image; edge detection is performed on the enhanced image to obtain the burr part in the enhanced image.

需要说明的是:上述本发明实施例先后顺序仅仅为了描述,不代表实施例的优劣。在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims (9)

1. A method for detecting burrs in a titanium metal machining process, the method comprising:
acquiring a gray level image of the surface of the titanium metal to be processed, and performing edge detection on the gray level image to obtain a processed edge line, a suspected burr edge line and a texture edge line in the gray level image;
Obtaining a gray scale change factor of each pixel point according to the distribution of gray scale values of each pixel point in a preset neighborhood taking each pixel point as a center; taking any suspected burr edge line as a target edge line, taking two processing edge lines adjacent to the target edge line as reference processing edge lines of the target edge line, and obtaining the burr possibility of the target edge line according to the gray scale change factors of all pixel points on the target edge line and the difference of the gray scale change factors of the pixel points between the target edge line and the reference processing edge line;
Acquiring the mass centers of the target edge line and each texture edge line, and taking the distance between the target edge line and each texture edge line as the distance parameter of each texture edge line; selecting a preset number of texture edge lines with minimum distance parameters as reference texture edge lines of target edge lines; obtaining a burr blurring factor of the target edge line according to the gradient value of each pixel point on each reference texture edge line and the distance parameter of each reference texture edge line;
obtaining a noise influence factor of the target edge line according to the burr possibility of the target edge line and the difference of the burr blurring factors; filtering the gray level image based on the noise influence factors of each suspected burr edge line to obtain an enhanced image;
performing edge detection on the enhanced image to obtain a burr part in the enhanced image;
The obtaining an enhanced image includes:
And taking the noise influence factor of each suspected burr edge line as a scale factor used by a wiener filtering algorithm, and filtering the area where the minimum circumcircle of each suspected burr edge line in the gray level image is located based on the wiener filtering algorithm to obtain an enhanced image.
2. The method for detecting burrs during titanium metal processing as defined in claim 1, wherein said obtaining processing edge lines, suspected burrs edge lines and texture edge lines in gray scale images includes:
Performing edge detection on the gray level image based on an edge detection algorithm to obtain a processing edge line and a texture edge line in the gray level image;
And comparing the processing edge line with a preset processing track, and taking the part of the processing edge line, which is missing relative to the preset processing track, as a suspected burr edge line.
3. The method for detecting burrs during titanium metal processing of claim 1, wherein said obtaining a gray scale variation factor for each pixel point comprises:
Taking any pixel point in the gray level image as a target pixel point, and taking any pixel point in a preset adjacent area taking the target pixel point as a center as a pixel point to be measured; if the gray value of the pixel to be detected is greater than or equal to the gray value of all the pixels in a preset window taking the pixel to be detected as the center, marking the pixel to be detected as a maximum pixel, and acquiring all the maximum pixels in a preset adjacent area;
taking any one maximum pixel point as a target maximum pixel point, and taking other maximum pixel points closest to the target maximum pixel point as reference maximum pixel points of the target maximum pixel point;
taking the average value of the gray values of the target maximum pixel point and the corresponding reference maximum pixel point as a first gray parameter of the target maximum pixel point; analyzing the integral level of gray values of all pixel points on the connecting line between the target maximum pixel point and the corresponding reference maximum pixel point to obtain a second gray parameter of the target maximum pixel point; acquiring an initial gray scale variation parameter of a target maximum pixel point according to the first gray scale parameter and the second gray scale parameter, wherein the initial gray scale variation parameter is positively correlated with the first gray scale parameter, and the initial gray scale variation parameter is negatively correlated with the second gray scale parameter;
Performing negative correlation mapping on the distance between the target maximum pixel point and the corresponding reference maximum pixel point to obtain a first distance weight of the target maximum pixel point, and weighting the initial gray level change parameter by using the first distance weight of the target maximum pixel point to obtain a real gray level change parameter of the target maximum pixel point;
analyzing the overall level of the real gray scale change parameters of all the maximum pixel points in the preset neighborhood, and carrying out normalization processing to obtain the gray scale change factor of the target pixel point.
4. The method for detecting burrs during titanium metal processing of claim 1, wherein said obtaining the probability of burrs of a target edge line comprises:
analyzing the overall level of the gray scale change factors of all pixel points on the target edge line or each reference processing edge line to obtain the overall gray scale change factors of the target edge line or each reference processing edge line;
According to the difference of the integral gray scale change factors between the target edge line and each reference processing edge line, gray scale change difference values of each reference processing edge line are obtained, and the maximum value of the gray scale change difference values of all the reference processing edge lines is used as a gray scale change characteristic value of the target edge line;
and obtaining the burr possibility of the target edge line according to the integral gray scale change factor and the gray scale change characteristic value of the target edge line, wherein the burr possibility is positively correlated with the gray scale change characteristic value of the target edge line, the burr possibility is negatively correlated with the integral gray scale change factor of the target edge line, and the burr possibility is a numerical value after normalization processing.
5. The method for detecting burrs during titanium metal processing of claim 1, wherein said obtaining a burr blur factor of a target edge line comprises:
Analyzing the overall level of the gradient values of all pixel points on each texture edge line to obtain a gradient distribution value of each texture edge line, and analyzing the overall level of the gradient distribution value of all texture edge lines to obtain an overall gradient distribution parameter;
Obtaining an initial gradient characteristic value of each reference texture edge line according to the overall gradient distribution parameters and the gradient distribution value of each reference texture edge line; the initial gradient characteristic value is positively correlated with the overall gradient distribution parameter, and the initial gradient characteristic value is negatively correlated with the gradient distribution value of each reference texture edge line;
performing negative correlation mapping on the distance parameters of each reference texture edge line to obtain a second distance weight of each reference texture edge line; weighting the initial gradient characteristic value of each reference texture edge line by using the second distance weight of each reference texture edge line to obtain a real gradient characteristic value of each reference texture edge line;
analyzing the overall level of the real gradient characteristic values of all the reference texture edge lines, and carrying out normalization processing to obtain the burr fuzzy factor of the target edge line.
6. The method for detecting burrs during titanium metal processing of claim 1, wherein said obtaining noise influencing factors of a target edge line comprises:
And carrying out normalization processing on the difference of the burr possibility and the burr blurring factor according to the target edge line to obtain a noise influence factor of the target edge line.
7. The method for detecting burrs in a titanium metal working process of claim 1, wherein said performing edge detection on the enhanced image to obtain burrs in the enhanced image comprises:
performing edge detection on the enhanced image to obtain an optimized processing edge line in the enhanced image;
Comparing the optimized machining edge line with a preset machining track, and taking the missing part of the optimized machining edge line relative to the preset machining track as a burr part in the enhanced image.
8. The method for detecting burrs in a titanium metal machining process according to claim 1, wherein the preset number is an integer ranging from 10 to 30.
9. A system for detecting burrs during titanium metal machining, said system comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that said processor implements the steps of the method according to any one of claims 1-8 when executing said computer program.
CN202411046065.XA 2024-08-01 2024-08-01 A burr detection method and system during titanium metal processing Active CN118570072B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411046065.XA CN118570072B (en) 2024-08-01 2024-08-01 A burr detection method and system during titanium metal processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411046065.XA CN118570072B (en) 2024-08-01 2024-08-01 A burr detection method and system during titanium metal processing

Publications (2)

Publication Number Publication Date
CN118570072A true CN118570072A (en) 2024-08-30
CN118570072B CN118570072B (en) 2024-11-22

Family

ID=92474828

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411046065.XA Active CN118570072B (en) 2024-08-01 2024-08-01 A burr detection method and system during titanium metal processing

Country Status (1)

Country Link
CN (1) CN118570072B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118781144A (en) * 2024-09-12 2024-10-15 海纳美腾智能制造(山东)有限公司 A coal washing plant belt deviation monitoring and protection system
CN118951900A (en) * 2024-10-18 2024-11-15 江苏民安节能设备有限公司 Efficient control cabinet shell deburring method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021169638A1 (en) * 2020-02-26 2021-09-02 长安大学 Wear pattern angle automatic detection method for dual neighborhoods
CN116228747A (en) * 2023-05-04 2023-06-06 青岛穗禾信达金属制品有限公司 Metal cabinet processing quality monitoring method
CN116385472A (en) * 2023-06-07 2023-07-04 深圳市锦红兴科技有限公司 Hardware stamping part deburring effect evaluation method
CN116777941A (en) * 2023-08-22 2023-09-19 山东明达圣昌铝业集团有限公司 Profile contour detection method and system based on machine vision
CN117576137A (en) * 2023-11-28 2024-02-20 西南石油大学 Rock slice image edge detection method based on improved canny algorithm

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021169638A1 (en) * 2020-02-26 2021-09-02 长安大学 Wear pattern angle automatic detection method for dual neighborhoods
CN116228747A (en) * 2023-05-04 2023-06-06 青岛穗禾信达金属制品有限公司 Metal cabinet processing quality monitoring method
CN116385472A (en) * 2023-06-07 2023-07-04 深圳市锦红兴科技有限公司 Hardware stamping part deburring effect evaluation method
CN116777941A (en) * 2023-08-22 2023-09-19 山东明达圣昌铝业集团有限公司 Profile contour detection method and system based on machine vision
CN117576137A (en) * 2023-11-28 2024-02-20 西南石油大学 Rock slice image edge detection method based on improved canny algorithm

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
李永基: ""基于图像的轨道表面缺陷识别研究"", 中国优秀硕士论文全文库 信息科技辑, no. 02, 15 February 2018 (2018-02-15) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118781144A (en) * 2024-09-12 2024-10-15 海纳美腾智能制造(山东)有限公司 A coal washing plant belt deviation monitoring and protection system
CN118951900A (en) * 2024-10-18 2024-11-15 江苏民安节能设备有限公司 Efficient control cabinet shell deburring method and system

Also Published As

Publication number Publication date
CN118570072B (en) 2024-11-22

Similar Documents

Publication Publication Date Title
CN118570072A (en) Burr detection method and system in titanium metal processing process
CN109242853B (en) An intelligent detection method for PCB defects based on image processing
CN112446838A (en) Image noise detection method and device based on local statistical information
CN115908415B (en) Edge-based defect detection method, device, equipment and storage medium
CN115330758B (en) Welding quality detection method based on denoising treatment
CN115330767A (en) Method for identifying production abnormity of corrosion foil
EP3510526B1 (en) Particle boundary identification
CN117392066B (en) Defect detection method, device, equipment and storage medium
CN107341793A (en) A kind of target surface image processing method and device
CN115311289A (en) Method for detecting oil stain defects of plain-color cloth
CN118552549B (en) A transmission shaft component defect detection method and system based on image processing
CN111275659A (en) Weld image processing method and device, terminal device and storage medium
CN117853510A (en) Canny edge detection method based on bilateral filtering and self-adaptive threshold
CN110400319A (en) A Silk Cake Oil Stain Segmentation Algorithm Based on Region Segmentation
CN106447683A (en) Feature extraction algorithm of circles
CN115661110A (en) A method for identifying and locating transparent workpieces
CN113673396B (en) Spore germination rate calculation method, device and storage medium
CN118037715B (en) Intelligent welding spot analysis optimization method and system for PCBA board
CN115272362A (en) Method and device for segmenting effective area of digital pathology full-field image
CN114913112A (en) Method, device and equipment for detecting double edges of wafer
CN117911419A (en) Method and device for detecting steel rotation angle enhancement of medium plate, medium and equipment
CN117611619A (en) Linear fitting method, linear fitting system, electronic equipment and storage medium
CN116883401A (en) Industrial product production quality detection system
CN116703883A (en) Method and device for determining pinhole defects after welding of power battery and electronic equipment
CN114862786A (en) Retinex image enhancement and Ostu threshold segmentation based isolated zone detection method and system

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