An image enhancement method based on target protection

By statistically analyzing the grayscale and gradient histograms of images, and using a weighted approach to calculate the gradient difference and perform grayscale mean unification, the problems of excessive background enhancement and loss of small targets after image enhancement are solved, achieving visual consistency and target protection in image enhancement.

CN116563140BActive Publication Date: 2026-03-13电视电声研究所(中国电子科技集团公司第三研究所)
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-11
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing technologies suffer from problems such as excessive background enhancement and loss of small targets after image enhancement.

Method used

By statistically analyzing the grayscale histogram and gradient histogram of the image, the gradient difference is calculated using a weighted approach, and the grayscale mean is uniformly processed to suppress excessive background enhancement while preserving the details of small targets.

Benefits of technology

Maintaining visual consistency after image enhancement protects small target details from loss, avoids excessive background enhancement, and improves image quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116563140B_ABST
    Figure CN116563140B_ABST
Patent Text Reader

Abstract

This invention discloses an image enhancement method based on target protection, comprising: acquiring the image to be enhanced; statistically analyzing the grayscale histogram of the image, and recording the number of pixels {N} at each grayscale level in the image. p p∈[0, 255]}, where N p This represents the number of pixels with gray level p, and records the number of pixels for the gray level with the most pixels as N. max ; Calculate the gradient difference between each pixel in the image and its neighboring pixels by adding weights; Calculate the gradient histogram {G} of the image. p Let p ∈ [0, 255], where Gp represents the sum of pixel gradients with gray level p; calculate the cumulative distribution function, and enlarge the gradient histogram to gray levels [15, 225]; perform mean averaging on the gray levels of each pixel in the image; assign values ​​to the pixels in the image, and output a new image. Using this invention, while suppressing excessive background enhancement, the details of small targets within the background are preserved, thus protecting the target in the enhanced image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image information processing, and in particular to an image enhancement method based on target protection. Background Technology

[0002] Image enhancement is a fundamental requirement for optoelectronic reconnaissance. During reconnaissance operations, optoelectronic equipment often produces images with unclear details and low contrast due to factors such as sensitivity and weather conditions, hindering user observation. Image enhancement is necessary to improve image details, especially edge details. Improving detail clarity enhances the user's visual sensitivity. Typically, targets have fewer pixels than the background, and their edges also have fewer pixels. When calculating gradient histograms, targets are often grouped into the background, further reducing their contrast and causing small targets to be missed. Conversely, background edges have more pixels and are more easily magnified, leading to over-enhancement and negatively impacting visual quality. Summary of the Invention

[0003] This invention provides an image enhancement method based on target protection, which at least solves the problems of excessive background enhancement and loss of small targets after image enhancement in the prior art.

[0004] An image enhancement method based on target protection proposed according to the present invention includes:

[0005] Obtain the image that needs enhancement;

[0006] Calculate the grayscale histogram of the image and record the number of pixels {N} for each grayscale level in the image. p ,p∈[0,255]}, where N p This represents the number of pixels with gray level p, and records the number of pixels for the gray level with the most pixels as N. max ;

[0007] The gradient difference between each pixel in the image and its neighboring pixels is calculated by adding weights.

[0008] Statistically analyze the gradient histogram {G} of the image. p ,p∈[0,255]}, where G p This represents the sum of the gradients of pixels with gray level p;

[0009] Calculate the cumulative distribution function and enlarge the gradient histogram to gray levels [15, 225].

[0010] The gray levels of each pixel in the image are averaged and uniformized.

[0011] The pixels of the image are assigned values, and a new image is output.

[0012] According to some embodiments of the present invention, acquiring the image to be enhanced further includes:

[0013] If the acquired image is a grayscale image, then the grayscale histogram is directly calculated.

[0014] If the acquired image is a color image, then the RGB color space of the color image is converted to the HLS color space, and the L luminance channel image of the HLS color space is extracted to perform a statistical grayscale histogram.

[0015] According to some embodiments of the present invention, the output of the new image further includes:

[0016] If the image is a grayscale image, the processed grayscale level is directly written back to the image and a new image is output.

[0017] If the image is a color image, the processed L brightness image is inserted back into the HLS color space to replace the original L brightness image. After converting the HLS color space to the RGB color space, a new image is output.

[0018] According to some embodiments of the present invention, after calculating the gradient histogram of the image, the method further includes:

[0019] The large-area gradient effect of the image is eliminated using Formula 1 as shown below;

[0020]

[0021] in This represents the sum of the gradients of pixels with gray level p after eliminating the influence of gradients in large regions.

[0022] According to some embodiments of the present invention, the calculation of the gradient difference between each pixel in the image and its neighboring pixels in a weighted manner is performed using Formula 2 as shown below:

[0023]

[0024] Where e represents a constant, P i,j N represents the gray level of (i, j). Pi,j This represents the number of pixels in the grayscale histogram corresponding to the grayscale level of pixel (i, j).

[0025] According to some embodiments of the present invention, the gradient histogram is enlarged to [15, 225] gray levels using Formula 3 as shown below;

[0026]

[0027] Among them, V mThis represents the enhanced gray level of a pixel with gray level m in the original image.

[0028] According to some embodiments of the present invention, the grayscale level unification processing of each pixel in the image is performed using the following formula 4:

[0029]

[0030] Among them, M a M is the grayscale mean of the processed image. o This represents the average grayscale value of the original image.

[0031] The technical solution in this embodiment of the invention extracts gradients from the acquired image using a weighted approach and uses a method of uniform grayscale mean to ensure consistent style before and after image enhancement. This suppresses excessive background enhancement while protecting small target details within the background from loss, thus protecting the target in the enhanced image.

[0032] The above description is merely an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention and to implement it in accordance with the contents of the specification, and in order to make the above and other objects, features and advantages of the present invention more apparent and understandable, specific embodiments of the present invention are described below. Attached Figure Description

[0033] Various other advantages and benefits will become apparent to those skilled in the art upon reading the following detailed description of the embodiments. The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. In the drawings:

[0034] Figure 1 This is a flowchart illustrating the image enhancement method based on target protection in an embodiment of the present invention;

[0035] Figure 2 This is the original image in the embodiments of the present invention;

[0036] Figure 3 This is the image processed by the image enhancement method in the embodiments of the present invention. Detailed Implementation

[0037] Exemplary embodiments of the invention will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this invention will be thorough and complete, and will fully convey the scope of the invention to those skilled in the art.

[0038] This invention proposes an image enhancement method based on target protection, referring to... Figure 1 ,include:

[0039] S1: Obtain the image to be enhanced. It is understood that the method of acquisition is not limited here; for example, it can be image data copied via a removable storage device, or received image data transmitted via communication means.

[0040] S2: Calculate the grayscale histogram of the image. Record the number of pixels {N} at each grayscale level in the image. p ,p∈[0,255]}. Where, N p This represents the number of pixels with gray level p, and records the number of pixels for the gray level with the most pixels as N. max .

[0041] S3: Calculate the gradient difference between each pixel in the image and its neighboring pixels by increasing the weights.

[0042] S4: Calculate the gradient histogram {G} of the image. p ,p∈[0,255]}. Where, G p This represents the sum of the pixel gradients for a gray level of p.

[0043] S5: Calculate the cumulative distribution function and enlarge the gradient histogram to [15, 225] gray levels;

[0044] S6: Perform a mean-unified processing on the gray levels of each pixel in the image to make the enhanced image visually similar to the original image.

[0045] S7: Assign values ​​to the pixels of the image and output a new image.

[0046] The technical solution in this embodiment of the invention extracts gradients from the acquired image using a weighted approach and uses a method of uniform grayscale mean to ensure consistent style before and after image enhancement. This suppresses excessive background enhancement while protecting small target details within the background from loss, thus protecting the target in the enhanced image.

[0047] Based on the above embodiments, further variant embodiments are proposed. It should be noted that, in order to keep the description brief, only the differences from the above embodiments are described in each variant embodiment.

[0048] According to some embodiments of the present invention, acquiring the image to be enhanced further includes:

[0049] If the acquired image is a grayscale image, then the grayscale histogram is directly calculated.

[0050] If the acquired image is a color image, then the RGB color space of the color image is converted to the HLS color space, and the L luminance channel image of the HLS color space is extracted to perform a statistical grayscale histogram. This invention uses color space transformation for color images, resulting in a better quality final image.

[0051] According to some embodiments of the present invention, the output of the new image includes:

[0052] If the image is a grayscale image, the processed grayscale level is directly written back to the image and a new image is output.

[0053] If the image is a color image, the processed L brightness image is inserted back into the HLS color space to replace the original L brightness image. After converting the HLS color space to the RGB color space, a new image is output.

[0054] According to some embodiments of the present invention, after calculating the gradient histogram of the image, the method further includes:

[0055] The large-area gradient effect of the image is eliminated using Formula 1 as shown below.

[0056]

[0057] in This represents the sum of the gradients of pixels with gray level p after eliminating the influence of gradients in large regions.

[0058] This avoids large grayscale jumps caused by excessive background gradients, which would result in the image being significantly magnified.

[0059] According to some embodiments of the present invention, the calculation of the gradient difference between each pixel in the image and its neighboring pixels in a weighted manner is performed using Formula 2 as shown below:

[0060]

[0061] Where e represents a constant, P i,j N represents the gray level of (i, j). Pi,j This represents the number of pixels in the grayscale histogram corresponding to the grayscale level of pixel (i, j).

[0062] In this embodiment, an adaptive weighting term is added when calculating the gradient. Since the target typically occupies only a few pixels in an image, with the rest being background, this weight indicates that the gradient between the target and the background is strengthened, but the weight between backgrounds is not increased or only slightly increased. Looking at the range of weight values, because the factor does not increase significantly, the overall gradient histogram does not change much, preventing some small noise pixels from being excessively amplified, thus ensuring visual consistency after image enhancement.

[0063] According to some embodiments of the present invention, the gradient histogram is enlarged to the [15, 225] gray level using the formula 3 shown below. This is because an image that is too bright or too dark will cause differences in visual effect. In addition, for the convenience of later processing, the image is enlarged to the [15, 225] gray level after enhancement.

[0064]

[0065] Among them, V m This represents the enhanced gray level of a pixel with gray level m in the original image. Using gray level protection of [15, 225] aligns with human visual perception, resulting in a smoother enhanced image that avoids overly bright or dark areas.

[0066] According to some embodiments of the present invention, in order to make the enhanced image visually similar to the original image and avoid over-enhancement, the gray levels of each pixel in the image are averaged using the following formula 4:

[0067]

[0068] Among them, M a M is the grayscale mean of the processed image. o This represents the average grayscale value of the original image.

[0069] The following describes in detail a database suitable for operation in two working modes, using a specific embodiment. It is important to understand that the following description is merely illustrative and not intended to limit the scope of the invention. Any similar structures or variations thereof employing the present invention should be included within the scope of protection of this invention.

[0070] In this embodiment, firstly, the image to be enhanced is acquired; the acquired image is a grayscale image, as referenced. Figure 2 Based on the grayscale values ​​of the acquired grayscale image, its grayscale histogram is plotted, and the number of pixels {N} at each grayscale level in the image is recorded. p ,p∈[0,255]}. Where, N p This represents the number of pixels with gray level p, and records the number of pixels for the gray level with the most pixels as N. max .

[0071] The gradient difference between each pixel in the image and its neighboring pixels is calculated by adding weights, using Equation 2 as shown below:

[0072]

[0073] Where e represents a constant, P i,j N represents the gray level of (i, j). Pi,j This represents the number of pixels with the gray level of pixel (i, j) in the gray-level histogram. The adaptive weight term is... These are the adaptive weights calculated based on the image parameters. Here, gradient statistics are performed in eight directions around the pixel, fully considering the edge direction and avoiding the loss of some edge gradients.

[0074] Statistically analyze the gradient histogram {G} of the image. p ,p∈[0,255]}. Where, G p This represents the sum of the pixel gradients for a gray level of p.

[0075] To avoid large grayscale jumps caused by excessive background gradients, which would result in the image being significantly magnified.

[0076] The large-area gradient effect of the image is eliminated using Formula 1 as shown below.

[0077]

[0078] in This represents the sum of the gradients of pixels with gray level p after eliminating the influence of gradients in large regions.

[0079] The grayscale levels of the image are enhanced using Formula 3 as shown below. Because an image that is too bright or too dark will cause differences in visual effect, and for the convenience of later processing, the image is enlarged to the [15, 225] grayscale level after enhancement.

[0080]

[0081] Among them, V m This represents the enhanced gray level of a pixel with gray level m in the original image.

[0082] To make the enhanced image visually similar to the original image, the gray levels of each pixel in the image are averaged using the following formula 4:

[0083]

[0084] Among them, M a M is the grayscale mean of the processed image. o This represents the average grayscale value of the original image.

[0085] Based on the calculated grayscale value The grayscale values ​​of the original image are rewritten to assign values ​​to pixels, and the processed new grayscale image is output, such as... Figure 3 As shown.

[0086] The technical solution adopted in this embodiment is based on protecting the contrast of the target in the image. It uses the adaptive weight term of the image to extract gradients and perform statistics, which effectively prevents the loss of small target details after image enhancement, while suppressing excessive background enhancement. Furthermore, after statistical histogram, the influence of large gradients in the background area is eliminated. The grayscale of each pixel in the image is averaged to avoid over-enhancement, eliminate visual differences, protect the details of the target in the enhanced image, and make the image more in line with human visual perception.

[0087] It should be noted that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention can have various modifications and variations, and the various embodiments can be freely combined in different ways. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

[0088] It should be noted that well-known methods, structures, and techniques are not shown in detail in this specification so as not to obscure the understanding of this specification.

Claims

1. A target protection based image enhancement method, characterized by, The method comprises the following steps: obtaining an image to be enhanced; counting a gray scale histogram of the image, recording the number of pixels of each pixel gray scale level in the image wherein N p represents the number of pixels of the gray scale level p, and recording the number of pixels of the gray scale level with the largest number of pixels as N max ; calculating the gradient difference between each pixel and its adjacent pixels in the image in an increased weight manner; statistically histogramming gradients of the image where G p represents the sum of pixel gradients at gray level p; calculating a cumulative distribution function to amplify the gradient histogram to [15, 225] gray levels; performing mean value uniform processing on the gray levels of each pixel in the image; assigning values to the pixels of the image and outputting a new image; The step of obtaining the image to be enhanced further comprises the following steps: if the obtained image is a gray image, directly counting a gray histogram; if the obtained image is a color image, converting the RGB color space of the color image into an HLS color space and extracting an L luminance channel image of the HLS color space to count a gray histogram; the step of outputting the new image further comprises the following steps: if the image is a gray image, directly writing the processed gray level back to the image and outputting a new image; if the image is a color image, inserting the processed L luminance image back to the HLS color space to replace the original L luminance image, converting the HLS color space into the RGB color space, and outputting a new image; after counting the gradient histogram of the image, the method further comprises the following steps: eliminating the large area gradient influence of the image by using formula 1 shown as follows: Official 1; wherein is the sum of the gradients of the pixels of gray level p after elimination of the influence of the large area gradients; the step of calculating the gradient difference between each pixel and its adjacent pixels in the image in an increased weight manner is processed by using formula 2 shown as follows: Equation 2; where e represents a constant, P i,j represents the gray level of (i, j), N Pi,j represents the number of pixels in the gray histogram for the gray level of pixel (i, j); the step of amplifying the gradient histogram to [15, 225] gray levels is processed by using formula 3 shown as follows: Official 3; wherein V m represents the enhanced gray level of the pixel with the gray level m in the original image; the step of performing mean value uniform processing on the gray levels of each pixel in the image is processed by using formula 4 shown as follows: Formula 4; where M a is the mean gray value of the processed image, and M o is the mean gray value of the original image.

Citation Information

Patent Citations

  • Infrared enhancement method based on gradient histogram

    CN113592750A

  • Infrared image enhancement method and system based on gray level saliency weight

    CN113628128A