CN115861320B - Intelligent detection method for automobile part machining information - Google Patents

Intelligent detection method for automobile part machining information Download PDF

Info

Publication number
CN115861320B
CN115861320B CN202310171997.6A CN202310171997A CN115861320B CN 115861320 B CN115861320 B CN 115861320B CN 202310171997 A CN202310171997 A CN 202310171997A CN 115861320 B CN115861320 B CN 115861320B
Authority
CN
China
Prior art keywords
area
target
defect
target area
suspected
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310171997.6A
Other languages
Chinese (zh)
Other versions
CN115861320A (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.)
Tianjin Sino German University of Applied Sciences
Original Assignee
Tianjin Sino German University of Applied Sciences
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 Tianjin Sino German University of Applied Sciences filed Critical Tianjin Sino German University of Applied Sciences
Priority to CN202310171997.6A priority Critical patent/CN115861320B/en
Publication of CN115861320A publication Critical patent/CN115861320A/en
Application granted granted Critical
Publication of CN115861320B publication Critical patent/CN115861320B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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

  • Image Processing (AREA)
  • Investigating Or Analyzing Materials By The Use Of Magnetic Means (AREA)

Abstract

The invention relates to the technical field of image data processing, in particular to an intelligent detection method for automobile part processing information. The method comprises the steps of obtaining a gray image of the bearing surface after fluorescent magnetic powder injection; obtaining a suspected defect area in the gray level image through a watershed algorithm; obtaining a pixel point corresponding to the maximum gray value in each suspected defect area as a target pixel point, clustering the pixel points in each suspected defect area, and taking the area of a cluster where the target pixel point is located as a target area; acquiring the aggregation degree of fluorescent magnetic powder of each target area according to the area of the suspected defect area corresponding to the target area and the position distribution and gradient distribution of the pixel points in the target area; acquiring a gray level difference between a target area and a gray level image as a target difference; obtaining the similarity between the target area and the background area according to the aggregation degree of the fluorescent magnetic powder and the target difference; and determining a defect area in the gray image according to the similarity. The efficiency of detecting defective areas is improved.

Description

一种汽车零件加工信息智能检测方法An intelligent detection method for processing information of automobile parts

技术领域technical field

本发明涉及图像数据处理技术领域,具体涉及一种汽车零件加工信息智能检测方法。The invention relates to the technical field of image data processing, in particular to an intelligent detection method for processing information of automobile parts.

背景技术Background technique

轴承是汽车零件中非常关键的一个部件,轴承质量的好坏关系到汽车的行驶安全。轴承在生产加工的过程中会因为锻造加热温度过高或保温时间过长产生缺陷,严重时晶界氧化甚至熔化。过烧的轴承在这种缺陷状态下进行锻造加工,受到重锤的锻打、冲孔及碾扩,缺陷处会产生撕裂,形成更大的缺陷。Bearing is a very critical part of auto parts, the quality of bearing is related to the driving safety of the car. During the production and processing of bearings, defects will occur due to excessive forging heating temperature or excessive holding time, and in severe cases, the grain boundaries will be oxidized or even melted. The burnt bearing is forged in this defect state, and is subjected to forging, punching and rolling with a heavy hammer, and the defect will tear and form a larger defect.

在现有技术中,通常采用荧光磁粉法对轴承表面的缺陷进行探伤,荧光磁粉会依附在轴承表面的缺陷区域而形成荧光区域,可通过图像分割领域中常用的分水岭算法将荧光区域进行分割。但是细微的荧光磁粉也会依附在轴承表面的不平整处,形成荧光区域,因此当通过分水岭算法进行分割时,会因为荧光区域较大,导致水淹后保留的疑似缺陷区域面积较大,使得疑似缺陷区域既包含部分不存在缺陷的不平整区域也包含缺陷区域,使得分割出来的缺陷区域不准确,对缺陷区域的识别造成干扰,不利于对缺陷区域的检测。In the prior art, the defect detection on the bearing surface is usually carried out using the fluorescent magnetic particle method. The fluorescent magnetic powder will adhere to the defect area on the bearing surface to form a fluorescent area, which can be segmented by the commonly used watershed algorithm in the field of image segmentation. However, the fine fluorescent magnetic powder will also adhere to the unevenness of the bearing surface to form a fluorescent area. Therefore, when segmented by the watershed algorithm, the area of the suspected defect area retained after flooding will be larger due to the larger fluorescent area. The suspected defect area includes both some uneven areas without defects and defect areas, which makes the segmented defect areas inaccurate, interferes with the identification of defect areas, and is not conducive to the detection of defect areas.

发明内容Contents of the invention

为了解决轴承不平整区域对缺陷区域的干扰,导致缺陷区域检测不准确的技术问题,本发明的目的在于提供一种汽车零件加工信息智能检测方法,所采用的技术方案具体如下:In order to solve the technical problem of inaccurate detection of defect areas caused by the interference of the uneven area of the bearing on the defect area, the purpose of the present invention is to provide an intelligent detection method for processing information of automobile parts. The technical solution adopted is as follows:

本发明实施例中提供了一种汽车零件加工信息智能检测方法,该方法包括以下:An embodiment of the present invention provides an intelligent detection method for processing information of automobile parts, the method includes the following steps:

获得荧光磁粉喷射后轴承表面的灰度图像;Obtain a grayscale image of the bearing surface after fluorescent magnetic particle spraying;

通过分水岭算法获得所述灰度图像中的疑似缺陷区域;获取每个所述疑似缺陷区域中的最大灰度值对应的像素点作为目标像素点,对每个所述疑似缺陷区域中的像素点进行聚类,将所述目标像素点所在聚类簇的区域作为目标区域;The suspected defect area in the grayscale image is obtained by the watershed algorithm; the pixel point corresponding to the maximum gray value in each of the suspected defect areas is obtained as the target pixel point, and the pixel point in each of the suspected defect area is obtained. Carrying out clustering, using the region of the cluster where the target pixel is located as the target region;

根据所述目标区域对应的所述疑似缺陷区域的面积和所述目标区域中像素点的位置分布与梯度分布获取每个所述目标区域的荧光磁粉聚集程度;Acquiring the degree of fluorescent magnetic powder aggregation of each target area according to the area of the suspected defect area corresponding to the target area and the position distribution and gradient distribution of pixels in the target area;

获取所述目标区域与所述灰度图像之间的灰度差异作为目标差异;根据所述荧光磁粉聚集程度与所述目标差异获取所述目标区域与背景区域的相似度;Obtaining the grayscale difference between the target area and the grayscale image as the target difference; acquiring the similarity between the target area and the background area according to the aggregation degree of the fluorescent magnetic powder and the target difference;

根据所述相似度将所述目标区域对应的所述疑似缺陷区域与所述背景区域合并,确定所述灰度图像中的缺陷区域。Merging the suspected defect area corresponding to the target area with the background area according to the similarity, to determine the defect area in the grayscale image.

进一步地,所述荧光磁粉聚集程度的获取方法,包括:Further, the method for obtaining the aggregation degree of the fluorescent magnetic powder includes:

获取所述目标区域中的最大灰度值对应的像素点的坐标作为第一坐标,计算所述目标区域中的每个像素点对应的坐标与第一坐标之间的距离,获取所述目标区域中的像素点之间的平均距离;将平均距离进行负相关映射并归一化,所得结果作为第一结果;Acquire the coordinates of the pixel corresponding to the maximum gray value in the target area as the first coordinate, calculate the distance between the coordinate corresponding to each pixel in the target area and the first coordinate, and obtain the target area The average distance between the pixels in ; the average distance is negatively correlated and normalized, and the result is taken as the first result;

获取所述目标区域中的边缘像素点的梯度均值作为平均梯度;Obtaining the gradient mean value of the edge pixels in the target area as the average gradient;

获取所述目标区域对应的疑似缺陷区域中的像素点的数量即疑似缺陷区域的面积作为第一面积;Obtaining the number of pixels in the suspected defective region corresponding to the target region, that is, the area of the suspected defective region, as the first area;

计算第一结果、平均梯度与第一面积之间的乘积作为所述目标区域的荧光磁粉聚集程度。Calculate the product of the first result, the average gradient and the first area as the aggregation degree of the fluorescent magnetic powder in the target area.

进一步地,所述目标差异的获取方法,包括:Further, the method for obtaining the target difference includes:

计算所述目标区域中的平均灰度值作为第一值;calculating the average gray value in the target area as the first value;

计算所述灰度图像中的平均灰度值作为第二值;calculating the average gray value in the gray image as a second value;

将第一值与第二值的差值作为所述目标区域与所述灰度图像之间的目标差异。The difference between the first value and the second value is used as the target difference between the target area and the grayscale image.

进一步地,所述相似度的获取方法,包括:Further, the method for obtaining the similarity includes:

将荧光磁粉聚集程度与目标差异的乘积进行负相关映射并归一化的结果作为目标区域与背景区域之间的相似度。The product of the degree of fluorescent magnetic particle aggregation and the target difference is negatively correlated and normalized as the similarity between the target area and the background area.

进一步地,所述根据所述相似度确定所述灰度图像中的缺陷区域的方法,包括:Further, the method for determining the defect area in the grayscale image according to the similarity includes:

设置相似度阈值,当相似度大于相似度阈值时,对应目标区域所在疑似缺陷区域不存在缺陷,将疑似缺陷区域与背景区域进行合并;未合并的区域即是缺陷区域,对缺陷区域进行核验。Set the similarity threshold. When the similarity is greater than the similarity threshold, there is no defect in the suspected defect area where the target area is located, and the suspected defect area is merged with the background area; the unmerged area is the defect area, and the defect area is verified.

进一步地,所述对每个所述疑似缺陷区域中的像素点进行聚类的方法,包括:Further, the method for clustering the pixels in each of the suspected defect regions includes:

使用DBSCAN密度聚类算法根据像素点的位置与灰度值对疑似缺陷区域中的像素点进行聚类。Use the DBSCAN density clustering algorithm to cluster the pixels in the suspected defect area according to the position and gray value of the pixels.

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

通过分水岭算法获得轴承表面的灰度图像中的疑似缺陷区域,进而只对疑似缺陷区域进行分析,提高对缺陷区域检测的效率;获取每个疑似缺陷区域中的最大灰度值对应的像素点作为目标像素点,方便后续对疑似缺陷区域的具体特征进行分析;因此,对每个疑似缺陷区域中的像素点进行聚类,将目标像素点所在聚类簇的区域作为目标区域,目标区域中的像素点为疑似缺陷区域中灰度值峰较大的像素点,可以反映出对应疑似缺陷区域中的荧光磁粉的依附情况,因此,根据目标区域对应的疑似缺陷区域的面积和目标区域中像素点的位置分布与梯度分布获取每个目标区域的荧光磁粉聚集程度,初步判断缺陷区域;为了进一步确定缺陷区域,获取目标区域与灰度图像之间的灰度差异作为目标差异,间接确定目标区域所在疑似缺陷区域与背景区域的差异程度;进而根据荧光磁粉聚集程度与目标差异获取目标区域与背景区域的相似度,根据相似度将目标区域对应的疑似缺陷区域与背景区域合并,去除了因轴承表面不平整导致的对缺陷区域检测的干扰,消除了分水岭算法引起的过分割区域,确定了灰度图像中的缺陷区域,提高了缺陷区域检测的准确率。The suspected defect area in the grayscale image of the bearing surface is obtained by the watershed algorithm, and then only the suspected defect area is analyzed to improve the efficiency of defect area detection; the pixel corresponding to the maximum gray value in each suspected defect area is obtained as The target pixel is convenient for subsequent analysis of the specific characteristics of the suspected defect area; therefore, the pixels in each suspected defect area are clustered, and the cluster area where the target pixel is located is used as the target area. The pixel point is the pixel point with a larger gray value peak in the suspected defect area, which can reflect the attachment of the fluorescent magnetic powder in the corresponding suspected defect area. Therefore, according to the area of the suspected defect area corresponding to the target area and the pixel point in the target area The position distribution and gradient distribution of each target area are obtained to obtain the degree of fluorescent magnetic particle aggregation in each target area, and the defect area is initially judged; in order to further determine the defect area, the gray difference between the target area and the gray image is obtained as the target difference, and the target area is indirectly determined. The degree of difference between the suspected defect area and the background area; then the similarity between the target area and the background area is obtained according to the degree of fluorescent magnetic particle aggregation and the target difference, and the suspected defect area corresponding to the target area is merged with the background area according to the similarity, and the bearing surface is removed. The interference to defect area detection caused by unevenness eliminates the over-segmented area caused by the watershed algorithm, determines the defect area in the grayscale image, and improves the accuracy of defect area detection.

附图说明Description of drawings

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

图1为本发明一个实施例所提供的一种汽车零件加工信息智能检测方法的流程示意图;Fig. 1 is a schematic flow chart of an intelligent detection method for processing information of automobile parts provided by an embodiment of the present invention;

图2为本发明一个实施例所提供的疑似缺陷区域中的灰度值大小的分布图。Fig. 2 is a distribution diagram of the gray value in the suspected defect area provided by an embodiment of the present invention.

具体实施方式Detailed ways

为了更进一步阐述本发明为达成预定发明目的所采取的技术手段及功效,以下结合附图及较佳实施例,对依据本发明提出的一种汽车零件加工信息智能检测方法,其具体实施方式、结构、特征及其功效,详细说明如下。在下述说明中,不同的“一个实施例”或“另一个实施例”指的不一定是同一实施例。此外,一或多个实施例中的特定特征、结构或特点可由任何合适形式组合。In order to further explain the technical means and effects adopted by the present invention to achieve the intended purpose of the invention, the specific implementation manner, The structure, characteristics and effects thereof are described in detail as follows. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, the particular features, structures or characteristics of one or more embodiments may be combined in any suitable manner.

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

下面结合附图具体的说明本发明所提供的一种汽车零件加工信息智能检测方法的具体方案。The specific scheme of an intelligent detection method for processing information of automobile parts provided by the present invention will be described in detail below in conjunction with the accompanying drawings.

请参阅图1,其示出了本发明一个实施例提供的一种汽车零件加工信息智能检测方法的流程示意图,该方法包括以下步骤:Please refer to Fig. 1, which shows a schematic flowchart of a method for intelligent detection of automobile parts processing information provided by an embodiment of the present invention, the method includes the following steps:

步骤S1:获得荧光磁粉喷射后轴承表面的灰度图像。Step S1: Obtain a grayscale image of the bearing surface after fluorescent magnetic particle spraying.

具体的,本发明实施例的目的是通过荧光磁粉法对轴承表面的缺陷进行检测,首先使用赛福探伤机对轴承表面喷射一定量的荧光磁粉,然后通过高清相机采集喷射荧光磁粉后的轴承表面的图像,对获得的图像进行去噪处理,本发明实施例使用均值滤波算法对获得的图像进行去噪,然后对去噪后的图像进行灰度化处理,获得灰度图像。Specifically, the purpose of the embodiment of the present invention is to detect the defects on the bearing surface by the fluorescent magnetic powder method. First, a certain amount of fluorescent magnetic powder is sprayed on the bearing surface by using a SAIF flaw detector, and then the bearing surface after spraying the fluorescent magnetic powder is collected by a high-definition camera. The obtained image is denoised. In the embodiment of the present invention, a mean filter algorithm is used to denoise the obtained image, and then the denoised image is grayscaled to obtain a grayscale image.

其中,均值滤波算法以及灰度化处理均为现有技术,在此不再进行赘述。Wherein, the mean value filtering algorithm and the grayscale processing are both existing technologies, and will not be described in detail here.

步骤S2:通过分水岭算法获得所述灰度图像中的疑似缺陷区域;获取每个所述疑似缺陷区域中的最大灰度值对应的像素点作为目标像素点,对每个所述疑似缺陷区域中的像素点进行聚类,将所述目标像素点所在聚类簇的区域作为目标区域。Step S2: Obtain the suspected defect area in the grayscale image through the watershed algorithm; obtain the pixel corresponding to the maximum gray value in each of the suspected defect areas as the target pixel, and for each of the suspected defect areas The pixels are clustered, and the area of the cluster where the target pixel is located is taken as the target area.

具体的,通过荧光磁粉法对轴承表面进行标记,轴承表面的不同平整度会形成不同的亮暗区域,例如当轴承表面的凹凸程度较大时,细微的荧光磁粉会依附在轴承表面的不平整处,形成一个整体的荧光区域;轴承表面的缺陷在微观观察下表面层金属晶界被氧化开裂呈现尖角,若金属内部成分偏析严重,晶界也开始熔化,严重时会形成尖角状洞穴,荧光磁粉会吸附在缺陷区域内,也形成一个整体的荧光区域。对轴承表面中的荧光区域进行分析,当荧光区域越大越亮时,说明荧光区域越可能为轴承表面中较大的不平整区域或缺陷区域。在灰度图像中荧光区域对应的灰度值较大,除去荧光区域的其他区域即背景区域对应的灰度值较小,通过分水岭算法获得灰度图像中的初始分割区域即疑似缺陷区域。分水岭算法是在灰度图像中找到极小值,然后开始扩张,若灰度图像中存在太多极小区域而产生许多小的集水盆地,会导致灰度图像过分割。因此当通过分水岭算法进行分割时,会因为荧光区域较大,导致水淹后保留的疑似缺陷区域面积较大,使得疑似缺陷区域既包含部分不存在缺陷的不平整区域也包含缺陷区域,使得分割出来的缺陷区域不准确。因此需要对获得的疑似缺陷区域进行处理,去除不存在缺陷的疑似缺陷区域,然后再对剩余的疑似缺陷区域进行识别,进而确定缺陷区域。本发明实施例根据缺陷区域的特征对分水岭算法的水淹位置进行优化,获得最佳的水淹位置,去除不存在缺陷的不平整区域因荧光磁粉进行标记造成的干扰,使得保留下来的疑似缺陷区域为缺陷区域。Specifically, the bearing surface is marked by the fluorescent magnetic particle method. Different flatness of the bearing surface will form different bright and dark areas. A whole fluorescent area is formed; the defects on the surface of the bearing are oxidized and cracked at the grain boundary of the surface layer under microscopic observation. If the segregation of the internal components of the metal is serious, the grain boundary will also begin to melt, and in severe cases, a sharp hole will be formed. , the fluorescent magnetic powder will be adsorbed in the defect area, and also form a whole fluorescent area. Analyze the fluorescent area on the bearing surface. When the fluorescent area is bigger and brighter, it means that the fluorescent area is more likely to be a larger uneven area or defect area on the bearing surface. In the grayscale image, the grayscale value corresponding to the fluorescent area is larger, and the grayscale value corresponding to the other areas except the fluorescent area, that is, the background area, is smaller. The initial segmented area in the grayscale image is the suspected defect area obtained by the watershed algorithm. The watershed algorithm is to find the minimum value in the grayscale image, and then start to expand. If there are too many small areas in the grayscale image, many small catchment basins will be generated, which will cause the grayscale image to be over-segmented. Therefore, when segmented by the watershed algorithm, due to the large fluorescent area, the area of the suspected defect area retained after flooding will be large, so that the suspected defect area includes both some uneven areas without defects and defect areas, making the segmentation The defect area that comes out is not accurate. Therefore, it is necessary to process the obtained suspected defect areas, remove the suspected defect areas without defects, and then identify the remaining suspected defect areas to determine the defect areas. The embodiment of the present invention optimizes the flooding position of the watershed algorithm according to the characteristics of the defect area, obtains the best flooding position, and removes the interference caused by the fluorescent magnetic particle marking in the uneven area without defects, so that the retained suspected defects The area is a defect area.

其中,分水岭算法是公知技术,这里不再进行过多赘述。Among them, the watershed algorithm is a well-known technology, and will not be repeated here.

通过分水岭算法获得的疑似缺陷区域,是直接根据阈值进行判断的,无法分清楚哪些疑似缺陷区域是不平整区域与缺陷区域,因此需要对每个疑似缺陷区域的具体特征进行分析,来对疑似缺陷区域进行合并,将属于正常的不平整区域的疑似缺陷区域与背景区域进行合并,也就是在通过分水岭算法分割时,不仅仅是一个“水淹”的过程,还需要对疑似缺陷区域进行判断,让属于正常的不平整区域的疑似缺陷区域也成为“被淹”的对象。The suspected defect area obtained by the watershed algorithm is directly judged according to the threshold value, and it is impossible to distinguish which suspected defect areas are uneven areas and defect areas. Therefore, it is necessary to analyze the specific characteristics of each suspected defect area to identify the suspected defects. The area is merged, and the suspected defect area belonging to the normal uneven area is merged with the background area, that is, when segmented by the watershed algorithm, it is not only a "flooding" process, but also the suspected defect area needs to be judged. Let the suspected defect area belonging to the normal uneven area also become the object of "flooding".

对疑似缺陷区域的具体特征进行分析,需要先获取每个疑似缺陷区域中的目标区域,获取目标区域的具体操作如下:To analyze the specific characteristics of the suspected defect area, it is necessary to obtain the target area in each suspected defect area first. The specific operation of obtaining the target area is as follows:

获得每个疑似缺陷区域中的最大灰度值对应的像素点作为目标像素点,若一个疑似缺陷区域中最大灰度值对应的像素点至少有两个,则任意选取一个最大灰度值对应的像素点作为目标像素点。使用DBSCAN密度聚类算法根据像素点的位置与灰度值对疑似缺陷区域中的像素点进行聚类,其中,DBSCAN密度聚类算法是根据像素点的位置进行聚类,通过灰度值来选择哪些像素点是聚类对象。获取目标像素点所在聚类簇的区域作为目标区域。本发明实施例设置DBSCAN密度聚类算法中的邻域半径为3,最小邻域像素点数量为3,此处阈值为经验阈值,实施者可根据不同的实施环境自行设定。其中,DBSCAN密度聚类算法为公知技术,这里不再进行过多赘述。Obtain the pixel point corresponding to the maximum gray value in each suspected defect area as the target pixel point, if there are at least two pixels corresponding to the maximum gray value in a suspected defect area, then arbitrarily select a pixel point corresponding to the maximum gray value pixel as the target pixel. Use the DBSCAN density clustering algorithm to cluster the pixels in the suspected defect area according to the position and gray value of the pixel. Among them, the DBSCAN density clustering algorithm is to cluster according to the position of the pixel and select the pixel by the gray value Which pixels are clustering objects. Obtain the area of the cluster where the target pixel is located as the target area. In the embodiment of the present invention, the neighborhood radius in the DBSCAN density clustering algorithm is set to 3, and the minimum number of neighborhood pixels is 3. Here, the threshold is an empirical threshold, which can be set by the implementer according to different implementation environments. Among them, the DBSCAN density clustering algorithm is a well-known technology, and will not be repeated here.

其中,将目标像素点所在聚类簇的区域作为目标区域的原因如下:Among them, the reasons for using the area of the cluster where the target pixel is located as the target area are as follows:

缺陷区域附着的荧光磁粉较多且均匀,因此缺陷区域的整体灰度值较大且灰度波动较大;缺陷区域中像素点的灰度值分布如图2中的B区域,B区域中的每个峰的高度就是缺陷区域中的对应像素点的灰度值;轴承表面的不平整区域通过荧光磁粉的依附形成的疑似缺陷区域之间存在背景区域,因此对应的灰度分布中的峰与峰之间的距离较大,不平整区域对应的疑似缺陷区域中灰度值峰不均匀,且像素点的灰度波动有大有小,如图2中的A区域,A区域中的每个峰值为对应疑似缺陷区域中对应像素点的灰度值。根据图2可以发现不平整区域对应的疑似缺陷区域与缺陷区域之间的峰的分布特征区别很大,A区域的峰的间距较大,并且峰值有高有低;B区域的峰比较密集,且峰值较大,在通过分水岭算法后,A区域的部分峰会小于阈值导致不会被分割出来,而B区域的峰值都大于分割阈值,都会被分割出来,B区域的峰的荧光磁粉聚集程度较大。因此,荧光磁粉聚集程度越大的疑似缺陷区域越可能为缺陷区域。目标像素点所在聚类簇能充分的反映对应的疑似缺陷区域中的高灰度值峰的分布,因此选取目标像素点所在的聚类簇的区域作为目标区域,对目标区域进行分析。因为A区域与B区域中灰度值峰的分布不同,因此聚类后每个疑似缺陷区域对应的目标区域中像素点数量不同且像素点分布也不同,根据目标区域中像素点的数量与分布获取每个目标区域的荧光磁粉聚集程度。The fluorescent magnetic powder attached to the defect area is more and uniform, so the overall gray value of the defect area is large and the gray level fluctuation is large; the gray value distribution of pixels in the defect area is shown in area B in Figure 2, and the area in B is The height of each peak is the gray value of the corresponding pixel in the defect area; there is a background area between the suspected defect areas formed by the attachment of fluorescent magnetic particles on the uneven area of the bearing surface, so the peaks in the corresponding gray scale distribution are the same as The distance between the peaks is relatively large, and the peaks of the gray value in the suspected defect area corresponding to the uneven area are not uniform, and the gray level fluctuations of the pixels vary from large to small, as shown in area A in Figure 2, and each peak in area A is the gray value of the corresponding pixel in the suspected defect area. According to Figure 2, it can be found that the distribution characteristics of the peaks between the suspected defect area corresponding to the uneven area and the defect area are very different. And the peak is large. After passing the watershed algorithm, some peaks in the A region are smaller than the threshold and will not be segmented, while the peaks in the B region are greater than the segmentation threshold and will be segmented. The peaks in the B region have a higher degree of fluorescent magnetic particle aggregation big. Therefore, the suspected defect region with a greater degree of fluorescent magnetic particle aggregation is more likely to be a defect region. The cluster where the target pixel is located can fully reflect the distribution of high gray value peaks in the corresponding suspected defect area, so the cluster area where the target pixel is located is selected as the target area to analyze the target area. Because the distribution of gray value peaks in area A and area B is different, the number of pixels in the target area corresponding to each suspected defect area after clustering is different and the distribution of pixel points is also different. According to the number and distribution of pixels in the target area Obtain the degree of fluorescent magnetic particle accumulation for each target area.

步骤S3:根据所述目标区域对应的所述疑似缺陷区域的面积和所述目标区域中像素点的位置分布与梯度分布获取每个所述目标区域的荧光磁粉聚集程度。Step S3: Obtain the degree of fluorescent magnetic powder aggregation in each target area according to the area of the suspected defect area corresponding to the target area and the position distribution and gradient distribution of pixels in the target area.

具体的,轴承表面的不平整区域产生的荧光区域对缺陷区域的识别会造成干扰,仅依靠灰度分布无法准确的区分不存在缺陷的荧光区域与缺陷区域。但是只要有荧光标记的区域,就有可能存在缺陷,因此通过对灰度图像中荧光区域进行分割,获得疑似缺陷区域,再对疑似缺陷区域进行分析,获得准确的缺陷区域。Specifically, the fluorescent area generated by the uneven area of the bearing surface will interfere with the recognition of the defect area, and it is impossible to accurately distinguish the fluorescent area without defects from the defect area only by relying on the gray scale distribution. However, as long as there are fluorescently marked areas, there may be defects. Therefore, the suspected defect area is obtained by segmenting the fluorescent area in the grayscale image, and then the suspected defect area is analyzed to obtain the accurate defect area.

对疑似缺陷区域进行分析,将不存在缺陷的疑似缺陷区域与背景区域进行合并,将最终分割的区域作为缺陷区域。由步骤S2可知,根据目标区域的荧光磁粉聚集程度可以对疑似缺陷区域进行初步分析。The suspected defect area is analyzed, the suspected defect area without defect is merged with the background area, and the final segmented area is regarded as the defect area. It can be known from step S2 that a preliminary analysis of the suspected defect area can be carried out according to the aggregation degree of the fluorescent magnetic powder in the target area.

优选地,获取荧光磁粉聚集程度的方法为:获取目标区域中的最大灰度值对应的像素点的坐标作为第一坐标,计算目标区域中的每个像素点对应的坐标与第一坐标之间的距离,获取目标区域中的像素点之间的平均距离;将平均距离进行负相关映射并归一化,所得结果作为第一结果;获取目标区域中的边缘像素点的梯度均值作为平均梯度;获取目标区域对应的疑似缺陷区域中的像素点的数量即疑似缺陷区域的面积作为第一面积;计算第一结果、平均梯度与第一面积之间的乘积作为目标区域的荧光磁粉聚集程度。Preferably, the method for obtaining the aggregation degree of the fluorescent magnetic powder is: obtaining the coordinates of the pixel point corresponding to the maximum gray value in the target area as the first coordinate, and calculating the distance between the coordinate corresponding to each pixel point in the target area and the first coordinate Get the average distance between the pixels in the target area; negatively map and normalize the average distance, and the result is taken as the first result; get the mean gradient of the edge pixels in the target area as the average gradient; Obtain the number of pixels in the suspected defect region corresponding to the target region, that is, the area of the suspected defect region as the first area; calculate the first result, the product of the average gradient and the first area as the degree of fluorescent magnetic particle aggregation in the target region.

需要说明的是,轴承表面因不平整引起的荧光区域在通过分水岭算法分割后只会保留荧光较明显的区域,荧光不明显的区域会被分割到背景区域中;缺陷区域在通过分水岭算法分割后保留下来的区域较大,因此,缺陷区域中灰度值较大的像素点的数量较多,灰度值较大的像素点即为图2中的B区域中每个峰的峰值点,对应的目标区域中的像素点就是对应疑似缺陷区域内与最大峰值点的峰值相近的像素点,对应在轴承表面就是某一块较大的缺陷区域。通过计算目标区域中像素点的平均距离来表示目标区域的荧光磁粉聚集程度,荧光磁粉聚集程度越大,说明目标区域对应的疑似缺陷区域为缺陷区域的可能程度越大。用边缘像素点的梯度变化来对聚类的结果进行修正,密度聚类的结果不仅仅是将与峰值接近的像素点聚为一类,还将聚类像素点对应的区域聚类为一类,缺陷区域的峰比较聚集且灰度值较大,边缘像素点的梯度越大说明在该区域中因为荧光磁粉聚集所产生的边缘特征越明显,则荧光磁粉聚集程度越大。通过聚类后会将不同的峰聚为一个区域即目标区域,因此目标区域的面积越大,也就是目标区域内像素点的数量越多,说明目标区域对应位置的荧光磁粉越聚集,荧光磁粉聚集程度越大,对应疑似缺陷区域为缺陷区域的可能程度越大。It should be noted that the fluorescent area caused by the unevenness of the bearing surface will only retain the area with obvious fluorescence after being segmented by the watershed algorithm, and the area with inconspicuous fluorescence will be segmented into the background area; the defect area will be segmented by the watershed algorithm The retained area is larger, therefore, the number of pixels with larger gray values in the defect area is larger, and the pixels with larger gray values are the peak points of each peak in area B in Figure 2, corresponding to The pixels in the target area correspond to the pixels in the suspected defect area that are close to the peak value of the maximum peak point, and correspond to a larger defect area on the bearing surface. Calculate the average distance of the pixel points in the target area to represent the degree of fluorescent magnetic powder aggregation in the target area. The greater the degree of fluorescent magnetic powder aggregation, the greater the possibility that the suspected defect area corresponding to the target area is a defect area. Use the gradient change of the edge pixels to correct the clustering results. The result of density clustering is not only to cluster the pixels close to the peak, but also to cluster the regions corresponding to the clustered pixels into one category. , the peaks in the defect area are more concentrated and the gray value is larger, and the larger the gradient of the edge pixel point is, the more obvious the edge feature is due to the aggregation of fluorescent magnetic powder in this area, and the greater the degree of fluorescent magnetic powder aggregation. After clustering, different peaks will be clustered into one area, that is, the target area. Therefore, the larger the area of the target area, that is, the larger the number of pixels in the target area, it means that the fluorescent magnetic powder at the corresponding position of the target area is more concentrated, and the fluorescent magnetic powder The greater the aggregation degree, the greater the possibility that the corresponding suspected defect region is a defect region.

通过分水岭算法分割后,每个疑似缺陷区域就相当于是一个孤立的区域,缺陷区域对应的疑似缺陷区域中像素点数量肯定多,因此像素点数量越多的疑似缺陷区域是缺陷区域的可能程度越大,而因不平整分割出来的不存在缺陷的疑似缺陷区域相当于是一些散点,对应的疑似缺陷区域中的像素点数量就少,疑似缺陷区域为缺陷区域的可能程度就越小。因此将疑似缺陷区域中的像素点数量即疑似缺陷区域的面积作为计算荧光磁粉聚集程度的一个分量。After being segmented by the watershed algorithm, each suspected defect area is equivalent to an isolated area. The number of pixels in the suspected defect area corresponding to the defect area must be large, so the suspected defect area with more pixels is more likely to be a defect area. Large, and the suspected defect area without defects segmented due to unevenness is equivalent to some scattered points, the number of pixels in the corresponding suspected defect area is small, and the possibility of the suspected defect area being a defect area is smaller. Therefore, the number of pixels in the suspected defect area, that is, the area of the suspected defect area, is taken as a component for calculating the degree of aggregation of the fluorescent magnetic powder.

作为一个示例,以目标区域j为例,获取目标区域j中最大灰度值对应的像素点的坐标作为第一坐标,若目标区域j中最大灰度值对应的像素点至少有两个,则任意选取一个像素点的坐标作为第一坐标。根据目标区域j中每个像素点的坐标获取目标区域j中每个像素点与第一坐标对应像素点之间的距离。通过算子获取目标区域j中每个像素点的梯度,并获得区域边界处边缘像素点的梯度,其中,算子为公知技术,这里不再进行过多赘述。根据目标区域j中每个像素点与第一坐标对应像素点之间的距离以及每个像素点的梯度,获取目标区域j的荧光磁粉聚集程度,获取目标区域j的荧光磁粉聚集程度的公式为:As an example, taking the target area j as an example, the coordinates of the pixel point corresponding to the maximum gray value in the target area j are obtained as the first coordinates. If there are at least two pixel points corresponding to the maximum gray value in the target area j, then The coordinates of a pixel point are arbitrarily selected as the first coordinates. Obtain the distance between each pixel in the target area j and the pixel corresponding to the first coordinate according to the coordinates of each pixel in the target area j. pass The operator obtains the gradient of each pixel in the target area j, and obtains the gradient of the edge pixels at the boundary of the area, where, The operator is a well-known technology, and details are not repeated here. According to the distance between each pixel point in the target area j and the pixel point corresponding to the first coordinate and the gradient of each pixel point, the degree of fluorescent magnetic powder aggregation in the target area j is obtained, and the degree of fluorescent magnetic powder aggregation in the target area j is obtained. The formula is:

其中,为目标区域j的荧光磁粉聚集程度;为目标区域j中像素点的数量;为目标区域j中最大灰度值对应像素点的坐标即第一坐标;为目标区域j中第个像素点的坐标;为目标区域j中第个边缘像素点的梯度;为目标区域j所在疑似缺陷区域的面积即第一面积;为自然常数。in, is the aggregation degree of fluorescent magnetic particles in the target area j; is the number of pixels in the target area j; is the coordinate of the pixel point corresponding to the maximum gray value in the target area j, that is, the first coordinate; is the target area j in the The coordinates of a pixel point; is the target area j in the The gradient of edge pixels; is the area of the suspected defect area where the target area j is located, i.e. the first area; is a natural constant.

需要说明的是,平均距离越小,说明目标区域j中的像素点的位置分布越聚集,越大;平均梯度越大,说明目标区域j中边缘像素点的灰度变化越大,因此荧光磁粉聚集产生的边缘特征越明显,越大;越大,说明目标区域j所在的疑似缺陷区域的面积越大即像素点数量越多,使得满足聚类条件的像素点越多,使得聚类效果越好,越大;因此,越大,说明目标区域j的荧光磁粉聚集程度越高,目标区域j所在的疑似缺陷区域越可能为缺陷区域。It should be noted that the average distance The smaller the value, the more concentrated the position distribution of the pixels in the target area j is, The larger; the average gradient The larger the value, the greater the grayscale change of the edge pixels in the target area j, so the edge features produced by the aggregation of fluorescent magnetic powder are more obvious. bigger; The larger the value, the larger the area of the suspected defect region where the target region j is located, that is, the larger the number of pixels, so that the more pixels satisfy the clustering conditions, the better the clustering effect. larger; therefore, The larger the , the higher the concentration of fluorescent magnetic powder in the target area j is, and the more likely the suspected defect area where the target area j is located is a defect area.

根据获取目标区域j的荧光磁粉聚集程度的方法,获取每个目标区域的荧光磁粉聚集程度。目标区域的荧光磁粉聚集程度越大,说明目标区域越不平整,越不平整的区域在通过荧光磁粉法进行标记后,标记的效果越明显;目标区域的荧光磁粉聚集程度越小,说明目标区域越是因为轴承表面不平整所保留下来的正常区域。通过像素点的位置来判断目标区域的相关性是不准确的,还需要根据每个峰之间的梯度变化来对聚类的结果进行修正,再根据每个目标区域的荧光磁粉聚集程度来判断对应的疑似缺陷区域能否与背景区域进行合并。According to the method of acquiring the degree of accumulation of fluorescent magnetic powder in the target area j, the degree of accumulation of fluorescent magnetic powder in each target area is acquired. The greater the degree of fluorescent magnetic particle aggregation in the target area, the more uneven the target area is, and the more uneven the area is marked by the fluorescent magnetic particle method, the more obvious the marking effect is; the smaller the degree of fluorescent magnetic particle aggregation in the target area, the more uneven the target area is. The more normal areas are retained due to the unevenness of the bearing surface. It is inaccurate to judge the correlation of the target area by the position of the pixel point. It is also necessary to correct the clustering result according to the gradient change between each peak, and then judge the correspondence according to the degree of fluorescent magnetic particle aggregation in each target area. Whether the suspected defect area can be merged with the background area.

步骤S4:获取所述目标区域与所述灰度图像之间的灰度差异作为目标差异;根据所述荧光磁粉聚集程度与所述目标差异获取所述目标区域与背景区域的相似度。Step S4: Acquiring the grayscale difference between the target area and the grayscale image as the target difference; acquiring the similarity between the target area and the background area according to the aggregation degree of the fluorescent magnetic powder and the target difference.

具体的,为了确定分水岭算法的最佳水淹位置,把不存在缺陷的疑似缺陷区域与背景区域进行合并,进而获取准确的缺陷区域,则根据目标区域的荧光磁粉聚集程度获取目标区域与背景区域的相似度。Specifically, in order to determine the optimal flooding position of the watershed algorithm, the suspected defect area without defects is merged with the background area, and then the accurate defect area is obtained, and the target area and the background area are obtained according to the degree of fluorescent magnetic particle aggregation in the target area similarity.

优选地,获取目标区域与背景区域的相似度的方法为:计算目标区域中的平均灰度值作为第一值;计算灰度图像中的平均灰度值作为第二值;将第一值与第二值的差值作为目标区域与灰度图像之间的目标差异。将荧光磁粉聚集程度与目标差异的乘积进行负相关映射并归一化的结果作为目标区域与背景区域之间的相似度。Preferably, the method for obtaining the similarity between the target area and the background area is: calculating the average gray value in the target area as the first value; calculating the average gray value in the gray image as the second value; combining the first value with The difference of the second value serves as the target difference between the target area and the grayscale image. The product of the degree of fluorescent magnetic particle aggregation and the target difference is negatively correlated and normalized as the similarity between the target area and the background area.

需要说明的是,通过计算疑似缺陷区域与背景区域之间的相似度,将相似度大的疑似缺陷区域与背景区域进行合并,以此排除部分不存在缺陷但又影响对缺陷区域判断的疑似缺陷区域。当通过分水岭算法进行分割时,就不会产生过多的不存在缺陷的疑似缺陷区域的干扰,使得对灰度图像中的缺陷区域分割的更加准确。It should be noted that by calculating the similarity between the suspected defect area and the background area, the suspected defect area with a large similarity is merged with the background area, so as to exclude some suspected defects that do not have defects but affect the judgment of the defect area area. When the segmentation is performed by the watershed algorithm, there will not be too much interference of suspected defect areas without defects, so that the segmentation of the defect areas in the grayscale image is more accurate.

作为一个示例,以步骤S3中的目标区域j为例,根据目标区域j中的每个像素点的灰度值,获取目标区域j的平均灰度值即第一值;根据灰度图像中的每个像素点的灰度值,获取灰度图像的平均灰度值即第二值,因为目标区域j中的像素点都是荧光磁粉标记的像素点,因此灰度值较大即第一值较大,而灰度图像中的像素点也包括背景区域的像素点,因此第二值一定比第一值小,第一值与第二值的差值即目标差异一定是正数。获取目标区域j的目标差异的公式为:As an example, taking the target area j in step S3 as an example, according to the gray value of each pixel in the target area j, the average gray value of the target area j is the first value; For the gray value of each pixel, obtain the average gray value of the gray image, which is the second value, because the pixels in the target area j are all pixels marked with fluorescent magnetic powder, so the gray value is larger, that is, the first value Larger, and the pixels in the grayscale image also include the pixels in the background area, so the second value must be smaller than the first value, and the difference between the first value and the second value, that is, the target difference must be a positive number. Get target difference for target region j The formula is:

其中,为目标区域j与灰度图像的目标差异;为目标区域j的平均灰度值即第一值;为灰度图像中的像素点数量;为灰度图像中第个像素点的灰度值。in, is the target difference between the target area j and the grayscale image; is the average gray value of the target area j, i.e. the first value; is the number of pixels in the grayscale image; for the grayscale image gray value of a pixel.

需要说明的是,越大,说明目标区域j的平均灰度值与灰度图像的平均灰度值之间的差异越大;通过荧光磁粉法进行标记,缺陷区域的灰度值比正常区域的灰度值大,并且灰度值越大,说明缺陷越明显;因此,越大,说明目标区域j与背景区域之间的差异越大。It should be noted, The larger the value, the greater the difference between the average gray value of the target area j and the average gray value of the gray image; the gray value of the defect area is larger than that of the normal area when the fluorescent magnetic particle method is used to mark. And the larger the gray value, the more obvious the defect; therefore, The larger the value, the greater the difference between the target area j and the background area.

根据荧光磁粉聚集程度与目标差异获取目标区域j与背景区域的相似度的公式为:According to the aggregation degree of fluorescent magnetic powder difference from target Get the similarity between the target area j and the background area The formula is:

其中,为目标区域j与背景区域的相似度;为目标区域j的荧光磁粉聚集程度;为目标区域j的目标差异;为自然常数。in, is the similarity between the target area j and the background area; is the aggregation degree of fluorescent magnetic particles in the target area j; is the target difference of the target region j; is a natural constant.

需要说明的是,越大,说明目标区域j所在的疑似缺陷区域越可能为缺陷区域,越小;越大,说明目标区域j中的灰度值与背景区域中的灰度值差异越大,目标区域j与背景区域之间越不相似,目标区域j越可能为缺陷区域,越小;因此,越小,说明目标区域j与背景区域越不相似,目标区域j所在的疑似缺陷区域越可能为缺陷区域。It should be noted, The larger the value, the more likely the suspected defect area where the target area j is located is a defect area, smaller; The larger the value, the greater the difference between the gray value in the target area j and the gray value in the background area, the less similar the target area j is to the background area, and the more likely the target area j is a defect area. smaller; therefore, The smaller the , the less similar the target area j is to the background area, and the suspected defect area where the target area j is located is more likely to be a defect area.

根据获取目标区域j与背景区域的相似度的方法,获取每个目标区域与背景区域的相似度。根据相似度设置分水岭算法中适当的分割阈值,使得最终分割区域为缺陷区域。According to the method of obtaining the similarity between the target area j and the background area, the similarity between each target area and the background area is obtained. Set the appropriate segmentation threshold in the watershed algorithm according to the similarity, so that the final segmented area is the defect area.

步骤S5:根据所述相似度将所述目标区域对应的所述疑似缺陷区域与所述背景区域合并,确定所述灰度图像中的缺陷区域。Step S5: Merge the suspected defective region corresponding to the target region with the background region according to the similarity, and determine the defective region in the grayscale image.

设置相似度阈值,当相似度大于相似度阈值时,对应目标区域所在疑似缺陷区域不存在缺陷,将疑似缺陷区域与背景区域进行合并;未合并的区域即是缺陷区域,对缺陷区域进行核验。Set the similarity threshold. When the similarity is greater than the similarity threshold, there is no defect in the suspected defect area where the target area is located, and the suspected defect area is merged with the background area; the unmerged area is the defect area, and the defect area is verified.

本发明实施例设置相似度阈值为0.32,实施者可根据实际不同的情况自行调整。当相似度大于相似度阈值时,说明目标区域与背景区域的相似度大,目标区域所在的疑似缺陷区域不存在缺陷,则将疑似缺陷区域与背景区域进行合并,通过分水岭算法对灰度图像进行分割时,该疑似缺陷区域不会被分割出来。In the embodiment of the present invention, the similarity threshold is set to 0.32, which can be adjusted by the implementer according to different actual situations. When the similarity is greater than the similarity threshold, it means that the similarity between the target area and the background area is large, and there is no defect in the suspected defect area where the target area is located, then the suspected defect area is merged with the background area, and the grayscale image is processed by the watershed algorithm. During segmentation, the suspected defect area will not be segmented.

对疑似缺陷区域完成合并后,消除了不存在缺陷的疑似缺陷区域,剩下的未合并的疑似缺陷区域就是缺陷区域,对缺陷区域进行标记,便于人工对缺陷区域进行核验,提高了缺陷检测的效率。After merging the suspected defect areas, the suspected defect areas without defects are eliminated, and the remaining unmerged suspected defect areas are defect areas. Marking the defect areas facilitates manual verification of the defect areas and improves the accuracy of defect detection. efficiency.

至此,本发明实施例结束。So far, the embodiment of the present invention ends.

综上所述,本发明实施例获得荧光磁粉喷射后轴承表面的灰度图像;通过分水岭算法获得灰度图像中的疑似缺陷区域;获取每个疑似缺陷区域中的最大灰度值对应的像素点作为目标像素点,对每个疑似缺陷区域中的像素点进行聚类,将目标像素点所在聚类簇的区域作为目标区域;根据目标区域对应的疑似缺陷区域的面积和目标区域中像素点的位置分布与梯度分布获取每个目标区域的荧光磁粉聚集程度;获取目标区域与灰度图像之间的灰度差异作为目标差异;根据荧光磁粉聚集程度与目标差异获取目标区域与背景区域的相似度;根据相似度确定灰度图像中的缺陷区域。提高了检测缺陷区域的效率。In summary, the embodiment of the present invention obtains the grayscale image of the bearing surface after fluorescent magnetic powder spraying; obtains the suspected defect area in the grayscale image through the watershed algorithm; obtains the pixel corresponding to the maximum gray value in each suspected defect area As the target pixel, cluster the pixels in each suspected defect area, and use the area of the cluster where the target pixel is located as the target area; according to the area of the suspected defect area corresponding to the target area and the number of pixels in the target area The position distribution and gradient distribution obtain the degree of fluorescent magnetic particle aggregation of each target area; obtain the gray level difference between the target area and the gray image as the target difference; obtain the similarity between the target area and the background area according to the degree of fluorescent magnetic particle aggregation and the target difference ; Determine the defect area in the grayscale image based on the similarity. Improved efficiency in detecting defective areas.

需要说明的是:上述本发明实施例先后顺序仅仅为了描述,不代表实施例的优劣。在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。It should be noted that: the order 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 figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. Multitasking and parallel processing are also possible or may be advantageous in certain embodiments.

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

Claims (4)

1.一种汽车零件加工信息智能检测方法,其特征在于,该方法包括以下步骤:1. A method for intelligent detection of automobile parts processing information, characterized in that the method comprises the following steps: 获得荧光磁粉喷射后轴承表面的灰度图像;Obtain a grayscale image of the bearing surface after fluorescent magnetic particle spraying; 通过分水岭算法获得所述灰度图像中的疑似缺陷区域;获取每个所述疑似缺陷区域中的最大灰度值对应的像素点作为目标像素点,对每个所述疑似缺陷区域中的像素点进行聚类,将所述目标像素点所在聚类簇的区域作为目标区域;The suspected defect area in the grayscale image is obtained by the watershed algorithm; the pixel point corresponding to the maximum gray value in each of the suspected defect areas is obtained as the target pixel point, and the pixel point in each of the suspected defect area is obtained. Carrying out clustering, using the region of the cluster where the target pixel is located as the target region; 根据所述目标区域对应的所述疑似缺陷区域的面积和所述目标区域中像素点的位置分布与梯度分布获取每个所述目标区域的荧光磁粉聚集程度;Acquiring the degree of fluorescent magnetic powder aggregation of each target area according to the area of the suspected defect area corresponding to the target area and the position distribution and gradient distribution of pixels in the target area; 获取所述目标区域与所述灰度图像之间的灰度差异作为目标差异;根据所述荧光磁粉聚集程度与所述目标差异获取所述目标区域与背景区域的相似度;Obtaining the grayscale difference between the target area and the grayscale image as the target difference; acquiring the similarity between the target area and the background area according to the aggregation degree of the fluorescent magnetic powder and the target difference; 根据所述相似度将所述目标区域对应的所述疑似缺陷区域与所述背景区域合并,确定所述灰度图像中的缺陷区域;merging the suspected defect region corresponding to the target region with the background region according to the similarity, and determining the defect region in the grayscale image; 所述荧光磁粉聚集程度的获取方法,包括:The method for obtaining the aggregation degree of the fluorescent magnetic powder includes: 获取所述目标区域中的最大灰度值对应的像素点的坐标作为第一坐标,计算所述目标区域中的每个像素点对应的坐标与第一坐标之间的距离,获取所述目标区域中的像素点之间的平均距离;将平均距离进行负相关映射并归一化,所得结果作为第一结果;Acquire the coordinates of the pixel corresponding to the maximum gray value in the target area as the first coordinate, calculate the distance between the coordinate corresponding to each pixel in the target area and the first coordinate, and obtain the target area The average distance between the pixels in ; the average distance is negatively correlated and normalized, and the result is taken as the first result; 获取所述目标区域中的边缘像素点的梯度均值作为平均梯度;Obtaining the gradient mean value of the edge pixels in the target area as the average gradient; 获取所述目标区域对应的疑似缺陷区域中的像素点的数量即疑似缺陷区域的面积作为第一面积;Obtaining the number of pixels in the suspected defective region corresponding to the target region, that is, the area of the suspected defective region, as the first area; 计算第一结果、平均梯度与第一面积之间的乘积作为所述目标区域的荧光磁粉聚集程度;calculating the product of the first result, the average gradient and the first area as the aggregation degree of fluorescent magnetic particles in the target area; 所述目标差异的获取方法,包括:The method for obtaining the target difference includes: 计算所述目标区域中的平均灰度值作为第一值;calculating the average gray value in the target area as the first value; 计算所述灰度图像中的平均灰度值作为第二值;calculating the average gray value in the gray image as a second value; 将第一值与第二值的差值作为所述目标区域与所述灰度图像之间的目标差异。The difference between the first value and the second value is used as the target difference between the target area and the grayscale image. 2.如权利要求1所述的一种汽车零件加工信息智能检测方法,其特征在于,所述相似度的获取方法,包括:2. A kind of automobile parts processing information intelligent detection method as claimed in claim 1, is characterized in that, the acquisition method of described similarity comprises: 将荧光磁粉聚集程度与目标差异的乘积进行负相关映射并归一化的结果作为目标区域与背景区域之间的相似度。The product of the degree of fluorescent magnetic particle aggregation and the target difference is negatively correlated and normalized as the similarity between the target area and the background area. 3.如权利要求1所述的一种汽车零件加工信息智能检测方法,其特征在于,所述根据所述相似度确定所述灰度图像中的缺陷区域的方法,包括:3. A kind of automobile parts processing information intelligent detection method as claimed in claim 1, is characterized in that, the method for determining the defect area in the grayscale image according to the similarity includes: 设置相似度阈值,当相似度大于相似度阈值时,对应目标区域所在疑似缺陷区域不存在缺陷,将疑似缺陷区域与背景区域进行合并;未合并的区域即是缺陷区域,对缺陷区域进行核验。Set the similarity threshold. When the similarity is greater than the similarity threshold, there is no defect in the suspected defect area where the target area is located, and the suspected defect area is merged with the background area; the unmerged area is the defect area, and the defect area is verified. 4.如权利要求1所述的一种汽车零件加工信息智能检测方法,其特征在于,所述对每个所述疑似缺陷区域中的像素点进行聚类的方法,包括:4. A kind of automobile parts processing information intelligent detection method as claimed in claim 1, is characterized in that, the method for clustering the pixels in each of the suspected defect regions comprises: 使用DBSCAN密度聚类算法根据像素点的位置与灰度值对疑似缺陷区域中的像素点进行聚类。Use the DBSCAN density clustering algorithm to cluster the pixels in the suspected defect area according to the position and gray value of the pixels.
CN202310171997.6A 2023-02-28 2023-02-28 Intelligent detection method for automobile part machining information Active CN115861320B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310171997.6A CN115861320B (en) 2023-02-28 2023-02-28 Intelligent detection method for automobile part machining information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310171997.6A CN115861320B (en) 2023-02-28 2023-02-28 Intelligent detection method for automobile part machining information

Publications (2)

Publication Number Publication Date
CN115861320A CN115861320A (en) 2023-03-28
CN115861320B true CN115861320B (en) 2023-05-12

Family

ID=85659149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310171997.6A Active CN115861320B (en) 2023-02-28 2023-02-28 Intelligent detection method for automobile part machining information

Country Status (1)

Country Link
CN (1) CN115861320B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116091499B (en) * 2023-04-07 2023-06-20 山东中胜涂料有限公司 Abnormal paint production identification system
CN116630815B (en) * 2023-07-25 2023-09-22 济南玖通志恒信息技术有限公司 Intelligent agricultural pest detection method
CN116990993B (en) * 2023-09-26 2023-12-22 深圳市柯达科电子科技有限公司 LCD display panel quality detection method
CN117291937B (en) * 2023-11-27 2024-03-05 山东嘉达装配式建筑科技有限责任公司 Automatic plastering effect visual detection system based on image feature analysis
CN118115499B (en) * 2024-04-29 2024-07-12 深圳市金利源绝缘材料有限公司 Visual detection method for production quality of electric power copper bar
CN118505686B (en) * 2024-07-17 2024-09-10 陕西海鹰汽车部件有限公司 A punching defect detection method for automobile punching tubes
CN119006467B (en) * 2024-10-24 2025-02-11 浙江易阳能源管理有限公司 A photovoltaic panel flatness detection method and system in photovoltaic construction

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101168474A (en) * 2006-10-27 2008-04-30 群康科技(深圳)有限公司 Method for manufacturing polycrystalline silicon thin film at low temperature
CN103955913A (en) * 2014-02-18 2014-07-30 西安电子科技大学 SAR image segmentation method based on line segment co-occurrence matrix characteristics and regional maps
CN107145896A (en) * 2017-03-14 2017-09-08 西南科技大学 Intelligent defect recognition system based on fluorescent magnetic powder
CN107292882A (en) * 2017-08-02 2017-10-24 国网电力科学研究院武汉南瑞有限责任公司 One kind is based on the adaptive electrical equipment malfunction detection methods of Meanshift

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190369631A1 (en) * 2017-01-22 2019-12-05 Sichuan Golden Ridge Intellgence Science & Technology Co., Ltd. Intelligent wheelchair system based on big data and artificial intelligence
CN108595596A (en) * 2018-04-19 2018-09-28 厦门启尚科技有限公司 A kind of image similarity search method
CN108629783B (en) * 2018-05-02 2021-05-04 山东师范大学 Image segmentation method, system and medium based on image feature density peak search
CN109215020B (en) * 2018-08-30 2022-06-14 国网黑龙江省电力有限公司佳木斯供电公司 Fault identification method of high voltage transmission line based on computer vision
CN110706236B (en) * 2019-09-03 2023-01-13 西人马大周(深圳)医疗科技有限公司 Three-dimensional reconstruction method and device of blood vessel image
CN112131924A (en) * 2020-07-10 2020-12-25 国网河北省电力有限公司雄安新区供电公司 A method for image recognition of substation equipment based on density clustering analysis
CN112906550B (en) * 2021-02-09 2022-07-19 哈尔滨理工大学 A Static Gesture Recognition Method Based on Watershed Transform
CN113642631B (en) * 2021-08-10 2022-07-12 沭阳协润电子有限公司 Dangerous area electronic fence generation method and system based on artificial intelligence
CN114581692B (en) * 2022-03-06 2022-12-02 扬州孚泰电气有限公司 Vibration damper fault detection method and system based on intelligent pattern recognition
CN115100212B (en) * 2022-08-29 2022-11-18 卡松科技股份有限公司 Method for detecting pollution degree of lubricating oil
CN115351598B (en) * 2022-10-17 2024-01-09 安徽金锘轴承制造有限公司 Method for detecting bearing of numerical control machine tool

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101168474A (en) * 2006-10-27 2008-04-30 群康科技(深圳)有限公司 Method for manufacturing polycrystalline silicon thin film at low temperature
CN103955913A (en) * 2014-02-18 2014-07-30 西安电子科技大学 SAR image segmentation method based on line segment co-occurrence matrix characteristics and regional maps
CN107145896A (en) * 2017-03-14 2017-09-08 西南科技大学 Intelligent defect recognition system based on fluorescent magnetic powder
CN107292882A (en) * 2017-08-02 2017-10-24 国网电力科学研究院武汉南瑞有限责任公司 One kind is based on the adaptive electrical equipment malfunction detection methods of Meanshift

Also Published As

Publication number Publication date
CN115861320A (en) 2023-03-28

Similar Documents

Publication Publication Date Title
CN115861320B (en) Intelligent detection method for automobile part machining information
CN109682839B (en) Online detection method for surface defects of metal arc-shaped workpiece
CN107369136B (en) Visual detection method for surface cracks of polycrystalline diamond compact
CN109872300B (en) Visual saliency detection method for appearance defects of friction plate
Aminzadeh et al. Automatic thresholding for defect detection by background histogram mode extents
CN109685760B (en) MATLAB-based SLM powder bed powder laying image convex hull depression defect detection method
CN116152242B (en) Visual detection system of natural leather defect for basketball
CN117788467B (en) Defect image classification method for titanium metal plate
CN118014989B (en) Intelligent detection method for surface defects of power adapter
CN113177924A (en) Industrial production line product flaw detection method
CN112419237B (en) A method for surface defect detection of automobile clutch master cylinder groove based on deep learning
CN110648330B (en) Defect detection method for camera glass
CN115272321A (en) Textile defect detection method based on machine vision
CN115100191A (en) Metal casting defect identification method based on industrial detection
CN116309416A (en) Visual inspection method for surface of part
CN110060239B (en) A kind of defect detection method for bottle mouth
CN101995412A (en) Robust glass scratch defect detection method and device thereof
CN116012292A (en) Wafer appearance defect detection method based on machine vision
CN117036259A (en) Metal plate surface defect detection method based on deep learning
Tang et al. Surface inspection system of steel strip based on machine vision
CN109584212B (en) MATLAB-based SLM powder bed powder laying image scratch defect identification method
CN117830312B (en) Alloy crack nondestructive testing method based on machine vision
CN113436102A (en) Method for detecting surface defects of machined part
CN114354631A (en) Valve blank surface defect detection method based on vision
Palianytsia et al. Development of an algorithm for identification of damage types on the surface of sheet metal

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