Adaptive illumination compensation and image enhancement method based on vision system
Patent Information
- Application Number
- CN202611313715.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-27
- Publication Date
- 2026-09-25
AI Technical Summary
这类方法虽然能够改变图像显示效果,但不能消除实际光照分布异常,且容易放大暗区噪声、压缩亮区灰阶或造成颜色失真
本发明,通过在场景总体照度保持稳定的条件下,使光照抑制窗依次跨照明分区迁移,并依据各抑制过程产生的图像响应位置、亮度变化量及响应扩散方向构建非局部光照耦合场。该方式能够主动显现镜头杂散光、透明罩反射、物体间接反射及高反射表面造成的远距离光照串扰,避免将图像中的偏亮或偏暗区域简单归因于其几何对应光源。基于所述非局部光照耦合场反向分解各照明分区的异常贡献,可以追踪引起照度异常的真实照明分区,提高异常归属的准确性,并减少因错误调节对应光源而造成的异常扩大、局部过补偿及多个照明分区反复升降亮度。
Smart Images

Figure CN122825293A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of lighting control and digital image processing technology, and in particular to an adaptive illumination compensation and image enhancement method based on a vision system. Background Technology
[0002] With the widespread application of machine vision technology in industrial inspection, intelligent manufacturing, security monitoring, robot navigation, and precision measurement, image quality has a significant impact on the accuracy of target recognition, defect detection, and dimensional measurement results. In actual imaging environments, factors such as the installation position of the light source, the reflective characteristics of the scene surface, the transparent protective cover, the lens structure, and changes in ambient light can easily lead to abnormal illumination in images, such as local overexposure, local underexposure, uneven brightness gradients, and saturation in high-reflectivity areas. In particular, stray light from the lens, multiple reflections from the transparent cover, indirect reflections from objects, and long-distance reflections from highly reflective surfaces can cause light from a certain illumination zone to propagate to its non-corresponding imaging area, resulting in a complex non-local crosstalk relationship between the illumination zone and the imaging area.
[0003] Existing visual illumination control schemes typically operate based on a pre-defined geometric correspondence between illumination zones and imaging areas. When an image area is too dark, the brightness of the corresponding light source is increased; when an image area is too bright, the brightness of the corresponding light source is decreased. This approach does not adequately consider the effects of nonlocal light propagation, so the location of an illumination anomaly in the image may not necessarily correspond to the actual illumination zone causing the anomaly. Directly adjusting the geometrically corresponding light source may create new brightness anomalies in other imaging areas, leading to repeated brightness increases and decreases in multiple illumination zones, thus affecting the stability of illumination control.
[0004] Furthermore, some existing solutions primarily utilize digital image processing methods such as histogram equalization, gamma correction, and local contrast enhancement to improve brightness unevenness. While these methods can alter the image display effect, they cannot eliminate actual abnormal illumination distribution and are prone to amplifying noise in dark areas, compressing grayscale in bright areas, or causing color distortion. Other solutions combine physical dimming with digital enhancement, but these typically lack the ability to determine whether a particular illumination anomaly can be eliminated through physical dimming. The processing scope of physical compensation and digital enhancement is unclear, and the same anomaly is easily processed repeatedly. Summary of the Invention
[0005] This invention provides an adaptive illumination compensation and image enhancement method based on a vision system, which can identify the light propagation relationship between illumination zones and non-corresponding imaging areas, reversely determine the source of illuminance anomalies, and reasonably divide the range of physical compensation and digital enhancement according to the feasibility of physical dimming.
[0006] The adaptive illumination compensation and image enhancement method based on vision systems includes the following steps: S1. Under the condition of maintaining the overall scene illumination stability, the illumination suppression windows in the controllable light source are moved across the illumination zones in sequence. Based on the image response position and response diffusion direction caused by each illumination suppression window, a nonlocal illumination coupling field is generated that represents the light propagation relationship between the illumination zone and the non-corresponding imaging area. S2. Based on the nonlocal illumination coupling field, the illuminance anomaly in the current image is inversely attributed to the illumination zone that caused the illuminance anomaly, and a compensation reachability field is generated based on the constraint relationship between the direct illumination effect and the nonlocal crosstalk effect of each illumination zone. S3. Adjust each lighting zone according to the compensation accessibility field, and use the residual illuminance anomalies in the compensation accessibility field that cannot be eliminated by adjusting the lighting zones to perform limited enhancement on the adjusted image to obtain an enhanced image.
[0007] Optionally, the step of sequentially migrating the light suppression window in the controllable light source across lighting zones specifically includes: dividing the controllable light source into multiple lighting zones; sequentially applying a light suppression window to each lighting zone, thereby reducing the emitted light intensity of the lighting zone while simultaneously increasing the emitted light intensity of all other lighting zones, so that the total emitted luminous flux of all lighting zones remains constant during the migration process.
[0008] Optionally, generating a nonlocal illumination coupling field characterizing the light propagation relationship between the illumination partition and the non-corresponding imaging region based on the image response position and response diffusion direction caused by each illumination suppression window specifically includes: for each illumination partition, acquiring two frames of images before and after applying the illumination suppression window, and calculating a difference image; determining the pixel position in the difference image where the pixel brightness change value is greater than a preset threshold as the image response position caused by the illumination partition, and determining the response diffusion direction based on the spatial gradient direction of the pixel brightness change value in the neighborhood of the image response position.
[0009] Optionally, by combining the image response position and response diffusion direction corresponding to each illumination zone, a nonlocal illumination coupling matrix is constructed, with the illumination zone as the input node, the imaging area as the output node, and the weights determined by the brightness change and diffusion direction, as the nonlocal illumination coupling field.
[0010] Optionally, in step S2, the step of reversing the attribution of illuminance anomalies in the current image to the illumination zone causing the illuminance anomalies based on the nonlocal illumination coupling field specifically includes: Obtain the illuminance deviation distribution between the current image and the preset desired illuminance image; construct a mapping relationship from the lighting zone adjustment amount to the image illuminance change using the nonlocal illumination coupling field; decompose the illuminance deviation distribution into the abnormal contribution amount of each lighting zone by solving the inverse problem under this mapping relationship; and determine the lighting zone whose abnormal contribution amount exceeds the preset threshold as the lighting zone that causes the illuminance abnormality.
[0011] Optionally, the generation of the compensated reachability field includes: The direct illumination effect component of each illumination zone on its corresponding imaging area and the nonlocal crosstalk effect component on the remaining imaging areas are separated from the nonlocal illumination coupling field. Based on the linear superposition constraint relationship between the direct illumination effect component and the nonlocal crosstalk effect component, an accessibility analysis model for image illuminance compensation by illumination zone adjustment is established. The accessibility analysis model is used to determine the set of illuminance anomaly modes that can be fully compensated by adjusting the illumination zones and the set of residual modes that cannot be fully compensated, and a compensation accessibility field indexed by the image area location is generated.
[0012] Optionally, the field value of the compensation accessibility field represents the degree to which the illuminance anomaly at the corresponding location can be compensated through lighting zoning.
[0013] Optionally, adjusting each lighting zone according to the compensated accessibility field specifically includes: Extract the fully compensable illuminance anomalous mode components defined by the compensateable accessibility location from the illuminance deviation distribution of the current image. With the goal of minimizing the anomalous mode components, solve the outgoing light intensity adjustment amount of each illumination zone under the illumination-imaging mapping relationship determined by the non-local illumination coupling location, and control the luminous intensity of each illumination zone in the controllable light source according to the adjustment amount.
[0014] Optionally, the step of performing limited enhancement on the adjusted image to obtain the enhanced image specifically includes: After the lighting zoning adjustment is completed, the adjusted image is acquired, and the residual illuminance deviation between the adjusted image and the desired illuminance image is calculated. Based on the residual mode set in the compensation accessibility field, the residual illuminance deviation is decomposed into an allowable enhancement component and a suppression component to generate a spatially adaptive enhancement gain field.
[0015] Optionally, the gain value in the enhanced gain field is allowed to be enhanced in the region where the field value of the compensation reachability field is lower than a preset threshold, and is suppressed in the region where the field value is higher than the preset threshold; the enhanced gain field is used to perform pixel brightness correction on the adjusted image to obtain the enhanced image.
[0016] The beneficial effects of this invention are: This invention, while maintaining a stable overall scene illuminance, sequentially migrates the illumination suppression window across lighting zones, constructing a nonlocal illumination coupling field based on the image response position, brightness change, and response diffusion direction generated during each suppression process. This method actively reveals long-distance illumination crosstalk caused by lens stray light, transparent cover reflections, indirect object reflections, and highly reflective surfaces, avoiding the simplistic attribution of brighter or darker areas in the image to their geometrically corresponding light sources. By inversely decomposing the anomalous contributions of each lighting zone based on the nonlocal illumination coupling field, the true lighting zone causing illuminance anomalies can be traced, improving the accuracy of anomaly attribution and reducing anomalous expansion, local overcompensation, and repeated brightness fluctuations across multiple lighting zones caused by incorrect adjustment of corresponding light sources.
[0017] This invention performs accessibility analysis on the direct illumination effect and non-local crosstalk effect of each lighting zone as mutually constrained responses under the same adjustment amount. It uses a compensation accessibility field to distinguish between illuminance anomalies that can be eliminated by physical dimming and residual anomalies that cannot be completely eliminated due to limitations imposed by adjustment boundaries, response correlation, and non-local crosstalk. Based on this, constrained zone dimming is first applied to fully compensable illuminance anomaly modes. Then, a spatially adaptive enhancement gain field is generated only for residual modes that persist after dimming and have low compensation accessibility. This expands the scope of physical illumination compensation and digital image enhancement, avoids redundant processing of the same anomaly, reduces the risk of over-enhancement, dark area noise amplification, bright area saturation, and color distortion, and improves the illuminance uniformity, detail discernibility, and visual stability of the enhanced image. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only for this invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of the method flow according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the method flow of S3 in an embodiment of the present invention. Detailed Implementation
[0020] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments. For some well-known technologies, those skilled in the art may also use other alternative methods to implement the invention. Moreover, the accompanying drawings are only for more specific description of the embodiments and are not intended to specifically limit the present invention.
[0021] Traditional illumination compensation methods mostly work by directly mapping and enhancing the corresponding light source to areas of darker image regions. This invention, however, reverse-tracks the actual lighting zones causing illumination anomalies. It employs a migrating illumination suppression window to actively detect long-distance crosstalk caused by lens stray light, reflections from transparent covers, indirect reflections from objects, and highly reflective surfaces, while maintaining overall stable illumination. By using a compensation accessibility field, it determines whether a particular illumination anomaly can be eliminated through physical dimming, preventing repeated brightness fluctuations between different lighting zones due to crosstalk. Limited enhancement is applied only to remaining illumination anomalies that cannot be eliminated by physical dimming, thus clearly defining the roles of physical illumination compensation and digital image enhancement.
[0022] like Figures 1-2 As shown, the adaptive illumination compensation and image enhancement method based on the vision system includes the following steps: S1. While maintaining the overall scene illumination stability, the illumination suppression windows in the controllable light source are sequentially migrated across the illumination zones. Based on the image response position and response diffusion direction caused by each illumination suppression window, a nonlocal illumination coupling field is generated that represents the light propagation relationship between the illumination zone and the non-corresponding imaging area.
[0023] S11. Divide the lighting zones and establish light source control benchmarks.
[0024] Controllable light sources are classified according to their independent driving channels, spatial light output range, and rated emitted luminous flux. Each of the illumination zones, whose emitted light intensity can be adjusted individually, is denoted as: ; in, A set of lighting zones representing controllable light sources; Indicates the first One lighting zone; Indicates the lighting zone number; This indicates the total number of lighting zones.
[0025] Each lighting zone is configured with an independent constant current drive channel or pulse width modulation drive channel; the lighting zone can be an arc-shaped light-emitting unit in a ring light source, a rectangular light-emitting unit in an area array light source, or a group of light-emitting devices composed of multiple light-emitting devices with the same illumination direction.
[0026] After the controllable light source is installed, the emitted luminous flux of each lighting zone is measured under different drive control values. Within the linear operating range of the drive control values, the emitted luminous flux of each lighting zone is expressed as: ; in, Indicates the first The current luminous flux emitted by each lighting zone; Indicates the first Luminous flux control slope for each lighting zone; Indicates the first Drive control quantities for each lighting zone; This indicates the luminous flux bias formed by the drive bias, ambient background light, or measurement zero-point offset when the drive control quantity is zero.
[0027] Under conditions of darkness or stable ambient light, at least five equally spaced drive control variables are set for each lighting zone. The corresponding emitted luminous flux is measured using a luminous flux meter, and the result is obtained using least-squares linear fitting. and The interval with a coefficient of determination of not less than 0.98 is determined as the linear working interval of the lighting zone.
[0028] If the entire driving range cannot meet the aforementioned linearity requirement, then only the continuous interval that meets the requirement is selected as the working interval of the subsequent illumination suppression window.
[0029] Total outgoing luminous flux of all lighting zones without the application of light suppression windows , represented as: ; The initial emitted luminous flux of each lighting zone is set to 50% to 70% of its maximum available emitted luminous flux, and in this embodiment it is set to 60%. This setting ensures the basic lighting intensity while reserving at least 30% adjustment margin for other lighting zones to simultaneously increase the emitted luminous intensity, thus avoiding drive saturation when migrating the illumination suppression window.
[0030] While dividing the illumination zones, the corresponding imaging region for each zone is determined. Specifically, during the system installation and calibration phase, each illumination zone can be illuminated individually, its direct illumination response image can be acquired, and the full width at half maximum (FWHM) of its main lobe can be defined as the corresponding imaging region for that illumination zone. , represented as: ; in, Indicates the pixel position in the image; Indicates the complete imaging range; This indicates that the first light is illuminated individually during the calibration phase. Pixel position in each lighting zone Linear brightness response; This represents the maximum value of the linear brightness response.
[0031] The aforementioned value of 0.5 corresponds to the full width at half maximum (FWHM) boundary of the optical main lobe, used to distinguish between the direct illumination main lobe and the indirect response outside the main lobe. For illumination systems with a clear mechanical installation relationship, the design projection range of the illumination zone can also be directly determined as the corresponding imaging area. This calibration is only used to distinguish between the corresponding imaging area and the non-corresponding imaging area and does not participate in the calculation of the nonlocal illumination coupling weight.
[0032] During subsequent data acquisition, the camera position, focal length, aperture, exposure time, analog gain, white balance, and gamma parameters were fixed, and automatic exposure, automatic gain, and automatic white balance were turned off so that changes in image brightness could reflect changes in lighting rather than the result of automatic camera adjustment.
[0033] S12, Move the illumination suppression window and acquire images before and after.
[0034] Light suppression windows are applied sequentially to each lighting zone according to their zone numbers. A light suppression window is not a necessary limitation of a physical blocking element, but rather a control window that reduces the emitted light intensity of the current lighting zone for a specified period of time.
[0035] When the light suppression window shifts to the [number]th When there are multiple lighting zones, the luminous flux suppression for that lighting zone is: ; in, Indicates the first The reduced luminous flux of each lighting zone due to the application of light suppression windows; Indicates the first The light suppression ratio of each lighting zone.
[0036] The light suppression ratio is 10%, that is This ratio allows the differential response to be significantly higher than the camera noise level without causing drastic changes to the overall lighting structure of the scene. For systems with insufficient adjustment margin, the lighting suppression ratio is expressed as: ; in, Indicates except the first The total luminous flux boost margin that can be provided by the remaining lighting zones outside of the main lighting zone; the coefficient 0.8 indicates that only 80% of the available boost margin is used, and the remaining 20% is used to absorb light source temperature drift, drive error and calibration error.
[0037] The total luminous flux enhancement margin is: ; in, Indicates the sequence number of the lighting zone other than the currently suppressed lighting zone; express The maximum luminous flux that each lighting zone is allowed to achieve within its linear operating range.
[0038] When the When the luminous flux emitted from one lighting zone decreases, the reduced luminous flux is distributed according to the remaining boost capacity of the other lighting zones: ; in, This indicates that the light suppression window is located at the first... When assigning the first lighting zone... Increase in luminous flux for each lighting zone; This represents the lighting partition index used to perform the summation.
[0039] As long as each lighting zone retains a positive boost margin, the above allocation method will simultaneously increase the emitted light intensity of all other lighting zones, and satisfy the following: ; Total outgoing luminous flux after applying an illumination suppression window , represented as: ; in, This indicates that the light suppression window is located at the first... The total outgoing luminous flux of all lighting zones when there are 1 lighting zone.
[0040] Based on the luminous flux control slope obtained in S11, the luminous flux reduction and luminous flux increase are converted into drive control quantities respectively: ; in, Indicates the first time after applying the light suppression window Drive control quantities for each lighting zone; This indicates that the light suppression window is located at the first... When the lighting zone is the first The increased drive control quantity for each lighting zone; Indicates the first The reference drive control quantity for each lighting zone.
[0041] Before applying each illumination suppression window, all illumination zones are restored to the baseline drive control value. After the light source output stabilizes, the image before application is acquired. Then, the emitted light intensity of the current illumination zone is reduced while the emitted light intensity of the remaining illumination zones is increased simultaneously. After the light source and camera response stabilize, the image after application is acquired.
[0042] The stabilization waiting time is determined by the time required for the light source drive output to reach the target value and remain stable, and can be set to three times the light source response time; for LED light sources with a response time of no more than 20ms, 60ms is used. The acquisition time should avoid the PWM switching edge; when using PWM drive, the camera exposure time should be set to an integer multiple of the PWM period to avoid stripes and phase differences.
[0043] The actual total emitted luminous flux during the migration process is monitored using a luminous flux meter; when the deviation from the reference total emitted luminous flux satisfies the following formula, the corresponding image is retained: ; in, This indicates that the light suppression window is located at the first... The actual total emitted luminous flux measured in each lighting zone; This indicates the relative deviation of the allowable total luminous flux.
[0044] The permissible relative deviation of the total luminous flux is taken as the larger of three times the relative measurement uncertainty of the luminous flux meter and 0.5%. For luminous flux meters with a relative measurement uncertainty of no more than 0.1%, take... A threefold measurement uncertainty is used to avoid misinterpreting normal measurement fluctuations as luminous flux instability; a lower limit of 0.5% is used to ensure that changes in total illuminance are insufficient to mask the spatial light propagation response. If this deviation is exceeded, the drive control values for other lighting zones are revised and data is collected again.
[0045] S13. Calculate the difference image and determine the image response location and response diffusion direction.
[0046] Perform black level correction and linearization on the raw image output from the camera. When the camera output is an RGB image, convert it to a linear luminance image according to the following formula: ; in, Indicates pixel position The linear brightness value; , and These represent the red, green, and blue channel values after black level correction and linearization, respectively; 0.2126, 0.7152, and 0.0722 are the standard weighting coefficients for linear RGB conversion to the luminance component. For monochrome cameras, the single-channel linear grayscale value is directly used as the linear luminance value.
[0047] Regarding the first For each illumination zone, the image after applying the illumination suppression window is subtracted from the image before application to obtain a signed difference image: ; in, Indicates the first The signed difference values corresponding to each lighting zone; This represents the linear brightness value of the image acquired after applying an illumination suppression window; This represents the linear brightness value of the image acquired in front of the illumination suppression window.
[0048] A negative difference value indicates that the brightness of the pixel location decreases as the current illumination zone is suppressed; a positive difference value indicates that the brightness of the pixel location increases due to compensation enhancement from other illumination zones or non-local light propagation. Retaining the positive and negative signs of the difference values allows for the differentiation between suppression and enhancement effects in subsequent steps.
[0049] The absolute value of the signed difference image is used to determine the pixel brightness change value: ; in, Indicates the first The pixel brightness change value caused by each lighting zone.
[0050] To suppress single-pixel readout noise, a 3×3 median filter is performed on the pixel brightness variation value: ; in, This represents the pixel brightness change value after median filtering; This represents the two-dimensional neighborhood offset relative to the current pixel; This represents the median function that selects the median value after sorting the values of nine neighboring pixels.
[0051] This neighborhood can remove single-pixel and dual-pixel impulse noise without significantly altering the true illumination response structure with a width greater than three pixels. Therefore, a 3×3 neighborhood is used. The specific scheme for this median function is as follows: sequentially read the brightness change values of the current pixel and its eight neighboring pixels, sort them in ascending order, and replace the brightness change value of the current pixel with the fifth value after sorting.
[0052] Before implementing the illumination suppression window shift, 20 reference images were continuously acquired while keeping the light source driving control constant. The system noise was estimated using the difference between adjacent reference images. ; in, The robust noise standard deviation representing the difference between two image frames; Indicates the first Frame reference image and the first Frame reference image at pixel position Difference in brightness; The coefficient 1.4826 is used to convert the median absolute deviation under Gaussian noise conditions into standard deviation.
[0053] Preset threshold used to determine valid image responses It is determined to be: ; in, This represents the average linear brightness value of all valid pixels in the reference image.
[0054] in, This is used to reduce the probability of Gaussian noise being misjudged as a valid response to the order of one in a million; This is used to avoid misinterpreting quantization errors, slight temperature drift, or minute scene fluctuations as light propagation responses under extremely low noise conditions. Instead of using a fixed grayscale value over a long period, this threshold is recalculated each time the system is started or camera exposure parameters are changed.
[0055] No. Image response location corresponding to each lighting zone The set is: ; in, Indicates the first All valid image response locations caused by each lighting zone.
[0056] The Scharr spatial gradient operator is used to calculate the horizontal and vertical gradients of pixel brightness changes within the neighborhood of the image response location: ; in, and These represent the horizontal gradient plot and the vertical gradient plot, respectively. Represents a two-dimensional convolution operation; and These represent the horizontal and vertical Scharr convolution kernels, respectively.
[0057] The convolution kernel is: ; Fixed convolution kernels do not include coefficients that need to be trained or adjusted. Compared with ordinary difference operators, they have better rotational symmetry and can reduce the deviation in response diffusion direction caused by different pixel arrangement directions.
[0058] The direction of diffusion of the brightness response from high response positions to low response positions is represented as follows: ; in, Indicates pixel position The response diffusion direction vector; superscript Indicates vector transpose; This represents a numerically stable term to prevent the denominator from being zero, taken from an image normalized to 0-1. .
[0059] The negative sign causes the direction vector to point from the position with a larger change in brightness to the position with a smaller change in brightness, thus aligning with the physical direction of the illumination response spreading outward from the center of the response.
[0060] When the local gradient is zero, the response diffusion direction vector is zero. This location only participates in the calculation of brightness change and does not contribute to the direction.
[0061] S14. Construct a nonlocal illumination coupling matrix.
[0062] The complete imaging range is divided into M non-overlapping imaging regions: ; in, Indicates the first One imaging region; and Indicates the imaging region number; This indicates the total number of imaging areas.
[0063] The imaging region can be divided according to the spatial resolution required for subsequent illumination adjustment. This invention divides the short side of the image into 32 equal segments and constructs a rectangular grid using the same pixel side length; portions of the edge that are less than a complete grid are incorporated into adjacent grids. 32 segments are used because they allow the side length of a single imaging region to be significantly greater than the 3×3 gradient neighborhood, while preserving sufficient spatial resolution.
[0064] For stationary equipment, this division remains unchanged after system calibration.
[0065] Calculate the corresponding imaging regions and the geometric center of each imaging region: ; in, Indicates the first Each illumination zone corresponds to the geometric center of the imaging area; Indicates the first The geometric center of each imaging region; Indicates pixel position Two-dimensional coordinate vector; and These represent the number of pixels included in the corresponding region.
[0066] The spatial direction from the corresponding imaging region to the non-corresponding imaging region is: ; in, Indicates by the first The corresponding imaging area of the illumination zone points to the first... Unit direction vector of each imaging region; This represents the Euclidean norm.
[0067] If the center of a certain imaging region falls into Then the imaging region is defined as the first... The corresponding output nodes for each illumination zone are defined; the remaining imaging areas are defined as non-corresponding output nodes. Therefore, there is no need to set a separate region overlap rate threshold.
[0068] For any non-corresponding output node, its nonlocal illumination coupling weight is expressed as: ; in, Indicates the first The lighting zone and the first Nonlocal illumination coupling weights between non-corresponding imaging regions.
[0069] in, This preserves the positive and negative attributes of the response in the coupling weights. Used to eliminate amplitude differences caused by varying suppression levels in different lighting zones; Used to eliminate scale differences caused by varying pixel counts in different imaging regions; orientation factor The value range is 0 to 2.
[0070] The orientation factor increases when the direction of local response diffusion is consistent with the direction from the corresponding imaging region to the current imaging region; when the directions are opposite, the orientation factor decreases.
[0071] This orientation factor is directly constructed from the dot product of unit vectors, without including weight coefficients that need to be set manually, thus avoiding the generation of additional empirical parameters between the brightness change weight and the diffusion direction weight.
[0072] when When empty, Set to zero; when the first When an imaging region belongs to the corresponding imaging region of the i-th illumination zone, the same applies. Set to zero so that the matrix only represents the nonlocal light propagation relationship between the illumination zone and the non-corresponding imaging region.
[0073] By combining the coupling weights of all lighting zones, a nonlocal illumination coupling matrix is constructed: ; in, This represents a nonlocal illumination coupling matrix; each row in the matrix corresponds to an illumination zone input node, and each column corresponds to an imaging region output node.
[0074] The spatial relationships between the nonlocal illumination coupling matrix, the input nodes of the illumination partition, and the output nodes of the imaging region are collectively considered as the nonlocal illumination coupling field. When a matrix element is negative, it indicates that suppressing the corresponding illumination partition will reduce the brightness of the non-corresponding imaging region; when a matrix element is positive, it indicates that the luminous flux redistribution associated with the migrating illumination suppression window will increase the brightness of the non-corresponding imaging region; the larger the absolute value of the matrix element, the stronger the corresponding nonlocal light propagation or illumination crosstalk effect.
[0075] Conventional light source calibration typically alters the output intensity of each light source individually, easily misinterpreting the global response resulting from overall scene brightening or darkening as a direct correspondence between the light source and the image region. By suppressing one illumination zone while simultaneously boosting the others, the total outgoing luminous flux remains constant. Therefore, the differential image primarily reflects lens stray light, reflections from transparent covers, indirect reflections from objects, and long-distance propagation from highly reflective surfaces caused by changes in the spatial distribution of luminous flux. Furthermore, by incorporating the brightness change and the response diffusion direction into the coupling weights, it can distinguish local noise that only exhibits brightness changes but has inconsistent diffusion directions, improving the spatial directivity and repeatability of nonlocal light propagation relationships.
[0076] The resulting nonlocal illumination coupling field can be directly used as input for the S2 reverse attribution illuminance anomaly and the generation of the compensated reachability field.
[0077] S2. Based on the nonlocal illumination coupling field, the illuminance anomalies in the current image are reversed and attributed to the illumination zones that caused the illuminance anomalies. Based on the constraint relationship between the direct illumination effect and the nonlocal crosstalk effect of each illumination zone, a compensation accessibility field is generated.
[0078] S21. Obtain the illumination deviation distribution of the current image.
[0079] Under the conditions of maintaining the same camera position, focal length, aperture, exposure time, analog gain, white balance, and gamma parameters as S1, the current image is acquired, and converted into a current linear brightness image according to the black level correction, linearization, and brightness conversion method used in S1. When the scene being detected is in a normal state, all lighting zones are functioning normally, and the overall scene illuminance is stable, 30 consecutive reference images are acquired. Pixel registration and linearization are performed on each reference image, and the median of the same pixel position in the 30 reference images is taken to obtain the preset desired illuminance image. ; in, This indicates the pixel location of the image with the preset desired illumination. The expected linear brightness value; Indicates the first Frame reference image at pixel position The linear brightness value; Indicates the reference image number; Represents the total number of reference images, taking Under fixed camera conditions, 30 frames of data are sufficient to estimate camera random noise and short-term light source fluctuations without significantly increasing calibration time; median calculation can eliminate outliers caused by individual moving objects, impulse noise, and instantaneous reflections. If the maximum deviation of the overall average brightness of the 30 reference images exceeds 1%, the overall scene illumination is considered unstable during the reference acquisition period, and the set of reference images is discarded and reacquired.
[0080] Based on the imaging regions divided by S1, calculate the average linear brightness of the current image and the image with the preset desired illumination in each imaging region: ; in, Indicates the current image is in the [number]th position. Average linear brightness within each imaging region; Indicates the first The expected average linear brightness of each imaging region; Indicates the current pixel position of the image. The linear brightness value.
[0081] No. The illuminance deviation of each imaging region is: ; in, Indicates the first Illuminance deviation in each imaging region; when When, it indicates that the imaging area is brighter than the desired state; when When the time is right, it indicates that the imaging area is darker than the desired state.
[0082] Arrange the illuminance deviations of all imaging regions according to the imaging region number to obtain the illuminance deviation distribution vector: ; in, This represents the illuminance deviation distribution vector of the current image.
[0083] Using reference images acquired when constructing the preset desired illumination image, calculate the standard deviation of normal brightness fluctuations in each imaging region: ; in, Indicates the first Standard deviation of brightness fluctuation in each imaging region under normal conditions; and They represent the first Frame and the Frame reference image in the Average linear brightness within each imaging region; The index of the reference image used to calculate the median is indicated; the coefficient 1.4826 is used to convert the absolute deviation of the median to the standard deviation under Gaussian noise conditions.
[0084] S22. Solve in reverse the anomaly contribution of each lighting zone.
[0085] Based on the nonlocal illumination coupling field obtained from S1, a mapping matrix is constructed between the equivalent adjustment amount of the illumination zone and the illuminance change amount of each imaging region: ; in, Represents the lighting adjustment mapping matrix; Indicates the first When a lighting zone produces a unit equivalent adjustment, the first... The linear brightness change of each imaging region.
[0086] The illumination suppression window in S1 represents a coordinated adjustment mode that suppresses the current illumination zone and compensates for the luminous flux of the remaining illumination zones. To ensure that the positive adjustment value in the mapping matrix represents the adjustment direction opposite to that of the illumination suppression window, the signed region response coefficients measured in S1 are inverted and used as... .
[0087] Therefore, each column of the mapping matrix represents the complete illuminance variation pattern produced for all imaging areas when the illumination zone is the main adjustment target.
[0088] The equivalent anomaly of lighting zones and the illuminance deviation distribution satisfy the following: ; in, Represents the equivalent anomaly vector for lighting zones; This represents the error vector caused by camera noise, minor scene changes, and errors not explained by the nonlocal illumination coupling field.
[0089] Constructing the regional reliability weight matrix , represented as: ; in, This indicates that a diagonal matrix is constructed using the elements within the brackets as the main diagonal elements. Indicates the first Reliability weights for each imaging region; This represents a numerically stable quantity that prevents the standard deviation of normal brightness fluctuations from being zero. It is taken as 0 when the linear brightness is normalized to the range of 1. .
[0090] The greater the normal brightness fluctuation, the lower the weight of the imaging area, so as to avoid the excessive influence of high reflectivity dynamic areas or areas with large noise on the inverse attribution results.
[0091] By solving the inverse problem with sparse and stable constraints, the equivalent anomaly quantities for each lighting zone are obtained: ; in, This represents the equivalent anomaly quantity of the lighting zone obtained from the solution; and These represent the minimum and maximum equivalent anomalies allowed for each lighting zone, respectively. Indicates the sparse constraint coefficient; Indicates the stability constraint coefficient; The first norm of a vector; The L2 norm of a vector.
[0092] The upper and lower limits of abnormal quantities for each lighting zone are determined based on its physical adjustment range. The lower limit of each lighting zone is the difference between the minimum available luminous flux and the current luminous flux of that lighting zone, and the upper limit is the difference between the maximum available luminous flux and the current luminous flux.
[0093] The sparsity constraint coefficients are determined by inversely solving the noise-dependent quantities at the input under normal conditions: ; in, This represents the 99th percentile of the sample set; Indicates the first The region brightness deviation vector of the frame reference image relative to the preset desired illumination image; This represents the maximum absolute value of the vector elements.
[0094] This value ensures that 99% of normal illuminance fluctuations cannot individually activate anomalies in a specific lighting zone. If the calculation result is zero, then take... This is to avoid completely eliminating sparse constraints.
[0095] The stability constraint coefficients are set as follows: ; in, The largest eigenvalue of the matrix. Coefficients. By making the stability constraint only 0.1% of the maximum curvature of the mapping matrix, the severe fluctuations in the inverse solution caused by highly similar lighting zone responses can be suppressed without significantly weakening the reconstruction accuracy of the illuminance deviation.
[0096] The above inverse problem is solved using an iterative soft thresholding method, and the soft thresholding function is: ; in, Indicates the input value The result after performing soft thresholding; Indicates a soft threshold; Represents a symbolic function.
[0097] The equivalent outliers for the lighting zones are initialized to zero. Each component is updated according to the gradient descent direction, followed by soft thresholding, and the results are truncated to the corresponding upper and lower limits of the outliers. The iteration step size is: ; in, This represents the iteration step size of the reverse problem; This represents the spectral norm of the weighted mapping matrix.
[0098] When the relative change between two consecutive iterations does not exceed The iteration stops when the condition is met; if the condition is not met, a maximum of 200 iterations are performed. This is used to stabilize the abnormal contribution of lighting zones to the order of one ten-thousandth on the normalized luminance scale, and 200 is the maximum number of iterations to balance real-time performance and convergence.
[0099] No. The abnormal contribution vectors and abnormal contribution amounts of each lighting zone to the current illuminance deviation are as follows: ; in, Indicates the first The region anomaly contribution vector generated by each lighting zone; Represents the first of the mapping matrix List; Indicates the first Equivalent anomalies in each lighting zone; Indicates the first Abnormal contribution of each lighting zone.
[0100] Set an abnormal contribution judgment threshold for each lighting zone. , represented as: ; in, Indicates the first When using the normal reference image as the current image for inverse solving, the first frame... The abnormal contribution amount generated by each lighting zone.
[0101] The 99th percentile is used to exclude spurious attributions caused by normal noise; 10% of the current illuminance deviation weighted amplitude is used to prevent lighting zones with minimal contributions from being identified as sources of anomalies. Lighting zones that satisfy the following formula are identified as causing current illuminance anomalies: ; in, This represents the set of lighting zone numbers that caused the current illuminance anomaly.
[0102] S23. Separate the direct illumination component and the non-local crosstalk component.
[0103] Based on the imaging area corresponding to the illumination partition determined by S1, construct a direct correspondence mask: ; in, Indicates the first The lighting zone and the first Direct correspondence markers between imaging regions; Indicates the first The geometric center of each imaging region is selected. The value is 1 if the geometric center of the imaging region is located within the corresponding imaging region, and 0 otherwise.
[0104] Using the direct correspondence mask, the illumination modulation mapping matrix is decomposed into a direct illumination effect matrix and a nonlocal crosstalk effect matrix: ; in, Indicates the first The lighting zone for the first Direct illumination coefficient for each imaging region; Indicates the first The lighting zone for the first The nonlocal crosstalk coefficient of each imaging region.
[0105] Arrange all direct illumination action coefficients and nonlocal crosstalk action coefficients into matrices: ; in, Represents the direct illumination effect matrix; This represents the nonlocal crosstalk effect matrix.
[0106] The image illuminance change generated by any illumination zone adjustment vector is: ; in, This represents a vector indicating the change in image region brightness caused by illumination zone adjustment. This represents the vector of lighting zone adjustment amounts.
[0107] The above expression shows that the same lighting zone adjustment value simultaneously determines its direct lighting effect and non-local crosstalk effect, and the two cannot be adjusted independently.
[0108] For example, when a certain illumination zone is enhanced to compensate for the dark anomaly of its corresponding imaging area, the stray light or reflection effect of that illumination zone on the distant imaging area will also be enhanced simultaneously; this linear superposition relationship is the constraint relationship between direct illumination effect and non-local crosstalk effect.
[0109] S24. Establish an accessibility analysis model and decompose compensable patterns and residual patterns.
[0110] Based on the current emitted luminous flux and allowable adjustment range of each lighting zone, construct a physically feasible adjustment set: ; in, This represents the set of physically feasible adjustments for lighting zones; and They represent the first The minimum and maximum allowable adjustment amounts for each lighting zone relative to the current operating point are determined; the optimal physical compensation adjustment amount for the current illuminance deviation is determined by solving the following weighted least squares problem with boundary constraints. , represented as: ; in, The stability coefficients obtained through compensation are expressed as: ; coefficient The stabilizing term is set to only 0.01% of the maximum curvature of the mapping matrix. This is used to select the solution with the smaller total adjustment amount when there are multiple approximately equivalent compensation solutions, while avoiding a significant reduction in compensation accuracy.
[0111] The above problem is solved using the projection gradient method, and the iterative update process is as follows: ; in, Indicates the iteration number; Indicates the first The lighting zone adjustment amount in the next iteration; This represents the projection function that truncates each adjustment value to its corresponding upper and lower limits. This indicates the step size for the compensation solution.
[0112] The compensation solution step size is: ; Using this step size enables the projection gradient iteration to converge stably under the quadratic objective function.
[0113] The specific scheme for the projection function is as follows: when a component is less than the corresponding lower limit, that component is set to the corresponding lower limit; when a component is greater than the corresponding upper limit, that component is set to the corresponding upper limit; the remaining components remain unchanged. The relative change between two adjacent iterations does not exceed... The iteration stops when the time is right, and the maximum number of iterations is 500. The adjustment boundary of the compensation solution is more than that of the reverse attribution problem, so the maximum number of iterations is set to 500.
[0114] The residual illuminance anomaly after optimal physical compensation is: ; in, This represents the residual illuminance anomaly vector that cannot be completely eliminated by the current optimal lighting zone adjustment; its first... Each component is denoted as .
[0115] No. Acceptable residual threshold for each imaging region , represented as: ; in, Used to eliminate camera noise and normal fluctuations in light source; This indicates that a small deviation of no more than 1% of the desired brightness is allowed; the larger of the two values can avoid setting overly strict thresholds for low-noise areas and also avoid making meaningless frequent adjustments for high-noise areas.
[0116] A set of illuminance anomalies that can be fully compensated by zonal lighting adjustment , represented as: ; in, Indicates existence; This means that the condition holds true for the entire imaging region.
[0117] The set of residual patterns that cannot be fully compensated , represented as: ; S25, Generate a compensated reachability field.
[0118] Based on the current illuminance deviation and the residual illuminance anomaly after optimal physical compensation, the compensated accessibility field value for each imaging region is calculated according to the following two cases: ; in, Indicates the first Compensation reachability field value for each imaging region This indicates that the input value will be displayed. A cutoff function limited to the range of 0 to 1; the specific scheme is as follows: when the input value is less than 0, output 0; when the input value is greater than 1, output 1; when the input value is between 0 and 1, output the input value itself. When the current illumination deviation of a certain imaging area is already within the acceptable residual threshold, no compensation is required, so its compensation reachability field value is set to 1.
[0119] By combining the location of each imaging region with its corresponding compensated accessibility field value, the compensated accessibility field is obtained: ; in, This represents the compensated reachability field indexed by the location of the image region.
[0120] when When the value is close to 1, it indicates that the illuminance anomaly at that location can be primarily eliminated through lighting zone adjustment; when... When the value is close to 0, it indicates that the illuminance anomaly at this location is difficult to eliminate by physical dimming due to limitations imposed by adjustment boundaries, non-local crosstalk, or lighting zone response correlation.
[0121] Traditional methods typically adjust the light source geometrically corresponding to a given image region based on whether that region is too bright or too dark. This approach fails to consider that adjusting the same light source can simultaneously generate both direct illumination and long-distance nonlocal crosstalk. Our approach first uses a nonlocal illumination coupling field to decompose the anomalous contributions of each illumination zone. Then, we perform reachability analysis on the direct illumination effect and the nonlocal crosstalk effect as an inseparable linear superposition response under the same adjustment amount. Therefore, only when the direct compensation benefit outweighs the nonlocal crosstalk cost and the physical adjustment boundary is met is the relevant anomaly considered acceptable for physical dimming compensation. This reduces the repeated brightness fluctuations of multiple illumination zones due to mutual crosstalk and provides a quantitative basis for S3 to distinguish between physical compensation and digital image enhancement.
[0122] S3. Adjust each lighting zone according to the compensation accessibility field, and use the residual illuminance anomalies in the compensation accessibility field that cannot be eliminated by adjusting the lighting zones to perform limited enhancement on the adjusted image to obtain the enhanced image.
[0123] S31. Extract the fully compensable illuminance anomalous mode components and adjust each lighting zone.
[0124] Based on the compensation accessibility field value obtained from S2, the illuminance deviation of the current image, and the acceptable residual threshold of each imaging region, the imaging regions participating in physical dimming compensation are determined: ; in, Indicates the first Physical compensation selection markers for each imaging region; This represents the threshold for determining the accessibility of compensation.
[0125] The threshold for determining the accessibility of compensation is set to 0.8, i.e. Since the larger the compensation accessibility field value in S2, the higher the feasibility of eliminating illuminance anomalies through physical dimming, a value of 0.8 indicates that only imaging areas that are expected to eliminate more than 80% of the effective deviation are included in the main physical compensation range.
[0126] During the system installation and calibration phase, known illuminance anomalies can be generated using the illumination suppression window of S1. Test samples are formed with suppression ratios of 5%, 7.5%, and 10%, respectively. The compensation solution of S2 is then performed, and the compensation accessibility field value corresponding to the samples whose residual after compensation does not exceed the corresponding acceptable residual threshold is statistically analyzed. The 5th percentile of the field value is limited to the range of 0.7 to 0.9 as the actual compensation accessibility judgment threshold. The 5th percentile ensures that at least 95% of the successfully compensated samples meet the selected threshold; the 0.7 to 0.9 limit is used to avoid introducing crosstalk regions due to an excessively low threshold, or missing physically compensateable regions due to an excessively high threshold; 0.8 is used when calibration is not implemented.
[0127] Based on the physical compensation selection markers, extract fully compensable illuminance anomalous mode components from the illuminance deviation distribution of the current image: ; in, Indicates the first Illumination anomalies within an imaging region that are included in the physical dimming processing range.
[0128] Arrange the physical dimming components of the entire imaging area into a vector: ; in, This indicates that the illuminance aberration mode components can be fully compensated.
[0129] Under the lighting regulation mapping relationship and physically feasible regulation set established in S2, with the goal of minimizing the fully compensable illuminance anomalous mode components, the lighting zone regulation is solved: ; in, This represents the physical adjustment amount of the lighting zone obtained by S3.
[0130] In the objective function described above, for the imaging area selected as the object of physical compensation, the goal is to make the adjusted illuminance deviation approach zero; for the unselected imaging areas, the objective component is zero, so the brightness changes generated by the illumination adjustment mapping matrix in these areas will also be suppressed by the objective function. This prevents the generation of new and significant illuminance anomalies in other areas in order to compensate for one area.
[0131] The above optimization problem is solved using the S2 projection gradient method. The adjustment amount is initialized to zero, and the compensation solution step size determined by S2 is used to update it successively. After each update, the adjustment amount is projected onto the physically feasible adjustment set. The optimization is performed when the relative change between two adjacent adjustment amounts does not exceed... The calculation stops when the time is right, and a maximum of 500 iterations are performed.
[0132] To ensure that the actual dimming process remains within the linear response range obtained from the S1 calibration, the amount of luminous flux adjustment sent to the lighting zone each time is limited: ; in, This indicates that the control cycle was actually issued up to the [number]th [number]. The amount of luminous flux adjustment for each lighting zone; The first physical adjustment vector represents the... Each component.
[0133] The single adjustment amplitude is set to 5% of the maximum available emitted light flux because the preferred illumination suppression ratio adopted by S1 is 10%. Limiting the single closed-loop adjustment to half of the calibration disturbance amplitude can keep the actual response within the verified local linear range and reduce brightness abrupt changes and visual flicker. If the required adjustment exceeds this limit, it will be completed gradually through multiple control cycles.
[0134] Based on the luminous flux control slope obtained from S1, the outgoing luminous flux adjustment is converted into the driving control quantity for the illumination zone: ; in, This indicates that the control cycle has been issued up to the [number]th [number]. Control quantities for each lighting zone drive channel; This indicates the number before this adjustment. Drive control quantities for each lighting zone.
[0135] The drive control quantities for all lighting zones are synchronously sent to the controllable light sources; the waiting time is set to three times the light source response time to allow the luminous intensity of each lighting zone to reach a stable state. Subsequently, images are re-acquired and the illuminance deviation of the selected physical compensation area is calculated.
[0136] Physical dimming stops when the adjusted deviation of all selected physical compensation areas does not exceed the corresponding acceptable residual threshold; dimming also stops when the weighted illuminance deviation norm of two adjacent control cycles decreases by less than 1% to avoid repeated brightness increases and decreases under non-local crosstalk constraints; otherwise, the adjustment amount for the next cycle is recalculated and issued; a maximum of 10 control cycles are executed; a 1% stop ratio is used to determine that continued adjustment can no longer produce substantial improvement, and 10 cycles correspond to a maximum cumulative adjustment range of about 50% for a single lighting zone.
[0137] S32. Acquire the adjusted image and calculate the remaining illuminance deviation.
[0138] After completing the lighting zone adjustment and waiting for the light source output to stabilize, the adjusted image is acquired while keeping the camera parameters unchanged. The adjusted image is then subjected to the same black level correction, linearization, and brightness conversion as S1 to obtain the adjusted linear brightness image.
[0139] Pixel-level residual illuminance deviation of the adjusted image relative to the preset desired illuminance image , represented as: ; in, Indicates pixel position The residual illuminance deviation; Indicates the pixel position of the adjusted image. The linear brightness value.
[0140] The region-level residual illuminance deviation is obtained by averaging the pixel-level residual illuminance deviations in each imaging region: ; in, Indicates the first lighting zone adjustment is complete. Residual illuminance deviation in each imaging region.
[0141] To avoid digitally enhancing camera noise, quantization errors, and minor brightness deviations within acceptable limits, an acceptable residual threshold is subtracted from the area-level residual illuminance deviation: ; in, Indicates the first Each imaging region needs to be included in the effective residual illuminance bias for limited enhancement analysis.
[0142] When the absolute value of the residual illuminance deviation does not exceed the acceptable residual threshold, the effective residual illuminance deviation is zero, and no digital brightness correction is performed on the area; when it exceeds the threshold, only the portion exceeding the threshold is sent to the subsequent enhancement process.
[0143] S33, decomposes the allowable enhancing and inhibiting components and generates an enhanced gain field.
[0144] Based on the compensated accessibility field value and the compensated accessibility determination threshold, calculate the digital enhancement allowable weight for each imaging region: ; in, Indicates the first Digital enhancement weights are allowed for each imaging region.
[0145] When the compensation accessibility field value is zero, the digital enhancement allowable weight is 1, indicating that the anomalies in this area cannot be eliminated by physical dimming, and limited enhancement is allowed. When the compensation accessibility field value reaches or exceeds the compensation accessibility judgment threshold, the digital enhancement allowable weight is zero, indicating that this area should be mainly processed by physical dimming, and digital enhancement is suppressed. When the field value is between the two, the digital enhancement allowable weight transitions linearly to avoid abrupt boundaries between adjacent imaging areas.
[0146] Based on the digital enhancement allowable weight, the effective residual illuminance deviation is decomposed into allowable enhancement components and inhibition components: ; in, Indicates the first Each imaging region allows for correction of residual illuminance aberrations via digital image enhancement; express The residual illumination aberrations in the imaging area are suppressed and not completely eliminated by digital image enhancement.
[0147] The suppression component is retained in the adjusted image to prevent digital enhancement from altering the illuminance structure that can already be controlled by physical dimming, and also to prevent physical compensation and digital enhancement from repeatedly affecting the same anomalous condition.
[0148] Calculate the brightness enhancement gain for each imaging region based on the allowable enhancement components: ; in, Indicates the first Brightness enhancement gain for each imaging region; Indicates the adjusted image at the 1st... Average linear brightness within each imaging region; This represents a numerically stable quantity that prevents the average linear luminance from becoming zero. It is calculated by taking the linear luminance normalized to 0–1. ; Indicates the minimum allowable enhancement gain; Larger allowable gain enhancement.
[0149] When the residual illuminance deviation is negative, it means that the image is still too dark after adjustment, and the expression makes the gain greater than 1; when the residual illuminance deviation is positive, it means that the image is still too bright after adjustment, and the expression makes the gain less than 1.
[0150] set up , The two are reciprocals of each other, making the maximum brightness increase and maximum brightness decrease basically symmetrical on the exposure scale; limiting the single digital correction to the range of 0.8 to 1.25 can prevent the noise in the dark area from being excessively amplified and avoid grayscale compression after the bright area is greatly reduced.
[0151] For cameras with high noise, candidate gains of 1.05, 1.10, 1.15, 1.20 and 1.25 can be tested on a grayscale calibration board. The largest candidate value whose standard deviation of noise after correction does not exceed 1.2 times that before correction is selected as the maximum allowable enhancement gain. The minimum allowable enhancement gain is then set to the reciprocal of the maximum allowable enhancement gain. The 1.2-fold limit means that the allowable noise increase does not exceed 20%.
[0152] To avoid blocky brightness boundaries caused by directly assigning values based on the imaging area, the region-level brightness enhancement gain is interpolated to a pixel-level enhancement gain field: ; in, Indicates pixel position Pixel-level enhancement gain; Indicates pixel position The set of indices of the centers of the four nearest imaging regions; Indicates the first Adjacent imaging regions for pixel position Bilinear interpolation weights.
[0153] The specific execution process of the bilinear interpolation function is as follows: Based on the horizontal and vertical relative distances of the pixel position within the rectangle formed by the centers of four adjacent imaging regions, the horizontal and vertical weights are calculated respectively, and then multiplied together to obtain the corresponding bilinear interpolation weights; the sum of the four weights is normalized to 1. For pixels with fewer than four adjacent regions at the image edge, the gain of the nearest imaging region is copied before linear interpolation is performed.
[0154] The resulting pixel-level enhancement gain field allows for near-complete digital correction in regions with low compensation reachability field values, and gradually approaches 1 in regions with high compensation reachability field values, thus forming a spatially continuous limited enhancement range.
[0155] S34. Perform pixel brightness correction and output an enhanced image.
[0156] For color images, read the adjusted image at the pixel position. The values of each linear color channel are calculated, and the safety gain that the pixel can be used without channel saturation is calculated: ; in, Indicates pixel position Safety enhancement gains; Indicates the color channel number; Indicates the pixel position of the adjusted image. The Each linear color channel value.
[0157] When the pixel-level enhancement gain is less than or equal to 1, the above formula maintains the original gain; when the pixel-level enhancement gain is greater than 1 and may cause any color channel to exceed the normalization upper limit of 1, the above formula automatically reduces the gain so that the maximum color channel does not exceed 1. Using the same gain for all color channels can maintain the original pixel color ratio while correcting brightness.
[0158] Pixel brightness correction is performed on the adjusted image using safety enhancement gain: ; in, Indicates the enhanced image at pixel location The Each linear color channel value.
[0159] For monochrome images, brightness correction is performed directly using the following formula: ; in, Indicates the enhanced image at pixel location The linear brightness value.
[0160] After completing linear domain brightness correction, gamma encoding and bit depth quantization are performed according to the output requirements of the camera or display device to obtain an enhanced image. Gamma encoding is only performed after all physical dimming and linear brightness correction are completed to avoid inconsistencies in the correction ratios of dark and bright areas caused by direct multiplication enhancement in the nonlinear grayscale space.
[0161] Traditional solutions typically apply uniform gain or local contrast enhancement to the entire image after dimming, which can easily lead to repeated enhancement of areas that can be eliminated by physical dimming and mask the non-local crosstalk of the illumination zones as a digital image effect. This implementation first extracts only the fully compensable illuminance anomalous patterns defined by the compensation accessibility field for physical dimming, and then re-decomposes the remaining illuminance deviation actually measured after dimming, allowing only the residual patterns in areas with low compensation accessibility to enter digital enhancement.
[0162] This allows physical illumination compensation to handle anomalies that can be eliminated through lighting zone adjustment, while digital image enhancement handles anomalies that cannot be eliminated due to adjustment boundaries and non-local crosstalk limitations, reducing the risks of repeated dimming, over-enhancement, dark area noise amplification, and color channel saturation.
[0163] This invention encompasses any substitutions, modifications, equivalent methods, and solutions made within the spirit and scope of this invention. To provide the public with a thorough understanding of this invention, specific details are described in detail in the following preferred embodiments; however, those skilled in the art will fully understand the invention even without these details. Furthermore, to avoid unnecessary misunderstanding of the essence of this invention, well-known methods, processes, procedures, components, and circuits are not described in detail.
[0164] 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 principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. An adaptive illumination compensation and image enhancement method based on a vision system, characterized in that, Includes the following steps: S1. Under the condition of maintaining the overall scene illumination stability, the illumination suppression windows in the controllable light source are moved across the illumination zones in sequence. Based on the image response position and response diffusion direction caused by each illumination suppression window, a nonlocal illumination coupling field is generated that represents the light propagation relationship between the illumination zone and the non-corresponding imaging area. S2. Based on the nonlocal illumination coupling field, the illuminance anomaly in the current image is inversely attributed to the illumination zone that caused the illuminance anomaly, and a compensation reachability field is generated based on the constraint relationship between the direct illumination effect and the nonlocal crosstalk effect of each illumination zone. S3. Adjust each lighting zone according to the compensation accessibility field, and use the residual illuminance anomalies in the compensation accessibility field that cannot be eliminated by adjusting the lighting zones to perform limited enhancement on the adjusted image to obtain an enhanced image.
2. The adaptive illumination compensation and image enhancement method based on a vision system according to claim 1, characterized in that, The step of sequentially migrating the light suppression window in the controllable light source across lighting zones specifically includes: dividing the controllable light source into multiple lighting zones; sequentially applying a light suppression window to each lighting zone, thereby reducing the emitted light intensity of the lighting zone while simultaneously increasing the emitted light intensity of all other lighting zones, so that the total emitted luminous flux of all lighting zones remains constant during the migration process.
3. The adaptive illumination compensation and image enhancement method based on a vision system according to claim 2, characterized in that, The step of generating a nonlocal illumination coupling field characterizing the light propagation relationship between illumination zones and non-corresponding imaging areas based on the image response position and response diffusion direction caused by each illumination suppression window specifically includes: for each illumination zone, acquiring two frames of images before and after applying the illumination suppression window, and calculating a difference image; determining the pixel position in the difference image where the pixel brightness change value is greater than a preset threshold as the image response position caused by the illumination zone, and determining the response diffusion direction based on the spatial gradient direction of the pixel brightness change value in the neighborhood of the image response position.
4. The adaptive illumination compensation and image enhancement method based on a vision system according to claim 3, characterized in that, By combining the image response position and response diffusion direction corresponding to each illumination zone, a nonlocal illumination coupling matrix is constructed with the illumination zone as the input node, the imaging area as the output node, and the weights determined by the brightness change and diffusion direction, which serves as the nonlocal illumination coupling field.
5. The adaptive illumination compensation and image enhancement method based on a vision system according to claim 1, characterized in that, In step S2, the step of inversely attributing the illuminance anomaly in the current image to the illumination zone that caused the illuminance anomaly based on the nonlocal illumination coupling field specifically includes: Obtain the illuminance deviation distribution between the current image and the preset desired illuminance image; construct a mapping relationship from the lighting zone adjustment amount to the image illuminance change using the nonlocal illumination coupling field; decompose the illuminance deviation distribution into the abnormal contribution amount of each lighting zone by solving the inverse problem under this mapping relationship; and determine the lighting zone whose abnormal contribution amount exceeds the preset threshold as the lighting zone that causes the illuminance abnormality.
6. The adaptive illumination compensation and image enhancement method based on a vision system according to claim 5, characterized in that, The generation of the compensated accessibility field includes: The direct illumination effect component of each illumination zone on its corresponding imaging area and the nonlocal crosstalk effect component on the remaining imaging areas are separated from the nonlocal illumination coupling field. Based on the linear superposition constraint relationship between the direct illumination effect component and the nonlocal crosstalk effect component, an accessibility analysis model for image illuminance compensation by illumination zone adjustment is established. The accessibility analysis model is used to determine the set of illuminance anomaly modes that can be fully compensated by adjusting the illumination zones and the set of residual modes that cannot be fully compensated, and a compensation accessibility field indexed by the image area location is generated.
7. The adaptive illumination compensation and image enhancement method based on a vision system according to claim 6, characterized in that, The field value of the compensation accessibility field represents the degree to which the illuminance anomaly at the corresponding location can be compensated through lighting zoning.
8. The adaptive illumination compensation and image enhancement method based on a vision system according to claim 1, characterized in that, The adjustment of each lighting zone according to the compensated accessibility field specifically includes: Extract the fully compensable illuminance anomalous mode components defined by the compensateable accessibility location from the illuminance deviation distribution of the current image. With the goal of minimizing the anomalous mode components, solve the outgoing light intensity adjustment amount of each illumination zone under the illumination-imaging mapping relationship determined by the non-local illumination coupling location, and control the luminous intensity of each illumination zone in the controllable light source according to the adjustment amount.
9. The adaptive illumination compensation and image enhancement method based on a vision system according to claim 8, characterized in that, The process of performing limited enhancement on the adjusted image to obtain the enhanced image specifically includes: After the lighting zoning adjustment is completed, the adjusted image is acquired, and the residual illuminance deviation between the adjusted image and the desired illuminance image is calculated. Based on the residual mode set in the compensation accessibility field, the residual illuminance deviation is decomposed into an allowable enhancement component and a suppression component to generate a spatially adaptive enhancement gain field.
10. The adaptive illumination compensation and image enhancement method based on a vision system according to claim 9, characterized in that, The gain value in the enhanced gain field is allowed to be enhanced in the region where the field value of the compensation reachability field is lower than a preset threshold, and is suppressed in the region where the field value is higher than the preset threshold; the enhanced gain field is used to perform pixel brightness correction on the adjusted image to obtain the enhanced image.