A Method for Detecting and Identifying Appearance Defects in Plastic Products Based on Image Technology

By deploying detection components in a ring and using dual-color grating technology, the problems of blind spots and optical interference in the detection of circular plastic products have been solved, enabling efficient and accurate defect identification and quality control, and improving the integrity and versatility of the detection system.

CN121214049BActive Publication Date: 2026-03-13JIANGXI ZEHUI NEW MATERIAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-10
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies have a 30% blind zone when inspecting circular plastic products, making it impossible to effectively capture defects on the back of pipes. Furthermore, pipes of different materials and colors cause optical interference under illumination, resulting in reduced accuracy of defect identification and decreased versatility of the inspection system.

Method used

The system employs a ring-shaped deployment of detection components. It projects a grating composed of two-color micro-lines and simultaneously triggers a camera to acquire multi-view distortion images. It reconstructs three-dimensional geometry and identifies defect points. By combining the results with a preset model comparison and the periodic patterns of the production line, it determines appearance defect data, executes quality control decisions, and optimizes production.

Benefits of technology

It completely eliminates detection blind spots, improves the integrity and reliability of detection, reduces false alarm rate, and enhances the adaptability and versatility of detection methods for diverse materials.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121214049B_ABST
    Figure CN121214049B_ABST
Patent Text Reader

Abstract

This invention relates to the field of appearance defect detection technology, and more particularly to a method for detecting and identifying appearance defects in plastic products based on image technology. The method includes the following steps: projecting a grating composed of dual-color microlines onto the surface of the plastic product, and simultaneously triggering a camera to acquire multi-view distortion images containing grating distortion information; reconstructing the three-dimensional geometry of the plastic product based on the multi-view distortion images and identifying defect points, and tracking the defect trajectories of the defect points on the surface of the plastic product, determining appearance defect data by identifying their distribution patterns and periodicity on the product surface; executing quality control decisions for the plastic product based on the appearance defect data; and sending optimized production instructions to the corresponding upstream equipment to suppress defect regeneration based on the defect sources in the appearance defect data. This invention achieves simultaneous detection and defect source identification of defects on the entire circumference of the inner and outer walls of plastic products through multi-view image analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of appearance defect detection technology, and in particular to a method for detecting and identifying appearance defects in plastic products based on image technology. Background Technology

[0002] Detection of surface defects in plastic products is a crucial step in ensuring product quality, including the identification and screening of surface defects such as cracks, bubbles, impurities, deformation, and scratches. However, existing technologies face challenges when inspecting circular plastic products. For example, with circular plastic pipes, traditional inspection systems often use fixed cameras with single or limited angles for image acquisition. This setup inevitably creates a blind zone of approximately 30% when processing the surface of circular pipes, preventing the effective capture of defects on the back side of the pipe and increasing the risk of missed defects. This problem is exacerbated, especially on continuous extrusion production lines where the pipes move at high speeds. Pipes of different materials and colors, such as transparent, semi-transparent, opaque, black, and colored, exhibit significant differences in their light reflection, absorption, and transmission characteristics. Existing technologies generally employ planar illumination light sources, which, when applied to the surface of circular pipes, generate numerous reflective points and uneven illumination areas on the curved surface. These optical interferences severely affect image quality and reduce the accuracy of defect identification. Furthermore, reflective points are often misidentified as defects, leading to a large number of false positives. This not only reduces production efficiency but also limits the versatility and flexibility of the inspection system. Summary of the Invention

[0003] Based on this, the present invention provides a method for detecting and identifying appearance defects in plastic products based on image technology, in order to solve at least one of the above-mentioned technical problems.

[0004] To achieve the above objectives, a method for detecting and identifying appearance defects in plastic products based on image technology is provided and applied to a plastic product production line. The method includes the following steps:

[0005] Step S1: Deploy the detection components in a ring along the normal plane of the plastic product extrusion path, project a grating composed of two-color micro-lines onto the surface of the plastic product, and simultaneously trigger the camera to acquire a multi-view distortion image containing grating distortion information.

[0006] Step S2: Reconstruct the three-dimensional geometry of the plastic product based on the multi-view distortion image and identify defect points. Compare the results with the preset standard geometric model, label the defect types, and obtain deviation point data.

[0007] Step S3: Track the defect trajectory of deviation point data on the surface of plastic products within the defined production line operation cycle, and determine the appearance defect data by identifying its distribution pattern and periodicity on the product surface.

[0008] Step S4: Make quality control decisions for plastic products based on appearance defect data;

[0009] Step S5: Based on the defect sources in the appearance defect data, send optimization production instructions to the corresponding upstream equipment to suppress defect recurrence.

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

[0011] On the one hand, by deploying the detection components in a ring around the normal plane of the plastic product and adopting a multi-angle synchronous acquisition strategy, the present invention can acquire multi-view distortion images containing the complete circumferential surface of the product, completely eliminating the blind spot of back-side detection caused by the circular curvature in traditional single-angle or limited-angle detection schemes; furthermore, this full-circumference coverage imaging method ensures that even on a high-speed continuous extrusion production line, defects at any position of the plastic product (especially pipes) can be captured without omission, fundamentally solving the problem of missed defect detection caused by detection blind spots, and significantly improving the integrity and reliability of the detection.

[0012] On the other hand, this invention employs an actively projected coded grating composed of dual-color microlines as structured light illumination, replacing traditional planar floodlighting. The fine microline grating and dual-color design effectively combat complex optical interference from products of different materials and colors (such as highly reflective, transparent, and black products). By reconstructing the three-dimensional geometry through grating distortion analysis rather than relying on surface grayscale changes, the negative impact of specular reflection and uneven illumination on the detection results is greatly reduced. This enables precise differentiation between real geometric defects and optical artifacts, significantly reducing the false alarm rate and substantially enhancing the adaptability and versatility of the detection method for diverse materials.

[0013] Figure caption

[0014] Figure 1 This is a schematic diagram of the steps of the image technology-based method for detecting and identifying appearance defects in plastic products according to the present invention.

[0015] Figure 2 This is a schematic diagram of the ring-shaped deployment detection component in this invention;

[0016] Figure 3 This is a schematic diagram of the grating projection effect in this invention;

[0017] Figure 4 Example diagram of a plastic product production line;

[0018] The realization of the objective, functional features and advantages of the present invention will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0019] The technical method of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0020] Furthermore, the accompanying drawings are merely illustrative of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor methods and / or microcontroller methods.

[0021] It should be understood that although the terms "first," "second," etc., may be used herein to describe various units, these units should not be limited by these terms. These terms are used merely to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.

[0022] To achieve the above objectives, please refer to Figures 1 to 4 This invention provides a method for detecting and identifying appearance defects in plastic products based on image technology, applicable to plastic product production lines. The method includes the following steps:

[0023] Step S1: Deploy the detection components in a ring along the normal plane of the plastic product extrusion path, project a grating composed of two-color micro-lines onto the surface of the plastic product, and simultaneously trigger the camera to acquire a multi-view distortion image containing grating distortion information.

[0024] In this embodiment of the invention, after the shaping and cooling section of the plastic product, six industrial cameras are arranged in a ring around the geometric center of the product, along the normal plane of its extrusion path, with adjacent cameras spaced at 60-degree intervals. Between every two adjacent cameras, a laser projector is installed at an incident angle of 45° relative to the tangent of the product surface. All laser projectors are driven to simultaneously project a grating composed of alternating red and blue parallel micro-lines onto the moving surface of the plastic product, wherein the width of each micro-line is controlled between 50 and 100 µm. Once the plastic product has completely entered the grating projection area, a central synchronization controller sends a trigger signal to synchronously trigger all cameras in the ring array to perform exposure acquisition, thereby obtaining a set of multi-view distortion images containing complete circumferential grating distortion information.

[0025] In one implementation of this invention, assuming the object to be tested is a plastic pipe with an outer diameter of 50 mm and the production line speed is 5 m / min, see [reference]. Figure 4 This diagram illustrates a production line for plastic products in this invention. 101 represents the extrusion path in the production line, and 102 represents a black plastic product. The detection component is installed 3 meters from the extrusion die. The trigger frequency is set to 100Hz, meaning a set of multi-view distortion images is acquired every 10 milliseconds. At a given acquisition moment, all six cameras are simultaneously exposed, capturing images of the pipe surface where defects such as pits and scratches cause localized bending, breakage, or blurring of the red and blue grating lines.

[0026] Step S2: Reconstruct the three-dimensional geometry of the plastic product based on the multi-view distortion image and identify defect points. Compare the results with the preset standard geometric model, label the defect types, and obtain deviation point data.

[0027] In this embodiment of the invention, firstly, pre-calibrated internal and external parameters of each camera and spatial pose of each laser projector are acquired. Next, the skeleton of each red and blue distorted grating line in the acquired multi-view distortion images is extracted to obtain its pixel coordinate trajectory in its respective image. Based on these pixel coordinate trajectories and the device calibration data, the three-dimensional spatial position of each point on the grating line in the real-world coordinate system is calculated using the triangulation principle of stereo vision, thereby obtaining a high-density surface three-dimensional point cloud covering the entire circumference of the product. Simultaneously, the set outer diameter of the product (e.g., 50mm) is obtained from the production order, and an ideal, perfectly smooth, standard geometric cylinder model with the same outer diameter is constructed in the computer. Finally, the shortest radial distance from each data point on the surface three-dimensional point cloud to the surface of this standard geometric cylinder model is calculated to obtain the geometric deviation value.

[0028] In one implementation of this invention, it is assumed that the calculated coordinates of a point P in a 3D point cloud are... The coordinates of its projection point P' on the standard cylindrical model are: The geometric deviation value at that point is the Euclidean distance between the two points. For example, if the calculated geometric deviation value of a point is -0.2mm, this indicates that there is a depression with a depth of 0.2mm relative to the standard surface. All points with geometric deviation values ​​exceeding a preset threshold (such as ±0.05mm) are identified as defect points, and their three-dimensional coordinates, deviation values, and the color information of the corresponding distortion grating are recorded, summarizing them to form deviation point data.

[0029] Step S3: Track the defect trajectory of deviation point data on the surface of plastic products within the defined production line operation cycle, and determine the appearance defect data by identifying its distribution pattern and periodicity on the product surface.

[0030] In this embodiment of the invention, a sliding spatiotemporal data window is established, with its length set to a 5-second time span during production line operation. Within this time window, spatiotemporal correlation is performed on multiple continuously collected deviation point data. Specifically, by comparing the positions of deviation points between adjacent frames on the product unfolding plane coordinate system (circumferential-axial), deviation points with similar spatial distances and deviation characteristics are connected to form defect trajectories. Then, the distribution pattern of these defect trajectories is analyzed and classified into three modes: linear, periodic, or random. If the defect trajectory is linear, the defect is determined to originate from a fixed scratch on the extrusion die or shaping sleeve; if the defect trajectory is periodic, its spatial period in the axial direction is extracted and compared with the rotation period of each rotating component on the production line (such as the extruder screw and traction machine track) to determine the specific defect source.

[0031] In one implementation of this invention, a series of defect points were found to form a spiral line with a pitch of 120 mm on the unfolded plane. Simultaneously, the recorded extruder screw speed was 50 rpm, and the traction speed was 6 m / min. Calculations showed that the tube advanced 120 mm per screw revolution (6000 mm / min / 50 rpm). Since the defect pitch perfectly matched the screw rotation cycle, the defect was determined to originate from a fixed attachment or wear point on the extruder screw. This defect pattern, defect type (e.g., pit), spatial location, and inferred defect source (extruder screw) were collectively packaged into a single visual defect data point.

[0032] Step S4: Make quality control decisions for plastic products based on appearance defect data;

[0033] In this embodiment of the invention, real-time quality control decisions are made based on the generated appearance defect data. The decisions are divided into two main types: immediate rejection and graded marking. For detected severe defects, such as cracks or dents exceeding the maximum permissible depth, immediate rejection is performed. For general or minor defects, graded marking is performed. A quality grade is assigned based on the severity (e.g., deviation value, defect area) and type of the defect, and a non-contact inkjet marking is applied to the surface of the product.

[0034] Step S5: Based on the defect sources in the appearance defect data, send optimization production instructions to the corresponding upstream equipment to suppress defect recurrence.

[0035] In this embodiment of the invention, when the defect tracing report indicates that the defect source is a systemic equipment problem rather than a random disturbance, the real-time operating parameters of the equipment corresponding to the defect source are queried, and the optimal process parameter adjustment amount is calculated by combining the severity and trend of the defect data through preset expert rules or control models, and an optimized production instruction is generated and sent to the corresponding upstream equipment PLC (Programmable Logic Controller) via industrial Ethernet.

[0036] In one implementation of this invention, for example, continuous reports of appearance defect data indicate a thinner wall thickness at the top of the pipe (0° circumferential position) (obtained by analyzing the continuous negative deviation value of the macroscopic defect area), and the defect source is determined to be "uneven cooling." A command is then sent to the PLC of the cooling water circulation system to slightly increase the opening of spray valve No. 1, responsible for cooling the top area, by 5%. After this command is executed, the cooling effect at the top is enhanced, and the wall thickness tends to be more uniform. Subsequent inspections continuously monitor the wall thickness at this location. If the defect is eliminated, the current valve opening is maintained; if the adjustment is excessive, a reverse fine-tuning is performed, ultimately stabilizing the production process parameters dynamically within the optimal window. This fundamentally suppresses the continuous generation of black spot defects, achieving intelligent feedforward control.

[0037] Preferably, step S1 includes the following steps:

[0038] Step S11: After the plastic product shaping and cooling section, visible light cameras are deployed in a ring at 60-degree intervals around the center of the plastic product extrusion path along the normal plane of the plastic product production line. A laser projector is installed between every two adjacent cameras at an incident angle of 45° relative to the tangent of the product surface.

[0039] Step S12: Drive the laser projector to project a grating composed of alternating red and blue parallel micro-lines onto the surface of the moving plastic product, forming a projection grating field on the surface of the plastic product; wherein the width of the micro-lines is 50 to 100 µm.

[0040] Step S13: After the plastic product is fully inside the grating projection area, based on the reflection of the projection grating field on the surface of the plastic product, the visible light camera in the ring array is synchronously triggered to perform exposure acquisition and obtain a multi-view distortion image containing grating distortion information.

[0041] In this embodiment of the invention, the physical deployment location is chosen after the shaping cooling water tank and before the traction machine in the plastic product extrusion production line. Specifically, a customized ring bracket is installed on a normal plane perpendicular to the product extrusion path. Six high-frame-rate industrial visible light cameras are deployed in a ring at 60-degree intervals around the center of this ring bracket (theoretically coinciding with the geometric center of the product), ensuring their optical axes are precisely aligned with the center. Simultaneously, six line laser projectors are also installed between every two adjacent cameras, at angular positions of 30°, 90°, 150°, 210°, 270°, and 330°. The installation angle of each laser projector is precisely adjusted so that the laser plane it projects forms a 45° incident angle with the tangent to the surface of the product at that location.

[0042] In one implementation of this invention, before deployment, a laser collimator and a 3D calibration plate are used to precisely calibrate the entire detection assembly. The calibration process determines the precise spatial pose parameters (rotation matrix R and translation vector T) of each camera and laser projector relative to the world coordinate system (usually with the center of the ring support as the origin). These parameters are stored as device calibration data for use in subsequent 3D reconstruction steps.

[0043] It should be noted that choosing a 45° incident angle is a trade-off. It ensures that sufficiently clear reflective grating lines are formed on a smooth surface, while minimizing the risk of local overexposure caused by direct sunlight entering the camera due to specular reflection.

[0044] Specifically, the laser source uses a dual-wavelength laser diode, which can simultaneously or time-divisionally generate red (wavelength approximately 650nm) and blue (wavelength approximately 450nm) lasers. Through internal optical beam combining, the projected grating exhibits an alternating arrangement of red and blue colors. When projected onto the surface of the plastic product, these grating lines bend due to the curved shape of the product, forming a projected grating field covering the entire detection area. The micro-linewidth is controlled by adjusting the working distance between the laser and the product surface, as well as the focusing quality of the laser itself; the target width is set between 50 and 100µm.

[0045] In one implementation of this invention, the dual-color grating is designed to address the problem of low contrast in monochromatic plastic products (such as pure red or pure blue) due to the similarity of colors. For example, on red pipes, blue grating lines exhibit extremely high contrast, while red grating lines, although having lower contrast, can still serve as supplementary information or provide effective data in non-red areas. This complementary design ensures that at least one color grating can always be clearly identified on products of various colors.

[0046] In this embodiment of the invention, a photoelectric sensor installed at the entrance of the detection component detects whether the head of a plastic product has entered. When the photoelectric sensor detects the product's entry and continuously blocks it for more than a preset time (calculated based on the production line speed to ensure the product completely fills the entire detection field of view), a central synchronization controller begins generating a high-precision pulse trigger signal at a fixed frequency (e.g., 100Hz). This trigger signal is simultaneously sent via hardware circuitry to the external trigger pins of all six visible light cameras in the circular array. Upon receiving the rising edge of the trigger signal, each camera immediately performs a global shutter exposure, thereby capturing the raster distortion image of the plastic product surface from its respective viewpoint at the same microsecond interval. This set of six images acquired simultaneously constitutes a multi-view distortion image set.

[0047] In another implementation of this invention, the accuracy of synchronous triggering is crucial. Assuming the production line speed... =5m / s, camera frame rate =100Hz, then the distance the product moves between each frame is:

[0048] ;

[0049] Where: d represents inter-frame displacement; v represents production line speed (unit: m / s); f represents camera acquisition frame rate (unit: Hz). If the trigger delay between cameras is too large, for example, reaching 1 millisecond, then the product will have moved 5mm within 1 millisecond, which will cause serious errors in subsequent 3D reconstruction. Therefore, this invention adopts hardware synchronous triggering to ensure that the trigger delay is less than 10 microseconds, and the corresponding displacement error is less than 0.05mm.

[0050] Most importantly, acquiring multi-view distortion images can also be used for:

[0051] A linear LED light source with a 45° total reflection conical mirror fixed at the front end is installed along the product extrusion path in the plastic product production line as an internal light source.

[0052] Using 1 millisecond as the time unit, the internal light source is lit up at odd milliseconds and the infrared background light source on the outside of the pipe flashes at even milliseconds;

[0053] The shutter of the camera array is synchronized with the on / off state of the light source, and the transmission image is acquired in odd-numbered milliseconds and the contour image is acquired in even-numbered milliseconds, forming two sets of time-matched image data streams;

[0054] Transmission image groups and contour image groups from the same acquisition period are packaged to form a time-series data package containing two types of optical information to obtain multi-view distortion images.

[0055] In this embodiment of the invention, an innovative dual-light source design is employed to simultaneously inspect the inner and outer walls of plastic products. Specifically, a slender stainless steel probe with a diameter of only 5mm is fixed at the center of the inspection area and extends forward along the central axis of the product extrusion path, penetrating into the moving plastic tube. The probe integrates a row of high-brightness linear white LED chips, forming the internal light source. At the very tip of the probe, a precision-machined 45° total reflection conical mirror with a highly reflective dielectric film is installed. When the internal LEDs are lit, the light is axially incident on the surface of the conical mirror and uniformly reflected 360° outwards, thus forming a bright, uniform halo around the inner wall of the tube.

[0056] In this embodiment of the invention, a high-speed time-division multiplexing method is used to drive the internal and external light sources to avoid mutual interference between the two optical signals. A high-precision clock synchronization controller operates at a frequency of 1kHz, dividing time into consecutive 1-millisecond units. In odd-numbered milliseconds (e.g., timestamps of 1ms, 3ms, 5ms...), the controller sends a high-level signal to the driving circuit of the internal light source, illuminating the internal linear LED. In even-numbered milliseconds (e.g., timestamps of 2ms, 4ms, 6ms...), the controller sends a high-level signal to a ring of infrared LEDs (forming an infrared background light source) surrounding the tube, causing it to blink momentarily. This alternating "one light on, one light off" operating mode ensures that only one light source is working within any given millisecond.

[0057] In this embodiment of the invention, the triggering mode of the ring-deployed camera array is set to be strictly synchronized with the driving signal of the light source. In odd-numbered milliseconds, when the internal light source is illuminated, the clock synchronization controller simultaneously sends a trigger signal to all cameras, instructing them to perform exposure acquisition. At this time, since the light is emitted from inside the pipe and penetrates the pipe wall, the camera captures a transmission image. In this image, defects such as uneven pipe wall thickness, internal bubbles, and impurities are manifested as different areas of light and dark or light distortion. In even-numbered milliseconds, when the external infrared background light source flashes, the controller sends a trigger signal to all cameras again. At this time, the camera captures a contour image. In this image, the outer contour of the pipe presents a clear silhouette against a bright infrared background. Defects such as outer diameter deviation, surface pits, and scratches of the pipe directly cause changes in the contour line.

[0058] Preferably, in step S2, the three-dimensional geometry of the plastic product is reconstructed based on the multi-view distortion image, defect points are identified, and compared with a preset standard geometric model to label the defect type and obtain deviation point data, including:

[0059] Acquire device calibration data for the internal and external parameters of each visible light camera and the spatial pose of each laser projector;

[0060] Skeleton extraction is performed on each distorted grating line in the multi-view distortion image to obtain the pixel coordinate trajectory;

[0061] Based on pixel coordinate trajectory and device calibration data, the three-dimensional spatial position of each point on the surface of the plastic product on the distorted grating is calculated in reverse using the triangulation principle to obtain the three-dimensional point cloud of the surface.

[0062] Obtain the outer diameter of the pipe set in the plastic product production work order, and construct a standard geometric cylinder model with the same outer diameter;

[0063] Calculate the radial distance from each data point on the 3D point cloud to the surface of the standard geometric cylinder model to obtain the geometric deviation value, and calculate the gradient change rate of the encoded halo texture in its neighborhood to obtain the texture distortion value.

[0064] In this embodiment of the invention, before processing multi-view distortion images, pre-stored device calibration data is first loaded from a local configuration file. This data is generated by a calibration program during the system installation and debugging phase. Specifically, the calibration process uses a three-dimensional calibration object with a high-precision checkerboard pattern, which is placed within the detection area and images are taken from multiple different poses. By analyzing the pixel coordinates of the checkerboard corner points in the image and their known three-dimensional coordinates in the world coordinate system, the intrinsic parameter matrix K (including focal length and principal point coordinates) and distortion coefficients (radial and tangential distortion) of each camera are calculated using the Zhang Zhengyou calibration method, as well as the extrinsic parameter matrix relative to the world coordinate system (with the center of the ring support as the origin). | (Rotation matrix) Translation vector Simultaneously, using structural cursor positioning technology, the plane equation of the light plane projected by each laser projector in the world coordinate system is determined.

[0065] In this embodiment of the invention, each received multi-view distortion image undergoes preprocessing, including noise reduction and enhancement. Then, for the red and blue dual-color grating lines in the image, processing is performed on their respective color channels. The Steger algorithm or morphological thinning algorithm is used to extract the centerline of the grating stripes, i.e., skeleton extraction. This algorithm accurately locates the central ridge position of the stripes by calculating the second derivative (Hessian matrix) of the image's grayscale intensity, achieving sub-pixel accuracy. The extracted result is a series of ordered pixel coordinates for each distorted grating line in the image. These coordinate sequences together constitute the pixel coordinate trajectory of the grating line.

[0066] In this embodiment of the invention, for each pixel point on the pixel coordinate trajectory in (This is the index of a point on the grating line). Perform the following calculation to obtain its three-dimensional coordinates in the world coordinate system. First, based on the camera to which that pixel belongs. The intrinsic and extrinsic parameters can be used to determine the equation of a spatial ray originating from the camera's optical center and passing through that pixel. Simultaneously, this pixel originates from the... The first laser projector projects the... A grating line. The equation of the spatial light plane corresponding to this grating line can be found in the equipment calibration data. Three-dimensional spatial point. This is the unique intersection point between the spatial ray and the spatial light plane. By solving the system of equations consisting of these two equations, the three-dimensional coordinates of this point can be obtained. Repeating this process for all pixels on all grating lines captured by all cameras will yield a high-density three-dimensional point cloud covering the entire circumference of the product.

[0067] In this embodiment of the invention, production order information for the current production batch is automatically obtained through an interface with the factory's Manufacturing Execution System (MES). This work order explicitly includes the specifications of the plastic pipes to be produced, such as "Material Code: PE-T50-B, Outer Diameter: 50.0mm, Wall Thickness: 3.0mm". The key parameter "Outer Diameter" is extracted, and a mathematically standard geometric cylinder model is constructed in memory based on this. The mathematical expression of this model is:

[0068] ;

[0069] in: This represents half of the standard outer diameter obtained from the production work order, i.e., the standard radius. It is the cross-sectional coordinate of any point in a coordinate system with the center line of pipe extrusion as the Z-axis.

[0070] In one implementation of this invention, if the work order specifies an outer diameter of 50.0 mm, then =25.0mm. The standard geometric cylinder model constructed is an infinitely long cylinder with a radius of 25.0mm and an axis coinciding with the Z-axis.

[0071] It should be noted that if the material being produced is not a round tube, but some other irregular shape, the corresponding standard 3D model will be loaded from the CAD file as the reference.

[0072] In this embodiment of the invention, for each data point in the surface three-dimensional point cloud Perform two calculations: Geometric deviation calculation: First, calculate the radial distance of the point in the XY plane. Then, calculate its distance from the standard radius. The difference is used to obtain the geometric deviation value. Specifically, the calculation formula is as follows:

[0073] ;

[0074] in: This is the geometric deviation value (unit: mm). Let P be the coordinates of point P in the XY plane. For the standard radius, the texture distortion value is calculated as follows: Return to this point. P The corresponding pixel position in the original multi-view distortion image. Then, define a N × N Calculate the gradient of image grayscale values ​​within a neighborhood window (e.g., 5×5). Texture distortion value. It is defined as the average gradient magnitude within this neighborhood. A smooth, defect-free surface has a clear and parallel raster texture with a gentle gradient change; while a surface with scratches or pits will cause the raster texture to be sharply distorted or interrupted, resulting in a larger gradient value.

[0075] In another implementation of this invention, a point cloud data point is assumed. The coordinates are (24.8, 0.1, 150.3), and the standard radius is... It is 25.0 mm. Its geometric deviation value is... Meanwhile, the average gradient magnitude calculated in its corresponding pixel neighborhood is 35.6 (gray level / pixel), while the average gradient magnitude in normal areas is usually around 10, indicating that there is significant texture distortion at this location.

[0076] Preferably, step S2, which involves reconstructing the three-dimensional geometry of the plastic product based on the multi-view distortion image, identifying defect points, comparing it with a preset standard geometric model, and labeling the defect type to obtain deviation point data, further includes:

[0077] Get the material type of the current batch of plastic products;

[0078] If the material type is high reflective PVC, then when the absolute value of the geometric deviation value is greater than the preset first geometric deviation threshold or the texture distortion value is greater than 15% of the preset distortion, the point is determined to be a deviation point.

[0079] If the material type is matte PE, then when the absolute value of the geometric deviation is greater than the preset second geometric deviation threshold or the texture distortion value is greater than 5% of the preset distortion, the point is determined to be a deviation point.

[0080] Wherein, the preset first geometric deviation threshold is less than the preset second geometric deviation threshold;

[0081] Identify all defect type labels that are determined to be deviation points;

[0082] Record the location of the deviation point, the defect type label, and the specific value to obtain the deviation point data.

[0083] In this embodiment of the invention, before executing the defect determination logic, the material type of the plastic product currently being produced is first obtained from the production work order or MES system. This information is part of the production plan and is usually in the form of a material code or a specific material name (such as "PVC-U", "HDPE100"). This information is parsed and mapped to an internally predefined material category library; for example, "PVC-U high white" is mapped to "high reflective PVC material", and "HDPE100 black" is mapped to "matte PE material". The purpose of this step is to load detection parameters that match the optical properties of the specific material.

[0084] It should be noted that these preset thresholds were obtained through statistical analysis of a large number of known qualified and defective products. For example, the first geometric deviation threshold... Second geometric deviation threshold It is determined by measuring the micro-roughness and allowable process variation range of standard samples of different materials, combined with product quality standards (such as ISO 4427). Generally, highly reflective materials have smoother surfaces, making minute geometric imperfections more noticeable and affecting aesthetics; therefore, their threshold is more stringent. < The baseline value for texture distortion. This is obtained by calculating the average gradient of a large number of defect-free standard sample images.

[0085] In one implementation of this invention, it is assumed that the current material is determined to be "highly reflective PVC material". The following parameters are loaded: First geometric deviation threshold. =0.08mm, texture distortion baseline value =12.0 (grayscale levels / pixel). For any data point calculated in the previous step, it is determined to be a deviation point if it meets any of the following conditions: 1, | |> |; 2. > ×(1+15%); Specifically, if the geometric deviation value of a point is... =−0.09mm, since |−0.09|>0.08, this point is determined to be a deviation point. Alternatively, the geometric deviation value of another point... =0.05mm did not exceed the threshold, but its texture distortion value =14.0. Since 14.0 > 12.0 × 1.15 = 13.8, this point is also judged as a deviation point.

[0086] In another implementation of this invention, if the current material is "matte PE material", the loaded parameter is: the second geometric deviation threshold. =0.12mm, texture distortion baseline value =18.0 (Matte surfaces have a rougher texture, so the baseline value is higher). The judgment condition becomes: 1, | |> |; 2. > ×(1+5%).

[0087] In this embodiment of the invention, for each point determined to be a deviation point, a defect type label is initially assigned based on the conditions that triggered the determination. If a point is mainly due to geometric deviation values... It was judged to exceed the threshold, according to The sign is used to indicate the sign. If >0, labeled "raised"; if A value less than 0 is labeled "depression". If a point's depression is primarily due to texture distortion... If the value exceeds the threshold, it is judged as a scratch or surface stain, which usually means that the geometric deformation is not obvious but the surface texture is damaged. If both indicators exceed the threshold, the geometric deviation value is used first for labeling, and the texture information is used as an auxiliary feature.

[0088] In this embodiment of the invention, the information of all points identified as deviation points is stored in a structured manner. Each record contains all relevant information for that point, forming a deviation point data list. Specifically, the structure of a deviation point data is as follows: {coordinates: Defect tags: dent, geometric deviation: -0.198, texture distortion: 35.6}.

[0089] Preferably, the defect type labels that identify all deviation points include:

[0090] Set the cluster radius and the minimum number of neighborhood points; the cluster radius is set to 0.5% to 1.5% of the pipe's outer diameter, and the minimum number of neighborhood points is set to 1% to 3% of the total number of deviation points.

[0091] Cluster analysis is performed on the location coordinates of the deviation points based on the cluster radius and the minimum number of neighborhood points to generate several mutually separated deviation point clusters;

[0092] Calculate the area of ​​the point cluster of the smallest bounding rectangle covered by each deviation point cluster;

[0093] Each deviation point cluster is classified and judged. If the area of ​​the corresponding point cluster is less than the preset area threshold, the deviation point cluster is classified as a local defect area; otherwise, it is classified as a macro defect area.

[0094] In this embodiment of the invention, before performing cluster analysis on the deviation point data, two key parameters need to be set: cluster radius and cluster radius. and minimum neighborhood number These two parameters are used in the DBSCAN clustering method, which aims to aggregate spatially adjacent deviation points into meaningful defect regions.

[0095] It should be noted that these parameters are not fixed, but rather related to the dimensions of the plastic product being inspected and the minimum defect size to be detected. This is based on the outer diameter of the pipe in the production order. Dynamically calculate cluster radius Specifically, the calculation formula is as follows:

[0096] ;

[0097] in: Cluster radius (unit: mm); The outer diameter of the pipe currently being produced (unit: mm); This is a percentage coefficient, ranging from 0.5% to 1.5%, preset in the process parameter library according to the detection accuracy requirements. Minimum neighborhood points. The total number of deviation points detected in the current frame. Correlation is used to filter out isolated noise points. Specifically, its calculation formula is:

[0098] ;

[0099] in: The minimum number of neighborhood points (unitless, rounded down). This represents the total number of points in the deviation point data list in the current frame. It is a percentage coefficient, with a value ranging from 1% to 3%, and is also preset in the process parameter library.

[0100] In one implementation of this invention, it is assumed that the outer diameter of the pipe is... =50mm, set coefficient =1.0%, then the cluster radius is... =50 × 1.0% = 0.5 mm. If the current frame detects a total of... =800 deviation points, set coefficient If the value is 2%, then the minimum number of neighborhood points is... =⌈800×2%⌉=⌈16⌉=16.

[0101] In this embodiment of the invention, the three-dimensional position coordinates of all deviation points generated in the previous frame are... As input, and using the cluster radius and minimum neighbor number set in the previous step, the DBSCAN clustering operation is performed. This method iterates through all points; if a point... The number of points contained within the radius neighborhood (including itself) is greater than or equal to If a point is found to be a core point, then that point is considered a core point. The clustering process starts from any core point and recursively applies this process to all points whose density is reachable (i.e., points within its range). Points within the same neighborhood are merged into the same cluster. This process continues until all points have been visited. Ultimately, several separate clusters of deviation points are output, each representing an independent, physically contiguous defect region. Deviation points that fail to be assigned to any cluster are considered noise and discarded.

[0102] In this embodiment of the invention, for each generated cluster of deviation points, it is necessary to evaluate the size it occupies on the surface of the workpiece. Since the workpiece is a curved surface, the three-dimensional coordinates of all points in the cluster are first projected onto an unfolded two-dimensional plane. The coordinate system of this unfolded plane is (circumferential angle). axial distance Specifically, the conversion formula is:

[0103] ;

[0104] ;

[0105] in: These are the three-dimensional coordinates of the deviation point; It is a two-parameter arctangent function that can correctly handle angles in all quadrants. After obtaining the two-dimensional projected coordinates of all points, the rotating caliper algorithm is used to calculate the minimum bounding rectangle of the point set. Then, the length and width of the rectangle are multiplied to obtain the area of ​​the point cluster of the deviation point cluster. .

[0106] In this embodiment of the invention, the area of ​​each point cluster calculated in the previous step is... With a preset area threshold By making comparisons, the nature of the defects can be distinguished.

[0107] It should be noted that the area threshold It is a key process parameter that defines the boundary between local small defects and macroscopic large defects. Its value is set according to product quality standards and typical defect sizes.

[0108] In another implementation of this invention, a preset area threshold is assumed. =5.0mm². Traverse all deviation point clusters: if the cluster area of ​​a point cluster is 5.0mm². =1.2mm², since 1.2 < 5.0, this cluster is classified as a local defect area and sent to the subsequent microstructure analysis process; if the area of ​​another cluster is... =35.7mm², since 35.7≥5.0, this cluster is classified as a macroscopic defect area and sent to the subsequent macroscopic deformation analysis process.

[0109] Preferably, the defect type label for identifying all defects determined to be deviation points also includes:

[0110] Extract the deviation values ​​of all points within the local defect area and calculate the gradient vector on the two-dimensional unfolded plane to generate the gradient field;

[0111] Calculate the standard deviation of the angles of all gradient vector directions in the gradient field. If the standard deviation of the angles is less than the preset angle threshold, the shape of the local defect area is initially determined to be a pit or a protrusion, and a preliminary shape judgment is generated.

[0112] Based on the initial morphological assessment, the deviation point is labeled with a defect type label such as scratch, pit, or crater.

[0113] In this embodiment of the invention, for each cluster of deviation points classified as a local defect region, a two-dimensional deviation value matrix representing the geometric shape of that region is first constructed. Specifically, this region is plotted in an unfolded two-dimensional plane (circumferential angle). axial distance The grid is constructed on the grid, and the average geometric deviation value of the deviation points within each grid is used. The grid is filled to form a grayscale image, where the grayscale values ​​represent the deviation values. Then, the Sobel operator or a similar gradient operator is applied to this two-dimensional deviation matrix to calculate the gradient for each pixel. Each gradient contains two components: the gradient magnitude (representing the drasticness of the deviation change) and the gradient direction (representing the direction of the fastest deviation change). All these gradient vectors together constitute the gradient field of the local defect region.

[0114] In this embodiment of the invention, to distinguish defects of different shapes, the distribution characteristics of all gradient vector directions in the gradient field are analyzed. A defect with obvious directionality (such as a scratch) will have a highly consistent gradient direction, while a point-like or surface-like defect (such as a pit or crater) will have its gradient direction diverge from the center outwards, with a more discrete directional distribution. The standard deviation of the angles of all gradient directions in the gradient field is calculated. To quantify this directional consistency, the specific calculation formula is as follows:

[0115] ;

[0116] in: The standard deviation of the gradient direction (in degrees); This represents the total number of gradient vectors in the gradient field. For the first The direction angles of the gradient vectors; This is the average of all direction angles. Then, the calculated... With a preset angle threshold Compare them.

[0117] It should be noted that the angle threshold These are empirical values ​​obtained through gradient field analysis of a large number of known defect samples (such as standard scratches and standard pits), used to distinguish between linear and non-linear defects.

[0118] In another implementation of this invention: for areas initially identified as "linear defects," the final defect type label is directly determined as "scratches." This is because linear geometric deviations with consistent gradient directions are typical characteristics of scratches. For areas initially identified as "point / area defects," further differentiation is required. The system calculates the average and standard deviation of all geometric deviation values ​​within the area. If the standard deviation is large, it indicates significant fluctuations in deviation values ​​within the area, with large differences between the center and edge points; in this case, the defect type label is determined as "pockmarks" or "sharp pits / protrusions." If the standard deviation is small, it indicates a gentle depression or protrusion; in this case, the defect type label is determined as "smooth pits" or "bubbles."

[0119] Preferably, the defect type label for identifying all defects determined to be deviation points also includes:

[0120] Extract the deviation value sequence along the circumference of the plastic product within the macroscopic defect area;

[0121] The ellipticity value is calculated based on the deviation value sequence. If the ellipticity value is greater than the preset ellipticity threshold, the deviation point is marked as cross-sectional deformation; otherwise, it is marked as uneven wall thickness, thus obtaining the defect type label for the macroscopic defect area.

[0122] In this embodiment of the invention, for each cluster of deviation points classified as a macroscopic defect area, the aim is to analyze its overall geometric deformation pattern. Since macroscopic defects typically affect the entire or most of the product cross-section, the focus is on their variation pattern in the circumferential direction. Specifically, taking the cross-section at the Z-axis position where the macroscopic defect area is located as the analysis object, the cross-section is sampled along the circumferential direction at fixed angular intervals (e.g., 1 degree), for a total of 360 points. For each sampling angle, the average value of the geometric deviation values ​​of the deviation points near that angle is extracted. In this way, a one-dimensional array containing 360 deviation values ​​arranged in angular order is obtained, and this array is the deviation value sequence of the cross-section.

[0123] In this embodiment of the invention, the waveform characteristics of the deviation value sequence directly reflect the deformation pattern of the cross section. A typical cross section deformation is ellipticization, in which the deviation value sequence exhibits a distinct sine or cosine waveform with a period of 180 degrees (i.e., two peaks and two troughs appear on the circumference). To quantify this characteristic, a Fourier transform (FFT) is performed on the deviation value sequence. Specifically, the discrete Fourier transform of the sequence is calculated, with particular attention paid to the amplitude of its second harmonic component. The second harmonic corresponds precisely to the component with a period of 180 degrees, and its amplitude directly reflects the severity of the cross section ellipticization. The amplitude of this second harmonic is defined as the ellipticity value of the cross section.

[0124] It should be noted that the ellipticity threshold is set based on the allowable tolerance for out-of-roundness in the product standard. For example, if the standard stipulates that the difference between the maximum and minimum outer diameter of the pipe must not exceed 1.5% of the nominal outer diameter, then the ellipticity threshold can be set to half of that difference. Cross-sectional deformation (ellipticization): This manifests as a systematic deformation of the entire profile, and the second harmonic component of its deviation value sequence will be very significant. Uneven wall thickness: This usually manifests as local or asymmetrical profile deviations, and the energy of its deviation value sequence is distributed across other harmonic orders, or it may not exhibit any regularity at all; therefore, its second harmonic component will be relatively small.

[0125] Preferably, step S3 includes the following steps:

[0126] Step S31: Establish a sliding time window, with the window length set to a time span of 5 to 10 seconds during production line operation. Correlate the deviation point data within the sliding time window to obtain the defect trajectory.

[0127] Step S32: If the defect trajectory is linear, the defect source is determined to be a fixing scratch on the extrusion die or the shaping sleeve;

[0128] Step S33: If the defect trajectory is periodic, compare the time period of the defect trajectory with the rotation period of the rotating parts on the production line to determine the defect source.

[0129] Step S34: Use the defect type label, spatial location, and defect source as appearance defect data.

[0130] In this embodiment of the invention, to analyze the continuity characteristics of defects along the longitudinal direction of the workpiece, a sliding time window is maintained in memory. This window is a first-in, first-out (FIFO) queue used to cache all clusters of deviation points detected within a recent period. The time span of the window is a configurable parameter, typically set to 5 to 10 seconds, to ensure that a sufficiently long workpiece length can be observed to effectively identify the distribution pattern of defects. A nearest-neighbor matching-based tracking algorithm is used to correlate clusters of deviation points detected in two consecutive frames within the sliding time window. If the first... A cluster of deviation points in a frame With the A cluster of deviation points in a frame If points are highly similar in characteristics such as spatial location, area, and average deviation, they are considered to be observations of the same physical defect at different times, and these observations are then linked together. By repeating this process throughout the entire sliding time window, all clusters of deviation points belonging to the same physical defect can be linked into a complete defect trajectory.

[0131] In this embodiment of the invention, after obtaining the defect trajectory, its geometric shape on the unfolded two-dimensional surface map (circumferential angle, axial distance) is analyzed. Specifically, linear regression analysis is performed on the coordinates of all points in the defect trajectory to calculate its best-fit line and correlation coefficient. If the correlation coefficient is greater than a preset linearity threshold (e.g., 0.98), and the slope of the fitted line is close to zero (i.e., the defect basically remains at the same circumferential angle), the defect trajectory is determined to be in a "linear" mode.

[0132] It should be noted that, in order to determine the source of the defect, the circumference or rotation period information of all rotating parts on the production line is retrieved from the equipment parameter database. These parts include the tracks or rollers of the traction machine, the meter counting wheel, etc.

[0133] In another implementation of this invention, a periodic defect trajectory with a period of 314.1 mm was detected. A query of the equipment parameter database revealed that the circumference of the traction machine's drive wheel is 314.2 mm. Since the difference is highly consistent within the allowable error range, it was determined that the periodic defect was caused by foreign matter adhering to the traction machine's drive wheel or surface damage there, leaving a mark each time it rotates and contacts the workpiece. Therefore, the defect source was identified as "traction machine drive wheel abnormality".

[0134] Specifically, an example of the structure of a visual defect data is as follows: {Defect ID: TRJ_015, Defect type label: Scratch, Spatial location: {Start Z: 105.2m, End Z: 112.8m, Circumferential angle: 178°}, Trajectory mode: Linear, Defect source: Scratch at the exit of the shaping sleeve, Severity level: Medium}.

[0135] Preferably, making quality control decisions for plastic products based on appearance defect data also includes automatic rejection operations:

[0136] The trigger delay for the rejection action is calculated based on the location and length of the defects in the appearance defect data.

[0137] After the delay, an instruction is sent to the inkjet marking machine downstream of the plastic product production line to print a quality failure mark on the surface of the defective section.

[0138] Alternatively, a command can be sent to the pneumatic rejection baffle downstream of the plastic product production line to remove defective plastic products from the main production line to the waste area as they pass through. Once the rejection action is completed, the baffle is immediately retracted to restore normal production.

[0139] In this embodiment of the invention, when a visual defect data is generated and the quality rule base determines that it needs to be handled (marked or removed), a trigger delay calculation program is immediately initiated. This program aims to ensure that the handling action can be accurately applied to the physical segment where the defect is located.

[0140] In one implementation of this invention, assume the downstream inkjet marking machine is installed 15.0 meters away from the detection system. A defect requiring marking is detected, with its appearance defect data recording a starting position of 10.2 meters. The production line speed at that time is 1.2 meters per second. Then, a delay calculation is triggered. =4.0 seconds.

[0141] In this embodiment of the invention, this operation is suitable for scenarios with low defect levels, where only marking is required for subsequent manual sorting or traceability. When the trigger delay countdown calculated in the previous step ends, the main controller will immediately send a printing command to the controller of the inkjet printer via industrial Ethernet or RS-485 bus.

[0142] In one implementation of this invention, continuing the previous example, after a 4.0-second delay, an instruction is immediately sent. Upon receiving the instruction, the marking machine will print a conspicuous mark of "NG-01" (indicating non-conformity-1) approximately 0.5 meters long on the surface of the moving pipe.

[0143] In another implementation of this invention, a pneumatic rejection baffle is installed 20.0 meters away from the detection system. A severe "section deformation" defect is detected, starting at 12.5 meters and measuring 2.0 meters in length. The production line speed is 1.5 m / s, the trigger delay is (20.0 − 12.5) / 1.5 = 5.0 seconds, and the rejection action duration is 2.0 / 1.5 ≈ 1.333 seconds. When the 5.0-second delay is reached, a high-level signal is sent to the solenoid valve controlling the pneumatic rejection baffle. The solenoid valve is energized, driving the cylinder to actuate, and a baffle quickly extends, pushing the 2-meter-long defective pipe from the main conveyor track into the adjacent waste collection bin. This high-level signal is precisely maintained for 1.333 seconds and then immediately returned to a low level. The solenoid valve is de-energized, and the baffle quickly retracts under the action of a spring or reverse air pressure. The entire rejection action is completed without interrupting the continuous operation of the production line, ensuring that subsequent qualified products can pass smoothly.

[0144] Preferably, the image-based method for detecting and identifying appearance defects in plastic products further includes an online adaptive illumination adjustment operation:

[0145] After each capture of a multi-view distortion image, grayscale analysis is immediately performed on the light-dark boundary region of the red-blue raster stripes in the image, and the difference between the grayscale values ​​of the light and dark areas is calculated as the real-time contrast value.

[0146] The real-time contrast value is compared with the preset optimal contrast range. If the real-time contrast value of three consecutive frames is lower than the lower limit of the preset optimal contrast range, the driving current of the corresponding laser projector is increased; if it is higher than the upper limit of the preset optimal contrast range, the driving current is decreased until it falls into the preset optimal contrast range.

[0147] In this embodiment of the invention, to address the problem of unstable illumination intensity caused by changes in ambient temperature during production, laser temperature rise, or slight fluctuations in the gloss of plastic products, a rapid illumination quality evaluation program is immediately initiated after acquiring each frame of multi-view distortion image. Specifically, instead of analyzing the entire image, only a preset, typically defect-free region of interest (ROI, e.g., 100×100 pixels) is selected at the center of the image. Within this ROI, the light-dark boundary lines of the red-blue grating stripes are found using an edge detection algorithm. Then, on both sides of these boundary lines, the average grayscale values ​​of the "bright area" (center of the grating stripes) and the "dark area" (between the stripes) are extracted, and the real-time contrast value is defined as the difference between these two values.

[0148] In one implementation of this invention, assuming three frames of images are continuously acquired, the real-time contrast values ​​calculated from the images acquired by camera number 3 are 115, 112, and 110, respectively. Since these three values ​​are all continuously lower than the lower limit of the optimal contrast range of 120, it is determined that the light intensity of the laser projector corresponding to camera number 3 is insufficient. At this time, a command to increase the drive current is sent to the digital drive controller of the laser projector.

[0149] In another implementation of this invention, if the real-time contrast values ​​of three consecutive frames of images acquired from camera 5 are 185, 188, and 190, all exceeding the upper limit of 180, it indicates that the illumination is too strong. Similar logic is executed to reduce the drive current, and the final instruction is to reduce the current. This closed-loop adjustment process continues until the image contrast of all cameras stabilizes within the optimal contrast range, thereby ensuring that the entire detection system can obtain high-quality, consistent raw image data under different operating conditions.

[0150] Most importantly, the operation of extracting the sub-pixel coordinates of the light-dark boundary line is as follows:

[0151] Scan the image in the multi-view light and shadow frame line by line along the direction perpendicular to the pipe axis, find the pixel with the largest absolute value of gray level gradient in each line, and use it as a rough boundary point;

[0152] Centered on the rough boundary point, select a total of 3 pixels in front of and behind it along its gradient direction and their gradient values;

[0153] Parabolic interpolation is used to fit the three pixels to calculate the sub-pixel coordinates of the gradient peak, and these sub-pixel coordinates are used as the precise boundary point positions of the row.

[0154] In one implementation of this invention, assume that the 200th row of an image is being scanned. The grayscale value sequence of the pixels in this row is “...240, 242, 238, 190, 55, 25, 28, 30…”. The calculated gradient sequence (the absolute value of the difference between adjacent pixels) is “...|242-240|, |238-242|, |190-238|, |55-190|, |25-55|, |28-25|…”, or “...2, 4, 48, 135, 30, 3…”. In this row, the gradient value 135 is the largest, occurring between two pixels whose grayscale value jumps from 190 to 55. One of these two pixels (e.g., the starting point of the gradient calculation, i.e., the pixel with a grayscale value of 190) is selected as the coarse boundary point of the 200th row. This operation is performed on both the left and right boundaries of the image.

[0155] In this embodiment of the invention, after finding the coarse boundary point, the fine localization stage begins. The true boundary (i.e., the true peak of the gradient) is located near this coarse boundary point. To accurately fit the position of this peak using mathematical methods, data from the peak point and its two sides needs to be collected. Specifically, taking the coarse boundary point found in step 1 as the center, along its gradient direction (for the edge of the contour image, the gradient direction is basically perpendicular to the edge, i.e., along the scan line direction), a total of three pixels, including this point, are selected. Then, the grayscale gradient values ​​of these three pixels are extracted.

[0156] Specifically, the precise x-coordinates (i.e., sub-pixel coordinates) of the parabola's vertex (i.e., the gradient peak) can be calculated using a simple, closed-form solution that doesn't involve complex iterations. This calculation will result in a floating-point number representing the precise location of the gradient peak relative to these three pixels. For example, the calculated sub-pixel coordinates are 105.38. This means that the most precise boundary location for this row is not at the center of the 105th pixel, but rather to its right, 0.38 pixels away from its center.

[0157] Therefore, the embodiments should be considered as exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of the equivalents of the application are intended to be included within the invention.

[0158] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features of the invention herein.

Claims

1. A method for detecting and identifying appearance defects of plastic products based on image technology, characterized in that, Applied to a plastic product production line, the method comprises the following steps: Step S1: deploying a detection assembly along the normal plane annular part of the plastic product extrusion path, projecting a grating composed of double-color micro lines onto the surface of the plastic product, and synchronously triggering the camera to collect multi-view distortion images containing grating distortion information; Step S1 comprises the following steps: Step S11: after the plastic product is cooled and shaped, visible light cameras are arranged in a 60-degree equidistant annular manner along the normal plane of the product extrusion path in the plastic product production line, with the center of the circle as the center, and a laser projector is installed between every two adjacent cameras at an incident angle of 45° with respect to the tangent of the product surface; Step S12: driving the laser projector to project a grating composed of parallel micro lines of red and blue alternating colors onto the moving surface of the plastic product, forming a projected grating field on the surface of the plastic product; wherein the width of the micro line is 50 to 100µm; Step S13: after the plastic product completely enters the grating projection area, based on the reflection of the projected grating field on the surface of the plastic product, the visible light cameras in the annular array are synchronously triggered to expose and collect, and multi-view distortion images containing grating distortion information are obtained; Step S2: reconstructing the three-dimensional geometry of the plastic product based on the multi-view distortion images and identifying the defect points, and comparing with the preset standard geometric model to label the defect type to obtain the deviation point data; Step S3: tracking the defect trajectory of the deviation point data on the surface of the plastic product within the defined production line running period, and determining the appearance defect data by identifying the distribution mode and periodicity of the defect on the product surface; Step S3 comprises the following steps: Step S31: establishing a sliding time window, the window length is set to a time span of 5 to 10 seconds of production line running, associating the deviation point data in the sliding time window to obtain the defect trajectory; Step S32: if the defect trajectory is linear, it is determined that the defect source is a fixed scratch of the extrusion die or the shaping sleeve; Step S33: if the defect trajectory is periodic, the time period of the defect trajectory is compared with the rotation period of the rotating components on the production line to determine the defect source; Step S34: taking the defect type label, spatial position and defect source as the appearance defect data; Step S4: executing plastic product quality control decisions based on the appearance defect data; Step S5: based on the defect source in the appearance defect data, sending optimization production instructions to the corresponding upstream equipment to suppress defect reproduction.

2. The method of claim 1, wherein the method further comprises: In step S2, the three-dimensional geometry of the plastic product is reconstructed based on the multi-view distortion images and the defect points are identified, and compared with the preset standard geometric model to label the defect type to obtain the deviation point data, which comprises: Obtaining device calibration data of the internal and external parameters of each visible light camera and the spatial pose of each laser projector; Skeleton extraction is performed on each distorted grating line in the multi-view distortion image to obtain a pixel coordinate trajectory; Based on the pixel coordinate trajectory and the device calibration data, the three-dimensional spatial positions of each point on the surface of the plastic product on the distorted grating are reversely calculated through the principle of triangulation to obtain the surface three-dimensional point cloud; Obtaining the set pipe outer diameter in the plastic product production work order, and constructing a standard geometric cylinder model with the same outer diameter; The radial distance of each data point on the surface three-dimensional point cloud to the surface of the standard geometric cylinder model is calculated to obtain a geometric deviation value, and the gradient change rate of the coded light ring texture in its neighborhood is calculated to obtain a texture distortion value.

3. The method of claim 2, wherein the method further comprises: The step S2 of reconstructing the three-dimensional geometry of the plastic product based on the multi-view distorted images and identifying the defect points, and comparing with the preset standard geometric model to label the defect types to obtain the deviation point data further comprises: Obtaining the material type of the current batch of plastic products; If the material type is high-reflective PVC material, when the absolute value of the geometric deviation value is greater than the preset first geometric deviation threshold or the texture distortion value is greater than 15% of the preset distortion, the point is determined as a deviation point; If the material type is matte PE material, when the absolute value of the geometric deviation value is greater than the preset second geometric deviation threshold or the texture distortion value is greater than 5% of the preset distortion, the point is determined as a deviation point; Wherein, the preset first geometric deviation threshold is smaller than the preset second geometric deviation threshold; Identifying the defect type labels of all the points determined as deviation points; Recording the position, defect type label and specific value of the deviation points to obtain the deviation point data.

4. The method of claim 3, wherein the method further comprises: Identifying the defect type labels of all the points determined as deviation points comprises: Setting the clustering radius and the minimum number of neighborhood points; wherein the clustering radius is 0.5% to 1.5% of the outer diameter of the pipe, and the minimum number of neighborhood points is 1% to 3% of the total number of deviation points; According to the clustering radius and the minimum number of neighborhood points, the position coordinates of the deviation points are clustered and analyzed to generate several mutually separated deviation point clusters; Calculating the point cluster area of the smallest circumscribed rectangle covered by each deviation point cluster; Classifying and identifying each deviation point cluster, if the corresponding point cluster area is less than the preset area threshold, the deviation point cluster is classified as a local defect area; otherwise, it is classified as a macro defect area.

5. The method of claim 4, wherein the method further comprises: Identifying the defect type labels of all the points determined as deviation points further comprises: Extracting the deviation values of all points in the local defect area and calculating the gradient vectors on the two-dimensional development plane to generate a gradient field; Calculating the angle standard deviation of all gradient vector directions in the gradient field, if the angle standard deviation is less than the preset angle threshold, the morphology of the local defect area is preliminarily determined as a pit or a protrusion to generate a preliminary morphology determination; Based on the result of the preliminary morphology determination, the deviation point is labeled with a defect type label of scratch, pimple or dimple.

6. The method of claim 4, wherein the method further comprises: Identifying the defect type labels of all the points determined as deviation points further comprises: Extracting the deviation value sequence along the circumferential direction of the plastic product in the macro defect area; According to the deviation value sequence, an ellipticity value is calculated, if the ellipticity value is greater than the preset ellipticity threshold, the deviation point is labeled as cross-section deformation, otherwise it is labeled as uneven wall thickness, to obtain the defect type label of the macro defect area.

7. The method of claim 1, wherein the method further comprises: The plastic product quality control decision based on the appearance defect data further comprises an automatic rejection operation: According to the defect position and length in the appearance defect data, the trigger delay of the rejection action is calculated; After the delay arrives, an instruction is sent to the inkjet coding machine downstream of the plastic product production line to spray a quality unqualified mark on the surface of the defect section; Or, send instructions to the pneumatic rejection baffle downstream of the plastic product production line, and reject the defective plastic product from the main production line to the waste area when it passes through, and immediately retract the baffle to restore the normal production state after the rejection action is completed.

8. The method of claim 1, wherein the method further comprises: The image-based plastic product appearance defect detection and identification method further includes an online adaptive adjustment of illumination operation: Immediately after capturing each multi-view distortion image, the light and dark boundary area of the red and blue grating fringe in the image is analyzed for gray scale, and the difference between the light and dark gray scale values is calculated as a real-time contrast value; The real-time contrast value is compared with the preset optimal contrast range, if the real-time contrast value of the continuous 3 frames of images is lower than the lower limit value in the preset optimal contrast range, the driving current of the corresponding laser projector is increased, if it is higher than the upper limit value in the preset optimal contrast range, the driving current is reduced until it falls within the preset optimal contrast range.

Citation Information

Patent Citations

  • 3-d printing of bone grafts

    CN108859127A

  • Method and system for detecting sealing leakage of container on line

    CN117405327A