Digital image dynamic enhancement method based on temperature prior features

CN122948700APending Publication Date: 2026-10-20WUXI KEZHENGHUI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611095324.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-22
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0004]针对现有技术的不足,本发明提供了基于温度先验特征的数字图像动态增强方法,解决了同一帧图像内不同温度区域的图像质量存在系统性差异的问题

Benefits of technology

1、本发明依据温度估计值与温度梯度幅值将图像划分为高温均匀区、高温梯度区、低温均匀区、低温梯度区和过渡区五类区域,并对各区域分别执行自适应伽马校正、局部对比度拉伸、亮度补偿与降噪、多尺度残差增强及加权融合处理,使增强强度与各像素的温度状态直接关联,消除了固定参数增强方法的区域适配性缺陷。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This invention relates to the field of digital image processing technology and discloses a dynamic image enhancement method based on temperature prior features. The method includes simultaneously acquiring visible light images and infrared thermal images, extracting temperature field moment features to complete global coarse registration, followed by thin-plate spline elastic fine registration and visible light-guided super-resolution reconstruction to obtain a high-resolution temperature field. Based on Newton's law of cooling, an exponential decay spatiotemporal evolution equation for temperature and degradation parameters is established. Kalman filtering is used to predict the current temperature estimate and degradation parameter estimate. The image is divided into five regions based on temperature and temperature gradient, and differentiated enhancement processing is performed. A spatial degradation penalty weight matrix is ​​constructed using the degradation parameter norm, and gradient fidelity is constrained for iterative optimization to output the final enhanced image. This invention solves the image distortion problem caused by spatial inhomogeneity and time-varying temperature fields in injection molded parts, achieving temperature-driven adaptive image enhancement and providing high-quality image input for visual inspection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital image processing technology, specifically to a method for dynamic enhancement of digital images based on temperature prior features. Background Technology

[0002] Injection molded parts are plastic products made from thermoplastic or thermosetting plastics, which are heated and melted in an injection molding machine, injected into a mold cavity, and then cooled and solidified. They are widely used in industrial products such as household appliances, automotive parts, and electronic device housings. In automated production lines, injection molded parts need to undergo online quality inspection after demolding to identify molding defects such as surface cracks, shrinkage marks, and material shortages, and to determine whether the dimensions are out of tolerance. Visual inspection is the core link in achieving the above quality judgment. It uses an industrial camera to capture visible light images of the injection molded part surface, which are then sent to defect detection and dimensional measurement for analysis.

[0003] In existing technologies, industrial cameras are typically deployed at visual inspection stations to photograph the surface of injection-molded parts. After acquiring visible light images, these images are directly sent for subsequent analysis. To suppress image noise or improve overall contrast, some solutions employ histogram equalization or contrast stretching with fixed parameters for global image enhancement. However, in practice, the surface temperature field of the injection-molded part exhibits significant spatial non-uniformity after demolding. The temperature in the gate area is much higher than that in the edge and corner areas. This high temperature alters the visible light reflection characteristics of the resin material on the surface of the plastic part, causing overexposure and decreased contrast in high-temperature areas of the acquired visible light images, while low-temperature areas appear darker and have blurred details. There are systematic differences in image quality across different temperature regions within the same frame. Summary of the Invention

[0004] To address the shortcomings of existing technologies, this invention provides a digital image dynamic enhancement method based on temperature prior features, which solves the problem of systematic differences in image quality between different temperature regions within the same frame.

[0005] To achieve the above objectives, the present invention provides a digital image dynamic enhancement method based on temperature prior features, comprising the following steps: Simultaneously acquire visible light images and infrared thermal images of the injection molded part surface, perform spatial registration and resolution reconstruction on the visible light images and infrared thermal images, and obtain a high-resolution temperature field; Local degradation features of the visible light image are extracted to construct an image degradation vector. Combined with the cooling physics of the injection molded part, a spatiotemporal evolution model of the high-resolution temperature field and the image degradation vector is established. Based on the spatiotemporal evolution model, a state vector and a system dynamic model are constructed. The state of the injection molded part at the current detection moment is filtered and predicted to obtain the temperature estimate and degradation parameter estimate at the current moment. The visible light image is divided into regions based on the temperature estimate, and the corresponding differential pixel value correction and image fusion are performed on each region to obtain an initial enhanced image. Based on the estimated degradation parameters, a spatial degradation penalty weight matrix is ​​constructed. An image optimization objective function is constructed using the spatial degradation penalty weight matrix. The image optimization objective function is iteratively minimized using the initial enhanced image as the independent variable, and the final dynamically enhanced image is output. By employing the aforementioned technical solution, visible light images and infrared thermal images of the injection-molded part surface are simultaneously acquired. A high-resolution temperature field is obtained through spatial registration and super-resolution reconstruction. Local degradation features are extracted, and a spatiotemporal evolution model of the temperature field and degradation vector is established based on Newton's law of cooling. Kalman filtering is used to predict the current temperature and degradation parameter estimates. Based on this, the image is partitioned and differential enhancement processing is performed. Then, spatial penalty weight constraints are constructed using degradation parameters for iterative optimization, outputting the final dynamically enhanced image. This method effectively compensates for image regionalization distortion caused by spatial inhomogeneity and time-varying temperature fields in the injection-molded part. The enhancement strategy adaptively adjusts with the cooling process, improving the image quality for subsequent visual inspection.

[0006] This invention provides a digital image dynamic enhancement method based on temperature prior features. It has the following beneficial effects: 1. Based on the temperature estimate and temperature gradient magnitude, this invention divides the image into five regions: high temperature uniform region, high temperature gradient region, low temperature uniform region, low temperature gradient region, and transition region. Adaptive gamma correction, local contrast stretching, brightness compensation and noise reduction, multi-scale residual enhancement, and weighted fusion processing are performed on each region to make the enhancement intensity directly related to the temperature state of each pixel, thus eliminating the region adaptability defects of fixed parameter enhancement methods.

[0007] 2. This invention utilizes the inherent spatial distribution law of high temperature field at the gate and low temperature field at the edge. It extracts the moment features of infrared temperature field and visible light profile and performs affine transformation matching. Then, it completes the elastic fine registration of thin plate spline by constraining the consistency of temperature gradient and grayscale gradient directions. The entire registration process does not rely on visible light surface texture feature points, and achieves pixel-level precise alignment between infrared temperature map and visible light image.

[0008] 3. This invention establishes an exponential decay time-varying evolution equation for temperature and degradation parameters, and uses Kalman filtering to incorporate temperature, degradation parameters and their rate of change into the state vector for time-series prediction and observation correction, so that the estimated value output at the current moment truly reflects the transient thermal state of the plastic part, and the enhancement strategy is adaptively adjusted with the cooling process.

[0009] 4. This invention constructs a spatial degradation penalty weight matrix using the degradation parameter norm, constraining the gradient fidelity term to allow larger gradient modifications in severely degraded regions and strictly limiting modifications in normal regions. After enhancement, the convergence value of the objective function and structural similarity can be directly used as quantitative criteria for the enhancement effect, and the enhancement quality can be evaluated in real time without relying on downstream detection results. Attached Figure Description

[0010] Figure 1 This is a flowchart of the digital image dynamic enhancement method based on temperature prior features according to the present invention. Figure 2 This is a flowchart of multispectral image registration and super-resolution reconstruction provided in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the construction of image degradation vectors according to an embodiment of the present invention. Detailed Implementation

[0011] The technical solution of the present invention will now be clearly and completely described 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.

[0012] Please see the appendix Figure 1 -Appendix Figure 3 This invention provides a digital image dynamic enhancement method based on temperature prior features, comprising the following steps: Simultaneously acquire visible light images and infrared thermal images of the injection molded part surface, perform spatial registration and resolution reconstruction on the visible light images and infrared thermal images, and obtain a high-resolution temperature field; Furthermore, obtaining a high-resolution temperature field specifically includes: Spatial moment features of infrared thermal images and visible light images are extracted for global coarse registration to obtain a preliminary aligned temperature field. Local elastic fine registration of the initially aligned temperature field is performed based on thin plate spline interpolation to obtain a low-resolution temperature map. Using a visible light image as a guide image, spatial upsampling is performed on a low-resolution temperature map to obtain a high-resolution temperature field; Obtaining the initial aligned temperature field specifically includes: Calculate the spatial moment features of each order of the infrared thermal image to construct the first moment feature vector; Extract the global region mask from the visible light image and calculate the spatial moment features of the global region mask to construct the second moment feature vector; The target affine transformation matrix is ​​solved with the goal of minimizing the error between the first moment eigenvector and the second moment eigenvector. The target affine transformation matrix is ​​then used to perform coordinate space transformation on the infrared thermal image to output a preliminary aligned temperature field. Specifically, in an automated visual inspection production line for injection molded parts, after demolding, the injection molded parts are conveyed to the inspection station by a conveyor belt. An industrial camera and an infrared thermal imager, both positioned at the station, simultaneously acquire visible light and infrared thermal images of the same injection molded part surface. In this embodiment, a programmable logic controller (PLC) sends an external hardware trigger pulse to simultaneously drive the shutter action of both the industrial camera and the infrared thermal imager, synchronizing the exposure times of the two images. The acquired visible light image is recorded as... Infrared thermal images are denoted as ,in These are the pixel coordinates of the visible light image. These are the pixel coordinates of the infrared thermal image; First, define the pixel coordinates in the infrared thermal image. The physical temperature value at that location is The temperature value is obtained by converting the grayscale value using an infrared thermal imager based on a calibration curve. Based on this, the zero-order moment of the infrared temperature field is calculated. and two first-order moments The definitions of each order of moment are as follows, with the zeroth order moment being: ; This represents the total heat in the temperature field; First moment: ; The centroid coordinates of the temperature field can be obtained from the ratio of the first moment to the zeroth moment. ; Using this centroid as a reference, the second central moment of the temperature field is further calculated, including:

[0013] The zeroth moment obtained from the above calculation centroid x-coordinate , centroid ordinate and second-order central moments Arranged sequentially, they form the first moment eigenvector. The first moment eigenvector fully describes the energy, location, and spatial distribution characteristics of the infrared temperature field; For visible light images The image is binarized using the Otsu's method to extract the foreground region corresponding to the main body of the injection molded part, forming a global region mask. This mask is a binary image, where pixel values ​​within the injection molded part region are 1, and pixel values ​​within the background region are 0. On this binary mask, the zeroth moment, first moment, barycentric coordinates, and second central moment are calculated using the same moment calculation method as for the infrared temperature field. Combining components in the same order to construct the second moment eigenvector Since the geometric contour of the injection molded part and the spatial distribution of the temperature field have an inherent consistency, the two sets of moment eigenvectors should satisfy a two-dimensional affine transformation relationship. Therefore, a target affine transformation matrix is ​​set. for The matrix contains six degrees of freedom: rotation, scaling, and translation. During the optimization iteration process, the current affine transformation is applied to the infrared thermal image. Bilinear interpolation is used to resample the transformed temperature values ​​onto a regular grid with the same size as the visible light image, and then the moment eigenvectors of the temperature field on this grid are calculated. and with and The squared Euclidean distance between them is used as the error function: ; The optimal affine transformation matrix that minimizes the error function is obtained through an iterative optimization algorithm. In this embodiment, the Levenberg-Marquardt algorithm is used for iterative search, with the initial value set as the identity matrix and the convergence tolerance set to [value missing]. After obtaining the optimal affine transformation matrix, the transformation is performed on all pixel coordinates of the infrared thermogram, and bilinear interpolation is used for resampling to generate a preliminary aligned temperature field. ; Because injection molded parts have three-dimensional thickness, and two-dimensional projections exhibit local parallax misalignment, a local elastic fine registration of the thin-plate spline is performed based on the initial aligned temperature field. The initial aligned temperature field is calculated separately. Spatial gradient magnitude map and visible light image The grayscale gradient magnitude map is obtained by calculating the horizontal and vertical differences using the Sobel operator and taking the modulus. A gradient response threshold is set, and pixels with values ​​in the top 15% of the two gradient magnitude maps are selected as candidate control points. A sequence of control point pairs is then established using the spatial nearest neighbor principle. For matching control points, define a thin-plate spline mapping function: ; in The coordinates of the control points are from the initially aligned temperature field. For radial basis functions, using The coordinate relationships of the control points are used to construct a system of linear equations, and the affine component parameters are solved using the least squares method. and the weighting coefficients corresponding to each control point The solution obtained The system initially aligns the temperature field, calculates the deformed coordinates pixel by pixel, performs grayscale interpolation, and outputs a low-resolution temperature map. ,at this time It has been precisely aligned with the visible light image in terms of pixel geometry, but its spatial resolution is still comparable to the original infrared thermal image; Visible light images To guide, low-resolution temperature maps By performing guided filtering wavefront sampling, a high-resolution temperature field with the same resolution as the visible light image is obtained. Since the injection-molded part has a uniform material, its surface temperature change is typically linearly correlated with the grayscale of the visible light image within a local region. This is assumed to occur within a local square window centered on the pixel to be processed. Internally, it outputs a high-resolution temperature. With guide image There exists a local linear mapping relationship: ; Window size selection Pixels, by minimizing the cost function within the window: ; in To prevent linear coefficients In this embodiment, an excessively large regularization coefficient is problematic. A value of 0.01 can be used to calculate the optimal linear coefficients for each window. and Each pixel is covered by multiple windows, therefore, the calculation is performed on overlapping windows. and The average value is substituted into the linear model to finally calculate the high-resolution temperature value for each pixel. After traversing the entire image, a high-resolution temperature field with the same size as the visible light image is generated. Each pixel in this high-resolution temperature field carries temperature information corresponding to its spatial location, providing a precise pixel-level temperature label and spatial correspondence basis for subsequent dynamic image enhancement based on temperature prior features.

[0014] Local degradation features of visible light images are extracted to construct image degradation vectors. Combined with the cooling physics of injection molded parts, a spatiotemporal evolution model of high-resolution temperature field and image degradation vector is established. Furthermore, a spatiotemporal evolution model of the high-resolution temperature field and image degradation vector is established, specifically including: Using multiple sets of historically acquired high-resolution temperature field data and corresponding image degradation vectors, exponential data fitting was performed based on Newton's law of cooling to obtain the corresponding cooling rate coefficient and degradation decay coefficient. The surface temperature field evolution equation with exponential temperature decay and the image degradation evolution equation with exponential degradation parameter decay were established. Specifically, in high-resolution temperature fields After generation, the visible light image is further processed. Multi-dimensional feature quantization is performed on the local degradation states in the image to construct an image degradation vector. After the injection molded part is demolded, due to the uneven surface temperature distribution, the visible light image in different areas will exhibit different degrees of contrast attenuation, texture blurring, and noise changes. These degradation phenomena are intrinsically related to temperature. The degradation vector constructed in this embodiment... It consists of three components, namely the contrast degradation component. fuzziness component and noise level components , represented as: ; For contrast degradation components First calculate in pixels Centered Maximum grayscale value within a local square window minimum gray value This yields local contrast: ; A reference sample of the same material and specifications as the injection-molded parts on the production line, and which has undergone sufficient natural cooling (i.e., its surface temperature is the same as the ambient temperature), is selected. Visible light images of this reference sample are acquired under the same illumination conditions. The average local contrast of the corresponding pixel positions on this reference sample is calculated and used as the baseline contrast. ,but The larger the value of the contrast degradation component, the more severe the contrast loss at that location. For fuzziness components The Sobel operator is used to calculate the spatial gradient of the visible light image in the horizontal and vertical directions, and the gradient magnitude is obtained: ; The average gradient magnitude of the reference sample acquired using the same method was used as the baseline gradient. ,but In regions where the gradient magnitude is smaller, the value of this component is larger, and the corresponding degree of blurriness is higher. For noise level components , calculation Centered Gray-scale variance within a local window and the global grayscale variance of the entire visible light image. ,but This component reflects the intensity of local noise relative to the global average noise; After constructing the degradation vector of a single image, a spatiotemporal evolution model of the high-resolution temperature field and the image degradation vector is established, taking into account the cooling physics of injection molded parts. After demolding, the injection molded part is exposed to the air in the workshop, and there is a temperature difference between its surface and the surrounding environment. Heat is dissipated into the air through convection. According to Newton's law of cooling, when the temperature difference between the surface of an object and the environment is small, the cooling rate of the object is proportional to the temperature difference. The temperature range of the injection molded part after demolding is usually tens to over one hundred degrees Celsius, with a limited temperature difference from the workshop environment. Moreover, the heat conduction of the plastic part itself is relatively uniform. Therefore, the surface temperature decays approximately exponentially over time. Image degradation is directly related to temperature. As the temperature decreases, the optical properties of the material surface change, and the degree of degradation changes synchronously. Therefore, each component of the image degradation vector also follows an exponential decay law. To establish the aforementioned evolution equation, it is necessary to use historical data to solve for the cooling rate coefficient and degradation decay coefficient at each pixel location. The historical data comes from multiple time points after demolding during the production line operation. High-resolution temperature fields generated at each time step according to the aforementioned registration and super-resolution process. and the degradation vectors extracted from the corresponding visible light images at each time step. For each pixel position ,use Group temperature-time data pairs An exponential model based on Newton's law of cooling: ; Perform nonlinear least squares fitting to solve for the cooling rate coefficient. and initial temperature ,in The ambient temperature balance constant in the workshop is measured in real time by thermocouple sensors placed around the production line, and its value range is typically within... to between; The moment when the temperature field data is first collected after demolding is recorded by the system clock and used as the starting point for subsequent calculations, thereby establishing the spatiotemporal evolution equation of the surface temperature field: ; in Indicates time Time Pixel Similarly, for each component in the degradation vector, the predicted temperature value at that location is obtained by using... Group degradation-time data pairs Exponential fitting was performed separately, and the fitting model is as follows: ; Solve for the degradation attenuation coefficient and equilibrium value corresponding to each component, where the degradation equilibrium value is: ; The image was acquired by capturing an image of a standard sample of the same material and specifications as the injection-molded part from the production line, which had undergone sufficient natural cooling, at ambient temperature. The values ​​of each degradation component were extracted using the aforementioned degradation component calculation algorithm, serving as the baseline degradation parameter for that pixel location under cooling equilibrium conditions. Based on this, the spatiotemporal evolution equation of the image degradation vector was established: ; in Indicates time Time Pixel The predicted degradation vector at that location, The degradation attenuation coefficient is solved by the following process: Similarly, by exponentially fitting the historical degradation components, the above together constitute a spatiotemporal evolution model of the high-resolution temperature field and the image degradation vector, providing numerical basis for subsequent time-series prediction of temperature and degradation parameters.

[0015] Based on the spatiotemporal evolution model, a state vector and system dynamic model are constructed to filter and predict the state of the injection molded part at the current detection moment, and obtain the temperature estimate and degradation parameter estimate at the current moment. Furthermore, the state of the injection molded part at the current detection moment is filtered and predicted to obtain the estimated temperature and degradation parameters at the current moment, specifically including: Based on the system dynamic model, state transition equations and observation equations for discrete time step iteration are established. The state vector, state transition equation, and observation equation are input into the Kalman filter to perform prior state prediction. The feedback Kalman gain is calculated by combining the newly acquired observation data at the current detection time. The prior state is then corrected and updated using the feedback Kalman gain to obtain the posterior state estimation vector at the current time. The posterior state estimation vector is decomposed, and the corresponding temperature component and degradation component are extracted as temperature estimate and degradation parameter estimate. Specifically, after obtaining the spatiotemporal evolution equations of the high-resolution temperature field and the image degradation vector, in order to achieve accurate estimation of the surface temperature state and image degradation state of the annotation at the current detection time, this embodiment converts the above spatiotemporal evolution model into a state-space expression that can be used for Kalman filtering, and uses filtering methods for time-series prediction and correction. First, define the pixel position. The system state vector at that point needs to fully describe the current state and its changing trend in both the temperature and degradation dimensions: [This requires] a high-resolution temperature field. and its time derivative Incorporate the state to constrain temperature and its rate of change; simultaneously, Degenerate vector It includes contrast degradation components, blur level components, and noise level components, as well as their time derivatives. Incorporation state, thereby constructing System state vector: ; Each element of this state vector varies with spatial position. The change starts from the established surface temperature field evolution equation, the equation... Taking the derivative with respect to time, we get: ; This indicates that the rate of temperature change is proportional to the difference between the current temperature and the ambient temperature, with the proportionality coefficient being the cooling rate coefficient. ; Similarly, for the image degradation evolution equation Taking the derivative with respect to time, we get: ; in Given the degenerate equilibrium vector, based on the aforementioned first-order differential relation, the system dynamic equations in continuous time can be written as follows: ; in and These are the zero matrix and the identity matrix, respectively. The subscripts indicate the matrix dimensions. To facilitate discrete filtering, the continuous equation is discretized using first-order forward difference, and the sampling time interval is taken as... The discrete state transition equations are obtained as follows: ; Wherein, the state transition matrix , The matrix of the above continuous system; As a constant input term, determined by ambient temperature and degenerate balance vector Decide; The noise is assumed to be process noise with a mean of zero and a covariance matrix of... Gaussian distribution, It can be set as a diagonal matrix, with the diagonal elements determined based on the possible fluctuation variance of each state variable between adjacent time steps. In this embodiment, the process noise variance of the temperature component is taken as... The process noise variance of the degradation component is taken as ; The observation equation establishes a mapping relationship between the actual collected data and the state vector. At the detection station, the infrared thermal imager provides the temperature observation value at the current moment. The visible light image, after degradation feature extraction, provides the current degradation observation vector. The observation vector is denoted as The observation equation is: ; Where the observation matrix for The matrix directly extracts the temperature value and degradation vector components from the state vector, i.e. ; To observe the noise, it is assumed that it follows a zero-mean Gaussian distribution. The diagonal elements of its covariance matrix R can be set according to the temperature measurement accuracy of the infrared thermal imager and the statistical fluctuations calculated by the degradation vector. In this embodiment, the variance of the temperature observation noise is 0.5 and the variance of the degradation component observation noise is 0.01. When the injection molded part arrives at the inspection station Determined as the current filtering time Based on the posterior state estimate of the previous time step and estimation error covariance Perform prior prediction: ; ; Then, using the newly acquired observation data at the current moment Calculate the Kalman gain and perform the state update: ; ; ; Based on the above predictions and updates, the current time is obtained. posterior state estimation vector Decompose the vector by index and extract the first component as the temperature estimate for the current moment. The fourth to sixth components were extracted as degradation parameter estimates. These two estimates, which incorporate prior knowledge from the physical evolution model and corrections from actual observations at the current moment, will be directly fed into the subsequent partitioning enhancement strategy to determine the type and intensity parameters of enhancement operations to be performed on each pixel region.

[0016] The visible light image is divided into regions based on the temperature estimate, and the corresponding differential pixel value correction and image fusion are performed on each region to obtain the initial enhanced image. Furthermore, the visible light image is divided into regions based on the temperature estimate, specifically including: Calculate the temperature gradient magnitude of the temperature estimate; The estimated temperature value is compared with the set high temperature threshold and low temperature threshold, and the temperature gradient amplitude is compared with the set gradient amplitude threshold. Based on the comparison results, the pixels of the visible light image are divided into high temperature uniform region, high temperature gradient region, low temperature uniform region, low temperature gradient region and transition region. Perform corresponding differential pixel value correction and image fusion on each of the divided regions to obtain the initial enhanced image, specifically including: An adaptive gamma correction model is applied to adjust pixel values ​​in high-temperature uniform regions. Perform local contrast stretching on the high-temperature gradient region; Brightness compensation and noise reduction are performed on the low-temperature uniform region; Pixel overlay is performed in the low-temperature gradient region using a multi-scale residual model. Perform corresponding differential pixel value correction and image fusion on each of the segmented regions to obtain an initial enhanced image, which also includes: After performing pixel correction on the high-temperature uniform region, high-temperature gradient region, low-temperature uniform region, and low-temperature gradient region, calculate the Euclidean distance from the pixel features in the transition region to the feature center points of the high-temperature uniform region, high-temperature gradient region, low-temperature uniform region, and low-temperature gradient region, and obtain the corresponding normalized weighted fusion coefficient based on the Euclidean distance. The normalized weighted fusion coefficients are weighted and summed with the pixel correction results of the high-temperature uniform region, the high-temperature gradient region, the low-temperature uniform region, and the low-temperature gradient region to output the initial enhanced image. Specifically, in obtaining the temperature estimate at the current moment. Next, the visible light image To divide regions based on temperature distribution, the temperature gradient magnitude of the estimated temperature values ​​is first calculated. Specifically through the The Sobel operator is applied to the horizontal and vertical directions respectively, and the arithmetic square root of the sum of the squares of the differences in the two directions is obtained. Then, three numerical boundaries were set for region division, including a high-temperature threshold. The method for determining the low temperature threshold is as follows: Statistically analyze the temperature distribution data of injection molded parts collected during the historical operation of the production line, and take the temperature value corresponding to the 80th percentile of the cumulative temperature probability distribution; Take the temperature value corresponding to the 20th percentile of the cumulative temperature probability distribution, and set the gradient magnitude threshold. Set to 15% of the current global maximum temperature gradient amplitude of the injection molded part, i.e. ; Each pixel and , Compare, and at the same time and The comparison was performed, and based on the results, all pixels in the visible light image were divided into five regions. The condition for the high-temperature uniform region was... The conditions in the high-temperature gradient region are: The conditions for a low-temperature uniform region are: The conditions in the low-temperature gradient region are: Pixels that do not meet the above four conditions are classified as transition regions. Differential pixel value correction is performed on each segmented region. For the high-temperature uniform region, the high temperature on the injection molded part surface causes strong reflection of the resin material, resulting in bright area saturation in the visible light image. An adaptive gamma correction model is used to adjust the pixel values. The corrected pixel values ​​are calculated as follows: ; in, The maximum grayscale value of the visible light image, taken as 255 for an 8-bit image, is the gamma exponent. The formula is as follows, based on a dynamic calculation using estimated temperature values: ; in, This represents the global maximum value of the current estimated temperature of the injection molded part. The gamma adjustment factor is set to 1.0 in this embodiment. As the temperature approaches... The higher the gamma index, the stronger the suppression of highlights; For high-temperature gradient regions, due to the large temperature gradient leading to loss of edge details, local contrast stretching is performed, first on the visible light image. A Gaussian low-pass filter is applied, with a filter kernel standard deviation of 2.0, to obtain the low-frequency components. The formula for calculating the stretched pixel value is: ; Contrast stretching factor It is obtained by linear mapping of temperature gradient magnitude: ; The basic tensile strength is taken as 1.5 in this embodiment. (The term in parentheses is omitted.) The high-frequency detail components at this pixel are extracted, multiplied by a stretching factor, and then superimposed back onto the original image to enhance the edge region. For low-temperature uniform regions, the visible light image is dark and lacks detail. Brightness compensation and noise reduction are performed, and the corrected pixel values ​​are calculated as follows: ; in This is the brightness compensation amount. The noise reduction intensity coefficient is set to 0.8 in this embodiment. To estimate the optimal optimization parameters from the current time step The noise level prediction component extracted from it, i.e. The third component; Brightness compensation amount Determined linearly based on temperature value: ; in This represents the global minimum value of the current estimated part temperature. To achieve the maximum brightness compensation, this embodiment uses 30 gray levels; the lower the temperature, the greater the compensation. To estimate the noise components, the visible light image is processed... Median filtering is performed, and the absolute value of the difference between the filtered result and the original image is taken. The noise reduction intensity coefficient is set to 0.8 in this embodiment; For low-temperature gradient regions, uneven cooling leads to texture information loss. A multi-scale residual model is used for pixel stacking, and the total number of layers for spatial downsampling is set. For each scale Generate the corresponding smooth image The smoothed image is obtained by using Gaussian filters with different standard deviations: the standard deviation for scale 1 is 1.0, for scale 2 it is 2.0, and for scale 3 it is 4.0. The formula for calculating the enhanced pixel value is as follows: ; in For the first The weighting coefficients for scale are determined by the fact that finer-scale residuals primarily correspond to texture details, while coarser-scale residuals primarily correspond to edge contours. In this embodiment, the weighting coefficients decrease as the scale increases, and are respectively set to... , , This method superimposes high-frequency residual components at different scales according to weights, thereby restoring both fine texture and coarse contour information. After completing the pixel correction for the four types of regions, weighted image fusion is performed on the transition regions to avoid visual block effects at the region boundaries. First, the feature center points for each of the four types of regions are determined: the average value of the temperature estimate and temperature gradient magnitude of all pixels in the high-temperature uniform region, high-temperature gradient region, low-temperature uniform region, and low-temperature gradient region are calculated to obtain four two-dimensional feature vectors, denoted as... , , , For each pixel within the transition region, construct its two-dimensional feature vector. Calculate the Euclidean distance between the vector and the four feature centers mentioned above. The smaller the distance, the closer the feature of the pixel is to the corresponding region. Obtain the normalized weighted fusion coefficient based on the Euclidean distance. ; in For the first The scale parameter for each region is taken as the standard deviation of the Euclidean distance from the feature vectors of all pixels within that region to their center point. Finally, the normalized weighted fusion coefficients are weighted and summed with the pixel correction results of the four regions to output the initial enhanced image of the transition area. ; The enhancement results of the high-temperature uniform region, high-temperature gradient region, low-temperature uniform region, low-temperature gradient region, and transition region are stitched together according to pixel coordinates to obtain a complete initial enhanced image. Each pixel in the initial enhanced image has undergone differentiated enhancement processing based on its temperature feature region. The boundaries between regions remain smooth due to the weighted fusion of the transition region, providing a good initial value for subsequent temperature-constrained iterative optimization.

[0017] A spatial degradation penalty weight matrix is ​​constructed based on the degradation parameter estimates. An image optimization objective function is constructed using the spatial degradation penalty weight matrix. The image optimization objective function is iteratively minimized using the initial enhanced image as the independent variable, and the final dynamically enhanced image is output. Furthermore, a spatial degradation penalty weight matrix is ​​constructed based on the degradation parameter estimates, specifically including: Calculate the Euclidean norm of the estimated degradation parameter values; Based on the Euclidean norm and the numerical mapping scaling coefficient, a spatial degradation penalty weight matrix that is negatively correlated with the numerical value and the Euclidean norm is constructed. The image optimization objective function is constructed using a spatial degradation penalty weight matrix, specifically including: Construct an image optimization objective function that includes data fidelity constraints, gradient fidelity constraints, and structural similarity constraints; Among them, the gradient fidelity constraint term is obtained by performing a Hadamard product operation on the image gradient residual between the independent variable image and the original visible light image and the spatial degradation penalty weight matrix. Specifically, in obtaining the initial enhanced image Subsequently, to further constrain the degree of damage to the original image structure caused by the enhancement process, a spatial adaptive penalty mechanism based on the degradation parameter estimate was introduced, and the initial enhancement result was finely adjusted through iterative optimization. First, construct the spatial degradation penalty weight matrix, and estimate the degradation parameters. It is a three-dimensional vector whose components are the contrast degradation estimates. fuzziness level estimate and noise level estimates ,Right now Calculate the Euclidean norm of the vector, which is the arithmetic square root of the sum of the squares of its components: ; This comprehensively reflects the pixel position. The value indicates the severity of image degradation caused by temperature effects. The higher the value, the more severe the degradation and the further the image pixels at that location deviate from their true physical appearance. Based on the above, construct the spatial degradation penalty weight matrix. Its definition is: ; in The numerical mapping scaling coefficient is determined by statistically analyzing the standard deviation of the norms of the degradation parameters of all pixels in the entire image. , Total number of pixels The value of this weight matrix is ​​the mean of the degradation norms of all pixels. The values ​​range from 0 to 1. When the degradation norm of a pixel is large, A value close to 0 indicates severe degradation at that location, allowing for smaller gradient constraints to be applied to pixel modifications during optimization, thus permitting greater correction. When the degradation norm is small, A value close to 1 indicates that the degradation at that location is slight, and the original gradient structure needs to be strictly maintained, thus establishing an inverse correlation between the degree of degradation and the degree of freedom for pixel modification; Then with the initial enhanced image As an independent variable for optimization Initial values ​​are used to construct the image optimization objective function. It is composed of a weighted combination of three constraint terms: ; The composition and physical meaning of each constraint term are as follows: The first term is the data fidelity constraint term. Image enhancement Compared with the original visible light image The sum of squares of the grayscale differences between each pixel ensures that the enhanced image does not deviate from the original acquired data in terms of overall value, maintaining the basic brightness distribution and subject information of the image. The second term is the gradient fidelity constraint term; the independent variable image is calculated first. Compared with the original visible light image The gradient of the difference image, i.e. Gradient calculation involves applying Sobel horizontal and vertical operators to the difference images to obtain horizontal and vertical gradient maps, respectively. The square root of the sum of their squares is taken as the gradient magnitude matrix. This gradient magnitude matrix is ​​then compared with the spatial degradation penalty weight matrix. Perform the Hadamard product operation, which involves multiplying pixels one by one, and then taking the square of the Frobenius norm of the result. This function is effective in severely degraded areas because... Smaller gradients allow for greater gradient differences between the enhanced and original images, meaning more significant modifications can be made to edges and textures; while in areas of slight degradation or normality, When the value is close to 1, gradient differences are strictly penalized, thus preserving the structural integrity of the original image. The weighting coefficient for this constraint term is 0.1 in this embodiment; The third term is the structural similarity constraint term. Indicates enhanced image Compared with the original visible light image The structural similarity index between two images is calculated based on the similarity of brightness, contrast, and structure within a local window. This is a recognized technique in the field. The loss term is calculated by subtracting the SSIM value from 1; the more structurally similar the two images, the closer this term is to 0. The weight coefficient for the structural similarity constraint term is 0.3 in this embodiment. This constraint term ensures from the perception level that the enhanced image does not destroy the overall structural relationship and visual naturalness of the original image. After constructing the objective function, the gradient descent algorithm is used to... Perform iterative minimization calculations. The independent variable... Initialize to , No. The iteration continues to the... The update formula for the next iteration is: ; in The iteration step size is set to 0.02 in this embodiment; The objective function in the current image The gradient at a given point can be obtained through automatic differentiation or numerical difference calculation. After each iteration, the mean absolute pixel difference between the current iteration image and the previous iteration image is calculated. The convergence threshold is reached when this difference decreases to a preset convergence threshold. At the following point, the objective function is determined to have converged, and the iteration is terminated. The iterative image at the convergence point is used as the final dynamically enhanced image. The output image, while maintaining the main structure of the original visible light image, adaptively recovers the contrast, texture details, and brightness information lost due to temperature effects based on the degree of degradation at each pixel position. It can be directly sent to subsequent defect detection and dimensional measurement for visual analysis.

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

Claims

1. A digital image dynamic enhancement method based on temperature prior features, characterized in that, Includes the following steps: Simultaneously acquire visible light images and infrared thermal images of the injection molded part surface, perform spatial registration and resolution reconstruction on the visible light images and infrared thermal images, and obtain a high-resolution temperature field; Local degradation features of the visible light image are extracted to construct an image degradation vector. Combined with the cooling physics of the injection molded part, a spatiotemporal evolution model of the high-resolution temperature field and the image degradation vector is established. Based on the spatiotemporal evolution model, a state vector and a system dynamic model are constructed. The state of the injection molded part at the current detection moment is filtered and predicted to obtain the temperature estimate and degradation parameter estimate at the current moment. The visible light image is divided into regions based on the temperature estimate, and the corresponding differential pixel value correction and image fusion are performed on each region to obtain an initial enhanced image. Based on the estimated degradation parameters, a spatial degradation penalty weight matrix is ​​constructed. An image optimization objective function is constructed using the spatial degradation penalty weight matrix. The image optimization objective function is iteratively minimized using the initial enhanced image as the independent variable, and the final dynamically enhanced image is output.

2. The digital image dynamic enhancement method based on temperature prior features according to claim 1, characterized in that, The acquisition of the high-resolution temperature field specifically includes: The spatial moment features of the infrared thermal image and the visible light image are extracted for global coarse registration to obtain a preliminary aligned temperature field. Local elastic fine registration of the initially aligned temperature field is performed based on thin plate spline interpolation to obtain a low-resolution temperature map. The high-resolution temperature field is obtained by spatially upsampling the low-resolution temperature map using the visible light image as a guide map.

3. The digital image dynamic enhancement method based on temperature prior features according to claim 1, characterized in that, The acquisition of the preliminary aligned temperature field specifically includes: Calculate the spatial moment features of each order of the infrared thermal image to construct the first moment feature vector; Extract the overall region mask of the visible light image, and calculate the spatial moment features of the overall region mask to construct a second moment feature vector; The target affine transformation matrix is ​​solved with the goal of minimizing the error between the first moment eigenvector and the second moment eigenvector. The target affine transformation matrix is ​​then used to perform coordinate space transformation on the infrared thermal image to output the preliminary aligned temperature field.

4. The digital image dynamic enhancement method based on temperature prior features according to claim 1, characterized in that, The establishment of the spatiotemporal evolution model of the high-resolution temperature field and the image degradation vector specifically includes: By utilizing multiple sets of historically acquired high-resolution temperature field data and corresponding image degradation vectors, exponential data fitting was performed based on Newton's law of cooling to obtain the corresponding cooling rate coefficient and degradation decay coefficient. Surface temperature field evolution equation with exponential temperature decay and image degradation evolution equation with exponential degradation parameter decay were then established.

5. The digital image dynamic enhancement method based on temperature prior features according to claim 1, characterized in that, The step of filtering and predicting the state of the injection molded part at the current detection moment to obtain the estimated temperature and degradation parameters at the current moment specifically includes: Based on the system dynamic model, state transition equations and observation equations for discrete time step iteration are established. The state vector, state transition equation, and observation equation are input into a Kalman filter to perform prior state prediction. The feedback Kalman gain is calculated by combining the newly acquired observation data at the current detection time. The prior state is then corrected and updated using the feedback Kalman gain to obtain the posterior state estimation vector at the current time. The posterior state estimation vector is decomposed, and the corresponding temperature component and degradation component are extracted as the temperature estimate and the degradation parameter estimate, respectively.

6. The digital image dynamic enhancement method based on temperature prior features according to claim 1, characterized in that, The step of dividing the visible light image into regions based on the temperature estimate specifically includes: Calculate the temperature gradient magnitude of the estimated temperature; The estimated temperature value is compared with the set high temperature threshold and low temperature threshold, and the temperature gradient amplitude is compared with the set gradient amplitude threshold. Based on the comparison results, the pixels of the visible light image are divided into a high temperature uniform region, a high temperature gradient region, a low temperature uniform region, a low temperature gradient region, and a transition region.

7. The digital image dynamic enhancement method based on temperature prior features according to claim 6, characterized in that, The step of performing corresponding differential pixel value correction and image fusion on each of the divided regions to obtain an initial enhanced image specifically includes: An adaptive gamma correction model is applied to the high-temperature uniform region to adjust the pixel values; Local contrast stretching is performed on the high-temperature gradient region; Brightness compensation and noise reduction are performed on the aforementioned low-temperature uniform region; The low-temperature gradient region is subjected to pixel stacking using a multi-scale residual model.

8. The digital image dynamic enhancement method based on temperature prior features according to claim 7, characterized in that, The step of performing corresponding differential pixel value correction and image fusion on each of the divided regions to obtain an initial enhanced image also includes: After performing pixel correction on the high-temperature uniform region, the high-temperature gradient region, the low-temperature uniform region, and the low-temperature gradient region, calculate the Euclidean distance from the pixel features in the transition region to the feature center points of the high-temperature uniform region, the high-temperature gradient region, the low-temperature uniform region, and the low-temperature gradient region, and obtain the corresponding normalized weighted fusion coefficient based on the Euclidean distance. The normalized weighted fusion coefficients are weighted and summed with the pixel correction results of the high-temperature uniform region, the high-temperature gradient region, the low-temperature uniform region, and the low-temperature gradient region to output the initial enhanced image.

9. The digital image dynamic enhancement method based on temperature prior features according to claim 1, characterized in that, The construction of the spatial degradation penalty weight matrix based on the degradation parameter estimates specifically includes: Calculate the Euclidean norm of the estimated degradation parameter; Based on the Euclidean norm and the numerical mapping scaling coefficient, a spatial degradation penalty weight matrix is ​​constructed that is negatively correlated with the Euclidean norm.

10. The digital image dynamic enhancement method based on temperature prior features according to claim 1, characterized in that, The process of constructing the image optimization objective function using the spatial degradation penalty weight matrix specifically includes: Construct the image optimization objective function that includes data fidelity constraints, gradient fidelity constraints, and structural similarity constraints; The gradient fidelity constraint term is obtained by performing a Hadamard product operation between the image gradient residual of the independent variable image and the original visible light image and the spatial degradation penalty weight matrix.