CN108254380B - 基于数字图像处理的pcb电路板模板比对方法 - Google Patents

基于数字图像处理的pcb电路板模板比对方法 Download PDF

Info

Publication number
CN108254380B
CN108254380B CN201810005421.1A CN201810005421A CN108254380B CN 108254380 B CN108254380 B CN 108254380B CN 201810005421 A CN201810005421 A CN 201810005421A CN 108254380 B CN108254380 B CN 108254380B
Authority
CN
China
Prior art keywords
pcb
detected
convex hull
standard
image processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810005421.1A
Other languages
English (en)
Other versions
CN108254380A (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.)
ZHEJIANG HARNPU POWER TECHNOLOGY CO LTD
Electric Power Research Institute of State Grid Qinghai Electric Power Co Ltd
Original Assignee
ZHEJIANG HARNPU POWER TECHNOLOGY CO LTD
Electric Power Research Institute of State Grid Qinghai Electric Power 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 ZHEJIANG HARNPU POWER TECHNOLOGY CO LTD, Electric Power Research Institute of State Grid Qinghai Electric Power Co Ltd filed Critical ZHEJIANG HARNPU POWER TECHNOLOGY CO LTD
Priority to CN201810005421.1A priority Critical patent/CN108254380B/zh
Publication of CN108254380A publication Critical patent/CN108254380A/zh
Application granted granted Critical
Publication of CN108254380B publication Critical patent/CN108254380B/zh
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/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/93Detection standards; Calibrating baseline adjustment, drift correction
    • 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/956Inspecting patterns on the surface of objects
    • 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/956Inspecting patterns on the surface of objects
    • G01N21/95607Inspecting patterns on the surface of objects using a comparative method
    • 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/8854Grading and classifying of flaws
    • G01N2021/8861Determining coordinates of flaws
    • 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
    • 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/956Inspecting patterns on the surface of objects
    • G01N2021/95638Inspecting patterns on the surface of objects for PCB's
    • 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)
  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Signal Processing (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

本发明公开了一种基于数字图像处理的PCB电路板模板比对方法,用于检测PCB电路板元器件缺陷,包括步骤一至三:步骤一,待测PCB电路板定位;步骤二,PCB电路板仿射变换;步骤三,PCB电路板元器件缺陷检测。本发明公开的基于数字图像处理的PCB电路板模板比对方法,利用颜色信息比较标准PCB电路板和待测PCB电路板,得到待测PCB电路板的具体位置信息。利用仿射变换调整待测PCB电路板的位置坐标,使其与标准PCB电路板的位置重合。对两块电路板分别做背景分离得到元器件图像,通过图像中像素值对比得到具体元器件的缺陷位置。

Description

基于数字图像处理的PCB电路板模板比对方法
技术领域
本发明属于模式识别和PCB板检测技术领域,具体涉及一种基于数字图像处理的PCB电路板模板比对方法。
背景技术
PCB电路板制作过程中可能出现缺件、错检、偏移等不良品。产品检测是PCB电路板制作流程中的重要工序之一,有效地保证PCB电路板出厂质量。为了准确地检测PCB电路板元器件缺陷,传统的人工目视抽检等方式已经不再适用于批量化大规模生产方式。
为此,有必要提出一种新型PCB电路板的检测方式,通过机器视觉有效地提升检测效率和准确性,获得具体元器件的缺陷位置。
发明内容
本发明针对现有技术的状况,针对上述状态,提供一种基于数字图像处理的PCB电路板模板比对方法。
本发明采用以下技术方案,所述基于数字图像处理的PCB电路板模板比对方法,用于检测PCB电路板元器件缺陷,包括以下步骤:
步骤一,PCB电路板定位:
(1.1)对两张以白色为背景的含标准PCB电路板和待测PCB电路板的图像,通过颜色空间变换将图像由普通的RGB颜色空间变换到HSV颜色空间;
(1.2)根据HSV空间中绿色色调值,提取出图像中的绿色区域,并且记录标准PCB电路板和待测PCB电路板的位置信息;
步骤二,PCB电路板仿射变换:
(2.1)在待测PCB电路板的位置信息上进一步寻找凸包点,根据上述位置信息和像素之间的邻域关系,得到一个包围整个待测PCB电路板的凸多边形,这个凸多边形的顶点集合即为凸包点集;
(2.2)对于得到的待测PCB电路板的凸包点集,根据标准PCB电路板中凸包点信息和两者之间的一一对应关系,通过仿射变换将待测PCB电路板的位置与标准PCB电路板的位置重合;
步骤三,PCB电路板元器件缺陷检测:
(3.1)对位置重合的标准PCB电路板和待测PCB电路板比较像素值,得到元器件缺陷的具体位置。
根据上述技术方案,所述步骤一(1.1)中:图像由RGB颜色空间变换到HSV颜色空间,每个像素的具体转换公式为:
V=max(R,G,B),
Figure BDA0001538469260000021
Figure BDA0001538469260000022
如果像素的H值小于0,则H←H+360。
根据上述技术方案,所述步骤一(1.2)中:根据HSV空间中绿色色调值,提取图像中绿色区域的方法采用二值化阈值提取法:
当像素值(H,S,V)满足52<H<200,100<S<255,46<V<255时,该像素属于图像中的绿色区域,否则不属于图像中的绿色区域。
根据上述技术方案,所述步骤一(1.2)中,记录标准PCB电路板和待测PCB电路板的位置信息的具体方法为:
X={x1,x2,…,xn},其中
Figure BDA0001538469260000031
根据上述技术方案,所述步骤二(2.1)中,寻找凸包点集的具体方法为:
以集合X中的任意一点为起点,将集合X中位于最外层的凸包点首尾相接构成凸多边形,该凸多边形的所有顶点构成凸包点集。
根据上述技术方案,所述步骤二(2.2)中,上述仿射变换包括旋转、缩放和平移三种几何操作。
本发明公开的基于数字图像处理的PCB电路板模板比对方法,其有益效果在于,利用颜色信息比较标准PCB电路板和待测PCB电路板,得到待测PCB电路板的具体位置信息;利用仿射变换调整待测PCB电路板的位置坐标,使其与标准PCB电路板的位置重合;对两块电路板分别做背景分离得到元器件图像,通过图像中像素值对比得到具体元器件的缺失位置。
具体实施方式
本发明公开了一种基于数字图像处理的PCB电路板模板比对方法,下面结合优选实施例,对本发明的具体实施方式作进一步描述。
优选地,所述基于数字图像处理的PCB电路板模板比对方法包括以下步骤:
步骤一,待测PCB电路板定位:
(1.1)对两张以白色为背景的含标准PCB电路板和待测PCB电路板的图像,通过颜色空间变换将图像由普通的RGB颜色空间变换到HSV颜色空间,具体公式如下(这里只是图像内部像素值显示由(R,G,B)模式转到了(H,S,V)模式,图像具体内容不变):
V=max(R,G,B),
Figure BDA0001538469260000041
Figure BDA0001538469260000042
如果像素的H值小于0,则H←H+360。
(1.2)根据HSV空间中绿色色调值,提取出图像中的绿色区域,并且记录标准PCB电路板和待测PCB电路板的位置信息。当像素值(H,S,V)满足52<H<200,100<S<255,46<V<255时,认为该像素属于电路板的绿色区域,并记录待测PCB电路板的位置集合为X={x1,x2,…,xn},其中
Figure BDA0001538469260000043
步骤二,PCB电路板仿射变换:
(2.1)在待测PCB电路板的位置信息上进一步寻找凸包点,根据位置信息和像素之间的邻域关系,得到一个包围整个待测PCB电路板的凸多边形,这个凸多边形的所有顶点集合即为凸包点集。
(2.2)对于得到的待测PCB电路板的凸包点集,根据已知的标准PCB电路板中凸包点信息和两者之间的一一对应关系,通过仿射变换将待测PCB电路板的位置与标准PCB电路板的位置重合。
步骤三,PCB电路板元器件缺陷检测:
(3.1)对位置重合的标准PCB电路板和待测PCB电路板比较像素值,得到元器件缺陷的具体位置。其中,上述仿射变换包括旋转、缩放和平移三种几何操作,使得图像从一个状态变换到另一个状态。其中,缩放和旋转通过左乘一个矩阵来实现,而平移通过叠加一个向量来实现。
对于本领域的技术人员而言,依然可以对前述各实施例所记载的技术方案进行修改,或对其中部分技术特征进行等同替换,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围。

Claims (4)

1.一种基于数字图像处理的PCB电路板模板比对方法,用于检测PCB电路板元器件缺陷,其特征在于,包括以下步骤:
步骤一,PCB电路板定位:
S1.1,对两张以白色为背景的含标准PCB电路板和待测PCB电路板的图像,通过颜色空间变换将图像由普通的RGB颜色空间变换到HSV颜色空间;
S1.2,根据HSV空间中绿色色调值,提取出图像中的绿色区域,并且记录标准PCB电路板和待测PCB电路板的位置信息;
步骤二,PCB电路板仿射变换:
S2.1,在待测PCB电路板的位置信息上进一步寻找凸包点,根据上述位置信息和像素之间的邻域关系,得到一个包围整个待测PCB电路板的凸多边形,这个凸多边形的顶点集合即为凸包点集;
S2.2,对于得到的待测PCB电路板的凸包点集,根据标准PCB电路板中凸包点信息和两者之间的一一对应关系,通过仿射变换将待测PCB电路板的位置与标准PCB电路板的位置重合;
步骤三,PCB电路板元器件缺陷检测:
S3.1,对位置重合的标准PCB电路板和待测PCB电路板比较像素值,得到元器件缺陷的具体位置;
所述步骤一S1.2中:根据HSV空间中绿色色调值,提取图像中绿色区域的方法采用二值化阈值提取法:
当像素值(H,S,V)满足52<H<200,100<S<255,46<V<255时,该像素属于图像中的绿色区域,否则不属于图像中的绿色区域;
所述步骤二S2.1中,寻找凸包点集的具体方法为:
以集合X中的任意一点为起点,将集合X中位于最外层的凸包点首尾相接构成凸多边形,该凸多边形的所有顶点构成凸包点集。
2.根据权利要求1所述的基于数字图像处理的PCB电路板模板比对方法,其特征在于,所述步骤一S1.1中:图像由RGB颜色空间变换到HSV颜色空间,每个像素的具体转换公式为:
V=max(R,G,B),
Figure FDA0003936091260000021
Figure FDA0003936091260000022
如果像素的H值小于0,则H←H+360。
3.根据权利要求1所述的基于数字图像处理的PCB电路板模板比对方法,其特征在于,所述步骤一S1.2中,记录标准PCB电路板和待测PCB电路板的位置信息的具体方法为:
X={x1,x2,…,xn},其中
Figure FDA0003936091260000023
4.根据权利要求1所述的基于数字图像处理的PCB电路板模板比对方法,其特征在于,所述步骤二S2.2中,上述仿射变换包括旋转、缩放和平移三种几何操作。
CN201810005421.1A 2018-01-03 2018-01-03 基于数字图像处理的pcb电路板模板比对方法 Active CN108254380B (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810005421.1A CN108254380B (zh) 2018-01-03 2018-01-03 基于数字图像处理的pcb电路板模板比对方法

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810005421.1A CN108254380B (zh) 2018-01-03 2018-01-03 基于数字图像处理的pcb电路板模板比对方法

Publications (2)

Publication Number Publication Date
CN108254380A CN108254380A (zh) 2018-07-06
CN108254380B true CN108254380B (zh) 2023-02-10

Family

ID=62725501

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810005421.1A Active CN108254380B (zh) 2018-01-03 2018-01-03 基于数字图像处理的pcb电路板模板比对方法

Country Status (1)

Country Link
CN (1) CN108254380B (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109389597B (zh) * 2018-10-24 2021-04-27 四川长虹电器股份有限公司 一种生产线上电路板缺陷检测系统及方法
CN109712115B (zh) * 2018-12-03 2021-11-23 武汉精立电子技术有限公司 一种pcb板自动检测方法及系统
CN115760740B (zh) * 2022-11-10 2024-01-26 中邮通建设咨询有限公司 一种无人机航拍用图像数据处理方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104504375A (zh) * 2014-12-18 2015-04-08 广州视源电子科技股份有限公司 一种pcb元件的识别方法及装置
CN105445277A (zh) * 2015-11-12 2016-03-30 湖北工业大学 一种fpc表面质量视觉智能检测方法
CN106651849A (zh) * 2016-12-27 2017-05-10 广东锐视智能检测有限公司 基于面阵相机的pcb裸板缺陷检测方法
TW201740484A (zh) * 2016-05-10 2017-11-16 韓美半導體有限公司 視覺化檢驗裝置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104504375A (zh) * 2014-12-18 2015-04-08 广州视源电子科技股份有限公司 一种pcb元件的识别方法及装置
CN105445277A (zh) * 2015-11-12 2016-03-30 湖北工业大学 一种fpc表面质量视觉智能检测方法
TW201740484A (zh) * 2016-05-10 2017-11-16 韓美半導體有限公司 視覺化檢驗裝置
CN106651849A (zh) * 2016-12-27 2017-05-10 广东锐视智能检测有限公司 基于面阵相机的pcb裸板缺陷检测方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于背景连通域的印刷线路板缺陷定位及识别;熊邦书等;《半导体光电》;20151015(第05期);821-823页 *
机器人双目视觉目标跟踪研究;何挺等;《机械设计与制造》;20080308(第03期);161-163页 *

Also Published As

Publication number Publication date
CN108254380A (zh) 2018-07-06

Similar Documents

Publication Publication Date Title
CN109523505B (zh) 一种基于机器视觉的陶瓷砖表面花纹缺陷检测方法
CN108254380B (zh) 基于数字图像处理的pcb电路板模板比对方法
CN109472271B (zh) 印刷电路板图像轮廓提取方法及装置
CN107945184B (zh) 一种基于彩色图像分割和梯度投影定位的贴装元件检测方法
CN112837257B (zh) 一种基于机器视觉的曲面标签拼接检测方法
CN109993154B (zh) 变电站单指针式六氟化硫型仪表智能识别方法
CN103017869A (zh) 一种基于数字图像处理的水位测定系统及方法
CN112304960B (zh) 一种基于深度学习的高分辨率图像物体表面缺陷检测方法
JPWO2010029932A1 (ja) 外観検査装置
CN106228541A (zh) 视觉检测中屏幕定位的方法及装置
CN107679479A (zh) 一种基于图像形态学处理的客观填涂识别方法
KR101428923B1 (ko) 인쇄회로기판의 부품패키징 영역 자동검출 시스템 및 방법
CN114677356A (zh) 一种基于多视角图像融合的酒瓶外观缺陷检测方法
CN114897881A (zh) 一种基于边缘特征的晶粒缺陷检测方法
CN114187253A (zh) 一种电路板零件安装检测方法
WO2018068414A1 (zh) 色环电阻的检测方法、装置和自动光学检测系统
CN112415013A (zh) 一种铜箔缺陷检测系统
CN111539951A (zh) 一种陶瓷砂轮头轮廓尺寸视觉检测方法
JP4354173B2 (ja) 電子回路用部品の外観検査装置
CN114705696A (zh) 一种基于数字图像处理和自动光学检测的缺陷检测方法
CN107895353B (zh) 一种交互式的深度图纹理拷贝瑕疵去除方法
CN110956640A (zh) 一种异源图像边缘点检测与配准方法
JP2006035505A (ja) 印刷物の検査方法及び装置
US20240078658A1 (en) Inspection apparatus and storage medium storing computer program
JP4354174B2 (ja) 電子回路用部品の製造方法

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