Machine vision detection method and system for sealing integrity of fresh stewed yolk bottle cap
By combining structured light measurement and elasticity model inversion, the problems of posture deviation and illumination change in the sealing detection of fresh stewed bird's nest bottle caps were solved, and a stable and quantitative judgment of sealing integrity was achieved.
Patent Information
- Application Number
- CN202611588022.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-14
- Publication Date
- 2026-11-24
AI Technical Summary
Existing methods for testing the seal of freshly stewed bird's nest bottle caps are susceptible to factors such as cap posture deviation, fixture positioning error, surface reflection, water mist interference, and instability in judging a single height threshold, making it difficult to achieve stable and quantitative determination of seal integrity.
By acquiring structured light images of the bottle cap under reference and detection conditions, the out-of-plane displacement field of the safety button area and the in-plane strain field of the bottle cap surface are extracted. Combined with the elastic mechanical response model, the equivalent vacuum degree is solved to determine the seal integrity.
It reduces the impact of bottle cap posture deviation and lighting changes on the test results, provides a clear physical meaning for the determination of seal integrity, and can identify abnormal test conditions.
Smart Images

Figure CN123160966A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of machine vision non-destructive testing technology, specifically relating to a machine vision inspection method and system for the sealing integrity of bottle caps of freshly stewed bird's nest. Background Technology
[0002] Freshly stewed bird's nest products are typically packaged in glass bottles with metal screw caps for airtight sealing. After sealing, sterilization, and cooling, the gas pressure inside the bottle decreases, creating a negative pressure state relative to the external atmospheric pressure. Under this negative pressure, the safety button area on the top of the cap will elastically indent inwards. When the cap is not properly sealed or there is a minor leak, the vacuum level inside the bottle decreases, the indentation of the safety button area decreases, and it may even spring back or bulge. Therefore, the deformation state of the safety button area can serve as an important indicator of the integrity of the seal on the freshly stewed bird's nest bottle cap.
[0003] Existing testing methods mainly include manual pressure testing, negative pressure sampling, two-dimensional image testing, and three-dimensional depth testing. Manual pressure testing is highly subjective and has low efficiency, making it difficult to meet the needs of online testing; negative pressure sampling is a sampling inspection and cannot cover all products; two-dimensional image testing is easily affected by bottle cap reflection, ink depth, varnish layer, water mist, and changes in ambient light; although three-dimensional depth testing can obtain bottle cap height information, the bottle cap screwing angle, thread fit error, bottle body posture deviation, and fixture positioning error can all introduce rigid body tilt, offset, and local installation deformation, causing a reference drift in the directly extracted safety button recess height.
[0004] Meanwhile, the surface of bottle caps for freshly stewed bird's nest typically features fixed embossed characters, trademark outlines, decorative patterns, or raised / recessed codes. These embossed structures are fixedly connected to the metal substrate of the bottle cap and deform synchronously with the cap surface. Existing technologies usually only perform simple splicing, weighting, or classification judgments of two-dimensional image features and three-dimensional depth features, failing to fully utilize the physical relationship that the displacement of the safety button from the surface and the in-surface strain of the bottle cap both originate from the same elastic deformation process. This results in the detection results lacking a clear physical meaning of vacuum degree and making it difficult to stably suppress the influence of posture interference, manufacturing errors, and surface anomalies.
[0005] Therefore, there is a need for a machine vision inspection method and system for the sealing integrity of bottle caps of fresh stewed bird's nest, so as to stably acquire out-of-plane deformation of the safety button area and in-plane deformation of the bottle cap surface in a production line environment, and realize the quantitative determination of the sealing integrity of bottle caps of fresh stewed bird's nest by jointly inverting the equivalent vacuum degree through a physical model. Summary of the Invention
[0006] To address the problems of existing methods for detecting the seal integrity of fresh stewed bird's nest bottle caps being easily affected by cap posture deviations, fixture positioning errors, surface reflections, water mist interference, and the instability of single height threshold judgments, this invention provides a machine vision detection method and system for the seal integrity of fresh stewed bird's nest bottle caps. By performing structured light measurements on the same fresh stewed bird's nest bottle cap in both a baseline state and a detection state, the out-of-plane displacement field of the safety button area and the in-plane strain field of the bottle cap surface are extracted. Based on an elastic mechanical response model, the equivalent vacuum degree is jointly inverted, thereby achieving a quantitative determination of the seal integrity of fresh stewed bird's nest bottle caps.
[0007] In a first aspect, the present invention provides a machine vision inspection method for the sealing integrity of bottle caps used for stewing bird's nest, comprising: Structured light images of the same fresh stewed bird's nest bottle cap were acquired in both the baseline and detection states, and the baseline absolute phase map, detection absolute phase map, baseline 3D point cloud, and detection 3D point cloud were calculated respectively. The attitude of the reference 3D point cloud and the detection 3D point cloud is normalized using the outer periphery geometry and the top surface reference area of the bottle cap to obtain the reference height field and the detection height field under the unified local coordinate system of the bottle cap. The out-of-surface displacement field of the safety button area is extracted from the difference between the reference height field and the detection height field; Phase gradient features are extracted from the fixed imprint structure region in the reference absolute phase image and the detection absolute phase image. Feature matching and sub-pixel displacement are performed to obtain the in-plane displacement field on the bottle cap surface and calculate the in-plane strain field. The out-of-plane displacement field and in-plane strain field of the safety button area are input into the elastic mechanical response model established by the bottle cap material parameters, geometric parameters and vacuum calibration data. A joint inversion objective function including out-of-plane displacement residual, in-plane strain residual and residual attitude compensation parameter terms is constructed. The equivalent vacuum degree is solved and the joint inversion residual is obtained. The results of the seal integrity judgment of the fresh stewed bird's nest bottle cap are output according to the equivalent vacuum degree, joint inversion residual and detection confidence. The detection confidence is calculated by the effective point ratio, the number of feature matching, the matching residual and the observation consistency formed by the difference between the inversion value of the out-of-plane displacement field and the inversion value of the in-plane strain field.
[0008] Furthermore, the baseline state is the baseline collection state after the fresh stewed bird's nest bottle cap is filled and sealed and before entering the sterilization or cooling process. The acquisition of structured light images of the same fresh stewed bird's nest bottle cap under the reference state includes performing multiple phase-shift projections on the top surface and outer peripheral area of the bottle cap, obtaining a reference absolute phase map by unwrapping according to the phase shift, and converting the reference absolute phase map into a reference three-dimensional point cloud according to the calibration parameters of the structured light system. The baseline absolute phase map and the baseline 3D point cloud were established as a single paired dataset of freshly stewed bird's nest bottle caps.
[0009] Furthermore, the detection status refers to the online detection status after the same fresh stewed bird's nest bottle cap has completed sterilization, cooling, or vacuuming and reached the preset detection time; The acquisition of structured light images of the same fresh stewed bird's nest bottle cap in the detection state includes using the same projection sequence and calibration parameters as the structured light image in the reference state, calculating the detection absolute phase map and the detection 3D point cloud, and adding the detection absolute phase map and the detection 3D point cloud to the same fresh stewed bird's nest bottle cap pairing dataset.
[0010] Furthermore, the pose normalization includes: Fit the outer cylindrical axis or the center of the outer annulus of the bottle cap to the reference 3D point cloud and the detection 3D point cloud, respectively; After removing the safety button area, the fixed embossed structure area, and the saturated reflective area, the top surface reference area is extracted. Establish a transverse origin based on the axis of the outer cylinder or the center of the outer ring; Establish the zero-height position based on the fitted plane of the top reference area; The baseline 3D point cloud and the detected 3D point cloud are resampled to a unified local coordinate grid of the bottle cap.
[0011] Furthermore, the extraction of the out-of-plane displacement field of the safety button region includes: Within a unified local coordinate grid of the bottle cap, effective points are selected for the reference height field and the detection height field, and the difference between the reference height field and the detection height field is calculated. The global translation, tilt, and residual rotation components in the difference field are fitted and subtracted. The difference field after subtraction is confined to the safety button region to obtain the out-of-plane displacement field of the safety button region; The out-of-surface displacement field of the safety button region is used as the observation input for the out-of-surface displacement residual.
[0012] Furthermore, the fixed embossing structure area is the area on the bottle cap surface where the fixed embossed characters, fixed trademark outline, fixed decorative pattern, or fixed embossed code are located; The extraction of the phase gradient features includes: Calculate the first-order gradient magnitude and gradient direction of the absolute phase within the fixed imprint structure region, and generate feature candidate points by combining the height gradient and projection modulation. Local extremum filtering, saturation reflection filtering, and gradient direction distribution filtering are performed on the feature candidate points to retain feature points located at the imprint edge or imprint corner; Generate phase gradient direction histogram descriptors for feature points.
[0013] Furthermore, the feature matching and sub-pixel displacement solution includes: An initial matching set is formed using the distances of the phase gradient direction histogram descriptors; Random consistency estimation is used to eliminate matching points that do not meet the consistency constraints; Establish local windows for phase gradient and height gradient around each preserved matching point; Subpixel in-plane displacement is obtained by minimizing the gradient residual within the window; Local weighted least squares fitting is performed on the sub-pixel in-plane displacement according to the matching confidence weight and the neighborhood distance weight to obtain the in-plane displacement field. The in-plane strain field is calculated from the spatial derivative of the in-plane displacement field.
[0014] Furthermore, the establishment of the elastic mechanical response model includes: Obtain the elastic modulus, Poisson's ratio, thickness distribution, initial curvature of the top surface, diameter and height of the safety button, fixed embossed structure stiffness correction term and bottle mouth support boundary conditions of the bottle cap material; By comparing the finite element calculation results with the vacuum calibration data, the effects of effective elastic modulus, support stiffness, initial curvature of the top surface and stiffness of the fixed imprint structure are corrected. A response library between vacuum degree, out-of-plane displacement response and in-plane strain response is established using the fusion results of the finite element calculation results and the vacuum calibration data. Record out-of-plane displacement samples and in-plane strain samples under different known internal and external pressure differences in the vacuum calibration data; By comparing the finite element calculation results with the vacuum calibration data, the effects of effective elastic modulus, support stiffness, initial curvature of the top surface, and stiffness of the fixed imprint structure are corrected. A response library is established between vacuum degree, out-of-plane displacement response, and in-plane strain response using the fusion results of the finite element calculation results and the vacuum calibration data.
[0015] Furthermore, the joint inversion objective function includes scale-normalized out-of-plane displacement residuals, scale-normalized in-plane strain residuals, residual attitude compensation parameter terms, and vacuum degree value range constraint terms. A piecewise loss function is used to reduce the weight of observation points whose residuals exceed the preset residual inflection threshold, and the equivalent vacuum degree is solved by bounded one-dimensional search or damped least squares. When the equivalent vacuum degree falls within the preset qualified vacuum range, the joint inversion residual is less than the preset residual threshold, and the detection confidence is greater than the preset confidence threshold, the sealing qualification judgment is output. When the equivalent vacuum degree does not fall within the preset qualified vacuum range, a sealing abnormality judgment is output. When the equivalent vacuum degree falls within the preset qualified vacuum range, and meets at least one of the following conditions: the joint inversion residual is not less than the preset residual threshold, and the detection confidence is not greater than the preset confidence threshold, a re-inspection judgment is output.
[0016] In a second aspect, the present invention provides a machine vision inspection system for the sealing integrity of bottle caps used in the production of freshly stewed bird's nest, comprising: The structured light acquisition module is configured to acquire structured light images of the same fresh stewed bird's nest bottle cap in both the reference and detection states, and to respectively calculate the reference absolute phase map, the detection absolute phase map, the reference 3D point cloud, and the detection 3D point cloud. The attitude normalization module is configured to normalize the attitude of the reference 3D point cloud and the detection 3D point cloud using the outer periphery geometry and the top surface reference area of the bottle cap, so as to obtain the reference height field and the detection height field under the unified local coordinate system of the bottle cap. The out-of-plane displacement extraction module is configured to extract the out-of-plane displacement field of the safety button area from the difference between the reference height field and the detection height field. The in-plane strain calculation module is configured to extract phase gradient features from the fixed imprint structure region in the reference absolute phase map and the detection absolute phase map, perform feature matching and sub-pixel displacement solution, obtain the in-plane displacement field of the bottle cap surface and calculate the in-plane strain field. The vacuum degree inversion module is configured to input the out-of-plane displacement field and in-plane strain field of the safety button area into the elastic mechanical response model established by the bottle cap material parameters, geometric parameters and vacuum calibration data, construct a joint inversion objective function including out-of-plane displacement residual, in-plane strain residual and residual attitude compensation parameter terms, solve for the equivalent vacuum degree and obtain the joint inversion residual; The judgment output module is configured to output the judgment result of the sealing integrity of the fresh stewed bird's nest bottle cap according to the equivalent vacuum degree, joint inversion residual and detection confidence. The detection confidence is calculated by the effective point ratio, the number of feature matching, the matching residual and the observation consistency formed by the difference between the inversion value of the out-of-plane displacement field and the inversion value of the in-plane strain field.
[0017] The beneficial effects of this invention are: This invention acquires structured light images of the same freshly stewed bird's nest bottle cap in both a baseline and a detection state to obtain baseline and detection 3D point clouds. Based on the difference between the two, it calculates the out-of-surface displacement field of the safety button area, which can reduce the influence of the original curved surface of the bottle cap, manufacturing errors, and initial assembly state on the extraction of the indentation amount.
[0018] This invention normalizes the attitude of the reference 3D point cloud and the detection 3D point cloud by using the outer periphery geometry and top surface reference area of the bottle cap. This can reduce the impact of bottle cap attitude deviation, fixture positioning deviation and rigid body pose difference between two acquisitions on the detection results.
[0019] This invention utilizes the phase gradient features of a fixed embossing structure region for feature matching and sub-pixel displacement calculation. The fixed embossing structure deforms together with the metal surface of the bottle cap. Compared with detection methods that rely solely on grayscale texture, this invention can reduce the impact of changes in illumination, ink depth, and some reflections on in-surface displacement tracking.
[0020] This invention calculates the in-plane strain field from the in-plane displacement field, and inputs the out-of-plane displacement field and the in-plane strain field of the safety button area into the elastic mechanical response model. The equivalent vacuum degree is solved by jointly inverting the objective function, so that the detection result has a clear physical meaning.
[0021] This invention introduces residual attitude compensation parameters into the joint inversion objective function, which can absorb the small translation, tilt and residual rotation errors between two structured light acquisitions, and reduce the impact of residual attitude errors on the solution of equivalent vacuum degree.
[0022] This invention outputs the seal integrity judgment result based on the equivalent vacuum degree, joint inversion residual and detection confidence. It can identify and output the re-inspection judgment for detection anomalies such as missing point cloud, insufficient feature matching and inconsistent observation while outputting the seal qualification or seal abnormality judgment. Attached Figure Description
[0023] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is the main flowchart of a machine vision inspection method for the sealing integrity of a bottle cap for freshly stewed bird's nest, as proposed in the first embodiment of the present invention. Figure 2 This is a flowchart of the steps for normalizing the pose of the reference 3D point cloud and the detected 3D point cloud in the first embodiment of the present invention. Figure 3 This is a flowchart of the steps for phase gradient feature extraction, feature matching, sub-pixel displacement solution, and in-plane strain calculation based on a fixed imprinted structure region in the first embodiment of the present invention. Figure 4 This is a flowchart of the steps in the first embodiment of the present invention to perform joint inversion of vacuum degree based on elastic mechanical response model and output the result of the seal integrity judgment of fresh stewed bird's nest bottle cap; Figure 5 This is a structural block diagram of a machine vision inspection system for the sealing integrity of bottle caps of freshly stewed bird's nest, as proposed in the second embodiment of the present invention. Detailed Implementation
[0024] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It is understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the invention. It should be noted that, unless otherwise specified, the embodiments and technical features described herein can be combined with each other.
[0025] This application applies to testing scenarios for freshly stewed bird's nest products sealed in glass bottles and metal caps, particularly for online non-destructive testing scenarios where negative pressure is created inside the bottle after sealing, sterilization, cooling, or vacuuming. The test object is the bottle cap of freshly stewed bird's nest, which has a safety button area capable of deforming with changes in the pressure difference between the inside and outside of the bottle, and a fixed embossed structure area consisting of fixed embossed characters, fixed trademark outlines, fixed decorative patterns, or fixed raised and recessed codes.
[0026] The detection equipment may include a projection unit, an imaging unit, a triggering unit, and a data processing unit. The projection unit is used to project phase-shifted structured light onto the bottle cap of the fresh stewed bird's nest; the imaging unit is used to acquire the structured light image modulated on the surface of the bottle cap; the triggering unit is used to trigger the structured light acquisition based on the positioning signal of the bottle cap; and the data processing unit is used to complete phase calculation, 3D reconstruction, attitude normalization, displacement and strain calculation, equivalent vacuum degree inversion, and seal integrity determination.
[0027] The first embodiment of this invention proposes a machine vision inspection method for the sealing integrity of bottle caps of freshly stewed bird's nest, comprising the following steps: S10: Collect structured light images of the same fresh stewed bird's nest bottle cap in the reference state and the detection state, and respectively calculate the reference absolute phase map, the detection absolute phase map, the reference 3D point cloud and the detection 3D point cloud; S20: Normalize the attitude of the reference 3D point cloud and the detection 3D point cloud using the outer periphery geometry and the top surface reference area of the bottle cap to obtain the reference height field and the detection height field under the unified local coordinate system of the bottle cap. S30: Extract the out-of-surface displacement field of the safety button area from the difference between the reference height field and the detection height field; S40: Extract phase gradient features from the fixed imprint structure region in the reference absolute phase map and the detection absolute phase map, perform feature matching and sub-pixel displacement solution, obtain the in-plane displacement field of the bottle cap surface and calculate the in-plane strain field. S50: Input the out-of-plane displacement field and in-plane strain field of the safety button area into the elastic mechanical response model established by the bottle cap material parameters, geometric parameters and vacuum calibration data, construct a joint inversion objective function including out-of-plane displacement residual, in-plane strain residual and residual attitude compensation parameter terms, solve the equivalent vacuum degree and obtain the joint inversion residual; S60: Output the seal integrity judgment result of the fresh stewed bird's nest bottle cap according to the equivalent vacuum degree, joint inversion residual and detection confidence. The detection confidence is calculated by the effective point ratio, the number of feature matching, the matching residual and the observation consistency formed by the difference between the inversion value of the out-of-plane displacement field and the inversion value of the in-plane strain field.
[0028] To more clearly illustrate the machine vision inspection method for the sealing integrity of a bottle cap used for stewing bird's nest according to the present invention, the following description is provided in conjunction with... Figure 1 The steps in the embodiments of the present invention are described in detail below.
[0029] S10: Collect structured light images of the same fresh stewed bird's nest bottle cap in the reference state and the detection state, and respectively calculate the reference absolute phase map, the detection absolute phase map, the reference 3D point cloud and the detection 3D point cloud; In this embodiment, step S10 includes: Step S11: Set the baseline state to the baseline collection state after the fresh stewed bird's nest bottle cap is filled and sealed and before entering the sterilization or cooling process. Step S12: Perform multiple phase-shift projections on the top surface and outer periphery of the bottle cap, obtain the reference absolute phase map by unwrapping the phase shift, and convert the reference absolute phase map into a reference three-dimensional point cloud according to the calibration parameters of the structured light system. Step S13: Establish the reference absolute phase map and the reference 3D point cloud as the same fresh stewed bird's nest bottle cap paired dataset; Step S14: Set the detection status to the online detection status after the same fresh stewed bird's nest bottle cap has completed sterilization, cooling or vacuuming and reached the preset detection time; Step S15: Using the same projection sequence and calibration parameters as the structured light image in the reference state, calculate the detection absolute phase map and the detection 3D point cloud; Step S16: Add the detected absolute phase map and the detected 3D point cloud to the same fresh stewed bird's nest bottle cap pairing dataset.
[0030] In practice, the baseline data acquisition station is set after the filling and sealing equipment and before the sterilization equipment. When the fresh stewed bird's nest bottle cap is screwed on and arrives at the baseline data acquisition station, the conveyor belt encoder, pallet position number, bottle identification code, or cycle sequence number in the production controller forms the product identifier for the current fresh stewed bird's nest bottle cap. The product identifier, along with the baseline data acquisition time, camera frame number, projection sequence number, and equipment number, is written into the paired dataset. When using a pallet conveying method, the pallet number and the position number within the pallet are combined as the product identifier; when using a continuous conveying method, the encoder pulse interval, trigger time, and visual positioning result are combined to form the product identifier.
[0031] The structured light acquisition device includes a projection unit, an imaging unit, a light-shielding unit, and a triggering unit. The projection unit projects phase-shifted fringes toward the top surface of the fresh-stewed bird's nest bottle cap, and the imaging unit acquires the fringed image modulated by the bottle cap surface from a position with a preset angle to the projection direction. The light-shielding unit surrounds the acquisition space above the fresh-stewed bird's nest bottle cap to reduce ambient light variations caused by workshop lighting, water vapor reflection, and equipment indicator lights.
[0032] When the lateral deviation of the center of the fresh stewed bird's nest bottle cap from the target acquisition position is no greater than 1.0 mm and the angle between the bottle cap's axis and the nominal axis of the acquisition device is no greater than 2°, the trigger unit simultaneously sends a hardware trigger signal to the projection unit and the imaging unit. If the above acquisition position conditions are not met, the conveying mechanism continues to adjust the position of the fresh stewed bird's nest bottle cap or outputs a positioning anomaly mark.
[0033] In one exemplary configuration, the projection sequence comprises three sets of fringe frequencies, each employing a 12-step phase shift, with 36 structured light images acquired in a single state. The fringe period numbers for the three sets of fringe frequencies are set to 1, 8, and 64, respectively. Camera exposure time, projection brightness, camera gain, phase shift steps, fringe direction, and acquisition order remain consistent between the baseline and detection states.
[0034] For metal bottle caps with high reflectivity, the exposure time is determined through no-load testing to ensure that the grayscale of the main effective pixels in the 8-bit image is between 20 and 240; pixels with a grayscale of 250 or higher are marked as saturated pixels. For bottle caps with large local reflectivity differences, two sets of different exposure times can be used to acquire the same phase shift position, and effective pixels are selected from the unsaturated images with high projection modulation.
[0035] For each fringe frequency, the wrapping phase is calculated based on the sine and cosine components of each phase-shifted image at the same camera pixel. The higher-frequency phases are then progressively expanded according to the fringe order provided by the lower-frequency phases, forming a reference absolute phase map and a detection absolute phase map. The projection modulation is calculated simultaneously during phase resolution. Pixels with a projection modulation below 0.15, saturated image grayscale, missing frames in the phase-shifted sequence, or discontinuous multi-frequency expansion results are marked as invalid points. Invalid point markings are saved along with the absolute phase values, ensuring that subsequent point cloud reconstruction, feature extraction, and inversion processes can read the same quality state.
[0036] The calibration parameters of the structured light system include camera intrinsic parameters, projection unit intrinsic parameters, extrinsic parameters between the camera and the projection unit, and mapping parameters between absolute phase and projection coordinates. For each effective camera pixel, the corresponding position in the projection unit is determined based on the absolute phase, and then triangulation is performed using the camera imaging ray and the projection ray to obtain the three-dimensional coordinates of the points on the surface of the fresh stewed bird's nest bottle cap.
[0037] For cases where two rays cannot intersect precisely due to calibration errors, the midpoint of the line connecting the closest points of the two rays is used as the three-dimensional coordinate, and the closest distance is recorded as the reconstruction residual. After forming the reference three-dimensional point cloud and the detection three-dimensional point cloud respectively, points with insufficient projection modulation, abnormal phase unfolding, reconstruction residuals exceeding 0.08 mm, and significantly larger local statistical distances are removed.
[0038] Neighborhood interpolation is performed on small missing regions with an area not exceeding nine bottle cap local coordinate grid cells. Interpolation points retain interpolation markers and are assigned weights lower than those of measured points in subsequent calculations. Large, continuous missing regions are left invalid to prevent the surface morphology formed by completion from being included in the equivalent vacuum degree inversion.
[0039] The detection and data acquisition station is located after the sterilization, cooling, or vacuuming processes. The system reads the reference absolute phase image and reference 3D point cloud of the same fresh-stewed bird's nest bottle cap based on the product identification, and completes the detection status acquisition using the same projection sequence and calibration parameters. The detection absolute phase image and detection 3D point cloud are only paired with reference data that have the same product identification, a complete reference projection sequence, and a consistent equipment calibration version.
[0040] When product identification cannot be matched, calibration versions are inconsistent, or reference data is missing, the same fresh-stewed bird's nest bottle cap paired dataset is marked as unusable for normal inversion, and the re-inspection judgment result is output in step S60. The same fresh-stewed bird's nest bottle cap paired dataset includes at least the product identification, reference absolute phase map, detection absolute phase map, reference 3D point cloud, detection 3D point cloud, valid point mask of the two acquisitions, projection modulation map, acquisition time, and calibration version.
[0041] The baseline data is generated before the sterilization or cooling process and stored in a storage area accessible to the online processing equipment at the time of detection. The detection data is generated after the same freshly stewed bird's nest bottle cap has undergone sterilization, cooling, or vacuuming and reached the specified detection time. Therefore, both the baseline object and the detection object used for subsequent difference calculations are available before the start of step S20.
[0042] In this embodiment, a repeatable positioning fixture can be used at the same data collection station to sequentially form a baseline state and a detection state. This implementation method is suitable for offline calibration or sampling verification, and the product identification is formed by the fixture number and the sample number. When using a dual-station online method or a single-station offline method, the data entering step S20 are all paired data formed by the same fresh stewed bird's nest bottle cap in the baseline state and the detection state.
[0043] S20: Normalize the attitude of the reference 3D point cloud and the detection 3D point cloud using the outer periphery geometry and the top surface reference area of the bottle cap to obtain the reference height field and the detection height field under the unified local coordinate system of the bottle cap. See Figure 2 In this embodiment, step S20 includes: Step S21: Fit the outer cylindrical axis or the center of the outer ring of the bottle cap to the reference 3D point cloud and the detection 3D point cloud respectively. Step S22: After removing the safety button area, the fixed embossing structure area, and the saturated reflective area, extract the top surface reference area; Step S23: Establish a transverse origin based on the axis of the outer cylinder or the center of the outer ring; Step S24: Establish the height zero point based on the fitted plane of the top reference area; Step S25: Resample the reference 3D point cloud and the detected 3D point cloud to a unified bottle cap local coordinate grid.
[0044] Establish a local coordinate system for the bottle cap with its center as the origin. The horizontal coordinate is defined as follows: and Both are in millimeters; the height coordinates are... The units are millimeters, and the points are positioned along the axial direction of the bottle cap. The direction in which the safety button is recessed into the bottle is defined as the positive direction of out-of-surface displacement. The reference 3D point cloud and the detected 3D point cloud are geometrically fitted in their respective acquisition coordinate systems, and then transformed to the local coordinate system of the bottle cap.
[0045] For bottle caps of freshly stewed bird's nest with a continuous outer skirt, a set of points with gentle height changes and circumferential continuity is extracted from the outer periphery of the cap. The outer cylindrical axis is obtained by cylindrical fitting with outlier removal. In cases where the outer cylindrical surface is occluded and only the top outer circle can be obtained, the outer circular arc is extracted from multiple height slices and the center of the outer circular ring is jointly fitted.
[0046] For cylindrical or annular fitting, initial values are generated using stochastic consistency estimation, and then updated using least-squares distances from valid points to the fitted geometry. If the valid arc coverage angle is less than 210° or the fitting residual is greater than 0.10 mm, the peripheral positioning results are marked as low confidence.
[0047] The top reference area is set as an annular region outside the safety button area and inside the cap shoulder area. Taking a 38mm diameter bottle cap as an example, the top reference area is selected as an annular band with a radius of 16.5mm to 18.0mm from the center of the bottle cap. When extracting the top reference area, the safety button area is removed according to the bottle cap specification mask, the areas containing fixed characters, fixed trademark outlines, and fixed decorative patterns are removed according to the fixed embossing structure mask, and areas exhibiting saturated reflection under the baseline or detection state are removed according to the saturation mask collected from the two acquisitions.
[0048] Fit a local plane to the remaining points. If the root mean square residual of the local plane is no greater than 0.03 mm, and the angle between the local plane normal and the global normal of all candidate reference points is no greater than 3°, the corresponding point is retained as the top surface reference point. Points that do not meet the above flatness conditions are not included in the fitting of the top surface reference region.
[0049] The intersection of the outer cylindrical axis and the fitted plane of the top reference area is used as the transverse origin of the local coordinate system of the bottle cap. If the outer cylindrical axis cannot be stably obtained, the projection of the center of the outer ring along the normal of the fitted plane of the top reference area is used as the transverse origin. The average height of the fitted plane of the top reference area is set as the zero height, and the normal of the fitted plane is used to determine the height direction of the local coordinate system of the bottle cap.
[0050] Local coordinate system of bottle cap The axis is determined by the projection of the fixed lateral direction of the structured light acquisition device onto the fitting plane of the top reference area, in the local coordinate system of the bottle cap. The axes are determined by right-handed coordinate relationships. The reference 3D point cloud and the detection 3D point cloud are each established with the same orientation in a bottle cap local coordinate system, as described above, so that the reference state and the detection state have the same lateral and height coordinate directions.
[0051] After applying translation and rotation transformations to the reference 3D point cloud and the detection 3D point cloud respectively, the two sets of point clouds are resampled to the same physical coordinate grid. For example, the grid spacing of the bottle cap local coordinate grid is set to 0.25mm, and the origin, number of rows and columns, and safety button area mask of the bottle cap local coordinate grid are determined by the bottle cap specification document.
[0052] Each grid point preferentially uses the nearest measured point and obtains its height by local surface fitting within its neighborhood; if there are no measured points in the neighborhood or the nearest measured point is more than 0.50 mm away, the grid point remains invalid. After resampling, the reference height field and the detection height field are obtained respectively.
[0053] The baseline and detection states are both normalized to eliminate fixture offset, bottle tilt, and transport positioning variations. The allowable circumferential position deviation of the fixed embossing structure in the cap specification document is set to ±5°. For circumferential angle differences caused by cap screwing, the lateral origin and height zero point are determined using the cap's outer circumference geometry, and then the residual rotation angle around the height axis is estimated based on the overall matching result of the fixed embossing structure area.
[0054] When estimating the residual rotation angle, an initial feature correspondence is established in the fixed imprint structure region of the reference state and the detection state, and the two-dimensional rotation angle that minimizes the position error of the corresponding feature is calculated. The calculated two-dimensional rotation angle is used as the rotation correction amount of the detection height field relative to the reference height field about the height axis, and in step S30, reverse rotation and resampling are performed.
[0055] When local warping exists in the top surface reference region, the annular top surface reference region is divided into no fewer than 8 circumferential sectors, and the planar residuals of each circumferential sector are calculated separately. Circumferential sectors whose planar residuals exceed 2.5 times the median of the planar residuals of all circumferential sectors are discarded, and the fitted plane of the top surface reference region is refitted using the retained circumferential sectors. When fewer than 5 circumferential sectors are retained, the attitude normalization result is marked as low confidence.
[0056] The attitude normalization result records at least the lateral origin, the fitted plane of the top reference area, the rigid body transformation parameters, the peripheral geometric fitting residual, the number of effective circumferential sectors, the residual rotation angle, and the proportion of resampled effective points. The reference height field and the detection height field use the same grid index and the same effective state code, enabling step S30 to perform effective point screening and height difference calculation at the same physical location.
[0057] In this embodiment, the initial value for rigid body transformation can be jointly constructed by the center of the outer circumference ring of the bottle cap and the top surface reference area. Then, the attitude is refined by point-to-plane iterative registration in the stable reference area outside the safety button area and the fixed imprint structure area. The maximum lateral correction amount for attitude refinement is set to 0.50 mm, and the maximum rotation correction angle is set to 2°. If the above ranges are exceeded, the attitude normalization result is marked as abnormal and enters the re-inspection branch.
[0058] S30: Extract the out-of-surface displacement field of the safety button area from the difference between the reference height field and the detection height field; In this embodiment, step S30 includes: Step S31: Filter valid points in the reference height field and the detection height field within the unified local coordinate grid of the bottle cap, and calculate the difference between the reference height field and the detection height field. Step S32: Fit and subtract the overall translation, tilt and residual rotation components in the difference field; Step S321: Fit the residual attitude compensation amount in planar form to the stable reference region outside the safety button region to obtain the initial value of the residual attitude compensation parameter. Step S322: Correct the out-of-plane displacement field of the safety button region based on the residual attitude compensation amount, and update the residual attitude compensation parameters as parameters to be solved along with the equivalent vacuum degree during the solution of the joint inversion objective function. Step S33: The subtracted difference field is confined to the safety button region to obtain the surface displacement field of the safety button region; Step S34: Use the out-of-plane displacement field of the safety button region as the observation input for the out-of-plane displacement residual.
[0059] In step S31, the validity status of the reference height value and the detected height value are checked simultaneously for the same local coordinate grid position of the bottle cap. If either state is marked as saturation, abnormal phase unfolding, large-area interpolation, or missing point cloud, the local coordinate grid position of the bottle cap is not used as a high-weight observation point. When both the reference state and the detected state are measured valid points, they are set as normal observation points; when there is only small-range interpolation, they are set as low-weight observation points.
[0060] When the effective point ratio in the safety button area is less than 0.80, the out-of-plane displacement field in the safety button area can still be formed, and the system reduces the detection confidence in step S60; when the effective point ratio in the safety button area is less than 0.60, the system outputs a re-inspection judgment result. The effective point ratio is the ratio of the number of grid points in the safety button area that have effective height values in both the reference height field and the detection height field to the total number of grid points in the safety button area.
[0061] Step S32 first processes the residual rotational component about the bottle cap height axis. Let the residual rotation angle of the detected height field relative to the reference height field be . The unit is degrees. Residual rotation angle. The initial value is the overall matching result of the fixed imprint structure area in step S20. For each local coordinate grid point of the bottle cap in the detection height field, the rotation angle is calculated with the bottle cap's lateral origin as the center. The reverse rotation is performed, and the rotated detection height is resampled to the local coordinate grid of the bottle cap where the reference height field is located.
[0062] After resampling, the difference between the reference height field and the detection height field is calculated in the stable reference area outside the safety button area. The residual rotation angle is then iteratively corrected within a small range using the residual height difference between stable reference points. Each correction of the residual rotation angle is limited to within 0.10°; the correction stops when the residual rotation angle change is less than 0.01° or when 10 iterations have been performed. If the absolute value of the residual rotation angle exceeds 2° or the registration residual in the stable reference area cannot be reduced after iterations, the residual rotation correction state is marked as invalid, and a re-inspection judgment result is output.
[0063] After correcting for the residual rotational components, calculate the overall translational and tilt components. Let the reference height field be denoted as... The detected height field after rotation correction is denoted as Both are in millimeters; the original difference between the reference height field and the detected height field is denoted as... Let along The residual tilt parameter in the direction is ,along The residual tilt parameter in the direction is The overall height translation parameters are: .
[0064] The out-of-plane displacement field of the safety button region after residual attitude compensation is denoted as: The calculation relationship is as follows: ; in, and The local coordinates of the bottle cap defined in step S20; Represents the residual attitude compensation in planar form; A positive value indicates that the detection state is concave along the inside of the bottle relative to the reference state.
[0065] In step S321, a stable reference region is selected outside the safety button area. This stable reference region is taken from the top surface reference region used in step S20, and further excludes areas with fixed embossed structures, saturated reflective areas, missing point cloud areas, and areas with local height anomalies. Robust plane fitting is performed using the original differences within the stable reference region as the dependent variable and the local coordinates of the bottle cap as the independent variable, yielding the desired result. , and The initial value.
[0066] During the fitting process, piecewise loss is used to reduce the impact of water droplets, local scratches, and a small number of residual indentations on the fitting results. After each fitting, the weights of the stable reference points are updated based on the residuals. The fitting process stops when the change between two consecutive values of the overall height translation parameter is less than 0.001 mm, the change between two consecutive values of the two residual tilt parameters is less than 0.0001 mm, or the iteration reaches 20 iterations. After the fitting is completed, the initial values of the residual attitude compensation parameters, the number of effective points in the stable reference region, and the robust plane fitting residuals are saved.
[0067] In step S322, the initial values of the residual attitude compensation parameters are first used to correct the original difference in the safety button region, resulting in the initial observation of the out-of-plane displacement field in the safety button region. In step S50, when performing the joint inversion, , and They continue to be used as parameters to be determined in the update. The update of the residual attitude compensation parameters is constrained by the fitting results of the stable reference region and the allowable range of variation.
[0068] For example, the overall height translation parameter The allowable variation range relative to the initial value is set at ±0.03 mm, along... Residual tilt parameters in the direction and along Residual tilt parameters in the direction The allowable variation range relative to the initial value is set to ±0.003. The residual attitude compensation parameters are updated together with the equivalent vacuum degree, so that the small attitude residuals are compensated during the inversion process, and the surface elastic deformation of the safety button area is preserved by the variation range constraint.
[0069] The safety button area is pre-defined by the bottle cap specifications and fine-tuned using a reference height field. For 38mm diameter metal screw caps, the safety button area is set as a circular area with a radius no greater than 16mm centered on the bottle cap. When inkjet printing is present in the center, areas with a radius less than 3mm that are affected by inkjet reflection in both acquisitions are designated as low-weight areas. Grid points where the edge of the safety button area intersects with the rounded corner of the cap top are assigned lower weights based on local curvature and point cloud noise.
[0070] The safety button region out-of-plane displacement field formed in step S33 includes at least the local coordinates of the bottle cap, the out-of-plane displacement value, the effective state, the data source type, the local point cloud noise, the residual angle correction state, and the plane compensation state. The data source type is used to distinguish between measured points and interpolated points, and the local point cloud noise is determined by the residual of the neighborhood surface fitting. Step S50 reads the safety button region out-of-plane displacement field as the observation input for the out-of-plane displacement residual, and determines the scale parameters and observation weights of the out-of-plane displacement residual based on the effective state and the local point cloud noise.
[0071] When the stable reference region is insufficient to fit the complete plane, only the overall height translation parameters are fitted, and the residual tilt parameters along the two lateral directions are kept at the initial values after attitude normalization in step S20. When the stable reference region is completely unavailable, the out-of-plane displacement field of the safety button region adopts the direct height difference after attitude normalization, while the residual attitude compensation state is recorded as invalid. When the residual attitude compensation state is invalid, the system reduces the detection confidence and outputs the re-inspection judgment result.
[0072] In this embodiment, the stable reference region can be further divided into multiple circumferential sectors, and local residual statistics can be obtained for each sector. The plane fitting weight is then determined by the number of effective points and the fitting residual in each circumferential sector. When water droplets, scratches, or reflections are present in a local area, the fitting weight of the affected circumferential sector is reduced, while the remaining circumferential sectors continue to be used to determine the initial values of the residual attitude compensation parameters.
[0073] S40: Extract phase gradient features from the fixed imprint structure region in the reference absolute phase map and the detection absolute phase map, perform feature matching and sub-pixel displacement solution, obtain the in-plane displacement field of the bottle cap surface and calculate the in-plane strain field. See Figure 3 In this embodiment, step S40 includes: Step S41: The area on the bottle cap surface where the fixed embossed characters, fixed trademark outline, fixed decorative pattern or fixed embossed code are located is determined as the fixed embossing structure area; Step S42: Calculate the first-order gradient magnitude and gradient direction of the absolute phase within the fixed imprint structure region, and generate feature candidate points by combining the height gradient and projection modulation. Step S43: Perform local extremum screening, saturation reflection screening, and gradient direction distribution screening on the feature candidate points, and retain feature points located at the imprint edge or imprint corner. Step S44: Generate a phase gradient direction histogram descriptor for the feature points; Step S45: Form an initial matching set using the distances of the phase gradient direction histogram descriptors; Step S46: Use random consistency estimation to eliminate matching points that do not meet the consistency constraints; Step S47: Establish a local window for phase gradient and a local window for height gradient around each retained matching point; Step S48: Obtain the sub-pixel in-plane displacement by minimizing the gradient residual within the window; Step S49: Perform local weighted least squares fitting on the sub-pixel in-plane displacement according to the matching confidence weight and the neighborhood distance weight to obtain the in-plane displacement field; Step S410: Calculate the in-plane strain field from the spatial derivative of the in-plane displacement field.
[0074] The fixed embossed structure area is marked during the bottle cap specification establishment stage and transformed into the bottle cap's local coordinate system. Fixed embossed characters, fixed trademark outlines, fixed decorative patterns, and fixed raised / recessed codes are fixedly connected to the bottle cap's metal substrate, possessing traceable geometric positions in both baseline and inspection states. Production date inkjet printing, random dot matrix codes, variable batch codes, and areas with stains or water droplets are not considered fixed embossed structure areas.
[0075] The bottle cap specification document records the mask of the fixed embossing structure area and the allowable circumferential position deviation. The allowable circumferential position deviation of the fixed embossing structure is set to ±5°. When the fixed embossing structure exceeds the allowable circumferential position deviation, the residual rotation correction in steps S20 and S30 is performed first, and then the feature extraction of the fixed embossing structure area is performed.
[0076] After resampling the reference absolute phase map and the detection absolute phase map onto the local coordinate grid of the bottle cap, local smoothing that preserves the edges is first used to suppress single-pixel noise, and then the first-order phase difference in the horizontal and vertical directions is calculated separately. The composite amplitude of the phase difference forms the phase gradient amplitude, and the ratio of the phase difference in the two directions forms the phase gradient direction. The height gradient is obtained by performing the same spatial scale difference on the reference height field and the detection height field.
[0077] The overall quality of feature candidate points is determined by the phase gradient, height gradient, and projection modulation. For example, the combined weights of the phase gradient, height gradient, and projection modulation are set to 0.50, 0.35, and 0.15, respectively, and the projection modulation is converted to a quality value between 0 and 1 before combination. The phase gradient reflects the geometric abrupt changes of the fixed imprinted structure in the absolute phase map, the height gradient reflects the three-dimensional concave and convex edges of the fixed imprinted structure, and the projection modulation is used to reduce the candidate quality in low signal-to-noise ratio regions.
[0078] Within the fixed embossing structure area, the median of the local phase gradient magnitude plus 2.5 times the local absolute deviation is used as the feature candidate threshold. Feature candidate points also need to satisfy the local extremum condition within a 5×5 pixel neighborhood. Feature candidate points with a saturated pixel ratio exceeding 0.10, an invalid point ratio exceeding 0.20, or gradient directions concentrated in a single direction are discarded. The retained feature points are mainly located at the intersection of embossing edges, character corners, inflection points of closed contours, or locations where the curvature of the concave-convex structure changes.
[0079] A description region of uniform physical size is established with each retained feature point as the center. The description region is divided into 4×4 sub-blocks. Eight gradient direction intervals are counted in each sub-block. The phase gradient magnitude and projection modulation are used as voting weights to form a phase gradient direction histogram descriptor.
[0080] After the phase gradient orientation histogram descriptor is normalized, the nearest neighbors between the baseline state and the detection state are found based on the Euclidean distance. When the ratio of the nearest neighbor distance to the second nearest neighbor distance is less than 0.75, the pair of feature points is included in the initial matching set. Step S44 forms the descriptor, and step S45 forms the initial matching set based on the descriptor distance. The two results are saved separately to avoid merging the descriptor formation process and the matching process.
[0081] The stochastic consistency estimation uses the consistency relationship of two-dimensional rotation and translation to filter the initial matching set. Each time, matching points satisfying the estimation conditions are extracted from the initial matching set, the overall two-dimensional transformation is calculated, and matching points with a post-transformation positional error of no more than 0.50px are counted. After iteration, the two-dimensional transformation with the most support points and the smallest average error is retained. When there are fewer than 80 support points, the feature matching quantity and quality are set to low; when there are fewer than 30 support points, the in-plane strain field is marked as unavailable.
[0082] For each retained matching point, a local window for the phase gradient and a local window for the height gradient are established in both the baseline state and the detection state. Let the local window for the phase gradient in the baseline state be denoted as... The local window of the phase gradient of the detection state is denoted as The local window for the height gradient of the baseline state is denoted as... The local window for detecting the height gradient of the state is denoted as .
[0083] in, and These are the sampling coordinates within the local window; The set of sampling locations contained within the local window; and These represent the horizontal and vertical subpixel displacements to be determined; Here, represents the height gradient residual balance coefficient. The sub-pixel matching residual is denoted as... The calculation relationship is as follows: ; In this embodiment, the height gradient residual balance coefficient The value is set to 0.35. Bicubic interpolation is used to obtain gradient values at non-integer sampling locations, and Gauss-Newton iterations are used to update the horizontal and vertical subpixel displacements. Iteration stops when the parameter increment is less than 0.01px, and the maximum number of iterations is set to 20. Matching points with a final matching residual exceeding 0.30px, a correlation quality below 0.75, or where the iteration has not converged are discarded.
[0084] Subpixel in-plane displacement is converted from camera mesh displacement to physical displacement in the bottle cap local coordinate system. For each mesh point to be fitted, at least six valid matching points within a 3mm radius neighborhood are selected, and local first-order displacement fitting is performed using the product of the matching confidence weight and the neighborhood distance weight. The neighborhood distance weight decreases smoothly as the distance from the feature point to the mesh point increases, while the matching confidence weight varies with the phase gradient direction histogram descriptor distance, subpixel matching residual, and the support level of the random consistency estimate. When there are insufficient valid feature points in the neighborhood, the in-plane strain value is not directly extrapolated to that mesh point.
[0085] Let the surface of the bottle cap be along The in-plane displacement field in the direction is ,along The in-plane displacement field in the direction is The normal strain components are denoted as follows: and The shear strain component is denoted as The in-plane small strain field is calculated according to the following formula: ; Each spatial derivative is obtained from the first-order coefficients of the locally weighted least squares fit. The joint inversion can use the three in-plane strain components, or the equivalent in-plane strain formed by the three in-plane strain components. When using the equivalent in-plane strain, the in-plane strain response in the elasticity response model and the in-plane strain field under the detection state are calculated using the same caliber.
[0086] The in-plane strain field output includes at least the local coordinates of the bottle cap, in-plane strain components, equivalent in-plane strain, number of effective feature points in the neighborhood, average matching residual, and local displacement fitting residual. Step S50 determines the in-plane strain scale parameters based on the feature matching confidence, local displacement fitting residual, and number of effective feature points in the neighborhood. If there are insufficient effective feature points in a certain region, that region does not participate in the calculation of the in-plane strain residual, but the out-of-plane displacement field of the safety button region can still be included in the joint inversion, and step S60 correspondingly reduces the detection confidence.
[0087] In this embodiment, zero-mean normalization can be performed on the local windows for phase gradient and height gradient respectively, and then the gradient residuals within the windows can be calculated; alternatively, sub-pixel localization can be completed first based on the local window for phase gradient, and then the local window for height gradient can be used to locally verify the sub-pixel localization results. All the above implementations maintain the data flow of fixed imprinted structure region, feature matching, sub-pixel displacement solving, in-plane displacement field formation, and in-plane strain field calculation unchanged.
[0088] S50: Input the out-of-plane displacement field and in-plane strain field of the safety button area into the elastic mechanical response model established by the bottle cap material parameters, geometric parameters and vacuum calibration data, construct a joint inversion objective function including out-of-plane displacement residual, in-plane strain residual and residual attitude compensation parameter terms, solve the equivalent vacuum degree and obtain the joint inversion residual; See Figure 4 In this embodiment, step S50 includes: Step S51: Obtain the elastic modulus, Poisson's ratio, thickness distribution, initial curvature of the top surface, diameter and height of the safety button, stiffness correction term of the fixed embossing structure, and boundary conditions of the bottle mouth support of the bottle cap material; by comparing the finite element calculation results with the vacuum calibration data, correct the influence of effective elastic modulus, support stiffness, initial curvature of the top surface, and stiffness of the fixed embossing structure; and establish a response library between vacuum degree, out-of-plane displacement response, and in-plane strain response using the fusion results of the finite element calculation results and the vacuum calibration data. Step S52: Record out-of-plane displacement samples and in-plane strain samples under different known internal and external pressure differences in the vacuum calibration data; Step S53: By comparing the finite element calculation results with the vacuum calibration data, the effects of effective elastic modulus, support stiffness, initial curvature of the top surface and stiffness of the fixed imprint structure are corrected. The fusion results of the finite element calculation results and the vacuum calibration data are used to establish a response library between vacuum degree, out-of-plane displacement response and in-plane strain response. Step S54, make the joint inversion objective function include scale-normalized out-of-plane displacement residual, scale-normalized in-plane strain residual, residual attitude compensation parameter term and vacuum degree value range constraint term; Step S541: Determine the out-of-plane displacement scale parameters based on the structured light repetitive measurement noise, point cloud local noise, and mesh interpolation distance; Step S542: Determine the in-plane strain scale parameter based on the feature matching confidence, local displacement fitting residual and the number of effective feature points in the neighborhood, and normalize the scale of the out-of-plane displacement residual and the in-plane strain residual using the out-of-plane displacement scale parameter and the in-plane strain scale parameter, respectively. Step S55: Use a piecewise loss function to reduce the weight of observation points whose residuals exceed the preset residual inflection threshold, and solve for the equivalent vacuum degree through bounded one-dimensional search or damped least squares.
[0089] In step S51, the elastic mechanical response model is used to describe the out-of-plane displacement response and in-plane strain response of the same specification of fresh stewed bird's nest bottle cap under different internal and external pressure differences. When establishing the elastic mechanical response model, the material type, thickness distribution, elastic modulus, Poisson's ratio, initial curvature of the top surface, diameter and height of the safety button, position of the fixed embossing structure, and bottle mouth support area are obtained according to the bottle cap specifications.
[0090] When the fixed embossing structure causes local thickness or curvature changes, a stiffness correction term for the fixed embossing structure is set in the corresponding finite element region. The bottle mouth support boundary is set as an elastic support boundary or a constrained support boundary based on the contact position after the bottle cap of the fresh stewed bird's nest is screwed on.
[0091] Taking a tin bottle cap with a diameter of 38 mm and a thickness of 0.22 mm as an example, the initial elastic modulus of the cap material is set to 210 GPa, and the initial Poisson's ratio is set to 0.30. The finite element model includes at least the safety button region, the transition region on the top surface of the cap, the fixed embossing structure region, and the cap shoulder support region. The finite element mesh is locally refined near the safety button region and the fixed embossing structure region. The vacuum degree is known to be expressed as the non-negative pressure difference between the pressure outside the cap and the pressure inside the bottle, in kilopascals.
[0092] In step S52, a vacuum calibration fixture applies known internal and external pressure differences of 0 kPa, 10 kPa, 20 kPa, 30 kPa, 40 kPa, 50 kPa, 60 kPa, 70 kPa, and 80 kPa to bottle caps of the same specifications for freshly stewed bird's nest. Each pressure point uses the same structured light projection sequence and data processing flow as the online detection to generate out-of-plane displacement samples and in-plane strain samples.
[0093] In step S53, the effects of effective elastic modulus, support stiffness, initial curvature of the top surface, and stiffness of the fixed imprint structure are corrected by comparing the finite element calculation results with the vacuum calibration data. The response library stores the predicted out-of-plane displacement, predicted in-plane strain, and calibration repeatability statistics for each bottle cap's local coordinate grid position under each vacuum level.
[0094] When the cap of the freshly stewed bird's nest bottle exhibits an approximately linear elastic response within the detection range, the vacuum degree of any candidate is calculated proportionally based on the unit pressure response. When the response slope changes across different pressure ranges, piecewise interpolation is performed between adjacent calibration pressure points.
[0095] During the inspection, a response library matching the current cap specification, supplier code, and cap type version is read. If a matching response library cannot be obtained, the normal seal integrity check is not performed, and a re-inspection result indicating model configuration abnormality is output.
[0096] After calling the response library, the out-of-plane displacement field and in-plane strain field of the safety button region are converted to the same grid positions and response representation as the response library. The measured points, interpolation points, and invalid points in the out-of-plane displacement field of the safety button region maintain different quality states; the valid grid points in the in-plane strain field retain the feature matching confidence, local displacement fitting residuals, and the number of valid feature points in the neighborhood.
[0097] In step S54, the out-of-plane displacement residual and the in-plane strain residual are formed based on the out-of-plane displacement field, the in-plane strain field and the predicted response corresponding to the response library in the safety button area, and the residual attitude compensation parameters obtained in step S30 are added to the joint inversion objective function as parameters to be determined.
[0098] Let the equivalent vacuum degree to be determined be... The unit is kilopascal; the first The coordinates of the out-of-plane displacement observation points are: , No. The observed out-of-plane displacement values are The model is based on the equivalent vacuum degree. Next to the The predicted out-of-plane displacement given at each location is ;No. In-plane strain observation values The model for the first The predicted in-plane strain given at each location is .
[0099] Let the first The out-of-plane displacement scale parameter for each out-of-plane displacement observation is: , No. The in-plane strain scale parameters for each in-plane strain observation are: ;No. The mass weight of each out-of-plane displacement observation is , No. The mass weight of each in-plane strain observation is: .
[0100] along The residual tilt parameter in the direction is denoted as ,along The residual tilt parameter in the direction is denoted as The overall height translation parameter is denoted as The in-plane strain residual equilibrium coefficient is denoted as... The residual attitude parameter constraint coefficients are denoted as The vacuum range constraint coefficient is denoted as .
[0101] The piecewise loss function is denoted as... ,in, The threshold value for the normalized residual; the vacuum range penalty function is denoted as... .
[0102] Joint inversion objective function Represented as: ; In step S541, the out-of-plane displacement scale parameter The distance is determined by combining the structured light repeated measurement noise, the current point cloud neighborhood fitting residual, and the grid interpolation distance from the local coordinate grid point of the bottle cap to the nearest measured point.
[0103] When the measured point has low local noise and the repeated measurements are stable, the out-of-plane displacement scale parameter should be taken as a small value; when the grid interpolation distance increases or the local noise of the point cloud increases, the out-of-plane displacement scale parameter should be increased accordingly.
[0104] For example, the out-of-plane displacement scale parameter of the normal measured area is set to 0.012 mm, and the out-of-plane displacement scale parameter of the low-weight interpolation area is set to 0.025 mm.
[0105] In step S542, the in-plane strain scale parameters It is determined based on feature matching confidence, subpixel matching residual, local displacement fitting residual, and the number of effective feature points in the neighborhood.
[0106] When the feature matching confidence is high, the subpixel matching residual is small, and there are many effective feature points in the neighborhood, the in-plane strain scale parameter takes a small value; when the number of effective feature points in the neighborhood is close to the minimum or the local displacement fitting residual increases, the in-plane strain scale parameter increases.
[0107] For example, the in-plane strain scale parameter for the normal region is set to 8 με, and the in-plane strain scale parameter for the low-confidence region is set to 20 με.
[0108] The out-of-plane displacement residual is divided by the corresponding out-of-plane displacement scale parameter to form the scale-normalized out-of-plane displacement residual; the in-plane strain residual is divided by the corresponding in-plane strain scale parameter to form the scale-normalized in-plane strain residual.
[0109] After scale normalization, millimeter-scale out-of-plane displacement residuals and micro-strain-scale in-plane strain residuals can be incorporated into the same joint inversion objective function, thus avoiding the unreasonable dominance of one observation in the joint inversion due to their different dimensions and numerical scales.
[0110] In step S55, the piecewise loss function is applied when the absolute value of the normalized residual is not greater than the inflection threshold. A quadratic loss is used when the absolute value of the normalized residual is greater than the inflection threshold. A linearly increasing loss is used to reduce the impact of large residual observation points caused by local point cloud anomalies or erroneous feature matching on the joint inversion results.
[0111] For example, the turning threshold Take 1.5 as the in-plane strain residual equilibrium coefficient. Set to 0.60, residual attitude parameter constraint coefficient. Take 0.02 as the vacuum range constraint coefficient. Take 100.
[0112] Vacuum range penalty function The equivalent vacuum level is set to 0 when it is between 0 kPa and 80 kPa; when the equivalent vacuum level is below 0 kPa, the square of the distance between the equivalent vacuum level and 0 kPa is taken; when the equivalent vacuum level is above 80 kPa, the square of the distance between the equivalent vacuum level and 80 kPa is taken. This calculation rule provides a clear calculation method for the range of vacuum level values.
[0113] When using the response library, the equivalent vacuum degree is measured in the range of 0 kPa to 80 kPa. Perform a bounded one-dimensional search. For each candidate vacuum level, first solve along the allowable range. Residual tilt parameters in the direction ,along Residual tilt parameters in the direction and overall height translation parameters Then calculate the joint inversion objective function.
[0114] A coarse search is first performed at 1 kPa intervals, followed by a fine search at 0.1 kPa intervals near the minimum value of the joint inversion objective function. The vacuum degree that minimizes the joint inversion objective function is taken as the equivalent vacuum degree. The sum of the residual terms of the out-of-plane displacement data and the residual terms of the in-plane strain data corresponding to the optimal solution is normalized by the number of effective observation points and taken as the joint inversion residual. The residual attitude compensation parameter term and the vacuum degree value range constraint term are not included in the joint inversion residual.
[0115] When the response library uses continuous interpolation and multiple parameters need to be updated simultaneously, damped least squares solution is used. The initial value of the equivalent vacuum degree is obtained by projecting the out-of-plane displacement field of the safety button region onto the response library separately, and the initial values of the residual attitude compensation parameters are obtained from the robust plane fitting results of step S321.
[0116] In each iteration, the parameter increment is calculated. When the joint inversion objective function decreases, the parameter increment is accepted and the damping is reduced. When the joint inversion objective function does not decrease, the parameter increment is rejected and the damping is increased.
[0117] The process stops when the change in equivalent vacuum is less than 0.05 kPa, the relative change in the joint inversion objective function is less than 0.001, or the iteration reaches 30 times.
[0118] After the solution is obtained, the equivalent vacuum degree, the minimum value of the joint inversion objective function, the normalized joint inversion residual, the residual attitude compensation parameters, the individually inverted values of the out-of-plane displacement field and the individually inverted values of the in-plane strain field are saved. All of the above results are then processed into step S60.
[0119] In this embodiment, a lookup relationship can also be established between vacuum degree and principal component coefficients of out-of-plane displacement and in-plane strain based on multiple vacuum calibration data. The detection observations are first projected onto the same principal component space, and then scale normalization, piecewise loss calculation, and joint updating of residual attitude compensation parameters are performed.
[0120] S60: Output the seal integrity judgment result of the fresh stewed bird's nest bottle cap according to the equivalent vacuum degree, joint inversion residual and detection confidence. The detection confidence is calculated by the effective point ratio, the number of feature matching, the matching residual and the observation consistency formed by the difference between the inversion value of the out-of-plane displacement field and the inversion value of the in-plane strain field.
[0121] See Figure 4 In this embodiment, step S60 includes: Step S61: Calculate the detection confidence level based on the effective point ratio, the number of feature matches, the matching residual, and the observation consistency formed by the difference between the inverted values of the out-of-plane displacement field and the in-plane strain field. Step S62: When the equivalent vacuum degree falls into the preset qualified vacuum range, the joint inversion residual is less than the preset residual threshold, and the detection confidence is greater than the preset confidence threshold, output the sealing qualified judgment. Step S63: When the equivalent vacuum degree does not fall within the preset qualified vacuum range, output a sealing abnormality judgment. Step S64: When the equivalent vacuum degree falls into the preset qualified vacuum range and meets at least one of the following conditions: the joint inversion residual is not less than the preset residual threshold and the detection confidence is not greater than the preset confidence threshold, the re-inspection judgment is output.
[0122] In step S61, the out-of-plane displacement field inversion value and the in-plane strain field inversion value are calculated separately.
[0123] When the out-of-plane displacement field of the safety button region is inverted separately, the residual attitude compensation parameters are retained, and only the out-of-plane displacement residual is used to solve for the corresponding vacuum degree; when the in-plane strain field is inverted separately, the same response library and vacuum degree value range as the joint inversion are used, and only the in-plane strain residual is used to solve for the corresponding vacuum degree.
[0124] The difference between the individually inverted values of the out-of-plane displacement field and the individually inverted values of the in-plane strain field is used to establish observational consistency. The closer the two individually inverted values are, the more consistent the out-of-plane deformation observations and in-plane deformation observations are in representing the pressure difference between the inside and outside of the bottle.
[0125] The detection confidence level comprehensively reflects the completeness of structured light data, the adequacy of fixed imprint structure matching, the quality of sub-pixel matching, and the consistency between the two types of physical observations.
[0126] Let the effective point ratio mass be The quantity and quality of feature matching are The quality of the matching residual is The observation consistency quality is All of the above quality values are normalized to 0 to 1.
[0127] Let the confidence weights for the effective point proportion quality, feature matching quantity quality, matching residual quality, and observation consistency quality be respectively... , , and The sum of the four confidence weights is 1.
[0128] The detection confidence level is denoted as The calculation relationship is as follows: ; in, Indicates the confidence level of the detection; Indicates the proportion of effective points in the mass; Indicates the quantity and quality of feature matching; Indicates the quality of the matching residual; Indicates the quality of observation consistency; , , and These represent the confidence weights of the corresponding quality quantities.
[0129] Effective point ratio quality The scale is formed based on the ratio of local coordinate grid points of the bottle cap that are simultaneously valid in the reference state and detection state within the safety button area.
[0130] Quantity and quality of feature matching The number of valid matches retained after random consistency estimation is used to form the set value. When there are 120 valid matches, the value is 1; when there are fewer than 30 valid matches, the value is 0; and when the number is between 30 and 120, the value is linearly mapped according to the number of valid matches.
[0131] Matching residual quality The residual is formed based on the average sub-pixel matching error of the retained matching points. When the average sub-pixel matching residual is no greater than 0.05px, the matching residual quality is set to 1; when the average sub-pixel matching residual reaches 0.30px, the matching residual quality is set to 0.20; when the average sub-pixel matching residual is between 0.05px and 0.30px, a linear mapping is applied between 1 and 0.20. Matching points with an average sub-pixel matching residual exceeding 0.30px have been removed in step S40.
[0132] Observational consistency quality The observation consistency quality is determined based on the absolute difference between the individually inverted values of the out-of-plane displacement field and the individually inverted values of the in-plane strain field. When the difference between the two individually inverted values is no greater than 3 kPa, the observation consistency quality is set to 0.88 to 1; when the difference between the two individually inverted values reaches 8 kPa, the observation consistency quality is set to 0.50; and when the difference between the two individually inverted values exceeds 15 kPa, the observation consistency quality is set to 0.
[0133] For example, the confidence weight of the proportion of valid points quality Set to 0.25, the confidence weight for the quantity and quality of feature matching. Set the confidence weight to 0.20 to match the residual quality. Set the confidence weight to 0.25 for the quality of observation consistency. Take 0.30.
[0134] For a freshly stewed bird's nest product, the preset qualified vacuum range is set to 25 kPa to 70 kPa, the preset joint inversion residual threshold is set to 1.50, and the preset reliability threshold is set to 0.80.
[0135] The preset qualified vacuum range, preset joint inversion residual threshold, and preset reliability threshold are determined during the product finalization stage based on quality requirements, sterilization and cooling processes, vacuum calibration data, and enterprise quality control requirements, and are saved together with the bottle cap specification version.
[0136] In step S62, when the equivalent vacuum level falls between 25 kPa and 70 kPa, the joint inversion residual is less than 1.50, and the detection confidence level is greater than 0.80, the sealing qualification judgment result is output.
[0137] In step S63, when the equivalent vacuum degree is lower than 25 kPa or higher than 70 kPa, the sealing abnormality judgment result is output.
[0138] In step S64, when the equivalent vacuum level falls between 25 kPa and 70 kPa, and at least one of the following conditions is met: the joint inversion residual is not less than 1.50, and the detection confidence level is not greater than 0.80, the re-inspection judgment result is output.
[0139] When the effective point ratio is less than 0.60, the effective matching points are less than 30, the product identification matching fails, the calibration version is inconsistent, the residual rotation correction fails, or the response library is missing, the re-inspection judgment result is also output, along with the corresponding abnormal reason.
[0140] The output record should include at least the product identification, detection time, equivalent vacuum degree, joint inversion residual, detection confidence, out-of-plane displacement field inversion value, in-plane strain field inversion value, effective point ratio, effective matching point number, average sub-pixel matching residual, residual rotation angle, residual attitude compensation parameters, and the result of the seal integrity judgment of the fresh stewed bird's nest bottle cap.
[0141] The judgment result is sent to the production controller or host computer. Products with sealing defects will be rejected, products requiring re-inspection will be diverted, and products that pass the sealing test will continue to the subsequent packaging process.
[0142] To facilitate operational status verification, the data processing equipment saves the intermediate results of each product as a structured log. The log recording is triggered when a single product completes step S60 or when an anomaly occurs during the processing.
[0143] The recorded fields include the reference frame index, detection frame index, effective point mask summary, number of effective matching points, average subpixel matching residual, residual rotation angle, residual attitude compensation parameters, out-of-plane displacement field inversion value, in-plane strain field inversion value, equivalent vacuum degree, joint inversion residual, detection confidence level, and the result of the seal integrity judgment of the fresh stewed bird's nest bottle cap.
[0144] Structured logs are saved as database records or structured text and read by product identifier through the debugging interface for testing, result verification, and equipment operation status verification.
[0145] The first embodiment will be described in detail with specific examples. Taking a 250mL glass bottle of freshly stewed bird's nest with a cap diameter of 38mm as an example, the cap is a metal screw cap with a thickness of approximately 0.22mm, the safety button area has a radius of 16mm, and the top surface of the cap has a fixed trademark outline and fixed embossed characters. The baseline sampling station is set after filling and sealing and before entering the sterilization process, while the detection sampling station is set at the final inspection position after sterilization and cooling are completed.
[0146] Step S10 involves acquiring structured light images of the same fresh-stewed bird's nest bottle cap in both the baseline and detection states, and calculating the baseline absolute phase map, detection absolute phase map, baseline 3D point cloud, and detection 3D point cloud, respectively. The projection unit sequentially projects three sets of phase-shifted fringes with 1, 8, and 64 fringe periods, each set using 12 phase shifts. The camera acquires 36 structured light images in both the baseline and detection states. Product identification consists of the tray number and the location number within the tray. The system calculates the baseline absolute phase map, detection absolute phase map, baseline 3D point cloud, and detection 3D point cloud for the same fresh-stewed bird's nest bottle cap and adds the data to the same fresh-stewed bird's nest bottle cap pairing dataset.
[0147] Step S20 involves normalizing the attitude of the reference 3D point cloud and the detection 3D point cloud using the outer periphery geometry of the bottle cap and the top surface reference area, resulting in a reference height field and a detection height field in a unified local coordinate system of the bottle cap. The system obtains the center of the bottle cap by fitting an outer circular ring, fits the zero height point through a top surface reference area with a radius of 16.5 mm to 18.0 mm, and resamples at a grid spacing of 0.25 mm to obtain the reference height field and the detection height field. After attitude normalization, the ratio of grid points in the safety button area that are simultaneously valid in the reference state and the detection state is 0.96.
[0148] Step S30 is executed, which involves extracting the out-of-plane displacement field of the safety button region from the difference between the reference height field and the detection height field. The residual rotation angle of the detection height field relative to the reference height field is 0.28° after overall matching of the fixed imprint structure region. The system then performs inverse rotation and resampling. The stable reference region is fitted to obtain the displacement field along... The residual tilt parameter in the direction is 0.0012, along... The residual tilt parameter in the direction is -0.0008, and the overall height translation parameter is 0.006 mm. After deducting the residual attitude compensation, the average off-surface indentation in the center area of the safety button is 0.105 mm. The off-surface displacement scale parameter of the normal measured area is set to 0.012 mm.
[0149] Step S40 involves extracting phase gradient features from the fixed embossed structure region in both the reference absolute phase image and the detection absolute phase image, performing feature matching and sub-pixel displacement calculation to obtain the in-plane displacement field and calculate the in-plane strain field on the bottle cap surface. The system extracts phase gradient features from the fixed trademark outline and fixed embossed character region. Initial matching of the phase gradient direction histogram descriptor yields 243 pairs of feature points, and after random consistency estimation, 186 pairs of feature points are retained. The average matching residual after sub-pixel displacement calculation is 0.08px. Local weighted least squares fitting is used to obtain the in-plane displacement field and in-plane strain field on the bottle cap surface. The equivalent in-plane strain peak value in the annular transition region is 75με, and the in-plane strain scale parameter for the normal region is set to 8με.
[0150] Step S50 involves inputting the out-of-plane displacement field and in-plane strain field of the safety button area into an elastic mechanical response model established using the bottle cap material parameters, geometric parameters, and vacuum calibration data. A joint inversion objective function is constructed, including out-of-plane displacement residuals, in-plane strain residuals, and residual attitude compensation parameters. The equivalent vacuum level is solved, and the joint inversion residual is obtained. The system calls a response library established for bottle caps of the same specifications within the range of 0 kPa to 80 kPa. The out-of-plane displacement field inversion value is 43.5 kPa, and the in-plane strain field inversion value is 40.5 kPa, with a difference of 3.0 kPa between the two values. The joint inversion yields an equivalent vacuum level of 42.0 kPa, and the normalized joint inversion residual is 0.84.
[0151] Execute step S60, which outputs the seal integrity judgment result of the fresh stewed bird's nest bottle cap according to the equivalent vacuum degree, joint inversion residual and detection confidence. The detection confidence is calculated by the effective point ratio, the number of feature matching, the matching residual and the observation consistency formed by the difference between the inversion value of the out-of-plane displacement field and the in-plane strain field.
[0152] The quality of the effective point proportion is 0.96, the quality of the number of feature matches is 1.00, the quality of the matching residuals is calculated to be 0.904 according to the aforementioned linear mapping relationship, and the quality of observation consistency is 0.88. Using confidence weights of 0.25, 0.20, 0.25, and 0.30, and substituting them into the detection confidence calculation formula, we obtain: The result is 0.93, rounded to two decimal places.
[0153] The equivalent vacuum degree of 42.0 kPa falls within the preset qualified vacuum range of 25 kPa to 70 kPa. The joint inversion residual of 0.84 is less than the preset joint inversion residual threshold of 1.50. The detection confidence level of 0.93 is greater than the preset confidence threshold of 0.80. The system outputs the sealing qualification judgment result and writes the product identification, equivalent vacuum degree, joint inversion residual, detection confidence level and intermediate quality indicators into the detection log.
[0154] When the equivalent vacuum degree of another freshly stewed bird's nest bottle cap obtained using the same process was 14.0 kPa, the equivalent vacuum degree did not fall within the preset qualified vacuum range, and the system output a sealing abnormality judgment result. When the equivalent vacuum degree was 38.0 kPa and the joint inversion residual was 1.82, the system output a re-inspection judgment result; when the equivalent vacuum degree was 38.0 kPa and the detection confidence level was 0.74, the system also output a re-inspection judgment result.
[0155] See Figure 5The second embodiment of the present invention proposes a machine vision inspection system for the sealing integrity of bottle caps of fresh stewed bird's nest, including a structured light acquisition module, an attitude normalization module, an out-of-plane displacement extraction module, an in-plane strain calculation module, a vacuum degree inversion module, and a judgment output module.
[0156] The structured light acquisition module is configured to acquire structured light images of the same fresh-stewed bird's nest bottle cap in both the baseline and detection states, and to calculate the baseline absolute phase map, detection absolute phase map, baseline 3D point cloud, and detection 3D point cloud, respectively. The structured light acquisition module receives the bottle cap positioning signal and product identification, triggers the projection unit and imaging unit according to the same projection sequence, and writes the results of both acquisitions into the same fresh-stewed bird's nest bottle cap pairing dataset.
[0157] The attitude normalization module is configured to normalize the attitude of the reference 3D point cloud and the detected 3D point cloud using the outer periphery geometry and top surface reference area of the bottle cap, resulting in a reference height field and a detected height field in a unified local coordinate system of the bottle cap. The attitude normalization module outputs the local coordinate mesh of the bottle cap, the effective point mask, the rigid body transformation parameters, the residual rotation angle, and the attitude fitting residual.
[0158] The off-plane displacement extraction module is configured to extract the off-plane displacement field of the safety button region from the difference between the reference height field and the detection height field. The off-plane displacement extraction module performs residual rotation correction on the detection height field, obtains initial values of residual attitude compensation parameters in the stable reference region outside the safety button region, and sends the off-plane displacement field of the safety button region, the off-plane displacement scale parameters, and the off-plane displacement mass weight to the vacuum degree inversion module.
[0159] The in-plane strain calculation module is configured to extract phase gradient features from the fixed imprinted structure region in the reference absolute phase map and the detection absolute phase map, perform feature matching and sub-pixel displacement solving, obtain the in-plane displacement field on the bottle cap surface, and calculate the in-plane strain field. The in-plane strain calculation module simultaneously outputs the number of effective matching points, the average matching residual, the local displacement fitting residual, and the number of effective feature points in the neighborhood.
[0160] The vacuum degree inversion module is configured to input the out-of-plane displacement field and in-plane strain field of the safety button area into an elastic mechanical response model established using bottle cap material parameters, geometric parameters, and vacuum calibration data. It then constructs a joint inversion objective function including out-of-plane displacement residuals, in-plane strain residuals, and residual attitude compensation parameters, solves for the equivalent vacuum degree, and obtains the joint inversion residuals. The vacuum degree inversion module also calculates the individual inversion values of the out-of-plane displacement field and the in-plane strain field separately.
[0161] The judgment output module is configured to output the seal integrity judgment result of the fresh stewed bird's nest bottle cap according to the equivalent vacuum degree, joint inversion residual, and detection confidence level. The detection confidence level is calculated by the effective point ratio, the number of feature matches, the matching residual, and the observation consistency formed by the difference between the individually inverted values of the out-of-plane displacement field and the individually inverted values of the in-plane strain field. The judgment output module sends the seal qualification judgment result, the seal abnormality judgment result, or the re-inspection judgment result to the production controller, and saves intermediate result records that can verify the operation process of the detection method.
[0162] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process and related descriptions of the system described in the second embodiment above can be referred to the corresponding process in the first embodiment, and will not be repeated here.
[0163] The machine vision inspection system for the sealing integrity of freshly stewed bird's nest bottle caps provided in the above embodiments is only described based on the division of the above functional modules. In practical applications, the corresponding functions can be allocated to different processing modules according to the specific data processing equipment and software architecture, or the functions of multiple modules can be integrated into the same data processing equipment, as long as the data processing process corresponding to each of the above modules can be completed.
[0164] The terms "first," "second," etc., are used to distinguish similar objects, not to specify a particular order or degree of importance. The term "comprising" and similar expressions indicate non-exclusive inclusion, meaning that a process, method, or system that includes a series of technical features may also include other conventional technical features not explicitly listed.
[0165] The present invention has now been described in conjunction with the above embodiments. Equivalent substitutions or adjustments made by those skilled in the art to the relevant technical features without departing from the inventive concept can be applied to the specific implementation of the present invention.
Claims
1. A machine vision detection method for the seal integrity of a fresh stewed bird's nest bottle cap, characterized by, include: Structured light images of the same fresh stewed bird's nest bottle cap were acquired in both the baseline and detection states, and the baseline absolute phase map, detection absolute phase map, baseline 3D point cloud, and detection 3D point cloud were calculated respectively. The attitude of the reference 3D point cloud and the detection 3D point cloud is normalized using the outer periphery geometry and the top surface reference area of the bottle cap to obtain the reference height field and the detection height field under the unified local coordinate system of the bottle cap. The out-of-surface displacement field of the safety button area is extracted from the difference between the reference height field and the detection height field; Phase gradient features are extracted from the fixed imprint structure region in the reference absolute phase image and the detection absolute phase image. Feature matching and sub-pixel displacement are performed to obtain the in-plane displacement field on the bottle cap surface and calculate the in-plane strain field. The out-of-plane displacement field and in-plane strain field of the safety button area are input into the elastic mechanical response model established by the bottle cap material parameters, geometric parameters and vacuum calibration data. A joint inversion objective function including out-of-plane displacement residual, in-plane strain residual and residual attitude compensation parameter terms is constructed. The equivalent vacuum degree is solved and the joint inversion residual is obtained. The results of the seal integrity judgment of the fresh stewed bird's nest bottle cap are output according to the equivalent vacuum degree, joint inversion residual and detection confidence. The detection confidence is calculated by the effective point ratio, the number of feature matching, the matching residual and the observation consistency formed by the difference between the inversion value of the out-of-plane displacement field and the inversion value of the in-plane strain field.
2. The machine vision inspection method for the seal integrity of the fresh stewed yolk oyster bottle cap according to claim 1, characterized in that, The baseline state is the baseline collection state after the fresh stewed bird's nest bottle cap is filled and sealed and before entering the sterilization or cooling process. The acquisition of structured light images of the same fresh stewed bird's nest bottle cap under the reference state includes performing multiple phase-shift projections on the top surface and outer peripheral area of the bottle cap, obtaining a reference absolute phase map by unwrapping according to the phase shift, and converting the reference absolute phase map into a reference three-dimensional point cloud according to the calibration parameters of the structured light system. The baseline absolute phase map and the baseline 3D point cloud were established as a single paired dataset of freshly stewed bird's nest bottle caps.
3. The machine vision inspection method for the seal integrity of the fresh stewed yolk oyster bottle cap according to claim 2, characterized in that, The detection status refers to the online detection status after the same fresh stewed bird's nest bottle cap has completed sterilization, cooling, or vacuuming and reached the preset detection time. The acquisition of structured light images of the same fresh stewed bird's nest bottle cap in the detection state includes using the same projection sequence and calibration parameters as the structured light image in the reference state, calculating the detection absolute phase map and the detection 3D point cloud, and adding the detection absolute phase map and the detection 3D point cloud to the same fresh stewed bird's nest bottle cap pairing dataset.
4. The machine vision inspection method for the seal integrity of the fresh stewed yolk oyster bottle cap of claim 1, wherein, The pose normalization includes: Fit the outer cylindrical axis or the center of the outer annulus of the bottle cap to the reference 3D point cloud and the detection 3D point cloud, respectively; After removing the safety button area, the fixed embossed structure area, and the saturated reflective area, the top surface reference area is extracted. Establish a transverse origin based on the axis of the outer cylinder or the center of the outer ring; Establish the zero-height position based on the fitted plane of the top reference area; The baseline 3D point cloud and the detected 3D point cloud are resampled to a unified local coordinate grid of the bottle cap.
5. The machine vision inspection method for the sealing integrity of the bottle cap of freshly stewed bird's nest according to claim 4, characterized in that, The extraction of the out-of-plane displacement field of the safety button area includes: Within a unified local coordinate grid of the bottle cap, effective points are selected for the reference height field and the detection height field, and the difference between the reference height field and the detection height field is calculated. The global translation, tilt, and residual rotation components in the difference field are fitted and subtracted. The difference field after subtraction is confined to the safety button region to obtain the out-of-plane displacement field of the safety button region; The out-of-surface displacement field of the safety button region is used as the observation input for the out-of-surface displacement residual.
6. The machine vision inspection method for the sealing integrity of the bottle cap of freshly stewed bird's nest according to claim 1, characterized in that, The fixed embossing structure area is the area on the bottle cap surface where fixed embossed characters, fixed trademark outlines, fixed decorative patterns, or fixed embossed codes are located. The extraction of the phase gradient features includes: Calculate the first-order gradient magnitude and gradient direction of the absolute phase within the fixed imprint structure region, and generate feature candidate points by combining the height gradient and projection modulation. Local extremum filtering, saturation reflection filtering, and gradient direction distribution filtering are performed on the feature candidate points to retain feature points located at the imprint edge or imprint corner; Generate phase gradient direction histogram descriptors for feature points.
7. The machine vision inspection method for the sealing integrity of the bottle cap of freshly stewed bird's nest according to claim 6, characterized in that, The feature matching and sub-pixel displacement solution include: An initial matching set is formed using the distances of the phase gradient direction histogram descriptors; Random consistency estimation is used to eliminate matching points that do not meet the consistency constraints; Establish local windows for phase gradient and height gradient around each preserved matching point; Subpixel in-plane displacement is obtained by minimizing the gradient residual within the window; Local weighted least squares fitting is performed on the sub-pixel in-plane displacement according to the matching confidence weight and the neighborhood distance weight to obtain the in-plane displacement field. The in-plane strain field is calculated from the spatial derivative of the in-plane displacement field.
8. The machine vision inspection method for the sealing integrity of the bottle cap of freshly stewed bird's nest according to claim 1, characterized in that, The establishment of the elastic mechanical response model includes: Obtain the elastic modulus, Poisson's ratio, thickness distribution, initial curvature of the top surface, diameter and height of the safety button, fixed embossed structure stiffness correction term and bottle mouth support boundary conditions of the bottle cap material; By comparing the finite element calculation results with the vacuum calibration data, the effects of effective elastic modulus, support stiffness, initial curvature of the top surface and stiffness of the fixed imprint structure are corrected. A response library between vacuum degree, out-of-plane displacement response and in-plane strain response is established using the fusion results of the finite element calculation results and the vacuum calibration data. Record out-of-plane displacement samples and in-plane strain samples under different known internal and external pressure differences in the vacuum calibration data; By comparing the finite element calculation results with the vacuum calibration data, the effects of effective elastic modulus, support stiffness, initial curvature of the top surface, and stiffness of the fixed imprint structure are corrected. A response library is established between vacuum degree, out-of-plane displacement response, and in-plane strain response using the fusion results of the finite element calculation results and the vacuum calibration data.
9. The machine vision inspection method for the sealing integrity of the bottle cap of freshly stewed bird's nest according to claim 1, characterized in that, The joint inversion objective function includes scale-normalized out-of-plane displacement residuals, scale-normalized in-plane strain residuals, residual attitude compensation parameters, and vacuum degree value range constraints. A piecewise loss function is used to reduce the weight of observation points whose residuals exceed the preset residual inflection threshold, and the equivalent vacuum degree is solved by bounded one-dimensional search or damped least squares. When the equivalent vacuum degree falls within the preset qualified vacuum range, the joint inversion residual is less than the preset residual threshold, and the detection confidence is greater than the preset confidence threshold, the sealing qualification judgment is output. When the equivalent vacuum degree does not fall within the preset qualified vacuum range, a sealing abnormality judgment is output. When the equivalent vacuum degree falls within the preset qualified vacuum range, and meets at least one of the following conditions: the joint inversion residual is not less than the preset residual threshold, and the detection confidence is not greater than the preset confidence threshold, a re-inspection judgment is output.
10. A machine vision inspection system for the sealing integrity of bottle caps used in fresh stewed bird's nest, characterized in that, include: The structured light acquisition module is configured to acquire structured light images of the same fresh stewed bird's nest bottle cap in both the reference and detection states, and to respectively calculate the reference absolute phase map, the detection absolute phase map, the reference 3D point cloud, and the detection 3D point cloud. The attitude normalization module is configured to normalize the attitude of the reference 3D point cloud and the detection 3D point cloud using the outer periphery geometry and the top surface reference area of the bottle cap, so as to obtain the reference height field and the detection height field under the unified local coordinate system of the bottle cap. The out-of-plane displacement extraction module is configured to extract the out-of-plane displacement field of the safety button area from the difference between the reference height field and the detection height field. The in-plane strain calculation module is configured to extract phase gradient features from the fixed imprint structure region in the reference absolute phase map and the detection absolute phase map, perform feature matching and sub-pixel displacement solution, obtain the in-plane displacement field of the bottle cap surface and calculate the in-plane strain field. The vacuum degree inversion module is configured to input the out-of-plane displacement field and in-plane strain field of the safety button area into the elastic mechanical response model established by the bottle cap material parameters, geometric parameters and vacuum calibration data, construct a joint inversion objective function including out-of-plane displacement residual, in-plane strain residual and residual attitude compensation parameter terms, solve for the equivalent vacuum degree and obtain the joint inversion residual; The judgment output module is configured to output the judgment result of the sealing integrity of the fresh stewed bird's nest bottle cap according to the equivalent vacuum degree, joint inversion residual and detection confidence. The detection confidence is calculated by the effective point ratio, the number of feature matching, the matching residual and the observation consistency formed by the difference between the inversion value of the out-of-plane displacement field and the inversion value of the in-plane strain field.
