Image processing-based appearance quality detection method and system for plastic shell

By combining image processing and depth camera technology, the anomaly degree and gradient depth performance of plastic shell images are comprehensively evaluated, which solves the problem of low accuracy in detecting complex backgrounds and subtle defects in traditional methods, and achieves high-precision and robust appearance quality inspection.

CN121353250BActive Publication Date: 2026-06-05DONGGUAN XINGBO PRECISION MOLD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
DONGGUAN XINGBO PRECISION MOLD
Filing Date
2025-10-29
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Traditional image processing methods have low accuracy in detecting complex backgrounds or subtle defects in plastic shells. They are prone to false positives and false negatives, especially under uneven lighting or reflection interference, and it is difficult to maintain stable feature discrimination capabilities.

Method used

An image processing-based approach is adopted to comprehensively evaluate abnormal regions in the plastic shell image by acquiring the degree of anomaly, gradient representation, and depth representation of the image of the plastic shell to be detected, and combining it with the three-dimensional information acquired by the depth camera. The detection capability is enhanced by using multi-angle neighborhood range and normalization processing.

Benefits of technology

It improves the detection accuracy of complex backgrounds and subtle defects, reduces false detections and missed detections, enhances the robustness and accuracy of detection, adapts to changes in lighting and complex texture backgrounds, and meets the needs of industrial automation quality control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121353250B_ABST
    Figure CN121353250B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of image data processing, in particular to a plastic shell appearance quality detection method and system based on image processing, comprising: collecting a plastic shell image to be detected and a standard plastic shell image; obtaining the abnormality degree of each pixel point in the plastic shell image to be detected, determining the pixel point with an abnormality degree greater than a set performance threshold as a suspected abnormal pixel point, calculating the gradient performance degree and depth performance degree of the suspected abnormal pixel point in each set angle neighborhood range, and combining the abnormality degree, the gradient performance degree and the depth performance degree to evaluate the defect degree of the pixel point; determining the region corresponding to the pixel point with a defect degree greater than a set threshold as a defect region, thereby realizing accurate identification of the appearance quality of the plastic shell to be detected. The present application solves the problem of low detection accuracy for complex backgrounds or subtle defects in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image data processing technology. More specifically, this invention relates to a method and system for inspecting the appearance quality of plastic housings based on image processing. Background Technology

[0002] Plastic housings are crucial structural components in electronic products, home appliances, automotive parts, and precision instruments. Their appearance quality directly impacts the overall aesthetics, assembly precision, and brand image of the product. Traditional plastic housing manufacturing processes involve multiple stages, including injection molding, cooling, demolding, and post-processing. During production, these processes are highly susceptible to the effects of temperature, pressure, mold wear, raw material impurities, and environmental factors, resulting in various appearance defects such as scratches, bubbles, burrs, shrinkage marks, flow marks, deformation, and color differences.

[0003] In recent years, with the rapid development of computer vision, digital image processing, and artificial intelligence technologies, automatic appearance quality inspection based on image processing has gradually become an important direction for the quality control of plastic shells. Common image processing workflows include grayscale conversion, filtering and denoising, edge detection, illumination compensation, feature enhancement, and morphological analysis. At the feature extraction level, traditional methods mainly rely on texture features, shape features, and color features, and use algorithms such as threshold segmentation, region growing, and Canny or Sobel operator detection to locate defect areas.

[0004] However, traditional image processing methods still have many limitations in the detection of plastic shells. On the one hand, the surface of plastic shells often has complex geometric curves and local reflective areas. Uneven lighting or reflection interference can lead to unstable image contrast, making segmentation algorithms based on fixed thresholds or edge operators prone to false positives and false negatives. On the other hand, shell surfaces of different colors, textures, and materials vary significantly, making it difficult for traditional algorithms to maintain stable feature discrimination capabilities in diverse samples. Especially when the defect size is small or sparsely distributed, feature signals are often masked by noise, and the robustness and generalization ability of traditional feature extraction methods are insufficient, resulting in low accuracy when detecting complex backgrounds or subtle defects. Summary of the Invention

[0005] To address the problem of low accuracy in detecting complex backgrounds or subtle defects mentioned in the background art, the present invention provides solutions in the following aspects.

[0006] In a first aspect, the present invention provides an image processing-based method for inspecting the appearance quality of a plastic shell, comprising: acquiring an image of a plastic shell to be inspected and a standard plastic shell image; obtaining the degree of abnormality of each pixel in the image of the plastic shell to be inspected, and determining pixels with an abnormality degree greater than a set performance threshold as suspected abnormal pixels; calculating the gradient performance and depth performance of the suspected abnormal pixels within a set angular neighborhood, wherein the gradient performance is the difference in gradient magnitude between the suspected abnormal pixels and the corresponding pixels in the standard plastic shell image, and the depth performance is the difference in depth value between the suspected abnormal pixels and the corresponding pixels in the standard plastic shell image; obtaining the degree of defect of the suspected abnormal pixels, wherein the degree of defect is positively correlated with the degree of abnormality, the gradient performance, and the depth performance; and defining the region corresponding to a pixel with a defect degree greater than a set threshold as a defect region.

[0007] The above technical solution accurately identifies and evaluates abnormal pixels in plastic shell images by comprehensively considering anomaly degree, gradient performance, and depth performance, effectively improving the detection accuracy of complex backgrounds and subtle defects, while reducing the risk of false detection and missed detection.

[0008] Furthermore, the degree of abnormality for, In the formula, The first image of the plastic shell to be detected The degree of abnormality of each pixel The first image of the plastic shell to be detected The grayscale value of each pixel For the first The average grayscale value of all pixels within a specified neighborhood radius centered on a given pixel. For the first The standard deviation of the grayscale values ​​of all pixels within a neighborhood radius centered on a given pixel is set. To preset hyperparameters, This is the normalization function.

[0009] The above technical solution calculates the normalized difference between the gray value of a pixel and the average gray value of its neighborhood, and performs normalization processing by combining the standard deviation of gray value changes within the neighborhood. This effectively enhances the sensitivity to local gray value anomalies, thereby improving the ability to identify potential abnormal areas under uneven lighting or complex background conditions.

[0010] Furthermore, the gradient representation degree for, In the formula, The first in the standard plastic shell image Gradient magnitude of each pixel In the standard plastic shell image, the first Within a set angular neighborhood starting from the nth pixel, the nth pixel... Gradient magnitude of each pixel The first image of the plastic shell to be detected Gradient magnitude of each pixel For the image of the plastic shell to be detected, the first one is... Within a set angular neighborhood starting from the nth pixel, the nth pixel... The gradient magnitude of each pixel.

[0011] The above technical solution can effectively capture abnormal features of image edge structure and texture changes by comparing and analyzing the gradient amplitude differences of corresponding pixels and their set angle neighborhoods in the standard image and the image to be detected, thereby enhancing the detection capability of local structural anomalies such as edge defects and scratches, and thus improving the accuracy and robustness of overall defect identification.

[0012] Furthermore, the depth representation for, In the formula, The first in the standard plastic shell image The depth value of each pixel. In the standard plastic shell image, the first Within a set angular neighborhood starting from the nth pixel, the nth pixel... The depth value of each pixel. The first image of the plastic shell to be detected The depth value of each pixel. For the image of the plastic shell to be detected, the first one is... Within a set angular neighborhood starting from the nth pixel, the nth pixel... The depth value of each pixel. This is the function for finding the maximum value.

[0013] The above technical solution effectively enhances the sensitivity to spatial structural anomalies such as local surface undulations, depressions or protrusions by comparing the difference in depth extreme values ​​between the image to be detected and the standard image at the same position and within the neighborhood of their set angles. This allows for the accurate capture of minute defects at the depth level, thereby improving the accuracy and reliability of three-dimensional structural defect identification.

[0014] Furthermore, the degree of the defect for, In the formula, For the image of the plastic shell to be detected, the first one is... The first pixel centered on the [number]th pixel Gradient performance within a defined angular neighborhood range To set the number of angular neighborhood ranges, The first image of the plastic shell to be detected The degree of abnormality of each pixel The first image of the plastic shell to be detected Depth representation of each pixel.

[0015] The above technical solution, by comprehensively considering the degree of anomaly, gradient performance, and depth performance, and using information from multiple angular regions to perform weighted evaluation of each pixel, effectively improves the ability to identify small and complex defects in plastic shell images. This ensures that defect detection is more comprehensive and accurate based on multi-dimensional analysis, thereby improving the robustness and accuracy of detection.

[0016] Furthermore, a depth camera is used to acquire images of the plastic shell to be inspected and images of a standard plastic shell.

[0017] Furthermore, it also includes performing grayscale processing on the image of the plastic shell to be detected and the standard plastic shell image.

[0018] Furthermore, the defined angular neighborhood range specifically refers to a neighborhood radius centered on the suspected abnormal pixel. The angle is set as Divide the neighborhood range of suspected abnormal pixels into a set angle range to obtain multiple set angle neighborhood ranges.

[0019] Furthermore, the set performance threshold is 0.5.

[0020] In a second aspect, the present invention provides an image processing-based plastic housing appearance quality inspection system, including a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the image processing-based plastic housing appearance quality inspection method described above is implemented.

[0021] The beneficial effects of this invention are as follows:

[0022] This invention utilizes a combination of features, such as anomaly degree, gradient performance, and depth performance, to perform detailed analysis on images of plastic shells to be inspected. This effectively detects minute anomalies in the images and improves the accuracy and robustness of detection by setting angular neighborhood ranges and cooperating with depth cameras. As a result, it greatly enhances the precision and reliability of detecting appearance defects in plastic shells and provides efficient and accurate technical support for quality control in industrial automation. Attached Figure Description

[0023] Figure 1 This is a flowchart illustrating an image processing-based method for inspecting the appearance quality of plastic housings according to an embodiment of the present invention;

[0024] Figure 2This is a schematic block diagram illustrating the structure of an image processing-based plastic housing appearance quality inspection system according to an embodiment of the present invention. Detailed Implementation

[0025] Example of an image processing-based method for inspecting the appearance quality of plastic housings.

[0026] like Figure 1 The flowchart shown below illustrates the appearance quality inspection method for plastic housings based on image processing according to an embodiment of the present invention, which includes the following steps:

[0027] S1: Acquire images of the plastic shell to be tested and a standard plastic shell.

[0028] In a preferred embodiment, a depth camera is used to acquire images of the plastic housing to be inspected and corresponding standard plastic housing images. The depth camera can not only acquire two-dimensional visible light images of the object's surface but also simultaneously capture three-dimensional data containing depth information. By introducing depth information, it helps to more accurately reconstruct the structural morphology of the car base surface, especially when dealing with areas with complex contours, curved surfaces, or minute unevenness. This significantly improves the spatial resolution of abnormal areas and enhances the stereo recognition effect of defect detection, thereby improving the ability to perceive minute three-dimensional defects without increasing additional hardware complexity.

[0029] In another optional embodiment, the acquired images of the plastic shell to be detected and the standard plastic shell are first subjected to grayscale preprocessing, converting the original images from color space to grayscale space. Grayscale processing can effectively reduce the complexity of image data and eliminate the interference of color factors, thereby improving the accuracy and stability of anomaly calculation. At the same time, this preprocessing step also helps to reduce interference caused by changes in lighting conditions, enhances the robustness and versatility of the algorithm in different environments, and lays a good foundation for the accurate identification of defective areas.

[0030] S2: Obtain the degree of abnormality of each pixel in the image of the plastic shell to be detected, and determine the pixels with the degree of abnormality greater than the set performance threshold as suspected abnormal pixels.

[0031] In one embodiment, the degree of abnormality for, In the formula, The first image of the plastic shell to be detected The degree of abnormality of each pixel The first image of the plastic shell to be detected The grayscale value of each pixel For the first The average grayscale value of all pixels within a specified neighborhood radius centered on a given pixel. For the first The standard deviation of the grayscale values ​​of all pixels within a neighborhood radius centered on a given pixel is set. To preset hyperparameters, This is the normalization function.

[0032] in, Indicates the first The pixel and the first pixel The grayscale difference among all pixels within a defined neighborhood radius centered on a single pixel indicates a significant discrepancy. A large difference suggests the pixel is inconsistent with its neighborhood, potentially indicating an edge, noise, or an anomaly. A small difference suggests the pixel is consistent with its neighborhood, possibly belonging to a smooth region. If a pixel has a large grayscale difference from its neighborhood and a small standard deviation of grayscale within the neighborhood, the pixel is highly abnormal, resembling a depression or protrusion. Conversely, if a pixel has a large grayscale difference from its neighborhood and a large standard deviation of grayscale within the neighborhood, the pixel is less abnormal, potentially indicating a normal textured region.

[0033] By introducing the gray-level mean and standard deviation of the local neighborhood to measure the degree of anomaly of each pixel, and using a normalization function to smooth the results, it is possible to effectively identify areas with significant gray-level differences in the image. Especially when there are minor defects or small gray-level fluctuations, it can maintain high sensitivity and accuracy, thereby improving the detection capability of small defects on the surface of car bases. At the same time, it has strong anti-noise ability and robustness to adapt to complex background changes.

[0034] Pixels whose abnormality level exceeds a set performance threshold are identified as suspected abnormal pixels. The set performance threshold is 0.5, but it can also be set according to the actual situation.

[0035] S3: Calculate the gradient and depth representation of suspected abnormal pixels within the neighborhood of each set angle.

[0036] In one embodiment, the gradient representation for, In the formula, The first in the standard plastic shell image Gradient magnitude of each pixel In the standard plastic shell image, the first Within a set angular neighborhood starting from the nth pixel, the nth pixel... Gradient magnitude of each pixel The first image of the plastic shell to be detected Gradient magnitude of each pixel For the image of the plastic shell to be detected, the first one is... Within a set angular neighborhood starting from the nth pixel, the nth pixel... The gradient magnitude of each pixel.

[0037] By comparing the gradient magnitude differences of corresponding pixels in the image of the plastic shell to be detected and the image of the standard plastic shell within multiple set angular neighborhoods, the ability to perceive local structural changes is effectively enhanced. This method not only considers the gradient changes of individual pixels but also integrates the differences in gradient distribution within a specific directional neighborhood, thus more comprehensively reflecting the changing trends of local texture and edge features. Since defective regions often exhibit significant structural anomalies, the design of gradient representation helps to more accurately distinguish between normal and abnormal regions, improves the recognition accuracy of small or direction-sensitive defects, and enhances the adaptability and robustness of the algorithm under complex backgrounds and heterogeneous texture conditions.

[0038] In one embodiment, the depth representation for, In the formula, The first in the standard plastic shell image The depth value of each pixel. In the standard plastic shell image, the first Within a set angular neighborhood starting from the nth pixel, the nth pixel... The depth value of each pixel. The first image of the plastic shell to be detected The depth value of each pixel. For the image of the plastic shell to be detected, the first one is... Within a set angular neighborhood starting from the nth pixel, the nth pixel... The depth value of each pixel. This is the function for finding the maximum value.

[0039] By comparing the differences between the maximum depth values ​​of corresponding pixels and their neighborhoods in a standard plastic shell image and an image of the plastic shell to be inspected, a depth representation is constructed, effectively enhancing the sensitivity to changes in three-dimensional topography. Using the maximum depth information within a defined angular neighborhood as a reference not only highlights local height anomalies but also reduces the interference of noise and texture undulations on depth change judgment. This helps to more accurately identify defects caused by depressions, protrusions, or other three-dimensional structural changes, thereby improving the stability and accuracy of the defect detection system in complex geometric structures and multi-scale defect scenarios.

[0040] The defined angular neighborhood range is specifically defined as follows: centered on the suspected abnormal pixel, with a neighborhood radius of [missing information]. The angle is set as Divide the neighborhood range of suspected abnormal pixels into a set angle range to obtain multiple set angle neighborhood ranges. It can be set to 30, or you can set it according to the actual situation.

[0041] For example: using suspected abnormal pixels Centered on, with a neighborhood radius of Set angle =30°, define the angular neighborhood range for suspected abnormal pixels, that is, divide the entire 360° direction into 12 angular regions. Specifically, starting from 0° in the horizontal direction, the ranges are defined sequentially in the directions of 0°, 30°, 60°, ..., 330° around the suspected abnormal pixel. Extract the set of pixels in each angular direction within a neighborhood of radius 5, and use it to calculate the gradient representation and depth representation in that direction.

[0042] S4: Calculate the defect level based on the anomaly level, gradient performance, and depth performance. The region corresponding to the pixel with a defect level greater than a set threshold is the defect region.

[0043] In one embodiment, the degree of defect for, In the formula, For the image of the plastic shell to be detected, the first one is... The first pixel centered on the [number]th pixel Gradient performance within a defined angular neighborhood range To set the number of angular neighborhood ranges, The first image of the plastic shell to be detected The degree of abnormality of each pixel The first one in the image of the plastic shell to be detected Depth representation of each pixel.

[0044] By fusing gradient representation across multiple angular regions with the anomaly level and depth representation of corresponding pixels, a defect severity index comprehensively reflects multi-dimensional anomaly features, thus comprehensively evaluating pixel anomalies at multiple levels of space, texture, and structure. This not only improves adaptability to complex defect morphologies but also significantly enhances sensitivity to hidden defects such as low contrast, small scale, and three-dimensional micro-deformation. It can reduce false alarm rates while maintaining detection accuracy, thereby improving the robustness and stability of the overall detection system.

[0045] The region corresponding to a pixel whose defect level is greater than a set threshold is a defect region.

[0046] The present invention combines three-dimensional information acquired by a depth camera with multi-dimensional features such as image grayscale, gradient, and neighborhood depth extrema, and performs comprehensive comparative analysis within a preset angular region. This enables a comprehensive evaluation of abnormal areas on the surface of plastic shells, effectively improving the detection sensitivity for minute defects such as dents, protrusions, and scratches. At the same time, the normalization process and multi-angle information fusion significantly enhance the algorithm's anti-interference ability under varying lighting conditions, surface reflections, and complex texture backgrounds. This ensures detection accuracy while meeting the real-time requirements of industrial production lines, reducing false alarms and false negatives, and greatly improving the reliability and stability of defect identification.

[0047] Example of an image processing-based plastic housing appearance quality inspection system:

[0048] like Figure 2 As shown in the figure, the structural block diagram of the appearance quality inspection system for plastic housing based on image processing according to an embodiment of the present invention includes a processor and a memory.

[0049] This invention also provides an image processing-based system for inspecting the appearance quality of plastic housings. For example... Figure 2 As shown, the system includes a processor and a memory, the memory storing computer program instructions, which, when executed by the processor, implement the image processing-based plastic housing appearance quality inspection method according to the present invention.

[0050] The image processing-based plastic shell appearance quality inspection system also includes other components well known to those skilled in the art, such as communication interfaces. Their settings and functions are known in the art and will not be described in detail here.

[0051] In this invention, the aforementioned memory can be any tangible medium containing or storing a program that can be used or combined with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc., or any other medium that can be used to store desired information and can be accessed by an application, module, or both. Any such computer storage medium can be part of a device or accessible to or connected to a device. Any application or module described in this invention can be implemented using computer-readable / executable instructions stored or otherwise maintained by such a computer-readable medium.

[0052] In the description of this specification, "multiple" or "several" means at least two, such as two, three or more, unless otherwise explicitly specified.

[0053] While this specification has shown and described numerous embodiments of the invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Many modifications, alterations, and alternatives will occur to those skilled in the art without departing from the spirit and essence of the invention. It should be understood that various alternatives to the embodiments of the invention described herein may be employed in the practice of this invention.

Claims

1. A method for inspecting the appearance quality of plastic housings based on image processing, characterized in that, include: Acquire images of the plastic shell to be tested and a standard plastic shell; Obtain the degree of anomaly of each pixel in the image of the plastic shell to be inspected. , In the formula, The first image of the plastic shell to be detected The grayscale value of each pixel For the first The average grayscale value of all pixels within a specified neighborhood radius centered on a given pixel. For the first The standard deviation of the grayscale values ​​of all pixels within a neighborhood radius centered on a given pixel is set. To preset hyperparameters, As a normalization function, pixels with an abnormality level greater than a set performance threshold are identified as suspected abnormal pixels. Calculate the gradient performance of suspected abnormal pixels within their neighborhoods at various set angles. and depth of expression : In the formula, The first in the standard plastic shell image Gradient magnitude of each pixel In the standard plastic shell image, the first Within a set angular neighborhood starting from the nth pixel, the nth pixel... Gradient magnitude of each pixel The first image of the plastic shell to be detected Gradient magnitude of each pixel For the image of the plastic shell to be detected, the first one is... Within a set angular neighborhood starting from the nth pixel, the nth pixel... Gradient magnitude of each pixel; In the formula, The first in the standard plastic shell image The depth value of each pixel. In the standard plastic shell image, the first Within a set angular neighborhood starting from the nth pixel, the nth pixel... The depth value of each pixel. The first image of the plastic shell to be detected The depth value of each pixel. For the image of the plastic shell to be detected, the first one is... Within a set angular neighborhood starting from the nth pixel, the nth pixel... The depth value of each pixel. To maximize the function, the gradient representation is the difference in gradient magnitude between suspected anomalous pixels and corresponding pixels in the standard plastic shell image, and the depth representation is the difference in depth value between suspected anomalous pixels and corresponding pixels in the standard plastic shell image. Obtain the defect level of suspected abnormal pixels , In the formula, For the image of the plastic shell to be detected, the first one is... The first pixel centered on the [number]th pixel Gradient performance within a defined angular neighborhood range To determine the number of angular neighborhood ranges, the degree of defect is positively correlated with the degree of anomaly, gradient representation, and depth representation. The region corresponding to a pixel whose defect level is greater than a set threshold is a defect region.

2. The method for inspecting the appearance quality of plastic shells based on image processing according to claim 1, characterized in that, A depth camera is used to acquire images of the plastic shell to be inspected and a standard plastic shell.

3. The method for inspecting the appearance quality of plastic housings based on image processing according to claim 1, characterized in that, It also includes performing grayscale processing on the image of the plastic shell to be detected and the standard plastic shell image.

4. The method for inspecting the appearance quality of plastic shells based on image processing according to claim 1, characterized in that, The defined angular neighborhood range is specifically defined as follows: with the suspected abnormal pixel as the center, the neighborhood radius is... The angle is set as Divide the neighborhood range of suspected abnormal pixels into a set angle range to obtain multiple set angle neighborhood ranges.

5. The method for inspecting the appearance quality of plastic housings based on image processing according to claim 1, characterized in that, The set performance threshold is 0.

5.

6. An image processing-based plastic housing appearance quality inspection system, characterized in that, It includes a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the appearance quality inspection method for plastic shells based on image processing as described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Injection molding part surface defect analysis method based on image recognition

    CN118781114A

  • Optical image contrast metric for optical target search

    TW202206805A