CN118446984B - A defect detection system and method for enamel colored porcelain - Google Patents

A defect detection system and method for enamel colored porcelain Download PDF

Info

Publication number
CN118446984B
CN118446984B CN202410556430.5A CN202410556430A CN118446984B CN 118446984 B CN118446984 B CN 118446984B CN 202410556430 A CN202410556430 A CN 202410556430A CN 118446984 B CN118446984 B CN 118446984B
Authority
CN
China
Prior art keywords
area
unit
image
detection
grayscale
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
CN202410556430.5A
Other languages
Chinese (zh)
Other versions
CN118446984A (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.)
Shenzhen Huangjinwu Precious Metal Refining Co ltd
Original Assignee
Shenzhen Huangjinwu Precious Metal Refining 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 Shenzhen Huangjinwu Precious Metal Refining Co ltd filed Critical Shenzhen Huangjinwu Precious Metal Refining Co ltd
Priority to CN202410556430.5A priority Critical patent/CN118446984B/en
Publication of CN118446984A publication Critical patent/CN118446984A/en
Application granted granted Critical
Publication of CN118446984B publication Critical patent/CN118446984B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/80Recognising image objects characterised by unique random patterns
    • 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

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

Abstract

本发明公开了一种珐琅彩瓷的缺陷检测系统及方法,属于珐琅彩瓷的缺陷检测技术领域,方法包括:建立胚胎模型,对胚胎模型进行分割,获得各单元区域;对各单元区域进行识别排序,获得识别序列;设置定位点;为各单元区域设置对应的校核信息;对待检珐琅彩瓷进行图像采集,获得检测图像;获取识别序列,根据定位点对检测图像进行定位识别,确定识别序列中对应排序的单元区域在检测图像中的定位初始区域;获取检测图像的检测灰度图像,在检测灰度图像中标记定位初始区域,确定单元区域的单元检测数据;根据单元区域对应的校核信息对单元检测数据进行校核,获得检测校核结果;依此类推,直到根据识别序列完成全部检测为止。

The invention discloses a defect detection system and method for enamel colored porcelain, belonging to the technical field of defect detection of enamel colored porcelain. The method comprises: establishing an embryo model, segmenting the embryo model, and obtaining each unit area; identifying and sorting each unit area to obtain an identification sequence; setting a positioning point; setting corresponding verification information for each unit area; performing image acquisition on the enamel colored porcelain to be inspected to obtain a detection image; obtaining an identification sequence, positioning and identifying the detection image according to the positioning point, and determining the initial positioning area of the correspondingly sorted unit area in the identification sequence in the detection image; obtaining a detection grayscale image of the detection image, marking the initial positioning area in the detection grayscale image, and determining unit detection data of the unit area; verifying the unit detection data according to the verification information corresponding to the unit area to obtain a detection verification result; and so on, until all detections are completed according to the identification sequence.

Description

一种珐琅彩瓷的缺陷检测系统及方法A defect detection system and method for enamel colored porcelain

技术领域Technical Field

本发明属于珐琅彩瓷的缺陷检测技术领域,具体是一种珐琅彩瓷的缺陷检测系统及方法。The invention belongs to the technical field of enamel colored porcelain defect detection, and in particular relates to an enamel colored porcelain defect detection system and method.

背景技术Background Art

珐琅彩瓷作为一种具有高度艺术价值的陶瓷工艺品,其生产过程中对质量的要求极高。然而,传统的珐琅彩瓷缺陷检测主要依赖于人工目视检查,这种方法不仅效率低下,而且容易受到人为因素的影响,导致检测结果的不准确和不一致。As a ceramic handicraft with high artistic value, enamel porcelain has extremely high quality requirements in its production process. However, traditional enamel porcelain defect detection mainly relies on manual visual inspection, which is not only inefficient but also easily affected by human factors, resulting in inaccurate and inconsistent detection results.

随着计算机视觉和机器学习技术的快速发展,越来越多的领域开始尝试将这些技术应用于自动化检测中。然而,在珐琅彩瓷缺陷检测领域,现有的自动化检测系统仍然存在一些问题。首先,由于珐琅彩瓷表面的复杂性和多样性,使得提取有效的特征变得困难。其次,现有的检测系统往往只能识别特定的缺陷类型,对于新出现的缺陷类型无法有效应对。With the rapid development of computer vision and machine learning technologies, more and more fields are beginning to try to apply these technologies to automated inspection. However, in the field of enamel porcelain defect detection, the existing automated inspection systems still have some problems. First, due to the complexity and diversity of the enamel porcelain surface, it is difficult to extract effective features. Second, the existing inspection systems can often only identify specific defect types and cannot effectively respond to newly emerging defect types.

基于此,本发明提供了一种珐琅彩瓷的缺陷检测系统及方法。Based on this, the present invention provides a defect detection system and method for enamel porcelain.

发明内容Summary of the invention

为了解决上述方案存在的问题,本发明提供了一种珐琅彩瓷的缺陷检测系统及方法。In order to solve the problems existing in the above-mentioned scheme, the present invention provides a defect detection system and method for enamel porcelain.

本发明的目的可以通过以下技术方案实现:The purpose of the present invention can be achieved through the following technical solutions:

一种珐琅彩瓷的缺陷检测方法,方法包括:A method for detecting defects in enamel colored porcelain, the method comprising:

步骤一:获取标准珐琅彩瓷,根据标准珐琅彩瓷建立胚胎模型,根据标准珐琅彩瓷对胚胎模型进行分割,获得各单元区域;Step 1: Obtain standard enamel colored porcelain, establish an embryo model according to the standard enamel colored porcelain, segment the embryo model according to the standard enamel colored porcelain, and obtain each unit area;

进一步地,根据标准珐琅彩瓷对胚胎模型进行分割的方法包括:Furthermore, the method for segmenting the embryo model according to the standard enamel porcelain includes:

获取标准珐琅彩瓷对应的标准图像,对所述标准图像进行分割,获得各初始图像以及各初始图像之间的过渡区域;Obtaining a standard image corresponding to the standard enamel porcelain, segmenting the standard image, and obtaining initial images and transition areas between the initial images;

对所述标准图像进行灰度处理,获得标准灰度图像,在标准灰度图像中标记各初始图像和过渡区域;确定各过渡区域对应的初始图像,标记为基准图像;设置各基准图像的初始值;Performing grayscale processing on the standard image to obtain a standard grayscale image, marking each initial image and transition area in the standard grayscale image; determining the initial image corresponding to each transition area and marking it as a reference image; and setting an initial value of each reference image;

识别过渡区域内各像素的灰度值,通过预设的判断模型对各灰度值进行分析,确定各像素对应的基准图像;Identify the grayscale value of each pixel in the transition area, analyze each grayscale value through a preset judgment model, and determine the reference image corresponding to each pixel;

将过渡区域内各像素合并到对应的基准图像中,获得各单元图像;根据单元图像在胚胎模型中的位置区域对胚胎模型进行分割,获得各单元区域。Each pixel in the transition area is merged into the corresponding reference image to obtain each unit image; the embryo model is segmented according to the position area of the unit image in the embryo model to obtain each unit area.

进一步地,设置各基准图像的初始值的方法包括:Furthermore, the method of setting the initial value of each reference image includes:

步骤SA1:识别基准图像中各像素的灰度值,将各灰度值相同的各相邻像素进行合并,获得各第一区域;确定第一区域的第一区域值;Step SA1: identifying the gray value of each pixel in the reference image, merging adjacent pixels with the same gray value to obtain each first region; and determining the first region value of the first region;

步骤SA2:计算各相邻第一区域的第一区域值之间的差值,标记为第一差值;将第一差值不大于阈值X1的各相邻第一区域进行合并,获得新的第一区域;确定新的第一区域值;Step SA2: Calculate the difference between the first region values of adjacent first regions, marked as the first difference; merge the adjacent first regions whose first difference is not greater than the threshold value X1 to obtain a new first region; determine the new first region value;

步骤SA3:循环步骤SA2,直到各第一差值均大于阈值X1为止;识别各第一区域的面积;Step SA3: looping step SA2 until all first differences are greater than the threshold value X1; identifying the area of each first region;

根据公式计算对应的初始值;According to the formula Calculate the corresponding initial value;

式中:CZ为初始值;v表示对应的第一区域,c=1、2、……、v,v为正整数;Ac表示对应的第一区域面积;DZc表示对应第一区域的第一区域值。In the formula: CZ is the initial value; v represents the corresponding first region, c=1, 2, ..., v, v is a positive integer; Ac represents the corresponding first region area; DZc represents the first region value corresponding to the first region.

进一步地,判断模型的表达式为:Furthermore, the expression of the judgment model is:

式中:s为过渡区域内相应像素的灰度值。 Where: s is the gray value of the corresponding pixel in the transition area.

步骤二:对各单元区域进行识别排序,获得识别序列;并根据标准珐琅彩瓷设置对应的定位点;为各单元区域设置对应的校核信息;Step 2: Identify and sort each unit area to obtain an identification sequence; set corresponding positioning points according to standard enamel porcelain; set corresponding verification information for each unit area;

进一步地,对各单元区域进行识别排序的方法包括:Furthermore, the method for identifying and sorting each unit area includes:

获取各单元区域对应的单元图像,对各单元图像进行等同标记;根据各单元图像进行识别顺序组合,获得各待选组合;Obtain unit images corresponding to each unit area, and mark each unit image equally; perform identification sequence combination according to each unit image to obtain each candidate combination;

基于标准珐琅彩瓷的标准图像对各待选组合进行识别模拟,获得对应的识别效率和识别精度;Based on the standard image of standard enamel porcelain, each candidate combination is recognized and simulated to obtain the corresponding recognition efficiency and recognition accuracy;

根据公式PQ=b1×XL+b2×DL计算对应的模拟值;Calculate the corresponding simulation value according to the formula PQ = b1 × XL + b2 × DL;

式中:PQ为模拟值;b1、b2均为比例系数,取值范围为0<b1≤1,0<b2≤1;XL为识别效率;DL为识别精度;Where: PQ is the simulation value; b1 and b2 are both proportional coefficients, with a value range of 0<b1≤1, 0<b2≤1; XL is the recognition efficiency; DL is the recognition accuracy;

根据模拟值最大的待选组合设置识别序列。The recognition sequence is set according to the candidate combination with the largest simulation value.

步骤三:对待检珐琅彩瓷进行图像采集,获得检测图像;Step 3: Capture images of the enamel porcelain to be inspected to obtain inspection images;

步骤四:获取识别序列,根据预设的定位点对检测图像进行定位识别,确定识别序列中对应排序的单元区域在检测图像中的位置,标记为定位初始区域;Step 4: Obtain the recognition sequence, perform positioning recognition on the detection image according to the preset positioning points, determine the position of the correspondingly ordered unit area in the recognition sequence in the detection image, and mark it as the initial positioning area;

步骤五:对检测图像进行灰度处理,获得检测灰度图像,在检测灰度图像中标记定位初始区域,根据定位初始区域进行图像处理,确定单元区域对应的单元检测数据;Step 5: grayscale processing is performed on the detection image to obtain a detection grayscale image, an initial positioning area is marked in the detection grayscale image, image processing is performed according to the initial positioning area, and unit detection data corresponding to the unit area is determined;

进一步地,对定位初始区域进行图像处理的方法包括:Furthermore, the method of performing image processing on the initial positioning area includes:

步骤SC1:识别定位初始区域内各像素的灰度值,将灰度值相同的各相邻像素进行合并,获得第二区域;Step SC1: Identify and locate the grayscale value of each pixel in the initial area, merge adjacent pixels with the same grayscale value to obtain a second area;

步骤SC2:计算各相邻第二区域之间的第二差值;将第二差值不大于阈值X2的相邻第二区域进行合并,获得新的第二区域;Step SC2: calculating the second difference between each adjacent second region; merging the adjacent second regions whose second difference is not greater than the threshold value X2 to obtain a new second region;

步骤SC3:循环步骤SC2,直到没有不大于阈值X2的第二差值为止,根据剩余的各第二区域确定单元初始区域;Step SC3: looping step SC2 until there is no second difference value not greater than the threshold value X2, and determining the unit initial region according to the remaining second regions;

步骤SC4:识别定位初始区域外与单元初始区域相邻的各像素,标记为界外像素;识别各界外像素的灰度值,评估各界外像素是否满足合并要求,将满足合并要求的各界外像素与单元初始区域进行合并,获得新的单元初始区域;Step SC4: Identify and locate each pixel outside the initial region and adjacent to the unit initial region, and mark them as out-of-bounds pixels; identify the grayscale value of each out-of-bounds pixel, evaluate whether each out-of-bounds pixel meets the merging requirement, merge each out-of-bounds pixel that meets the merging requirement with the unit initial region, and obtain a new unit initial region;

步骤SC5:循环步骤SC4,直到没有符合合并要求的界外像素为止,将单元初始区域标记为单元对照区;根据单元对照区获取单元检测数据。Step SC5: loop step SC4 until there are no out-of-bounds pixels that meet the merging requirements, mark the unit initial area as the unit control area; and obtain unit detection data according to the unit control area.

步骤六:将单元检测数据在胚胎模型中对应的单元区域上进行定位标记;获取单元区域对应的校核信息,根据校核信息对单元检测数据进行校核,获得对应的检测校核结果;Step 6: Position and mark the unit detection data on the corresponding unit area in the embryo model; obtain the verification information corresponding to the unit area, verify the unit detection data according to the verification information, and obtain the corresponding detection verification result;

进一步地,根据校核信息对单元检测数据进行校核的方法包括:Furthermore, the method for verifying the unit detection data according to the verification information includes:

根据胚胎模型、校核信息和单元检测数据生成对应的单元检测图,根据单元检测图进行形状评估,获得对应的形状判断结果;Generate a corresponding unit detection graph according to the embryo model, verification information and unit detection data, perform shape evaluation according to the unit detection graph, and obtain a corresponding shape judgment result;

根据校核信息和单元检测数据获取对应的校核灰度图像和单元检测灰度图像;Acquire corresponding calibration grayscale image and unit detection grayscale image according to calibration information and unit detection data;

将校核灰度图像和单元检测灰度图像进行对位比较,获得灰度差值面;对灰度差值面进行分析,确定异常区域,识别异常区域面积,根据异常区域面积进行判断,获得对应的灰度校核结果;Compare the verification grayscale image and the unit detection grayscale image to obtain a grayscale difference surface; analyze the grayscale difference surface to determine the abnormal area, identify the area of the abnormal area, make a judgment based on the area of the abnormal area, and obtain the corresponding grayscale verification result;

将形状判断结果和灰度校核结果整合为检测校核结果。The shape judgment results and grayscale verification results are integrated into the detection verification results.

进一步地,对灰度差值面进行分析的方法包括:Furthermore, the method for analyzing the grayscale difference surface includes:

设置灰度限值;根据灰度限值建立对应的转化公式式中:r(x,y)为灰度差值面中对应位置的灰度差值;(x,y)为对应位置的坐标;R为灰度限值;输出数据为转化值1或0;Set the grayscale limit; establish the corresponding conversion formula according to the grayscale limit Where: r(x, y) is the grayscale difference of the corresponding position in the grayscale difference plane; (x, y) is the coordinate of the corresponding position; R is the grayscale limit; the output data is the conversion value 1 or 0;

通过转化公式对灰度差值面进行处理,获得各位置的转化值,将转化值为1对应的区域标记为异常区域。The grayscale difference surface is processed by the conversion formula to obtain the conversion value of each position, and the area corresponding to the conversion value of 1 is marked as an abnormal area.

步骤七:返回步骤四,直到根据识别序列完成全部检测为止。Step 7: Return to step 4 until all detections are completed according to the recognition sequence.

一种珐琅彩瓷的缺陷检测系统,包括标准分析模块、采集模块和检测模块;A defect detection system for enamel colored porcelain, comprising a standard analysis module, a collection module and a detection module;

所述标准分析模块用于根据标准珐琅彩瓷建立胚胎模型,并对胚胎模型进行分割,获得各单元区域;对各单元区域进行识别排序,获得识别序列;并根据标准珐琅彩瓷设置对应的定位点;为各单元区域设置对应的校核信息;The standard analysis module is used to establish an embryo model according to the standard enamel porcelain, and segment the embryo model to obtain each unit area; identify and sort each unit area to obtain an identification sequence; and set corresponding positioning points according to the standard enamel porcelain; set corresponding verification information for each unit area;

所述采集模块用于对待检珐琅彩瓷进行图像采集,获得检测图像;获取识别序列,根据预设的定位点对检测图像进行定位识别,确定识别序列中对应排序的单元区域在检测图像中的位置,标记为定位初始区域;对检测图像进行灰度处理,获得检测灰度图像,在检测灰度图像中标记定位初始区域,根据定位初始区域进行图像处理,确定单元区域对应的单元检测数据;The acquisition module is used to acquire images of the enamel porcelain to be inspected to obtain an inspection image; obtain an identification sequence, perform positioning identification on the inspection image according to a preset positioning point, determine the position of the correspondingly ordered unit area in the identification sequence in the inspection image, and mark it as the initial positioning area; perform grayscale processing on the inspection image to obtain an inspection grayscale image, mark the initial positioning area in the inspection grayscale image, perform image processing according to the initial positioning area, and determine the unit inspection data corresponding to the unit area;

所述检测模块用于对珐琅彩瓷的进行缺陷检测,将单元检测数据在胚胎模型中对应的单元区域上进行定位标记;获取单元区域对应的校核信息,根据校核信息对单元检测数据进行校核,获得对应的检测校核结果;依此类推,直到根据识别序列完成全部检测为止。The detection module is used to perform defect detection on enamel porcelain, locate and mark the unit detection data on the corresponding unit area in the embryo model; obtain the verification information corresponding to the unit area, verify the unit detection data according to the verification information, and obtain the corresponding detection verification result; and so on, until all detections are completed according to the recognition sequence.

与现有技术相比,本发明的有益效果是:Compared with the prior art, the present invention has the following beneficial effects:

通过本发明实现对珐琅彩瓷进行智能检测,通过对珐琅彩瓷进行分割、分布式识别校核,降低珐琅彩瓷因表面的复杂性和多样性带来的不利影响,提高检测精度;且对于新出现的生产缺陷也可进行识别,提高检测的全面性和适用性;可以大幅减少人工参与,降低人工成本,同时提高检测的稳定性,还可以替代人工进行这些高风险操作,降低生产过程中的安全风险。The present invention can realize intelligent detection of enamel colored porcelain. By segmenting and distributing the identification and verification of enamel colored porcelain, the adverse effects caused by the complexity and diversity of the surface of enamel colored porcelain can be reduced, and the detection accuracy can be improved. Newly emerged production defects can also be identified, thereby improving the comprehensiveness and applicability of detection. Human participation can be greatly reduced, labor costs can be reduced, and the stability of detection can be improved. These high-risk operations can also be replaced by humans, thereby reducing safety risks in the production process.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单的介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

图1为本发明方法流程图。FIG1 is a flow chart of the method of the present invention.

具体实施方式DETAILED DESCRIPTION

下面将结合实施例对本发明的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solution of the present invention will be clearly and completely described below in conjunction with the embodiments. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

如图1所示,一种珐琅彩瓷的缺陷检测方法,方法包括:As shown in FIG1 , a method for detecting defects of enamel colored porcelain includes:

步骤一:获取标准珐琅彩瓷,根据标准珐琅彩瓷建立胚胎模型,所述胚胎模型是根据标准珐琅彩瓷建立的三维数据模型,根据标准珐琅彩瓷对胚胎模型进行分割,获得各单元区域;Step 1: Obtain standard enamel colored porcelain, establish an embryo model according to the standard enamel colored porcelain, wherein the embryo model is a three-dimensional data model established according to the standard enamel colored porcelain, and segment the embryo model according to the standard enamel colored porcelain to obtain each unit area;

根据标准珐琅彩瓷对胚胎模型进行分割的方法包括:Methods for segmenting embryo models according to standard enamel porcelain include:

获取标准珐琅彩瓷对应的标准图像,识别标准图像中各图案的边界,指的是异色边界,不同颜色交汇处将会形成边界;以识别的边界为基准向两侧进行一定的推移后进行分割,获得各初始图像;避免直接分割不精准,推移后进行分割,将会保障初始图像的准确性,相邻初始图像因为推移分割将会形成一个过渡区域,后续再对过渡区域进行分析,将过渡区域分配相应的初始图像;该步骤可以基于现有技术进行快速分割;如基于深度神经网络建立初始分割模型;创建样本数据集,样本数据集包括素材样本和人工标注样本集,素材样本为原始图片集,人工标注样本集为对原始图片进行格式转换、人工标注初始图像处理后的图片集,样本数据集中素材样本和人工标注样本集比例为2:1;对人工标注样本集中的图片进行二值化处理,并以单通道形式进行保存,将照片样本集和人工标注样本集按照比例进行切分,形成第二照片样本集和第二人工标注样本集;在Pytorch深度学习框架下基于Linknet网络结构搭建Linknet网络模型,设置Linknet网络模型的参数,将第二照片样本集和第二人工标注样本集输入Linknet网络模型,并基于Pytorch深度学习框架对Linknet网络模型进行训练,训练过程中保存多个模型,利用验证集数据选择误差最小的模型作为初始分割模型;通过初始分割模型对标准图像进行处理,获得各初始图像以及对应的过渡区域;Obtain a standard image corresponding to the standard enamel porcelain, identify the boundaries of each pattern in the standard image, which refers to the boundaries of different colors. The intersection of different colors will form a boundary; use the identified boundary as a reference to perform a certain shift to both sides and then perform segmentation to obtain each initial image; avoid inaccurate direct segmentation, and perform segmentation after shifting, which will ensure the accuracy of the initial image. Adjacent initial images will form a transition area due to the shifting segmentation, and the transition area will be analyzed later, and the transition area will be assigned a corresponding initial image; this step can be quickly segmented based on existing technology; such as establishing an initial segmentation model based on a deep neural network; create a sample data set, the sample data set includes material samples and manually annotated sample sets, the material samples are the original picture sets, and the manually annotated sample sets are the picture sets after the original pictures are format converted and the manually annotated initial images are processed, and the sample data set contains the material samples The ratio of the sample set to the manually labeled sample set is 2:1; the pictures in the manually labeled sample set are binarized and saved in a single-channel form, and the photo sample set and the manually labeled sample set are divided according to the ratio to form a second photo sample set and a second manually labeled sample set; a Linknet network model is built based on the Linknet network structure under the Pytorch deep learning framework, the parameters of the Linknet network model are set, the second photo sample set and the second manually labeled sample set are input into the Linknet network model, and the Linknet network model is trained based on the Pytorch deep learning framework. Multiple models are saved during the training process, and the model with the smallest error is selected as the initial segmentation model using the validation set data; the standard image is processed by the initial segmentation model to obtain each initial image and the corresponding transition area;

对标准图像进行灰度处理,获得标准灰度图像,在标准灰度图像中标记各初始图像以及对应的过渡区域;确定各过渡区域对应的初始图像,标记为基准图像;设置各基准图像的初始值;Performing grayscale processing on the standard image to obtain a standard grayscale image, marking each initial image and the corresponding transition area in the standard grayscale image; determining the initial image corresponding to each transition area and marking it as a reference image; setting the initial value of each reference image;

识别过渡区域内各像素的灰度值,根据各基准图像的初始值对灰度值进行评估,判断该灰度值的像素是属于哪个基准图像,因为不同颜色的灰度值具有较大差异,因此可以直观的比较出来,为了便于处理,根据上述步骤建立判断模型,判断模型的表达式为式中:s为输入数据,即过渡区域内对应像素的灰度值;临近标准以该基准图像的初始值进行设置的,如根据各初始值设置各基准图像的区间范围,以对应的区间范围为临近标准,或者直接以其灰度值是否最接近本基准图像的初始值为临近标准;通过判断模型对过渡区域内各像素的灰度值进行分析,获得各像素属于的基准图像,将相应像素合并到对应的基准图像中;将当前的各基准图像或初始图像标记为单元图像;根据单元图像对应的位置区域对胚胎模型进行分割,获得各单元图像对应的单元区域。Identify the grayscale value of each pixel in the transition area, evaluate the grayscale value according to the initial value of each reference image, and determine which reference image the pixel of the grayscale value belongs to. Because the grayscale values of different colors have large differences, they can be compared intuitively. In order to facilitate processing, a judgment model is established according to the above steps. The expression of the judgment model is: Wherein: s is the input data, i.e., the gray value of the corresponding pixel in the transition area; the proximity standard is set according to the initial value of the reference image, such as setting the interval range of each reference image according to each initial value, and taking the corresponding interval range as the proximity standard, or directly taking whether its gray value is closest to the initial value of the reference image as the proximity standard; the gray value of each pixel in the transition area is analyzed by the judgment model to obtain the reference image to which each pixel belongs, and the corresponding pixels are merged into the corresponding reference image; the current reference images or initial images are marked as unit images; the embryo model is segmented according to the position area corresponding to the unit image to obtain the unit area corresponding to each unit image.

设置各基准图像的初始值的方法包括:The method of setting the initial value of each reference image includes:

步骤SA1:识别基准图像中各像素的灰度值,将各灰度值相同的各相邻像素进行合并,获得各第一区域;计算第一区域内各像素对应的灰度值的平均值,标记为第一区域值;Step SA1: Identify the grayscale value of each pixel in the reference image, merge adjacent pixels with the same grayscale value to obtain each first region; calculate the average value of the grayscale value corresponding to each pixel in the first region, and mark it as the first region value;

步骤SA2:计算各相邻第一区域的第一区域值之间的差值,标记为第一差值;将第一差值不大于阈值X1的各相邻第一区域进行合并,获得新的第一区域;确定新的第一区域值;Step SA2: Calculate the difference between the first region values of adjacent first regions, marked as the first difference; merge the adjacent first regions whose first difference is not greater than the threshold value X1 to obtain a new first region; determine the new first region value;

步骤SA3:循环步骤SA2,直到各第一差值均大于阈值X1为止;识别各第一区域的面积;Step SA3: looping step SA2 until all first differences are greater than the threshold value X1; identifying the area of each first region;

根据公式计算对应的初始值;According to the formula Calculate the corresponding initial value;

式中:CZ为初始值;v表示对应的第一区域,c=1、2、……、v,v为正整数;Ac表示对应的第一区域面积;DZc表示对应第一区域的第一区域值。In the formula: CZ is the initial value; v represents the corresponding first region, c=1, 2, ..., v, v is a positive integer; Ac represents the corresponding first region area; DZc represents the first region value corresponding to the first region.

步骤二:对各单元区域进行识别排序,获得识别序列;并根据标准珐琅彩瓷设置对应的定位点;定位点用于后续进行图像识别时确定各图像的位置;根据现有技术设置定位点,可以设置多个定位点;为各单元区域设置对应的校核信息,校核信息是该单元区域对应的标准单元图像进行设置的;包括相应的标准校核数据;如形状、尺寸、灰度值等相关数据;Step 2: Identify and sort each unit area to obtain an identification sequence; and set corresponding positioning points according to standard enamel porcelain; the positioning points are used to determine the position of each image during subsequent image recognition; according to the prior art, positioning points can be set, and multiple positioning points can be set; corresponding verification information is set for each unit area, and the verification information is set for the standard unit image corresponding to the unit area; including corresponding standard verification data; such as shape, size, gray value and other related data;

其中,对各单元区域进行识别排序的方法包括:The method for identifying and sorting each unit area includes:

获取各单元区域对应的单元图像,对各单元图像进行等同标记,即将相同的单元图像标记一个相同的标记符号,根据各单元图像是否相同进行判断,因为珐琅彩瓷中可能具有很多种相同的图像;Obtain the unit images corresponding to each unit area, and mark each unit image identically, that is, mark the same unit image with an identical marking symbol, and judge whether each unit image is identical, because there may be many identical images in enamel porcelain;

根据各单元图像进行识别顺序组合,获得各待选组合,具有同类标记的各单元图像持续处于同一顺序;即根据各单元图像确定可以具有的各种组合方式,标记为待选组合;According to the identification sequence combination of each unit image, each candidate combination is obtained, and each unit image with the same mark is continuously in the same order; that is, various possible combinations are determined according to each unit image and marked as candidate combinations;

基于标准珐琅彩瓷的标准图像对各待选组合进行识别模拟,即按照待选组合顺序对标准图像中对应的单元图像进行识别,将识别的单元图像进行提取,提取后标准图像将没有该单元图像,再按照待选组合之后的识别顺序进行识别,依此类推,直到识别完成为止;根据识别结果确定对应的识别效率和识别精度;Based on the standard image of the standard enamel porcelain, each candidate combination is recognized and simulated, that is, the corresponding unit images in the standard image are recognized in the order of the candidate combinations, and the recognized unit images are extracted. After the extraction, the standard image will not have the unit images, and then the recognition is performed in the recognition order after the candidate combination, and so on, until the recognition is completed; the corresponding recognition efficiency and recognition accuracy are determined according to the recognition results;

将获得的识别效率和识别精度分别标记为XL和DL;The obtained recognition efficiency and recognition accuracy are marked as XL and DL respectively;

根据公式PQ=b1×XL+b2×DL计算对应的模拟值;Calculate the corresponding simulation value according to the formula PQ = b1 × XL + b2 × DL;

式中:PQ为模拟值;b1、b2均为比例系数,取值范围为0<b1≤1,0<b2≤1;XL为识别效率;DL为识别精度;Where: PQ is the simulation value; b1 and b2 are both proportional coefficients, with a value range of 0<b1≤1, 0<b2≤1; XL is the recognition efficiency; DL is the recognition accuracy;

根据模拟值最大的待选组合设置识别序列。The recognition sequence is set according to the candidate combination with the largest simulation value.

步骤三:对待检珐琅彩瓷进行图像采集,获得检测图像;Step 3: Capture images of the enamel porcelain to be inspected to obtain inspection images;

步骤四:获取识别序列,根据预设的定位点对检测图像进行定位识别,确定识别序列中对应排序的单元区域在检测图像中的位置,标记为定位初始区域;定位初始区域为大致位置,根据定位点和单元区域的坐标区域可以确定在检测图像中的对应位置,但是一般会有一定的偏差,但是并不影响对相应位置区域的快速定位;识别序列中对应排序的单元区域是根据已经识别的图像进行确定的。Step 4: Get the recognition sequence, locate and identify the detection image according to the preset positioning points, determine the position of the corresponding ordered unit area in the recognition sequence in the detection image, and mark it as the initial positioning area; the initial positioning area is an approximate position, and the corresponding position in the detection image can be determined based on the coordinate area of the positioning point and the unit area, but there will generally be a certain deviation, but it does not affect the rapid positioning of the corresponding position area; the corresponding ordered unit area in the recognition sequence is determined based on the image that has been recognized.

步骤五:对检测图像进行灰度处理,获得检测灰度图像,在检测灰度图像中标记定位初始区域,对定位初始区域进行图像处理,确定单元区域对应的单元检测数据;Step 5: grayscale processing is performed on the detection image to obtain a detection grayscale image, an initial positioning area is marked in the detection grayscale image, image processing is performed on the initial positioning area, and unit detection data corresponding to the unit area is determined;

对定位初始区域进行图像处理的方法包括:The method of performing image processing on the initial positioning area includes:

步骤SC1:识别定位初始区域内各像素的灰度值,将灰度值相同的各相邻像素进行合并,获得第二区域;Step SC1: Identify and locate the grayscale value of each pixel in the initial area, merge adjacent pixels with the same grayscale value to obtain a second area;

步骤SC2:计算各相邻第二区域之间的第二差值,即对应灰度值的差值;将第二差值不大于阈值X2的相邻第二区域进行合并,获得新的第二区域,阈值X2根据对应校核信息中可能存在的该颜色最大灰度值差值进行设置;以其灰度值平均值作为后续计算的依据;Step SC2: Calculate the second difference between each adjacent second area, that is, the difference of the corresponding gray value; merge the adjacent second areas whose second difference is not greater than the threshold value X2 to obtain a new second area, the threshold value X2 is set according to the maximum gray value difference of the color that may exist in the corresponding verification information; use the average gray value as the basis for subsequent calculations;

步骤SC3:循环步骤SC2,直到没有不大于阈值X2的第二差值为止,根据剩余的各第二区域确定单元初始区域,即根据该单元区域的真实灰度值情况,可以从各第二区域中确定该单元区域对应的第二区域,标记为单元初始区域;Step SC3: looping step SC2 until there is no second difference value not greater than the threshold value X2, determining the unit initial region according to the remaining second regions, that is, according to the real gray value of the unit region, the second region corresponding to the unit region can be determined from the second regions and marked as the unit initial region;

步骤SC4:识别定位初始区域外与单元初始区域相邻的各像素的灰度值,将对应像素标记为界外像素;确定各界外像素是否满足合并要求,即差值是否不大于阈值X2;将满足合并要求的各界外像素与单元初始区域进行合并,获得新的单元初始区域;Step SC4: Identify the grayscale value of each pixel outside the initial positioning area and adjacent to the unit initial area, and mark the corresponding pixel as an out-of-bounds pixel; determine whether each out-of-bounds pixel meets the merging requirement, that is, whether the difference is not greater than the threshold value X2; merge each out-of-bounds pixel that meets the merging requirement with the unit initial area to obtain a new unit initial area;

步骤SC5:循环步骤SC4,直到没有符合合并要求的界外像素为止,将单元初始区域标记为单元对照区;获取单元对照区的位置数据、各像素的灰度值、形状数据、灰度图像等相关数据,整合为单元检测数据;Step SC5: looping step SC4 until there are no out-of-bounds pixels that meet the merging requirements, marking the unit initial area as the unit control area; obtaining the position data of the unit control area, the gray value of each pixel, the shape data, the gray image and other related data, and integrating them into the unit detection data;

步骤六:将单元检测数据在胚胎模型中对应的单元区域上进行定位标记,即根据单元检测数据中相应的定位位置标记在单元区域上,可以了解是否错位;获取单元区域对应的校核信息,根据校核信息对单元检测数据进行校核,获得对应的检测校核结果;Step 6: Mark the unit detection data on the corresponding unit area in the embryo model, that is, mark the unit area according to the corresponding positioning position in the unit detection data to understand whether it is misplaced; obtain the verification information corresponding to the unit area, verify the unit detection data according to the verification information, and obtain the corresponding detection verification result;

根据校核信息对单元检测数据进行校核的方法包括:The method for verifying unit detection data according to verification information includes:

根据胚胎模型识别单元检测数据对应的单元检测形状和位置,形成对应的单元检测图,在单元检测图中标记单元区域对应的单元区域形状和位置;根据单元检测图进行形状评估,判断形状是否检测合格,主要从位置偏差和形状相似度两个方向进行判断,会预设相应的判断标准;获得对应的形状判断结果,包括形状判断合格和形状判断不合格;According to the unit detection shape and position corresponding to the unit detection data of the embryo model recognition unit, a corresponding unit detection map is formed, and the unit area shape and position corresponding to the unit area are marked in the unit detection map; shape evaluation is performed according to the unit detection map to determine whether the shape is qualified, mainly from the two directions of position deviation and shape similarity, and corresponding judgment standards are preset; corresponding shape judgment results are obtained, including qualified shape judgment and unqualified shape judgment;

根据校核信息和单元检测数据获取对应的校核灰度图像和单元检测灰度图像,校核灰度图像即为该单元区域在标准灰度图像的中对应的灰度图像;单元检测灰度图像即为单元对照区的灰度图像;According to the calibration information and the unit detection data, a corresponding calibration grayscale image and a unit detection grayscale image are obtained. The calibration grayscale image is the grayscale image corresponding to the unit area in the standard grayscale image; the unit detection grayscale image is the grayscale image of the unit control area;

将校核灰度图像和单元检测灰度图像进行对位比较,获得灰度差值面;即先根据位置是否偏差进行位置调整,然后再根据对应像素的灰度值进行相减,获得各像素对应的灰度差值的绝对值,形成灰度差值面;The calibration grayscale image and the unit detection grayscale image are compared to obtain a grayscale difference surface; that is, the position is first adjusted according to whether the position is deviated, and then the grayscale values of the corresponding pixels are subtracted to obtain the absolute value of the grayscale difference corresponding to each pixel to form a grayscale difference surface;

对灰度差值面进行分析,确定异常区域,识别异常区域面积,根据异常区域面积进行判断,获得对应的灰度校核结果;即当异常区域面积超过预设值时,判定灰度校核不合格,反之,判断灰度校核合格。The grayscale difference surface is analyzed to determine the abnormal area, identify the area of the abnormal area, make a judgment based on the area of the abnormal area, and obtain the corresponding grayscale verification result; that is, when the area of the abnormal area exceeds the preset value, the grayscale verification is judged to be unqualified, otherwise, the grayscale verification is judged to be qualified.

将形状判断结果和灰度校核结果整合为检测校核结果。The shape judgment results and grayscale verification results are integrated into the detection verification results.

对灰度差值面进行分析的方法包括:Methods for analyzing the grayscale difference surface include:

根据珐琅彩瓷的检测要求,设置对应的最大灰度差值,标记为灰度限值;根据灰度限值建立对应的转化公式式中:r(x,y)为灰度差值面中对应位置的灰度差值;(x,y)为对应位置的坐标;R为灰度限值;输出数据为转化值1或0;According to the inspection requirements of enamel porcelain, set the corresponding maximum grayscale difference, marked as the grayscale limit; establish the corresponding conversion formula according to the grayscale limit Where: r(x, y) is the grayscale difference of the corresponding position in the grayscale difference plane; (x, y) is the coordinate of the corresponding position; R is the grayscale limit; the output data is the conversion value 1 or 0;

通过转化公式对灰度差值面进行处理,获得各位置的转化值,将转化值为1对应的区域标记为异常区域。The grayscale difference surface is processed by the conversion formula to obtain the conversion value of each position, and the area corresponding to the conversion value of 1 is marked as an abnormal area.

步骤七:返回步骤四,直到根据识别序列完成全部检测为止。Step 7: Return to step 4 until all detections are completed according to the recognition sequence.

通过本发明实现对珐琅彩瓷进行智能检测,通过对珐琅彩瓷进行分割、分布式识别校核,降低珐琅彩瓷因表面的复杂性和多样性带来的不利影响,提高检测精度;且对于新出现的生产缺陷也可进行识别,提高检测的全面性和适用性;可以大幅减少人工参与,降低人工成本,同时提高检测的稳定性,还可以替代人工进行这些高风险操作,降低生产过程中的安全风险。The present invention can realize intelligent detection of enamel colored porcelain. By segmenting and distributing the identification and verification of enamel colored porcelain, the adverse effects caused by the complexity and diversity of the surface of enamel colored porcelain can be reduced, and the detection accuracy can be improved. Newly emerged production defects can also be identified, thereby improving the comprehensiveness and applicability of detection. Human participation can be greatly reduced, labor costs can be reduced, and the stability of detection can be improved. These high-risk operations can also be replaced by humans, thereby reducing safety risks in the production process.

一种珐琅彩瓷的缺陷检测系统,包括标准分析模块、采集模块和检测模块;A defect detection system for enamel colored porcelain, comprising a standard analysis module, a collection module and a detection module;

所述标准分析模块用于根据标准珐琅彩瓷建立胚胎模型,并对胚胎模型进行分割,获得各单元区域;对各单元区域进行识别排序,获得识别序列;并根据标准珐琅彩瓷设置对应的定位点;为各单元区域设置对应的校核信息。The standard analysis module is used to establish an embryo model according to the standard enamel porcelain, and segment the embryo model to obtain each unit area; identify and sort each unit area to obtain an identification sequence; and set corresponding positioning points according to the standard enamel porcelain; and set corresponding verification information for each unit area.

所述采集模块用于对待检珐琅彩瓷进行图像采集,获得检测图像;获取识别序列,根据预设的定位点对检测图像进行定位识别,确定识别序列中对应排序的单元区域在检测图像中的位置,标记为定位初始区域;对检测图像进行灰度处理,获得检测灰度图像,在检测灰度图像中标记定位初始区域,根据定位初始区域进行图像处理,确定单元区域对应的单元检测数据。The acquisition module is used to acquire images of the enamel porcelain to be inspected to obtain a detection image; obtain a recognition sequence, locate and identify the detection image according to a preset positioning point, determine the position of the correspondingly ordered unit area in the recognition sequence in the detection image, and mark it as the initial positioning area; perform grayscale processing on the detection image to obtain a detection grayscale image, mark the initial positioning area in the detection grayscale image, perform image processing according to the initial positioning area, and determine the unit detection data corresponding to the unit area.

所述检测模块用于对珐琅彩瓷的进行缺陷检测,将单元检测数据在胚胎模型中对应的单元区域上进行定位标记;获取单元区域对应的校核信息,根据校核信息对单元检测数据进行校核,获得对应的检测校核结果;依此类推,直到根据识别序列完成全部检测为止。The detection module is used to perform defect detection on enamel porcelain, locate and mark the unit detection data on the corresponding unit area in the embryo model; obtain the verification information corresponding to the unit area, verify the unit detection data according to the verification information, and obtain the corresponding detection verification result; and so on, until all detections are completed according to the recognition sequence.

上述公式均是去除量纲取其数值计算,公式是由采集大量数据进行软件模拟得到最接近真实情况的一个公式,公式中的预设参数和预设阈值由本领域的技术人员根据实际情况设定或者大量数据模拟获得。The above formulas are all calculated by removing dimensions and taking numerical values. The formula is a formula that is closest to the actual situation obtained by collecting a large amount of data and performing software simulation. The preset parameters and preset thresholds in the formula are set by technical personnel in this field according to actual conditions or obtained by simulating a large amount of data.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其它变体意在涵盖非排他性地包含,从而使得包括一系列要素的过程、装置、物品或者方法不仅包括那些要素,而且还包括没有明确列出的其它要素,或者还包括为这种过程、装置、物品或者方法所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、装置、物品或者方法中还存在另外的相同要素。It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.

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

对于本领域技术人员而言,显然本发明不限于上述示范性实施例的细节,而且在不背离本发明的精神或基本特征的情况下,能够以其他的具体形式实现本发明。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本发明的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化囊括在本发明内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现,本领域内的技术人员应明白,本发明的实施例可提供为方法、系统或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例,或结合软件和硬件方面的实施例的形式。而且本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。For the convenience of description, the above devices are described in terms of functions and are divided into various units and described separately. Of course, when implementing the present application, the functions of each unit can be implemented in the same one or more software and/or hardware. It should be understood by those skilled in the art that the embodiments of the present invention can be provided as methods, systems or computer program products. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

本发明是参照根据本发明实施例的方法、设备(系统)和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框,以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装。The present invention is described with reference to flowcharts and/or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each process and/or box in the flowchart and/or block diagram, as well as the combination of the processes and/or boxes in the flowchart and/or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one process or multiple boxes in the flowchart.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.

Claims (9)

1.一种珐琅彩瓷的缺陷检测方法,其特征在于,方法包括:1. A method for detecting defects in enamel colored porcelain, characterized in that the method comprises: 步骤一:获取标准珐琅彩瓷,根据标准珐琅彩瓷建立胚胎模型,根据标准珐琅彩瓷对胚胎模型进行分割,获得各单元区域;Step 1: Obtain standard enamel colored porcelain, establish an embryo model according to the standard enamel colored porcelain, segment the embryo model according to the standard enamel colored porcelain, and obtain each unit area; 步骤二:对各单元区域进行识别排序,获得识别序列;并根据标准珐琅彩瓷设置对应的定位点;为各单元区域设置对应的校核信息;Step 2: Identify and sort each unit area to obtain an identification sequence; set corresponding positioning points according to standard enamel porcelain; set corresponding verification information for each unit area; 步骤三:对待检珐琅彩瓷进行图像采集,获得检测图像;Step 3: Capture images of the enamel porcelain to be inspected to obtain inspection images; 步骤四:获取识别序列,根据预设的定位点对检测图像进行定位识别,确定识别序列中对应排序的单元区域在检测图像中的位置,标记为定位初始区域;Step 4: Obtain the recognition sequence, perform positioning recognition on the detection image according to the preset positioning points, determine the position of the correspondingly ordered unit area in the recognition sequence in the detection image, and mark it as the initial positioning area; 步骤五:对检测图像进行灰度处理,获得检测灰度图像,在检测灰度图像中标记定位初始区域,根据定位初始区域进行图像处理,确定单元区域对应的单元检测数据;Step 5: grayscale processing is performed on the detection image to obtain a detection grayscale image, an initial positioning area is marked in the detection grayscale image, image processing is performed according to the initial positioning area, and unit detection data corresponding to the unit area is determined; 步骤六:将单元检测数据在胚胎模型中对应的单元区域上进行定位标记;获取单元区域对应的校核信息,根据校核信息对单元检测数据进行校核,获得对应的检测校核结果;Step 6: Position and mark the unit detection data on the corresponding unit area in the embryo model; obtain the verification information corresponding to the unit area, verify the unit detection data according to the verification information, and obtain the corresponding detection verification result; 步骤七:返回步骤四,直到根据识别序列完成全部检测为止。Step 7: Return to step 4 until all detections are completed according to the recognition sequence. 2.根据权利要求1所述的一种珐琅彩瓷的缺陷检测方法,其特征在于,根据标准珐琅彩瓷对胚胎模型进行分割的方法包括:2. The method for detecting defects of enamel colored porcelain according to claim 1, characterized in that the method for segmenting the embryo model according to the standard enamel colored porcelain comprises: 获取标准珐琅彩瓷对应的标准图像,对所述标准图像进行分割,获得各初始图像以及各初始图像之间的过渡区域;Obtaining a standard image corresponding to the standard enamel porcelain, segmenting the standard image, and obtaining initial images and transition areas between the initial images; 对所述标准图像进行灰度处理,获得标准灰度图像,在标准灰度图像中标记各初始图像和过渡区域;确定各过渡区域对应的初始图像,标记为基准图像;设置各基准图像的初始值;Performing grayscale processing on the standard image to obtain a standard grayscale image, marking each initial image and transition area in the standard grayscale image; determining the initial image corresponding to each transition area and marking it as a reference image; and setting an initial value of each reference image; 识别过渡区域内各像素的灰度值,通过预设的判断模型对各灰度值进行分析,确定各像素对应的基准图像;Identify the grayscale value of each pixel in the transition area, analyze each grayscale value through a preset judgment model, and determine the reference image corresponding to each pixel; 将过渡区域内各像素合并到对应的基准图像中,获得各单元图像;根据单元图像在胚胎模型中的位置区域对胚胎模型进行分割,获得各单元区域。Each pixel in the transition area is merged into the corresponding reference image to obtain each unit image; the embryo model is segmented according to the position area of the unit image in the embryo model to obtain each unit area. 3.根据权利要求2所述的一种珐琅彩瓷的缺陷检测方法,其特征在于,设置各基准图像的初始值的方法包括:3. The method for detecting defects in enamel porcelain according to claim 2, wherein the method for setting the initial value of each reference image comprises: 步骤SA1:识别基准图像中各像素的灰度值,将各灰度值相同的各相邻像素进行合并,获得各第一区域;确定第一区域的第一区域值;Step SA1: identifying the gray value of each pixel in the reference image, merging adjacent pixels with the same gray value to obtain each first region; and determining the first region value of the first region; 步骤SA2:计算各相邻第一区域的第一区域值之间的差值,标记为第一差值;将第一差值不大于阈值X1的各相邻第一区域进行合并,获得新的第一区域;确定新的第一区域值;Step SA2: Calculate the difference between the first region values of adjacent first regions, marked as the first difference; merge the adjacent first regions whose first difference is not greater than the threshold value X1 to obtain a new first region; determine the new first region value; 步骤SA3:循环步骤SA2,直到各第一差值均大于阈值X1为止;识别各第一区域的面积;Step SA3: looping step SA2 until all first differences are greater than the threshold value X1; identifying the area of each first region; 根据公式计算对应的初始值;According to the formula Calculate the corresponding initial value; 式中:CZ为初始值;v表示对应的第一区域,c=1、2、……、v,v为正整数;Ac表示对应的第一区域面积;DZc表示对应第一区域的第一区域值。In the formula: CZ is the initial value; v represents the corresponding first region, c=1, 2, ..., v, v is a positive integer; Ac represents the corresponding first region area; DZc represents the first region value corresponding to the first region. 4.根据权利要求2所述的一种珐琅彩瓷的缺陷检测方法,其特征在于,判断模型的表达式为:4. The method for detecting defects in enamel colored porcelain according to claim 2, wherein the expression of the judgment model is: 式中:s为过渡区域内相应像素的灰度值。 Where: s is the gray value of the corresponding pixel in the transition area. 5.根据权利要求2所述的一种珐琅彩瓷的缺陷检测方法,其特征在于,对各单元区域进行识别排序的方法包括:5. The method for detecting defects in enamel porcelain according to claim 2, characterized in that the method for identifying and sorting each unit area comprises: 获取各单元区域对应的单元图像,对各单元图像进行等同标记;根据各单元图像进行识别顺序组合,获得各待选组合;Obtain unit images corresponding to each unit area, and mark each unit image equally; perform identification sequence combination according to each unit image to obtain each candidate combination; 基于标准珐琅彩瓷的标准图像对各待选组合进行识别模拟,获得对应的识别效率和识别精度;Based on the standard image of standard enamel porcelain, each candidate combination is recognized and simulated to obtain the corresponding recognition efficiency and recognition accuracy; 根据公式PQ=b1×XL+b2×DL计算对应的模拟值;Calculate the corresponding simulation value according to the formula PQ = b1 × XL + b2 × DL; 式中:PQ为模拟值;b1、b2均为比例系数,取值范围为0<b1≤1,0<b2≤1;XL为识别效率;DL为识别精度;Where: PQ is the simulation value; b1 and b2 are both proportional coefficients, with a value range of 0<b1≤1, 0<b2≤1; XL is the recognition efficiency; DL is the recognition accuracy; 根据模拟值最大的待选组合设置识别序列。The recognition sequence is set according to the candidate combination with the largest simulation value. 6.根据权利要求1所述的一种珐琅彩瓷的缺陷检测方法,其特征在于,对定位初始区域进行图像处理的方法包括:6. The method for defect detection of enamel porcelain according to claim 1, characterized in that the method of performing image processing on the initial positioning area comprises: 步骤SC1:识别定位初始区域内各像素的灰度值,将灰度值相同的各相邻像素进行合并,获得第二区域;Step SC1: Identify and locate the grayscale value of each pixel in the initial area, merge adjacent pixels with the same grayscale value to obtain a second area; 步骤SC2:计算各相邻第二区域之间的第二差值;将第二差值不大于阈值X2的相邻第二区域进行合并,获得新的第二区域;Step SC2: calculating the second difference between each adjacent second region; merging the adjacent second regions whose second difference is not greater than the threshold value X2 to obtain a new second region; 步骤SC3:循环步骤SC2,直到没有不大于阈值X2的第二差值为止,根据剩余的各第二区域确定单元初始区域;Step SC3: looping step SC2 until there is no second difference value not greater than the threshold value X2, and determining the unit initial region according to the remaining second regions; 步骤SC4:识别定位初始区域外与单元初始区域相邻的各像素,标记为界外像素;识别各界外像素的灰度值,评估各界外像素是否满足合并要求,将满足合并要求的各界外像素与单元初始区域进行合并,获得新的单元初始区域;Step SC4: Identify and locate each pixel outside the initial region and adjacent to the unit initial region, and mark them as out-of-bounds pixels; identify the grayscale value of each out-of-bounds pixel, evaluate whether each out-of-bounds pixel meets the merging requirement, merge each out-of-bounds pixel that meets the merging requirement with the unit initial region, and obtain a new unit initial region; 步骤SC5:循环步骤SC4,直到没有符合合并要求的界外像素为止,将单元初始区域标记为单元对照区;根据单元对照区获取单元检测数据。Step SC5: loop step SC4 until there are no out-of-bounds pixels that meet the merging requirements, mark the unit initial area as the unit control area; and obtain unit detection data according to the unit control area. 7.根据权利要求1所述的一种珐琅彩瓷的缺陷检测方法,其特征在于,根据校核信息对单元检测数据进行校核的方法包括:7. The method for defect detection of enamel porcelain according to claim 1, characterized in that the method for verifying the unit detection data according to the verification information comprises: 根据胚胎模型、校核信息和单元检测数据生成对应的单元检测图,根据单元检测图进行形状评估,获得对应的形状判断结果;Generate a corresponding unit detection graph according to the embryo model, verification information and unit detection data, perform shape evaluation according to the unit detection graph, and obtain a corresponding shape judgment result; 根据校核信息和单元检测数据获取对应的校核灰度图像和单元检测灰度图像;Acquire corresponding calibration grayscale image and unit detection grayscale image according to calibration information and unit detection data; 将校核灰度图像和单元检测灰度图像进行对位比较,获得灰度差值面;对灰度差值面进行分析,确定异常区域,识别异常区域面积,根据异常区域面积进行判断,获得对应的灰度校核结果;Compare the verification grayscale image and the unit detection grayscale image to obtain a grayscale difference surface; analyze the grayscale difference surface to determine the abnormal area, identify the area of the abnormal area, make a judgment based on the area of the abnormal area, and obtain the corresponding grayscale verification result; 将形状判断结果和灰度校核结果整合为检测校核结果。The shape judgment results and grayscale verification results are integrated into the detection verification results. 8.根据权利要求7所述的一种珐琅彩瓷的缺陷检测方法,其特征在于,对灰度差值面进行分析的方法包括:8. The method for detecting defects of enamel porcelain according to claim 7, characterized in that the method for analyzing the grayscale difference surface comprises: 设置灰度限值;根据灰度限值建立对应的转化公式式中:r(x,y)为灰度差值面中对应位置的灰度差值;(x,y)为对应位置的坐标;R为灰度限值;输出数据为转化值1或0;Set the grayscale limit; establish the corresponding conversion formula according to the grayscale limit Where: r(x, y) is the grayscale difference of the corresponding position in the grayscale difference plane; (x, y) is the coordinate of the corresponding position; R is the grayscale limit; the output data is the conversion value 1 or 0; 通过转化公式对灰度差值面进行处理,获得各位置的转化值,将转化值为1对应的区域标记为异常区域。The grayscale difference surface is processed by the conversion formula to obtain the conversion value of each position, and the area corresponding to the conversion value of 1 is marked as an abnormal area. 9.一种珐琅彩瓷的缺陷检测系统,其特征在于,执行权利要求1至8任意一项所述的一种珐琅彩瓷的缺陷检测方法,包括标准分析模块、采集模块和检测模块;9. A defect detection system for enamel colored porcelain, characterized in that it implements a defect detection method for enamel colored porcelain as claimed in any one of claims 1 to 8, comprising a standard analysis module, a collection module and a detection module; 所述标准分析模块用于根据标准珐琅彩瓷建立胚胎模型,并对胚胎模型进行分割,获得各单元区域;对各单元区域进行识别排序,获得识别序列;并根据标准珐琅彩瓷设置对应的定位点;为各单元区域设置对应的校核信息;The standard analysis module is used to establish an embryo model according to the standard enamel porcelain, and segment the embryo model to obtain each unit area; identify and sort each unit area to obtain an identification sequence; and set corresponding positioning points according to the standard enamel porcelain; set corresponding verification information for each unit area; 所述采集模块用于对待检珐琅彩瓷进行图像采集,获得检测图像;获取识别序列,根据预设的定位点对检测图像进行定位识别,确定识别序列中对应排序的单元区域在检测图像中的位置,标记为定位初始区域;对检测图像进行灰度处理,获得检测灰度图像,在检测灰度图像中标记定位初始区域,根据定位初始区域进行图像处理,确定单元区域对应的单元检测数据;The acquisition module is used to acquire images of the enamel porcelain to be inspected to obtain a detection image; obtain a recognition sequence, perform positioning recognition on the detection image according to a preset positioning point, determine the position of the correspondingly ordered unit area in the recognition sequence in the detection image, and mark it as the initial positioning area; perform grayscale processing on the detection image to obtain a detection grayscale image, mark the initial positioning area in the detection grayscale image, perform image processing according to the initial positioning area, and determine the unit detection data corresponding to the unit area; 所述检测模块用于对珐琅彩瓷的进行缺陷检测,将单元检测数据在胚胎模型中对应的单元区域上进行定位标记;获取单元区域对应的校核信息,根据校核信息对单元检测数据进行校核,获得对应的检测校核结果;依此类推,直到根据识别序列完成全部检测为止。The detection module is used to perform defect detection on enamel porcelain, locate and mark the unit detection data on the corresponding unit area in the embryo model; obtain the verification information corresponding to the unit area, verify the unit detection data according to the verification information, and obtain the corresponding detection verification result; and so on, until all detections are completed according to the recognition sequence.
CN202410556430.5A 2024-05-07 2024-05-07 A defect detection system and method for enamel colored porcelain Active CN118446984B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410556430.5A CN118446984B (en) 2024-05-07 2024-05-07 A defect detection system and method for enamel colored porcelain

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410556430.5A CN118446984B (en) 2024-05-07 2024-05-07 A defect detection system and method for enamel colored porcelain

Publications (2)

Publication Number Publication Date
CN118446984A CN118446984A (en) 2024-08-06
CN118446984B true CN118446984B (en) 2024-11-05

Family

ID=92329170

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410556430.5A Active CN118446984B (en) 2024-05-07 2024-05-07 A defect detection system and method for enamel colored porcelain

Country Status (1)

Country Link
CN (1) CN118446984B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116468726A (en) * 2023-06-13 2023-07-21 厦门福信光电集成有限公司 Online foreign matter line detection method and system
CN116485764A (en) * 2023-04-26 2023-07-25 中铁交通投资集团有限公司 Method, system, terminal and medium for identifying structural surface defects

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4562126B2 (en) * 2004-09-29 2010-10-13 大日本スクリーン製造株式会社 Defect detection apparatus and defect detection method
CN117237336B (en) * 2023-11-10 2024-02-23 湖南科技大学 Metallized ceramic ring defect detection method, system and readable storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116485764A (en) * 2023-04-26 2023-07-25 中铁交通投资集团有限公司 Method, system, terminal and medium for identifying structural surface defects
CN116468726A (en) * 2023-06-13 2023-07-21 厦门福信光电集成有限公司 Online foreign matter line detection method and system

Also Published As

Publication number Publication date
CN118446984A (en) 2024-08-06

Similar Documents

Publication Publication Date Title
WO2021143343A1 (en) Method and device for testing product quality
CN105139386B (en) A kind of image processing method of fast automatic detecting electric connector solder joint defective work
CN113222913B (en) Circuit board defect detection positioning method, device and storage medium
WO2024002187A1 (en) Defect detection method, defect detection device, and storage medium
CN111242899B (en) Image-based flaw detection method and computer-readable storage medium
CN112634203B (en) Image detection method, electronic device, and computer-readable storage medium
CN111080622A (en) Neural network training method, workpiece surface defect classification and detection method and device
CN108764134A (en) A kind of automatic positioning of polymorphic type instrument and recognition methods suitable for crusing robot
CN114004815B (en) A PCBA appearance detection method and device
CN114004826B (en) A vision-based method for detecting appearance defects of medical injection molded parts
CN107895362A (en) A kind of machine vision method of miniature binding post quality testing
CN118967672A (en) Industrial defect detection method, system, device and storage medium
CN111754502A (en) A method of detecting surface defects of magnetic core based on Faster-RCNN algorithm based on multi-scale feature fusion
CN112967224A (en) Electronic circuit board detection system, method and medium based on artificial intelligence
CN114441452B (en) Optical fiber pigtail detection method
CN113420839B (en) Semi-automatic labeling method and segmentation positioning system for stacking planar target objects
CN109102486B (en) Surface defect detection method and device based on machine learning
CN118446984B (en) A defect detection system and method for enamel colored porcelain
CN113269234A (en) Connecting piece assembly detection method and system based on target detection
CN118735915A (en) A paint detection method and detection system based on multi-dimensional visual analysis
CN116091503B (en) A method, device, equipment, and medium for identifying foreign matter defects in a panel
CN117726966A (en) A video inspection method and terminal based on artificial intelligence
CN116563202A (en) Building surface crack identification method and system based on convolutional neural network
CN115937555A (en) Industrial defect detection algorithm based on standardized flow model
CN109360289B (en) Power meter detection method fusing inspection robot positioning information

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