[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN111815575A - A detection method of bearing steel ball parts based on machine vision - Google Patents

A detection method of bearing steel ball parts based on machine vision Download PDF

Info

Publication number
CN111815575A
CN111815575A CN202010564947.0A CN202010564947A CN111815575A CN 111815575 A CN111815575 A CN 111815575A CN 202010564947 A CN202010564947 A CN 202010564947A CN 111815575 A CN111815575 A CN 111815575A
Authority
CN
China
Prior art keywords
image
edge
detection
steel ball
machine vision
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
CN202010564947.0A
Other languages
Chinese (zh)
Other versions
CN111815575B (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.)
Zhejiang University of Technology ZJUT
Original Assignee
Zhejiang University of Technology ZJUT
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 Zhejiang University of Technology ZJUT filed Critical Zhejiang University of Technology ZJUT
Priority to CN202010564947.0A priority Critical patent/CN111815575B/en
Publication of CN111815575A publication Critical patent/CN111815575A/en
Application granted granted Critical
Publication of CN111815575B publication Critical patent/CN111815575B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • 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
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • 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
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • 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

Landscapes

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

Abstract

A bearing steel ball part detection method based on machine vision comprises steel ball circularity detection and part scratch detection and comprises the following steps: the method comprises the following steps of firstly, detecting the circularity of a steel ball, and the process is as follows: 1.1) preprocessing an input image; 1.2) acquiring the outline of the steel ball; 1.3) screening the obtained edges, and outputting the outline and circle center radius of the steel ball qualified by detection; step two, detecting scratches of the parts: 2.1) detecting the edge of the front surface of the part; 2.2) detecting the side edge of the part. The invention provides a bearing steel ball part detection method based on machine vision, which can overcome various interference factors and establish a high-efficiency and stable detection system.

Description

一种基于机器视觉的轴承钢珠零件检测方法A detection method of bearing steel ball parts based on machine vision

技术领域technical field

本发明涉及零件检测领域,具体地涉及一种基于机器视觉的轴承钢珠零件检测方法。The invention relates to the field of parts detection, in particular to a method for detecting bearing steel ball parts based on machine vision.

背景技术Background technique

人类在推动社会进步的同时,将许多复杂的、带有大量重复性的工作交给机器来完成,机器视觉系统正属于这个范畴。一般来说,机器视觉系统就是工业测试监控系统。在一些具有危险性的工作场合或者人眼难以识别的情况下,往往会使用机器视觉系统来提高生产线的品质或自动化程度。机器视觉技术是检测领域的一个方向,其目的在于用机器代替人类的眼睛去完成检测、识别、分类等任务。完整的机器视觉技术包括光源照明、光学成像、数字图像处理、机器分类、工业控制等技术,具有很高的稳定性和准确性。在国外,机器视觉主要被应用于半导体、电子及机械等行业,例如集成电路制造、电子模具、丝网印刷、元器件成型等。此外,机器视觉还广泛用于产品质量检测系统,在工业生产中举足轻重。While promoting social progress, human beings hand over many complex and repetitive tasks to machines, and machine vision systems fall into this category. Generally speaking, a machine vision system is an industrial test monitoring system. Machine vision systems are often used to improve the quality or automation of production lines in dangerous workplaces or situations that are difficult to recognize by the human eye. Machine vision technology is a direction in the field of detection. Its purpose is to replace human eyes with machines to complete tasks such as detection, recognition, and classification. Complete machine vision technology includes light source lighting, optical imaging, digital image processing, machine classification, industrial control and other technologies, with high stability and accuracy. In foreign countries, machine vision is mainly used in semiconductor, electronics and machinery industries, such as integrated circuit manufacturing, electronic molds, screen printing, component molding, etc. In addition, machine vision is also widely used in product quality inspection systems and plays an important role in industrial production.

现有的零件检测方法一般都是基于机器视觉技术。研究人员基于机器视觉技术开发了一套圆形零件检测框架,通过简单的摄像机标定和亚像素实现了圆形零件的精密测量,其算法模型主要包括系统矫正、预处理、图像二值化和圆形检测四个部分。还有人对非球面曲面光学零件精密加工技术进行了分析和研究,研制出了一套超精密空气压缩主轴系统,将检测精度提高到国际水准。通过线阵工业相机来扫描待检测的计算机硬盘薄片零件图像,根据图像扫描的特性提出一种新的标定算法和轮廓矢量化算法,将标定、二值化、边缘检测以及轮廓矢量化等结合从而得到待检测零件的尺寸参数。一些研究学者针对零件表面的缺陷进行检测,通过两次进行动态提取算法准确提取了目标零件检测区域,然后基于统计图分类算法和零件的宽度、厚度、分散度、偏转程度等边缘信息生成检测参数。在现代的自动化流水线上,检测系统能够随时随地的确认零件的尺寸大小、数量、有无缺陷等,大幅提高了工业生产效率。但是当前机器视觉的问题也很明显,系统时滞、精度不高、稳定性差等问题都亟需解决。Existing parts inspection methods are generally based on machine vision technology. The researchers developed a set of circular parts detection framework based on machine vision technology, and realized the precise measurement of circular parts through simple camera calibration and sub-pixels. The algorithm model mainly includes system correction, preprocessing, image binarization and circular Shape detection in four parts. Others have analyzed and studied the precision machining technology of aspherical curved optical parts, and developed a set of ultra-precision air compression spindle system, which improves the detection accuracy to the international level. A line scan industrial camera is used to scan the image of the computer hard disk thin part to be detected, and a new calibration algorithm and contour vectorization algorithm are proposed according to the characteristics of image scanning. Get the size parameters of the parts to be inspected. Some researchers detect the defects on the surface of the part, and accurately extract the detection area of the target part through two dynamic extraction algorithms, and then generate detection parameters based on the statistical map classification algorithm and the edge information such as the width, thickness, dispersion, and deflection of the part. . In modern automated assembly lines, the inspection system can confirm the size, quantity, and presence of defects of parts anytime and anywhere, which greatly improves industrial production efficiency. However, the problems of current machine vision are also obvious, and problems such as system time delay, low precision, and poor stability need to be solved urgently.

发明内容SUMMARY OF THE INVENTION

为了克服现有技术中无法快速准确的对零件进行检测,为了解决上述的技术问题,本发明提供一种基于机器视觉的轴承钢珠零件检测方法,能够克服多种干扰因素,建立高效稳定的检测系统。In order to overcome the inability to detect parts quickly and accurately in the prior art, and to solve the above technical problems, the present invention provides a method for detecting bearing steel ball parts based on machine vision, which can overcome various interference factors and establish an efficient and stable detection system .

本发明解决其技术问题所采用的技术方案是:The technical scheme adopted by the present invention to solve its technical problems is:

一种基于机器视觉的轴承钢珠零件检测方法,其特征在于,所述检测方法包括以下步骤:A machine vision-based detection method for bearing steel ball parts, characterized in that the detection method comprises the following steps:

第一步、钢珠圆形度检测,过程如下:The first step is to test the roundness of the steel ball. The process is as follows:

1.1)图像预处理:使用高斯滤波对输入图像进行预处理,去除图像中的高频信号;1.1) Image preprocessing: use Gaussian filtering to preprocess the input image to remove high-frequency signals in the image;

1.2)提取肠系膜上动脉口:通过灰度转换、阈值分割等方法将图像进行转化,使得后续算法更容易辨别图像信息;经过这一步,系统会得到若干闭合的边缘轮廓;1.2) Extracting the ostium of the superior mesenteric artery: The image is transformed by grayscale conversion, threshold segmentation and other methods to make it easier for subsequent algorithms to identify image information; after this step, the system will obtain several closed edge contours;

1.3)筛选边缘轮廓:为了能得到较好的检测边缘,采用了三个筛选条件:轮廓像素域检测、椭圆拟合检测和圆形度检测,轮廓像素域检测是统计每个轮廓的像素面积;由于钢珠的圆形轮廓会在成像后会形成近似于圆形的椭圆,所以进行椭圆拟合,可以有效的排除噪声干扰;最后在得到钢珠的边缘轮廓信息后,对椭圆进行圆形度检测,这一步的目的是为了检测钢珠的外形是否符合生产规范;1.3) Screening edge contours: In order to obtain better detection edges, three screening conditions are adopted: contour pixel domain detection, ellipse fitting detection and circularity detection. Contour pixel domain detection is to count the pixel area of each contour; Since the circular contour of the steel ball will form an ellipse similar to a circle after imaging, the ellipse fitting can effectively eliminate noise interference; finally, after obtaining the edge contour information of the steel ball, the circularity of the ellipse is detected. The purpose of this step is to detect whether the shape of the steel ball conforms to the production specification;

第二步、零件划痕检测,过程如下:The second step, parts scratch detection, the process is as follows:

2.1)零件侧面划痕检测:使用边缘检测方法对零件侧面划痕进行检测,首先确定图像中的边缘像素,然后把这些像素连接在一起,从而构成所需的区域边界;2.1) Scratch detection on the side of the part: use the edge detection method to detect the scratch on the side of the part, first determine the edge pixels in the image, and then connect these pixels together to form the required area boundary;

2.2)零件正面划痕检测:由于正面的边缘信息太多,会对分类结结果造成严重的影响,采用剔除冗余边缘信息方法,去除图像中的高频信号。2.2) Scratch detection on the front of the part: Because there is too much edge information on the front, it will have a serious impact on the classification results. The method of eliminating redundant edge information is used to remove high-frequency signals in the image.

进一步,2.1)中,图像边缘是表示图像中一个区域和另一个区域的开始,图像中相邻之间的像素的集合就构成了图像的边缘,所以,图像的边缘可以理解成图像的灰度发生空间突变的像素的集合,图像边缘有两个重要的概念:方向和梯度,沿着边缘方向的像素变化比较平顺,而垂直于边缘方向的像素变化比较剧烈,因此根据这个特点,通常会用一阶和二阶导数来进行边缘检测,所以,一幅图像中的边缘检测是可以通过对灰度值求导来进行确定的,而导数的运算可以通过微分算子进行。Further, in 2.1), the edge of the image represents the beginning of one area and another area in the image, and the set of adjacent pixels in the image constitutes the edge of the image, so the edge of the image can be understood as the grayscale of the image The collection of pixels with spatial mutation, the image edge has two important concepts: direction and gradient. The pixels along the edge direction change smoothly, while the pixels perpendicular to the edge direction change more violently. Therefore, according to this feature, it is usually used. The first-order and second-order derivatives are used for edge detection. Therefore, the edge detection in an image can be determined by derivation of the gray value, and the operation of the derivative can be performed by a differential operator.

进一步,所述2.2)的步骤如下:Further, the steps of described 2.2) are as follows:

2.2.1)用平滑滤波对图像进行预处理,去除图像中的高频信号;2.2.1) Preprocess the image with smooth filtering to remove high-frequency signals in the image;

2.2.2)采用边缘检测的方法检测图像边缘信息并提取图像的闭合轮廓;2.2.2) Use edge detection method to detect image edge information and extract the closed contour of the image;

2.2.3)使用椭圆拟合方法对轮廓进行椭圆拟合,之所以要进行椭圆拟合是因为本发明所要提取的目标区域是一个圆环;2.2.3) use ellipse fitting method to carry out ellipse fitting to outline, and the reason why ellipse fitting is to be carried out is because the target area to be extracted by the present invention is a ring;

2.2.4)根据图像的固定信息,选取合适的阈值,对得到的椭圆轮廓进行筛选,得到圆环的区域的内圆和外圆轮廓,最后采用图像相减的方法,得到所要提取的目标区域。2.2.4) According to the fixed information of the image, select an appropriate threshold value, screen the obtained elliptical outline, and obtain the inner circle and outer circle outline of the ring area, and finally use the method of image subtraction to obtain the target area to be extracted. .

本发明的有益效果主要表现在:基于机器视觉,解决了工业生产过程中人工不易辨别残次品的问题。并且该方法具有很高的稳定性和移植性,具有广泛的应用前景。The beneficial effects of the invention are mainly manifested in: based on machine vision, the problem that it is difficult to manually identify defective products in the industrial production process is solved. And the method has high stability and transplantability, and has broad application prospects.

附图说明Description of drawings

图1是本发明的机器视觉检测系统;Fig. 1 is the machine vision detection system of the present invention;

图2是本发明的圆形度检测示意图;Fig. 2 is the circularity detection schematic diagram of the present invention;

图3是本发明的零件正面检测流程。FIG. 3 is the flow of the detection of the front side of the part of the present invention.

具体实施方式Detailed ways

下面结合附图对本发明作进一步描述。The present invention will be further described below in conjunction with the accompanying drawings.

参照图1~图3,一种基于机器视觉的轴承钢珠零件检测方法,主要解决钢珠圆形度检测和零件划痕检测,包括以下步骤:Referring to Figures 1 to 3, a method for detecting bearing steel ball parts based on machine vision mainly solves the detection of the roundness of steel balls and the detection of parts scratches, including the following steps:

第一步、钢珠圆形度检测,检测方法的流程如图2所示,过程如下:The first step is to detect the circularity of steel balls. The process of the detection method is shown in Figure 2. The process is as follows:

1.1)对输入图像进行预处理,具体步骤如下:1.1) Preprocess the input image, the specific steps are as follows:

本发明首先使用高斯滤波对输入图像进行预处理,去除图像中的高频信号;The present invention first uses Gaussian filtering to preprocess the input image to remove high-frequency signals in the image;

1.2)获取钢珠轮廓,具体步骤如下:1.2) To obtain the steel ball profile, the specific steps are as follows:

在得到预处理的信息后,本发明通过灰度转换、阈值分割等方法将图像进行转化,使得后续算法更容易辨别图像信息。经过这一步,系统会得到若干闭合的边缘轮廓,其中只有一个是钢珠的边缘轮廓,其他轮廓是因为光照产生的噪声干扰;After obtaining the pre-processed information, the present invention transforms the image through grayscale conversion, threshold segmentation and other methods, so that the subsequent algorithm can more easily identify the image information. After this step, the system will obtain several closed edge contours, only one of which is the edge contour of the steel ball, and the other contours are due to noise interference generated by lighting;

1.3)对得到的边缘轮廓进行筛选,对检测合格的钢珠输出轮廓和圆心半径,步骤如下:1.3) Screen the obtained edge contour, and output the contour and center radius of the steel ball that has passed the inspection. The steps are as follows:

为了能得到较好的检测边缘,本发明采用了三个筛选条件:轮廓像素域检测、椭圆拟合检测和圆形度检测。轮廓像素域检测是统计每个轮廓的像素面积。由于钢珠的圆形轮廓会在成像后会形成近似于圆形的椭圆,所以进行椭圆拟合,可以有效的排除噪声干扰。最后在得到钢珠的边缘轮廓信息后,对椭圆进行圆形度检测,这一步的目的是为了检测钢珠的外形是否符合生产规范,在系统成像后轮廓的圆形度应该是在一定误差范围内变化,超出这个范围的钢珠很可能就是存在缺陷、需要剔除的零件。本文中的像素阈值为:1600、2000,圆形度的阈值为0.980;In order to obtain a better detection edge, the present invention adopts three screening conditions: contour pixel domain detection, ellipse fitting detection and circularity detection. Contour pixel domain detection is to count the pixel area of each contour. Since the circular outline of the steel ball will form an ellipse similar to a circle after imaging, ellipse fitting can effectively eliminate noise interference. Finally, after the edge contour information of the steel ball is obtained, the circularity of the ellipse is detected. The purpose of this step is to detect whether the shape of the steel ball conforms to the production specification. After the system imaging, the circularity of the contour should be within a certain error range. , steel balls beyond this range are likely to be defective parts that need to be removed. The pixel thresholds in this article are: 1600, 2000, and the circularity threshold is 0.980;

圆形度是用来刻画图像目标边界的复杂程度,其数值在目标是正圆形状时最小。最常用的圆形度是圆周长平方与面积的比值,形状越复杂该比值越大,圆形度指标在正圆时取得最小值4π。取C为圆形度指标,P为周长,A为面积其计算公式如下:Circularity is used to describe the complexity of the image target boundary, and its value is the smallest when the target is a perfect circle shape. The most commonly used circularity is the ratio of the square of the circumference of the circumference to the area. The more complex the shape, the greater the ratio. The circularity index achieves a minimum value of 4π when it is a perfect circle. Take C as the circularity index, P as the perimeter, and A as the area. The calculation formula is as follows:

Figure BDA0002547495200000051
Figure BDA0002547495200000051

以上计算方法较为粗略,本发明采用用边界能量来进行衡量。取p为边界上任一点到某起始点的距离。在任一点上,该边界都有一个瞬时曲率半径r(p),由几何关系可以得知该瞬时曲率半径是该点与边界相切圆的半径。在p点的曲率函数如下:The above calculation method is relatively rough, and the present invention uses boundary energy to measure. Take p as the distance from any point on the boundary to a starting point. At any point, the boundary has an instantaneous radius of curvature r(p), which can be known from the geometric relationship as the radius of the circle tangent to the point and the boundary. The curvature function at point p is as follows:

Figure BDA0002547495200000052
Figure BDA0002547495200000052

函数K(p)是周期为p的周期函数。单位边界长度的平均能量计算公式如下:The function K(p) is a periodic function with period p. The formula for calculating the average energy per unit boundary length is as follows:

Figure BDA0002547495200000061
Figure BDA0002547495200000061

取圆的半径为R。曲率可以由链码计算得出,因此边界能量也能够轻易获得。对于面积固定的边界而言,一个圆的最小边界能量E0为:Take the radius of the circle as R. The curvature can be calculated from the chain code, so the boundary energy can also be easily obtained. For a boundary with a fixed area, the minimum boundary energy E 0 of a circle is:

Figure BDA0002547495200000062
Figure BDA0002547495200000062

其中p为边界上任一点到某起始点的距离,R为圆的半径;where p is the distance from any point on the boundary to a starting point, and R is the radius of the circle;

第二步、零件划痕检测,过程如下:The second step, parts scratch detection, the process is as follows:

2.1)零件侧面划痕检测,基本步骤如下:2.1) Scratch detection on the side of the part, the basic steps are as follows:

本发明使用边缘检测方法对零件侧面划痕进行检测,首先确定图像中的边缘像素,然后把这些像素连接在一起,从而构成所需的区域边界。图像边缘,是表示图像中一个区域和另一个区域的开始,图像中相邻之间的像素的集合就构成了图像的边缘。所以,图像的边缘可以理解成图像的灰度发生空间突变的像素的集合。图像边缘有两个重要的概念:方向和梯度。沿着边缘方向的像素变化比较平顺,而垂直于边缘方向的像素变化比较剧烈。因此根据这个特点,通常会用一阶和二阶导数来进行边缘检测。所以,一幅图像中的边缘检测是可以通过对灰度值求导来进行确定的,而导数的运算可以通过微分算子进行;The invention uses the edge detection method to detect the scratches on the side of the part, firstly determines the edge pixels in the image, and then connects these pixels together to form the required area boundary. The edge of an image represents the beginning of one area and another area in the image, and the collection of adjacent pixels in the image constitutes the edge of the image. Therefore, the edge of an image can be understood as a collection of pixels where the grayscale of the image undergoes spatial abrupt changes. Image edges have two important concepts: direction and gradient. The pixel changes along the edge direction are relatively smooth, while the pixel changes perpendicular to the edge direction are more severe. Therefore, according to this feature, the first and second derivatives are usually used for edge detection. Therefore, the edge detection in an image can be determined by derivation of the gray value, and the operation of the derivative can be performed by the differential operator;

Sobel算子是一种一阶微分算子,其通过像素临近区域的梯度值计算每个像素的梯度,最后根据固定的阈值进行取舍。其计算公式如下:The Sobel operator is a first-order differential operator, which calculates the gradient of each pixel through the gradient value of the adjacent area of the pixel, and finally makes a choice according to a fixed threshold. Its calculation formula is as follows:

Figure BDA0002547495200000063
Figure BDA0002547495200000063

Sobel算子是一种三层算子模板,通过dx和dy两个卷积核形成Sobel算子。其中一个卷积核进行垂直边缘的计算,一个卷积核进行水平卷积核的计算,两个卷积核的最大值作为计算的最终输出结果。The Sobel operator is a three-layer operator template. The Sobel operator is formed by two convolution kernels of dx and dy. One of the convolution kernels performs the calculation of the vertical edge, one of the convolution kernels performs the calculation of the horizontal convolution kernel, and the maximum value of the two convolution kernels is used as the final output result of the calculation.

除了Sobel算子之外,本文还采用了Canny算子进行边缘检测。文中使用Canny算子来计算图像梯度的局部极大值,通过两个阈值来寻找目标的强边缘和弱边缘。该方法实质上是通过准高斯函数进行平滑处理,然后再通过一阶微分算子定位导数的最大值。在二阶正方形内可以计算有限差分的均值,从而在图像中的一点上求取偏导数梯度。方向角和幅值可以通过直角坐标系到极坐标系的坐标转化公式进行计算:In addition to the Sobel operator, this paper also uses the Canny operator for edge detection. In this paper, the Canny operator is used to calculate the local maximum value of the image gradient, and two thresholds are used to find the strong and weak edges of the target. The method is essentially smoothing through a quasi-Gaussian function, and then locating the maximum value of the derivative through a first-order differential operator. Within the second-order square, the mean of the finite differences can be computed to find the gradient of the partial derivative at a point in the image. The direction angle and magnitude can be calculated by the coordinate conversion formula from the rectangular coordinate system to the polar coordinate system:

Figure BDA0002547495200000071
Figure BDA0002547495200000071

Figure BDA0002547495200000072
Figure BDA0002547495200000072

其中M[i,j]反映了图像的边缘强度,θ[i,j]反映了图像的边缘方向。当M[i,j]取得局部极大值的时候,θ[i,j]即为此时的边缘方向。对于梯度幅值,采用非极大值抑制方法,提取出各个梯度方向上梯度值最大的像素;where M[i,j] reflects the edge strength of the image, and θ[i,j] reflects the edge direction of the image. When M[i,j] obtains a local maximum value, θ[i,j] is the edge direction at this time. For the gradient amplitude, the non-maximum suppression method is used to extract the pixel with the largest gradient value in each gradient direction;

2.2)零件正面边缘检测,检测流程如图3所示,由于正面的边缘信息太多,会对分类结结果造成严重的影响,所以本发明提出一种剔除冗余边缘信息的方法,去除图像中的高频信号,步骤如下:2.2) The front edge detection of parts, the detection process is shown in Figure 3, because too much front edge information will have a serious impact on the classification results, so the present invention proposes a method for eliminating redundant edge information. , the steps are as follows:

2.2.1)用平滑滤波对图像进行预处理,去除图像中的高频信号;2.2.1) Preprocess the image with smooth filtering to remove high-frequency signals in the image;

2.2.2)采用边缘检测的方法检测图像边缘信息并提取图像的闭合轮廓;2.2.2) Use edge detection method to detect image edge information and extract the closed contour of the image;

2.2.3)使用椭圆拟合方法对轮廓进行椭圆拟合,之所以要进行椭圆拟合是因为本发明所要提取的目标区域是一个圆环;2.2.3) use ellipse fitting method to carry out ellipse fitting to outline, and the reason why ellipse fitting is to be carried out is because the target area to be extracted by the present invention is a ring;

2.2.4)根据图像的固定信息,选取合适的阈值,对得到的椭圆轮廓进行筛选,得到圆环的区域的内圆和外圆轮廓,最后采用图像相减的方法,得到所要提取的目标区域。2.2.4) According to the fixed information of the image, select an appropriate threshold value, screen the obtained elliptical outline, and obtain the inner circle and outer circle outline of the ring area, and finally use the method of image subtraction to obtain the target area to be extracted. .

以上所述仅为本发明的实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所做的的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above descriptions are only the embodiments of the present invention, and are not intended to limit the scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the description and drawings of the present invention, or directly or indirectly applied to other related The technical field of the present invention is similarly included in the scope of patent protection of the present invention.

Claims (3)

1.一种基于机器视觉的轴承钢珠零件检测方法,其特征在于,所述检测方法包括以下步骤:1. a bearing steel ball parts detection method based on machine vision, is characterized in that, described detection method comprises the following steps: 第一步、钢珠圆形度检测,过程如下:The first step is to test the roundness of the steel ball. The process is as follows: 1.1)图像预处理:使用高斯滤波对输入图像进行预处理,去除图像中的高频信号;1.1) Image preprocessing: use Gaussian filtering to preprocess the input image to remove high-frequency signals in the image; 1.2)获取钢珠轮廓:通过灰度转换、阈值分割等方法将图像进行转化,使得后续算法更容易辨别图像信息;经过这一步,系统会得到若干闭合的边缘轮廓;1.2) Obtain the outline of the steel ball: transform the image through grayscale conversion, threshold segmentation and other methods, so that the subsequent algorithm can more easily identify the image information; after this step, the system will obtain several closed edge contours; 1.3)筛选边缘轮廓:为了能得到较好的检测边缘,采用了三个筛选条件:轮廓像素域检测、椭圆拟合检测和圆形度检测,轮廓像素域检测是统计每个轮廓的像素面积;由于钢珠的圆形轮廓会在成像后会形成近似于圆形的椭圆,所以进行椭圆拟合,可以有效的排除噪声干扰;最后在得到钢珠的边缘轮廓信息后,对椭圆进行圆形度检测,这一步的目的是为了检测钢珠的外形是否符合生产规范;1.3) Screening edge contours: In order to obtain better detection edges, three screening conditions are adopted: contour pixel domain detection, ellipse fitting detection and circularity detection. Contour pixel domain detection is to count the pixel area of each contour; Since the circular contour of the steel ball will form an ellipse similar to a circle after imaging, the ellipse fitting can effectively eliminate noise interference; finally, after obtaining the edge contour information of the steel ball, the circularity of the ellipse is detected. The purpose of this step is to detect whether the shape of the steel ball conforms to the production specification; 第二步、零件划痕检测,过程如下:The second step, parts scratch detection, the process is as follows: 2.1)零件侧面划痕检测:使用边缘检测方法对零件侧面划痕进行检测,首先确定图像中的边缘像素,然后把这些像素连接在一起,从而构成所需的区域边界;2.1) Scratch detection on the side of the part: use the edge detection method to detect the scratch on the side of the part, first determine the edge pixels in the image, and then connect these pixels together to form the required area boundary; 2.2)零件正面划痕检测:由于正面的边缘信息太多,会对分类结结果造成严重的影响,采用剔除冗余边缘信息方法,去除图像中的高频信号。2.2) Scratch detection on the front of the part: Because there is too much edge information on the front, it will have a serious impact on the classification results. The method of eliminating redundant edge information is used to remove high-frequency signals in the image. 2.如权利要求1所述的一种基于机器视觉的轴承钢珠零件检测方法,其特征在于,所述2.1)中,图像边缘是表示图像中一个区域和另一个区域的开始,图像中相邻之间的像素的集合就构成了图像的边缘,所以,图像的边缘可以理解成图像的灰度发生空间突变的像素的集合,图像边缘有两个重要的概念:方向和梯度,沿着边缘方向的像素变化比较平顺,而垂直于边缘方向的像素变化比较剧烈,因此根据这个特点,通常会用一阶和二阶导数来进行边缘检测,所以,一幅图像中的边缘检测是可以通过对灰度值求导来进行确定的,而导数的运算可以通过微分算子进行。2. The method for detecting bearing steel ball parts based on machine vision as claimed in claim 1, characterized in that, in 2.1), the edge of the image represents the beginning of one area and another area in the image, and adjacent areas in the image. The set of pixels in between constitutes the edge of the image. Therefore, the edge of the image can be understood as the set of pixels whose grayscale of the image undergoes spatial mutation. There are two important concepts in the image edge: direction and gradient, along the direction of the edge. The change of the pixels of the image is relatively smooth, while the change of the pixels perpendicular to the edge direction is more severe. Therefore, according to this characteristic, the first and second derivatives are usually used for edge detection. Therefore, the edge detection in an image can be detected by grayscale. The degree value is derived to determine it, and the operation of the derivative can be carried out by the differential operator. 3.如权利要求1或2所述的一种基于机器视觉的轴承钢珠零件检测方法,其特征在于,所述2.2)的步骤如下:3. a kind of bearing steel ball parts detection method based on machine vision as claimed in claim 1 or 2, is characterized in that, the step of described 2.2) is as follows: 2.2.1)用平滑滤波对图像进行预处理,去除图像中的高频信号;2.2.1) Preprocess the image with smooth filtering to remove high-frequency signals in the image; 2.2.2)采用边缘检测的方法检测图像边缘信息并提取图像的闭合轮廓;2.2.2) Use edge detection method to detect image edge information and extract the closed contour of the image; 2.2.3)使用椭圆拟合方法对轮廓进行椭圆拟合,之所以要进行椭圆拟合是因为本发明所要提取的目标区域是一个圆环;2.2.3) use ellipse fitting method to carry out ellipse fitting to outline, and the reason why ellipse fitting is to be carried out is because the target area to be extracted by the present invention is a ring; 2.2.4)根据图像的固定信息,选取合适的阈值,对得到的椭圆轮廓进行筛选,得到圆环的区域的内圆和外圆轮廓,最后采用图像相减的方法,得到所要提取的目标区域。2.2.4) According to the fixed information of the image, select an appropriate threshold value, screen the obtained elliptical outline, and obtain the inner circle and outer circle outline of the ring area, and finally use the method of image subtraction to obtain the target area to be extracted. .
CN202010564947.0A 2020-06-19 2020-06-19 Bearing steel ball part detection method based on machine vision Active CN111815575B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010564947.0A CN111815575B (en) 2020-06-19 2020-06-19 Bearing steel ball part detection method based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010564947.0A CN111815575B (en) 2020-06-19 2020-06-19 Bearing steel ball part detection method based on machine vision

Publications (2)

Publication Number Publication Date
CN111815575A true CN111815575A (en) 2020-10-23
CN111815575B CN111815575B (en) 2024-03-26

Family

ID=72846239

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010564947.0A Active CN111815575B (en) 2020-06-19 2020-06-19 Bearing steel ball part detection method based on machine vision

Country Status (1)

Country Link
CN (1) CN111815575B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112613523A (en) * 2020-12-15 2021-04-06 中冶赛迪重庆信息技术有限公司 Method, system, medium and electronic terminal for identifying steel flow at converter steel tapping hole
CN116363136A (en) * 2023-06-01 2023-06-30 山东创元智能设备制造有限责任公司 On-line screening method and system for automatic production of motor vehicle parts

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103175844A (en) * 2012-03-16 2013-06-26 沈阳理工大学 Detection method for scratches and defects on surfaces of metal components
CN106053485A (en) * 2016-08-01 2016-10-26 苏州宙点自动化设备有限公司 Machine vision-based novel algorithm of intelligent circular inspection of steel ball surface defects
CN109003258A (en) * 2018-06-15 2018-12-14 广东工业大学 A kind of high-precision sub-pix circular pieces measurement method
CN111862037A (en) * 2020-07-17 2020-10-30 华中科技大学无锡研究院 Method and system for geometric feature detection of precision hole parts based on machine vision

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103175844A (en) * 2012-03-16 2013-06-26 沈阳理工大学 Detection method for scratches and defects on surfaces of metal components
CN106053485A (en) * 2016-08-01 2016-10-26 苏州宙点自动化设备有限公司 Machine vision-based novel algorithm of intelligent circular inspection of steel ball surface defects
CN109003258A (en) * 2018-06-15 2018-12-14 广东工业大学 A kind of high-precision sub-pix circular pieces measurement method
CN111862037A (en) * 2020-07-17 2020-10-30 华中科技大学无锡研究院 Method and system for geometric feature detection of precision hole parts based on machine vision

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112613523A (en) * 2020-12-15 2021-04-06 中冶赛迪重庆信息技术有限公司 Method, system, medium and electronic terminal for identifying steel flow at converter steel tapping hole
CN112613523B (en) * 2020-12-15 2023-04-07 中冶赛迪信息技术(重庆)有限公司 Method, system, medium and electronic terminal for identifying steel flow at converter steel tapping hole
CN116363136A (en) * 2023-06-01 2023-06-30 山东创元智能设备制造有限责任公司 On-line screening method and system for automatic production of motor vehicle parts
CN116363136B (en) * 2023-06-01 2023-08-11 山东创元智能设备制造有限责任公司 On-line screening method and system for automatic production of motor vehicle parts

Also Published As

Publication number Publication date
CN111815575B (en) 2024-03-26

Similar Documents

Publication Publication Date Title
CN109490316B (en) Surface defect detection algorithm based on machine vision
CN109003258B (en) A high-precision sub-pixel circular part measurement method
CN108921176B (en) Pointer instrument positioning and identifying method based on machine vision
CN110223296B (en) Deformed steel bar surface defect detection method and system based on machine vision
CN105913415B (en) A kind of image sub-pixel edge extracting method with extensive adaptability
CN107808378B (en) Detection method for latent defects of complex structural castings based on vertical vertical and horizontal line profile features
CN104359403B (en) Planar part dimension measurement method based on sub-pixel edge algorithm
CN108389179B (en) Machine vision-based can cover surface defect detection method
CN109506580B (en) Spot-facing quality determining method based on line laser 3-D scanning
CN106053479B (en) A kind of vision detection system of the workpiece appearance defects based on image procossing
CN109682839B (en) Online detection method for surface defects of metal arc-shaped workpiece
CN107618533A (en) A kind of machine vision detection device and method of the discrete defect of Rail Surface
CN106204614A (en) A kind of workpiece appearance defects detection method based on machine vision
CN109658402A (en) Industry profile geometric dimension automatic testing method based on computer vision imaging
CN105160652A (en) Handset casing testing apparatus and method based on computer vision
CN108876860B (en) An Image Calibration Method for Measurement of Bubble Offset of Tube Level
CN107796826B (en) Detection method for broken teeth of micro-duplex gears based on tooth center distance curve analysis
CN107742289A (en) A detection method of rotating body workpiece based on machine vision
CN109986172B (en) Welding seam positioning method, equipment and system
CN113077437B (en) Workpiece quality detection method and system
CN112669265B (en) A method for surface defect detection based on Fourier transform and image gradient features
CN109781737B (en) Detection method and detection system for surface defects of hose
CN117095004B (en) Excavator walking frame main body welding deformation detection method based on computer vision
CN105184792B (en) A kind of saw blade wear extent On-line Measuring Method
CN107388991B (en) A kind of more fillet axial workpiece radius of corner measurement methods in end face

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