Global Mapping Table Generation Method and Device for Image Enhancement

Through the global mapping table generation method, the problems of local details loss and large amount of computing in traditional image enhancement methods are solved, and the rapid enhancement of images and contrast improvement are achieved.

CN115034975BActive Publication Date: 2025-05-30ALLWINNER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210502328.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-10
Publication Date
2025-05-30
Estimated Expiration
2042-05-10

AI Technical Summary

Technical Problem

The existing image enhancement methods are prone to losing local details during global histogram equalization processing, and the local histogram equalization processing has a large amount of computation and is difficult to improve the contrast effect.

Method used

Using the global mapping table generation method, by acquiring the target image, performing image segmentation to obtain the image block, directing and adjusting the second transformation function of each image block based on the first transformation function, and generating the first mapping table for image enhancement.

Benefits of technology

The calculation amount of image processing is reduced, the image is rapidly enhanced, the contrast of the image is effectively improved, the local details are retained, the block effect is eliminated, and the image enhancement effect is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115034975B_ABST
    Figure CN115034975B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and apparatus for generating a global mapping table for image enhancement. The method includes: determining a first transformation function corresponding to an image to be processed; performing image segmentation on the image to obtain a plurality of image blocks, and determining a second transformation function corresponding to each image block; based on the first transformation function, guiding and adjusting the second transformation function corresponding to each image block to obtain a third transformation function corresponding to each image block; generating a mapping table based on the third transformation functions corresponding to all the image blocks and the brightness information of the image. It can be seen that implementing the present invention can intelligently generate a global mapping table for image enhancement. By using this global mapping table for image enhancement, not only can the computational amount during image processing be reduced, thereby quickly enhancing the image, so as to be applicable to real-time processing of images, but also the contrast of the image can be effectively improved, local details of the image can be retained, and block effects of the image can be eliminated, thereby enhancing the image enhancement effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular, to a method and apparatus for generating a global mapping table for image enhancement. Background Art

[0002] With the rapid development of image enhancement technology, image enhancement technology has penetrated into all walks of life, such as aerospace, military, healthcare and other industries. It can specifically emphasize the overall or local features of an image, strengthen the important information of the image and weaken the secondary information of the image, enhance the recognition effect of the image, so as to improve the quality of the image.

[0003] Currently, the commonly used image enhancement methods generally achieve the effect by performing histogram equalization (including global histogram equalization and local histogram) processing on the image. Histogram equalization can adjust the brightness of each pixel in the image by changing the histogram information of the image to increase the contrast of the image, so as to achieve the effect of image enhancement. However, it is found in practice that this traditional image enhancement method has the following deficiencies: performing global histogram equalization processing on the image will make the local area of the image too bright or too dark, and it is easy to lose the local details of the image; while performing local histogram equalization processing on the image, although it can maintain certain local details of the image, the processing operation amount of the image is too large and it is easy to cause block effects of the image, resulting in a slow image processing process and it is difficult to improve the contrast enhancement effect of the image. It can be seen that how to improve the image enhancement effect while quickly performing image enhancement on the image is particularly important. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method and apparatus for generating a global mapping table for image enhancement, which can reduce the operation amount during image processing, quickly enhance the image, and can also effectively improve the contrast of the image, retain the local details of the image and eliminate the block effect of the image, so as to improve the image enhancement effect.

[0005] To solve the above technical problem, a first aspect of the present invention discloses a method for generating a global mapping table for image enhancement, the method comprising:

[0006] Obtain a target image to be processed, and determine a first transformation function corresponding to the target image; the target image is determined based on an original image to be enhanced, and the target image is the original image or an image obtained by reducing the original image;

[0007] Perform an image segmentation operation on the target image to obtain a plurality of image blocks, and determine a second transformation function corresponding to each image block;

[0008] Based on the first transformation function, perform a guided adjustment on the second transformation function corresponding to each of the image blocks to obtain a third transformation function corresponding to each of the image blocks;

[0009] Based on the third transformation functions corresponding to all the image blocks and the target brightness information of the target image, generate a first mapping table; the target brightness information of the target image includes all the target brightness values included in the target image and the distribution of each of the target brightness values, and the first mapping table is used to perform an image enhancement operation on the original image.

[0010] As an optional implementation manner, in the first aspect of the present invention, the performing a guided adjustment on the second transformation function corresponding to each of the image blocks based on the first transformation function to obtain a third transformation function corresponding to each of the image blocks includes:

[0011] Based on the first transformation function, determine a target guiding function corresponding to the second transformation function corresponding to each of the image blocks; each target guiding function is used to perform a guided adjustment on the second transformation function corresponding to this image block;

[0012] Determine a guiding adjustment ratio corresponding to the second transformation function corresponding to each of the image blocks;

[0013] According to the target guiding function corresponding to the second transformation function corresponding to each of the image blocks and the guiding adjustment ratio, perform a guided adjustment on the second transformation function corresponding to each of the image blocks to obtain a third transformation function corresponding to each of the image blocks;

[0014] Wherein, the third transformation function corresponding to each of the image blocks is:

[0015] CDF′ b (i) = (1 - ratio) * C gd (i) + ratio * CDF b (i);

[0016] CDF′ b (i) is the third transformation function corresponding to the corresponding image block, C gd (i) is the target guiding function corresponding to the second transformation function corresponding to this image block, CDF b (i) is the second transformation function corresponding to this image block, and ratio is the guiding adjustment ratio corresponding to the second transformation function corresponding to this image block.

[0017] As an optional implementation manner, in the first aspect of the present invention, the determining a target guiding function corresponding to the second transformation function corresponding to each of the image blocks based on the first transformation function includes:

[0018] Based on the luminance information of each of the image blocks, determine a first guiding function corresponding to each of the image blocks; the luminance information of each of the image blocks includes all the luminance values included in the image block and the distribution of each of the luminance values in the image block;

[0019] Based on the first transformation function, perform a function superposition operation on the first guiding function corresponding to each of the image blocks to obtain a second guiding function corresponding to each of the image blocks;

[0020] Obtain a distribution function corresponding to each of the image blocks; the distribution function corresponding to each of the image blocks is determined based on the luminance information of the image block;

[0021] According to the distribution function corresponding to each of the image blocks, analyze the mapping of the first luminance value of each of the image blocks by the second transformation function corresponding to the image block and the mapping of the second luminance value of each of the image blocks by the second guiding function corresponding to the image block; each of the first luminance value mapping situations represents the difference in the first luminance value corresponding to each of the luminance values in the image block after being mapped by the second transformation function corresponding to the image block, and each of the second luminance value mapping situations represents the difference in the second luminance value corresponding to each of the luminance values in the image block after being mapped by the second transformation function corresponding to the image block;

[0022] According to the comparison situation of the difference in the first luminance value and the difference in the second luminance value corresponding to each of the image blocks, determine the target guiding function corresponding to the second transformation function corresponding to each of the image blocks;

[0023] Wherein, the second guiding function corresponding to each of the image blocks is:

[0024]

[0025] C′ tar (i) is the second guiding function corresponding to the corresponding image block, C tar (i) is the first guiding function corresponding to the image block, CDF g (i) is the first transformation function, and i is the luminance value under this image block;

[0026] The difference in the first luminance value and the difference in the second luminance value corresponding to each of the image blocks are:

[0027]

[0028] ΔL act is the difference in the first luminance value corresponding to the corresponding image block, ΔL tar is the difference in the second luminance value corresponding to the image block, H b(i) is the distribution function corresponding to the image block;

[0029] The target guiding function corresponding to the second transformation function corresponding to each of the image blocks is:

[0030]

[0031] As an alternative implementation manner, in the first aspect of the present invention, the determining the guiding adjustment ratio corresponding to the second transformation function corresponding to each of the image blocks includes:

[0032] According to the distribution function corresponding to each of the image blocks, analyze the mapping situation of the target guiding function corresponding to the second transformation function corresponding to each of the image blocks to the third brightness value of the image block; each of the third brightness value mapping situations represents the third brightness value difference corresponding to the mapping of each of the brightness values in the image block by the target guiding function corresponding to the second transformation function corresponding to the image block;

[0033] According to the comparison situation between the first brightness value difference corresponding to each of the image blocks and the third brightness value difference, determine the guiding adjustment ratio corresponding to the second transformation function corresponding to each of the image blocks;

[0034] Wherein, the third brightness value difference corresponding to each of the image blocks is:

[0035]

[0036] ΔL gd is the third brightness value difference corresponding to the corresponding image block;

[0037] The guiding adjustment ratio corresponding to the second transformation function corresponding to each of the image blocks is:

[0038]

[0039] As an alternative implementation manner, in the first aspect of the present invention, the generating the first mapping table based on the third transformation functions corresponding to all the image blocks and the target brightness information of the target image includes:

[0040] According to the third transformation function corresponding to each of the image blocks, calculate the first mapping value corresponding to each of the brightness values in each of the image blocks;

[0041] Determine the mapping adjustment parameter corresponding to each of the image blocks, and perform a mapping adjustment operation on the first mapping value corresponding to each of the brightness values in each of the image blocks according to the mapping adjustment parameter corresponding to each of the image blocks, to obtain the second mapping value corresponding to each of the brightness values in each of the image blocks;

[0042] Determine all third mapping values corresponding to each target brightness value among all target brightness values included in the target image according to the second mapping values corresponding to all the brightness values in all the image blocks; all the third mapping values corresponding to each target brightness value are all the third mapping values at all target pixel positions matching the target brightness value;

[0043] Based on all the third mapping values corresponding to each target brightness value, determine a fourth mapping value corresponding to each target brightness value, and generate a first mapping table according to the fourth mapping values corresponding to all the target brightness values;

[0044] Among them, the second mapping value corresponding to each brightness value in each image block is:

[0045] G′ out =(1 - stren)*G out +stren*G;

[0046] G′ out is the second mapping value corresponding to this brightness value in the corresponding image block, stren is the mapping adjustment parameter corresponding to this image block, G out is the first mapping value corresponding to this brightness value in this image block, and G is this brightness value in this image block;

[0047] The first mapping table is:

[0048]

[0049] Map(i) is the first mapping table, and a(i) is the counting function corresponding to the target brightness value i, representing the third mapping value G at the target pixel position (x, y) matching the target brightness value i out ;

[0050] Among them, the counting function corresponding to each target brightness value is:

[0051] G(x, y) represents this brightness value G at the pixel position (x, y) in the corresponding image block.

[0052] As an optional implementation manner, in the first aspect of the present invention, after generating the first mapping table based on the third transformation function corresponding to all the image blocks and the target brightness information of the target image, the method further includes:

[0053] Determine the fourth transformation function corresponding to the first mapping table, and based on the fourth transformation function, determine whether the first mapping table meets the mapping table adjustment condition; the fourth transformation function is a transformation function determined based on the fourth mapping values corresponding to all the target brightness values;

[0054] When it is determined that the first mapping table meets the mapping table adjustment condition, perform a mapping table adjustment operation on the first mapping table according to the comparison between the histogram parameter corresponding to each target brightness value and the preset histogram average distribution level to obtain a second mapping table; the histogram parameter corresponding to each target brightness value is determined based on the distribution of the target brightness value;

[0055] Moreover, before determining the fourth transformation function corresponding to the first mapping table, the method further includes:

[0056] Traverse the first mapping table and determine whether there are blank mapping values among the fourth mapping values corresponding to all the target brightness values;

[0057] When it is determined that there are no blank mapping values among the fourth mapping values corresponding to all the target brightness values, trigger the operation of determining the fourth transformation function corresponding to the first mapping table, and trigger the operation of determining whether the first mapping table meets the mapping table adjustment condition according to the fourth transformation function;

[0058] When it is determined that there are blank mapping values among the fourth mapping values corresponding to all the target brightness values, determine all the to-be-processed brightness values among all the target brightness values whose corresponding fourth mapping values are the blank mapping values;

[0059] For each to-be-processed brightness value, determine all other relevant brightness values that match the to-be-processed brightness value and exclude the to-be-processed brightness value; each other relevant brightness value is adjacent to the to-be-processed brightness value and the fourth mapping value corresponding to each other relevant brightness value is not the blank mapping value; perform a mapping value filling operation on the fourth mapping value corresponding to the to-be-processed brightness value according to the fourth mapping values corresponding to all the other relevant brightness values to update the fourth mapping value corresponding to the to-be-processed brightness value;

[0060] After updating the fourth mapping values corresponding to all the to-be-processed brightness values, update the first mapping table according to the fourth mapping values corresponding to all the to-be-processed brightness values, and trigger the operation of determining the fourth transformation function corresponding to the first mapping table, and trigger the operation of determining whether the first mapping table meets the mapping table adjustment condition according to the fourth transformation function;

[0061] Wherein, the second mapping table is:

[0062]

[0063] Map′(i) is the second mapping table, Map(i - 1) is the first mapping table, and Hist s (i) is the histogram parameter corresponding to the target brightness value, and M s is the preset histogram average distribution level.

[0064] As an optional implementation manner, in the first aspect of the present invention, the method further includes:

[0065] Determine whether the target mapping table satisfies the mapping table smoothing condition; when the first mapping table satisfies the mapping table adjustment condition, the target mapping table is the second mapping table; when the first mapping table does not satisfy the mapping table adjustment condition, the target mapping table is the first mapping table;

[0066] When it is determined that the target mapping table satisfies the mapping table smoothing condition, determine the smoothing parameter corresponding to the target mapping table; the smoothing parameter includes at least one of the smoothing times of the target mapping table, the fourth mapping values corresponding to all the target brightness values to be smoothed in a single smoothing, the smoothing range corresponding to each of the fourth mapping values to be smoothed in a single smoothing, and the smoothing weight value corresponding to the smoothing range corresponding to each of the fourth mapping values to be smoothed in a single smoothing;

[0067] According to the smoothing parameter, perform a mapping table smoothing operation on the target mapping table to obtain a third mapping table;

[0068] Among them, the third mapping table obtained after performing a single mapping table smoothing operation on the target mapping table is:

[0069]

[0070] Map(s) is the third mapping table, n is the smoothing range corresponding to each of the fourth mapping values to be smoothed in a single smoothing, and ω T is the cumulative sum of the smoothing weight values ω(n + i) corresponding to the smoothing ranges corresponding to each of the fourth mapping values to be smoothed in a single smoothing, and Map(η(s + i)) is the target mapping table, where η(s + i) is a limiting range function;

[0071] Among them, the limiting range function is:

[0072]

[0073] The second aspect of the present invention discloses a global mapping table generation device applied to image enhancement. The device includes:

[0074] An acquisition module, configured to acquire a target image to be processed;

[0075] A determination module, configured to determine a first transformation function corresponding to the target image; the target image is determined based on an original image to be enhanced, and the target image is the original image or an image obtained by reducing the original image;

[0076] An image segmentation module, configured to perform an image segmentation operation on the target image to obtain a plurality of image blocks;

[0077] The determination module is further configured to determine a second transformation function corresponding to each of the image blocks;

[0078] A guiding and adjusting module, configured to perform guiding and adjustment on the second transformation function corresponding to each of the image blocks based on the first transformation function to obtain a third transformation function corresponding to each of the image blocks;

[0079] A mapping table generation module, configured to generate a first mapping table based on the third transformation functions corresponding to all the image blocks and the target brightness information of the target image; the target brightness information of the target image includes all target brightness values included in the target image and the distribution of each target brightness value, and the first mapping table is used to perform an image enhancement operation on the original image.

[0080] As an optional implementation manner, in the second aspect of the present invention, the guiding and adjusting module includes:

[0081] A determination sub-module, configured to determine a target guiding function corresponding to the second transformation function corresponding to each of the image blocks based on the first transformation function; each target guiding function is used to perform guiding and adjustment on the second transformation function corresponding to the image block; determine a guiding and adjustment ratio corresponding to the second transformation function corresponding to each of the image blocks;

[0082] A guiding and adjusting sub-module, configured to perform guiding and adjustment on the second transformation function corresponding to each of the image blocks according to the target guiding function corresponding to the second transformation function corresponding to each of the image blocks and the guiding and adjustment ratio to obtain a third transformation function corresponding to each of the image blocks;

[0083] Wherein, the third transformation function corresponding to each of the image blocks is:

[0084] CDF′ b (i)=(1 - ratio)*C gd (i)+ratio*CDF b (i);

[0085] CDF′b (i) is the third transformation function corresponding to the corresponding image block, C gd (i) is the target guiding function corresponding to the second transformation function of the image block, CDF b (i) is the second transformation function corresponding to the image block, and ratio is the guiding adjustment ratio corresponding to the second transformation function of the image block.

[0086] As an optional implementation manner, in the second aspect of the present invention, the manner in which the determination sub-module determines the target guiding function corresponding to the second transformation function of each image block based on the first transformation function is specifically as follows:

[0087] Based on the luminance information of each image block, determine the first guiding function corresponding to each image block; the luminance information of each image block includes all the luminance values included in the image block and the distribution of each luminance value in the image block;

[0088] Based on the first transformation function, perform a function superposition operation on the first guiding function corresponding to each image block to obtain the second guiding function corresponding to each image block;

[0089] Obtain the distribution function corresponding to each image block; the distribution function corresponding to each image block is determined based on the luminance information of the image block;

[0090] According to the distribution function corresponding to each image block, analyze the mapping situation of the second transformation function corresponding to each image block to the first luminance value of the image block and the mapping situation of the second guiding function corresponding to each image block to the second luminance value of the image block; each first luminance value mapping situation represents the first luminance value difference corresponding to each luminance value in the image block after being mapped by the second transformation function corresponding to the image block, and each second luminance value mapping situation represents the second luminance value difference corresponding to each luminance value in the image block after being mapped by the second transformation function corresponding to the image block;

[0091] According to the comparison situation of the first luminance value difference and the second luminance value difference corresponding to each image block, determine the target guiding function corresponding to the second transformation function of each image block;

[0092] Among them, the second guiding function corresponding to each image block is:

[0093]

[0094] C′ tar (i) is the second guiding function corresponding to the corresponding image block, C tar(i) is the first guiding function corresponding to the image block, cDF g (i) is the first transformation function, and i is the luminance value under the image block;

[0095] The first luminance value difference and the second luminance value difference corresponding to each image block are:

[0096]

[0097] ΔL act is the first luminance value difference corresponding to the corresponding image block, ΔL tar is the second luminance value difference corresponding to the image block, H b (i) is the distribution function corresponding to the image block;

[0098] The target guiding function corresponding to the second transformation function corresponding to each image block is:

[0099]

[0100] As an optional implementation manner, in the second aspect of the present invention, the manner in which the determination sub-module determines the guiding adjustment ratio corresponding to the second transformation function corresponding to each image block is specifically:

[0101] According to the distribution function corresponding to each image block, analyze the mapping situation of the third luminance value of the target guiding function corresponding to the second transformation function corresponding to each image block; each third luminance value mapping situation represents the third luminance value difference corresponding to each luminance value in the image block after the target guiding function corresponding to the second transformation function corresponding to the image block performs mapping;

[0102] According to the comparison situation between the first luminance value difference and the third luminance value difference corresponding to each image block, determine the guiding adjustment ratio corresponding to the second transformation function corresponding to each image block;

[0103] Among them, the third luminance value difference corresponding to each image block is:

[0104]

[0105] ΔL gd is the third luminance value difference corresponding to the corresponding image block;

[0106] The guiding adjustment ratio corresponding to the second transformation function corresponding to each image block is:

[0107]

[0108] As an alternative implementation, in the second aspect of the present invention, the manner in which the mapping table generation module generates the first mapping table based on the third transformation functions corresponding to all the image blocks and the target brightness information of the target image is specifically as follows:

[0109] According to the third transformation function corresponding to each image block, calculate the first mapping value corresponding to each brightness value in each image block;

[0110] Determine the mapping adjustment parameter corresponding to each image block, and perform a mapping adjustment operation on the first mapping value corresponding to each brightness value in each image block according to the mapping adjustment parameter corresponding to each image block, to obtain the second mapping value corresponding to each brightness value in each image block;

[0111] According to the second mapping values corresponding to all the brightness values in all the image blocks, determine all the third mapping values corresponding to each target brightness value among all the target brightness values included in the target image; all the third mapping values corresponding to each target brightness value are all the third mapping values at all the target pixel positions that match the target brightness value;

[0112] Based on all the third mapping values corresponding to each target brightness value, determine the fourth mapping value corresponding to each target brightness value, and generate the first mapping table according to the fourth mapping values corresponding to all the target brightness values;

[0113] Among them, the second mapping value corresponding to each brightness value in each image block is:

[0114] G′ out =(1 - stren)*G out +stren*G;

[0115] G′ out is the second mapping value corresponding to this brightness value in the corresponding image block, stren is the mapping adjustment parameter corresponding to this image block, G out is the first mapping value corresponding to this brightness value in this image block, and G is this brightness value in this image block;

[0116] The first mapping table is:

[0117]

[0118] Map(i) is the first mapping table, a(i) is the counting function corresponding to the target brightness value i, indicating the third mapping value G at the target pixel position (x, y) that matches the target brightness value i out ;

[0119] Among them, the counting function corresponding to each of the target brightness values is:

[0120] G(x, y) represents the brightness value G at the pixel position (x, y) in the corresponding image block.

[0121] As an optional implementation manner, in the second aspect of the present invention, the determining module is further configured to, after the mapping table generating module generates a first mapping table based on the third transformation functions corresponding to all the image blocks and the target brightness information of the target image, determine a fourth transformation function corresponding to the first mapping table;

[0122] The device further includes:

[0123] A judging module, configured to judge whether the first mapping table meets the mapping table adjustment condition according to the fourth transformation function; the fourth transformation function is a transformation function determined based on the fourth mapping values corresponding to all the target brightness values;

[0124] A mapping table adjustment module, configured to, when the judging module judges that the first mapping table meets the mapping table adjustment condition, perform a mapping table adjustment operation on the first mapping table according to the comparison between the histogram parameter corresponding to each target brightness value and the preset histogram average distribution level to obtain a second mapping table; the histogram parameter corresponding to each target brightness value is determined based on the distribution of the target brightness value;

[0125] In addition, the device further includes:

[0126] A traversing module, configured to traverse the first mapping table before the determining module determines the fourth transformation function corresponding to the first mapping table;

[0127] The judging module is further configured to judge whether there is a blank mapping value among the fourth mapping values corresponding to all the target brightness values; when it is judged that there is no blank mapping value among the fourth mapping values corresponding to all the target brightness values, trigger the determining module to perform the operation of determining the fourth transformation function corresponding to the first mapping table, and trigger the operation of judging whether the first mapping table meets the mapping table adjustment condition according to the fourth transformation function;

[0128] The determining module is further configured to, when the judging module determines that there is the blank mapping value among all the fourth mapping values corresponding to all the target brightness values, determine all the to-be-processed brightness values corresponding to the fourth mapping value being the blank mapping value from all the target brightness values; for each to-be-processed brightness value, determine all other relevant brightness values that match the to-be-processed brightness value and exclude the to-be-processed brightness value; each of the other relevant brightness values is adjacent to the to-be-processed brightness value and the fourth mapping value corresponding to each of the other relevant brightness values is not the blank mapping value.

[0129] The mapping value filling module is configured to perform a mapping value filling operation on the fourth mapping value corresponding to the to-be-processed brightness value according to the fourth mapping values corresponding to all the other relevant brightness values, so as to update the fourth mapping value corresponding to the to-be-processed brightness value.

[0130] The updating module is configured to, after updating the fourth mapping values corresponding to all the to-be-processed brightness values, update the first mapping table according to the fourth mapping values corresponding to all the to-be-processed brightness values, and trigger the determining module to perform the operation of determining the fourth transformation function corresponding to the first mapping table, and trigger the judging module to perform the operation of judging whether the first mapping table meets the mapping table adjustment condition according to the fourth transformation function.

[0131] Wherein, the second mapping table is:

[0132]

[0133] Map′(i) is the second mapping table, Map(i - 1) is the first mapping table, Hist s (i) is the histogram parameter corresponding to the corresponding target brightness value, M s is the preset histogram average distribution level.

[0134] As an optional implementation manner, in the second aspect of the present invention, the judging module is further configured to judge whether the target mapping table meets the mapping table smoothing condition; when the first mapping table meets the mapping table adjustment condition, the target mapping table is the second mapping table; when the first mapping table does not meet the mapping table adjustment condition, the target mapping table is the first mapping table.

[0135] The determining module is further configured to determine a smoothing parameter corresponding to the target mapping table when the judging module determines that the target mapping table satisfies the mapping table smoothing condition; the smoothing parameter includes at least one of the smoothing times of the target mapping table, the fourth mapping values corresponding to all the target brightness values to be smoothed in a single smoothing, the smoothing range corresponding to each of the fourth mapping values to be smoothed in a single smoothing, and the smoothing weighting value corresponding to the smoothing range corresponding to each of the fourth mapping values to be smoothed in a single smoothing;

[0136] Moreover, the apparatus further includes:

[0137] A mapping table smoothing module, configured to perform a mapping table smoothing operation on the target mapping table according to the smoothing parameter to obtain a third mapping table;

[0138] Wherein, the third mapping table obtained after performing a single mapping table smoothing operation on the target mapping table is:

[0139]

[0140] Map(s) is the third mapping table, n is the smoothing range corresponding to each of the fourth mapping values to be smoothed in a single smoothing, ω T is the cumulative sum of the smoothing weighting values ω(n + i) corresponding to the smoothing range corresponding to each of the fourth mapping values to be smoothed in a single smoothing, Map(η(s + i)) is the target mapping table, where η(s + i) is a restricted range function;

[0141] Wherein, the restricted range function is:

[0142]

[0143] A third aspect of the present invention discloses another global mapping table generation apparatus for image enhancement, the apparatus includes:

[0144] A memory storing executable program code;

[0145] A processor coupled to the memory;

[0146] The processor calls the executable program code stored in the memory and executes the global mapping table generation method for image enhancement disclosed in the first aspect of the present invention.

[0147] A fourth aspect of the present invention discloses a computer storage medium, the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the global mapping table generation method for image enhancement disclosed in the first aspect of the present invention.

[0148] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0149] In the embodiments of the present invention, a target image to be processed is obtained, and a first transformation function corresponding to the target image is determined; an image segmentation operation is performed on the target image to obtain a plurality of image blocks, and a second transformation function corresponding to each image block is determined; based on the first transformation function, the second transformation function corresponding to each image block is guided and adjusted to obtain a third transformation function corresponding to each image block; a first mapping table is generated based on the third transformation functions corresponding to all the image blocks and the target brightness information of the target image. It can be seen that implementing the present invention can intelligently generate a global mapping table for image enhancement. By performing image enhancement through this global mapping table, the problems of image local detail loss and discontinuous boundaries of image blocks existing in the traditional histogram equalization image processing method can be effectively solved, and a large number of interpolation operations on image data can be avoided. In this way, it is not only beneficial to reduce the computational amount during image processing, thereby quickly enhancing the image and being applicable to real-time processing of images, but also beneficial to effectively improve the contrast of the image, retain the local details of the image, and eliminate the block effect of the image, thereby enhancing the image enhancement effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0150] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0151] Figure 1 is a schematic flowchart of a method for generating a global mapping table for image enhancement disclosed in an embodiment of the present invention;

[0152] Figure 2 is a schematic flowchart of another method for generating a global mapping table for image enhancement disclosed in an embodiment of the present invention;

[0153] Figure 3 is a schematic structural diagram of a device for generating a global mapping table for image enhancement disclosed in an embodiment of the present invention;

[0154] Figure 4 is a schematic structural diagram of another device for generating a global mapping table for image enhancement disclosed in an embodiment of the present invention;

[0155] Figure 5 is a schematic structural diagram of still another device for generating a global mapping table for image enhancement disclosed in an embodiment of the present invention;

[0156] Figure 6It is a schematic diagram of a target guiding function corresponding to a second transformation function corresponding to an image block disclosed in an embodiment of the present invention. Detailed implementation manners

[0157] To enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention.

[0158] The terms "first", "second", etc. in the specification and claims of the present invention and the above accompanying drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, device, product, or terminal including a series of steps or units is not limited to the listed steps or units, but optionally further includes steps or units not listed, or optionally further includes other steps or units inherent to these processes, methods, products, or terminals.

[0159] Referring to "embodiment" herein means that a specific feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the present invention. The phrase appears in various places in the specification and does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment mutually exclusive with other embodiments. Those skilled in the art will explicitly and implicitly understand that the embodiments described herein can be combined with other embodiments.

[0160] The present invention discloses a global mapping table generation method and device for image enhancement, which can reduce the amount of computation during image processing, quickly enhance the image, effectively improve the contrast of the image, retain the local details of the image, and eliminate the block effect of the image, thereby enhancing the image enhancement effect. The following will be described in detail respectively.

[0161] Embodiment 1

[0162] Please refer to Figure 1 , Figure 1 It is a schematic flowchart of a global mapping table generation method for image enhancement disclosed in an embodiment of the present invention. Among them, Figure 1The global mapping table generation method for image enhancement described above can be applied to the work of enhancing the image contrast of static images, and can also be applied to the real-time image processing work of dynamic images (such as video images). Optionally, the global mapping table generation method for image enhancement can be applied to the image processing work of a variety of image sensor devices, such as security cameras, motion cameras, and dash cams, etc., which are not limited in the embodiments of the present invention. Further optionally, this method can be implemented by an image processing system, which can be integrated in an image processing device, and can be a local server or a cloud server for managing the image processing (image enhancement) process, etc., which are not limited in the embodiments of the present invention. As Figure 1 shown, the global mapping table generation method for image enhancement may include the following operations:

[0163] 101. Obtain a target image to be processed and determine a first transformation function corresponding to the target image.

[0164] In the embodiments of the present invention, the target image is determined based on the original image to be enhanced. Specifically, when the resolution of the original image is small or the processing rate during image data processing does not need to be improved, the target image can be the original image; when the resolution of the original image is large or the processing rate during image data processing needs to be improved, the target image can be the image obtained by reducing the original image. When reducing the original image, the downsampling scale can be determined according to the resolution of the original image.

[0165] Furthermore, the first transformation function corresponding to the target image is determined in the following manner: Determine the histogram of the target image according to the target brightness information of the target image; Determine the clipping limit value of the histogram of the target image according to the resolution of the target image and the brightness value range of the target image; Perform a clipping operation on the histogram of the target image according to the clipping limit value to obtain a first sub-histogram exceeding the clipping limit value and a second sub-histogram not exceeding the clipping limit value; Fill the first sub-histogram into the second sub-histogram according to a preset filling method to update the second sub-histogram; Update the histogram of the target image according to the updated second sub-histogram; Determine the distribution function of the target image according to the updated histogram of the target image; Determine the first transformation function corresponding to the target image according to the distribution function of the target image; where the target brightness information of the target image includes all target brightness values included in the target image and the distribution of each target brightness value, and the first transformation function corresponding to the target image is: k∈[0, 255]; CDF g (k) is the first transformation function corresponding to the target image, T is the total number of pixels of the target image, H g (i) is the distribution function of the target image.

[0166] 102. Perform an image segmentation operation on the target image to obtain multiple image blocks, and determine the second transformation function corresponding to each image block.

[0167] In an embodiment of the present invention, optionally, before performing an image segmentation operation on the target image to obtain multiple image blocks, the method may further include: determining the segmentation parameter of the target image according to the total number of pixels of the target image; wherein, performing an image segmentation operation on the target image to obtain multiple image blocks includes: performing an image segmentation operation on the target image according to the segmentation parameter of the target image to obtain multiple image blocks. Specifically, the segmentation parameter of the target image includes the number of segments and / or the total number of pixels of each image block to be obtained. It should be noted that, generally, when segmenting the target image, it is necessary to ensure that the total number of pixels of each image block obtained by segmentation is not less than 1024, otherwise, it is not conducive to subsequent image processing operations. Further, the specific determination steps of the second transformation function corresponding to each image block may be implemented with reference to the specific determination steps of the first transformation function corresponding to the target image. Among them, when performing a clipping operation on the histogram of each image block, the clipping limit value of each image block may be determined according to the brightness information of the image block, or the same clipping limit value may be directly set.

[0168] 103. Based on the first transformation function, perform a guided adjustment on the second transformation function corresponding to each image block to obtain the third transformation function corresponding to each image block.

[0169] In an embodiment of the present invention, specifically, since the brightness information of each image block is inconsistent, the intensity of the guided adjustment performed on the second transformation function corresponding to each image block based on the first transformation function is also inconsistent, that is, the third transformation functions corresponding to all image blocks are different from each other, which is beneficial to improving the accuracy of the guided adjustment of the second transformation function corresponding to each image block.

[0170] 104. Generate a first mapping table based on the third transformation functions corresponding to all image blocks and the target brightness information of the target image.

[0171] In an embodiment of the present invention, wherein, the target brightness information of the target image includes all target brightness values included in the target image and the distribution of each target brightness value. Specifically, the first mapping table is used to perform an image enhancement operation on the original image. The first mapping table can be understood as the mapping value corresponding to each target brightness value of the target image. Among them, when the target image is the original image, the first mapping table can be used to directly perform an image enhancement operation on the target image; when the target image is an image obtained by shrinking the original image, the target image is enlarged to the original image and then an image enhancement operation is performed.

[0172] It can be seen that implementing the embodiments of the present invention can intelligently generate a global mapping table for image enhancement. By using this global mapping table for image enhancement, it is possible to effectively solve the problems of loss of local details in the image and discontinuous boundaries of image blocks existing in the traditional histogram equalization image processing method. Moreover, it is not necessary to perform a large number of interpolation operations on the image data. In this way, it is not only beneficial to reduce the computational amount during image processing, thereby quickly enhancing the image, and thus being applicable to real-time processing of images, but also beneficial to effectively improve the contrast of the image, retain the local details of the image, and eliminate the blocking effect of the image, thereby enhancing the image enhancement effect.

[0173] Embodiment 2

[0174] Please refer to Figure 2 , Figure 2 which is a schematic flowchart of a method for generating a global mapping table applied to image enhancement disclosed in the embodiments of the present invention. Among them, Figure 2 the described method for generating a global mapping table applied to image enhancement can be applied to the work of enhancing the image contrast of static images, and can also be applied to the real-time image processing work of dynamic images (such as video images). Optionally, the method for generating a global mapping table applied to image enhancement can be applied to the image processing work of a variety of image sensor devices, such as security cameras, motion cameras, and dash cams, etc., and the embodiments of the present invention do not make limitations. Further optionally, this method can be implemented by an image processing system, and this image processing system can be integrated in an image processing device, and can be a local server or a cloud server, etc., that manages the image processing (image enhancement) process, and the embodiments of the present invention do not make limitations. As Figure 2 shown, the method for generating a global mapping table applied to image enhancement can include the following operations:

[0175] 201. Obtain a target image to be processed and determine a first transformation function corresponding to the target image.

[0176] 202. Perform an image segmentation operation on the target image to obtain a plurality of image blocks, and determine a second transformation function corresponding to each image block.

[0177] 203. Based on the first transformation function, determine a target guiding function corresponding to the second transformation function of each image block.

[0178] In an embodiment of the present invention, each target guiding function is used to guide and adjust the second transformation function corresponding to the image block. Specifically, since the brightness information of each image block is different and the image processing requirements of each image block are also inconsistent, the guiding and adjusting directions of the target guiding function for the second transformation function corresponding to the image block are also different. For example, when the image block is displayed darker and needs to be brightened, that is, when it is necessary to perform an upward guiding adjustment on the curve direction of the second transformation function corresponding to the image block, at this time, it can be determined that the target guiding function corresponding to the second transformation function of the image block is an upward curve (convex curve); when the image block is displayed brighter and needs to be dimmed, that is, when it is necessary to perform a downward guiding adjustment on the curve direction of the second transformation function corresponding to the image block, at this time, it can be determined that the target guiding function corresponding to the second transformation function of the image block is a downward curve (concave curve); and when the image block does not need to be adjusted much in brightness, at this time, it can be determined that the target guiding function corresponding to the second transformation function of the image block is a curve close to a linear line.

[0179] 204. Determine the guiding adjustment ratio corresponding to the second transformation function of each image block.

[0180] In an embodiment of the present invention, specifically, the guiding adjustment ratio corresponding to the second transformation function of each image block can be understood as the guiding adjustment intensity of the target guiding function corresponding to the second transformation function of the image block for the second transformation function corresponding to the image block, which is beneficial to improving the guiding adjustment accuracy of the second transformation function corresponding to each image block further.

[0181] 205. According to the target guiding function and the guiding adjustment ratio corresponding to the second transformation function of each image block, guide and adjust the second transformation function of each image block to obtain the third transformation function corresponding to each image block.

[0182] In an embodiment of the present invention, the third transformation function corresponding to each image block is CDF′ b (i)=(1 - ratio)*C gd (i)+ratio*CDF b (i); CDF′ b (i) is the third transformation function corresponding to the corresponding image block, C gd (i) is the target guiding function corresponding to the second transformation function of the image block, CDF b (i) is the second transformation function of the image block, and ratio is the guiding adjustment ratio corresponding to the second transformation function of the image block.

[0183] 206. Generate a first mapping table based on the third transformation functions corresponding to all image blocks and the target brightness information of the target image.

[0184] In the embodiments of the present invention, for other descriptions of steps 201, 202, and 206, please refer to the detailed descriptions of steps 101, 102, and 104 in Embodiment 1 respectively, and the embodiments of the present invention will not be elaborated herein.

[0185] It can be seen that implementing the embodiments of the present invention can determine the target guiding functions corresponding to the second transformation functions of each image block, and make corresponding guiding adjustments to the second transformation functions of each image block, which is beneficial to improving the reliability and accuracy of the guiding adjustments of the second transformation functions of each image block, and further beneficial to retaining the image details of each image block, thereby being beneficial to enhancing the enhancement effect of the subsequent enhanced original image.

[0186] In an optional embodiment, the determining, based on the first transformation function, the target guiding function corresponding to the second transformation function of each image block in step 203 includes:

[0187] Determine the first guiding function corresponding to each image block based on the brightness information of each image block;

[0188] Perform a function superposition operation on the first guiding function corresponding to each image block based on the first transformation function to obtain the second guiding function corresponding to each image block;

[0189] Obtain the distribution function corresponding to each image block;

[0190] Analyze the mapping of the second transformation function corresponding to each image block to the first brightness value of the image block and the mapping of the second guiding function corresponding to each image block to the second brightness value of the image block according to the distribution function corresponding to each image block;

[0191] Determine the target guiding function corresponding to the second transformation function of each image block according to the comparison of the difference between the first brightness value and the difference between the second brightness value corresponding to each image block.

[0192] In this optional embodiment, the brightness information of each image block includes all the brightness values contained in the image block and the distribution of each brightness value in the image block. Specifically, based on the brightness information of each image block, a first guiding function corresponding to each image block is determined (that is, the basis for determining the target guiding function corresponding to the second transformation function corresponding to the image block). It can be understood that: based on the brightness information of the image block, an external control sets a first guiding function corresponding to the image block. The function of the first guiding function is to guide and control the stretching direction of the second transformation function corresponding to the image block according to the processing requirements of the image block, and the first guiding function can be an upward curve, a downward curve, or an S-shaped curve. For example, in order to brighten the image block, the first guiding function corresponding to the image block can be set as a weak upward curve. Assuming that i is the brightness value within the image block, the first guiding function can be defined as: When not too much brightening is required for the image block, the first guiding function corresponding to the image block can be set to be close to a linear line, and the first guiding function can be defined as: And when it is necessary to brighten the local dark area of the image block and not too much brightening is required for the local bright area, the two curves above can be combined, and the first guiding function corresponding to the image block can be set as: C tar3 (i) = ((256 - i) * Ctar1 + i * Ctar2 + 128 >> 8, i ∈ [0, 255], where the symbol ">>" is the right shift operation in the computer, and ">>8" means dividing by 256.

[0193] In this optional embodiment, the distribution function corresponding to each image block is determined based on the brightness information of the image block; each first brightness value mapping situation represents the difference in the first brightness value corresponding to each brightness value in the image block after being mapped by the second transformation function corresponding to the image block, and each second brightness value mapping situation represents the difference in the second brightness value corresponding to each brightness value in the image block after being mapped by the second transformation function corresponding to the image block.

[0194] Among them, the second guiding function corresponding to each image block is:

[0195]

[0196] C′ tar (i) is the second guiding function corresponding to the corresponding image block, and C tar (i) is the first guiding function corresponding to the image block, and cDF g (i) is the first transformation function, and i is the brightness value under the image block;

[0197] And the difference in the first brightness value and the difference in the second brightness value corresponding to each image block are:

[0198]

[0199] ΔL act is the first luminance value difference corresponding to the corresponding image block, ΔL tar is the second luminance value difference corresponding to the image block, H b (i) is the distribution function corresponding to the image block;

[0200] And, the target guiding function corresponding to the second transformation function of each image block is:

[0201]

[0202] Among them, the schematic diagram of the target guiding function corresponding to the second transformation function of the corresponding image block is as shown in Figure 6 shown. The function of this target guiding function is to make a guiding adjustment to the second transformation function corresponding to the image block, so that the first luminance value difference corresponding to the image block approaches the second luminance value difference.

[0203] It can be seen that this optional embodiment can reasonably determine the target guiding function corresponding to the second transformation function of the corresponding image block based on evidence, which is beneficial to accurately guiding and adjusting the second transformation function corresponding to the image block according to the luminance information of the corresponding image block. Furthermore, it is beneficial to make a reliable and accurate adjustment to the luminance information of the image block to retain the local characteristics of each image block.

[0204] In another optional embodiment, determining the guiding adjustment ratio corresponding to the second transformation function of each image block in step 204 above includes:

[0205] According to the distribution function corresponding to each image block, analyze the mapping of the third luminance value of the target guiding function corresponding to the second transformation function of each image block;

[0206] According to the comparison between the first luminance value difference and the third luminance value difference of each image block, determine the guiding adjustment ratio corresponding to the second transformation function of each image block.

[0207] In this optional embodiment, specifically, each mapping of the third luminance value represents the third luminance value difference corresponding to each luminance value in the image block after being mapped by the target guiding function corresponding to the second transformation function of the image block;

[0208] Among them, the third luminance value difference corresponding to each image block is:

[0209]

[0210] ΔLgd is the third luminance value difference corresponding to the corresponding image block;

[0211] Moreover, the guiding adjustment ratio corresponding to the second transformation function corresponding to each image block is:

[0212] where the value range of ratio is [0, 1].

[0213] It can be seen that this optional embodiment can determine the guiding adjustment intensity of the second transformation function corresponding to each image block according to the luminance information of each image block, so as to reduce the occurrence of over-bright or over-dark images of the image block, which is beneficial to retaining or enhancing the image details of the image block, and thus beneficial to improving the overall enhancement effect of the enhanced image.

[0214] In another optional embodiment, generating the first mapping table based on the third transformation functions corresponding to all image blocks and the target luminance information of the target image in step 206 includes:

[0215] Calculating a first mapping value corresponding to each luminance value in each image block according to the third transformation function corresponding to each image block;

[0216] Determining a mapping adjustment parameter corresponding to each image block, and performing a mapping adjustment operation on the first mapping value corresponding to each luminance value in each image block according to the mapping adjustment parameter corresponding to each image block, to obtain a second mapping value corresponding to each luminance value in each image block;

[0217] Determining all third mapping values corresponding to each target luminance value among all target luminance values included in the target image according to the second mapping values corresponding to all luminance values in all image blocks;

[0218] Based on all third mapping values corresponding to each target luminance value, determining a fourth mapping value corresponding to each target luminance value, and generating a first mapping table according to the fourth mapping values corresponding to all target luminance values.

[0219] In this optional embodiment, specifically, all third mapping values corresponding to each target luminance value are all third mapping values at all target pixel positions matching the target luminance value, that is, the target luminance value can be distributed at multiple target pixel positions in the target image. For example, at the target pixel positions (x 1 , y 1 ) and (x 4 , y 3 ) in the target image, the target luminance value is 150.

[0220] Among them, the second mapping value corresponding to each luminance value in each image block is:

[0221] G′ out =(1 - stren)*G out +stren*G, where the value range of stren is [0, 1];

[0222] G′ out is the second mapping value corresponding to this luminance value in the corresponding image block, stren is the mapping adjustment parameter corresponding to this image block, and G out is the first mapping value corresponding to this luminance value in this image block, and G is the luminance value in this image block;

[0223] And the first mapping table is:

[0224]

[0225] Map(i) is the first mapping table, a(i) is the counting function corresponding to the target luminance value i, representing the third mapping value G at the target pixel position (x, y) that matches the target luminance value i out ;

[0226] Among them, the counting function corresponding to each target luminance value is:

[0227]

[0228] G(x, y) represents the luminance value G at the pixel position (x, y) in the corresponding image block, and a(i) can be understood as the number of the target luminance value i in the target image.

[0229] For example, in each image block, each luminance value at each pixel position corresponds to a second mapping value. However, due to the local differences between image blocks, even for the same luminance value between image blocks, there will be different mapping levels in different image blocks. At this time, in order to generate a global mapping table (i.e., the first mapping table) based on the corresponding third transformation functions in each image block, it is necessary to average all the second mapping values corresponding to the same luminance value in each image block (that is, all the third mapping values corresponding to each target luminance value in all the target luminance values included in the target image) to obtain the fourth mapping value corresponding to each target luminance value, that is, a first mapping table in which the target luminance value and the fourth mapping value are in one-to-one mapping is generated.

[0230] It can be seen that this optional embodiment can intelligently generate a one-to-one mapping table, which is beneficial to eliminating the local differences between image blocks, thereby reducing the occurrence of block effects in the enhanced image, and thus improving the overall enhancement effect of the enhanced image.

[0231] In yet another alternative embodiment, after generating the first mapping table based on the third transformation functions corresponding to all image blocks and the target brightness information of the target image in step 206 above, the method may further include:

[0232] Determine the fourth transformation function corresponding to the first mapping table, and determine whether the first mapping table meets the mapping table adjustment condition according to the fourth transformation function;

[0233] When it is determined that the first mapping table meets the mapping table adjustment condition, perform a mapping table adjustment operation on the first mapping table according to the comparison between the histogram parameters corresponding to each target brightness value and the preset histogram average distribution level to obtain a second mapping table.

[0234] In this alternative embodiment, specifically, the fourth transformation function is a transformation function determined based on the fourth mapping values corresponding to all target brightness values, and the histogram parameter corresponding to each target brightness value is determined based on the distribution of the target brightness value. Among them, the histogram parameter corresponding to each target brightness value can be understood as the total number of pixels corresponding to the target brightness value.

[0235] Among them, the second mapping table is:

[0236]

[0237] Map′(i) is the second mapping table, Map(i - 1) is the first mapping table, Hist s (i) is the histogram parameter corresponding to the corresponding target brightness value, M s is the preset histogram average distribution level.

[0238] For example, in the first mapping table obtained in the above steps, there may be a phenomenon of brightness inversion, that is, there is an inversion between the bright area and the dark area of the image, that is, there is an extreme value in the fourth transformation function. At this time, a mapping table adjustment operation needs to be performed on the first mapping table so that the histogram parameter of each target brightness value in the first mapping table is greater than or equal to the histogram parameter of the previous target brightness value adjacent to and before the target brightness value. Among them, Map[0] needs to be set to 0, and Map

[255] needs to be set to 255. When there is no extreme value in the fourth transformation function, the mapping table adjustment operation may not be performed on the first mapping table.

[0239] It can be seen that this alternative embodiment can flexibly adjust the first mapping table by analyzing the fourth transformation function corresponding to the first mapping table, effectively solve the phenomenon of brightness inversion in the first mapping table, ensure the enhancement effect of the enhanced image, and enrich the intelligent processing method of the global mapping table by the image processing system.

[0240] In yet another alternative embodiment, before determining the fourth transformation function corresponding to the first mapping table in the above step, the method may further include:

[0241] Traverse the first mapping table and determine whether there are blank mapping values among the fourth mapping values corresponding to all target brightness values;

[0242] When it is determined that there are no blank mapping values among the fourth mapping values corresponding to all target brightness values, trigger the operation of determining the fourth transformation function corresponding to the first mapping table, and trigger the operation of determining whether the first mapping table meets the mapping table adjustment condition according to the fourth transformation function;

[0243] When it is determined that there are blank mapping values among the fourth mapping values corresponding to all target brightness values, determine all to-be-processed brightness values whose corresponding fourth mapping values are blank mapping values from all target brightness values;

[0244] For each to-be-processed brightness value, determine all other relevant brightness values that match the to-be-processed brightness value and exclude the to-be-processed brightness value; perform a mapping value filling operation on the fourth mapping value corresponding to the to-be-processed brightness value according to the fourth mapping values corresponding to all other relevant brightness values to update the fourth mapping value corresponding to the to-be-processed brightness value;

[0245] After updating the fourth mapping values corresponding to all to-be-processed brightness values, update the first mapping table according to the fourth mapping values corresponding to all to-be-processed brightness values, and trigger the operation of determining the fourth transformation function corresponding to the first mapping table, and trigger the operation of determining whether the first mapping table meets the mapping table adjustment condition according to the fourth transformation function.

[0246] In this alternative embodiment, each other relevant brightness value is adjacent to the to-be-processed brightness value and the fourth mapping value corresponding to each other relevant brightness value is not a blank mapping value. For example, in the calculation process of the first mapping table in the above step, since a(i) may be 0, that is, the fourth mapping value corresponding to a certain target brightness value may be a blank mapping value. At this time, linear interpolation filling needs to be performed on the fourth mapping value corresponding to the target brightness value. The specific method can be understood as follows: first set Map[0] in the first mapping table to 0 and Map

[255] to 255, and then traverse the first mapping table. If it is found that the fourth mapping value corresponding to a certain target brightness value in the first mapping table is a blank mapping value, at this time, using this target brightness value (i.e., the to-be-processed brightness value) as the reference element, move to the left and right sides to find all other relevant brightness values that are the first non-blank mapping values on both sides, so as to perform a mapping value filling operation (such as linear filling) on the fourth mapping value of the to-be-processed brightness value according to the fourth mapping values corresponding to all other relevant brightness values until all target brightness values in the first mapping table are traversed.

[0247] It can be seen that this optional embodiment can automatically perform a mapping value filling operation on the blank mapping values in the first mapping table, ensuring the data integrity of the first mapping table. In this way, the subsequent mapping table adjustment operation on the first mapping table can be carried out effectively and smoothly, so as to improve the reliability and accuracy of the obtained global mapping table.

[0248] In another optional embodiment, the method may further include:

[0249] Determine whether the target mapping table meets the mapping table smoothing condition;

[0250] When it is determined that the target mapping table meets the mapping table smoothing condition, determine the smoothing parameter corresponding to the target mapping table;

[0251] Perform a mapping table smoothing operation on the target mapping table according to the smoothing parameter to obtain a third mapping table.

[0252] In this optional embodiment, when the first mapping table meets the mapping table adjustment condition, the target mapping table is the second mapping table; when the first mapping table does not meet the mapping table adjustment condition, the target mapping table is the first mapping table, and the smoothing parameter includes at least one of the smoothing times of the target mapping table, the fourth mapping values corresponding to all target brightness values to be smoothed in a single smoothing, the smoothing range corresponding to each fourth mapping value to be smoothed in a single smoothing, and the smoothing weight value corresponding to the smoothing range corresponding to each fourth mapping value to be smoothed in a single smoothing.

[0253] Among them, the third mapping table obtained after performing a single mapping table smoothing operation on the target mapping table is:

[0254]

[0255] Map(s) is the third mapping table, n is the smoothing range corresponding to each fourth mapping value to be smoothed in a single smoothing, ω T is the cumulative sum of the smoothing weight values ω(n + i) corresponding to the smoothing range corresponding to each fourth mapping value to be smoothed in a single smoothing, Map(η(s + i)) is the target mapping table, where η(s + i) is a restricted range function;

[0256] Among them, the restricted range function is:

[0257]

[0258] Specifically, determining whether the target mapping table meets the mapping table smoothing condition can be judged by the severity of the color jitter phenomenon of the enhanced image. That is, when it is predicted that the color jitter phenomenon of the enhanced image is severe, the mapping table smoothing operation needs to be performed on the target mapping table. Otherwise, the mapping table smoothing operation does not need to be performed on the target mapping table. For example, for the mapping table smoothing operation on the target mapping table, it can be understood that when smoothing the fourth mapping value with a target brightness value of 8, at this time, the smoothing times can be set to 2, and the smoothing range corresponding to the fourth mapping value to be smoothed in a single smoothing is the fourth mapping values corresponding to the target brightness values of 3, 4, 5, 6, 7, 8 (the current target brightness value), 9, 10, 11, 12, 13, and the smoothing weight values corresponding to this smoothing range can be set to {1, 1, 1, 1, 2, 4, 2, 1, 1, 1, 1} respectively, that is, the closer to the current target brightness value of 8 (this distance calculation can be calculated according to the Gaussian template method), the larger the smoothing weight value can be set. It should be noted that the target mapping table smoothing operation can also be implemented by Gaussian smoothing method and mean filter smoothing method, etc.

[0259] It can be seen that this optional embodiment can effectively eliminate the color jitter phenomenon of the enhanced image through the smoothing of the target mapping table, greatly improve the enhancement effect of the image, and further enrich the intelligent processing methods of the image processing system for the mapping table through flexible mapping table smoothing methods.

[0260] Embodiment III

[0261] Please refer to Figure 3 , Figure 3 which is a schematic structural diagram of a global mapping table generation device for image enhancement disclosed in an embodiment of the present invention. As Figure 3 shown, the global mapping table generation device for image enhancement may include:

[0262] An acquisition module 301, configured to acquire a target image to be processed;

[0263] A determination module 302, configured to determine a first transformation function corresponding to the target image;

[0264] An image segmentation module 303, configured to perform an image segmentation operation on the target image to obtain a plurality of image blocks;

[0265] The determination module 302 is further configured to determine a second transformation function corresponding to each image block;

[0266] A guidance adjustment module 304, configured to perform a guidance adjustment on the second transformation function corresponding to each image block based on the first transformation function to obtain a third transformation function corresponding to each image block;

[0267] A mapping table generation module 305, configured to generate a first mapping table based on third transformation functions corresponding to all image blocks and target brightness information of a target image.

[0268] In an embodiment of the present invention, the target image is determined based on an original image to be enhanced, and the target image is the original image or an image obtained by reducing the original image; the target brightness information of the target image includes all target brightness values included in the target image and the distribution of each target brightness value, and the first mapping table is used to perform an image enhancement operation on the original image.

[0269] It can be seen that implementing Figure 3 The described global mapping table generation device for image enhancement can intelligently generate a global mapping table for image enhancement. By performing image enhancement through this global mapping table, it can effectively solve the problems of loss of local details of an image and discontinuity of boundaries of image blocks existing in the traditional histogram equalization image processing method, and can also eliminate the need for a large number of interpolation operations on image data. In this way, it is not only beneficial to reduce the computational amount during image processing, and then perform fast enhancement on the image, so as to be applicable to real-time processing of images, but also beneficial to effectively improve the contrast of the image, retain local details of the image, and eliminate the block effect of the image, thereby enhancing the enhancement effect of the image.

[0270] In an optional embodiment, the guidance adjustment module 304 includes:

[0271] A determination sub-module 3041, configured to determine a target guidance function corresponding to the second transformation function corresponding to each image block based on the first transformation function; and determine a guidance adjustment ratio corresponding to the second transformation function corresponding to each image block;

[0272] A guidance adjustment sub-module 3042, configured to perform guidance adjustment on the second transformation function corresponding to each image block according to the target guidance function corresponding to the second transformation function corresponding to each image block and the guidance adjustment ratio, so as to obtain a third transformation function corresponding to each image block.

[0273] In this optional embodiment, each target guidance function is used to perform guidance adjustment on the second transformation function corresponding to the image block; wherein, the third transformation function corresponding to each image block is:

[0274] CDF′ b (i) = (1 - ratio) * C gd (i) + ratio * CDF b (i);

[0275] CDF′ b (i) is the third transformation function corresponding to the corresponding image block, C gd(i) is the target guiding function corresponding to the second transformation function of the image block, CDF b (i) is the second transformation function corresponding to the image block, and ratio is the guiding adjustment ratio corresponding to the second transformation function of the image block.

[0276] It can be seen that implementing Figure 4 the global mapping table generation device applied to image enhancement described above can, by determining the target guiding functions corresponding to the second transformation functions of each image block, perform corresponding guiding adjustments on the second transformation functions of each image block, which is beneficial to improving the reliability and accuracy of the guiding adjustments of the second transformation functions of each image block, and thus is beneficial to retaining the image details of each image block, and further is beneficial to enhancing the enhancement effect of the original image obtained subsequently.

[0277] In another optional embodiment, the specific manner in which the determining sub-module 3041 determines the target guiding function corresponding to the second transformation function of each image block based on the first transformation function is as follows:

[0278] Based on the luminance information of each image block, determine the first guiding function corresponding to each image block;

[0279] Based on the first transformation function, perform a function superposition operation on the first guiding function corresponding to each image block to obtain the second guiding function corresponding to each image block;

[0280] Obtain the distribution function corresponding to each image block;

[0281] According to the distribution function corresponding to each image block, analyze the mapping situation of the first luminance value of each image block by the second transformation function corresponding to each image block and the mapping situation of the second luminance value of each image block by the second guiding function corresponding to each image block;

[0282] According to the comparison situation of the difference between the first luminance value and the difference between the second luminance value corresponding to each image block, determine the target guiding function corresponding to the second transformation function of each image block.

[0283] In this optional embodiment, the luminance information of each image block includes all the luminance values included in the image block and the distribution situation of each luminance value in the image block; the distribution function corresponding to each image block is determined based on the luminance information of the image block; each first luminance value mapping situation represents the difference between the first luminance values corresponding to each luminance value in the image block after being mapped by the second transformation function corresponding to the image block, and each second luminance value mapping situation represents the difference between the second luminance values corresponding to each luminance value in the image block after being mapped by the second transformation function corresponding to the image block;

[0284] Among them, the second guiding function corresponding to each image block is:

[0285]

[0286] C′ tar (i) is the second guiding function corresponding to the corresponding image block, C tar (i) is the first guiding function corresponding to the image block, CDF g (i) is the first transformation function, and i is the luminance value of the image block;

[0287] The first luminance value difference and the second luminance value difference corresponding to each image block are:

[0288]

[0289] ΔL act is the first luminance value difference corresponding to the corresponding image block, ΔL tar is the second luminance value difference corresponding to the image block, H b (i) is the distribution function corresponding to the image block;

[0290] The target guiding function corresponding to the second transformation function corresponding to each image block is:

[0291]

[0292] It can be seen that implementing Figure 4 The global mapping table generation device for image enhancement described above can reasonably and justifiably determine the target guiding function corresponding to the second transformation function corresponding to the corresponding image block, which is conducive to accurately guiding and adjusting the second transformation function corresponding to the image block according to the luminance information of the corresponding image block, and further conducive to making reliable and accurate adjustments to the luminance information of the image block to retain the local characteristics of each image block.

[0293] In another optional embodiment, the manner in which the determination sub-module 3041 determines the guiding adjustment ratio corresponding to the second transformation function corresponding to each image block is specifically as follows:

[0294] According to the distribution function corresponding to each image block, analyze the mapping situation of the third luminance value of the target guiding function corresponding to the second transformation function corresponding to each image block;

[0295] According to the comparison situation between the first luminance value difference and the third luminance value difference corresponding to each image block, determine the guiding adjustment ratio corresponding to the second transformation function corresponding to each image block.

[0296] In this optional embodiment, each third luminance value mapping situation represents the third luminance value difference corresponding to each luminance value in the image block after being mapped by the target guiding function corresponding to the second transformation function corresponding to the image block;

[0297] Among them, the third luminance value difference corresponding to each image block is:

[0298]

[0299] ΔL gd is the third luminance value difference corresponding to the corresponding image block;

[0300] The guiding adjustment ratio corresponding to the second transformation function corresponding to each image block is:

[0301]

[0302] It can be seen that implementing Figure 4 The global mapping table generation device for image enhancement described above can determine the guiding adjustment intensity of the second transformation function corresponding to each image block according to the luminance information of each image block, so as to reduce the occurrence of over-bright or over-dark images of the image block, which is beneficial to retaining or enhancing the image details of the image block, and thus is beneficial to improving the overall enhancement effect of the enhanced image.

[0303] In another optional embodiment, the manner in which the mapping table generation module 305 generates the first mapping table based on the third transformation functions corresponding to all image blocks and the target luminance information of the target image is specifically as follows:

[0304] According to the third transformation function corresponding to each image block, calculate the first mapping value corresponding to each luminance value in each image block;

[0305] Determine the mapping adjustment parameter corresponding to each image block, and perform a mapping adjustment operation on the first mapping value corresponding to each luminance value in each image block according to the mapping adjustment parameter corresponding to each image block, to obtain the second mapping value corresponding to each luminance value in each image block;

[0306] According to the second mapping values corresponding to all luminance values in all image blocks, determine all third mapping values corresponding to each target luminance value among all target luminance values included in the target image;

[0307] Based on all third mapping values corresponding to each target luminance value, determine the fourth mapping value corresponding to each target luminance value, and generate the first mapping table according to the fourth mapping values corresponding to all target luminance values.

[0308] In this optional embodiment, all third mapping values corresponding to each target luminance value are all third mapping values at all target pixel positions matching the target luminance value;

[0309] Among them, the second mapping value corresponding to each luminance value in each image block is:

[0310] G' out =(1 - stren)*G out +stren*G;

[0311] G' out is the second mapping value corresponding to the luminance value in the corresponding image block, stren is the mapping adjustment parameter corresponding to the image block, and G out is the first mapping value corresponding to the luminance value in the image block, and G is the luminance value in the image block;

[0312] The first mapping table is:

[0313]

[0314] Map(i) is the first mapping table, a(i) is the counting function corresponding to the target luminance value i, representing the third mapping value G at the target pixel position (x, y) that matches the target luminance value i out ;

[0315] wherein, the counting function corresponding to each target luminance value is:

[0316]

[0317] G(x, y) represents the luminance value G at the pixel position (x, y) in the corresponding image block.

[0318] It can be seen that implementing Figure 4 the global mapping table generation device applied to image enhancement described above can intelligently generate a one-to-one mapping table, which is beneficial to eliminating the local differences between image blocks, thereby reducing the occurrence of block effects in the enhanced image, and thus improving the overall enhancement effect of the enhanced image.

[0319] In another optional embodiment, the determining module 302 is further configured to determine a fourth transformation function corresponding to the first mapping table after the mapping table generation module 305 generates the first mapping table based on the third transformation functions corresponding to all image blocks and the target luminance information of the target image;

[0320] The device may further include:

[0321] A judging module 306, configured to judge whether the first mapping table meets the mapping table adjustment condition according to the fourth transformation function;

[0322] A mapping table adjustment module 307, configured to perform a mapping table adjustment operation on the first mapping table according to the comparison between the histogram parameters corresponding to each target luminance value and the preset histogram average distribution level to obtain a second mapping table when the judging module 306 judges that the first mapping table meets the mapping table adjustment condition.

[0323] In this alternative embodiment, the fourth transformation function is a transformation function determined based on the fourth mapping values corresponding to all target brightness values; the histogram parameter corresponding to each target brightness value is determined based on the distribution of the target brightness value.

[0324] Among them, the second mapping table is as follows:

[0325]

[0326] Map′(i) is the second mapping table, Map(i - 1) is the first mapping table, Hist s (i) is the histogram parameter corresponding to the corresponding target brightness value, and M s is the preset average distribution level of the histogram.

[0327] It can be seen that the global mapping table generation device applied to image enhancement described above can flexibly adjust the first mapping table by analyzing the fourth transformation function corresponding to the first mapping table, effectively solving the phenomenon of brightness inversion in the first mapping table, ensuring the enhancement effect of the enhanced image, and enriching the intelligent processing method of the image processing system for the global mapping table. Figure 4 In yet another alternative embodiment, the device may further include:

[0328] A traversal module 308, configured to traverse the first mapping table before the determination module 302 determines the fourth transformation function corresponding to the first mapping table;

[0329] A judgment module 306, further configured to judge whether there are blank mapping values among the fourth mapping values corresponding to all target brightness values; when it is judged that there are no blank mapping values among the fourth mapping values corresponding to all target brightness values, trigger the operation of the determination module 302 to determine the fourth transformation function corresponding to the first mapping table, and trigger the operation of judging whether the first mapping table meets the mapping table adjustment condition according to the fourth transformation function;

[0330] The determination module 302 is further configured to, when the judgment module 306 judges that there are blank mapping values among the fourth mapping values corresponding to all target brightness values, determine all to-be-processed brightness values corresponding to the fourth mapping values that are blank mapping values from all target brightness values; for each to-be-processed brightness value, determine all other relevant brightness values that match the to-be-processed brightness value and exclude the to-be-processed brightness value;

[0331] A mapping value filling module 309, configured to perform a mapping value filling operation on the fourth mapping value corresponding to the to-be-processed brightness value according to the fourth mapping values corresponding to all other relevant brightness values, so as to update the fourth mapping value corresponding to the to-be-processed brightness value;

[0332] ​

[0333] An update module 310, configured to, after updating all the fourth mapping values corresponding to the to-be-processed brightness values, update the first mapping table according to the fourth mapping values corresponding to all the to-be-processed brightness values, and trigger an operation of determining a fourth transformation function corresponding to the first mapping table executed by the determination module 302, and trigger an operation of determining whether the first mapping table meets a mapping table adjustment condition according to the fourth transformation function executed by the judgment module 306.

[0334] In this optional embodiment, each other relevant brightness value is adjacent to the to-be-processed brightness value and the fourth mapping value corresponding to each other relevant brightness value is not a blank mapping value.

[0335] It can be seen that implementing Figure 4 The global mapping table generation device for image enhancement described above can automatically perform a mapping value filling operation on the blank mapping values in the first mapping table, ensuring the data integrity of the first mapping table. In this way, subsequent mapping table adjustment operations on the first mapping table can be effectively and smoothly carried out to improve the reliability and accuracy of the obtained global mapping table.

[0336] In another optional embodiment, the judgment module 306 is further configured to judge whether a target mapping table meets a mapping table smoothing condition;

[0337] The determination module 302 is further configured to determine a smoothing parameter corresponding to the target mapping table when the judgment module 306 determines that the target mapping table meets the mapping table smoothing condition;

[0338] Moreover, the device may further include:

[0339] A mapping table smoothing module 311, configured to perform a mapping table smoothing operation on the target mapping table according to the smoothing parameter to obtain a third mapping table.

[0340] In this optional embodiment, when the first mapping table meets the mapping table adjustment condition, the target mapping table is the second mapping table; when the first mapping table does not meet the mapping table adjustment condition, the target mapping table is the first mapping table; the smoothing parameter includes at least one of the smoothing times of the target mapping table, the fourth mapping values corresponding to all target brightness values to be smoothed in a single smoothing, the smoothing range corresponding to each fourth mapping value to be smoothed in a single smoothing, and the smoothing weighting value corresponding to the smoothing range corresponding to each fourth mapping value to be smoothed in a single smoothing;

[0341] Wherein, the third mapping table obtained after performing a single mapping table smoothing operation on the target mapping table is:

[0342]

[0343] Map(s) is the third mapping table, n is the smoothing range corresponding to each fourth mapping value to be smoothed in a single smoothing, and ω T is the cumulative sum of the smoothing weight values ω(n + i) corresponding to the smoothing ranges corresponding to each fourth mapping value to be smoothed in a single smoothing. Map(η(s + i)) is the target mapping table, where η(s + i) is the range-limiting function;

[0344] Among them, the range-limiting function is:

[0345]

[0346] It can be seen that implementing Figure 4 the global mapping table generation device for image enhancement described above can effectively eliminate the color jitter phenomenon in the enhanced image by smoothing the target mapping table, greatly improve the image enhancement effect, and further enrich the intelligent processing methods of the image processing system for the mapping table through flexible mapping table smoothing methods.

[0347] Embodiment 4

[0348] Please refer to Figure 5 , Figure 5 which is a schematic structural diagram of another global mapping table generation device for image enhancement disclosed in the embodiments of the present invention. As Figure 5 shown, the global mapping table generation device for image enhancement may include:

[0349] A memory 401 storing executable program code;

[0350] A processor 402 coupled to the memory 401;

[0351] The processor 402 calls the executable program code stored in the memory 401 and executes the steps in the global mapping table generation method for image enhancement described in Embodiment 1 or Embodiment 2 of the present invention.

[0352] Embodiment 5 The embodiments of the present invention disclose a computer storage medium. The computer storage medium stores computer instructions, which are used to execute the steps in the global mapping table generation method for image enhancement described in Embodiment 1 or Embodiment 2 of the present invention when called.

[0353] Embodiment 6

[0354] The embodiments of the present invention disclose a computer program product. The computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute the steps in the global mapping table generation method for image enhancement described in Embodiment 1 or Embodiment 2.

[0355] The device embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art can understand and implement it without creative work.

[0356] Through the above specific descriptions of the embodiments, those skilled in the art can clearly understand that each implementation can be realized by means of software plus a necessary general hardware platform, and of course, it can also be realized by hardware. Based on this understanding, the essence of the above technical solution, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, and the storage medium includes read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-erasable programmable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc memories, magnetic disk memories, tape memories, or any other computer-readable medium capable of carrying or storing data.

[0357] Finally, it should be noted that: the global mapping table generation method and device for image enhancement disclosed in the embodiments of the present invention only disclose the preferred embodiments of the present invention, which are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating a global mapping table for image enhancement, characterized in that, the method includes: Obtain a target image to be processed and determine a first transformation function corresponding to the target image; the target image is determined based on an original image to be enhanced, and the target image is the original image or an image obtained by reducing the original image; Perform an image segmentation operation on the target image to obtain a plurality of image blocks, and determine a second transformation function corresponding to each image block; Based on the first transformation function, perform a guiding adjustment on the second transformation function corresponding to each image block to obtain a third transformation function corresponding to each image block; Generate a first mapping table based on the third transformation function corresponding to all the image blocks and the target brightness information of the target image; the target brightness information of the target image includes all target brightness values included in the target image and the distribution of each target brightness value, and the first mapping table is used to perform an image enhancement operation on the original image; Wherein, the performing a guiding adjustment on the second transformation function corresponding to each image block based on the first transformation function to obtain a third transformation function corresponding to each image block includes: Determine a first guiding function corresponding to each image block based on the brightness information of each image block; the brightness information of each image block includes all brightness values included in the image block and the distribution of each brightness value in the image block; Perform a function superposition operation on the first guiding function corresponding to each image block based on the first transformation function to obtain a second guiding function corresponding to each image block; Obtain a distribution function corresponding to each image block; the distribution function corresponding to each image block is determined based on the brightness information of the image block; According to the distribution function corresponding to each image block, analyze the mapping situation of the second transformation function corresponding to each image block to the first brightness value of the image block and the mapping situation of the second guiding function corresponding to each image block to the second brightness value of the image block; each first brightness value mapping situation represents the first brightness value difference corresponding to each brightness value in the image block after being mapped by the second transformation function corresponding to the image block, and each second brightness value mapping situation represents the second brightness value difference corresponding to each brightness value in the image block after being mapped by the second transformation function corresponding to the image block; Determine a target guiding function corresponding to the second transformation function corresponding to each image block according to the comparison situation of the first brightness value difference and the second brightness value difference corresponding to each image block; each target guiding function is used to perform a guiding adjustment on the second transformation function corresponding to the image block; Determine a guiding adjustment ratio corresponding to the second transformation function corresponding to each image block; According to the target guiding function corresponding to the second transformation function corresponding to each image block and the guiding adjustment ratio, perform a guiding adjustment on the second transformation function corresponding to each image block to obtain a third transformation function corresponding to each image block.

2. The global mapping table generation method for image enhancement according to claim 1, characterized in that, the third transformation function corresponding to each of the image blocks is: is the third transformation function corresponding to the corresponding image block, is the target guiding function corresponding to the second transformation function corresponding to the image block, is the second transformation function corresponding to the image block, ratio is the guiding adjustment ratio corresponding to the second transformation function corresponding to the image block, and i is the brightness value under the image block.

3. The global mapping table generation method for image enhancement according to claim 2, characterized in that, the second guiding function corresponding to each of the image blocks is: ; is the second guiding function corresponding to the corresponding image block, is the first guiding function corresponding to the image block, is the first transformation function, and i is the luminance value under the image block; the first luminance value difference and the second luminance value difference corresponding to each of the image blocks are: ; is the first luminance value difference corresponding to the corresponding image block, is the second luminance value difference corresponding to the image block, is the distribution function corresponding to the image block; the target guiding function corresponding to the second transformation function corresponding to each of the image blocks is: 。 4. The global mapping table generation method for image enhancement according to claim 3, characterized in that, the determining of the guiding adjustment ratio corresponding to the second transformation function corresponding to each of the image blocks includes: analyzing, according to the distribution function corresponding to each of the image blocks, the mapping situation of the target guiding function corresponding to the second transformation function corresponding to each of the image blocks to the third luminance value of the image block; each of the third luminance value mapping situations represents the third luminance value difference corresponding to each of the luminance values in the image block after the target guiding function corresponding to the second transformation function corresponding to the image block maps each of the luminance values; determining the guiding adjustment ratio corresponding to the second transformation function corresponding to each of the image blocks according to the comparison situation between the first luminance value difference and the third luminance value difference corresponding to each of the image blocks; wherein, the third luminance value difference corresponding to each of the image blocks is: ; is the third luminance value difference corresponding to the corresponding image block; the guiding adjustment ratio corresponding to the second transformation function corresponding to each of the image blocks is: 。 5. The global mapping table generation method for image enhancement according to claim 4, characterized in that, the generating of the first mapping table based on the third transformation functions corresponding to all the image blocks and the target luminance information of the target image includes: calculating, according to the third transformation function corresponding to each of the image blocks, the first mapping value corresponding to each of the luminance values in each of the image blocks; determining the mapping adjustment parameter corresponding to each of the image blocks, and performing a mapping adjustment operation on the first mapping value corresponding to each of the luminance values in each of the image blocks according to the mapping adjustment parameter corresponding to each of the image blocks, to obtain the second mapping value corresponding to each of the luminance values in each of the image blocks; determining, according to the second mapping values corresponding to all the luminance values in all the image blocks, all the third mapping values corresponding to each of the target luminance values included in the target image; all the third mapping values corresponding to each of the target luminance values are all the third mapping values at all the target pixel positions matching the target luminance value; determining the fourth mapping value corresponding to each of the target luminance values based on all the third mapping values corresponding to each of the target luminance values, and generating the first mapping table according to the fourth mapping values corresponding to all the target luminance values; wherein, the second mapping value corresponding to each of the luminance values in each of the image blocks is: ; is the second mapping value corresponding to the luminance value in the corresponding image block, is the mapping adjustment parameter corresponding to the image block, is the first mapping value corresponding to the luminance value in the image block, and G is the luminance value in the image block; the first mapping table is: ; For the first mapping table, a(i) is the counting function corresponding to the target brightness value i, indicating the third mapping value at the target pixel position (x, y) that matches the target brightness value i; wherein, the counting function corresponding to each of the target luminance values is: a(i) = , ; represents the luminance value G at the pixel position (x, y) in the corresponding image block.

6. The global mapping table generation method for image enhancement according to claim 5, It is characterized in that after generating the first mapping table based on the third transformation functions corresponding to all the image blocks and the target brightness information of the target image, the method further includes: determining a fourth transformation function corresponding to the first mapping table, and judging whether the first mapping table meets the mapping table adjustment condition according to the fourth transformation function; the fourth transformation function is a transformation function determined based on the fourth mapping values corresponding to all the target brightness values; when it is judged that the first mapping table meets the mapping table adjustment condition, performing a mapping table adjustment operation on the first mapping table according to the comparison between the histogram parameter corresponding to each target brightness value and the preset histogram average distribution level to obtain a second mapping table; the histogram parameter corresponding to each target brightness value is determined based on the distribution of the target brightness value; and, before determining the fourth transformation function corresponding to the first mapping table, the method further includes: traversing the first mapping table and judging whether there are blank mapping values among the fourth mapping values corresponding to all the target brightness values; when it is judged that there are no blank mapping values among the fourth mapping values corresponding to all the target brightness values, triggering the operation of determining the fourth transformation function corresponding to the first mapping table, and triggering the operation of judging whether the first mapping table meets the mapping table adjustment condition according to the fourth transformation function; when it is judged that there are blank mapping values among the fourth mapping values corresponding to all the target brightness values, determining all the to-be-processed brightness values corresponding to the fourth mapping values being the blank mapping values from all the target brightness values; for each to-be-processed brightness value, determining all other relevant brightness values that match the to-be-processed brightness value and exclude the to-be-processed brightness value; each of the other relevant brightness values is adjacent to the to-be-processed brightness value and the fourth mapping value corresponding to each of the other relevant brightness values is not the blank mapping value; performing a mapping value filling operation on the fourth mapping value corresponding to the to-be-processed brightness value according to the fourth mapping values corresponding to all the other relevant brightness values to update the fourth mapping value corresponding to the to-be-processed brightness value; after updating the fourth mapping values corresponding to all the to-be-processed brightness values, updating the first mapping table according to the fourth mapping values corresponding to all the to-be-processed brightness values, and triggering the operation of determining the fourth transformation function corresponding to the first mapping table, and triggering the operation of judging whether the first mapping table meets the mapping table adjustment condition according to the fourth transformation function; wherein, the second mapping table is: ; is the second mapping table, is the first mapping table, is the histogram parameter corresponding to the target brightness value, M s is the preset histogram average distribution level.

7. The global mapping table generation method for image enhancement according to claim 6, It is characterized in that the method further includes: judging whether the target mapping table meets the mapping table smoothing condition; when the first mapping table meets the mapping table adjustment condition, the target mapping table is the second mapping table; when the first mapping table does not meet the mapping table adjustment condition, the target mapping table is the first mapping table; When it is determined that the target mapping table meets the mapping table smoothing condition, determine the smoothing parameter corresponding to the target mapping table; the smoothing parameter includes at least one of the smoothing times of the target mapping table, the fourth mapping values corresponding to all the target brightness values to be smoothed in a single smoothing, the smoothing range corresponding to each of the fourth mapping values to be smoothed in a single smoothing, and the smoothing weighting value corresponding to the smoothing range corresponding to each of the fourth mapping values to be smoothed in a single smoothing; According to the smoothing parameter, perform a mapping table smoothing operation on the target mapping table to obtain a third mapping table; Among them, the third mapping table obtained after performing a single mapping table smoothing operation on the target mapping table is: ; For the third mapping table, n and -n are respectively the upper smoothing limit value and the lower smoothing limit value in the smoothing range corresponding to each of the fourth mapping values to be smoothed under single smoothing, is the smoothing weighted value corresponding to the smoothing range corresponding to each of the fourth mapping values to be smoothed under single smoothing cumulative sum, is the target mapping table, where, is the limit range function, and s is the current target brightness value in the target mapping table; Among them, the restricted range function is: 。 8. A global mapping table generation device applied to image enhancement, Characterized in that, The device includes: An acquisition module, configured to acquire a target image to be processed; A determination module, configured to determine a first transformation function corresponding to the target image; the target image is determined based on an original image to be enhanced, and the target image is the original image or an image obtained by reducing the original image; An image segmentation module, configured to perform an image segmentation operation on the target image to obtain a plurality of image blocks; The determination module is further configured to determine a second transformation function corresponding to each of the image blocks; A guidance adjustment module, configured to perform guidance adjustment on the second transformation function corresponding to each of the image blocks based on the first transformation function to obtain a third transformation function corresponding to each of the image blocks; A mapping table generation module, configured to generate a first mapping table based on the third transformation functions corresponding to all the image blocks and the target brightness information of the target image; the target brightness information of the target image includes all the target brightness values included in the target image and the distribution of each target brightness value, and the first mapping table is used to perform an image enhancement operation on the original image; Among them, the guidance adjustment module includes: A determination sub-module, configured to determine a first guiding function corresponding to each image block based on the luminance information of each image block; the luminance information of each image block includes all luminance values included in the image block and the distribution of each luminance value in the image block; based on the first transformation function, perform a function superposition operation on the first guiding function corresponding to each image block to obtain a second guiding function corresponding to each image block; obtain a distribution function corresponding to each image block; the distribution function corresponding to each image block is determined based on the luminance information of the image block; according to the distribution function corresponding to each image block, analyze the mapping situation of the first luminance value of the second transformation function corresponding to each image block to the image block and the mapping situation of the second luminance value of the second guiding function corresponding to each image block to the image block; each first luminance value mapping situation represents the first luminance value difference corresponding to each luminance value in the image block after being mapped by the second transformation function corresponding to the image block, and each second luminance value mapping situation represents the second luminance value difference corresponding to each luminance value in the image block after being mapped by the second transformation function corresponding to the image block; according to the comparison situation between the first luminance value difference and the second luminance value difference corresponding to each image block, determine the target guiding function corresponding to the second transformation function corresponding to each image block; each target guiding function is used to perform guiding adjustment on the second transformation function corresponding to the image block; determine the guiding adjustment ratio corresponding to the second transformation function corresponding to each image block; A guiding adjustment sub-module, configured to perform guiding adjustment on the second transformation function corresponding to each image block according to the target guiding function corresponding to the second transformation function corresponding to each image block and the guiding adjustment ratio to obtain a third transformation function corresponding to each image block.

9. A global mapping table generation device applied to image enhancement, characterized in that, the device includes: a memory storing executable program code; a processor coupled to the memory; the processor calls the executable program code stored in the memory and executes the method for generating a global mapping table applied to image enhancement according to any one of claims 1-7.

10. A computer storage medium, characterized in that, the computer storage medium stores computer instructions, and when the computer instructions are called, they are used to execute the method for generating a global mapping table applied to image enhancement according to any one of claims 1-7.

Citation Information

Patent Citations

  • Image enhancement method and device

    CN101853497A

  • Image processing method and device, computer readable storage medium and electronic equipment

    CN112950515A