Image processing method and device, electronic equipment, storage medium and program product
By using the first gamma and the second gamma curve to process images under the same photography link, the problem that the SDR and HDR display effects in the prior art are not possible, and an image processing method that takes into account both display effects under the same link is realized, reducing the computing overhead.
Patent Information
- Application Number
- CN202510444484.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-07-25
AI Technical Summary
Existing photography algorithms cannot take into account the display effects of standard dynamic range (SDR) and high dynamic range (HDR) links under a single photography link, resulting in the color of the highlighted area being easily distorted and the HDR effect is lost during post-processing and editing.
By performing inverse mapping of the image using the first gamma curve, the first mapped image is acquired, and then mapping process is performed according to the second gamma curve, a second image supporting different display standards is generated, and the final display image is determined in combination with parameter information of the display screen.
Under the same photo link, the display effects of SDR and HDR can be taken into account at the same time, reducing the amount of calculation, and improving the practicality and display effects of image processing.
Smart Images

Figure CN120378754A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technologies, and in particular, to an image processing method, apparatus, electronic device, storage medium, and program product. Background Art
[0002] Generally, a photographing link includes a standard dynamic range (SDR) link and a link corresponding to a high dynamic range (HDR). Existing photographing algorithms are for a single photographing link, and each photographing algorithm only targets the display effect corresponding to that link and cannot take into account the display effects of other links. Summary of the Invention
[0003] Based on this, to address the above technical problems, it is necessary to provide an image processing method, apparatus, electronic device, storage medium, and program product that can take into account the display effects of other links under the same photographing link.
[0004] In a first aspect, this application provides an image processing method, which includes:
[0005] Performing an inverse mapping process on a first image according to a first gamma curve to obtain a first mapped image corresponding to the first image; the first image supports a first display standard;
[0006] Performing a mapping process on the first mapped image according to a second gamma curve to obtain a second image; the second image supports a second display standard;
[0007] Determining a display image of the display screen according to the parameter information of the display screen, the first image, and the second image.
[0008] In a second aspect, this application further provides an image processing apparatus, which includes:
[0009] A first processing module, configured to perform an inverse mapping process on a first image according to a first gamma curve to obtain a first mapped image corresponding to the first image; the first image supports a first display standard;
[0010] A second processing module, configured to perform a mapping process on the first mapped image according to a second gamma curve to obtain a second image; the second image supports a second display standard;
[0011] A determining module, configured to determine a display image of the display screen according to the parameter information of the display screen, the first image, and the second image.
[0012] In a third aspect, this application further provides an electronic device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of the method described in the first aspect above are implemented.
[0013] In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method described in the first aspect above are implemented.
[0014] In a fifth aspect, the present application further provides a computer program product, including a computer program. When the computer program is executed by a processor, the steps of the method described in the first aspect above are implemented.
[0015] For the above image processing method, device, electronic device, storage medium and program product, the method performs an inverse mapping process on a first image according to a first gamma curve to obtain a first mapped image corresponding to the first image; the first image supports a first display standard; a mapping process is performed on the first mapped image according to a second gamma curve to obtain a second image; the second image supports a second display standard; according to the parameter information of the display screen, the first image and the second image, the display image of the display screen is determined. In this way, the embodiments of the present application can ensure that under the same link, when the first image is obtained, the second image can be determined according to the first image, so that both the first image and the second image can be displayed when displayed on the display screen; in other words, under the same link, the display of both the first image and the second image can be taken into account. Moreover, the embodiments of the present application do not need to deploy multiple photographing algorithms under this link, which can reduce overhead and computational complexity, thereby improving the practicability of the image processing method. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for the description of the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0017] Figure 1 It is a schematic diagram of an electronic device in an embodiment;
[0018] Figure 2 It is a schematic flowchart of an image processing method in an embodiment;
[0019] Figure 3 It is a schematic flowchart of an image processing method in another embodiment;
[0020] Figure 4 It is a schematic flowchart of an image processing method in another embodiment;
[0021] Figure 5 It is a schematic flowchart of an image processing method in another embodiment;
[0022] Figure 6 It is a schematic flowchart of an image processing method in another embodiment;
[0023] Figure 7 It is a schematic flowchart of an image processing method in another embodiment;
[0024] Figure 8 It is a schematic diagram of HLG standard gamma and sRGB standard gamma in one embodiment;
[0025] Figure 9 It is a schematic flowchart of an image processing method in another embodiment;
[0026] Figure 10 It is a schematic flowchart of an image processing method in another embodiment;
[0027] Figure 11 It is a schematic flowchart of an image processing method in another embodiment;
[0028] Figure 12 It is a schematic diagram of the first gamma curve and the third gamma curve in one embodiment;
[0029] Figure 13 It is a schematic flowchart of an image processing method in another embodiment;
[0030] Figure 14 It is a structural block diagram of an electronic device executing an image processing method in one embodiment;
[0031] Figure 15 It is a structural block diagram of an image processing apparatus in one embodiment;
[0032] Figure 16 It is an internal structure diagram of an electronic device in one embodiment. Detailed implementation manners
[0033] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0034] Generally, the camera shooting link includes the link corresponding to the Standard Dynamic Range (SDR) and the link corresponding to the High Dynamic Range (HDR). Adapting each camera shooting algorithm to both the SDR link and the HDR link can, although, achieve the effects of both SDR and HDR on one link, but it will greatly increase the quick, stable, and cost-saving overhead of the camera shooting link, and the overall solution has an excessive computational load. Most of the existing camera shooting algorithms are adapted to the link corresponding to SDR. The images processed in this way only focus on the display effect of SDR and do not take into account the display effect of HDR, that is, the effects of both SDR and HDR cannot be taken into account simultaneously on one link. If you want to present the HDR effect on a screen that supports HDR effect display (such as a mobile phone screen), usually an additional gain mask image of the high-brightness area is calculated and packed with the obtained SDR image into the Ultra High Dynamic Range (UHDR) format, so that more brightness can be stimulated in the high-brightness area during HDR screen display. However, since the gain mask image calculated for the high-brightness area is a single-channel image, the UHDR format image packed with it only stimulates the high-brightness area of the captured picture when displayed in the mobile phone album, and there is only an increase in the display of brightness without enhancement of the color part, and the high-brightness display color is prone to distortion. Moreover, if post-processing editing is performed on the album side, since the gain mask image is not edited correspondingly, the picture will lose the HDR effect. In summary, for a single camera shooting link, each camera shooting algorithm only targets the display effect corresponding to this link and cannot take into account the display effects of other links.
[0035] In view of this, the present application provides an image processing method, device, electronic device, storage medium, and program product, which can take into account the display effects of both HDR and SDR on a single camera shooting link.
[0036] The image processing method provided by the embodiments of the present application can be applied to an electronic device. Among them, the electronic device can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things device can be a smart speaker, a smart TV, a smart air conditioner, a smart vehicle-mounted device, a projection device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The head-mounted device can be a Virtual Reality (VR) device, an Augmented Reality (AR) device, a smart glasses, etc. In the embodiments of the present application, a shooting component is configured in the electronic device, and the shooting component can be a conventional shooting lens.
[0037] Exemplarily, refer to Figure 1, the electronic device 10 can be a mobile phone, and the electronic device 10 includes a shooting component 101.
[0038] In an exemplary embodiment, as Figure 2 shown, an image processing method is provided. Taking this method applied to an electronic device as an example for illustration. The image processing method includes the following steps 201 to step 203:
[0039] Step 201, perform an inverse mapping process on the first image according to the first gamma curve to obtain a first mapped image corresponding to the first image; the first image supports the first display standard.
[0040] The first gamma curve is a curve formed by combining a standard gamma and a tone curve. The standard gamma can be Hybrid Log - Gamma (HLG), or it can be Standard Red Green Blue (SRGB) gamma. The tone curve includes the tone curve corresponding to SDR and the tone curve corresponding to HDR. The first gamma curve can be a curve formed by combining HLG and the tone curve corresponding to HDR, or it can be a curve formed by combining sRGB gamma and the tone curve corresponding to SDR. Specifically, the first gamma curve can be expressed as: srgbGammaTone = sRGB_gamma + sdr_ToneCurve, or it can be expressed as hlgGammaTone = HLG_gamam + hdr_ToneCurve. Wherein, sRGB_gamma is sRGB gamma, sdr_ToneCurve is the tone curve corresponding to SDR, HLG_gamam is HLG, and hdr_ToneCurve is the tone curve corresponding to HDR. The first gamma curve can be preset by a staff member according to experience and stored in the memory of the electronic device.
[0041] The first image can be an SDR image or an HDR image. Correspondingly, the first display standard can be the display standard corresponding to the SDR image or the display standard corresponding to the HDR image. The first image can be obtained by shooting with the shooting component in the electronic device. The type of the first gamma curve is determined according to the type of the first image. If the first image is an SDR image, the first gamma curve is srgbGammaTone; if the first image is an HDR image, the first gamma curve is hlgGammaTone.
[0042] After the electronic device obtains the first image, it obtains the corresponding first gamma curve from the memory. If the electronic device has undergone a mapping process during the acquisition of the first image, after obtaining the first image, the electronic device can perform an inverse mapping process on the first image according to the first gamma curve. That is to say, by changing the pixel values in the first image according to the first gamma curve, the mapped image corresponding to the first image, that is, the first mapped image, can be obtained.
[0043] Step 202: Perform a mapping process on the first mapped image according to the second gamma curve to obtain a second image; the second image supports the second display standard.
[0044] For the description of the second gamma curve, reference can be made to the specific description of the first gamma curve above. The second gamma curve is different from the first gamma curve. When the first gamma curve is srgbGammaTone, the second gamma curve is hlgGammaTone; when the first gamma curve is hlgGammaTone, the first gamma curve is srgbGammaTone.
[0045] For the description of the second image and the second display standard, reference can be made to the description of the first image and the second display standard above. The second image is different from the first image. If the first image is an SDR image and the standard supported by the first image is the display standard corresponding to SDR, then the second image is an HDR image and the standard supported by the second image is the display standard corresponding to HDR; if the first image is an HDR image and the standard supported by the first image is the display standard corresponding to HDR, then the second image is an SDR image and the standard supported by the second image is the display standard corresponding to SDR.
[0046] After the electronic device obtains the first mapped image corresponding to the first image, it performs a mapping process on the first mapped image according to the second gamma curve. That is to say, by changing the pixel values in the first mapped image according to the second gamma curve, the second image can be obtained.
[0047] Optionally, when the obtained first image is an SDR image and the srgbGammaTone has been applied to the SDR image, the pixel values in the SDR image can be inversely mapped according to srgbGammaTone to obtain the mapped image corresponding to the SDR image. By performing a mapping process on the pixel values in the mapped image corresponding to the SDR image according to hlgGammaTone, an HDR image can be obtained.
[0048] Optionally, when the acquired first image is an HDR image and the hlgGammaTone has been applied to the acquired HDR image, the pixel values in the HDR image can be inversely mapped according to the hlgGammaTone to obtain the mapped image corresponding to the HDR image, and the pixel values in the mapped image corresponding to the HDR image can be mapped according to the srgbGammaTone to obtain an SDR image.
[0049] Step 203: Determine the display image of the display screen according to the parameter information of the display screen, the first image, and the second image.
[0050] The parameter information of the display screen may include resolution, screen ratio, pixel density, color gamut, color depth, brightness, contrast, supported display formats, etc. The parameter information of the display screen is pre-stored in the memory of the electronic device.
[0051] After the electronic device acquires the first image and the second image, it determines the display image of the display screen according to the parameter information, the first image, and the second image. The image displayed on the display screen may be an SDR image or an HDR image. This embodiment does not limit the specific method for determining the display image of the display screen according to the parameter information of the display screen, the first image, and the second image, as long as its function can be realized.
[0052] In an optional embodiment, after the electronic device acquires the second image, it may perform three-dimensional lookup table processing and / or sharpening processing on the second image according to actual requirements. Through three-dimensional lookup table processing, the color performance of the second image can be further improved; through sharpening processing, the sharpening degree of the second image can be adjusted.
[0053] In the embodiments of the present application, by performing mapping processing on the acquired first image according to the first gamma curve and the second gamma curve, a second image can be obtained, which can ensure that in the same link, when the first image is acquired, the second image can be determined according to the first image, so that both the first image and the second image can be displayed when displayed on the display screen; in other words, in the same link, the display of the first image and the second image can be taken into account simultaneously. Moreover, the embodiments of the present application do not need to deploy multiple photographing algorithms in this link, which can reduce overhead and computational complexity, thereby improving the practicality of the image processing method.
[0054] In one embodiment, based on Figure 2 the embodiments shown below, an exemplary description is given of the process in which the electronic device performs inverse mapping processing on the first image according to the first gamma curve to obtain the first mapped image corresponding to the first image. The process includes:
[0055] For each pixel in the first image, according to the first pixel value of the pixel and the first gamma curve, determine the second pixel value of the pixel to obtain a first mapped image.
[0056] After the electronic device obtains the first image, for each pixel in the first image, according to the first gamma curve, adjust the first pixel value of the pixel to the second pixel value, and the first mapped image corresponding to the first image can be obtained.
[0057] Next, an exemplary introduction to the implementation manner of the electronic device determining the second pixel value according to the first pixel value of the pixel and the first gamma curve is given.
[0058] See Figure 3 The electronic device can execute Figure 3 The processes shown in steps 301 and 302 to implement the determination of the second pixel value of the pixel:
[0059] Step 301, according to the first pixel value, determine a target point from the first gamma curve; the first coordinate value of the target point is the same as the first pixel value.
[0060] When representing the first gamma curve in a coordinate system, the first gamma curve corresponds to a first coordinate value and a second coordinate value in the coordinate system. The first coordinate value can be the coordinate value of the first gamma curve on the first coordinate axis (X-axis) in the coordinate system, and the corresponding second coordinate value is the coordinate value of the first gamma curve on the second coordinate axis (Y-axis) in the coordinate system; the first coordinate value can also be the coordinate value of the first gamma curve on the Y-axis in the coordinate system, and the corresponding second coordinate value is the coordinate value of the first gamma curve on the X-axis in the coordinate system.
[0061] For each pixel in the first image, the electronic device determines, according to the first pixel value of the pixel, the first coordinate value in the coordinate system that is the same as the first pixel value on the first gamma curve. In other words, obtain all the coordinate values of the first gamma curve on the first coordinate axis in the coordinate system, and determine the target point corresponding to the first coordinate value that is the same as the first pixel value on the first gamma curve.
[0062] Step 302, determine the second coordinate value of the target point as the second pixel value.
[0063] After the electronic device determines the target point on the first gamma curve, obtain the second coordinate value corresponding to the target point on the second coordinate axis, and determine the second coordinate value as the second pixel value.
[0064] Execute the above steps 301 and 302 for each pixel in the first image, and the first mapped image corresponding to the first image can be obtained.
[0065] In an alternative embodiment, assume that mapping the coordinate values on the Y-axis in the coordinate system to the coordinate values on the X-axis according to the first gamma curve is the mapping. Then, for the inverse mapping process of the first image, it is to determine the target point corresponding to the coordinate value of the X-axis that is the same as the first pixel value on the first gamma curve, and adjust the first pixel value of this pixel point to the coordinate value of this target point on the Y-axis, that is, the second pixel value.
[0066] In the embodiment of the present application, for each pixel point's first pixel value in the first image, by determining the target point from the first gamma curve according to the first pixel value; and determining the second coordinate value of this target point as the second pixel value, the first mapped image can be obtained. In this way, the method for determining the first mapped image is simple and easy to implement, and can improve the practicability of the image processing method.
[0067] In one embodiment, based on Figure 2 In the embodiment shown below, hereinafter, an exemplary description will be given of the process by which the electronic device determines the display image of the display screen according to the parameter information of the display screen, the first image, and the second image. As Figure 4 shown, this process includes the following steps 401 and 402:
[0068] Step 401, determine the display format supported by the display screen according to the parameter information.
[0069] After the electronic device obtains the parameter information of the display screen, it extracts the display format supported by the display screen from the parameter information. The display format supported by the display screen can be the display format corresponding to the SDR image, or the display format corresponding to the HDR image, or also the UHDR format. The display format supported by the display screen is related to the type of the display screen of the electronic device, and no limitation is made here.
[0070] Step 402, determine the display image according to the display format, the first image, and the second image.
[0071] After the electronic device determines the display format supported by the display screen, it will display the image corresponding to the display format supported by the display screen on the display screen according to this display format, as well as the acquired first image and second image, that is, the display image.
[0072] Hereinafter, an exemplary introduction will be given to the possible implementation manners for the electronic device to determine the display image according to the display format, the first image, and the second image.
[0073] 1) The first implementation manner
[0074] The process by which the electronic device determines the display image according to the display format, the first image, and the second image is as follows:
[0075] If the display format is the second display format, determine the display image from the first image and the second image; the display format of the display image is the same as the second display format.
[0076] The second display format can be the display format corresponding to SDR or the display format corresponding to HDR.
[0077] It can be understood that after the electronic device obtains the display format of the display screen, if it determines that the display format is the display format corresponding to SDR, it determines, from the first image and the second image, an image with the same display format as that corresponding to SDR, and uses it as the display image.
[0078] After the electronic device obtains the display format of the display screen, if it determines that the display format is the display format corresponding to HDR, it determines, from the first image and the second image, an image with the same display format as that corresponding to SDR, and uses it as the display image.
[0079] Optionally, assume that the first image is an HDR image and the second image is an SDR image. If the electronic device determines that the display format is the display format corresponding to SDR, it uses the second image as the display image; if the electronic device determines that the display format is the display format corresponding to HDR, it uses the first image as the display image.
[0080] In this embodiment, the display format of the display screen of the electronic device is the same as the display format corresponding to any one of the first image and the second image, and directly selects one image from the first image and the second image as the display image for display, which can improve the display efficiency and display effect. Moreover, the image processing method provided in this embodiment can be applied to display screens with different display formats.
[0081] 2) The second implementation manner
[0082] See Figure 5 The electronic device can execute Figure 5 The steps 501 to 503 shown to implement the process of determining the display image according to the display format, the first image, and the second image:
[0083] Step 501, if the display format is the first display format, determine the gain mask image according to the first image and the second image.
[0084] The first display format is UHDR. When the electronic device determines that the display format of the display screen is the first display format, it determines the gain mask image according to the obtained first image and second image. The gain mask image is an image used to adjust the gain of different regions in the image, that is, used to increase or decrease the signal intensity of different regions.
[0085] In an optional embodiment, before determining the gain mask image based on the first image and the second image, the electronic device may perform scaling processing on the first image and the second image respectively to obtain the scaled first image and the scaled second image. By performing scaling processing on the first image and the second image first and then performing candidate correlation calculations, the amount of subsequent calculations can be reduced and the calculation efficiency can be improved.
[0086] Step 502: Determine a target image from the first image and the second image; wherein, the display standard supported by the target image is the smallest display standard among the first display standard and the second display standard.
[0087] The electronic device determines the smallest display standard among the first display standard supported by the first image and the second display standard supported by the second image, and determines the image corresponding to the smallest display standard as the target image.
[0088] Exemplarily, assume that the first display standard supported by the first image is SDR, the second display standard supported by the second image is HDR, and the smallest display standard among the first display standard and the second display standard is SDR, then the first image is determined as the target image.
[0089] Step 503: Perform image fusion processing on the gain mask image and the target image to obtain a fused image, and determine the fused image as the display image.
[0090] After obtaining the gain mask image and the target image, the electronic device performs image fusion processing on the gain mask image and the target image. That is, signal enhancement processing is performed on corresponding different regions in the target image according to the gain mask image, and a fused image can be obtained. In this embodiment, the specific method for performing image fusion processing on the gain mask image and the target image is not limited as long as its function can be realized.
[0091] After obtaining the fused image, the electronic device determines the fused image as the display image and displays it on the display screen.
[0092] In this embodiment, in the case where the display format is the first display format, the gain mask image and the target image determined from the first image and the second image can be fused to determine a display image that can be displayed on the display screen. Such an image processing method can be compatible with the display of images corresponding to the first display format, and can improve the practicability and reliability of the image processing method.
[0093] In one embodiment, based on Figure 5 In the embodiment shown below, the process of the electronic device determining the gain mask image according to the first image and the second image will be exemplarily described. As Figure 6As shown, the process includes steps 601 to 603:
[0094] Step 601, perform domain conversion processing on the first image to obtain a first linear image of the first image in the linear domain.
[0095] The electronic device performs domain conversion processing on the obtained first image. That is, the first image in the color domain is converted to the linear domain, and a first linear image of the first image in the linear domain can be obtained.
[0096] In an optional embodiment, the electronic device can calculate the first linear image through a standard formula in the AV1 Image File Format (AVIF).
[0097] Exemplarily, the first image is an HDR image, and the first linear image hdrLinear can be calculated through the formula hdrLinear = hlgToLinear(hdr).
[0098] Step 602, perform domain conversion processing on the second image to obtain a second linear image of the second image in the linear domain.
[0099] The electronic device performs domain conversion processing on the obtained second image. That is, the second image in the color domain is converted to the linear domain, and a second linear image of the second image in the linear domain can be obtained.
[0100] In an optional embodiment, the electronic device can calculate the second linear image through a standard formula in the AV1 Image File Format (AVIF).
[0101] Exemplarily, the second image is an SDR image, and the first linear image sdrLinear can be calculated through the formula sdrLinear = srgbToLinear(sdr).
[0102] Step 603, determine a gain mask image according to the first linear image, the second linear image, and a preset mask calculation algorithm.
[0103] The preset mask calculation method can be pre-set by the staff. During the execution of the preset mask calculation algorithm, the electronic device will obtain several parameters, namely the maximum display brightness corresponding to HDR (in nit) and the maximum display brightness corresponding to SDR (in nit) set on the display screen.
[0104] After obtaining the first linear graph and the second linear graph, the electronic device determines a gain mask image based on a preset mask calculation algorithm, according to the maximum display brightness corresponding to the HDR of the electronic device and the maximum display brightness corresponding to the SDR, as well as the first linear graph and the second linear graph.
[0105] Exemplarily, the gain mask image gainMask can be calculated by the following formula:
[0106] , where hlgNits is the maximum display brightness corresponding to the HDR, and sdrNits is the maximum display brightness corresponding to the SDR.
[0107] In this embodiment, by performing domain conversion processing on the first image and the second image respectively, the first linear graph and the second linear graph in the linear domain are obtained. The first linear graph obtained in this way includes the information of the three channels corresponding to the first image, and the second linear graph includes the information of the three channels corresponding to the second image. Then, the gain mask image obtained according to the first linear graph, the second linear graph, and the preset mask calculation method includes the information of the three channels, which can make the obtained display image more accurate and have a better display effect on the display screen.
[0108] The above embodiment introduces the process of determining the first image from the obtained first image, which can ensure that the display of the first image and the second image can be taken into account simultaneously in the same link.
[0109] In the embodiment of the present application, different obtained first images have a certain impact on the subsequent determination of the quality of the second image and the display of the first image and the second image.
[0110] Next, an exemplary introduction to the implementation manner of the electronic device for obtaining the first image is given.
[0111] 1) The first implementation manner
[0112] Based on any of the above embodiments, in the embodiment of the present application, the image processing method further includes:
[0113] Processing the original image corresponding to the first image according to a preset image processing algorithm to obtain the first image.
[0114] The original image corresponding to the first image may be image data directly captured by a shooting component in the electronic device without any post-processing, and is also called a RAW image.
[0115] The preset image processing algorithms can be, but are not limited to, RAW Fusion algorithm, White Balance (WB) algorithm, Color Correction Algorithm (CC) algorithm, Local Tone Mapping (LTM), Noise Processing System (NPS) algorithm, Computer Vision (CV) algorithm, Auto White Balance Scaling Factor (ASF) algorithm, Lookup Table Algorithm (LUT) algorithm. This embodiment does not limit the preset image processing algorithms, as long as their functions can be realized.
[0116] After the electronic device obtains the original image corresponding to the first image, it can process the original image according to the preset image processing algorithm to obtain the first image.
[0117] In an alternative embodiment, when there are multiple preset image processing algorithms, the electronic device can sequentially process the original image using multiple processing algorithms. The order of the multiple processing algorithms can be set by itself.
[0118] In this embodiment, directly processing the original image corresponding to the first image according to the preset image processing algorithm to obtain the first image, the method of obtaining the first image in this way is fast and easy to implement, and can improve the efficiency and practicability of the image processing method.
[0119] In one embodiment, during the process of the electronic device processing the original image according to the preset image processing algorithm, for some of the multiple processing algorithms, the processing effect is better in the color domain corresponding to the first image, and for some of the processing algorithms, the processing effect is better in the color domain corresponding to the second image. In this regard, during the process of processing the original image according to the preset image processing algorithm, the image can be converted between different color domains. Hereinafter, the process of the electronic device processing the original image corresponding to the first image according to the preset image processing algorithm to obtain the first image will be exemplarily described. As Figure 7 shown, this process includes the following steps 701 to step 705:
[0120] Step 701, process the original image corresponding to the first image according to the first algorithm to obtain a first reference image.
[0121] The first algorithm refers to the algorithm in the preset image processing algorithms that has better processing effects in the color domain corresponding to the first image. The first algorithm may include multiple image processing algorithms. The first algorithm may include a first sub-algorithm and a second sub-algorithm. The first sub-algorithm is the algorithm that needs to be executed before the second algorithm, and the second sub-algorithm is the algorithm that needs to be executed after the second algorithm. In this embodiment, the specific contents of the first sub-algorithm and the second sub-algorithm are not limited, and the staff can set them according to actual application requirements.
[0122] The electronic device processes the original image corresponding to the first image according to the first algorithm to obtain a processed image, that is, the first reference image. The color domain corresponding to the first reference image is the same as the color domain corresponding to the first image.
[0123] Step 702: Perform an inverse mapping process on the first reference image according to the first gamma curve to obtain a second reference image; perform a mapping process on the second reference image according to the second gamma curve to obtain a third reference image;
[0124] After the electronic device obtains the first reference image, it needs to convert the first reference image to the color domain corresponding to the second image. Then, perform an inverse mapping process on the first reference image according to the first gamma curve to obtain a second reference image; perform a mapping process on the second reference image according to the second gamma curve to obtain a third reference image. The color domain corresponding to the third reference image is the same as the color domain corresponding to the second image.
[0125] For the specific process of performing an inverse mapping process on the first reference image according to the first gamma curve, reference can be made to the description of the specific process of performing an inverse mapping process on the first image according to the first gamma curve in the above embodiment. For the specific process of performing a mapping process on the second reference image according to the second gamma curve, reference can be made to the description of the specific process of performing a mapping process on the first mapped image according to the second gamma curve in the above embodiment, which will not be elaborated here.
[0126] Step 703: Process the third reference image according to the second algorithm to obtain a first intermediate image;
[0127] The second algorithm refers to the processing algorithm in the preset processing algorithms that has better processing effects in the color domain corresponding to the second image. The second algorithm may include multiple processing algorithms.
[0128] After the electronic device converts the first reference image to the color domain corresponding to the second image, it processes the third reference image according to the second algorithm to obtain a processed third reference image, that is, the first intermediate image.
[0129] Step 704: Perform inverse mapping on the first intermediate image according to the second gamma curve to obtain a fourth reference image; perform mapping on the fourth reference image according to the first gamma curve to obtain a second intermediate image.
[0130] The color domain corresponding to the first intermediate image is the same as the color domain corresponding to the second image. When executing the second sub-algorithm in the first algorithm, it needs to be performed in the color domain corresponding to the first image. That is to say, it is necessary to convert the first intermediate image to the color domain corresponding to the first image.
[0131] It can be understood that the electronic device performs inverse mapping on the obtained first intermediate image according to the second gamma curve to obtain a fourth reference image; by performing mapping on the fourth reference image according to the first gamma curve, a second intermediate image with the same color domain as that corresponding to the first image can be obtained.
[0132] For the specific process of performing inverse mapping on the first intermediate image according to the second gamma curve, reference can be made to the description of the specific process of performing inverse mapping on the first image according to the first gamma curve in the above embodiment. For the specific process of performing mapping on the fourth reference image according to the first gamma curve, reference can be made to the description of the specific process of performing mapping on the first mapped image according to the second gamma curve in the above embodiment, which will not be elaborated here.
[0133] Step 705: Process the second intermediate image according to the second sub-algorithm in the first algorithm to obtain the first image.
[0134] After the electronic device obtains a second intermediate image with the same color domain as that corresponding to the first image, it executes the second sub-algorithm in the first algorithm to process the second intermediate image, and the first image can be obtained.
[0135] In this embodiment, during the process of processing the original image corresponding to the first image according to the preset image processing algorithm, the color domain corresponding to the image can be converted between the color domain corresponding to the first image and the color domain corresponding to the second image, so that the algorithms in the image processing algorithm can be executed in the corresponding color domain, which can improve the quality of the finally determined first image, thereby improving the quality of the subsequently determined second image, and further improving the display effect of the image displayed on the display screen.
[0136] 2) The second implementation manner
[0137] The first gamma curve and the second gamma curve in the above embodiment are global and respectively affect the global brightness tone and global contrast of the first image and the second image. Therefore, when the brightness tone is adjusted well and the global contrast is appropriate, it is impossible to adjust the local effects of the first image and the second image. For example Figure 8As shown, a schematic diagram of the HLG standard gamma and the sRGB standard gamma is presented. The curve on the upper side is the HLG standard gamma, and the curve on the lower side is the sRGB standard gamma. From Figure 8 it can be seen that the HLG standard gamma brightens the image more in the low-brightness area. To reasonably reduce the brightness, the tone curve needs to lower the HLG standard gamma, but it is best not to change the shape of the original gamma curve too much. Therefore, at the maximum value of the corresponding hlgGammaTone, it is not mapped to the full value (for example, a pixel value of 1.0 will be mapped to 0.8), which will cause the high-brightness area of the image after being mapped by hlgGammaTone to be not bright and lack a sense of energy.
[0138] In view of this, referring to Figure 9 , based on any of the above embodiments, in the embodiments of the present application, the image processing method further includes:
[0139] Step 901: Determine the linear graph corresponding to the original image and the initial image of the first image according to a preset image processing algorithm and the original image corresponding to the first image.
[0140] The electronic device can process the original image corresponding to the first image obtained according to the RAW Fusion algorithm in the preset image processing algorithm to obtain the linear graph corresponding to the original image. The electronic device continues to process the linear graph according to other algorithms in the preset image processing algorithm to obtain the initial image of the first image. The color domain corresponding to the initial image of the first image is the same as the color domain corresponding to the first image.
[0141] It can be understood that in the process of processing the obtained original image according to the preset image processing algorithm, both the linear graph corresponding to the original image and the initial image of the first image can be obtained.
[0142] Step 902: Perform brightness enhancement processing on the grayscale image corresponding to the linear graph according to a preset brightness enhancement parameter to obtain the lighting gain graph corresponding to the linear graph.
[0143] After the electronic device obtains the linear graph corresponding to the original image, it performs grayscale processing on the linear graph to obtain the grayscale image corresponding to the linear graph.
[0144] The preset brightness enhancement parameter includes a first brightening parameter, a second brightening parameter, and a third brightening parameter calculated according to the exposure ratio, and the average brightness of the grayscale image corresponding to the linear graph in the non-overexposed area.
[0145] After the electronic device obtains the grayscale image corresponding to the linear graph, it performs brightness enhancement processing on the grayscale image according to the calculated preset brightness parameter to obtain the lighting gain graph corresponding to the linear graph.
[0146] In an alternative embodiment, the electronic device may first determine a first gain map according to the first brightening parameter, the second brightening parameter, and the grayscale map corresponding to the linear map; then determine a second gain map according to the third brightening parameter and the average brightness; and obtain the lighting gain map corresponding to the linear map by calculating the product of the first gain map and the second gain map.
[0147] Exemplarily, assume that the first brightening parameter is represented as coeff, the second brightening parameter is represented as scale, and the third brightening parameter is represented as gain. The first gain map can be expressed as: , and the second gain map can be expressed as , where gray represents the grayscale map corresponding to the linear map. The lighting gain map can be expressed as .
[0148] Step 903, generate a first image according to the initial image and the lighting gain map.
[0149] After obtaining the initial image of the first image and the lighting gain map corresponding to the linear map, the electronic device can generate a first image according to the initial image and the lighting gain map. The first image can be an image with a minimum group of 1, that is, the brightening multiple in the non-brightened area is 1.
[0150] In this embodiment, by performing brightness enhancement processing on the grayscale map corresponding to the linearity according to the preset brightness enhancement parameter to obtain the lighting gain map, and performing brightening processing according to the lighting gain map and the initial image to generate the first image, the high-brightness area in the first image can be excited, so that the final display image can release a sense of high-light energy and has a better display effect.
[0151] In an alternative embodiment, before determining the lighting gain map, the linear map may be segmented first to determine the region of interest in the linear map; determine the lighting gain map corresponding to the other regions in the linear map except the region of interest, and the brightening multiple corresponding to the region of interest is 1. If the image to be displayed includes a face image, the region of interest in the linear map may be the face region. Protecting the region of interest in the linear map in this way can avoid improving the region of interest and affecting the display effect of the region of interest in the final display image.
[0152] In one embodiment, based on Figure 9 the embodiment shown, hereinafter, the process of the electronic device generating a first image according to the initial image and the lighting gain map will be exemplarily described. As Figure 10 shown, this process includes the following steps 1001 to step 1003:
[0153] Step 1001, perform domain conversion processing on the initial image to obtain a third linear map of the initial image in the linear domain.
[0154] The lighting gain map is obtained based on the grayscale map of the linear graph. That is to say, the lighting gain map is a graph in the linear domain. When enhancing the initial image according to the lighting gain map, the electronic device can first perform domain conversion processing on the initial image, that is, convert the initial image from the color domain to the linear domain to obtain the third linear graph. The description of the domain conversion processing of the initial image can refer to the specific description of the domain conversion processing of the first image in the above embodiments, which will not be elaborated here.
[0155] Step 1002: Perform image fusion processing on the third linear graph and the lighting gain map to generate a reference image.
[0156] After obtaining the third linear graph, the electronic device performs image fusion processing on the obtained third linear graph and the lighting gain map to obtain a reference image in the enhanced linear domain.
[0157] Exemplarily, the reference image can be expressed as , where hlg2Linear represents the third linear graph of the initial image in the linear domain.
[0158] Step 1003: Determine the image in the color domain converted from the reference image as the first image.
[0159] The reference image is an image in the linear domain, and the finally obtained first image is in the color domain. After obtaining the parameter image, the electronic device can perform domain conversion on the reference image, converting it from the linear domain to the color domain to obtain the first image. The method of converting from the linear domain to the color domain can be the inverse operation of the method of converting from the color domain to the linear domain, which will not be elaborated here.
[0160] In this embodiment, first convert the initial image to the linear domain to obtain the third linear graph, perform lighting processing on the third linear graph through the lighting gain map in the linear domain to obtain the reference image; then convert the reference image to the color domain to obtain the required first image. The first image determined in this way has a higher display effect, thereby improving the display effect of the determined second image.
[0161] In one embodiment, during the process of obtaining the first image, lighting gain processing is performed, and the maximum pixel value of the obtained first image has reached 1.0, while the maximum value of the first gamma curve has not reached 1.0 (only up to 0.8 at most). In this way, after performing inverse mapping on the first image according to the first gamma curve, the information between 0.8 - 1.0 will be lost.
[0162] In view of this, based on Figure 2 In the embodiments shown below, the process of the electronic device performing inverse mapping processing on the first image according to the first gamma curve to obtain the first mapped image corresponding to the first image will be exemplarily described. AsFigure 11 As shown, the process includes the following steps 1101 and 1102:
[0163] Step 1101: Perform gamma transformation processing on the first gamma curve to obtain a third gamma curve.
[0164] The electronic device performs gamma transformation processing on the first gamma curve so that the transformed third gamma curve can record the image information after lighting gain processing. In this embodiment, there is no limitation on the specific manner of performing gamma transformation processing on the first gamma curve, and the staff can set it according to actual applications.
[0165] In an optional embodiment, as Figure 12 shown, the electronic device can use two gamma change processing methods to transform the first gamma curve. One is to perform overall stretching on the first gamma curve, such as Figure 12 the topmost curve in Figure 12 ; the other is to stretch the part with the highest corresponding brightness in the first gamma curve, such as Figure 12 the middle curve in
[0166] The bottommost curve in
[0167] is the first gamma curve. Step 1102: Use the third gamma curve to perform inverse mapping processing on the first image to obtain the first mapped image corresponding to the first image.
[0168] After the electronic device obtains the third gamma curve, it uses the third gamma curve to perform inverse mapping processing on the first image to obtain the first image. For the specific process of performing inverse mapping processing on the first image using the third gamma curve, reference can be made to the description of the specific process of performing inverse mapping processing on the first image according to the first gamma curve in the above embodiment, and details are not described here again.
[0169] In this embodiment, by performing gamma transformation processing on the first gamma curve, the transformed third gamma curve can record the image information after lighting gain processing. In this way, the first image obtained by performing inverse mapping processing on the first image according to the third gamma curve is more accurate, thereby improving the display effect when the first image is subsequently displayed.
[0170] After obtaining a first image through a shooting component of an electronic device and performing image processing on the first image to obtain a second image, the first image and the second image can be stored in a folder (the folder corresponding to the album) in the memory of the electronic device. On the album side, the stored images may be edited and adjusted. For example, filters may be added to the first image and / or the second image, and beauty and blurring adjustments may be made. Among them, the editing and adjustment of the stored images can be that the electronic device performs corresponding editing and adjustment on the images according to a pre-set software program, or the electronic device receives the adjustment operations of the user and performs corresponding editing processing on the images. However, the editing of the images on the album side is usually related to the shooting link corresponding to the shooting component in the electronic device. For example, in the HDR link, after the images are edited and adjusted on the album side, the HDR effect will be lost, resulting in the inability to display the HDR effect when the images are obtained from the album side for display.
[0171] In view of this, on the basis of any of the above embodiments, refer to Figure 13 , in the embodiments of the present application, the image processing method further includes Figure 13 the steps 1301 and 1302 shown in
[0172] Step 1301, perform inverse mapping processing on the edited image according to the first gamma curve to obtain a second mapped image corresponding to the edited image; the edited image is obtained by editing the first image and the second image in the target color domain.
[0173] The target color domain can be the SDR domain or the HDR domain. The edited image refers to the image obtained by editing the first image and the second image in the target color domain on the album side of the electronic device. Specifically, if the shooting link corresponding to the shooting component is HDR, the editing process performed on the album side is performed in the HDR domain. That is to say, the edited image is obtained by editing the first image and the second image in the HDR domain, and the display standard supported by the edited image is HDR. Similarly, if the shooting link corresponding to the shooting component is SDR, the editing process performed on the album side is performed in the SDR domain. That is to say, the edited image is obtained by editing the first image and the second image in the SDR domain, and the display standard supported by the edited image is SDR.
[0174] After the electronic device obtains the edited image, performing inverse mapping processing on the edited image according to the first gamma curve can obtain a second mapped image corresponding to the edited image. The specific process of performing inverse mapping processing on the edited image according to the first gamma curve can refer to the description of the specific process of performing inverse mapping processing on the first image according to the first gamma curve in the above embodiments, and will not be repeated here.
[0175] Step 1302: Perform mapping processing on the second mapped image according to the second gamma curve to obtain a third image corresponding to the edited image; the display formats of the third image and the edited image are different.
[0176] After the electronic device obtains the second mapped image corresponding to the edited image, mapping processing is performed on the second mapped image according to the second gamma curve, and a third image corresponding to the edited image can be obtained; the display formats of the third image and the edited image are different, that is, the display standards supported by the third image and the edited image are different. If the display standard supported by the edited image is SDR, and the edited image is mapped through the first gamma curve and the second gamma curve, the SDR image can be converted into an HDR image, then the display standard supported by the third image is HDR. If the display standard supported by the edited image is HDR, and the edited image is mapped through the first gamma curve and the second gamma curve, the HDR image can be converted into an SDR image, then the display standard supported by the third image is SDR.
[0177] In this embodiment, at the album end of the electronic device, inverse mapping processing is performed on the edited image according to the first gamma curve to obtain the second mapped image; mapping processing is performed on the first mapped image according to the second gamma curve to obtain the third image, so as to ensure that the album end of the electronic device includes images that can support two different display standards, namely the edited image and the third image, thereby ensuring that two display effects can be taken into account when the images obtained from the album end are displayed.
[0178] In one embodiment, an image processing method for an electronic device is provided. In this embodiment, the imaging link corresponding to the shooting component of the electronic device is taken as an example of an HDR link for illustration. The image processing method includes the following steps:
[0179] Step A1: Determine a linear graph corresponding to the original image and an initial image of the HDR image according to a preset image processing algorithm and the original image corresponding to the HDR image.
[0180] Step A2: Perform brightness enhancement processing on the grayscale graph corresponding to the linear graph according to a preset brightness enhancement parameter to obtain a lighting gain graph corresponding to the linear graph.
[0181] The preset brightness enhancement parameter may include a first brightening parameter represented as coeff, a second brightening parameter represented as scale, and a third brightening parameter represented as gain.
[0182] Step A3: Perform domain conversion processing on the initial image to obtain a third linear graph of the initial image in the linear domain.
[0183] Step A4: Perform image fusion processing on the third linear graph and the lighting gain graph to generate a reference image, and convert the reference image to an image in the color domain and determine it as the HDR image;
[0184] Step A5: Perform gamma transformation processing on hlgGammaTone to obtain a new hlgGammaTone.
[0185] Step A6: Use the new hlgGammaTone to perform inverse mapping processing on the HDR image to obtain the first mapped image.
[0186] Step A7: Use srgbGammaTone to perform mapping processing on the first mapped image to obtain the SDR image.
[0187] Step A8: If, according to the parameter information of the display screen, it is determined that the display format of the display screen is UHDR, then perform domain conversion on the first image and the second image respectively to obtain the first linear graph of the first image in the linear domain and the second linear graph of the second image in the linear domain.
[0188] Step A9: Determine the gain mask image according to the first linear graph, the second linear graph, and the preset mask calculation algorithm.
[0189] Step A10: Perform image fusion processing on the gain mask image and the SDR image to obtain the display image.
[0190] In an optional embodiment, the structural block diagram of the electronic device executing the above image processing method is as Figure 14 shown. Figure 14 The first image processing algorithm in can include RAW Fusion algorithm, WB algorithm, CC algorithm, LTM algorithm, and increased bit gamma, etc. The second image processing algorithm can include NPS algorithm, CV algorithm, ASF algorithm, LUT algorithm, removed bit gamma, etc. The brightening process refers to fusing the third linear graph and the lighting gain graph to obtain a reference image, and performing domain conversion on the reference image to obtain the first image; the mapping process refers to converting the first image into the second image. Other algorithms include color processing and deformation processing algorithms, etc. The mapping process can be to convert the image processed by other algorithms, and reference can be made to the specific description of the embodiment shown in the above Figure 7 The finally obtained images include the new second image and the gain mask image. By performing image fusion processing on the second image and the gain mask image, the display image can be obtained, and the display format of the display image is UHDR.
[0191] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown in the direction of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0192] Based on the same inventive concept, an embodiment of the present application further provides an image processing apparatus for implementing the above-mentioned image processing method. The implementation solution for solving the problem provided by this apparatus is similar to the implementation solution described in the above method. Therefore, the specific limitations in one or more embodiments of the following image processing apparatus can refer to the limitations on the image processing method in the above text, and will not be repeated here.
[0193] In one embodiment, as Figure 15 shown, an image processing apparatus is provided, including:
[0194] A first processing module 1301, configured to perform an inverse mapping process on a first image according to a first gamma curve to obtain a first mapped image corresponding to the first image; the first image supports a first display standard;
[0195] A second processing module 1302, configured to perform a mapping process on the first mapped image according to a second gamma curve to obtain a second image; the second image supports a second display standard;
[0196] A determination module 1303, configured to determine a display image of the display screen according to the parameter information of the display screen, the first image, and the second image.
[0197] In one of the embodiments, the first processing module 1301 includes:
[0198] A first determination unit, configured to, for each pixel point in the first image, determine a second pixel value of the pixel point according to the first pixel value of the pixel point and the first gamma curve, to obtain the first mapped image.
[0199] In one of the embodiments, the first determination unit is specifically configured to determine a target point from the first gamma curve according to the first pixel value; the first coordinate value of the target point is the same as the first pixel value; and determine the second coordinate value of the target point as the second pixel value.
[0200] In one embodiment, the determining module 1303 includes:
[0201] A second determining unit, configured to determine a display format supported by the display screen according to parameter information;
[0202] A third determining unit, configured to determine a display image according to the display format, the first image, and the second image.
[0203] In one embodiment, the third determining unit includes:
[0204] A first determining subunit, configured to, if the display format is a first display format, determine a gain mask image according to the first image and the second image; determine a target image from the first image and the second image; wherein the display standard supported by the target image is the smallest display standard among the first display standard and the second display standard;
[0205] A fusion subunit, configured to perform image fusion processing on the gain mask image and the target image to obtain a fusion image, and determine the fusion image as the display image.
[0206] In one embodiment, the first determining subunit is specifically configured to perform domain conversion processing on the first image to obtain a first linear graph of the first image in the linear domain; perform domain conversion processing on the second image to obtain a second linear graph of the second image in the linear domain; determine the gain mask image according to the first linear graph, the second linear graph, and a preset mask calculation algorithm.
[0207] In one embodiment, the third determining unit is specifically configured to, if the display format is a second display format, determine a display image from the first image and the second image; the display format of the display image is the same as the second display format.
[0208] In one embodiment, the image processing apparatus further includes:
[0209] A third processing module, configured to process the original image corresponding to the first image according to a preset image processing algorithm to obtain the first image.
[0210] In one embodiment, the third processing module includes:
[0211] A first processing unit, configured to process the original image corresponding to the first image according to a first sub-algorithm in the first algorithm to obtain a first reference image;
[0212] A second processing unit, configured to perform inverse mapping processing on the first reference image according to a first gamma curve to obtain a second reference image; perform mapping processing on the second reference image according to a second gamma curve to obtain a third reference image;
[0213] A third processing unit, configured to process a third reference image according to a second algorithm to obtain a first intermediate image;
[0214] A fourth processing unit, configured to perform an inverse mapping process on the first intermediate image according to a second gamma curve to obtain a fourth reference image; perform a mapping process on the fourth reference image according to a first gamma curve to obtain a second intermediate image;
[0215] A fifth processing unit, configured to process the second intermediate image according to a second sub-algorithm in the first algorithm to obtain a first image.
[0216] In one embodiment, the determination module 1303 further includes:
[0217] A fourth determination unit, configured to determine a linear graph corresponding to the original image and an initial image of the first image according to a preset image processing algorithm and the original image corresponding to the first image;
[0218] A sixth processing unit, configured to perform a brightness enhancement process on a grayscale graph corresponding to the linear graph according to a preset brightness enhancement parameter to obtain a lighting gain graph corresponding to the linear graph;
[0219] A generation unit, configured to generate a first image according to the initial image and the lighting gain graph.
[0220] In one embodiment, the generation unit is specifically configured to perform a domain conversion process on the initial image to obtain a third linear graph of the initial image in the linear domain; perform an image fusion process on the third linear graph and the lighting gain graph to generate a reference image; determine the image converted to the color domain as the first image.
[0221] In one embodiment, the third processing module is further configured to perform a gamma transformation process on the first gamma curve to obtain a third gamma curve; perform an inverse mapping process on the first image by using the third gamma curve to obtain a first mapped image corresponding to the first image.
[0222] In one embodiment, the image processing device further includes:
[0223] A fourth processing module, configured to perform an inverse mapping process on an edited image according to the first gamma curve to obtain a second mapped image corresponding to the edited image; the edited image is obtained by performing an editing process on the first image and the second image in a target color domain; perform a mapping process on the second mapped image according to the second gamma curve to obtain a third image corresponding to the edited image; the display formats of the third image and the edited image are different.
[0224] Each module in the above image processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in the processor of the computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.
[0225] In an exemplary embodiment, an electronic device is provided. The electronic device can be a terminal, and its internal structure diagram can be as Figure 16 shown. The computer device includes a processor, a memory, a communication interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements an image processing method. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0226] Those skilled in the art can understand that Figure 16 the structure shown in
[0227] is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.
[0228] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the image processing method described in the above embodiment.
[0229] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data that have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0230] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., and are not limited thereto. The processors involved in the embodiments provided in this application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., and are not limited thereto.
[0231] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope described in this specification.
[0232] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. An image processing method, characterized in that, The method includes: Performing an inverse mapping process on a first image according to a first gamma curve to obtain a first mapped image corresponding to the first image; the first image supports a first display standard; Performing a mapping process on the first mapped image according to a second gamma curve to obtain a second image; the second image supports a second display standard; Determining a display image of the display screen according to parameter information of the display screen, the first image, and the second image.
2. The method according to claim 1, wherein The performing an inverse mapping process on a first image according to a first gamma curve to obtain a first mapped image corresponding to the first image includes: For each pixel point in the first image, determining a second pixel value of the pixel point according to the first pixel value of the pixel point and the first gamma curve to obtain the first mapped image.
3. The method according to claim 2, characterized in that The determining a second pixel value of the pixel point according to the first pixel value of the pixel point and the first gamma curve includes: Determining a target point from the first gamma curve according to the first pixel value; a first coordinate value of the target point is the same as the first pixel value; Determining the second coordinate value of the target point as the second pixel value.
4. The method according to any one of claims 1 to 3, characterized in that The determining a display image of the display screen according to parameter information of the display screen, the first image, and the second image includes: Determining a display format supported by the display screen according to the parameter information; Determining the display image according to the display format, the first image, and the second image.
5. The method according to claim 4, characterized in that, The determining the display image according to the display format, the first image, and the second image includes: If the display format is a first display format, determining a gain mask image according to the first image and the second image; Determining a target image from the first image and the second image; wherein, a display standard supported by the target image is the smallest display standard among the first display standard and the second display standard; Performing an image fusion process on the gain mask image and the target image to obtain a fused image, and determining the fused image as the display image.
6. The method according to claim 5, wherein The determining a gain mask image according to the first image and the second image includes: Performing a domain conversion process on the first image to obtain a first linear graph of the first image in a linear domain; Performing a domain conversion process on the second image to obtain a second linear graph of the second image in a linear domain; Determining the gain mask image according to the first linear graph, the second linear graph, and a preset mask calculation algorithm.
7. The method according to claim 4, wherein The determining the display image according to the display format, the first image, and the second image includes: If the display format is a second display format, determining the display image from the first image and the second image; a display format of the display image is the same as the second display format.
8. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Processing an original image corresponding to the first image according to a preset image processing algorithm to obtain the first image.
9. The method according to claim 8, wherein The image processing algorithm includes a first algorithm and a second algorithm; processing the original image corresponding to the first image according to the preset image processing algorithm to obtain the first image includes: Processing the original image corresponding to the first image according to the first sub-algorithm in the first algorithm to obtain a first reference image; Performing inverse mapping processing on the first reference image according to the first gamma curve to obtain a second reference image; performing mapping processing on the second reference image according to the second gamma curve to obtain a third reference image; Processing the third reference image according to the second algorithm to obtain a first intermediate image; Performing inverse mapping processing on the first intermediate image according to the second gamma curve to obtain a fourth reference image; performing mapping processing on the fourth reference image according to the first gamma curve to obtain a second intermediate image; Processing the second intermediate image according to the second sub-algorithm in the first algorithm to obtain the first image.
10. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Determining a linear graph corresponding to the original image and an initial image of the first image according to the preset image processing algorithm and the original image corresponding to the first image; Performing brightness enhancement processing on the grayscale graph corresponding to the linear graph according to the preset brightness enhancement parameter to obtain a lighting gain graph corresponding to the linear graph; Generating the first image according to the initial image and the lighting gain graph.
11. The method according to claim 10, wherein The generating the first image according to the initial image and the lighting gain graph includes: Performing domain conversion processing on the initial image to obtain a third linear graph of the initial image in the linear domain; Performing image fusion processing on the third linear graph and the lighting gain graph to generate a reference image; Determining the image converted to the color domain as the first image.
12. The method according to claim 10, wherein The performing inverse mapping processing on the first image according to the first gamma curve to obtain a first mapped image corresponding to the first image includes: Performing gamma transformation processing on the first gamma curve to obtain a third gamma curve; Performing inverse mapping processing on the first image using the third gamma curve to obtain a first mapped image corresponding to the first image.
13. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Performing inverse mapping processing on the edited image according to the first gamma curve to obtain a second mapped image corresponding to the edited image; the edited image is obtained by performing editing processing on the first image and the second image in the target color domain; Performing mapping processing on the second mapped image according to the second gamma curve to obtain a third image corresponding to the edited image; the display formats of the third image and the edited image are different.
14. An image processing apparatus, characterized in that, The device includes: A first processing module, configured to perform inverse mapping processing on a first image according to a first gamma curve to obtain a first mapped image corresponding to the first image; the first image supports a first display standard; A second processing module, configured to perform mapping processing on the first mapped image according to a second gamma curve to obtain a second image; the second image supports a second display standard; A determination module, configured to determine a display image of the display screen according to parameter information of the display screen, the first image, and the second image.
15. An electronic device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1-13 are implemented.
16. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 13 are implemented.
17. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 13 are implemented.