CN115471684A - Injection molding workpiece template matching method, electronic equipment and storage medium - Google Patents

Injection molding workpiece template matching method, electronic equipment and storage medium Download PDF

Info

Publication number
CN115471684A
CN115471684A CN202210994199.9A CN202210994199A CN115471684A CN 115471684 A CN115471684 A CN 115471684A CN 202210994199 A CN202210994199 A CN 202210994199A CN 115471684 A CN115471684 A CN 115471684A
Authority
CN
China
Prior art keywords
matching
image
workpiece
injection molding
template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210994199.9A
Other languages
Chinese (zh)
Inventor
秦岭
胡志成
尹政杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan University of Technology WUT
Original Assignee
Wuhan University of Technology WUT
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 Wuhan University of Technology WUT filed Critical Wuhan University of Technology WUT
Priority to CN202210994199.9A priority Critical patent/CN115471684A/en
Publication of CN115471684A publication Critical patent/CN115471684A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/752Contour matching
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B07SEPARATING SOLIDS FROM SOLIDS; SORTING
    • B07CPOSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
    • B07C5/00Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
    • B07C5/34Sorting according to other particular properties
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B07SEPARATING SOLIDS FROM SOLIDS; SORTING
    • B07CPOSTAL SORTING; SORTING INDIVIDUAL ARTICLES, OR BULK MATERIAL FIT TO BE SORTED PIECE-MEAL, e.g. BY PICKING
    • B07C5/00Sorting according to a characteristic or feature of the articles or material being sorted, e.g. by control effected by devices which detect or measure such characteristic or feature; Sorting by manually actuated devices, e.g. switches
    • B07C5/36Sorting apparatus characterised by the means used for distribution
    • B07C5/361Processing or control devices therefor, e.g. escort memory
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • G06V10/765Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects using rules for classification or partitioning the feature space

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Injection Moulding Of Plastics Or The Like (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses an injection molding workpiece template matching method, electronic equipment and a storage medium, wherein J (psi) ij ) The arbitration function implements a template matching mechanism. Comprises four main steps: preprocessing image data of an injection molding workpiece; extracting contour features of an image data set and establishing a standard template; obtaining matching precision and determining a matching threshold value and a statistical scaling value thereof for an injection molding workpiece by adopting a Hu moment-based contour matching algorithm; finally using a base based on J (psi) ij ) And matching the workpiece to be detected with the standard template by a plastic template matching mechanism of the arbitration function. The method replaces the detection based on the gray value in the traditional detection method, so that the template matching of the injection molding workpiece has stability on the influence factors such as translation, rotation and scaling. The invention realizes the automatic detection of the defects of the injection molding workpiece, and has the advantages of high detection speed, and obviously improved accuracy and robustness compared with the traditional method.

Description

注塑工件模板匹配方法、电子设备及存储介质Injection molding workpiece template matching method, electronic equipment and storage medium

技术领域technical field

本发明涉及注塑工件缺陷检测领域,具体涉及一种对待测的工件图像兼具了平移、旋转、缩放稳定性的注塑工件模板匹配方法、电子设备及存储介质。The invention relates to the field of defect detection of injection molded workpieces, in particular to a template matching method for injection molded workpieces, electronic equipment and a storage medium with translation, rotation and scaling stability of the workpiece image to be tested.

背景技术Background technique

在自动化普及程度较高的地区,注塑产线已基本实现全自动化。而对注塑工件的质检仍主要采用人工目测来检测塑件的表面缺陷,这种开环的工作方法主观性强,实时监控能力较弱,鉴于人工检测的标准不一,检测标准不稳定。同时,从作业环境来讲,一线工人在工作过程中也面临危险性,且劳动强度较大。In areas with a high degree of automation, injection molding production lines have basically achieved full automation. However, the quality inspection of injection molded workpieces still mainly uses manual visual inspection to detect surface defects of plastic parts. This open-loop working method is highly subjective and has weak real-time monitoring capabilities. Due to the different standards of manual inspection, the inspection standards are unstable. At the same time, from the perspective of the working environment, front-line workers also face dangers during the work process, and the labor intensity is relatively high.

目前也有采用图像识别的方式进行注塑工件的表面检测,但是当塑件图像在实际拍摄过程中发生平移、旋转、缩放等畸变影响下,误报比例大且准确率低,实际应用效果并不理想,仅在容易出现一致性表面缺陷的几个工位能够使用,适用性非常窄。At present, image recognition is also used to detect the surface of injection molded workpieces. However, under the influence of translation, rotation, zooming and other distortions in the actual shooting process of the plastic part image, the proportion of false alarms is large and the accuracy rate is low, and the actual application effect is not ideal. , can only be used in a few stations that are prone to consistent surface defects, and the applicability is very narrow.

发明内容Contents of the invention

本发明要解决的技术问题是提供一种兼具多变量稳定性的注塑工件模板匹配方法、电子设备及存储介质,塑件图像在实际拍摄过程中发生平移、旋转、缩放等畸变影响下,仍然能够进行合格与否的判定,以解决现有技术检测标准主观性强、准确率低,鲁棒性不佳,应用范围窄以及人工成本高等问题,实现塑件质量检测环节的自动化。The technical problem to be solved by the present invention is to provide a template matching method for injection molded workpieces with multivariable stability, electronic equipment and storage media. It can judge whether it is qualified or not, so as to solve the problems of strong subjectivity, low accuracy, poor robustness, narrow application range and high labor cost of the existing technical testing standards, and realize the automation of the quality testing process of plastic parts.

为解决以上技术问题,本发明采用以下技术方案:In order to solve the above technical problems, the present invention adopts the following technical solutions:

一种兼具多变量稳定性的注塑工件模板匹配方法,其特征在于包括如下步骤:A method for matching templates of injection molded workpieces with multivariate stability, characterized in that it comprises the following steps:

S1:采集注塑工件图像并对所采集的注塑工件图像数据预处理;S1: Collect the image of the injection molding workpiece and preprocess the collected image data of the injection molding workpiece;

S2:图像数据集的轮廓特征提取和标准模板数据的建立;S2: Contour feature extraction of image dataset and establishment of standard template data;

S3:对注塑工件采用基于Hu矩的轮廓匹配算法得出匹配精度;S3: The contour matching algorithm based on the Hu moment is used to obtain the matching accuracy for the injection molded workpiece;

S4:使用基于J(ψij)仲裁函数的塑件模板匹配机制对待测工件与标准模板进行匹配。S4: Use the J(ψ ij ) arbitration function-based plastic part template matching mechanism to match the workpiece to be tested with the standard template.

进一步地,步骤S1中注塑工件图像数据预处理包括以下步骤:原始图像进行灰度变换处理,灰度图像进行中值滤波,经平滑处理后的图像再进行锐化处理。Further, the preprocessing of the image data of the injection molded workpiece in step S1 includes the following steps: performing grayscale transformation processing on the original image, performing median filtering on the grayscale image, and performing sharpening processing on the smoothed image.

进一步地,步骤S2中图像数据集的轮廓特征提取使用Canny边缘检测算法,首先用高斯一阶导函数滤波器对图像进行预处理,再计算出梯度的方向和幅值,基于非最大化抑制理论确定图像较为精确的边缘信息,并根据实际图像设定相应阈值获取最佳轮廓特征,由此建立各类缺陷图像的标准模板的图像数据库。Further, the contour feature extraction of the image data set in step S2 uses the Canny edge detection algorithm. First, the Gaussian first-order derivative function filter is used to preprocess the image, and then the direction and magnitude of the gradient are calculated. Based on the non-maximization suppression theory Determine the more accurate edge information of the image, and set the corresponding threshold according to the actual image to obtain the best contour features, thereby establishing an image database of standard templates for various defect images.

进一步地,步骤S2中将高门限灰度值设定为240,低门限灰度值设定为200。Further, in step S2, the high threshold gray value is set to 240, and the low threshold gray value is set to 200.

进一步地,步骤S3中对注塑工件采用基于Hu矩的轮廓匹配算法得出匹配精度包括以下步骤:利用Hu矩函数建立模板图像和缺陷图像的不变矩数据,将缺陷图像的不变矩数据与模板图像的不变矩数据进行匹配得出匹配结果,将匹配结果的数值作为几何轮廓相似度的度量。Further, in step S3, the contour matching algorithm based on the Hu moment is used for the injection molded workpiece to obtain the matching accuracy, which includes the following steps: using the Hu moment function to establish the invariant moment data of the template image and the defect image, and combining the invariant moment data of the defect image with the The invariant moment data of the template image is matched to obtain the matching result, and the value of the matching result is used as a measure of the similarity of the geometric contour.

进一步地,步骤S3中Hu矩函数是图像的二阶、三阶中心矩组合成的七个不变矩。Further, the Hu moment function in step S3 is seven invariant moments composed of the second-order and third-order central moments of the image.

进一步地,步骤S3中,缺陷图像的不变矩数据与模板图像的不变矩数据之间使用如下公式进行匹配:Further, in step S3, the following formula is used for matching between the invariant moment data of the defect image and the invariant moment data of the template image:

Figure BDA0003804989330000021
Figure BDA0003804989330000021

其中,ψij表示匹配结果,记作匹配精度,其数值大小和相似程度呈反相关趋势;i用于记待测工件的编号,j表示同一工件图像输进行匹配的次数,k表示被处理图像的Hu矩从一到七的顺序,A表示标准模板,B表示历次的待测图像;

Figure BDA0003804989330000031
表示图片编号为i的标准模板的第k个Hu矩数据,
Figure BDA0003804989330000032
表示图片编号为i的待测图像的第k个Hu矩数据。Among them, ψij represents the matching result, which is recorded as the matching accuracy, and its numerical value and similarity show an anti-correlation trend; i is used to record the number of the workpiece to be tested, j represents the number of matching times of the same workpiece image input, and k represents the processed image The order of the Hu moments from one to seven, A represents the standard template, and B represents the previous images to be tested;
Figure BDA0003804989330000031
Indicates the kth Hu moment data of the standard template with picture number i,
Figure BDA0003804989330000032
Indicates the kth Hu moment data of the image to be tested with the image number i.

进一步地,步骤S4中使用基于J(ψij)仲裁函数的塑件模板匹配机制对待测工件与标准模板进行匹配按以下仲裁函数公式进行匹配:Further, in step S4, use the J(ψ ij ) arbitration function-based plastic part template matching mechanism to match the workpiece to be tested with the standard template according to the following arbitration function formula:

Figure BDA0003804989330000033
Figure BDA0003804989330000033

仲裁函数J(ψij)中,i表示待测工件的编号,j表示同一工件图像输进行匹配的次数也是同一工件输入仲裁函数的次数,一般是一次或者两次;huA[k]表示标准模板图像的Hu不变矩数据,k表示被处理图像的Hu矩从一到七的顺序;Ω为合格工件的精度下限阈值;In the arbitration function J(ψ ij ), i represents the number of the workpiece to be tested, and j represents the number of matching times of the same workpiece image input is also the number of times the same workpiece is input into the arbitration function, usually once or twice; hu A [k] represents the standard The Hu invariant moment data of the template image, k represents the order of the Hu moment of the processed image from one to seven; Ω is the lower limit threshold of the accuracy of the qualified workpiece;

如果仲裁函数J(ψij)值为1,也即匹配精度低于阈值Ω,则该图像所表示的工件为合格产品;If the value of the arbitration function J(ψ ij ) is 1, that is, the matching accuracy is lower than the threshold Ω, the workpiece represented by the image is a qualified product;

如果仲裁函数值为0,也即匹配精度高于阈值Ω,但低于其统计学缩放值,则将图像进行二次预处理,进一步提取特征信息后再匹配,如第二次的匹配精度仍高于阈值,再划归到缺陷图像数据集;If the arbitration function value is 0, that is, the matching accuracy is higher than the threshold Ω, but lower than its statistical scaling value, the image will be preprocessed twice, and the feature information will be further extracted before matching. If the second matching accuracy is still If it is higher than the threshold, it is classified into the defect image data set;

如果函数值为-1,也即匹配精度Ω高于阈值的统计学缩放值,将该工件直接划归为缺陷图像数据集。If the function value is -1, that is, the statistical scaling value of the matching accuracy Ω is higher than the threshold, the artifact is directly classified as a defect image dataset.

一种电子设备,包括:存储器、处理器及在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如上所述方法的步骤。An electronic device, comprising: a memory, a processor, and a computer program on the memory that can run on the processor, wherein the processor implements the steps of the above method when executing the computer program.

一种暂态或非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被执行时实现如上所述方法的步骤。A transient or non-transitory computer-readable storage medium, on which a computer program is stored, is characterized in that, when the computer program is executed, the steps of the above method are realized.

由此,本发明公开了一种兼具多变量稳定性的注塑工件模板匹配新方法及电子设备和存储介质,Thus, the present invention discloses a new template matching method for injection molded workpieces with multi-variable stability, electronic equipment and storage media,

与现有技术相比,本发明的技术方案所带来的有益效果是:Compared with the prior art, the beneficial effects brought by the technical solution of the present invention are:

取代了基于灰度值的模板匹配方法,使得匹配过程对平移、旋转、缩放等影响因素具有鲁棒性。It replaces the template matching method based on the gray value, making the matching process robust to factors such as translation, rotation, and scaling.

通过本发明中的J(ψij)仲裁函数,对一部分可能存在错误分类的图像进行二次匹配,增加了容错率的新匹配方法有利于增强注塑工件缺陷分类的准确性。Through the J(ψ ij ) arbitration function in the present invention, secondary matching is performed on some images that may have misclassifications, and the new matching method that increases the error tolerance rate is conducive to enhancing the accuracy of defect classification of injection molding workpieces.

本发明的系统和电子设备可以实现注塑工件的自动化检测,提高检测质量且检测一致性得到保证。The system and electronic equipment of the present invention can realize the automatic detection of injection molded workpieces, improve the detection quality and ensure the detection consistency.

附图说明Description of drawings

下面将结合附图及实施例对本发明作进一步说明,附图中:The present invention will be further described below in conjunction with accompanying drawing and embodiment, in the accompanying drawing:

图1是本发明兼具多变量稳定性的注塑工件模板匹配方法的流程图。Fig. 1 is a flow chart of the template matching method for injection molded workpieces with multivariable stability of the present invention.

图2是本发明注塑工件原始图像(a)与预处理之后图像(b)对比图。Fig. 2 is a comparison diagram of the original image (a) of the injection molded workpiece of the present invention and the image (b) after pretreatment.

图3是实施例中Canny边缘检测算法高门限(a)与低门限(b)对比图,其中(a)图的两个门限分别为240、200;(b)图的两个门限分别为40、20。Fig. 3 is the contrast diagram of high threshold (a) and low threshold (b) of Canny edge detection algorithm in the embodiment, wherein the two thresholds of (a) figure are 240,200 respectively; The two thresholds of (b) figure are 40 respectively , 20.

图4是本发明特征提取结果。Fig. 4 is the feature extraction result of the present invention.

图5是本发明所提出模板匹配方法的具体流程图。Fig. 5 is a specific flow chart of the template matching method proposed by the present invention.

具体实施方式detailed description

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

根据本发明实施的兼具多变量稳定性的注塑工件模板匹配方法,如图1和5所示。输入端为采集的塑件图像,输出端为图像是否合格的判定结果。按如下的实施例基于模板匹配结果实现判定:The template matching method for injection molded workpieces with multivariable stability implemented according to the present invention is shown in FIGS. 1 and 5 . The input end is the collected image of the plastic part, and the output end is the judgment result of whether the image is qualified or not. According to the following embodiment, the judgment is realized based on the template matching result:

(1)注塑工件图像数据预处理:原始图像进行灰度变换处理,灰度图像进行中值滤波,经平滑处理图像进行图像锐化处理。本步骤所述灰度变换处理作用为提高注塑工件识别度,所述平滑处理作用为消除图像噪声。所述锐化处理作用为消除平滑处理造成的模糊。注塑工件图像数据预处理结果如图2。(1) Preprocessing of the image data of the injection molding workpiece: the original image is processed by grayscale transformation, the grayscale image is processed by median filtering, and the smoothed image is processed by image sharpening. The function of the gray scale conversion processing in this step is to improve the recognition degree of the injection molded workpiece, and the function of the smoothing processing is to eliminate image noise. The sharpening process is used to eliminate the blur caused by the smoothing process. The preprocessing results of the image data of the injection molding workpiece are shown in Figure 2.

(2)图像数据集的轮廓特征提取和标准模板的建立:图像数据集的轮廓特征提取使用Canny边缘检测算法,并根据实际图像设定相应阈值获取最佳轮廓特征。所述Canny边缘检测算法本实施例中采用高阈值如图3。(2) Contour feature extraction of image data set and establishment of standard template: the contour feature extraction of image data set uses Canny edge detection algorithm, and the corresponding threshold is set according to the actual image to obtain the best contour feature. The Canny edge detection algorithm in this embodiment adopts a high threshold as shown in Fig. 3 .

本实施例针对塑件在工业生产中最可能出现的8类缺陷形式分别进行轮廓特征提取,8类缺陷:塑件翘曲变形、表面黑点、尺寸不稳定、收缩凹陷、银纹、飞边、填充不良、开裂。特征提取结果如图4。In this embodiment, contour feature extraction is performed on 8 types of defects that are most likely to occur in plastic parts in industrial production. 8 types of defects: warping of plastic parts, black spots on the surface, unstable dimensions, shrinkage depressions, silver streaks, and flashing , poor filling, cracking. The feature extraction results are shown in Figure 4.

(3)对注塑工件采用基于Hu矩的轮廓匹配算法得出匹配精度:利用Hu矩函数(下式3)建立模板图像和缺陷图像的不变矩数据,将缺陷图像的不变矩数据与模板图像的不变矩数据进行匹配得出匹配结果,将匹配结果的数值作为几何轮廓相似度的度量。Hu矩函数是图像的二阶、三阶中心矩组合成的七个不变矩。(3) The contour matching algorithm based on the Hu moment is used for the injection molding workpiece to obtain the matching accuracy: the invariant moment data of the template image and the defect image are established by using the Hu moment function (equation 3 below), and the invariant moment data of the defect image are compared with the template The invariant moment data of the image is matched to obtain the matching result, and the value of the matching result is used as a measure of the similarity of the geometric contour. The Hu moment function is the seven invariant moments composed of the second-order and third-order central moments of the image.

本实施例所述建立的模板图像的HU矩数据如下:The HU moment data of the template image set up described in this embodiment are as follows:

Hu1[1]=2.02425;Hu1[2]=4.46429;Hu1[3]=8.01779;Hu1[4]=8.98081;Hu1[5]=18.0195;Hu1[6]=-11.5543;Hu1[7]=17.499。Hu1[1]=2.02425; Hu1[2]=4.46429; Hu1[3]=8.01779; Hu1[4]=8.98081; Hu1[5]=18.0195; Hu1[6]=-11.5543; Hu1[7]=17.499.

Figure BDA0003804989330000061
Figure BDA0003804989330000061

本实施例中,该函数对标准工件的匹配精度在0.0871到0.1517之间。引入这个匹配精度区间的下限记作Ω,用于建立J(ψij)仲裁函数,本实施例中Ω=0.15。In this embodiment, the matching accuracy of the function to the standard workpiece is between 0.0871 and 0.1517. The lower limit introduced into this matching precision interval is denoted as Ω, which is used to establish the J(ψ ij ) arbitration function, and Ω=0.15 in this embodiment.

将设计好的标准模板分别于8类缺陷图像进行匹配,并输出匹配结果如下。Match the designed standard templates with the 8 types of defect images, and output the matching results as follows.

Figure BDA0003804989330000062
Figure BDA0003804989330000062

(4)使用基于J(ψij)仲裁函数的塑件模板匹配机制对待测工件与标准模板进行匹配:结合标准模板的数据,本实例中阈值Ω的统计学缩放值为0.2542。除了塑件尺寸不稳定这类缺陷会进入二次预处理程序以外,其他七类缺陷均顺利检测。而尺寸不稳定的图像在二次预处理以后也得到了准确地分类。(4) Use the J(ψ ij ) arbitration function-based plastic part template matching mechanism to match the workpiece to be tested with the standard template: combined with the data of the standard template, the statistical scaling value of the threshold Ω in this example is 0.2542. Except for defects such as unstable dimensions of plastic parts that will enter the secondary pretreatment process, the other seven types of defects were successfully detected. The images with unstable size are also accurately classified after the second preprocessing.

将本发明提出的新方法可视化后,如图5所示。After the new method proposed by the present invention is visualized, it is shown in FIG. 5 .

本发明实施例的电子设备,包括:存储器、处理器及在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如上所述方法的步骤。电子设备可以设置在相应工位上,以摄像头和存储器处理器的方式实现。The electronic equipment in the embodiment of the present invention includes: a memory, a processor, and a computer program on the memory that can run on the processor, wherein the processor implements the steps of the method described above when executing the computer program . The electronic equipment can be arranged on the corresponding workstation, and realized in the form of a camera and a memory processor.

当然,本发明也可以直接是暂态或非暂态计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被执行时实现如上所述方法的步骤。Of course, the present invention can also directly be a transitory or non-transitory computer-readable storage medium on which a computer program is stored, and it is characterized in that, when the computer program is executed, the steps of the above method are realized.

应当理解的是,对本领域普通技术人员来说,可以根据上述说明加以改进或变换,而所有这些改进和变换都应属于本发明所附权利要求的保护范围。It should be understood that those skilled in the art can make improvements or changes based on the above description, and all these improvements and changes should belong to the protection scope of the appended claims of the present invention.

Claims (10)

1. A method for matching injection molding workpiece templates with multivariable stability is characterized by comprising the following steps:
s1: collecting an injection molding workpiece image and preprocessing the collected injection molding workpiece image data;
s2: extracting contour features of an image data set and establishing standard template data;
s3: obtaining the matching precision of the injection molding workpiece by adopting a Hu moment-based contour matching algorithm;
s4: using a base based on J (psi) ij ) And matching the workpiece to be detected with the standard template by a plastic template matching mechanism of the arbitration function.
2. The method for matching templates of injection-molded workpieces with multivariate stability as claimed in claim 1, wherein the pre-processing of image data of injection-molded workpieces in step S1 comprises the steps of: and carrying out gray level transformation processing on the original image, carrying out median filtering on the gray level image, and carrying out sharpening processing on the smoothed image.
3. The method for matching the templates of injection-molded workpieces with multivariate stability as claimed in claim 1, wherein the profile features of various standard images of the image dataset are extracted in step S2, a classical Canny edge detection algorithm is used, the images are preprocessed by a first derivative function filter of gaussian first, then the direction and amplitude of the gradient are calculated, more accurate edge information of the images is determined based on the non-maximization inhibition theory, and the optimal profile features are obtained by setting corresponding thresholds according to the actual images, thereby establishing an image database of the standard templates of various defective images.
4. The method as claimed in claim 1, wherein the high threshold gray-level value is set to 240 and the low threshold gray-level value is set to 200 in step S2.
5. The injection molding workpiece template matching method with multivariable stability as claimed in claim 1, wherein the step S3 of obtaining the matching precision by applying the profile matching algorithm based on the Hu moment to the injection molding workpiece comprises the following steps: and establishing invariant moment data of the template image and the defect image by using the Hu moment function, matching the invariant moment data of the defect image with the invariant moment data of the template image to obtain a matching result, and taking the value of the matching result as the measurement of the similarity of the geometric profile.
6. The method for matching injection molding workpiece templates with multivariate stability as claimed in claim 1, wherein the Hu moment function in step S3 is seven invariant moments formed by combining the second and third central moments of the image.
7. The method for matching templates of injection-molded workpieces with multivariate stability as claimed in claim 1, wherein in step S3, the invariant moment data of the defect image and the invariant moment data of the template image are matched using the following formula:
Figure FDA0003804989320000021
wherein psi ij Expressing a matching result, recording the matching result as matching precision, wherein the numerical value and the similarity degree of the matching result show an inverse correlation trend; i is used for recording the number of a workpiece to be detected, j represents the matching times of the same workpiece image, k represents the sequence of Hu moments of the processed image from one to seven, A represents a standard template, and B represents the image to be detected of previous times;
Figure FDA0003804989320000022
the kth Hu moment data representing the standard template of picture number i,
Figure FDA0003804989320000023
and k-th Hu moment data of the image to be measured with the picture number i.
8. The method of claim 1, wherein J (ψ) is used in step S4 ij ) The arbitration function model matching mechanism matches the workpiece to be tested with the standard model according to the following arbitration function J (psi) ij ) Matching by using a formula:
Figure FDA0003804989320000024
wherein i represents the number of the workpiece to be detected, j represents the number of times that the same workpiece image is input for matching, and is also the number of times that the same workpiece is input into an arbitration function, and generally the number of times is one or two; hu (pharmaceutical) A [k]Hu invariant moment data representing a standard template image, k representing the sequence of Hu moments of a processed image from one to seven; omega is the lower limit threshold of the precision of the qualified workpiece;
if the arbitration function J (psi) ij ) If the value is 1, namely the matching precision is lower than the threshold value omega, the workpiece represented by the image is a qualified product;
if the arbitration function value is 0, namely the matching precision is higher than the threshold omega but lower than the statistical scaling value, performing secondary preprocessing on the image, further extracting characteristic information and then matching, and classifying the image into a defect image data set if the matching precision of the second time is still higher than the threshold;
and if the function value is-1, namely the statistical scaling value of the matching precision omega is higher than the threshold value, directly classifying the workpiece into a defect image data set.
9. An electronic device, comprising: memory, processor and computer program on the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of the claims 1 to 8 when executing the computer program.
10. A transitory or non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program is configured to perform the steps of the method according to any one of claims 1 to 8 when executed.
CN202210994199.9A 2022-08-18 2022-08-18 Injection molding workpiece template matching method, electronic equipment and storage medium Pending CN115471684A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210994199.9A CN115471684A (en) 2022-08-18 2022-08-18 Injection molding workpiece template matching method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210994199.9A CN115471684A (en) 2022-08-18 2022-08-18 Injection molding workpiece template matching method, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115471684A true CN115471684A (en) 2022-12-13

Family

ID=84366624

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210994199.9A Pending CN115471684A (en) 2022-08-18 2022-08-18 Injection molding workpiece template matching method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115471684A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116071360A (en) * 2023-03-10 2023-05-05 苏州振畅智能科技有限公司 Workpiece appearance defect detection method, electronic equipment and storage medium
JPWO2024195316A1 (en) * 2023-03-22 2024-09-26

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106018422A (en) * 2016-07-13 2016-10-12 河北工业大学 Matching-based visual outline defect inspection system and method for specially-shaped stamping parts
CN108280838A (en) * 2018-01-31 2018-07-13 桂林电子科技大学 A kind of intermediate plate tooth form defect inspection method based on edge detection
CN114004826A (en) * 2021-11-13 2022-02-01 博科视(苏州)技术有限公司 Appearance defect detection method for medical injection molded parts based on vision
CN114627089A (en) * 2022-03-21 2022-06-14 成都数之联科技股份有限公司 Defect identification method, apparatus, computer equipment, and computer-readable storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106018422A (en) * 2016-07-13 2016-10-12 河北工业大学 Matching-based visual outline defect inspection system and method for specially-shaped stamping parts
CN108280838A (en) * 2018-01-31 2018-07-13 桂林电子科技大学 A kind of intermediate plate tooth form defect inspection method based on edge detection
CN114004826A (en) * 2021-11-13 2022-02-01 博科视(苏州)技术有限公司 Appearance defect detection method for medical injection molded parts based on vision
CN114627089A (en) * 2022-03-21 2022-06-14 成都数之联科技股份有限公司 Defect identification method, apparatus, computer equipment, and computer-readable storage medium

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
JOSHUA R. LYZHOFT 等: "TEMPLATE MATCHING USED FOR SMALL BODY OPTICAL NAVIGATION WITH POORLY DETAILED OBJECTS", 2ND RPI SPACE IMAGING WORKSHOP., 30 October 2019 (2019-10-30), pages 1 - 9 *
MACHINELP: "OpenCV之二值图像分析 – 使用Hu矩实现轮廓匹配", 《知乎》, 16 May 2019 (2019-05-16), pages 1 - 3 *
张相胜 等: "基于机器视觉的汽车线束压接缺陷检测系统", 仪表技术与传感器, no. 3, 31 December 2020 (2020-12-31), pages 73 - 77 *
段连飞 等: "无人机载SAR图像信息提取技术", 30 April 2016, 西安:西北工业大学出版社, pages: 62 - 63 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116071360A (en) * 2023-03-10 2023-05-05 苏州振畅智能科技有限公司 Workpiece appearance defect detection method, electronic equipment and storage medium
JPWO2024195316A1 (en) * 2023-03-22 2024-09-26

Similar Documents

Publication Publication Date Title
WO2024002187A1 (en) Defect detection method, defect detection device, and storage medium
CN113706490B (en) A kind of wafer defect detection method
CN109816648B (en) Identification method of flash defects in complex injection molding products based on multi-template low-rank decomposition
CN109934839A (en) A kind of workpiece inspection method of view-based access control model
CN108596880A (en) Weld defect feature extraction based on image procossing and welding quality analysis method
CN110689524B (en) No-reference online image definition evaluation method and system
CN104197836A (en) Vehicle lock assembly size detection method based on machine vision
CN107644417B (en) Method for detecting appearance defect of strain gauge
CN110298840A (en) A kind of yarn faults detection method based on image
CN115546155A (en) Rivet size detection method based on machine vision
CN113516619B (en) Product surface flaw identification method based on image processing technology
CN115035092A (en) Image-based bottle detection method, device, equipment and storage medium
CN115471684A (en) Injection molding workpiece template matching method, electronic equipment and storage medium
CN118537339B (en) Method and system for evaluating surface quality of part based on sander
CN112014407A (en) Method for detecting surface defects of integrated circuit wafer
CN116337869A (en) A machine vision-based inspection system for double-sided circuit board production
CN114266719B (en) Hough transform-based product detection method
CN115423799A (en) Method and device for identifying surface cracks of continuous casting billet
CN115222730B (en) Defect detection algorithm based on line scanning spectrum confocal camera
CN112907498B (en) Pore identification method, device, equipment and storage medium
CN116433978A (en) Automatic generation and automatic labeling method and device for high-quality flaw image
Sulaiman et al. DEFECT INSPECTION SYSTEM FOR SHAPE-BASED MATCHING USING TWO CAMERAS.
CN116630278B (en) A wood edge defect detection method based on three-dimensional data
Nordin et al. Feature extraction of mold defects on fine arts painting using derivative oriented thresholding
CN118691595A (en) A connector production defect detection method and system based on image recognition

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