Power line microphotograph image low-light enhancement method based on hierarchical nonlinear mapping
By using a hierarchical nonlinear mapping method, the dark levels are divided according to brightness statistics and corresponding parameters are configured, which solves the problem of unstable low-light image enhancement effect in the existing technology, realizes the enhancement of dark area brightness and the protection of highlight area, and improves the accuracy and efficiency of image processing.
Patent Information
- Application Number
- CN202611675169.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-28
- Publication Date
- 2026-11-27
AI Technical Summary
Existing low-light enhancement methods are unstable when dealing with micro-images of transmission lines with significant differences in darkness. Fixed parameters are difficult to match different levels of insufficient light, resulting in limited improvement in the recognition of dark areas or overexposure and diffusion in highlight areas.
A hierarchical nonlinear mapping method is adopted, which divides the darkness level by brightness statistics and configures different nonlinear mapping parameter groups for each level to control the enhancement intensity of brightness nonlinear mapping. Combined with global and local brightness statistical discrimination conditions, personalized image enhancement is achieved.
It improves the consistency and accuracy of enhancement effects for low-light images, ensures increased brightness in dark areas while avoiding overexposure in bright areas, reduces the computational cost of online processing, and improves the accuracy and efficiency of image discrimination.
Smart Images

Figure CN123181233A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power line inspection image processing technology, and in particular to a method for enhancing low-light illumination of micro-images of transmission lines based on hierarchical nonlinear mapping. Background Technology
[0002] Transmission lines are a crucial component of power systems, and the safety of their corridor environment directly impacts power supply reliability. With the development of intelligent inspection technology, fixed micro-photography equipment is increasingly deployed along transmission lines for continuous, long-term, and automated monitoring of the line corridors, providing visual data for tasks such as corridor status perception, external force damage risk identification, and construction machinery intrusion detection. Micro-photography equipment is exposed to the natural environment for extended periods, and the acquisition process covers various lighting conditions, including early morning, evening, night, overcast skies, and backlighting. The acquired images generally exhibit low brightness, requiring low-light enhancement processing before subsequent intelligent analysis. Existing low-light enhancement methods mainly include histogram equalization, contrast-limited adaptive histogram equalization, gamma correction, Retinex-like methods, and deep learning-based enhancement networks.
[0003] However, the lighting conditions in micro-photographs of power transmission lines vary constantly with time and weather, resulting in significant differences in the degree of underexposure in the actual captured images, ranging from slightly dark at dusk to severely underexposed at night. Existing low-light enhancement methods typically rely on empirically fixed enhancement parameters, applying the same set of parameters to images with varying degrees of low light. Since different levels of low light images require different enhancement intensities, fixed parameters are difficult to match with varying degrees of underexposure: for images with severe underexposure, the fixed parameters result in insufficient enhancement, leading to limited improvement in target recognition in dark areas; for images with mild underexposure, the same fixed parameters apply excessive brightness boost, causing overexposure diffusion in highlight areas and abnormal local contrast. Therefore, when dealing with micro-photographs of power transmission lines with significantly varying degrees of darkness, the enhancement effect of existing methods fluctuates with the degree of underexposure, exhibiting poor stability. Summary of the Invention
[0004] This application provides a low-light enhancement method for micro-images of transmission lines based on hierarchical nonlinear mapping to solve the above-mentioned problems.
[0005] This application provides a low-light enhancement method for micro-images of transmission lines based on hierarchical nonlinear mapping. The method includes: Acquire micro-images of transmission lines, perform brightness statistics on the micro-images of transmission lines, and determine whether the micro-images of transmission lines are low-light images that need to be enhanced based on the brightness statistics results; For the low-light image, the darkness level of the low-light image is determined based on the brightness statistics; wherein, the darkness level includes at least two levels with different degrees of darkness; Obtain a set of nonlinear mapping parameters corresponding to the darkness level; wherein, different darkness levels correspond to different sets of nonlinear mapping parameters, and the sets of nonlinear mapping parameters are used to control the enhancement intensity of the brightness nonlinear mapping; By employing a set of nonlinear mapping parameters corresponding to the darkness level, nonlinear mapping enhancement is performed on the brightness of the low-light image to obtain an enhanced micro-image of the transmission line.
[0006] Furthermore, the step of performing brightness statistics on the micro-image of the transmission line includes: The micro-image of the power transmission line is spatially divided into multiple sub-blocks; Calculate the global average brightness of the entire micro-image of the transmission line and the peak grayscale of the brightness histogram of each sub-block; The step of determining whether the micro-image of the transmission line is a low-light image to be enhanced based on the brightness statistics includes: For each darkness level, a set of corresponding combined discrimination conditions are set; wherein, the combined discrimination conditions include: the number of sub-blocks whose peak grayscale is lower than the preset peak threshold corresponding to the darkness level is not less than the preset number threshold, and the global average brightness is lower than the preset average threshold corresponding to the darkness level. When the micro-image of the transmission line meets any of the combined discrimination conditions corresponding to the darkness level, the micro-image of the transmission line is determined to be a low-light image to be enhanced. When the micro-image of the transmission line does not meet any of the combined discrimination conditions corresponding to the darkness level, the micro-image of the transmission line is judged to be a normal lighting image, and the micro-image of the transmission line is directly output. For the low-light image, determining the darkness level of the low-light image based on the brightness statistics includes: The darkness level corresponding to the combination of discrimination conditions satisfied by the low-light image is determined as the darkness level to which the low-light image belongs.
[0007] Furthermore, the darkness levels include light darkness, medium darkness, and heavy darkness levels, with the darkness intensity increasing sequentially. In the combined discrimination conditions corresponding to the light darkness, medium darkness, and heavy darkness levels, the preset peak thresholds are, in sequence, a first peak threshold, a second peak threshold, and a third peak threshold, and the preset mean thresholds are, in sequence, a first mean threshold, a second mean threshold, and a third mean threshold. Specifically, the first peak threshold, the second peak threshold, and the third peak threshold increase sequentially, as do the first mean threshold, the second mean threshold, and the third mean threshold. The step of determining the darkness level corresponding to the combination of discrimination conditions satisfied by the low-light image as the darkness level to which the low-light image belongs includes: In descending order of darkness, the low-light images are sequentially judged to determine whether they meet the combined discrimination conditions corresponding to each darkness level. The darkness level corresponding to the first combined discrimination condition that is met is determined as the darkness level to which the low-light image belongs.
[0008] Furthermore, the nonlinear mapping parameter set includes a first mapping parameter, a second mapping parameter, and a third mapping parameter corresponding to the dark area range, the midtone range, and the highlight range, respectively; The process involves using a set of nonlinear mapping parameters corresponding to the darkness level to perform nonlinear mapping enhancement on the brightness of the low-light image, resulting in an enhanced micro-image of the transmission line. This includes: According to the preset first brightness boundary point and second brightness boundary point, the brightness value range is divided into the dark area range, the mid-tone range and the highlight range in sequence; wherein, the first brightness boundary point is smaller than the second brightness boundary point; For each pixel of the low-light image, a preset nonlinear mapping is used to map the brightness value of the pixel according to the range in which the pixel's brightness value is located; wherein, the enhancement intensity of the preset nonlinear mapping is controlled by the mapping parameters corresponding to the range in which the pixel is located. Based on the brightness values of each pixel after mapping, the enhanced micro-image of the transmission line is obtained; among the nonlinear mapping parameter groups corresponding to different darkness levels, the first mapping parameter is larger and the third mapping parameter is smaller for darker darkness levels.
[0009] Furthermore, before mapping the brightness value of each pixel in the low-light image using a preset non-linear mapping based on the range in which the pixel's brightness value falls, the method further includes: The preset nonlinear mapping is offset and corrected so that the mapping corresponding to the dark area and the mapping corresponding to the midtone area are continuous at the first brightness boundary point, and the mapping corresponding to the midtone area and the mapping corresponding to the highlight area are continuous at the second brightness boundary point. The preset nonlinear mapping after offset correction is subjected to amplitude limiting processing so that the brightness value output by the preset nonlinear mapping does not exceed the brightness value range. The preset nonlinear mapping after the amplitude limiting process is monotonicized so that the preset nonlinear mapping monotonically increases within the range of brightness values.
[0010] Further, obtaining the nonlinear mapping parameter set corresponding to the darkness level includes: During the offline phase, for each darkness level, multiple sample images belonging to that darkness level are acquired. For each candidate nonlinear mapping parameter group, the multiple sample images are enhanced using the candidate nonlinear mapping parameter group respectively, and the shared parameter group corresponding to the dark level is determined from each candidate nonlinear mapping parameter group based on the difference between the enhancement result and the preset enhancement target. Save the shared parameter group corresponding to each of the aforementioned darkness levels; When the image is online, after determining the darkness level of the low-light image, the saved shared parameter group corresponding to the darkness level is called as the nonlinear mapping parameter group corresponding to the darkness level.
[0011] Further, determining the shared parameter set corresponding to the darkness level from each candidate nonlinear mapping parameter set based on the difference between the enhancement result and the preset enhancement target includes: Each of the sample images is spatially divided into multiple sub-blocks; wherein the sample images before and after enhancement use the same spatial division; Based on the enhancement results and the preset enhancement target, the enhancement loss corresponding to each sample image is determined; wherein, the enhancement loss includes distribution difference loss, brightness position loss, contrast preservation loss, and specular protection loss; the distribution difference loss is used to quantify the difference between the brightness distribution of each sub-block of the enhanced sample image and the corresponding target brightness distribution in the preset enhancement target; the brightness position loss is used to quantify the deviation between the brightness statistics of each sub-block of the enhanced sample image and the corresponding target brightness in the preset enhancement target; the contrast preservation loss is used to quantify the decrease in the brightness dispersion of the same sub-block before and after enhancement; the specular protection loss is used to quantify the degree to which the enhanced brightness value in the specular sub-block exceeds the preset allowable increment, wherein the specular sub-block is the sub-block whose brightness statistics before enhancement meet the preset specular condition; Based on the average value of the enhancement loss corresponding to the multiple sample images, and the enhancement loss of the sample image with the largest enhancement loss among the multiple sample images, the comprehensive loss corresponding to the candidate nonlinear mapping parameter group is determined; The candidate nonlinear mapping parameter group that satisfies the preset optimization conditions is determined as the shared parameter group corresponding to the dark level.
[0012] Furthermore, the preset enhancement target is constructed in the following manner: Multiple local brightness types are preset, and target brightness ranges are preset for each local brightness type based on the brightness statistics of micro-images of power transmission lines under normal lighting. For each sub-block, the local brightness type of the sub-block is determined based on the brightness statistics of the sub-block before enhancement; The target brightness of the sub-block is determined based on the target brightness range corresponding to the local brightness type to which the sub-block belongs, the brightness statistics of the sub-block before enhancement, and the overall darkness of the sample image to which the sub-block belongs. The brightness histogram of the sub-block before enhancement is shifted according to the target brightness to obtain the shifted brightness distribution; A central brightness distribution is constructed with the target brightness as the center; The translational brightness distribution and the center brightness distribution are weighted and fused to obtain the target brightness distribution corresponding to the sub-block; wherein, for the sub-block whose local brightness type is specular, the target brightness is reduced relative to the brightness before enhancement of the sub-block, and the reduction does not exceed a preset amplitude threshold.
[0013] Further, the nonlinear mapping enhancement of the brightness of the low-light image to obtain the enhanced micro-image of the transmission line includes: The low-light image is converted from a first color space to a second color space that separates the luminance and chrominance components. Extract the luminance and chroma channels from the low-light image converted to the second color space; The luminance channel is enhanced by performing nonlinear mapping enhancement to obtain the enhanced luminance channel; The enhanced luminance channel is fused with the chroma channel, and the fusion result is converted from the second color space back to the first color space to obtain an enhanced micro-image of the power transmission line.
[0014] Furthermore, after performing nonlinear mapping enhancement on the luminance channel to obtain the enhanced luminance channel, the method further includes: The enhanced luminance channel is subjected to contrast-limited local histogram equalization to obtain a locally enhanced luminance channel; wherein, the processing parameters of the local histogram equalization are preset fixed parameters and correspond to different dark levels. The processing parameters are the same, and the difference in enhancement intensity corresponding to different dark levels is reflected by the corresponding nonlinear mapping parameter group. The step of fusing the enhanced luminance channel with the chroma channel includes: fusing the locally enhanced luminance channel with the chroma channel.
[0015] The beneficial effects of the technical solution in this application are: First, this application overcomes the problem of fluctuating effects on images with vastly different levels of darkness by dividing low-light images into darkness levels, configuring different nonlinear mapping parameter groups for different darkness levels, and performing mapping enhancement according to the levels, so that the enhancement intensity matches the degree of insufficient light in the image.
[0016] Second, this application combines the global brightness mean of the entire image with the peak gray value of the brightness histogram of each spatial sub-block to form a combined discrimination condition. The interference of the bright sky area on the overall brightness judgment is suppressed by the local statistics of the sub-block. Underexposed target areas such as towers, wires and machinery in the lower part of the image can be accurately identified. The normal lighting image is directly output after discrimination without participating in enhancement processing, thus improving both discrimination accuracy and processing efficiency.
[0017] Third, this application divides the brightness range into three intervals: dark area, midtone and highlight, and controls the mapping intensity of each interval by independent mapping parameters. With the offset correction, limiting and monotonic processing at the dividing point, the dark area is fully enhanced, the overexposure diffusion in the highlight area is suppressed, the gray level order relationship between pixels is maintained, and the mapping enhancement is performed only in the brightness channel and not in the chroma channel, thus avoiding hue shift and saturation abnormality.
[0018] Fourth, in this application, multiple sample images of the same darkness level share a set of nonlinear mapping parameters obtained through offline optimization. After determining the darkness level in the online processing stage, the corresponding parameters are directly called without performing parameter search, which ensures the consistency of the enhancement results of the same batch of images and reduces the online processing overhead. Moreover, the parameter optimization is constrained by the target brightness distribution constructed by the statistical prior of normal lighting images, and does not rely on pixel-level pairing of low-light and normal lighting images, resulting in low data acquisition costs.
[0019] Other features and advantages of the present invention will be set forth in the following description. Attached Figure Description
[0020] Figure 1 A flowchart illustrating the low-light enhancement method for micro-images of transmission lines based on hierarchical nonlinear mapping, provided in this application embodiment; Figure 2 A flowchart illustrating a low-light enhancement method for micro-images of transmission lines based on hierarchical nonlinear mapping in an application scenario provided in this application embodiment; Figure 3 Another flowchart illustrating a low-light enhancement method for micro-images of transmission lines based on hierarchical nonlinear mapping in an application scenario provided by an embodiment of this application; Figure 4 A schematic diagram of the 3×3 region division and low light level discrimination process provided in the embodiments of this application; Figure 5 Different parameters provided for embodiments of this application Below Visualized curves; Figure 6 A schematic diagram showing the comparison between the solution provided in this application and the classic low-light enhancement method in the embodiments of this application; Figure 7 A schematic diagram showing the comparison between the solution provided in this application and the deep learning low-light enhancement method in the embodiments of this application. Detailed Implementation
[0021] The present application will now be described in further detail with reference to the accompanying drawings.
[0022] like Figure 1 As shown in the figure, this application provides a low-light enhancement method for micro-images of transmission lines based on hierarchical nonlinear mapping, including: Step S101: Obtain a micro-image of the transmission line, perform brightness statistics on the micro-image of the transmission line, and determine whether the micro-image of the transmission line is a low-light image to be enhanced based on the brightness statistics results.
[0023] Step S102: For a low-light image, determine the darkness level of the low-light image based on the brightness statistics; wherein, the darkness level includes at least two levels with different degrees of darkness.
[0024] The aforementioned micro-images of transmission lines refer to images obtained by fixed micro-image devices deployed along the transmission line, capturing images of the line corridor scene. These fixed micro-image devices are image acquisition devices installed at fixed points on poles or along the line. Their installation position and shooting direction remain relatively fixed after deployment, used for continuous, long-term, and automated observation of the line corridor environment. Compared to close-range inspection images from drones, micro-images typically image the entire line corridor scene, simultaneously including objects such as the sky, conductors, poles, vegetation, roads, buildings, and construction machinery. This provides crucial visual data for corridor status perception, external force damage risk identification, and mechanical equipment intrusion detection. Therefore, the imaging quality of micro-images directly affects the performance of subsequent intelligent analysis tasks such as target detection, hazard identification, and status analysis.
[0025] The long-term outdoor operation of micro-capture equipment results in complex and variable lighting conditions for the images it captures. The acquisition process covers various lighting conditions, including early morning, evening, night, overcast skies, and backlighting. Affected by factors such as changes in natural light, equipment installation angle, shooting direction, partial obstruction, and camera dynamic range limitations, the actual captured images generally exhibit problems such as low overall brightness, loss of detail in dark areas, decreased contrast between the target and background, and the coexistence of localized highlights and large areas of darkness. Micro-capture images of power transmission lines also show significant spatial non-uniform lighting characteristics: the upper part of the image is often dominated by a bright sky, while the lower part, including key target areas such as towers, vegetation, roads, and machinery, has lower brightness, and there are significant brightness differences between different spatial areas within the same image.
[0026] The method for acquiring micro-images of transmission lines can be selected based on the actual deployment. In one optional implementation, the micro-capture device takes photos of the line channel at preset acquisition cycles. The acquired images are transmitted to the processing end via a communication link, and the processing end receives the images and proceeds to subsequent processing. In another optional implementation, the micro-capture device stores the acquired images on a local storage medium, and the processing end obtains the micro-images of the transmission line by reading historical image data from the storage medium. The specific format and resolution of the acquired images are not limited; both grayscale and color images can be used for processing. For color images, their pixels are usually composed of component values from multiple color channels, and subsequent processing can convert them to grayscale images or other color space representations as needed.
[0027] Optionally, step S101 above performs brightness statistics on the micro-image of the transmission line, including: dividing the micro-image of the transmission line into multiple sub-blocks in space; calculating the global average brightness of the entire micro-image of the transmission line and the peak gray level of the brightness histogram of each sub-block. The above step S101, which determines whether the micro-image of the transmission line is a low-light image to be enhanced based on the brightness statistics, includes: setting a set of combined discrimination conditions for each darkness level; wherein, the combined discrimination conditions include: the number of sub-blocks with peak grayscale values lower than the preset peak threshold corresponding to the darkness level is not less than a preset number threshold, and the global average brightness value is lower than the preset average threshold corresponding to the darkness level; when the micro-image of the transmission line meets the combined discrimination conditions corresponding to any darkness level, the micro-image of the transmission line is determined to be a low-light image to be enhanced; when the micro-image of the transmission line does not meet the combined discrimination conditions corresponding to any darkness level, the micro-image of the transmission line is determined to be a normal lighting image, and the micro-image of the transmission line is directly output. Step S102 above includes: determining the darkness level corresponding to the combination discrimination conditions satisfied by the low-light image as the darkness level to which the low-light image belongs.
[0028] When performing brightness statistics on micro-images of power transmission lines, in one optional implementation, the image is spatially divided into multiple sub-blocks, and statistics are performed at both the global and local levels based on the block division results. The reason for spatially dividing the image stems from the non-uniform spatial illumination characteristics of micro-images of power transmission lines: the upper part of the image is often dominated by a bright sky, while the lower part, including key target areas such as towers, vegetation, roads, and machinery, has lower brightness. The average brightness of the entire image is easily affected by the bright sky area, making it difficult to accurately reflect the illumination status of each local area. Dividing the image into multiple sub-blocks allows for the acquisition of brightness statistics for each local area, thus complementing the global statistics of the entire image. The number of sub-blocks can be set according to the actual scene. In a preferred implementation, the image is divided into nine 3×3 sub-blocks, denoted as... =1,2,3), each sub-block is a rectangular region. The reason for using a 3×3 division is that, on the one hand, this division method can effectively separate the typical sky area from the ground and tower areas, so that each sub-block corresponds to different lighting characteristics in space; on the other hand, for micro-images of common resolution, each sub-block contains about 230,000 pixels, and the sample size can ensure the statistical stability and peak identification of the brightness histogram, avoiding the drastic fluctuations of the histogram caused by overly fine division.
[0029] The global statistic is the global mean brightness of the entire image. During calculation, let the input image be... Image size is ,in, This represents the number of pixels in the image's height direction. This refers to the number of pixels along the image width, expressed in pixels. First, [the image is...] Convert to grayscale image In a grayscale image, the grayscale value of each pixel is the quantized representation of the pixel's brightness information. Then, the following calculations are performed: ; In the formula, Represents the pixel position of a grayscale image. The grayscale value at that location, for an 8-bit image, ranges from 0 to 255; This is the global brightness average, expressed in gray levels. The formula works by taking the arithmetic mean of the gray values of all pixels in the image, using a single statistical measure to characterize the overall brightness level of the image. The smaller the value, the lower the overall brightness of the image.
[0030] The local level statistics are the peak gray levels of the brightness histograms of each sub-block. For each sub-block... First, calculate its brightness histogram. : ; In the formula, Indicates the first The grayscale value in each sub-block is equal to The number of pixels, expressed in pixels; This is an indicator function; it takes the value 1 if the condition inside the parentheses is true, and 0 otherwise. The grayscale level is used. In the above calculation formula, all pixels within the sub-block are traversed and counted according to their grayscale values, thus characterizing the grayscale distribution pattern of the local area. Based on this, the grayscale value with the highest frequency in the sub-block is extracted as the peak grayscale. ; In the formula, For the first The peak grayscale value of the brightness histogram of each sub-block, expressed in grayscale levels. The peak grayscale value reflects the dominant background or target brightness level within the sub-block, the mean value reflects the overall brightness level of the area, and the peak value indicates the location where the pixels have the most concentrated grayscale values; if A smaller value indicates that a large number of pixels in the area are concentrated in the low grayscale range, indicating significant insufficient lighting. Using both the mean and peak values for judgment can avoid misjudgments caused by relying solely on the mean.
[0031] After completing global and local statistics, the process proceeds to the discrimination stage. This stage sets a set of combined discrimination conditions for each darkness level. These conditions consist of two parts: a quantity condition (the number of sub-blocks with peak grayscale values lower than a preset peak threshold for that darkness level is not less than a preset quantity threshold) and a mean condition (the global average brightness value is lower than a preset mean threshold for that darkness level). Both conditions must be met simultaneously. Taking a 3×3 partition as an example, the number of sub-blocks can be represented as follows: ; In the formula, The number of sub-blocks whose peak grayscale is lower than the preset peak threshold T, expressed as the number of sub-blocks; Measured by gray level; This is an indicator function. The principle behind this formula is: to compare the peak grayscale value with the threshold value for each sub-block and accumulate the count; when the number of sub-blocks is set to other values, the summation range is adjusted accordingly with the number of sub-blocks. A larger value indicates the presence of multiple dark sub-regions in the image, suggesting that the darkness has a certain spatial range and is not caused by a single local shadow or edge region by chance. This can be used as a criterion to eliminate the interference of accidental dark patches. The preset peak threshold, preset quantity threshold, and preset mean threshold can all be preset according to the grayscale distribution characteristics of the transmission line micro-image. Different threshold values correspond to different levels of darkness.
[0032] During the discrimination process, the brightness statistics of the micro-image of the transmission line to be judged are successively substituted into the combination discrimination conditions corresponding to each darkness level for matching: when the image meets the combination discrimination conditions corresponding to any darkness level, it indicates that the image's illumination is insufficient to the point of needing enhancement, and the image is judged as a low-light image to be enhanced; when the image does not meet the combination discrimination conditions corresponding to any darkness level, it indicates that the image's brightness quality meets the requirements for subsequent analysis, and the image is judged as a normal-light image. Normal-light images do not undergo enhancement processing and are directly output, thus avoiding unnecessary processing on normal images and saving processing resources. This discrimination method combines the global statistics of the entire image with the local statistics of each sub-block. The interference of the bright sky area on the overall brightness judgment is suppressed by the local statistics of the sub-blocks, and the underexposed target area in the lower part of the image can be accurately identified.
[0033] In step S102, the darkness level corresponding to the combined discrimination conditions satisfied by the low-light image is determined as the darkness level to which the low-light image belongs. Since the combined discrimination conditions are set level by level, the discrimination process determines the level corresponding to the conditions satisfied at the same time as confirming that the image belongs to a low-light image. Discrimination and level determination are completed in the same matching process, making the processing flow compact. After determining the darkness level, the low-light image carries its corresponding darkness level into the subsequent enhancement process. Subsequent processing calls the enhancement parameters corresponding to this darkness level to adapt the enhancement intensity to the degree of insufficient illumination in the image.
[0034] In some implementations, the number of darkness levels and the value relationships of the discrimination conditions for each level combination can be further designed. By setting multiple progressively dark levels and defining the magnitude relationships between the thresholds of each level, the fineness of the characterization of insufficient lighting can be improved. In addition, considering the possible nesting relationships between the discrimination conditions for each level combination, the discrimination order is also defined to ensure that the classification result of each low-light image is unique. The specific scheme is as follows: Optionally, the aforementioned darkness levels include light darkness, medium darkness, and heavy darkness levels, with the darkness intensity increasing sequentially. In the combined discrimination conditions corresponding to the light darkness, medium darkness, and heavy darkness levels, the preset peak thresholds are, in sequence, a first peak threshold, a second peak threshold, and a third peak threshold, and the preset mean thresholds are, in sequence, a first mean threshold, a second mean threshold, and a third mean threshold. Specifically, the first peak threshold, the second peak threshold, and the third peak threshold increase sequentially, as do the first mean threshold, the second mean threshold, and the third mean threshold. The above-mentioned determination of the darkness level corresponding to the combination discrimination conditions satisfied by the low-light image as the darkness level to which the low-light image belongs includes: judging whether the low-light image satisfies the combination discrimination conditions corresponding to each darkness level in descending order of darkness, and determining the darkness level corresponding to the first combination discrimination condition satisfied as the darkness level to which the low-light image belongs.
[0035] In one optional implementation, three darkness levels are used, progressively increasing in darkness as mild darkness, moderate darkness, and severe darkness, corresponding to light insufficiency in transmission line micro-images ranging from slightly dark to severely underexposed. Each of the three levels corresponds to a set of combined discrimination conditions. The preset peak thresholds in each set of conditions are, in order, a first peak threshold, a second peak threshold, and a third peak threshold, and the preset mean thresholds are, in order, a first mean threshold, a second mean threshold, and a third mean threshold. The three preset peak thresholds and the three preset mean thresholds increase sequentially. Different levels correspond to different darkness assessment scales. The mild darkness, moderate darkness, and severe darkness levels use their respective peak thresholds to measure the darkness of sub-blocks and their respective mean thresholds to measure the darkness of the entire image, thus distinguishing the degree of insufficient illumination into three levels. The values of each threshold are set based on the grayscale distribution characteristics of the micro-images of transmission lines. As a set of implementation values, the combination discrimination conditions for mild darkness level can be set as follows: the number of sub-blocks with peak grayscale below 40 grayscale level is not less than 2 and the global average brightness is less than 90 grayscale level; the moderate darkness level can be set as follows: the number of sub-blocks with peak grayscale below 50 grayscale level is not less than 2 and the global average brightness is less than 100 grayscale level; the severe darkness level can be set as follows: the number of sub-blocks with peak grayscale below 55 grayscale level is not less than 2 and the global average brightness is less than 105 grayscale level.
[0036] Based on the above correspondence between levels and thresholds, the image Diablo Rank It can be represented as: ; In the formula, , , These represent the Darkness level: Mild, Medium, and Darkness, respectively. This represents a normally lit image. , , These are the number of sub-blocks whose peak gray level is lower than the preset peak threshold of 40, 50, and 55, respectively, counted in terms of the number of sub-blocks. The global average brightness is expressed in gray levels; the peak threshold and average threshold are expressed in gray levels, and the quantity threshold is expressed in the number of sub-blocks. The principle behind this segmentation rule is to simultaneously match the local and global statistics of the image under multiple threshold conditions. Each set of conditions corresponds to a level of darkness. The image is classified into the corresponding under-illuminated range if it meets a certain condition. If none of the three conditions are met, it indicates that the image is normally illuminated.
[0037] Because the peak and mean thresholds increase sequentially across different levels, there is a nested relationship between the three sets of combined discrimination conditions: an image that meets a less severe level condition often simultaneously meets other level conditions with more lenient thresholds. In other words, a low-light image may simultaneously meet the combined discrimination conditions for multiple levels. Without a defined discrimination order, the same image might be classified into different levels, leading to inconsistent classification results and affecting the determinism of subsequent enhancement parameter calls. Therefore, in one optional implementation, the low-light image is sequentially judged to meet the combined discrimination conditions corresponding to the severe, moderate, and mild darkness levels, in descending order of darkness. The darkness level corresponding to the first satisfied combined discrimination condition is determined as the image's darkness level. This sequential arrangement ensures that images simultaneously meeting multiple level conditions are consistently classified into the same level, and the classification result for any low-light image is unique and reproducible, guaranteeing the determinism of the discrimination process. Furthermore, during the threshold calibration stage, mutually exclusive numerical ranges can be set for each level, making the level conditions independent and achieving the same goal of unique classification results.
[0038] After the level is determined, low-light images of light, medium and heavy darkness each carry a level label and enter the subsequent enhancement process. The subsequent processing calls different enhancement parameters for images of different darkness levels. The darker the image, the stronger the shadow enhancement. The enhancement intensity is matched with the degree of insufficient light.
[0039] Step S103: Obtain the nonlinear mapping parameter set corresponding to the darkness level; wherein, different darkness levels correspond to different nonlinear mapping parameter sets, and the nonlinear mapping parameter set is used to control the enhancement intensity of the brightness nonlinear mapping.
[0040] Optionally, step S103 includes: in the offline stage, acquiring multiple sample images belonging to each darkness level; enhancing multiple sample images using each candidate nonlinear mapping parameter group, and determining the shared parameter group corresponding to the darkness level from each candidate nonlinear mapping parameter group based on the difference between the enhancement result and the preset enhancement target; saving the shared parameter group corresponding to each darkness level; and in the online stage, after determining the darkness level to which the low-light image belongs, calling the saved shared parameter group corresponding to the darkness level as the nonlinear mapping parameter group corresponding to the darkness level.
[0041] The aforementioned nonlinear mapping parameter set controls the intensity of brightness nonlinear mapping enhancement, and its values directly determine the brightness performance of the enhanced image. Different darkness levels correspond to different nonlinear mapping parameter sets, thus allowing the enhancement intensity to be configured differently according to the degree of insufficient illumination in the image. The parameter set can be obtained in various ways, such as being calibrated by technicians based on experience, or automatically determined through optimization on sample images. In a preferred embodiment, the determination and use of the parameter set is divided into an offline stage and an online stage: the offline stage performs parameter optimization on a batch of sample images and saves the results; the online stage directly calls the saved results for new input images. This division is based on the consideration that if parameter search is performed separately for each image, on the one hand, the enhancement results of images in the same batch are prone to inconsistencies due to independent parameter tuning; on the other hand, the computational overhead of parameter search is large, making it difficult to meet the real-time requirements of online processing. Sharing parameters according to darkness levels and moving the optimization process to the offline stage can simultaneously ensure the consistency of image processing at the same level and the efficiency of online calling.
[0042] During the offline phase, for each darkness level, multiple sample images belonging to that darkness level are first acquired. These sample images are low-light transmission line micro-images grouped into the same darkness level after the aforementioned discrimination and classification. Multiple sample images within the same level constitute the parameter optimization image set for that level. Subsequently, for each candidate nonlinear mapping parameter group, the multiple sample images are enhanced using that candidate nonlinear mapping parameter group, and the enhancement results are compared with a preset enhancement target. The preset enhancement target is the brightness state benchmark expected to be achieved by the enhancement result, used to measure the quality of the enhancement effect of the candidate parameter group; the smaller the difference between the enhancement result and the enhancement target, the closer the enhancement effect of the candidate parameter group is to the desired state. Based on the comparison results of the differences, candidate parameter groups whose differences meet the preset optimization conditions are selected from each candidate nonlinear mapping parameter group as the shared parameter group corresponding to that darkness level, meaning that multiple sample images within the same darkness level share the same set of parameters. The preset optimization condition can be set to minimize the difference, or it can be set to the difference being lower than a preset difference threshold.
[0043] The candidate nonlinear mapping parameter sets are derived from a preset candidate parameter search space. In one optional implementation, the parameter search employs a grid search method, that is, the values of each parameter are discretized and traversed within the candidate parameter search space at a preset step size, and the enhancement effect of each candidate parameter set is evaluated one by one. Candidate parameter search space It can be represented as: ; In the formula, , , These are three scale parameters in the nonlinear mapping parameter set; the endpoints of the search interval for each parameter are numerical values, and the discrete search step size can be 0.10. The three scale parameters correspond to the mapping intensity control in different intervals within the brightness value range, and their specific effects on the mapping will be explained in detail in the subsequent mapping enhancement steps. The setting of each interval range is based on the brightness distribution characteristics of the transmission line micro-images: dark areas require stronger brightness enhancement, therefore... Set a larger search range; the mid-tone area should have a smooth transition, therefore Set to medium range; highlight areas need to suppress overexposure diffusion, therefore Set a smaller search space. This search space design can reduce the risk of abrupt midtone changes and excessive highlight enhancement while ensuring shadow enhancement capabilities. Grid search is only one optional traversal method; other parameter optimization methods such as random search and heuristic search are also applicable.
[0044] After optimization, the optimal shared parameters corresponding to this Diablo level can be expressed as: ; In the formula, These are candidate sets of nonlinear mapping parameters; For the first The optimal shared parameter set corresponding to each darkness level; The level loss for this darkness level is used to comprehensively measure the difference between the enhancement results of the candidate parameter set on multiple sample images of this level and the preset enhancement target. Its specific composition can be set as needed. It can be understood that by traversing all candidate parameter sets within the candidate parameter search space, the candidate parameter set that minimizes the level loss is determined as the optimal parameter for that level, thus making the optimization result optimal for the batch of samples within that level. In the offline stage, the above optimization is performed for each darkness level to obtain and save the shared parameter set corresponding to each level. The saving format can be a parameter lookup table or a configuration file for online retrieval. When there are significant changes in the monitoring scene, device imaging characteristics, or seasonal lighting conditions, sample images can be re-acquired and offline optimization can be performed again to update the saved shared parameter set, ensuring that the parameter configuration matches the current imaging conditions.
[0045] In the online phase, for newly input micro-images of transmission lines, after completing the illumination state judgment and determining their corresponding darkness level, the saved shared parameter set corresponding to that darkness level is directly called as the nonlinear mapping parameter set for subsequent mapping enhancement. Parameter searching is no longer performed during the entire online process. Because images of the same darkness level share a set of parameters validated by batch samples, the enhancement results of images in the same batch remain consistent. Since parameter searching is moved to the offline phase, online processing only requires one judgment and one call, resulting in low processing overhead and meeting the needs of continuous batch image processing in micro-image monitoring scenarios for transmission lines.
[0046] Optionally, determining the shared parameter set corresponding to the darkness level from each candidate nonlinear mapping parameter set based on the difference between the enhancement result and the preset enhancement target includes: dividing each sample image into multiple sub-blocks in space; wherein the sample images before and after enhancement use the same spatial division; determining the enhancement loss corresponding to each sample image based on the enhancement result and the preset enhancement target; wherein the enhancement loss includes distribution difference loss, brightness position loss, contrast preservation loss, and highlight protection loss; the distribution difference loss is used to quantify the difference between the brightness distribution of each sub-block of the enhanced sample image and the corresponding target brightness distribution in the preset enhancement target; the brightness position loss is used to quantify the difference between the enhanced sample image and the target brightness distribution in the preset enhancement target; the brightness position loss is used to quantify the difference between the enhanced sample image and the target brightness distribution in the preset enhancement target. The deviation between the brightness statistics of each sub-block of the image and the corresponding target brightness in the preset enhancement target; contrast preservation loss is used to quantify the decrease in the brightness dispersion of the same sub-block before and after enhancement; highlight protection loss is used to quantify the degree to which the enhanced brightness value in the highlight sub-block exceeds the preset allowable increment, and the highlight sub-block is the sub-block whose brightness statistics before enhancement meet the preset highlight conditions; based on the average of the enhancement losses corresponding to multiple sample images, and the enhancement loss of the sample image with the largest enhancement loss among multiple sample images, the comprehensive loss corresponding to the candidate nonlinear mapping parameter group is determined; the candidate nonlinear mapping parameter group whose comprehensive loss meets the preset optimization conditions is determined as the shared parameter group corresponding to the dark level.
[0047] In one optional implementation, the evaluation of candidate nonlinear mapping parameter groups during offline optimization is based on block brightness statistics. Each sample image is spatially divided into multiple sub-blocks, and the sample images before and after enhancement use the same spatial division, ensuring a clear correspondence between each sub-block before and after enhancement. The consideration for using the same division is that subsequent loss calculations require comparing the brightness state of the same spatial region before and after enhancement. If different division methods are used before and after enhancement, the pixel set corresponding to the same sub-block number will be misaligned, rendering the comparison of statistics meaningless. The spatial division method can follow the division results from the aforementioned illumination discrimination stage, for example, nine 3×3 sub-blocks, denoted as the total number of sub-blocks. In the embodiments of this application .
[0048] Based on the block segmentation, the enhancement loss corresponding to each sample image is determined according to the enhancement results and the preset enhancement target. The enhancement loss is used to measure the deviation between the actual brightness state and the desired brightness state of the image after enhancement with a certain candidate parameter set, and consists of four components: distribution difference loss, brightness position loss, contrast preservation loss, and highlight protection loss.
[0049] Distribution difference loss is used to quantify the difference between the brightness distribution of each sub-block in the enhanced sample image and the corresponding target brightness distribution in the preset enhancement target. Let the enhanced image be... The probability distribution of the brightness histogram of each sub-block is as follows: The target brightness distribution corresponding to this sub-block in the preset enhancement target is as follows: For each sub-block, the difference between the two distributions is measured using the maximum mean difference: ; ; ; In the formula, and They are respectively and In the The probability at each brightness level; For the first The brightness values for each brightness level are expressed in grayscale; the upper limit of the summation is calculated. Number of brightness levels; Here, k is the Gaussian kernel function, and k is the kernel notation, along with the number of brightness levels as the upper limit of the summation. and the scale parameter in the nonlinear mapping parameter set , , The meanings are different; the symbols are simply reused. The bandwidth parameter of the kernel function, expressed in gray levels; This is a dimensionless loss value. The above calculation formula uses a Gaussian kernel function to map two distributions to a high-dimensional feature space. The difference between the distributions is measured by comparing the distance between their mean points in this space: the first two terms characterize the degree of internal aggregation of each distribution, and the third term characterizes the degree of mutual proximity between the two distributions. The smaller the combined value of the three terms, the closer the enhanced brightness distribution is to the target brightness distribution. The maximum mean difference does not require parametric assumptions about the distribution shape and is suitable for comparing non-parametric distributions such as histograms.
[0050] Brightness position loss The deviation between the luminance statistics of each sub-block after quantization enhancement and the corresponding target luminance in the preset enhancement target is used. Its scope covers all sub-blocks and is defined as follows: ; In the formula, and The enhanced version The average brightness and peak grayscale of each sub-block and These represent the mean and peak grayscale values of the target brightness corresponding to the sub-block in the enhanced target, both expressed in grayscale levels. Dividing by 255 normalizes the value, making it dimensionless. The above calculation formula constrains the brightness position of each local region after enhancement from both the mean and peak values. The mean term constrains the overall brightness of the region to converge towards the target brightness, while the peak term constrains the dominant brightness level of the region to migrate towards the target position. Combining these two approaches avoids the bias caused by a single statistical constraint.
[0051] Contrast retention loss The amount of reduction in brightness dispersion of the same sub-block before and after quantization enhancement, which also applies to all sub-blocks, is defined as: ; In the formula, and These are the before and after enhancement, respectively. The standard deviation of brightness for each sub-block, expressed in gray levels, is used to characterize the dispersion of brightness within the sub-block. In the above calculation formula, a penalty is only incurred when the standard deviation of the enhanced sub-block is lower than that before enhancement: when Less than When the difference is positive, the loss increases; when the dispersion does not decrease after enhancement, the zeroing operation prevents this term from incurring a penalty. Its design aims to constrain the enhancement process from causing an excessive decrease in local brightness dispersion, avoid flattening local structures, and preserve the texture and edge information of targets such as conductors and towers.
[0052] Spectrum protection loss is used to quantify the extent to which the enhanced brightness value in a specular sub-block exceeds a preset allowable increment, and it only applies to specular sub-blocks. A specular sub-block refers to a sub-block whose pre-enhancement brightness statistics meet preset specular conditions, such as a sub-block with an average brightness level of no less than 160 gray levels or a histogram peak gray level of no less than 180 gray levels. Spectrum protection loss is defined as: ; In the formula, For the first Local brightness type of each sub-block; This is an indicator function that takes a value of 1 only when the sub-block is of the specular type; For the first The set of pixels within each sub-block This represents the number of pixels in the sub-block. and These represent the pixels before and after enhancement, respectively. The brightness value, expressed in gray levels; The allowable increase in highlight brightness is expressed in gray levels. The principle behind this formula is to calculate the brightness increase before and after enhancement pixel by pixel within the highlight sub-block. Only when the increase exceeds the allowable range is the excess portion accumulated, thereby constraining the diffusion of bright areas into saturated areas. This constraint is not applied to dark and midtone sub-blocks to avoid affecting the normal enhancement of dark areas.
[0053] The enhancement loss for a single sample image is obtained by weighting and combining the above four loss terms: ; In the formula, , , and These are the weighting coefficients for the four losses, used to adjust the relative importance of each constraint in the overall evaluation. As a set of implementation values, , , and The values can be 1.00, 0.35, 0.30, and 0.80 respectively. The distribution difference loss has the largest weight, reflecting the dominant constraint of the enhancement result migrating to the target brightness distribution. The highlight protection loss has the second largest weight, reflecting the importance of overexposure control.
[0054] After obtaining the enhancement loss for each sample image, further synthesis is performed at the level of darkness. Let the set of images for parameter optimization at this darkness level contain... For each sample image, the comprehensive loss is defined as: ; In the formula, For the set of Enhancement loss of sample images; As the loss weight for the worst sample, it can be set to 0.20 as an optional implementation method; The loss value is the sample image with the largest enhancement loss in the set. In the above calculation formula, the average performance of the batch samples and the worst sample performance are jointly included in the evaluation. The average loss term reflects the overall enhancement level of the candidate parameter group for most samples in the set, while the worst sample loss term reflects the worst performance of the candidate parameter group on extremely low-light or locally high-light samples in the set. When only the average loss is optimized, the optimization result may only be suitable for most samples, resulting in the failure of enhancement for a few extreme samples. After introducing the worst sample loss with a smaller weight, the performance of extreme samples is constrained, while a single abnormal sample does not dominate the overall optimization direction. Finally, the candidate nonlinear mapping parameter group whose comprehensive loss meets the preset optimization conditions (e.g., minimum comprehensive loss) is determined as the shared parameter group corresponding to this darkness level, so that the optimization result is applicable to the batch samples of the same level as a whole and robust to extreme samples.
[0055] Optionally, the aforementioned preset enhancement target is constructed as follows: multiple local brightness types are preset, and target brightness ranges are preset for each local brightness type based on the brightness statistics of micro-images of transmission lines under normal lighting; for each sub-block, the local brightness type to which the sub-block belongs is determined based on the brightness statistics of the sub-block before enhancement; the target brightness of the sub-block is determined based on the target brightness range corresponding to the local brightness type to which the sub-block belongs, the brightness statistics of the sub-block before enhancement, and the overall darkness of the sample image to which the sub-block belongs; the brightness histogram of the sub-block before enhancement is shifted according to the target brightness to obtain a shifted brightness distribution; a central brightness distribution is constructed with the target brightness as the center; the shifted brightness distribution and the central brightness distribution are weighted and fused to obtain the target brightness distribution corresponding to the sub-block; wherein, for the sub-block whose local brightness type is highlight, the target brightness is reduced relative to the brightness of the sub-block before enhancement, and the reduction does not exceed a preset amplitude threshold.
[0056] The preset enhancement targets in offline optimization need to be constructed under the condition of lacking normal lighting reference images that are pixel-level paired with the image to be enhanced. In actual transmission line micro-photography scenarios, it is difficult to collect strictly aligned low-light and normal lighting image pairs for the same scene, so it is not possible to directly use paired normal images as enhancement targets. In one optional implementation, a construction approach combining statistical priors and the image's own distribution is adopted: on the one hand, the statistical results of normal lighting transmission line micro-photography images are used to preset reasonable target brightness ranges for different local areas, providing scene-based prior constraints; on the other hand, targets are dynamically generated based on the block brightness distribution of the sample images to be evaluated, so that the enhancement targets not only conform to the brightness rules of normal lighting scenes, but also adapt to the actual content of each sample image.
[0057] The construction process first establishes a local brightness type system and presets a target brightness range for each type. The local brightness type is a classification of the brightness state of the sub-block. In one optional implementation, four types are preset: extremely dark area, relatively dark area, mid-tone area, and highlight area. Based on the brightness statistics of micro-images of power transmission lines under normal lighting, a target brightness range is preset for each type. For example, the target mean range of extremely dark area, relatively dark area, mid-tone area, and highlight area can be set to [95,125], [115,145], [135,160], and [175,210], respectively, all in grayscale.
[0058] For each sub-block, its local luminance type is determined based on its luminance statistics before enhancement. The luminance statistics for each sub-block include the luminance mean. Normalized histogram and histogram peak gray level The normalized histogram is defined as follows: ,in: ; In the formula, Indicates the first The grayscale value in each sub-block is Pixel ratio; The grayscale value in this sub-block is equal to The number of pixels; This represents the total number of pixels in this sub-block. Peak grayscale. Measured by grayscale level. The rule for determining the sub-block type is: ; In the formula, For the first Local brightness type of each sub-block; The brightness average of the sub-block before enhancement is expressed in grayscale levels. Each judgment threshold is set based on the local brightness statistics and grayscale range of the micro-image. The implementation principle of this rule includes: using both the mean and peak values for judgment: the mean reflects the overall brightness level of the area, while the peak value indicates the location of the most concentrated grayscale pixels. When relying solely on the mean, a few extremely bright or dark pixels may skew the judgment result; introducing the peak value criterion avoids such misjudgments. It should be noted that the local brightness type classification here describes the local brightness attributes of the sub-block, used to construct the target brightness distribution; this, along with the aforementioned dark level classification of the entire image, operates at both the local and global levels respectively, and the two do not conflict.
[0059] The target brightness of a sub-block is determined based on its target brightness range for its type, the brightness statistics before enhancement, and the overall darkness of the sample image to which the sub-block belongs. The overall darkness of the image is determined by the enhancement intensity coefficient. Participate in calculation, Based on global brightness average and the ratio of pixels in the dark area Confirmed. The dark pixel ratio is defined as follows: ; In the formula, This refers to the number of pixels whose grayscale values are in the range of 0 to 80, expressed in pixels. This represents the total number of pixels in the image. This is a dimensionless proportional value, reflecting the proportion of pixels in the darker areas of the image. The rules for determining the enhancement intensity coefficient are as follows: ; In the formula, To enhance the intensity coefficient, a dimensionless parameter is used. This can be understood as adapting the shift in target brightness to the overall darkness of the image; the darker the image, the greater the intensity shift. The larger the value, the more the target distribution migrates to brighter areas, resulting in more significant enhancement; the closer the image is to normal brightness. The smaller the value, the more conservative the increase.
[0060] After determining the enhancement intensity coefficient, the target brightness of each sub-block is determined according to a unified migration rule. Let the... The lower and upper bounds of the target brightness range corresponding to the local brightness type of each sub-block are respectively... The lower bound (i.e.) )and The upper bound (i.e.) Then, the average target brightness of this sub-block is: ; In the formula, For the first Average brightness of each sub-block before enhancement The target brightness average of the sub-block is represented by both gray levels. The lower bound and The upper bound is the lower and upper bounds of the target brightness range corresponding to the local brightness type of the sub-block, in grayscale. This refers to the aforementioned enhancement intensity coefficient. The principle behind this formula is to proportionally shift the current average brightness of the sub-block towards the target range: the difference term within parentheses represents the gap between the current brightness of the sub-block and the upper limit of the target range, multiplied by the enhancement intensity coefficient. The actual migration amount is then obtained; the darker the image, the greater the migration. The larger the value, the greater the migration amount, and the closer the target location is to the brighter side of the target area; the closer the image is to normal brightness, the greater the migration amount. The smaller the value, the more conservative the transfer. The transfer results are... The calculation is constrained within the target brightness range, ensuring that the target position neither deviates excessively from the original brightness state of the sub-block nor exceeds the reasonable range defined by the statistical prior of normal illumination. Substituting the target brightness range of each type into this general calculation formula yields the calculation formula for the average target brightness of each type of sub-block.
[0061] The formula for calculating the average target brightness of each type of sub-block is as follows: ; In the formula, For the first The average target brightness of each sub-block, expressed in gray levels; Indicates will Limited to the range The principle behind this set of formulas is to determine the target location based on type differences: the average brightness of extremely dark areas and darker areas is compared with... The brightness is increased proportionally towards the upper limit of the target range to enhance the visibility of targets in dark areas; the midtone area is adjusted only moderately with a weakening factor of 0.35 to smooth the transition and prevent abrupt changes in midtones. The calculation results are constrained within the brightness range of each type of target to ensure that the target position does not exceed the limit.
[0062] The target brightness in the highlight area is determined in the opposite direction to other types, by adjusting downwards. The amount of downward adjustment is calculated based on the degree to which it exceeds the highlight threshold. ; ; In the formula, This represents the amount by which the mean of the highlight area sub-blocks is reduced. As an alternative implementation method, the upper limit of the quantity is lowered. , The lower limit of the reduction amount associated with the peak gray level is calculated in gray levels. The above formula applies a limited reverse adjustment to the highlight area: when the average value of the sub-block exceeds 160 gray levels, the excess is calculated as a base reduction amount at 0.15 times the base value; when the peak gray level reaches 180 gray levels or above, an additional reduction of no less than 1.5 gray levels is applied. The final reduction amount is limited to within 5 gray levels by taking the smaller value, thereby suppressing overexposure diffusion and avoiding excessive darkening of highlight details.
[0063] After obtaining the target brightness, the brightness histogram of the sub-block before enhancement is translated according to the target brightness to obtain a translated brightness distribution that maintains the original distribution shape. Then, construct a central brightness distribution centered on the target brightness. The center brightness distribution can be a Gaussian distribution centered on the target brightness mean. A weighted fusion of the two distributions yields the target brightness distribution corresponding to this sub-block. ; In the formula, For the first Target brightness distribution of each sub-block; For the weighted average, a value of 0.3 can be used. The above formula synthesizes the two types of information sources according to their weights: the translational brightness distribution preserves the grayscale structure of local areas in the original image, making the enhancement target compatible with the actual content of the image; the central brightness distribution introduces prior constraints on the normal brightness range, providing a stable guide for enhancement. The target brightness distribution formed by the weighted fusion of the two provides a stable optimization target for enhancement parameter optimization without relying on a normally lit reference image that is strictly paired with the image to be enhanced.
[0064] Step S104: Using a set of nonlinear mapping parameters corresponding to the darkness level, nonlinear mapping enhancement is performed on the brightness of the low-light image to obtain the enhanced micro-image of the transmission line.
[0065] Optionally, the above-mentioned nonlinear mapping parameter set includes a first mapping parameter, a second mapping parameter, and a third mapping parameter corresponding to the dark area range, the midtone range, and the highlight range, respectively; Step S104 above includes: dividing the brightness value range into a dark area range, a midtone range, and a highlight range according to a preset first brightness boundary point and a second brightness boundary point; wherein the first brightness boundary point is smaller than the second brightness boundary point; for each pixel of the low-light image, mapping the brightness value of the pixel using a preset nonlinear mapping according to the range in which the pixel's brightness value is located; wherein the enhancement intensity of the preset nonlinear mapping is controlled by the mapping parameter corresponding to the range in which the pixel is located; obtaining the enhanced micro-image of the transmission line based on the brightness values of each pixel after mapping; wherein, in the nonlinear mapping parameter group corresponding to different darkness levels, the first mapping parameter is larger and the third mapping parameter is smaller for the darker darkness level.
[0066] The aforementioned nonlinear mapping enhancement refers to a processing method that transforms pixel brightness values point by point according to a preset nonlinear mapping relationship. Compared with linear stretching, nonlinear mapping can apply different transformation intensities at different positions within the brightness value range, thereby adapting to the differentiated enhancement needs of low-light images where dark areas require strong enhancement and bright areas require controlled enhancement.
[0067] In one alternative implementation, the fundamental function of the nonlinear mapping is chosen to be the hyperbolic tangent function: ; In the formula, These are the input variables for the function; The output range is limited to The function is continuous, smooth, and monotonically increasing. It was chosen because its smooth, monotonic variation and bounded output range facilitate the construction of stable brightness transformation curves. To control the curvature of the curve, a scaling parameter is introduced. ,get: ; In the formula, The scaling parameter is a dimensionless parameter that determines the intensity of change in the nonlinear curve: when When the size is small, the curve changes more gently, suitable for slightly dark images; when... When the value is larger, the curve changes more rapidly in dark or low-to-medium brightness areas, making it suitable for images with severe low light. In other words, The larger the value, the stronger the nonlinear stretching, but excessively large values... An excessively high value can also amplify noise in dark areas or cause excessive local contrast, so the value of k needs to be appropriate for the darkness of the image. In actual mapping, the pixel brightness value is normalized by dividing it by 255 and then input into the function. The function output is then multiplied by 255 to restore the grayscale value, thus matching the brightness range of the image.
[0068] Considering the varying enhancement requirements across different brightness ranges in low-light images—dark areas need stronger enhancement while highlight areas require overexposure suppression—using a single-parameter mapping curve across the entire brightness range makes it difficult to simultaneously address the needs of each range. In one optional implementation, the nonlinear mapping parameter set includes three scale parameters: a first mapping parameter, a second mapping parameter, and a third mapping parameter, denoted as... , , Accordingly, according to the preset first brightness dividing point Second brightness boundary point The brightness range is divided into dark areas sequentially. Intermediate adjustment range and highlight area ,in Less than As an optional implementation, the two dividing points can be fixed at gray levels 35 and 160, respectively. These values are set according to the brightness distribution characteristics of the micro-image of the transmission line. The area near gray level 35 corresponds to the transition position between dark areas and low to medium brightness, while the area near gray level 160 corresponds to the transition position between normal brightness and high brightness.
[0069] During mapping, for each pixel in the low-light image, a preset nonlinear mapping is used to transform the pixel's brightness value according to the interval in which the pixel's brightness value falls: for pixels with brightness values in the dark interval, the enhancement intensity of the mapping curve is controlled by the first mapping parameter k1; for pixels in the midtone interval, it is controlled by the second mapping parameter k2; and for pixels in the highlight interval, it is controlled by the third mapping parameter k3. The mappings of the three intervals are connected at the boundary points, so that the mapping result of the entire image transitions continuously. The specific method of connection processing is given in the following implementation. The values of the three parameters follow a configuration rule adapted to the degree of darkness: in the nonlinear mapping parameter group corresponding to different darkness levels, the darker the level, the larger the first mapping parameter, and the stronger the brightness compensation in the dark area; the smaller the third mapping parameter, the lower the risk of the highlight area continuing to expand; the midtone parameter remains relatively stable and undertakes the role of smooth transition between intervals. As a set of implementation values, the shared parameters for each level obtained by optimization on a batch of micro-photographed images of transmission lines are: slightly dark image , , Medium-dark images , , Dark images , , .
[0070] After mapping all pixels, the image is reconstructed based on the brightness values of each mapped pixel, resulting in an enhanced micro-image of the power transmission line. Since the shadow, midtone, and highlight regions are controlled by independent parameters, the enhancement process can improve the visibility of targets in shadows while suppressing overexposure in highlights. Furthermore, the parameter intensity is configured differently according to the darkness level, ensuring that images with different degrees of insufficient lighting achieve enhancement effects adapted to their darkness levels.
[0071] Optionally, before mapping the brightness value of each pixel in the low-light image using a preset nonlinear mapping according to the range in which the pixel's brightness value is located, the aforementioned method for enhancing the low-light image of a transmission line based on hierarchical nonlinear mapping further includes: performing offset correction on the preset nonlinear mapping so that the mapping corresponding to the dark area range is continuous with the mapping corresponding to the midtone range at the first brightness boundary point, and the mapping corresponding to the midtone range is continuous with the mapping corresponding to the highlight range at the second brightness boundary point; performing amplitude limiting processing on the preset nonlinear mapping after offset correction so that the brightness value output by the preset nonlinear mapping does not exceed the brightness value range; and performing monotonic processing on the preset nonlinear mapping after amplitude limiting so that the preset nonlinear mapping monotonically increases within the brightness value range.
[0072] The mapping of the shadow, midtone, and highlight regions is controlled by independent scale parameters. The different values of these parameters mean that the mapping curves for the three regions generally do not have equal values at the boundary points. If the three curves are directly stitched together, the mapping result will show abrupt changes at the first and second brightness boundary points. Pixels with brightness values in the vicinity of these boundary points will experience sudden grayscale differences after mapping, leading to blockiness and false edges in the enhanced image. To avoid this problem, a pre-defined non-linear mapping is offset corrected before pixel-by-pixel mapping. Let the original brightness value be... The range of values is The three-segment mapping under offset correction is expressed as: ; In the formula, Represents the original brightness value The enhanced brightness value is expressed in gray levels; For nonlinear mapping parameter sets; For the aforementioned hyperbolic tangent fundamental function; , This is the offset correction term at the first dividing point. , The offset correction term at the second dividing point is calculated in grayscale. Taking the first dividing point as an example, the offset correction term is defined using the anchor point method as follows: ; ; The anchor point setting at the second boundary point is similar. The principle of anchor point correction is to apply a translation to adjacent intervals using the function value at the boundary point as the anchor: at the first boundary point... At this point, the output of the dark area interval mapping is The output of the intermediate tone interval mapping without correction is Apply to the middle tuning range After the offset, it is in The output at that point becomes The output of the dark area at this point is exactly equal to that of the dark area, and the two curves are continuous at the dividing point; the correction principle at the second dividing point is the same. Through the anchor point connection method, the three mapping curves transition continuously, avoiding the block phenomenon in the enhancement result.
[0073] Offset correction resolves the continuity issue at the boundary points, but the output of the nonlinear mapping may still exceed the effective grayscale range of the image. After the piecewise curve is shifted by the offset, the output at some positions may be lower than 0 or higher than 255. The excess portion cannot be represented during image storage, and without uniform processing, it will also disrupt the relative brightness relationships between positions. Therefore, a limiting process is performed on the offset-corrected mapping: ; In the formula, Indicates will Limited to the range Inside; This is the mapped output after amplitude limiting, expressed in grayscale levels. The principle behind this process is to compare each point of the mapped output with the effective grayscale range; values below the lower bound are raised to the lower bound, and values above the upper bound are pushed down to the upper bound, ensuring that all outputs fall within the effective grayscale range. Within the effective range, the mapping results are guaranteed to be quantized and displayed correctly.
[0074] While amplitude limiting ensures the validity of the output, differences in segmentation parameters and the truncation effect of amplitude limiting can still cause non-monotonic fluctuations in the mapping curve at local locations: if pixels with higher original brightness become lower than pixels with lower original brightness after mapping, the original grayscale order of the image is disrupted, manifesting as edge inversion and local grayscale anomalies. Therefore, monotonicity processing is performed on the mapping after amplitude limiting: ; In the formula, The final mapped output after monotonicization, expressed in grayscale; the initial position of the recursion is taken as... The mapped output is the value after limiting. The principle behind this process is to compare brightness values point by point in ascending order, taking the larger of the current position's mapped output and the previous position's mapped output, thus making the mapping curve monotonically increase within the brightness range. After monotonication, pixels with higher original brightness will not have lower original brightness values than pixels with lower original brightness after enhancement, preserving the grayscale order of the image and eliminating edge inversion and local grayscale anomalies.
[0075] Offset correction, amplitude limiting, and monotonicity processing are all applied to the mapping curve itself and are completed before pixel-by-pixel mapping. These three processes sequentially address the continuity of the piecewise mapping, output validity, and grayscale order preservation. The mapping curve after these three processes serves as the final mapping relationship, applying a pixel-by-pixel transformation to the brightness of the low-light image. The enhanced brightness is Because curve correction and pixel mapping are separated, the same corrected mapping can be reused for all pixels, making the process stable and easy to implement.
[0076] Optionally, step S104 includes: converting the low-light image from a first color space to a second color space where the luminance and chrominance components are separated; extracting the luminance channel and chrominance channel from the low-light image converted to the second color space; performing nonlinear mapping enhancement on the luminance channel to obtain the enhanced luminance channel; fusing the enhanced luminance channel and the chrominance channel, and converting the fusion result back from the second color space to the first color space to obtain the enhanced micro-image of the transmission line.
[0077] The aforementioned nonlinear mapping enhancement acts on the brightness information of an image. However, micro-images of power transmission lines are typically acquired in RGB format. In the RGB color space, each pixel consists of red, green, and blue channel components, which simultaneously carry both brightness and color information, and these two are coupled. If brightness stretching is directly applied to each of the three channels in the RGB space, the proportional relationship between the channels is altered. Since color information is determined by the relative proportions between channels, direct enhancement easily causes hue shifts and saturation anomalies, manifesting as color distortion in areas such as the sky and vegetation. To avoid damaging color information during the enhancement process, in one optional implementation, the enhancement process is performed in a color space where the brightness and chromaticity components are separated.
[0078] During processing, low-light images are converted from a first color space to a second color space where the luminance and chrominance components are separated. The first color space refers to the color space used for image acquisition and storage, such as the RGB color space; the second color space refers to a color space where the luminance and chrominance components are separated. In a preferred embodiment, the YCbCr color space is used, where Y is the luminance channel, carrying the image's brightness information, and Cb and Cr are the chrominance channels, carrying the blue and red difference information, respectively. There is a deterministic linear conversion relationship between RGB and YCbCr, and the conversion process can be implemented using a standard color space conversion matrix. Besides YCbCr, color spaces such as YUV and Lab, which also have luminance-chrominance separation characteristics, can also be used as the second color space.
[0079] After conversion, the luminance and chroma channels are extracted from the image in the second color space. The luminance channel is represented as: ; In the formula, The input is a low-light image; This indicates a brightness channel extraction operation; The extracted luminance channel has its elements representing the luminance value of the corresponding pixel, expressed in grayscale. Subsequent non-linear mapping enhancement applies only to the luminance channel. implement: The channel adopts the spatial division method of the aforementioned illumination discrimination stage, with each sub-block corresponding one-to-one with the sub-blocks in the discrimination stage in terms of spatial location. Thus, the block statistics in the enhancement stage and the illumination state analysis in the discrimination stage are based on the same spatial reference. On this basis, a set of nonlinear mapping parameters corresponding to the darkness level is used to map Y pixel by pixel to obtain the enhanced luminance channel. The chroma channels Cb and Cr remain unchanged throughout the enhancement process and do not participate in mapping operations. The design of enhancing only the luminance channel is based on the characteristic of the YCbCr color space that relatively separates the luminance component from the chroma component: luminance adjustment is constrained within the Y channel, and chroma information is not affected by mapping operations, thereby reducing hue shift and saturation anomalies caused by directly stretching the RGB three channels.
[0080] The enhanced luminance channel needs to be recombined with chrominance information to form a complete color image. The image is fused with the original chrominance channels Cb and Cr, and the fusion result is converted from the second color space back to the first color space to obtain the enhanced micro-image of the transmission line: ; In the formula, This indicates the inverse transformation operation, namely chroma channel blending and inverse color space conversion; This is an enhanced image of a power transmission line. The principle behind this process is the reversibility of the luminance-chrominance separation space: enhancement only changes the value of the luminance channel, while the chrominance channel is preserved as is. After the two are recombined and inversely converted back to the RGB space, the brightness and darkness of the image are improved, while the colors of areas such as the sky, vegetation, and machinery remain consistent with the original image. The enhancement result achieves a balance between brightness visibility and color fidelity.
[0081] Optionally, after performing nonlinear mapping enhancement on the luminance channel to obtain the enhanced luminance channel, the low-light enhancement method for transmission line micro-images based on hierarchical nonlinear mapping further includes: performing contrast-limited local histogram equalization on the enhanced luminance channel to obtain a locally enhanced luminance channel; wherein the processing parameters of the local histogram equalization are preset fixed parameters, and the processing parameters are the same for different darkness levels, and the difference in enhancement intensity corresponding to different darkness levels is reflected by the corresponding nonlinear mapping parameter group; fusing the enhanced luminance channel with the chrominance channel includes: fusing the locally enhanced luminance channel with the chrominance channel.
[0082] After nonlinear mapping enhancement, the overall brightness distribution of the luminance channel has been adjusted, and the overall brightness of the dark areas has been improved. However, for targets such as conductors, towers, roads, and machinery, the discernibility of local textures and edges remains limited simply by improving the overall brightness. In one optional implementation, the luminance channel enhanced by nonlinear mapping is further subjected to contrast-limited local histogram equalization to obtain a locally enhanced luminance channel, which is then fused with the chroma channel for output.
[0083] Contrast-limited local histogram equalization, also known as contrast-limited adaptive histogram equalization, involves dividing an image into several local regions, performing histogram equalization on each region, limiting the contrast enhancement of each region, and smoothing the boundaries between adjacent regions through interpolation. This method operates on local regions of the luminance channel, specifically enhancing grayscale differences within each region, thereby improving the local discernibility of dark areas such as power lines, towers, roads, and machinery. The contrast-limiting mechanism suppresses the amplification of noise by histogram equalization in flat regions. The processing parameters are preset fixed parameters, including, for example, the size of the local region division and the contrast-limiting threshold. As an optional implementation, the image block size can be set to 8×8, and the contrast-limiting threshold can be set to 0.01 to 0.02, where the division size is in pixels and the contrast-limiting threshold is dimensionless. The reason for using fixed parameter settings is that if the local enhancement parameters change with the image or level, some local areas may be over-enhanced, leading to noise amplification and block effects; a fixed window size and a limited contrast threshold constrain the intensity of local enhancement within a stable range, ensuring the stability of the processing results.
[0084] Furthermore, corresponding to different levels of darkness, the processing parameters for local histogram equalization remain the same, and the differences in enhancement intensity corresponding to different levels of darkness are only reflected through the corresponding nonlinear mapping parameter set. This design concentrates the hierarchical differentiated enhancement control in the nonlinear mapping stage: the mapping parameter set is responsible for adjusting the enhancement intensity according to the darkness level, while local histogram equalization remains consistent across levels, only responsible for enhancing local textures. In this way, the entry point for adjusting the enhancement intensity is singular, avoiding the uncontrollable superposition caused by the dual adjustment of the mapping stage and the local enhancement stage, and also keeping the processing flow of images of different levels consistent.
[0085] After local histogram equalization, the object of the fusion stage is replaced by the locally enhanced luminance channel instead of the nonlinearly mapped luminance channel. This involves fusing the locally enhanced luminance channel with the original chroma channel and converting it back from the second color space to the first color space to output the final enhanced image. Because the local enhancement only applies to the luminance channel, the chroma channel remains in its original state throughout the entire processing. Therefore, the final enhanced image improves the visibility of dark textures while maintaining consistent color reproduction with the original image.
[0086] To facilitate understanding of the working principle of the low-light enhancement method for transmission line micro-images based on hierarchical nonlinear mapping, this application provides a specific application example of this method in a certain application scenario. In this application scenario, the method utilizes the scene characteristic of transmission line micro-images where the upper sky is brighter and the lower target is darker. It combines global statistics with local histogram statistics for quality judgment and selects a set of three-segment nonlinear enhancement parameters with shared levels based on the overall darkness. This method does not require pixel-aligned normal lighting images in the same scene. Instead, it obtains a reasonable brightness range through normal lighting micro-image data statistics and dynamically constructs the target distribution based on the local brightness distribution of the image to be enhanced. Figure 2 and Figure 3 As shown, the above-mentioned low-light enhancement method for transmission line micro-images based on hierarchical nonlinear mapping mainly includes: (1) Low light quality judgment and dark level classification stage; like Figure 4 As shown, based on the spatial distribution characteristics of the transmission line micro-image—the sky being brighter at the top and the target being darker at the bottom—the image is spatially divided into 3×3 rectangular sub-regions, denoted as... =1,2,3). The reason for choosing a 3×3 grid is twofold: First, this division method can effectively separate typical sky areas from ground and tower areas, thus corresponding to different lighting characteristics in space; second, for micro-images of common resolutions, each sub-block contains approximately 230,000 pixels, a sufficient sample size to ensure the statistical stability and peak discernibility of the brightness histogram, avoiding drastic fluctuations in the histogram caused by overly fine division. By independently calculating the brightness histogram for each sub-block, key statistics reflecting the local lighting state can be obtained, mainly including the sub-block brightness mean and the histogram peak gray level. The mean reflects the overall brightness level of the area, while the peak indicates the dominant background or target brightness level.
[0087] Let the input transmission line micro-image be Image size is First, Convert to grayscale image And calculate the global grayscale mean of the entire image: .in, Indicates the position of the grayscale image The pixel value at that location. Average grayscale value. The smaller the value, the lower the overall brightness of the image. For each sub-block... Calculate its brightness histogram : .in, Indicates the first The grayscale value in each sub-block is The number of pixels, This is the indicator function. Then, the most frequent gray value in this sub-block is extracted as the local histogram peak gray value. : Peak grayscale This reflects the dominant background or target brightness level within that sub-block. If The smaller value indicates that a large number of pixels in this area are concentrated in the low grayscale range, indicating significant insufficient lighting.
[0088] Using the aforementioned local statistics, a discrimination criterion can be established to distinguish between normal-quality images and low-light images requiring enhancement. Considering that the severity of insufficient illumination varies significantly among samples classified as low-light images, it is not appropriate to use the same set of enhancement parameters. Therefore, a low-light level classification mechanism is further introduced. First, for a given peak grayscale threshold... Count the number of sub-blocks whose peak grayscale value is lower than the threshold among the nine sub-blocks: .in, For indicator functions. When A larger value indicates the presence of multiple dark sub-regions in the image, suggesting that the darkness has a certain spatial range and is not caused by a single local shadow or accidental edge area. Based on the grayscale distribution characteristics of transmission line micro-images, three sets of darkness level judgment thresholds are set. The darkness level is defined as follows: ; in, , , These represent light, medium, and dark shades of darkness, respectively. This indicates a normal image.
[0089] (2) Luminance spatial conversion and block luminance statistics stage; For images requiring enhancement, the RGB image is converted to the YCbCr color space, and the luminance channel Y is extracted. The YCbCr space separates the luminance and chrominance components; therefore, this embodiment only enhances the Y channel while keeping the Cb and Cr chrominance channels unchanged, thereby reducing hue shift and saturation anomalies caused by directly stretching the RGB three channels. The luminance channel is represented as: .in, (·) indicates the luminance channel extraction operation. Luminance channel Using the aforementioned grayscale image The space is divided into 3×3 sections, with each sub-block corresponding one-to-one in spatial location. For ease of expression in subsequent formulas, the 3×3 regions are numbered in a fixed order. and the brightness channel The b-th sub-block in the array is denoted as: .in, Indicates the first Each block, and These represent the start and end positions of the block in the row direction, respectively, c b s and These represent the start and end positions of the block along the column direction, respectively. For each block, calculate its average brightness. Standard deviation Normalized histogram and histogram peak The block-normalized histogram is defined as follows: , .in, Indicates the first The gray level in each block is pixel ratio, This indicates that the grayscale value in this block is equal to The number of pixels. The histogram peak is used to describe the location of the most concentrated grayscale position of pixels in this block, defined as: Based on the average and peak brightness of each area, the local region is divided into extremely dark areas, moderately dark areas, mid-tone areas, and highlight areas: ; The above thresholds are set by combining the local brightness statistics of the micro-image and the grayscale range. This is achieved by simultaneously using the mean value. and peak Making a judgment can avoid misjudgments caused by relying solely on the mean; the judgment of the local block type does not conflict with the dark level classification of the entire image, as the two describe the local brightness attribute and the overall darkness, respectively.
[0090] (3) Predefined target brightness distribution construction stage; In the absence of strictly matched normal lighting images, this embodiment utilizes statistical results from micro-images of power transmission lines under normal lighting to pre-set reasonable target mean ranges for different local areas. As one implementation, the target mean ranges for extremely dark areas, relatively dark areas, mid-tone areas, and highlight areas can be set to [95, 125], [115, 145], [135, 160], and [175, 210], respectively, and denoted as _____. The lower and upper bounds of the range of the target mean of each block are respectively and .
[0091] Based on the global grayscale average of the entire image and the ratio of pixels in the dark area Determine the strength coefficient The proportion of pixels in the dark area is defined as follows: .in, This indicates the number of pixels with grayscale values in the range of 0 to 80; These represent the height and width of the input image, respectively. and Enhanced strength coefficient Defined as: ; The darker the image, The larger the value, the more the target distribution migrates to brighter areas; the closer the image is to normal brightness, the better. The smaller the value, the more conservative the enhancement. For extremely dark and relatively dark areas, the average brightness is increased to match the target range to enhance the visibility of targets in dark areas. .in, This represents the average brightness of the original blocks. Indicates the average brightness of the target. Indicates the strength enhancement coefficient. This means restricting x to the interval Inside.
[0092] Based on the average brightness of the blocks and histogram peak gray level The local area is divided into extremely dark regions, moderately dark regions, midtone regions, and highlight regions. This local area type is used to construct the target brightness distribution and does not conflict with the overall image's classification of light, moderate, and heavy darkness levels; the former describes local brightness attributes, while the latter is used to determine the shared enhancement parameters corresponding to the same darkness level. Specifically, the target mean of each type of local area is calculated as follows: ; For highlight areas, the target mean value no longer shifts upwards, but is appropriately reduced based on the degree to which it exceeds the highlight threshold. The amount of reduction in the mean value for highlight areas... The calculation is as follows: ; in:; ; As one implementation method, =5. Therefore, when the mean of the highlight patch exceeds 160 or the peak gray level of the histogram... When it reaches 180 or above, through The target mean is reduced by a limited amount, and the reduction is limited to no more than 5 gray levels, thereby suppressing overexposure diffusion while avoiding excessive darkening of highlight details.
[0093] After obtaining the target mean, the original block histogram is shifted to obtain a candidate target distribution that preserves the original distribution shape. Simultaneously, a Gaussian target distribution is constructed centered on the target mean. Finally, the two are weighted and merged to form the block target distribution: .in, For mixed weights, This is the final target probability distribution. This target distribution preserves the grayscale structure of local regions in the original image while introducing prior constraints within the normal brightness range. It provides a stable target for optimizing enhancement parameters without relying on a normally illuminated reference image that is strictly paired with the image to be enhanced. As one implementation method, 0.3 is acceptable.
[0094] (4) Three-stage nonlinear brightness mapping stage; The following nonlinear function is selected as the basis function for the brightness enhancement curve: Its output range is limited to The function is continuous, smooth, and monotonic. To control the curvature of the curve, a scaling parameter is introduced. ,get: .in, This determines the intensity of the change in the nonlinear curve. When When the value is smaller, the curve changes more gently, suitable for slightly dark images. When... When the value is larger, the curve changes more rapidly in dark or low-to-medium brightness areas, making it suitable for images with severe low light levels. In other words, The larger the value, the stronger the nonlinear stretching, but excessively large values... Values can also lead to amplified noise in dark areas or excessive local contrast. Figure 5 Showing When the value is 0.5, 1, 2 and 5 Visualize the curve.
[0095] Let the original brightness value be x, with a range of [0, 255]. Based on two boundary points b1 and b2, the brightness range is divided into three intervals: And set the parameter vector. The enhancement intensity of the shadows, midtones, and highlights is controlled separately. As one implementation method, the dividing point is fixed at a gray level. =35 and =160. Based on the basic functions, a three-segment brightness mapping is constructed: ; in, Represents the original brightness value Enhanced brightness value , , , The enhancement intensity of the shadows, midtones, and highlights is controlled separately. To ensure continuity of the three curves at the dividing points, an anchor point correction method is used to define the offset term. The anchor point term at the first dividing point is: , The anchor point settings at the second dividing point are similar. Connecting the three mapping curves via anchor points ensures a continuous transition and avoids blocky enhancement results. Subsequently, the mapping curves are truncated and monotonicized: , This process ensures that pixels with higher original brightness will not fall below pixels with lower original brightness after enhancement, thus maintaining the image's grayscale order and reducing edge inversion and local grayscale anomalies. For the input image's brightness channel... The enhanced luminance channel is: After mapping, a contrast-limited adaptive histogram equalization process is further applied to enhance local texture and edge contrast. Finally, the enhanced luminance channel is fused with the original chroma channel to obtain the enhanced image. .
[0096] (5) Batch parameter optimization stage under objective constraints; This application does not independently tune parameters for each image. Instead, it searches for a set of shared parameters K for the parameter optimization image set for each darkness level to improve the consistency of batch processing of micro-images of the same darkness level. For each set of candidate parameters, the enhanced brightness image is first obtained according to a three-segment mapping, and then the histogram of each enhanced block is calculated. With target distribution The differences between them.
[0097] First, a block-based target distribution loss is used to constrain the brightness distribution of the enhanced local region. Let the enhanced region be... The histogram of each block is as follows The target distribution is Then we have: ;
[0098] Where MMD(·) represents the maximum mean difference measure. and They are respectively and In the The probability of each brightness level This is the bandwidth parameter. The kernel function is defined as: ; Secondly, the block mean and peak constraints are combined into a luminance position loss, and further contrast preservation loss and highlight protection loss are introduced: the luminance position loss consists of the deviation between the block luminance mean, the histogram peak value and the corresponding target value; the contrast preservation loss constraint does not reduce the local standard deviation excessively before and after enhancement, avoiding local structure flattening; the highlight protection loss only applies to the highlight block, suppressing the diffusion of the bright part into the saturation area.
[0099] Specifically, the total number of blocks is B, and in this embodiment, B=9. The brightness position loss is defined as: ; This applies to all local blocks. The contrast preservation loss is defined as: ; in, and These represent the standard deviations of block brightness before and after enhancement, respectively. This item applies to all local blocks and is used to avoid local structural flattening.
[0100] Highlight protection loss is defined as: ; Where is the indicator function. For the first The set of pixels within each block and These represent the pixels before and after enhancement, respectively. brightness value, Indicates the allowed increase in specular brightness. This item only applies to... This applies to the segmentation of highlight areas to suppress the diffusion of bright areas into saturated areas.
[0101] Finally, the enhancement loss for a single image is defined as: ; in, These are the weighting coefficients for each loss. As one implementation method, the weights for each loss can be set as follows: =1.00、 =0.35、 =0.30、 =0.80, corresponding to distribution distance loss, brightness position loss, contrast retention loss, and highlight protection loss, respectively.
[0102] For a batch of images within the same darkness level, both the average loss and the worst-case loss are considered to avoid the optimization parameters being suitable only for the majority of samples, resulting in the failure of enhancement for a few extremely low-light or locally high-light images: ; ; in, As one implementation method, the worst sample loss weight is used. A value of 0.20 can be chosen to allow the worst sample loss to participate in the batch objective function at a smaller proportion, which both constrains samples in extreme low light or local high light and avoids a single abnormal sample dominating the optimization of overall parameters. Denotes the candidate parameter search space, parameter search space Specifically defined as: ; in, , , The nonlinear mapping intensity is controlled separately for the shadow, midtone, and highlight regions, with a discrete search step size of 0.10 for each. The above ranges are preset based on the brightness distribution characteristics of transmission line micro-images: shadow areas require stronger enhancement, therefore... Set a larger search range; the mid-tone area should have a smooth transition, therefore Set to medium range; overexposure diffusion needs to be suppressed in highlight areas, therefore Set it to a smaller range. This reduces the risk of abrupt changes in midtones and over-enhancing highlights while ensuring shadow enhancement capabilities.
[0103] This represents the optimal enhancement parameters corresponding to the darkness level, and the parameter search uses a grid search. The objective function guides the enhancement results towards a reasonable brightness distribution through block target distribution constraints and brightness position constraints, and maintains the stability of local structures and highlight areas using contrast preservation constraints and highlight protection constraints; at the same time, it combines batch average loss and worst sample loss to improve the batch applicability and processing consistency of enhancement parameters under the same darkness level.
[0104] The aforementioned batch parameter optimization process is executed as an offline parameter determination stage. After optimization, the optimal shared parameters corresponding to the three levels of low, medium, and high darkness are saved respectively. In the actual transmission line micro-image processing, it is not necessary to re-perform parameter search for each new input image; only after completing the low-light quality discrimination and darkness level identification, the corresponding level of shared optimal parameters are called for enhancement.
[0105] (6) Enhance the image generation and parameter reuse stage; After optimizing the shared parameters for light, moderate, and heavy darkness levels, the optimal parameters for each level are saved. For a new macro image to be processed, its need for enhancement and its darkness level are first determined according to the low-light quality discrimination and level classification rules; if it is a normal image, the original image is directly output; if it is a low-light image, the shared optimal parameters corresponding to that level are read. A three-segment nonlinear mapping is performed on the Y channel of the YCbCr space.
[0106] After mapping, local texture enhancement can be further performed on the Y channel using contrast-limited adaptive histogram equalization to improve the local discernibility of dark areas such as power lines, towers, roads, and machinery. Finally, the processed Y channel is recombined with the original Cb and Cr channels and converted back to RGB space to obtain the final enhanced image. Since the chroma channel does not participate in non-linear mapping, it can reduce color shift in areas such as the sky, vegetation, and machinery.
[0107] As a set of non-limiting implementation parameters, based on a batch of micro-images of transmission lines, the following slightly dark images were obtained through optimization using the aforementioned level-sharing parameters: =1.6、 =0.8、 =0.8; Moderately dark image =2.3、 =0.8、 =0.6; Dark image =2.5、 =0.8、 =0.5. As the darkness increases, the shadow parameters... Increase and highlight parameters This reduction allows for stronger brightness compensation in dark areas while mitigating the risk of further expansion of highlight areas. The specific values described above are merely illustrative examples and do not constitute a limitation on the scope of protection of this invention.
[0108] To verify the effectiveness of the method provided in this application's embodiments, the classic low-light enhancement methods compared include: gamma correction, Contrast Limited Adaptive Histogram Equalization (CLAHE), and Retinex. The deep learning algorithms compared include Zero-DCE, URetinex-Net, PairLIE, and RD-Net (retinal decomposition network). The method provided in this application's embodiments is tested using optimized parameters; the parameter optimization results for images at different darkness levels are shown in Table 1.
[0109] Table 1 Results of image optimization parameters at different darkness levels ; Figure 6The comparison between the proposed method and classic low-light enhancement methods is presented. Original low-light images generally suffer from insufficient visibility in dark areas, unclear edges of conductors and towers, and difficulty in identifying targets on the ground, especially in twilight and nighttime scenes where machinery and construction areas are obscured by shadows. While gamma correction and CLAHE can improve overall brightness, the enhancement is uneven, resulting in insufficient recovery of dark details and limited differentiation between fine line targets and the background.
[0110] The method provided in this application embodiment exhibits a more stable enhancement effect under different low light levels: in daylight low light scenes, it effectively improves the visibility of ground passages, vegetation and construction areas while maintaining smooth brightness in the sky area; in twilight backlight scenes, it improves the recognition of targets below while preserving the natural layers of the sky; in nighttime scenes, dark textures, tower structures and distant mechanical targets are presented more clearly, and slender targets such as wires maintain good continuity.
[0111] Figure 7 The comparison results between the proposed method and deep learning-based low-light enhancement methods are presented. Zero-DCE can improve overall brightness, but it is not well adapted to complex lighting distributions: it is prone to overexposure in slightly dark images, and the edges of wires, towers, and distant targets are not clear enough in moderately and heavily dark images. URetinex-Net and RD-Net have insufficient enhancement or weakened details in some scenes, and are unstable in processing strong light areas and fine line structures. PairLIE has certain advantages in dark detail recovery, but the results are prone to edge blurring, noise amplification, and local details are easily buried by strong light.
[0112] To measure the visual quality and perceived naturalness of the augmentation results, two no-reference evaluation metrics were used: NIQE (Natural Image Quality Evaluator) and PI (Perceptual Index). NIQE measures statistical naturalness by the Mahalanobis distance between the test image and the statistical model of the natural image; a lower value indicates that the augmentation result is closer to the natural image. PI is obtained by fusing the perceptual regression score with NIQE; a lower value indicates that the augmentation result achieves a better balance between naturalness and perceived quality.
[0113] Table 2 presents the no-reference quality metrics for each method on the micro-image dataset of transmission lines. It can be seen that the method provided in this application achieves the lowest NIQE and PI in light, moderate, and heavy darkness scenes, with minimal numerical fluctuations (NIQE remains between 3.40 and 3.70, and PI between 2.53 and 2.58). This indicates that the enhancement strategy based on target distribution constraints and hierarchical parameter optimization can achieve more stable visual quality under different low light levels. Among the comparative methods, Zero-DCE is generally superior, but as the darkness increases, its NIQE rises from 3.71 to 4.80, and its PI rises from 2.71 to 3.28, indicating insufficient stability.
[0114] Table 2. Performance metrics of different deep learning low-light enhancement methods on the power transmission line micro-video dataset. ;
[0115] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method for enhancing low-light illumination in micro-images of transmission lines based on hierarchical nonlinear mapping, characterized in that, The method includes: Acquire micro-images of transmission lines, perform brightness statistics on the micro-images of transmission lines, and determine whether the micro-images of transmission lines are low-light images that need to be enhanced based on the brightness statistics results; For the low-light image, the darkness level of the low-light image is determined based on the brightness statistics; wherein, the darkness level includes at least two levels with different degrees of darkness; Obtain a set of nonlinear mapping parameters corresponding to the darkness level; wherein, different darkness levels correspond to different sets of nonlinear mapping parameters, and the sets of nonlinear mapping parameters are used to control the enhancement intensity of the brightness nonlinear mapping; By employing a set of nonlinear mapping parameters corresponding to the darkness level, nonlinear mapping enhancement is performed on the brightness of the low-light image to obtain an enhanced micro-image of the transmission line.
2. The method for enhancing low-light illumination of transmission line micro-images based on hierarchical nonlinear mapping according to claim 1, characterized in that, The step of performing brightness statistics on the micro-images of the transmission line includes: The micro-image of the power transmission line is spatially divided into multiple sub-blocks; Calculate the global average brightness of the entire micro-image of the transmission line and the peak grayscale of the brightness histogram of each sub-block; The step of determining whether the micro-image of the transmission line is a low-light image to be enhanced based on the brightness statistics includes: For each darkness level, a set of corresponding combined discrimination conditions are set; wherein, the combined discrimination conditions include: the number of sub-blocks whose peak grayscale is lower than the preset peak threshold corresponding to the darkness level is not less than the preset number threshold, and the global average brightness is lower than the preset average threshold corresponding to the darkness level. When the micro-image of the transmission line meets any of the combined discrimination conditions corresponding to the darkness level, the micro-image of the transmission line is determined to be a low-light image to be enhanced. When the micro-image of the transmission line does not meet any of the combined discrimination conditions corresponding to the darkness level, the micro-image of the transmission line is judged to be a normal lighting image, and the micro-image of the transmission line is directly output. For the low-light image, determining the darkness level of the low-light image based on the brightness statistics includes: The darkness level corresponding to the combination of discrimination conditions satisfied by the low-light image is determined as the darkness level to which the low-light image belongs.
3. The low-light enhancement method for micro-images of transmission lines based on hierarchical nonlinear mapping according to claim 2, characterized in that, The darkness levels include light darkness, medium darkness, and heavy darkness, with the darkness increasing sequentially. In the combined discrimination conditions corresponding to the light darkness, medium darkness, and heavy darkness levels, the preset peak thresholds are, in sequence, a first peak threshold, a second peak threshold, and a third peak threshold, and the preset mean thresholds are, in sequence, a first mean threshold, a second mean threshold, and a third mean threshold. Specifically, the first peak threshold, the second peak threshold, and the third peak threshold increase sequentially, as do the first mean threshold, the second mean threshold, and the third mean threshold. The step of determining the darkness level corresponding to the combination of discrimination conditions satisfied by the low-light image as the darkness level to which the low-light image belongs includes: In descending order of darkness, the low-light images are sequentially judged to determine whether they meet the combined discrimination conditions corresponding to each darkness level. The darkness level corresponding to the first combined discrimination condition that is met is determined as the darkness level to which the low-light image belongs.
4. The low-light enhancement method for micro-images of transmission lines based on hierarchical nonlinear mapping according to claim 1, characterized in that, The nonlinear mapping parameter set includes a first mapping parameter, a second mapping parameter, and a third mapping parameter, respectively corresponding to the dark area range, the midtone range, and the highlight range; The process involves using a set of nonlinear mapping parameters corresponding to the darkness level to perform nonlinear mapping enhancement on the brightness of the low-light image, resulting in an enhanced micro-image of the transmission line. This includes: According to the preset first brightness boundary point and second brightness boundary point, the brightness value range is divided into the dark area range, the mid-tone range and the highlight range in sequence; wherein, the first brightness boundary point is smaller than the second brightness boundary point; For each pixel of the low-light image, a preset nonlinear mapping is used to map the brightness value of the pixel according to the range in which the pixel's brightness value is located; wherein, the enhancement intensity of the preset nonlinear mapping is controlled by the mapping parameters corresponding to the range in which the pixel is located. Based on the brightness values of each pixel after mapping, the enhanced micro-image of the transmission line is obtained; among the nonlinear mapping parameter groups corresponding to different darkness levels, the first mapping parameter is larger and the third mapping parameter is smaller for darker darkness levels.
5. The low-light enhancement method for micro-images of transmission lines based on hierarchical nonlinear mapping according to claim 4, characterized in that, Before mapping the brightness value of each pixel in the low-light image using a preset non-linear mapping based on the range in which the pixel's brightness value falls, the method further includes: The preset nonlinear mapping is offset and corrected so that the mapping corresponding to the dark area and the mapping corresponding to the midtone area are continuous at the first brightness boundary point, and the mapping corresponding to the midtone area and the mapping corresponding to the highlight area are continuous at the second brightness boundary point. The preset nonlinear mapping after offset correction is subjected to amplitude limiting processing so that the brightness value output by the preset nonlinear mapping does not exceed the brightness value range. The preset nonlinear mapping after the amplitude limiting process is monotonicized so that the preset nonlinear mapping monotonically increases within the range of brightness values.
6. The method for enhancing low-light illumination of transmission line micro-images based on hierarchical nonlinear mapping according to claim 1, characterized in that, The step of obtaining the non-linear mapping parameter set corresponding to the darkness level includes: During the offline phase, for each darkness level, multiple sample images belonging to that darkness level are acquired. For each candidate nonlinear mapping parameter group, the multiple sample images are enhanced using the candidate nonlinear mapping parameter group respectively, and the shared parameter group corresponding to the dark level is determined from each candidate nonlinear mapping parameter group based on the difference between the enhancement result and the preset enhancement target. Save the shared parameter group corresponding to each of the aforementioned darkness levels; When the image is online, after determining the darkness level of the low-light image, the saved shared parameter group corresponding to the darkness level is called as the nonlinear mapping parameter group corresponding to the darkness level.
7. The low-light enhancement method for micro-images of transmission lines based on hierarchical nonlinear mapping according to claim 6, characterized in that, The step of determining the shared parameter set corresponding to the darkness level from each candidate nonlinear mapping parameter set based on the difference between the enhancement result and the preset enhancement target includes: Each of the sample images is spatially divided into multiple sub-blocks; wherein the sample images before and after enhancement use the same spatial division; Based on the enhancement results and the preset enhancement target, the enhancement loss corresponding to each sample image is determined; wherein, the enhancement loss includes distribution difference loss, brightness position loss, contrast preservation loss, and specular protection loss; the distribution difference loss is used to quantify the difference between the brightness distribution of each sub-block of the enhanced sample image and the corresponding target brightness distribution in the preset enhancement target; the brightness position loss is used to quantify the deviation between the brightness statistics of each sub-block of the enhanced sample image and the corresponding target brightness in the preset enhancement target; the contrast preservation loss is used to quantify the decrease in the brightness dispersion of the same sub-block before and after enhancement; the specular protection loss is used to quantify the degree to which the enhanced brightness value in the specular sub-block exceeds the preset allowable increment, wherein the specular sub-block is the sub-block whose brightness statistics before enhancement meet the preset specular condition; Based on the average value of the enhancement loss corresponding to the multiple sample images, and the enhancement loss of the sample image with the largest enhancement loss among the multiple sample images, the comprehensive loss corresponding to the candidate nonlinear mapping parameter group is determined; The candidate nonlinear mapping parameter group that satisfies the preset optimization conditions is determined as the shared parameter group corresponding to the dark level.
8. The method for enhancing low-light illumination of transmission line micro-images based on hierarchical nonlinear mapping according to claim 7, characterized in that, The preset enhancement target is constructed in the following way: Multiple local brightness types are preset, and target brightness ranges are preset for each local brightness type based on the brightness statistics of micro-images of power transmission lines under normal lighting. For each sub-block, the local brightness type of the sub-block is determined based on the brightness statistics of the sub-block before enhancement; The target brightness of the sub-block is determined based on the target brightness range corresponding to the local brightness type to which the sub-block belongs, the brightness statistics of the sub-block before enhancement, and the overall darkness of the sample image to which the sub-block belongs. The brightness histogram of the sub-block before enhancement is shifted according to the target brightness to obtain the shifted brightness distribution; A central brightness distribution is constructed with the target brightness as the center; The translational brightness distribution and the center brightness distribution are weighted and fused to obtain the target brightness distribution corresponding to the sub-block; wherein, for the sub-block whose local brightness type is specular, the target brightness is reduced relative to the brightness before enhancement of the sub-block, and the reduction does not exceed a preset amplitude threshold.
9. The method for enhancing low-light illumination of transmission line micro-images based on hierarchical nonlinear mapping according to claim 1, characterized in that, The process of performing nonlinear mapping enhancement on the brightness of the low-light image to obtain an enhanced micro-image of the transmission line includes: The low-light image is converted from a first color space to a second color space that separates the luminance and chrominance components. Extract the luminance and chroma channels from the low-light image converted to the second color space; The luminance channel is enhanced by performing nonlinear mapping enhancement to obtain the enhanced luminance channel; The enhanced luminance channel is fused with the chroma channel, and the fusion result is converted from the second color space back to the first color space to obtain an enhanced micro-image of the power transmission line.
10. The method for enhancing low-light illumination of transmission line micro-images based on hierarchical nonlinear mapping according to claim 9, characterized in that, After performing nonlinear mapping enhancement on the luminance channel to obtain the enhanced luminance channel, the method further includes: The enhanced luminance channel is subjected to contrast-limited local histogram equalization to obtain a locally enhanced luminance channel; wherein, the processing parameters of the local histogram equalization are preset fixed parameters and correspond to different dark levels. The processing parameters are the same, and the difference in enhancement intensity corresponding to different dark levels is reflected by the corresponding nonlinear mapping parameter group. The step of fusing the enhanced luminance channel with the chroma channel includes: fusing the locally enhanced luminance channel with the chroma channel.
