Tone mapping curve adjusting method and device, exposure method and device, computer equipment, readable storage medium and program product
By introducing automatic exposure information during the tone mapping process and adjusting the tone mapping curve, the problem of dark area details in the prior art is solved, and a more accurate and effective image processing effect is achieved.
Patent Information
- Application Number
- CN202510058814.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-04-25
AI Technical Summary
The prior art is difficult to effectively retain dark area details during tone mapping, especially under a single global tone mapping curve, resulting in some dark area scenes losing details.
By introducing information of automatic exposure, adjusting the tone mapping curve, the specific method includes determining the brightness range based on the accumulated histogram of the image to be processed, obtaining the reference brightness value and the target brightness value, and determining the adjustment point of the tone mapping curve based on these values, and finally adjusting the curve to improve accuracy.
Improves the accuracy of tone mapping curve adjustment, ensuring the retention of dark area details and the dynamic range compression of the image.
Smart Images

Figure CN119893299A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a tone mapping curve adjustment method, exposure method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] One of the core functions of an imaging system is image display. A good display effect can reproduce the original scene more realistically. Tone mapping is an important component that affects the reproduction system. The essence of the tone-mapping curve is a brightness mapping function. The input brightness is obtained according to the mapping function to obtain the output brightness. Its function is to map the brightness of the input image to a narrower brightness range, thereby achieving dynamic range compression.
[0003] Tone-mapping is divided into global tone mapping and local tone mapping. Local tone mapping requires partition processing and is more complicated. Global tone mapping uses a single tone mapping curve to increase the low-brightness pixel value of the entire image and lower the high-brightness pixel value, resulting in some dark areas of the scene losing details under the condition of single global tone mapping. Summary of the invention
[0004] Based on this, it is necessary to provide a tone mapping curve adjustment method, exposure method, device, computer equipment, computer-readable storage medium and computer program product that can introduce automatic exposure information into the tone mapping curve to improve the accuracy of the tone mapping curve adjustment in order to address the above-mentioned technical problems.
[0005] In a first aspect, the present application provides a tone mapping curve adjustment method, the method comprising:
[0006] Determine a brightness range based on a cumulative histogram corresponding to the image to be processed, wherein the brightness range includes a first brightness endpoint value and a second brightness endpoint value;
[0007] Acquiring a reference brightness value of the image to be processed during exposure and a target brightness value obtained by adjusting the reference brightness value based on a histogram restriction condition;
[0008] Determining an adjustment point of a tone mapping curve based on the reference brightness value, the target brightness value, the first brightness endpoint value, and the second brightness endpoint value, wherein the adjustment point comprises a point position at which the target brightness value is moved toward the reference brightness value;
[0009] The tone mapping curve is adjusted based on the adjustment point.
[0010] In one embodiment, the method further comprises:
[0011] Get the lighting scene mode;
[0012] The step of determining an adjustment point of a tone mapping curve based on the reference brightness value, the target brightness value, the first brightness endpoint value, and the second brightness endpoint value comprises:
[0013] determining an adjustment logic based on the lighting scene mode;
[0014] The reference brightness value, the target brightness value, the first brightness endpoint value, and the second brightness endpoint value are processed based on the adjustment logic to obtain an adjustment point of a tone mapping curve.
[0015] In one embodiment, the processing the reference brightness value, the target brightness value, the first brightness endpoint value, and the second brightness endpoint value based on the adjustment logic to obtain an adjustment point of a tone mapping curve includes:
[0016] When the illumination scene mode is the first illumination scene mode and the target brightness value satisfies the brightness condition obtained based on the first brightness endpoint value, it is determined that the adjustment points of the tone mapping curve include (0,0), (hist l ,level l ),(target final ,min(0.18,target ideal )),(hist h ,level h ),(1,1), where hist l is the first brightness endpoint value, target final is the target brightness value, target ideal is the reference brightness value, hist h is the second brightness endpoint value, level l and level h is a preset constant, and min is the minimum value; the first value of each point pair is the horizontal coordinate of the original point in the tone mapping curve, and the second value is the horizontal coordinate of the reference point in the tone mapping curve, and the vertical coordinate of the original point is adjusted to the vertical coordinate of the reference point;
[0017] When the illumination scene mode is the first illumination scene mode and the target brightness value does not satisfy the brightness condition obtained based on the first brightness endpoint value, it is determined that the adjustment points of the tone mapping curve include (0,0), (target final ,min(0.18,targetideal )),(hist h ,level h ),(1,1);
[0018] When the illumination scene mode is the second illumination scene mode, it is determined that the adjustment points of the tone mapping curve include (0,0), (hist l ,level l ),(0.5*target final ,max(0.10,0.5*target final )),(target final ,max(target final ,0.18)),(1.5*target final ,max(1.5*
[0019] target final ,0.28)),(hist h ,level h ),(1,1); where max is the maximum value;
[0020] The light brightness corresponding to the first lighting scene mode is greater than the light brightness corresponding to the second lighting scene mode.
[0021] In a second aspect, the present application further provides an exposure method, the method comprising:
[0022] Obtaining the brightness value of each sub-block of the image to be processed, and calculating the weighted image average brightness corresponding to the image to be processed based on the brightness value of each sub-block;
[0023] Obtaining a basic brightness value based on the brightness value of each sub-block and an exposure parameter;
[0024] Determining a lighting scene based on the brightness value of each of the sub-blocks;
[0025] Obtaining a reference brightness value based on the basic brightness value, the weighted image average brightness and the illumination scene, and obtaining a target brightness value based on the reference brightness value;
[0026] Obtaining a camera gain adjustment value based on the weighted image average brightness and the target brightness value;
[0027] Exposure is performed based on the camera gain adjustment value.
[0028] In one embodiment, obtaining a basic brightness value based on the brightness value of each sub-block and an exposure parameter includes:
[0029] Calculating a global average brightness based on the brightness values of each of the sub-blocks;
[0030] Obtaining scene illumination based on the global average brightness and exposure parameters of the camera;
[0031] A base brightness value corresponding to the scene illumination is determined.
[0032] In one of the embodiments, determining the lighting scene based on the brightness value of each of the sub-blocks includes:
[0033] Dividing the image to be processed into initial regions according to a preset division method, and calculating the brightness mean of each initial region based on the brightness value of the sub-block;
[0034] Grouping the initial regions to obtain a foreground region and a background region, and obtaining a first mean difference between the foreground region and the background region based on a brightness mean of each initial region;
[0035] Select a target area from each initial area included in the background area, and calculate a second mean difference between the target area and the global average brightness;
[0036] Obtaining a scene parameter value based on the first mean difference and the second mean difference;
[0037] When the scene parameter value is less than or equal to the target value, the illumination scene is determined to be a front-lit scene; and when the scene parameter value is greater than the target value, the illumination scene is determined to be a back-lit scene.
[0038] In one of the embodiments, obtaining a reference brightness value based on the basic brightness value and the illumination scene, and obtaining a target brightness value based on the weighted image average brightness and the reference brightness value, includes:
[0039] Acquire global histogram statistical information corresponding to the image to be processed, and determine a cumulative histogram based on the global histogram statistical information;
[0040] Determine average brightness values corresponding to pixels in each preset range based on the cumulative histogram;
[0041] A first adjustment coefficient is obtained based on the scene parameter value, a second adjustment coefficient is obtained based on the average brightness values corresponding to the pixels in each preset range and the global average brightness, and a third adjustment coefficient is obtained based on the average brightness values corresponding to the pixels in the first target preset range and the global average brightness;
[0042] When the illumination scene is a front-lit scene, obtaining a reference brightness value based on the first adjustment coefficient, the second adjustment coefficient, and the basic brightness value;
[0043] When the illumination scene is a backlight scene, obtaining a reference brightness value based on the first adjustment coefficient, the third adjustment coefficient and the basic brightness value;
[0044] A target brightness value is obtained based on the reference brightness value, the weighted image average brightness and the average brightness value corresponding to pixels in a second target preset range.
[0045] In one embodiment, obtaining the target brightness value based on the reference brightness value, the weighted image average brightness, and the average brightness value corresponding to the pixels in the second target preset range includes:
[0046] Obtaining a pixel quantity restriction condition based on an average brightness value corresponding to pixels in a second target preset range;
[0047] A target brightness value is obtained based on the pixel quantity restriction condition, the weighted image average brightness and the reference brightness value.
[0048] In one embodiment, obtaining the camera gain adjustment value based on the weighted image average brightness and the target brightness value includes:
[0049] The ratio of the target brightness value to the weighted image average brightness is used as a camera gain adjustment value.
[0050] In a third aspect, the present application further provides a tone mapping curve adjustment device, the device comprising:
[0051] A brightness range determination module, configured to determine a brightness range based on a cumulative histogram corresponding to the image to be processed, wherein the brightness range includes a first brightness endpoint value and a second brightness endpoint value;
[0052] A target brightness value determination module, used to obtain a reference brightness value during the exposure process of the image to be processed and a target brightness value obtained by adjusting the reference brightness value based on a histogram restriction condition;
[0053] an adjustment point determination module, configured to determine an adjustment point of a tone mapping curve based on the reference brightness value, the target brightness value, the first brightness endpoint value, and the second brightness endpoint value, wherein the adjustment point comprises a point position at which the target brightness value is moved toward the reference brightness value;
[0054] An adjustment module is used to adjust the tone mapping curve based on the adjustment point.
[0055] In a fourth aspect, the present application further provides an exposure device, comprising:
[0056] A weighted image average brightness determination module, used to obtain the brightness value of each sub-block of the image to be processed, and calculate the weighted image average brightness corresponding to the image to be processed based on the brightness value of each sub-block;
[0057] A basic brightness value determination module, used to obtain a basic brightness value based on the brightness value of each sub-block and an exposure parameter;
[0058] A lighting scene determination module, used to determine the lighting scene based on the brightness value of each sub-block;
[0059] A target brightness value generating module, used to obtain a reference brightness value based on the basic brightness value and the illumination scene, and to obtain a target brightness value based on the weighted image average brightness and the reference brightness value;
[0060] A camera gain adjustment value determination module, configured to obtain a camera gain adjustment value based on the weighted image average brightness and the target brightness value;
[0061] An exposure module is used to perform exposure based on the camera gain adjustment value.
[0062] In a fifth aspect, the present application further provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method in any one of the above-mentioned embodiments when executing the computer program.
[0063] In a sixth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method in any one of the above-mentioned embodiments.
[0064] In a seventh aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the method in any one of the above-mentioned embodiments when executed by a processor.
[0065] The above-mentioned tone mapping curve adjustment method, exposure method, device, computer equipment, computer-readable storage medium and computer program product first determine the brightness range, and obtain the reference brightness value of the image to be processed during the exposure process and the target brightness value obtained by adjusting the reference brightness value based on the histogram constraint condition. In this way, based on the reference brightness value and the target brightness value in the automatic exposure process as well as the first brightness endpoint value and the second brightness endpoint value, the adjustment point of the tone mapping curve is determined, and the information of automatic exposure can be introduced into the tone mapping curve to improve the adjustment of the tone mapping curve. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0067] Figure 1 is a schematic flow chart of a tone mapping curve adjustment method in one embodiment;
[0068] Figure 2 A schematic diagram of a flow chart of an adjustment point generation step in one embodiment;
[0069] Figure 3 ] is a curve schematic diagram after the tone-mapping curve and the gamma2.2 curve are merged in one embodiment;
[0070] Figure 4 This is a diagram showing the result of AE+tone-mapping and gamma joint adjustment in a normal (first) lighting scene mode in an embodiment;
[0071] Figure 5 This is a diagram showing the result of AE+tone-mapping and gamma joint adjustment in a low (second) light monitoring scene mode in an embodiment;
[0072] Figure 6 is a schematic flow chart of an exposure method in one embodiment;
[0073] Figure 7 is a schematic diagram of dividing an image to be processed into blocks in one embodiment;
[0074] Figure 8 A schematic diagram of a preset division method in an embodiment;
[0075] Fig. 9 is a flow chart of an automatic exposure and tone-mapping curve joint adjustment algorithm based on scene illumination information in one embodiment;
[0076] Fig.10 is a structural block diagram of a tone mapping curve adjustment device in one embodiment;
[0077] Fig.11 is a structural block diagram of an exposure device in one embodiment;
[0078] Fig.12 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0079] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with 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.
[0080] In one embodiment, Figure 1 As shown, a tone mapping curve adjustment method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server.
[0081] In this embodiment, the method includes the following steps:
[0082] S102: Determine a brightness range based on a cumulative histogram corresponding to the image to be processed, where the brightness range includes a first brightness endpoint value and a second brightness endpoint value.
[0083] The cumulative histogram corresponding to the image to be processed can be obtained based on the global histogram of the image to be processed. The cumulative histogram has grayscale as the horizontal axis and the frequency of each grayscale as the vertical axis. The cumulative histogram represents the cumulative probability distribution of the components of the image to be processed in grayscale, and each probability value represents the probability of being less than or equal to this grayscale value.
[0084] The brightness range is pre-set, and the first brightness endpoint value and the second brightness endpoint value can be the lower 1% image brightness mean and the upper 95% image brightness value in the cumulative histogram, respectively. In other embodiments, the first brightness endpoint value and the second brightness endpoint value can also take other ranges, and it is only necessary to ensure that the second brightness endpoint value is greater than the first brightness endpoint value.
[0085] S104: Acquire a reference brightness value of the image to be processed during exposure and a target brightness value obtained by adjusting the reference brightness value based on a histogram restriction condition.
[0086] Among them, in the automatic exposure algorithm, the ideal reference brightness value target for image adjustment is obtained according to the illumination information of the scene. ideal However, in order to limit the number of pixels that are too bright or too dark, most scenes use a histogram to limit the overall exposure. This will result in the AE algorithm being unable to reach the ideal reference brightness value target after adjusting the camera gain. ideal , but can only reach the target brightness value target obtained after the histogram brightness limit final .
[0087] The tone-mapping module presets a fixed tone-mapping curve, which can map the normalized high dynamic range image data to the low dynamic range, perform gamma correction, and finally output the corresponding color to the display. Therefore, it is necessary to use the ideal reference brightness value target in the automatic exposure stage. ideal And the target brightness value target after histogram limitation final to fine-tune the preset tone-mapping curve.
[0088] S106: Determine an adjustment point of the tone mapping curve based on the reference brightness value, the target brightness value, the first brightness endpoint value, and the second brightness endpoint value, wherein the adjustment point includes a point position where the target brightness value is moved toward the reference brightness value.
[0089] Among them, the present application can determine the horizontal coordinates of the two points to be adjusted based on the first brightness endpoint value and the second brightness endpoint value. For example, the first brightness endpoint value and the second brightness endpoint value are respectively recorded as minLw and highLw, and then the hist is calculated by these two values. l and hist h The specific formula is as follows:
[0090] level l =0.015
[0091] hist l =max(level l ,min(minLw,level l +0.0076))
[0092] level h =0.95
[0093] hist h =min(level h ,max(highLw,level h -0.0305))
[0094] Among them, hist l and hist h are the horizontal coordinates of the two points to be adjusted, level l and level h is the horizontal coordinate of the target point corresponding to the two points to be adjusted, wherein in the present application, the vertical coordinate of the point to be adjusted is adjusted to the vertical coordinate of the target point.
[0095] S108: Adjusting the tone mapping curve based on the adjustment point.
[0096] The adjustment point is the point where the tone mapping curve needs to be adjusted, which includes the point where the target brightness value is moved toward the reference brightness value, so as to compensate for the situation where the pixels in the target brightness area are too bright or too dark due to the histogram limitation.
[0097] After the adjustment point is determined, the tone mapping curve is adjusted based on the adjustment point, thereby adjusting the tone of the image to be processed.
[0098] The above-mentioned tone mapping curve adjustment method first determines the brightness range, and obtains the reference brightness value during the exposure process of the image to be processed and the target brightness value obtained by adjusting the reference brightness value based on the histogram restriction condition. In this way, the adjustment point of the tone mapping curve is determined based on the reference brightness value and the target brightness value during the automatic exposure process as well as the first brightness endpoint value and the second brightness endpoint value. The automatic exposure information can be introduced into the tone mapping curve to improve the tone mapping curve adjustment.
[0099] In one of the optional embodiments, the method also includes: obtaining a lighting scene mode; thereby determining an adjustment point of a tone mapping curve based on a reference brightness value, a target brightness value, a first brightness endpoint value, and a second brightness endpoint value, including: determining an adjustment logic based on the lighting scene mode; and processing the reference brightness value, the target brightness value, the first brightness endpoint value, and the second brightness endpoint value based on the adjustment logic to obtain an adjustment point of the tone mapping curve.
[0100] Among them, the tone-mapping module has two modes, a first lighting scene mode and a second lighting scene mode, wherein the light brightness corresponding to the first lighting scene mode is greater than the light brightness corresponding to the second lighting scene mode. For example, the first lighting scene mode is a normal lighting scene mode, and the second lighting scene mode is a low-light monitoring scene mode.
[0101] Different lighting scene modes correspond to different adjustment points. In this application, the generation method of the adjustment point is determined based on the adjustment point, the lighting scene mode and the corresponding adjustment logic. Figure 2 As shown, the target brightness value and the reference brightness value are first obtained from the automatic exposure process, and then the adjustment point corresponding to the tone mapping curve is determined based on the lighting scene mode (normal (first) lighting scene mode and low (second) lighting scene mode), and then the tone curve is adjusted, so that it can automatically adapt to different lighting scene modes to improve the accuracy of adjustment point generation.
[0102] In the above embodiment, a tone-mapping curve adjustment scheme for the normal light scene mode and the low light monitoring scene mode is proposed, so that it can better adapt to the requirements of different scenes.
[0103] In one of the optional embodiments, the reference brightness value, the target brightness value, the first brightness endpoint value and the second brightness endpoint value are processed based on the adjustment logic to obtain the adjustment point of the tone mapping curve, including: when the illumination scene mode is the first illumination scene mode and the target brightness value satisfies the brightness condition obtained based on the first brightness endpoint value, determining that the adjustment points of the tone mapping curve include (0,0), (hist l ,level l ),(target final ,min(0.18,target ideal )),(hist h ,level h ),(1,1), where hist l is the first brightness endpoint value, target final is the target brightness value, target ideal is the reference brightness value, hist h is the second brightness endpoint value, level l and level h is a preset constant, and min is the minimum value; the first value of each point pair is the horizontal coordinate of the original point in the tone mapping curve, and the second value is the horizontal coordinate of the reference point in the tone mapping curve, and the vertical coordinate of the original point is adjusted to the vertical coordinate of the reference point; when the illumination scene mode is the first illumination scene mode, and the target brightness value does not meet the brightness condition obtained based on the first brightness endpoint value, it is determined that the adjustment points of the tone mapping curve include (0,0), (target final ,min(0.18,target ideal )),(hist h ,level h ),(1,1);
[0104] When the illumination scene mode is the second illumination scene mode, it is determined that the adjustment points of the tone mapping curve include (0,0), (hist l ,level l ),(0.5*target final ,max(0.10,0.5*target final )),(target final ,max(target final ,0.18)),(1.5*target final ,max(1.5*
[0105] target final ,0.28)),(hist h ,levelh ),(1,1); where max is the maximum value; the light brightness corresponding to the first lighting scene mode is greater than the light brightness corresponding to the second lighting scene mode.
[0106] The brightness condition obtained based on the first brightness endpoint value can be hist l +0.1. In other embodiments, the brightness condition may also be other values, which are not specifically limited here.
[0107] Among them, in the first lighting scene mode, such as the normal lighting scene mode, the present application mainly performs the following judgments:
[0108] If the target brightness value target final Less than hist l +0.1, then the preset tone-mapping curve adjustment point is [(0,0), (hist l ,level l ),(target final ,min(0.18,target ideal )),(hist h ,level h ),(1,1)]. The first value in each point pair is the horizontal coordinate point a in the original tone-mapping curve, and the second value is the corresponding adjusted target horizontal coordinate point b, so that the vertical coordinate value corresponding to point a after adjustment is equal to the vertical coordinate value corresponding to point b, thereby achieving the effect of smooth movement of the target curve.
[0109] Adjust the target final ,min(0.18,target ideal )) is used to set the target brightness value target final Towards the ideal target brightness target ideal The target brightness area is moved to compensate for the bright or dark pixels in the target brightness area caused by the histogram limitation. At the same time, a limit of 0.18 is added to the target point to prevent the image from being over-brightened, which will cause the overall image to be white.
[0110] If the target brightness value target final Greater than hist l +0.1, then the preset tone-mapping curve adjustment point is [(0,0), (target final ,min(0.18,target ideal )),(hist h ,level h ),(1,1)]. Remove the adjustment point (hist l,level l ) to prevent pixel value inversion during the adjustment process.
[0111] In the second lighting scene mode, such as the low-light monitoring scene mode, the present application makes the following judgment:
[0112] In low-light monitoring scenarios, the purpose is to clearly reflect the details of the target area, so the adjustment points of the tone-mapping curve are as follows: [(0,0), (hist l ,level l ),(0.5*target final ,max(0.10,0.5*target final )),(target final ,max(target final ,0.18)),(1.5*target final ,max(1.5*target final ,0.28)),(hist h ,level h ),(1,1)]. The pixel values near the target brightness value are stretched to the flat linear region of the tone-mapping curve, thereby ensuring the details near the target brightness region.
[0113] like Figure 3 As shown, in order to facilitate the display of the low-brightness area pixel mapping relationship, Figure 3 The curve after the tone-mapping curve and the gamma2.2 curve are combined is shown in Figure 2. Figure 3 The hollow dots represent the preset fusion curves. The solid line represents the tone-mapping and gamma2.2 fusion curves obtained by this patent in the normal lighting scene mode, and the dotted line represents the tone-mapping and gamma2.2 fusion curves obtained by this application in the low-light monitoring scene mode.
[0114] Solid dots represent targets final point, in this example the target brightness value target final = reference brightness value target ideal After AE and tone-mapping are combined, the curve in normal lighting scene mode is almost the same as the preset curve. In low-light monitoring scene mode, target final The corresponding ordinate value is equal to Figure 3 The vertical coordinate value corresponding to the star icon (abscissa 0.18). The adjusted curve is at the target brightness value target finalThe brightness value near the point increases and the pixel mapping range increases, making the details of the dark area of the corresponding image clearer. Figure 4 and Figure 5 As shown, in low-light monitoring scene mode, Figure 5 There is more detail in the mid-dark areas.
[0115] In the above embodiment, a tone-mapping curve adjustment scheme for the normal light scene mode and the low light monitoring scene mode is proposed, so that it can better adapt to the requirements of different scenes.
[0116] In one embodiment, Figure 6 As shown, an exposure method is provided. This embodiment takes the method applied to a terminal as an example. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0117] S602: Obtain the brightness value of each sub-block of the image to be processed, and calculate the weighted image average brightness corresponding to the image to be processed based on the brightness value of each sub-block.
[0118] Combination Figure 7 As shown, the image is divided into N sub-blocks, where Figure 7 The number of sub-blocks is for reference only, and in other embodiments, the number of sub-blocks may be other, which is not specifically limited here. The brightness value of each sub-block may be obtained by a hardware statistics module.
[0119] The weighted average image brightness is a parameter used to describe the overall brightness of an image. It takes into account the weights of different brightness areas in the image. The weighted average image brightness in this application can be calculated as follows:
[0120]
[0121] where w i , w j Represents the weights of the image blocks in the shadow area and non-shadow area respectively. i and Y j Respectively represent the average brightness of the shadow area and non-shadow area image blocks (normalized to 0-1). The shadow area is located in the center of the image and has a higher weight. Here we set w i =0.65,w j =0.35. In other embodiments, the weight may also be set to other values.
[0122] S604: Obtain a basic brightness value based on the brightness value of each sub-block and the exposure parameter.
[0123] Exposure parameters include exposure time, ISO (the sensitivity of the CCD or CMOS photosensitive element) and aperture number.
[0124] In one of the optional embodiments, a basic brightness value is obtained based on the brightness value of each sub-block and the exposure parameter, including: calculating the global average brightness based on the brightness value of each sub-block; obtaining the scene illumination based on the global average brightness and the exposure parameter of the camera; and determining the basic brightness value corresponding to the scene illumination.
[0125] The global average brightness is the average brightness of all pixels in the image to be processed. In this embodiment, for the convenience of calculation, the average brightness of each sub-block is calculated as the global average brightness.
[0126] The scene illumination Lux is calculated using the camera’s exposure parameters and the global average brightness. The specific calculation formula is as follows:
[0127] Where Kc is the camera constant, which can be obtained by calibration. t is the exposure time, s is the ISO, and fs is the aperture number.
[0128] The basic brightness value is obtained based on the mapping relationship between the scene brightness and the basic brightness value, and the intermediate value is obtained by linear interpolation. The specific mapping relationship can be as follows:
[0129] Table 1 Mapping relationship between scene illumination value and basic brightness value
[0130] log(lux) <![CDATA[target base ]]> log(30) 0.0601 log(125) 0.1011 log(300) 0.1563 log(700) 0.18 log(1000) 0.2673 log(7500) 0.3586 log(20000) 0.4647
[0131] Among them, for the intermediate value, for example, when the scene illumination is 50, it can be obtained by interpolation based on the basic brightness values corresponding to the scene illumination of 30 and the scene illumination of 125.
[0132] S606: Determine a lighting scene based on the brightness value of each sub-block.
[0133] Among them, the lighting scene is obtained based on the brightness of each sub-block globally, wherein the brightness mean of the foreground area and the background area can be calculated based on the sub-blocks included in the foreground area and the background area in the image to be processed, and then the lighting scene is determined based on the brightness mean of the foreground area and the background area.
[0134] In some optional embodiments, the lighting scene is determined based on the brightness value of each sub-block, including: dividing the image to be processed into initial areas according to a preset division method, and calculating the brightness mean of each initial area based on the brightness value of the sub-block; grouping each initial area to obtain a foreground area and a background area, and based on the brightness mean of each initial area, obtaining a first mean difference between the foreground area and the background area; selecting a target area from each initial area included in the background area, and calculating a second mean difference between the target area and the global average brightness; obtaining a scene parameter value based on the first mean difference and the second mean difference; when the scene parameter value is less than or equal to the target value, determining that the lighting scene is a front-lit scene, and when the scene parameter value is greater than the target value, determining that the lighting scene is a backlit scene.
[0135] Specifically, combined Figure 8 As shown, Figure 8 FIG. 1 is a schematic diagram of a preset division method in an embodiment. The image to be processed is divided into initial regions according to the preset division method. Figure 8 As shown, the image to be processed is divided into 5 initial regions, denoted as Y0~Y4. The background region consists of two parts: the region with a larger mean in region 1 or region 3 and region 0. The foreground region consists of three parts: the region with a smaller mean in region 1 or region 3 and region 2 and region 4. The mean difference between the background region and the foreground region is statistically calculated, denoted as p1. The difference between the mean of region 2 and the global average brightness is statistically calculated as p2. Finally, diff=p1-p2 is obtained. When the diff value is less than or equal to 0, it is considered to be a front-lit scene, otherwise, it is considered to be a backlit scene.
[0136] S608: Obtain a reference brightness value based on the basic brightness value, the weighted image average brightness, and the lighting scene, and obtain a target brightness value based on the reference brightness value.
[0137] The reference brightness value is the reference brightness value, that is, the optimal brightness value under the lighting scene, and the target brightness value is obtained by adjusting the reference brightness value in order to avoid the number of pixels that are too bright or too dark overall. The adjustment of the reference brightness value is based on the cumulative histogram to limit the number of pixels that are too bright or too dark overall.
[0138] The reference brightness is obtained based on the basic brightness value, the lighting scene, and the weighted image average brightness.
[0139] The reference brightness value and the target brightness value are used to determine the adjustment point during the tone mapping curve adjustment process, that is, the reference brightness value and the target brightness value are sent to the tone mapping curve adjustment module 1004 so that the tone mapping curve adjustment module 1004 determines the adjustment point based on the reference brightness value and the target brightness value.
[0140] S610: Obtain a camera gain adjustment value based on the weighted image average brightness and the target brightness value.
[0141] S612: Perform exposure based on the camera gain adjustment value.
[0142] In one optional embodiment, obtaining a camera gain adjustment value based on the weighted image average brightness and the target brightness value includes: taking a ratio of the target brightness value to the weighted image average brightness as the camera gain adjustment value.
[0143] Specifically, by comparing the final brightness target value target final and the weighted average brightness of the image to be processed Y To calculate the camera gain adjustment value delta:
[0144] delta=target final / weighted Y
[0145] Finally, the camera's automatic exposure adjustment is completed based on the obtained camera gain adjustment value delta.
[0146] In the above embodiment, on the one hand, scene illumination information is introduced into the AE module, and the judgment of front-lit scenes and backlit scenes is introduced to improve the adaptability of AE to different scenes. On the other hand, the reference brightness value and the target brightness value are sent to the tone mapping curve adjustment module 1004, so that the tone mapping curve adjustment module 1004 determines the adjustment point based on the reference brightness value and the target brightness value, thereby improving the accuracy of the tone mapping curve adjustment.
[0147] In one of the optional embodiments, a reference brightness value is obtained based on a basic brightness value and a lighting scene, and a target brightness value is obtained based on a weighted image average brightness and a reference brightness value, including: obtaining global histogram statistical information corresponding to the image to be processed, and determining a cumulative histogram based on the global histogram statistical information; determining each average brightness value corresponding to each preset range pixel based on the cumulative histogram; obtaining a first adjustment coefficient based on a scene parameter value, obtaining a second adjustment coefficient based on each average brightness value corresponding to each preset range pixel and a global average brightness, and obtaining a third adjustment coefficient based on the average brightness value corresponding to the first target preset range pixel and the global average brightness; when the lighting scene is a front-lit scene, a reference brightness value is obtained based on the first adjustment coefficient, the second adjustment coefficient and the basic brightness value; when the lighting scene is a backlit scene, a reference brightness value is obtained based on the first adjustment coefficient, the third adjustment coefficient and the basic brightness value; and the target brightness value is obtained based on the reference brightness value, the weighted image average brightness and the average brightness value corresponding to the second target preset range pixel.
[0148] The average brightness values corresponding to the pixels in each preset range may include the average brightness of the lower 10% pixels, which is recorded as low 10 , 10% to 20% lower average brightness is low 10to20 , 20% higher average brightness is recorded as high 20 , the average brightness that is 2% higher is recorded as high2, wherein for the purpose of the following description, the average brightness that is 20% higher is used as the average brightness value corresponding to the pixels in the first target preset range, and the average brightness that is 2% higher is used as the average brightness value corresponding to the pixels in the second target preset range. In other embodiments, each preset range pixel, the first target preset range pixel, and the second target preset range pixel can select other values, which are only exemplified here.
[0149] Wherein obtaining the first adjustment coefficient based on the scene parameter value may include:
[0150] gain=min(max(diff,-1),1)
[0151] Where gain is the first adjustment coefficient, min is the minimum value, and max is the maximum value.
[0152] Obtaining the second adjustment coefficient based on the average brightness values corresponding to the pixels in the preset range and the global average brightness may include:
[0153] u0 is obtained based on the average brightness of the bottom 10% pixels and the global average brightness:
[0154]
[0155] Based on the average brightness of the lower 10% to lower 20% and the global average brightness, u1 is obtained:
[0156]
[0157] The weight is obtained based on the average brightness of the lower 10% pixels and the average brightness of the lower 10% to the lower 20% pixels:
[0158] Based on u0, u1 and weight, the second adjustment coefficient is obtained:
[0159] u=weight*u1+(1-weight)*u0
[0160] The third adjustment coefficient is obtained based on the average brightness value corresponding to the pixels in the first target preset range and the global average brightness, including:
[0161]
[0162] Wherein, w is the third adjustment coefficient.
[0163] Based on different lighting scenarios, a reference brightness value can be obtained based on the first adjustment coefficient, the third adjustment coefficient and the basic brightness value. Specifically:
[0164] When the illumination scene is a front-lit scene, a reference brightness value is obtained based on the first adjustment coefficient, the second adjustment coefficient, and the basic brightness value:
[0165] target ideal =target base *(1+gain*w)
[0166] When the illumination scene is a backlight scene, a reference brightness value is obtained based on the first adjustment coefficient, the third adjustment coefficient and the basic brightness value:
[0167] target ideal =target base *(1+gain*u)
[0168] In one of the optional embodiments, a target brightness value is obtained based on a reference brightness value, a weighted image average brightness, and an average brightness value corresponding to pixels in a second target preset range, including: obtaining a pixel quantity restriction condition based on the average brightness value corresponding to pixels in the second target preset range; obtaining a target brightness value based on the pixel quantity restriction condition, the weighted image average brightness, and the reference brightness value.
[0169] For most scenes, it is necessary to limit the number of pixels that are too bright or too dark. Here, a histogram is used to limit the number of pixels. First, the cumulative histogram is used to calculate the pixel number limit condition, which includes an upper limit and a lower limit. Specifically:
[0170]
[0171] Then by upper limit delta high , lower limit delta low and weighted image average brightness weighted Y Calculate the final target brightness value target final :
[0172] target final =min(max(target ideal ,delta low *weighted Y ),delta high *weighted Y )
[0173] In the above embodiment, scene illumination information is introduced into the AE module, and front-light and back-light scene judgments are introduced to improve the adaptability of AE to different scenes.
[0174] For ease of understanding, combined Fig. 9 As shown, Fig. 9 The flowchart of the automatic exposure and tone-mapping curve joint adjustment algorithm based on scene illumination information in one embodiment is as follows: First, hardware statistical information is obtained, and the hardware statistical information may include a cumulative histogram corresponding to the image to be processed, a brightness value of each sub-block of the image to be processed, and the like.
[0175] The processing process can include multiple threads, or a single thread can be used for processing. Fig. 9 As shown, one of the threads can calculate the weighted image average brightness of the image to be processed. The specific calculation method can be found above. Another thread evaluates the scene illumination and sets the target brightness. The target brightness here refers to the reference brightness value mentioned above. The third thread determines the lighting scene and then adjusts the reference brightness based on the lighting scene to obtain the target brightness value. The camera gain is then calculated based on the weighted image average brightness and the target brightness value, so that the AE module completes the automatic exposure. In addition, the tone-mapping curve can be adjusted based on the target brightness value and the reference brightness value, and the tone-mapping module adjustment is completed.
[0176] In the above embodiment, the tone-mapping curve adjustment method based on automatic exposure information can ensure good display effects in different scenes.
[0177] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0178] Based on the same inventive concept, the embodiment of the present application also provides a tone mapping curve adjustment device and an exposure device for implementing the tone mapping curve adjustment method and exposure method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more tone mapping curve adjustment devices and exposure device embodiments provided below can refer to the limitations of the tone mapping curve adjustment method and exposure method above, and will not be repeated here.
[0179] In an exemplary embodiment, Fig.10 As shown, a tone mapping curve adjustment device is provided, comprising: a brightness range determination module 1001, a target brightness value determination module 1002, an adjustment point determination module 1003 and an adjustment module 1004, wherein:
[0180] A brightness range determination module 1001 is used to determine a brightness range based on a cumulative histogram corresponding to the image to be processed, wherein the brightness range includes a first brightness endpoint value and a second brightness endpoint value;
[0181] A target brightness value determination module 1002 is used to obtain a reference brightness value during the exposure process of the image to be processed and a target brightness value obtained by adjusting the reference brightness value based on a histogram restriction condition;
[0182] An adjustment point determination module 1003, configured to determine an adjustment point of a tone mapping curve based on the reference brightness value, the target brightness value, the first brightness endpoint value, and the second brightness endpoint value, wherein the adjustment point comprises a point position at which the target brightness value is moved toward the reference brightness value;
[0183] The adjustment module 1004 is configured to adjust the tone mapping curve based on the adjustment point.
[0184] In one of the optional embodiments, the above-mentioned adjustment point determination module 1003 is also used in the method further including: obtaining a lighting scene mode; determining an adjustment logic based on the lighting scene mode; and processing the reference brightness value, the target brightness value, the first brightness endpoint value and the second brightness endpoint value based on the adjustment logic to obtain an adjustment point of the tone mapping curve.
[0185] In one optional embodiment, the adjustment point determination module 1003 is further used to determine that the adjustment points of the tone mapping curve include (0,0), (hist l ,level l ),(target final,min(0.18,target ideal )),(hist h ,level h ),(1,1), where hist l is the first brightness endpoint value, target final is the target brightness value, target ideal is the reference brightness value, hist h is the second brightness endpoint value, level l and level h is a preset constant, and min is a minimum value; the first value of each point pair is the horizontal coordinate of the original point in the tone mapping curve, and the second value is the horizontal coordinate of the reference point in the tone mapping curve, and the vertical coordinate of the original point is adjusted to the vertical coordinate of the reference point; when the illumination scene mode is the first illumination scene mode and the target brightness value does not meet the brightness condition obtained based on the first brightness endpoint value, it is determined that the adjustment points of the tone mapping curve include (0,0), (target final ,min(0.18,target ideal )),(hist h ,level h ),(1,1); when the illumination scene mode is the second illumination scene mode, determining that the adjustment points of the tone mapping curve include (0,0),(hist l ,level l ),(0.5*target final ,max(0.10,0.5*
[0186] target final )),(target final ,max(target final ,0.18)),(1.5*target final ,max(1.5*
[0187] target final ,0.28)),(hist h ,level h ),(1,1); wherein max is the maximum value; the light brightness corresponding to the first lighting scene mode is greater than the light brightness corresponding to the second lighting scene mode.
[0188] In an exemplary embodiment, Fig.11As shown, an exposure device is provided, comprising: a weighted image average brightness determination module 1101, a basic brightness value determination module 1102, a lighting scene determination module 1103, a target brightness value generation module 1104, a camera gain adjustment value determination module 1105 and an exposure module 1106, wherein:
[0189] The weighted image average brightness determination module 1101 is used to obtain the brightness value of each sub-block of the image to be processed, and calculate the weighted image average brightness corresponding to the image to be processed based on the brightness value of each sub-block;
[0190] A basic brightness value determination module 1102, configured to obtain a basic brightness value based on the brightness value of each sub-block and an exposure parameter;
[0191] A lighting scene determination module 1103, configured to determine the lighting scene based on the brightness value of each of the sub-blocks;
[0192] A target brightness value generating module 1104 is used to obtain a reference brightness value based on the basic brightness value and the illumination scene, and to obtain a target brightness value based on the weighted image average brightness and the reference brightness value;
[0193] A camera gain adjustment value determination module 1105, configured to obtain a camera gain adjustment value based on the weighted image average brightness and the target brightness value;
[0194] The exposure module 1106 is configured to perform exposure based on the camera gain adjustment value.
[0195] In one of the optional embodiments, the basic brightness value determination module 1102 is specifically used to calculate the global average brightness based on the brightness values of each of the sub-blocks; obtain the scene illumination based on the global average brightness and the exposure parameters of the camera; and determine the basic brightness value corresponding to the scene illumination.
[0196] In one of the optional embodiments, the above-mentioned lighting scene determination module 1103 is specifically used to divide the image to be processed into initial areas according to a preset division method, and calculate the brightness mean of each initial area based on the brightness value of the sub-block; group each initial area to obtain a foreground area and a background area, and based on the brightness mean of each initial area, obtain a first mean difference between the foreground area and the background area; select a target area from each initial area included in the background area, and calculate the second mean difference between the target area and the global average brightness; obtain a scene parameter value based on the first mean difference and the second mean difference; when the scene parameter value is less than or equal to the target value, determine that the lighting scene is a front-lit scene, and when the scene parameter value is greater than the target value, determine that the lighting scene is a backlit scene.
[0197] In one of the optional embodiments, the target brightness value generation module 1104 is specifically used to obtain global histogram statistical information corresponding to the image to be processed, and determine a cumulative histogram based on the global histogram statistical information; determine each average brightness value corresponding to each preset range pixel based on the cumulative histogram; obtain a first adjustment coefficient based on the scene parameter value, obtain a second adjustment coefficient based on each average brightness value corresponding to each preset range pixel and the global average brightness, and obtain a third adjustment coefficient based on the average brightness value corresponding to the first target preset range pixel and the global average brightness; when the lighting scene is a front-lit scene, obtain a reference brightness value based on the first adjustment coefficient, the second adjustment coefficient and the basic brightness value; when the lighting scene is a backlit scene, obtain a reference brightness value based on the first adjustment coefficient, the third adjustment coefficient and the basic brightness value; obtain a target brightness value based on the reference brightness value, the weighted image average brightness and the average brightness value corresponding to the second target preset range pixel.
[0198] In one of the optional embodiments, the target brightness value generation module 1104 is specifically used to obtain a pixel quantity restriction condition based on the average brightness value corresponding to the pixels in the second target preset range; and obtain the target brightness value based on the pixel quantity restriction condition, the weighted image average brightness and the reference brightness value.
[0199] In one of the optional embodiments, the camera gain adjustment value determination module 1105 is specifically configured to use the ratio of the target brightness value to the weighted image average brightness as the camera gain adjustment value.
[0200] Each module in the above tone mapping curve adjustment device and exposure device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0201] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Fig.12As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. 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 input / output interface of the computer device is used to exchange information between the processor and an external device. 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, near field communication (NFC) or other technologies. When the computer program is executed by the processor, a tone mapping curve adjustment method and an exposure method are implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen 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, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0202] Those skilled in the art will understand that Fig.12 The structure shown in the figure 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 certain components, or have a different arrangement of components.
[0203] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0204] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0205] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0206] 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 used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0207] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and 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-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. 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), magnetic 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0208] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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, they should be considered to be within the scope of this application.
[0209] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A tone mapping curve adjustment method, characterized in that: The method comprises: Determine a brightness range based on a cumulative histogram corresponding to the image to be processed, wherein the brightness range includes a first brightness endpoint value and a second brightness endpoint value; Acquiring a reference brightness value of the image to be processed during exposure and a target brightness value obtained by adjusting the reference brightness value based on a histogram restriction condition; Determining an adjustment point of a tone mapping curve based on the reference brightness value, the target brightness value, the first brightness endpoint value, and the second brightness endpoint value, wherein the adjustment point comprises a point position at which the target brightness value is moved toward the reference brightness value; The tone mapping curve is adjusted based on the adjustment point.
2. The method according to claim 1, characterized in that The method further comprises: Get the lighting scene mode; The step of determining an adjustment point of a tone mapping curve based on the reference brightness value, the target brightness value, the first brightness endpoint value, and the second brightness endpoint value comprises: determining an adjustment logic based on the lighting scene mode; The reference brightness value, the target brightness value, the first brightness endpoint value, and the second brightness endpoint value are processed based on the adjustment logic to obtain an adjustment point of a tone mapping curve.
3. The method according to claim 2, characterized in that The step of processing the reference brightness value, the target brightness value, the first brightness endpoint value, and the second brightness endpoint value based on the adjustment logic to obtain an adjustment point of a tone mapping curve includes: When the illumination scene mode is the first illumination scene mode and the target brightness value satisfies the brightness condition obtained based on the first brightness endpoint value, it is determined that the adjustment points of the tone mapping curve include (0,0), (hist l ,level l ),(target final ,min(0.18,target ideal )),(hist h ,level h ),(1,1), where hist l is the first brightness endpoint value, target final is the target brightness value, target ideal is the reference brightness value, hist h is the second brightness endpoint value, level l and level h is a preset constant, and min is the minimum value; the first value of each point pair is the horizontal coordinate of the original point in the tone mapping curve, and the second value is the horizontal coordinate of the reference point in the tone mapping curve, and the vertical coordinate of the original point is adjusted to the vertical coordinate of the reference point; When the illumination scene mode is the first illumination scene mode and the target brightness value does not satisfy the brightness condition obtained based on the first brightness endpoint value, it is determined that the adjustment points of the tone mapping curve include (0,0), (target final ,min(0.18,target ideal )),(hist h ,level h ),(1,1); When the illumination scene mode is the second illumination scene mode, it is determined that the adjustment points of the tone mapping curve include (0,0), (hist l ,level l ),(0.5*target final ,max(0.10,0.5*target final )),(target final ,max(target final ,0.18)),(1.5*target final ,max(1.5* target final ,0.28)),(hist h ,level h ),(1,1); where max is the maximum value; The light brightness corresponding to the first lighting scene mode is greater than the light brightness corresponding to the second lighting scene mode.
4. An exposure method, characterized in that: The method comprises: Obtaining the brightness value of each sub-block of the image to be processed, and calculating the weighted image average brightness corresponding to the image to be processed based on the brightness value of each sub-block; Obtaining a basic brightness value based on the brightness value of each sub-block and an exposure parameter; Determining a lighting scene based on the brightness value of each of the sub-blocks; Obtaining a reference brightness value based on the basic brightness value, the weighted image average brightness and the illumination scene, and obtaining a target brightness value based on the reference brightness value; Obtaining a camera gain adjustment value based on the weighted image average brightness and the target brightness value; Exposure is performed based on the camera gain adjustment value.
5. The method according to claim 4, characterized in that The obtaining of a basic brightness value based on the brightness value of each sub-block and an exposure parameter includes: Calculating a global average brightness based on the brightness values of each of the sub-blocks; Obtaining scene illumination based on the global average brightness and exposure parameters of the camera; A base brightness value corresponding to the scene illumination is determined.
6. The method according to claim 5, characterized in that The determining of the lighting scene based on the brightness value of each of the sub-blocks includes: Dividing the image to be processed into initial regions according to a preset division method, and calculating the brightness mean of each initial region based on the brightness value of the sub-block; Grouping the initial regions to obtain a foreground region and a background region, and obtaining a first mean difference between the foreground region and the background region based on a brightness mean of each initial region; Select a target area from each initial area included in the background area, and calculate a second mean difference between the target area and the global average brightness; Obtaining a scene parameter value based on the first mean difference and the second mean difference; When the scene parameter value is less than or equal to the target value, the illumination scene is determined to be a front-lit scene; and when the scene parameter value is greater than the target value, the illumination scene is determined to be a back-lit scene.
7. The method according to claim 6, characterized in that The obtaining of a reference brightness value based on the basic brightness value and the illumination scene, and obtaining a target brightness value based on the weighted image average brightness and the reference brightness value, includes: Acquire global histogram statistical information corresponding to the image to be processed, and determine a cumulative histogram based on the global histogram statistical information; Determine average brightness values corresponding to pixels in each preset range based on the cumulative histogram; A first adjustment coefficient is obtained based on the scene parameter value, a second adjustment coefficient is obtained based on the average brightness values corresponding to the pixels in each preset range and the global average brightness, and a third adjustment coefficient is obtained based on the average brightness values corresponding to the pixels in the first target preset range and the global average brightness; When the illumination scene is a front-lit scene, obtaining a reference brightness value based on the first adjustment coefficient, the second adjustment coefficient, and the basic brightness value; When the illumination scene is a backlight scene, obtaining a reference brightness value based on the first adjustment coefficient, the third adjustment coefficient and the basic brightness value; A target brightness value is obtained based on the reference brightness value, the weighted image average brightness and the average brightness value corresponding to pixels in a second target preset range.
8. The method according to claim 7, characterized in that The step of obtaining a target brightness value based on the reference brightness value, the weighted image average brightness, and an average brightness value corresponding to pixels in a second target preset range includes: Obtaining a pixel quantity restriction condition based on an average brightness value corresponding to pixels in a second target preset range; A target brightness value is obtained based on the pixel quantity restriction condition, the weighted image average brightness and the reference brightness value.
9. The method according to claim 8, characterized in that The obtaining a camera gain adjustment value based on the weighted image average brightness and the target brightness value includes: The ratio of the target brightness value to the weighted image average brightness is used as a camera gain adjustment value.
10. A tone mapping curve adjustment device, characterized in that: The device comprises: A brightness range determination module, configured to determine a brightness range based on a cumulative histogram corresponding to the image to be processed, wherein the brightness range includes a first brightness endpoint value and a second brightness endpoint value; A target brightness value determination module, used to obtain a reference brightness value during the exposure process of the image to be processed and a target brightness value obtained by adjusting the reference brightness value based on a histogram restriction condition; an adjustment point determination module, configured to determine an adjustment point of a tone mapping curve based on the reference brightness value, the target brightness value, the first brightness endpoint value, and the second brightness endpoint value, wherein the adjustment point comprises a point position at which the target brightness value is moved toward the reference brightness value; An adjustment module is used to adjust the tone mapping curve based on the adjustment point.
11. An exposure device, characterized in that: The device comprises: A weighted image average brightness determination module, used to obtain the brightness value of each sub-block of the image to be processed, and calculate the weighted image average brightness corresponding to the image to be processed based on the brightness value of each sub-block; A basic brightness value determination module, used to obtain a basic brightness value based on the brightness value of each sub-block and an exposure parameter; A lighting scene determination module, used to determine the lighting scene based on the brightness value of each sub-block; a target brightness value generating module, configured to obtain a reference brightness value based on the basic brightness value and the illumination scene, and to obtain a target brightness value based on the weighted image average brightness and the reference brightness value; A camera gain adjustment value determination module, configured to obtain a camera gain adjustment value based on the weighted image average brightness and the target brightness value; An exposure module is used to perform exposure based on the camera gain adjustment value.
12. A computer device comprising a memory and a processor, wherein the memory stores 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 to 9 are implemented.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.
14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.