A method for visually enhancing the identification of microbubbles within a silicone gel
By using polarized structured light and a multi-feature fusion method, the problem of identifying microbubbles inside silica gel under high transparency and stress backgrounds was solved, achieving high-precision bubble edge enhancement and identification, and overcoming the problems of missed detection and misjudgment of conventional methods.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG LEXUS NEW ENERGY TECH CO LTD
- Filing Date
- 2026-06-09
- Publication Date
- 2026-07-31
AI Technical Summary
Existing technologies struggle to effectively identify tiny air bubbles inside silica gels. In particular, under conditions of high transparency and birefringence interference caused by macroscopic residual stress, conventional imaging methods struggle to capture the contrast at the bubble edges. Furthermore, refractive distortion and high-frequency noise caused by surface micro-undulations severely affect the detection results.
A method combining polarized structured light and multi-feature fusion is employed. By projecting circularly polarized structured light and rotating a linear polarizer, phase-shifted image sequences are acquired. The encapsulation phase is calculated, the differential energy map is calculated, and the maximum spanning tree is constructed to obtain the relative anomalous phase. Bubble recognition is then performed by combining linear polarization modulation contrast estimation and dynamic threshold.
It effectively suppresses macroscopic stress interference and background noise, significantly reduces the false detection rate, retains the weak feature response of microbubbles, achieves high-precision adaptive extraction, and improves the recognition accuracy of microbubbles in complex transparent media.
Smart Images

Figure CN122492677A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of visual nondestructive testing technology, specifically to a method for visually enhanced identification of microbubbles inside silica gel. Background Technology
[0002] Silicone gel is widely used in precision optical devices and high-end electronic packaging due to its excellent high light transmittance and chemical stability. However, in actual production and potting processes, microbubbles are easily generated inside the silicone gel, which seriously affects the insulation performance and optical yield of the product. Therefore, accurate identification of internal microbubbles is crucial.
[0003] Currently, common visual inspection technologies mostly employ conventional bright and dark field illumination imaging or basic structured light phase measurement methods. However, in the preset inspection scenarios for highly transparent silica gels, existing technologies face many complex problems that are difficult to overcome. First, the extremely high transparency of silica gel results in very low visual contrast at the edges of the internal microbubbles, making it difficult for conventional imaging to effectively capture their boundaries. Second, the silica gel inevitably generates macroscopic residual stress during the curing process, and the non-uniform birefringence caused by this stress will severely alias and interfere with the true phase information of the bubbles. In addition, the gel surface generally has micro-undulations, and this type of surface refractive distortion will lead to severe distortion in the estimation of local optical path gradients. At the same time, when extracting phase feature gradients, the inherent high-frequency noise of the sensor is easily amplified by the differential operator, thus producing virtual surface fluctuation artifacts. Finally, if conventional filtering suppression methods are directly used, the dynamic range of the optical features of the bubbles themselves will be severely reduced, causing their internal response features to be submerged in the background, making it easy for targets to be missed and noise points to be falsely detected in non-uniform backgrounds.
[0004] Therefore, there is an urgent need for a method for identifying microbubbles inside silica gel that can effectively overcome stress interference, adaptively compensate for refractive distortion, and target and enhance the weak features of bubbles. Summary of the Invention
[0005] This invention provides a method for visually enhancing and recognizing microbubbles inside silica gel, which helps to solve the problems mentioned in the background art.
[0006] This invention provides the following technical solution: a method for visually enhancing and recognizing microbubbles inside silica gel, comprising: Circularly polarized structured light is projected onto the object under test, and a phase-shifted image sequence is acquired by rotating a linear polarizer to calculate the encapsulation phase. Calculate the differential energy map, construct the maximum spanning tree to expand the phase and subtract the baseline to obtain the relative anomalous phase; The discrete spatial partial derivative of the relative anomalous phase is obtained, and the magnitude of the gradient of the comprehensive anomalous phase is calculated. The decay scale is determined based on the point spread function radius, and the spatial coherence coefficient is obtained by mapping the gradient magnitude. The total light intensity is calculated based on the image sequence, and the linear polarization modulation contrast estimate is extracted by combining the alternating amplitude. The transient bubble phase is calculated using the mean of the abnormal phase as the baseline and weighted by the contrast estimate. Unpolarized scattering features are extracted and fused with transient phase, anti-coherence coefficient and gate weights to obtain enhanced features; The enhanced features are mirrored and filled, and a dynamic threshold is generated by combining local window statistical parameters. The output mask is then binarized.
[0007] Optionally, the steps of projecting circularly polarized structured light onto the object under test, acquiring a phase-shifted image sequence by rotating a linear polarizer, and calculating the encapsulated phase specifically include: At the output end of the projection light source, a circularly polarized sinusoidal fringe structured light is projected onto the object under test by waveplate modulation, and the collected coordinates are physically calibrated and mapped. Polarization is analyzed using an analyzer, and the transmission axis of the analyzer is rotated synchronously to four equally spaced preset polarization angles to obtain a four-frame polarization image sequence compatible with four-step phase-shift demodulation. Extract the image pixel intensity values corresponding to four different polarization angles, and use the four-quadrant arctangent function to calculate the principal value wrapped phase matrix under structured light modulation.
[0008] Optionally, the steps of calculating the differential energy map, constructing the maximum spanning tree, expanding the phase, subtracting the reference, and obtaining the relative anomalous phase specifically include: In an empty field without a test object, structured light is projected and demodulated to obtain the reference phase matrix of the corresponding planar carrier. Within the local spatial neighborhood centered on the current pixel, the squared values of the horizontal and vertical wrapping differences after phase wrapping correction are calculated respectively. The sum of the two values is used to obtain the local phase difference energy map matrix, where the wrapping difference is obtained by mapping the principal wrapping phase difference of adjacent pixels through the tangent and arctangent functions. The pixel with the smallest value in the local phase difference energy map is used as the seed point for expansion. The graph is traversed along the maximum spanning tree constructed based on the local phase difference energy map. The phase step number is preferentially passed to the pixels with lower difference energy map values to expand the wrapped phase. Subtracting the reference phase matrix from the expanded phase matrix yields the relative abnormal phase matrix.
[0009] Optionally, the step of obtaining the discrete spatial partial derivative of the relative anomalous phase and calculating the magnitude of the comprehensive anomalous phase gradient specifically includes: The center difference discretization method is used to calculate the relative abnormal phase gradient in the structured light carrier modulation direction and the local abnormal phase gradient perpendicular to the carrier modulation direction. The calculation process is to obtain the relative abnormal phase difference between adjacent pixels in the corresponding direction and divide it by twice the pixel equivalent physical size. The local anomalous phase gradients in the two directions are squared and summed, and the sum is squared to obtain the scalarized comprehensive anomalous phase gradient magnitude matrix.
[0010] Optionally, the step of determining the attenuation scale based on the point spread function radius and obtaining the spatial coherence coefficient by mapping the gradient magnitude specifically includes: Obtain the pre-determined physical radius of the point spread function of the imaging system, and determine the attenuation scale parameter from the point spread function radius; The local spatial coherence distribution matrix is obtained by dividing the square of the comprehensive abnormal phase gradient magnitude by twice the square of the attenuation scale parameter and taking the natural exponent from the negative of the ratio.
[0011] Optionally, the step of calculating the total light intensity based on the image sequence and extracting the linear polarization modulation contrast estimate using alternating amplitude specifically includes: The pixel intensity values of the four frames of polarization image sequence are summed and averaged to obtain the estimate of the total light intensity DC component of each pixel; The alternating amplitude feature components of the image are calculated using the pixel intensity difference under mutually orthogonal polarization angles. The ratio of the alternating amplitude characteristic component to the estimated total light intensity DC component is used as the linear polarization modulation contrast estimation matrix.
[0012] Optionally, the step of calculating the transient bubble phase using the mean of the abnormal phase as a baseline and weighted by a contrast estimate specifically includes: Calculate the global mean of the relative abnormal phase, and use the difference between the relative abnormal phase and the global mean as the phase component after baseline subtraction; The difference between the numerical value and the linear polarization modulation contrast estimate is used as the spatial suppression weight; The phase component after baseline subtraction is multiplied by the spatial suppression weight to obtain the transient bubble phase matrix.
[0013] Optionally, the step of extracting the non-polarization scattering features and fusing them with the transient phase, the back coherence coefficient, and the gate weights to obtain the enhanced features specifically includes: Multiply the total light intensity DC component estimate by the spatial suppression weight to construct the non-polarized volume scattering response characteristic estimate; Subtracting the numerical value from the local spatial coherence coefficient yields the inverse coherence coefficient; Calculate the ratio of the total light intensity DC component estimate to its global mean, obtain the natural exponent from the negative of the ratio, and subtract the natural exponent from the value to obtain the gating weight; The absolute value of the transient bubble phase, the estimator of the non-polarized body scattering response characteristics, the inverse coherence coefficient, and the gate weight are multiplied together to obtain the cross-fused entity enhancement feature matrix.
[0014] Optionally, the steps of mirroring the enhanced features, generating a dynamic threshold by combining local window statistical parameters, and binarizing the output mask specifically include: The odd-numbered pixel side length of the adaptive sliding window is determined by rounding down and doubling the ratio of the estimated maximum physical radius of the target to the pixel equivalent physical size. The image boundary of the entity enhancement feature matrix is expanded using a mirror filling method, and the mean and variance of local neighborhood features are calculated within the adaptive sliding window; The square root of the local feature variance is multiplied by a preset sensitivity control constant, and the product is added to the mean of the local neighborhood features to obtain the local adaptive dynamic segmentation threshold matrix. The difference between the entity enhancement feature matrix and the local adaptive dynamic segmentation threshold matrix is compared pixel by pixel using a unit step function. When the difference is greater than or equal to zero, the target mask value is output, and when it is less than zero, the background mask value is output, thus obtaining the microbubble binarized mask matrix.
[0015] The present invention has the following beneficial effects: 1. This solution proposes a visual detection method based on polarized structured light and multi-feature fusion for the specific environment of identifying tiny bubbles inside silica gel. In silica gel, the contrast of bubble edges is extremely low, and the macroscopic residual stress generated by gel solidification causes strong birefringence background interference. At the same time, the high-frequency noise from surface micro-undulations leads to severe refractive distortion, making it easy for conventional algorithms to miss or misjudge. The solution mainly extracts abnormal phase gradients and applies damping attenuation, combines linear polarization modulation contrast estimation to correct the stress background, and finally extracts non-polarized scattering features and uses dynamic thresholds for segmentation. In the special environment of silica gel with complex residual stress and surface micro-undulations, this solution can cleverly utilize the non-polarized body scattering characteristics of the bubble entity for targeted enhancement. It can not only effectively suppress macroscopic stress interference and local background noise, significantly reducing the false detection rate, but also retain the weak feature response of real bubbles with extremely small size and low contrast to the maximum extent. It successfully overcomes the contradiction between noise artifact amplification and weak target loss in traditional algorithms, and achieves high-precision adaptive extraction of weak targets in complex transparent media. 2. By introducing a waveplate at the output end of the projection light source to generate circularly polarized sinusoidal fringe structured light, and simultaneously rotating the transmission axis of the analyzer at the receiving end to a specific equally spaced angle to obtain a phase-shift observation sequence, the modulation of the polarization state is converted into a geometric phase shift change in the light intensity distribution. At the same time, the principal value wrapped phase is extracted using the four-quadrant arctangent function, avoiding the mechanical vibration error and hysteresis effect caused by the stepping process of traditional mechanical phase-shifting devices, thus improving the physical stability of the image acquisition process. When acquiring interferometric images containing target boundary information, the system's sensitivity to detection of complex transparent media is enhanced, providing a high-quality and low-noise basic image source for subsequent high-precision phase unwrapping and feature extraction. 3. By calculating the phase differential energy map matrix after phase entanglement correction within the local spatial neighborhood, and using the pixel with the smallest differential energy map value as the seed point for expansion, graph traversal expansion is performed along the maximum spanning tree constructed based on the local quality map. This step prioritizes the transfer of phase step levels to pixels in high-reliability regions with lower differential energy map values, effectively avoiding the propagation problem of unwrapping errors caused by low-contrast regions or high-frequency noise regions. This quality-guided expansion strategy improves the robustness of phase recovery under complex noise environments, ensures the continuity of abnormal phase distribution and the correctness of spatial topology, and prevents analysis failure caused by local faults. 4. By employing a central difference discretization method, the local anomalous phase gradients of the relative anomalous phase in the original carrier modulation direction and the vertical direction are calculated separately. The square root of the sum of the squares of the gradients in the two orthogonal directions is then used to calculate the magnitude of the comprehensive anomalous phase gradient. Compared with single-sided difference, the central difference method has higher numerical approximation accuracy and can more smoothly quantify the dynamic optical path deflection gradient caused by the micro-undulations of the silicon gel surface. The scalarized magnitude matrix eliminates the anisotropic distribution differences of the anomalous gradient in a specific spatial direction, providing a unified physical metric, which enables subsequent spatial coherence damped modulation to more stably evaluate the high-frequency fluctuations in the local area. 5. By pre-determining the physical radius of the point spread function of the optical system, the damping attenuation scale parameter is calculated accordingly. Furthermore, the exponential attenuation model is used to map the comprehensive anomalous phase gradient magnitude into a local spatial coherence distribution matrix. This process correlates the attenuation scale with the actual physical resolution limit of the optical system, enabling the constructed spatial coherence coefficient to specifically suppress virtual high-frequency noise that exceeds the system's resolution capability. The coherence coefficient maintains a high response in the smooth region and generates damping attenuation in the anomalous high-frequency fluctuation region, thereby effectively filtering out spurious responses caused by sensor noise and surface micro-undulation distortion while preserving the true low-frequency and mid-frequency physical structure. 6. The total light intensity estimate of each spatial pixel is calculated based on the phase-shifted image sequence, and the alternating amplitude feature component is calculated using the pixel intensity difference under orthogonal polarization angles, thereby extracting the linear polarization modulation contrast estimate matrix. This extraction process effectively integrates the light intensity response information under different polarization states, distinguishing the stress background with high polarization preservation degree from the solid region with strong scattering and depolarization in terms of numerical distribution. The constructed contrast estimate can serve as a physical representation of the local polarization preservation state, providing a reliable feature basis for the subsequent separation of macroscopic stress and microbubble entities, and reducing the resolution ambiguity caused by a single light intensity feature in complex transparent media. 7. By using the global mean of the relatively abnormal phase as a benchmark, the phase components after subtracting the macroscopic stress baseline are calculated, and spatial suppression weights are constructed using the linear polarization modulation contrast estimate. The two are multiplied to obtain the corrected transient bubble phase matrix. Using the mean as a baseline can initially remove the overall background trend, while the introduction of spatial suppression weights utilizes the physical characteristic that the macroscopic stress region has a high degree of polarization preservation. This weighting operation can specifically weaken the low-frequency background phase interference caused by the non-uniform birefringence phenomenon, improve the independence of the transient bubble phase in spatial distribution, and reduce the adverse effects of stress residuals on subsequent target feature extraction and threshold segmentation. 8. By constructing a non-polarized body scattering response feature estimate that characterizes the loss of linear polarization modulation properties, and fusing and multiplying it with the absolute value of the transient bubble phase, the inverse spatial coherence coefficient, and the exponential gate weight based on the total light intensity, the solid enhancement feature matrix is obtained. The cross-fusion of multidimensional features enables targeted response amplification of the internal region of the bubble solid, and the inverse coherence coefficient ensures that the enhancement effect is concentrated in the physical anomalous region. The introduced exponential gate weight produces smooth decay in the low energy region, which, while filtering dark field noise, avoids the risk of secondary bias in the bright region caused by a single linear intensity multiplier, and improves the distribution stability of the feature matrix in complex backgrounds. 9. By using mirror filling to expand the image boundary of the entity enhancement feature matrix before calculating the local neighborhood mean and variance, the edge statistical distortion caused by conventional zero-fill or no-fill strategies is eliminated. Mirror filling utilizes the texture and gray-level symmetry of the boundary itself, so that smooth and continuous statistical samples can be obtained in the local window near the image edge. This operation prevents the local mean and variance from undergoing systematic numerical shift in the edge region, ensuring the continuity and reliability of the calculated local dynamic segmentation threshold in the entire image range, and reducing the risk of false mask generation and target edge breakage caused by threshold estimation distortion in the boundary region. 10. By combining the neighborhood mean and local variance within a local window and introducing a sensitivity control constant, an adaptive dynamic segmentation threshold matrix is generated. Subsequently, a pixel-by-pixel binarization operation is performed using a unit step function to output the mask. The dynamic threshold strategy can keenly track the subtle spatial fluctuations of uneven background light intensity and stress characteristics, overcoming the local missed detection problem that is easily generated by a global single threshold when facing complex media. The variance-based offset adjustment enables the threshold surface to adapt to changes in local contrast, effectively suppressing local high-frequency noise in the background while preserving the weak feature response of small targets, thus improving the overall accuracy and spatial morphology fidelity of bubble recognition. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the basic process of the present invention.
[0017] Figure 2 This is a schematic diagram of the optical hardware acquisition system architecture of the present invention.
[0018] Figure 3 This is a flowchart of the multi-feature cross-fusion and target enhancement algorithm of the present invention.
[0019] Figure 4 This is a schematic diagram illustrating the evolution of image data processing effects according to the present invention.
[0020] Figure 5 This is a schematic diagram of the maximum spanning tree unwrapping and pathfinding based on the differential energy graph according to the present invention. Detailed Implementation
[0021] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0022] Example 1, refer to Figure 1 A method for visually enhanced recognition of microbubbles inside silica gel, comprising: Circularly polarized structured light is projected onto the object under test, and a phase-shifted image sequence is acquired by rotating a linear polarizer to calculate the encapsulation phase. Calculate the differential energy map, construct the maximum spanning tree to expand the phase and subtract the baseline to obtain the relative anomalous phase; The discrete spatial partial derivative of the relative anomalous phase is obtained, and the magnitude of the gradient of the comprehensive anomalous phase is calculated. The decay scale is determined based on the point spread function radius, and the spatial coherence coefficient is obtained by mapping the gradient magnitude. The total light intensity is calculated based on the image sequence, and the linear polarization modulation contrast estimate is extracted by combining the alternating amplitude. The transient bubble phase is calculated using the mean of the abnormal phase as the baseline and weighted by the contrast estimate. Unpolarized scattering features are extracted and fused with transient phase, anti-coherence coefficient and gate weights to obtain enhanced features; The enhanced features are mirrored and filled, and a dynamic threshold is generated by combining local window statistical parameters. The output mask is then binarized.
[0023] The steps of projecting circularly polarized structured light onto the object under test, acquiring a phase-shifted image sequence by rotating a linear polarizer, and calculating the encapsulated phase specifically include: At the output end of the projection light source, a circularly polarized sinusoidal fringe structured light is projected onto the object under test by waveplate modulation, and the collected coordinates are physically calibrated and mapped. Polarization is analyzed using an analyzer, and the transmission axis of the analyzer is rotated synchronously to four equally spaced preset polarization angles to obtain a four-frame polarization image sequence compatible with four-step phase-shift demodulation. Extract the image pixel intensity values corresponding to four different polarization angles, and use the four-quadrant arctangent function to calculate the principal value wrapped phase matrix under structured light modulation.
[0024] The steps of calculating the differential energy map, constructing the maximum spanning tree, expanding the phase, subtracting the reference, and obtaining the relative anomalous phase specifically include: In an empty field without a test object, structured light is projected and demodulated to obtain the reference phase matrix of the corresponding planar carrier. Within the local spatial neighborhood centered on the current pixel, the squared values of the horizontal and vertical wrapping differences after phase wrapping correction are calculated respectively. The sum of the two values is used to obtain the local phase difference energy map matrix, where the wrapping difference is obtained by mapping the principal wrapping phase difference of adjacent pixels through the tangent and arctangent functions. The pixel with the smallest value in the local phase difference energy map is used as the seed point for expansion. The graph is traversed along the maximum spanning tree constructed based on the local phase difference energy map. The phase step number is preferentially passed to the pixels with lower difference energy map values to expand the wrapped phase. Subtracting the reference phase matrix from the expanded phase matrix yields the relative abnormal phase matrix.
[0025] The steps of obtaining the discrete spatial partial derivative of the relative anomalous phase and calculating the magnitude of the comprehensive anomalous phase gradient specifically include: The center difference discretization method is used to calculate the relative abnormal phase gradient in the structured light carrier modulation direction and the local abnormal phase gradient perpendicular to the carrier modulation direction. The calculation process is to obtain the relative abnormal phase difference between adjacent pixels in the corresponding direction and divide it by twice the pixel equivalent physical size. The local anomalous phase gradients in the two directions are squared and summed, and the sum is squared to obtain the scalarized comprehensive anomalous phase gradient magnitude matrix.
[0026] The step of determining the attenuation scale based on the point spread function radius and obtaining the spatial coherence coefficient by mapping the gradient magnitude specifically includes: Obtain the pre-determined physical radius of the point spread function of the imaging system, and determine the attenuation scale parameter from the point spread function radius; The local spatial coherence distribution matrix is obtained by dividing the square of the comprehensive abnormal phase gradient magnitude by twice the square of the attenuation scale parameter and taking the natural exponent from the negative of the ratio.
[0027] The step of calculating the total light intensity based on the image sequence and extracting the linear polarization modulation contrast estimate using alternating amplitude specifically includes: The pixel intensity values of the four frames of polarization image sequence are summed and averaged to obtain the estimate of the total light intensity DC component of each pixel; The alternating amplitude feature components of the image are calculated using the pixel intensity difference under mutually orthogonal polarization angles. The ratio of the alternating amplitude characteristic component to the estimated total light intensity DC component is used as the linear polarization modulation contrast estimation matrix.
[0028] The step of calculating the transient bubble phase using the mean of the abnormal phase as a baseline and weighted by the contrast estimate specifically includes: Calculate the global mean of the relative abnormal phase, and use the difference between the relative abnormal phase and the global mean as the phase component after baseline subtraction; The difference between the numerical value and the linear polarization modulation contrast estimate is used as the spatial suppression weight; The phase component after baseline subtraction is multiplied by the spatial suppression weight to obtain the transient bubble phase matrix.
[0029] The step of extracting non-polarized scattering features and fusing them with transient phase, reverse coherence coefficient, and gate weights to obtain enhanced features specifically includes: Multiply the total light intensity DC component estimate by the spatial suppression weight to construct the non-polarized volume scattering response characteristic estimate; Subtracting the numerical value from the local spatial coherence coefficient yields the inverse coherence coefficient; Calculate the ratio of the total light intensity DC component estimate to its global mean, obtain the natural exponent from the negative of the ratio, and subtract the natural exponent from the value to obtain the gating weight; Reference Figure 3The absolute value of the transient bubble phase, the estimator of the non-polarized body scattering response characteristics, the inverse coherence coefficient, and the gate weight are multiplied together to obtain the cross-fused entity enhancement feature matrix.
[0030] The steps of mirroring the enhanced features, generating a dynamic threshold by combining local window statistical parameters, and binarizing the output mask specifically include: The odd-numbered pixel side length of the adaptive sliding window is determined by rounding down and doubling the ratio of the estimated maximum physical radius of the target to the pixel equivalent physical size. The image boundary of the entity enhancement feature matrix is expanded using a mirror filling method, and the mean and variance of local neighborhood features are calculated within the adaptive sliding window; The square root of the local feature variance is multiplied by a preset sensitivity control constant, and the product is added to the mean of the local neighborhood features to obtain the local adaptive dynamic segmentation threshold matrix. The difference between the entity enhancement feature matrix and the local adaptive dynamic segmentation threshold matrix is compared pixel by pixel using a unit step function. When the difference is greater than or equal to zero, the target mask value is output, and when it is less than zero, the background mask value is output, thus obtaining the microbubble binarized mask matrix. This solution proposes a visual detection method based on polarized structured light and multi-feature fusion for the specific environment of identifying tiny bubbles inside silica gel. In silica gel, the contrast of bubble edges is extremely low, and the macroscopic residual stress generated by gel solidification causes strong birefringence background interference. At the same time, high-frequency noise from surface micro-undulations leads to severe refractive distortion, making it easy for conventional algorithms to miss or misjudge. The solution mainly extracts abnormal phase gradients and applies damping attenuation, combines linear polarization modulation contrast estimation to correct the stress background, and finally extracts non-polarized scattering features and uses dynamic thresholds for segmentation. In the special environment of silica gel with complex residual stress and surface micro-undulations, this solution can cleverly utilize the non-polarized body scattering characteristics of the bubble entity for targeted enhancement. It can not only effectively suppress macroscopic stress interference and local background noise, significantly reducing the false detection rate, but also retain the weak feature response of real bubbles with extremely small size and low contrast to the maximum extent. It successfully overcomes the contradiction between noise artifact amplification and weak target loss in traditional algorithms, and achieves high-precision adaptive extraction of weak targets in complex transparent media. Example 2: A method for visually enhanced recognition of microbubbles inside silica gel, further comprising: The steps of projecting circularly polarized structured light onto the object under test, acquiring a phase-shifted image sequence by rotating a linear polarizer, and calculating the encapsulated phase specifically include: Reference Figure 2 A quarter-wave plate is added to the output end of the projector to project a spatial physical frequency onto the silica gel under test. Left-handed circularly polarized sinusoidal fringe structured light, where coordinates The data was mapped to millimeters after camera intrinsic parameter calibration. Polarization is performed using a linear polarizer at the front of the camera, and the transmission axis of the linear polarizer is rotated synchronously to [the specified angle]. , , , This forms an equivalent observation sequence compatible with four-step phase-shift demodulation, by sequentially acquiring four original images, denoted as follows: , , , ; Calculate the principal wrapping phase matrix under structured light modulation: In the formula, Representing coordinates The enclosed phase at the location; Represents the arctangent function in the four quadrants; , , , This represents the pixel intensity values of the image directly acquired at four polarization angles. By introducing a waveplate at the output end of the projection light source to generate circularly polarized sinusoidal fringe structured light, and simultaneously rotating the analyzer's transmission axis to a specific equally spaced angle at the receiving end to obtain a phase-shift observation sequence, the modulation of the polarization state is converted into a geometric phase shift change in the light intensity distribution. Simultaneously, the principal value wrapping phase is extracted using the four-quadrant arctangent function, avoiding the mechanical vibration errors and hysteresis effects caused by traditional mechanical phase-shifting devices during the stepping process, thus improving the physical stability of the image acquisition process. When acquiring interferometric images containing target boundary information, this enhances the system's sensitivity to complex transparent media, providing a high-quality and low-noise basic image source for subsequent high-precision phase unwrapping and feature extraction. The steps of calculating the differential energy map, constructing the maximum spanning tree, expanding the phase, subtracting the reference, and obtaining the relative anomalous phase specifically include: The reference phase matrix of the system's distortion-free planar carrier wave is obtained by pre-projecting and demodulating in an empty field state without the sample to be tested. The acquisition of the reference phase matrix is specifically a calibration decarrier operation, that is, projecting structured light onto an empty field or standard reference plane without a test object and demodulating it to obtain the background reference phase, which is a conventional technical means known to those skilled in the art. In Centered Within the neighborhood, calculations are included. The local phase difference energy map matrix after winding correction: in: In the formula, This represents the target quantity obtained from the calculated phase difference energy map; Indicates the package phase; and This represents the wrap-around difference operator between adjacent pixels. In discrete coordinates, the horizontal wrap-around difference operator is... Vertical Wrap Difference Operator The acquisition process is as follows: calculate the principal value wrapping phase difference between adjacent pixels, and use the arctangent function to force the mapping and wrapping to the desired value. Within the interval, the mathematical formulas are as follows: Reference Figure 5 ,by The smallest pixel is used as the seed point for expansion. A graph traversal expansion is performed along the maximum spanning tree constructed based on the local quality map. Phase step levels are preferentially passed to pixels in high-reliability regions with lower energy map values. The relative anomalous phase matrix is obtained by subtracting the system baseline. In the formula, Indicates the relative abnormal phase after deducting the baseline; This indicates the pre-acquired distortion-free reference phase; This represents the integer step number obtained by graph traversal. The initial state is set to 0 at the expanded seed point, and then along the maximum spanning tree path to the neighboring unexpanded pixels. During traversal, calculate the wrapping phase difference between the currently expanded pixel and its neighboring pixels. If this difference is less than... Then the neighboring pixels Value in the current pixel Add 1 to the value; if the difference is greater than If, then subtract 1; if in Between, The value remains unchanged. The process involves integrating along this path to determine the result, and then obtaining the entire image pixel by pixel. The phase differential energy map matrix, after phase entanglement correction, is calculated within the local spatial neighborhood. The pixel with the smallest differential energy map value is used as the seed point for expansion, and graph traversal expansion is performed along the maximum spanning tree constructed based on the local quality map. This step prioritizes propagating the phase step order to pixels in high-reliability regions with lower differential energy map values, effectively avoiding the propagation problem of unwrapping errors caused by low-contrast regions or high-frequency noise regions. This quality-guided expansion strategy improves the robustness of phase recovery under complex noise environments, ensures the continuity of anomalous phase distribution and the correctness of spatial topology, and prevents analysis failure caused by local faults. The steps of obtaining the discrete spatial partial derivative of the relative anomalous phase and calculating the magnitude of the comprehensive anomalous phase gradient specifically include: The center difference discretization method is used to calculate the local anomalous phase gradients of the relative anomalous phase in the original carrier modulation direction and the vertical direction: In the formula, and These represent the calculated anomalous phase gradients in the horizontal and vertical directions, respectively, with dimensions of... ; Indicates a relative anomalous phase; The equivalent physical size parameter of a pixel, in millimeters; Calculate the scalarized composite anomaly phase gradient magnitude matrix: In the formula, This represents the calculated magnitude of the integrated anomaly phase gradient. and This represents the anomalous phase gradients in the two directions calculated above. By employing a central difference discretization method, the local anomalous phase gradients in the original carrier modulation direction and the perpendicular direction are calculated separately, and the square root of the sum of the squares of the gradients in the two orthogonal directions is used to calculate the magnitude of the comprehensive anomalous phase gradient. Compared with single-sided difference, the central difference method has higher numerical approximation accuracy and can more smoothly quantify the dynamic optical path deflection gradient caused by the micro-undulations of the silicon gel surface. The scalarized magnitude matrix eliminates the anisotropic distribution differences of the anomalous gradient in a specific spatial direction, providing a unified physical metric, which enables subsequent spatial coherence damped modulation to more stably evaluate the high-frequency fluctuations in the local area. The step of determining the attenuation scale based on the point spread function radius and obtaining the spatial coherence coefficient by mapping the gradient magnitude specifically includes: Pre-determine the physical radius of the point spread function of the optical system. The calculation of damping attenuation scale parameters that strictly maintain dimensionless closure: The physical radius of the point spread function of the optical system can be measured by the edge method, the point hole method or the standard resolution plate test, which is a basic a priori calibration method in the field of optical engineering. In the formula, This represents the calculated damping attenuation scale parameter, in units of... ; This represents the physical radius of the acquired point spread function of the optical system. Calculate the local spatial coherence distribution matrix: In the formula, This represents the calculated local spatial coherence coefficient; Indicates the magnitude of the combined anomaly phase gradient; This represents the attenuation scale parameter after dimension unification. The damping attenuation scale parameter is calculated by pre-measuring the physical radius of the optical system's point spread function, and further using an exponential attenuation model to map the magnitude of the integrated anomalous phase gradient into a local spatial coherence distribution matrix. This process correlates the attenuation scale with the actual physical resolution limit of the optical system, enabling the constructed spatial coherence coefficient to specifically suppress virtual high-frequency noise exceeding the system's resolution capability. The coherence coefficient maintains a high response in smooth regions and generates damping attenuation in anomalous high-frequency fluctuation regions, thus effectively filtering out spurious responses caused by sensor noise and surface micro-undulation distortion while preserving the true low-frequency and mid-frequency physical structure. The step of calculating the total light intensity based on the image sequence and extracting the linear polarization modulation contrast estimate using alternating amplitude specifically includes: Calculate the total light intensity estimate for each spatial pixel: In the formula, This represents the calculated estimate of the DC component of the total light intensity; to Indicates the intensity value of a phase-shifted image sequence; Calculate the linear polarization modulation contrast estimator matrix: In the formula, The numerator represents the calculated linear polarization modulation contrast estimate; the molecule represents the alternating amplitude characteristic component. This represents the total light intensity estimate. The total light intensity estimate for each spatial pixel is calculated based on a phase-shifted image sequence, and the alternating amplitude feature components are calculated using the pixel intensity difference under orthogonal polarization angles. This process then extracts the linear polarization modulation contrast estimate matrix. This extraction process effectively integrates light intensity response information under different polarization states, distinguishing between stress backgrounds with high polarization preservation and solid regions with strong scattering and depolarization in terms of numerical distribution. The constructed contrast estimate can serve as a physical representation of the local polarization preservation state, providing a reliable feature basis for subsequent separation of macroscopic stress and microbubble entities, and reducing the resolution ambiguity caused by a single light intensity feature in complex transparent media. The step of calculating the transient bubble phase using the mean of the abnormal phase as a baseline and weighted by the contrast estimate specifically includes: Calculate the transient bubble phase matrix after correcting for the macroscopic stress background: In the formula, This represents the calculated transient bubble phase; This indicates the extracted relative anomalous phase; A global mean benchmark representing the relative abnormal phase; This represents the extracted linear polarization modulation contrast estimate; As a spatial suppression weight, the phase component after subtracting the macroscopic stress baseline is calculated based on the global mean of the relatively abnormal phase, and the spatial suppression weight is constructed using the linear polarization modulation contrast estimate. The two are multiplied to obtain the corrected transient bubble phase matrix. Using the mean as the baseline can initially remove the overall background trend, while the introduction of the spatial suppression weight takes advantage of the physical characteristic that the macroscopic stress region has a high degree of polarization preservation. This weighting operation can specifically weaken the low-frequency background phase interference caused by the non-uniform birefringence phenomenon, improve the independence of the transient bubble phase in spatial distribution, and reduce the adverse effects of stress residuals on subsequent target feature extraction and threshold segmentation. The step of extracting non-polarized scattering features and fusing them with transient phase, reverse coherence coefficient, and gate weights to obtain enhanced features specifically includes: Constructing a feature estimate of the non-polarized volume scattering response: In the formula, This represents an estimate of the scattering characteristics that indicate the loss of linear polarization modulation. This represents the estimate of the total light intensity; This represents the linear polarization modulation contrast estimate; Reference Figure 3The flowchart of the multi-feature cross-fusion and target enhancement algorithm shown integrates transient phase, scattering feature estimates, and back coherence coefficients, and introduces exponential gating weights based on total light intensity to calculate the cross-fused entity enhancement feature matrix: in: In the formula, This represents the calculated entity enhancement feature matrix; This represents the absolute value of the transient bubble phase; This represents the characteristic estimate of the scattering response of a non-polarized body; Represents the local spatial coherence coefficient; This represents the estimate of the total light intensity; express The global mean is obtained. By constructing a non-polarized body scattering response feature estimate that characterizes the loss of linear polarization modulation properties, it is fused and multiplied with the absolute value of the transient bubble phase, the inverse spatial coherence coefficient, and the exponential gate weight based on the total light intensity to obtain the entity enhancement feature matrix. The cross-fusion of multidimensional features enables targeted response amplification of the internal region of the bubble entity, and the inverse coherence coefficient ensures that the enhancement effect is concentrated in the physical anomalous region. The introduced exponential gate weight produces smooth decay in the low energy region, which, while filtering dark field noise, avoids the risk of secondary bias in the bright region caused by a single linear intensity multiplier, and improves the distribution stability of the feature matrix in complex backgrounds. The steps of mirroring the enhanced features, generating a dynamic threshold by combining local window statistical parameters, and binarizing the output mask specifically include: The odd-numbered physical pixel side lengths of the adaptive sliding window are determined based on the estimated maximum radius of the bubble: In the formula, This represents the calculated local window side length constant. Indicates the equivalent physical size of a pixel; This parameter represents the expected maximum physical radius of the bubble to be tested. This parameter depends on the quality control standards of the specific industrial testing task and the process specifications of the silicone gel product to be tested. In other words, it is the maximum physical size of the bubble that the system needs to tolerate or must intercept. Based on the microbubble distribution characteristics in conventional silicone gel infusion processes, it is usually set between 0.1 mm and 3.0 mm. Mirror filling is used to expand the original image boundary to eliminate edge statistical distortion, and the local neighborhood mean is calculated: In the formula, This represents the calculated local neighborhood mean. This represents the entity enhancement feature matrix after mirror filling. By expanding the image boundary of the entity enhancement feature matrix using mirror filling before calculating the local neighborhood mean and variance, the edge statistical distortion caused by conventional zero-fill or no-fill strategies is eliminated. Mirror filling utilizes the texture and gray-level symmetry of the boundary itself, so that smooth and continuous statistical samples can be obtained in the local window near the image edge. This operation prevents the local mean and variance from undergoing systematic numerical shifts in the edge region, ensuring the continuity and reliability of the calculated local dynamic segmentation threshold across the entire image, and reducing the risk of false mask generation and target edge fragmentation caused by threshold estimation distortion in the boundary region. Calculate the local adaptive dynamic segmentation threshold matrix: In the formula, This represents the calculated local dynamic threshold; The square root represents the local neighborhood mean; the part inside the square root represents the local variance. This represents a sensitivity control constant, the value of which is derived from local threshold segmentation models in statistics (such as the Niblack or Sauvola algorithm) and Chebyshev's inequality; it defines the segmentation boundary based on the degree of deviation between the bubble target feature values and the background variance; its value ranges from... For weakly scattering targets, the preferred value is between 1.0 and 2.0; the larger this constant value is, the higher the threshold value becomes. The overall numerical baseline is raised, making the binarization judgment condition more stringent; it can effectively suppress local background noise and reduce the false detection rate; however, it can cause real bubble entity features with weak contrast and extremely small size to fail to cross the threshold, resulting in missed detections, and the connectivity of the bubble mask will also deteriorate; the smaller the value of this constant: the higher the threshold. The numerical baseline is lowered, and the binarization judgment condition becomes more relaxed; it can retain the weak feature response of microbubbles to the maximum extent and improve the detection rate; however, it makes the algorithm extremely sensitive to local background noise, small impurities in silicon gel or incompletely suppressed stress residuals, resulting in a large number of false noise clumps in the final mask. Calculate the final microbubble binarization mask matrix: In the formula, This represents the calculated bubble binarization mask matrix; Indicates the feature value of local entity enhancement; Indicates the local dynamic threshold; This represents a unit step function that returns 1 when the input is greater than or equal to zero, and 0 when the input is less than zero. (See reference...) Figure 4As shown, through the above steps, this scheme effectively realizes the evolution from the original low-contrast wrapping phase map to the final high-fidelity microbubble binarized mask image and target extraction. By combining the neighborhood mean and local variance within the local window and introducing a sensitivity control constant, an adaptive dynamic segmentation threshold matrix is generated. Subsequently, a pixel-by-pixel binarization operation is performed using a unit step function to output the mask. The dynamic threshold strategy can keenly track the subtle spatial fluctuations of uneven background light intensity and stress characteristics, overcoming the local missed detection problem that is easily caused by a global single threshold when facing complex media. The variance-based offset adjustment allows the threshold surface to adapt to changes in local contrast, effectively suppressing local high-frequency noise in the background while preserving the weak feature response of the micro-target, thus improving the overall accuracy and spatial morphological fidelity of bubble recognition.
[0031] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.
[0032] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the technical principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A method for visually enhancing and recognizing microbubbles inside silica gel, characterized in that, include: Circularly polarized structured light is projected onto the object under test, and a phase-shifted image sequence is acquired by rotating a linear polarizer to calculate the encapsulation phase. Calculate the differential energy map, construct the maximum spanning tree to expand the phase and subtract the baseline to obtain the relative anomalous phase; The discrete spatial partial derivative of the relative anomalous phase is obtained, and the magnitude of the gradient of the comprehensive anomalous phase is calculated. The decay scale is determined based on the point spread function radius, and the spatial coherence coefficient is obtained by mapping the gradient magnitude. The total light intensity is calculated based on the image sequence, and the linear polarization modulation contrast estimate is extracted by combining the alternating amplitude. The transient bubble phase is calculated using the mean of the abnormal phase as the baseline and weighted by the contrast estimate. Unpolarized scattering features are extracted and fused with transient phase, anti-coherence coefficient and gate weights to obtain enhanced features; The enhanced features are mirrored and filled, and a dynamic threshold is generated by combining local window statistical parameters. The output mask is then binarized.
2. The method for visually enhancing and recognizing microbubbles inside silica gel according to claim 1, characterized in that, The steps of projecting circularly polarized structured light onto the object under test, acquiring a phase-shifted image sequence by rotating a linear polarizer, and calculating the encapsulated phase specifically include: At the output end of the projection light source, a circularly polarized sinusoidal fringe structured light is projected onto the object under test by waveplate modulation, and the collected coordinates are physically calibrated and mapped. Polarization is analyzed using an analyzer, and the transmission axis of the analyzer is rotated synchronously to four equally spaced preset polarization angles to obtain a four-frame polarization image sequence compatible with four-step phase-shift demodulation. Extract the image pixel intensity values corresponding to four different polarization angles, and use the four-quadrant arctangent function to calculate the principal value wrapped phase matrix under structured light modulation.
3. The method for visually enhancing and recognizing microbubbles inside silica gel according to claim 1, characterized in that, The steps of calculating the differential energy map, constructing the maximum spanning tree, expanding the phase, subtracting the reference, and obtaining the relative anomalous phase specifically include: In an empty field without a test object, structured light is projected and demodulated to obtain the reference phase matrix of the corresponding planar carrier. Within the local spatial neighborhood centered on the current pixel, the squared values of the horizontal and vertical wrapping differences after phase wrapping correction are calculated respectively. The sum of the two values is used to obtain the local phase difference energy map matrix, where the wrapping difference is obtained by mapping the principal wrapping phase difference of adjacent pixels through the tangent and arctangent functions. The pixel with the smallest value in the local phase difference energy map is used as the seed point for expansion. The graph is traversed along the maximum spanning tree constructed based on the local phase difference energy map. The phase step number is preferentially passed to the pixels with lower difference energy map values to expand the wrapped phase. Subtracting the reference phase matrix from the expanded phase matrix yields the relative abnormal phase matrix.
4. The method for visually enhancing and recognizing microbubbles inside silica gel according to claim 1, characterized in that, The steps of obtaining the discrete spatial partial derivative of the relative anomalous phase and calculating the magnitude of the comprehensive anomalous phase gradient specifically include: The center difference discretization method is used to calculate the relative abnormal phase gradient in the structured light carrier modulation direction and the local abnormal phase gradient perpendicular to the carrier modulation direction. The calculation process is to obtain the relative abnormal phase difference between adjacent pixels in the corresponding direction and divide it by twice the pixel equivalent physical size. The local anomalous phase gradients in the two directions are squared and summed, and the sum is squared to obtain the scalarized comprehensive anomalous phase gradient magnitude matrix.
5. The method for visually enhancing and recognizing microbubbles inside silica gel according to claim 1, characterized in that, The step of determining the attenuation scale based on the point spread function radius and obtaining the spatial coherence coefficient by mapping the gradient magnitude specifically includes: Obtain the pre-determined physical radius of the point spread function of the imaging system, and determine the attenuation scale parameter from the point spread function radius; The local spatial coherence distribution matrix is obtained by dividing the square of the comprehensive abnormal phase gradient magnitude by twice the square of the attenuation scale parameter and taking the natural exponent from the negative of the ratio.
6. The method for visually enhancing and recognizing microbubbles inside silica gel according to claim 1, characterized in that, The step of calculating the total light intensity based on the image sequence and extracting the linear polarization modulation contrast estimate using alternating amplitude specifically includes: The pixel intensity values of the four frames of polarization image sequence are summed and averaged to obtain the estimate of the total light intensity DC component of each pixel; The alternating amplitude feature components of the image are calculated using the pixel intensity difference under mutually orthogonal polarization angles. The ratio of the alternating amplitude characteristic component to the estimated total light intensity DC component is used as the linear polarization modulation contrast estimation matrix.
7. The method for visually enhancing and recognizing microbubbles inside silica gel according to claim 1, characterized in that, The step of calculating the transient bubble phase using the mean of the abnormal phase as a baseline and weighted by the contrast estimate specifically includes: Calculate the global mean of the relative abnormal phase, and use the difference between the relative abnormal phase and the global mean as the phase component after baseline subtraction; The difference between the numerical value and the linear polarization modulation contrast estimate is used as the spatial suppression weight; The phase component after baseline subtraction is multiplied by the spatial suppression weight to obtain the transient bubble phase matrix.
8. The method for visually enhancing and recognizing microbubbles inside silica gel according to claim 1, characterized in that, The step of extracting non-polarized scattering features and fusing them with transient phase, reverse coherence coefficient, and gate weights to obtain enhanced features specifically includes: Multiply the total light intensity DC component estimate by the spatial suppression weight to construct the non-polarized volume scattering response characteristic estimate; Subtracting the numerical value from the local spatial coherence coefficient yields the inverse coherence coefficient; Calculate the ratio of the total light intensity DC component estimate to its global mean, obtain the natural exponent from the negative of the ratio, and subtract the natural exponent from the value to obtain the gating weight; The absolute value of the transient bubble phase, the estimator of the non-polarized body scattering response characteristics, the inverse coherence coefficient, and the gate weight are multiplied together to obtain the cross-fused entity enhancement feature matrix.
9. The method for visually enhancing and recognizing microbubbles inside silica gel according to claim 1, characterized in that, The steps of mirroring the enhanced features, generating a dynamic threshold by combining local window statistical parameters, and binarizing the output mask specifically include: The odd-numbered pixel side length of the adaptive sliding window is determined by rounding down and doubling the ratio of the estimated maximum physical radius of the target to the pixel equivalent physical size. The image boundary of the entity enhancement feature matrix is expanded using a mirror filling method, and the mean and variance of local neighborhood features are calculated within the adaptive sliding window; The square root of the local feature variance is multiplied by a preset sensitivity control constant, and the product is added to the mean of the local neighborhood features to obtain the local adaptive dynamic segmentation threshold matrix. The difference between the entity enhancement feature matrix and the local adaptive dynamic segmentation threshold matrix is compared pixel by pixel using a unit step function. When the difference is greater than or equal to zero, the target mask value is output, and when it is less than zero, the background mask value is output, thus obtaining the microbubble binarized mask matrix.