[go: up one dir, main page]

CN110308153A - Metal workpiece defect detection method, system, storage medium, and device based on monocular stereo vision - Google Patents

Metal workpiece defect detection method, system, storage medium, and device based on monocular stereo vision Download PDF

Info

Publication number
CN110308153A
CN110308153A CN201910714364.9A CN201910714364A CN110308153A CN 110308153 A CN110308153 A CN 110308153A CN 201910714364 A CN201910714364 A CN 201910714364A CN 110308153 A CN110308153 A CN 110308153A
Authority
CN
China
Prior art keywords
light source
metal workpiece
workpiece
detected
image
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.)
Pending
Application number
CN201910714364.9A
Other languages
Chinese (zh)
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.)
Guangxi Normal University
Original Assignee
Guangxi Normal University
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 Guangxi Normal University filed Critical Guangxi Normal University
Priority to CN201910714364.9A priority Critical patent/CN110308153A/en
Publication of CN110308153A publication Critical patent/CN110308153A/en
Pending legal-status Critical Current

Links

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B07SEPARATING SOLIDS FROM SOLIDS; SORTING
    • B07CPOSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
    • B07C5/00Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
    • B07C5/34Sorting according to other particular properties
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B07SEPARATING SOLIDS FROM SOLIDS; SORTING
    • B07CPOSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
    • B07C5/00Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
    • B07C5/36Sorting apparatus characterised by the means used for distribution
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/01Arrangements or apparatus for facilitating the optical investigation
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8806Specially adapted optical and illumination features
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8887Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges based on image processing techniques

Landscapes

  • Chemical & Material Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Pathology (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Immunology (AREA)
  • Biochemistry (AREA)
  • Analytical Chemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Signal Processing (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

本发明公开了一种基于单目立体视觉的金属工件缺陷检测方法,用于对待测金属工件进行缺陷检查,包括以下步骤:步骤S1:以待测金属工件为中心,以至少三个方位上设置光源并进行光源方向标定,以得到每个方位下的最终光源方向向量;及步骤S2:预设模板工件,获取待测金属工件和所述模板工件在至少三个方位最终光源方向向量下的图像;采用光度立体视觉的原理对图像进行数值化且处理对比分析,以判断待测金属工件是否存在缺陷。基于上述方法,本发明还提供一种系统;本发明还提供一种存储介质;本发明还提供一种装置。

The invention discloses a metal workpiece defect detection method based on monocular stereo vision, which is used for defect inspection of the metal workpiece to be tested, comprising the following steps: Step S1: centering on the metal workpiece to be tested, setting Light source and perform light source direction calibration to obtain the final light source direction vector in each orientation; and step S2: preset template workpiece, and obtain images of the metal workpiece to be tested and the template workpiece in at least three orientations under the final light source direction vector ; Use the principle of photometric stereo vision to digitize the image and process it for comparative analysis to determine whether there is a defect in the metal workpiece to be tested. Based on the above method, the present invention also provides a system; the present invention also provides a storage medium; and the present invention also provides a device.

Description

基于单目立体视觉的金属工件缺陷检测方法、系统、存储介 质、以及装置Metal workpiece defect detection method, system and storage medium based on monocular stereo vision quality, and device

【技术领域】【Technical field】

本发明涉及智能化补光领域,具体涉及一种基于单目立体视觉的金属工件缺陷检测方法、系统、存储介质、以及装置。The invention relates to the field of intelligent supplementary light, in particular to a metal workpiece defect detection method, system, storage medium, and device based on monocular stereo vision.

【背景技术】【Background technique】

金属工件是日常工业生产中的基础部件,主要是指以金属材料来制造的各种规格与形状的金属块、金属棒、金属管等的合称,但是金属工件的质量问题是我国一直很重视的问题,目前,国内多数生产厂家仍采用人工目视的方式对钢珠进行检测,大量的检测人员在白炽灯下用目视的方法对钢珠进行检测,并对其进行简单的分选,这种检测方法依赖于检测人员的经验和责任心,劳动强度大,工作效率低,长时间重复作业易引起视觉疲劳,检测结果随意性大,因此利用机器视觉来检测金属工件的缺陷的技术应运而生;Metal workpieces are the basic components in daily industrial production, mainly referring to metal blocks, metal rods, metal pipes, etc. of various specifications and shapes made of metal materials, but the quality of metal workpieces has always been attached great importance to in our country. At present, most domestic manufacturers still use manual visual inspection to detect steel balls, and a large number of inspectors use visual methods to detect steel balls under incandescent lamps and perform simple sorting on them. The detection method relies on the experience and sense of responsibility of the inspectors. It is labor-intensive and low-efficiency. Repeated operations for a long time can easily cause visual fatigue, and the detection results are random. Therefore, the technology of using machine vision to detect defects in metal workpieces emerged as the times require. ;

而现今技术中,机器视觉检测金属工件的缺陷面临的突破点无非在于两点:第一点是由于表面缺陷是随机分布在金属工件上,如何获取金属工件全方位的高清图像的问题;第二是由于金属的特性或者后处理抛光的效果下,金属工件的表面反光率相当高,导致采集图像时亮度分布不均,从而经常淹没所要检测的缺陷信息,比如在采集金属工件的图像时,由经常存在一些过亮的光斑或者过暗的黑块,使得缺陷信息在检测过程中不准确,那么如何找到合适的图像采集的光源方向的问题;In today's technology, the breakthroughs faced by machine vision detection of metal workpiece defects are nothing more than two points: the first point is how to obtain a full range of high-definition images of metal workpieces because surface defects are randomly distributed on metal workpieces; second Due to the characteristics of the metal or the effect of post-processing and polishing, the surface reflectance of the metal workpiece is quite high, resulting in uneven brightness distribution when collecting images, which often submerges the defect information to be detected. For example, when collecting images of metal workpieces, by There are often some too bright light spots or too dark black blocks, which makes the defect information inaccurate during the detection process, so how to find a suitable light source direction for image acquisition;

上述两点问题都是普遍在金属工件的应用中,图像识别技术重点关注且急需解决的。The above two problems are common in the application of metal workpieces, and image recognition technology focuses on and needs to be solved urgently.

【发明内容】【Content of invention】

为克服上述问题,本发明提供一种基于单目立体视觉的金属工件缺陷检测方法。In order to overcome the above problems, the present invention provides a metal workpiece defect detection method based on monocular stereo vision.

本发明提供一技术方案如下:本发明提供一种基于单目立体视觉的金属工件缺陷检测方法,用于对待测金属工件进行缺陷检查,包括以下步骤:步骤S1:以待测金属工件为中心,以至少三个方位上进行光源方向标定,以得到每个方位下的最终光源方向向量;及步骤S2:预设模板工件,获取待测金属工件和模板工件在至少三个方位最终光源方向向量下的图像;采用光度立体视觉的原理对图像进行数值化且处理对比分析,以判断待测金属工件是否存在缺陷。The present invention provides a technical solution as follows: The present invention provides a metal workpiece defect detection method based on monocular stereo vision, which is used for defect inspection of the metal workpiece to be tested, including the following steps: Step S1: centering on the metal workpiece to be tested, Calibrate the direction of the light source in at least three directions to obtain the final direction vector of the light source in each direction; and step S2: preset the template workpiece, and obtain the metal workpiece to be tested and the template workpiece under the final light source direction vector in at least three directions The image; the principle of photometric stereo vision is used to digitize the image and process it for comparative analysis to determine whether there is a defect in the metal workpiece to be tested.

优选地,步骤S1中以待测金属工件为中心,以至少三个方位上进行光源方向标定,以得到每个方位下的最终光源方向向量,具体包括以下步骤:步骤S11:在至少三个方位中的每个方位设置光源;从而得到至少三个方位的光源,引入标定球分别在每个方位的光源照射范围内等间距摆放五次,对所有方位上的光源下的所述标定球进行采集,从而得到至少15副标定球图像;步骤S12:识别每个标定球图像中的标定球的中心点和高光点,并计算中心点和高光点的空间位置关系;将标定球视为正交投影模型并结合光度立体视觉原理,从而计算得到每个方位下的光源方向向量;及步骤S13:通过每个标定球图像得到的光源方向向量,使用最小二乘法求得每个方位下的最终光源方向向量。Preferably, in step S1, centering on the metal workpiece to be tested, the direction of the light source is calibrated in at least three directions to obtain the final direction vector of the light source in each direction, which specifically includes the following steps: Step S11: in at least three directions Set the light source in each orientation; thus obtain the light source in at least three orientations, introduce the calibration ball and place it at equal intervals five times in the light source irradiation range of each orientation, and carry out the calibration ball under the light source in all orientations. Acquisition, thus at least 15 pairs of calibration ball images are obtained; step S12: identify the center point and highlight point of the calibration ball in each calibration ball image, and calculate the spatial position relationship between the center point and the highlight point; regard the calibration ball as orthogonal The projection model is combined with the principle of photometric stereo vision to calculate the light source direction vector in each orientation; and step S13: use the least squares method to obtain the final light source in each orientation through the light source direction vector obtained from each calibration ball image direction vector.

优选地,步骤S2中,预设模板工件,获取待测金属工件和模板工件在至少三个方位最终光源方向向量下的图像;采用光度立体视觉的原理对图像进行数值化且处理对比分析,以判断待测金属工件是否存在缺陷,具体包括以下步骤:步骤S21:获取待测金属工件和预设的模板工件在至少三个最终光源方向向量下的至少3幅图像;步骤S22:根据步骤S21获得的图像,利用基于正交投影模型下的 Phong模型,求得待测金属工件的表面法向量并分别建立梯度图,将梯度图进行高斯转换得到曲率图,且对曲率图进行形态学处理;及步骤S23:将待测金属工件已经过形态学处理的曲率图进行Bolb分析,以输出待测金属工件是否存在缺陷的结果。Preferably, in step S2, the template workpiece is preset, and the images of the metal workpiece to be tested and the template workpiece in at least three orientations under the final light source direction vector are obtained; the image is digitized and processed for comparison and analysis by using the principle of photometric stereo vision to Judging whether there is a defect in the metal workpiece to be tested specifically includes the following steps: Step S21: Obtain at least 3 images of the metal workpiece to be tested and the preset template workpiece under at least three final light source direction vectors; Step S22: Obtain according to step S21 Using the Phong model based on the orthogonal projection model, the surface normal vector of the metal workpiece to be tested is obtained and the gradient map is respectively established, and the gradient map is Gaussian transformed to obtain the curvature map, and the curvature map is morphologically processed; and Step S23: Bolb analysis is performed on the morphologically processed curvature map of the metal workpiece to be tested, so as to output whether there is a defect in the metal workpiece to be tested.

优选地,进一步包括步骤S3,具体包括以下步骤:Preferably, step S3 is further included, specifically including the following steps:

步骤S3:根据步骤S2的结果,采用机械手臂将对待测金属工件分类抓取。Step S3: According to the result of step S2, the metal workpieces to be tested are sorted and grasped by the mechanical arm.

为更好的解决上述问题,本发明又提出另一方案如下,一种基于单目立体视觉的金属工件缺陷检测系统,用于对待测金属工件进行缺陷检查,包括:In order to better solve the above problems, the present invention proposes another solution as follows, a metal workpiece defect detection system based on monocular stereo vision, which is used for defect inspection of the metal workpiece to be tested, including:

发射模块:用于从至少三个方位对待测金属工件发射光线;Emitting module: used to emit light from at least three directions of the metal workpiece to be tested;

采集模块:用于采集待测金属工件在发射模块照射下的图像;Acquisition module: used to collect the image of the metal workpiece to be tested under the irradiation of the emission module;

处理模块:用于计算发射模块在八个方位中每个方位对金属工件的最终光源方向向量,以及判断待测金属工件是否存在缺陷;Processing module: used to calculate the final light source direction vector of the emission module to the metal workpiece in each of the eight orientations, and to determine whether the metal workpiece to be tested has defects;

执行模块:将待测金属工件进行分类;Execution module: classify the metal workpiece to be tested;

控制模块:根据处理模块的结果,用于控制发射模块和执行模块进行相应的动作。Control module: according to the result of the processing module, it is used to control the launch module and the execution module to perform corresponding actions.

为更好的解决上述问题,本发明又提出另一方案如下,一种存储介质,该存储介质或者处理器存储有计算机程序,存储介质程序运行时,控制储存介质或者处理器需执行的计算机程序需执行包括上述的基于单目立体视觉的金属工件缺陷检测方法。In order to better solve the above problems, the present invention proposes another solution as follows, a storage medium, the storage medium or the processor stores a computer program, and when the storage medium program is running, the computer program to be executed by the storage medium or the processor is controlled It is necessary to implement the metal workpiece defect detection method based on the above-mentioned monocular stereo vision.

为更好的解决上述问题,本发明又提出另一方案如下,一种基于单目立体视觉的金属工件缺陷检测装置,用于对待测金属工件进行缺陷检查,其包括相机、光源、圆形光源控制器、载物台、工控机以及计算机;所述工控机和所述相机、光源、圆形光源控制器、载物台、计算机均电性连接,所述光源和所述相机均位于所述圆形光源控制器朝向所述载物台的一面上,且所述相机位于圆形光源控制器的中心位置,所述载物台可放置待测金属元件,其中所述光源以所述相机为中心呈环形均匀分布,所述光源为至少三个,从而以至少三个方位发射光线以使光线完全覆盖待测金属工件;当待测金属工件置于所述载物台上时,所述工控机控制所述圆形光源控制器开始响应,所述圆形光源控制器可控制各个所述光源依次单独亮;在每个所述光源单独亮时所述相机每次都采集一张图像传输至所述计算机分析,从而找到每个方位下的最终光源方向向量;其中,所述计算机对图像进行分析时,需要使用到权利要求1中所述步骤S1的方法。In order to better solve the above problems, the present invention proposes another solution as follows, a metal workpiece defect detection device based on monocular stereo vision, which is used for defect inspection of the metal workpiece to be tested, which includes a camera, a light source, a circular light source controller, stage, industrial computer and computer; the industrial computer is electrically connected to the camera, light source, circular light source controller, stage, and computer, and the light source and the camera are located at the On the side of the circular light source controller facing the stage, and the camera is located at the center of the circular light source controller, the metal component to be tested can be placed on the stage, wherein the light source is based on the camera The center is evenly distributed in a ring shape, and the light sources are at least three, so that light is emitted in at least three directions so that the light completely covers the metal workpiece to be tested; when the metal workpiece to be tested is placed on the stage, the industrial control The camera controls the circular light source controller to start responding, and the circular light source controller can control each of the light sources to be turned on individually; when each of the light sources is individually turned on, the camera collects an image and transmits it to the The computer analyzes to find the final light source direction vector in each orientation; wherein, when the computer analyzes the image, the method of step S1 in claim 1 needs to be used.

优选地,所述装置进一步包括驱动导轨以及机械手臂,所述载物台设于驱动导轨上且固定连接,所述工控机可控制所述驱动导轨运行,使得所述载物台在驱动导轨上可循环移动,同时,当所述载物台移动至所述圆形光源控制器底部正中心时,工控机将获取载物台的位置信号且将所述位置信号反馈给所述圆形光源控制器,从而触发圆形光源控制器开始响应。Preferably, the device further includes a driving rail and a mechanical arm, the object stage is arranged on the driving rail and is fixedly connected, and the industrial computer can control the operation of the driving rail so that the object stage is on the driving rail It can move cyclically. At the same time, when the object stage moves to the center of the bottom of the circular light source controller, the industrial computer will obtain the position signal of the object stage and feed back the position signal to the circular light source controller. controller, thereby triggering the circular light controller to start responding.

优选地,当每个所述光源均找到最终光源方向向量时,工控机控制每个所述光源再一次单独亮,且均以最终光源方向向量的方向照射所述待测金属元件,同时每个所述光源亮时,均触发相机进行图像采集,然后,计算机将对所采集的图像进行计算处理以判断待测金属工件是否存在缺陷;其中,计算机在进行对图像进行处理时,需要依靠权利要求1所述的步骤S2中的方法。Preferably, when each of the light sources finds the final light source direction vector, the industrial computer controls each of the light sources to turn on individually again, and illuminates the metal component to be tested in the direction of the final light source direction vector, while each When the light source is on, the camera is triggered to collect images, and then the computer will calculate and process the collected images to determine whether there are defects in the metal workpiece to be tested; wherein, when the computer processes the images, it needs to rely on claims The method in step S2 described in 1.

优选地,所述圆形光源控制器的朝向所述载物台的表面涂有黑色漆,所述光源为红外LED点光源;所述相机为500万高清16mm定焦镜头,其最大靶面尺寸是2/3”,所述光源功率是2.1W,波长是850nm。Preferably, the surface of the circular light source controller facing the stage is coated with black paint, the light source is an infrared LED point light source; the camera is a 5 million high-definition 16mm fixed-focus lens, and its maximum target surface size is It is 2/3", the power of the light source is 2.1W, and the wavelength is 850nm.

与现有技术相比,本发明所提供的一种基于单目立体视觉的金属工件缺陷检测方法具有如下的有益效果:Compared with the prior art, a metal workpiece defect detection method based on monocular stereo vision provided by the present invention has the following beneficial effects:

1、本发明基于单目立体视觉的金属工件缺陷检测方法,利用多个方位即至少三个上的光源,每个方位都标定最佳的光源方向向量,从而使得每次的待测金属工件各个方位均在最终光源方向向量下,再通过引入一个不存在缺陷的模板工件,通过将模板工件和其待测金属工件在最终光源方向向量下采集的图像进行对比,从而判断得到待测金属工件是否存在缺陷,这样的优势在于:1. The metal workpiece defect detection method based on monocular stereo vision of the present invention utilizes multiple azimuths, that is, at least three light sources, and each azimuth is calibrated with the best light source direction vector, so that each metal workpiece to be tested is The azimuths are all under the final light source direction vector, and then by introducing a template workpiece without defects, by comparing the images collected under the final light source direction vector between the template workpiece and its metal workpiece to be tested, it is judged whether the metal workpiece to be tested is There are flaws, the advantages of this are:

第一点是光源是至少三个方位上的,不同于单一光源下的光线,很难将整个待测金属工件覆盖,难免存在过暗的区域,导致后续采集图像存在没被光照覆盖到的死角或者过暗的区域,从而待测金属工件有很多缺陷的位置被忽视掉,从而引起检测不准确;本发明从多个方位设置光源对待测金属工件进行覆盖,使待测金属工件上需要被检测的部位均被光源照射到,从而采集图像时不会存在死角区域,检测精准度和可靠性相对更好;The first point is that the light source is in at least three directions. Unlike the light under a single light source, it is difficult to cover the entire metal workpiece to be tested, and there will inevitably be too dark areas, resulting in dead angles that are not covered by the light in the subsequent collected images. Or too dark areas, so that the positions of many defects of the metal workpiece to be tested are ignored, thereby causing inaccurate detection; the invention sets light sources from multiple directions to cover the metal workpiece to be tested, so that the metal workpiece to be tested needs to be detected All the parts are irradiated by the light source, so there will be no dead angle areas when collecting images, and the detection accuracy and reliability are relatively better;

第二点是每个方位上的光源均通过标定为最佳光源向量,即可以理解为每个光源最合适的方向,这样的好处在于每个方位上均不会出现过曝或者过暗的情况,因此后续采集图像时,不会出现亮点或者暗点,增加了采集图像的质量,从而进一步增加了检测缺陷的准确性;The second point is that the light source in each direction is calibrated as the best light source vector, which can be understood as the most suitable direction for each light source. The advantage of this is that there will be no overexposure or overdarkening in each direction. , so there will be no bright spots or dark spots when the subsequent image is collected, which increases the quality of the collected image, thereby further increasing the accuracy of defect detection;

第三点是每次待测金属工件和模板工件均是在最终光源方向向量下的,保证了对比时参考光源背景的一致,对比于以往的金属工件检测技术,其用于对比的模板工件是在固定情况下的,示例性的如:检测时采取模板工件的图像为之前就预设好的,而不是每次都在同样的光源方向下采集的,这样用于判断待测金属工件十分不准确,导致最终的判断结果误差率较大,从而带来经济损失;本发明将待测金属工件和预设好的模板工件在同样的最终光源方向向量下进行对比,从而变量只有一个,对比后的结果可靠性很高。The third point is that each time the metal workpiece and the template workpiece to be tested are under the direction vector of the final light source, which ensures the consistency of the background of the reference light source during comparison. Compared with the previous metal workpiece detection technology, the template workpiece used for comparison is In a fixed situation, for example: the image of the template workpiece taken during detection is preset before, instead of being collected under the same light source direction every time, so it is very different for judging the metal workpiece to be tested. Accurate, resulting in a large error rate in the final judgment result, which brings economic losses; the present invention compares the metal workpiece to be tested with the preset template workpiece under the same final light source direction vector, so that there is only one variable, and after the comparison The results are highly reliable.

2、光源方向标定的方法现有技术有很多,本发明在每个方位得到最终光源方向向量的方法为,在每个方位上设置光源,且在每个光源的照射范围内设置标定球,用标定球在每个光源的照射范围等间距摆放五次,采集每个标定球在不同位置下的图像,通过算法以获取每个方位下最终光源方向向量,这种方法可快速获取每个方位下的最终光源方向向量,其和其他现有技术的光源标定方法对比的优点在于:使用设备对于光源和相机均无其他特殊的要求,仅需要标定球作为标定工具,且实现过程十分简单,仅需要利用相机对标定球进行拍摄从而采集图像,且计算的过程保证了计算的准确,使用最小二乘法得到的最终光源方向向量,可以理解为标定球在每个方位下不同位置的小球得到的光源方向计算出误差最小的结果。2. There are many methods of light source direction calibration in the prior art. The method of the present invention to obtain the final light source direction vector in each orientation is to set a light source in each orientation, and set a calibration ball within the irradiation range of each light source, using The calibration ball is placed five times at equal intervals in the irradiation range of each light source, and the images of each calibration ball at different positions are collected, and the final light source direction vector in each orientation is obtained through an algorithm. This method can quickly obtain each orientation The final light source direction vector below, compared with other light source calibration methods in the prior art, has the advantage that: the use of equipment has no other special requirements for light source and camera, only the calibration ball is needed as a calibration tool, and the implementation process is very simple. It is necessary to use the camera to shoot the calibration ball to collect the image, and the calculation process ensures the accuracy of the calculation. The final light source direction vector obtained by using the least square method can be understood as the result of the calibration ball at different positions in each orientation. The direction of the light source calculates the result with the smallest error.

同时,每个方位下的光源,标定球需要在每个光源的照射范围等间距摆放五次,保证了光源方向标定的精密度和准确度。At the same time, for the light source in each direction, the calibration ball needs to be placed five times at equal intervals in the irradiation range of each light source, so as to ensure the precision and accuracy of the light source direction calibration.

3、本发明判断待测金属工件是否存在缺陷的方法为:采用一个模板工件在同样的最终光源方向向量下和待测金属工件进行对比,这样的优势在于,保证了输出结果为因变量,而待测金属工件是否存在缺陷则为变亮,其他的统一一致,因此大大提高了检测缺陷的精准性,3. The method for judging whether there is a defect in the metal workpiece to be tested in the present invention is: using a template workpiece to compare with the metal workpiece to be tested under the same final light source direction vector, the advantage of this is that the output result is guaranteed to be a dependent variable, and If there is a defect in the metal workpiece to be tested, it will become brighter, and the others will be uniform, thus greatly improving the accuracy of defect detection.

4、进一步可以在检测完待测金属工件是否存在缺陷后,增加机械手臂进行分选,从而提高生产效率,利用自动化予以增加工件的品质,节省人力,以及减少了工件的不良率,如一些待测金属工件是还未经后处理的脆性件,人手可能造成手痕或者污染,且人工用力不均可能导致待测金属工件变形,机械手臂可调试相对均衡的力度,使工件的品质提高,且机械手臂出错率远比人为要低,增加了成品率。4. Further, after detecting whether there are defects in the metal workpiece to be tested, the mechanical arm can be added for sorting, thereby improving production efficiency, using automation to increase the quality of the workpiece, saving manpower, and reducing the defect rate of the workpiece, such as some waiting The metal workpiece to be tested is a brittle piece that has not been post-processed. Human hands may cause hand marks or pollution, and uneven manual force may cause deformation of the metal workpiece to be tested. The mechanical arm can be adjusted to a relatively balanced force to improve the quality of the workpiece, and The error rate of the robotic arm is far lower than that of humans, which increases the yield.

5、基于单目立体视觉的金属工件缺陷检测方法上,本发明还提出了一种系统,该系统可利用与工厂或者代工厂的流水线以及一些实验室的检测系统,该系统可根据设定的技术指标要求自动对缺陷进行检测,并对有缺陷部位进行分类,还可以根据需要自动分拣、剔除等。5. On the metal workpiece defect detection method based on monocular stereo vision, the present invention also proposes a system, which can use the assembly line of the factory or foundry and the detection system of some laboratories, and the system can be used according to the set Technical indicators require automatic detection of defects, classification of defective parts, and automatic sorting and elimination as needed.

6、基于单目立体视觉的金属工件缺陷检测方法上,本发明还提出了一种基于该方法的装置,该装置采用相机、光源、圆形光源控制器、载物台、工控机以及计算机,三个方向发射光线以使光线完全覆盖待测金属工件,圆形光源控制器控制均匀分布的光源依次单独亮;在每个光源单独亮时相机每次都采集一张图像传输至计算机分析,从而找到每个方位下的最终光源方向向量,因此该装置具有自动对光源方向标定的功能,圆形光源控制器可以控制光源的单独闪亮,相机可以采集图像,从而通过圆形光源控制器、相机、光源、计算机,即可实现找到每个方位下光源的最终光源方向向量,待测金属工件在载物台上可在光源的最终光源方向向量下进行光线覆盖。6. In the metal workpiece defect detection method based on monocular stereo vision, the present invention also proposes a device based on the method, which uses a camera, a light source, a circular light source controller, a stage, an industrial computer and a computer, The light is emitted in three directions so that the light completely covers the metal workpiece to be tested, and the circular light source controller controls the evenly distributed light sources to turn on individually; when each light source is turned on individually, the camera collects an image each time and transmits it to the computer for analysis, thereby Find the final light source direction vector in each orientation, so the device has the function of automatically calibrating the light source direction. The circular light source controller can control the individual flashing of the light source, and the camera can collect images, so that the circular light source controller, camera , light source, and computer, the final light source direction vector of the light source in each orientation can be found, and the metal workpiece to be tested can be covered with light under the final light source direction vector of the light source on the stage.

7、进一步该基于单目立体视觉的金属工件缺陷检测装置还包括驱动导轨以及机械手臂,该驱动导轨可将载物台循环在圆形光源控制器底部和靠近机械手臂的一侧移动,起到一个对载物台上的待测金属工件一个来回运载的功能,机械手臂可以夹取待测金属工件放上载物台,也可将已经检测完的待测金属工件夹取下,从而进行分类,从而使得整个检测的流程全部自动化,相对较稳定,提高了产品的一致性;适合大批量生产,降低了企业生产成本。7. Further, the metal workpiece defect detection device based on monocular stereo vision also includes a driving guide rail and a mechanical arm, and the driving guide rail can circulate the stage at the bottom of the circular light source controller and move on the side close to the mechanical arm, so as to A function of carrying the metal workpiece to be tested back and forth on the stage. The robotic arm can pick up the metal workpiece to be tested and put it on the stage, and can also remove the metal workpiece that has been tested for classification. As a result, the entire detection process is fully automated, relatively stable, and product consistency is improved; it is suitable for mass production and reduces the production cost of the enterprise.

8、所述圆形光源控制器的朝向所述载物台的表面涂有黑色漆;目的是为减少自身的光源反射,从而降低自身对待测金属工件检测过程中的影响,光源为红外LED点光源,传统光源单调的发光效果相比,LED光源是低压微电子产品,成功融合了计算机技术、网络通信技术、图像处理技术、嵌入式控制技术等所以亦是数字信息化产品是半导体光电器件“高新尖”技术具有在线编程、无限升级、灵活多变的特点。8. The surface of the circular light source controller facing the stage is coated with black paint; the purpose is to reduce the reflection of its own light source, thereby reducing its own influence in the detection process of the metal workpiece to be tested. The light source is an infrared LED point Light source, compared with the monotonous luminous effect of traditional light sources, LED light source is a low-voltage microelectronic product that successfully integrates computer technology, network communication technology, image processing technology, embedded control technology, etc., so it is also a digital information product and is a semiconductor optoelectronic device. "High-tech and cutting-edge" technology has the characteristics of online programming, unlimited upgrades, and flexibility.

9、所述相机为500万高清16mm定焦镜头,其最大靶面尺寸是2/3”,所述光源功率是2.1W,波长是850nm,已达到最适合该基于单目立体视觉的金属工件缺陷检测装置的要求,光学分辨率越高,即越适合高精度检测,同理,靶面尺寸说的就是这个图像传感器的感光部分的大小。一般用英寸来表示,而最大为2/3”靶面尺寸的可获取比较大的通光量以及更好的景深。9. The camera is a 5 million high-definition 16mm fixed-focus lens, its maximum target size is 2/3", the power of the light source is 2.1W, and the wavelength is 850nm, which is the most suitable for the metal workpiece based on monocular stereo vision The requirements of the defect detection device, the higher the optical resolution, the more suitable for high-precision detection. Similarly, the size of the target surface refers to the size of the photosensitive part of the image sensor. It is generally expressed in inches, and the maximum is 2/3” The size of the target surface can obtain a relatively large amount of light and a better depth of field.

【附图说明】【Description of drawings】

图1是本发明第一实施例基于单目立体视觉的金属工件缺陷检测方法的流程图;Fig. 1 is the flow chart of the metal workpiece defect detection method based on monocular stereo vision in the first embodiment of the present invention;

图2是本发明第一实施例基于单目立体视觉的金属工件缺陷检测方法,步骤S1中“至少三个方位”的其中方式的结构示意图;Fig. 2 is the first embodiment of the present invention based on monocular stereo vision metal workpiece defect detection method, a structural schematic diagram of the method of "at least three orientations" in step S1;

图3是本发明第一实施例基于单目立体视觉的金属工件缺陷检测方法,步骤S1中“至少三个方位”的另一种方式的结构示意图;Fig. 3 is a structural schematic diagram of another mode of "at least three orientations" in step S1 of the method for detecting metal workpiece defects based on monocular stereo vision in the first embodiment of the present invention;

图4是本发明第一实施例基于单目立体视觉的金属工件缺陷检测方法中步骤S1的具体流程图;4 is a specific flow chart of step S1 in the metal workpiece defect detection method based on monocular stereo vision in the first embodiment of the present invention;

图5是本发明第一实施例基于单目立体视觉的金属工件缺陷检测方法中对应实施步骤S11的结构示意图;Fig. 5 is a structural schematic diagram corresponding to the implementation of step S11 in the metal workpiece defect detection method based on monocular stereo vision in the first embodiment of the present invention;

图6是本发明第一实施例基于单目立体视觉的金属工件缺陷检测方法中步骤S2的具体流程图;6 is a specific flow chart of step S2 in the metal workpiece defect detection method based on monocular stereo vision in the first embodiment of the present invention;

图7是本发明第一实施例基于单目立体视觉的金属工件缺陷检测系统的模块示意图Fig. 7 is a block diagram of a metal workpiece defect detection system based on monocular stereo vision according to the first embodiment of the present invention

图8是本发明第二实施例基于单目立体视觉的金属工件缺陷检测装置第一视角下的结构示意图;Fig. 8 is a structural schematic diagram of a metal workpiece defect detection device based on monocular stereo vision in a first viewing angle according to the second embodiment of the present invention;

图9是本发明第二实施例基于单目立体视觉的金属工件缺陷检测装置第二视角下的结构示意图;Fig. 9 is a structural schematic diagram of a metal workpiece defect detection device based on monocular stereo vision in a second viewing angle according to the second embodiment of the present invention;

图10是本发明第二实施例基于单目立体视觉的金属工件缺陷检测装置的部分结构示意图。Fig. 10 is a partial structural schematic diagram of a metal workpiece defect detection device based on monocular stereo vision according to the second embodiment of the present invention.

附图标识说明:Explanation of the accompanying drawings:

100、系统;200、装置;100. system; 200. device;

10、发射模块;20、采集模块;30、处理模块;40、执行模块;50、控制模块;10. Launch module; 20. Acquisition module; 30. Processing module; 40. Execution module; 50. Control module;

1、相机;2、光源;3、圆形光源控制器;4、载物台; 5、驱动导轨;6、工控机;7、机械手臂;8、计算机。1. Camera; 2. Light source; 3. Circular light source controller; 4. Stage; 5. Drive rail; 6. Industrial computer; 7. Mechanical arm; 8. Computer.

【具体实施方式】【Detailed ways】

为了使本发明的目的,技术方案及优点更加清楚明白,以下结合附图及实施实例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be further described in detail below in conjunction with the accompanying drawings and implementation examples. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

本发明提供的一种基于单目立体视觉的金属工件缺陷检测方法,主要适用于金属工件缺陷检测领域,助力工业智能化生产,铸造企业良好的品控。The invention provides a metal workpiece defect detection method based on monocular stereo vision, which is mainly applicable to the field of metal workpiece defect detection, assists industrial intelligent production, and provides good quality control for foundry enterprises.

请参阅图1,本发明的第一实施例提供基于单目立体视觉的金属工件缺陷检测方法;Please refer to FIG. 1, the first embodiment of the present invention provides a metal workpiece defect detection method based on monocular stereo vision;

该基于单目立体视觉的金属工件缺陷检测方法包括步骤S1~步骤S3:The metal workpiece defect detection method based on monocular stereo vision includes steps S1 to S3:

步骤S1:以待测金属工件为中心,在至少三个方位上设置光源并进行光源方向标定,以得到每个方位下的最终光源方向向量;Step S1: take the metal workpiece to be tested as the center, set the light source in at least three directions and perform light source direction calibration to obtain the final light source direction vector in each direction;

可以理解,上述以待测金属工件为中心点,具体以金属工件的尺寸而定,当待测金属工件相对光源的视场角较小时,则将待测金属工件可视为一个点,而当将待测金属工件较大时,则以待测金属工件的中心点作为中心;光源方向标定的释意为:找到光源方向的标准。It can be understood that the center point of the metal workpiece to be tested is used as the center point, and it depends on the size of the metal workpiece. When the field angle of the metal workpiece to be tested is relatively small relative to the light source, the metal workpiece to be tested can be regarded as a point. When the metal workpiece to be tested is large, the center point of the metal workpiece to be tested is taken as the center; the interpretation of the light source direction calibration is: to find the standard of the light source direction.

为更好的理解步骤S1,请参阅图2以及图3,上述“至少三个方位”可理解为在待测金属工件的周边的三个位置,其可像图示一样为在待测金属工件的四周,也可是其中的一侧,具体根据待测金属工件的情况而设定,示例性的如,待测金属工件(未标号)四周设定光源2,光源2在至少三个方位,其中,设定光源2在三个方位时,光源2发射的夹角为120°,设定光源2在四个方位时,光源2发射的夹角为90°,如果待测工件自身的形貌较为复杂或者要求检测缺陷的精度较高,则采用更多的方位进行光源方向标定。For a better understanding of step S1, please refer to Figure 2 and Figure 3, the above "at least three orientations" can be understood as three positions around the metal workpiece to be tested, which can be as shown in the figure on the metal workpiece to be tested The surrounding area, or one side thereof, is specifically set according to the situation of the metal workpiece to be tested. Exemplarily, a light source 2 is set around the metal workpiece to be tested (unlabeled), and the light source 2 is in at least three directions, wherein , when the light source 2 is set in three directions, the included angle emitted by the light source 2 is 120°; when the light source 2 is set in four directions, the included angle emitted by the light source 2 is 90°. If it is complex or requires higher precision in defect detection, more orientations are used to calibrate the direction of the light source.

而进行光源方向标定的意义在于寻找到每个方位下最合适的光源方向向量,即最终光源方向向量,以获取最优的拍摄图像;示例性的如:左边方位上的最终光源方向向量为意思即为在从左边射出的光只有在方向为时,获得的效果才是最好的,如没有曝光面,没有阴影等。本领域人员很容易理解,光源方向标定是进行视觉测量和定位的基础工作之一,标定参数准确与否直接关系到整个检测的精度。The significance of performing light source direction calibration is to find the most suitable light source direction vector in each orientation, that is, the final light source direction vector, in order to obtain the optimal captured image; for example, the final light source direction vector on the left orientation is It means that the light emitted from the left is only in the direction of , the effect obtained is the best, such as no exposed surface, no shadow, etc. Those skilled in the art can easily understand that the calibration of the light source direction is one of the basic tasks for visual measurement and positioning, and whether the calibration parameters are accurate or not is directly related to the accuracy of the entire detection.

可选地,本实施例采用指南针坐标下的8个方位进行光源方向标定,即为:东、西、南、北、东北、东南、西北:西南这8个方位进行光源方向标定,那么则可获得8 个方位的最终光源方向向量。Optionally, in this embodiment, 8 azimuths under the compass coordinates are used to calibrate the direction of the light source, namely: east, west, south, north, northeast, southeast, northwest: southwest. These 8 azimuths are used to calibrate the direction of the light source, then Obtain the final light source direction vectors for 8 orientations.

及步骤S2:获取待测金属工件在至少三个方位最终光源方向向量下的图像;采用光度立体视觉的原理对图像进行处理,以判断待测金属工件是否存在缺陷;And step S2: Obtain images of the metal workpiece to be tested under the final light source direction vector in at least three directions; process the image using the principle of photometric stereo vision to determine whether there is a defect in the metal workpiece to be tested;

可以理解,模板工件指的是正常无缺陷的工件,以作为参照物使用,根据步骤S1各个方向下光源方向标定后的最终光源方向向量,对最终光源方向向量下的待测金属工件以及模板工件的图像进行采取并且对比,示例性的如:将本实施例中获取的8个方位的最终光源方向向量下拍摄的待测金属工件图像,和同在8个方位的最终光源方向向量下的模板工件进行对比,从而得到待测金属工件是否存在缺陷的结果。It can be understood that the template workpiece refers to a normal and non-defective workpiece, which is used as a reference object. According to the final light source direction vector after the calibration of the light source direction in each direction in step S1, the metal workpiece to be tested and the template workpiece under the final light source direction vector The images are taken and compared, for example: the image of the metal workpiece to be tested taken under the final light source direction vectors of 8 directions acquired in this embodiment, and the template under the final light source direction vectors of 8 directions The workpieces are compared to obtain the result of whether there are defects in the metal workpiece to be tested.

其中“光度立体视觉”是一种经典三维模型重建技术。Among them, "photometric stereo vision" is a classic 3D model reconstruction technology.

其中“缺陷”的定义可为待测金属工件表面的斑点、凹坑、划痕、色差、缺损。Wherein, the definition of "defect" can be spots, pits, scratches, chromatic aberrations, and defects on the surface of the metal workpiece to be tested.

一些实施例中,进一步包括步骤S3:根据步骤S2的结果,采用机械手臂将对待测金属工件分类抓取。In some embodiments, step S3 is further included: according to the result of step S2, a mechanical arm is used to classify and grasp the metal workpieces to be tested.

请参阅图4,其中步骤S1:以待测金属工件为中心,以至少三个方位上设置光源并进行光源方向标定,以得到每个方位下的最终光源方向向量,具体包括以下步骤:Please refer to Figure 4, where step S1: take the metal workpiece to be tested as the center, set the light source in at least three directions and calibrate the direction of the light source to obtain the final light source direction vector in each direction, specifically including the following steps:

步骤S11:在至少三个方位中的每个方位设置光源;从而得到至少三个方位的光源,引入标定球分别在每个方位的光源照射范围内等间距摆放五次,对所有方位上的光源下的所述标定球进行采集,从而得到至少15副标定球图像;Step S11: Set up a light source in each of at least three directions; thus obtain light sources in at least three directions, introduce calibration balls and place them five times at equal intervals within the light source irradiation range of each direction, and for all directions The calibration sphere under the light source is collected, thereby obtaining at least 15 pairs of calibration sphere images;

步骤S12:识别每个标定球图像中的标定球的中心点和高光点,并计算中心点和高光点的空间位置关系;将标定球视为正交投影模型并结合光度立体视觉原理,从而计算得到每个方位下的光源方向向量;及Step S12: Identify the center point and the highlight point of the calibration ball in each calibration ball image, and calculate the spatial position relationship between the center point and the highlight point; regard the calibration ball as an orthogonal projection model and combine the principle of photometric stereo vision to calculate get the light source direction vector in each azimuth; and

步骤S13:通过每个标定球图像得到的光源方向向量,使用最小二乘法求得每个方位下的最终光源方向向量。Step S13: Using the light source direction vector obtained from each calibration ball image, use the least square method to obtain the final light source direction vector in each orientation.

请参阅图5,其中对于步骤S11中提出的:“在至少三个方位中的每个方位设置光源;从而得到至少三个方位的光源,引入五个标定球在至少三个方位的光源中每个方位的光源范围内等间距摆放,从而采集至少三个光源方向的至少15副的标定球图像”,其中Phong模型是真实图形学中提出的第一个有影响的光照明模型,该模型只考虑物体对直接光照的反射作用,认为环境光是常量,没有考虑物体之间相互的反射光,物体间的反射光只用环境光表示。Please refer to Fig. 5, wherein for step S11 proposed: "A light source is set in each orientation in at least three orientations; thereby obtain the light source of at least three orientations, introduce five calibration balls in each of the light sources of at least three orientations Place the light sources in three directions at equal intervals, so as to collect at least 15 calibration ball images in at least three light source directions", where the Phong model is the first influential light illumination model proposed in real graphics. Only the reflection of objects to direct light is considered, and the ambient light is considered constant. The reflected light between objects is not considered, and the reflected light between objects is only represented by ambient light.

可以理解为,使用的标定球(未标号)可选地为氮化硅陶瓷球,其表面材料是高光黑色,由于本实施例为8个方位,8个方位下的每个方位均设置有光源2,使用八个光源方位标定方法即为:把1个标定球先放置其中一个方位的光源2对应的光源照射范围内任意位置,采集一幅光源2 照明下的标定球图像,然后等间距的替换四次位置,从而一共采集5幅光源2照明下的标定球图像,然后再将5个标定球放置另一个方位对应的光源照射范围内,再采集5幅光源2照明标定球即氮化硅陶瓷球的图像;由于本实施例可选地为8个光源2,因此需要依次进行8轮,一共将标定球放置8个方位下中5个不同位置;每轮均采集5张照片,也即采集8个光源方向向量下至少40副的标定球图像;It can be understood that the calibration ball (unlabeled) used is optionally a silicon nitride ceramic ball, and its surface material is high-gloss black. Since there are 8 directions in this embodiment, a light source is provided in each of the 8 directions. 2. The method of using eight light source azimuth calibration is: first place a calibration ball at any position within the light source irradiation range corresponding to light source 2 in one azimuth, collect an image of the calibration ball under the illumination of light source 2, and then equidistantly Replace the positions four times, so that a total of 5 calibration ball images under the illumination of light source 2 are collected, and then 5 calibration balls are placed within the irradiation range of the light source corresponding to another orientation, and then 5 images of calibration balls illuminated by light source 2 are collected, namely silicon nitride The image of the ceramic ball; since the present embodiment can optionally be 8 light sources 2, it is necessary to perform 8 rounds in sequence, and place the calibration ball in 5 different positions in 8 orientations; 5 photos are collected in each round, that is, Collect at least 40 calibration ball images under 8 light source direction vectors;

其中对于步骤S12中所述“使用基于正交投影模型下的Phong模型(Phong:冯氏模型)结合光度立体视觉原理,从而计算得到光源方向向量”,该步骤采用了Phong 模型替代传统光度立体视觉的朗伯体模型。由于传统光度立体视觉的朗伯体模型假设在朗伯体反射模型下,物体表面一点的亮度值只与其表面反射率和表面法向量有关,而且这个关系是线性的。然而,现实中,大多数物体的表面既不是纯粹的镜面,也不是纯粹的漫反射表面,而是包含有这两种成分的混合反射表面。因而本发明使Phong模型替代朗伯体模型,考虑了漫反射、镜面反射和环境光的线性组合,更加真实地反映物体材质特性,更加贴近于现实,具体表述为:Wherein for step S12 described "using the Phong model (Phong: Phong model) based on the orthogonal projection model in combination with the principle of photometric stereo vision, thereby calculating the light source direction vector", this step adopts the Phong model to replace the traditional photometric stereo vision Lambertian model. Because the Lambertian body model of traditional photometric stereo vision assumes that under the Lambertian body reflection model, the brightness value of a point on the surface of an object is only related to its surface reflectance and surface normal vector, and this relationship is linear. However, in reality, the surface of most objects is neither a pure specular surface nor a pure diffuse reflective surface, but a mixed reflective surface containing these two components. Therefore, the present invention replaces the Lambertian body model with the Phong model, considers the linear combination of diffuse reflection, specular reflection and ambient light, reflects the material characteristics of the object more truly, and is closer to reality, specifically expressed as:

正交投影下Phong模型所描述的反射图方程为:The reflection map equation described by the Phong model under the orthogonal projection is:

其中,n表示物体表面的法向量。nh表示物体表面的镜面反射方向向量。其中k是镜面反射指数因子,且K∈Z+,Z+表示全体正整数的集合,k值的大小可用同类材质表面形状已知的图像获得,其中E为Phong模型的目标函数。Among them, n represents the normal vector of the surface of the object. n h represents the specular reflection direction vector of the object surface. Where k is the specular index factor, and K∈Z + , Z+ represents the set of all positive integers, and the value of k can be obtained from images with known surface shapes of similar materials, where E is the objective function of the Phong model.

其中对于步骤S13中,其所述的“通过每个标定球图像得到的光源方向向量,使用最小二乘法求得每个方位下的最终光源方向向量”的具体方法为:Among them, for step S13, the specific method of "obtaining the final light source direction vector in each orientation by using the least squares method to obtain the light source direction vector obtained from each calibration ball image" is as follows:

当标定球放置相机图像视野中位置1时候,采集到8 幅光源2照明标定球的图像,使用正交投影下的Phong模型,计算出8个光源2下的方向单位向量,即记为 L11,L12,L13,L14,L15,L16,L17,L18,标号中L11表示为位置1的1号光源2的光源方向单位向量(顺时针对8个光源2进行编号),以此类推,5个不同位置的光源2的光源方向单位向量为, L11,L12,L13,L14,L15,L16,L17,L18;L21,L22,L23,L24,L25,L26,L27,L28;L31,L32,L33,L34,L35,L36,L37,L38; L41,L42,L43,L44,L45,L46,L47,L48;L51,L52,L53,L54,L55,L56,L57,L58,针对这5个光源方向单位向量,假设最优的方向向量为L,使用最小二乘法求解最终光源方向单位向量的方法,示例性的为:When the calibration ball is placed at position 1 in the camera image field of view, 8 images of light source 2 illuminating the calibration ball are collected, and using the Phong model under the orthogonal projection, the directional unit vectors of the 8 light sources 2 are calculated, which is denoted as L 11 , L 12 , L 13 , L 14 , L 15 , L 16 , L 17 , L 18 , L 11 in the label represents the light source direction unit vector of No. 1 light source 2 at position 1 (the eight light sources 2 are numbered clockwise ), and so on, the light source direction unit vectors of light source 2 at five different positions are: L 11 , L 12 , L 13 , L 14 , L 15 , L 16 , L 17 , L 18 ; L 23 , L 24 , L 25 , L 26 , L 27 , L 28 ; L 31 , L 32 , L 33 , L 34 , L 35 , L 36 , L 37 , L 38 ; L 41 , L 42 , L 43 ,L 44 ,L 45 ,L 46 ,L 47 ,L 48 ; L 51 ,L 52 ,L 53 ,L 54 ,L 55 ,L 56 ,L 57 ,L 58 , for these five light source direction unit vectors, suppose The optimal direction vector is L, and the method of using the least squares method to solve the unit vector of the final light source direction is as an example:

针对1号红外LED点光源最终光源方向单位向量求解为:For the No. 1 infrared LED point light source, the final light source direction unit vector is solved as:

将其简化为:Simplifies it to:

AL=HAL=H

可以理解:其中, understandable: among them,

最后使用最小二乘法求解,可得:Finally, using the least squares method to solve, we can get:

L=(ATA)-1ATHL=(A T A) -1 A T H

依此方法,根据最小二乘法的可以求解出计8个方位下的红外LED点光源的最终方向单位向量,可以理解,该最终方向单位向量即为。According to this method, the final direction unit vectors of the infrared LED point light sources in 8 directions can be calculated according to the least square method. It can be understood that the final direction unit vectors are .

请参阅图6,其中步骤S2中,“预设模板工件,获取待测金属工件和所述模板工件在至少三个方位最终光源方向向量下的图像;采用光度立体视觉的原理对图像进行数值化且处理对比分析,以判断待测金属工件是否存在缺陷”的具体步骤为:Please refer to Fig. 6, wherein in step S2, "preset the template workpiece, obtain the image of the metal workpiece to be tested and the template workpiece under the final light source direction vector in at least three directions; use the principle of photometric stereo vision to digitize the image And process comparative analysis to judge whether there is a defect in the metal workpiece to be tested. The specific steps are:

步骤S21:获取待测金属工件和预设的模板工件在至少三个最终光源方向向量下的至少3幅图像;Step S21: acquiring at least 3 images of the metal workpiece to be tested and the preset template workpiece under at least three final light source direction vectors;

步骤S22:根据步骤S21获得的图像,利用基于正交投影模型下的Phong模型,求得待测金属工件以及模板工件的表面法向量并分别建立梯度图,将梯度图进行高斯转换得到曲率图,且对曲率图进行形态学处理;及Step S22: According to the image obtained in step S21, use the Phong model based on the orthogonal projection model to obtain the surface normal vectors of the metal workpiece to be tested and the template workpiece, and establish a gradient map respectively, and perform Gaussian transformation on the gradient map to obtain a curvature map. and performing morphological processing on the curvature map; and

步骤S23:将待测金属工件和预设的模板工件已经过形态学处理的曲率图进行Bolb分析,以输出待测金属工件是否存在缺陷的结果。Step S23: Bolb analysis is performed on the morphologically processed curvature maps of the metal workpiece to be tested and the preset template workpiece to output whether there is a defect in the metal workpiece to be tested.

其中,“模板工件”为表面没有任何缺陷的金属工件,其和待测金属工件的型号尺寸一致。Wherein, the "template workpiece" is a metal workpiece without any defects on the surface, which is consistent with the type and size of the metal workpiece to be tested.

其中,“Blob分析”是对图像中相同像素的连通域进行分析,该连通域称为Blob;经二值化处理后的图像中色斑可认为是Blob;Blob分析工具可以从背景中分离出目标,并可以计算出目标的数量、位置、形状、方向和大小,还可以提供相关斑点间的拓扑结构,在处理过程中不是对单个像素逐一分析,而是对图像的行进行操作;图像的每一行都用游程长度编码来表示相邻的目标范围;这种算法与基于像素的算法相比,大大提高了处理的速度。Among them, "Blob analysis" is to analyze the connected domain of the same pixel in the image, and the connected domain is called Blob; the color spots in the image after binarization processing can be considered as Blob; the Blob analysis tool can be separated from the background target, and can calculate the number, position, shape, direction and size of the target, and can also provide the topological structure among the related spots. In the process of processing, instead of analyzing individual pixels one by one, the row of the image is operated; Each row is encoded with run-length to represent the adjacent object range; this algorithm greatly improves the processing speed compared with the pixel-based algorithm.

可以理解,步骤S21即为当步骤S13结束后,求得的每个方位最终光源方向向量下所采集的图像,因本实施例一共8个方位下,所以所测待测金属工件的图像为八张,所测模板工件的图像为八张,因此获取十六张图像。It can be understood that step S21 is the image collected under the final light source direction vector of each orientation obtained after step S13 is completed. Since there are a total of 8 orientations in this embodiment, the images of the metal workpiece to be measured are eight There are eight images of the measured template workpiece, so sixteen images are obtained.

步骤S22所述的“梯度图”为图像的梯度幅值特征图,当所采集图像中的灰度值存在边缘时,一定有较大的梯度值,相反,当图像中有比较平滑的部分时,灰度值变化较小,则相应的梯度也较小,图像处理中把梯度的模简称为梯度,由图像梯度构成的图像成为梯度图像,在获取梯度图像时,可采用小区域模板进行卷积来计算,示例性的如:可利用Sobel算子(Sobel:一种边缘检测的名词,可译为索贝尔)、Robinson算子(Robinson:鲁滨逊)、Laplace 算子(Laplace:拉普拉斯)等,利用高斯转换得到曲率图释意为:高斯转换后的曲率图的几何意义即曲面局部面积的极限,因此在本实施例中,高斯转换后曲率图反映了梯度图像局部的弯曲程度,即反映了梯度图像变化的数据,最后将曲率图进行形态学处理,本领域人员很容易理解,所述形态学处理的释意为对图像进行观察和处理,从而达到改善图像质量的目的。The "gradient map" described in step S22 is the gradient magnitude feature map of the image. When there are edges in the gray value of the collected image, there must be a larger gradient value. On the contrary, when there are relatively smooth parts in the image, When the gray value changes small, the corresponding gradient is also small. In image processing, the modulus of the gradient is referred to as the gradient, and the image composed of the image gradient becomes a gradient image. When obtaining the gradient image, a small area template can be used for convolution. To calculate, exemplary such as: Sobel operator (Sobel: a term of edge detection, which can be translated as Sobel), Robinson operator (Robinson: Robinson), Laplace operator (Laplace: Laplace Si), etc., using Gaussian transformation to obtain the curvature diagram means: the geometric meaning of the curvature map after Gaussian transformation is the limit of the local area of the curved surface, so in this embodiment, the curvature map after Gaussian transformation reflects the local curvature of the gradient image , that is, the data reflecting the change of the gradient image. Finally, the curvature map is subjected to morphological processing. Those skilled in the art can easily understand that the meaning of the morphological processing is to observe and process the image, so as to achieve the purpose of improving image quality.

最终,将将待测金属工件和模板工件已经过形态学处理的曲率图进行Blob分析,可将模板工件的图像作为背景对比待测金属工件的图像,从而对比得到待测金属工件是否存在缺陷。Finally, Blob analysis will be performed on the morphologically processed curvature maps of the metal workpiece to be tested and the template workpiece, and the image of the template workpiece can be used as a background to compare the image of the metal workpiece to be tested, so as to compare whether there is a defect in the metal workpiece to be tested.

请参阅图7,为更好的解决上述问题,本发明又提出另一方案如下,一种基于单目立体视觉的金属工件缺陷检测系统100,用于对待测金属工件进行缺陷检查,包括:Please refer to FIG. 7 , in order to better solve the above problems, the present invention proposes another solution as follows, a metal workpiece defect detection system 100 based on monocular stereo vision, which is used for defect inspection of the metal workpiece to be tested, including:

发射模块10:用于从至少三个方位对所述待测金属工件发射光线;Emitting module 10: used for emitting light to the metal workpiece to be tested from at least three directions;

采集模块20:用于采集所述待测金属工件在所述发射模块10照射下的图像;Acquisition module 20: for collecting the image of the metal workpiece to be tested under the irradiation of the emission module 10;

处理模块30:用于计算所述发射模块10在各个方位中每个方位对待测金属工件的最终光源方向向量,以及计算判断待测金属工件是否存在缺陷;Processing module 30: used to calculate the final light source direction vector of the metal workpiece to be tested in each orientation of the emission module 10 in each orientation, and calculate and judge whether there is a defect in the metal workpiece to be tested;

执行模块40:将待测金属工件进行分类;Executing module 40: classifying the metal workpiece to be tested;

控制模块50:根据处理模块30的结果,用于控制发射模块10和执行模块40进行相应的动作。The control module 50 : according to the result of the processing module 30 , is used to control the transmitting module 10 and the execution module 40 to perform corresponding actions.

可以理解,本发明的提供的基于单目立体视觉的金属工件缺陷检测系统100,所述基于单目立体视觉的金属工件缺陷检测系统100利用如本发明所提供基于单目立体视觉的金属工件缺陷检测方法的整体步骤或者单一步骤的组合,该系统可以应用于服务器、计算机、相机、手机、平板电脑等多种终端设备中,且采用硬件和软件实现;以实现对金属工件进行缺陷检测。It can be understood that the metal workpiece defect detection system 100 based on monocular stereo vision provided by the present invention, the metal workpiece defect detection system 100 based on monocular stereo vision utilizes the metal workpiece defect detection system 100 based on monocular stereo vision provided by the present invention The overall steps of the detection method or the combination of single steps, the system can be applied to various terminal devices such as servers, computers, cameras, mobile phones, tablet computers, etc., and is realized by hardware and software; to detect defects on metal workpieces.

为更好的解决上述问题,本发明又提出另一方案如下,本发明还提供一种存储介质,该存储介质或者处理器存储有计算机程序,所述存储介质程序运行时,控制所述储存介质或者处理器需执行的计算机程序需执行包括上述的基于单目立体视觉的金属工件缺陷检测方法。In order to better solve the above problems, the present invention proposes another solution as follows. The present invention also provides a storage medium, the storage medium or the processor stores a computer program, and when the storage medium program is running, the storage medium is controlled. Or the computer program to be executed by the processor needs to execute the above-mentioned metal workpiece defect detection method based on monocular stereo vision.

本发明的第二实施例提供基于单目立体视觉的金属工件缺陷检测装置,图示装置仅仅为方便阐述该发明第一实施例所述方法从而设定的结构示意图,并不用于限定于该发明的结构、连接关系以及位置关系甚至所处环境的形貌。The second embodiment of the present invention provides a metal workpiece defect detection device based on monocular stereo vision. The illustrated device is only a schematic structural diagram set up for the convenience of explaining the method described in the first embodiment of the present invention, and is not intended to limit the invention The structure, connection relationship and positional relationship of the environment and even the shape of the environment.

请继续参阅图8以及图9,实施例二提供的基于单目立体视觉的金属工件缺陷检测装置200,包括相机1、光源2、圆形光源控制器3、载物台4、驱动导轨5、工控机6、机械手臂7,计算机8;Please continue to refer to FIG. 8 and FIG. 9, the metal workpiece defect detection device 200 based on monocular stereo vision provided by the second embodiment includes a camera 1, a light source 2, a circular light source controller 3, a stage 4, a driving guide rail 5, Industrial computer 6, mechanical arm 7, computer 8;

其中工控机6电性连接驱动导轨5以及机械手臂7,工控机6可控制驱动导轨5运行,使得载物台4在驱动导轨5 上可循环移动,工控机6控制机机械手臂7抓取待检区域的待测金属工件放置于载物台4上,在驱动导轨5的作用下,将载物台4平移到相机1所能拍摄到的区域,即载物台4停止的位置刚好在相机1的正下方,同时,当载物台4到达设定的位置时,工控机6将获取载物台4的位置信号且将位置信号反馈给圆形光源控制器3,然后圆形光源控制器3控制均匀分布的光源2通电从而依次单独亮;光源2可从至少三个方向发射光线以使光线完全覆盖待测金属工件,在每个光源2单独亮时相机1每次都采集一张图像传输至计算机8 分析,从而找到每个方位下的最佳光源方向,向量在坐标系中代表了方向,因此此处提及的最佳光源方向即是实施一中的最终光源方向向量,为方便理解,以下均用最佳光源方向阐述。Among them, the industrial computer 6 is electrically connected to the driving guide rail 5 and the mechanical arm 7, and the industrial computer 6 can control the operation of the driving guide rail 5, so that the stage 4 can move circularly on the driving guide rail 5, and the industrial computer 6 controls the mechanical arm 7 to grab and wait. The metal workpiece to be tested in the inspection area is placed on the stage 4, and under the action of the driving guide rail 5, the stage 4 is translated to the area that can be photographed by the camera 1, that is, the position where the stage 4 stops is just in front of the camera. 1, at the same time, when the stage 4 reaches the set position, the industrial computer 6 will obtain the position signal of the stage 4 and feed back the position signal to the circular light source controller 3, and then the circular light source controller 3. Control the evenly distributed light sources 2 to be powered on so as to turn on individually; the light source 2 can emit light from at least three directions so that the light completely covers the metal workpiece to be tested, and the camera 1 collects an image each time when each light source 2 is turned on independently Transmission to the computer 8 for analysis, thereby finding the best light source direction in each orientation, the vector represents the direction in the coordinate system, so the best light source direction mentioned here is the final light source direction vector in the first implementation, for convenience Understand, the following are all described with the best light source direction.

进一步地,工控机6、圆形光源控制器3、相机1、以及光源2均依次电性连接,其中相机1和光源2均位于圆形光源控制器3朝向载物台4的一面上,相机1位于圆形光源控制器3该面的中心位置,且其中光源2以相机1为中心环形矩阵设定,圆形光源控制器3离载物台4的高度不予限定,只需实现以下功能即可:当待测金属工件放于载物台4上时,光源2可对待测金属工件进行不同方向上的光覆盖,相机1能实时采集待测金属工件被光照的图像。Further, the industrial computer 6, the circular light source controller 3, the camera 1, and the light source 2 are all electrically connected in sequence, wherein the camera 1 and the light source 2 are both located on the side of the circular light source controller 3 facing the stage 4, and the camera 1 is located at the center of the surface of the circular light source controller 3, and the light source 2 is set in a circular matrix centered on the camera 1. The height of the circular light source controller 3 from the stage 4 is not limited, only the following functions need to be realized That is: when the metal workpiece to be tested is placed on the stage 4, the light source 2 can cover the metal workpiece to be tested with light in different directions, and the camera 1 can collect the illuminated image of the metal workpiece to be tested in real time.

进一步地,光源2可选地设定数量为8个,当上述圆形光源控制器3接收到位置信号时,8个光源2依次亮灭,分别从不同方向给载物台4上的待测金属工件进行光照;Further, the number of light sources 2 can optionally be set to 8. When the above-mentioned circular light source controller 3 receives the position signal, the 8 light sources 2 will be turned on and off in turn, and they will be sent to the objects to be tested on the stage 4 from different directions. Metal workpieces are illuminated;

可以理解:依次亮灭在本实施例中的示意为,多个光源2可排出一个序列,比如光源2从其中一个开始为一,依次以一、二、三、四、…八排列,其中从第一个光源2单个亮,其余光源2熄灭,到第二个光源2单个亮,其余光源 2熄灭…依次顺序不断循环,直到序列最后一个亮,即为依次亮灭。It can be understood that: sequentially on and off in this embodiment shows that multiple light sources 2 can be arranged in a sequence. The first light source 2 is turned on individually, and the rest of the light sources 2 are turned off. When the second light source 2 is turned on individually, the rest of the light sources 2 are turned off...the cycle continues in sequence until the last one in the sequence is turned on, that is, it is turned on and off sequentially.

一些特殊的实施例中,在上述单个光源2依次亮灭后,还会采用两个光源2依次亮灭,或者三个光源2依次亮灭。In some special embodiments, after the above-mentioned single light source 2 is turned on and off sequentially, two light sources 2 are turned on and off sequentially, or three light sources 2 are turned on and off sequentially.

可以理解,在圆形光源控制器3控制均匀分布的光源2 依次亮灭的过程中,以及计算机8分析每个光源2单独亮时相机1每次采集的图像时,即为对光源2的光源方向标定的过程,该过程需要依靠实施例一中步骤S1的方法。It can be understood that when the circular light source controller 3 controls the uniformly distributed light sources 2 to turn on and off in turn, and when the computer 8 analyzes the images collected by the camera 1 each time each light source 2 is turned on individually, it is the light source for the light source 2. The process of direction calibration needs to rely on the method of step S1 in the first embodiment.

在实施二中对应实施一步骤S1的方法,具体的为:每个方位下的光源2均预设好有步骤S1中所述方式设置的标定球,工控机6控制每个光源2单独亮时,相机1均会采集标定球图像,计算机8对每次采集标定球图像进行分析,以找到最佳光源方向,依次循环分析,以至此时8个方位下的光源2均找到最佳光源方向,工控机6控制循环分析结束。In the second implementation, the method corresponding to the first step S1 is implemented, specifically: the light source 2 in each orientation is preset with a calibration ball set in the manner described in step S1, and the industrial computer 6 controls each light source 2 to be turned on separately. , the camera 1 will collect the calibration sphere image, and the computer 8 will analyze the calibration sphere image collected each time to find the best light source direction, and the analysis will be repeated in turn, so that the light source 2 in the 8 directions can find the best light source direction at this time, The analysis of the control cycle of the industrial computer 6 ends.

更进一步地,当8个光源2均找到最佳光源方向后,工控机6继续控制8个光源2依次单独亮灭,此时待测金属工件是在八个方位以最佳光源向量照射,同时触发相机1进行图像采集,然后,计算机8将对所采集的图像进行计算处理以判断待测金属工件是否存在缺陷,其中计算机8在进行对图像进行处理时,需要依靠实施例一所述的步骤S2 中的方法:Furthermore, when the eight light sources 2 all find the best light source direction, the industrial computer 6 continues to control the eight light sources 2 to turn on and off individually in turn. At this time, the metal workpiece to be tested is irradiated with the best light source vector in eight directions, and at the same time Trigger the camera 1 to collect images, and then the computer 8 will calculate and process the collected images to determine whether there is a defect in the metal workpiece to be tested. When the computer 8 processes the images, it needs to rely on the steps described in the first embodiment Method in S2:

在实施二中对应实施一步骤S2的方法,具体的为:在每个光源2均为最佳光源方向后,相机1继续采集8个最佳光源方向的图像,该图像并非标定球图像,标定球图像是用于找到每个光源2下的最佳光源方向,而该图像是待测金属工件的图像,用于检测待测金属工件有无缺陷,根据实施一所述方法可知,对所采集的图像,利用正交投影模型下的Phong模型,计算待检测金属工件的表面法向量,然后使用表面法向量计算表面梯度信息;根据表面梯度信息,将表面梯度信息与高斯导数卷积,获取得到表面高斯曲率,再将图像上每一点的高斯曲率转化为灰度值,即将待测对象表面的高斯曲率转化为曲率图像。对曲率图像进行边缘检测,然后剔除干扰点,对闭合区域进行填充以及膨胀处理,然后分割阈值,Blob分析,以实现待测金属工件的缺陷检测,需要说明的是,该技术为本领域人员容易知道的技术手段,因此本发明实施例一以及实施二均并未强调阐述上述步骤S2的部分。In the second implementation, the method of step S2 is correspondingly implemented, specifically: after each light source 2 is in the best light source direction, the camera 1 continues to collect 8 images of the best light source directions, which are not calibration ball images, and the calibration The ball image is used to find the best light source direction under each light source 2, and the image is the image of the metal workpiece to be tested, and is used to detect whether the metal workpiece to be tested has defects. According to the method described in the first implementation, the collected Using the Phong model under the orthogonal projection model to calculate the surface normal vector of the metal workpiece to be detected, and then use the surface normal vector to calculate the surface gradient information; according to the surface gradient information, the surface gradient information is convolved with the Gaussian derivative to obtain The Gaussian curvature of the surface, and then convert the Gaussian curvature of each point on the image into a gray value, that is, convert the Gaussian curvature of the surface of the object to be measured into a curvature image. Perform edge detection on the curvature image, then remove the interference points, fill and expand the closed area, then segment the threshold, and analyze the Blob to realize the defect detection of the metal workpiece to be tested. It should be noted that this technology is easy for those skilled in the art. Known technical means, so the first embodiment and the second embodiment of the present invention do not emphasize the part of the above-mentioned step S2.

处理后的结果进一步反馈给工控机6,即将待测金属工件是否存在缺陷的信息反馈给工控机6,工控机6从而控制驱动导轨5将载物台4移送到靠近机械手臂7的一侧,同时工控机6会控制机械手臂7对待测金属工件进行抓取,从而进行分类处理,示例性的如:设定两个区域,一个为有缺陷的待测金属工件归类区域,另一个则为没有缺陷的待测金属工件归类区域,如果计算机8处理的结果为该待测金属工件存在缺陷,工控机6会控制机械手臂7则将其抓取放于有缺陷的归类区域,反之亦然;结束后,工控机6控制所有上述运行元件复位。The processed result is further fed back to the industrial computer 6, that is, the information on whether the metal workpiece to be tested has defects is fed back to the industrial computer 6, and the industrial computer 6 controls the driving guide rail 5 to move the loading platform 4 to the side close to the mechanical arm 7, At the same time, the industrial computer 6 will control the mechanical arm 7 to grab the metal workpiece to be tested, so as to perform classification processing. For example, two areas are set, one is the classification area for the defective metal workpiece to be tested, and the other is the If there is no defect in the classification area of the metal workpiece to be tested, if the result processed by the computer 8 is that the metal workpiece to be tested has a defect, the industrial computer 6 will control the mechanical arm 7 to grab it and place it in the defective classification area, and vice versa However; after the end, the industrial computer 6 controls all the above-mentioned operating elements to reset.

上述对基于单目立体视觉的待测金属工件缺陷检测装置200的必要结构和运行方式进行了阐述,以下为对其中必要结构的型号和特征进行进一步说明:The necessary structure and operation mode of the metal workpiece defect detection device 200 to be tested based on monocular stereo vision have been described above, and the models and features of the necessary structure are further described below:

请参阅图10,圆形光源控制器3的朝向载物台4的表面涂有黑色漆(图未示),目的是为减少自身的光源反射,从而降低自身对待测金属工件检测过程中的影响;减少相机1所拍摄区域的背景干扰,已达到简单地将待测金属工件分割出来的目的。Please refer to Fig. 10, the surface of the circular light source controller 3 facing the stage 4 is coated with black paint (not shown), the purpose is to reduce its own light source reflection, thereby reducing its own influence on the detection process of the metal workpiece to be measured ; Reduce the background interference of the area photographed by the camera 1, and achieve the purpose of simply segmenting the metal workpiece to be tested.

可选地,其中光源2为红外LED点光源,红外LED点光源的优势在于,减少了环境光的干扰;可以在自然环境中使用该图像采集装置,而不仅仅局限于暗室坏境。Optionally, the light source 2 is an infrared LED point light source. The advantage of the infrared LED point light source is that it reduces the interference of ambient light; the image acquisition device can be used in a natural environment, not limited to a dark room environment.

可选地,圆形光源控制器3控制光源2的方式是自动模式,通过圆形光源控制器3控制环形矩阵排列的8个光源2 亮灭。Optionally, the circular light source controller 3 controls the light source 2 in an automatic mode, and the circular light source controller 3 controls the eight light sources 2 arranged in a circular matrix to turn on and off.

可选地,相机1可选地是500万高清16mm定焦镜头,其最大靶面尺寸是2/3”;具体的型号可以是MER-131-210U3M(-L)NIR,传感器是1/2”COMS,光学分辨率是1280*1024,像元尺寸是4.8*4.8um;Optionally, camera 1 is optionally a 5 million high-definition 16mm fixed-focus lens, and its maximum target size is 2/3”; the specific model can be MER-131-210U3M(-L)NIR, and the sensor is 1/2 "COMS, optical resolution is 1280*1024, pixel size is 4.8*4.8um;

可以理解,机器视觉系统中,镜头相当于人的眼睛,其主要作用是将目标图像聚焦在传感器的光敏面阵上,因此光学分辨率越高,即越适合高精度检测,同理,靶面尺寸说的就是这个图像传感器的感光部分的大小。一般用英寸来表示,而2/3”可获取比较大的通光量以及更好的景深。It can be understood that in a machine vision system, the lens is equivalent to the human eye, and its main function is to focus the target image on the photosensitive area array of the sensor. Therefore, the higher the optical resolution, the more suitable for high-precision detection. Similarly, the target surface The size refers to the size of the photosensitive part of the image sensor. Generally expressed in inches, and 2/3" can obtain a relatively large amount of light and a better depth of field.

可选地,光源2的型号是OSRAM;SFH4232A,功率是2.1W,波长是850nm。Optionally, the model of the light source 2 is OSRAM; SFH4232A, the power is 2.1W, and the wavelength is 850nm.

本领域技术人员也应当理解,如果将本发明所述方法或者装置、经过简单变化、在其上述方法增添功能进行组合、或者在其装置上进行替换,如各组件进行型号材料上的替换、使用环境进行替换、各组件位置关系进行简单替换等;或者将其所构成的产品一体设置;或者可拆卸设计;凡组合后的组件可以组成具有特定功能的方法/设备/装置,用这样的方法/设备/装置替代本发明的方法和装置均同样落在本发明的保护范围内。Those skilled in the art should also understand that if the method or device described in the present invention is simply changed, combined with functions added to the above-mentioned method, or replaced on the device, such as the replacement of the model material of each component, the use of Replacement of the environment, simple replacement of the positional relationship of each component, etc.; or the product it constitutes is integrated; or detachable design; where the combined components can form a method/equipment/device with specific functions, with such a method/ Equipment/devices that replace the methods and devices of the present invention also fall within the protection scope of the present invention.

与现有技术相比,本发明所提供的一种基于单目立体视觉的金属工件缺陷检测方法具有如下的有益效果:Compared with the prior art, a metal workpiece defect detection method based on monocular stereo vision provided by the present invention has the following beneficial effects:

1、本发明基于单目立体视觉的金属工件缺陷检测方法,利用多个方位即至少三个上的光源,每个方位都标定最佳的光源方向向量,从而使得每次的待测金属工件各个方位均在最终光源方向向量下,再通过引入一个不存在缺陷的模板工件,通过将模板工件和其待测金属工件在最终光源方向向量下采集的图像进行对比,从而判断得到待测金属工件是否存在缺陷,这样的优势在于:1. The metal workpiece defect detection method based on monocular stereo vision of the present invention utilizes multiple azimuths, that is, at least three light sources, and each azimuth is calibrated with the best light source direction vector, so that each metal workpiece to be tested is The azimuths are all under the final light source direction vector, and then by introducing a template workpiece without defects, by comparing the images collected under the final light source direction vector between the template workpiece and its metal workpiece to be tested, it is judged whether the metal workpiece to be tested is There are flaws, the advantages of this are:

第一点是光源是至少三个方位上的,不同于单一光源下的光线,很难将整个待测金属工件覆盖,难免存在过暗的区域,导致后续采集图像存在没被光照覆盖到的死角或者过暗的区域,从而待测金属工件有很多缺陷的位置被忽视掉,从而引起检测不准确;本发明从多个方位设置光源对待测金属工件进行覆盖,使待测金属工件上需要被检测的部位均被光源照射到,从而采集图像时不会存在死角区域,检测精准度和可靠性相对更好;The first point is that the light source is in at least three directions. Unlike the light under a single light source, it is difficult to cover the entire metal workpiece to be tested, and there will inevitably be too dark areas, resulting in dead angles that are not covered by the light in the subsequent collected images. Or too dark areas, so that the positions of many defects of the metal workpiece to be tested are ignored, thereby causing inaccurate detection; the invention sets light sources from multiple directions to cover the metal workpiece to be tested, so that the metal workpiece to be tested needs to be detected All the parts are irradiated by the light source, so there will be no dead angle areas when collecting images, and the detection accuracy and reliability are relatively better;

第二点是每个方位上的光源均通过标定为最佳光源向量,即可以理解为每个光源最合适的方向,这样的好处在于每个方位上均不会出现过曝或者过暗的情况,因此后续采集图像时,不会出现亮点或者暗点,增加了采集图像的质量,从而进一步增加了检测缺陷的准确性;The second point is that the light source in each direction is calibrated as the best light source vector, which can be understood as the most suitable direction for each light source. The advantage of this is that there will be no overexposure or overdarkening in each direction. , so there will be no bright spots or dark spots when the subsequent image is collected, which increases the quality of the collected image, thereby further increasing the accuracy of defect detection;

第三点是每次待测金属工件和模板工件均是在最终光源方向向量下的,保证了对比时参考光源背景的一致,对比于以往的金属工件检测技术,其用于对比的模板工件是在固定情况下的,示例性的如:检测时采取模板工件的图像为之前就预设好的,而不是每次都在同样的光源方向下采集的,这样用于判断待测金属工件十分不准确,导致最终的判断结果误差率较大,从而带来经济损失;本发明将待测金属工件和预设好的模板工件在同样的最终光源方向向量下进行对比,从而变量只有一个,对比后的结果可靠性很高。The third point is that each time the metal workpiece and the template workpiece to be tested are under the direction vector of the final light source, which ensures the consistency of the background of the reference light source during comparison. Compared with the previous metal workpiece detection technology, the template workpiece used for comparison is In a fixed situation, for example: the image of the template workpiece taken during detection is preset before, instead of being collected under the same light source direction every time, so it is very different for judging the metal workpiece to be tested. Accurate, resulting in a large error rate in the final judgment result, which brings economic losses; the present invention compares the metal workpiece to be tested with the preset template workpiece under the same final light source direction vector, so that there is only one variable, and after the comparison The results are highly reliable.

2、光源方向标定的方法现有技术有很多,本发明在每个方位得到最终光源方向向量的方法为,在每个方位上设置光源,且在每个光源的照射范围内设置标定球,用标定球在每个光源的照射范围等间距摆放五次,采集每个标定球在不同位置下的图像,通过算法以获取每个方位下最终光源方向向量,这种方法可快速获取每个方位下的最终光源方向向量,其和其他现有技术的光源标定方法对比的优点在于:使用设备对于光源和相机均无其他特殊的要求,仅需要标定球作为标定工具,且实现过程十分简单,仅需要利用相机对标定球进行拍摄从而采集图像,且计算的过程保证了计算的准确,使用最小二乘法得到的最终光源方向向量,可以理解为标定球在每个方位下不同位置的小球得到的光源方向计算出误差最小的结果。2. There are many methods of light source direction calibration in the prior art. The method of the present invention to obtain the final light source direction vector in each orientation is to set a light source in each orientation, and set a calibration ball within the irradiation range of each light source, using The calibration ball is placed five times at equal intervals in the irradiation range of each light source, and the images of each calibration ball at different positions are collected, and the final light source direction vector in each orientation is obtained through an algorithm. This method can quickly obtain each orientation The final light source direction vector below, compared with other light source calibration methods in the prior art, has the advantage that: the use of equipment has no other special requirements for light source and camera, only the calibration ball is needed as a calibration tool, and the implementation process is very simple. It is necessary to use the camera to shoot the calibration ball to collect the image, and the calculation process ensures the accuracy of the calculation. The final light source direction vector obtained by using the least square method can be understood as the result of the calibration ball in different positions in each orientation. The direction of the light source calculates the result with the smallest error.

同时,每个方位下的光源,标定球需要在每个光源的照射范围等间距摆放五次,保证了光源方向标定的精密度和准确度。At the same time, for the light source in each direction, the calibration ball needs to be placed five times at equal intervals in the irradiation range of each light source, so as to ensure the precision and accuracy of the light source direction calibration.

3、本发明判断待测金属工件是否存在缺陷的方法为:采用一个模板工件在同样的最终光源方向向量下和待测金属工件进行对比,这样的优势在于,保证了输出结果为因变量,而待测金属工件是否存在缺陷则为变亮,其他的统一一致,因此大大提高了检测缺陷的精准性,3. The method for judging whether there is a defect in the metal workpiece to be tested in the present invention is: using a template workpiece to compare with the metal workpiece to be tested under the same final light source direction vector, the advantage of this is that the output result is guaranteed to be a dependent variable, and If there is a defect in the metal workpiece to be tested, it will become brighter, and the others will be uniform, thus greatly improving the accuracy of defect detection.

4、进一步可以在检测完待测金属工件是否存在缺陷后,增加机械手臂进行分选,从而提高生产效率,利用自动化予以增加工件的品质,节省人力,以及减少了工件的不良率,如一些待测金属工件是还未经后处理的脆性件,人手可能造成手痕或者污染,且人工用力不均可能导致待测金属工件变形,机械手臂可调试相对均衡的力度,使工件的品质提高,且机械手臂出错率远比人为要低,增加了成品率。4. Further, after detecting whether there are defects in the metal workpiece to be tested, the mechanical arm can be added for sorting, thereby improving production efficiency, using automation to increase the quality of the workpiece, saving manpower, and reducing the defect rate of the workpiece, such as some waiting The metal workpiece to be tested is a brittle piece that has not been post-processed. Human hands may cause hand marks or pollution, and uneven manual force may cause deformation of the metal workpiece to be tested. The mechanical arm can be adjusted to a relatively balanced force to improve the quality of the workpiece, and The error rate of the robotic arm is far lower than that of humans, which increases the yield.

5、基于单目立体视觉的金属工件缺陷检测方法上,本发明还提出了一种系统,该系统可利用与工厂或者代工厂的流水线以及一些实验室的检测系统,该系统可根据设定的技术指标要求自动对缺陷进行检测,并对有缺陷部位进行分类,还可以根据需要自动分拣、剔除等。5. On the metal workpiece defect detection method based on monocular stereo vision, the present invention also proposes a system, which can use the assembly line of the factory or foundry and the detection system of some laboratories, and the system can be used according to the set Technical indicators require automatic detection of defects, classification of defective parts, and automatic sorting and elimination as needed.

6、基于单目立体视觉的金属工件缺陷检测方法上,本发明还提出了一种基于该方法的装置,该装置采用相机、光源、圆形光源控制器、载物台、工控机以及计算机,三个方向发射光线以使光线完全覆盖待测金属工件,圆形光源控制器控制均匀分布的光源依次单独亮;在每个光源单独亮时相机每次都采集一张图像传输至计算机分析,从而找到每个方位下的最终光源方向向量,因此该装置具有自动对光源方向标定的功能,圆形光源控制器可以控制光源的单独闪亮,相机可以采集图像,从而通过圆形光源控制器、相机、光源、计算机,即可实现找到每个方位下光源的最终光源方向向量,待测金属工件在载物台上可在光源的最终光源方向向量下进行光线覆盖。6. In the metal workpiece defect detection method based on monocular stereo vision, the present invention also proposes a device based on the method, which uses a camera, a light source, a circular light source controller, a stage, an industrial computer and a computer, The light is emitted in three directions so that the light completely covers the metal workpiece to be tested, and the circular light source controller controls the evenly distributed light sources to turn on individually; when each light source is turned on individually, the camera collects an image each time and transmits it to the computer for analysis, thereby Find the final light source direction vector in each orientation, so the device has the function of automatically calibrating the light source direction. The circular light source controller can control the individual flashing of the light source, and the camera can collect images, so that the circular light source controller, camera , light source, and computer, the final light source direction vector of the light source in each orientation can be found, and the metal workpiece to be tested can be covered with light under the final light source direction vector of the light source on the stage.

7、进一步该基于单目立体视觉的金属工件缺陷检测装置还包括驱动导轨以及机械手臂,该驱动导轨可将载物台循环在圆形光源控制器底部和靠近机械手臂的一侧移动,起到一个对载物台上的待测金属工件一个来回运载的功能,机械手臂可以夹取待测金属工件放上载物台,也可将已经检测完的待测金属工件夹取下,从而进行分类,从而使得整个检测的流程全部自动化,相对较稳定,提高了产品的一致性;适合大批量生产,降低了企业生产成本。7. Further, the metal workpiece defect detection device based on monocular stereo vision also includes a driving guide rail and a mechanical arm, and the driving guide rail can circulate the stage at the bottom of the circular light source controller and move on the side close to the mechanical arm, so as to A function of carrying the metal workpiece to be tested back and forth on the stage. The robotic arm can pick up the metal workpiece to be tested and put it on the stage, and can also remove the metal workpiece that has been tested for classification. As a result, the entire detection process is fully automated, relatively stable, and product consistency is improved; it is suitable for mass production and reduces the production cost of the enterprise.

8、所述圆形光源控制器的朝向所述载物台的表面涂有黑色漆;目的是为减少自身的光源反射,从而降低自身对待测金属工件检测过程中的影响,光源为红外LED点光源,传统光源单调的发光效果相比,LED光源是低压微电子产品,成功融合了计算机技术、网络通信技术、图像处理技术、嵌入式控制技术等所以亦是数字信息化产品是半导体光电器件“高新尖”技术具有在线编程、无限升级、灵活多变的特点。8. The surface of the circular light source controller facing the stage is coated with black paint; the purpose is to reduce the reflection of its own light source, thereby reducing its own influence in the detection process of the metal workpiece to be tested. The light source is an infrared LED point Light source, compared with the monotonous luminous effect of traditional light sources, LED light source is a low-voltage microelectronic product that successfully integrates computer technology, network communication technology, image processing technology, embedded control technology, etc., so it is also a digital information product and is a semiconductor optoelectronic device. "High-tech and cutting-edge" technology has the characteristics of online programming, unlimited upgrades, and flexibility.

9、所述相机为500万高清16mm定焦镜头,其最大靶面尺寸是2/3”,所述光源功率是2.1W,波长是850nm,已达到最适合该基于单目立体视觉的金属工件缺陷检测装置的要求,光学分辨率越高,即越适合高精度检测,同理,靶面尺寸说的就是这个图像传感器的感光部分的大小。一般用英寸来表示,而最大为2/3”靶面尺寸的可获取比较大的通光量以及更好的景深。9. The camera is a 5 million high-definition 16mm fixed-focus lens, its maximum target size is 2/3", the power of the light source is 2.1W, and the wavelength is 850nm, which is the most suitable for the metal workpiece based on monocular stereo vision The requirements of the defect detection device, the higher the optical resolution, the more suitable for high-precision detection. Similarly, the size of the target surface refers to the size of the photosensitive part of the image sensor. It is generally expressed in inches, and the maximum is 2/3” The size of the target surface can obtain a relatively large amount of light and a better depth of field.

以上仅为本发明较佳实施例而已,并不用以限制本发明,凡在本发明原则之内所作的任何修改,等同替换和改进等均应包含本发明的保护范围之内。The above are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modification, equivalent replacement and improvement made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims (10)

1. A metal workpiece defect detection method based on monocular stereoscopic vision is used for carrying out defect inspection on a metal workpiece to be detected, and is characterized by comprising the following steps:
step S1: setting light sources in at least three directions by taking a metal workpiece to be measured as a center, and calibrating the directions of the light sources to obtain a final light source direction vector in each direction; and
step S2: presetting a template workpiece, and acquiring images of a metal workpiece to be detected and the template workpiece in at least three directions under final light source direction vectors; the image is digitized and processed and contrasted and analyzed by adopting the principle of photometric stereo vision so as to judge whether the metal workpiece to be detected has defects or not.
2. The method for detecting defects of a metal workpiece based on monocular stereovision as claimed in claim 1, wherein in step S1, the light source direction calibration is performed in at least three directions with the metal workpiece to be detected as the center, so as to obtain the final light source direction vector in each direction, which comprises the following steps:
step S11: providing a light source in each of at least three orientations; thereby obtaining light sources in at least three directions, introducing calibration balls and placing the calibration balls five times in the light source irradiation range of each direction at equal intervals, and collecting the calibration balls under the light sources in all directions, thereby obtaining at least 15 calibration ball images;
step S12: identifying a central point and a highlight point of a calibration ball in each calibration ball image, and calculating the spatial position relationship of the central point and the highlight point; the calibration ball is taken as an orthogonal projection model and combined with the photometric stereo vision principle, so that a light source direction vector under each direction is obtained through calculation; and
step S13: and obtaining a final light source direction vector under each direction by using a least square method according to the light source direction vector obtained by each calibration sphere image.
3. The method for detecting defects of a metal workpiece based on monocular stereovision as set forth in claim 1, wherein in step S2, a template workpiece is preset, and images of the metal workpiece to be detected and the template workpiece under at least three azimuthal final light source direction vectors are obtained; the method adopts the principle of photometric stereo vision to carry out numeralization, processing and contrastive analysis on the image so as to judge whether the metal workpiece to be detected has defects, and specifically comprises the following steps:
step S21, acquiring at least 3 images of the metal workpiece to be detected and the preset template workpiece under at least three final light source direction vectors;
step S22: according to the image obtained in the step S21, utilizing a Phong model based on an orthogonal projection model to obtain surface normal vectors of the metal workpiece to be detected and the template workpiece, respectively establishing a gradient map, carrying out Gaussian conversion on the gradient map to obtain a curvature map, and carrying out morphological processing on the curvature map; and
step S23: performing Bolb analysis on the curvature maps of the metal workpiece to be detected and the preset template workpiece after morphological processing to output a result of whether the metal workpiece to be detected has defects.
4. The method for detecting defects of a metal workpiece based on monocular stereovision as claimed in claim 1, further comprising a step S3 based on the step S2, specifically comprising the steps of:
step S3: and according to the result of the step S2, classifying and grabbing the metal workpiece to be detected by using a mechanical arm.
5. The utility model provides a metal work piece defect detecting system based on monocular stereoscopic vision for carry out defect inspection to the metal work piece that awaits measuring, its characterized in that includes:
a transmitting module: the device is used for emitting light rays to the metal workpiece to be detected from at least three directions;
an acquisition module: the device is used for acquiring an image of the metal workpiece to be detected under the irradiation of the transmitting module;
a processing module: the device is used for calculating the final light source direction vector of each orientation of the transmitting module to the metal workpiece to be detected in each orientation, and calculating and judging whether the metal workpiece to be detected has defects or not;
an execution module: classifying the metal workpiece to be detected;
a control module: and according to the result of the processing module, the transmitting module and the executing module are controlled to perform corresponding actions.
6. A storage medium or a processor storing a computer program, wherein when the storage medium program is executed, the computer program controlling the storage medium or the processor to execute needs to execute a method for detecting defects of a metal workpiece based on monocular stereoscopic vision as set forth in any one of claims 1 to 4.
7. A metal workpiece defect detection device based on monocular stereoscopic vision is used for carrying out defect inspection on a metal workpiece to be detected and is characterized by comprising a camera, a light source, a circular light source controller, an objective table, an industrial personal computer and a computer; the industrial personal computer is electrically connected with the camera, the light source, the circular light source controller, the object stage and the computer, the light source and the camera are both positioned on one surface of the circular light source controller facing the object stage, the camera is positioned in the center of the circular light source controller, and a metal element to be detected can be placed on the object stage;
when a metal workpiece to be detected is placed on the objective table, the industrial personal computer controls the circular light source controller to start responding, and the circular light source controller can control each light source to be sequentially and independently lightened; when each light source is independently lightened, the camera collects one image each time and transmits the image to the computer for analysis, and therefore a final light source direction vector under each direction is found;
wherein, when the computer analyzes the image, the method of step S1 in claim 1 is used.
8. The apparatus according to claim 7, further comprising a driving rail and a robot arm, wherein the stage is fixedly connected to the driving rail, and the industrial personal computer is capable of controlling the driving rail to operate, so that the stage can move circularly on the driving rail, and meanwhile, when the stage moves to the center of the bottom of the circular light source controller, the industrial personal computer obtains a position signal of the stage and feeds the position signal back to the circular light source controller, so as to trigger the circular light source controller to start responding.
9. The metal workpiece defect detection device based on monocular stereoscopic vision of claim 7, wherein when each light source finds a final light source direction vector, the industrial personal computer controls each light source to be independently turned on again, the metal element to be detected is irradiated in the direction of the final light source direction vector, and simultaneously when each light source is turned on, the camera is triggered to perform image acquisition, and then the computer performs calculation processing on the acquired image to judge whether the metal workpiece to be detected has defects;
wherein, when the computer processes the image, the computer needs to rely on the method in step S2 of claim 1.
10. The apparatus for detecting defects of metal workpieces based on monocular stereoscopic vision as claimed in claim 7, wherein the surface of the circular light source controller facing the objective table is coated with black paint, and the light source is an infrared LED point light source; the camera is a 500-ten-thousand high-definition 16mm prime lens, the maximum target surface size is 2/3 ″, the power of the light source is 2.1W, and the wavelength is 850 nm.
CN201910714364.9A 2019-08-03 2019-08-03 Metal workpiece defect detection method, system, storage medium, and device based on monocular stereo vision Pending CN110308153A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910714364.9A CN110308153A (en) 2019-08-03 2019-08-03 Metal workpiece defect detection method, system, storage medium, and device based on monocular stereo vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910714364.9A CN110308153A (en) 2019-08-03 2019-08-03 Metal workpiece defect detection method, system, storage medium, and device based on monocular stereo vision

Publications (1)

Publication Number Publication Date
CN110308153A true CN110308153A (en) 2019-10-08

Family

ID=68083026

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910714364.9A Pending CN110308153A (en) 2019-08-03 2019-08-03 Metal workpiece defect detection method, system, storage medium, and device based on monocular stereo vision

Country Status (1)

Country Link
CN (1) CN110308153A (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111624206A (en) * 2020-07-03 2020-09-04 东北大学 Metal surface defect detection method based on linear array camera stereoscopic vision
CN111879789A (en) * 2020-07-15 2020-11-03 深圳科瑞技术股份有限公司 Metal surface defect detection method and system
CN111896550A (en) * 2020-03-31 2020-11-06 广西师范大学 A surface defect detection device and method
CN112669318A (en) * 2021-03-17 2021-04-16 上海飞机制造有限公司 Surface defect detection method, device, equipment and storage medium
CN112785510A (en) * 2019-11-11 2021-05-11 华为技术有限公司 Image processing method and related product
CN112858318A (en) * 2021-04-26 2021-05-28 惠州高视科技有限公司 Method for distinguishing screen foreign matter defect from dust, electronic equipment and storage medium
CN113658155A (en) * 2021-08-24 2021-11-16 凌云光技术股份有限公司 Object surface flaw detection and analysis method and device based on photometric stereo
CN113870342A (en) * 2021-08-19 2021-12-31 广州超音速自动化科技股份有限公司 Appearance defect detection method, intelligent terminal and storage device
CN113920087A (en) * 2021-10-09 2022-01-11 东北林业大学 Micro component defect detection system and method based on deep learning
CN114155359A (en) * 2022-01-05 2022-03-08 上海赛图图像设备有限公司 Multi-angle scanning image acquisition system and method thereof
CN115272258A (en) * 2022-08-03 2022-11-01 无锡九霄科技有限公司 Metal cylindrical surface defect detection method, system and medium based on machine vision
CN118408940A (en) * 2024-04-26 2024-07-30 苏州苏映视图像软件科技有限公司 Defect detection method, device, equipment and storage medium
CN118483237A (en) * 2024-07-01 2024-08-13 奈米科学仪器装备(杭州)有限公司 A chip surface defect detection system and method based on photometric stereo vision
WO2024193182A1 (en) * 2023-03-23 2024-09-26 长园视觉科技(珠海)有限公司 Method, system and apparatus based on multi-channel separation, and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103286081A (en) * 2013-05-07 2013-09-11 浙江工业大学 Monocular multi-perspective machine vision-based online automatic sorting device for steel ball surface defect
CN105059914A (en) * 2015-07-16 2015-11-18 佛山市普拉迪数控科技有限公司 Detection fixture capable of placing and taking workpieces conveniently
CN105181709A (en) * 2015-10-14 2015-12-23 中国计量学院 Combined multiple-light-source on-line detection device and method for appearance defects of brake pad
CN106855520A (en) * 2017-02-10 2017-06-16 南京航空航天大学 A kind of workpiece, defect detection method based on machine vision
CN207908399U (en) * 2017-12-12 2018-09-25 广西师范大学 A kind of seamless steel pipe detection device
US20190056331A1 (en) * 2014-06-09 2019-02-21 Keyence Corporation Image Inspection Apparatus, Image Inspection Method, Image Inspection Program, Computer-Readable Recording Medium And Recording Device
CN109523541A (en) * 2018-11-23 2019-03-26 五邑大学 A kind of metal surface fine defects detection method of view-based access control model

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103286081A (en) * 2013-05-07 2013-09-11 浙江工业大学 Monocular multi-perspective machine vision-based online automatic sorting device for steel ball surface defect
US20190056331A1 (en) * 2014-06-09 2019-02-21 Keyence Corporation Image Inspection Apparatus, Image Inspection Method, Image Inspection Program, Computer-Readable Recording Medium And Recording Device
CN105059914A (en) * 2015-07-16 2015-11-18 佛山市普拉迪数控科技有限公司 Detection fixture capable of placing and taking workpieces conveniently
CN105181709A (en) * 2015-10-14 2015-12-23 中国计量学院 Combined multiple-light-source on-line detection device and method for appearance defects of brake pad
CN106855520A (en) * 2017-02-10 2017-06-16 南京航空航天大学 A kind of workpiece, defect detection method based on machine vision
CN207908399U (en) * 2017-12-12 2018-09-25 广西师范大学 A kind of seamless steel pipe detection device
CN109523541A (en) * 2018-11-23 2019-03-26 五邑大学 A kind of metal surface fine defects detection method of view-based access control model

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
AHMAD, JAHANZEB: ""An improved photometric stereo through distance estimation and light vector optimization from diffused maxima region"", 《PATTERN RECOGNITION LETTERS》 *
KANG, DONGYEOP 等: ""Development of an inspection system for planar steel surface using multispectral photometric stereo"", 《OPTICAL ENGINEERING》 *
崔吉: "《工业视觉实用教程》", 31 October 2018 *
席锋 秦华锋著: "《位置敏感探测器的定位及结构改进研究》", 31 May 2016 *
谢利民: ""基于近场照明的光度立体视觉算法研究"", 《中国博士学位论文全文数据库》 *
黄秀玲 等: ""基于四光源光度立体法的药品泡罩包装中铝箔缺陷检测方法"", 《包装学报》 *

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112785510B (en) * 2019-11-11 2024-03-05 华为技术有限公司 Image processing method and related product
CN112785510A (en) * 2019-11-11 2021-05-11 华为技术有限公司 Image processing method and related product
CN111896550A (en) * 2020-03-31 2020-11-06 广西师范大学 A surface defect detection device and method
CN111624206B (en) * 2020-07-03 2021-08-31 东北大学 Metal surface defect detection method based on line scan camera stereo vision
CN111624206A (en) * 2020-07-03 2020-09-04 东北大学 Metal surface defect detection method based on linear array camera stereoscopic vision
CN111879789A (en) * 2020-07-15 2020-11-03 深圳科瑞技术股份有限公司 Metal surface defect detection method and system
CN112669318A (en) * 2021-03-17 2021-04-16 上海飞机制造有限公司 Surface defect detection method, device, equipment and storage medium
CN112669318B (en) * 2021-03-17 2021-06-08 上海飞机制造有限公司 Surface defect detection method, device, equipment and storage medium
CN112858318A (en) * 2021-04-26 2021-05-28 惠州高视科技有限公司 Method for distinguishing screen foreign matter defect from dust, electronic equipment and storage medium
CN113870342A (en) * 2021-08-19 2021-12-31 广州超音速自动化科技股份有限公司 Appearance defect detection method, intelligent terminal and storage device
CN113658155A (en) * 2021-08-24 2021-11-16 凌云光技术股份有限公司 Object surface flaw detection and analysis method and device based on photometric stereo
CN113920087A (en) * 2021-10-09 2022-01-11 东北林业大学 Micro component defect detection system and method based on deep learning
CN114155359A (en) * 2022-01-05 2022-03-08 上海赛图图像设备有限公司 Multi-angle scanning image acquisition system and method thereof
CN115272258A (en) * 2022-08-03 2022-11-01 无锡九霄科技有限公司 Metal cylindrical surface defect detection method, system and medium based on machine vision
WO2024193182A1 (en) * 2023-03-23 2024-09-26 长园视觉科技(珠海)有限公司 Method, system and apparatus based on multi-channel separation, and storage medium
CN118408940A (en) * 2024-04-26 2024-07-30 苏州苏映视图像软件科技有限公司 Defect detection method, device, equipment and storage medium
CN118483237A (en) * 2024-07-01 2024-08-13 奈米科学仪器装备(杭州)有限公司 A chip surface defect detection system and method based on photometric stereo vision

Similar Documents

Publication Publication Date Title
CN110308153A (en) Metal workpiece defect detection method, system, storage medium, and device based on monocular stereo vision
TWI658524B (en) System and method for inspecting a wafer (1)
US10068326B2 (en) System and method for enhancing visual inspection of an object
CN106802301B (en) Machine vision online detection system and method for engine valve
CN108375585A (en) A kind of multiangle visual defect detection platform and detection method
TW201100779A (en) System and method for inspecting a wafer (3)
CN109211110A (en) A kind of flat-type workpiece size detection system and method based on machine vision
JP5728699B2 (en) Surface inspection apparatus, surface inspection method, and surface inspection program
TW201324645A (en) System and method for inspecting a wafer (4)
EP4202424A1 (en) Method and system for inspection of welds
WO2024160208A1 (en) Detection method, detection device and detection system
CN110956627A (en) Intelligent optical detection sample characteristic and flaw intelligent lighting image capturing method and device
CN114998308A (en) Defect detection method and system based on photometric stereo
CN114280075B (en) Online visual detection system and detection method for surface defects of pipe parts
CN110715930A (en) Precise optical surface weak defect microscopic illumination method and device
JP5224288B2 (en) Surface inspection apparatus and surface inspection method
CN106530315B (en) Target extraction system and method for medium and small objects under full angle
CN114577805A (en) MiniLED backlight panel defect detection method and device
CN109945842B (en) Leak detection and labeling error analysis method for end-face labels of bundled round steel
CN106841226A (en) A kind of cable orientation detection correction system
CN118882520A (en) A three-dimensional detection device and method for surface defects of large-aperture curved optical elements
CN109785290A (en) Normalized steel plate defect detection method is shone based on local light
CN111812120B (en) A flip-type lens defect detection device and method
CN111323425A (en) A multi-camera visual inspection device and method
CN111239162A (en) Full-automatic glasses lens check out test set

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191008