+

CN118655084A - Surface defect detection method, system, electronic device and storage medium - Google Patents

Surface defect detection method, system, electronic device and storage medium Download PDF

Info

Publication number
CN118655084A
CN118655084A CN202411148073.5A CN202411148073A CN118655084A CN 118655084 A CN118655084 A CN 118655084A CN 202411148073 A CN202411148073 A CN 202411148073A CN 118655084 A CN118655084 A CN 118655084A
Authority
CN
China
Prior art keywords
defect
target object
image
shape
graph
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202411148073.5A
Other languages
Chinese (zh)
Other versions
CN118655084B (en
Inventor
郁梦辉
王磊
韩昭嵘
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Lingxi Robot Intelligent Technology Co ltd
Original Assignee
Hangzhou Lingxi Robot Intelligent Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Lingxi Robot Intelligent Technology Co ltd filed Critical Hangzhou Lingxi Robot Intelligent Technology Co ltd
Priority to CN202411148073.5A priority Critical patent/CN118655084B/en
Publication of CN118655084A publication Critical patent/CN118655084A/en
Application granted granted Critical
Publication of CN118655084B publication Critical patent/CN118655084B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/95Investigating the presence of flaws or contamination characterised by the material or shape of the object to be examined
    • G01N21/952Inspecting the exterior surface of cylindrical bodies or wires
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The application relates to a surface defect detection method and a system, and relates to the defect detection field, wherein the method comprises the following steps: acquiring a 2.5D image set of a target object through a 2.5D imaging system, removing the background of an image in the 2.5D image set to obtain a main body 2.5D image set of the target object, acquiring a shape graph from the main body 2.5D image set, detecting surface defects of the target object according to the shape graph based on a Gaussian band-pass frequency domain filtering method, and synthesizing the shape graph by images acquired by light sources under different phases to characterize the surface concave-convex condition of the target object. The application solves the problem of low accuracy of object surface defect detection, the 2.5D image set obtained by the 2.5D imaging system has good fine defect imaging effect, and the shape chart shows the concave-convex change condition of the battery surface with high contrast, so that the defect area is distinguished from the normal surface, and the accuracy and efficiency of defect detection are improved.

Description

表面缺陷检测方法、系统、电子设备和存储介质Surface defect detection method, system, electronic device and storage medium

技术领域Technical Field

本申请涉及缺陷检测领域,特别是涉及表面缺陷检测方法、系统、电子设备和存储介质。The present application relates to the field of defect detection, and in particular to a surface defect detection method, system, electronic device and storage medium.

背景技术Background Art

外观检测是一些产品(如,圆柱形电池)制造过程中的一个关键质量控制步骤,通常分为三种主要方法:人工检测、传统2D图像检测以及基于深度学习的检测。Appearance inspection is a key quality control step in the manufacturing process of some products (e.g., cylindrical batteries), and is usually divided into three main methods: manual inspection, traditional 2D image inspection, and deep learning-based inspection.

人工检测依赖于工作人员的视觉判断来识别缺陷,效率低,且长时间的重复工作容易导致操作者视觉疲劳,影响判断准确性;传统的2D图像检测技术通过高分辨率相机捕捉电池表面的图像,利用图像处理技术来识别缺陷,2D图像检测受拍摄角度、光照条件的影响较大,可能导致缺陷的成像质量不佳,使得一些细微的或低对比度的缺陷难以被准确识别;深度学习检测方法通过训练算法模型自动识别和分类电池表面的缺陷,深度学习模型通常需要大量的标注数据进行训练,对于样本量少的特定缺陷,检测能力可能会下降。Manual inspection relies on the visual judgment of workers to identify defects, which is inefficient, and long-term repetitive work can easily lead to visual fatigue of the operator, affecting the accuracy of judgment; traditional 2D image detection technology uses a high-resolution camera to capture images of the battery surface and uses image processing technology to identify defects. 2D image detection is greatly affected by the shooting angle and lighting conditions, which may result in poor imaging quality of defects, making some subtle or low-contrast defects difficult to accurately identify; deep learning detection methods automatically identify and classify defects on the battery surface by training algorithm models. Deep learning models usually require a large amount of labeled data for training. For specific defects with a small sample size, the detection capability may be reduced.

目前针对相关技术中物体表面缺陷检测准确率低的问题,尚未提出有效的解决方案。Currently, no effective solution has been proposed for the problem of low accuracy in object surface defect detection in related technologies.

发明内容Summary of the invention

本申请实施例提供了一种表面缺陷检测方法、系统、电子设备和存储介质,以至少解决相关技术中物体表面缺陷检测准确率低的问题。The embodiments of the present application provide a surface defect detection method, system, electronic device and storage medium to at least solve the problem of low accuracy in object surface defect detection in the related art.

第一方面,本申请实施例提供了一种表面缺陷检测方法,所述方法包括:In a first aspect, an embodiment of the present application provides a surface defect detection method, the method comprising:

通过2.5D成像系统获取目标物体的2.5D图像集,所述2.5D成像系统包括高速线扫相机和高速条纹线扫光源;Acquire a 2.5D image set of the target object by a 2.5D imaging system, wherein the 2.5D imaging system includes a high-speed line scanning camera and a high-speed stripe line scanning light source;

对所述2.5D图像集中的图像进行背景去除,得到所述目标物体的主体2.5D图像集;Performing background removal on the images in the 2.5D image set to obtain a main 2.5D image set of the target object;

从所述主体2.5D图像集中获取形状图,基于高斯带通频域滤波方法,根据所述形状图对所述目标物体进行的表面缺陷检测,所述形状图由光源在不同相位下获取的图像合成,表征了所述目标物体的表面凹凸情况。A shape map is obtained from the 2.5D image set of the subject, and surface defect detection of the target object is performed according to the shape map based on a Gaussian bandpass frequency domain filtering method. The shape map is synthesized by images obtained by a light source at different phases, and characterizes the surface concave-convexity of the target object.

在其中一些实施例中,所述基于高斯带通频域滤波方法,根据所述形状图对所述目标物体进行的表面缺陷检测包括:In some embodiments, the surface defect detection of the target object based on the shape graph based on the Gaussian bandpass frequency domain filtering method includes:

对所述形状图进行高斯带通频域滤波,得到滤波图;Performing Gaussian bandpass frequency domain filtering on the shape graph to obtain a filtered graph;

根据所述滤波图和所述形状图,得到滤波前后的差值图;Obtaining a difference map before and after filtering according to the filter map and the shape map;

对所述差值图进行二值化,得到所述表面缺陷图;Binarizing the difference map to obtain the surface defect map;

根据所述表面缺陷图,得到所述目标物体的表面缺陷数据。Surface defect data of the target object is obtained according to the surface defect map.

在其中一些实施例中,所述对所述差值图进行二值化,得到所述表面缺陷图包括:In some embodiments, binarizing the difference map to obtain the surface defect map includes:

基于所述差值图生成缺陷外接矩形框,并根据所述缺陷外接矩形框内像素点的灰度值,确定二值化阈值;Generate a defect circumscribed rectangular frame based on the difference map, and determine a binarization threshold according to the grayscale values of pixels within the defect circumscribed rectangular frame;

基于所述二值化阈值,对所述差值图进行二值化,得到所述表面缺陷图。Based on the binarization threshold, the difference map is binarized to obtain the surface defect map.

在其中一些实施例中,所述对所述形状图进行高斯带通频域滤波,得到滤波图包括:In some embodiments, performing Gaussian bandpass frequency domain filtering on the shape graph to obtain a filtered graph comprises:

确定所述形状图的像素行数和像素列数,基于所述像素行数和所述像素列数生成高斯核;Determining the number of pixel rows and pixel columns of the shape graph, and generating a Gaussian kernel based on the number of pixel rows and the number of pixel columns;

基于傅里叶变换,根据所述高斯核对所述形状图进行空间滤波,得到滤波图。Based on Fourier transform, spatial filtering is performed on the shape image according to the Gaussian kernel to obtain a filtered image.

在其中一些实施例中,所述表面缺陷数据包括缺陷在所述形状图中的坐标数据,所述方法还包括:In some embodiments, the surface defect data includes coordinate data of the defect in the shape map, and the method further includes:

获取所述目标物体的3D点云图;Acquire a 3D point cloud image of the target object;

将所述3D点云图与所述形状图对齐,根据对齐结果和所述缺陷在所述形状图中的坐标数据,得到所述缺陷在所述3D点云图中的3D坐标数据;Aligning the 3D point cloud image with the shape image, and obtaining 3D coordinate data of the defect in the 3D point cloud image according to the alignment result and the coordinate data of the defect in the shape image;

基于所述3D坐标数据,从所述3D点云图中获取所述目标物体表面缺陷的3D数据。Based on the 3D coordinate data, 3D data of the surface defects of the target object are obtained from the 3D point cloud image.

在其中一些实施例中,所述缺陷在所述形状图中的坐标数据包括所述缺陷在所述形状图中的缺陷外接矩形框,以及所述缺陷外接矩形框的2.5D坐标数据;In some embodiments, the coordinate data of the defect in the shape map includes a defect circumscribed rectangular frame of the defect in the shape map, and 2.5D coordinate data of the defect circumscribed rectangular frame;

所述将所述3D点云图与所述形状图对齐,根据对齐结果和缺陷在所述形状图中的坐标数据,得到所述缺陷在所述3D点云图中的3D坐标数据包括:The aligning the 3D point cloud image with the shape image, and obtaining the 3D coordinate data of the defect in the 3D point cloud image according to the alignment result and the coordinate data of the defect in the shape image comprises:

根据所述主体2.5D图像集,生成所述目标物体的第一主体外接矩形框;Generating a first main body circumscribed rectangular frame of the target object according to the main body 2.5D image set;

对所述3D点云图进行背景去除,得到所述目标物体的第二主体外接矩形框;Performing background removal on the 3D point cloud image to obtain a second main body circumscribed rectangular frame of the target object;

根据所述2.5D坐标数据、所述第一主体外接矩形框和所述第二主体外接矩形框,确定所述缺陷外接矩形框在所述3D点云图中的3D坐标数据。The 3D coordinate data of the defect circumscribed rectangular frame in the 3D point cloud image is determined according to the 2.5D coordinate data, the first main body circumscribed rectangular frame and the second main body circumscribed rectangular frame.

在其中一些实施例中,所述方法还包括:In some embodiments, the method further comprises:

将所述缺陷数据与预设缺陷阈值进行比较,comparing the defect data with a preset defect threshold,

若所述缺陷数据小于等于预设缺陷阈值,则所述目标物体为合格品,If the defect data is less than or equal to the preset defect threshold, the target object is a qualified product.

若所述缺陷数据大于预设缺陷阈值,则所述目标物体为不合格品。If the defect data is greater than a preset defect threshold, the target object is a defective product.

第二方面,本申请实施例提供了一种表面缺陷检测系统,所述系统包括:获取模块、处理模块和检测模块,其中,In a second aspect, an embodiment of the present application provides a surface defect detection system, the system comprising: an acquisition module, a processing module and a detection module, wherein:

所述获取模块,用于通过2.5D成像系统获取目标物体的2.5D图像集,所述2.5D成像系统包括高速线扫相机和高速条纹线扫光源;The acquisition module is used to acquire a 2.5D image set of the target object through a 2.5D imaging system, wherein the 2.5D imaging system includes a high-speed line scanning camera and a high-speed stripe line scanning light source;

所述处理模块,用于对所述2.5D图像集中的图像进行背景去除,得到所述目标物体的主体2.5D图像集;The processing module is used to remove the background of the images in the 2.5D image set to obtain a main 2.5D image set of the target object;

所述检测模块,用于从所述主体2.5D图像集中获取形状图,基于高斯带通频域滤波方法,根据所述形状图对所述目标物体进行的表面缺陷检测,所述形状图由光源在不同相位下获取的图像合成,表征了所述目标物体的表面凹凸情况。The detection module is used to obtain a shape map from the main body 2.5D image set, and based on a Gaussian bandpass frequency domain filtering method, perform surface defect detection on the target object according to the shape map. The shape map is synthesized by images obtained by a light source at different phases, and represents the surface convexity of the target object.

第三方面,本申请实施例提供了一种计算机设备,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如上述第一方面所述的表面缺陷检测方法。In a third aspect, an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the surface defect detection method as described in the first aspect above is implemented.

第四方面,本申请实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上述第一方面所述的表面缺陷检测方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the surface defect detection method as described in the first aspect above.

相比于相关技术,本申请实施例提供的表面缺陷检测方法,通过2.5D成像系统获取目标物体的2.5D图像集,2.5D成像系统包括高速线扫相机和高速条纹线扫光源,对2.5D图像集中的图像进行背景去除,得到目标物体的主体2.5D图像集,从主体2.5D图像集中获取形状图,基于高斯带通频域滤波方法,根据形状图对目标物体进行的表面缺陷检测,形状图由光源在不同相位下获取的图像合成,表征了目标物体的表面凹凸情况,通过2.5D成像系统获取的2.5D图像集,细微缺陷成像效果好,形状图通过高对比度地展示电池表面的凹凸变化情况,使得缺陷区域与正常表面形成区分,提高了缺陷检测的准确率和效率。Compared with the related art, the surface defect detection method provided in the embodiment of the present application obtains a 2.5D image set of the target object through a 2.5D imaging system. The 2.5D imaging system includes a high-speed line scan camera and a high-speed stripe line scan light source. The background of the images in the 2.5D image set is removed to obtain a main 2.5D image set of the target object, and a shape map is obtained from the main 2.5D image set. Based on the Gaussian bandpass frequency domain filtering method, surface defect detection is performed on the target object according to the shape map. The shape map is synthesized by images obtained by the light source at different phases, and characterizes the surface concave-convex conditions of the target object. The 2.5D image set obtained by the 2.5D imaging system has a good imaging effect of subtle defects. The shape map displays the concave-convex changes of the battery surface with high contrast, so that the defective area is distinguished from the normal surface, thereby improving the accuracy and efficiency of defect detection.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

图1是根据本申请实施例的表面缺陷检测方法的流程图;FIG1 is a flow chart of a surface defect detection method according to an embodiment of the present application;

图2是根据本申请实施例的一种高斯带通频域滤波检测方法的流程图;FIG2 is a flow chart of a Gaussian bandpass frequency domain filtering detection method according to an embodiment of the present application;

图3是根据本申请实施例的一种表面缺陷检测方法的流程图;FIG3 is a flow chart of a surface defect detection method according to an embodiment of the present application;

图4是根据本申请实施例的表面缺陷检测系统的结构框图;FIG4 is a structural block diagram of a surface defect detection system according to an embodiment of the present application;

图5是根据本申请实施例的电子设备的内部结构示意图。FIG. 5 is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行描述和说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。基于本申请提供的实施例,本领域普通技术人员在没有作出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

显而易见地,下面描述中的附图仅仅是本申请的一些示例或实施例,对于本领域的普通技术人员而言,在不付出创造性劳动的前提下,还可以根据这些附图将本申请应用于其他类似情景。此外,还可以理解的是,虽然这种开发过程中所作出的努力可能是复杂并且冗长的,然而对于与本申请公开的内容相关的本领域的普通技术人员而言,在本申请揭露的技术内容的基础上进行的一些设计,制造或者生产等变更只是常规的技术手段,不应当理解为本申请公开的内容不充分。Obviously, the drawings described below are only some examples or embodiments of the present application. For ordinary technicians in this field, the present application can also be applied to other similar scenarios based on these drawings without creative work. In addition, it can also be understood that although the efforts made in this development process may be complicated and lengthy, for ordinary technicians in this field related to the content disclosed in this application, some changes in design, manufacturing or production based on the technical content disclosed in this application are just conventional technical means, and should not be understood as insufficient content disclosed in this application.

在本申请中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域普通技术人员显式地和隐式地理解的是,本申请所描述的实施例在不冲突的情况下,可以与其它实施例相结合。Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those of ordinary skill in the art that the embodiments described in this application may be combined with other embodiments without conflict.

除非另作定义,本申请所涉及的技术术语或者科学术语应当为本申请所属技术领域内具有一般技能的人士所理解的通常意义。本申请所涉及的“一”、“一个”、“一种”、“该”等类似词语并不表示数量限制,可表示单数或复数。本申请所涉及的术语“包括”、“包含”、“具有”以及它们任何变形,意图在于覆盖不排他的包含;例如包含了一系列步骤或模块(单元)的过程、方法、系统、产品或设备没有限定于已列出的步骤或单元,而是可以还包括没有列出的步骤或单元,或可以还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。本申请所涉及的“连接”、“相连”、“耦接”等类似的词语并非限定于物理的或者机械的连接,而是可以包括电气的连接,不管是直接的还是间接的。本申请所涉及的“多个”是指两个或两个以上。“和/或”描述关联对象的关联关系,表示可以存在三种关系,例如,“A和/或B”可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。本申请所涉及的术语“第一”、“第二”、“第三”等仅仅是区别类似的对象,不代表针对对象的特定排序。Unless otherwise defined, the technical terms or scientific terms involved in this application should be understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the" and the like involved in this application do not indicate a quantity limitation, and may indicate the singular or plural. The terms "include", "comprise", "have" and any of their variations involved in this application are intended to cover non-exclusive inclusions; for example, a process, method, system, product or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include unlisted steps or units, or may also include other steps or units inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And/or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and/or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. The character "/" generally indicates that the objects before and after are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

本实施例提供了一种表面缺陷检测方法。图1是根据本申请实施例的表面缺陷检测方法的流程图,如图1所示,该流程包括如下步骤:This embodiment provides a surface defect detection method. FIG1 is a flow chart of the surface defect detection method according to an embodiment of the present application. As shown in FIG1 , the process includes the following steps:

步骤S101,通过2.5D成像系统获取目标物体的2.5D图像集,2.5D成像系统包括高速线扫相机和高速条纹线扫光源。Step S101 , acquiring a 2.5D image set of a target object through a 2.5D imaging system, wherein the 2.5D imaging system includes a high-speed line scan camera and a high-speed stripe line scan light source.

高速线扫相机,用于获取待扫描物体的图像。2.5D成像系统中使用的光源为专用的高速条纹线扫光源,可以一边改变相位一边进行条纹发光,以实现条纹的高速变化,从而与相机的高速拍摄达成同步。2.5D成像系统还可以包括控制器,用于控制线扫光源和高速线扫相机。The high-speed line scan camera is used to obtain an image of the object to be scanned. The light source used in the 2.5D imaging system is a dedicated high-speed stripe line scan light source, which can emit stripe light while changing the phase to achieve high-speed changes in the stripes, thereby achieving synchronization with the high-speed shooting of the camera. The 2.5D imaging system may also include a controller for controlling the line scan light source and the high-speed line scan camera.

通过2.5D成像系统获取目标物体表面的2.5D图像集,2.5D图像集包括平均图、镜面反射图像、漫反射图像、光泽比图像、深度图和形状图,其中,形状图是对光源在不同相位下获取的图像进行解码合成得到的,表征了目标物体的表面凹凸变化情况。A 2.5D image set of the target object surface is obtained through a 2.5D imaging system. The 2.5D image set includes an average image, a specular reflection image, a diffuse reflection image, a gloss ratio image, a depth map and a shape map. The shape map is obtained by decoding and synthesizing images obtained at different phases of the light source, and represents the surface concave-convex changes of the target object.

步骤S102,对2.5D图像集中的图像进行背景去除,得到目标物体的主体2.5D图像集。Step S102: performing background removal on the images in the 2.5D image set to obtain a main 2.5D image set of the target object.

对2.5D图像集进行预处理,包括去除背景并提取目标物体主体区域,确保图像中只包含目标物体本身的信息,并计算目标物体主体区域外接矩形的位置及大小。The 2.5D image set is preprocessed, including removing the background and extracting the main area of the target object, ensuring that the image only contains information about the target object itself, and calculating the position and size of the circumscribed rectangle of the main area of the target object.

在传统的单张2D图像处理时,去除背景需要复杂的步骤分辨目标物体主体轮廓,而本实施例中可以从2.5D图像集中选择背景干扰较少的图直接通过简单的二值化快速提取目标物体主体区域,并且提取的目标物体主体区域适用于该组所有图,保持了处理的一致性的同时提高了处理效率。In traditional single 2D image processing, background removal requires complex steps to distinguish the main contour of the target object. In this embodiment, images with less background interference can be selected from the 2.5D image set to quickly extract the main area of the target object through simple binarization, and the extracted main area of the target object is applicable to all images in the group, thereby maintaining the consistency of processing and improving processing efficiency.

步骤S103,从主体2.5D图像集中获取形状图,基于高斯带通频域滤波方法,根据形状图对目标物体进行的表面缺陷检测,形状图由光源在不同相位下获取的图像合成,表征了目标物体的表面凹凸情况。Step S103, obtaining a shape map from the main 2.5D image set, and performing surface defect detection on the target object according to the shape map based on the Gaussian bandpass frequency domain filtering method. The shape map is synthesized by images obtained by the light source at different phases, and represents the surface concave-convex condition of the target object.

需要说明的是,形状图为去除背景并提取目标物体主体区域后的形状图。It should be noted that the shape image is a shape image after the background is removed and the main area of the target object is extracted.

本实施例中选择凹凸变化成像相对明显的形状图进行缺陷检测。对于具有凹凸变化的缺陷,如目标物体为圆柱电池时,形状图有利于检测圆柱电池的表面划痕、凹坑和焊渣。形状图通过高对比度地展示电池表面的凹凸变化情况,使得缺陷区域与正常表面形成区分,提高了常规平面图像难以觉察的高度差缺陷的识别准确性和效率。In this embodiment, a shape map with relatively obvious concave-convex changes is selected for defect detection. For defects with concave-convex changes, such as when the target object is a cylindrical battery, the shape map is helpful for detecting surface scratches, pits and welding slag of the cylindrical battery. The shape map shows the concave-convex changes on the battery surface with high contrast, distinguishing the defective area from the normal surface, and improving the recognition accuracy and efficiency of height difference defects that are difficult to detect with conventional plane images.

在其中一些实施例中,步骤S103中基于高斯带通频域滤波方法,根据形状图对目标物体进行的表面缺陷检测包括:In some embodiments, the surface defect detection of the target object according to the shape graph based on the Gaussian bandpass frequency domain filtering method in step S103 includes:

步骤S1031,对形状图进行高斯带通频域滤波,得到滤波图。Step S1031, performing Gaussian bandpass frequency domain filtering on the shape graph to obtain a filtered graph.

在其中一些实施例中,步骤S1031具体包括:In some embodiments, step S1031 specifically includes:

步骤S201,确定形状图的像素行数和像素列数,基于像素行数和像素列数生成高斯核。Step S201, determining the number of pixel rows and pixel columns of the shape image, and generating a Gaussian kernel based on the number of pixel rows and pixel columns.

假设形状图的像素行数为M,像素列数为N,以σ1分别生成N*1维高斯核G11和M*1维高斯核G12,并计算M*N维高斯核G1Assuming that the number of pixel rows of the shape graph is M and the number of pixel columns is N, generate N*1-dimensional Gaussian kernel G 11 and M*1-dimensional Gaussian kernel G 12 with σ 1 , and calculate the M*N-dimensional Gaussian kernel G 1 :

其中,α11和α12表示的比例因子,T表示转置。Among them, α 11 and α 12 represent The scaling factor of , T represents the transpose.

再通过相同方法,以σ22 > σ1)计算M*N维高斯核G2Then, the M*N dimensional Gaussian kernel G 2 is calculated using σ 22 > σ 1 ) by the same method.

步骤S202,基于傅里叶变换,根据高斯核对形状图进行空间滤波,得到滤波图。Step S202 , based on Fourier transform, spatial filtering is performed on the shape image according to the Gaussian kernel to obtain a filtered image.

计算高斯核差值G3Calculate the Gaussian kernel difference G 3 :

G3=G2- G1 G3 = G2 - G1

重新排列G3得到G’3,对G’3进行离散傅里叶变换,得到G(u,v)。Rearrange G 3 to obtain G' 3 , and perform discrete Fourier transform on G' 3 to obtain G(u,v).

对形状图进行傅里叶变换:Take a Fourier transform of the shape map:

其中,F(u,v)是形状图f(m,n)离散傅里叶变换的频域结果,M和N分别表示图像的行数和列数,u和v表示频域像素坐标,m和n表示空间域像素坐标,j表示虚数单位。Where F(u,v) is the frequency domain result of the discrete Fourier transform of the shape image f(m,n), M and N represent the number of rows and columns of the image, u and v represent the frequency domain pixel coordinates, m and n represent the spatial domain pixel coordinates, and j represents the imaginary unit.

将F(u,v)与G(u,v)进行乘法运算,得到H(u,v):Multiply F(u,v) by G(u,v) to get H(u,v):

H(u,v)=F(u,v)*G(u,v)H(u,v)=F(u,v)*G(u,v)

然后,将H(u,v)进行离散傅里叶逆变换,得到空间域滤波结果:Then, perform inverse discrete Fourier transform on H(u,v) to obtain the spatial domain filtering result:

f’(m,n)为对形状图进行空间滤波后的滤波图。f’(m,n) is the filtered image after spatial filtering of the shape image.

步骤S1032,根据滤波图和形状图,得到滤波前后的差值图。Step S1032, obtaining a difference map before and after filtering according to the filter map and the shape map.

将滤波图f’(m,n),与f(m,n)作差,得到滤波前后差值图fsubSubtract the filter image f'(m,n) from f(m,n) to get the difference image f sub before and after filtering:

fsub=|f’(m,n)-f(m,n)|f sub =|f'(m,n)-f(m,n)|

其中,|.|表示绝对值。Here, |.| represents an absolute value.

步骤S1033,对差值图进行二值化,得到表面缺陷图。Step S1033, binarizing the difference map to obtain a surface defect map.

在其中一些实施例中步骤S1033具体包括:In some embodiments, step S1033 specifically includes:

步骤S301,基于差值图生成缺陷外接矩形框,并根据缺陷外接矩形框内像素点的灰度值,确定二值化阈值。Step S301, generating a defect bounding rectangle based on the difference map, and determining a binarization threshold according to the grayscale values of the pixels in the defect bounding rectangle.

步骤S302,基于二值化阈值,对差值图进行二值化,得到表面缺陷图。Step S302: binarize the difference image based on the binarization threshold to obtain a surface defect image.

设定缺陷外接矩形框大小为wb*hb,计算缺陷外接矩形框内像素点灰度值的平均值μ和方差δ,设定阈值t:Set the size of the defect's bounding rectangle to w b *h b , calculate the mean μ and variance δ of the grayscale values of the pixels within the defect's bounding rectangle, and set the threshold t:

t=μ+k*δt=μ+k*δ

其中,k为预设系数。对差值图fsub进行局部二值化,得到缺陷图fbinWhere k is a preset coefficient. The difference image f sub is locally binarized to obtain the defect image f bin :

步骤S1034,根据表面缺陷图,得到目标物体的表面缺陷数据。Step S1034, obtaining surface defect data of the target object according to the surface defect map.

表面缺陷数据包括但不限于是缺陷位置和大小。图2是根据本申请实施例的一种高斯带通频域滤波检测方法的流程图。本实施例中使用高斯带通频域滤波方法检测缺陷,并计算缺陷位置、大小信息。高斯带通滤波器允许通过特定频率范围的信号,可以有效地增强图像中的特定细节,同时抑制过高或过低的频率成分,提高了在频域中具有特定频率范围缺陷的检测准确率。Surface defect data includes but is not limited to defect location and size. FIG2 is a flow chart of a Gaussian bandpass frequency domain filtering detection method according to an embodiment of the present application. In this embodiment, a Gaussian bandpass frequency domain filtering method is used to detect defects and calculate defect location and size information. The Gaussian bandpass filter allows signals in a specific frequency range to pass through, which can effectively enhance specific details in the image while suppressing excessively high or low frequency components, thereby improving the detection accuracy of defects with a specific frequency range in the frequency domain.

在其中一些实施例中,表面缺陷数据包括缺陷在形状图中的坐标数据,方法还包括:In some embodiments, the surface defect data includes coordinate data of the defect in the shape map, and the method further includes:

步骤S1035,获取目标物体的3D点云图;Step S1035, obtaining a 3D point cloud image of the target object;

步骤S1036,将3D点云图与形状图对齐,根据对齐结果和缺陷在形状图中的坐标数据,得到缺陷在3D点云图中的3D坐标数据。Step S1036, aligning the 3D point cloud image with the shape image, and obtaining the 3D coordinate data of the defect in the 3D point cloud image based on the alignment result and the coordinate data of the defect in the shape image.

测量非3D的缺陷信息,如划痕长度、焊点面积,仅需对缺陷图fbin做简单的统计处理,而测量3D的缺陷信息,如划痕、凹坑、焊点的实际深度,则需要获取其3D信息进行深度测量。To measure non-3D defect information, such as scratch length and solder joint area, only simple statistical processing of the defect image f bin is required. However, to measure 3D defect information, such as the actual depth of scratches, pits, and solder joints, it is necessary to obtain their 3D information for depth measurement.

在点云图中受到噪点和起伏波动精度的影响,对轻微、细小的缺陷定位较难,高精度的3D相机成本高,因此本实施例中使用2.5D图像进行缺陷定位,再将其与3D点云图对齐,进行缺陷测量。图3是根据本申请实施例的一种表面缺陷检测方法的流程图。In the point cloud image, due to the influence of noise and fluctuations in precision, it is difficult to locate slight and small defects. High-precision 3D cameras are expensive. Therefore, in this embodiment, 2.5D images are used to locate defects, which are then aligned with the 3D point cloud image to measure defects. FIG3 is a flow chart of a surface defect detection method according to an embodiment of the present application.

2.5D图像与3D点云图分辨率不同,且目标物体在图像中位置也不同,需要将2.5D图像的缺陷坐标映射到3D点云图中。The resolution of the 2.5D image is different from that of the 3D point cloud image, and the position of the target object in the image is also different. The defect coordinates of the 2.5D image need to be mapped to the 3D point cloud image.

在其中一些实施例中,缺陷在形状图中的坐标数据包括缺陷在形状图中的缺陷外接矩形框,以及缺陷外接矩形框的2.5D坐标数据;步骤S1036具体包括:In some embodiments, the coordinate data of the defect in the shape map includes the defect circumscribed rectangular frame of the defect in the shape map, and the 2.5D coordinate data of the defect circumscribed rectangular frame; step S1036 specifically includes:

步骤S401,根据主体2.5D图像集,生成目标物体的第一主体外接矩形框。Step S401 : generating a first main body circumscribed rectangular frame of a target object according to a main body 2.5D image set.

步骤S402,对3D点云图进行背景去除,得到目标物体的第二主体外接矩形框。Step S402: removing the background of the 3D point cloud image to obtain a second main body circumscribed rectangular frame of the target object.

步骤S403,根据2.5D坐标数据、第一主体外接矩形框和第二主体外接矩形框,确定缺陷外接矩形框在3D点云图中的3D坐标数据。Step S403, determining the 3D coordinate data of the defect circumscribed rectangular frame in the 3D point cloud image according to the 2.5D coordinate data, the first main body circumscribed rectangular frame and the second main body circumscribed rectangular frame.

可选地,对获取到的3D点云图进行去噪并提取目标物体主体区域,计算目标物体主体区域的外接矩形框,宽度和长度分别为w3d,h3d。同时,计算形状图中目标物体主体区域的外接矩形框的宽度和长度分别为w2.5d,h2.5d,缺陷外接矩形框的宽度和长度分别为wd,hd,左上角坐标为(md,nd)。2.5D的形状图中缺陷坐标映射到3D点云图中:Optionally, the acquired 3D point cloud image is denoised and the main area of the target object is extracted, and the bounding rectangle of the main area of the target object is calculated, with a width and length of w 3d and h 3d respectively. At the same time, the width and length of the bounding rectangle of the main area of the target object in the shape image are calculated to be w 2.5d and h 2.5d respectively, and the width and length of the defect bounding rectangle are w d and h d respectively, and the upper left corner coordinates are (m d , n d ). The defect coordinates in the 2.5D shape image are mapped to the 3D point cloud image:

(m’d,n’d)为缺陷外接矩形框左上角坐标在3D点云图中的映射坐标,w’d,h’d分别为缺陷外接矩形框的宽度和长度。( m'd , n'd ) are the mapping coordinates of the upper left corner of the defect's circumscribed rectangular box in the 3D point cloud image, and w'd and h'd are the width and length of the defect's circumscribed rectangular box, respectively.

步骤S1037,基于3D坐标数据,从3D点云图中获取目标物体表面缺陷的3D数据。Step S1037, based on the 3D coordinate data, obtaining 3D data of surface defects of the target object from the 3D point cloud image.

需要说明的是,对于2.5D图像缺陷坐标映射到3D点云图中,也可通过特征点匹配的方法进行图像对齐,然后进行坐标转换。3D点云图中缺陷定位之后,可利用点云距离值计算需要的缺陷深度信息。It should be noted that for mapping the 2.5D image defect coordinates to the 3D point cloud, the image can also be aligned by feature point matching, and then the coordinate conversion can be performed. After the defect is located in the 3D point cloud, the point cloud distance value can be used to calculate the required defect depth information.

在其中一些实施例中,方法还包括:In some embodiments, the method further comprises:

将缺陷数据与预设缺陷阈值进行比较,若缺陷数据小于等于预设缺陷阈值,则目标物体为合格品,若缺陷数据大于预设缺陷阈值,则目标物体为不合格品。The defect data is compared with a preset defect threshold. If the defect data is less than or equal to the preset defect threshold, the target object is a qualified product. If the defect data is greater than the preset defect threshold, the target object is a failed product.

在目标物品为需检测合格情况的产品时,计算提取到的各类缺陷的长度、宽度、深度信息,与检测的标准阈值进行比较,低于检测标准阈值则认为是合格品,高于检测标准阈值的则认为是不合格品。When the target item is a product that needs to be tested for compliance, the length, width, and depth information of each type of defect extracted is calculated and compared with the standard detection threshold. If it is lower than the standard detection threshold, it is considered a qualified product, and if it is higher than the standard detection threshold, it is considered an unqualified product.

通过上述步骤S101至S103,利用2.5D成像系统获取目标物体的2.5D图像集,2.5D成像系统包括高速线扫相机和高速条纹线扫光源,2.5D图像集中的图像进行背景去除,得到目标物体的主体2.5D图像集,从主体2.5D图像集中获取形状图,基于高斯带通频域滤波方法,根据形状图对目标物体进行的表面缺陷检测,形状图由光源在不同相位下获取的图像合成,表征了目标物体的表面凹凸情况,解决了物体表面缺陷检测准确率低的问题,通过2.5D成像系统获取的2.5D图像集,细微缺陷成像效果好,形状图通过高对比度地展示电池表面的凹凸变化情况,使得缺陷区域与正常表面形成区分,提高了缺陷检测的准确率和效率。Through the above steps S101 to S103, a 2.5D image set of the target object is obtained by using a 2.5D imaging system. The 2.5D imaging system includes a high-speed line scan camera and a high-speed stripe line scan light source. The background of the image in the 2.5D image set is removed to obtain a main 2.5D image set of the target object. A shape map is obtained from the main 2.5D image set. Based on the Gaussian bandpass frequency domain filtering method, surface defect detection of the target object is performed according to the shape map. The shape map is synthesized by images obtained by the light source at different phases, which characterizes the surface concave-convex conditions of the target object and solves the problem of low accuracy in detecting surface defects of the object. The 2.5D image set obtained by the 2.5D imaging system has good imaging effect of subtle defects. The shape map displays the concave-convex changes of the battery surface with high contrast, so that the defect area is distinguished from the normal surface, thereby improving the accuracy and efficiency of defect detection.

从2.5D图像集中选择背景干扰较少的图直接通过简单的二值化快速提取目标物体主体区域,并且提取的目标物体主体区域适用于该组所有图,保持了处理的一致性的同时提高了处理效率。The main area of the target object is quickly extracted by selecting images with less background interference from the 2.5D image set through simple binarization. The extracted main area of the target object is applicable to all images in the group, which maintains the consistency of processing and improves the processing efficiency.

利用形状图进行缺陷检测,形状图通过高对比度地展示电池表面的凹凸变化情况,使得缺陷区域与正常表面形成区分,提高了常规平面图像难以觉察的高度差缺陷的识别准确性和效率。Shape maps are used for defect detection. Shape maps show the changes in the concave and convex surfaces of the battery with high contrast, distinguishing the defective area from the normal surface, thereby improving the accuracy and efficiency of identifying height difference defects that are difficult to detect with conventional plane images.

将2.5D图像检测到的缺陷映射到3D点云图中,获取缺陷3D信息,进一步对缺陷进行定性定量分析。The defects detected by the 2.5D image are mapped to the 3D point cloud map to obtain the 3D information of the defects, and further perform qualitative and quantitative analysis of the defects.

需要说明的是,在上述流程中或者附图的流程图中示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

本实施例还提供了一种表面缺陷检测系统,该系统用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”、“单元”、“子单元”等可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。This embodiment also provides a surface defect detection system, which is used to implement the above embodiments and preferred implementations, and will not be repeated here. As used below, the terms "module", "unit", "subunit", etc. can implement a combination of software and/or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

图4是根据本申请实施例的表面缺陷检测系统的结构框图,如图4所示,该系统包括:获取模块51、处理模块52和检测模块53。FIG. 4 is a structural block diagram of a surface defect detection system according to an embodiment of the present application. As shown in FIG. 4 , the system includes: an acquisition module 51 , a processing module 52 and a detection module 53 .

获取模块51,用于通过2.5D成像系统获取目标物体的2.5D图像集,2.5D成像系统包括高速线扫相机和高速条纹线扫光源。The acquisition module 51 is used to acquire a 2.5D image set of the target object through a 2.5D imaging system, where the 2.5D imaging system includes a high-speed line scanning camera and a high-speed stripe line scanning light source.

处理模块52,用于对2.5D图像集中的图像进行背景去除,得到目标物体的主体2.5D图像集。The processing module 52 is used to remove the background of the images in the 2.5D image set to obtain a main 2.5D image set of the target object.

检测模块53,从主体2.5D图像集中获取形状图,基于高斯带通频域滤波方法,根据形状图对目标物体进行的表面缺陷检测,形状图由光源在不同相位下获取的图像合成,表征了目标物体的表面凹凸情况。The detection module 53 obtains a shape map from the main body 2.5D image set, and performs surface defect detection on the target object according to the shape map based on the Gaussian bandpass frequency domain filtering method. The shape map is synthesized by images obtained by the light source at different phases, and represents the surface convexity of the target object.

在其中一些实施例中,检测模块53包括:滤波模块、做差模块、缺陷图生成模块和缺陷数据获取模块。In some embodiments, the detection module 53 includes: a filtering module, a difference module, a defect map generation module and a defect data acquisition module.

滤波模块,用于对形状图进行高斯带通频域滤波,得到滤波图;A filtering module, used for performing Gaussian bandpass frequency domain filtering on the shape graph to obtain a filtered graph;

做差模块,用于根据滤波图和形状图,得到滤波前后的差值图。The difference module is used to obtain the difference image before and after filtering based on the filter image and the shape image.

缺陷图生成模块,用于对差值图进行二值化,得到表面缺陷图。The defect map generation module is used to binarize the difference map to obtain a surface defect map.

缺陷数据获取模块,用于根据表面缺陷图,得到目标物体的表面缺陷数据。The defect data acquisition module is used to obtain the surface defect data of the target object according to the surface defect map.

在其中一些实施例中,缺陷图生成模块包括:阈值确定模块和二值化模块。In some of the embodiments, the defect map generating module includes: a threshold determination module and a binarization module.

阈值确定模块,用于基于差值图生成缺陷外接矩形框,并根据缺陷外接矩形框内像素点的灰度值,确定二值化阈值。The threshold determination module is used to generate a defect circumscribed rectangular frame based on the difference map, and determine the binarization threshold according to the grayscale value of the pixel points in the defect circumscribed rectangular frame.

二值化模块,用于基于二值化阈值,对差值图进行二值化,得到表面缺陷图。The binarization module is used to binarize the difference image based on the binarization threshold to obtain a surface defect image.

在其中一些实施例中,滤波模块包括:高斯核生成模块和滤波图生成模块。In some of the embodiments, the filtering module includes: a Gaussian kernel generation module and a filter map generation module.

高斯核生成模块,用于确定形状图的像素行数和像素列数,基于像素行数和像素列数生成高斯核;A Gaussian kernel generation module, used for determining the number of pixel rows and pixel columns of the shape image, and generating a Gaussian kernel based on the number of pixel rows and pixel columns;

滤波图生成模块,用于基于傅里叶变换,根据高斯核对形状图进行空间滤波,得到滤波图。The filter image generation module is used to perform spatial filtering on the shape image based on Fourier transform and Gaussian kernel to obtain the filter image.

在其中一些实施例中,表面缺陷数据包括缺陷在形状图中的坐标数据,系统还包括:点云生成模块、映射模块和3D数据获取模块。In some of the embodiments, the surface defect data includes coordinate data of the defect in the shape map, and the system further includes: a point cloud generation module, a mapping module and a 3D data acquisition module.

点云生成模块,用于获取目标物体的3D点云图。The point cloud generation module is used to obtain the 3D point cloud image of the target object.

映射模块,用于将3D点云图与形状图对齐,根据对齐结果和缺陷在形状图中的坐标数据,得到缺陷在3D点云图中的3D坐标数据。The mapping module is used to align the 3D point cloud image with the shape image, and obtain the 3D coordinate data of the defect in the 3D point cloud image according to the alignment result and the coordinate data of the defect in the shape image.

3D数据获取模块,用于基于3D坐标数据,从3D点云图中获取目标物体表面缺陷的3D数据。The 3D data acquisition module is used to acquire 3D data of surface defects of the target object from the 3D point cloud image based on the 3D coordinate data.

在其中一些实施例中,缺陷在形状图中的坐标数据包括缺陷在形状图中的缺陷外接矩形框,以及缺陷外接矩形框的2.5D坐标数据;映射模块包括:第一框图模块、第二框图模块和坐标确定模块。In some embodiments, the coordinate data of the defect in the shape map includes the defect circumscribed rectangular box in the shape map and the 2.5D coordinate data of the defect circumscribed rectangular box; the mapping module includes: a first frame module, a second frame module and a coordinate determination module.

第一框图模块,用于根据主体2.5D图像集,生成目标物体的第一主体外接矩形框。The first frame module is used to generate a first main body circumscribed rectangular frame of the target object according to the main body 2.5D image set.

第二框图模块,用于对3D点云图进行背景去除,得到目标物体的第二主体外接矩形框;The second frame module is used to remove the background of the 3D point cloud image to obtain a second main body circumscribed rectangular frame of the target object;

坐标确定模块,用于根据2.5D坐标数据、第一主体外接矩形框和第二主体外接矩形框,确定缺陷外接矩形框在3D点云图中的3D坐标数据。The coordinate determination module is used to determine the 3D coordinate data of the defect circumscribed rectangular frame in the 3D point cloud image according to the 2.5D coordinate data, the first main body circumscribed rectangular frame and the second main body circumscribed rectangular frame.

在其中一些实施例中,系统还包括:判断模块。In some of the embodiments, the system further includes: a judgment module.

判断模块,用于将缺陷数据与预设缺陷阈值进行比较,若缺陷数据小于等于预设缺陷阈值,则目标物体为合格品,若缺陷数据大于预设缺陷阈值,则目标物体为不合格品。The judgment module is used to compare the defect data with a preset defect threshold. If the defect data is less than or equal to the preset defect threshold, the target object is a qualified product. If the defect data is greater than the preset defect threshold, the target object is a failed product.

通过上述系统,获取模块51通过2.5D成像系统获取目标物体的2.5D图像集,2.5D成像系统包括高速线扫相机和高速条纹线扫光源,处理模块52对2.5D图像集中的图像进行背景去除,得到目标物体的主体2.5D图像集,检测模块53从主体2.5D图像集中获取形状图,基于高斯带通频域滤波方法,根据形状图对目标物体进行的表面缺陷检测,形状图由光源在不同相位下获取的图像合成,表征了目标物体的表面凹凸情况,解决了物体表面缺陷检测准确率低的问题,通过2.5D成像系统获取的2.5D图像集,细微缺陷成像效果好,形状图通过高对比度地展示电池表面的凹凸变化情况,使得缺陷区域与正常表面形成区分,提高了缺陷检测的准确率和效率。Through the above system, the acquisition module 51 acquires a 2.5D image set of the target object through a 2.5D imaging system, the 2.5D imaging system includes a high-speed line scan camera and a high-speed stripe line scan light source, the processing module 52 removes the background of the image in the 2.5D image set to obtain a main 2.5D image set of the target object, and the detection module 53 acquires a shape map from the main 2.5D image set, and performs surface defect detection on the target object according to the shape map based on a Gaussian bandpass frequency domain filtering method. The shape map is synthesized by images acquired by the light source at different phases, characterizing the surface concave-convex condition of the target object, solving the problem of low accuracy in detecting surface defects of the object. The 2.5D image set acquired by the 2.5D imaging system has a good imaging effect for subtle defects, and the shape map displays the concave-convex changes on the battery surface with high contrast, so that the defect area is distinguished from the normal surface, thereby improving the accuracy and efficiency of defect detection.

需要说明的是,上述各个模块可以是功能模块也可以是程序模块,既可以通过软件来实现,也可以通过硬件来实现。对于通过硬件来实现的模块而言,上述各个模块可以位于同一处理器中;或者上述各个模块还可以按照任意组合的形式分别位于不同的处理器中。It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

本实施例还提供了一种电子设备,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。This embodiment further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

可选地,上述电子设备还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。Optionally, the electronic device may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.

可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:

S1,通过2.5D成像系统获取目标物体的2.5D图像集,2.5D成像系统包括高速线扫相机和高速条纹线扫光源。S1, acquiring a 2.5D image set of a target object through a 2.5D imaging system, wherein the 2.5D imaging system includes a high-speed line scanning camera and a high-speed stripe line scanning light source.

S2,对2.5D图像集中的图像进行背景去除,得到目标物体的主体2.5D图像集。S2, performing background removal on the images in the 2.5D image set to obtain a main 2.5D image set of the target object.

S3,从主体2.5D图像集中获取形状图,基于高斯带通频域滤波方法,根据形状图对目标物体进行的表面缺陷检测,形状图由光源在不同相位下获取的图像合成,表征了目标物体的表面凹凸情况。S3, obtains a shape map from the main 2.5D image set, and performs surface defect detection on the target object based on the shape map based on the Gaussian bandpass frequency domain filtering method. The shape map is synthesized by images obtained by the light source at different phases, which characterizes the surface concave-convexity of the target object.

需要说明的是,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.

在一个实施例中,图5是根据本申请实施例的电子设备的内部结构示意图,如图5所示,提供了一种电子设备,该电子设备可以是服务器,其内部结构图可以如图5所示。该电子设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该电子设备的处理器用于提供计算和控制能力。该电子设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该电子设备的数据库用于存储数据。该电子设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种表面缺陷检测方法。In one embodiment, FIG5 is a schematic diagram of the internal structure of an electronic device according to an embodiment of the present application. As shown in FIG5, an electronic device is provided, which may be a server, and its internal structure diagram may be as shown in FIG5. The electronic device includes a processor, a memory, a network interface, and a database connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the electronic device is used to store data. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a surface defect detection method is implemented.

本领域技术人员可以理解,图5中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的电子设备的限定,具体的电子设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art will understand that the structure shown in FIG. 5 is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,该计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink) DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and/or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

本领域的技术人员应该明白,以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。Those skilled in the art should understand that the technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims (10)

1. A method of detecting surface defects, the method comprising:
Acquiring a 2.5D image set of a target object by a 2.5D imaging system, the 2.5D imaging system comprising a high-speed line scan camera and a high-speed fringe line scan light source;
removing the background of the images in the 2.5D image set to obtain a main body 2.5D image set of the target object;
And acquiring a shape graph from the main body 2.5D image set, and detecting surface defects of the target object according to the shape graph based on a Gaussian band-pass frequency domain filtering method, wherein the shape graph is synthesized by images acquired by light sources under different phases, so that the surface concave-convex condition of the target object is represented.
2. The method according to claim 1, wherein the surface defect detection of the target object according to the shape map based on the gaussian bandpass frequency domain filtering method comprises:
carrying out Gaussian band-pass frequency domain filtering on the shape graph to obtain a filtering graph;
obtaining a difference value diagram before and after filtering according to the filtering diagram and the shape diagram;
binarizing the difference value graph to obtain the surface defect graph;
and obtaining surface defect data of the target object according to the surface defect map.
3. The method of claim 2, wherein binarizing the difference map to obtain the surface defect map comprises:
generating a defect external rectangular frame based on the difference value diagram, and determining a binarization threshold according to the gray value of the pixel point in the defect external rectangular frame;
And based on the binarization threshold value, binarizing the difference value graph to obtain the surface defect graph.
4. The method of claim 2, wherein said gaussian bandpass frequency domain filtering said shape map to obtain a filtered map comprises:
Determining the pixel row number and the pixel column number of the shape graph, and generating a Gaussian kernel based on the pixel row number and the pixel column number;
And based on Fourier transformation, performing spatial filtering according to the shape graph by the Gaussian kernel to obtain a filtering graph.
5. The method of claim 2, wherein the surface defect data comprises coordinate data of a defect in the shape map, the method further comprising:
Acquiring a 3D point cloud image of the target object;
Aligning the 3D point cloud image with the shape image, and obtaining 3D coordinate data of the defect in the 3D point cloud image according to an alignment result and the coordinate data of the defect in the shape image;
And acquiring 3D data of the surface defect of the target object from the 3D point cloud image based on the 3D coordinate data.
6. The method of claim 5, wherein the coordinate data of the defect in the shape map comprises a defect bounding rectangular box of the defect in the shape map, and 2.5D coordinate data of the defect bounding rectangular box;
Aligning the 3D point cloud image with the shape image, and obtaining 3D coordinate data of the defect in the 3D point cloud image according to an alignment result and coordinate data of the defect in the shape image includes:
generating a first main body circumscribed rectangular frame of the target object according to the main body 2.5D image set;
Removing the background of the 3D point cloud image to obtain a second main body circumscribed rectangular frame of the target object;
And determining 3D coordinate data of the defect circumscribed rectangular frame in the 3D point cloud picture according to the 2.5D coordinate data, the first main body circumscribed rectangular frame and the second main body circumscribed rectangular frame.
7. The method according to claim 2, wherein the method further comprises:
Comparing the defect data with a preset defect threshold,
If the defect data is less than or equal to a preset defect threshold value, the target object is a qualified product,
And if the defect data is larger than a preset defect threshold value, the target object is a defective product.
8. A surface defect detection system, the system comprising: the device comprises an acquisition module, a processing module and a detection module, wherein,
The acquisition module is used for acquiring a 2.5D image set of the target object through a 2.5D imaging system, and the 2.5D imaging system comprises a high-speed line scanning camera and a high-speed fringe line scanning light source;
The processing module is used for removing the background of the images in the 2.5D image set to obtain a main body 2.5D image set of the target object;
the detection module is used for acquiring a shape graph from the main body 2.5D image in a concentrated mode, detecting surface defects of the target object according to the shape graph based on a Gaussian band-pass frequency domain filtering method, and synthesizing the shape graph by images acquired by light sources under different phases to characterize the surface concave-convex condition of the target object.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the surface defect detection method according to any of claims 1 to 7 when executing the computer program.
10. A storage medium having stored thereon a computer program, wherein the program when executed by a processor implements the surface defect detection method according to any one of claims 1 to 7.
CN202411148073.5A 2024-08-21 2024-08-21 Surface defect detection method, system, electronic device and storage medium Active CN118655084B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411148073.5A CN118655084B (en) 2024-08-21 2024-08-21 Surface defect detection method, system, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411148073.5A CN118655084B (en) 2024-08-21 2024-08-21 Surface defect detection method, system, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN118655084A true CN118655084A (en) 2024-09-17
CN118655084B CN118655084B (en) 2024-12-24

Family

ID=92704512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411148073.5A Active CN118655084B (en) 2024-08-21 2024-08-21 Surface defect detection method, system, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN118655084B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119850606A (en) * 2025-03-19 2025-04-18 苏州苏映视图像软件科技有限公司 Image defect detection method, device, micro-distance imaging equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180150929A1 (en) * 2015-05-11 2018-05-31 Siemens Aktiengesellschaft Method and system for registration of 2d/2.5d laparoscopic and endoscopic image data to 3d volumetric image data
CN114119469A (en) * 2021-10-13 2022-03-01 东方晶源微电子科技(北京)有限公司 Image processing method, apparatus and system for semiconductor electron beam defect monitoring
CN114764804A (en) * 2022-06-16 2022-07-19 深圳新视智科技术有限公司 Lithium battery pole piece defect detection method, device, equipment and storage medium
CN115494080A (en) * 2022-09-22 2022-12-20 章鱼博士智能技术(上海)有限公司 A method and system for detecting appearance defects of battery pack blue film
CN116071353A (en) * 2023-03-06 2023-05-05 成都盛锴科技有限公司 Bolt assembly detection method and system
CN117372338A (en) * 2023-09-15 2024-01-09 瑞声科技(新加坡)有限公司 Mirror defect detection method, device, equipment and readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180150929A1 (en) * 2015-05-11 2018-05-31 Siemens Aktiengesellschaft Method and system for registration of 2d/2.5d laparoscopic and endoscopic image data to 3d volumetric image data
CN114119469A (en) * 2021-10-13 2022-03-01 东方晶源微电子科技(北京)有限公司 Image processing method, apparatus and system for semiconductor electron beam defect monitoring
CN114764804A (en) * 2022-06-16 2022-07-19 深圳新视智科技术有限公司 Lithium battery pole piece defect detection method, device, equipment and storage medium
CN115494080A (en) * 2022-09-22 2022-12-20 章鱼博士智能技术(上海)有限公司 A method and system for detecting appearance defects of battery pack blue film
CN116071353A (en) * 2023-03-06 2023-05-05 成都盛锴科技有限公司 Bolt assembly detection method and system
CN117372338A (en) * 2023-09-15 2024-01-09 瑞声科技(新加坡)有限公司 Mirror defect detection method, device, equipment and readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119850606A (en) * 2025-03-19 2025-04-18 苏州苏映视图像软件科技有限公司 Image defect detection method, device, micro-distance imaging equipment and storage medium

Also Published As

Publication number Publication date
CN118655084B (en) 2024-12-24

Similar Documents

Publication Publication Date Title
CN109580630B (en) Visual inspection method for defects of mechanical parts
CN109087274B (en) Electronic device defect detection method and device based on multi-dimensional fusion and semantic segmentation
CN109615611B (en) Inspection image-based insulator self-explosion defect detection method
CN114897864B (en) Workpiece detection and defect judgment method based on digital model information
CN101256157B (en) Surface defect detection method and device
CN109410192B (en) A fabric defect detection method and device for multi-texture grading fusion
CN111598869B (en) Method, equipment and storage medium for detecting Mura of display screen
CN116109777B (en) A complementary pseudo-multimodal feature system and method
CN113888457A (en) Defect detection system and method based on 3D laser scanning technology
CN107169957A (en) A kind of glass flaws on-line detecting system and method based on machine vision
CN118655084A (en) Surface defect detection method, system, electronic device and storage medium
CN119693358B (en) Connector surface defect detection method and system based on image processing
CN118837379A (en) High-precision defect detection method and system for intelligent glasses
CN111739003A (en) A Machine Vision Algorithm for Appearance Detection
CN116908185B (en) Method, device, electronic device and storage medium for detecting appearance defects of articles
CN118671004A (en) Product surface defect detection method and system
CN108876842A (en) A kind of measurement method, system, equipment and the storage medium of sub-pixel edge angle
JP2003216931A (en) Specific pattern recognizing method, specific pattern recognizing program, specific pattern recognizing program storage medium and specific pattern recognizing device
CN114061480B (en) Method for detecting appearance of workpiece
Prabha et al. Defect detection of industrial products using image segmentation and saliency
CN118858293A (en) Graphite Sheet Component Appearance Defect Detection Method Based on Photometric Stereo Algorithm
CN118172350A (en) Quality detection method and device for hand-rolled cigars and electronic equipment
CN118710586A (en) Circuit board defect detection method and device, storage medium, and electronic equipment
JP2021156629A (en) Correction program, correction method, and information processor
CN114255213B (en) Defect detection method and system based on semantic alignment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载