A carton multi-defect online detection system based on machine vision

CN122882458APending Publication Date: 2026-10-09GUANGDONG RONGSEN PACKAGING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611153483.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-31
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0005]针对现有技术的不足,本发明提供了一种基于机器视觉的纸箱多缺陷在线检测系统,解决了现有的机器视觉技术在检测表面涂覆透明涂层的瓦楞纸箱时,透明涂层表面的镜面反射与底层基材的漫反射发生光强叠加,造成光场信息串扰与形貌重构失真;此外,瓦楞纸箱表面的局部翘曲会改变测量点处的实际入射角,导致采用固定参数的偏振分离方法在计算权重时出现偏差,致使涂层厚度测量不准,难以有效区分气泡、欠涂及涂层下基材损伤等不同类型的缺陷的问题

Benefits of technology

[0028]1、本发明通过对初始三维点云进行局部曲面拟合获取外法向量,从而计算出测量点处的局部入射角,并结合菲涅尔反射光场模型计算理论线偏振度参考值以修正光强分离权重。该特征使得系统能够根据瓦楞纸箱表面的实际起伏状态自适应调整计算参数,消除了因纸箱表面局部翘曲导致入射角改变所引起的光强分离偏差,提高了复杂表面形态下光强分离与形貌重构的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122882458A_ABST
    Figure CN122882458A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of machine vision and industrial online detection, and discloses a carton multi-defect online detection system based on machine vision, which is applied to corrugated cartons with transparent coating on surfaces. The system collects a polarization image of the surface of the carton to obtain a measurement linear polarization degree, carries out initial light intensity separation and reconstructs an initial three-dimensional point cloud; calculates a local incident angle according to the initial three-dimensional point cloud, and combines a Fresnel reflected light field model to calculate a theoretical linear polarization degree reference value to correct a light intensity separation weight; carries out secondary separation on the initial total light intensity by using the weight, and respectively reconstructs an outer surface of the coating and a substrate surface; and finally calculates a spatial normal distance between the two surfaces, and combines a discrete Laplace response to determine a defect type. The application eliminates polarization separation calculation errors caused by surface warping of the carton, realizes double three-dimensional reconstruction of the transparent coating and the substrate, and improves the classification and detection accuracy of various defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of machine vision and industrial online inspection technology, specifically to an online inspection system for multiple defects in cardboard boxes based on machine vision. Background Technology

[0002] To improve the waterproof and moisture-proof performance of packaging and the visual effect of printing, a transparent coating is usually applied to the surface of corrugated cardboard boxes in industrial production. During the coating and transportation process, due to process fluctuations and mechanical extrusion, various quality defects such as bubbles, undercoating, and damage to the substrate under the coating may occur on the surface of the cardboard box. Currently, machine vision-based inspection equipment is widely used to automate the screening of cardboard boxes on the production line.

[0003] In existing visual inspection processes, the specular reflection of the transparent coating surface and the diffuse reflection of the underlying corrugated substrate cause these two types of reflected light to overlap on the camera sensor. This makes it difficult for traditional 3D measurement methods such as phase-shifting profilometry to obtain accurate surface phase information, resulting in distorted shape reconstruction. To separate this mixed light field, existing technologies have attempted to introduce polarization imaging methods. However, conventional polarization separation algorithms are usually based on fixed optical parameters and the assumption of an ideal plane. Due to the inherent undulations on the surface of corrugated cardboard boxes and the tendency for local warping during assembly line transport, the actual incident angle of light at the detection feature point changes constantly. This spatial variation in geometric pose leads to a significant deviation in the separation weights calculated by conventional polarization separation algorithms, making it impossible to accurately separate the specular reflection of the coating from the diffuse reflection of the substrate.

[0004] Furthermore, due to incomplete separation of the mixed light field, existing methods typically only obtain the outline of a single outer surface of the cardboard box, failing to capture the hierarchical structural relationship between the coating and the substrate. Lacking accurate three-dimensional coordinates of the underlying substrate, the system cannot calculate the true coating thickness. Consequently, during defect detection, it cannot distinguish between bubble defects caused by localized coating buildup and substrate damage caused by pressure-induced indentations in the underlying corrugated layer, even when the coating thickness is normal. This leads to frequent missed detections and false alarms in industrial settings. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides an online multi-defect detection system for corrugated boxes based on machine vision. This system solves the problem that when existing machine vision technologies detect corrugated boxes with a transparent coating, the specular reflection from the transparent coating surface and the diffuse reflection from the underlying substrate cause light intensity superposition, resulting in crosstalk of light field information and distortion of shape reconstruction. Furthermore, local warping of the corrugated box surface alters the actual incident angle at the measurement point, leading to deviations in the weight calculation using a fixed-parameter polarization separation method. This results in inaccurate coating thickness measurement and difficulty in effectively distinguishing different types of defects such as bubbles, undercoating, and damage to the substrate beneath the coating.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution:

[0007] The first aspect of this invention provides a machine vision-based online multi-defect detection system for corrugated cardboard boxes, applied to corrugated cardboard boxes with a transparent coating on their surface. The system includes:

[0008] An image acquisition module is used to project a structured light pattern onto the surface of the corrugated cardboard box and simultaneously acquire a polarization image corresponding to the structured light pattern under hardware triggering.

[0009] The data processing module is used to perform the following steps:

[0010] The initial total light intensity and the degree of linear polarization are obtained from the polarization image;

[0011] Initial light intensity separation is performed using the measured linear polarization degree to reconstruct the initial three-dimensional point cloud of the corrugated cardboard box;

[0012] The local surface normal vector at the target feature point is obtained from the initial three-dimensional point cloud, and the local incident angle at the target feature point is calculated in combination with the predetermined incident light propagation direction;

[0013] The local incident angle is substituted into the preset Fresnel reflection light field model to calculate the theoretical linear polarization reference value, and the separation weight is calculated based on the ratio of the measured linear polarization to the theoretical linear polarization reference value.

[0014] The initial total light intensity is subjected to secondary light intensity separation according to the separation weight, and the corrected specular reflection light intensity of the coating and the diffuse reflection light intensity of the substrate are obtained respectively.

[0015] Based on the corrected specular reflection intensity of the coating and the diffuse reflection intensity of the substrate, the outer surface of the coating and the surface of the substrate are reconstructed respectively, wherein refraction correction is performed when reconstructing the surface of the substrate.

[0016] Unify the outer surface of the coating and the surface of the substrate to the same coordinate system or coordinate grid, calculate the spatial normal distance between the outer surface of the coating and the surface of the substrate based on this, and determine the defect type by combining the discrete Laplace response of the outer surface of the coating and the surface of the substrate.

[0017] Furthermore, the image acquisition module includes a photoelectric encoder and a split-plane polarization camera; the photoelectric encoder is used to generate a trigger signal when it senses that the corrugated cardboard box has reached a preset trigger displacement interval; the split-plane polarization camera is used to perform exposure using a global shutter after receiving the trigger signal, so as to output the polarization image containing the light intensity of four polarization directions.

[0018] Further, the step of obtaining the initial total light intensity and measuring the linear polarization degree based on the polarization image specifically includes: extracting the interpolated light intensity of four different polarization directions in the polarization image and performing Stokes parameter conversion to obtain the initial total light intensity and the measured linear polarization degree at the target feature point; multiplying the measured linear polarization degree by the initial total light intensity to obtain the initial coating specular reflection light intensity, and using the initial coating specular reflection light intensity to calculate the wrapping phase to obtain the initial three-dimensional point cloud.

[0019] Further, obtaining the local surface normal vector at the target feature point specifically includes: performing local surface fitting on the point cloud surrounding the target feature point in the initial three-dimensional point cloud, calculating the local surface normal vector of the target feature point; determining the spatial propagation direction of the projection beam by combining a pre-calibrated system projection vector lookup table, and calculating the true local incident angle at the target feature point based on the spatial propagation direction of the projection beam and the local surface normal vector.

[0020] Furthermore, the step of substituting the local incident angle into a preset Fresnel reflection light field model to calculate the theoretical linear polarization reference value specifically includes: obtaining the known refractive index of the transparent coating; substituting the actual local incident angle and the known refractive index into the Fresnel reflection light field model to calculate the theoretical linear polarization reference value corresponding to the ideal specular reflected light under the current light-receiving posture.

[0021] Further, the step of performing secondary light intensity separation on the initial total light intensity according to the separation weight specifically includes: using the product of the initial total light intensity and the separation weight as the corrected coating specular reflection light intensity; and using the difference between the initial total light intensity and the corrected coating specular reflection light intensity as the corrected substrate diffuse reflection light intensity.

[0022] Furthermore, the reconstructing of the outer surface of the coating and the substrate surface respectively specifically includes: calculating the three-dimensional coordinates using the corrected specular reflection intensity of the coating to obtain the outer surface of the coating; calculating the diffuse reflection intensity of the substrate using the corrected diffuse reflection intensity, and performing spatial refraction correction considering the deflection of light passing through the coating interface to obtain the substrate surface that is unified with the outer surface of the coating to the world coordinate grid.

[0023] Furthermore, the step of determining the defect type by combining the discrete Laplace response of the outer surface of the coating and the surface of the substrate specifically includes: when the measured thickness of the coating in the Z direction is greater than the upper limit of the normal thickness set by the process, and the discrete Laplace response of the outer surface of the coating at the target feature point is negative, the area where the target feature point is located is determined to be a bubble defect.

[0024] Furthermore, the step of determining the defect type by combining the discrete Laplace response of the outer surface of the coating and the surface of the substrate specifically includes: when the measured thickness of the coating in the Z direction is within a set normal thickness range, and the absolute value of the discrete Laplace response of the substrate surface at the target feature point exceeds a preset threshold, the area where the target feature point is located is determined to be a substrate damage defect under the coating.

[0025] Furthermore, the data processing module is also used to: when a bubble defect is determined, to perform integral calculation on the portion of the Z-axis coating thickness that exceeds the normal thickness limit using a set upper limit of normal thickness as the integration benchmark, and output the equivalent over-thickness volume of the bubble defect; when a substrate damage defect under the coating is determined, to extract the Z-axis distance deviation of the substrate surface at the target feature point relative to the surface of the undamaged reference substrate, and to take the maximum value of the Z-axis distance deviation as the maximum Z-axis damage depth of the substrate damage defect under the coating.

[0026] The second aspect of the present invention provides a machine vision-based online detection method for multiple defects in cardboard boxes, implemented based on the above-mentioned detection system, including structured light projection, polarization image acquisition, light intensity separation based on Stokes parameter conversion, adaptive calculation of local incident angle, secondary light field decoupling, layered three-dimensional morphology reconstruction with refraction correction, and defect morphology determination based on the same coordinate system.

[0027] This invention provides an online multi-defect detection system for cardboard boxes based on machine vision. It has the following advantages:

[0028] 1. This invention obtains the external normal vector by performing local surface fitting on the initial 3D point cloud, thereby calculating the local incident angle at the measurement point. It then combines this with a Fresnel reflection light field model to calculate a theoretical linear polarization reference value to correct the light intensity separation weight. This feature allows the system to adaptively adjust the calculation parameters according to the actual undulation of the corrugated cardboard box surface, eliminating light intensity separation deviations caused by changes in the incident angle due to local warping of the cardboard box surface, and improving the accuracy of light intensity separation and morphology reconstruction under complex surface morphologies.

[0029] 2. This invention utilizes the specular reflection intensity of the coating and the diffuse reflection intensity of the substrate obtained through secondary separation to calculate the three-dimensional coordinates, and performs spatial refraction correction on the calculation of the underlying substrate. This feature overcomes the signal crosstalk caused by the superposition of reflected light from the transparent coating and diffuse reflection light from the underlying substrate, unifying the two physical surfaces into the same coordinate system. This enables the independent acquisition of the coating morphology and the substrate morphology, providing fundamental data for the subsequent accurate calculation of the spatial normal distance reflecting the coating thickness.

[0030] 3. This invention combines the calculated spatial normal distance with the discrete Laplace response of the coating outer surface and the substrate surface for joint defect determination. By analyzing the deformation characteristics and thickness variation relationship of different interfaces, this determination logic can effectively distinguish between bubble defects formed by coating surface accumulation and substrate damage defects in the underlying corrugated cardboard box that are of normal thickness. This solves the problem that traditional visual methods relying solely on single contour or grayscale features are prone to misjudgment, and improves the reliability of the system in classifying and detecting defects of different causes. Attached Figure Description

[0031] Figure 1 This is a schematic diagram of the structure of a three-dimensional multi-defect detection system for coated cardboard boxes based on spatial adaptive polarization separation and motion compensation, according to an embodiment of the present invention.

[0032] Figure 2 This is a flowchart of a three-dimensional detection method for multiple defects in coated cardboard boxes based on spatial adaptive polarization separation and motion compensation, according to an embodiment of the present invention.

[0033] Figure 3 This is a flowchart of the offline nonlinear optical path system calibration process according to an embodiment of the present invention;

[0034] Figure 4 This is a schematic diagram illustrating the principle of multi-dimensional optical field synchronous acquisition and full-resolution reconstruction in an embodiment of the present invention.

[0035] Figure 5 This is a schematic diagram illustrating the initial global polarization separation and motion error compensation principle of an embodiment of the present invention.

[0036] Figure 6 This is a schematic diagram of the adaptive polarization separation principle based on spatial geometric feedback according to an embodiment of the present invention;

[0037] Figure 7 This is a schematic diagram illustrating the principle of layered three-dimensional topography reconstruction and differential metrology for multiple types of defects in an embodiment of the present invention.

[0038] Figure 8 This is a schematic diagram of the effect of dynamic layered three-dimensional reconstruction and thickness distribution of the system in an application embodiment of the present invention, wherein (a) is a two-layer three-dimensional point cloud topography reconstruction diagram, and (b) is a two-dimensional grayscale image of the corresponding Z-axis coating thickness distribution.

[0039] Figure 9 This is a schematic diagram of the spatial difference profile determination logic for typical defect morphology in an application embodiment of the present invention;

[0040] Figure 10 This is a comparison chart of the accuracy of the adaptive polarization separation algorithm in application embodiments of the present invention. Detailed Implementation

[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0042] See attached document Figure 1 The present invention provides an online inspection system for multiple defects in cardboard boxes based on machine vision, including a hardware platform and a data processing module set in an industrial control computer.

[0043] The hardware platform includes a split-focus plane polarization camera, a digital light processing projector, a photoelectric encoder, and an industrial control computer. The digital light processing projector is referred to as a DLP projector.

[0044] Using the upper surface of the conveyor belt as the mounting reference plane, the DLP projector is mounted above the inspection area of ​​the conveyor belt. Its main projection axis forms a preset projection angle with the normal of the mounting reference plane, which is used to sequentially project phase-shift patterns with different spatial frequencies and different phase shifts into the inspection area of ​​the conveyor belt. The preset projection angle is determined in advance based on the size of the inspection area, the height range of the carton to be tested, and the effective projection range of the DLP projector.

[0045] The focal plane polarization camera is mounted above the inspection area of ​​the production line at a preset observation angle, with its lens optical axis forming the preset observation angle with the normal of the mounting reference plane. The image sensor of the focal plane polarization camera is equipped with a micro-polarization filter array, which has a basic period of 2×2 pixel units, with each pixel corresponding to polarization directions of 0°, 45°, 90° and 135° respectively.

[0046] The effective projection area of ​​the DLP projector and the effective imaging field of view of the split-focus plane polarization camera coincide within the pipeline detection area. The preset projection angle and preset observation angle are set such that when the surface of the coated carton under test is within the preset slope variation range, the split-focus plane polarization camera can receive the specular reflection light component generated by the outer surface of the coating, as well as the diffuse reflection light component of the substrate formed after the projected light passes through the coating to reach the substrate and returns through the coating.

[0047] The preset slope variation range refers to the allowable tilt angle range of the local outward normal vector of the surface of the carton under test relative to the normal of the mounting reference plane. This tilt angle range is predetermined based on the allowable warpage of the carton under test, the range of surface morphology variation, and the effective imaging field of view of the split-plane polarization camera.

[0048] An optical encoder is mounted on the output shaft of a servo motor or the drive shaft of a conveyor belt on an assembly line. It is used to output displacement pulse signals based on the actual displacement of the conveyor belt. The optical encoder has a pre-calibrated unit pulse displacement equivalent, which represents the physical displacement of the conveyor belt corresponding to each pulse output by the optical encoder.

[0049] The industrial control computer connects to the split-focus plane polarization camera and the DLP projector via control and data interfaces, respectively, and receives displacement pulse signals from the photoelectric encoder via a pulse acquisition interface. These displacement pulse signals are then input to the DLP projector and the split-focus plane polarization camera via trigger interfaces, serving as hardware trigger signals for both.

[0050] When the conveyor belt reaches the preset trigger displacement interval, the photoelectric encoder outputs a displacement pulse signal. The DLP projector responds to the displacement pulse signal by switching and projecting the corresponding phase-shift pattern; the split-focus plane polarization camera responds to the same displacement pulse signal and uses a global shutter for exposure after a preset trigger delay, so that the camera exposure time corresponds to the stable projection period of the phase-shift pattern. The preset trigger delay is pre-set based on the pattern switching time and pattern stabilization time of the DLP projector and the exposure response time of the split-focus plane polarization camera.

[0051] The industrial control computer is equipped with a graphics processor, which is used to perform parallel image operations and matrix operations in polarization image interpolation, Stokes parameter calculation, phase solution, point cloud computing, and defect parameter calculation.

[0052] The data processing module includes a camera-projector joint calibration module, a polarization image reconstruction and parameter calculation module, an initial light intensity separation and motion compensation module, an adaptive polarization separation module, and a layered morphology reconstruction and defect parameter calculation module.

[0053] The camera-projector joint calibration module is used to obtain the intrinsic parameters, distortion parameters and extrinsic parameters of the focal plane polarization camera and DLP projector relative to the world coordinate system, and to establish the discrete mapping relationship between the object space coordinates and the unit vector of the projected light propagation.

[0054] The polarization image reconstruction and parameter calculation module is used to interpolate and reconstruct the original image of the micro-polarization array acquired by the focal plane polarization camera, obtain sub-images of each polarization direction with the same size as the original pixel array of the sensor, and calculate the Stokes parameters and measure the degree of linear polarization based on each polarization direction sub-image.

[0055] The initial light intensity separation and motion compensation module is used to obtain the initial coating specular reflection estimated light intensity based on the measured linear polarization degree, perform spatial registration on images corresponding to different phase shift steps, calculate the additional phase shift introduced by the object motion, and reconstruct the initial three-dimensional point cloud of the coating based on the corrected phase shift amount.

[0056] The adaptive polarization separation module is used to calculate the local surface normal vector based on the initial three-dimensional point cloud of the coating, and determine the local incident angle by combining the discrete mapping relationship between the object space coordinates and the unit vector of the projected light propagation. It calculates the theoretical linear polarization reference value according to the Fresnel reflection equation and generates a pixel-by-pixel separation weight accordingly, thereby obtaining the separated coating specular reflection intensity sequence and the substrate diffuse reflection estimated intensity sequence.

[0057] The layered topography reconstruction and defect parameter calculation module is used to reconstruct the three-dimensional point cloud of the outer surface of the coating and the three-dimensional point cloud of the substrate surface based on the specular reflection light intensity sequence of the coating and the estimated light intensity sequence of the diffuse reflection of the substrate, respectively. It calculates the coating thickness in the Z direction of the two sets of three-dimensional point clouds on a unified world coordinate grid, and determines the defect region and the corresponding geometric parameters based on the thickness threshold and local second-order spatial difference features.

[0058] The aforementioned data processing modules are executed in the following order: camera-projector joint calibration, polarization image reconstruction and parameter calculation, initial light intensity separation and motion compensation, adaptive polarization separation, and layered morphology reconstruction and defect parameter calculation; the output data of the previous module serves as the input data for the next module.

[0059] See attached document Figure 2 This invention provides a machine vision-based online detection method for multiple defects in cardboard boxes, comprising the following steps:

[0060] S10. Establish a world coordinate system within the pipeline inspection area, and divide the effective three-dimensional measurement area into discrete object-space points according to the preset spatial discrete step length. Use a multi-pose calibration plate to jointly calibrate the split-focus plane polarization camera and the digital light processing projector to obtain their intrinsic parameters, distortion parameters, and extrinsic parameters relative to the world coordinate system. Based on the joint calibration results, calculate the projection light propagation unit vector corresponding to each discrete object-space point, establish a discrete mapping relationship between the object-space three-dimensional coordinates and the projection light propagation unit vector, and generate an object-space coordinate-projection light propagation unit vector lookup table, hereinafter referred to as the light vector lookup table.

[0061] S20 controls the digital light processing projector to project multiple sets of phase-shift patterns onto the surface of the coated carton under test in a preset spatial frequency order. Based on the displacement pulse signal output by the photoelectric encoder, the split-focus plane polarization camera is triggered to synchronously acquire the original image sequence of the micro-polarization array. Using the local gradient guided interpolation method, the missing pixels in each polarization direction are interpolated to obtain 0°, 45°, 90° and 135° polarization direction sub-images of the same size as the original pixel array of the image sensor. Stokes parameters are calculated based on each polarization direction sub-image, and the measurement linear polarization degree matrix corresponding to each phase shift step is obtained.

[0062] S30: Calculate the initial coating specular reflection estimated light intensity sequence based on the measured linear polarization matrix and the first Stokes parameter; register the initial coating specular reflection estimated light intensity images at different acquisition times to the image coordinate system corresponding to the same reference time based on the actual displacement of each phase step recorded by the photoelectric encoder; convert the actual displacement into an additional phase offset along the phase change direction of the projected fringes, and determine the corrected phase shift for each phase step accordingly; perform non-equal interval phase shift calculation and multi-frequency heterodyne phase expansion using the corrected phase shift to obtain the compensated absolute phase, and reconstruct the initial three-dimensional point cloud of the coating based on the joint calibration parameters of the split-focus plane polarization camera and the digital light processing projector.

[0063] S40: Calculate the local unit normal vector of the coating surface based on the initial three-dimensional point data of the coating; use the world coordinates of each point as an index to look up the light vector lookup table to obtain the corresponding projection light propagation unit vector, and calculate the local incident angle based on the projection light propagation unit vector and the local unit normal vector; substitute the local incident angle and the coating refractive index into the Fresnel reflection equation to calculate the theoretical linear polarization reference value under ideal Fresnel reflection conditions; generate a pixel-by-pixel separation weight based on the measured linear polarization degree and the theoretical linear polarization reference value, and perform secondary light intensity separation on the total light intensity of each phase shift step to obtain the coating specular reflection light intensity sequence and the substrate diffuse reflection estimated light intensity sequence.

[0064] S50 performs spatial registration, non-uniformly spaced phase shift calculation, motion phase compensation, and multi-frequency heterodyne phase expansion on the specular reflection intensity sequence of the coating and the estimated diffuse reflection intensity sequence of the substrate, respectively, to reconstruct the 3D point cloud of the outer surface of the coating and the 3D point cloud of the substrate surface. The two sets of 3D point clouds are transformed and resampled to a unified world coordinate XY grid. The coordinate difference between the outer surface of the coating and the surface of the substrate along the Z-axis of the world coordinate system is calculated at the same world coordinate grid point to obtain the Z-axis coating thickness distribution matrix. Based on the preset thickness threshold, local second-order spatial difference features, and connected region statistical results, undercoating defects, bubble defects, and substrate damage under the coating are determined, and the world coordinates and corresponding geometric parameters of each defect region are output.

[0065] Among them, the geometric parameters of undercoating defects include at least the physical area of ​​the defect region, the minimum Z-axis coating thickness, and the average Z-axis coating thickness; the geometric parameters of bubble defects include at least the equivalent overthickness volume of the bubble region; and the geometric parameters of substrate damage under the coating include at least the world coordinates of the damaged region and the maximum Z-axis damage depth.

[0066] See attached document Figure 3 A world coordinate system is established within the inspection area of ​​the production line, and the effective three-dimensional measurement area is divided into discrete object-space lattices. The upper surface of the production line conveyor belt is used as the reference plane of the world coordinate system, and a fixed reference point is selected within the inspection area of ​​the reference plane as the origin of the world coordinate system. Establish a world coordinate system .in, The shaft is set along the direction of movement of the conveyor belt. The shaft is set along the width direction of the conveyor belt. The axes are perpendicular to the upper surface of the conveyor belt and point to the side where the coated carton to be tested is located. The positive direction of each coordinate axis is determined according to the right-hand coordinate system.

[0067] The effective three-dimensional measurement area is determined based on the maximum external dimensions of the coated carton to be tested, the allowable warpage height, and the combined effective field of view of the split-plane polarization camera and the digital light processing projector. The effective three-dimensional measurement area is within... axis, shaft and The coordinate ranges along the axes are respectively , and .

[0068] Based on the object space resolution of phase-shift profile measurement, the depth measurement resolution, and the joint calibration error of the camera-projector, the following settings are respectively set: axis, shaft and Spatial distance along the axis of the walk , and Spatial distances are measured using the same units of length as world coordinates.

[0069] The effective three-dimensional measurement area is divided into grids according to the spatial discrete step length, generating a discrete three-dimensional object point set. :

[0070] ;

[0071] In the formula, Represents the discrete object point set within the effective three-dimensional measurement area; Indicates that the index is The three-dimensional coordinate column vector of discrete object points in the world coordinate system; , and They represent along axis, shaft and The grid indices along the axes are all non-negative integers; , and These represent the spatial distance step lengths along the three coordinate axes, respectively. , and These represent the minimum coordinates of the effective three-dimensional measurement area in the three coordinate axes.

[0072] The maximum grid index along each of the three coordinate axes is determined by the following formula:

[0073] ;

[0074] ;

[0075] ;

[0076] In the formula, , and They represent along axis, shaft and Maximum grid index in the axial direction; symbol This indicates rounding down to ensure that all discrete object points are within the effective three-dimensional measurement area.

[0077] Through the above spatial discretization process, the continuous object measurement area is represented as a discrete three-dimensional grid with definite spatial coordinates and index relationships, so that the corresponding projection light propagation direction can be queried according to the point cloud coordinates in the subsequent detection process.

[0078] Secondly, a multi-attitude calibration board was used to jointly calibrate the split-focus plane polarization camera and the digital light processing projector.

[0079] A calibration plate with known feature point dimensions and coordinates is placed within the effective three-dimensional measurement area, and the calibration plate is positioned in multiple calibration postures with different depths and tilt angles. Each calibration posture covers the height range and surface tilt angle range that the carton under test may exhibit during normal inspection.

[0080] At least one rigid body transformation relationship between the orientation of the calibration plate and the world coordinate system is predetermined by a fixed positioning fixture, a preset installation position, or a coordinate measurement method, so as to uniformly transform the camera calibration results and the projector calibration results to the world coordinate system.

[0081] Images of the calibration board at various calibration attitudes are acquired by a split-focus plane polarization camera. Based on the image coordinates of the feature points on the calibration board and their corresponding physical coordinates, the intrinsic parameter matrix of the split-focus plane polarization camera is calculated. , distortion parameter vector and the rotation matrix of the camera coordinate system relative to the world coordinate system. Translation vector .

[0082] In this embodiment, the camera extrinsic parameters adopt the transformation convention from the world coordinate system to the camera coordinate system, that is, the world coordinate points Coordinates in the camera coordinate system satisfy:

[0083] ;

[0084] In the formula, Represents the coordinates of a three-dimensional point in the world coordinate system; This represents the coordinates of the same 3D point in the camera coordinate system; Represents the rotation matrix from the world coordinate system to the camera coordinate system; This represents the translation vector from the world coordinate system to the camera coordinate system.

[0085] Intrinsic parameter matrix It should include at least the equivalent focal length of the camera in two image coordinate directions and the coordinates of the principal point; the distortion parameter vector. It includes at least radial distortion parameters and tangential distortion parameters. The camera's intrinsic parameters, distortion parameters, and extrinsic parameters can be obtained using a multi-pose calibration method with a planar calibration plate.

[0086] A digital light processing projector is used as a reverse imaging device for calibration. The digital light processing projector projects a preset phase-shift coded pattern onto the calibration board in each calibration posture. A split-focus plane polarization camera captures the projected pattern on the surface of the calibration board, and the correspondence between the feature points of the calibration board and the pixels of the digital micromirror device is obtained through phase decoding.

[0087] Digital micromirror device (DMD) is abbreviated as DMD. The pixel coordinate system of DMD adopts a two-dimensional coordinate system. It means that, among them, and These represent the coordinate directions of two mutually orthogonal pixels within the DMD image plane. Based on the world coordinates of the feature points on the calibration board and their corresponding DMD pixel coordinates, the intrinsic parameter matrix of the digital light processing projector is calculated. , distortion parameter vector and the rotation matrix of the projector coordinate system relative to the world coordinate system. Translation vector .

[0088] The projector's extrinsic parameters also adopt the transformation convention from the world coordinate system to the projector coordinate system, namely:

[0089] ;

[0090] In the formula, Represents world coordinates Three-dimensional coordinates in the projector coordinate system; Represents the rotation matrix from the world coordinate system to the projector coordinate system; This represents the translation vector from the world coordinate system to the projector coordinate system. Based on the aforementioned extrinsic parameters, the coordinates of the optical center of the digital light processing projector in the world coordinate system are... for:

[0091] ;

[0092] In the formula, Indicates the three-dimensional coordinates of the optical center of the digital light processing projector in the world coordinate system; superscript This indicates the matrix transpose.

[0093] For pixel coordinates on the DMD image plane First, based on the distortion parameter vector Perform distortion correction on the pixel to obtain the distorted pixel coordinates. The distortion-free pixel coordinates are converted into direction vectors on the projector's normalized imaging plane:

[0094] ;

[0095] In the formula, This represents the unnormalized ray direction vector in the projector coordinate system; Represents the intrinsic parameter matrix of the projector The inverse matrix; and Let x and y represent the x and y coordinates of the DMD pixel after distortion correction, respectively. Transforming the ray direction vector to the world coordinate system yields:

[0096] ;

[0097] In the formula, This represents the unnormalized projection light propagation direction vector in the world coordinate system, pointing from the digital light processing projector to the object space; subscript The direction is indicated by the projector pointing towards the object space containing the measured surface. This is determined by DMD pixels. The corresponding projected ray can be represented as:

[0098] ;

[0099] In the formula, Indicates the parameters on the projected light ray. Determined world coordinates; This represents a proportional parameter along the direction of projection light propagation. Indicates the optical center of the projector; This represents the vector of the direction of propagation of the projected light.

[0100] Then, traverse the discrete three-dimensional object point set. A lookup table for the unit vector of projected light propagation in the object's coordinate system.

[0101] For any discrete object point According to the projector intrinsic parameter matrix , distortion parameter vector Rotation matrix Translation vector Projecting the discrete object point onto the DMD pixel coordinate system yields the corresponding DMD pixel coordinates. .

[0102] When a discrete object point is located behind the optical center of the projector, or when the corresponding DMD pixel coordinates exceed the effective projection area of ​​the DMD, the discrete object point is marked as an invalid point for the optical vector. The valid marker corresponding to the invalid point is set to 0, and its vector storage value can be set to a zero vector, but it does not participate in subsequent vector interpolation calculations.

[0103] When the discrete object point is within the effective projection range of the projector, distortion correction is performed on the corresponding DMD pixel coordinates, and the projection light propagation direction vector corresponding to that pixel is calculated according to the projector's back projection relationship. .

[0104] The projection light propagation direction vector is normalized to obtain the discrete object-side point. The corresponding unit vector for projected light propagation:

[0105] ;

[0106] In the formula, This indicates that the digital light processing projector points to the discrete object point. The unit vector of projected light propagation; This represents the corresponding unnormalized projection light propagation direction vector; Let represent the Euclidean norm of a vector. A normalized unit vector has a magnitude of 1.

[0107] According to the grid index of discrete object points Store the corresponding projected light propagation unit vector in a three-dimensional vector lookup table. In the middle, and set the corresponding valid tag table. :

[0108] ;

[0109] ;

[0110] In the formula, Indicates that the index is The three-dimensional projected light propagation unit vector corresponding to the discrete object point; Indicates the effective marker of the optical vector at the corresponding position; when When, the unit vector at that position can be used for subsequent queries and interpolation; when At this point, the position is not involved in subsequent optical vector interpolation. 3D vector lookup table. and valid label table Together they form the light vector lookup table.

[0111] The optical vector lookup table contains the position-dependent projection light propagation direction, determined by projector intrinsic parameters, lens distortion parameters, projector mounting orientation, and spatial divergence of the projection beam. Compared to repeatedly performing projector distortion correction and backprojection calculations for each point cloud coordinate during online detection, pre-generating the optical vector lookup table reduces the amount of online computation.

[0112] In subsequent testing, the world coordinates of a point on the surface of the coated cardboard box under test are used as the query coordinates. Adjacent grid nodes containing these query coordinates are determined from the optical vector lookup table. Spatial interpolation is then performed based on the unit vectors corresponding to the valid grid nodes to obtain the projected light propagation unit vector at that surface point. This projected light propagation unit vector, together with the local unit normal vector of the surface point, is used to calculate the local angle of incidence, providing directional parameters for subsequently determining the theoretical linear polarization reference value based on the Fresnel reflection equation.

[0113] See attached document Figure 4 Based on the displacement pulse signal output by the photoelectric encoder, the phase-shift pattern projection timing of the digital light processing projector and the global shutter exposure timing of the focal plane polarization camera are synchronously controlled. The coated cardboard box under test moves along the conveyor belt of the production line along the world coordinate system. Movement along the axis. During image acquisition, the conveyor belt runs at a preset speed. Digital light processing projectors are hereinafter referred to as DLP projectors.

[0114] The phase-shifting pattern projected by the DLP projector includes A group of sinusoidal phase-shift patterns with different spatial frequencies, wherein, The index of the current spatial frequency group is denoted as ,and Each group of spatial frequencies corresponds to Phase shift pattern, in which, The index of the current phase shift is denoted as ,and .

[0115] The phase of the phase-shifted pattern is along the DMD pixel coordinates of the DLP projector. Taking the change of direction as an example, the first The first group of spatial frequencies The phase shift pattern can be represented as:

[0116] ;

[0117] In the formula, Represents DMD pixel coordinates The grayscale value of the pattern at that location; Indicates the first Average gray level of the phase-shift pattern; Indicates the first Modulation of the phase-shift pattern; Indicates the first The stripe period of the phase-shift pattern in the DMD pixel coordinate system, in pixels; Indicates the first The standard phase shift of the step pattern. When using equally spaced standard phase shifts, the standard phase shift is:

[0118] ;

[0119] In the formula, The unit is radians; Indicates the phase shift index; This represents the total number of phase-shift patterns contained in each group of spatial frequencies. When the phase of the phase-shift pattern changes along other directions within the DMD image plane, the pixel coordinates corresponding to that direction are used instead of the above. .

[0120] The DLP projector projects each set of phase-shift patterns sequentially according to a preset spatial frequency order. The phase data corresponding to different spatial frequencies is used for subsequent multi-frequency heterodyne phase unfolding.

[0121] The photoelectric encoder has a unit pulse displacement equivalent The unit pulse displacement equivalent represents the physical displacement of the conveyor belt per pulse output by the photoelectric encoder. Based on the allowable object displacement, object-space sampling interval, and subsequent spatial registration range for phase-shift pattern acquisition, the number of trigger pulses between two adjacent pattern acquisitions is set. The conveyor belt displacement corresponding to two consecutive triggers is:

[0122] ;

[0123] In the formula, This indicates the physical displacement of the conveyor belt between two consecutive hardware triggers; This represents the cumulative number of encoder pulses between two consecutive triggers, and is a positive integer. This represents the equivalent displacement per unit pulse, expressed in length per pulse. When the conveyor belt's operating speed is... At that time, the nominal time interval between two adjacent triggers is:

[0124] ;

[0125] In the formula, Indicates the nominal time interval between two consecutive triggers; This indicates the speed of the conveyor belt along the direction of motion. During actual data acquisition, the physical displacement corresponding to each phase step is based on the cumulative number of pulses recorded by the photoelectric encoder.

[0126] When the cumulative displacement of the conveyor belt reaches the trigger displacement At that time, the photoelectric encoder outputs a hardware trigger pulse. The hardware trigger pulse is then input to both the DLP projector and the split-focus plane polarization camera.

[0127] The DLP projector responds to a hardware trigger pulse, switches and projects the first frequency in the current spatial frequency group. Phase-shift pattern. The focal plane polarization camera responds to the same hardware trigger pulse, and after a preset trigger delay... Then, use the global shutter to take the exposure.

[0128] Preset trigger delay This refers to the time from when the hardware trigger pulse reaches the focal plane polarization camera to when the camera begins exposure. The preset trigger delay is determined based on the pattern switching time and pattern stabilization time of the DLP projector, so that the focal plane polarization camera begins exposure after the current phase-shifted pattern has reached a stable projection state.

[0129] When using global shutter exposure, the effective pixels on the image sensor perform photoelectric integration within the same exposure time period to reduce the geometric distortion of the image introduced by line-by-line exposure during the movement of the carton being tested.

[0130] The single exposure time of a focal plane polarizing camera is denoted as... The single exposure time meets the following requirements:

[0131] ;

[0132] In the formula, This indicates the object displacement of the cardboard box under test during a single exposure. This represents the maximum allowable object displacement during a single exposure, and its value is predetermined based on the system's object space resolution and allowable motion blur. The unit is time.

[0133] For any spatial frequency group, after After a series of consecutive triggers, the focal plane polarization camera acquires the corresponding original image sequence of the micro-polarization array. (Completed) After the phase-shifting pattern is projected, the original image data is recorded as follows:

[0134] ;

[0135] In the formula, Represents pixel coordinates on the image sensor In the Group spatial frequency, the first The original light intensity collected under the phase-shifting pattern; and These represent the horizontal and vertical pixel indices of the image sensor, respectively. Indicates the spatial frequency group index; This indicates the phase shift index. The following explanation of the polarization image reconstruction process is for a fixed spatial frequency group; the index is omitted unless it causes ambiguity. .

[0136] Secondly, local gradient-guided interpolation is performed on the original image of the micro-polarization array to obtain sub-images of each polarization direction with the same size as the original pixel array of the image sensor.

[0137] The image sensor of a focal plane polarization camera is equipped with a micro-polarization filter array. The micro-polarization filter array has a basic period of 2×2 pixel units, with the four pixels within the basic period corresponding to polarization directions of 0°, 45°, 90°, and 135°, respectively. The specific arrangement order of the pixels with the four polarization directions within the 2×2 basic unit is determined according to the sensor structure or calibration file of the focal plane polarization camera.

[0138] Since each sensor pixel only samples light intensity in one polarization direction, the number of original sampling points in each polarization direction is approximately one-quarter of the total number of pixels in the image sensor, and the horizontal or vertical spacing between adjacent sampling points in the same polarization direction is greater than the original pixel spacing of the sensor. To ensure that the images in each polarization direction have a consistent image size and pixel index, the polarization image reconstruction and parameter calculation module interpolates the missing pixels in each polarization direction.

[0139] To reduce the impact of different polarization directions of adjacent pixels on gradient judgment, a reference grayscale image is first constructed using the average grayscale of the four pixels in each 2×2 polarization basic unit, and the local image edge direction is determined based on the reference grayscale image.

[0140] For the target location Calculate the absolute gradients of the reference grayscale image in the horizontal and vertical directions, respectively. and When using the first-order central difference, the absolute gradient can be expressed as:

[0141] ;

[0142] ;

[0143] In the formula, This represents a reference grayscale image formed by the average grayscale of 2×2 polarization basic units. This represents the absolute grayscale gradient of the target location in the horizontal direction of the image; This represents the absolute grayscale gradient of the target location in the vertical direction of the image; The axis is set along the horizontal direction of the image. The axis is set vertically along the image. Local gradients can also be calculated using the Sobel operator, but a unified gradient calculation method is used throughout the same detection process.

[0144] Set gradient difference threshold When the following conditions are met:

[0145] ;

[0146] When it is assumed that there is no obvious single edge direction at the current position, the missing pixels are interpolated using the mean of the effective sampled values ​​of the same polarization direction in the preset neighborhood.

[0147] Gradient difference threshold It can be determined based on dark-field images from a split-plane polarizing camera. Specifically, multiple dark-field images are acquired under shading conditions, and the values ​​in the dark-field images are calculated. The statistical distribution is determined, and the preset upper quantile value of the statistical distribution is set as the gradient difference threshold. The preset upper quantile value is determined based on the allowable edge misjudgment rate.

[0148] when:

[0149] ;

[0150] and When the reference gray level changes significantly in the vertical direction, it is determined that the local image edge mainly extends in the horizontal direction, and the effective sampling point in the same polarization direction closest to the target position is selected in the horizontal direction for linear interpolation.

[0151] when:

[0152] ;

[0153] and When the reference gray level changes significantly in the horizontal direction, it is determined that the local image edge mainly extends in the vertical direction, and the effective sampling point in the same polarization direction closest to the target position is selected in the vertical direction for linear interpolation.

[0154] For any polarization direction ,in, Let the nearest effective sampling points in the same polarization direction located on both sides of the target position along the selected interpolation direction be respectively and The pixel distances from the target location to the two sampling points are respectively and Then the interpolated light intensity at the target location can be expressed as:

[0155] ;

[0156] In the formula, Indicates polarization direction At the target location Interpolated light intensity at the location; and These represent the measured light intensity at two effective sampling points with the same polarization direction, respectively. and These represent the pixel distances from the target location to the two valid sampling points, respectively.

[0157] When the target location is at the image boundary and it is impossible to obtain effective sampling points in the same polarization direction on both sides of the selected direction at the same time, the sampling points in the same polarization direction on one side of that direction are used for interpolation; when the number of effective sampling points on one side is insufficient, the effective sampling points in the same polarization direction in the preset neighborhood are used for mean interpolation.

[0158] In regions without a clearly defined single edge direction, the polarization direction The mean interpolation result is:

[0159] ;

[0160] In the formula, Indicates the target location The polarization direction is within the preset neighborhood of the center. The set of valid sampling points; This indicates the number of sampling points in the valid sampling point set. The size of the preset neighborhood remains unchanged during the same detection process.

[0161] For pixel locations in the original image where the corresponding polarization direction light intensity has been acquired, their measured light intensity values ​​are retained; for missing locations, the interpolation results described above are used. This yields four sets of polarization direction sub-image sequences of the same size as the original pixel array of the image sensor, denoted as follows:

[0162] ;

[0163] in, , , and Representing pixel positions In the The light intensity corresponding to the 0°, 45°, 90°, and 135° polarization directions under the phase shift pattern. The above interpolation is used to unify the image size and pixel index in each polarization direction, and does not equate the interpolated image with the sensor's native optical resolution in each polarization direction.

[0164] Then, the first three Stokes parameters are calculated based on the four sets of polarization direction images.

[0165] First Stokes parameter Indicates pixel position In the The total light intensity under a phase-shifting pattern is calculated using the following formula:

[0166] ;

[0167] Second Stokes parameter The difference between the light intensity in the 0° polarization direction and the light intensity in the 90° polarization direction is expressed by the following formula:

[0168] ;

[0169] Third Stokes parameter The difference between the light intensity in the 45° polarization direction and the light intensity in the 135° polarization direction is expressed by the following formula:

[0170] ;

[0171] In the formula, , and Representing pixel positions In the The first, second, and third Stokes parameters under the phase-shifting pattern are used; each parameter uses the same gray dimension as the light intensity of the input polarization image. Finally, the measured linear polarization matrix is ​​calculated based on the Stokes parameters. :

[0172] ;

[0173] In the formula, Indicates pixel position In the Measurement of linear polarization under phase-shifting patterns; Indicates the combined intensity of linearly polarized components; Indicates total light intensity; This represents a dimensionless small positive number used to prevent the denominator from being zero. Its value is predetermined based on the image grayscale quantization range and the dark field noise level.

[0174] Considering that image noise and interpolation errors may cause the calculation results to exceed the physical range of linear polarization, an interval restriction is applied to the measurement of linear polarization:

[0175] ;

[0176] After interval restriction, The value range is [0,1].

[0177] See attached document Figure 5 The obtained linear polarization degree matrix and first Stokes parameter are used to calculate the estimated light intensity sequence of the initial coating specular reflection.

[0178] When structured light projected by a digital light processing projector illuminates the surface of the coated cardboard box under test, the projected light undergoes specular reflection on the outer surface of the coating and can pass through the transparent or translucent coating to reach the substrate surface. The diffusely reflected light generated on the substrate surface returns to the focal plane polarization camera via the coating.

[0179] After scattering, the linearly polarized component of the diffuse reflected light from the substrate is relatively weak; during specular reflection from the outer surface of the coating, the polarized component perpendicular to the incident plane... Polarization components and those parallel to the incident plane The polarization components have different Fresnel reflectivities, thus the reflected light from the coated specular surface typically has a high degree of linear polarization. Based on this difference, the total light intensity is weighted pixel-by-pixel by measuring the degree of linear polarization to obtain the initial estimated light intensity of the coated specular reflection.

[0180] The following explanation of the phase-shifted image processing procedure is based on a fixed spatial frequency group. The spatial frequency group index is omitted unless otherwise specified. The initial light intensity separation and motion compensation module receives the first Stokes parameter output from the polarization image reconstruction and parameter calculation module. And measuring linear polarization degree Calculate the specular reflection of the initial coating to estimate the light intensity. :

[0181] ;

[0182] In the formula, Indicates the position of image pixels In the Estimated light intensity from specular reflection of the initial coating under a phase-shifting pattern; superscript This indicates that the light intensity represents the initial separation result; This represents the total light intensity at the corresponding pixel position and phase shift step. This indicates the measured linear polarization degree at the corresponding pixel position and phase shift step. and These represent the horizontal and vertical pixel indices of the image sensor, respectively. This indicates the current phase shift index.

[0183] The above calculations are used to reduce the influence of low-polarization diffuse reflection components on the initial phase solution. Since the linear polarization degree of the specular reflected light from the coating is also affected by local incident angle, surface morphology, material refractive index, and measurement noise, the initial estimated intensity of the coating specular reflection may still contain substrate diffuse reflection crosstalk and ambient light noise. Therefore, this intensity sequence is used to reconstruct the initial 3D point cloud of the coating and to provide initial data for local geometric parameter calculations; it is not used as the final separated intensity of the coating specular reflection.

[0184] Secondly, based on the phase displacement recorded by the photoelectric encoder, the initial coating specular reflection estimated light intensity image is spatially registered.

[0185] During the projection and acquisition of a set of phase-shift patterns, the coated cardboard box under test moves continuously with the conveyor belt. The same pixel position in images from different phase-shift steps may correspond to different physical positions on the cardboard box surface, failing to meet the spatial correspondence condition required for phase-shift calculation. Therefore, the first phase-shift image is used as the registration reference image, and the images from the second to the third phase-shift steps are then used for registration. The initial coating specular reflection estimation light intensity image of step 1 is registered to the reference time corresponding to the image of step 1.

[0186] While acquiring the phase transition images, the industrial control computer synchronously records the cumulative pulse count of the photoelectric encoder. According to the... The difference in the cumulative pulse count between the first step image and the first step image, along with the unit pulse displacement equivalent of the photoelectric encoder, determines the first step image. The actual physical displacement vector of the step image relative to the first step image .

[0187] in, This indicates the time from the image acquisition time of the cardboard box under test to the time of the image acquisition in step 1. The displacement vector in the world coordinate system at the moment of image acquisition. Along the conveyor belt in the world coordinate system. When the axis is running in the positive direction, direction and The positive direction of the axis is consistent, and its magnitude is equal to the product of the difference in the corresponding cumulative pulse count and the equivalent of the unit pulse displacement.

[0188] Based on the nominal height of the coated cardboard box to be tested, determine the object-side reference plane in the world coordinate system. The object-side reference plane is parallel to the upper surface of the conveyor belt, and its Z-coordinate in the world coordinate system is denoted as follows: . The Z-coordinate of the upper surface of the conveyor belt is determined based on the nominal height of the carton to be measured.

[0189] Using the intrinsic parameter matrix of a focal plane polarization camera , distortion parameter vector Rotation matrix Translation vector , will the The pixels in the step image are back-projected onto the object-side reference plane. A displacement vector is applied to the object-side coordinates obtained from the back-projection. The coordinates are translated in opposite directions, and then the translated object coordinates are projected onto the image coordinate system of step 1. The registered object coordinates are obtained through bilinear interpolation. The initial coating specular reflection is used to estimate the light intensity image.

[0190] Bilinear interpolation is used to calculate the corresponding image light intensity based on the mapped non-integer pixel coordinates. Locations mapped outside the image boundaries are marked as invalid registration pixels.

[0191] After completing the spatial registration of each phase-shifting image, take the images from step 1 to step 2. The effective area covered by the images of each step is used as the phase shift solution area, so that the light intensity data of each step at the same pixel position in this area corresponds to the same physical position on the surface of the carton to be tested.

[0192] Then, based on the actual physical displacement corresponding to each phase shift, the additional phase offset introduced by the object's motion is calculated.

[0193] The joint calibration parameters of the split-focus plane polarization camera and the digital light processing projector will be used to... The actual physical displacement vector of the step image relative to the first step image Converted to pixel displacement within the DMD image plane.

[0194] Specifically, the same physical point on the object reference plane is selected according to the acquisition position in step 1 and step 2 respectively. The acquisition position is projected onto the DMD pixel coordinate system, the difference between the two DMD pixel coordinates is calculated, and the difference is projected onto the phase increase direction of the phase shift pattern to obtain the signed equivalent DMD pixel displacement along the fringe phase change direction. .

[0195] When the phase of the phase-shifted pattern is along the DMD pixel coordinates When the direction of increase changes, Take the difference between the x-coordinates of the two DMD pixels; when the phase-shift pattern changes along other directions, Take the projection component of the DMD pixel displacement in the phase-increasing direction. When the projection component is consistent with the phase-increasing direction... Take a positive value; otherwise, take a negative value.

[0196] For the Group spatial frequency, additional phase shift introduced by motion for:

[0197] ;

[0198] In the formula, Indicates the first At the group of spatial frequencies, the first The signed additional phase offset of the step image relative to the first step image introduced by the translation of the object, in radians; Represents the signed equivalent DMD pixel displacement along the direction of fringe phase increase, in pixels; Indicates the first The stripe period of the phase-shift pattern in the DMD pixel coordinate system, in pixels; Indicates the spatial frequency group index; This indicates the phase shift index. For the image in step 1, Accordingly, .

[0199] Through the above conversion, the object displacement during phase-shift image acquisition is converted into the phase offset at the corresponding spatial frequency.

[0200] Subsequently, the corrected phase shift for each phase shift step is determined based on the standard phase shift and the additional phase offset, and non-equal interval phase shift calculation is performed.

[0201] In this embodiment, the direction of fringe phase increase is taken as the positive phase direction, and the fringe phase is... The standard phase shift of the step pattern is added to the corresponding signed additional phase shift to obtain the first step pattern. Group spatial frequency of the first The corrected phase shift of the image at step 1 relative to the image at step 1. Since the actual displacements corresponding to each phase shift step may differ, the corrected phase shifts do not need to be kept at equal intervals.

[0202] Using the phase shift values ​​corrected in each step as known quantities, a non-uniformly spaced phase-shifted intensity equation is established for the initial coating specular reflection intensity estimation sequence after spatial registration. For each effective pixel position, the equations from step 1 to step 2 are used. The light intensity observations of each step are solved by least squares to obtain the background light intensity coefficient, cosine phase coefficient, and sine phase coefficient.

[0203] Based on the obtained cosine and sine phase coefficients, the motion-compensated wrap phase is calculated using the four-quadrant arctangent function. The four-quadrant arctangent function determines the quadrant of the phase based on the signs of the two phase coefficients. The output encloses the phase in the quadrant. Interval.

[0204] In the formula, Indicates pixel position In the The wrap-around phase obtained after image registration and motion phase correction at the group spatial frequency; Indicates the spatial frequency group index.

[0205] To each The compensated wrapper phase corresponding to the spatial frequency group undergoes multi-frequency heterodyne phase unwrapping. Specifically, the integer number of periods corresponding to the wrapper phase at higher spatial frequencies is determined using the lower spatial frequency phase, and the absolute phase corresponding to the higher spatial frequencies is obtained step by step. The number of spatial frequency groups, the fringe period, and the phase unwrapping order correspond to the multiple projected phase shift patterns.

[0206] Finally, the initial 3D point cloud of the coating is reconstructed based on the compensated absolute phase and the camera-projector joint calibration parameters.

[0207] Based on the calibration relationship between absolute phase and DMD fringe coordinates, the absolute phase corresponding to each effective pixel in the focal plane polarization camera is converted into DMD pixel coordinates. The camera observation ray is determined based on the intrinsic, distortion, and extrinsic parameters of the focal plane polarization camera, and the corresponding projection ray is determined based on the intrinsic, distortion, and extrinsic parameters of the digital light processing projector.

[0208] The spatial intersection of the camera's observation ray and the projected ray is calculated using triangulation to obtain the world coordinates corresponding to each effective pixel, generating the initial 3D point cloud for the coating. When two rays cannot intersect precisely due to calibration errors or image noise, the midpoint of the shortest connecting line segment between the two rays is taken as the corresponding 3D spatial coordinate.

[0209] The initial 3D point cloud of the coating is used to characterize the initial geometry of the outer surface of the coating on the coated carton under test, in order to calculate the local unit normal vector and the local incident angle.

[0210] See attached document Figure 6 The initial 3D point cloud of the coating is obtained, and the local unit normal vector corresponding to each effective point on the surface of the coating under test is calculated. The coated cardboard box under test may have local surface tilt due to stress deformation or undulation of the internal corrugated substrate. Local surface tilt will change the incident angle of the projected light relative to the outer normal vector of the coating surface, and cause the linear polarization degree of the specular reflected light of the coating to change with spatial position.

[0211] The adaptive polarization separation module receives the initial 3D point cloud of the coating output from the initial intensity separation and motion compensation module. The initial 3D point cloud of the coating is composed of the image pixel positions. The corresponding world coordinates are represented as follows:

[0212] ;

[0213] In the formula, Indicates the position of image pixels The corresponding initial three-dimensional points on the outer surface of the coating; , and These represent the points in the world coordinate system. The X, Y, and Z coordinates in the figure; and These represent the horizontal and vertical pixel indices of the image, respectively.

[0214] Under the condition that the surface of the coating to be tested is within the system's preset slope variation range and can be represented as a single-value height surface on the world coordinate XY plane, a preset local neighborhood is selected with the target point as the center. Moving least squares local surface fitting is performed on the effective three-dimensional points within the neighborhood to obtain a locally smooth surface. The size of the local neighborhood remains constant throughout the detection process and contains at least the number of valid 3D points required for surface fitting. Based on the fitted local surface, the two spatial partial derivatives at the target location are calculated using the first-order central difference or the analytical partial derivative of the fitted surface:

[0215] ;

[0216] In the formula, The Z-coordinate of the coating surface is represented along the world coordinate system. Rate of change in the axial direction; The Z-coordinate of the coating surface is represented along the world coordinate system. The rate of change along the axial direction. Both spatial partial derivatives are dimensionless.

[0217] Calculate the local unit normal vector at the target location based on the spatial partial derivatives.

[0218] ;

[0219] In the formula, Indicates pixel position The corresponding local unit normal vector of the coating surface; the numerator represents the local unnormalized normal vector; the denominator represents the Euclidean norm of the unnormalized normal vector. The normalized local unit normal vector has a magnitude of 1.

[0220] All local unit normal vectors are uniformly oriented away from the cardboard substrate and towards the air. A world coordinate system is established. The unit vector in the positive direction of the axis is When the initially calculated local unit normal vector is When the dot product is less than zero, the local unit normal vector is inverted.

[0221] For locations where the number of valid points required for fitting is insufficient, the fitting residual exceeds the preset upper limit, or the spatial partial derivative cannot be stably calculated, these locations are marked as invalid points for the normal vector and will not participate in the subsequent weighted ratio based on the local incident angle.

[0222] Secondly, the corresponding projected light propagation unit vector is obtained by querying the optical vector lookup table based on the point cloud world coordinates at each phase transition acquisition time.

[0223] The initial 3D point cloud of the coating corresponds to the reference acquisition time of the image in step 1. For image pixel positions... The corresponding physical point on the same carton, according to the number recorded by the photoelectric encoder. Step actual physical displacement vector The reference time world coordinates of this point are translated along the direction of the conveyor belt movement to obtain the first... World coordinates at the moment of image acquisition

[0224] in, This indicates the time from the image acquisition time of the cardboard box under test to the time of the image acquisition in step 1. The world coordinate displacement generated at the moment of image acquisition; when the carton under test only undergoes rigid translation during phase-shift pattern acquisition, the local unit normal vector of the same physical point. It remains unchanged between phase shifts.

[0225] The adaptive polarization separation module uses world coordinates To retrieve coordinates, the optical vector lookup table is invoked. Since world coordinates typically do not coincide with the discrete grid nodes in the optical vector lookup table, eight adjacent grid nodes surrounding the queried coordinates are determined within the effective range of the optical vector lookup table, and trilinear interpolation is performed based on the relative positions of the queried coordinates along the three coordinate axes.

[0226] Preferably, all eight adjacent grid nodes participating in the trilinear interpolation are valid optical vector nodes. When some adjacent nodes are invalid but the number of valid nodes is not less than a preset minimum number of valid nodes... When the number of valid nodes is less than a certain threshold, the interpolation result is calculated only after normalizing the trilinear interpolation weights corresponding to the valid nodes; when the number of valid nodes is less than a certain threshold... When this happens, mark the query location as an invalid point for the optical vector query.

[0227] In the formula, This represents the minimum number of valid adjacent grid nodes required to perform optical vector interpolation. It is a positive integer not exceeding 8 and is preset based on the grid density of the optical vector lookup table and the allowable interpolation error. The direction vector obtained from trilinear interpolation is then normalized in horizontal direction to obtain the [missing value]. The unit vector of projected light propagation at the moment of image acquisition. The direction of the unit vector of projected light propagation is defined as the direction from the digital light processing projector to the point on the surface of the coating to be measured.

[0228] Then, the local incident angle corresponding to each phase shift step is calculated based on the projected light propagation unit vector and the local unit normal vector.

[0229] Inverting the unit vector of the projected light propagation yields the unit vector pointing from the point on the surface of the coating under test to the digital light processing projector:

[0230] ;

[0231] In the formula, Indicates pixel position The corresponding physical point is at the 1st The unit vector pointing to the digital light processing projector at the moment of image acquisition; Let represent the unit vector of projected light propagating from the digital light processing projector to this surface point. Calculate the dot product between the unit vector pointing to the projector and the local unit normal vector:

[0232] ;

[0233] In the formula, Represents the local incident direction cosine; symbol " " represents the dot product of vectors.

[0234] when When the local outward normal vector of a point deviates from the direction of the projector, it does not meet the frontal lighting condition in this embodiment, and the point is marked as an invalid point in terms of local lighting direction. This determination is used to identify locally backlit locations and does not indicate the detection of spatial occlusion caused by other objects or surfaces. For those meeting the conditions... The position restricts the dot product value to [the position]. Within the range, and calculate the local incident angle. :

[0235] ;

[0236] In the formula, Indicates pixel position The corresponding physical point is at the 1st The local incident angle at the moment of image acquisition, in radians; Indicates when Time to take ,when Time to take In other cases, take For the effective light-receiving point, The range of values ​​is .

[0237] Subsequently, based on the local incident angle and the coating refractive index, the theoretical linear polarization reference value under ideal Fresnel reflection conditions is calculated.

[0238] In this embodiment, the coating to be tested is a transparent or semi-transparent coating that is transparent within the working wavelength band of the digital light processing projector, so that the projected structured light can reach the surface of the substrate and the diffuse reflection light from the substrate can return to the focal plane polarization camera through the coating.

[0239] In this embodiment, the calculation condition is that the output light of the digital light processing projector is approximately unpolarized light within the detection working wavelength band. When the projector output light has a repeatable fixed initial polarization bias, the polarization bias is pre-determined using a standard reference plane, and baseline correction is performed on the collected light intensity in each polarization direction before calculating the linear polarization degree.

[0240] Using the single interface between air and coating as the Fresnel reflection calculation interface, and assuming the air refractive index is... The real part of the refractive index of the coating in the operating wavelength range of the digital light processing projector is The air refractive index can be taken as... Coating refractive index Obtained through material parameter measurement or known optical parameters of the coating material.

[0241] Neglecting the effects of coating absorption, multi-interface interference, and surface roughness on Fresnel reflectivity, the local incident angle is... air refractive index and coating refractive index Substitute into the Fresnel reflection equation and calculate polarized light reflectivity :

[0242] ;

[0243] And calculate polarized light reflectivity :

[0244] ;

[0245] In the formula, This indicates that the direction of electric field vibration is perpendicular to the incident plane. Polarized light energy reflectivity; This indicates that the direction of electric field vibration is parallel to the incident plane. Polarized light energy reflectivity; both are dimensionless quantities, with values ​​ranging from [value range missing]. ; Indicates the refractive index of air; This represents the real part of the coating's refractive index; This indicates the local angle of incidence.

[0246] Calculate the theoretical linear polarization reference value based on the reflectivity of s-polarized light and p-polarized light. :

[0247] ;

[0248] In the formula, This represents the theoretical linear polarization reference value for specularly reflected light from an ideal air-coated interface under specific incident angle and refractive index conditions; symbol This indicates taking the absolute value to ensure that the theoretical linear polarization reference value is non-negative. For a normal air-coating interface, ,and The value range is [0,1].

[0249] The theoretical linear polarization reference value is used to characterize the effect of local incident angle changes on the polarization degree of the coating specular reflection, and is not expressed as the actual maximum linear polarization degree after considering coating roughness, absorption and multilayer interference.

[0250] Finally, pixel-by-pixel separation weights are generated based on the measured linear polarization degree and the theoretical linear polarization degree reference value, and secondary light intensity separation is performed on the total light intensity.

[0251] Under the approximate conditions that the linear polarization component of the diffuse reflection light from the substrate is relatively weak and the measured main linear polarization component originates from the specular reflection light from the coating, the measured degree of linear polarization can be approximately expressed as the product of the theoretical linear polarization reference value and the proportion of the specular reflection light intensity of the coating to the total light intensity. Based on this approximation, the ratio of the measured degree of linear polarization to the theoretical linear polarization reference value is used as an estimate of the proportion of the specular reflection light intensity of the coating.

[0252] Set the threshold for calculating the theoretical linear polarization ratio. and the stability constant of the denominator And calculate the pixel-by-pixel separation weights according to the following formula. :

[0253] ;

[0254] In the formula, Indicates pixel position In the Estimated weighting of the proportion of specular reflection intensity of the coating under phase-shifting patterns; Indicates the degree of linear polarization being measured; This represents the theoretical linear polarization reference value calculated based on the local incident angle. This represents a dimensionless small positive number used to prevent the denominator from being too small; This indicates the theoretical lower limit of the linear polarization degree that allows the calculation of the linear polarization degree ratio; valid local geometric parameters mean that the local unit normal vector, the optical vector query result, and the local incident angle at that location are all valid data.

[0255] Denominator stability constant The noise level of the polarization measurement is preset based on the focal plane polarization camera. The threshold for calculating the theoretical linear polarization ratio is then used. The upper limit of the linear polarization degree measured under low polarization conditions and the preset safety margin are determined based on the standard reference plane.

[0256] When the local surface is nearly perpendicular to the incident light, the reflectivity of s-polarized light is close to that of p-polarized light, and the theoretical linear polarization reference value is relatively small. In this case, the ratio of the measured linear polarization degree to the theoretical linear polarization reference value is not used to avoid excessive amplification of noise; instead, the measured linear polarization degree is used as the initial separation weight.

[0257] The specular reflection intensity sequence of the coating is calculated based on the pixel-by-pixel separation weights and the total light intensity represented by the first Stokes parameter. :

[0258] ;

[0259] In the formula, Indicates pixel position In the The intensity of the reflected light from the coating mirror obtained by secondary intensity separation under the phase-shifting pattern; This represents the total light intensity at the corresponding pixel position and phase shift step. This indicates the estimated weight of the proportion of light intensity reflected by the coated specular surface.

[0260] The residual light intensity in the total light intensity is calculated to obtain the estimated light intensity sequence of diffuse reflection from the substrate. :

[0261] ;

[0262] In the formula, Indicates pixel position In the Estimating light intensity from diffuse reflection of substrate under phase-shifting patterns; This represents the estimated weight of the proportion of diffuse reflection intensity of the substrate to the total light intensity. Through the above processing, the local surface geometry information represented by the initial three-dimensional point cloud of the coating is used to correct the light intensity separation weights at different locations and different phase shift steps, thereby obtaining the estimated light intensity sequences for the specular reflection intensity of the coating and the diffuse reflection intensity of the substrate.

[0263] See attached document Figure 7 Based on the specular reflection intensity sequence of the coating and the estimated intensity sequence of diffuse reflection of the substrate obtained in the previous step, the three-dimensional point cloud of the outer surface of the coating and the three-dimensional point cloud of the substrate surface are reconstructed.

[0264] The layered topography reconstruction and defect parameter calculation module receives the specular reflection intensity sequence of the coating. Estimated light intensity sequence of substrate diffuse reflectance For each light intensity sequence, spatial registration of each phase-shifted image, calculation of additional phase offset, non-equidistant phase shift solution, and multi-frequency heterodyne phase expansion are performed to obtain the absolute phase corresponding to the outer surface of the coating and the absolute phase corresponding to the substrate surface.

[0265] For the specular reflection intensity sequence of the coating, based on the correspondence between absolute phase and DMD pixel coordinates, and combined with the joint calibration parameters of the split-plane polarization camera and digital light processing projector, the camera observation ray and projection ray are determined. Then, the three-dimensional coordinates of the outer surface of the coating are calculated using triangulation methods to generate a three-dimensional point cloud of the outer surface of the coating. .

[0266] For the estimated light intensity sequence of substrate diffuse reflection, considering the refraction of the projection light and substrate diffuse reflection light at the air-coating interface, the refraction correction of the projection light and the camera observation light is performed using the reconstructed 3D point cloud of the outer surface of the coating, the local unit normal vector of the outer surface of the coating, and the refractive index of the coating.

[0267] Specifically, the corresponding DMD pixel coordinates are determined based on the absolute phase of the substrate surface, and combined with the camera-projector joint calibration parameters, projection rays from the digital light processing projector pointing to the substrate and camera observation rays from the focal plane polarization camera pointing to the substrate are established respectively.

[0268] Local surface fitting is performed on the 3D point cloud of the outer surface of the coating to form a continuous fitted surface of the outer surface of the coating. The first intersection points of the projected ray and the camera observation ray with the continuous fitted surface along their respective propagation directions are calculated, and the two first intersection points are taken as the refraction points of the projected ray and the camera observation ray when passing through the air-coating interface.

[0269] Based on the local unit normal vector at each refraction point and the air refractive index Coating refractive index The direction of light propagation before refraction is calculated according to the law of refraction. The direction of propagation of the projected light and the camera observation light after entering the coating is calculated respectively, and the corresponding refraction point is taken as the starting point of the refracted light.

[0270] in, Indicates the refractive index of air; This represents the real part of the refractive index of the coating within the operating wavelength range of the digital light processing projector; the local unit normal vector uniformly points to the air side outside the coating.

[0271] The three-dimensional coordinates of the substrate surface are calculated based on the spatial intersection of the two refracted light rays. When the two refracted light rays cannot intersect precisely due to calibration errors or image measurement errors, the shortest connecting line segment between the two refracted light rays is calculated, and the midpoint of this shortest connecting line segment is used as the corresponding three-dimensional coordinate of the substrate surface, thereby generating a three-dimensional point cloud of the substrate surface. .

[0272] 3D point cloud of the outer surface of the coating The corresponding world coordinate system Z-coordinate distribution is denoted as 3D point cloud of substrate surface The corresponding world coordinate system Z-coordinate distribution is denoted as .

[0273] The specular reflection intensity sequence of the coating and the estimated diffuse reflection intensity sequence of the substrate both originate from the same pixel array of a split-plane polarization camera. Therefore, the two sets of 3D point clouds have a data correspondence in the camera pixel index. However, since the outer surface of the coating and the surface of the substrate are located in different spatial positions, and the projected light and the camera observation light are refracted at the coating interface, the points on the outer surface of the coating and the points on the surface of the substrate corresponding to the same camera pixel do not necessarily have the same world coordinates X and Y.

[0274] To establish the spatial correspondence between the two surfaces at the same object location, the three-dimensional point cloud of the coating outer surface and the three-dimensional point cloud of the substrate surface are uniformly transformed to the world coordinate system, and then interpolated and resampled to the same world coordinate XY plane mesh.

[0275] Unified world coordinate XY plane grid along the world coordinate system shaft and The grid spacing in the axial direction is denoted as follows: and Among them, subscript The parameter represents the spatial spacing of the hierarchical point cloud resampling grid, distinguishing it from the spatial spacing step size used in the optical vector lookup table. and .

[0276] After resampling, the outer surface of the coating and the surface of the substrate are on the same world coordinate grid point. The Z coordinates at each location are denoted as follows: and .

[0277] Secondly, the Z-axis coordinate difference between the outer surface of the coating and the surface of the substrate is calculated on a unified world coordinate grid to generate the Z-axis coating thickness distribution matrix.

[0278] Using the world coordinate reference plane where the upper surface of the conveyor belt is located as a reference, along the world coordinate system In the Z-axis direction, the coordinate difference between the coating outer surface and the substrate surface is calculated point by point on the grid. Coating thickness in the Z-axis direction. Determined according to the following formula:

[0279] ;

[0280] In the formula, Represents world coordinate grid points Located in the world coordinate system Coating thickness in the axial direction; This represents the Z-coordinate of the outer surface of the coating at that world coordinate grid point; This represents the Z-coordinate of the substrate surface at that world coordinate grid point; This indicates that the grid point is invalid for thickness calculation. , and Use the same unit of length.

[0281] When any layer of 3D point cloud has no valid data at the current grid point, or when a spatial correspondence cannot be established between two layers of point cloud, or If this occurs, the grid point is marked as an invalid point for thickness calculation. Invalid points for thickness calculation are not included in subsequent defect region determination, physical area calculation, and equivalent volume calculation.

[0282] Indicates the coordinate system along the world coordinate system The projected thickness along the axial direction is not directly equivalent to the normal thickness measured along the local surface normal vector direction of the coating.

[0283] Then, based on the Z-axis coating thickness distribution and the local second-order spatial difference characteristics of the two surfaces, undercoating defects, bubble defects, and substrate damage under the coating are determined. The layer morphology reconstruction and defect parameter calculation module obtains the lower limit threshold of the normal coating thickness. and thickness upper limit threshold ,in:

[0284] ;

[0285] Thickness lower limit threshold and thickness upper limit threshold The two thresholds are preset according to the allowable thickness range of the coating process, or determined based on the Z-axis coating thickness measurement results of standard good products. Same length unit. For undercoating defects, when the effective Z-axis coating thickness within a continuous grid area satisfies:

[0286] ;

[0287] When the coating is applied, the corresponding grid points are marked as candidate points for undercoating. The candidate points are then divided into connected regions according to a preset adjacent grid connectivity rule to obtain the undercoating defect region. Undercoating defects include missed coating and insufficient coating where the coating thickness is below the process lower limit.

[0288] Let the number of effective world coordinate grid cells contained in a region of underpainting defects be . The physical area of ​​the undercoating defect region is then... for:

[0289] ;

[0290] In the formula, This represents the projected area of ​​the underpainted defect region on the XY plane of the world coordinate system. Indicates the number of effective mesh cells within the connected region of the underpainting defect; and These represent the resampling grid edges of the unified world coordinate system. shaft and Grid spacing in the axial direction.

[0291] Simultaneously, the minimum and average values ​​of the coating thickness in the Z-direction within the undercoating defect area are calculated and used as the thickness quantification parameter of the undercoating defect.

[0292] For bubble defects, the coating thickness in the Z direction and the local morphology of the coating's outer surface are determined at the current world coordinate grid points. When the following conditions are met:

[0293] ;

[0294] And the Z-coordinate of the outer surface of the coating The local discrete Laplace response satisfies:

[0295] ;

[0296] When this occurs, the grid point is marked as a candidate bubble point.

[0297] In the formula, This indicates that on a unified world coordinate XY grid, according to the grid spacing... and The discretized Laplace response of the coating's outer surface was obtained using the central difference calculation; in the world coordinate system. When the positive axis points outward from the carton, negative values ​​are used to characterize the tendency of local protrusion on the outer surface of the coating.

[0298] The candidate bubble points are divided into connected regions according to the preset adjacent grid connectivity rules to obtain the bubble defect region. Discretely integrate the Z-axis thickness increment exceeding the standard coating thickness within the bubble defect region to calculate the equivalent over-thickness volume of the bubble defect. :

[0299] ;

[0300] In the formula, This represents the equivalent super-thickness volume of the bubble defect area relative to the standard coating thickness. This represents the set of valid world coordinate grid points contained in the bubble defect region; This indicates the Z-axis coating thickness at the current grid point; Indicates the standard process coating thickness; This represents the area of ​​a single world coordinate grid cell.

[0301] Standard process coating thickness The thickness is determined based on the coating process settings; when no standard process thickness is set separately, the average of the lower and upper thickness thresholds can be used, i.e.:

[0302] ;

[0303] Because the bubble defect area meets the requirements ,and Not higher than Therefore, the ultrathickness corresponding to each grid point The value is non-negative. The equivalent ultrathickness volume is used to characterize the geometric volume increase of the bubble region relative to the normal coating thickness, and is not directly equivalent to the actual volume of the closed cavity inside the bubble. For substrate damage under the coating, the Z-coordinate distribution of the substrate surface in the world coordinate system is extracted. And calculate its local discrete Laplace response. Set the substrate Laplace response threshold. When a certain world coordinate grid point simultaneously satisfies:

[0304] ;

[0305] as well as:

[0306] ;

[0307] At that time, the grid point is marked as a candidate point for substrate damage under the coating.

[0308] In the formula, This represents the discrete Laplace response of the substrate surface at the Z coordinate, calculated on a unified world coordinate XY grid. This represents the Laplace response threshold of the substrate, and its dimensions are... Same. The threshold is predetermined based on the statistical upper limit of the discrete Laplace response absolute value distribution in the standard good substrate region.

[0309] The above criteria are used to identify areas on the substrate surface with localized scratches, dents, or other morphological abnormalities, where the Z-axis coating thickness at the corresponding location remains within the normal process range. Candidate points of substrate damage under the coating are divided into regions according to preset connectivity rules to obtain the substrate damage areas under the coating.

[0310] Extract 3D points of the normal substrate surrounding the damaged area, and perform local surface fitting on these points to generate the surface of the undamaged reference substrate corresponding to the damaged area. Calculate the Z-axis distance between each substrate point within the damaged area and the surface of the undamaged reference substrate, and take the maximum value as the maximum Z-axis damage depth. Simultaneously, output the world coordinates of the point corresponding to this maximum value.

[0311] Finally, the judgment results and geometric parameters of each defect area are summarized to generate defect detection result data.

[0312] The defect detection results data should include at least: defect type, world coordinate range of defect area, world coordinates of defect feature points, physical area of ​​undercoated defect area, minimum Z-axis coating thickness and average Z-axis coating thickness of undercoated defect area, equivalent overthickness volume of bubble defect, and maximum Z-axis damage depth of substrate damage area under coating and its corresponding world coordinates.

[0313] Specific application examples (in conjunction with numerical flow):

[0314] This embodiment takes the inspection of a corrugated cardboard box with a transparent UV waterproof coating on the surface of a packaging production line as an example.

[0315] 1. Basic operating conditions are synchronized with hardware:

[0316] The conveyor belt speed was set to 0.5 m / s, and the unit pulse displacement equivalent of the photoelectric encoder was 0.01 mm / pulse. The system was configured to generate a hardware trigger every 10 mm of conveyor belt movement (i.e., 1000 pulses output by the photoelectric encoder). Upon receiving the trigger, the split-focus plane polarizing camera used a global shutter speed of 500 μs for exposure, ensuring that the physical displacement of the carton during a single exposure was only 0.25 mm, effectively avoiding motion blur. The known refractive index of the coating material (UV resin) was set to 1.52.

[0317] 2. Polarization acquisition and initial separation:

[0318] Focus on feature point A on the surface of the cardboard box, which is suspected to be a bubble defect.

[0319] Under a certain phase-shift pattern acquisition step, the system measured the interpolated light intensity in four polarization directions (0°, 45°, 90°, and 135°) in the neighborhood of feature point A. After Stokes parameter conversion, the total light intensity at point A was found to be 200 gray levels, and its actual linear polarization degree (based on interpolation of the original micro-polarization array image) was measured to be 0.60.

[0320] The system directly uses the measured linear polarization degree for initial separation, obtaining an initial specular reflection intensity of 120 (200 × 0.60) and a diffuse reflection intensity of 80 at point A. Using this initial specular reflection intensity sequence, the system preliminarily calculates the encapsulation phase and reconstructs the initial three-dimensional point cloud of the coating in this region.

[0321] 3. Adaptive polarization separation (core closed-loop correction):

[0322] Based on the initial 3D point cloud, the system performs local surface fitting on the point cloud surrounding point A, calculating that the local outward normal vector of point A is tilted by approximately 15° (i.e., there is warping or bubble protrusion on the surface of the cardboard box at this location). Using a pre-calibrated projection vector lookup table, the system finds the spatial propagation direction of the projection beam at this point, and then calculates the true local incident angle of point A to be 30°.

[0323] The system substitutes a 30° incident angle and a refractive index of 1.52 into the preset Fresnel reflection light field model and obtains that the theoretical linear polarization reference value corresponding to the ideal specular reflection light under this light-receiving posture is 0.75.

[0324] Subsequently, the system calculates the ratio of the measured linear polarization degree (0.60) to the theoretical linear polarization degree reference value (0.75), obtaining a separation weight of 0.80. Based on this, a secondary intensity separation is performed, yielding the true high-precision specular reflection intensity of point A at 160 (200 × 0.80), while the diffuse reflection intensity of the substrate is corrected to 40. (Note: This step effectively eliminates the interference of polarization degree reduction caused by local surface tilt, recovering the underestimated specular reflection component.)

[0325] 4. Layered Restructuring and Defect Identification:

[0326] See attached document Figure 8 Using the two corrected high-precision light intensity sequences, the system calculates and performs spatial refraction corrections respectively, and resamples the two surfaces to a unified world coordinate grid:

[0327] See attached document Figure 9 Bubble defect determination: At point A, the measured Z-coordinate of the coating's outer surface is 15.12 mm, and the Z-coordinate of the substrate surface is 15.00 mm, calculating the Z-axis thickness to be 120 μm. The normal thickness limit set by the process is 80 μm. Simultaneously, the discrete Laplace response of the coating's outer surface at this point is negative (showing a noticeable bulge). The system determines this area as a "bubble defect" and calculates its equivalent overthickness volume as 2.3 mm. 3 .

[0328] See attached document Figure 10 Substrate damage assessment under coating: At another feature point B on the same carton, the Z-axis coating thickness was measured to be 55 μm (within the normal range of 40–80 μm), but the Laplacian response of the three-dimensional point cloud on the substrate surface drastically exceeded the threshold. The system determined that there was a "hidden substrate indentation" at this location and output its maximum Z-axis damage depth as 0.35 mm.

[0329] To verify the superiority of the "spatial adaptive polarization separation and motion compensation" scheme of this invention, multiple sets of comparative experiments were conducted using an industrial production line platform. The comparison benchmarks included:

[0330] Method I (Traditional Phase Shift Profilometry): Without using polarization separation, the phase of the total light intensity is directly calculated.

[0331] Method II (Conventional Polarization Separation): Static global polarization separation is used (local incident angle is not calculated based on initial point cloud feedback, and Fresnel correction is not used).

[0332] The present invention employs adaptive light intensity weight allocation and dynamic error compensation.

[0333] 1. Comparison of 3D reconstruction accuracy (thickness measurement RMSE):

[0334] One hundred standard coated cardboard box samples (standard coating thickness 50μm) with high-precision film thickness gauge calibration values ​​were selected for dynamic scanning.

[0335] Method I is affected by interference and crosstalk caused by the superposition of light intensity on the front and back of the transparent coating, resulting in severe distortion of phase calculation and a root mean square error (RMSE) of 38.5 μm in the Z direction.

[0336] Method II performed reasonably well in flat areas, but in areas with warped edges and corrugated areas, the separation weights were incorrect due to changes in the local incident angle, resulting in a thickness RMSE of 14.2 μm.

[0337] The present invention introduces geometric feedback and Fresnel correction through closed loop, which effectively decouples the strong coupling relationship between morphology and polarization degree, and the thickness RMSE is significantly reduced to 2.8μm, achieving a high-precision micron-level online measurement level.

[0338] 2. Statistics on the detection rate and false alarm rate of multiple types of defects:

[0339] Tests were conducted on a test set comprising 500 samples (including 150 artificially implanted air bubble defects, 100 undercoating defects, and 80 scratches / dents on the substrate under the coating).

[0340] Bubble and undercoating detection: The bubble detection rate of the present invention reaches 99.3%, the undercoating detection rate is 98.5%, and the false alarm rate is only 0.4%. In contrast, Method II cannot adapt to curvature changes and often misjudges the polarization attenuation at the normal corrugated peak as undercoating, with a false alarm rate as high as 8.7%.

[0341] Detection of substrate damage under coating: Because the present invention performs rigorous double-layer point cloud refraction correction (taking into account the deflection of light passing through the coating interface), the detection rate of minor substrate damage reaches 96.2%, which is significantly better than traditional visual 2D detection (which can only detect the surface and the detection rate of the bottom layer is less than 20%).

[0342] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A machine vision-based online inspection system for multiple defects in cardboard boxes, characterized in that, For use with corrugated cardboard boxes whose surfaces are coated with a transparent coating, the system includes: An image acquisition module is used to project a structured light pattern onto the surface of the corrugated cardboard box and simultaneously acquire a polarization image corresponding to the structured light pattern under hardware triggering. The data processing module is used to perform the following steps: The initial total light intensity and the degree of linear polarization are obtained from the polarization image; Initial light intensity separation is performed using the measured linear polarization degree to reconstruct the initial three-dimensional point cloud of the corrugated cardboard box; The local surface normal vector at the target feature point is obtained from the initial three-dimensional point cloud, and the local incident angle at the target feature point is calculated in combination with the predetermined incident light propagation direction; The local incident angle is substituted into the preset Fresnel reflection light field model to calculate the theoretical linear polarization reference value, and the separation weight is calculated based on the ratio of the measured linear polarization to the theoretical linear polarization reference value. The initial total light intensity is subjected to secondary light intensity separation according to the separation weight, and the corrected specular reflection light intensity of the coating and the diffuse reflection light intensity of the substrate are obtained respectively. Based on the corrected specular reflection intensity of the coating and the diffuse reflection intensity of the substrate, the outer surface of the coating and the surface of the substrate are reconstructed respectively, wherein refraction correction is performed when reconstructing the surface of the substrate. Unify the outer surface of the coating and the surface of the substrate to the same coordinate system or coordinate grid, calculate the spatial normal distance between the outer surface of the coating and the surface of the substrate based on this, and determine the defect type by combining the discrete Laplace response of the outer surface of the coating and the surface of the substrate.

2. The machine vision-based online multi-defect detection system for cardboard boxes according to claim 1, characterized in that, The image acquisition module includes a photoelectric encoder and a focal plane polarization camera; The photoelectric encoder is used to generate a trigger signal when it senses that the corrugated cardboard box has reached a preset trigger displacement interval. The focal plane polarization camera is used to perform exposure using a global shutter after receiving the trigger signal, so as to output the polarization image containing the light intensity of four polarization directions.

3. The online multi-defect detection system for cardboard boxes based on machine vision according to claim 1, characterized in that, The step of obtaining the initial total light intensity and measuring the degree of linear polarization based on the polarization image specifically includes: The interpolated light intensities of four different polarization directions in the polarization image are extracted and Stokes parameter conversion is performed to obtain the initial total light intensity and the measured linear polarization degree at the target feature point; The initial coating specular reflection intensity is obtained by multiplying the measured linear polarization degree by the initial total light intensity, and the wrapping phase is calculated using the initial coating specular reflection intensity to obtain the initial three-dimensional point cloud.

4. The machine vision-based online multi-defect detection system for cardboard boxes according to claim 1, characterized in that, The step of obtaining the local surface normal vector at the target feature point specifically includes: Local surface fitting is performed on the point cloud surrounding the target feature point in the initial three-dimensional point cloud, and the local surface normal vector of the target feature point is calculated. The spatial propagation direction of the projection beam is determined by combining the pre-calibrated system projection vector lookup table, and the true local incident angle at the target feature point is calculated based on the spatial propagation direction of the projection beam and the local surface normal vector.

5. The machine vision-based online multi-defect detection system for cardboard boxes according to claim 4, characterized in that, The step of substituting the local incident angle into a preset Fresnel reflection light field model to calculate the theoretical linear polarization reference value specifically includes: Obtain the known refractive index of the transparent coating; Substituting the actual local incident angle and the known refractive index into the Fresnel reflection light field model, the theoretical linear polarization reference value corresponding to the ideal specular reflected light under the current light-receiving posture is calculated.

6. The online multi-defect detection system for cardboard boxes based on machine vision according to claim 1, characterized in that, The step of performing secondary light intensity separation on the initial total light intensity according to the separation weight specifically includes: The product of the initial total light intensity and the separation weight is taken as the corrected specular reflection light intensity of the coating. The difference between the initial total light intensity and the corrected specular reflection light intensity of the coating is taken as the corrected diffuse reflection light intensity of the substrate.

7. The online multi-defect detection system for cardboard boxes based on machine vision according to claim 1, characterized in that, The reconstructing of the outer surface of the coating and the surface of the substrate respectively specifically includes: The three-dimensional coordinates are calculated using the corrected specular reflection intensity of the coating to obtain the outer surface of the coating; The substrate diffuse reflection intensity is calculated using the corrected intensity, and spatial refraction correction is performed considering the deflection of light passing through the coating interface to obtain the substrate surface that is unified with the outer surface of the coating to the world coordinate grid.

8. The online multi-defect detection system for cardboard boxes based on machine vision according to claim 1, characterized in that, The method of determining the defect type by combining the discrete Laplace response of the outer surface of the coating and the surface of the substrate specifically includes: When the measured thickness of the Z-axis coating is greater than the upper limit of the normal thickness set by the process, and the discrete Laplace response of the outer surface of the coating at the target feature point is negative, the area where the target feature point is located is determined to be a bubble defect.

9. The online multi-defect detection system for cardboard boxes based on machine vision according to claim 1, characterized in that, The method of determining the defect type by combining the discrete Laplace response of the outer surface of the coating and the surface of the substrate specifically includes: When the measured thickness of the Z-axis coating is within the set normal thickness range, and the absolute value of the discrete Laplace response on the substrate surface at the target feature point exceeds a preset threshold, the area where the target feature point is located is determined to be a substrate damage defect under the coating.

10. The online multi-defect detection system for cardboard boxes based on machine vision according to claim 1, characterized in that, The data processing module is also used for: When a bubble defect is identified, the part of the Z-axis coating thickness that exceeds the normal thickness limit is integrated using the set upper limit of normal thickness as the integration benchmark, and the equivalent over-thickness volume of the bubble defect is output. When a defect is identified as a damage defect in the substrate under the coating, the Z-direction distance deviation of the substrate surface at the target feature point relative to the surface of the undamaged reference substrate is extracted, and the maximum value of the Z-direction distance deviation is taken as the maximum Z-direction damage depth of the damage defect in the substrate under the coating.