Image processing method, system, electronic device and storage medium
Patent Information
- Application Number
- CN202210751193.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-29
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2042-06-29
AI Technical Summary
[0006]在本实施例中提供了一种图像处理方法、系统、电子装置和存储介质,以解决相关技术中色调映射的图像处理中计算开销大、过度增强严重的问题
[0038] Compared with related technologies, the image processing method, system, electronic device, and storage medium provided in this embodiment solve the problems of high computational overhead and severe over-enhancement in tone mapping image processing, thereby reducing the computational overhead of tone mapping and improving the quality of mapped images. This is achieved by obtaining a global tone mapping result based on the initial luminance channel of the image to be processed, and then decomposing the global tone mapping result to obtain a luminance channel decomposition result; performing detail enhancement on the detail layer of the luminance channel decomposition result to obtain a detail enhancement result; performing local histogram equalization on the base layer of the luminance channel decomposition result to obtain a local histogram equalization result; obtaining a base layer update result based at least on the local histogram equalization result and the base layer; and obtaining the target image based on the base layer update result and the detail enhancement result.
Smart Images

Figure CN117372311B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to image processing methods, systems, electronic devices, and storage media. Background Technology
[0002] In recent years, High Dynamic Range (HDR) imaging technology has developed rapidly and will become the mainstream in the field of imaging and video in the future. However, most display devices are still just LDR (Low Dynamic Range) displays and cannot directly display HDR images.
[0003] Tone mapping is an image conversion technique that converts HDR signals into LDR signals. It's an intermediate product where current image display technology cannot meet the demands of HDR. Essentially, tone mapping is an information compression process. In this process, a simple linear mapping cannot be used because it would lose important details in the original image and cause severe distortion. Currently, tone mapping methods can be divided into two main categories: Global Tone Mapping (GTM) and Local Tone Mapping (LTM). GTM, also known as the spatial invariant method, uses the same transformation function to map all pixels in the HDR image in the same way, making it a one-to-one mapping method. Its advantages are simple computation, high time and space efficiency, and a smoother, more uniform overall brightness image. Its disadvantage is that using a fixed mapping curve prevents adaptive transformation based on the local features of the pixel's neighborhood, leading to problems such as loss of local detail and low local contrast. LTM, also known as the spatial transformation method, differs from GTM in that it maps differently based on the local features of each pixel's region. Two pixels with the same value in different regions will be mapped to different values, making it a one-to-many mapping method. The advantage of this method is that the mapped image has better local detail and contrast; the disadvantage is that it has high computational complexity, ignores the overall brightness information of the image, and is prone to problems such as halo, noise amplification and over-enhancement.
[0004] In related technologies, tone mapping is generally performed using techniques such as multi-scale histogram fusion and single-scale histogram equalization. However, the multi-scale histogram fusion method greatly increases the computational cost, while the single-scale histogram equalization method is prone to over-enhancement, resulting in the loss of detailed information.
[0005] There is currently no effective solution to the problems of high computational cost and severe over-enhancement in image processing involving tone mapping in related technologies. Summary of the Invention
[0006] This embodiment provides an image processing method, system, electronic device, and storage medium to solve the problems of high computational overhead and severe over-enhancement in tone mapping image processing in related technologies.
[0007] Firstly, this embodiment provides an image processing method, including:
[0008] The global tone mapping result is obtained based on the initial luminance channel of the image to be processed, and the global tone mapping result is decomposed to obtain the luminance channel decomposition result;
[0009] The detail layer of the brightness channel decomposition result is enhanced to obtain the detail enhancement result;
[0010] The base layer of the brightness channel decomposition result is subjected to local histogram equalization to obtain a local histogram equalization result; the base layer update result is obtained based at least on the local histogram equalization result and the base layer;
[0011] The target image is obtained based on the base layer update result and the detail enhancement result.
[0012] In some embodiments, the detail enhancement of the detail layer of the luminance channel decomposition result to obtain the detail enhancement result includes:
[0013] The detail layer of the luminance channel decomposition result is input into the detail enhancement function for detail enhancement, and the detail enhancement result is obtained.
[0014] In some embodiments, the luminance channel decomposition result includes a base layer and a detail layer; the decomposition of the global tone mapping result to obtain the luminance channel decomposition result includes:
[0015] The global tone mapping result is input into a low-pass filter for filtering to obtain the base layer;
[0016] The detail layer is obtained based on the global tone mapping result and the base layer.
[0017] In some embodiments, the step of performing local histogram equalization on the base layer of the luminance channel decomposition result to obtain the local histogram equalization result includes:
[0018] Based on the base layer statistics of the brightness channel decomposition results, the local stacked histogram of each pixel in the base layer within a preset window is calculated.
[0019] A local tone mapping curve is generated based on the local stacked histogram;
[0020] The local histogram equalization result is generated based on the local tone mapping curve.
[0021] In some embodiments, obtaining the base layer update result based at least on the local histogram equalization and the base layer includes:
[0022] The histogram polarization coefficients are obtained based on the local histogram equalization results.
[0023] Obtain the initial intensity weight, and calculate the intensity weight based on the initial intensity weight and the histogram polarization coefficient;
[0024] Obtain preset constraint coefficients, and obtain the base layer update result based on the constraint coefficients, the local histogram equalization result, the intensity weight, and the base layer.
[0025] In some embodiments, obtaining the target image based on the base layer update result and the detail enhancement result includes:
[0026] The target brightness channel is obtained by fusing the detail enhancement results and the base layer update results;
[0027] The brightness gain coefficient is obtained based on the initial brightness channel and the target brightness channel;
[0028] The image to be processed is subjected to gain processing based on the brightness gain coefficient to obtain the target image.
[0029] In some embodiments, obtaining the global tone mapping result based on the luminance channel of the image to be processed includes:
[0030] Obtain the brightness channel of the image to be processed;
[0031] Obtain a preset tone mapping curve, and perform global tone mapping based on the luminance channel and the tone mapping curve to obtain the global tone mapping result.
[0032] Secondly, this embodiment provides a tone mapping system, including: a terminal device, a transmission device, and a server device; wherein the terminal device is connected to the server device through the transmission device;
[0033] The server device is used to implement the image processing method described in the first aspect above;
[0034] The transmission device is used to transmit the target image to the terminal device;
[0035] The terminal device is used to display the target image.
[0036] Thirdly, this embodiment provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the image processing method described in the first aspect above.
[0037] Fourthly, this embodiment provides a storage medium storing a computer program that, when executed by a processor, implements the image processing method described in the first aspect above.
[0038] Compared with related technologies, the image processing method, system, electronic device, and storage medium provided in this embodiment solve the problems of high computational overhead and severe over-enhancement in tone mapping image processing, thereby reducing the computational overhead of tone mapping and improving the quality of mapped images. This is achieved by obtaining a global tone mapping result based on the initial luminance channel of the image to be processed, and then decomposing the global tone mapping result to obtain a luminance channel decomposition result; performing detail enhancement on the detail layer of the luminance channel decomposition result to obtain a detail enhancement result; performing local histogram equalization on the base layer of the luminance channel decomposition result to obtain a local histogram equalization result; obtaining a base layer update result based at least on the local histogram equalization result and the base layer; and obtaining the target image based on the base layer update result and the detail enhancement result.
[0039] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0040] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0041] Figure 1 This is an application scenario diagram of an image processing method in one embodiment;
[0042] Figure 2 This is a flowchart illustrating an image processing method in one embodiment;
[0043] Figure 3 This is a schematic diagram of a local stacked histogram generation method in one embodiment;
[0044] Figure 4 This is a schematic diagram of the initial intensity weighting curve in one embodiment;
[0045] Figure 5 This is a flowchart illustrating the image processing method in another embodiment;
[0046] Figure 6 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0047] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0048] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning as understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these,” used in this application, do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to such processes, methods, products, or devices. The terms “connected,” “linked,” and “coupled,” used in this application, are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. The term “multiple” used in this application refers to two or more. The "and / or" operator describes the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: A alone, A and B simultaneously, and B alone. Typically, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," and "third," etc., used in this application are merely for distinguishing similar objects and do not represent a specific ordering of the objects.
[0049] The image processing method provided in this application can be applied to, for example... Figure 1In the application environment shown, terminal device 102 communicates with server device 104 via a network. Server device 104 obtains a global tone mapping result based on the initial luminance channel of the image to be processed, and decomposes this global tone mapping result to obtain a luminance channel decomposition result; server device 104 performs detail enhancement on the detail layer of the luminance channel decomposition result to obtain a detail enhancement result; server device 104 performs local histogram equalization on the base layer of the luminance channel decomposition result to obtain a local histogram equalization result; server device 104 obtains a base layer update result based at least on the local histogram equalization result and the base layer; server device 104 obtains the target image based on the base layer update result and the detail enhancement result. Terminal device 102 is used to display the target image sent by server device 104. Terminal device 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices, and server device 104 can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0050] This embodiment provides an image processing method. Figure 2 This is a flowchart of the image processing method in this embodiment, as shown below. Figure 2 As shown, the process includes the following steps:
[0051] Step S202: Obtain the global tone mapping result based on the initial luminance channel of the image to be processed, and decompose the global tone mapping result to obtain the luminance channel decomposition result.
[0052] Specifically, the image to be processed is acquired, and the maximum value of the RGB pixels of the image to be processed is extracted as the initial luminance channel; global tone mapping is performed on the initial luminance channel according to the global tone mapping curve to obtain the global tone mapping result; the global tone mapping result is decomposed to obtain the luminance channel decomposition result.
[0053] Step S204: Perform detail enhancement on the detail layer of the luminance channel decomposition result to obtain the detail enhancement result.
[0054] Step S206: Perform local histogram equalization on the base layer of the brightness channel decomposition result to obtain the local histogram equalization result; at least based on the local histogram equalization result and the base layer, obtain the base layer update result.
[0055] The local histogram equalization refers to performing pixel statistics on pixels within a fixed preset window, centered on each pixel. To reduce computational and memory overhead, a statistical method using intensity stacked histograms is adopted to perform local histogram equalization on the base layer.
[0056] Step S208: Obtain the target image based on the base layer update result and the detail enhancement result. Specifically, the target image can be obtained by fusing the base layer update result and the detail enhancement result.
[0057] Through the above steps, global tone mapping is performed on the initial luminance channel of the image to be processed, and further decomposed. The base layer after decomposition is updated using a local histogram equalization method. Finally, the updated base layer result and the detail enhancement result are fused. Compared with related technologies, this method combines the advantages of global and local mapping, which can preserve local details and contrast while brightening dark areas and suppressing bright areas. It can reduce memory and computational overhead, neutralize image pixels with excessive detail enhancement, solve the problems of high computational overhead and severe over-enhancement in tone mapping image processing, reduce the computational overhead of tone mapping, and improve the quality of mapped images.
[0058] In some embodiments, the detail layer of the luminance channel decomposition result is enhanced to obtain a detail-enhanced result, including:
[0059] The detail layer of the luminance channel decomposition result is input into the detail enhancement function for detail enhancement, and the detail enhancement result is obtained.
[0060] The detail enhancement function is designed using a transformation principle similar to the gamma transformation, and its expression is as follows:
[0061]
[0062] Where, x detail For the detail layer of the input, y detail To output the enhanced detail result, the parameters α2 and β2 are used to adjust the intensity of the enhancement, and the function sign() is used to retrieve the sign bit.
[0063] By using the above steps to enhance the details in the detail layer through the detail enhancement function, the texture information in the image can be made more obvious, thereby improving the image quality.
[0064] In some embodiments, the luminance channel decomposition result includes a base layer and a detail layer; the global tone mapping result is decomposed to obtain the luminance channel decomposition result, including:
[0065] The global tone mapping result is input into a low-pass filter for filtering to obtain the base layer;
[0066] The detail layer is obtained based on the global tone mapping result and the base layer.
[0067] The low-pass filter can be a linear mean filter, a Gaussian filter, a nonlinear bilateral filter, a median filter, or a guided filter, etc. Preferably, a guided filter is used in this embodiment. The global tone mapping result generally includes high-frequency noise and low-frequency brightness information. The global tone mapping result is input to the low-pass filter for filtering to obtain a base layer with low-frequency information. The detail layer is obtained by subtracting the base layer from the global tone mapping result.
[0068] Through the above steps, the global tone mapping result can be decomposed into a detail layer with high-frequency information and a base layer with low-frequency information. This facilitates subsequent information extraction from the detail layer and the base layer, ultimately resulting in a target image with better image quality. This solves the problems of high computational cost and severe over-enhancement in tone mapping image processing, reduces the computational cost of tone mapping, and improves the quality of the mapped image.
[0069] In some embodiments, the base layer of the luminance channel decomposition result is subjected to local histogram equalization to obtain the local histogram equalization result, including:
[0070] Based on the base layer statistics of the brightness channel decomposition results, the local stacked histogram of each pixel in the base layer within the preset window is statistically analyzed.
[0071] A local tone mapping curve is generated based on the local stacked histogram;
[0072] The local histogram equalization result is generated based on the local tone mapping curve.
[0073] The size of the preset window is determined according to the actual situation; the local stacked histogram is a histogram drawn with each pixel as the center, based on the stacking statistics of each pixel within the preset window; the stacking statistics refer to the grouping bins obtained by grouping pixels within the preset window into bins and statistically analyzing pixels within a certain range into a group; the local tone mapping curve is generated based on the deviation statistics generated by the local stacked histogram, and is generated based on the deviation statistics and the local stacked histogram.
[0074] Specifically, Figure 3 This is a schematic diagram of the local stacked histogram generation method in this embodiment, as shown below. Figure 3As shown, taking a preset window of 5×5 pixels and 4 bin groups as an example, firstly, based on the preset window, the number of pixels of each pixel in the base layer within the preset window is counted, and the number of bin groups is determined to be 4. All pixels within the preset window are counted into 4 bin groups according to a certain range. The first bin group is for pixels with a grayscale range of 0-63, corresponding to pixel cells numbered 1 and 2 in the preset window; the second bin group is for pixels with a grayscale range of 64-127, corresponding to pixel cells numbered 3 and 4 in the preset window; the third bin group is for pixels with a grayscale range of 128-191; and the fourth bin group is for pixels with a grayscale range of 192-255, which has no corresponding pixel cells in the preset window. This generates the local stacked histogram. Secondly, based on the counted local stacked histogram, the offset of the statistical mean of each bin in the local stacked histogram relative to the center of the bin group is obtained as the deviation statistic to compensate for the loss of accuracy in the histogram.
[0075] Next, each bin of the local stacked histogram is transformed into a linear curve. The horizontal width of the sloping portion of the curve is the width of the bin, and the vertical height of the curve is the pixel count of the bin, meaning the slope is proportional to the number of pixels in the bin. Based on the deviation statistics of each bin, the corresponding bin curve is shifted horizontally. The linear curves generated by all bins are summed, and the mapping range (vertical axis) is linearly stretched to [0, 255] to generate the local tone mapping curve. Here, the linear stretching refers to the linear relationship between the input pixel value and the pixel statistics generated by accumulating from left to right along the horizontal axis where the bin is located. The cumulative curve represents the sum of all pixels within the window (defined as total_num) corresponding to the input pixel value of 255. By linearly stretching the ordinate (normalizing the range from 0 to total_num to 0-255), this linear cumulative curve transforms into a mapping curve between the input and output pixel values. This mapping curve is the local tone mapping curve. Finally, based on this transformed local tone mapping curve, each pixel value in the base layer is mapped to a new pixel value. The image composed of these new pixel values is the result of the local histogram equalization.
[0076] By employing the above steps and using a local intensity stacking method that groups pixel values within a certain range into bins, the computational and memory overhead of local histogram equalization within a preset window for each pixel value can be reduced. Furthermore, the accuracy loss in histogram statistics is reduced based on the deviation statistics. As a result, the generated local tone mapping curve has the characteristics of low computational and memory overhead and high accuracy. This solves the problems of high computational overhead and severe over-enhancement in tone mapping image processing, thereby reducing the computational overhead of tone mapping and improving the quality of the mapped image.
[0077] In some embodiments, obtaining the base layer update result based at least on the local histogram equalization and the base layer includes:
[0078] The histogram polarization coefficients are obtained based on the local histogram equalization results;
[0079] Obtain the initial intensity weight, and calculate the intensity weight based on the initial intensity weight and the histogram polarization coefficient;
[0080] Obtain the preset constraint coefficients, and based on the constraint coefficients, the local histogram equalization result, the intensity weight, and the base layer, obtain the base layer update result.
[0081] It should be noted that the histogram polarization coefficient describes the degree of polarization of the histogram. Regions with stronger halos have stronger polarization and larger polarization coefficients; conversely, regions with weaker halos have smaller polarization coefficients. The expression for the histogram polarization coefficient is:
[0082]
[0083] Where, m loc The mean value of all pixels in the preset window corresponding to each pixel, m i The mean of the i-th bin in the local stacked histogram for each pixel, n i Let N be the number of pixels in the i-th bin, and N be the number of bins in the histogram.
[0084] Figure 4 This is a schematic diagram of an initial intensity weight curve in this embodiment. When the pixel value x of the base layer... base Near the center of the dynamic range, the weights approach 1; when the pixel value x of the base layer... base At both ends of the dynamic range, the weights approach 0; the expression for this initial strength weight is:
[0085]
[0086] Where δ is the Gaussian kernel parameter, used to adjust the initial weight curve.
[0087] To suppress halos, regions with stronger halos require smaller intensity weights. The expression for this intensity weight is:
[0088]
[0089] Among them, e -b*P The parameter a is used to adjust the weights of the halo suppression strategy, and parameter b is used to adjust the strength of the halo suppression effect.
[0090] The expression for the preliminary update result of the base layer, based on the local histogram equalization result, the intensity weight, and the base layer, is as follows:
[0091] y base =x base +(x LHE -0.5)*W
[0092] Where, x base x is the normalized original base layer pixel value. LHE This is the normalized result of the local histogram equalization; LHE stands for Local Histogram Equalization.
[0093] It should be noted that histogram equalization maps local means or medians to the median of the entire dynamic range. To increase local contrast, (x...) LHE -0.5) will brighten pixels that are greater than the local mean or median, and darken pixels that are less than the local mean or median.
[0094] Furthermore, to further limit the change range of brightness after mapping, the change range of the initial update result of the base layer is limited according to a preset constraint coefficient ε. The value of the constraint coefficient ε is located in the interval [0, 1]. This constraint coefficient is used to forcibly constrain pixels that exceed the local maximum value of the original base layer and the local minimum value of the original base layer. The smaller the constraint coefficient, the stronger the constraint effect.
[0095] y update =y base +ε*(y base -x base )
[0096] The y update This is the update result of the base layer.
[0097] Through the above steps, the intensity weight is determined by the initial intensity weight and polarization coefficient, thereby obtaining the base layer update result based on the intensity weight. The constraint coefficient is used to limit the change range of the brightness after mapping based on the base layer update result, which can effectively suppress halos and over-enhancement. Compared with related technologies, the image processing method of this embodiment can effectively suppress halos and over-enhancement, solve the problems of high computational overhead and severe over-enhancement in tone mapping image processing, reduce the computational overhead of tone mapping, and improve the quality of the mapped image.
[0098] In some embodiments, obtaining the target image based on the base layer update result and the detail enhancement result includes:
[0099] The target brightness channel is obtained by fusing the detail enhancement result and the base layer update result;
[0100] The brightness gain coefficient is obtained based on the initial brightness channel and the target brightness channel;
[0101] The image to be processed is then subjected to gain processing based on the brightness gain coefficient to obtain the target image.
[0102] The fusion step can be a weighted sum of the detail enhancement result and the base layer update result, or it can be a direct summation; the brightness gain coefficient can be obtained based on the ratio of the target brightness channel to the initial brightness channel; the target image can be obtained by multiplying the image to be processed by the brightness gain coefficient.
[0103] By fusing the updated base layer update results and detail enhancement results through the above steps, memory and computational overhead can be reduced compared with related technologies. This neutralizes over-enhanced image pixels and solves the problems of high computational overhead and severe over-enhancing in tone mapping image processing. It reduces the computational overhead of tone mapping and improves the quality of mapped images.
[0104] In some embodiments, obtaining the global tone mapping result based on the luminance channel of the image to be processed includes:
[0105] Obtain the brightness channel of the image to be processed;
[0106] Obtain the preset tone mapping curve, perform global tone mapping based on the luminance channel and the tone mapping curve, and obtain the global tone mapping result.
[0107] Here, the initial luminance channel refers to the channel with the largest value among the RGB three channels of each pixel in the image to be processed; the global tone mapping result is decomposed by filtering the global tone mapping result to obtain the luminance channel decomposition result; the global tone mapping result is performed using a preset global tone mapping curve (GTM), and the expression of the global tone mapping curve is:
[0108]
[0109] Where, x GTM For each of these initial brightness channels, the normalized input, y GTM For each of the initial luminance channels, the parameters α1 and β1 are used to adjust the shape of the curve according to the actual application; the normalization of each initial luminance channel means normalizing the initial luminance channel value in the range of 0-255 to the value in the range of 0-1.
[0110] Specifically, the image to be processed is acquired, and the maximum value of the RGB pixels of the image to be processed is extracted as the initial luminance channel; global tone mapping is performed on the initial luminance channel according to the global tone mapping curve to obtain the global tone mapping result; the global tone mapping result is decomposed to obtain the luminance channel decomposition result.
[0111] By performing global tone mapping on the initial luminance channel of the image to be processed through the above steps, the overall visual effect of the image can be improved. This solves the problems of high computational cost and severe over-enhancement in tone mapping image processing, reduces the computational cost of tone mapping, and improves the quality of the mapped image.
[0112] This embodiment also provides an image processing method. Figure 5 This is a flowchart of another image processing method in this embodiment, such as... Figure 5 As shown, the process includes the following steps:
[0113] Step S502: Input the image to be processed.
[0114] Step S504: Extract the initial luminance channel of the image to be processed. Specifically, extract the maximum value of the RGB values of the pixels in the image to be processed as the initial luminance channel.
[0115] Step S506, global tone mapping, obtaining the global tone mapping result. Obtain a preset tone mapping curve, and perform global tone mapping based on the luminance channel and the tone mapping curve to obtain the global tone mapping result.
[0116] Step S508: Luminance channel decomposition to obtain the luminance channel decomposition result. The global tone mapping result is then input into a low-pass filter for filtering to obtain the base layer; the detail layer is obtained based on the global tone mapping result and the base layer.
[0117] Step S510, detail enhancement, obtaining the detail enhancement result. The detail layer of the luminance channel decomposition result is input into the detail enhancement function for detail enhancement, obtaining the detail enhancement result.
[0118] Step S512: Calculate the local intensity stacking histogram. Count the number of pixels within a preset window for each pixel in the base layer, determine the number of bin groups, and statistically assign all pixels within the preset window to bin groups according to a certain range, thereby generating the local stacking histogram.
[0119] Step S514, Local Histogram Equalization. A local tone mapping curve is generated based on the local stacked histogram; the local tone mapping curve is then used to generate the local histogram equalization result.
[0120] Step S516: Calculate the intensity weight. Obtain the histogram polarization coefficient based on the local histogram equalization result; obtain the initial intensity weight, and calculate the intensity weight based on the initial intensity weight and the histogram polarization coefficient.
[0121] Step S518: Obtain the base layer update result. Obtain the preset constraint coefficients, and obtain the base layer update result based on the constraint coefficients, the local histogram equalization result, the intensity weight, and the base layer.
[0122] Step S520: Luminance channel synthesis, calculation of luminance gain coefficient, and gain processing. The detail enhancement result and the base layer update result are fused to obtain the target luminance channel; the luminance gain coefficient is obtained based on the initial luminance channel and the target luminance channel; the image to be processed is then processed according to the luminance gain coefficient to obtain the target image.
[0123] Step S522: Output the target image.
[0124] Through the above steps, global tone mapping is performed on the initial luminance channel of the image to be processed, and further decomposed. The base layer after decomposition is updated using the local histogram equalization method. Finally, the updated base layer result and the detail enhancement result are fused. Compared with related technologies, this can reduce memory and computational overhead, neutralize image pixels with excessive detail enhancement, solve the problems of high computational overhead and severe over-enhancement in tone mapping image processing, reduce the computational overhead of tone mapping, and improve the quality of the mapped image.
[0125] It should be understood that, although Figure 2-5 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2-5 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
[0126] This embodiment also provides an image processing system, which includes: a terminal device 102, a transmission device, and a server device 104; wherein the terminal device 102 is connected to the server device 104 through the transmission device.
[0127] The server device 104 is used to perform the steps in any of the above method embodiments;
[0128] The transmission device is used to transmit the target image to the terminal device 102;
[0129] The terminal device 102 is used to display the target image.
[0130] This embodiment also provides an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.
[0131] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0132] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0133] S1. Obtain the global tone mapping result based on the initial luminance channel of the image to be processed, and decompose the global tone mapping result to obtain the luminance channel decomposition result;
[0134] S2, perform detail enhancement on the detail layer of the luminance channel decomposition result to obtain the detail enhancement result;
[0135] S3, perform local histogram equalization on the base layer of the brightness channel decomposition result to obtain the local histogram equalization result; at least based on the local histogram equalization result and the base layer, obtain the base layer update result;
[0136] S4. Obtain the target image based on the base layer update result and the detail enhancement result.
[0137] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.
[0138] Furthermore, in conjunction with the image processing methods provided in the above embodiments, this embodiment can also provide a storage medium for implementation. The storage medium stores a computer program; when executed by a processor, the computer program implements any one of the image processing methods in the above embodiments.
[0139] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 6As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements an image processing method.
[0140] Those skilled in the art will understand that Figure 6 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0141] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0142] It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.
[0143] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.
[0144] The term "embodiment" in this application refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply that it is mutually exclusive with or independent of other embodiments. It will be clearly or implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0145] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.
Claims
1. An image processing method, characterized in that, include: The global tone mapping result is obtained based on the initial luminance channel of the image to be processed, and the global tone mapping result is decomposed to obtain the luminance channel decomposition result; The detail layer of the brightness channel decomposition result is enhanced to obtain the detail enhancement result; The base layer of the brightness channel decomposition result is subjected to local histogram equalization to obtain the local histogram equalization result; The base layer update result is obtained based on at least the local histogram equalization result and the base layer, specifically including: obtaining histogram polarization coefficients based on the local histogram equalization result; obtaining initial intensity weights, and calculating intensity weights based on the initial intensity weights and the histogram polarization coefficients; obtaining preset constraint coefficients, and obtaining the base layer update result based on the constraint coefficients, the local histogram equalization result, the intensity weights, and the base layer; The target image is obtained based on the base layer update result and the detail enhancement result.
2. The image processing method according to claim 1, characterized in that, The detail enhancement of the detail layer of the luminance channel decomposition result to obtain the detail enhancement result includes: The detail layer of the luminance channel decomposition result is input into the detail enhancement function for detail enhancement, and the detail enhancement result is obtained.
3. The image processing method according to claim 1, characterized in that, The luminance channel decomposition result includes a base layer and a detail layer; the decomposition of the global tone mapping result to obtain the luminance channel decomposition result includes: The global tone mapping result is input into a low-pass filter for filtering to obtain the base layer; The detail layer is obtained based on the global tone mapping result and the base layer.
4. The image processing method according to claim 1, characterized in that, The step of performing local histogram equalization on the base layer of the brightness channel decomposition result to obtain the local histogram equalization result includes: Based on the base layer statistics of the brightness channel decomposition results, the local stacked histogram of each pixel in the base layer within a preset window is calculated. A local tone mapping curve is generated based on the local stacked histogram; The local histogram equalization result is generated based on the local tone mapping curve.
5. The image processing method according to claim 1, characterized in that, The step of obtaining the target image based on the base layer update result and the detail enhancement result includes: The target brightness channel is obtained by fusing the detail enhancement results and the base layer update results; The brightness gain coefficient is obtained based on the initial brightness channel and the target brightness channel; The image to be processed is subjected to gain processing based on the brightness gain coefficient to obtain the target image.
6. The image processing method according to any one of claims 1 to 5, characterized in that, The step of obtaining the global tone mapping result based on the luminance channel of the image to be processed includes: Obtain the brightness channel of the image to be processed; Obtain a preset tone mapping curve, and perform global tone mapping based on the luminance channel and the tone mapping curve to obtain the global tone mapping result.
7. A tone mapping system, characterized in that, include: Terminal equipment, transmission equipment, and server equipment; wherein the terminal equipment is connected to the server equipment through the transmission equipment; The server device is used to execute the image processing method according to any one of claims 1 to 6; The transmission device is used to transmit the target image to the terminal device; The terminal device is used to display the target image.
8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the image processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the image processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Image enhancement method and system based on two-dimensional gamma correction and tone mapping
CN114529475A