Image processing method and device, electronic equipment, chip and medium
By performing histogram statistics and compression curve adjustments on the video sequence frame by frame, the problem of HDR constant compression ratio between different devices is solved, and better dynamic range compression and visual effects are achieved.
Patent Information
- Application Number
- CN202310233192.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-10
- Publication Date
- 2024-09-10
AI Technical Summary
In existing high dynamic range imaging processing technology, a constant compression ratio leads to differences in HDR between different display devices, and the dynamic compression effect is not ideal, resulting in poor visual perception.
By performing histogram statistics on the video sequence frame by frame, the overall compression ratio and brightness intermediate information of each frame of image are obtained, and the shape of the compression curve is adjusted to achieve adaptive dynamic range compression and ensure that each frame of image better displays highlights. with dark area details.
It achieves adaptive dynamic range compression between different display devices, improves the visual appearance and coding efficiency of HDR, and reduces the transmission loss of dynamic range.
Smart Images

Figure CN118632035A
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of digital image processing, and in particular to an image processing method, device, electronic device, chip and medium. Background Art
[0002] With the development of technology, people have higher and higher requirements for image quality. High dynamic range imaging (HDR) has become one of the most concerned developments in our viewing experience. True HDR combines high resolution (usually 4K+8K), high dynamic range and wide color gamut (Rec2020). In order to enhance the viewing experience, various display devices focus on improving the ability to represent brightness and color range, especially highlight details and dark details, thereby improving the sense of reality.
[0003] However, the compression ratio of high dynamic range imaging processing in the prior art is constant, resulting in large differences in HDR between different display devices, unsatisfactory dynamic compression effects, and poor visual perception. Summary of the invention
[0004] The present disclosure provides an image processing method, device, electronic device, chip and medium to solve the problems in the related art and realize adaptive adjustment of the compression curve shape according to each frame image in a video sequence, so as to better transmit the dynamic range information of the entire image and ensure that each frame image can better display the highlight and dark area detail information.
[0005] The first aspect of the present disclosure proposes an image processing method, which includes: performing histogram statistics on an input video sequence frame by frame to obtain statistical information; obtaining a compression curve based on the overall compression ratio and intermediate brightness information of each frame image in the video sequence obtained using the statistical information; and adjusting the shape of the compression curve according to the overall compression ratio and the intermediate brightness information to perform dynamic range compression on each frame image in the video sequence.
[0006] In some embodiments of the present disclosure, the statistical information includes statistical information of linear RGB values and reference brightness information, and histogram statistics are performed on the input video sequence frame by frame to obtain the statistical information including: smoothing the histogram of each frame image in the video sequence to determine the RGB maximum value of each pixel point in each frame image in the video sequence and the brightness of the non-linear domain; transferring the RGB maximum value of each pixel point and the brightness of the non-linear domain into the linear region, performing cumulative histogram calculation, and obtaining the statistical information of the linear RGB values and reference brightness information of each frame image in the video sequence.
[0007] In some embodiments of the present disclosure, based on the overall compression ratio of each frame image in the video sequence obtained by using statistical information, obtaining a compression curve includes: calculating the overall compression ratio of each frame image in the video sequence based on reference brightness information and preset target brightness; obtaining control points of the compression curve of each frame image in the video sequence according to the overall compression ratio, statistical information of linear RGB values, intermediate brightness information and reference brightness information; and establishing a compression curve for each frame image in the video sequence according to the control points.
[0008] In some embodiments of the present disclosure, the control points include boundary points, a first control point, a second control point and at least one third control point. According to the overall compression ratio, statistical information of linear RGB values, intermediate brightness information and reference brightness information, obtaining the control points of the compression curve of each frame image in the video sequence includes: determining the intermediate brightness information of each frame image in the video sequence according to the statistical information of the linear RGB values of each frame image in the video sequence; determining the boundary points of the compression curve of each frame image in the video sequence and the control areas of the boundary points according to the intermediate brightness information and the overall compression ratio; determining the first control points of each frame image in the video sequence according to the boundary points, the control areas of the boundary points and the preset adjustment values; and interpolating the second control points and at least one third control point of each frame image in the video sequence based on the boundary points, the intermediate brightness information, the overall compression ratio and the preset threshold range.
[0009] In some embodiments of the present disclosure, adjusting the shape of the compression curve according to the overall compression ratio and the intermediate brightness information to perform dynamic range compression on each frame image of the video sequence includes: adjusting the first control point, the second control point and at least one third control point according to the overall compression ratio and the intermediate brightness information of each frame image in the video sequence; determining the shape of the compression curve of each frame image in the video sequence according to the adjusted first control point, the second control point and the at least one third control point to perform dynamic range compression on each frame image in the video sequence.
[0010] In some embodiments of the present disclosure, adjusting the first control point according to the overall compression ratio and intermediate brightness information of each frame image in the video sequence includes: determining the adjustment ratio of the first control point of each frame image in the video sequence according to the boundary point and the overall compression ratio; adjusting the first control point according to the adjustment ratio of the first control point and the intermediate brightness information.
[0011] In some embodiments of the present disclosure, adjusting the second control point according to the overall compression ratio and intermediate brightness information of each frame image in the video sequence includes: calculating the interpolation ratio of the second control point of each frame image in the video sequence according to the overall compression ratio of each frame image in the video sequence; determining the adjustment ratio of the second control point of each frame image in the video sequence according to the boundary point, the interpolation ratio of the second control point, and the overall compression ratio; and adjusting the second control point according to the adjustment ratio of the second control point and the intermediate brightness information.
[0012] In some embodiments of the present disclosure, adjusting at least one third control point according to the overall compression ratio and intermediate brightness information of each frame image in the video sequence includes: calculating the interpolation ratio of at least one third control point of each frame image in the video sequence according to the overall compression ratio and intermediate brightness information of each frame image in the video sequence; and adjusting at least one third control point according to the interpolation ratio.
[0013] The second aspect of the present disclosure proposes an image processing device, which includes: a statistical unit, used to perform histogram statistics on an input video sequence frame by frame to obtain statistical information; an acquisition unit, used to obtain a compression curve based on the overall compression ratio of each frame image in the video sequence obtained using the statistical information; an adjustment unit, used to adjust the shape of the compression curve according to the overall compression ratio and intermediate brightness information, so as to perform dynamic range compression on each frame image in the video sequence.
[0014] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the first aspect embodiment of the present disclosure.
[0015] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the first aspect embodiment of the present disclosure.
[0016] The fifth aspect embodiment of the present disclosure proposes a chip, which includes one or more interface circuits and one or more processors; the interface circuit is used to receive signals from a memory of an electronic device and send signals to the processor, the signals including computer instructions stored in the memory, and when the processor executes the computer instructions, the electronic device executes the method described in the first aspect embodiment of the present disclosure.
[0017] In summary, according to the image processing method proposed in the present invention, histogram statistics are performed on the input video sequence frame by frame to obtain statistical information; based on the overall compression ratio and intermediate brightness information of each frame image in the video sequence obtained using the statistical information, a compression curve is obtained; according to the overall compression ratio and the intermediate brightness information, the shape of the compression curve is adjusted to perform dynamic range compression on each frame image in the video sequence, and the shape of the compression curve is adaptively adjusted according to each frame image in the video sequence, so as to better transmit the dynamic range information of the entire image, and ensure that each frame image can better display the highlight and dark area detail information.
[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0020] Figure 1 A flowchart of an image processing method provided by an embodiment of the present disclosure;
[0021] Figure 2 A flowchart of an image processing method provided by an embodiment of the present disclosure;
[0022] Figure 3 A schematic diagram of an interpolation result provided in an embodiment of the present disclosure;
[0023] Figure 4 A schematic diagram of a restriction of a first control point provided in an embodiment of the present disclosure;
[0024] Figure 5 A schematic diagram of a method for adjusting at least one third control point provided by an embodiment of the present disclosure;
[0025] Figure 6 A schematic diagram of upper and lower limits provided in an embodiment of the present disclosure;
[0026] Figure 7 A schematic diagram of an example of adjusting a first control point and a second control point provided in an embodiment of the present disclosure;
[0027] Figure 8 A schematic diagram of a dynamic curve application method provided by an embodiment of the present disclosure;
[0028] Fig. 9 A schematic diagram of dynamic range adjustment provided by an embodiment of the present disclosure;
[0029] Fig.10A schematic diagram of a specific image processing method provided by an embodiment of the present disclosure;
[0030] Fig.11 A schematic diagram of the structure of an image processing device provided by an embodiment of the present disclosure;
[0031] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0032] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0033] As technology develops, people's requirements for image quality are getting higher and higher. Improving image resolution and increasing the frame rate of video are key features of ultra-high-definition video, but these features alone cannot make the image cover the full range of brightness information visible to the human eye. High dynamic range imaging (HDR) has become one of the most watched developments in our viewing experience. True HDR combines high resolution (usually 4K+8K), high dynamic range, and wide color gamut (Rec2020). In order to enhance the viewing experience, various display devices focus on improving the ability to represent brightness and color range, especially highlight details and shadow details, thereby improving realism.
[0034] Specifically, there are mainly two solutions in the prior art. The first solution is HDR10 static metadata dynamic range compression. The static dynamic range compression curve is in the HDR10 standard. The Blu-ray Disc Association (Blu-ray Disc Association) proposed HDR10. HDR10 uses static metadata to transmit the dynamic range mapping information of the video. The amount of information transmitted is relatively small. The main information used to calculate the dynamic range compression ratio is the highest brightness information of the frame in the entire video sequence. The highest brightness is used as the source brightness, and the real-time display brightness of the display is used as the target brightness for dynamic range compression to achieve a relatively good display on the display. The other is the HDR standard Hybrid Log-Gamma (HLG) jointly developed by BBC and NHK. HLG defines a nonlinear optical-electro transfer function (Optical-Electro Transfer Function, OETF), where the lower half of the signal value uses a gamma curve compatible with SDR, and the upper half of the signal value uses a logarithmic curve based on Weber's law. It uses the same relative brightness system as existing display devices. The display brightness is not only related to the signal level, but also to the display device. The highest level of the signal corresponds to the highest brightness of the display device. In this way, the display capability of the display device can be taken into account and the relative brightness can be transmitted, which can be displayed on any brightness display without metadata.
[0035] However, the first solution uses the highest brightness information in the video sequence as the source brightness information for dynamic range compression of the entire video sequence, which will result in the overall compression ratio of the video sequence being unable to change. In a video with drastic brightness changes, since the compression ratio is kept constant, only the brighter frames can be compressed to an ideal effect. The darker frames may become darker due to inappropriate compression ratios, giving people a bad visual experience. The second solution uses a transfer function to transmit relative brightness information, which essentially performs a linear dynamic range compression on the display end. On the one hand, the control of the dynamic range is not fine enough. On the other hand, since the encoding efficiency of HLG is lower than the transfer function PQ used in this solution, the transmission loss of the dynamic range is high.
[0036] It can be seen that in the prior art, since the absolute brightness encoded by the common HDR transfer function PQ function exceeds the range of current display capabilities, the compression ratio of high dynamic range imaging processing is constant, resulting in large differences in HDR between different display devices, unsatisfactory dynamic compression effects, and poor visual perception.
[0037] In order to solve the problems existing in the related art, the present disclosure proposes an image processing solution, which performs histogram statistics on the input video sequence frame by frame to obtain statistical information; based on the statistical information, obtains the compression curve and the overall compression ratio of each frame image in the video sequence; according to the overall compression ratio, adjusts the shape of the compression curve to perform dynamic range compression on each frame image in the video sequence, and adaptively adjusts the shape of the compression curve according to each frame image in the video sequence, thereby better transmitting the dynamic range information of the entire image, and ensuring that each frame image can better display the highlight and dark area detail information.
[0038] The method proposed in the present disclosure is mainly used in the digital image processing stage in the field of mobile phone video recording or industrial camera imaging, and is not limited in the embodiments of the present disclosure.
[0039] The image processing method provided in this application is described in detail below with reference to the accompanying drawings.
[0040] Figure 1 Flow chart of an image processing method provided by an embodiment of the present disclosure. Figure 1 As shown, the image processing method includes steps 101-103.
[0041] Step 101, performing histogram statistics on the input video sequence frame by frame to obtain statistical information.
[0042] In an embodiment of the present disclosure, histogram statistics are performed frame by frame on the input video sequence according to the size that is ultimately used for display or the size after upsampling the size with a suitable ratio. The statistical information includes linear RGB values and reference brightness information.
[0043] Histogram statistics specifically process the maximum RGB value of each pixel point in each frame of the video sequence and the brightness in the nonlinear domain, and obtain the linear RGB value and reference brightness information of each frame of the video sequence through certain statistical processing. Among them, the histogram statistics is processed based on coarse granularity, which means that the histogram in the histogram statistics Figure 1 The size span of each bin is large, that is, the coarse-grained image information is large.
[0044] Step 102: Obtain a compression curve based on the overall compression ratio and intermediate brightness information of each frame of the video sequence obtained based on the statistical information.
[0045] In the embodiment of the present disclosure, the overall compression ratio of each frame image is obtained according to the statistical information. According to the overall compression ratio and the statistical information, each control point (such as an anchor point and a knee point) is obtained, and then linear interpolation is performed in combination with the statistical information to obtain the value of each control point, thereby determining the compression curve.
[0046] Among them, the brightness intermediate information refers to the brightness information close to the center of the brightness histogram, which is usually the brightness range that the human eye pays most attention to in the entire picture. Compression curve (ToneMapping curve), ToneMapping (tone mapping) is used to map the color from the original brightness (usually high dynamic range, HDR) to the target brightness (usually low dynamic range, LDR). The mapping result is displayed through the medium, and under the action of the visual characteristics of the human eye, the effect of restoring the original scene as much as possible is achieved.
[0047] Step 103: adjusting the shape of the compression curve according to the overall compression ratio and the intermediate brightness information, so as to perform dynamic range compression on each frame of the video sequence.
[0048] In the embodiment of the present disclosure, each control point is adjusted according to the overall compression ratio and intermediate brightness information of each frame of image, and the shape of the compression curve of each frame of image is determined according to the adjusted control point to realize dynamic range compression of the video sequence. The compression ratio is obtained according to the statistical information and the preset target brightness.
[0049] In the present disclosure, the compression curve can be a combination of a straight line and a high-order Bezier curve. The Bezier curve is mainly used for mathematical curves in two-dimensional graphics applications. The curve consists of a starting point, an end point and a control point (also called an anchor point). By adjusting the control point, the shape of the Bezier curve drawn in a certain way will change.
[0050] In summary, according to the image processing method proposed in the present invention, histogram statistics are performed on the input video sequence frame by frame to obtain statistical information; based on the overall compression ratio and intermediate brightness information of each frame image in the video sequence obtained using the statistical information, a compression curve is obtained; according to the overall compression ratio and the intermediate brightness information, the shape of the compression curve is adjusted to perform dynamic range compression on each frame image in the video sequence, and the shape of the compression curve is adaptively adjusted according to each frame image in the video sequence, so as to better transmit the dynamic range information of the entire image, and ensure that each frame image can better display the highlight and dark area detail information.
[0051] based on Figure 1 The embodiment shown, Figure 2 The following further illustrates a flow chart of an image processing method proposed in the present disclosure. Figure 2 based on Figure 1 In the embodiment shown, step 102 and step 103 are further defined. Figure 2 In the embodiment shown, step 102 includes step 202, step 203 and step 204; step 103 includes step 205 and step 206. Figure 2 As shown, the method comprises the following steps:
[0052] Step 201 , performing histogram statistics on the input video sequence frame by frame to obtain statistical information, where the statistical information includes linear RGB values and reference brightness information.
[0053] In an embodiment of the present disclosure, in order to perform statistics more efficiently, statistics are performed in a nonlinear domain after gamma processing. The histogram of each frame image in the video sequence is smoothed to determine the RGB maximum value of each pixel point in each frame image in the video sequence and the brightness in the nonlinear domain; the RGB maximum value of each pixel point and the brightness in the nonlinear domain are transferred to the linear region, and the cumulative histogram is calculated to obtain the linear RGB value and reference brightness information of each frame image in the video sequence.
[0054] In an optional embodiment of the present disclosure, the statistics include the maximum value of the three channels R / G / B and the brightness Y information of each pixel.
[0055] The histogram calculated in the nonlinear domain is denoted as Figure 1 , histogram Figure 1 The horizontal axis is the 10-bit (0-1024) commonly used in HDR video encoding. The physical meaning is maxRGB, and the vertical axis is the number of pixels when maxRGB is the horizontal axis for each pixel. Figure 1 It is used to calculate the dynamic range compression curve to prevent brightness flicker between frames. In this disclosure, a sliding window between frames can be added to divide the window size according to some information of the video itself (such as LuxID, etc.), and each frame is histogrammed. Figure 1 Smoothing ensures that the histogram output frame by frame has no sudden change in brightness. After more efficient histogram smoothing, the maxRGB information is transferred to the linear region for cumulative histogram calculation. The histogram used for the final tone compression curve calculation is recorded as histogram. Figure 2 , histogram Figure 2 It is an array that only retains the linear maxRGB values when the accumulated number of pixels is 1%, 25%, 50%, 75%, 90%, 95%, and 99% of the total number of pixels and is transferred to the linear domain after inverse gamma transformation, that is, the statistical information of the maxRGB value, as well as the reference brightness information converted from the non-linear domain back to the linear domain.
[0056] Among them, the information of brightness Y is the reference brightness information of the present disclosure, and the conversion formula of the statistical brightness Y information is related to the color gamut. Taking BT.2020, which is common in HDR content, as an example, the calculation of Y is:
[0057] Y'=0.2627*R'+0.6780*G'+0.0593*B', where Y' refers to the brightness after gamma processing.
[0058] The reference brightness information includes first reference brightness information and second reference brightness information, wherein the first reference brightness information is brightness information calculated based on statistical information of the MaxRGB value, such as the brightness range of 99% of the pixels; the second reference brightness information is brightness information calculated based on brightness Y, such as the maximum value of 99.99% of the pixels within the brightness range, and the average value of the percentage of pixels below 100nit in a scene.
[0059] It should be noted that the brightness Y needs to undergo the same statistical processing as MaxRGB to obtain the second reference brightness information, that is, both need to be obtained by histogram statistical calculation.
[0060] Step 202: Calculate the overall compression ratio of each frame of the video sequence based on the reference brightness information and the preset target brightness.
[0061] In an embodiment of the present disclosure, the reference brightness information includes the highest brightness of each frame of the video source or the brightness range of each frame of the video source. To eliminate noise interference, it can be set to 95% or 99% of the brightness value in the histogram.
[0062] It should be noted that, according to different compression methods, the first reference brightness information or the second reference brightness information in the reference brightness information may be selected for reference to obtain an overall compression ratio and achieve compression of the dynamic range.
[0063] According to the maximum brightness of the current frame of the video source and the preset target brightness, the overall compression ratio of each frame in the video sequence is obtained. Among them, the preset target brightness is set according to the brightness parameter of the actual display device and is not limited in the embodiment of the present disclosure. Optionally, the reference brightness information is related to whether the statistical information of maxRGB or brightness Y is used for compression in the subsequent compression method, and is expressed as reference brightness information in the present disclosure.
[0064] Step 203, obtaining the control points of the compression curve of each frame image in the video sequence according to the overall compression ratio, the statistical information of the linear RGB values, the intermediate brightness information and the reference brightness information.
[0065] In an embodiment of the present disclosure, the control points include boundary points, a first control point, a second control point and at least one third control point. The brightness intermediate information of each frame image in the video sequence is determined based on the statistical information of the linear RGB values of each frame image in the video sequence; the boundary points of the compression curve of each frame image in the video sequence and the control areas of the boundary points are determined based on the brightness intermediate information and the overall compression ratio; the first control point of each frame image in the video sequence is determined based on the boundary points, the control areas of the boundary points and the preset adjustment values; and the second control point and at least one third control point of each frame image in the video sequence are interpolated based on the boundary points, the brightness intermediate information, the overall compression ratio and the preset threshold range.
[0066] The statistical information of the linear RGB value of each frame in the video sequence is the histogram. Figure 2 The linear RGB value in the image, the brightness middle information refers to mid-Tone, that is, the information of a part of the middle area in the image brightness. In the present disclosure, at least one third control point can be 7 third control points, which is not limited in the present disclosure.
[0067] In the present disclosure, the calculation of the boundary points (knee points) of the straight area is as follows: the calculation of the boundary points controls the range of the linear area, and the linear area maintains the compression ratio of the preset target brightness (targetLum) / reference brightness information (sourceLum), that is, it ensures that the partial contrast of the low light does not change. Therefore, the function of overall control of the range of the linear area is determined by the ordinate (ky) of the boundary points of the straight part. In the implementation, we use two values to determine the range of the ordinate (ky) of the boundary points. These two values are interpolated to obtain the result of ky, and the interpolation ratio is determined by the intermediate brightness information. On the basis of the histogram statistics, the intermediate brightness information takes the maxRGB value corresponding to 50% of the pixels in the histogram statistics. Therefore, the larger the value of the intermediate brightness information is designed, the smaller the range of the linear area controlled by the ordinate of the boundary points of the straight part, thereby reducing the area that determines the contrast.
[0068] Taking HDR as the target display brightness as an example, the original maximum brightness is the maximum brightness of 10000nit transmitted by the PQ function. When converted to the preset target brightness = 1000nit, the vertical coordinate value of the boundary point of the straight line should be maintained between [200,300]nit that the SDR display can accept. At the same time, when the reference brightness information is equal to the preset target brightness in extreme cases, the overall compression curve is guaranteed to be a straight line, that is, when the control point value of the Bezier curve is The first control point is 1024 / 10=102. According to the first-order continuity condition, the vertical coordinate of the boundary point of the straight line can be calculated as 840 / 4096 (the brightness in the middle is half of the maximum brightness of the video source, 5000nit). We choose to interpolate the two broken lines (such as Figure 3 The final interpolation point is related to the target brightness, and the interpolation ratio is negatively correlated with the brightness value of the intermediate brightness information. According to the above principle, the interpolation diagram is as follows: Figure 3 As shown, after careful design, the brightness of the dark area is guaranteed while meeting the extreme case that the target brightness is the same as the original brightness. The entire compression curve takes a straight line, and the vertical coordinates of the boundary points of the straight line part meet specific requirements.
[0069] In the present disclosure, the calculation of the first control point (anchor 1) and the second control point (anchor 2) of the curve is as follows: the slope of the linear area is determined by the ratio of the preset target brightness and the reference brightness information. This part of the brightness is linearly compressed to maintain the contrast, and the compressed curve part changes the contrast to obtain a better sensory effect. The compressed curve part is determined by a total of 9 control points, which can better determine the proportion of brightness compression in each interval. Overall, the specific position of the control point is also determined by the initially set compression ratio and the left and right ranges, but in order to ensure the smoothness of the linear and curve intersection area to avoid artifacts, the first-order derivative at the connection of the straight line and curve needs to be the same, so the value of the first control point is determined by the following control conditions,
[0070]
[0071]
[0072]
[0073] Specifically, since the values of the first control point and the second control point are roughly in the range of 10000nit to 3000nit, the brightness information after that is the key brightness information in the whole picture, so we need to compress the values of the first control point and the second control point appropriately to sacrifice the contrast of this range to enhance the contrast of the subsequent key parts of the picture. Therefore, we set a tune value to fine-tune the first control point, and at the same time, we need to ensure that the size of the first control point does not exceed the limit, and there will be no artifacts caused by the uneven transition of curves and straight lines in the case of fixed points.
[0074] Among them, the main reasons for adjusting the first control point are: to avoid the smoothness of the curve as much as possible in the fixed point case, and to meet the purpose of compressing the first section of the curve; when the boundary point value is close to 0, the constraint on the first control point is not strong enough, and outliers need to be avoided.
[0075] Since the first control point determines the first segment of the curve, which is directly connected to the straight line portion, the upper limit of the change of the first control point is determined by the value of the ordinate of the boundary point of the straight line portion. The relationship between the upper limit and the ordinate of the boundary point of the straight line portion is as follows: Figure 4 As shown, the smaller the area of the first straight line, the smaller the movable range constraint of the first control point. At the same time, it is necessary to limit the vertical coordinate of the boundary point of the straight line to 0 or close to 0 so that the first control point will not be unconstrained. The inflection point is designed to be a common SDR brightness level of 100nit. This adjustment is mainly used in scenes with large dynamic range compression. In scenes with a small dynamic range compression rate, the tune value is 1, and the first control point is not adjusted. The first control point can be determined by directly calculating the first-order smoothing conditions of the first and second curves.
[0076] In the present disclosure, the calculation of at least one third control point is specifically as follows: Figure 5 As shown, by initially setting the min and max ranges of the third control point value, and then determining the interpolation ratio of min and max according to the [T1, T2] region where the middle brightness falls, an initial control point value is determined.
[0077] It should be noted that after all the initial control points are calculated, the first control point needs to be fine-tuned in the same way as the second control point to enhance the contrast of the brightness range that is of interest to the human eye.
[0078] Step 204: Establish a compression curve for each frame of the video sequence according to the control points.
[0079] In an embodiment of the present disclosure, in an optional embodiment of the present disclosure, the dynamic range compression curve is mainly divided into two sections, one section is a linear area, which is used to maintain the absolute brightness of the dark area, and the other section is a nonlinear area, which protects or improves the contrast of the main part of the image by sacrificing the contrast of some areas, so as to achieve the compression of the overall dynamic range. The two parts are connected by a boundary point.
[0080] The process of calculating the parameters required for the compression curve is divided into three aspects:
[0081] (1) Calculation of boundary points of control points in the straight line area;
[0082] (2) Calculation of the first control point and the second control point of the compression curve;
[0083] (3) Calculation of at least one third control point (the remaining anchor points).
[0084] The general idea is that each control point (boundary point and the first control point, the second control point, and the third control point) will have two values to determine its range. The final result is calculated by the statistical information (in the medium-bright / highlight area) to calculate the ratio of the linear interpolation of these two values. After linear interpolation, the value of each control point is obtained, thereby determining the entire compression curve. The expression of the entire curve is as follows,
[0085]
[0086] Among them B N satisfy
[0087]
[0088] Among them, the boundary point is the coordinate (K x , K y ), and the first control point, the second control point, and the third control point refer to the Bezier curve B n P k .
[0089] Step 205: adjusting the control point according to the overall compression ratio and intermediate brightness information of each frame of the video sequence.
[0090] In an embodiment of the present disclosure, the adjustment ratio of the first control point of each frame image in the video sequence is determined according to the boundary point and the overall compression ratio; the first control point is adjusted according to the adjustment ratio of the first control point and the intermediate brightness information.
[0091] In an embodiment of the present disclosure, the interpolation ratio of the second control point of each frame image in the video sequence is calculated according to the overall compression ratio of each frame image in the video sequence; the adjustment ratio of the second control point of each frame image in the video sequence is determined according to the boundary point, the interpolation ratio of the second control point, and the overall compression ratio; the second control point is adjusted according to the adjustment ratio of the second control point and the intermediate brightness information.
[0092] Specifically, the compression ratio of the first control point is calculated by calculating the constraints on the first control point. First, it is necessary to determine whether the scene involves a large dynamic range compression. The basis for the judgment is based on the value of the ordinate of the boundary point of the straight line portion and the ratio of the preset target brightness to the reference brightness information. Because the value of the ordinate of the boundary point of the straight line portion satisfies the rule that the greater the brightness in the middle, the smaller the ordinate of the boundary point of the straight line portion. Therefore, when the value of the linear area is smaller, it means that 50% of the pixels in the picture are in a higher brightness range. Low_thr_limit can be set to represent the corresponding adjustment required for the first control point when the ordinate of the boundary point of the straight line portion is in the low-brightness area [50, 400] nit range. At the same time, when the preset target brightness / reference brightness information is smaller, it means that the dynamic range compression rate is greater when compressing the curve. High_thr_limit is used to represent the adjustment required when the compression rate is [2.5, 8]. Finally, the relationship between the middle brightness and the overall brightness change is combined to determine the range of low_thr_limit*high_thr_limit, and finally determine the adjustment ratio of the first control point. As Figure 6 As shown, the upper and lower limits are examples. If the linear area is large enough (the brightness value in the middle is small, and 50% of the brightness is distributed at a relatively dark brightness level), and the reference brightness value is smaller than the preset target brightness value (the compression curve needs to be compressed at a smaller ratio), then the calculated adjustment coefficient is 1, and the first control point is not adjusted. The product of high_thr_limit and low_thr_limit represents the overall compression ratio of the first control point. The compression ratio must not destroy the continuity of the curve. The overall value of the first control point is between 1 / N+1 when the Bezier curve is a straight line and the first control point limit.
[0093] Since the first control point is compressed to a certain extent, the second control point also needs to be adjusted appropriately to ensure that the contrast of the most concerned image area after the second control point is enhanced. The adjustment method is similar to that of the first control point, and the adjustment range is generally smaller than that of the first control point to ensure that the contrast between the first control point and the second control point is not sacrificed too much, such as Figure 7 In this way, the slope change between the first control point and the second control point can be appropriately adjusted and compressed, while the slope of the second control point and the subsequent connection can be enhanced, thereby improving the contrast of the intermediate brightness information.
[0094] In an embodiment of the present disclosure, the interpolation ratio of at least one third control point of each frame image in the video sequence is calculated according to the overall compression ratio of each frame image in the video sequence; and at least one third control point is adjusted according to the interpolation ratio. Specifically, in the global range [0, T], the first control point, the second control point and the third control point are adjusted according to the overall compression ratio. Since our Bezier curve is a straight line when the dynamic range is not compressed in extreme cases, we will determine the values of the initial first control point, the second control point and the third control point and the proportion of the first control point, the second control point and the third control point in the final result when the Bezier curve is distributed in a straight line according to the size of the compression ratio. When the dynamic range compression ratio is smaller, the proportion of the degree of linearity of the first control point, the second control point and the third control point is greater. At this time, the above-mentioned linear interpolation scheme is used to obtain the first control point, the second control point and the third control point. In particular, the result calculated by the second control point needs to be processed and fine-tuned in the same way as the first control point.
[0095] Step 206: Determine the shape of the compression curve of each frame image in the video sequence according to the adjusted control points, so as to perform dynamic range compression on each frame image in the video sequence.
[0096] In the embodiments of the present disclosure, Figure 8 As shown in the figure, after a small amount of control information is passed to the display end in the form of metadata, if the target display brightness set by the camera end is consistent with that of the display end, the compression curve in the metadata can be directly applied to calculate the compression ratio of each pixel, thereby adjusting the dynamic range.
[0097] In addition, in the present disclosure, if the target display brightness is different from the brightness obtained by the display terminal in real time, the display terminal can pull up or expand the curve according to the real-time brightness.
[0098] It can be understood that the dynamic range compression proposed in this solution refers to the compression of the real brightness range (unit: nit) of the source video towards the display brightness. The only parameters that need to be transmitted are the coordinates of the boundary points of the linear region and the nine control point information of the Bezier curve. Fig. 9 Shown is a schematic diagram of dynamic range adjustment, which can effectively display highlight areas that exceed the screen display capability on a specific display.
[0099] In summary, through the method provided by the present disclosure, based on the rough histogram statistical information in the video sequence, by establishing the relationship between the brightness interval and the control points of the high-order Bezier curve, the method of adaptively adjusting the shape of the compression curve according to the source brightness distribution of each frame of the video sequence, so as to adaptively compress or maintain the dynamic range of the video source with a high dynamic range, better transmit the dynamic range information of the entire video, ensure that each frame can better show the highlight and dark area detail information, and at the same time enhance the information of the middle tone to a certain extent, the performance on the high-brightness display (1000nit and above) is ideal, and the encoding efficiency is higher, and only a small amount of information is added to the video sequence to achieve the complete information transmission of the dynamic range compression curve. And the better transfer function PQ function can be applied to reduce the loss of dynamic range during encoding and transmission.
[0100] based on Figure 1 , Figure 2 The embodiment shown, as Fig.10 As shown, the present disclosure provides a schematic diagram of a specific image processing method.
[0101] In an embodiment of the present disclosure, by performing histogram statistics on the input video sequence frame by frame, the overall compression ratio is calculated according to the statistical information and the target display brightness; the control area of the boundary point in the compression curve, that is, the first part of the linear area, is determined according to the compression ratio and the intermediate brightness information. The first control point and the second control point are determined according to the information of the boundary point, the overall compression ratio, and the intermediate brightness information; and 8 initial control points are interpolated according to the first control point, the preset 8 control point threshold ranges, and the intermediate brightness information. Among them, the 8 initial control points include the second control point and at least one third control point. Then, according to the overall compression ratio, the interpolation ratio is calculated and all control points are adjusted.
[0102] It should be noted that after the second control point is interpolated by the overall compression ratio, it needs to be processed in the same way as the first control point to obtain the adjusted second control point. The adjusted control points are output, i.e., the compression curve straight line boundary points and the 9 compression curve control points, to achieve compression of the dynamic range of the entire video sequence, such as Figure 8 An exemplary method of dynamic range compression is shown, wherein the nine control points of the compression curve are a first control point, a second control point, and seven third control points.
[0103] In summary, this solution can perform dynamic range compression on the video frame by frame, and is better suitable for scenes with large brightness changes and complex flickering light sources (such as bars and other scenes). The dynamic range compression has good stability, no brightness flickering, and both high-brightness frames and low-brightness frames can better convey the creator's intentions. At the same time, the dynamic range compression curve can be fully transmitted through a very small number of parameters, with little impact on video encoding efficiency, and can adapt to videos with PQ function as the transfer function, and the loss of dynamic range transmission caused by encoding and decoding is small.
[0104] Fig.11 FIG. 1 is a schematic diagram of the structure of an image processing device 1100 provided in an embodiment of the present disclosure. Fig.11 As shown, the image processing device comprises:
[0105] The statistical unit 1110 is used to perform histogram statistics on the input video sequence frame by frame to obtain statistical information;
[0106] An acquisition unit 1120 is used to acquire a compression curve based on the overall compression ratio and intermediate brightness information of each frame of the video sequence obtained using the statistical information;
[0107] The adjustment unit 1130 is used to adjust the shape of the compression curve according to the overall compression ratio and the intermediate brightness information, so as to perform dynamic range compression on each frame image of the video sequence.
[0108] In some embodiments, the statistical unit 1110 is used to: smooth the histogram of each frame image in the video sequence, determine the RGB maximum value of each pixel point in each frame image in the video sequence and the brightness of the non-linear domain; transfer the smoothed RGB maximum value of each pixel point and the brightness of the non-linear domain into the linear region, calculate the cumulative histogram, and obtain the statistical information and reference brightness information of the linear RGB value of each frame image in the video sequence.
[0109] In some embodiments, the acquisition unit 1120 is used to: calculate the overall compression ratio of each frame image in the video sequence based on reference brightness information and preset target brightness; obtain the control points of the compression curve of each frame image in the video sequence according to the overall compression ratio, statistical information of linear RGB values, intermediate brightness information and reference brightness information; and establish the compression curve of each frame image in the video sequence according to the control points.
[0110] In some embodiments, the control points include boundary points, first control points, second control points and at least one third control point, and the acquisition unit 1120 is used to: determine the intermediate brightness information of each frame image in the video sequence based on the statistical information of the linear RGB values of each frame image in the video sequence; determine the boundary points of the compression curve of each frame image in the video sequence and the control area of the boundary points based on the intermediate brightness information and the overall compression ratio; determine the first control point of each frame image in the video sequence based on the boundary points, the control area of the boundary points and the preset adjustment value; interpolate the second control point and at least one third control point for each frame image in the video sequence based on the boundary points, the intermediate brightness information, the overall compression ratio and the preset threshold range.
[0111] In some embodiments, adjusting the shape of the compression curve according to the overall compression ratio to perform dynamic range compression on each frame image of the video sequence includes: adjusting the first control point, the second control point, and at least one third control point according to the overall compression ratio and intermediate brightness information of each frame image in the video sequence; determining the shape of the compression curve of each frame image in the video sequence according to the adjusted first control point, the second control point, and the at least one third control point to perform dynamic range compression on each frame image in the video sequence.
[0112] In some embodiments, the adjustment unit 1130 is used to: determine the adjustment ratio of the first control point of each frame image in the video sequence according to the boundary point and the overall compression ratio; and adjust the first control point according to the adjustment ratio of the first control point and the intermediate brightness information.
[0113] In some embodiments, the adjustment unit 1130 is used to: calculate the interpolation ratio of the second control point of each frame image in the video sequence according to the overall compression ratio of each frame image in the video sequence; determine the adjustment ratio of the second control point of each frame image in the video sequence according to the boundary point, the interpolation ratio of the second control point, and the overall compression ratio; adjust the second control point according to the adjustment ratio of the second control point and the intermediate brightness information.
[0114] In some embodiments, the adjustment unit 1130 is used to: calculate the interpolation ratio of at least one third control point of each frame image in the video sequence according to the overall compression ratio and intermediate brightness information of each frame image in the video sequence; and adjust at least one third control point according to the interpolation ratio.
[0115] In summary, through the image processing device, the histogram statistics of the input video sequence are performed frame by frame to obtain statistical information; based on the statistical information, the compression curve and the overall compression ratio of each frame image in the video sequence are obtained; according to the overall compression ratio, the shape of the compression curve is adjusted to perform dynamic range compression on each frame image in the video sequence, and the shape of the compression curve is adaptively adjusted according to each frame image in the video sequence, so as to better transmit the dynamic range information of the entire image and ensure that each frame image can better show the highlight and dark area detail information.
[0116] Corresponding to the methods provided in the above-mentioned embodiments, the present disclosure also provides an image processing device. Since the device provided in the embodiment of the present disclosure corresponds to the methods provided in the above-mentioned embodiments, the implementation method of the method is also applicable to the device provided in this embodiment and will not be described in detail in this embodiment.
[0117] In the embodiments provided in the present application, the methods and devices provided in the embodiments of the present application are introduced. In order to implement the functions in the methods provided in the embodiments of the present application, the electronic device may include a hardware structure and a software module, and implement the functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. A function of the functions may be executed in the form of a hardware structure, a software module, or a hardware structure plus a software module.
[0118] Fig.12 1 is a block diagram of an electronic device 500 for implementing the above-mentioned image processing method according to an exemplary embodiment. For example, the electronic device 1200 may be a mobile phone, a computer, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0119] Reference Fig.12 , the electronic device 1200 may include one or more of the following components: a processing component 1202 , a memory 1204 , a power component 1206 , a multimedia component 1208 , an audio component 1210 , an input / output (I / O) interface 1212 , a sensor component 1214 , and a communication component 1216 .
[0120] The processing component 1202 generally controls the overall operation of the electronic device 1200, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1202 may include one or more processors 1220 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 1202 may include one or more modules to facilitate the interaction between the processing component 1202 and other components. For example, the processing component 1202 may include a multimedia module to facilitate the interaction between the multimedia component 1208 and the processing component 1202.
[0121] The memory 1204 is configured to store various types of data to support operations on the electronic device 1200. Examples of such data include instructions for any application or method operating on the electronic device 1200, contact data, phone book data, messages, pictures, videos, etc. The memory 1204 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0122] The power supply component 1206 provides power to the various components of the electronic device 1200. The power supply component 1206 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 1200.
[0123] The multimedia component 1208 includes a screen that provides an output interface between the electronic device 1200 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 1208 includes a front camera and / or a rear camera. When the electronic device 1200 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0124] The audio component 1210 is configured to output and / or input audio signals. For example, the audio component 1210 includes a microphone (MIC), and when the electronic device 1200 is in an operation mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 504 or sent via the communication component 1216. In some embodiments, the audio component 1210 also includes a speaker for outputting audio signals.
[0125] I / O interface 1212 provides an interface between processing component 1202 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0126] The sensor assembly 1214 includes one or more sensors for providing various aspects of status assessment for the electronic device 1200. For example, the sensor assembly 1214 can detect the open / closed state of the electronic device 1200, the relative positioning of components, such as the display and keypad of the electronic device 1200, and the sensor assembly 1214 can also detect the position change of the electronic device 1200 or a component of the electronic device 1200, the presence or absence of user contact with the electronic device 1200, the orientation or acceleration / deceleration of the electronic device 1200, and the temperature change of the electronic device 1200. The sensor assembly 1214 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 1214 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 1214 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0127] The communication component 1216 is configured to facilitate wired or wireless communication between the electronic device 1200 and other devices. The electronic device 1200 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, 4G LTE, 5GNR (NewRadio) or a combination thereof. In an exemplary embodiment, the communication component 1216 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 1216 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0128] In an exemplary embodiment, the electronic device 1200 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0129] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 1204 including instructions, and the instructions can be executed by the processor 1220 of the electronic device 1200 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0130] An embodiment of the present disclosure further proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the image processing method described in the above embodiment of the present disclosure.
[0131] An embodiment of the present disclosure further provides a computer program product, including a computer program, which executes the image processing method described in the above embodiment of the present disclosure when a processor is used.
[0132] An embodiment of the present disclosure also proposes a chip, which includes one or more interface circuits and one or more processors; the interface circuit is used to receive signals from a memory of an electronic device and send signals to the processor, the signals include computer instructions stored in the memory, and when the processor executes the computer instructions, the electronic device executes the image processing method described in the above embodiments of the present disclosure.
[0133] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0134] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0135] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0136] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.
[0137] It should be understood that the various parts of the embodiments of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0138] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0139] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0140] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. An image processing method, It is characterized in that The method comprises: Perform histogram statistics on the input video sequence frame by frame to obtain statistical information; Obtaining a compression curve based on the overall compression ratio and intermediate brightness information of each frame of the video sequence obtained using the statistical information; The shape of the compression curve is adjusted according to the overall compression ratio and the intermediate brightness information to perform dynamic range compression on each frame image of the video sequence.
2. The method according to claim 1, It is characterized in that The statistical information includes the statistical information of the linear RGB value and the reference brightness information. The statistical information obtained by performing histogram statistics on the input video sequence frame by frame includes: Smoothing the histogram of each frame of the video sequence, and determining the RGB maximum value of each pixel point of each frame of the video sequence and the brightness of the nonlinear domain; The maximum RGB value of each pixel and the brightness in the nonlinear domain are transferred to the linear region, and a cumulative histogram is calculated to obtain the statistical information of the linear RGB value and the reference brightness information of each frame image in the video sequence.
3. The method according to claim 2, It is characterized in that The obtaining of the compression curve of each frame image in the video sequence based on the overall compression ratio and the intermediate brightness information of each frame image in the video sequence obtained by using the statistical information comprises: Calculating the overall compression ratio of each frame image in the video sequence based on the reference brightness information and the preset target brightness; Obtaining a control point of the compression curve for each frame of the video sequence according to the overall compression ratio, the statistical information of the linear RGB values, the intermediate brightness information, and the reference brightness information; The compression curve of each frame image in the video sequence is established according to the control points.
4. The method according to claim 3, It is characterized in that The control points include boundary points, first control points, second control points and at least one third control point, and the control points of the compression curve for each frame image in the video sequence are obtained according to the overall compression ratio, the statistical information of the linear RGB values, the intermediate brightness information and the reference brightness information, including: Determining intermediate brightness information of each frame of the image in the video sequence according to the statistical information of the linear RGB values of each frame of the image in the video sequence; Determining the boundary points of the compression curve of each frame image in the video sequence and the control area of the boundary points according to the intermediate brightness information and the overall compression ratio; Determining the first control point of each frame image in the video sequence according to the boundary point, the control area of the boundary point and the preset adjustment value; Based on the boundary point, the intermediate brightness information, the overall compression ratio and a preset threshold range, the second control point and the at least one third control point of each frame image in the video sequence are interpolated.
5. The method according to claim 4, It is characterized in that The step of adjusting the shape of the compression curve according to the overall compression ratio and the intermediate brightness information to perform dynamic range compression on each frame of the video sequence comprises: adjusting the first control point, the second control point and the at least one third control point according to the overall compression ratio and the intermediate brightness information of each frame of the image in the video sequence; The shape of the compression curve of each frame image in the video sequence is determined according to the adjusted first control point, the second control point and at least one third control point, so as to perform dynamic range compression on each frame image in the video sequence.
6. The method according to claim 5, It is characterized in that According to the overall compression ratio and intermediate brightness information of each frame image in the video sequence, adjusting the first control point includes: Determining, according to the boundary point and the overall compression ratio, an adjustment ratio of the first control point of each frame image in the video sequence; The first control point is adjusted according to the adjustment ratio of the first control point and the intermediate brightness information.
7. The method according to claim 5, It is characterized in that According to the overall compression ratio and intermediate brightness information of each frame image in the video sequence, adjusting the second control point comprises: Calculating the interpolation ratio of the second control point of each frame of the video sequence according to the overall compression ratio of each frame of the video sequence; Determining an adjustment ratio of the second control point of each frame image in the video sequence according to the boundary point, the interpolation ratio of the second control point, and the overall compression ratio; The second control point is adjusted according to the adjustment ratio of the second control point and the intermediate brightness information.
8. The method according to claim 5, It is characterized in that The adjusting at least one third control point according to the overall compression ratio and the intermediate brightness information of each frame of the image in the video sequence comprises: Calculating an interpolation ratio of the at least one third control point of each frame of the image in the video sequence according to the overall compression ratio of each frame of the image in the video sequence and the intermediate brightness information; The at least one third control point is adjusted according to the interpolation ratio.
9. An image processing device, It is characterized in that The device comprises: A statistical unit, used for performing histogram statistics on the input video sequence frame by frame to obtain statistical information; An acquisition unit, configured to acquire a compression curve of each frame of the video sequence based on the overall compression ratio obtained by using the statistical information; The adjustment unit is used to adjust the shape of the compression curve according to the overall compression ratio to perform dynamic range compression on each frame image of the video sequence.
10. An electronic device, It is characterized in that include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.
11. A non-transitory computer-readable storage medium storing computer instructions, It is characterized in that The computer instructions are used to cause the computer to execute the method according to any one of claims 1-8.
12. A chip, It is characterized in that It comprises one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send the signal to the processor, the signal includes a computer instruction stored in the memory, and when the processor executes the computer instruction, the electronic device executes the method described in any one of claims 1 to 8.
