Image enhancement method and device, electronic equipment and computer readable storage medium

By acquiring the grayscale distribution information and the equalization deviation coefficient of the aluminum casting image, the details blurring caused by the image enhancement of aluminum castings in the prior art are solved, and an effective image enhancement effect is achieved.

CN120259091AActive Publication Date: 2025-07-04SHENZHEN XINRUN FULIAN DIGITAL TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510753249.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-06
Publication Date
2025-07-04
Estimated Expiration
2045-06-06

AI Technical Summary

Technical Problem

When the prior art enhances the image of workpieces with low overall brightness and fine texture, such as aluminum castings, the gray scale of the bright part is compressed, resulting in blurring or loss of workpiece details.

Method used

By obtaining the grayscale distribution information of the image to be enhanced, the equalization deviation coefficient is determined, and fused with the histogram equalization image, the target enhancement image is obtained, and the workpiece details are preserved.

Benefits of technology

Effective enhancement of workpiece images such as aluminum castings is achieved, detailed information is retained, and the problem of the gray scale of bright parts is compressed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120259091A_ABST
    Figure CN120259091A_ABST
Patent Text Reader

Abstract

The invention provides an image enhancement method and device, electronic equipment and a computer readable storage medium, and the method comprises the steps: obtaining a to-be-enhanced image, and determining the gray scale distribution information of the to-be-enhanced image; determining an equilibrium deviation coefficient according to the gray scale distribution information; acquiring a histogram equalization image corresponding to the to-be-enhanced image; and fusing the to-be-enhanced image and the histogram equalization image according to the equalization deviation coefficient to obtain a target enhanced image. The gray scale distribution information of the to-be-enhanced image is determined, and the equalization deviation coefficient reflecting the gray scale equalization condition is determined based on the gray scale distribution information, so that the actual equalization requirement can be determined, and then the to-be-enhanced image and the histogram equalization image are fused based on the equalization deviation coefficient, so that the required equalization strength can be realized; and the details are kept.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing, and particularly to an image enhancement method, apparatus, electronic device, and computer-readable storage medium. Background Art

[0002] In workpiece image acquisition, histogram equalization is often used for image enhancement. However, for workpieces such as aluminum castings with relatively low overall brightness and fine textures, existing image enhancement methods will cause the gray levels in the bright areas to be compressed, resulting in blurred or lost details of the workpieces. Summary of the Invention

[0003] The main objective of the present invention is to provide an image enhancement method, apparatus, electronic device, and computer-readable storage medium, aiming to solve the problem that the details of workpieces are blurred or lost by the existing image enhancement methods.

[0004] To achieve the above objective, the present invention provides an image enhancement method, and the method includes the steps of: Obtain an image to be enhanced, and determine the gray level distribution information of the image to be enhanced; Determine an equalization deviation coefficient according to the gray level distribution information; Obtain a histogram equalized image corresponding to the image to be enhanced; Fuse the image to be enhanced and the histogram equalized image with the equalization deviation coefficient to obtain a target enhanced image.

[0005] Optionally, the determining the gray level distribution information of the image to be enhanced includes: Obtain the gray levels corresponding to each pixel point in the image to be enhanced; Take the pixel points with gray levels greater than or equal to a preset gray level threshold as target pixel points; Obtain the gray level distribution information according to the gray levels corresponding to the target pixel points.

[0006] Optionally, the determining the equalization deviation coefficient according to the gray level distribution information includes: Obtain a preset comparison quantity, and determine a plurality of comparison pixel quantities according to the preset comparison quantity and the number of pixels of the image to be enhanced; Determine the actual gray levels corresponding to each of the comparison pixel quantities according to the gray level distribution information; Determine a plurality of ideal gray levels according to the preset comparison quantity, and the number of the ideal gray levels is the preset comparison quantity; Obtain the equalization deviation coefficient according to the difference between the corresponding ideal gray level and the actual gray level.

[0007] Optionally, the determining of a plurality of comparison pixel numbers according to the preset comparison number and the number of pixels of the image to be enhanced includes: Dividing the number of pixels by the preset comparison number to obtain a pixel interval; Taking the number corresponding to an integer multiple of the pixel interval as the comparison pixel number, where the maximum integer multiple is the preset comparison number.

[0008] Optionally, the determining of the actual gray level corresponding to each comparison pixel number according to the gray level distribution information includes: Sorting the target pixel points in the gray level distribution information by the gray level magnitude; For each comparison pixel number, determining a target pixel point with the same order as the comparison pixel number; Taking the gray level corresponding to the target pixel point as the actual gray level corresponding to the comparison pixel number.

[0009] Optionally, the determining of a plurality of ideal gray levels according to the preset comparison number and the gray level distribution information includes: Obtaining a preset gray level threshold, and subtracting the preset gray level threshold from the total number of gray levels to obtain a gray level distribution number; Dividing the gray level distribution number by the preset comparison number to obtain a gray level interval; Taking the gray levels corresponding to integer multiples of the gray level interval as the ideal gray levels, where the maximum integer multiple is the preset comparison number.

[0010] Optionally, the fusing of the image to be enhanced and the histogram equalized image with the equalization deviation coefficient to obtain a target enhanced image includes: Determining an enhancement deviation coefficient corresponding to the equalization deviation coefficient, where the sum of the equalization deviation coefficient and the enhancement deviation coefficient is 1; Taking the equalization deviation coefficient as the coefficient corresponding to the histogram equalized image, and taking the enhancement deviation coefficient as the coefficient corresponding to the image to be enhanced for fusion to obtain the target enhanced image.

[0011] To achieve the above object, the present invention further provides an image enhancement device, where the image enhancement device includes: A first acquisition module, configured to acquire an image to be enhanced and determine the gray level distribution information of the image to be enhanced; A first determination module, configured to determine an equalization deviation coefficient according to the gray level distribution information; A second acquisition module, configured to acquire a histogram equalized image corresponding to the image to be enhanced; A first execution module, configured to fuse the image to be enhanced and the histogram equalized image with the equalization deviation coefficient to obtain a target enhanced image.

[0012] To achieve the above object, the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the steps of the image enhancement method described above are implemented.

[0013] To achieve the above object, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the image enhancement method described above are implemented.

[0014] An image enhancement method, device, electronic device, and computer-readable storage medium provided by the present invention obtain an image to be enhanced and determine the gray-scale distribution information of the image to be enhanced; determine an equalization deviation coefficient according to the gray-scale distribution information; obtain a histogram equalized image corresponding to the image to be enhanced; and fuse the image to be enhanced and the histogram equalized image with the equalization deviation coefficient to obtain a target enhanced image. By determining the gray-scale distribution information of the image to be enhanced and determining the equalization deviation coefficient reflecting the gray-scale equalization situation based on the gray-scale distribution information, the actual equalization requirement can be clarified, and then the image to be enhanced and the histogram equalized image are fused based on the equalization deviation coefficient, so that the required equalization intensity can be achieved and the retention of details can be ensured. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings herein are incorporated into the specification and form a part of the specification, showing embodiments consistent with the present invention and used together with the specification to explain the principles of the present invention.

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or in the prior art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the prior art. Obviously, for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0017] Figure 1 It is a schematic flowchart of the first embodiment of the image enhancement method of the present invention; Figure 2 It is a schematic module structure diagram of the electronic device of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0018] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention. In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present application.

[0019] The present invention provides an image enhancement method. Refer to Figure 1 , Figure 1 which is a schematic flowchart of the first embodiment of the image enhancement method of the present invention. The method includes the following steps: Step S10: Obtain the image to be enhanced and determine the gray-scale distribution information of the image to be enhanced; The image to be enhanced is an image that needs to be enhanced. The image to be enhanced contains workpieces. In this embodiment and subsequent embodiments, the example of an aluminum casting included in the image to be enhanced is used for illustration. It can be understood that other images containing other types of objects with a dark background, low overall brightness, and fine textures of the workpieces can also use this method for image enhancement.

[0020] The gray-scale distribution information indicates the gray-scale distribution of the image to be enhanced. The gray-scale distribution information may specifically include the number of pixels corresponding to each gray scale, the gray-scale values corresponding to each pixel in the image to be enhanced, etc.

[0021] Step S20: Determine the equalization deviation coefficient according to the gray-scale distribution information; The equalization deviation coefficient is used to indicate the degree of gray-scale imbalance of the image to be enhanced.

[0022] It can be understood that the higher the degree of imbalance of the image to be enhanced, the more necessary it is to perform equalization processing. The lower the degree of imbalance of the image to be enhanced, the more able it is to retain its own gray-scale distribution, thereby retaining image details. Therefore, in this embodiment, the equalization deviation coefficient is determined through the gray-scale distribution information, so that the equalization requirement of the image to be enhanced can be clarified.

[0023] Step S30: Obtain the histogram equalization image corresponding to the image to be enhanced; The histogram equalization image is an image obtained by equalizing the image to be enhanced. The specific equalization operation can be set according to actual needs, such as histogram equalization, adaptive histogram equalization, contrast-limited adaptive histogram equalization. In this embodiment and subsequent embodiments, the example of using adaptive histogram equalization is used for illustration.

[0024] Step S40: Fuse the image to be enhanced and the histogram equalized image with the equalization deviation coefficient to obtain a target enhanced image.

[0025] Since the equalization deviation coefficient indicates the degree of non-uniformity of the image to be enhanced, in other words, the degree of equalization required; therefore, after obtaining the histogram equalized image corresponding to the image to be enhanced, the image to be enhanced and the histogram equalized image can be fused based on the equalization deviation coefficient, so that while retaining the workpiece details on the image to be enhanced according to the actual gray level situation of the image to be enhanced, the equalization effect of the histogram equalized image can be combined.

[0026] In this embodiment, by determining the gray level distribution information of the image to be enhanced and determining the equalization deviation coefficient reflecting the gray level equalization situation based on the gray level distribution information, the actual equalization requirement can be clarified, and then the image to be enhanced and the histogram equalized image are fused based on the equalization deviation coefficient, so that the required equalization intensity can be achieved and the retention of details can be ensured.

[0027] Further, in the second embodiment of the image enhancement method of the present invention proposed based on the first embodiment of the present invention, the step S10 includes the steps: Step S11: Obtain the gray levels corresponding to the pixel points in the image to be enhanced. Step S12: Take the pixel points with gray levels greater than or equal to the preset gray level threshold as target pixel points. Step S13: Obtain the gray level distribution information according to the gray levels corresponding to the target pixel points.

[0028] It can be understood that in some scenarios, aluminum castings are usually collected against a black background. Therefore, the image to be enhanced will contain pixel points with relatively small gray levels corresponding to the black background. In order to make the subsequent enhancement operations dominated by the image corresponding to the aluminum casting, in this embodiment, the part corresponding to the background is removed to obtain the target pixel points corresponding to the aluminum casting, and then the gray level distribution information is obtained based on the gray level situation of the target pixel points, so that the gray level distribution information can mainly reflect the gray level condition of the pixels corresponding to the aluminum casting. The gray level distribution information may also include the number of target pixel points.

[0029] Since the gray level of the background is relatively small, in this embodiment, a preset gray level threshold is set, and the pixel points with gray levels less than the preset gray level threshold are taken as background pixel points, while the pixel points with gray levels greater than or equal to the preset gray level threshold are taken as target pixel points. The background pixel points are not used to generate the gray level distribution information, and the gray level distribution information is generated only through the target pixel points. The specific value of the preset gray level threshold can be set based on actual needs, such as 10.

[0030] Further, in the third embodiment of the image enhancement method of the present invention proposed based on the first embodiment of the present invention, the step S20 includes the steps: Step S21, obtaining a preset comparison quantity, and determining a plurality of comparison pixel quantities according to the preset comparison quantity and the pixel quantity of the image to be enhanced; It can be understood that the number of gray levels of a general image is 256. If all gray levels are to be compared one by one, the calculation amount will be too large, which will affect the image enhancement efficiency. Therefore, in this embodiment, a preset comparison quantity is set. The total number of pixels and the gray levels are evenly divided by the preset comparison quantity, and the ideal values and actual values of some gray level points are compared through the preset comparison quantity, so as to determine the equilibrium deviation coefficient corresponding to the image to be enhanced. It can be understood that the larger the preset comparison quantity, the more gray level points need to be compared, the more the equilibrium deviation coefficient can conform to the actual deviation situation of the image to be enhanced, and the greater the calculation amount. Therefore, the specific value of the preset comparison quantity can be set based on actual needs. For example, the preset comparison quantity is 4, that is, the ideal values and actual values of 4 gray level points are compared.

[0031] The comparison pixel quantity is the cumulative quantity corresponding to a plurality of pixel points to be compared obtained by dividing the pixel quantity based on the preset comparison quantity. Specifically, the step S21 includes the steps: Step S211, dividing the pixel quantity by the preset comparison quantity to obtain a pixel interval; Step S212, taking the quantity corresponding to an integer multiple of the pixel interval as the comparison pixel quantity, where the maximum integer multiple is the preset comparison quantity.

[0032] The pixel quantity is the pixel quantity included in the image to be enhanced. Dividing the pixel quantity by the preset comparison quantity, that is, dividing the pixel quantity into the preset comparison quantity of parts, and the quantity of pixels included in each part is the pixel interval. Specifically:

[0033] Where i is the pixel interval; N is the pixel quantity; s is the preset comparison quantity.

[0034] It should be noted that when the gray level distribution information is obtained through the gray level corresponding to the target pixel point, the gray level distribution information indicates the state of the target pixel point. Therefore, N in the above formula is set to the number of target pixel points.

[0035] After determining the pixel interval, a plurality of comparison pixel quantities can be obtained based on the pixel interval, that is, the comparison pixel quantities include [i, 2×i, 3×i......s×i]; taking s as 4 as an example, the obtained comparison pixel quantities include [i, 2×i, 3×i, 4×i].

[0036] Step S22: Determine the actual gray level corresponding to each of the comparison pixel counts according to the gray level distribution information; The actual gray level is the gray level of the pixel corresponding to the comparison pixel count in the image to be enhanced; specifically, step S22 includes the steps of: Step S221: Sort the target pixel points in the gray level distribution information by gray level magnitude; Step S222: For each of the comparison pixel counts, determine the target pixel point whose order is the same as the comparison pixel count; Step S223: Take the gray level corresponding to the target pixel point as the actual gray level corresponding to the comparison pixel count.

[0037] Determine the gray level values of each target pixel point according to the gray level distribution information, and sort the gray level values from small to large, that is, [n1 + v, n2 + v, n3 + v......n255], where v is a preset gray level threshold; each item represents the number of pixels corresponding to the gray level value. Taking the preset gray level threshold as 10 as an example, n1 + v represents the number of target pixel points corresponding to the gray level with a gray level value of 1 + 10 = 11, n2 + v represents the number of target pixel points corresponding to the gray level with a gray level value of 2 + 10 = 12, and so on.

[0038] s×i in the comparison pixel count is the number of target pixel points. Therefore, the comparison pixel count can surely find the corresponding and unique target pixel point in the above gray level sorting; if n1 + v < i < n2 + v, then the gray level value corresponding to the target pixel point corresponding to the comparison pixel count i is n2 + v, that is, the actual gray level value k1 corresponding to the comparison pixel count i is n2 + v; if n55 + v < 2×i < n56 + v, then the gray level value corresponding to the target pixel point corresponding to the comparison pixel count 2×i is n56 + v, that is, the actual gray level value k2 corresponding to the comparison pixel count 2×i is n56 + v, and so on, and the actual gray levels of all comparison pixel counts can be determined, and the actual gray levels are denoted as [k1, k2, k3......ks].

[0039] Step S23: Determine a plurality of ideal gray levels according to the preset comparison count, and the number of the ideal gray levels is the preset comparison count; The gray level values are evenly divided into a plurality of ideal gray levels according to the preset comparison count. Specifically, step S23 includes the steps of: Step S231: Obtain the preset gray level threshold, and subtract the preset gray level threshold from the total number of gray levels to obtain the gray level distribution number; Step S232: Divide the gray level distribution number by the preset comparison count to obtain the gray level interval; Step S233: Take the gray levels corresponding to integer multiples of the gray level interval as the ideal gray levels, where the maximum integer multiple is the preset comparison count.

[0040]

[0041] where j is the gray scale interval; It should be noted that when the gray scale distribution information is obtained from the gray scale corresponding to the target pixel, the gray scale distribution information indicates the state of the target pixel. Therefore, 255 - v is used to obtain the gray scale covered by the target pixel, that is, the gray scale distribution number, and then the gray scale distribution number is divided by the preset comparison quantity to obtain the gray scale interval.

[0042] After determining the gray scale interval, the required ideal gray scales can be determined based on the gray scale interval, that is, the ideal gray scales include [j, 2×j, 3×j......s×j]; taking s = 4 as an example, the obtained ideal gray scales include [v + j, v + 2×j, v + 3×j, v + 4×j].

[0043] Step S24, obtaining the equilibrium deviation coefficient according to the difference between the corresponding ideal gray scale and the actual gray scale.

[0044] After obtaining the ideal gray scale and the actual gray scale, the equilibrium deviation coefficient can be determined by comparing the ideal gray scale and the actual gray scale. Specifically:

[0045] where C is the equilibrium deviation coefficient; k m is the m-th actual gray scale.

[0046] The absolute value indicates the gray scale difference between the actual gray scale and the ideal gray scale, and the average value of multiple groups of gray scale differences is used as the equilibrium deviation coefficient, so that the equilibrium deviation coefficient can reflect the overall gray scale deviation of the image to be enhanced.

[0047] Furthermore, in the fourth embodiment of the image enhancement method of the present invention proposed based on the first embodiment of the present invention, the step S40 includes the steps: Step S41, determining the enhancement deviation coefficient corresponding to the equilibrium deviation coefficient, where the sum of the equilibrium deviation coefficient and the enhancement deviation coefficient is 1; Step S42, using the equilibrium deviation coefficient as the coefficient corresponding to the histogram equalized image, and using the enhancement deviation coefficient as the coefficient corresponding to the image to be enhanced for fusion to obtain the target enhanced image.

[0048] In this embodiment, the image to be enhanced and the histogram equalized image are fused by weighted average; after the equilibrium deviation coefficient C is determined, 1 - C is used as the enhancement deviation coefficient.

[0049] It can be understood that the equalization deviation coefficient reflects the gray-scale difference between the actual gray scale and the ideal gray scale. The greater the gray-scale difference between the actual gray scale and the ideal gray scale, the more histogram equalization is required. Therefore, the components of the histogram equalization image should be more. Therefore, the equalization deviation coefficient is used as the coefficient of the histogram equalization image, and the enhancement deviation coefficient is used as the coefficient of the image to be enhanced for image fusion to obtain the target enhanced image. Specifically:

[0050] where P r is the target enhanced image; P is the image to be enhanced; P a is the histogram equalization image.

[0051] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0052] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), including several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of this application.

[0053] This application also provides an image enhancement device for implementing the above image enhancement method. The image enhancement device includes: A first acquisition module, configured to acquire an image to be enhanced and determine the gray-scale distribution information of the image to be enhanced; A first determination module, configured to determine an equalization deviation coefficient according to the gray-scale distribution information; A second acquisition module, configured to acquire a histogram equalization image corresponding to the image to be enhanced; A first execution module, configured to fuse the image to be enhanced and the histogram equalization image with the equalization deviation coefficient to obtain a target enhanced image.

[0054] This image enhancement device determines the grayscale distribution information of the image to be enhanced, and determines the equilibrium deviation coefficient reflecting the grayscale equilibrium situation based on the grayscale distribution information, so as to clarify the actual equilibrium requirement. Furthermore, it fuses the image to be enhanced with the histogram equalization image based on the equilibrium deviation coefficient, thereby enabling the required equalization intensity to be achieved and ensuring the retention of details.

[0055] It should be noted that the first acquisition module in this embodiment can be used to execute step S10 in the embodiment of the present application, the first determination module in this embodiment can be used to execute step S20 in the embodiment of the present application, the second acquisition module in this embodiment can be used to execute step S30 in the embodiment of the present application, and the first execution module in this embodiment can be used to execute step S40 in the embodiment of the present application.

[0056] Furthermore, the first acquisition module includes: A first acquisition unit for acquiring the grayscale corresponding to each pixel point in the image to be enhanced; A first execution unit for taking the pixel points whose grayscale is greater than or equal to a preset grayscale threshold as target pixel points; A second execution unit for obtaining the grayscale distribution information according to the grayscale corresponding to the target pixel points.

[0057] Furthermore, the first determination module includes: A second acquisition unit for acquiring a preset comparison quantity and determining a plurality of comparison pixel quantities according to the preset comparison quantity and the number of pixels in the image to be enhanced; A first determination unit for determining the actual grayscale corresponding to each of the comparison pixel quantities according to the grayscale distribution information; A second determination unit for determining a plurality of ideal grayscales according to the preset comparison quantity, and the number of the ideal grayscales is the preset comparison quantity; A third execution unit for obtaining the equilibrium deviation coefficient according to the difference between the corresponding ideal grayscale and the actual grayscale.

[0058] Furthermore, the second acquisition unit includes: A first calculation subunit for dividing the number of pixels by the preset comparison quantity to obtain a pixel interval; A first execution subunit for taking the quantity corresponding to an integer multiple of the pixel interval as the comparison pixel quantity, where the maximum integer multiple is the preset comparison quantity.

[0059] Furthermore, the first determination unit includes: A first sorting subunit for sorting the target pixel points in the grayscale distribution information according to the grayscale magnitude; A first determination subunit, configured to determine, for each of the comparison pixel counts, target pixel points having the same order as the comparison pixel counts; A second execution subunit, configured to use the gray level corresponding to the target pixel point as the actual gray level corresponding to the comparison pixel count.

[0060] Further, the second determination unit includes: A first acquisition subunit, configured to acquire a preset gray level threshold, and obtain a gray level distribution number by subtracting the preset gray level threshold from the total number of gray levels; A second calculation subunit, configured to divide the gray level distribution number by the preset comparison quantity to obtain a gray level interval; A third execution subunit, configured to use the gray level corresponding to an integer multiple of the gray level interval as the ideal gray level, where the maximum integer multiple is the preset comparison quantity.

[0061] Further, the first execution module includes: A third determination unit, configured to determine an enhancement deviation coefficient corresponding to the equalization deviation coefficient, where the sum of the equalization deviation coefficient and the enhancement deviation coefficient is 1; A fourth execution unit, configured to use the equalization deviation coefficient as the coefficient corresponding to the histogram equalization image, and use the enhancement deviation coefficient as the coefficient corresponding to the image to be enhanced for fusion to obtain the target enhanced image.

[0062] Refer to Figure 2 , in terms of hardware structure, the electronic device may include components such as a communication module 10, a memory 20, and a processor 30. In the electronic device, the processor 30 is respectively connected to the memory 20 and the communication module 10. A computer program is stored on the memory 20, and the computer program is simultaneously executed by the processor 30. When the computer program is executed, the steps of the above method embodiment are implemented.

[0063] The communication module 10 can be connected to an external communication device through a network. The communication module 10 can receive requests sent by the external communication device, and can also send requests, instructions, and information to the external communication device. The external communication device can be other electronic devices, servers, or Internet of Things devices, such as a television, etc.

[0064] A memory 20 can be used to store software programs and various data. The memory 20 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as obtaining an image to be enhanced and determining the grayscale distribution information of the image to be enhanced), etc.; the data storage area can include a database, and the data storage area can store data or information created according to the use of the system, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0065] A processor 30 is the control center of the electronic device, connecting various parts of the entire electronic device through various interfaces and circuits. By running or executing software programs and / or modules stored in the memory 20, and calling data stored in the memory 20, it executes various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. The processor 30 may include one or more processing units; optionally, the processor 30 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor may not be integrated into the processor 30 either.

[0066] Although Figure 2 not shown, the above-mentioned electronic device may further include a circuit control module, and the circuit control module is used to connect to a power supply to ensure the normal operation of other components. Those skilled in the art can understand that Figure 2 the structure of the electronic device shown in

[0067] does not constitute a limitation to the electronic device, and may include more or fewer components than shown in the figure, or combine some components, or have different component arrangements. Figure 2 The present invention also proposes a computer-readable storage medium, on which a computer program is stored. The computer-readable storage medium may be the memory 20 in the

[0068] In the present invention, the terms "first", "second", "third", "fourth", and "fifth" are used only for descriptive purposes and should not be construed as indicating or implying relative importance. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.

[0069] In the description of this specification, the description with reference to terms such as "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0070] Although the embodiments of the present invention have been shown and described above, the scope of protection of the present invention is not limited thereto. It can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, and substitutions to the above embodiments within the scope of the present invention, and these changes, modifications, and substitutions should all be covered by the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be subject to the scope of protection of the claims.

Claims

1. An image enhancement method, characterized in that, The described image enhancement method includes: Obtain the image to be enhanced and determine the grayscale distribution information of the image to be enhanced; Determine the equalization deviation coefficient according to the grayscale distribution information; Obtain the histogram equalized image corresponding to the image to be enhanced; Fuse the image to be enhanced and the histogram equalized image with the equalization deviation coefficient to obtain the target enhanced image.

2. The image enhancement method according to claim 1, wherein The determination of the grayscale distribution information of the image to be enhanced includes: Obtain the grayscale corresponding to each pixel point in the image to be enhanced; Use the pixel points with grayscale greater than or equal to the preset grayscale threshold as target pixel points; Obtain the grayscale distribution information according to the grayscale corresponding to the target pixel points.

3. The image enhancement method according to claim 1, wherein The determination of the equalization deviation coefficient according to the grayscale distribution information includes: Obtain the preset comparison quantity, and determine multiple comparison pixel quantities according to the preset comparison quantity and the pixel quantity of the image to be enhanced; Determine the actual grayscale corresponding to each comparison pixel quantity according to the grayscale distribution information; Determine multiple ideal grayscales according to the preset comparison quantity, and the number of ideal grayscales is the preset comparison quantity; Obtain the equalization deviation coefficient according to the difference between the corresponding ideal grayscale and the actual grayscale.

4. The image enhancement method according to claim 3, wherein The determination of multiple comparison pixel quantities according to the preset comparison quantity and the pixel quantity of the image to be enhanced includes: Divide the pixel quantity by the preset comparison quantity to obtain the pixel interval; Use the quantity corresponding to the integer multiple of the pixel interval as the comparison pixel quantity, where the maximum integer multiple is the preset comparison quantity.

5. The image enhancement method according to claim 3, characterized in that The determination of the actual grayscale corresponding to each comparison pixel quantity according to the grayscale distribution information includes: Sort the target pixel points in the grayscale distribution information by grayscale magnitude; For each comparison pixel quantity, determine the target pixel point with the same order as the comparison pixel quantity; Use the grayscale corresponding to the target pixel point as the actual grayscale corresponding to the comparison pixel quantity.

6. The image enhancement method according to claim 3, wherein, The determination of multiple ideal grayscales according to the preset comparison quantity and the grayscale distribution information includes: Obtain the preset grayscale threshold, and subtract the preset grayscale threshold from the total grayscale number to obtain the grayscale distribution number; Divide the grayscale distribution number by the preset comparison quantity to obtain the grayscale interval; Use the grayscale corresponding to the integer multiple of the grayscale interval as the ideal grayscale, where the maximum integer multiple is the preset comparison quantity.

7. The image enhancement method according to claim 1, wherein The fusion of the image to be enhanced and the histogram equalized image with the equalization deviation coefficient to obtain the target enhanced image includes: Determine the enhancement deviation coefficient corresponding to the equalization deviation coefficient, where the sum of the equalization deviation coefficient and the enhancement deviation coefficient is 1; Use the equalization deviation coefficient as the coefficient corresponding to the histogram equalized image, and use the enhancement deviation coefficient as the coefficient corresponding to the image to be enhanced for fusion to obtain the target enhanced image.

8. An image enhancement device, characterized in that, The image enhancement device includes: The first acquisition module is used to acquire the image to be enhanced and determine the grayscale distribution information of the image to be enhanced; The first determination module is used to determine the equalization deviation coefficient according to the grayscale distribution information; The second acquisition module is used to acquire the histogram equalized image corresponding to the image to be enhanced; A first execution module, configured to fuse the image to be enhanced and the histogram equalization image with the equalization deviation coefficient to obtain a target enhanced image.

9. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the steps of the image enhancement method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, the steps of the image enhancement method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Image intensification algorithm based on histogram equalization

    CN104680500A

  • Brightness compensation method and device, parameter determination method and device and display device

    CN111833794A

  • Unmanned aerial vehicle image processing system for building detection

    CN119579451A

  • Dynamic range-adjustment apparatuses and methods

    US20140348428A1

  • Battery image processing method and apparatus, battery detection method and apparatus, and device and medium

    WO2025025334A1