Method for structuring unstructured image data based on CCD vision detection

By performing Gaussian filtering, threshold segmentation, and morphological processing on CCD visual inspection images, multidimensional features of defect areas are extracted, and product quality scores and process quality evaluation indicators are generated. This solves the problem of unstructured image data in CCD visual inspection systems and enables accurate quantification of product quality and optimization of the production process.

CN122175928APending Publication Date: 2026-06-09CHINA TOBACCO ANHUI IND CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA TOBACCO ANHUI IND CO LTD
Filing Date
2026-03-09
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

The images acquired by existing CCD vision inspection systems are unstructured data and lack systematic organization, making it difficult to form a calculable, statistical, and traceable data structure for the inspection results. This makes it difficult to achieve comprehensive quantification of defect features and accurate evaluation of product quality.

Method used

By performing Gaussian filtering, threshold segmentation, and morphological processing on CCD visual inspection images, multidimensional features of defect areas are extracted, defect level mapping rules are established, product quality scores and quality capability evaluation indicators for production processes are generated, and an anomaly early warning mechanism is combined.

Benefits of technology

It enables accurate identification and quantification of defect characteristics, improves product quality reliability and traceability, enhances production line stability and efficiency, and supports quality management and production process optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122175928A_ABST
    Figure CN122175928A_ABST
Patent Text Reader

Abstract

The present application relates to the field of machine vision and industrial quality detection technology, and particularly relates to a non-structured image data structuring processing method based on CCD vision detection, which is applied to an industrial production line and used for structuring processing of defect information in a detection image obtained by a CCD vision detection device, and quality knowledge discovery and reasoning architecture based on a knowledge graph, so that non-structured image pixels are gradually converted into knowledge entities with semantic association, and structured quality image data which can be calculated, counted and traced back is obtained.The present application can realize automatic extraction and structured expression of defect features, defect types and their associated relationships in an industrial vision detection image, so that intelligent analysis of production quality data, quality problem tracing and production process optimization can be realized, so as to improve the data utilization efficiency of an industrial detection system and the intelligent level of quality management.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of machine vision and industrial quality inspection technology, specifically a method for structuring unstructured image data based on CCD visual inspection. Background Technology

[0002] With the development of industrial automation and intelligent manufacturing, machine vision-based online inspection technology has been widely applied in fields such as electronic manufacturing, precision machining, semiconductor packaging, and material surface inspection. Among these, CCD vision inspection equipment, due to its advantages of high imaging resolution, fast inspection speed, and non-contact inspection, is widely used in industrial production lines for the automated detection of product appearance defects, such as scratches, contamination points, and surface unevenness. For example, patent CN104197838A uses computer vision algorithms and image processing methods to extract the three-dimensional shape and measurement information of the object from its digital image, enabling dimensional measurement. Patent CN118216699A uses machine vision intelligent algorithms to identify the internal air separation conditions of an air separator. Patent CN116697889A uses machine vision technology to measure the length, circumference, roundness, and cylindricity of cigarettes. The patents with publication numbers CN119762879A and CN119228779A respectively use deep learning models to detect defects in cigarette images and cigarette pack appearance defects.

[0003] In practical applications, CCD vision inspection equipment typically acquires surface images of products to be inspected through image acquisition systems and uses image processing algorithms to identify and analyze defect information in the images. However, in actual production environments, the inspection images acquired by CCD vision inspection systems are essentially unstructured data, with information primarily existing in pixel form. Existing technologies, when processing inspection images, usually only focus on defect identification, lacking the ability to systematically organize image data, making it difficult to form a calculable, statistically significant, and traceable data structure for the inspection results. Summary of the Invention

[0004] This invention addresses the shortcomings of existing technologies by proposing a method for structuring unstructured image data based on CCD visual inspection. The aim is to achieve automated extraction and structured representation of defect features, defect types, and their relationships in industrial visual inspection images. This enables intelligent analysis of production quality data, traceability of quality issues, and optimization of the production process, thereby improving the data utilization efficiency and intelligent quality management level of industrial inspection systems.

[0005] To achieve the above-mentioned objectives, the present invention adopts the following technical solution: The present invention provides a method for structuring unstructured image data based on CCD visual inspection, characterized by the following steps: Step 1: Acquire the original inspection image of the product to be inspected during the production process using CCD vision inspection equipment. and the original detection image After Gaussian filtering, the background image B is obtained; based on B, the original detection image is processed. The defective regions in the image are identified to obtain a cleaned defect mask. ; Step 2: Process the cleaned defect mask image Feature extraction and semantic mapping are performed to obtain multidimensional features of the defect region, which are used to calculate the grade weight of the defect region. Step 3: Based on multidimensional features and grade weights, transform the multidimensional features of the defective region into a quality score for each product under inspection. ; Step 4: Based on quality scoring The quality capability evaluation index of the production process of the equipment where the product to be tested is located within a single cycle is calculated using equation (17). ; (17) In equation (17): Indicates the first Quality score of each product to be tested; This represents the average quality score of all products to be tested within a single period. This indicates the number of products to be tested within a single period. Stability penalty coefficient; Step 5: When the quality score is lower than the preset threshold, an abnormal signal of "defective product warning" is triggered; When the quality capability evaluation index shows a downward trend for M consecutive periods, an abnormal signal for "preventive maintenance" is triggered.

[0006] The present invention provides a method for structuring unstructured image data based on CCD visual inspection, characterized in that step one includes the following steps: Step 1.1: Use equation (1) to process the original detection image. In position pixel value at Preprocessing is performed to obtain the enhanced defect image. In position pixel value at : (1) In formula (1): Represents a Gaussian filtered background image exist Pixel value at; Represents absolute value Step 1.2: For The defective region is segmented and cleaned to obtain a cleaned defect mask image. ; Step 1.2.1, using equation (2) to... Threshold segmentation is performed on the defect region to obtain the initial defect mask image. In position pixel value at : (2) In formula (2): Indicates position Adaptive threshold at the location; Step 1.2.2, using equation (3) to... Morphological processing was performed to obtain the purified defect mask image. In position pixel value at : (3) In formula (3): Represents a structural element; This represents the erosion operation; This indicates the expansion operation.

[0007] Furthermore, step two includes the following steps: Step 2.1: Apply the cleaned defect mask image according to the preset connectivity rules. Perform connected component labeling to identify Each independent defect area: right The pixel values ​​in the image are traversed and scanned. When adjacent pixel values ​​satisfy the connectivity condition, they are grouped into the same connected region, thereby... Divided into Each defect region is identified as an independent defect region, and a set of defect regions is obtained. ,in, Indicates the first One defective area, Indicates the number of defects identified: Step 2.2: Extraction The multidimensional features include: pixel area ,perimeter Tightness of shape Texture grayscale mean Texture variance Texture contrast ; Step 2.3: According to of Using preset hierarchical rules to A comprehensive grading was performed to obtain... Defect semantic level and will Mapped to defect level weights .

[0008] Furthermore, step 2.2 includes the following steps: Step 2.2.1: Obtain using equation (5) pixel area : (5) In equation (5), express any position in Pixel value at; Step 2.2.2: Obtain using equation (6) physical area : (6) In equation (6): They represent The actual physical resolution of a pixel at any position in the horizontal and vertical directions; Step 2.2.3: Obtain using equation (7) circumference : In equation (7): express The physical dimension of the side length corresponding to a pixel at any position in the graph. for The set of boundary pixels, express The total number of pixels at the middle boundary; Step 2.2.4: Obtain using equation (7) Shape compactness : Step 2.2.5: Obtain using equation (9) Texture grayscale mean : Step 2.2.6: Obtain using equation (10) Texture grayscale variance : Step 2.2.7: Obtain using equation (11) Texture contrast : In equation (11): express The first gray level in the gray-level co-occurrence matrix; express The second gray level in the gray-level co-occurrence matrix; Represents the total number of gray levels; express The first gray level in the gray-level co-occurrence matrix And the second gray level The normalized probability values ​​between them.

[0009] Furthermore, step three includes the following steps: Step 3.1: For The severity of the defects was quantitatively calculated to obtain... Defect severity score ; Step 3.2: Based on the severity score of each defect, obtain the quality score of a single product to be inspected using equation (16). : (16) In equation (16): This represents the quality benchmark value used for normalization.

[0010] Furthermore, step 3.1 includes the following steps: Step 3.1.1: Construct using equation (13) eigenvectors Then, normalization is performed to obtain the normalized feature vector. : Step 3.1.2: Obtain using equation (15) Severity score : (15) In equation (15): express The first in One physical characteristic; express The Middle The weights of each physical feature.

[0011] The present invention provides an electronic device, including a memory and a processor, characterized in that the memory is used to store a program supporting the processor in performing the method described therein, and the processor is configured to execute the program stored in the memory.

[0012] The present invention discloses a computer-readable storage medium storing a computer program, characterized in that the computer program is executed by a processor to perform the steps of the method described thereon.

[0013] Compared with the prior art, the beneficial effects of the present invention are as follows: 1. This invention overcomes the problems of large image noise interference and unclear defect boundaries in the prior art by performing background suppression and enhancement processing on the original detection image obtained by CCD visual inspection, and performing threshold segmentation and morphological purification on the defect area. This enables accurate extraction of the defect area of ​​the product to be inspected, and improves the accuracy and reliability of defect identification.

[0014] 2. This invention extracts multi-dimensional features for each defect region, including pixel area, physical area, perimeter, shape compactness, texture grayscale mean, grayscale variance, and grayscale contrast. This overcomes the shortcomings of existing technologies that only extract single or local features and are difficult to comprehensively describe defects. Thus, it achieves comprehensive quantification of defect morphology and texture features, providing a reliable data foundation for subsequent defect level classification and quality scoring.

[0015] 3. By establishing a defect level mapping rule, this invention comprehensively divides the multidimensional features of each defect region into defect levels and maps them into weights, overcoming the problems of difficulty in uniformly quantifying and evaluating different defects and the discreteness of defect information in the prior art. This allows for a unified and comparable scoring of product quality, facilitating quality analysis and management of the production line.

[0016] 4. This invention generates a quality score for a single product by constructing a defect feature vector and performing weighted normalization calculations. This overcomes the problems of lacking unified evaluation indicators and being unable to quantify the overall product quality in the prior art, thereby achieving accurate quantitative evaluation of the overall product quality and improving the operability and traceability of quality control.

[0017] 5. This invention further calculates the quality capability evaluation index of the production process based on the quality score of all products within the cycle, and combines threshold and trend analysis to provide abnormal early warning and preventive maintenance prompts. This overcomes the problem in the prior art that it is difficult to monitor and predict the overall quality capability of the production process in real time. As a result, it can detect equipment abnormalities or production process drift in a timely manner, improve the stability and production efficiency of the production line, and reduce the defect rate. Attached Figure Description

[0018] Figure 1 This is a flowchart of the method of the present invention. Detailed Implementation

[0019] In this embodiment, a method for structuring unstructured image data based on CCD visual inspection transforms defect information in unstructured inspection images acquired from industrial production lines into calculable, statistically significant, and traceable structured data. This enables precise quantitative evaluation of product quality and supports quality capability analysis, anomaly warning, and production process optimization in production processes. Consequently, it improves the utilization rate of industrial visual inspection data, enhances the visualization and decision-making capabilities of quality control, provides reliable data support for intelligent manufacturing and production process automation, and solves the problems of unstructured image data and difficulty in systematically analyzing defect information in existing CCD visual inspection systems. Figure 1 As shown, the method includes the following steps: Step 1: On an actual industrial production line, CCD vision inspection equipment performs high-speed imaging of each product to be inspected, thereby acquiring the original inspection image of the product during the production process. The image Typically, these are high-resolution grayscale or color images (e.g., 8-bit grayscale images with a resolution of up to 2048×2048). The acquired raw detection image. It includes not only defect information, but also overall lighting distribution and background noise.

[0020] For the original detection image After Gaussian filtering, a smooth background image B is obtained. This image mainly retains the overall brightness distribution and low-frequency information (background information) in the image, while weakening or removing small defects, noise and high-frequency details.

[0021] Based on B, the original detection image The defective regions in the image are identified to obtain a cleaned defect mask. ; Step 1.1: For subsequent processing, the image needs to be... Enhancement and background suppression are performed, thereby utilizing Equation (1) to enhance the original detection image. In position pixel value at Preprocessing is performed to obtain the enhanced defect image. In position pixel value at This can highlight local brightness anomalies, enhance the contrast of defective areas, and make subsequent segmentation more accurate.

[0022] (1) In formula (1): Represents a Gaussian filtered background image exist Pixel value at; It represents the absolute value.

[0023] Step 1.2: For The defective region is segmented and cleaned to obtain a cleaned defect mask image. ; Step 1.2.1, using equation (2) to... Threshold segmentation is performed on the defect region to obtain the initial defect mask image. In position pixel value at : (2) In formula (2): Indicates position An adaptive threshold is used at a location; this adaptive threshold can be calculated based on the statistical characteristics of the local image to address the problem of uneven illumination.

[0024] Step 1.2.1, using equation (3) to... Morphological processing is performed to remove isolated noise points while preserving scratches and contaminants, thus obtaining a cleaned defect mask image. In position pixel value at : (3) In formula (3): Represents a structural element; This represents the erosion operation; This indicates the expansion operation.

[0025] Step 2: Process the cleaned defect mask image Feature extraction and semantic mapping are performed to obtain multidimensional features of the defect region, which are used to calculate the grade weight of the defect region. Step 2.1: Apply the cleaned defect mask image according to the preset connectivity rules. Perform connected component labeling to identify Each defect is separated into its own independent defect region. After distinguishing each defect independently, complete features can be calculated for a single defect, achieving precise quantification. Specifically, this includes: right The pixel values ​​in the image are scanned traversally. When adjacent pixel values ​​satisfy the connectivity condition, they are grouped into the same connected region as the same defect region and assigned the same connected component label, thereby... Divided into Each defect region is identified as an independent defect region, and a set of defect regions is obtained. ,in, Indicates the first One defective area, This indicates the number of defects identified.

[0026] Step 2.2: Extraction The multidimensional features include: pixel area ,perimeter Tightness of shape Texture grayscale mean Texture variance Texture contrast .

[0027] Step 2.2.1: By analyzing the region All pixels within the range are summed and statistically analyzed, and then equation (5) is used to obtain the result. pixel area : (5) In equation (5), express any position in The pixel value at that location.

[0028] Step 2.2.2: Obtain using equation (6) physical area : (6) In equation (6): They represent The actual physical resolution of a pixel at any position in the horizontal and vertical directions.

[0029] Step 2.2.3: Obtain using equation (7) circumference : In equation (7): express The physical dimension of the side length corresponding to a pixel at any position in the graph. for The set of boundary pixels, express The total number of pixels at the middle boundary.

[0030] Step 2.2.4: Obtain using equation (7) Shape compactness : Step 2.2.5: Obtain using equation (9) Texture grayscale mean : Step 2.2.6: Obtain using equation (10) Texture grayscale variance : Step 2.2.7: Obtain using equation (11) Texture contrast : In equation (11): This indicates the total number of gray levels. A gray level represents the discrete levels into which the gray values ​​of an image pixel are divided; for example, an 8-bit image has 256 gray levels, ranging from 0 to 255. express The first gray level in the gray-level co-occurrence matrix; express The second gray level in the gray-level co-occurrence matrix; express The first gray level in the gray-level co-occurrence matrix obtained by statistically analyzing the preset pixel adjacency relationships The pixel is related to the second gray level in a certain direction and distance. The normalized probability value of pixels occurring simultaneously reflects the spatial relationship between different gray levels within that region, i.e., the spatial correlation of gray-level texture. For example: smooth regions → small gray-level variations → co-occurrence matrix concentrated on the diagonal; coarse textures → large gray-level variations → more dispersed distribution; high contrast → The value increases. Calculating texture contrast using the gray-level co-occurrence matrix can distinguish between smooth and rough surfaces, aiding in defect classification.

[0031] Step 2.3: According to of Using preset hierarchical rules to A comprehensive grading was performed to obtain... Defect semantic level and will Mapped to defect level weights Quantify the importance of each defect to provide a weighting basis for subsequent product quality scoring.

[0032] Step 3: Convert the multidimensional features of the defective area into a quality score for the individual product to be inspected. : Step 3.1: For The severity of the defects was quantitatively calculated to obtain... Defect severity score : Step 3.1.1: Construct using equation (13) eigenvectors : Step 3.1.2: Use equation (14) to... Normalization is performed to obtain the normalized feature vector. : (14) In equation (14), express If the difference of the j-th feature value is 0, then the feature is normalized to 0.

[0033] Step 3.1.3: Obtain using equation (15) Severity score : (15) In equation (15): express The first in One physical characteristic; express The Middle The weights of each physical feature.

[0034] Step 3.2: Based on the severity score of each defect, obtain the quality score of a single product to be inspected using equation (16). : (16) In equation (16): This represents the quality benchmark value used for normalization. The normalized eigenvectors ensure that different physical quantities are comparable.

[0035] Step 4: Based on quality scoring The quality capability evaluation index of the production process of the equipment where the product to be tested is located within a single cycle is calculated using equation (17). ,pass It can monitor the quality stability of the entire production process and quantify production capacity.

[0036] (17) In equation (17): Indicates the first Quality score of each product to be tested; This represents the average quality score of all products to be tested within a single period. This indicates the number of products to be tested within a single period. Stability penalty coefficient.

[0037] Step 5: Based on quality score and quality capability evaluation indicators Monitor and provide early warnings regarding the operating status of production equipment: When the quality score of a single product to be tested Below the preset threshold When this happens, an abnormal signal called "Defective Product Warning" is triggered, indicating that the product has a quality defect; When quality capability evaluation indicators If a downward trend is observed for M consecutive cycles, an abnormal signal for "preventive maintenance" is triggered, indicating that the production process of the corresponding production equipment may drift or its performance may degrade, thus prompting equipment maintenance or process adjustment.

[0038] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the above-described method, and the processor is configured to execute the program stored in the memory.

[0039] In this embodiment, a computer-readable storage medium stores a computer program, which is executed by a processor to perform the steps of the above method.

Claims

1. A method for structuring unstructured image data based on CCD visual inspection, characterized in that, Includes the following steps: Step 1: Acquire the original inspection image of the product to be inspected during the production process using CCD vision inspection equipment. and the original detection image After Gaussian filtering, the background image B is obtained; based on B, the original detection image is processed. The defective regions in the image are identified to obtain a cleaned defect mask. ; Step 2: Process the cleaned defect mask image Feature extraction and semantic mapping are performed to obtain multidimensional features of the defect region, which are used to calculate the grade weight of the defect region. Step 3: Based on multidimensional features and grade weights, transform the multidimensional features of the defective region into a quality score for each product under inspection. ; Step 4: Based on quality scoring The quality capability evaluation index of the production process of the equipment where the product to be tested is located within a single cycle is calculated using equation (17). ; (17) In equation (17): Indicates the first Quality score of each product to be tested; This represents the average quality score of all products to be tested within a single period. This indicates the number of products to be tested within a single period. Stability penalty coefficient; Step 5: When the quality score is lower than the preset threshold, an abnormal signal of "defective product warning" is triggered; When the quality capability evaluation index shows a downward trend for M consecutive periods, an abnormal signal for "preventive maintenance" is triggered.

2. The method for structuring unstructured image data based on CCD visual inspection according to claim 1, characterized in that, Step one includes the following steps: Step 1.1: Use equation (1) to process the original detection image. In position pixel value at Preprocessing is performed to obtain the enhanced defect image. In position pixel value at : (1) In formula (1): Represents a Gaussian filtered background image exist Pixel value at; Represents absolute value Step 1.2: For The defective region is segmented and cleaned to obtain a cleaned defect mask image. ; Step 1.2.1, using equation (2) to... Threshold segmentation is performed on the defect region to obtain the initial defect mask image. In position pixel value at : (2) In formula (2): Indicates position Adaptive threshold at the location; Step 1.2.2, using equation (3) to... Morphological processing was performed to obtain the purified defect mask image. In position pixel value at : (3) In formula (3): Represents a structural element; This represents the erosion operation; This indicates the expansion operation.

3. The method for structuring unstructured image data based on CCD visual inspection according to claim 2, characterized in that, Step two includes the following steps: Step 2.1: Apply the cleaned defect mask image according to the preset connectivity rules. Perform connected component labeling to identify Each independent defect area: right The pixel values ​​in the image are traversed and scanned. When adjacent pixel values ​​satisfy the connectivity condition, they are grouped into the same connected region, thereby... Divided into Each defect region is identified as an independent defect region, and a set of defect regions is obtained. ,in, Indicates the first One defective area, Indicates the number of defects identified: Step 2.2: Extraction The multidimensional features include: pixel area ,perimeter Tightness of shape Texture grayscale mean Texture variance Texture contrast ; Step 2.3: According to of Using preset hierarchical rules to A comprehensive grading was performed to obtain... Defect semantic level and will Mapped to defect level weights .

4. The method for structuring unstructured image data based on CCD visual inspection according to claim 3, characterized in that, Step 2.2 includes the following steps: Step 2.2.1: Obtain using equation (5) pixel area : (5) In equation (5), express any position in Pixel value at; Step 2.2.2: Obtain using equation (6) physical area : (6) In equation (6): They represent The actual physical resolution of a pixel at any position in the horizontal and vertical directions; Step 2.2.3: Obtain using equation (7) circumference : In equation (7): express The physical dimension of the side length corresponding to a pixel at any position in the graph. for The set of boundary pixels, express The total number of pixels at the middle boundary; Step 2.2.4: Obtain using equation (7) Shape compactness : Step 2.2.5: Obtain using equation (9) Texture grayscale mean : Step 2.2.6: Obtain using equation (10) Texture grayscale variance : Step 2.2.7: Obtain using equation (11) Texture contrast : In equation (11): express The first gray level in the gray-level co-occurrence matrix; express The second gray level in the gray-level co-occurrence matrix; Represents the total number of gray levels; express The first gray level in the gray-level co-occurrence matrix And the second gray level The normalized probability values ​​between them.

5. The method for structuring unstructured image data based on CCD visual inspection according to claim 3, characterized in that, Step three includes the following steps: Step 3.1: For The severity of the defects was quantitatively calculated to obtain... Defect severity score ; Step 3.2: Based on the severity score of each defect, obtain the quality score of a single product to be inspected using equation (16). : (16) In equation (16): This represents the quality benchmark value used for normalization.

6. The method for structuring unstructured image data based on CCD visual inspection according to claim 5, characterized in that, Step 3.1 includes the following steps: Step 3.1.1: Construct using equation (13) eigenvectors Then, normalization is performed to obtain the normalized feature vector. : Step 3.1.2: Obtain using equation (15) Severity score : (15) In equation (15): express The first in One physical characteristic; express The Middle The weights of each physical feature.

7. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store a program that supports a processor in executing the method of any one of claims 1-6, the processor being configured to execute the program stored in the memory.

8. A computer-readable storage medium storing a computer program thereon, characterized in that, The computer program is executed by a processor to perform the steps of the method according to any one of claims 1-6.