WO2022017197A1 - Intelligent product quality inspection method and apparatus - Google Patents

Intelligent product quality inspection method and apparatus Download PDF

Info

Publication number
WO2022017197A1
WO2022017197A1 PCT/CN2021/105434 CN2021105434W WO2022017197A1 WO 2022017197 A1 WO2022017197 A1 WO 2022017197A1 CN 2021105434 W CN2021105434 W CN 2021105434W WO 2022017197 A1 WO2022017197 A1 WO 2022017197A1
Authority
WO
WIPO (PCT)
Prior art keywords
product
image data
image
storage
module
Prior art date
Application number
PCT/CN2021/105434
Other languages
French (fr)
Chinese (zh)
Inventor
刘鹤辉
王黎明
李国志
刘西洋
Original Assignee
南京认知物联网研究院有限公司
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 南京认知物联网研究院有限公司 filed Critical 南京认知物联网研究院有限公司
Publication of WO2022017197A1 publication Critical patent/WO2022017197A1/en

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • G01N2021/8883Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges involving the calculation of gauges, generating models

Definitions

  • the invention relates to the field of industrial intelligence, and more particularly, to an intelligent product quality detection method and device.
  • Visual inspection refers to the use of machines instead of human eyes to make measurements and judgments, and to convert the captured target into image signals through machine vision products (ie, image capture devices, divided into CMOS and CCD), and transmit them to a dedicated image processing system.
  • machine vision products ie, image capture devices, divided into CMOS and CCD
  • the pixel distribution, brightness, color and other information are converted into digital signals; the image system performs various operations on these signals to extract the characteristics of the target, and then controls the on-site equipment actions according to the results of the discrimination.
  • Visual inspection is invaluable in its ability to detect defects and prevent defective products from being shipped to consumers.
  • the feature of machine vision inspection is to improve the flexibility and automation of production.
  • machine vision In some dangerous working environments that are not suitable for manual work or where artificial vision is difficult to meet the requirements, machine vision is often used to replace artificial vision; at the same time, in the process of mass industrial production, using artificial vision to check product quality is inefficient and not accurate.
  • the use of machine vision detection methods can greatly improve production efficiency and production automation.
  • machine vision is easy to realize information integration, which is the basic technology to realize computer integrated manufacturing. Visual inspection involves taking an image of an object, detecting it and converting it into data for the system to process and analyze, ensuring compliance with its manufacturer's quality standards. Objects that do not meet quality standards are tracked and rejected.
  • the workflow of product inspection is generally as follows: the camera program takes a picture and saves the photo to a certain location on the disk, the quality inspection model reads the photo from the disk to start the quality inspection, and sends the inspection result to the result processing program after completion.
  • These programs are generally run in series, which leads to the following defects in the existing visual inspection: 1.
  • the dependencies between programs are too high and the stability is poor.
  • the quality detection model relies on the camera program to output photos. Once the disk read and write errors, the whole solution will not work; the result processing program depends on the output of the quality detection model. When there are multiple result processing programs, a problem in one of the links will lead to an error in the overall solution.
  • the photo read and write time is long and the efficiency is low.
  • the disk read and write time is long.
  • a photo is larger than 4M, even if SSD is used, it takes nearly 1s to write or read a single photo to the disk.
  • the efficiency is too low for industrial testing. Therefore, there is an urgent need for an intelligent product quality detection method and device that can improve stability and efficiency.
  • the present invention provides an intelligent product quality detection method and device, which can improve the stability and efficiency of product quality detection.
  • An intelligent product quality detection method comprising the following steps:
  • Step S1 collecting image data for the product
  • Step S2 Detecting the product according to the collected image data to generate a detection result
  • Step S3 analyze and process the product according to the detection result
  • the image data and detection results set a storage time limit.
  • the image acquisition program is started, and the image acquisition program sends an instruction to make the photographing device capture and generate an image of the product to be detected.
  • a storage device is used to store the photographed image.
  • the inspection program reads the image data from the storage device, detects the product according to the image data, generates inspection results for the inspection program after product inspection, and uses the storage device to store the generated inspection results.
  • the product processing program reads the product detection result from the storage device, and performs corresponding processing on the product according to the product detection result.
  • the inspection program relies on the images captured by the image acquisition program, if the reading and writing time of the image data is too long or an error occurs during the reading and writing process, the inspection program will not be able to output the inspection results normally, and the product inspection will not be carried out.
  • the product processing procedure is also dependent on the inspection procedure, and the process of generating or reading the inspection results is too slow, which will cause the procedure to be blocked, and the inspection of the product cannot be carried out.
  • This solution starts from improving the stability of the entire product inspection, and sets a storage time limit for image data and inspection results.
  • i is the current image serial number of the currently detected product
  • C k is the detection time of the k-th image of the currently detected product
  • F is the time interval for the image to be stored
  • the storage time t is calculated by data fitting according to the image retention time of a plurality of products, and the storage time limit is set as t+d according to the storage time t, and the d is a fixed constant.
  • the image detection time of the product and the image storage time interval first obtain the image detection time of the product and the image storage time interval, and then calculate the image retention time of m products through the calculation formula of image retention time, and each product has n images.
  • Collect the image retention time T ij (i ⁇ (1,m), j ⁇ (1,n)) of each image obtain the continuous function of the storage time t from the collected image retention time T ij, and according to the storage time t
  • step S1 includes:
  • Step S1.1 create a first queue
  • Step S1.2 image capturing of the product and generating image data, and storing the generated image data in the first queue
  • Step S1.3 If there is a product without image capture and image data generation, proceed to step S1.2, otherwise end step S1;
  • the step S2 includes:
  • Step S2.1 create a second queue
  • Step S2.2 According to the image data stored in the first queue, the corresponding products are detected and the detection results are generated, and the generated detection results are stored in the second queue;
  • Step S2.3 if the product corresponding to the image data in the first queue has not been detected and the detection result has not been generated, continue to perform step S2.2, otherwise perform step S2.4;
  • Step S2.4 if step S1 has not ended, wait for the first queue to store the newly generated image data, then continue to execute step S2.1; if step S1 has ended, end step S2;
  • the step S3 includes:
  • Step S3.1 analyze according to the detection results in the second cohort
  • Step S3.2 processing according to the analysis result
  • the steps S1, S2, and S3 are executed in parallel without interfering with each other; if the image data in the first queue remains in the first queue for longer than the storage time limit, the image data exceeding the storage time limit is automatically cleared; The time when the detection results in the second queue are stored in the second queue exceeds the storage time limit, the detection results that exceed the storage time limit are automatically cleared.
  • queues are created according to product information.
  • the queues are of different types. Different types of queues store different data. Problems in one queue will not affect the other queue. At the same time, this facilitates the isolation of the two queues and reduces the The stability and performance problems of image data, especially image data with large pixels, are caused when transferring between programs.
  • the step S1, step S2, and step S3 are performed in parallel, without interfering with each other. Specifically, the image data is generated after the current product is photographed, and then stored in the first queue. If there is a next product, the steps of photographing, generating and storing are repeated. That is, step S1 is repeated until all products are photographed; the detection step is performed simultaneously with the photographing step.
  • step S2 When there are product images that have not been read in the first queue, the product images in the first queue are read, and the product images are paired according to the product images. The products are tested, and the test results are stored in the second queue, and the test steps are repeated until all products are tested, that is, step S2 is repeated. Because step S1 and step S2 are performed at the same time, step S2 does not need to wait for all product images to be photographed in step S1 before starting the detection, which saves time. In the same way, the processing step is carried out at the same time as the shooting step and the detection step. When there is an unread product test result in the second queue, the test result in the second queue is read, and the corresponding product is carried out according to the test result.
  • step S3 The process is performed until all product detection results are analyzed, that is, step S3 is repeated. Because step S3 does not need to wait for all products to be photographed in step S1, and does not need to wait for step S2 to detect all products before processing, time is saved and the performance of the entire solution is improved.
  • the image data and detection results in the queue have a storage time limit, and the image data and detection results that lead to timeout will be automatically cleared to maintain the stability of the model and avoid system paralysis caused by reading and writing high-pixel images and analyzing complex models.
  • step S1.1 is specifically to create a plurality of first queues according to the number of products; the step S2.1 is specifically to create a plurality of second queues according to the number of detection models for detecting the products.
  • multiple products can correspondingly create multiple first and second queues, and each queue can perform steps at the same time, enabling multiple products to perform quality inspection at the same time, effectively utilizing system resources, and improving efficiency.
  • the isolation also ensures the stability of the scheme.
  • the image data collected in the step S1 is stored in the form of a binary stream, and the step S2 acquires the image data in the form of a binary stream to detect the product.
  • a binary stream-based access interface is defined.
  • the photos captured in step S1 are stored in the cache by calling the storage interface in the form of binary streams, and step S2 is directly obtained.
  • Binary stream saving the time of image transcoding.
  • An intelligent product quality detection device comprising: an image acquisition module, a storage module, a detection module, a processing module and an intelligent management module;
  • the image collection module collects image data for the product, and the collected image data is stored in the storage module;
  • the detection module detects the product according to the image data, and the detection result is stored in the storage module, and the image data is the image data stored in the storage module by the image acquisition module;
  • the processing module reads the product detection result from the storage module, analyzes according to the detection result, and performs subsequent processing on the corresponding product;
  • the intelligent management module manages the data in the storage module.
  • the intelligent management module includes: a format detection unit and a storage time limit unit; the format detection unit is used to detect the format of the data in the storage module; the storage time limit unit is used to set the storage time limit of the data in the storage module.
  • the storage module implements the storage function with a cache.
  • the cache improves the speed of reading and writing images and reading and writing detection results.
  • the storage module includes: a first storage unit and a second storage unit; the first storage unit is used for storing product images; the second storage unit is used for storing product detection results.
  • the storage module stores the image data in a binary stream.
  • the storage module realizes the storage function with a cache, which improves the speed of reading and writing images and reading and writing detection results.
  • Fig. 1 is the flow chart of the present invention
  • FIG. 2 is a module relationship diagram of the present invention.
  • Fig. 1 is the flow chart of the present invention, as shown in the figure, a kind of intelligent product quality detection method of the present embodiment, comprises the following steps:
  • Step S1 collecting image data for the product
  • Step S2 Detecting the product according to the collected image data to generate a detection result
  • Step S3 analyze and process the product according to the detection result
  • the image data and detection results set a storage time limit.
  • the image acquisition program is started, and the image acquisition program sends an instruction to make the photographing device capture and generate an image of the product to be detected.
  • a storage device is used to store the photographed image.
  • the inspection program reads the image data from the storage device, detects the product according to the image data, generates inspection results for the inspection program after product inspection, and uses the storage device to store the generated inspection results.
  • the product processing program reads the product detection result from the storage device, and performs corresponding processing on the product according to the product detection result.
  • the inspection program relies on the images captured by the image acquisition program, if the reading and writing time of the image data is too long or an error occurs during the reading and writing process, the inspection program will not be able to output the inspection results normally, and the product inspection will not be carried out.
  • the product processing procedure is also dependent on the inspection procedure, and the process of generating or reading the inspection results is too slow, which will cause the procedure to be blocked, and the inspection of the product cannot be carried out.
  • This solution starts from improving the stability of the entire product inspection, and sets a storage time limit for image data and inspection results.
  • i is the current image serial number of the currently detected product
  • C k is the detection time of the k-th image of the currently detected product
  • F is the time interval for the image to be stored
  • the storage time t is calculated by data fitting, and the storage time limit is set to t+d according to the storage time t, and the d is a fixed constant.
  • the image detection time of the product and the image storage time interval first obtain the image detection time of the product and the image storage time interval, and then calculate the image retention time of m products through the calculation formula of image retention time, and each product has n images.
  • Collect the image retention time T ij (i ⁇ (1,m), j ⁇ (1,n)) of each image obtain the continuous function of the storage time t from the collected image retention time T ij, and according to the storage time t
  • step S1 includes:
  • Step S1.1 create a first queue
  • Step S1.2 image capturing of the product and generating image data, and storing the generated image data in the first queue
  • Step S1.3 If there is a product without image capture and image data generation, proceed to step S1.2, otherwise end step S1;
  • the step S2 includes:
  • Step S2.1 create a second queue
  • Step S2.2 According to the image data stored in the first queue, the corresponding products are detected and the detection results are generated, and the generated detection results are stored in the second queue;
  • Step S2.3 if the product corresponding to the image data in the first queue has not been detected and the detection result has not been generated, continue to perform step S2.2, otherwise perform step S2.4;
  • Step S2.4 if step S1 has not ended, wait for the first queue to store the newly generated image data, then continue to execute step S2.1; if step S1 has ended, end step S2;
  • the step S3 includes:
  • Step S3.1 analyze according to the detection results in the second cohort
  • Step S3.2 processing according to the analysis result
  • the steps S1, S2, and S3 are executed in parallel without interfering with each other; if the image data in the first queue remains in the first queue for longer than the storage time limit, the image data exceeding the storage time limit is automatically cleared; The time when the detection results in the second queue are stored in the second queue exceeds the storage time limit, the detection results that exceed the storage time limit are automatically cleared.
  • queues are created according to product information.
  • the queues are of different types. Different types of queues store different data. Problems in one queue will not affect the other queue.
  • the stability and performance problems of image data, especially image data with large pixels, are caused when transferring between programs.
  • the step S1, step S2, and step S3 are performed in parallel, without interfering with each other. Specifically, the image data is generated after the current product is photographed, and then stored in the first queue. If there is a next product, the steps of photographing, generating and storing are repeated. That is, step S1 is repeated until all products are photographed; the detection step is performed simultaneously with the photographing step.
  • step S2 When there are product images that have not been read in the first queue, the product images in the first queue are read, and the product images are paired according to the product images. The products are tested, and the test results are stored in the second queue, and the test steps are repeated until all products are tested, that is, step S2 is repeated. Because step S1 and step S2 are performed at the same time, step S2 does not need to wait for all product images to be photographed in step S1 before starting the detection, which saves time. In the same way, the processing step is carried out at the same time as the shooting step and the detection step. When there is an unread product test result in the second queue, the test result in the second queue is read, and the corresponding product is carried out according to the test result.
  • step S3 The process is performed until all product detection results are analyzed, that is, step S3 is repeated. Because step S3 does not need to wait for all products to be photographed in step S1, and does not need to wait for step S2 to detect all products before processing, time is saved and the performance of the entire solution is improved.
  • the image data and detection results in the queue have a storage time limit, and the image data and detection results that lead to timeout will be automatically cleared to maintain the stability of the model and avoid system paralysis caused by reading and writing high-pixel images and analyzing complex models.
  • step S1.1 is specifically to create a plurality of first queues according to the number of products; the step S2.1 is specifically to create a plurality of second queues according to the number of detection models for detecting the products.
  • multiple products can correspondingly create multiple first and second queues, and each queue can perform steps at the same time, enabling multiple products to perform quality inspection at the same time, effectively utilizing system resources, and improving efficiency.
  • the isolation also ensures the stability of the scheme.
  • the image data collected in the step S1 is stored in the form of a binary stream, and the step S2 acquires the image data in the form of a binary stream to detect the product.
  • a binary stream-based access interface is defined.
  • the photos captured in step S1 are stored in the cache by calling the storage interface in the form of binary streams, and step S2 is directly obtained.
  • Binary stream saving the time of image transcoding.
  • FIG. 2 is a module relationship diagram of the present invention, as shown in the figure, including: an image acquisition module, a storage module, a detection module, a processing module and an intelligent management module;
  • the image collection module collects image data for the product, and the collected image data is stored in the storage module;
  • the detection module detects the product according to the image data, and the detection result is stored in the storage module, and the image data is the image data stored in the storage module by the image acquisition module;
  • the processing module reads the product detection result from the storage module, analyzes according to the detection result, and performs subsequent processing on the corresponding product;
  • the intelligent management module manages the data in the storage module.
  • the intelligent management module includes: a format detection unit and a storage time limit unit; the format detection unit is used to detect the format of the data in the storage module; the storage time limit unit is used to set the storage time limit of the data in the storage module.
  • the storage module implements the storage function with a cache.
  • the cache improves the speed of reading and writing images and reading and writing detection results.
  • the storage module includes: a first storage unit and a second storage unit; the first storage unit is used for storing product images; the second storage unit is used for storing product detection results.
  • the storage module stores the image data in a binary stream.

Landscapes

  • Chemical & Material Sciences (AREA)
  • Biochemistry (AREA)
  • Pathology (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Immunology (AREA)
  • Analytical Chemistry (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Signal Processing (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The present invention relates to the field of industrial intelligence, and more particularly, to an intelligent product quality inspection method and apparatus. The method comprises the following steps: step S1: performing image data collection on a product; step S2: inspecting the product according to collected image data to generate an inspection result; and step S3: carrying out analysis according to the inspection result and processing the product, wherein storage time limits are set for the image data and the inspection result. The apparatus comprises: an image collection module, a storage module, an inspection module, a processing module and an intelligent management module, wherein the image collection module performs image data collection on a product; the inspection module inspects the product according to image data; the processing module reads a product inspection result from the storage module, carries out analysis according to the inspection result, and performs subsequent processing on the corresponding product; and the intelligent management module manages data in the storage module. According to the present invention, the stability and efficiency of product quality inspection can be improved.

Description

一种智能化的产品质量检测方法及装置An intelligent product quality detection method and device 技术领域technical field
本发明涉及工业智能领域,更具体地,涉及一种智能化的产品质量检测方法及装置。The invention relates to the field of industrial intelligence, and more particularly, to an intelligent product quality detection method and device.
背景技术Background technique
视觉检测是指用机器代替人眼来做测量和判断,通过机器视觉产品(即图像摄取装置,分CMOS和CCD两种)将被摄取目标转换成图像信号,传送给专用的图像处理系统,根据像素分布和亮度、颜色等信息,转变成数字化信号;图像系统对这些信号进行各种运算来抽取目标的特征,进而根据判别的结果来控制现场的设备动作。是用于生产、装配或包装的有价值的机制。视觉检测在检测缺陷和防止缺陷产品被配送到消费者的功能方面具有不可估量的价值。机器视觉检测的特点是提高生产的柔性和自动化程度。在一些不适合于人工作业的危险工作环境或人工视觉难以满足要求的场合,常用机器视觉来替代人工视觉;同时在大批量工业生产过程中,用人工视觉检查产品质量效率低且精度不高,用机器视觉检测方法可以大大提高生产效率和生产的自动化程度。而且机器视觉易于实现信息集成,是实现计算机集成制造的基础技术。视觉检测涉及拍摄物体的图像,对其进行检测并转化为数据供系统处理和分析,确保符合其制造商的质量标准。不符合质量标准的对象会被跟踪和剔除。Visual inspection refers to the use of machines instead of human eyes to make measurements and judgments, and to convert the captured target into image signals through machine vision products (ie, image capture devices, divided into CMOS and CCD), and transmit them to a dedicated image processing system. The pixel distribution, brightness, color and other information are converted into digital signals; the image system performs various operations on these signals to extract the characteristics of the target, and then controls the on-site equipment actions according to the results of the discrimination. Is a valuable mechanism for production, assembly or packaging. Visual inspection is invaluable in its ability to detect defects and prevent defective products from being shipped to consumers. The feature of machine vision inspection is to improve the flexibility and automation of production. In some dangerous working environments that are not suitable for manual work or where artificial vision is difficult to meet the requirements, machine vision is often used to replace artificial vision; at the same time, in the process of mass industrial production, using artificial vision to check product quality is inefficient and not accurate. , The use of machine vision detection methods can greatly improve production efficiency and production automation. Moreover, machine vision is easy to realize information integration, which is the basic technology to realize computer integrated manufacturing. Visual inspection involves taking an image of an object, detecting it and converting it into data for the system to process and analyze, ensuring compliance with its manufacturer's quality standards. Objects that do not meet quality standards are tracked and rejected.
在计算机视觉领域中,产品检测的工作流程一般为:相机程序拍照将照片保存到磁盘某个位置,质量检测模型从磁盘上读取照片开始质量检测,完成后将检测结果发送给结果处理程序。这几个程序之间一般是串行运行,这种运行方式导致了现有的视觉检测一般具有以下的缺陷:1、程序之间依赖过高,稳定性差。质量检测模型依赖相机程序输出照片,一旦磁盘读写出错,整个方案就无法工作;结果处理程序依赖质量检测模型输出结果,当存在多个结果处理程序时,其中一个环节出问题都会导致整体方案出错需要重新测试调整,无法及时给出检测结果。2、照片读写时间长,效率低。当面对大照片时,磁盘读写的时间都较长,当一张照片大于4M时,即便使用SSD,每次单张照片的磁盘单纯写或者单纯读都需要花费近1s的时间,这对于工业检测来说效率太低。因此,目前亟需一种能提高稳定性和效率的智能化的产品质量检测方法及装置。In the field of computer vision, the workflow of product inspection is generally as follows: the camera program takes a picture and saves the photo to a certain location on the disk, the quality inspection model reads the photo from the disk to start the quality inspection, and sends the inspection result to the result processing program after completion. These programs are generally run in series, which leads to the following defects in the existing visual inspection: 1. The dependencies between programs are too high and the stability is poor. The quality detection model relies on the camera program to output photos. Once the disk read and write errors, the whole solution will not work; the result processing program depends on the output of the quality detection model. When there are multiple result processing programs, a problem in one of the links will lead to an error in the overall solution. It needs to be re-tested and adjusted, and the test results cannot be given in time. 2. The photo read and write time is long and the efficiency is low. When faced with large photos, the disk read and write time is long. When a photo is larger than 4M, even if SSD is used, it takes nearly 1s to write or read a single photo to the disk. The efficiency is too low for industrial testing. Therefore, there is an urgent need for an intelligent product quality detection method and device that can improve stability and efficiency.
发明内容SUMMARY OF THE INVENTION
为了解决上述问题,本发明提供一种智能化的产品质量检测方法及装置,该方法及装置能提高产品质量检测的稳定性和效率。In order to solve the above problems, the present invention provides an intelligent product quality detection method and device, which can improve the stability and efficiency of product quality detection.
本发明采取的技术方案是:The technical scheme adopted by the present invention is:
一种智能化的产品质量检测方法,包括以下步骤:An intelligent product quality detection method, comprising the following steps:
步骤S1:对产品进行图像数据采集;Step S1: collecting image data for the product;
步骤S2:根据采集到图像数据对产品进行检测生成检测结果;Step S2: Detecting the product according to the collected image data to generate a detection result;
步骤S3:根据检测结果进行分析并且对产品进行处理;Step S3: analyze and process the product according to the detection result;
所述图像数据和检测结果设定了存储时限。The image data and detection results set a storage time limit.
具体地,首先开启图像采集程序,图像采集程序发送指令使拍摄装置对要检测的产品进行图像的捕捉与生成,图像捕捉与生成后,使用存储装置对拍摄到的图像进行存储。然后检测程序从存储装置中读取图像的数据,根据图像的数据进行产品的检测,对产品检测过后的检测程序生成检测结果,使用存储装置对生成的检测结果进行存储。最后产品处理程序从存储装置中读取产品检测结果,根据产品检测的结果对产品进行相应的处理。因为检测程序依赖于图像采集程序拍摄的图像,所以图像数据的读写时间若是太长或在读写过程中出错,则会导致检测程序无法正常输出检测结果,产品的检测无法进行。除此之外,产品处理程序亦依赖于检测程序,生成或读取检测结果的过程太慢亦会致使程序堵塞,产品的检测无法进行。考虑到各程序之间的依赖过高,只要检测步骤的其中一环出错便会致使整个产品检测方案无法进行。本方案从提高整个产品检测的稳定性出发,给图像数据和检测结果设定了存储时限,一旦图像数据或检测结果在读写的过程中超过设定的时限,则自动清除,进行下一个产品的检测。设定存储时限一来消除了整体图像数据读写速度太慢的问题,二来保证了整体的检测结果生成和解读能快速完成,从两个方面解决了程序堵塞,提高了整体产品质量检测方案的稳定性。Specifically, firstly, the image acquisition program is started, and the image acquisition program sends an instruction to make the photographing device capture and generate an image of the product to be detected. After the image is captured and generated, a storage device is used to store the photographed image. Then the inspection program reads the image data from the storage device, detects the product according to the image data, generates inspection results for the inspection program after product inspection, and uses the storage device to store the generated inspection results. Finally, the product processing program reads the product detection result from the storage device, and performs corresponding processing on the product according to the product detection result. Because the inspection program relies on the images captured by the image acquisition program, if the reading and writing time of the image data is too long or an error occurs during the reading and writing process, the inspection program will not be able to output the inspection results normally, and the product inspection will not be carried out. In addition, the product processing procedure is also dependent on the inspection procedure, and the process of generating or reading the inspection results is too slow, which will cause the procedure to be blocked, and the inspection of the product cannot be carried out. Considering the high dependence between various procedures, as long as one of the inspection steps is wrong, the entire product inspection program cannot be carried out. This solution starts from improving the stability of the entire product inspection, and sets a storage time limit for image data and inspection results. Once the image data or inspection results exceed the set time limit during the process of reading and writing, they will be automatically cleared and the next product will be processed. detection. Setting the storage time limit eliminates the problem that the overall image data reading and writing speed is too slow, and secondly ensures that the overall detection result generation and interpretation can be completed quickly, which solves the program blockage from two aspects and improves the overall product quality inspection scheme. stability.
进一步地,所述存储时限的设定过程为:Further, the setting process of the described storage time limit is:
获取产品的图像检测时间、图像存入缓存时间间隔;Obtain the image detection time of the product and the image storage time interval;
根据图像检测时间、图像存入缓存时间间隔计算出图像存留时间;Calculate the image retention time according to the image detection time and the image storage time interval;
所述图像存留时间的计算公式为:The calculation formula of the image retention time is:
Figure PCTCN2021105434-appb-000001
Figure PCTCN2021105434-appb-000001
其中,i为当前被检测产品的当前图像序号,C k为当前被检测产品第k张图像的检测时间,F为图像用于存储的时间间隔; Among them, i is the current image serial number of the currently detected product, C k is the detection time of the k-th image of the currently detected product, and F is the time interval for the image to be stored;
根据多个产品的图像存留时间通过数据拟合计算出存储时间t,根据存储时间t将存储时限设定为t+d,所述d为固定常量。The storage time t is calculated by data fitting according to the image retention time of a plurality of products, and the storage time limit is set as t+d according to the storage time t, and the d is a fixed constant.
具体地,先获取产品的图像检测时间、图像存入缓存时间间隔,然后通过图像存留时间的计算公式,将m个产品的图像存留时间算出,每个产品具有n张图像的。收集每张图像的图像存留时间T ij(i∈(1,m),j∈(1,n)),将收集到的图像存留时间T ij得到存储时间t的连续函数,并且根据存储时间t将存储时限设定为t+d,d为固定常量,当i=1时,T 1=0,1≤k≤i-1。 Specifically, first obtain the image detection time of the product and the image storage time interval, and then calculate the image retention time of m products through the calculation formula of image retention time, and each product has n images. Collect the image retention time T ij (i∈(1,m), j∈(1,n)) of each image, obtain the continuous function of the storage time t from the collected image retention time T ij, and according to the storage time t The storage time limit is set as t+d, d is a fixed constant, when i=1, T 1 =0, 1≤k≤i-1.
进一步地,所述步骤S1包括:Further, the step S1 includes:
步骤S1.1:创建第一队列;Step S1.1: create a first queue;
步骤S1.2:对产品进行图像捕捉及生成图像数据,将生成的图像数据存入第一队列;Step S1.2: image capturing of the product and generating image data, and storing the generated image data in the first queue;
步骤S1.3:若存在产品未进行图像捕捉及生成图像数据,则继续执行步骤S1.2,否则结束步骤S1;Step S1.3: If there is a product without image capture and image data generation, proceed to step S1.2, otherwise end step S1;
所述步骤S2包括:The step S2 includes:
步骤S2.1:创建第二队列;Step S2.1: create a second queue;
步骤S2.2:根据第一队列所存放的图像数据对相应的产品进行检测及生成检测结果,将生成的检测结果存入第二队列;Step S2.2: According to the image data stored in the first queue, the corresponding products are detected and the detection results are generated, and the generated detection results are stored in the second queue;
步骤S2.3:若第一队列中的图像数据相应的产品存在未进行检测及生成检测结果,则继续执行步骤S2.2,否则执行步骤S2.4;Step S2.3: if the product corresponding to the image data in the first queue has not been detected and the detection result has not been generated, continue to perform step S2.2, otherwise perform step S2.4;
步骤S2.4:若步骤S1未结束,则等待第一队列存入新生成的图像数据之后,继续执行步骤S2.1;若步骤S1已结束,则结束步骤S2;Step S2.4: if step S1 has not ended, wait for the first queue to store the newly generated image data, then continue to execute step S2.1; if step S1 has ended, end step S2;
所述步骤S3包括:The step S3 includes:
步骤S3.1:根据第二队列中的检测结果进行分析;Step S3.1: analyze according to the detection results in the second cohort;
步骤S3.2:根据分析结果进行处理;Step S3.2: processing according to the analysis result;
所述步骤S1、步骤S2、步骤S3并行执行,互不干涉;若第一队列中的图像数据存留在第一队列中的时间超过存储时限,则自动清除其中超过存储时限的图像数据;若第二队列中的检测结果存留在第二队列中的时间超过存储时限,则自动清除其中超过存储时限的检测结 果。The steps S1, S2, and S3 are executed in parallel without interfering with each other; if the image data in the first queue remains in the first queue for longer than the storage time limit, the image data exceeding the storage time limit is automatically cleared; The time when the detection results in the second queue are stored in the second queue exceeds the storage time limit, the detection results that exceed the storage time limit are automatically cleared.
具体地,根据产品信息创建队列,所述队列具有不同的类型,不同类型的队列存放不同的数据,一个队列的问题不会对另一个队列产生影响;同时,这样方便两个队列相互隔离,减少图像数据特别是像素大的图像数据在程序间传输时产生的稳定性以及性能问题。所述步骤S1、步骤S2、步骤S3并行执行,互不干涉具体为:拍摄当前产品后生成图像数据,然后存入第一队列,若还有下一个产品则重复拍摄、生成、存储的步骤,即重复步骤S1直至所有产品被拍摄完毕;与拍摄步骤同时进行的,为检测步骤,当第一队列中存在没有读取的产品图像,则读取第一队列中的产品图像,根据产品图像对产品进行检测,得出检测结果存入第二队列,重复检测步骤直至所有产品被检测完毕,即重复步骤S2。因为步骤S1与步骤S2同时进行,步骤S2无需等待步骤S1把所有产品图像拍摄完成再开始检测,这样节省了时间。同理,与拍摄步骤、检测步骤同时进行的还有处理步骤,当第二队列中存在没有读取的产品检测结果,则读取第二队列中的检测结果,根据检测结果对产品进行相应的处理直至所有的产品检测结果被分析完毕,即重复步骤S3。因为步骤S3无需等待步骤S1把所有产品拍摄完毕,以及无需等待步骤S2把所有产品检测完毕再进行处理,节省了时间,提高了整个方案的性能。队列中的图像数据以及检测结果设有存储时限,其中导致超时的图像数据以及检测结果会被自动清除,以维护模型的稳定,避免读写高像素图像、分析复杂模型而引起的系统瘫痪。Specifically, queues are created according to product information. The queues are of different types. Different types of queues store different data. Problems in one queue will not affect the other queue. At the same time, this facilitates the isolation of the two queues and reduces the The stability and performance problems of image data, especially image data with large pixels, are caused when transferring between programs. The step S1, step S2, and step S3 are performed in parallel, without interfering with each other. Specifically, the image data is generated after the current product is photographed, and then stored in the first queue. If there is a next product, the steps of photographing, generating and storing are repeated. That is, step S1 is repeated until all products are photographed; the detection step is performed simultaneously with the photographing step. When there are product images that have not been read in the first queue, the product images in the first queue are read, and the product images are paired according to the product images. The products are tested, and the test results are stored in the second queue, and the test steps are repeated until all products are tested, that is, step S2 is repeated. Because step S1 and step S2 are performed at the same time, step S2 does not need to wait for all product images to be photographed in step S1 before starting the detection, which saves time. In the same way, the processing step is carried out at the same time as the shooting step and the detection step. When there is an unread product test result in the second queue, the test result in the second queue is read, and the corresponding product is carried out according to the test result. The process is performed until all product detection results are analyzed, that is, step S3 is repeated. Because step S3 does not need to wait for all products to be photographed in step S1, and does not need to wait for step S2 to detect all products before processing, time is saved and the performance of the entire solution is improved. The image data and detection results in the queue have a storage time limit, and the image data and detection results that lead to timeout will be automatically cleared to maintain the stability of the model and avoid system paralysis caused by reading and writing high-pixel images and analyzing complex models.
进一步地,所述步骤S1.1具体为根据产品数量创建多个第一队列;所述步骤S2.1具体为根据对产品进行检测的检测模型数量创建多个第二队列。Further, the step S1.1 is specifically to create a plurality of first queues according to the number of products; the step S2.1 is specifically to create a plurality of second queues according to the number of detection models for detecting the products.
具体地,多个产品可以对应地创建多个第一、第二队列,每个队列可同时执行步骤,可以使多个产品同时进行质量检测,有效利用系统资源,提高效率的同时,队列之间的隔离也使得方案的稳定性得到保障。Specifically, multiple products can correspondingly create multiple first and second queues, and each queue can perform steps at the same time, enabling multiple products to perform quality inspection at the same time, effectively utilizing system resources, and improving efficiency. The isolation also ensures the stability of the scheme.
进一步地,所述步骤S1采集到的图像数据以二进流形式进行存储,所述步骤S2获取二进流形式的图像数据对产品进行检测。Further, the image data collected in the step S1 is stored in the form of a binary stream, and the step S2 acquires the image data in the form of a binary stream to detect the product.
具体地,为了应对高像素图像读取及转换格式时间长的问题,定义了基于二进制流的存取接口,步骤S1拍摄得到的照片以二进制流的形式调用存储接口存入缓存,步骤S2直接获取二进制流,节省了图像转码的时间。Specifically, in order to deal with the problem of long time for high-pixel image reading and format conversion, a binary stream-based access interface is defined. The photos captured in step S1 are stored in the cache by calling the storage interface in the form of binary streams, and step S2 is directly obtained. Binary stream, saving the time of image transcoding.
一种智能化的产品质量检测装置,包括:图像采集模块、存储模块、检测模块、处理模块和智能管理模块;An intelligent product quality detection device, comprising: an image acquisition module, a storage module, a detection module, a processing module and an intelligent management module;
所述图像采集模块对产品进行图像数据采集,采集到的图像数据存入存储模块;The image collection module collects image data for the product, and the collected image data is stored in the storage module;
所述检测模块根据图像数据对产品进行检测,检测的结果存入存储模块,所述图像数据为图像采集模块存入存储模块的图像数据;The detection module detects the product according to the image data, and the detection result is stored in the storage module, and the image data is the image data stored in the storage module by the image acquisition module;
所述处理模块从存储模块中读取产品检测结果,根据检测结果进行分析并且对相应的产品作后续处理;The processing module reads the product detection result from the storage module, analyzes according to the detection result, and performs subsequent processing on the corresponding product;
所述智能管理模块对存储模块内的数据进行管理。The intelligent management module manages the data in the storage module.
进一步地,所述智能管理模块包括:格式检测单元和存储时限单元;所述格式检测单元用于检测存储模块内数据的格式;所述存储时限单元用于设定存储模块内数据的存储时限。Further, the intelligent management module includes: a format detection unit and a storage time limit unit; the format detection unit is used to detect the format of the data in the storage module; the storage time limit unit is used to set the storage time limit of the data in the storage module.
进一步地,所述存储模块以缓存实现存储功能。Further, the storage module implements the storage function with a cache.
具体地,缓存提高了图像读写以及检测结果读写的速度。Specifically, the cache improves the speed of reading and writing images and reading and writing detection results.
进一步地,所述存储模块包括:第一存储单元、第二存储单元;所述第一存储单元用于存储产品图像;第二存储单元用于存储产品检测结果。Further, the storage module includes: a first storage unit and a second storage unit; the first storage unit is used for storing product images; the second storage unit is used for storing product detection results.
进一步地,所述存储模块以二进流存储图像数据。Further, the storage module stores the image data in a binary stream.
与现有技术相比,本发明的有益效果为:Compared with the prior art, the beneficial effects of the present invention are:
(1)存储模块以缓存实现存储功能,提高了图像读写以及检测结果读写的速度。(1) The storage module realizes the storage function with a cache, which improves the speed of reading and writing images and reading and writing detection results.
(2)产品图像拍摄完成后直接将二进制流写入缓存,然后直接从缓存读取二进制流进行检测,节省了图像的读写时间,提高整体方案性能。(2) After the product image is taken, the binary stream is directly written into the cache, and then the binary stream is directly read from the cache for detection, which saves the reading and writing time of the image and improves the overall solution performance.
(3)队列以及步骤之间的相互独立,一方面提高了方案的稳定性,另一方面提高了方案的性能。(3) The mutual independence of queues and steps improves the stability of the scheme on the one hand and the performance of the scheme on the other hand.
附图说明Description of drawings
图1为本发明的流程图;Fig. 1 is the flow chart of the present invention;
图2为本发明的模块关系图。FIG. 2 is a module relationship diagram of the present invention.
具体实施方式detailed description
本发明附图仅用于示例性说明,不能理解为对本发明的限制。为了更好说明以下实施例,附图某些部件会有省略、放大或缩小,并不代表实际产品的尺寸;对于本领域技术人员来说,附图中某些公知结构及其说明可能省略是可以理解的。The accompanying drawings of the present invention are only used for exemplary illustration, and should not be construed as limiting the present invention. In order to better illustrate the following embodiments, some parts of the drawings may be omitted, enlarged or reduced, which do not represent the size of the actual product; for those skilled in the art, some well-known structures and their descriptions in the drawings may be omitted. understandable.
实施例Example
图1为本发明的流程图,如图所示,本实施例一种智能化的产品质量检测方法,包括以下步骤:Fig. 1 is the flow chart of the present invention, as shown in the figure, a kind of intelligent product quality detection method of the present embodiment, comprises the following steps:
步骤S1:对产品进行图像数据采集;Step S1: collecting image data for the product;
步骤S2:根据采集到图像数据对产品进行检测生成检测结果;Step S2: Detecting the product according to the collected image data to generate a detection result;
步骤S3:根据检测结果进行分析并且对产品进行处理;Step S3: analyze and process the product according to the detection result;
所述图像数据和检测结果设定了存储时限。The image data and detection results set a storage time limit.
具体地,首先开启图像采集程序,图像采集程序发送指令使拍摄装置对要检测的产品进行图像的捕捉与生成,图像捕捉与生成后,使用存储装置对拍摄到的图像进行存储。然后检测程序从存储装置中读取图像的数据,根据图像的数据进行产品的检测,对产品检测过后的检测程序生成检测结果,使用存储装置对生成的检测结果进行存储。最后产品处理程序从存储装置中读取产品检测结果,根据产品检测的结果对产品进行相应的处理。因为检测程序依赖于图像采集程序拍摄的图像,所以图像数据的读写时间若是太长或在读写过程中出错,则会导致检测程序无法正常输出检测结果,产品的检测无法进行。除此之外,产品处理程序亦依赖于检测程序,生成或读取检测结果的过程太慢亦会致使程序堵塞,产品的检测无法进行。考虑到各程序之间的依赖过高,只要检测步骤的其中一环出错便会致使整个产品检测方案无法进行。本方案从提高整个产品检测的稳定性出发,给图像数据和检测结果设定了存储时限,一旦图像数据或检测结果在读写的过程中超过设定的时限,则自动清除,进行下一个产品的检测。设定存储时限一来消除了整体图像数据读写速度太慢的问题,二来保证了整体的检测结果生成和解读能快速完成,从两个方面解决了程序堵塞,提高了整体产品质量检测方案的稳定性。Specifically, firstly, the image acquisition program is started, and the image acquisition program sends an instruction to make the photographing device capture and generate an image of the product to be detected. After the image is captured and generated, a storage device is used to store the photographed image. Then the inspection program reads the image data from the storage device, detects the product according to the image data, generates inspection results for the inspection program after product inspection, and uses the storage device to store the generated inspection results. Finally, the product processing program reads the product detection result from the storage device, and performs corresponding processing on the product according to the product detection result. Because the inspection program relies on the images captured by the image acquisition program, if the reading and writing time of the image data is too long or an error occurs during the reading and writing process, the inspection program will not be able to output the inspection results normally, and the product inspection will not be carried out. In addition, the product processing procedure is also dependent on the inspection procedure, and the process of generating or reading the inspection results is too slow, which will cause the procedure to be blocked, and the inspection of the product cannot be carried out. Considering the high dependence between various procedures, as long as one of the inspection steps is wrong, the entire product inspection program cannot be carried out. This solution starts from improving the stability of the entire product inspection, and sets a storage time limit for image data and inspection results. Once the image data or inspection results exceed the set time limit during the process of reading and writing, they will be automatically cleared and the next product will be processed. detection. Setting the storage time limit eliminates the problem that the overall image data reading and writing speed is too slow, and secondly ensures that the overall detection result generation and interpretation can be completed quickly, which solves the program blockage from two aspects and improves the overall product quality inspection scheme. stability.
进一步地,所述存储时限的设定过程为:Further, the setting process of the described storage time limit is:
获取产品的图像检测时间、图像存入缓存时间间隔;Obtain the image detection time of the product and the image storage time interval;
根据图像检测时间、图像存入缓存时间间隔计算出图像存留时间;Calculate the image retention time according to the image detection time and the image storage time interval;
所述图像存留时间的计算公式为:The calculation formula of the image retention time is:
Figure PCTCN2021105434-appb-000002
Figure PCTCN2021105434-appb-000002
其中,i为当前被检测产品的当前图像序号,C k为当前被检测产品第k张图像的检测时间,F为图像用于存储的时间间隔; Among them, i is the current image serial number of the currently detected product, C k is the detection time of the k-th image of the currently detected product, and F is the time interval for the image to be stored;
根据多个产品的图像存留时间通过数据拟合计算出存储时间t,根据存储时间t将存储时 限设定为t+d,所述d为固定常量。According to the image retention time of a plurality of products, the storage time t is calculated by data fitting, and the storage time limit is set to t+d according to the storage time t, and the d is a fixed constant.
具体地,先获取产品的图像检测时间、图像存入缓存时间间隔,然后通过图像存留时间的计算公式,将m个产品的图像存留时间算出,每个产品具有n张图像的。收集每张图像的图像存留时间T ij(i∈(1,m),j∈(1,n)),将收集到的图像存留时间T ij得到存储时间t的连续函数,并且根据存储时间t将存储时限设定为t+d,d为固定常量,当i=1时,T 1=0,1≤k≤i-1。 Specifically, first obtain the image detection time of the product and the image storage time interval, and then calculate the image retention time of m products through the calculation formula of image retention time, and each product has n images. Collect the image retention time T ij (i∈(1,m), j∈(1,n)) of each image, obtain the continuous function of the storage time t from the collected image retention time T ij, and according to the storage time t The storage time limit is set as t+d, d is a fixed constant, when i=1, T 1 =0, 1≤k≤i-1.
进一步地,所述步骤S1包括:Further, the step S1 includes:
步骤S1.1:创建第一队列;Step S1.1: create a first queue;
步骤S1.2:对产品进行图像捕捉及生成图像数据,将生成的图像数据存入第一队列;Step S1.2: image capturing of the product and generating image data, and storing the generated image data in the first queue;
步骤S1.3:若存在产品未进行图像捕捉及生成图像数据,则继续执行步骤S1.2,否则结束步骤S1;Step S1.3: If there is a product without image capture and image data generation, proceed to step S1.2, otherwise end step S1;
所述步骤S2包括:The step S2 includes:
步骤S2.1:创建第二队列;Step S2.1: create a second queue;
步骤S2.2:根据第一队列所存放的图像数据对相应的产品进行检测及生成检测结果,将生成的检测结果存入第二队列;Step S2.2: According to the image data stored in the first queue, the corresponding products are detected and the detection results are generated, and the generated detection results are stored in the second queue;
步骤S2.3:若第一队列中的图像数据相应的产品存在未进行检测及生成检测结果,则继续执行步骤S2.2,否则执行步骤S2.4;Step S2.3: if the product corresponding to the image data in the first queue has not been detected and the detection result has not been generated, continue to perform step S2.2, otherwise perform step S2.4;
步骤S2.4:若步骤S1未结束,则等待第一队列存入新生成的图像数据之后,继续执行步骤S2.1;若步骤S1已结束,则结束步骤S2;Step S2.4: if step S1 has not ended, wait for the first queue to store the newly generated image data, then continue to execute step S2.1; if step S1 has ended, end step S2;
所述步骤S3包括:The step S3 includes:
步骤S3.1:根据第二队列中的检测结果进行分析;Step S3.1: analyze according to the detection results in the second cohort;
步骤S3.2:根据分析结果进行处理;Step S3.2: processing according to the analysis result;
所述步骤S1、步骤S2、步骤S3并行执行,互不干涉;若第一队列中的图像数据存留在第一队列中的时间超过存储时限,则自动清除其中超过存储时限的图像数据;若第二队列中的检测结果存留在第二队列中的时间超过存储时限,则自动清除其中超过存储时限的检测结果。The steps S1, S2, and S3 are executed in parallel without interfering with each other; if the image data in the first queue remains in the first queue for longer than the storage time limit, the image data exceeding the storage time limit is automatically cleared; The time when the detection results in the second queue are stored in the second queue exceeds the storage time limit, the detection results that exceed the storage time limit are automatically cleared.
具体地,根据产品信息创建队列,所述队列具有不同的类型,不同类型的队列存放不同的数据,一个队列的问题不会对另一个队列产生影响;同时,这样方便两个队列相互隔离, 减少图像数据特别是像素大的图像数据在程序间传输时产生的稳定性以及性能问题。所述步骤S1、步骤S2、步骤S3并行执行,互不干涉具体为:拍摄当前产品后生成图像数据,然后存入第一队列,若还有下一个产品则重复拍摄、生成、存储的步骤,即重复步骤S1直至所有产品被拍摄完毕;与拍摄步骤同时进行的,为检测步骤,当第一队列中存在没有读取的产品图像,则读取第一队列中的产品图像,根据产品图像对产品进行检测,得出检测结果存入第二队列,重复检测步骤直至所有产品被检测完毕,即重复步骤S2。因为步骤S1与步骤S2同时进行,步骤S2无需等待步骤S1把所有产品图像拍摄完成再开始检测,这样节省了时间。同理,与拍摄步骤、检测步骤同时进行的还有处理步骤,当第二队列中存在没有读取的产品检测结果,则读取第二队列中的检测结果,根据检测结果对产品进行相应的处理直至所有的产品检测结果被分析完毕,即重复步骤S3。因为步骤S3无需等待步骤S1把所有产品拍摄完毕,以及无需等待步骤S2把所有产品检测完毕再进行处理,节省了时间,提高了整个方案的性能。队列中的图像数据以及检测结果设有存储时限,其中导致超时的图像数据以及检测结果会被自动清除,以维护模型的稳定,避免读写高像素图像、分析复杂模型而引起的系统瘫痪。Specifically, queues are created according to product information. The queues are of different types. Different types of queues store different data. Problems in one queue will not affect the other queue. The stability and performance problems of image data, especially image data with large pixels, are caused when transferring between programs. The step S1, step S2, and step S3 are performed in parallel, without interfering with each other. Specifically, the image data is generated after the current product is photographed, and then stored in the first queue. If there is a next product, the steps of photographing, generating and storing are repeated. That is, step S1 is repeated until all products are photographed; the detection step is performed simultaneously with the photographing step. When there are product images that have not been read in the first queue, the product images in the first queue are read, and the product images are paired according to the product images. The products are tested, and the test results are stored in the second queue, and the test steps are repeated until all products are tested, that is, step S2 is repeated. Because step S1 and step S2 are performed at the same time, step S2 does not need to wait for all product images to be photographed in step S1 before starting the detection, which saves time. In the same way, the processing step is carried out at the same time as the shooting step and the detection step. When there is an unread product test result in the second queue, the test result in the second queue is read, and the corresponding product is carried out according to the test result. The process is performed until all product detection results are analyzed, that is, step S3 is repeated. Because step S3 does not need to wait for all products to be photographed in step S1, and does not need to wait for step S2 to detect all products before processing, time is saved and the performance of the entire solution is improved. The image data and detection results in the queue have a storage time limit, and the image data and detection results that lead to timeout will be automatically cleared to maintain the stability of the model and avoid system paralysis caused by reading and writing high-pixel images and analyzing complex models.
进一步地,所述步骤S1.1具体为根据产品数量创建多个第一队列;所述步骤S2.1具体为根据对产品进行检测的检测模型数量创建多个第二队列。Further, the step S1.1 is specifically to create a plurality of first queues according to the number of products; the step S2.1 is specifically to create a plurality of second queues according to the number of detection models for detecting the products.
具体地,多个产品可以对应地创建多个第一、第二队列,每个队列可同时执行步骤,可以使多个产品同时进行质量检测,有效利用系统资源,提高效率的同时,队列之间的隔离也使得方案的稳定性得到保障。Specifically, multiple products can correspondingly create multiple first and second queues, and each queue can perform steps at the same time, enabling multiple products to perform quality inspection at the same time, effectively utilizing system resources, and improving efficiency. The isolation also ensures the stability of the scheme.
进一步地,所述步骤S1采集到的图像数据以二进流形式进行存储,所述步骤S2获取二进流形式的图像数据对产品进行检测。Further, the image data collected in the step S1 is stored in the form of a binary stream, and the step S2 acquires the image data in the form of a binary stream to detect the product.
具体地,为了应对高像素图像读取及转换格式时间长的问题,定义了基于二进制流的存取接口,步骤S1拍摄得到的照片以二进制流的形式调用存储接口存入缓存,步骤S2直接获取二进制流,节省了图像转码的时间。Specifically, in order to deal with the problem of long time for high-pixel image reading and format conversion, a binary stream-based access interface is defined. The photos captured in step S1 are stored in the cache by calling the storage interface in the form of binary streams, and step S2 is directly obtained. Binary stream, saving the time of image transcoding.
一种智能化的产品质量检测装置,图2为本发明的模块关系图,如图所示,包括:图像采集模块、存储模块、检测模块、处理模块和智能管理模块;An intelligent product quality detection device, FIG. 2 is a module relationship diagram of the present invention, as shown in the figure, including: an image acquisition module, a storage module, a detection module, a processing module and an intelligent management module;
所述图像采集模块对产品进行图像数据采集,采集到的图像数据存入存储模块;The image collection module collects image data for the product, and the collected image data is stored in the storage module;
所述检测模块根据图像数据对产品进行检测,检测的结果存入存储模块,所述图像数据为图像采集模块存入存储模块的图像数据;The detection module detects the product according to the image data, and the detection result is stored in the storage module, and the image data is the image data stored in the storage module by the image acquisition module;
所述处理模块从存储模块中读取产品检测结果,根据检测结果进行分析并且对相应的产品作后续处理;The processing module reads the product detection result from the storage module, analyzes according to the detection result, and performs subsequent processing on the corresponding product;
所述智能管理模块对存储模块内的数据进行管理。The intelligent management module manages the data in the storage module.
进一步地,所述智能管理模块包括:格式检测单元和存储时限单元;所述格式检测单元用于检测存储模块内数据的格式;所述存储时限单元用于设定存储模块内数据的存储时限。Further, the intelligent management module includes: a format detection unit and a storage time limit unit; the format detection unit is used to detect the format of the data in the storage module; the storage time limit unit is used to set the storage time limit of the data in the storage module.
进一步地,所述存储模块以缓存实现存储功能。Further, the storage module implements the storage function with a cache.
具体地,缓存提高了图像读写以及检测结果读写的速度。Specifically, the cache improves the speed of reading and writing images and reading and writing detection results.
进一步地,所述存储模块包括:第一存储单元、第二存储单元;所述第一存储单元用于存储产品图像;第二存储单元用于存储产品检测结果。Further, the storage module includes: a first storage unit and a second storage unit; the first storage unit is used for storing product images; the second storage unit is used for storing product detection results.
进一步地,所述存储模块以二进流存储图像数据。Further, the storage module stores the image data in a binary stream.
显然,本发明的上述实施例仅仅是为清楚地说明本发明技术方案所作的举例,而并非是对本发明的具体实施方式的限定。凡在本发明权利要求书的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明权利要求的保护范围之内。Obviously, the above-mentioned embodiments of the present invention are only examples for clearly illustrating the technical solutions of the present invention, and are not intended to limit the specific embodiments of the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principle of the claims of the present invention shall be included within the protection scope of the claims of the present invention.

Claims (10)

  1. 一种智能化的产品质量检测方法,其特征在于,包括以下步骤:An intelligent product quality detection method is characterized in that, comprises the following steps:
    步骤S1:对产品进行图像数据采集;Step S1: collecting image data for the product;
    步骤S2:根据采集到图像数据对产品进行检测生成检测结果;Step S2: Detecting the product according to the collected image data to generate a detection result;
    步骤S3:根据检测结果进行分析并且对产品进行处理;Step S3: analyze and process the product according to the detection result;
    所述图像数据和检测结果设定了存储时限。The image data and detection results set a storage time limit.
  2. 根据权利要求1所述的一种智能化的产品质量检测方法,其特征在于,所述存储时限的设定过程为:A kind of intelligent product quality detection method according to claim 1, is characterized in that, the setting process of described storage time limit is:
    获取产品的图像检测时间、图像存入缓存时间间隔;Obtain the image detection time of the product and the image storage time interval;
    根据图像检测时间、图像存入缓存时间间隔计算出图像存留时间;Calculate the image retention time according to the image detection time and the image storage time interval;
    所述图像存留时间的计算公式为:The calculation formula of the image retention time is:
    Figure PCTCN2021105434-appb-100001
    Figure PCTCN2021105434-appb-100001
    其中,i为当前被检测产品的当前图像序号,C k为当前被检测产品第k张图像的检测时间,F为图像用于存储的时间间隔; Among them, i is the current image serial number of the currently detected product, C k is the detection time of the k-th image of the currently detected product, and F is the time interval for the image to be stored;
    根据多个产品的图像存留时间通过数据拟合计算出存储时间t,根据存储时间t将存储时限设定为t+d,所述d为常量。The storage time t is calculated by data fitting according to the image retention time of a plurality of products, and the storage time limit is set as t+d according to the storage time t, and the d is a constant.
  3. 根据权利要求1所述的一种智能化的产品质量检测方法,其特征在于,所述步骤S1包括:步骤S1.1:创建第一队列;The intelligent product quality detection method according to claim 1, wherein the step S1 comprises: step S1.1: creating a first queue;
    步骤S1.2:对产品进行图像捕捉及生成图像数据,将生成的图像数据存入第一队列;Step S1.2: image capturing of the product and generating image data, and storing the generated image data in the first queue;
    步骤S1.3:若存在产品未进行图像捕捉及生成图像数据,则继续执行步骤S1.2,否则结束步骤S1;Step S1.3: If there is a product without image capture and image data generation, proceed to step S1.2, otherwise end step S1;
    所述步骤S2包括:The step S2 includes:
    步骤S2.1:创建第二队列;Step S2.1: create a second queue;
    步骤S2.2:根据第一队列所存放的图像数据对相应的产品进行检测及生成检测结果,将生成的检测结果存入第二队列;Step S2.2: According to the image data stored in the first queue, the corresponding products are detected and the detection results are generated, and the generated detection results are stored in the second queue;
    步骤S2.3:若第一队列中的图像数据相应的产品存在未进行检测及生成检测结果,则继续执行步骤S2.2,否则执行步骤S2.4;Step S2.3: if the product corresponding to the image data in the first queue has not been detected and the detection result has not been generated, continue to perform step S2.2, otherwise perform step S2.4;
    步骤S2.4:若步骤S1未结束,则等待第一队列存入新生成的图像数据之后,继续执行步骤S2.1;若步骤S1已结束,则结束步骤S2;Step S2.4: if step S1 has not ended, wait for the first queue to store the newly generated image data, then continue to execute step S2.1; if step S1 has ended, end step S2;
    所述步骤S3包括:The step S3 includes:
    步骤S3.1:根据第二队列中的检测结果进行分析;Step S3.1: analyze according to the detection results in the second cohort;
    步骤S3.2:根据分析结果进行处理;Step S3.2: processing according to the analysis result;
    所述步骤S1、步骤S2、步骤S3并行执行,互不干涉;若第一队列中的图像数据存留在第一队列中的时间超过存储时限,则自动清除其中超过存储时限的图像数据;若第二队列中的检测结果存留在第二队列中的时间超过存储时限,则自动清除其中超过存储时限的检测结果。The steps S1, S2, and S3 are executed in parallel without interfering with each other; if the image data in the first queue remains in the first queue for longer than the storage time limit, the image data exceeding the storage time limit is automatically cleared; The time when the detection results in the second queue are stored in the second queue exceeds the storage time limit, the detection results that exceed the storage time limit are automatically cleared.
  4. 根据权利要求3所述的一种智能化的产品质量检测方法,其特征在于,所述步骤S1.1具体为根据产品数量创建多个第一队列;所述步骤S2.1具体为根据对产品进行检测的检测模型数量创建多个第二队列。An intelligent product quality detection method according to claim 3, characterized in that, the step S1.1 is specifically to create a plurality of first queues according to the number of products; The number of detection models to perform detection creates multiple second queues.
  5. 根据权利要求1所述的一种智能化的产品质量检测方法,其特征在于,所述图像数据以二进流形式进行存储。The intelligent product quality detection method according to claim 1, wherein the image data is stored in the form of binary stream.
  6. 一种智能化的产品质量检测装置,其特征在于,包括:图像采集模块、存储模块、检测模块、处理模块和智能管理模块;An intelligent product quality detection device is characterized in that it comprises: an image acquisition module, a storage module, a detection module, a processing module and an intelligent management module;
    所述图像采集模块对产品进行图像数据采集,采集到的图像数据存入存储模块;The image collection module collects image data for the product, and the collected image data is stored in the storage module;
    所述检测模块根据图像数据对产品进行检测,检测的结果存入存储模块,所述图像数据为图像采集模块存入存储模块的图像数据;The detection module detects the product according to the image data, and the detection result is stored in the storage module, and the image data is the image data stored in the storage module by the image acquisition module;
    所述处理模块从存储模块中读取产品检测结果,根据检测结果进行分析并且对相应的产品作后续处理;The processing module reads the product detection result from the storage module, analyzes according to the detection result, and performs subsequent processing on the corresponding product;
    所述智能管理模块对存储模块内的数据进行管理。The intelligent management module manages the data in the storage module.
  7. 根据权利要求6所述的一种智能化的产品质量检测装置,其特征在于,所述智能管理模块包括:格式检测单元和存储时限单元;所述格式检测单元用于检测存储模块内数据的格式;所述存储时限单元用于设定存储模块内数据的存储时限。The intelligent product quality detection device according to claim 6, wherein the intelligent management module comprises: a format detection unit and a storage time limit unit; the format detection unit is used to detect the format of the data in the storage module ; The storage time limit unit is used to set the storage time limit of the data in the storage module.
  8. 根据权利要求6所述的一种智能化的产品质量检测装置,其特征在于,所述存储模块以缓存实现存储功能。The intelligent product quality detection device according to claim 6, wherein the storage module realizes the storage function by means of a cache.
  9. 根据权利要求7所述的一种智能化的产品质量检测装置,其特征在于,所述存储模块包括:第一存储单元和第二存储单元;所述第一存储单元用于存储产品图像;第二存储单元用于存储产品检测结果。The intelligent product quality detection device according to claim 7, wherein the storage module comprises: a first storage unit and a second storage unit; the first storage unit is used for storing product images; The second storage unit is used to store the product inspection results.
  10. 根据权利要求6所述的一种智能化的产品质量检测装置,其特征在于,所述存储模块以二进流存储图像数据。The intelligent product quality detection device according to claim 6, wherein the storage module stores the image data in a binary stream.
PCT/CN2021/105434 2020-07-22 2021-07-09 Intelligent product quality inspection method and apparatus WO2022017197A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010709986.5 2020-07-22
CN202010709986.5A CN111830039B (en) 2020-07-22 2020-07-22 Intelligent product quality detection method and device

Publications (1)

Publication Number Publication Date
WO2022017197A1 true WO2022017197A1 (en) 2022-01-27

Family

ID=72924614

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/105434 WO2022017197A1 (en) 2020-07-22 2021-07-09 Intelligent product quality inspection method and apparatus

Country Status (3)

Country Link
CN (1) CN111830039B (en)
WO (1) WO2022017197A1 (en)
ZA (1) ZA202107467B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116433097A (en) * 2023-04-19 2023-07-14 北京市永康药业有限公司 Injection packaging quality detection method and system

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111830039B (en) * 2020-07-22 2021-07-27 南京认知物联网研究院有限公司 Intelligent product quality detection method and device
CN114130687A (en) * 2021-10-22 2022-03-04 南京认知物联网研究院有限公司 Product visual quality inspection method, system, computer equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101836099A (en) * 2007-08-27 2010-09-15 夏普株式会社 Display control device, inspection system, display control method, program and computer readable recording medium having the program recorded therein
CN104422694A (en) * 2013-09-11 2015-03-18 法国圣戈班玻璃公司 Processing device and processing method of measured data as well as optical measurement system
CN108548822A (en) * 2018-06-21 2018-09-18 无锡旭锠智能科技有限公司 A kind of wide cut continuous surface defective vision detecting system
CN108563550A (en) * 2018-04-23 2018-09-21 上海达梦数据库有限公司 A kind of monitoring method of distributed system, device, server and storage medium
KR102022496B1 (en) * 2019-02-28 2019-09-18 (주)아이프리즘 Process management and monitoring system using vision image detection and a method thereof
CN110308156A (en) * 2019-07-30 2019-10-08 爱索尔(广州)包装有限公司 A kind of tubulation printing defects detect automatically and eliminating system
CN111272775A (en) * 2020-02-24 2020-06-12 上海感图网络科技有限公司 Device and method for detecting defects of heat exchanger by using artificial intelligence
CN111830039A (en) * 2020-07-22 2020-10-27 南京认知物联网研究院有限公司 Intelligent product quality detection method and device

Family Cites Families (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7899179B2 (en) * 2004-01-20 2011-03-01 International Business Machines Corporation Method for monitoring off-schedule software agents
US7257689B1 (en) * 2004-10-15 2007-08-14 Veritas Operating Corporation System and method for loosely coupled temporal storage management
CN1842001A (en) * 2005-03-31 2006-10-04 都科摩(北京)通信技术研究中心有限公司 Media access control process and apparatus for wireless distributed network
CN101561948A (en) * 2008-04-17 2009-10-21 中国印钞造币总公司 Automatic coin quality detection device
CN102063330B (en) * 2011-01-05 2013-04-24 北京航空航天大学 Performance data acquisition method for large-scale parallel program
US8412696B2 (en) * 2011-01-31 2013-04-02 Splunk Inc. Real time searching and reporting
CN202196021U (en) * 2011-06-01 2012-04-18 苏州优纳科技有限公司 Automated optical inspection system
CN102271089B (en) * 2011-08-29 2014-02-05 北京航空航天大学 Cache cleaning method based on time prediction and directional acknowledgement for delay tolerant network
CN102750132B (en) * 2012-06-13 2015-02-11 深圳中微电科技有限公司 Thread control and call method for multithreading virtual assembly line processor, and processor
CN102735690A (en) * 2012-06-26 2012-10-17 东莞市三瑞自动化科技有限公司 Intelligent high speed online automation detection method based on machine vision, and system thereof
CN103077080B (en) * 2013-01-07 2015-08-12 清华大学 Based on parallel program performance collecting method and the device of high performance platform
CN104301360B (en) * 2013-07-19 2019-03-12 阿里巴巴集团控股有限公司 A kind of method of logdata record, log server and system
CN104730079B (en) * 2015-03-10 2018-09-07 盐城市圣泰阀门有限公司 Defect detecting system
CN204924967U (en) * 2015-08-18 2015-12-30 浙江欧威科技有限公司 Image acquisition mechanism of full -automatic AOI complete machine
US9811363B1 (en) * 2015-12-16 2017-11-07 Amazon Technologies, Inc. Predictive management of on-demand code execution
CN105700998A (en) * 2016-01-13 2016-06-22 浪潮(北京)电子信息产业有限公司 Method and device for monitoring and analyzing performance of parallel programs
CN106020777B (en) * 2016-04-29 2018-08-07 杭州华橙网络科技有限公司 A kind of data processing method, apparatus and system
CN106453834B (en) * 2016-09-07 2019-08-27 努比亚技术有限公司 Mobile terminal and camera image pickup method
CN107844098A (en) * 2016-09-17 2018-03-27 青岛海尔模具有限公司 A kind of digital factory management system and management method
US10956415B2 (en) * 2016-09-26 2021-03-23 Splunk Inc. Generating a subquery for an external data system using a configuration file
CN106959928B (en) * 2017-03-23 2019-08-13 华中科技大学 A kind of stream data real-time processing method and system based on multi-level buffer structure
CN107479961B (en) * 2017-08-28 2019-12-27 湖南友哲科技有限公司 Cell image rapid scanning processing method based on computer multithreading multi-core microscope
CN109684358B (en) * 2017-10-18 2021-11-09 北京京东尚科信息技术有限公司 Data query method and device
CN108827879A (en) * 2018-04-19 2018-11-16 沈夕尧 A kind of new city motor-vehicle tail-gas remote sensing monitoring method
CN110780989B (en) * 2019-08-29 2023-03-24 腾讯科技(深圳)有限公司 Overload protection method, device, equipment and medium
CN111028924A (en) * 2019-10-21 2020-04-17 西安电子科技大学 Method and system for labeling medical image data in various forms
CN110650293A (en) * 2019-11-08 2020-01-03 杨佳苗 Real-time image processing method and device on high-speed artificial intelligence camera
CN110888387B (en) * 2019-11-11 2023-11-17 南方电网储能股份有限公司信息通信分公司 Contact net running state safety monitoring device and method
CN111277896A (en) * 2020-02-13 2020-06-12 上海高重信息科技有限公司 Method and device for splicing network video stream images

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101836099A (en) * 2007-08-27 2010-09-15 夏普株式会社 Display control device, inspection system, display control method, program and computer readable recording medium having the program recorded therein
CN104422694A (en) * 2013-09-11 2015-03-18 法国圣戈班玻璃公司 Processing device and processing method of measured data as well as optical measurement system
CN108563550A (en) * 2018-04-23 2018-09-21 上海达梦数据库有限公司 A kind of monitoring method of distributed system, device, server and storage medium
CN108548822A (en) * 2018-06-21 2018-09-18 无锡旭锠智能科技有限公司 A kind of wide cut continuous surface defective vision detecting system
KR102022496B1 (en) * 2019-02-28 2019-09-18 (주)아이프리즘 Process management and monitoring system using vision image detection and a method thereof
CN110308156A (en) * 2019-07-30 2019-10-08 爱索尔(广州)包装有限公司 A kind of tubulation printing defects detect automatically and eliminating system
CN111272775A (en) * 2020-02-24 2020-06-12 上海感图网络科技有限公司 Device and method for detecting defects of heat exchanger by using artificial intelligence
CN111830039A (en) * 2020-07-22 2020-10-27 南京认知物联网研究院有限公司 Intelligent product quality detection method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116433097A (en) * 2023-04-19 2023-07-14 北京市永康药业有限公司 Injection packaging quality detection method and system
CN116433097B (en) * 2023-04-19 2023-11-21 北京市永康药业有限公司 Injection packaging quality detection method and system

Also Published As

Publication number Publication date
ZA202107467B (en) 2021-10-27
CN111830039A (en) 2020-10-27
CN111830039B (en) 2021-07-27

Similar Documents

Publication Publication Date Title
WO2022017197A1 (en) Intelligent product quality inspection method and apparatus
WO2022170706A1 (en) Defect detection method and apparatus for mold monitoring, and device and medium
KR102494946B1 (en) Battery detection method and device (BATTERY DETECTION METHOD AND DEVICE)
CN111080693A (en) Robot autonomous classification grabbing method based on YOLOv3
JP2021501330A (en) Automated optical inspection system based on CPU + GPU + FPGA architecture
CN111624203B (en) Relay contact point alignment non-contact measurement method based on machine vision
CN110991360B (en) Robot inspection point position intelligent configuration method based on visual algorithm
CN107024478A (en) A kind of part processes automatic defect identifying system
CN102509304A (en) Intelligent optimization-based camera calibration method
JP2021119341A (en) System and method for intelligently monitoring production line
CN110298840A (en) A kind of yarn faults detection method based on image
CN113688817A (en) Instrument identification method and system for automatic inspection
CN109698139A (en) The real-time acquisition system of wafer defect optical photograph and acquisition method
CN114596244A (en) Infrared image identification method and system based on visual processing and multi-feature fusion
CN111669575B (en) Method, system, electronic device, medium and terminal for testing image processing effect
CN105738376B (en) A kind of automatic cloth inspecting machine using contact-type image sensor
CN112949490A (en) Device action detection method and device, electronic device and readable storage medium
CN112991324A (en) Detection method for visual transmission in magnetic particle detection process
CN111880867A (en) Cold atom data acquisition and analysis system based on python
CN111380875B (en) Defect detection method and system
WO2024044947A1 (en) Defect detection method and apparatus, and computer-readable storage medium
CN104048968A (en) Industrial processing part automatic defect identification system
CN112730427B (en) Product surface defect detection method and system based on machine vision
WO2024111540A1 (en) Protein collection determination system, protein collection determination method, and recording medium
TWI765364B (en) Artificial intelligence defect image classification method and system thereof

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21847112

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21847112

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 21847112

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 07/08/2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21847112

Country of ref document: EP

Kind code of ref document: A1