A correction system and method for online detection of plastic packaging bottles
By using motion disturbance adaptive analysis estimator and deformation boundary equalization corrector on high-speed production lines, background light interference and compensation of bottle body movements are solved in real time, and background light interference and motion disturbance problems in transparent plastic bottle detection are improved, and the accuracy and production efficiency of detection are improved.
Patent Information
- Application Number
- CN202510758785.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-06-09
AI Technical Summary
On high-speed production lines, the online detection of transparent plastic bottles is subject to interference from background light transmission and reflection, resulting in reduced image contrast and unclear bottle boundary structure, which affects the accuracy and reliability of the detection. The existing methods cannot effectively solve the problems of real-time background light compensation and motion disturbance.
The motion disturbance adaptive analysis estimator and deformation boundary equalization corrector are adopted. Through the background light interference suppressor, the shape boundary upper and lower boundary estimator and the deformation boundary equalization corrector, combined with the dynamic optical compensation model and real-time bidirectional edge-keeping filtering technology, the background light interference is corrected in real time and the bottle movement and deformation are compensated to build a unified and continuous bottle support curved surface.
It significantly improves the visual clarity of the boundaries of transparent plastic bottles, reduces the impact of high-speed motion and deformation on the detection results, meets the real-time and stability requirements of the production line, and improves the accuracy and production efficiency of the inspection.
Smart Images

Figure CN120279018B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of plastic production detection, and in particular to a correction system and method for online detection of plastic packaging bottles. Background Art
[0002] Transparent plastic bottles are widely used in the food and cosmetics industries, known for their crystal-clear appearance and lightweight design. However, on high-speed production lines, in-line inspection of these bottles presents significant technical challenges, particularly interference from background light transmission and reflection. Traditional machine vision inspection systems, which rely on imaging with ordinary visible light, are susceptible to background light interference, resulting in reduced image contrast and a fusion of the bottle boundary with the background, blurring or even distorting the boundary structure. This issue is particularly pronounced under high-speed, dynamic conditions, severely impacting the accuracy and reliability of defect detection.
[0003] Existing machine vision inspection methods for surface defects on transparent parts mostly focus on static environments and have not proposed effective real-time dynamic background light compensation technology. Methods for identifying deformed plastic bottles, such as those based on shape features, are mainly applicable to static or low-speed environments. They are not suitable for the actual needs of high-speed bottle movement and dynamic disturbances in high-speed production line environments. They cannot reliably extract the bottle edge, resulting in limited structural integrity of the inspection results.
[0004] In view of this, the present invention provides a correction system and method for online detection of plastic packaging bottles to solve the problems of real-time background light interference and motion disturbance in a high-speed production environment. Summary of the Invention
[0005] The purpose of the present invention is to provide a correction system and method for online detection of plastic packaging bottles, which can effectively suppress background light interference and compensate for bottle movement and normal deformation in real time, so as to solve the problems in the above-mentioned background technology.
[0006] In order to achieve the above object, the present invention provides the following technical solutions:
[0007] In a first aspect, the present invention provides a correction system for online detection of plastic packaging bottles, comprising a motion disturbance adaptive analysis estimator and a deformation boundary equalization corrector, wherein the motion disturbance adaptive analysis estimator comprises a background light interference suppressor and shape boundary upper and lower bound estimators; wherein:
[0008] The background light interference suppressor estimates the background light interference in real time based on the dynamic optical compensation model and generates a background light correction estimate. It performs real-time dynamic correction on the background light of the original input image and outputs a target enhanced image after background light suppression processing.
[0009] The upper and lower bounds of the shape boundary estimator determines the main direction and upper and lower directions of the bottle in the target enhanced image, and uses real-time bidirectional edge-preserving filtering and feature point registration to construct a unified and continuous bottle support surface. The local confidence index can be calculated for each boundary line in the bottle support surface.
[0010] The deformation boundary equalization corrector performs dynamic shape template fitting correction on the bottle support surface to obtain a template correction surface corrected by the shape template fitting correction; the bottle support surface and the template correction surface are dynamically fused through the dynamic correction coefficient to obtain a boundary correction result.
[0011] As a preferred technical solution of the first aspect of the present invention, the logic for acquiring the target enhanced image after background light suppression processing is:
[0012] Step S101: fusing the original input images based on the mutual information maximization method to obtain an initial fused image;
[0013] Step S102: constructing a dynamic optical compensation model of the bottle background light intensity distribution, and dynamically extracting the background light prediction image after motion registration of the initial fused image;
[0014] Step S103: Calculating a dynamic optical compensation weight after jitter rate compensation according to the real-time jitter rate;
[0015] Step S104: performing pixel-level dynamic optical compensation calculation on the background light prediction image after motion registration in step S102 using the dynamic optical compensation weights in step S103 to obtain a background light interference correction estimate;
[0016] Step S105: Using the initial fused image as the input image, subtract the background light interference correction estimation value obtained above pixel by pixel to generate a target enhanced image after background light suppression processing.
[0017] As a preferred technical solution of the first aspect of the present invention, the acquisition logic of the original input image is:
[0018] The light source distribution map in the optical isolation detection cabin is determined in the historical database according to the priority registration principle; the light source matrix, imaging camera and light source control unit for controlling the light source matrix are adaptively arranged based on the light source distribution map; and the original input image of the transparent bottle is collected in real time based on the light source distribution map.
[0019] As a preferred technical solution of the first aspect of the present invention, the arrangement logic of the light source distribution diagram is:
[0020] Several annular light source arrangement belts are arranged along the corresponding latitude direction of the hemispherical cabin. On each annular light source arrangement belt, multiple light source nodes are arranged at equal angles to form a light source network. Visible light LED arrays, near-infrared LED arrays and polarized light modules are arranged on the light source nodes.
[0021] The number of light sources at each latitude decreases as the latitude increases (towards the north and south poles). The golden section points on the sphere are extracted based on an algorithm and used as light source installation points.
[0022] Based on the detection task, the requirements for light sources of different wavelengths are extracted, and the light source matrix can be arranged in layers or regions so that the light source matrix covers the entire hemispherical cabin.
[0023] As a preferred technical solution of the first aspect of the present invention, the construction logic of the dynamic optical compensation model is:
[0024] Extract the original input image of multiple detection frame sequences within a preset time period, and use the bottle morphology to fit the motion disturbance features of each detection frame in real time to perceive the motion disturbance. The motion disturbance features include the translation jitter vector, the bottle rotation angle, and the bottle motion trend;
[0025] Combining the historical background light prediction image and the current motion disturbance features, the background light intensity distribution of the current detection frame is predicted. Based on the background light intensity, the historical background light prediction image of the previous time is aligned with the background light prediction image of the current time to form a background light prediction image.
[0026] As a preferred technical solution of the first aspect of the present invention, the logic for obtaining the bottle support curved surface is:
[0027] Step S201: Identify the bottle area and determine the main direction and up and down direction of the bottle;
[0028] Step S202: In the direction defined in step S201, extract the upper and lower support surfaces using real-time bidirectional edge-preserving filtering, and estimate the bottle motion disturbance intensity based on the motion disturbance characteristics:
[0029] Step S203: performing feature point registration on the upper and lower support surfaces to reconstruct the bottle body region to form a unified and continuous bottle body support surface.
[0030] As a preferred technical solution of the first aspect of the present invention, the logic for obtaining the boundary correction result is:
[0031] Construct multiple shape templates based on prior knowledge of the geometry of plastic packaging bottles, and store each shape template in a parameterized form in a historical database;
[0032] Based on the motion disturbance features of the bottle in the current target enhanced image, the shape template that best matches the motion disturbance features is selected from the historical database, so that the shape template is aligned with the bottle support surface in both spatial position and direction;
[0033] Construct a fitting error function between the template surface and the unified bottle support surface, determine the optimal template parameters through optimization of the fitting error function, and generate a fitting template surface;
[0034] The dynamic correction coefficient is calculated by combining the bottle motion disturbance intensity, local confidence and optimal template fitting error in real time. Based on the dynamic correction coefficient, the fitted template surface and the target enhanced image are weightedly fused to obtain an accurate and stable boundary correction result.
[0035] As a preferred technical solution of the first aspect of the present invention, a dynamic correction coefficient is comprehensively calculated based on the bottle motion disturbance intensity of the target enhanced image, the template fitting error of the fitting template surface, and the local boundary confidence. The formula of the dynamic correction coefficient is:
[0036] ;
[0037] in: The dimensionless data after normalization of the bottle motion disturbance intensity, local confidence index and optimal template fitting error; the weights satisfy .
[0038] As a preferred technical solution of the first aspect of the present invention, the boundary correction result includes a sequence of upper and lower boundary points of the bottle, a boundary surface function, and a closed area boundary contour, wherein: the upper and lower boundary point sequence is represented by a set of three-dimensional spatial coordinate points; the boundary surface function is a parameterized surface expression used to describe the geometric shape of the bottle surface; and the closed area boundary contour represents the closed curve boundary of the overall contour of the bottle.
[0039] In a second aspect, the present invention provides a correction method for online detection of plastic packaging bottles, based on the implementation of the first aspect, comprising the following steps:
[0040] Based on the dynamic optical compensation model, the background light interference is estimated in real time and the background light correction estimation value is generated. The background light of the original input image is dynamically corrected in real time, and the target enhanced image after background light suppression processing is output;
[0041] Determine the main direction and up-down direction of the bottle in the target enhanced image, use real-time bidirectional edge-preserving filtering and feature point registration to construct a unified and continuous bottle support surface, and calculate the local confidence index for each boundary line in the bottle support surface;
[0042] The bottle support curved surface is corrected by dynamic shape template fitting to obtain a template correction curved surface corrected by shape template fitting; the bottle support curved surface and the template correction curved surface are dynamically fused by the dynamic correction coefficient to obtain a boundary correction result.
[0043] In the above technical solution, the technical effects and advantages provided by the present invention are:
[0044] The present invention constructs a dynamic optical compensation model to dynamically correct background light interference in real time, greatly improving the visual clarity of the boundaries of transparent plastic bottles and solving the problem of serious background interference in traditional detection systems. In addition, the motion disturbance and deformation of the bottle body on the high-speed production line are reduced by real-time motion disturbance feature perception and dynamic shape template fitting, reducing the impact of the high-speed movement of the bottle on the detection results, meeting the real-time and stability requirements of the production line; combined with real-time bidirectional edge-preserving filtering and feature point alignment technology, the boundary structure distortion problem caused by the bottle body movement is overcome, forming a continuous and high-confidence bottle body support surface, and the bottle body support surface and the template correction surface are dynamically fused through the dynamic correction coefficient. It is easy to be quickly deployed and integrated in an industrial environment, effectively improving production efficiency and quality control level, and has significant practical application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments described in the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0046] Figure 1 This is a structural diagram of the correction system for online detection of plastic packaging bottles of the present invention.
[0047] Figure 2 This is a schematic diagram of the space frame support structure of the present invention.
[0048] Figure 3 This is a flow chart of the correction method for online detection of plastic packaging bottles of the present invention.
[0049] Description of reference numerals:
[0050] 100. Motion disturbance adaptive analysis estimator; 101. Background light interference suppressor; 102. Shape boundary upper and lower bound estimator; 200. Deformation boundary equalization corrector. DETAILED DESCRIPTION
[0051] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of this disclosure will be more comprehensive and complete, and will fully convey the concepts of the example embodiments to those skilled in the art. The accompanying drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. Identical reference numerals in the figures indicate identical or similar parts, and thus repeated descriptions thereof will be omitted.
[0052] In addition, the described features, structures or characteristics can be combined in any suitable manner in one or more example embodiments. In the following description, many specific details are provided to provide a full understanding of the example embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure can be practiced while omitting one or more of the specific details, or methods, components, steps, etc. In other cases, well-known structures, methods, implementations or operations are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0053] Example 1
[0054] like Figure 1 As shown, the present invention provides a correction system for online detection of plastic packaging bottles, which is integrated on a high-speed production line and includes a motion disturbance adaptive analysis estimator 100 and a deformation boundary equalization corrector 200. The motion disturbance adaptive analysis estimator 100 includes a background light interference suppressor 101 and a shape boundary upper and lower bound estimator 102; wherein:
[0055] The background light interference suppressor 101 constructs a dynamic optical compensation model for the original input image interfered by background transmitted light and reflected light. Based on the dynamic optical compensation model, it corrects the optical interference caused by the background light in real time to obtain a compensated interference background image; the target enhanced image is used for bottle boundary detection;
[0056] It should be noted that in high-speed online inspection environments, plastic bottles are not only subject to interference from background transmitted and reflected light, but also to drift / deformation of the bottle boundary in the camera coordinate system due to the bottle's high-speed motion and vibration. Furthermore, the transmitted and reflected light dynamically changes with the motion posture (angle, offset), making traditional static filtering or optical compensation (such as simple background modeling) unable to dynamically adapt to the optical changes caused by motion, resulting in unstable background light suppression and error accumulation. Therefore, a dynamic optical compensation model is needed that can perceive the disturbance characteristics of the bottle's motion in real time and adjust the optical compensation parameters accordingly to achieve stable background light suppression.
[0057] Specifically, the acquisition logic of the target enhanced image after background light suppression processing is:
[0058] Step S101: fusing the original input images based on the mutual information maximization method to obtain an initial fused image;
[0059] It should be noted that the acquisition logic of the original input image is:
[0060] The light source distribution map in the optical isolation detection cabin is determined in the historical database according to the priority registration principle; the light source matrix, imaging camera and light source control unit for controlling the light source matrix are adaptively arranged based on the light source distribution map; and the original input image of the transparent bottle is collected in real time based on the light source distribution map.
[0061] It should be noted that the priority registration principles include:
[0062] The historical database stores light source distribution maps and detection performance indicators under different detection spectrum combinations corresponding to different plastic bottle information. The detection performance indicators are used to characterize the uniformity of the three-dimensional spatial illumination distribution in the optically isolated detection chamber. In other words, the historical light source distribution maps with the most similar plastic bottle information are first selected from the historical database. These maps are prioritized according to the detection performance indicators corresponding to the historical light source distribution maps. The light source distribution map with the best historical detection performance is determined as the light source distribution map for the current detection process. The light source matrix and imaging camera are arranged based on the light source distribution map. The light source matrix includes a visible light LED array, a near-infrared LED array, and a polarized light module.
[0063] The light source control unit controls the light source matrix in real time and collects the original input image of the transparent bottle in real time. When detecting the recessed area of the bottle, it can form light and shadow or reflected highlights to enhance the detectability of defect features and realize enhanced imaging of the boundaries and recessed areas of the transparent plastic bottle.
[0064] It is further explained that if Figure 2 As shown, the optical isolation detection cabin is a hemispherical cabin, which is fixed on the production line. A bottle inlet and a bottle outlet are respectively provided at both ends of the hemispherical cabin. Light-proof cloth is provided at the bottle inlet and the bottle outlet, so that the hemispherical cabin and the production line are combined to form an optical isolation environment. The bottle enters the detection area from the bottle inlet along the production line, is illuminated and detected by the light source matrix in the optical isolation environment, and the target image captured by the imaging camera is sent to the server, and then the bottle is sent out from the bottle outlet to avoid interference from external stray light.
[0065] The light source matrix is arranged on the hemispherical cabin according to the light source distribution diagram. The internal space surrounds the bottle body. The light source matrix adopts a spherical uniform arrangement method, referring to the golden section point of the sphere or the equal latitude-longitude distribution to achieve maximum all-round lighting; the inner wall is coated with matte black material to reduce stray light interference.
[0066] The arrangement logic of the light source distribution diagram is:
[0067] Several annular light source arrangement belts are arranged along the corresponding latitude direction of the hemispherical cabin. On each annular light source arrangement belt, multiple light source nodes are arranged at equal angles to form a light source network. Visible light LED arrays, near-infrared LED arrays and polarized light modules are arranged on the light source nodes.
[0068] The number of light sources along each latitude decreases with increasing latitude (towards the north and south poles) to ensure consistent overall illumination density. An algorithm extracts the golden section points on the sphere and uses these points as light source installation points. This arrangement naturally approximates an equidistant distribution across the sphere, avoiding the extremes of dense and sparse light at the equator or poles.
[0069] Based on the detection task, the requirements of light sources in different bands are extracted, and the light source matrix can be arranged in layers or regions: so that the light source matrix covers the entire hemispherical cabin, provides uniform visible light background illumination, highlights the longitudinal boundaries and concave shapes of the bottle, and ensures the imaging of the overall shape of the bottle.
[0070] The acquisition logic of the initial fused image:
[0071] The imaging cameras of different channels are used to synchronously collect the multi-channel original input image sequence of the bottle in real time;
[0072] Based on the mutual information theory, mutual information is calculated between the original input images of each channel to determine the information correlation between channels;
[0073] Based on the mutual information maximization objective function, the above weights are solved through the optimization algorithm to maximize the sum of the mutual information between the fused image and each channel image, and the optimal weight coefficient of the fused image is obtained;
[0074] The optimal weight coefficient of the fused image is used to perform weighted fusion on the original images of each channel to obtain the initial fused image, which can fully integrate the bottle boundary feature information of different spectral or polarization channels, enhance the bottle boundary contrast, and significantly reduce the influence of background light interference.
[0075] Step S102: constructing a dynamic optical compensation model of the bottle background light intensity distribution, and dynamically extracting the background light prediction image after motion registration of the initial fused image;
[0076] It should be noted that the function formula of the dynamic optical compensation model is:
[0077]
[0078] in: is the background light intensity, is the pixel space position, is the timestamp corresponding to the detection frame, is a function of the motion disturbance characteristics, represents the translation jitter vector, Indicates the rotation angle of the bottle. Indicates the jitter rate, Indicates the dynamic optical compensation weight after jitter rate compensation, which is calculated by jitter rate. and dynamic optical compensation weight after jitter rate compensation Indicates the movement trend of the bottle; the optical characteristic parameters include light source angle, light intensity distribution and material transmittance, and characterize the coupling between the current space-time-motion disturbance of the bottle based on the function.
[0079] Specifically, under different motion postures, the background transmitted / reflected light will appear as a dynamically changing background light distribution in the original input image, and a function is constructed to characterize the background light intensity with pixel spatial position, time, motion disturbance characteristics and optical characteristic parameters as influencing parameters. In practical applications, due to the background light being transmitted / reflected to different pixel spatial positions, the background light intensity is dynamically changing. However, the bottle movement trend will cause the background light distribution to be "blurred" or "intensity fluctuation", so in different detection frames The background light intensity changes dynamically, and the previous detection frame is converted to the The historical background light prediction image is "aligned" to the current detection frame Background light prediction image.
[0080] Specifically, the construction logic of the dynamic optical compensation model is:
[0081] Extract the original input image of multiple detection frame sequences within a preset time period, and use the bottle morphology to fit the motion disturbance features of each detection frame in real time to perceive the motion disturbance. The motion disturbance features include the translation jitter vector, the bottle rotation angle, and the bottle motion trend;
[0082] Specifically, the time information of continuous detection frames within a preset time period is used to estimate the motion disturbance characteristics of the bottle in real time on the original input image, and the dynamic model (such as Kalman filtering) of the bottle morphology fitting is smoothly estimated to avoid the noise influence of instantaneous jitter, thereby providing a more stable and robust motion disturbance feature input for subsequent dynamic optical compensation.
[0083] Combining the historical background light prediction image and the current motion disturbance features, the background light intensity distribution of the current detection frame is predicted. Based on the background light intensity, the historical background light prediction image of the previous time is aligned with the background light prediction image of the current time to form a background light prediction image.
[0084] Step S103: Calculate the dynamic optical compensation weight after jitter rate compensation according to the real-time jitter rate, and the calculation formula is:
[0085] ;
[0086] in: represents the dynamic optical compensation weight, Indicates the jitter rate, Indicates that the bottle is in the detection frame The modulus of the motion velocity vector at the moment represents the magnitude of the jitter intensity. is the adjustment coefficient, and the dynamic optical compensation weight reflects the strength of the motion disturbance. The stronger the motion, the more significant the background light compensation, and vice versa.
[0087] Step S104: performing pixel-level dynamic optical compensation calculation on the background light prediction image after motion registration in step S102 using the dynamic optical compensation weights in step S103 to obtain a background light interference correction estimate;
[0088] The formula for the background light interference correction estimate is:
[0089] ;
[0090] Step S105: Using the initial fused image as the input image, subtract the background light interference correction estimation value obtained above pixel by pixel to generate a target enhanced image after background light suppression processing.
[0091] The calculation formula of the target enhanced image after background light suppression is:
[0092] ;
[0093] In this embodiment, a dynamic optical compensation model couples the dynamic distribution of background light interference with motion parameters to model the real-time motion disturbance characteristics of the bottle during high-speed inspection (including translation, rotation, and acceleration). Through real-time motion estimation and background light prediction, pixel-level dynamic optical compensation is performed, forming a motion-optical coupled adaptive background light suppression mechanism. This model effectively addresses the issues of blurred boundaries and false detection of transparent bottles under the influence of transmitted / reflected light background interference, without reducing inspection speed, ensuring the integrity of the boundary structure and the consistency of inspection results. Compared to traditional static compensation, which can only handle stable backgrounds, this model tracks bottle disturbances in real time and dynamically matches the background light distribution, improving the accuracy of background light suppression under dynamic disturbances. It further suppresses the impact of dynamic background light changes on boundary grayscale, preventing boundaries from being misdetected as defects or being submerged, and ensuring the usability of upper and lower bound filtering. Through fast motion estimation and dynamic background compensation, pixel-level interference caused by background transmitted and reflected light is reduced, resulting in an enhanced image of the target with effectively suppressed background light interference.
[0094] The shape boundary upper and lower bound estimator 102 determines the main direction and upper and lower directions of the bottle in the target enhanced image, and uses real-time bidirectional edge-preserving filtering and feature point registration to construct a unified and continuous bottle support surface. The local confidence index can be calculated for each boundary line in the bottle support surface.
[0095] Specifically, the logic for obtaining the bottle support surface is:
[0096] Step S201: Identify the bottle area and determine the main direction and up and down direction of the bottle;
[0097] Specifically, the bottle area is identified from the target enhanced image after background light suppression, and the bottle contour detection method is used to determine the main direction of the bottle in the image. The physical up and down directions of the bottle are defined along the main direction vector, with the up direction corresponding to the bottle mouth and the down direction corresponding to the bottle bottom, clarifying the scanning direction during the upper and lower bounds estimation process.
[0098] Step S202: In the direction defined in step S201, extract the upper and lower support surfaces using real-time bidirectional edge-preserving filtering, and estimate the bottle motion disturbance intensity based on the motion disturbance characteristics:
[0099] Specifically, local maximum scanning and edge-preserving filtering are performed row by row along the upward direction to extract the upper boundary support surface of the bottle boundary in the target enhanced image in real time; local minimum scanning and edge-preserving filtering are performed row by row along the downward direction to extract the lower boundary support surface of the bottle boundary in real time;
[0100] It is further explained that in the edge-preserving filtering process, an adaptive window adjustment method is used to dynamically adjust the filtering window size based on the local gradient characteristics of the bottle body, ensuring that the local structural information of the bottle boundary will not be over-smoothed or lose details due to filtering.
[0101] Step S203: performing feature point registration on the upper and lower support surfaces to reconstruct the bottle body area to form a unified and continuous bottle body support surface;
[0102] Specifically, from the upper boundary support surface and the lower boundary support surface extracted in step S202, a sequence of equally spaced boundary feature points distributed along the main direction is extracted for each of the upper boundary support surface and the lower boundary support surface;
[0103] Based on the position alignment and local boundary consistency features, the boundary points in the upper boundary support surface and the lower boundary support surface are registered one by one to construct paired boundary point pairs;
[0104] The closed bottle boundary area contour is constructed by connecting paired boundary point pairs, and a unified bottle support surface is generated within the bottle boundary area using spline interpolation or fitting. A local confidence index can be calculated for each boundary line in the bottle support surface. The bottle support surface has upper and lower boundary structure information, global continuity and boundary consistency, providing stable support for subsequent template fitting and correction.
[0105] More specifically, the bottle support surface is modeled or deformed using three-dimensional modeling to obtain the local thickness of the bottle as the vertical span between each column of points. The normal direction of the bottle is used for subsequent shape template alignment. Confidence assessment is used to assist in determining the reliability of the estimate.
[0106] The deformation boundary equalization corrector 200 performs dynamic shape template fitting correction on the bottle support surface to obtain a template correction surface after shape template fitting correction; and dynamically fuses the bottle support surface and the template correction surface through the dynamic correction coefficient to obtain a boundary correction result.
[0107] Specifically, the logic for obtaining the boundary correction result is:
[0108] Construct multiple shape templates based on prior knowledge of the geometry of plastic packaging bottles, and store each shape template in a parameterized form in a historical database;
[0109] Enhance the motion disturbance features of the bottle in the current target image, search the historical database, and determine the shape template that best matches the current detection target disturbance. Adjust the shape template to be consistent with the spatial position and direction of the bottle support surface, and achieve preliminary alignment between the template surface and the bottle support surface.
[0110] Construct a fitting error function between the template surface and the unified bottle support surface, determine the optimal template parameters through optimization of the fitting error function, and generate a fitting template surface;
[0111] Specifically, the fitting error function is defined as:
[0112]
[0113] in: Indicates that the parameter is The shape template at point The predicted distance from the predicted position to the reference point; Indicates that the bottle support surface is at point The actual distance from the actual position to the reference point; Indicates that the parameter is The fitting error function corresponding to the shape template is minimized using an optimization algorithm (such as the least squares method or the gradient descent method) to obtain the optimal parameters of the shape template. The shape templates corresponding to the optimal parameters are combined to form an optimized template surface, which is called the fitting template surface.
[0114] The dynamic correction coefficient is calculated by combining the bottle motion disturbance intensity, local confidence and optimal template fitting error in real time. Based on the dynamic correction coefficient, the fitted template surface and the target enhanced image are weightedly fused to obtain an accurate and stable boundary correction result.
[0115] Specifically, the dynamic correction coefficient is based on a real-time dynamic combination of the bottle motion disturbance intensity (image stability), the local confidence index (boundary quality reliability), and the optimal template fitting error (the minimum error after template parameter optimization convergence). The optimal template fitting error is the minimum error between the template surface and the actual bottle surface, and is determined by error function optimization. The formula for the dynamic correction coefficient is:
[0116] ;
[0117] in: The dimensionless data after normalization of the bottle motion disturbance intensity, local confidence index and optimal template fitting error; the weights satisfy , that is: the smaller the disturbance intensity, the higher the local confidence, and the smaller the fitting error, the smaller the dynamic correction coefficient The higher it tends to be, the higher the credibility of the shape template is;
[0118] The fusion formula of the boundary correction result is:
[0119]
[0120] The boundary correction result includes the upper and lower boundary point sequences of the bottle, the boundary surface function, and the closed area boundary contour. Specifically, the upper and lower boundary point sequences are represented by a set of three-dimensional spatial coordinate points; the boundary surface function is a parameterized surface expression used to describe the geometric shape of the bottle surface; and the closed area boundary contour represents the closed curve boundary of the overall contour of the bottle.
[0121] Example 2
[0122] like Figure 3 As shown, the parts not described in detail in this embodiment are as shown in Example 1. This embodiment provides a correction method for online detection of plastic packaging bottles, including the following steps:
[0123] Based on the dynamic optical compensation model, the background light interference is estimated in real time and the background light correction estimation value is generated. The background light of the original input image is dynamically corrected in real time, and the target enhanced image after background light suppression processing is output;
[0124] Determine the main direction and up-down direction of the bottle in the target enhanced image, use real-time bidirectional edge-preserving filtering and feature point registration to construct a unified and continuous bottle support surface, and calculate the local confidence index for each boundary line in the bottle support surface;
[0125] The bottle support curved surface is corrected by dynamic shape template fitting to obtain a template correction curved surface corrected by shape template fitting; the bottle support curved surface and the template correction curved surface are dynamically fused by the dynamic correction coefficient to obtain a boundary correction result.
[0126] The acquisition logic of the target enhanced image after background light suppression processing is:
[0127] Step S101: fusing the original input images based on the mutual information maximization method to obtain an initial fused image;
[0128] Step S102: constructing a dynamic optical compensation model of the bottle background light intensity distribution, and dynamically extracting the background light prediction image after motion registration of the initial fused image;
[0129] Step S103: Calculating a dynamic optical compensation weight after jitter rate compensation according to the real-time jitter rate;
[0130] Step S104: performing pixel-level dynamic optical compensation calculation on the background light prediction image after motion registration in step S102 using the dynamic optical compensation weights in step S103 to obtain a background light interference correction estimate;
[0131] Step S105: Using the initial fused image as the input image, subtract the background light interference correction estimation value obtained above pixel by pixel to generate a target enhanced image after background light suppression processing.
[0132] The acquisition logic of the original input image is:
[0133] The light source distribution map in the optical isolation detection cabin is determined in the historical database according to the priority registration principle; the light source matrix, imaging camera and light source control unit for controlling the light source matrix are adaptively arranged based on the light source distribution map; and the original input image of the transparent bottle is collected in real time based on the light source distribution map.
[0134] The arrangement logic of the light source distribution diagram is:
[0135] Several annular light source arrangement belts are arranged along the corresponding latitude direction of the hemispherical cabin. On each annular light source arrangement belt, multiple light source nodes are arranged at equal angles to form a light source network. Visible light LED arrays, near-infrared LED arrays and polarized light modules are arranged on the light source nodes.
[0136] The number of light sources at each latitude decreases as the latitude increases (towards the north and south poles). The golden section points on the sphere are extracted based on an algorithm and used as light source installation points.
[0137] Based on the detection task, the requirements for light sources of different wavelengths are extracted, and the light source matrix can be arranged in layers or regions so that the light source matrix covers the entire hemispherical cabin.
[0138] The construction logic of the dynamic optical compensation model is:
[0139] Extract the original input image of multiple detection frame sequences within a preset time period, and use the bottle morphology to fit the motion disturbance features of each detection frame in real time to perceive the motion disturbance. The motion disturbance features include the translation jitter vector, the bottle rotation angle, and the bottle motion trend;
[0140] Combining the historical background light prediction image and the current motion disturbance features, the background light intensity distribution of the current detection frame is predicted. Based on the background light intensity, the historical background light prediction image of the previous time is aligned with the background light prediction image of the current time to form a background light prediction image.
[0141] The logic for obtaining the bottle support surface is:
[0142] Step S201: Identify the bottle area and determine the main direction and up and down direction of the bottle;
[0143] Step S202: In the direction defined in step S201, extract the upper and lower support surfaces using real-time bidirectional edge-preserving filtering, and estimate the bottle motion disturbance intensity based on the motion disturbance characteristics:
[0144] Step S203: performing feature point registration on the upper and lower support surfaces to reconstruct the bottle body region to form a unified and continuous bottle body support surface.
[0145] The logic for obtaining the boundary correction result is:
[0146] Construct multiple shape templates based on prior knowledge of the geometry of plastic packaging bottles, and store each shape template in a parameterized form in a historical database;
[0147] Based on the motion disturbance features of the bottle in the current target enhanced image, the shape template that best matches the motion disturbance features is selected from the historical database, so that the shape template is aligned with the bottle support surface in both spatial position and direction;
[0148] Construct a fitting error function between the template surface and the unified bottle support surface, determine the optimal template parameters through optimization of the fitting error function, and generate a fitting template surface;
[0149] The dynamic correction coefficient is calculated by combining the bottle motion disturbance intensity, local confidence and optimal template fitting error in real time. Based on the dynamic correction coefficient, the fitted template surface and the target enhanced image are weightedly fused to obtain an accurate and stable boundary correction result.
[0150] Based on the bottle motion disturbance intensity of the target enhanced image, the template fitting error of the fitting template surface, and the local boundary confidence, the dynamic correction coefficient is comprehensively calculated. The formula of the dynamic correction coefficient is:
[0151] ;
[0152] in: The dimensionless data after normalization of the bottle motion disturbance intensity, local confidence index and optimal template fitting error; the weights satisfy .
[0153] The boundary correction result includes the upper and lower boundary point sequences of the bottle body, the boundary surface function, and the closed area boundary contour, wherein the upper and lower boundary point sequences are represented by a set of three-dimensional spatial coordinate points; the boundary surface function is a parameterized surface expression used to describe the geometric shape of the bottle surface; and the closed area boundary contour represents the closed curve boundary of the entire bottle contour.
[0154] An embodiment of the present invention provides a correction system for online detection of plastic packaging bottles, which is used to execute a correction method for online detection of plastic packaging bottles provided by the above-mentioned embodiments of the present invention. The specific methods and processes for realizing corresponding functions of the various structures included in the correction system for online detection of plastic packaging bottles are detailed in the embodiment of the above-mentioned correction method for online detection of plastic packaging bottles, and will not be repeated here.
[0155] The above description is merely illustrative of certain exemplary embodiments of the present invention. It goes without saying that those skilled in the art will be able to modify the described embodiments in various ways without departing from the spirit and scope of the present invention. Therefore, the above drawings and description are illustrative in nature and should not be construed as limiting the scope of protection of the claims.
Claims
1. A correction system for online detection of plastic packaging bottles, characterized in that: The invention comprises a motion disturbance adaptive analysis estimator (100) and a deformation boundary equalization corrector (200), wherein the motion disturbance adaptive analysis estimator (100) comprises a background light interference suppressor (101) and a shape boundary upper and lower bound estimator (102); wherein: A background light interference suppressor (101) estimates background light interference in real time based on a dynamic optical compensation model and generates a background light correction estimation value, performs real-time dynamic correction on the background light of the original input image, and outputs a target enhanced image after background light suppression processing; The construction logic of the dynamic optical compensation model is: Combine the historical background light prediction image and the current motion disturbance characteristics of the bottle to predict the background light intensity distribution of the current detection frame. Based on the background light intensity, align the historical background light prediction image of the previous time with the background light prediction image of the current time to form a background light prediction image. A shape boundary upper and lower bound estimator (102) determines the main direction and upper and lower directions of the bottle body in the target enhanced image, constructs a unified and continuous bottle body support surface using real-time bidirectional edge-preserving filtering and feature point registration, and calculates a local confidence index for each boundary line in the bottle body support surface; The deformation boundary equalization corrector (200) performs dynamic shape template fitting correction on the bottle support surface, wherein the shape template is retrieved from a historical database by matching the bottle motion disturbance characteristics, and the spatial position and direction are adjusted to match the bottle support surface, thereby obtaining a template correction surface corrected by the shape template fitting correction; the bottle support surface and the template correction surface are dynamically fused through a dynamic correction coefficient to obtain a boundary correction result.
2. A correction system for online detection of plastic packaging bottles according to claim 1, characterized in that: The acquisition logic of the target enhanced image after background light suppression processing is: Step S101: fusing the original input images based on the mutual information maximization method to obtain an initial fused image; Step S102: constructing a dynamic optical compensation model of the bottle background light intensity distribution, and dynamically extracting the background light prediction image after motion registration of the initial fused image; Step S103: Calculating a dynamic optical compensation weight after jitter rate compensation according to the real-time jitter rate; Step S104: performing pixel-level dynamic optical compensation calculation on the background light prediction image after motion registration in step S102 using the dynamic optical compensation weights in step S103 to obtain a background light interference correction estimate; Step S105: Using the initial fused image as the input image, subtract the background light interference correction estimation value obtained above pixel by pixel to generate a target enhanced image after background light suppression processing.
3. A correction system for online detection of plastic packaging bottles according to claim 2, characterized in that: The acquisition logic of the original input image is: Determine the light source distribution map in the optical isolation detection cabin according to the priority registration principle in the historical database; adaptively arrange the light source matrix, imaging camera and light source control unit for controlling the light source matrix based on the light source distribution map; The original input image of the transparent bottle is collected in real time based on the light source distribution map.
4. A correction system for online detection of plastic packaging bottles according to claim 3, characterized in that: The arrangement logic of the light source distribution diagram is: Several annular light source arrangement belts are arranged along the corresponding latitude direction of the hemispherical cabin. On each annular light source arrangement belt, multiple light source nodes are arranged at equal angles to form a light source network. Visible light LED arrays, near-infrared LED arrays and polarized light modules are arranged on the light source nodes. The number of light sources on each latitude decreases as the latitude increases. The golden section point on the sphere is extracted based on the algorithm and used as the light source installation point. Based on the detection task, the requirements for light sources of different wavelengths are extracted, and the light source matrix is arranged in layers or regions so that the light source matrix covers the entire hemispherical cabin.
5. A correction system for online detection of plastic packaging bottles according to claim 4, characterized in that: The construction logic of the dynamic optical compensation model is: Extract the original input image of multiple detection frame sequences within a preset time period, and use the bottle morphology to fit the motion disturbance features of each detection frame in real time to perceive the motion disturbance. The motion disturbance features include the translation jitter vector, the bottle rotation angle, and the bottle motion trend; Combining the historical background light prediction image and the current motion disturbance features, the background light intensity distribution of the current detection frame is predicted. Based on the background light intensity, the historical background light prediction image of the previous time is aligned with the background light prediction image of the current time to form a background light prediction image.
6. A correction system for online detection of plastic packaging bottles according to claim 5, characterized in that: The logic for obtaining the bottle support surface is: Step S201: Identify the bottle area and determine the main direction and up and down direction of the bottle; Step S202: In the direction defined in step S201, extract the upper and lower support surfaces using real-time bidirectional edge-preserving filtering, and estimate the bottle motion disturbance intensity based on the motion disturbance characteristics: Step S203: performing feature point registration on the upper and lower support surfaces to reconstruct the bottle body region to form a unified and continuous bottle body support surface.
7. A correction system for online detection of plastic packaging bottles according to claim 6, characterized in that: The logic for obtaining the boundary correction result is: Construct multiple shape templates based on prior knowledge of the geometry of plastic packaging bottles, and store each shape template in a parameterized form in a historical database; Based on the motion disturbance features of the bottle in the current target enhanced image, the shape template that best matches the motion disturbance features is selected from the historical database, so that the shape template is aligned with the bottle support surface in both spatial position and direction; Construct a fitting error function between the template surface and the unified bottle support surface, determine the optimal template parameters through optimization of the fitting error function, and generate a fitting template surface; The dynamic correction coefficient is calculated by combining the bottle motion disturbance intensity, local confidence and optimal template fitting error in real time. Based on the dynamic correction coefficient, the fitted template surface and the target enhanced image are weightedly fused to obtain an accurate and stable boundary correction result.
8. The correction system for online detection of plastic packaging bottles according to claim 7, characterized in that: Based on the bottle motion disturbance intensity of the target enhanced image, the template fitting error of the fitting template surface, and the local boundary confidence, the dynamic correction coefficient is comprehensively calculated. The formula of the dynamic correction coefficient is: ; in: The dimensionless data after normalization of the bottle motion disturbance intensity, local confidence index and optimal template fitting error; the weights satisfy .
9. The correction system for online detection of plastic packaging bottles according to claim 8, characterized in that: The boundary correction result includes the upper and lower boundary point sequences of the bottle body, the boundary surface function, and the closed area boundary contour, wherein the upper and lower boundary point sequences are represented by a set of three-dimensional spatial coordinate points; the boundary surface function is a parameterized surface expression used to describe the geometric shape of the bottle surface; and the closed area boundary contour represents the closed curve boundary of the entire bottle contour.
10. A correction method for online detection of plastic packaging bottles, implemented based on the correction system for online detection of plastic packaging bottles according to any one of claims 1 to 9, characterized in that: The following steps are involved: Based on the dynamic optical compensation model, the background light interference is estimated in real time and the background light correction estimation value is generated. The background light of the original input image is dynamically corrected in real time, and the target enhanced image after background light suppression processing is output; Determine the main direction and up-down direction of the bottle in the target enhanced image, use real-time bidirectional edge-preserving filtering and feature point registration to construct a unified and continuous bottle support surface, and calculate the local confidence index for each boundary line in the bottle support surface; The bottle support curved surface is corrected by dynamic shape template fitting to obtain a template correction curved surface corrected by shape template fitting; the bottle support curved surface and the template correction curved surface are dynamically fused by the dynamic correction coefficient to obtain a boundary correction result.
Citation Information
Patent Citations
Visual detection method and system for bottleneck carbonization of glass bottle ampoule
CN108665438A
Plastic bottle defect detection method and system based on artificial intelligence and image processing
CN114612441A