CN104966300B - Bearing roller image detecting system and method and image detection device - Google Patents
Bearing roller image detecting system and method and image detection device Download PDFInfo
- Publication number
- CN104966300B CN104966300B CN201510346247.3A CN201510346247A CN104966300B CN 104966300 B CN104966300 B CN 104966300B CN 201510346247 A CN201510346247 A CN 201510346247A CN 104966300 B CN104966300 B CN 104966300B
- Authority
- CN
- China
- Prior art keywords
- image
- circle
- point
- bearing roller
- area
- 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.)
- Expired - Fee Related
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10052—Images from lightfield camera
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30164—Workpiece; Machine component
Landscapes
- Engineering & Computer Science (AREA)
- Quality & Reliability (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
本发明公开了一种轴承滚子图像检测方法;包括如下的步骤:首先、针对不同的拍摄环境,调试出相对应的图像参数;其次、根据上一步骤获取的相关图像参数,提取标准件的特征点,确定图像识别的标准;最后、提取被测件的特征点,对比标准件的特征点做出判断。
The invention discloses a bearing roller image detection method, which includes the following steps: firstly, according to different shooting environments, corresponding image parameters are debugged; secondly, according to the related image parameters obtained in the previous step, the standard parts are extracted The feature points determine the standard of image recognition; finally, extract the feature points of the tested part and compare them with the feature points of the standard part to make a judgment.
Description
技术领域technical field
本发明涉及一种图像检测系统,尤其是一种轴承滚子图像检测系统及方法。The invention relates to an image detection system, in particular to a bearing roller image detection system and method.
背景技术Background technique
在日常生活中经常进行图像识别的活动。比如说,我们能够分辨出桌子、椅子,很小的时候就能够分辨出自己的父母,能够进行正常的阅读,这些都是我们习以为常的能力,在计算机出现以前,没有人对此表现出惊奇,也没有人注意到人类的模式识别能力是一种值得研究的课题。当计算机出现之后,人工智能开始发展,模式识别也随之成为一个热门课题,当科学家发现用机器实现人类的模式识别能力是如此麻烦时,人们才意识到这个问题的难度。Image recognition activities are often performed in daily life. For example, we can distinguish between tables and chairs, we can distinguish our parents from a very young age, and we can read normally. These are all abilities we take for granted. Before the advent of computers, no one expressed surprise. Nor has anyone noticed that human pattern recognition is a worthy subject of study. After the emergence of computers, artificial intelligence began to develop, and pattern recognition became a hot topic. When scientists discovered that it was so troublesome to realize human pattern recognition ability with machines, people realized the difficulty of this problem.
30年前,数字计算机出现了,它的强有力的数值计算能力,使得人们期望着它也囊想人脑一样,具备非数值计算能力,然而,人们早期的乐观期望并没有成为现实,比起现金的计算机来,人脑的机制更为复杂,计算机在数值计算能力方面超过了人类并不代表它的通用计算能力也很强,这样非数值计算能力如何在计算机上实现,恰恰成为人工智能和机器模式识别的重要任务。30 years ago, the digital computer appeared. Its powerful numerical computing ability made people expect that it would have the same non-numerical computing ability as the human brain. However, people’s early optimistic expectations did not become a reality. Compared with In the case of cash computers, the mechanism of the human brain is more complex. The fact that a computer surpasses humans in terms of numerical computing ability does not mean that its general computing ability is also very strong. How to realize non-numerical computing ability on a computer is just a matter of artificial intelligence and important task of machine pattern recognition.
20世纪60年代末,数字图像处理具备了比较完整的体系,形成了一门新兴的学科。20世纪70年代,数字图像处理技术得到迅猛的发展,理论和方法进一步完善,应用范围更加广泛。在这一时期,图像处理主要和模式识别及图像理解系统的研究相联系,如文字识别、医学图像处理、遥感图像的处理等。20世纪70年代后期到现在,各个应用领域对数字图像处理提出越来越高的要求,促进了这门学科向更高级的方向发展。特别是在景物理解和计算机视觉(即机器视觉)方面,图像处理已由二维处理发展到三维理解或解释。近年来,随着计算机和其它各有关领域的迅速发展,例如在图像表现、科学计算可视化、多媒体计算技术等方面的发展,数字图像处理已从一个专门的研究领域变成了科学研究和人机界面中的一种普遍应用的工具。In the late 1960s, digital image processing had a relatively complete system and formed a new discipline. In the 1970s, digital image processing technology developed rapidly, the theory and method were further improved, and the scope of application was wider. During this period, image processing was mainly related to the research of pattern recognition and image understanding systems, such as text recognition, medical image processing, and remote sensing image processing. From the late 1970s to the present, various application fields put forward higher and higher requirements for digital image processing, which promoted the development of this subject to a more advanced direction. Especially in terms of scene understanding and computer vision (ie machine vision), image processing has been developed from two-dimensional processing to three-dimensional understanding or interpretation. In recent years, with the rapid development of computers and other related fields, such as the development of image representation, scientific computing visualization, multimedia computing technology, etc., digital image processing has changed from a specialized research field to a scientific research and man-machine A ubiquitous tool in the interface.
随着微电子集成技术、微计算机技术、数字技术的飞速发展,数据记录和存储仪器的研究与开发也有了更快的发展,各大公司相继投入巨资研究、开发该类仪器,以图率先占领此技术领域。With the rapid development of microelectronics integration technology, microcomputer technology, and digital technology, the research and development of data recording and storage instruments have also developed faster. Major companies have invested heavily in research and development of such instruments one after another. Occupy this technical field.
数据记录系统起始于20世纪50年代,1956年美国首先研究了用在军事上的测试系统[3],满足众多传统方法不能完成的数据采集和测试任务。大约在20世纪60年代后期,国外就有整套的数据采集产品进入市场。此阶段的数据采集设备和系统多属于专用的系统。20世纪70年代中后期,随着微型机的发展,诞生了采集器、仪表同计算机融为一体的数据采集系统,在发展过程中也逐渐分为两类,一类是实验室数据采集系统,另一类是工业现场数据采集系统。就使用的总线而言,实验室数据采集系统多采用并行总线,工业现场数据采集系统多采用串行数据总线。20世纪90年代至今,由于集成电路制造技术的不断提高,出现了高性能、高可靠性的单片数据采集系统。计算机、单片机和大规模集成电路的组合,用软件管理,使系统的成本降低,体积减小,功能成倍增加,数据处理能力大大加强。该阶段数据采集系统采用更加先进的模块是结构,利用ARM、DSP、FPGA等高性能芯片,根据不同的应用要求,通过简单的增加和更改模块,并结合系统编程,就可扩展和修改系统,迅速的组成一个新的系统。纵观国内外数据记录仪市场目前数据记录仪主要具有以下的特点和发展趋势:The data recording system began in the 1950s. In 1956, the United States first studied the test system used in the military [3] to meet the data collection and test tasks that many traditional methods cannot complete. Around the late 1960s, a complete set of data acquisition products entered the market abroad. Most of the data acquisition equipment and systems at this stage are dedicated systems. In the mid-to-late 1970s, with the development of microcomputers, a data acquisition system integrating collectors, instruments and computers was born, which was gradually divided into two categories during the development process, one is laboratory data acquisition systems, and the other is laboratory data acquisition systems. The other is the industrial field data acquisition system. As far as the bus used is concerned, the laboratory data acquisition system mostly uses a parallel bus, and the industrial field data acquisition system mostly uses a serial data bus. Since the 1990s, due to the continuous improvement of integrated circuit manufacturing technology, a high-performance, high-reliability single-chip data acquisition system has emerged. The combination of computer, single-chip microcomputer and large-scale integrated circuit is managed by software, which reduces the cost and volume of the system, multiplies the functions, and greatly enhances the data processing capacity. At this stage, the data acquisition system adopts a more advanced module structure, using ARM, DSP, FPGA and other high-performance chips, according to different application requirements, by simply adding and changing modules, combined with system programming, the system can be expanded and modified. Quickly form a new system. Throughout the domestic and foreign data logger market, the current data logger mainly has the following characteristics and development trends:
1.智能化,以微处理器为核心,从而实现高性能、多回路的检测系统。有些记录仪还具有联网和通讯功能,历史数据查询功能,可以即时或按时打印各种曲线、数据等;1. Intelligent, with microprocessor as the core, so as to realize high-performance, multi-loop detection system. Some recorders also have networking and communication functions, historical data query functions, and can print various curves and data in real time or on time;
2.信号输入万能化,用户可以任意的选用电压、电流、热电阻、热电偶等作为输入信号类型,这也使得仪表的应用场合变得更加广阔;2. The signal input is universal, the user can arbitrarily choose voltage, current, thermal resistance, thermocouple, etc. as the input signal type, which also makes the application of the instrument more extensive;
3.存储容量大、方式多样化,数据记录仪大多采用大容量的RAM、SRAM、FLASH、软盘甚至硬盘来保存数据,这些保存方式其容量都远远大于传统的记录仪的记录容量;3. Large storage capacity and diverse methods. Most data loggers use large-capacity RAM, SRAM, FLASH, floppy disk or even hard disk to save data. The capacity of these storage methods is far greater than that of traditional recorders;
4.显示方案多样化,以液晶显示、数码管显示居多,其中液晶显示又有TFT彩色和黑白液晶。4. The display schemes are diversified, most of which are liquid crystal display and digital tube display, among which liquid crystal display has TFT color and black and white liquid crystal.
发明内容Contents of the invention
本发明要解决的技术问题是提供一种简单的轴承滚子图像检测方法。The technical problem to be solved by the invention is to provide a simple image detection method for bearing rollers.
为了解决上述技术问题,本发明提供一种轴承滚子图像检测方法;包括如下的步骤:In order to solve the above technical problems, the present invention provides a bearing roller image detection method; including the following steps:
首先、针对不同的拍摄环境,调试出相对应的图像参数;其次、根据上一步骤获取的相关图像参数,提取标准件的特征点,确定图像识别的标准;最后、提取被测件的特征点,对比标准件的特征点做出判断。Firstly, adjust the corresponding image parameters according to different shooting environments; secondly, extract the feature points of the standard part according to the relevant image parameters obtained in the previous step, and determine the standard of image recognition; finally, extract the feature points of the tested part , compared with the feature points of the standard parts to make a judgment.
作为对本发明所述的轴承滚子图像检测方法的改进:所述图像参数为在某一环境下获取的图像中的阈值二值化数据、图像膨胀系数数据、图像腐蚀系数数据、Canny边缘提取数据的相关取值。As an improvement to the bearing roller image detection method described in the present invention: the image parameters are threshold binarization data, image expansion coefficient data, image corrosion coefficient data, and Canny edge extraction data in an image acquired in a certain environment The relevant value of .
作为对本发明所述的轴承滚子图像检测方法的进一步改进:所述阈值二值化数据处理时,当图像中的单个高频噪声包括一到四个像素范围时,设置为本次处理的二值化阈值的取值范围;所述图像膨胀系数数据处理时,将阈值二值化数据处理后的图像进行膨胀处理,当图像中黑色小颗粒干扰完全消失时,将其膨胀次数作为此时的膨胀系数;所述图像腐蚀系数处理时,将图像膨胀系数数据处理后的图像进行腐蚀处理,当图像中单个伤疤所包含的像素点个数大于等于四的时候,将此时的图像腐蚀次数作为图像腐蚀系数。As a further improvement to the bearing roller image detection method described in the present invention: during the processing of the threshold value binarization data, when a single high-frequency noise in the image includes a range of one to four pixels, it is set as the binary value of this processing. The value range of the value threshold; during the image expansion coefficient data processing, the image after the threshold binarization data processing is expanded, and when the small black particle interference in the image disappears completely, its expansion number is used as the current value. Expansion coefficient: When the image corrosion coefficient is processed, the image after the image expansion coefficient data processing is corroded, and when the number of pixels contained in a single scar in the image is greater than or equal to four, the number of times of image corrosion at this time is used as Image corrosion factor.
作为对本发明所述的轴承滚子图像检测方法的进一步改进:标准件的特征点提取步骤为对标准件图像依次进行粗定位、精定位、预处理、图像内外圈面积计算;被测件的特征点提取步骤为对所记录的被测件图像依次进行粗定位、精定位、预处理、内外圆断点判断、内外圆走势判断、内外圈面积以及内圈面积计算并比对。As a further improvement to the bearing roller image detection method described in the present invention: the feature point extraction step of the standard part is to perform rough positioning, fine positioning, preprocessing, and calculation of the area of the inner and outer rings of the image of the standard part in sequence; The point extraction step is to perform rough positioning, fine positioning, preprocessing, inner and outer circle breakpoint judgment, inner and outer circle trend judgment, inner and outer ring area and inner ring area calculation and comparison for the recorded image of the tested part in sequence.
作为对本发明所述的轴承滚子图像检测方法的进一步改进:所述粗定位将收集的图像中,以轴承滚子所在的区域进行剪辑;所述精定位根据粗定位确定的图像进行轮廓线的扫点,并获得该目标轴承滚子轮廓的最左端、最右端、最上端以及最下端;所述预处理为根据确定的图像参数分别对精定位确定的图像依次进行阈值二值化、图像膨胀系数、图像腐蚀系数、Canny边缘提取;所述内外圆断点判断、内外圆走势判断、内外圈面积以及内圈面积计算均通过对图像外圆轮廓和内圆轮廓扫点进行。As a further improvement to the bearing roller image detection method described in the present invention: in the image collected by the rough positioning, the area where the bearing roller is located is clipped; Scan points, and obtain the leftmost, rightmost, uppermost, and lowermost ends of the target bearing roller profile; the preprocessing is to perform threshold binarization and image expansion on the images determined by precise positioning according to the determined image parameters. Coefficient, image corrosion coefficient, Canny edge extraction; the inner and outer circle breakpoint judgment, the inner and outer circle trend judgment, the inner and outer circle area and the inner circle area calculation are all carried out by scanning the outer circle contour and the inner circle contour of the image.
作为对本发明所述的轴承滚子图像检测方法的进一步改进:被测件的特征点对比标准件的特征点判断按照内外圆断点判断、内外圆走势判断、内外圈面积比对的次序依次进行。As a further improvement to the bearing roller image detection method described in the present invention: the feature points of the measured piece are compared with the feature points of the standard piece to judge according to the order of inner and outer circle breakpoint judgment, inner and outer circle trend judgment, and inner and outer ring area comparison. .
作为对本发明所述的轴承滚子图像检测方法的进一步改进:所述内外圆断点判断、内外圆走势判断、内外圈面积以及内圈面积计算步骤时,针对图像外圆轮廓和内圆轮廓扫点后,分别进行如下的判定:内外圆断点判断:如果扫点步骤中,找不到下一个扫描点时,即判定为出现断点,确认被测件为不合格件,不再进行下一步判定;如果没有出现断点,则进行内外圆走势判断;内外圆走势判断:如果扫点步骤出现内弯现象,即判定为内外圆走势不符合圆形,确认其为不合格件,不再进行下一步判定;如果其走势符合圆形,则进行内外圈面积比对;根据标准件的面积数据与被测件的内外圆面积与内圆面积分别进行比对,如果面积比对数据不在一定误差范围内,则判定其为不合格件,如果数据在一定误差范围内,则判定其为合格件。As a further improvement to the bearing roller image detection method described in the present invention: during the steps of determining the break point of the inner and outer circles, the trend of the inner and outer circles, the area of the inner and outer rings, and the calculation steps of the area of the inner ring, scan the contour of the outer circle and the inner circle of the image After the point is selected, the following judgments are made respectively: Judgment of inner and outer circle breakpoints: If the next scanning point cannot be found in the point scanning step, it is judged that there is a breakpoint, and it is confirmed that the tested part is unqualified, and the next step is not carried out. One-step judgment; if there is no breakpoint, judge the trend of inner and outer circles; judge the trend of inner and outer circles: if there is an inward bending phenomenon in the point scanning step, it is judged that the trend of the inner and outer circles does not conform to the circle, and it is confirmed that it is unqualified, and no longer Carry out the next step of judgment; if the trend conforms to a circle, compare the area of the inner and outer circles; compare the area data of the standard part with the area of the inner and outer circles of the tested part and the area of the inner circle respectively, if the area comparison data is not within a certain range If the data is within the error range, it is judged to be unqualified, and if the data is within a certain error range, it is judged to be qualified.
作为对本发明所述的轴承滚子图像检测方法的进一步改进:所述内外圆之间的面积计算:在扫外轮廓的过程中,由当前的扫描点向内圆方向沿纵坐标寻找穿过黑色区域后的边缘点,该点与外轮廓上的扫描点的纵坐标进行作差;外轮廓的扫描点继续扫点,以同样的方法再计算差值;将这些差值累加,即为内外圆间的面积;内圆的面积计算:在扫内轮廓的过程中,累加扫描点的纵坐标,即为内圆的面积。As a further improvement to the bearing roller image detection method described in the present invention: calculation of the area between the inner and outer circles: in the process of scanning the outer contour, from the current scanning point to the direction of the inner circle along the ordinate to find the area passing through the black The edge point behind the area, the difference between this point and the ordinate of the scanning point on the outer contour; the scanning point of the outer contour continues to scan points, and then calculate the difference in the same way; accumulate these differences, that is, the inner and outer circles The area of the inner circle; the calculation of the area of the inner circle: in the process of scanning the inner contour, the ordinate of the accumulated scanning point is the area of the inner circle.
作为对本发明所述的轴承滚子图像检测方法的进一步改进:所述扫点步骤中,将整个轴承滚子均分成4份,每份为圆;扫点的起始点为其中的对称的两个像素点;将其中一个像素点作为左上和左下两个圆的起点,左上向上寻找边缘点,左下向下寻找边缘点;将与其对应的另外一个像素点作为右上和右下两个圆的起点。As a further improvement to the bearing roller image detection method described in the present invention: in the step of scanning points, the whole bearing roller is divided into 4 parts, and each part is Circle; the starting point of the scanning point is two symmetrical pixels; one of the pixels is used as the upper left and lower left The starting point of the circle, look for the edge point from the upper left, and look for the edge point from the lower left; use another pixel corresponding to it as the upper right and lower right The starting point of the circle.
轴承滚子图像检测装置,包括图像获取装置以及图像分析装置:所述图像获取装置包括暗室,所述暗室内的下侧面为轴承滚子托台;所述暗室内轴承滚子托台的正上方,设置摄像头;所述暗室的侧壁为带有弧度的白色幕墙;所述暗室内的正上方设置照明装置,所述照明装置包括LED灯头,所述LED灯头包括正中间的主拍摄灯和围绕主拍摄灯均匀分布的至少四个辅拍摄灯;在所述主拍摄灯和辅拍摄灯正下方设置有柔光布。The bearing roller image detection device includes an image acquisition device and an image analysis device: the image acquisition device includes a dark room, the lower side of the dark room is a bearing roller support platform; the bearing roller support platform in the dark room is directly above , set the camera; the side wall of the dark room is a white curtain wall with a radian; the lighting device is set directly above the dark room, and the lighting device includes an LED light head, and the LED light head includes a main shooting light in the middle and a surrounding There are at least four auxiliary shooting lights evenly distributed among the main shooting lights; a soft light cloth is arranged directly below the main shooting lights and the auxiliary shooting lights.
本发明可以应用在检测相同类型的轴承滚子中,利用USB接口的摄像头采集图像,采集的图像同过OpenCV捕获到计算机中。在图像预处理中,采用了阈值二值化、形态学变换膨胀、形态学变换腐蚀和Canny边缘提取,简化了图像本身的信息量,突出了图像的特征值。利用图像特征点提取和对比,进行图像识别,作出判断。The present invention can be applied in detecting the same type of bearing rollers, and the camera with the USB interface is used to collect images, and the collected images are captured into the computer through OpenCV. In image preprocessing, threshold value binarization, morphological transformation dilation, morphological transformation erosion and Canny edge extraction are used to simplify the information of the image itself and highlight the characteristic value of the image. Use image feature point extraction and comparison to perform image recognition and make judgments.
该轴承滚子图像检测方法具有机械结构简单、易于操作、辨别速度快、辨别范围广、单次辨别数量多等特点。整套系统的成本低、效率高,具有较强的通用性和抗干扰性,具有广阔的市场前景。The bearing roller image detection method has the characteristics of simple mechanical structure, easy operation, fast identification speed, wide identification range, large number of single identifications, and the like. The whole system has low cost, high efficiency, strong versatility and anti-interference, and has broad market prospects.
附图说明Description of drawings
下面结合附图对本发明的具体实施方式作进一步详细说明。The specific implementation manners of the present invention will be described in further detail below in conjunction with the accompanying drawings.
图1是本发明的图像获取装置结构示意图;Fig. 1 is a schematic structural diagram of an image acquisition device of the present invention;
图2是图1中的主拍摄灯2和辅拍摄灯3结构示意图;Fig. 2 is a schematic structural view of the main shooting light 2 and the auxiliary shooting light 3 in Fig. 1;
图3是图1中的白色幕墙10。Fig. 3 is the white curtain wall 10 in Fig. 1 .
具体实施方式detailed description
本发明给出一种轴承滚子图像检测系统及方法及图像检测装置。The invention provides a bearing roller image detection system and method and an image detection device.
该种轴承滚子图像检测方法;包括如下的步骤:The image detection method of a bearing roller includes the following steps:
首先、针对不同的拍摄环境,调试出相对应的图像参数;First, adjust the corresponding image parameters for different shooting environments;
其次、根据上一步骤获取的相关图像参数,提取标准件的特征点,确定图像识别的标准;Secondly, according to the relevant image parameters obtained in the previous step, the feature points of the standard part are extracted to determine the standard of image recognition;
最后、提取被测件的特征点,对比标准件的特征点做出判断。Finally, extract the feature points of the tested part, and compare them with the feature points of the standard part to make a judgment.
其图像参数为在某一环境下获取的图像中的阈值二值化数据、图像膨胀系数数据、图像腐蚀系数数据、Canny边缘提取数据的相关取值。其中阈值二值化数据处理时,当图像中的单个高频噪声包括一到四个像素范围时,设置为本次处理的二值化阈值的取值范围。图像膨胀系数数据处理时,将阈值二值化数据处理后的图像进行膨胀处理,当图像中黑色小颗粒干扰完全消失时,将其膨胀次数作为此时的膨胀系数。图像腐蚀系数处理时,将图像膨胀系数数据处理后的图像进行腐蚀处理,当图像中单个伤疤所包含的像素点个数大于等于四的时候,将此时的图像腐蚀次数作为图像腐蚀系数。Canny边缘提取数据为现有技术。Its image parameters are threshold binarization data, image expansion coefficient data, image corrosion coefficient data, and relevant values of Canny edge extraction data in the image acquired in a certain environment. When the threshold value binarization data is processed, when a single high-frequency noise in the image includes a range of one to four pixels, it is set as the value range of the binarization threshold value for this processing. When processing the image expansion coefficient data, the image after the threshold value binarization data processing is subjected to expansion processing, and when the interference of small black particles in the image completely disappears, the expansion times are used as the expansion coefficient at this time. When processing the image corrosion coefficient, the image after the image expansion coefficient data processing is subjected to corrosion processing. When the number of pixels contained in a single scar in the image is greater than or equal to four, the number of image corrosions at this time is used as the image corrosion coefficient. Canny edge extraction data is an existing technology.
被测件的特征点对比标准件的特征点判断按照内外圆断点判断、内外圆走势判断、内外圈面积比对的次序依次进行。所述内外圆断点判断、内外圆走势判断、内外圈面积以及内圈面积计算步骤针对图像外圆轮廓和内圆轮廓扫点时进行,在一次扫点的时候,记录下扫点的所有数据,则将其数据进行分析之后,分别进行如下次序的判定:The feature points of the tested part are compared with the feature points of the standard part to judge according to the order of inner and outer circle breakpoint judgment, inner and outer circle trend judgment, and inner and outer ring area comparison. The steps of judging breakpoints of inner and outer circles, judging the trend of inner and outer circles, calculating the area of inner and outer circles and the area of inner circles are carried out when scanning points of the outer circle contour and inner circle contour of the image, and record all the data of the scanning points during one sweep , after the data is analyzed, the judgments are made in the following order:
内外圆断点判断:如果扫点步骤中,找不到下一个扫描点时,即判定为出现断点,确认被测件为不合格件,不再进行下一步判定;如果没有出现断点,则进行内外圆走势判断;Judgment of inner and outer circle breakpoints: If the next scanning point cannot be found in the point scanning step, it is judged that a breakpoint has occurred, and the tested part is confirmed to be unqualified, and the next step is not judged; if there is no breakpoint, Then judge the trend of inner and outer circles;
内外圆走势判断:如果扫点步骤出现内弯现象,即判定为内外圆走势不符合圆形,确认其为不合格件,不再进行下一步判定;如果其走势符合圆形,则进行内外圈面积比对;Judgment of the trend of inner and outer circles: If there is an inward bending phenomenon in the scanning point step, it is judged that the trend of the inner and outer circles does not conform to the circle, and it is confirmed that it is unqualified, and the next step is not judged; if the trend is in line with the circle, the inner and outer circles are judged area comparison;
根据标准件的面积数据与被测件的内外圆面积与内圆面积分别进行比对,如果面积比对数据不在一定误差范围内,则判定其为不合格件,如果数据在一定误差范围内,则判定其为合格件。According to the area data of the standard part and the area of the inner and outer circles of the tested part and the area of the inner circle, respectively, if the area comparison data is not within a certain error range, it is judged as a substandard part; if the data is within a certain error range, It is judged to be qualified.
在扫点的时候记录所有的数据,可以减少其数据的记录量,减少后面的数据处理的误差。而以上所述的误差范围则根据每次轴承滚子的加工精度进行对应的限定,其取值范围与轴承滚子的大小有关,轴承滚子的截面越大,误差范围越大,一般为100到600像素点点数之间;实际值依轴承滚子大小而定(通过像素点来体现实际的尺寸误差,所以这里的误差范围采用的是像素点点数)。Recording all the data when scanning points can reduce the amount of data recording and reduce the error of subsequent data processing. The above-mentioned error range is limited according to the machining accuracy of each bearing roller, and its value range is related to the size of the bearing roller. The larger the cross-section of the bearing roller, the larger the error range, generally 100 Between to 600 pixels; the actual value depends on the size of the bearing roller (the actual size error is reflected by the pixels, so the error range here is the number of pixels).
实施例1、图1~图3给出一种图像检测装置。如果在检测的时候,想要获得最佳最快的检测效果,则需要针对检测的图像进行设置,取最佳显示效果的图像进行检测,而一般的自然光光照条件下,很难达到最佳的图像拍摄效果,继而会导致图像处理过于繁琐,并影响图像检测效率。针对此,本发明给出一种轴承滚子图像检测系统,该轴承滚子图像检测系统包括图像获取装置以及图像分析装置。Embodiment 1, Figures 1 to 3 present an image detection device. If you want to obtain the best and fastest detection effect during detection, you need to set up the detected image, and select the image with the best display effect for detection, but under normal natural light conditions, it is difficult to achieve the best The effect of image capture will in turn cause image processing to be too cumbersome and affect the efficiency of image detection. Aiming at this, the present invention provides a bearing roller image detection system, which includes an image acquisition device and an image analysis device.
本发明的图像获取装置包括暗室1,暗室1内的下侧面设置有轴承滚子托台,所述暗室1的侧壁为带有弧度的白色幕墙10,所述暗室1内的正上方设置照明装置,所述照明装置包括LED灯头,所述LED灯头包括正中间的主拍摄灯2和围绕主拍摄灯2均匀分布的四个辅拍摄灯3(为了获得更佳的拍摄效果,也可以在主拍摄LED灯的周围使用更加多均匀分布的辅拍摄灯3);在五个LED灯头(主拍摄灯2和辅拍摄灯3)正下方,设置一层柔光布4;在暗室1内放置轴承滚子位置的轴承滚子托台正上方设置摄像头5。使用的时候,轴承滚子托台上放置轴承,再通过将摄像头5相应的调整,使其镜头拍摄的画面为整个托台,此时,摄像头5拍摄轴承的图像并存储,而此时拍摄的图像为轴承和轴承平台,而由于轴承平台存在,只要将轴承放置在轴承平台内,则其拍摄的图像均包括完整的轴承,这种设置方式可以直接形成轴承的粗定位,减少轴承检测时候的计算量。The image acquisition device of the present invention comprises a darkroom 1, the lower side of the darkroom 1 is provided with a bearing roller support platform, the side wall of the darkroom 1 is a white curtain wall 10 with a curvature, and the lighting is arranged directly above the darkroom 1. device, the lighting device includes an LED light head, and the LED light head includes a main shooting light 2 in the middle and four auxiliary shooting lights 3 evenly distributed around the main shooting light 2 (in order to obtain a better shooting effect, it can also be placed on the main shooting light Use more evenly distributed auxiliary shooting lights 3) around the shooting LED lights; set a layer of soft light cloth 4 directly below the five LED lamp heads (main shooting lights 2 and auxiliary shooting lights 3); place bearings in the darkroom 1 A camera 5 is arranged directly above the bearing roller pallet at the roller position. When in use, place the bearing on the bearing roller pallet, and then adjust the camera 5 accordingly so that the picture taken by the lens is the entire pallet. At this time, the camera 5 captures the image of the bearing and stores it, and the captured The image is the bearing and the bearing platform, and because the bearing platform exists, as long as the bearing is placed in the bearing platform, the images taken include the complete bearing. This setting method can directly form the rough positioning of the bearing and reduce the time of bearing inspection. Calculations.
在图像采集过程中,由于轴承滚子一般都是金属材质的物体,所以直接对其直接拍摄的时候,会明显具有反光的效果,这种情况下的拍摄,会导致摄像头5无法拍摄到金属表面的纹理,会影响到轴承滚子表面的伤疤检测,因此,在本发明中,为了获取最佳的拍摄效果,首先将轴承滚子内置于暗室1中,本发明的暗室1为前、后、左、右侧均为带有弧度的白色幕墙10,通过白色的背景对光的反射和散射来达到均匀环境光的作用;而在该暗室1的正上方设置有摄像头5以及光源。虽然暗室1内由白色幕墙10构成,可以在拍摄的时候,对光照起到反射和散射的效果,但不均匀的光照直接照射到轴承滚子的时候,还是会出现影子,而本发明的图像分析过程中,如果出现了影子,则将无法进行准确分析,所以需要消除影子效果;此时,采用多方位照射的方式进行,其照明装置采用五颗LED灯头实现,将其中一颗居中,而其他四颗则均匀的环绕排列在其四周,此时进行拍摄时,可以有效的消除影子等现象,但此时,会出现灯光照射光线过强,且过于集中,使得拍摄时曝光过度,所以在其五颗LED灯头的上覆盖一层柔光布4,使得照射在轴承滚子表面的光均匀而柔和,此时进行拍摄的结果就能达到本发明中进行图像分析的要求了。During the image acquisition process, since the bearing rollers are generally metal objects, when they are directly photographed directly, there will be obvious reflective effects. In this case, the camera 5 will not be able to photograph the metal surface The texture will affect the detection of scars on the surface of the bearing rollers. Therefore, in the present invention, in order to obtain the best shooting effect, the bearing rollers are first built into the darkroom 1. The darkroom 1 of the present invention is front, rear, Both the left and right sides are white curtain walls 10 with radians, which achieve the effect of uniform ambient light through the reflection and scattering of light by the white background; and a camera 5 and a light source are arranged directly above the dark room 1 . Although the darkroom 1 is composed of a white curtain wall 10, which can reflect and scatter the light when shooting, but when the uneven light directly irradiates the bearing roller, shadows will still appear, and the image of the present invention During the analysis process, if there is a shadow, accurate analysis will not be possible, so it is necessary to eliminate the shadow effect; at this time, the method of multi-directional illumination is used, and the lighting device is realized by five LED lamp heads, one of which is centered, and the The other four are evenly arranged around it. When shooting at this time, it can effectively eliminate shadows and other phenomena. Its five LED lamp holders are covered with a layer of soft light cloth 4, so that the light irradiated on the surface of the bearing roller is even and soft, and the result of shooting at this time can reach the requirements of image analysis in the present invention.
图像获取装置进行图像采集之后,由图像分析装置进行图像的分析处理,所述分析处理步骤如下:After the image acquisition device performs image acquisition, the image analysis device performs image analysis and processing, and the analysis and processing steps are as follows:
采集好符合检测要求的图像之后,需要去除噪声,加强有用的信息,并对输入测量仪器或者其他因素所造成的退化现象进行复原,需要对其图像进行预处理,其预处理的步骤如下:After collecting the image that meets the detection requirements, it is necessary to remove the noise, strengthen the useful information, and restore the degradation phenomenon caused by the input measuring instrument or other factors. It is necessary to preprocess the image. The preprocessing steps are as follows:
阀值二值化处理:一幅图像包括目标物体、背景还有噪声,要想从多值的数字图像中直接提取出目标物体,最常用的方法就是设定一个全局的阈值T,用T将图像的数据分成两部分:大于T的像素群和小于T的像素群。其数学表达式如下:Threshold binarization: An image includes target objects, background and noise. To directly extract target objects from multi-valued digital images, the most common method is to set a global threshold T, and use T to set The data of the image is divided into two parts: the pixel group larger than T and the pixel group smaller than T. Its mathematical expression is as follows:
结合本发明所使用的图像获取装置,二值化-二值化阈值的取值范围在100~180之间(具体值的确定为图像中刚出现黑色小颗粒干扰时的值);其获取的图像在经过多种阀值大小的比对后,发现当阈值大小为150左右时,二值化的效果最佳。此时轴承滚子的表面轮廓清晰,“伤疤”的显像也相当明显,甚至是极小的“伤疤”;但此时会有非连续的黑色颗粒的噪声影响。针对这样的影响,将通过阀值二值化处理的图像再次通过图像膨胀处理。In conjunction with the image acquisition device used in the present invention, the value range of the binarization-binarization threshold is between 100 and 180 (the determination of the specific value is the value when the small black particles just appear in the image); After comparing the images with various threshold values, it is found that when the threshold value is around 150, the binarization effect is the best. At this time, the surface contour of the bearing roller is clear, and the image of the "scar" is quite obvious, even a very small "scar"; but at this time, there will be noise effects of discontinuous black particles. For such effects, the image processed by threshold binarization is again processed by image dilation.
图像膨胀处理:形态学变换膨胀(dilation)⊕采用向量加法(或Minkowski集合加法,如(a,b)+(c,d)=(a+c,b+d))对两个集合进行合并。膨胀X⊕B是所有向量加之和的集合,向量加法的两个操作数分别来自于X和B,并且取到任何可能的组合。Image expansion processing: Morphological transformation dilation (dilation) ⊕ Use vector addition (or Minkowski set addition, such as (a,b)+(c,d)=(a+c,b+d)) to merge two sets . Expansion X⊕B is the set of sums of all vectors. The two operands of vector addition come from X and B respectively, and any possible combination is taken.
X⊕B={p∈ε2,p=x+b,x∈X且b∈B}X⊕B={p∈ε 2 , p=x+b, x∈X and b∈B}
采用各向同性结构元素的膨胀运算可以描述为一个将所有与物体邻近的背景像素变为物体像素的变换。The dilation operation with isotropic structuring elements can be described as a transformation that converts all background pixels adjacent to the object into object pixels.
选择膨胀次数:对图像进行形态学变换膨胀的目的是为了除去图像中的黑色非连续小颗粒噪声阈值为130时,主要的干扰为轴承滚子表面的黑色颗粒噪声。对图像做一次形态学变换膨胀之后,黑色颗粒噪声可以完全消除。增加膨胀次数后,外轮廓的特征受到了影响。Select the number of expansion: the purpose of morphological transformation and expansion of the image is to remove the black discontinuous small particle noise in the image. When the threshold is 130, the main interference is the black particle noise on the surface of the bearing roller. After a morphological transformation and expansion of the image, the black particle noise can be completely eliminated. After increasing the number of dilations, the characteristics of the outer contour are affected.
在形态学变换膨胀过程中,对背景白色膨胀,可以在一定程度上消除黑色小颗粒点噪声。但是较大的黑色颗粒点只能经过多次膨胀之后才能消除。In the process of morphological transformation and expansion, the background white is expanded, which can eliminate the noise of small black particles to a certain extent. However, larger black particles can only be eliminated after multiple expansions.
当为了消除较大的颗粒点而增加膨胀次数时,滚子内圆又会受到明显的影响。所以需要在调节参数时,在保证体现“伤疤”明显的前提下,将黑色颗粒点控制在一定大小;膨胀次数则是保证,在不影响截面图像特征的前提下,完全消除黑色颗粒点。即,这需要二值化的阈值大小和图像膨胀的次数相互配合,来达到预期的效果。When the number of expansions is increased in order to eliminate larger particle points, the inner circle of the roller will be significantly affected. Therefore, when adjusting the parameters, it is necessary to control the black particles to a certain size under the premise of ensuring that the "scar" is obvious; the number of expansions is to ensure that the black particles are completely eliminated without affecting the characteristics of the cross-sectional image. That is, this requires the cooperation between the binarization threshold size and the number of times of image expansion to achieve the desired effect.
图像腐蚀:腐蚀(erosion)对集合元素采用向量减法,将两个集合合并,腐蚀是膨胀的对偶运算。腐蚀和膨胀都不是可逆运算。Image corrosion: corrosion (erosion) Use vector subtraction for the set elements to merge two sets. Erosion is the dual operation of expansion. Neither erosion nor dilation are reversible operations.
这一公式表明图像的每个点p都被测试到了;腐蚀的结果由所有满足p+b属于X的点p构成。This formula states that every point p of the image has been tested; the result of erosion consists of all points p that belong to X satisfying p+b.
基本的形态学变化可以用来在图像中寻找物体轮廓,而且速度很快。具体实现方法是计算原始图像和腐蚀后的图像的差。Basic morphological changes can be used to find object contours in images, and it is fast. The specific implementation method is to calculate the difference between the original image and the corroded image.
腐蚀还用来简化物体的结构——那些只有一个像素宽的物体或物体的部分将被去掉。这样就把较复杂的物体分解为几个简单部分了。Erosion is also used to simplify the structure of objects - those objects or parts of objects that are only one pixel wide will be removed. This breaks down more complex objects into simpler parts.
选择图像腐蚀次数:承接上文对图像进行了二值化和膨胀之后,图像该有的“伤疤”特征有所削弱。尤其是滚子表面“孤岛”式的“伤疤”,很可能因为对白膨胀之后,这样的“孤岛伤疤”变得很小的一点;这样不利于接下来对图像进行边缘提取。Select the number of times of image erosion: After the binarization and expansion of the image are carried out above, the "scar" feature that the image should have is weakened. Especially the "island" type "scar" on the surface of the roller, it is likely that after the dialogue is expanded, such "island scar" becomes smaller; this is not conducive to the subsequent edge extraction of the image.
在二值化阈值设定为130,并经1次图像膨胀之后,再对图像进行不同次数的图像腐蚀After the binarization threshold is set to 130 and the image is expanded once, the image is corroded for different times.
对图像的白色进行腐蚀的目的,是为了凸显“伤疤”。但要注意腐蚀次数不宜过多,过多的腐蚀次数会导致“伤疤”对轴承滚子截面本身的内外圈造成影响。另外,腐蚀和膨胀不是互逆变换——若先对一幅图像进行腐蚀,然后再膨胀,得到的不是原始图像。结果图像会比原始图像更简单,一些细节被去掉了。The purpose of etching the white of the image is to highlight the "scar". However, it should be noted that the number of times of corrosion should not be too much. Too many times of corrosion will cause "scars" to affect the inner and outer rings of the bearing roller section itself. In addition, erosion and dilation are not reciprocal transformations - if you first erode an image and then dilate it, you will not get the original image. The resulting image will be simpler than the original, with some details removed.
先腐蚀在膨胀是一个重要的形态学变换,称为开运算(opening)。图像X关于结构元素B的开运算记为XοB,定义为Erosion first and then expansion is an important morphological transformation called opening. The opening operation of image X with respect to structural element B is denoted as XοB, defined as
先膨胀再腐蚀称为闭运算(closing)。图像X关于结构元素B的闭运算记为X·B,定义为Dilation followed by erosion is called closing. The closing operation of image X with respect to structural element B is denoted as X·B, defined as
根据上文所描述的,本发明中用到的实为开运算,而在使用这两个变换时,是先膨胀再腐蚀的。这里需要注意的是膨胀或者腐蚀的对象问题,对白色做膨胀相当于对黑色做腐蚀。所以在具体选用开运算还是闭运算时,可经试验再确定。According to the above description, the opening operation used in the present invention is actually an opening operation, and when using these two transformations, the expansion is performed first and then corroded. What needs to be paid attention to here is the object of expansion or corrosion. Expansion of white is equivalent to corrosion of black. Therefore, when choosing whether to open or close the operation, it can be determined through experiments.
Canny边缘提取:Canny edge extraction:
Canny提出了一种新的边缘检测方法,它对受白噪声影响的阶跃型边缘是最优的。Canny检测子的最优性与以下的三个标准有关:Canny proposed a new edge detection method, which is optimal for step-type edges affected by white noise. The optimality of the Canny detector is related to the following three criteria:
检测标准:不丢失重要的边缘,不应有虚假的边缘。Detection criteria: no important edges are lost, and there should be no spurious edges.
定位标准:实际边缘与检测到的边缘位置之间的偏差最小。Positioning criterion: The deviation between the actual edge and the detected edge position is minimal.
单响应标准:将过个响应降低为单个边缘响应。这一点被第一个标准部分地覆盖了,因为当有两个响应对应于单个边缘时,其中之一应该被认为是虚假的。这第三个标准解决受噪声影响的边缘问题,起抵制非平滑边缘检测子的作用。Single Response Criterion: Reduce past responses to a single marginal response. This point is partially covered by the first criterion, since when there are two responses corresponding to a single edge, one of them should be considered spurious. This third criterion addresses the problem of edges affected by noise, acting against non-smooth edge detectors.
可发现如果两块黑色区域靠的很近时(间距只有一个像素点),此时对其进行Canny边缘提取会导致其边缘的间断。这样破坏了原本轴承滚子表面内外圈的连续性。倒推至图像腐蚀,可以发现主要影响这种现象的主要原因是腐蚀次数。腐蚀次数越多,黑色块面积增大而距离拉近;所以在选择图像腐蚀次数时要考虑到接下来的Canny边缘提取,减小影响。It can be found that if two black areas are very close (the distance is only one pixel), the Canny edge extraction will result in the discontinuity of the edge. This destroys the continuity of the inner and outer rings on the original bearing roller surface. Pushing back to image corrosion, it can be found that the main reason that mainly affects this phenomenon is the number of corrosions. The more times of corrosion, the larger the area of the black block and the closer the distance; so when selecting the number of image corrosions, the next Canny edge extraction should be considered to reduce the impact.
通过预处理之后,需要对图像进行特征点提取步骤,该特征点提取步骤主要包括标准件的特征点提取步骤和被测件的特征点提取步骤,其中标准件由于其基本选用合格的成品进行拍摄,所以其在捕捉目标零件步骤记录数据进行存储后,在本特征点提取步骤中进行扫点,其通过扫点后计算获取内外圆面积以及内圆面积数据,并作为标准数据存储,而被测件则需要在特征点提取步骤中,经过扫点后,依次通过内外圆断点判断、内外圆走势判断、内外圆面积与内圆面积误差判断步骤进行判定其是否为合格件。After the preprocessing, it is necessary to perform a feature point extraction step on the image. The feature point extraction step mainly includes the feature point extraction step of the standard part and the feature point extraction step of the tested part. The standard part basically uses qualified finished products for shooting. , so after storing the recorded data in the step of capturing the target part, it scans the points in the feature point extraction step, and calculates and obtains the data of the inner and outer circle area and the inner circle area after scanning the points, and stores them as standard data, while the measured Parts need to be in the feature point extraction step, after scanning points, then through the inner and outer circle breakpoint judgment, inner and outer circle trend judgment, inner and outer circle area and inner circle area error judgment steps to determine whether it is a qualified part.
由图像或波形所获得的数据量是相当大的。例如,一个文字图像可以有几千个数据,一个心电图波形也可能有几千个数据,一个卫星遥感图像的数据量就更大。为了有效地实现分类识别,就要对原始数据进行变换,得到最能反映分类本质的特征。这就是特征提取和选择的过程。本发明的特征提取步骤如下:The amount of data obtained from images or waveforms is considerable. For example, a text image may have thousands of data, an electrocardiogram waveform may also have thousands of data, and a satellite remote sensing image may have a larger amount of data. In order to realize classification recognition effectively, it is necessary to transform the original data to obtain the features that can best reflect the essence of classification. This is the process of feature extraction and selection. The feature extraction steps of the present invention are as follows:
捕捉目标零件:Snap target part:
捕捉目标零件这一过程主要是为了缩小检测的范围,减少计算的数据量。因为待提取特征值的图像较为简单,颜色为单一的黑白色;本发明的捕捉目标零件主要分两个步骤:The process of capturing target parts is mainly to narrow the scope of detection and reduce the amount of calculated data. Because the image of the feature value to be extracted is relatively simple, the color is a single black and white; the capture target part of the present invention is mainly divided into two steps:
粗定位:将目标轴承滚子框在粗略的正方形框内;Coarse positioning: frame the target bearing roller in a rough square frame;
因为轴承滚子每次到达摄像头5下的位子大致固定,仅有微小的偏差;所以大可为了减少计算量,人为的选择感兴趣的区域。Because the position of the bearing roller under the camera 5 is roughly fixed each time, there is only a slight deviation; so in order to reduce the amount of calculation, the area of interest can be artificially selected.
精确定位:将目标轴承滚子框在最小的矩形框内;Precise positioning: frame the target bearing roller in the smallest rectangular frame;
通过步骤一很大程度上缩小了待处理图像的面积:The area of the image to be processed is greatly reduced through the steps:
步骤二是在步骤一的基础上,扫点来获得轴承滚子的最左端、最右端、最上端和最下端。这样能将轴承滚子框在最小的矩阵中。Step 2 is to scan points on the basis of step 1 to obtain the leftmost, rightmost, uppermost and lowermost ends of the bearing rollers. This enables the bearing rollers to be framed in a minimal matrix.
在捕捉目标零件步骤之后,再通过预处理(以上确定的数据依次进行阈值二值化数据、图像膨胀系数数据、图像腐蚀系数数据、Canny边缘提取数据操作)之后,就可以进行特征点确定,以最终确定被测件是否合格。After the step of capturing the target part, after preprocessing (the data determined above are sequentially operated on the threshold value binarization data, image expansion coefficient data, image corrosion coefficient data, and Canny edge extraction data), the feature points can be determined. Finally determine whether the tested part is qualified.
特征点确定:Feature point determination:
特征点即为最能够说明该物体的特征,需要有代表性,同时也要保证能够方便得到。在本发明中初设定3种特征点,如下文介绍:The feature point is the feature that can best explain the object, and it needs to be representative, and at the same time, it must be easy to obtain. Initially set 3 kinds of characteristic points in the present invention, introduce as follows:
特征点1:内外圈是否有断点:Feature point 1: Whether there are breakpoints in the inner and outer rings:
经图像预处理(根据拍摄图像的质量进行预处理数据的确定,在实施例中,采用的是二值化阈值为130,膨胀次数为1次,腐蚀次数为1次)之后的图像。若为标准件,轴承滚子的内外圈不会出现间断现象。出现间断点的情况仅可能发生在两个黑色块距离很近的时候,或者弯曲角度成锐角(尖端)容易出现断点现象。所以可以使用这一特征点来进行判断被测物是否为标准件。即根据特征点1,可获得2维特征量——外圈是否有断点和内圈是否有断点。The image after image preprocessing (preprocessing data is determined according to the quality of the captured image, in the embodiment, the binarization threshold is 130, the number of dilation is 1, and the number of erosion is 1). If it is a standard part, there will be no discontinuity in the inner and outer rings of the bearing rollers. The occurrence of discontinuities may only occur when two black blocks are very close to each other, or when the bending angle is at an acute angle (tip), discontinuities are prone to occur. Therefore, this feature point can be used to judge whether the measured object is a standard part. That is, according to feature point 1, a 2-dimensional feature quantity can be obtained——whether there is a breakpoint in the outer circle and whether there is a breakpoint in the inner circle.
特征点2:内外圈的走势是否符合圆形:Feature point 2: Whether the trend of the inner and outer rings conforms to a circle:
这个特征点显而易见,如果为非标准件(一般为黑色块与内外圈粘连)时,沿着边缘走时,会有较明显的内弯现象。在实际应用中,并不能100%的判断出是否为走势有误,能被判断出来的只是个别走势错误的。一旦能判断出来走势是错误的,可以跳过后续的判断直接断定该轴承滚子为次残品,可以减少总体的计算量。即特征点2,也可获得2维特征量——外圈走势是否正确和内圈走势是否正确。This characteristic point is obvious. If it is a non-standard part (generally, the black block is glued to the inner and outer rings), when walking along the edge, there will be a more obvious inward bending phenomenon. In practical applications, it is impossible to judge 100% whether the trend is wrong, and what can be judged is only a few wrong trends. Once it can be judged that the trend is wrong, the subsequent judgment can be skipped and it can be directly concluded that the bearing roller is a substandard product, which can reduce the overall calculation amount. That is, the feature point 2 can also obtain the 2-dimensional feature quantity—whether the trend of the outer circle is correct and whether the trend of the inner circle is correct.
特征点3:外圈与内圈之间的面积和内圈的面积:Feature point 3: the area between the outer ring and the inner ring and the area of the inner ring:
该特征点有三个目的:This feature point serves three purposes:
1、弥补特征点2遗漏下来的漏洞;1. Make up for the loopholes missed by feature point 2;
对于内外圈如果有向内凹陷或者向外凸出,其面积会有最直接的变化。这样可以弥补特征点2不能100%检测出走势错误的漏洞。两者的配合,既可以提高程序的工作效率,又可以提高精确度。If the inner and outer rings are concave inward or protruding outward, the area will have the most direct change. This can make up for the loophole that feature point 2 cannot 100% detect trend errors. The cooperation of the two can not only improve the working efficiency of the program, but also improve the accuracy.
2、剔除倒圆角不符合标准(这样的轴承滚子外圈会比标准件小)的轴承滚子;2. Eliminate the bearing rollers whose round corners do not meet the standard (the outer ring of such bearing rollers will be smaller than the standard parts);
在检测轴承滚子倒圆角是否符合标准时,要比人眼更加精准。一旦标准件的各个特征点确定了,即外圈和内圈间的面积确定的前提下,倒圆角不标准的轴承滚子面积相比之下会小。It is more accurate than human eyes when detecting whether the rounding of bearing rollers meets the standard. Once the various feature points of the standard parts are determined, that is, under the premise that the area between the outer ring and the inner ring is determined, the area of the bearing rollers with non-standard rounded corners will be relatively small.
3、剔除在外圈和内圈之间有黑块(次残品)的轴承滚子;3. Remove bearing rollers with black blocks (substandard products) between the outer ring and inner ring;
除了要考虑与内外圆相粘连的黑块,还要考虑孤立的黑块,它同样是“伤疤”。In addition to considering the black blocks that are glued to the inner and outer circles, isolated black blocks are also considered, which are also "scars".
这种面试与距离测试对比时,考虑到如果选择用每个点的距离与标准件进行比较,误差太小而体现不出区别。而用面积作为特征点的话,相当于将距离的误差进行了累加——误差得到了放大。When comparing this kind of interview with the distance test, it is considered that if you choose to compare the distance of each point with the standard part, the error is too small to reflect the difference. Using the area as a feature point is equivalent to accumulating the error of the distance—the error is magnified.
根据特征点3,又确定了2维的特征量。According to the feature point 3, a 2-dimensional feature quantity is determined.
总共定下的特征量一共是6维,分别是:外圈是否有断点;内圈是否有断点;外圈走势是否正确;内圈走势是否正确;外圈与内圈间的面积是否符合标准;内圈的面积是否符合标准。The total set feature quantity is 6 dimensions, namely: whether there is a breakpoint in the outer circle; whether there is a breakpoint in the inner circle; whether the trend of the outer circle is correct; whether the trend of the inner circle is correct; whether the area between the outer circle and the inner circle conforms Standard; whether the area of the inner ring meets the standard.
以上所述的进行扫点步骤的时候,为了实现最佳的工作效率,本发明采用如下的扫点顺序:When performing the above-mentioned scan point step, in order to achieve the best work efficiency, the present invention adopts the following scan point sequence:
在扫点时将整个轴承滚子均分成4份,每份为圆。扫点的起始点为其中的对称的两个像素点。将其中一个像素点作为左上和左下两个圆的起点,左上向上寻找边缘点,左下向下寻找边缘点;将与其对应的另外一个像素点作为右上和右下两个圆的起点。Divide the entire bearing roller into 4 parts when sweeping, each part is round. The starting point of the scanning point is two symmetrical pixels. Take one of the pixels as the upper left and lower left two The starting point of the circle, look for the edge point from the upper left, and look for the edge point from the lower left; use another pixel corresponding to it as the upper right and lower right The starting point of the circle.
分块扫描有如下两个优点:1.保证了左上和右上的圆扫点趋势主要均为向上,左下和右下的圆扫点趋势主要均为向下;可以在智能化操作中,简化其软件编程,减少出现错误的概率。2.凡是遇到断点或趋势错误的情况及跳出扫点,提高了本发明的工作效率。Block scanning has the following two advantages: 1. Guaranteed the upper left and upper right The trend of circular sweep points is mainly upward, lower left and lower right The trend of circular scanning points is mainly downward; in intelligent operation, its software programming can be simplified and the probability of errors can be reduced. 2. In case of encountering a breakpoint or trend error and jumping out of the scanning point, the work efficiency of the present invention is improved.
而为了适应圆弧的弧线走势,在圆弧的不同阶段扫点的顺序也需要有所变化。因为圆弧的趋势比较平缓,趋势的不同主要体现在圆弧的头尾两端,所以大致可分成两个阶段。将两个阶段的“分水岭”粗略设定为点(左上角半圆的横向距离/2,y)。根据取点方式,下文中均以“中间点”代表该点。In order to adapt to the arc trend of the arc, the order of scanning points at different stages of the arc also needs to be changed. Because the trend of the arc is relatively flat, the difference in trend is mainly reflected in the beginning and end of the arc, so it can be roughly divided into two stages. The "watershed" of the two stages is roughly set as the point (lateral distance of the upper left semicircle/2, y). According to the point selection method, the point will be represented by "intermediate point" in the following.
譬如在扫描左上的圆时,扫描点刚开始扫描时,圆弧以向上为主要趋势;当扫描点过了中间点,圆弧趋势以右为主。这种扫点方法可以避免当扫点到达一个像素,以一般的顺序寻找下一个扫描点时,会因为找不到符合条件的点而把它误判为弧线出现了断点,这样的误判无疑是一个很大的漏洞。而通过以上方法进行扫点,则可以避免这样的误判。For example, in the upper left of the scan When the scanning point is circular, when the scanning point just starts to scan, the main trend of the arc is upward; when the scanning point passes the middle point, the main trend of the arc is to the right. This point scanning method can avoid that when the scanning point reaches a pixel and searches for the next scanning point in a general order, it will be misjudged as a breakpoint of the arc because no qualified point can be found. Such a misjudgment Undoubtedly a big loophole. By scanning points through the above methods, such misjudgments can be avoided.
以上所述的内外圆之间的面积计算如下:The area between the inner and outer circles described above is calculated as follows:
在扫外轮廓的过程中,由当前的扫描点向内圆方向沿纵坐标寻找穿过黑色区域(指的是没边缘区域)后的边缘点(该边缘点即白点,其为内边缘点,对于不合格件,由于中间会出现黑色块等缺陷,所以其检测到黑色块轮廓的时候,其并不是真正的边缘点,但被误认为是边缘点),该点与外轮廓上的扫描点的纵坐标进行作差;外轮廓的扫描点继续扫点,以同样的方法再计算差值;将这些差值累加,即为内外圆间的面积;In the process of scanning the outer contour, from the current scanning point to the inner circle direction along the ordinate to find the edge point after passing through the black area (referring to the area without edge) (the edge point is the white point, which is the inner edge point , for unqualified parts, because there will be defects such as black blocks in the middle, when it detects the outline of black blocks, it is not a real edge point, but it is mistaken for an edge point), this point is consistent with the scan on the outer contour The vertical coordinates of the points are subtracted; the scanning points of the outer contour continue to scan points, and the difference is calculated in the same way; these differences are accumulated, which is the area between the inner and outer circles;
以上所述的内圆的面积计算:Calculate the area of the inner circle described above:
在扫内轮廓的过程中,累加扫描点的纵坐标,即为内圆的面积。In the process of scanning the inner contour, the ordinate of the scanning point is accumulated, which is the area of the inner circle.
通过这种面积的计算,由于外圆变形、内圆变形或者内圆无法准确被识别,所以其扫点结束后,面积计算结果与标准件会出现偏差,根据这个偏差即可以确定是否是合格件。Through this area calculation, since the outer circle deformation, inner circle deformation or inner circle cannot be accurately identified, after the scanning point is completed, the area calculation result will deviate from the standard part, and it can be determined whether it is a qualified part according to this deviation .
最后,还需要注意的是,以上列举的仅是本发明的一个具体实施例。显然,本发明不限于以上实施例,还可以有许多变形。本领域的普通技术人员能从本发明公开的内容直接导出或联想到的所有变形,均应认为是本发明的保护范围。Finally, it should also be noted that what is listed above is only a specific embodiment of the present invention. Obviously, the present invention is not limited to the above embodiments, and many variations are possible. All deformations that can be directly derived or associated by those skilled in the art from the content disclosed in the present invention should be considered as the protection scope of the present invention.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510346247.3A CN104966300B (en) | 2015-06-19 | 2015-06-19 | Bearing roller image detecting system and method and image detection device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510346247.3A CN104966300B (en) | 2015-06-19 | 2015-06-19 | Bearing roller image detecting system and method and image detection device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104966300A CN104966300A (en) | 2015-10-07 |
CN104966300B true CN104966300B (en) | 2017-09-12 |
Family
ID=54220331
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510346247.3A Expired - Fee Related CN104966300B (en) | 2015-06-19 | 2015-06-19 | Bearing roller image detecting system and method and image detection device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104966300B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107818292B (en) * | 2016-09-14 | 2021-04-09 | 中国石油化工股份有限公司 | Mineral particle identification method and system based on back scattering scanning electron microscope |
CN106775749B (en) * | 2016-12-29 | 2019-11-05 | 东软集团股份有限公司 | The processing method and processing device of image |
CN107492093B (en) * | 2017-07-20 | 2019-12-10 | 浙江大学 | Bearing anomaly detection method based on image processing |
CN108956618B (en) * | 2018-06-25 | 2020-08-11 | 衢州学院 | A surface detection method of tapered roller bearing based on frequency domain vision |
CN108776171A (en) * | 2018-09-12 | 2018-11-09 | 中国计量大学 | Steel wire rope nondestructive inspection sensing device based on multiloop excitation and image analysis |
CN110595779B (en) * | 2019-04-26 | 2021-10-12 | 深圳市豪视智能科技有限公司 | Bearing abnormity detection method and related equipment |
CN110189322B (en) * | 2019-06-04 | 2021-11-19 | 广州视源电子科技股份有限公司 | Flatness detection method, device, equipment, storage medium and system |
CN111275671A (en) * | 2020-01-15 | 2020-06-12 | 江苏众远智能装备有限公司 | A method for visual recognition of robots with 3D technology |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008045957A (en) * | 2006-08-11 | 2008-02-28 | Jtekt Corp | Visual inspection device of bearing roll |
CN101526484A (en) * | 2009-04-13 | 2009-09-09 | 江南大学 | Bearing defect detecting technique based on embedded-type machine vision |
CN201436584U (en) * | 2009-07-23 | 2010-04-07 | 沈阳天嘉科技有限公司 | Needle bearing shortage detecting device |
CN102636490A (en) * | 2012-04-12 | 2012-08-15 | 江南大学 | Method for detecting surface defects of dustproof cover of bearing based on machine vision |
CN103868924A (en) * | 2012-12-18 | 2014-06-18 | 江南大学 | Bearing appearance defect detecting algorithm based on visual sense |
-
2015
- 2015-06-19 CN CN201510346247.3A patent/CN104966300B/en not_active Expired - Fee Related
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008045957A (en) * | 2006-08-11 | 2008-02-28 | Jtekt Corp | Visual inspection device of bearing roll |
CN101526484A (en) * | 2009-04-13 | 2009-09-09 | 江南大学 | Bearing defect detecting technique based on embedded-type machine vision |
CN201436584U (en) * | 2009-07-23 | 2010-04-07 | 沈阳天嘉科技有限公司 | Needle bearing shortage detecting device |
CN102636490A (en) * | 2012-04-12 | 2012-08-15 | 江南大学 | Method for detecting surface defects of dustproof cover of bearing based on machine vision |
CN103868924A (en) * | 2012-12-18 | 2014-06-18 | 江南大学 | Bearing appearance defect detecting algorithm based on visual sense |
Non-Patent Citations (1)
Title |
---|
基于图像处理的轴承防尘盖表面缺陷检测研究;张扬;《中国优秀硕士学位论文全文数据库工程科技Ⅱ辑》;20100815;第13-15页 * |
Also Published As
Publication number | Publication date |
---|---|
CN104966300A (en) | 2015-10-07 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104966300B (en) | Bearing roller image detecting system and method and image detection device | |
CN103063159B (en) | Part size measurement method based on charge coupled device (CCD) | |
CN113252568A (en) | Lens surface defect detection method, system, product and terminal based on machine vision | |
CN105894036A (en) | Image feature template matching method being applied to detection of mobile phone screen defects | |
CN104093016A (en) | Method and system for detecting contamination of camera module | |
CN101532926A (en) | On-line vision detecting system for automatic impact specimen processing device and image processing method thereof | |
CN105974120B (en) | A C-reactive protein chromaticity automatic detection device and method | |
CN110660072B (en) | Method and device for identifying straight line edge, storage medium and electronic equipment | |
CN109584215A (en) | Online visual inspection system of circuit board | |
Li et al. | Hardware-oriented algorithm for high-speed laser centerline extraction based on Hessian matrix | |
CN113705564B (en) | Pointer type instrument identification reading method | |
WO2020243992A1 (en) | Groove defect detection method and device | |
CN107194916A (en) | A kind of vision measurement system of feature based Point matching | |
CN116777877A (en) | Circuit board defect detection method, device, computer equipment and storage medium | |
CN119091236B (en) | Ceramic packaging substrate detection method and system based on visual inspection and meta-learning | |
CN108364306A (en) | A kind of vision real-time detection method of high speed periodic motion | |
CN106529455A (en) | Fast human posture recognition method based on SoC FPGA | |
CN110426395A (en) | A kind of solar energy EL cell silicon chip surface inspecting method and device | |
Lin et al. | A tiny defect detection system for tire mold surfaces based on consecutive frames | |
CN109741302B (en) | SD card form recognition system and method based on machine vision | |
CN111507177B (en) | Identification method and device for metering turnover cabinet | |
Gong et al. | An improved Canny algorithm based on adaptive 2D-Otsu and Newton Iterative | |
Zhang et al. | IDDM: An incremental dual-network detection model for in-situ inspection of large-scale complex product | |
CN117876331A (en) | A surface defect detection and quantification method based on photometric stereo vision | |
Hao et al. | An image-based hairline crack identification method for metal parts |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20170912 Termination date: 20190619 |