Flexible package three-dimensional vision detection method and system

By combining 3D point cloud data and structured light fringe images, missing point cloud regions are screened and structural defects and refractive interference are distinguished, solving the problem of misjudgment of missing point cloud in flexible packaging inspection and achieving more accurate inspection results.

CN123154807APending Publication Date: 2026-11-24YANTAI YUHONG PRINTING PACKING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611448076.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-17
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In existing 3D visual inspection of flexible packaging, the point cloud data formed by structured light or laser line scanning is easily affected by high reflectivity, refraction of transparent film, bag edge occlusion, folded edge occlusion and film wrinkles, resulting in missing point cloud, point cloud jumps or local holes, leading to the wrong rejection of good products and missed detection of defective products.

Method used

By using 3D point cloud data and structured light stripe images corresponding to the same detection location, missing point cloud areas are screened out. By comparing the position of the stripe center line, the continuity of the boundary, and the change in point cloud height, structural defect areas and refractive interference areas are distinguished. Combined with polarization images, optical interference is eliminated, and accurate 3D detection results for flexible packaging are generated.

Benefits of technology

It effectively distinguishes between optical interference and real structural defects, reduces the false rejection of good products and the missed detection of real structural defects, and improves the accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123154807A_ABST
    Figure CN123154807A_ABST
Patent Text Reader

Abstract

This invention discloses a three-dimensional visual inspection method and system for flexible packaging, relating to the field of three-dimensional visual inspection technology. Based on three-dimensional point cloud data and structured light stripe images corresponding to the same inspection location on the flexible packaging, it filters out missing point cloud regions. It compares the position of the stripe centerline with the position of the centerline of adjacent complete stripes, and determines the continuity of the boundary of the missing point cloud region with adjacent point clouds and the height change of the point cloud at each boundary position. When multiple adjacent boundary positions form a continuous height anomaly, a structural defect region is identified. When no structural defect is formed and the stripe centerline shifts while the boundary remains continuous with adjacent point clouds, a refraction interference region is identified. Combined with polarization images, it forms a reflection interference elimination result and a masking verification result for locations such as bag edges, thereby reducing misjudgments caused by optical interference and the missed detection of real structural defects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of three-dimensional visual inspection technology, specifically to a three-dimensional visual inspection method and system for flexible packaging. Background Technology

[0002] Flexible packaging is widely used for the outer packaging of products such as food, daily chemicals, pharmaceuticals, and electronic consumables. Its packaging materials typically include transparent film, aluminized film, composite film, and printed film. During the production process, appearance and structural inspections are required for locations such as the bag surface, sealing edges, folded edges, and transparent windows. With the increase in production line speed and the variety of packaging materials, two-dimensional vision inspection is gradually becoming insufficient to stably reflect three-dimensional states such as film surface undulations, local depressions, foreign object protrusion, and changes in sealing edge structure. Therefore, three-dimensional vision inspection is increasingly used to obtain spatial morphological information of the packaging surface and to improve inspection stability by combining polarization images, multispectral images, and multi-camera data.

[0003] In existing flexible packaging inspection processes, point cloud data generated by structured light or laser line scanning is easily affected by high reflectivity, transparent film refraction, bag edge obstruction, folded edge obstruction, and film wrinkles, resulting in missing points, point cloud jumps, or local holes. Current processing methods usually treat these areas as low-quality data for point filling, rejection, or direct judgment as suspected defect areas. There is a lack of differentiation on the causes of point cloud missing. It is easy to misjudge point cloud missing caused by reflection, refraction, or obstruction as real defects. It may also ignore point cloud missing, point cloud jumps, or local holes caused by actual damage, dents, or foreign objects in the point cloud data as unstable acquisition, thus leading to the wrong rejection of good products, missed detection of defective products, and inaccurate judgment of sealing risk. Summary of the Invention

[0004] This invention provides a three-dimensional visual inspection method and system for flexible packaging, which solves the problems mentioned in the background art.

[0005] A three-dimensional visual inspection method for flexible packaging includes the following steps: The missing point cloud region was obtained by screening the three-dimensional point cloud data and structured light stripe image corresponding to the same detection position of flexible packaging. For each missing point cloud region, within the corresponding structured light stripe image region, the position of the stripe center line is compared with the position of the center line of the adjacent complete stripe, and the continuity state of the boundary and the adjacent point cloud and the point cloud height change at each boundary position are determined along the boundary of the missing point cloud region. When the point cloud height changes at multiple adjacent boundary locations form a continuous height anomaly, the corresponding missing point cloud region is identified as a structural defect region. For point cloud missing regions that are not identified as structural defect regions, when the position of the stripe center line is offset relative to the position of the adjacent complete stripe center line, and the boundary of the point cloud missing region remains continuous with the adjacent point cloud, the corresponding point cloud missing region is identified as a refraction interference region. Based on the structural defect region, a structural defect confirmation result is generated. The refractive interference region is then subjected to refractive interference elimination, generating a refractive interference elimination result. Finally, based on the structural defect confirmation result and the refractive interference elimination result, a three-dimensional inspection result of the flexible packaging is obtained.

[0006] Preferably, the 3D point cloud data and the structured light fringe image correspond to the same detection location, including: A calibration piece with positioning points is placed at the inspection station to obtain the coordinate position of the same positioning point in the three-dimensional point cloud data and the structured light stripe image, and a position correspondence is established based on the difference between the coordinate positions. When inspecting flexible packaging, the position of the bag is determined based on the outer edge of the flexible packaging. At least one of the sealing contour and the edge of the transparent window is aligned with the corresponding position in the three-dimensional point cloud data and the structured light stripe image. The point cloud position in the three-dimensional point cloud data is converted to the corresponding coordinate in the structured light stripe image according to the position correspondence.

[0007] Preferably, the filtering of the missing point cloud regions includes: The flexible packaging surface is divided into multiple structural areas, including the bag face area, sealing area, folded edge area, transparent window area and bag edge area, and multiple detection zones are further divided within each structural area. The ratio of the number of valid point clouds in each detection zone to the area of ​​the detection zone, the area of ​​holes formed by locations with consecutive missing valid point clouds, and the ratio of the actual extracted stripe centerline length to the stripe centerline length that should appear are calculated. When at least one of the following conditions is met: the ratio of the effective point cloud quantity to the detection zone area is lower than the preset lower limit of the point cloud density of the same type of structure region and the hole area is higher than the preset upper limit of the point cloud hole area of ​​the same type of structure region, and the ratio of the actual extracted stripe center line length to the stripe center line length that should appear is lower than the preset lower limit of the structure light stripe integrity rate of the same type of structure region, the corresponding detection zone is determined as the point cloud missing region. When adjacent detection zones have consecutive points cloud locations without valid points cloud on both sides of the common boundary, the adjacent detection zones are merged into the same point cloud missing region.

[0008] Preferably, the comparison between the position of the stripe center line and the position of the adjacent complete stripe center line includes: Extract the stripe center point along the stripe width direction, and connect multiple stripe center points to form the stripe center line position; Extend the center lines of the stripes that can be continuously identified on both sides of the missing point cloud region toward the missing point cloud region to obtain the position of the center line of the adjacent complete stripe. The deviation distance of the stripe centerline position relative to the adjacent complete stripe centerline position is measured along the direction perpendicular to the stripe extension. When there are multiple stripe sections in the missing point cloud area, the maximum value of the deviation distance of each stripe section is taken.

[0009] Preferably, the determination of the continuous state of the boundary and adjacent point clouds, as well as the point cloud height changes at each boundary location, includes: Determine the inner and outer directions of each boundary location along the boundary of the missing point cloud region, and search for valid point clouds in the vicinity of the boundary location; When there are valid point clouds in both the inner and outer directions, the difference between the median heights of the valid point clouds on both sides is taken as the change in point cloud height at the corresponding boundary position. When there is no effective point cloud in the inner direction, the maximum difference in the height of the effective point cloud continuously distributed along the boundary direction in the vicinity of the outer direction is taken as the point cloud height change at the corresponding boundary position. When the change in point cloud height does not exceed the preset fluctuation range of similar structure regions, the boundary length at the corresponding boundary position is included in the boundary length that is continuous with the adjacent point cloud, and the continuous state is determined according to the ratio of the boundary length to the total boundary length of the missing point cloud region.

[0010] Preferably, the preset fluctuation range is determined based on the maximum value of the height difference between adjacent point clouds in qualified samples of the same structural region. When the point cloud height change at a single boundary location exceeds the preset fluctuation range, the boundary location is recorded as noise and does not form the structural defect region. When the point cloud height changes at multiple adjacent boundary locations all exceed the preset fluctuation range, a continuous height anomaly is formed, and the missing point cloud regions corresponding to the multiple adjacent boundary locations are identified as the structural defect regions.

[0011] Preferably, the method further includes: A polarization image corresponding to the same detection position as the three-dimensional point cloud data is acquired. In the polarization image region corresponding to the missing area of ​​the point cloud, adjacent pixels with grayscale values ​​reaching the highest grayscale value in the output grayscale range of the polarization imaging device are connected to obtain a pixel region, and the area of ​​the connected pixel region is calculated. When the ratio of the area of ​​the pixel region to the area of ​​the corresponding polarized image region exceeds the preset upper limit of the polarization saturation area ratio determined by the appearance qualified sample of the same structure region, and the change in point cloud height at the boundary of the point cloud missing region does not exceed the preset fluctuation range, the corresponding range of the pixel region and the point cloud missing region in the polarized image are merged into a reflective interference region. The reflective interference area is subjected to reflective interference elimination, a reflective interference elimination result is generated, and the reflective interference elimination result is incorporated into the three-dimensional detection result of the flexible packaging.

[0012] Preferably, the method further includes: For the point cloud missing regions that are not identified as structural defect regions, the shortest distances from the boundary of the point cloud missing regions to the bag edge, fold edge, wrinkle edge, and transparent window edge of the flexible packaging surface are measured respectively. When the location corresponding to the shortest distance is one of the bag edge, the folded edge, and the crease edge, and the ratio of the boundary length that is continuous with the adjacent point cloud to the total boundary length of the missing point cloud area is not lower than the occlusion calibration lower limit determined by the appearance qualified sample at the bag edge, folded edge, and crease edge, the missing point cloud area and the location corresponding to the shortest distance are recorded together as the occlusion verification area.

[0013] Preferably, the region outline of each missing point cloud region in the three-dimensional point cloud data, the corresponding region in the structured light stripe image, and the corresponding processing result are recorded and saved according to the flexible packaging number, the detection station trigger number, and the missing point cloud region number. The three-dimensional inspection result of the flexible packaging is generated based on the saved region contour, the corresponding region and the processing result. The processing result includes at least one of the following: structural defect confirmation result, refraction interference elimination result, reflection interference elimination result and occlusion verification result.

[0014] A flexible packaging 3D vision inspection system, comprising: The basic data acquisition module is set at the inspection station of flexible packaging. It is used to collect three-dimensional point cloud data and structured light stripe images of flexible packaging, and to map the three-dimensional point cloud data and the structured light stripe images to the same inspection position. The point cloud missing region filtering module is used to filter out point cloud missing regions based on the three-dimensional point cloud data and the structured light stripe image corresponding to the same detection location. The point cloud missing judgment data acquisition module is used to compare the position of the stripe center line with the position of the adjacent complete stripe center line in the corresponding structured light stripe image area for each point cloud missing area, and determine the continuity state of the boundary and the adjacent point cloud and the point cloud height change at each boundary position along the boundary of the point cloud missing area. The point cloud missing cause determination module is used to determine the corresponding point cloud missing area as a structural defect area when the point cloud height change at multiple adjacent boundary positions forms a continuous height anomaly. It is also used to determine the corresponding point cloud missing area as a refraction interference area when the position of the stripe center line of the point cloud missing area is offset relative to the position of the adjacent complete stripe center line, and the boundary of the point cloud missing area remains continuous with the adjacent point cloud. The cause detection and processing module is used to confirm the defects in the structural defect area, eliminate the refractive interference in the refractive interference area, and output the three-dimensional detection results of the flexible packaging.

[0015] This invention provides a three-dimensional visual inspection method and system for flexible packaging, which has the following beneficial effects: 1. By using 3D point cloud data and structured light stripe images corresponding to the same detection location, the continuous state and point cloud height changes at each boundary position are determined along the boundary of the missing point cloud area. Combined with the offset of the stripe center line relative to the adjacent complete stripe center line, the area where the continuous height anomaly is formed is identified as the structural defect area, and the area where the stripe center line is offset but the boundary remains continuous with the adjacent point cloud is identified as the refractive interference area. At the same time, the polarization image is combined to form the reflection interference elimination result, and the point cloud missing at the bag edge, fold edge and wrinkle edge is formed to form the occlusion verification result, so that optical interference, occlusion position and real structural defects are processed separately, reducing the false rejection of good products and the missed detection of real structural defects. Attached Figure Description

[0016] Figure 1 This is a schematic diagram of the 3D visual inspection method for flexible packaging. Figure 2 This is a schematic diagram of a 3D vision inspection system for flexible packaging. Detailed Implementation

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

[0018] Example 1 This embodiment can be applied to the online appearance inspection of transparent composite film food packaging bags, aluminized composite film daily chemical refill packaging bags, pharmaceutical flexible packaging bags with transparent windows, and antistatic flexible packaging bags. Among them, transparent composite film food packaging bags have multiple issues such as bag surface reflection, transparent window refraction, edge undulation, folded edge obstruction, and deformation due to compression by contents, which better reflects the inspection process of this invention. Therefore, this embodiment selects transparent composite film food packaging bags with transparent windows as the inspection object. After the flexible packaging enters the inspection station along the conveyor line, the inspection information of the bag surface, seal, folded edge, and transparent window is obtained by using three-dimensional point cloud data, structured light stripe images, and polarization images. This information is used to distinguish point cloud missingness caused by reflection, refraction, obstruction, and structural damage, and outputs the three-dimensional inspection results of the flexible packaging.

[0019] This invention provides a three-dimensional visual inspection method for flexible packaging. Please refer to [link / reference]. Figure 1 This includes the following steps: The missing point cloud region was obtained by screening the three-dimensional point cloud data and structured light stripe image corresponding to the same detection position of flexible packaging. For each missing point cloud region, within the corresponding structured light stripe image region, the position of the stripe center line is compared with the position of the center line of the adjacent complete stripe, and the continuity state of the boundary and the adjacent point cloud and the point cloud height change at each boundary position are determined along the boundary of the missing point cloud region. When the point cloud height changes at multiple adjacent boundary locations form a continuous height anomaly, the corresponding missing point cloud area is identified as a structural defect area. For point cloud missing regions that are not identified as structural defect regions, when the position of the stripe center line shifts relative to the position of the adjacent complete stripe center line, and the boundary of the point cloud missing region remains continuous with the adjacent point cloud, the corresponding point cloud missing region is identified as a refraction interference region. Based on the structural defect area, a structural defect confirmation result is generated. The refractive interference area is then eliminated to generate a refractive interference elimination result. Finally, based on the structural defect confirmation result and the refractive interference elimination result, the three-dimensional inspection result of the flexible packaging is obtained.

[0020] Regarding the determination of the center line of adjacent complete stripes: In this embodiment, stripe center points are extracted one by one from both sides of the point cloud missing area. Stripes whose center points can be extracted from three or more consecutive sections closest to the boundary of the point cloud missing area are considered as adjacent complete stripes. The distance between the center points of stripes of any two adjacent sections shall not exceed the maximum value of the distance between the center points of stripes in the appearance qualified samples of the same structural area. When the above conditions are met, the center points of each stripe are connected and extended to the point cloud missing area to obtain the position of the center line of adjacent complete stripes. If no center point of stripes is extracted from any section or the distance between the center points of adjacent stripes exceeds the maximum value, the corresponding stripe is not considered as an adjacent complete stripe.

[0021] Regarding the determination of the continuity between the boundary and adjacent point clouds: In this embodiment, boundary positions are selected sequentially along the boundary of the missing point cloud region, and valid point clouds are searched within a range of one to three times the average spacing of point clouds around each boundary position. When valid point clouds exist on both the inner and outer sides of the boundary, the difference between the median heights of the valid point clouds on both sides is calculated. When there are no valid point clouds on the inner side of the boundary, the maximum difference in height of the valid point clouds continuously distributed along the boundary direction on the outer side of the boundary is calculated. If the difference does not exceed the preset fluctuation range of similar structural regions, the boundary position is determined to be continuous. If the difference exceeds the preset fluctuation range or no valid point cloud can be found for comparison, the boundary position is determined to be discontinuous. When the proportion of the boundary length corresponding to the continuous boundary position to the total length of the boundary of the missing point cloud region is not less than the minimum value of this proportion among the qualified samples of similar structural regions, the boundary of the missing point cloud region is determined to be continuous with the adjacent point clouds.

[0022] In this embodiment, the missing point cloud region is first screened based on the 3D point cloud data and structured light stripe image corresponding to the same detection position. Then, by combining the position of the stripe center line, the position of the center line of the adjacent complete stripe, the continuity of the boundary and the adjacent point cloud, and the point cloud height change at each boundary position, the structural defect region and the refraction interference region are distinguished. The structural defect confirmation result is generated based on the structural defect region, and the refraction interference region is eliminated to generate the refraction interference elimination result. This enables the 3D detection result of flexible packaging to reflect the real structural defects and refraction interference respectively, reducing the confusion caused by the direct filling, elimination or misjudgment of missing point clouds as structural defects.

[0023] Example 2 In the application scenario set in Example 1, this example continues to explain the correspondence between the same detection position of the three-dimensional point cloud data and the structured light stripe image, the screening of the missing point cloud region, the comparison of the stripe center line position, the determination of the continuous state of the boundary and adjacent point clouds and the point cloud height change at each boundary position, as well as the formation process of the occlusion verification region.

[0024] This embodiment uses a transparent composite film food packaging bag with a transparent window as the detection object. The collection area covers the bag surface, sealing edge, folded edge, transparent window and bag edge. After the flexible packaging enters the detection station along the conveyor line, the three-dimensional vision acquisition device and polarization imaging device are activated by the trigger signal of the same detection station, so that the three-dimensional point cloud data, structured light stripe image and polarization image all come from the same detection position of the same flexible packaging.

[0025] First, the acquisition process of 3D point cloud data, structured light fringe images, and polarization images is explained.

[0026] In this embodiment: the three-dimensional vision acquisition device is set above or to the side of the inspection station on the conveyor line. Before acquisition, a similar flexible package with qualified appearance is placed at the inspection station. The installation height and installation angle of the three-dimensional vision acquisition device are adjusted so that the outer contour of the bag surface, the sealing edge contour, the folded edge contour and the transparent window contour all fall into the imaging screen, and the above contours are not cut off by the edge of the imaging screen.

[0027] In this embodiment: when using structured light scanning, striped light is projected onto the surface of the flexible packaging from the projection end, and the camera end acquires the striped image after the striped light falls on the surface of the flexible packaging. Based on the bending position, discontinuity position, and position change of the stripes in the image, three-dimensional point cloud data and structured light striped image are generated. When using laser line scanning, the laser line moves along the surface of the flexible packaging, and the camera end continuously records the imaging position of the laser line on the surface of the flexible packaging. Based on the change of the imaging position of the laser line with the scanning position, three-dimensional point cloud data and structured light striped image are generated.

[0028] In this embodiment: the polarization imaging device is positioned above or to the side of the conveyor line inspection station, maintaining the same inspection direction as the 3D vision acquisition device, so that the image of the polarization imaging device covers the corresponding inspection area of ​​the 3D vision acquisition device; the polarization imaging device acquires the grayscale distribution of the flexible packaging surface under polarization conditions to obtain a polarization image. When adjusting the exposure time, an area excluding bag edges, sealing edges, folded edges, transparent window edges, and dark-colored printed text is selected from the main area of ​​the bag surface of the qualified sample as the exposure reference area. Based on the highest output grayscale value of the polarization imaging device, the average grayscale value of the exposure reference area, the percentage of pixel area reaching the highest output grayscale value, and the percentage of pixel area with grayscale value not exceeding 10% of the highest output grayscale value are statistically analyzed. When the average grayscale value is 20% to 80% of the highest output grayscale value, the percentage of pixel area reaching the highest output grayscale value does not exceed 5%, the percentage of pixel area with grayscale value not exceeding 10% of the highest output grayscale value does not exceed 5%, and the average grayscale difference between the two sides of the printed texture edge or film edge is not less than 10% of the highest output grayscale value, the exposure time is determined to meet the acquisition requirements.

[0029] When the average gray value is higher than 80% of the highest output gray value or the area of ​​pixels reaching the highest output gray value exceeds 5%, it is judged as overexposure. Each time, the exposure time is reduced by 10% and the image is re-acquired. When the average gray value is lower than 20% of the highest output gray value or the area of ​​pixels with gray values ​​not higher than 10% of the highest output gray value exceeds 5%, it is judged as underexposure. Each time, the exposure time is increased by 10% and the image is re-acquired until the exposure reference area meets the above acquisition requirements. Among them, when the polarization imaging device outputs an eight-bit grayscale image, the highest output gray value is 255, the corresponding average gray value range is 51 to 204, the gray value of low grayscale pixels is not higher than 25, and the average gray value difference between the two sides of the printing texture edge or film surface edge is not lower than 26.

[0030] The steps involving the 3D point cloud data and structured light fringe images corresponding to the same detection location include: A calibration piece with positioning points is placed at the inspection station. The coordinate positions of the same positioning point in the 3D point cloud data and structured light stripe image are obtained respectively. The position correspondence is established based on the difference between the coordinate positions. When inspecting flexible packaging, the position of the bag is determined based on the outer edge of the flexible packaging. At least one of the sealing contour and the edge of the transparent window is aligned with the corresponding position in the 3D point cloud data and the structured light stripe image. The point cloud position in the 3D point cloud data is converted to the corresponding coordinate in the structured light stripe image according to the position correspondence.

[0031] Specifically: A calibration plate with positioning points is placed at the inspection station, allowing the 3D vision acquisition device to acquire the positioning points on the same calibration plate and record the coordinate positions of the same positioning point in the 3D point cloud data and the structured light fringe image respectively; when recording the coordinate positions in the 3D point cloud data, the 3D point cloud data is first projected onto the plane of the inspection station or the imaging plane of the 3D vision acquisition device to obtain the two-dimensional coordinates, and then the translation, rotation, and scaling are obtained according to the coordinate differences of the same positioning point in the two types of data, and the positional correspondence is established by the translation, rotation, and scaling; the polarization imaging device simultaneously acquires the positioning points on the calibration plate and establishes the positional correspondence between the polarization image and the 3D point cloud data according to the same coordinate difference processing method.

[0032] During data processing: When detecting flexible packaging, the bag position is determined based on the outer edge of the flexible packaging. At least one of the sealing contour and the transparent window edge is aligned with the corresponding position in the 3D point cloud data and structured light fringe image. The point cloud position in the 3D point cloud data is converted to the corresponding coordinate in the structured light fringe image according to the position correspondence. For polarized images, according to the position correspondence between the polarized image and the 3D point cloud data, the same bag surface position, the same sealing edge position, or the same transparent window position is mapped to the same detection position in the polarized image.

[0033] In this embodiment: when the upper left corner of the transparent window corresponds to a local point cloud hole in the 3D point cloud data, a stripe bend position in the structured light stripe image, and a continuous saturated pixel region in the polarization image, all three fall within the same contour range of the upper left corner of the transparent window after positional correspondence. The 3D point cloud data, structured light stripe image, and polarization image corresponding to this position constitute the basic detection data.

[0034] The steps for filtering missing regions in a point cloud include: The flexible packaging surface is divided into multiple structural areas, including the bag face area, sealing area, folded edge area, transparent window area and bag edge area, and multiple detection zones are further divided within each structural area. The ratio of the number of valid point clouds in each detection zone to the area of ​​the detection zone, the area of ​​holes formed by locations with consecutive missing valid point clouds, and the ratio of the actual extracted stripe centerline length to the required stripe centerline length are calculated. When the ratio of the effective point cloud quantity to the detection zone area is lower than the preset lower limit of the point cloud density of the same type of structure region and the hole area is higher than the preset upper limit of the point cloud hole area of ​​the same type of structure region, and the ratio of the actual extracted stripe center line length to the stripe center line length that should appear is lower than the preset lower limit of the structure light stripe integrity rate of the same type of structure region, the corresponding detection zone is determined as a point cloud missing region. When adjacent detection zones have consecutive points without valid point cloud locations along the common boundary on both sides, the adjacent detection zones are merged into the same point cloud missing region.

[0035] In this embodiment: First, based on the outer contour, sealing contour, folding contour, and transparent window contour of the flexible packaging, the surface of the flexible packaging is divided into the bag face area, sealing area, folding area, transparent window area, and bag edge area. Then, inspection zones are divided within each structural area. The size of the inspection zone is determined according to the minimum outer boundary of defects to be detected as specified in the production inspection standards, customer acceptance standards, or internal quality standards of the enterprise, so that one inspection zone can cover the minimum outer boundary corresponding to dents, tears, foreign objects protruding, or abnormal sealing, and does not cross two different structural areas.

[0036] Specifically: point cloud density is the ratio of the number of valid point clouds in the detection zone to the area of ​​the detection zone; valid point clouds are point clouds with three-dimensional coordinates that are not marked as invalid values, background points, or points outside the imaging field of view by the three-dimensional vision acquisition device; the height difference of neighboring point clouds in qualified samples of similar structural areas is used to determine the preset fluctuation range and serves as the calibration basis for comparing the point cloud height changes at each boundary position with the preset fluctuation range.

[0037] Specifically: The point cloud hole area is obtained by statistically analyzing the locations where there are consecutive missing valid point clouds within the detection zone; when there are no valid point clouds in adjacent horizontal or vertical positions in the point cloud arrangement, the adjacent invalid positions are connected to form a hole area, and the sum of the projected areas of the hole areas within the detection zone is taken as the point cloud hole area.

[0038] Specifically: the structured light stripe integrity rate is the ratio of the actual extracted stripe centerline length within the detection zone to the stripe centerline length that should appear within the detection zone; the stripe centerline length that should appear is obtained by calibrating the structured light stripe images of the same batch of appearance-qualified samples within the same detection zone, and the length of the complete stripe centerline within the same detection zone is recorded during calibration.

[0039] Specifically: The point cloud missing screening conditions were obtained by calibrating the same batch of appearance qualified samples before production. The calibrated samples covered the center, left and right placement states. The center state is when the center line of the flexible packaging corresponds to the center line of the conveyor line. The left and right states are the states where the flexible packaging is close to the left and right side of the conveyor line, respectively. The basic detection data of the bag surface area, sealing area, folded area, transparent window area and bag edge area are collected in the three placement states respectively.

[0040] During data processing: For the same structural region, the same detection zone of the same qualified sample is sampled no less than three times, and the point cloud density, point cloud hole area, and structured light stripe integrity rate are recorded respectively; the difference between the maximum and minimum point cloud density in the repeated sampling is used as the point cloud density sampling error compensation amount, the difference between the maximum and minimum point cloud hole area in the repeated sampling is used as the point cloud hole area sampling error compensation amount, and the difference between the maximum and minimum structured light stripe integrity rate in the repeated sampling is used as the structured light stripe integrity rate sampling error compensation amount.

[0041] During data processing: the minimum point cloud density of the appearance-qualified sample minus the point cloud density acquisition error compensation is used as the preset lower limit of point cloud density; the maximum point cloud hole area of ​​the appearance-qualified sample plus the point cloud hole area acquisition error compensation is used as the preset upper limit of point cloud hole area; and the minimum structured light stripe integrity rate of the appearance-qualified sample minus the structured light stripe integrity rate acquisition error compensation is used as the preset lower limit of structured light stripe integrity rate. Among these, the preset lower limit of point cloud density is not lower than 0, the preset upper limit of point cloud hole area does not exceed the area of ​​the corresponding detection zone, and the preset lower limit of structured light stripe integrity rate is not lower than 0.

[0042] It should be noted that when changing the batch of membrane material, adjusting the light source, or adjusting the conveying speed, a qualified sample should be collected again and the following should be updated: point cloud density acquisition error compensation, point cloud hole area acquisition error compensation, structured light stripe integrity rate acquisition error compensation, point cloud density preset lower limit, point cloud hole area preset upper limit, and structured light stripe integrity rate preset lower limit.

[0043] During data processing: when the point cloud density of a certain detection zone is lower than the preset lower limit of the point cloud density of the same type of structure region, or the point cloud hole area is higher than the preset upper limit of the point cloud hole area of ​​the same type of structure region, the detection zone is regarded as a candidate region; the structure light stripe integrity rate of the candidate region is read, and when the structure light stripe integrity rate is lower than the preset lower limit of the structure light stripe integrity rate of the same type of structure region, the corresponding detection zone is determined as a point cloud missing region.

[0044] It should be noted that when there are no valid point cloud locations continuously arranged along the common boundary on both sides of adjacent detection zones, the adjacent detection zones are merged into the same point cloud missing area to avoid the same point cloud missing area being separated by the detection zone boundary.

[0045] To determine reflective interference, the pixel grayscale and continuous saturated pixel regions corresponding to the missing point cloud regions in the polarization image are first obtained, as follows: After the missing areas of the point cloud are mapped to their locations, an image region at the same location is obtained in the polarized image, and the grayscale value of the pixels in that image region is read. When the grayscale value of a pixel reaches the highest grayscale value in the camera's output grayscale range, the pixel is counted as a saturated pixel. The camera's output grayscale range is determined by the image bit depth of the polarization imaging device.

[0046] During data processing: if multiple saturated pixels are adjacent horizontally, vertically, or diagonally, these saturated pixels are connected to form a continuous saturated pixel region, and the area of ​​the continuous saturated pixel region is used as the statistical object of the saturated pixel area; if the pixel grayscale does not reach the highest grayscale value of the camera's output grayscale range, the pixel is not included in the saturated pixel area.

[0047] Specifically: the polarization saturation area ratio is the ratio of the saturated pixel area to the area of ​​the polarization image region corresponding to the missing point cloud region; the main area of ​​the bag surface is selected from the area excluding the bag edge, sealing edge, folded edge, transparent window edge and printed dark text. The main area of ​​the bag surface is used to adjust the exposure time of the polarization imaging device and does not participate in the saturation pixel area statistics.

[0048] The steps for comparing the position of the fringe center line with the position of the center line of the adjacent complete fringe include: Extract the center points of the stripes along the stripe width direction, and connect multiple stripe center points to form the stripe center line position; Extend the center lines of the stripes that can be continuously identified on both sides of the missing point cloud region toward the missing point cloud region to obtain the positions of the center lines of the adjacent complete stripes. The deviation distance of the stripe centerline position relative to the adjacent complete stripe centerline position is measured along the direction perpendicular to the stripe extension. When there are multiple stripe sections in the missing point cloud area, the maximum value of the deviation distance of each stripe section is taken.

[0049] Specifically: After mapping the missing areas of the point cloud, obtain the stripe image regions at the same location in the structured light stripe image, read the grayscale changes along the stripe width direction, and select the position with the highest grayscale as the stripe center point; when the two sides of the stripe can be extracted in the width direction, take the middle position of the two sides as the stripe center point, and connect multiple stripe center points to obtain the stripe center line position.

[0050] Specifically: the position of the center line of adjacent complete stripes is obtained by extending the center lines of stripes that can be continuously identified on both sides of the missing area of ​​the point cloud towards the missing area of ​​the point cloud; continuous identification means that the center points of stripes can be extracted from adjacent sections, and the distance between adjacent stripe center points does not exceed the maximum value of the spacing between stripe center points in the same structural area of ​​the appearance qualified sample.

[0051] During data processing, the structured light fringe offset is the deviation distance of the fringe centerline position in the missing area of ​​the point cloud relative to the centerline position of the adjacent complete fringe. The deviation distance is measured along the direction perpendicular to the fringe extension. When there are multiple fringe sections in the missing area of ​​the point cloud, the maximum value of the deviation distance of each section is taken as the structured light fringe offset.

[0052] The steps for determining the continuous state of the boundary and adjacent point clouds, as well as the changes in point cloud height at each boundary location, include: Determine the inner and outer directions of each boundary location along the boundary of the missing point cloud region, and search for valid point cloud data within the vicinity of the boundary location; When there are effective point clouds in both the inner and outer directions, the difference between the median heights of the effective point clouds on both sides is taken as the change in point cloud height at the corresponding boundary position. When there is no effective point cloud in the inner direction, the maximum difference in the height of the effective point cloud continuously distributed along the boundary direction in the adjacent range of the outer direction is taken as the point cloud height change at the corresponding boundary position. When the change in point cloud height does not exceed the preset fluctuation range of the same type of structure region, the boundary length of the corresponding boundary position is included in the boundary length that is continuous with the adjacent point cloud, and the continuous state is determined according to the ratio of the boundary length to the total boundary length of the missing point cloud region.

[0053] Specifically: Read the boundary position along the outline of the missing point cloud region, and determine the adjacent range with each boundary position as the center; when the adjacent range is determined based on the average spacing of the point cloud, take 1 to 3 times the average spacing of the point cloud, which is the average distance between adjacent valid point clouds in the non-missing area around the missing point cloud region; when the adjacent range is determined based on the detection partition size, take 1% to 5% of the detection partition side length, which is the shortest side length of the detection partition to which the missing point cloud region belongs.

[0054] Specifically: the two sides of the boundary include the side facing the interior of the missing point cloud region and the side away from the missing point cloud region; for irregular missing point cloud regions, first determine the tangent direction of the current boundary position along the boundary of the missing point cloud region, then take the direction perpendicular to the tangent direction and pointing towards the interior of the missing point cloud region as the inner direction, and take the direction away from the interior of the missing point cloud region as the outer direction.

[0055] Specifically: For each boundary location, search for valid point clouds that can represent the height changes on both sides of the boundary within the vicinity of the boundary location; when valid point clouds exist in both the inner and outer directions, read and compare the heights of valid point clouds within the vicinity of the inner and outer directions respectively; when no valid point cloud exists in the inner direction, read the heights of valid point clouds continuously distributed along the boundary direction within the vicinity of the outer direction, and use the height changes of these continuously distributed valid point clouds as the basis for judging the point cloud boundary height difference at that boundary location; if a valid point cloud for comparison cannot be obtained within the vicinity, then the boundary location is not included in the boundary length that maintains continuity with adjacent point clouds.

[0056] Specifically: when the effective point cloud height difference used for comparison does not exceed the preset fluctuation range of the appearance qualified samples in the same structural area, the boundary length corresponding to the boundary position is included in the boundary length that is continuous with the adjacent point cloud; when the effective point cloud height difference used for comparison exceeds the preset fluctuation range of the appearance qualified samples in the same structural area, the boundary length corresponding to the boundary position is not included in the boundary length that is continuous with the adjacent point cloud.

[0057] Specifically: Before production, the preset fluctuation range is calibrated separately for the bag face area, sealing area, folded area, transparent window area, and bag edge area. During calibration, qualified samples are selected, and the difference in the height of the adjacent point cloud at different comparison positions in each structural area is obtained according to the aforementioned adjacent range and point cloud height reading method. When there are effective point clouds on both sides of the comparison position, the difference between the median heights of the effective point clouds on both sides is taken. When there are no effective point clouds on one side of the comparison position, the maximum difference in the height of the effective point clouds continuously distributed along the boundary direction on the other side is taken. Then, the maximum value among all the adjacent point cloud height differences obtained in the same structural area is taken as the base value. When there is a duplicate acquisition error, the base value is added to the corresponding acquisition error compensation amount to obtain the preset fluctuation range of the structural area.

[0058] Specifically: the continuity ratio of the point cloud boundary is the ratio of the length of the boundary that is continuous with the adjacent point cloud to the total length of the boundary of the missing point cloud region; when there are adjacent valid point clouds on both sides of the boundary, the height difference of the point cloud boundary is obtained by comparing the heights of the adjacent valid point clouds on both sides of the boundary of the missing point cloud region; when there are no valid point clouds inside the missing point cloud region, the maximum difference in height of the valid point clouds continuously distributed along the boundary direction in the adjacent range on the outer side is used as the height difference of the point cloud boundary at that boundary position; when there are multiple adjacent valid point clouds on one side of the boundary, the median of the height values ​​of the adjacent valid point clouds on that side is taken as the height of that side.

[0059] It should be noted that: in this embodiment, the point cloud boundary height difference at each boundary position corresponds to the point cloud height change at each boundary position determined along the boundary of the missing point cloud region; when the point cloud boundary height difference at multiple adjacent boundary positions exceeds the preset fluctuation range of the same type of structural region, the point cloud height change at the multiple adjacent boundary positions forms a continuous height anomaly.

[0060] The present invention provides a three-dimensional visual inspection method for flexible packaging, which further includes: For the point cloud missing regions that are not identified as structural defect regions, the shortest distances from the boundary of the point cloud missing region to the bag edge, fold edge, wrinkle edge and transparent window edge of the flexible packaging surface are measured respectively. When the location corresponding to the shortest distance is one of the bag edge, fold edge, and crease edge, and the ratio of the continuous boundary length with the adjacent point cloud to the total boundary length of the missing point cloud area is not lower than the occlusion calibration lower limit determined by the appearance qualified sample at the bag edge, fold edge, and crease edge, the missing point cloud area and the location corresponding to the shortest distance are recorded together as the occlusion verification area.

[0061] Specifically: the bag edge is determined by the outer contour of the flexible packaging; the folded edge is determined by the linear height change position formed by folding the bag body; the wrinkled edge is determined by the narrow strip height change position formed by local bending of the bag surface; the transparent window edge is determined by the contour line between the transparent window and the main area of ​​the bag surface; the bag edge, folded edge, wrinkled edge and transparent window edge are all converted to the same detection position and then participate in the distance measurement.

[0062] During data processing, the shortest distance from the boundary of the missing point cloud region to the edge of the bag, the edge of the fold, the edge of the wrinkle, and the edge of the transparent window are measured respectively. The position corresponding to the shortest distance is taken as the neighboring position of the missing point cloud region. If the shortest distances of two positions are the same, both positions are recorded as the neighboring positions of the missing point cloud region.

[0063] In the scenario set in Example 1: if the distance from a missing point cloud region to the edge of the transparent window is the minimum distance among all neighboring locations, then the edge of the transparent window is taken as the neighboring location of the missing point cloud region and recorded as the structural position of the missing point cloud region; when determining the cause of the missing point cloud region later, the reflection determination result is obtained based on the polarization saturation area ratio and the height difference of the point cloud boundary, and the refraction determination result is obtained based on the structured light fringe offset and the continuity ratio of the point cloud boundary; if the distance from a missing point cloud region to the edge of the bag, folded edge, or wrinkled edge is the minimum distance among all neighboring locations, then the edge of the bag, folded edge, or wrinkled edge is taken as the neighboring location of the missing point cloud region and used for subsequent occlusion determination.

[0064] In this embodiment: In order to determine the judgment parameters corresponding to different reasons for point cloud missingness, typical areas corresponding to the actual production process of flexible packaging are selected as calibration objects. The calibration objects include the metallized film area, transparent window area, transparent film stacking area, bag opening folded edge area, sealing edge overlapping area, natural wrinkle area, and abnormal areas with sealing edge cracks, bag surface depressions, foreign object lifting, and local tears of the aluminized composite film packaging bag. By collecting the three-dimensional point cloud data, structured light stripe images, and polarization images corresponding to the above areas, the parameter change range under normal and abnormal states is statistically analyzed.

[0065] Specifically: To address point cloud loss caused by reflection, the metallized film area of ​​the aluminized composite film packaging bag and the transparent composite film area with high reflectivity were selected as calibration objects. Polarization images of the corresponding areas of 30 appearance-qualified samples were collected, and the polarization saturation area ratio of the corresponding area for each sample was calculated. The maximum value among the detection results of multiple qualified samples within the same structural area was taken as the normal upper limit of the polarization saturation area ratio. When there are equipment acquisition errors during repeated acquisitions, the maximum change in the polarization saturation area ratio during repeated acquisitions was added to the maximum value as a compensation value. In this embodiment, the normal upper limit of the polarization saturation area ratio for the ordinary composite film area was calibrated to 0.18, and the normal upper limit of the polarization saturation area ratio for the aluminized composite film area was calibrated to 0.42. When the polarization saturation area ratio of the detection area exceeds the corresponding normal upper limit, and the height difference of the point cloud boundary does not exceed the height fluctuation range of the corresponding structural area, this area is considered as the object for judging point cloud loss caused by reflection.

[0066] Specifically: To address point cloud defects caused by refraction, the transparent window region and the transparent film stack region are selected as calibration objects; structured light stripe images of the transparent material under normal conditions are acquired, the positions of the stripe center lines within the same structural region are extracted, and the positional offset of the stripe center line relative to the center lines of adjacent complete stripes is calculated; the maximum value of the structured light stripe offset among multiple appearance-qualified samples is taken as the normal upper limit of the structured light stripe offset, and corrections are made based on repeated acquisition errors. In this embodiment, the normal upper limit of the structured light stripe offset corresponding to the transparent window region is calibrated as 0.65 mm, and the normal lower limit of the continuous ratio of the point cloud boundary is calibrated as 0.85. When the structured light stripe offset exceeds the normal upper limit and the continuous ratio of the point cloud boundary is not lower than the normal lower limit, this region is used as the object for judging point cloud defects caused by refraction.

[0067] Specifically: For point cloud defects caused by occlusion, the bag opening folded edge area, the sealing edge overlap area, and the natural wrinkle area are selected as calibration objects; the continuous ratio of point cloud boundaries of appearance-qualified samples under normal packaging posture is collected, and statistics are made separately for bag edges, folded edges, and wrinkle edges; the minimum value among the detection results of multiple qualified samples in the same structural area is taken as the normal lower limit of the continuous ratio of the point cloud boundary, and error correction is performed based on the maximum decrease that occurs during repeated collection; the minimum value of the continuous ratio of the point cloud boundary obtained under normal occlusion is taken as the occlusion calibration lower limit. In this embodiment, the occlusion calibration lower limit for the bag edge area is 0.80, the occlusion calibration lower limit for the folded edge area is 0.76, and the occlusion calibration lower limit for the wrinkle edge area is 0.72. When the adjacent position of the point cloud defect area corresponds to the above-mentioned structural areas, and the continuous ratio of the point cloud boundary meets the corresponding occlusion calibration range, this area is taken as the object of judgment for point cloud defects caused by occlusion.

[0068] Specifically: For point cloud loss caused by structural damage, areas such as edge cracking, bag surface denting, foreign object protrusion, and localized tear areas are selected as calibration objects; three-dimensional point cloud data of corresponding positions of normal and abnormal samples are collected, and the height difference between adjacent point clouds on both sides of the boundary of the normal structural area is calculated, with the maximum height difference among multiple appearance-qualified samples as the height fluctuation range; at the same time, the continuous ratio of the point cloud boundary of the normal structural area is calculated, with the minimum value among multiple appearance-qualified samples as the normal lower limit of the continuous ratio of the point cloud boundary; in this embodiment, the height fluctuation range of the bag surface area is within 0.18 mm, the edge sealing area is within 0.45 mm, the folded edge area is within 0.65 mm, the transparent window area is within 0.55 mm, and the bag edge area is within 0.60 mm. When the continuous ratio of the point cloud boundary of the detection area is lower than the corresponding normal lower limit, and the height difference of the point cloud boundary exceeds the corresponding height fluctuation range, the area is used as the object for judging point cloud loss caused by structural damage.

[0069] During data processing: the normal lower limit of point cloud density, the normal upper limit of point cloud hole area, and the normal lower limit of structured light stripe integrity rate are determined according to the minimum or maximum value among the repeated acquisition results of qualified samples in the same structural region; among them, the parameter with the lowest allowable index value is determined by the minimum value among the qualified sample test results, and the parameter with the highest allowable index value is determined by the maximum value among the qualified sample test results, and is corrected in combination with the repeated acquisition error; the normal upper limit of polarization saturation area ratio, the normal upper limit of structured light stripe offset, the normal lower limit of point cloud boundary continuity ratio, the height fluctuation range, and the lower limit of occlusion calibration are all statistically determined according to the normal sample test results of the corresponding typical regions, so as to ensure that different material regions and different structural regions have corresponding parameter judgment criteria.

[0070] In this embodiment, the positional correspondence between three-dimensional point cloud data, structured light stripe images, and polarization images is established through calibration plates and flexible packaging contours. Point cloud missing areas are then screened according to the bag surface area, sealing area, folded edge area, transparent window area, and bag edge area. Subsequently, the continuity state between the boundary and adjacent point clouds is determined according to the stripe centerline position comparison method and the point cloud height change acquisition method defined in the claims. The shortest distance from the point cloud missing area to the bag edge, folded edge, wrinkle edge, and transparent window edge is measured to provide corresponding data for the subsequent determination of structural defect areas, refractive interference areas, reflective interference areas, and occlusion verification areas.

[0071] Example 3 In the application scenario set in Example 1, this example continues to explain the determination of the structural defect area, refraction interference area, reflection interference area and occlusion verification area, as well as the generation process of the structural defect confirmation result, refraction interference elimination result, reflection interference elimination result and occlusion verification result; the polarization saturation area ratio, structured light stripe offset, point cloud boundary continuity ratio, point cloud boundary height difference and adjacent position of point cloud missing area used in this example are all obtained in the manner of Example 2.

[0072] Before processing each missing point cloud region, the polarization saturation area ratio, structured light fringe offset, point cloud boundary continuity ratio, point cloud height change at each boundary position, and adjacent positions of the missing point cloud region are recorded. The point cloud boundary height difference is used as the recorded value of the point cloud height change at each boundary position for subsequent comparison and result tracking.

[0073] During data processing: For each missing point cloud region, separate records are established for reflection interference judgment, refraction interference judgment, occlusion verification judgment, and structural defect judgment. The reflection interference judgment record includes the region number, polarization saturation area ratio, and point cloud height change at the corresponding boundary position. The refraction interference judgment record includes the region number, structured light fringe offset, and point cloud boundary continuity ratio. The occlusion verification judgment record includes the region number, adjacent positions of the missing point cloud region, and point cloud boundary continuity ratio. The structural defect judgment record includes the region number, adjacent boundary positions forming continuous height anomalies, and corresponding point cloud height changes.

[0074] It should be noted that the preset upper and lower limits in this embodiment are set separately according to parameter type and structural region. Different parameters do not share the same preset value. Specifically, the maximum value of the polarization saturation area ratio and the maximum value of the structure light stripe offset in the appearance qualified samples of the same structural region are used as the basic values ​​of the preset upper limit of polarization saturation area ratio and the preset upper limit of structure light stripe offset, respectively. The minimum value of the continuous ratio of point cloud boundary in the appearance qualified samples of the same structural region is used as the basic value of the preset lower limit of the continuous ratio of point cloud boundary. The minimum value of the continuous ratio of point cloud boundary at the edge of bag, fold edge and crease edge of appearance qualified samples is used as the basic value of the occlusion calibration lower limit. The basic value of the preset fluctuation range is the maximum value of the height difference between adjacent point clouds in the appearance qualified samples of the same structural region.

[0075] Secondly, if the 3D vision acquisition device or polarization imaging device has repeated acquisition errors, the same detection position of the same qualified sample should be repeatedly acquired no less than three times before production. The difference between the maximum and minimum values ​​of the same parameter in the repeated acquisitions should be used as the acquisition error compensation amount for that parameter. When setting a preset upper limit, the acquisition error compensation amount should be added to the maximum value of the corresponding parameter of the qualified sample. When setting a preset lower limit, the acquisition error compensation amount should be deducted from the minimum value of the corresponding parameter of the qualified sample. When setting a preset fluctuation range, the acquisition error compensation amount should be added to the maximum value of the height difference between adjacent point clouds.

[0076] When the parameter is a proportional parameter, the preset upper limit after adding the acquisition error compensation amount shall not exceed 100%, and the preset lower limit after deducting the acquisition error compensation amount shall not be lower than 0; the polarization saturation area ratio and the continuous ratio of the point cloud boundary shall both be set according to this rule.

[0077] The preset fluctuation range is determined based on the maximum height difference of adjacent point clouds among visually acceptable samples of similar structural regions. The criteria for determining structural defect regions are as follows: When the point cloud height change at a single boundary location exceeds the preset fluctuation range, the boundary location is recorded as noise and does not form a structural defect area. When the point cloud height changes at multiple adjacent boundary locations all exceed the preset fluctuation range, a continuous height anomaly is formed, and the missing point cloud regions corresponding to multiple adjacent boundary locations are identified as structural defect regions.

[0078] Specifically: The point cloud boundary height difference at each boundary position is read sequentially along the boundary of the missing point cloud region, and the judgment is made according to the correspondence between the point cloud boundary height difference and the point cloud height change in Example 2; when only a single boundary position has a point cloud boundary height difference exceeding the preset fluctuation range of the same type of structural region, the boundary position is recorded as noise; when the point cloud boundary height difference of multiple adjacent boundary positions exceeds the preset fluctuation range, a continuous height anomaly is formed, and the point cloud missing regions corresponding to multiple adjacent boundary positions are determined as structural defect regions.

[0079] It should be noted that, in this embodiment, the boundary positions along the boundary of the missing point cloud region are sequentially sorted in the same direction. Closed boundaries are sorted in either a clockwise or counterclockwise direction, while non-closed boundaries are sorted from one end of the boundary to the other. Adjacent boundary positions refer to two consecutive boundary positions before and after the above sorting. Multiple adjacent boundary positions refer to two or more consecutive boundary positions arranged in the above sorting. When the point cloud height change of one of the consecutively arranged boundary positions does not exceed the preset fluctuation range, or the point cloud height change of that boundary position cannot be obtained, that boundary position is used as the break point of the continuous relationship.

[0080] In the scenario set in Example 1: when there is a tear, dent, foreign object protrusion, or damage to the sealing structure on the bag surface, if the location has been identified as a missing point cloud area, the point cloud height changes at each boundary location are obtained sequentially along the boundary of the missing point cloud area; when the point cloud height changes at multiple adjacent boundary locations all exceed the preset fluctuation range of the same type of structural area, a continuous height anomaly is formed, and the corresponding missing point cloud area is identified as a structural defect area; a structural defect confirmation result is generated based on the location of the structural defect area, the adjacent boundary locations that form the continuous height anomaly, and the corresponding point cloud height changes.

[0081] It should be noted that the above judgment criteria were calibrated separately for the bag face area, sealing area, folded area, transparent window area and bag edge area before production. When the batch of film material, light source angle, exposure time of polarization imaging device, conveying speed or installation position of inspection station changes, appearance qualified samples are collected again and the judgment criteria for the corresponding structural areas are updated.

[0082] For point cloud missing regions that are not identified as structural defect regions, when the position of the fringe center line shifts relative to the position of the adjacent complete fringe center line, and the boundary of the point cloud missing region remains continuous with the adjacent point cloud, the corresponding point cloud missing region is identified as a refraction interference region. Specifically: The refraction determination condition is set by the preset upper limit of the structured light fringe offset and the preset lower limit of the continuous ratio of the point cloud boundary; when the structured light fringe offset of the missing area of ​​the point cloud exceeds the preset upper limit of the structured light fringe offset of the same type of structure area, and the continuous ratio of the point cloud boundary is not lower than the preset lower limit of the continuous ratio of the point cloud boundary of the same type of structure area, the refraction determination result meets the refraction determination condition.

[0083] In the scenario set in Example 1: when the structured light stripes in the image are bent or shifted due to the transparent window area or the overlapping area of ​​the transparent film, if the shift of the structured light stripes exceeds the preset upper limit of the shift of the structured light stripes in the same type of structured area, and the continuous ratio of the point cloud boundary is not lower than the preset lower limit of the continuous ratio of the point cloud boundary in the same type of structured area, then the missing area of ​​the point cloud is judged as a point cloud missing caused by refraction.

[0084] It should be noted that when the missing point cloud region is adjacent to the edge of a transparent window, the cause of the missing point cloud is not directly determined based on this location. Instead, it is first determined whether a continuous height anomaly has formed in the missing point cloud region. When the height difference between the point cloud boundaries at multiple adjacent boundary locations exceeds the preset fluctuation range of similar structural regions, it is treated as a point cloud missing caused by structural damage. When no continuous height anomaly has formed, and the center line of the stripes corresponding to the missing point cloud region can be continuously extracted and bends or shifts relative to the center line of the adjacent complete stripes, and the continuous ratio of the point cloud boundary is not lower than the preset lower limit of the continuous ratio of the point cloud boundary of similar structural regions, it is treated as a point cloud missing caused by refraction. If the edge of the point cloud is discontinuous and the position of the center line of the stripe for comparison cannot be obtained, or if a valid point cloud sufficient to determine the continuous ratio of the point cloud boundary and the height difference of the point cloud boundary cannot be obtained around the missing point cloud area, the refraction interference elimination is not performed on the missing point cloud area. While keeping the corresponding flexible packaging detection position unchanged, the three-dimensional point cloud data, structured light stripe image and polarization image of the position are re-acquired according to the acquisition conditions of the three-dimensional vision acquisition device, the acquisition conditions of the polarization imaging device and the positional correspondence between the data used when the position was first acquired. The cause of the missing point cloud is re-determined according to the above judgment conditions. If the cause of the missing point cloud still cannot be determined after re-acquisition, the missing point cloud area is recorded as an area to be manually reviewed.

[0085] Specifically: For point cloud missing areas that have been identified as refraction interference areas, record their structured light fringe offset, point cloud boundary continuity ratio, and the structured region to which they belong; perform refraction interference removal on the refraction interference areas; and generate refraction interference removal results.

[0086] During data processing: the location of the refractive interference area, the offset of the structured light stripe, the continuity ratio of the point cloud boundary, and the structured region to which it belongs are written into the refractive interference elimination result, and the refractive interference elimination result is used to generate the three-dimensional detection result of flexible packaging.

[0087] In the scenario set in Example 1: if a structured light stripe shift occurs inside the transparent window, and the boundary of the missing point cloud region remains continuous with the adjacent point cloud, then the missing point cloud region is identified as a refraction interference region; if a continuous height anomaly is formed at the edge of the transparent window, then the corresponding missing point cloud region is identified as a structural defect region, and refraction interference elimination is not performed.

[0088] The present invention provides a three-dimensional visual inspection method for flexible packaging, which further includes: Acquire a polarization image corresponding to the same detection position as the 3D point cloud data. Within the polarization image region corresponding to the missing area of ​​the point cloud, connect adjacent pixels whose grayscale values ​​reach the highest grayscale value in the output grayscale range of the polarization imaging device to obtain the pixel region, and calculate the area of ​​the connected pixel region. When the ratio of the pixel area to the corresponding polarization image area exceeds the preset upper limit of the polarization saturation area ratio determined by the qualified sample of the same structure area, and the change in point cloud height at the boundary of the missing point cloud area does not exceed the preset fluctuation range, the corresponding range of the pixel area and the missing point cloud area in the polarization image will be merged into the reflective interference area. The reflective interference area is subjected to reflective interference elimination, a reflective interference elimination result is generated, and the reflective interference elimination result is incorporated into the three-dimensional detection result of flexible packaging.

[0089] Specifically: Read the pixel grayscale in the polarization image region corresponding to the missing point cloud region, connect the pixels whose grayscale reaches the highest grayscale value in the output grayscale range of the polarization imaging device and are adjacent in the horizontal, vertical or diagonal direction to form a continuous saturated pixel region, and use the continuous saturated pixel region as the pixel region to calculate its area.

[0090] During data processing: when the ratio of the pixel area to the corresponding polarized image area exceeds the preset upper limit of the polarization saturation area ratio, and the change in point cloud height at the boundary of the missing point cloud area does not exceed the preset fluctuation range, the corresponding ranges of the pixel area and the missing point cloud area in the polarized image are merged into a reflective interference area; the position and polarization saturation area ratio of the reflective interference area are recorded, a reflective interference elimination result is generated, and the reflective interference elimination result is incorporated into the three-dimensional detection result of flexible packaging.

[0091] In the scenario set in Example 1: if strong local reflection occurs on the surface of the aluminum-plated bag, a continuous saturated pixel area is formed in the polarization image, and a local missing area appears in the three-dimensional point cloud data, but the change in point cloud height at the boundary of the missing area does not exceed the preset fluctuation range, then the area corresponding to that location is determined as the reflective interference area and a reflective interference elimination result is generated.

[0092] The specific handling of the occlusion verification area is carried out based on the determination of the shortest distance and the lower limit of occlusion calibration in Example 2.

[0093] Specifically: the occlusion determination criteria are set by the adjacent location of the missing point cloud region and the lower limit of the occlusion calibration; when the adjacent location of the missing point cloud region is the edge of a bag, a folded edge, or a wrinkled edge, and the continuous proportion of the point cloud boundary is not lower than the lower limit of the occlusion calibration, the occlusion determination result meets the occlusion determination criteria.

[0094] In the scenario set in Example 1: When the bag edge, fold edge, and wrinkle edge of the flexible packaging block the structured light or laser line, a local point cloud cannot be formed; if the adjacent position of the missing point cloud area is the bag edge, fold edge, or wrinkle edge, and the continuous ratio of the point cloud boundary is not lower than the lower limit of the occlusion calibration, then the missing point cloud area is judged as a point cloud missing caused by occlusion.

[0095] Specifically: for point cloud missing regions that meet the occlusion verification conditions, read the adjacent positions of the point cloud missing regions; when the adjacent positions are bag edges, folded edges, or wrinkled edges, record the point cloud missing regions and the corresponding bag edges, folded edges, or wrinkled edges as occlusion verification regions.

[0096] During data processing: record the location of the occlusion verification area, the location corresponding to the shortest distance, and the continuous ratio of the point cloud boundary, and generate occlusion verification results for verification personnel or inspection devices to check the occlusion positions of the bag edge back side, folded edge back side, or folds.

[0097] In the scenario set in Example 1, if the area near the missing point cloud region is a folded edge, and the continuous ratio of the point cloud boundary is not lower than the occlusion calibration lower limit, then the region is output as the occlusion verification region.

[0098] It should be noted that when the same missing point cloud region meets two or more judgment conditions at the same time, firstly, it is determined whether the height changes of the point cloud at multiple adjacent boundary positions form a continuous height anomaly; if a continuous height anomaly is formed, the corresponding missing point cloud region is identified as a structural defect region; if no continuous height anomaly is formed and a valid point cloud can be obtained to determine the continuity state between the boundary and adjacent point clouds, then, in combination with the adjacent positions of the missing point cloud region, the offset of the fringe center line position relative to the adjacent complete fringe center line position, the continuity state between the boundary and adjacent point clouds, and the polarization saturation area ratio, occlusion verification, refraction interference elimination, and reflection interference elimination are performed in sequence.

[0099] When the missing point cloud region neither forms a continuous height anomaly nor meets the corresponding conditions for verification of refraction interference, reflection interference, or occlusion, three-dimensional point cloud data, structured light fringe images, and polarization images are re-acquired at that location. If the judgment still cannot be completed after re-acquisition, the missing point cloud region is recorded as a region to be manually verified, and its location and re-acquisition results are saved in the detection log.

[0100] Record the region outline of each missing point cloud region in the 3D point cloud data, the corresponding region in the structured light stripe image, and the corresponding processing results, and save them according to the flexible packaging number, the detection station trigger number, and the missing point cloud region number. Based on the saved regional contours, corresponding regions, and processing results, a 3D inspection result for flexible packaging is generated. The processing result includes at least one of the following: structural defect confirmation result, refractive interference elimination result, reflective interference elimination result, and occlusion verification result.

[0101] Specifically: the location of each missing point cloud region includes its region outline in the 3D point cloud data, the corresponding region in the structured light fringe image, and the corresponding region in the polarization image; the corresponding processing results include at least one of the following: reflection interference elimination result, refraction interference elimination result, occlusion verification result, and structural defect confirmation result.

[0102] During data processing: Records are saved according to the flexible packaging number, inspection station trigger number, point cloud missing area number, area location, point cloud missing reason, and processing result, so that inspection personnel can trace the source of judgment and processing method of each area based on the flexible packaging number and point cloud missing area number.

[0103] Specifically: The 3D inspection results of flexible packaging include the location of each missing point cloud area, the cause of the missing point cloud, the processing result, and the corresponding area markers; the area markers include reflective interference areas, refractive interference areas, occlusion verification areas, and structural defect areas.

[0104] In this embodiment: if there are three missing point cloud areas in a transparent composite film food packaging bag, and the first missing point cloud area is located on the aluminum-coated bag surface and is determined to be a missing point cloud caused by reflection, then the reflection interference elimination result is output; the second missing point cloud area is located inside the transparent window and is determined to be a missing point cloud caused by refraction, then the refraction interference elimination result is output; the third missing point cloud area is located at the sealing edge and is determined to be a missing point cloud caused by structural damage, then the structural defect confirmation result is output.

[0105] It should be noted that the 3D inspection results of flexible packaging are used to distinguish between optical interference, occlusion verification and actual structural defects, so that point cloud defects caused by reflection and refraction are not directly misjudged as damage, defects caused by occlusion of bag edges, folds and wrinkles are verified separately, and actual dents, tears, foreign objects pushing up or seal structural damage can be confirmed and output.

[0106] In this embodiment, structural defect confirmation results, refraction interference elimination results, reflection interference elimination results, and occlusion verification results are generated according to the structural defect area, refraction interference area, reflection interference area, and occlusion verification area, respectively. The area outline, corresponding area, and processing results are saved according to the flexible packaging number, detection station trigger number, and point cloud missing area number, so that each processing step defined in the claims can be implemented and traced item by item in the same flexible packaging three-dimensional inspection process.

[0107] Example 4 This embodiment provides a three-dimensional vision inspection system for flexible packaging. Please refer to [link / reference]. Figure 2 ,include: The basic data acquisition module is set at the inspection station of flexible packaging. It is used to collect the three-dimensional point cloud data and structured light stripe images of flexible packaging, and to map the three-dimensional point cloud data and structured light stripe images to the same inspection position. The point cloud missing region filtering module is used to filter out point cloud missing regions based on the 3D point cloud data and structured light stripe images corresponding to the same detection location. The point cloud missing judgment data acquisition module is used to compare the position of the stripe center line with the position of the adjacent complete stripe center line in the corresponding structured light stripe image area for each point cloud missing area, and determine the continuity state of the boundary and the adjacent point cloud along the boundary of the point cloud missing area, as well as the point cloud height change at each boundary position. The point cloud missing cause determination module is used to identify the corresponding point cloud missing area as a structural defect area when the point cloud height changes at multiple adjacent boundary positions form a continuous height anomaly. It is also used to identify the corresponding point cloud missing area as a refraction interference area when the position of the stripe center line shifts relative to the position of the adjacent complete stripe center line and the boundary of the point cloud missing area remains continuous with the adjacent point cloud. The cause-based detection and processing module is used to confirm defects in structural defect areas, eliminate refractive interference in refractive interference areas, and output the three-dimensional detection results of flexible packaging.

[0108] Specifically: The basic data acquisition module for testing includes a three-dimensional vision acquisition device set at the testing station. The three-dimensional vision acquisition device acquires three-dimensional point cloud data and structured light stripe images through structured light scanning or laser line scanning. The module establishes a positional correspondence relationship with the calibration sheet positioning point, the outer edge of the flexible packaging, the sealing contour and the edge of the transparent window in Example 2, and converts the point cloud position in the three-dimensional point cloud data to the corresponding coordinates in the structured light stripe image.

[0109] Specifically: The point cloud missing area screening module divides the detection areas into the bag surface area, sealing area, folded edge area, transparent window area, and bag edge area. It calculates the ratio of the number of effective point clouds to the area of ​​the detection area, the area of ​​the holes, and the ratio of the length of the stripe center line, and compares them with the preset lower limit of point cloud density, the preset upper limit of point cloud hole area, and the preset lower limit of structured light stripe integrity rate, respectively. When the point cloud missing area screening conditions are met, the corresponding detection area is determined as the point cloud missing area, and adjacent detection areas are merged according to the continuous arrangement of the common boundary where there are no effective point cloud positions.

[0110] Specifically: The point cloud missing data acquisition module extracts the center points of the stripes along the stripe width direction and connects them to form the position of the stripe center line. The center lines of the stripes that can be continuously identified on both sides of the point cloud missing area are extended to the point cloud missing area to form the position of the center line of the adjacent complete stripes. The module also determines the inner and outer directions along the boundary of the point cloud missing area, obtains the point cloud height change at each boundary position according to the difference of the median of the effective point cloud height on both sides or the maximum difference of the continuous effective point cloud height on the outer side, and determines the continuity state between the boundary and the adjacent point cloud according to the ratio of the boundary length that does not exceed the preset fluctuation range to the total boundary length.

[0111] Specifically: The point cloud missing cause determination module judges continuous height anomalies based on the comparison results between the point cloud height changes at each boundary position and the preset fluctuation range; when multiple adjacent boundary positions form continuous height anomalies, the corresponding point cloud missing area is determined as a structural defect area; when no structural defect area is formed, when the position of the stripe center line is offset relative to the position of the adjacent complete stripe center line, and the boundary remains continuous with the adjacent point cloud, the corresponding point cloud missing area is determined as a refraction interference area.

[0112] Specifically: the cause-based detection and processing module generates structural defect confirmation results based on the structural defect area, eliminates refraction interference in the refraction interference area, and generates refraction interference elimination results; when performing the reflection interference and occlusion verification branches, this module receives the polarization image processing results and the shortest distance from the missing point cloud area to the bag edge, fold edge, wrinkle edge, and transparent window edge, respectively, generates reflection interference elimination results and occlusion verification results, and saves the area contour, corresponding area, and processing results according to the flexible packaging number, detection station trigger number, and missing point cloud area number, and outputs the three-dimensional detection results of the flexible packaging.

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

Claims

1. A three-dimensional visual inspection method for flexible packaging, characterized in that, Includes the following steps: The missing point cloud region was obtained by screening the three-dimensional point cloud data and structured light stripe image corresponding to the same detection position of flexible packaging. For each missing point cloud region, within the corresponding structured light stripe image region, the position of the stripe center line is compared with the position of the center line of the adjacent complete stripe, and the continuity state of the boundary and the adjacent point cloud and the point cloud height change at each boundary position are determined along the boundary of the missing point cloud region. When the point cloud height changes at multiple adjacent boundary locations form a continuous height anomaly, the corresponding missing point cloud region is identified as a structural defect region. For point cloud missing regions that are not identified as structural defect regions, when the position of the stripe center line is offset relative to the position of the adjacent complete stripe center line, and the boundary of the point cloud missing region remains continuous with the adjacent point cloud, the corresponding point cloud missing region is identified as a refraction interference region. Based on the structural defect region, a structural defect confirmation result is generated. The refractive interference region is then subjected to refractive interference elimination, generating a refractive interference elimination result. Finally, based on the structural defect confirmation result and the refractive interference elimination result, a three-dimensional inspection result of the flexible packaging is obtained.

2. The three-dimensional visual inspection method for flexible packaging according to claim 1, characterized in that, The three-dimensional point cloud data and the structured light stripe image correspond to the same detection location, including: A calibration piece with positioning points is placed at the inspection station to obtain the coordinate position of the same positioning point in the three-dimensional point cloud data and the structured light stripe image, and a position correspondence is established based on the difference between the coordinate positions. When inspecting flexible packaging, the position of the bag is determined based on the outer edge of the flexible packaging. At least one of the sealing contour and the edge of the transparent window is aligned with the corresponding position in the three-dimensional point cloud data and the structured light stripe image. The point cloud position in the three-dimensional point cloud data is converted to the corresponding coordinate in the structured light stripe image according to the position correspondence.

3. The three-dimensional visual inspection method for flexible packaging according to claim 1, characterized in that, The filtering of missing point cloud regions includes: The flexible packaging surface is divided into multiple structural areas, including the bag face area, sealing area, folded edge area, transparent window area and bag edge area, and multiple detection zones are further divided within each structural area. The ratio of the number of valid point clouds in each detection zone to the area of ​​the detection zone, the area of ​​holes formed by locations with consecutive missing valid point clouds, and the ratio of the actual extracted stripe centerline length to the stripe centerline length that should appear are calculated. When at least one of the following conditions is met: the ratio of the effective point cloud quantity to the detection zone area is lower than the preset lower limit of the point cloud density of the same type of structure region and the hole area is higher than the preset upper limit of the point cloud hole area of ​​the same type of structure region, and the ratio of the actual extracted stripe center line length to the stripe center line length that should appear is lower than the preset lower limit of the structure light stripe integrity rate of the same type of structure region, the corresponding detection zone is determined as the point cloud missing region. When adjacent detection zones have consecutive points cloud locations without valid points cloud on both sides of the common boundary, the adjacent detection zones are merged into the same point cloud missing region.

4. The three-dimensional visual inspection method for flexible packaging according to claim 1, characterized in that, The comparison between the position of the stripe center line and the position of the adjacent complete stripe center line includes: Extract the stripe center point along the stripe width direction, and connect multiple stripe center points to form the stripe center line position; Extend the center lines of the stripes that can be continuously identified on both sides of the missing point cloud region toward the missing point cloud region to obtain the position of the center line of the adjacent complete stripe. The deviation distance of the stripe centerline position relative to the adjacent complete stripe centerline position is measured along the direction perpendicular to the stripe extension. When there are multiple stripe sections in the missing point cloud area, the maximum value of the deviation distance of each stripe section is taken.

5. The three-dimensional visual inspection method for flexible packaging according to claim 1, characterized in that, The determination of the continuous state of the boundary and adjacent point clouds, as well as the height changes of the point clouds at each boundary location, includes: Determine the inner and outer directions of each boundary location along the boundary of the missing point cloud region, and search for valid point clouds in the vicinity of the boundary location; When there are valid point clouds in both the inner and outer directions, the difference between the median heights of the valid point clouds on both sides is taken as the change in point cloud height at the corresponding boundary position. When there is no effective point cloud in the inner direction, the maximum difference in the height of the effective point cloud continuously distributed along the boundary direction in the vicinity of the outer direction is taken as the point cloud height change at the corresponding boundary position. When the change in point cloud height does not exceed the preset fluctuation range of similar structure regions, the boundary length at the corresponding boundary position is included in the boundary length that is continuous with the adjacent point cloud, and the continuous state is determined according to the ratio of the boundary length to the total boundary length of the missing point cloud region.

6. The three-dimensional visual inspection method for flexible packaging according to claim 5, characterized in that: The preset fluctuation range is determined based on the maximum value of the height difference between adjacent point clouds in qualified samples of the same structural region. When the point cloud height change at a single boundary location exceeds the preset fluctuation range, the boundary location is recorded as noise and does not form the structural defect region. When the point cloud height changes at multiple adjacent boundary locations all exceed the preset fluctuation range, a continuous height anomaly is formed, and the missing point cloud regions corresponding to the multiple adjacent boundary locations are identified as the structural defect regions.

7. The three-dimensional visual inspection method for flexible packaging according to claim 6, characterized in that, The method further includes: A polarization image corresponding to the same detection position as the three-dimensional point cloud data is acquired. In the polarization image region corresponding to the missing area of ​​the point cloud, adjacent pixels with grayscale values ​​reaching the highest grayscale value in the output grayscale range of the polarization imaging device are connected to obtain a pixel region, and the area of ​​the connected pixel region is calculated. When the ratio of the area of ​​the pixel region to the area of ​​the corresponding polarized image region exceeds the preset upper limit of the polarization saturation area ratio determined by the appearance qualified sample of the same structure region, and the change in point cloud height at the boundary of the point cloud missing region does not exceed the preset fluctuation range, the corresponding range of the pixel region and the point cloud missing region in the polarized image are merged into a reflective interference region. The reflective interference area is subjected to reflective interference elimination, a reflective interference elimination result is generated, and the reflective interference elimination result is incorporated into the three-dimensional detection result of the flexible packaging.

8. The three-dimensional visual inspection method for flexible packaging according to claim 5, characterized in that, The method further includes: For the point cloud missing regions that are not identified as structural defect regions, the shortest distances from the boundary of the point cloud missing regions to the bag edge, fold edge, wrinkle edge, and transparent window edge of the flexible packaging surface are measured respectively. When the location corresponding to the shortest distance is one of the bag edge, the folded edge, and the crease edge, and the ratio of the boundary length that is continuous with the adjacent point cloud to the total boundary length of the missing point cloud area is not lower than the occlusion calibration lower limit determined by the appearance qualified sample at the bag edge, folded edge, and crease edge, the missing point cloud area and the location corresponding to the shortest distance are recorded together as the occlusion verification area.

9. The three-dimensional visual inspection method for flexible packaging according to claim 8, characterized in that: Record the region outline of each missing point cloud region in the three-dimensional point cloud data, the corresponding region in the structured light stripe image, and the corresponding processing result, and save them according to the flexible packaging number, the detection station trigger number, and the missing point cloud region number; The three-dimensional inspection result of the flexible packaging is generated based on the saved region contour, the corresponding region and the processing result. The processing result includes at least one of the following: structural defect confirmation result, refraction interference elimination result, reflection interference elimination result and occlusion verification result.

10. A flexible packaging three-dimensional visual inspection system, based on the flexible packaging three-dimensional visual inspection method according to any one of claims 1-9, characterized in that, include: The basic data acquisition module is set at the inspection station of flexible packaging. It is used to collect three-dimensional point cloud data and structured light stripe images of flexible packaging, and to map the three-dimensional point cloud data and the structured light stripe images to the same inspection position. The point cloud missing region filtering module is used to filter out point cloud missing regions based on the three-dimensional point cloud data and the structured light stripe image corresponding to the same detection location. The point cloud missing judgment data acquisition module is used to compare the position of the stripe center line with the position of the adjacent complete stripe center line in the corresponding structured light stripe image area for each point cloud missing area, and determine the continuity state of the boundary and the adjacent point cloud and the point cloud height change at each boundary position along the boundary of the point cloud missing area. The point cloud missing cause determination module is used to determine the corresponding point cloud missing area as a structural defect area when the point cloud height change at multiple adjacent boundary positions forms a continuous height anomaly. It is also used to determine the corresponding point cloud missing area as a refraction interference area when the position of the stripe center line of the point cloud missing area is offset relative to the position of the adjacent complete stripe center line, and the boundary of the point cloud missing area remains continuous with the adjacent point cloud. The cause detection and processing module is used to confirm the defects in the structural defect area, eliminate the refractive interference in the refractive interference area, and output the three-dimensional detection results of the flexible packaging.