Detailed Description
Embodiments of the present application will be further described below with reference to the accompanying drawings. The same or similar reference numbers in the drawings identify the same or similar elements or elements having the same or similar functionality throughout. In addition, the embodiments of the present application described below in conjunction with the accompanying drawings are exemplary and are only for the purpose of explaining the embodiments of the present application, and are not to be construed as limiting the present application.
Referring to fig. 1, an image display method according to an embodiment of the present application includes the following steps:
011: judging whether the image to be processed is an HDR image;
012: if so, performing first brightness processing on a highlight area of the HDR image to improve the brightness of the highlight area; and
013: and displaying the processed HDR image.
Referring to fig. 2, the image display apparatus 10 according to the embodiment of the present disclosure includes a determining module 11, a processing module 12, and a display module 13. The judging module 11, the processing module 12 and the display module 13 are respectively used for executing the step 011, the step 012 and the step 013. Namely, the judging module 11 is configured to judge whether the image to be processed is an HDR image; the processing module 12 is configured to, when the image to be processed is an HDR image, perform first luminance processing on a highlight area of the HDR image to improve luminance of the highlight area; the display module 13 is configured to display the processed HDR image.
Referring to fig. 3 and 4, in some embodiments, the terminal 100 further includes a display 30 and a processor 20. The processor is used for judging whether the image to be processed is an HDR image or not and carrying out first brightness processing on a highlight area of the HDR image when the image to be processed is the HDR image; the display 30 is used to display the processed HDR image. That is, step 011 and step 012 can be implemented by processor 20, and step 013 can be implemented by display 30.
Specifically, the terminal 100 includes a housing 40, a processor 20, and a display 30. The terminal 100 may be a mobile phone, a tablet computer, a display device, a notebook computer, a teller machine, a gate, a smart watch, a head-up display device, a game console, etc. As shown in fig. 3, the embodiment of the present application is described by taking the terminal 100 as an example, and it is understood that the specific form of the terminal 100 is not limited to a mobile phone. The housing 40 may also be used to mount functional modules of the terminal 100, such as a display device (i.e., the display 30), an imaging device, a power supply device, and a communication device, so that the housing 40 provides protection for the functional modules against dust, falling, water, and the like.
The image to be processed may be captured by the camera 50 of the terminal 100, or may be downloaded from the internet by the user, which is not limited herein.
After acquiring the image to be processed, the processor 20 first determines whether the image to be processed is an HDR image; the method can be specifically judged by the following steps: acquiring image parameters of an image to be processed; for example, the image parameter information of the image, such as the size of the image, the format of the image, the type of the image, etc., is generally generated at the same time when the image is generated by the camera 50, thereby facilitating the processor 20 to quickly acquire the information of the image. The processor 20 then determines whether the image to be processed is an HDR image according to the image parameters. For example, the processor 20 determines whether the image to be processed is an HDR image according to the type information of the image; or, the image format of the HDR image is different from the format of the normal image, and is generally HDR or tif, and the processor 20 may determine whether the image to be processed is the HDR image by recognizing the format of the image to be processed.
When determining that the image to be processed is an HDR image, the processor 20 first identifies a highlight region in the HDR image, where the highlight region is a region in which highlight pixels in the HDR image are distributed in a concentrated manner, and the highlight pixels are pixels greater than or equal to a predetermined pixel value, for example, the predetermined pixel value may be 220, 225, 230, 236, 240, 244, 250, 255, and the like, and when identifying the highlight region in the HDR image, the processor 20 may first identify a highlight pixel in the HDR image according to whether the pixel value of the pixel is greater than the predetermined pixel value, and then determine the highlight region according to the distribution of the highlight pixel. The highlight area can only consist of highlight pixels, and when the highlight area only consists of the highlight pixels, the pixel values of the pixels of the highlight area are all larger than the preset pixel value, so that the accuracy of determining the highlight area is ensured; or the highlight area may also be composed of a part of highlight pixels and a part of medium-low-brightness pixels (pixels with pixel values smaller than a predetermined pixel value), where a ratio of the highlight pixels in the highlight area is greater than a preset ratio, which may be 60%, 70%, 75%, 80%, 85, 90%, 95%, 99%, and so on, that is, the processor 20 uses a part where a ratio of the highlight pixels reaches the preset ratio as the highlight area, so as to ensure integrity of the highlight area, and prevent that the highlight area is too large in number and even a single pixel is also used as one highlight area, which results in too scattered distribution of the highlight area after the first brightness processing, and affects a display effect of the HDR image.
Then, the processor 20 performs a first brightness processing on the highlight area, where the first brightness processing specifically may be that the pixel value of the pixel corresponding to the highlight area is amplified, so as to increase the brightness of the pixel in the highlight area by changing the pixel value, of course, according to the selection of the predetermined pixel value, the brightness gain for increasing the brightness of the pixel in the highlight area by changing the pixel value is also different, and the smaller the selection of the predetermined pixel value is, the larger the difference between the predetermined pixel value and the maximum pixel value 255 is, the larger the brightness gain is; the larger the predetermined pixel value is selected, the smaller its difference from the maximum pixel value 255, the smaller the luminance gain.
The brightness of the highlight area after the first brightness processing is improved, so that the brightness difference between the highlight area and the part outside the highlight area in the display picture is increased, the highlight display of the highlight area is realized, the display 30 displays according to the processed HDR image, and the HDR image has a better display effect.
The image display method, the image display device 10 and the terminal 100 of the embodiment of the application perform the first brightness processing on the highlight region by identifying the HDR image and determining the highlight region, so as to improve the brightness of the highlight region, thereby increasing the brightness difference between the highlight region and the part outside the highlight region in the display screen, realizing the highlight display of the highlight region, and being beneficial to improving the display effect of the HDR image.
Referring to fig. 5, in some embodiments, step 012 includes the following steps:
0121: increasing the backlight brightness according to a predetermined ratio, wherein the backlight brightness is the brightness of a backlight light source of the terminal 100;
0122: and performing second brightness processing on the middle and low brightness regions outside the high brightness region in the HDR image so as to keep the brightness of the middle and low brightness regions before and after the backlight brightness is improved consistent.
Referring again to fig. 2, in certain embodiments, the processing module 12 is further configured to perform steps 0121 and 0122. That is, the processing module 12 is further configured to increase the backlight brightness according to a predetermined ratio, where the backlight brightness is the brightness of the backlight light source of the terminal 100; and performing second brightness processing on the middle and low brightness regions outside the high brightness region in the HDR image so as to keep the brightness of the middle and low brightness regions before and after the backlight brightness is improved consistent.
Referring again to fig. 3, in some embodiments, the processor 20 is further configured to increase the backlight brightness according to a predetermined ratio, where the backlight brightness is the brightness of the backlight light source of the terminal 100; and performing second brightness processing on the middle and low brightness regions outside the high brightness region in the HDR image so as to keep the brightness of the middle and low brightness regions before and after the backlight brightness is improved consistent. That is, steps 0121 and 0122 may be implemented by the processor 20.
Specifically, the display luminance of the display 30 is related to the backlight luminance in addition to the pixel value, and the larger the pixel value is, the larger the display luminance is, and the larger the backlight luminance is, the larger the display luminance is. To further increase the brightness of the highlight region, the processor 20 may increase the backlight brightness according to a predetermined ratio, for example, the display 30 includes a backlight panel including a backlight source and a driving circuit, and the processor 20 may control a driving current input to the driving circuit to increase the brightness of the backlight source, thereby increasing the backlight brightness of the display 30. The backlight brightness can be improved in two ways:
mode 1: increasing the driving current input to the driving circuit according to a predetermined step length, increasing the backlight brightness with the increase of the driving current, setting a brightness detector in the terminal 100, calculating to obtain the target backlight brightness according to the current backlight brightness and a predetermined ratio, wherein the predetermined ratio is a ratio value determined according to the current display brightness and the maximum display brightness, stopping increasing the driving current when detecting that the backlight brightness reaches the target backlight brightness, and gradually increasing the backlight brightness to make the increase of the backlight brightness smoother;
mode 2: the terminal 100 further includes a memory 60, the memory 60 is a mapping relationship table between the target backlight brightness and the driving current, the processor 20 is connected to the memory 60, the processor 20 can calculate the target backlight brightness according to the current backlight brightness and the predetermined ratio, and then query the mapping relationship table to obtain the target driving current corresponding to the target backlight brightness, so that the backlight light source is driven according to the target driving current to make the backlight brightness reach the target backlight brightness, and the backlight brightness can be quickly improved.
If the current backlight brightness is larger, the backlight brightness boosted according to the predetermined ratio may exceed the maximum backlight brightness, and at this time, when the backlight brightness is boosted according to the method 1, since the brightness detected by the brightness detector cannot reach the target backlight brightness, the processor 20 will increase the driving current all the time, thereby causing the backlight panel to be burned out; at this time, when the backlight brightness is increased according to the method 2, since the driving current corresponding to the target backlight brightness does not exist in the mapping relationship table, the processor 20 cannot achieve the increase of the backlight brightness. Therefore, when determining the target backlight brightness, it is first determined whether the target backlight brightness is greater than the maximum backlight brightness. When the target backlight brightness is larger than the maximum backlight brightness, the maximum backlight brightness is taken as the target backlight brightness, and the preset proportion is calculated according to the current backlight brightness and the target backlight brightness, so that the situation that the backlight panel is burnt out or the backlight brightness cannot be improved is prevented.
After the backlight brightness is increased to the target backlight brightness, the overall brightness of the HDR image is increased, and in order to achieve the effect of only increasing the brightness of the highlight region and highlighting the highlight region, the processor 20 may perform a second brightness processing on the middle-low brightness region outside the highlight region in the HDR image, so that the brightness of the middle-low brightness region before the backlight brightness is increased and the brightness of the middle-low brightness region after the second brightness processing are kept consistent, where the consistency refers to that the brightness of the middle-low brightness region before the backlight brightness is increased and the brightness of the middle-low brightness region after the second brightness processing are equal; or the difference value of the brightness of the middle and low brightness areas before the brightness of the backlight is increased and after the second brightness processing is less than the preset difference value. For example, the processor 20 reduces the brightness of the middle and low brightness regions at the target backlight brightness to the brightness before the backlight brightness is raised. The second brightness processing performed by the processor 20 on the middle and low brightness regions outside the high brightness region in the HDR image may be, for example, performing reduction processing on pixel values of pixels in the middle and low brightness regions according to a scaling factor, where the processor 20 first calculates a backlight brightness difference value before backlight brightness is increased and after backlight brightness is increased, then obtains a scaling factor corresponding to the pixel value of the pixel according to the backlight brightness difference value based on a preset lookup table, and reduces the pixel value of the pixel in the middle and low brightness regions by the scaling factor, where the scaling factor is smaller than 1, and the scaling factor may be for each pixel, that is, each pixel has a corresponding scaling factor, so as to implement accurate second brightness processing on each pixel; the scaling factor may also be for the medium and low brightness regions, that is, the medium and low brightness regions correspond to one scaling factor, and the scaling factor may be a scaling factor corresponding to a pixel with a maximum pixel value in the medium and low brightness regions, or the scaling factor may also be a scaling factor corresponding to an average value of pixel values in the medium and low brightness regions, so that the scaling factor corresponding to each pixel does not need to be calculated, and the calculation amount is reduced. The larger the brightness difference value is, the smaller the scaling factor is, and the smaller the brightness difference value is, the larger the scaling factor is. Therefore, the brightness of the highlight area is further improved, meanwhile, the brightness of the middle and low brightness areas is guaranteed to be unchanged, the effect of highlighting the highlight area is improved, the display effect of the middle and low brightness areas is not affected, and the display effect of the HDR image is good.
Referring to fig. 6, in some embodiments, step 0122 further includes the following steps:
0123: amplifying the pixel value of the pixel in the highlight area; and
0124: the pixel values of the pixels of the HDR image are subjected to reduction processing.
Referring again to fig. 2, in certain embodiments, the processing module 12 is further configured to perform steps 0123 and 0124. That is, the processing module 12 is further configured to perform an amplification process on the pixel values of the pixels in the highlight area; and performing reduction processing on pixel values of pixels of the HDR image.
Referring again to fig. 3, in some embodiments, the processor 20 is further configured to perform an amplification process on the pixel values of the pixels in the highlight region; and performing reduction processing on pixel values of pixels of the HDR image. That is, steps 0123 and 0124 may be implemented by the processor 20.
Specifically, when performing the second luminance processing on the middle and low luminance regions, the pixel value of the pixel in the high luminance region may be enlarged first, and then the entire HDR image may be reduced, so that the pixel value of the pixel in the high luminance region is substantially unchanged, the pixel value of the pixel in the middle and low luminance regions is reduced, and the luminance of the pixel in the middle and low luminance regions is reduced, so as to maintain the display luminance substantially consistent with the display luminance before the display luminance is increased. For example, the pixel values of the pixels in the highlight region may be enlarged by a scaling factor (e.g. 0.5), and then the pixel values of the entire HDR image may be reduced by the scaling factor, where the pixel values of the pixels in the highlight region are unchanged and the pixel values of the pixels in the mid-low brightness region are reduced by half.
Referring to fig. 7, in certain embodiments, step 0123 comprises:
0129: calculating the backlight brightness difference value before and after the backlight brightness is improved;
0125: based on a preset lookup table, obtaining a scaling coefficient corresponding to a preset pixel value according to the backlight brightness difference value;
0126: and carrying out linear amplification processing on the pixel values of the pixels of the highlight area according to the scaling coefficient.
Step 0124 comprises:
0127: the pixel values of the pixels of the HDR image are subjected to a reduction process according to the scaling coefficient.
Referring again to fig. 2, in certain embodiments, the processing module 12 is further configured to perform steps 0129, 0125, 0126, and 0127. That is, the processing module 12 is further configured to calculate a backlight brightness difference between the backlight brightness before being increased and the backlight brightness after being increased; based on a preset lookup table, obtaining a scaling coefficient corresponding to a preset pixel value according to the backlight brightness difference value; carrying out linear amplification processing on the pixel values of the pixels in the highlight area according to the scaling coefficient; the pixel values of the pixels of the HDR image are subjected to a reduction process according to the scaling coefficient.
Referring again to fig. 3, in some embodiments, the processor 20 is further configured to calculate a backlight brightness difference between the backlight brightness before and after the backlight brightness is increased; based on a preset lookup table, obtaining a scaling coefficient corresponding to a preset pixel value according to the backlight brightness difference value; carrying out linear amplification processing on the pixel values of the pixels in the highlight area according to the scaling coefficient; the pixel values of the pixels of the HDR image are subjected to a reduction process according to the scaling coefficient. That is, steps 0129, 0125, step 0126, and step 0127 may be implemented by the processor 20.
Specifically, when the processor 20 performs the amplification processing on the pixels in the highlight area, the backlight luminance difference value before the backlight luminance is increased and after the backlight luminance is increased is calculated, then the scaling factor corresponding to the predetermined pixel value is obtained according to the backlight luminance difference value based on the preset lookup table, the preset lookup table stores the mapping relationship among the predetermined pixel value, the backlight luminance difference value and the scaling factor, and the other one can be determined according to any two of the predetermined pixel value, for example, the scaling factor is determined according to the predetermined pixel value and the backlight luminance difference value, and the predetermined pixel value is determined according to the backlight luminance difference value and the scaling factor. The predetermined pixel value is a value for distinguishing between the high-luminance pixel and the low-luminance pixel, and may be, for example, 220, 225, 230, 236, 240, 244, 250, 255, and the like, and the predetermined pixel value is 240 in the present embodiment. When the pixel value of the pixel is larger than or equal to 240, the pixel is a highlight pixel; when the pixel value is less than 240, the pixel is a low-brightness pixel.
In one example, the scaling factor determined according to the predetermined pixel value (240) and the backlight brightness difference value is B, and after the pixel with the predetermined pixel value is scaled by the scaling factor, the display brightness of the pixel is reduced to the display brightness before the backlight brightness is increased.
When the processor 20 performs linear enlargement processing on the pixel value of the pixel of the highlight area according to the scaling factor, the larger the pixel value is, the brighter the pixel is, the correspondingly settable larger the enlargement factor is, so as to improve the highlight effect of the highlight area. The processor 20 may determine that the predetermined pixel value 240 corresponds to an enlargement coefficient of 1 and the maximum pixel value 255 corresponds to a reduction coefficient of 1/B, determine a linear enlargement function Y of a and B in aX + B according to two sets of values (240, 1) and (255, 1/B), where X is a pixel value and Y is an enlargement coefficient, and then determine an enlargement coefficient corresponding to each pixel in the highlight region according to the linear enlargement function to perform the linear enlargement processing on the pixel values of the pixels of the highlight region. The enlarged pixel values are not used for displaying, but the subsequent processor 20 facilitates performing a reduction process on pixels of the entire HDR image according to a scaling factor, the reduction process is to multiply the pixel value of each pixel of the HDR image by the scaling factor, specifically, since each pixel includes pixel values of three channels of red, green and blue (i.e., R, G, B), when performing the enlargement process and the reduction process, the pixel value of each channel is enlarged and reduced, for example, when reducing the pixel value, a focusing matrix with a diagonal line having a value of B is set, and then (R, G, B) is multiplied by the focusing matrix to obtain the reduced pixel value, thereby ensuring that only the display brightness of the pixel is changed, and the color information of the pixel is not changed.
Referring to fig. 8, in some embodiments, step 012 further includes the following steps:
0128: and performing second brightness processing on a display area outside the HDR image in the current display interface so as to enable the brightness of the display area outside the HDR image before the backlight brightness is increased and after the second brightness processing to be consistent.
Referring again to fig. 2, in certain embodiments, the processing module 12 is further configured to perform step 0128. That is, the processing module 12 is further configured to perform the second brightness processing on the display area outside the HDR image in the current display interface, so that the brightness of the display area outside the HDR image before the backlight brightness is increased and after the second brightness processing is performed is kept consistent.
Referring again to fig. 3, in some embodiments, the processor 20 is further configured to perform a second brightness processing on a portion of the current display interface outside the HDR image, so that brightness of a display area outside the HDR image before the backlight brightness is increased and after the second brightness processing is performed is consistent. That is, step 0128 may be implemented by processor 20.
Specifically, when the HDR image is displayed, only a part of the current display interface may be occupied, and at this time, the display interface may also display a system interface, or other non-HDR images, and in order to further improve the highlighting effect of the highlight region, when performing the second luminance processing, in addition to performing the second luminance processing on the middle and low luminance regions other than the highlight region in the HDR image, the second luminance processing is also performed on the display regions other than the HDR image in the display interface, so as to ensure that only the highlight region of the HDR is luminance-improved on the entire display interface, and improve the highlighting effect of the highlight region. And the display areas except the highlight areas of the HDR images in the display interface are subjected to second brightness processing, so that the problem of screen flashing caused by the fact that the display brightness is switched between the display brightness after being promoted and the display brightness before being promoted corresponding to the HDR images when the album is checked in a sliding mode can be prevented when the display interface simultaneously displays the HDR images and other non-HDR images is checked in the sliding mode, and the display effect when the images are checked in the sliding mode is improved.
Referring to fig. 9, a non-volatile computer readable storage medium 300 storing a computer program 302 according to an embodiment of the present disclosure, when the computer program 302 is executed by one or more processors 200, the processor 200 may execute the image display method according to any of the embodiments.
For example, referring to fig. 1, the computer program 302, when executed by the one or more processors 200, causes the processors 200 to perform the steps of:
011: judging whether the image to be processed is an HDR image;
012: if so, performing first brightness processing on a highlight area of the HDR image to improve the brightness of the highlight area; and
013: and displaying the processed HDR image.
For another example, referring to fig. 5, when the computer program 302 is executed by the one or more processors 200, the processors 200 may further perform the steps of:
0121: increasing the backlight brightness according to a preset proportion;
0122: and performing second brightness processing on the middle and low brightness regions outside the high brightness region in the HDR image so as to keep the brightness of the middle and low brightness regions before and after the backlight brightness is improved consistent.
For another example, referring to fig. 8, when the computer program 302 is executed by the one or more processors 200, the processors 200 may further perform the steps of:
0128: and performing second brightness processing on a display area outside the HDR image in the current display interface so as to enable the brightness of the display area outside the HDR image before the backlight brightness is increased and after the second brightness processing to be consistent.
In the description herein, reference to the description of the terms "one embodiment," "some embodiments," "an illustrative embodiment," "an example," "a specific example" or "some examples" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more program modules for implementing specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes additional implementations in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present application.
Although embodiments of the present application have been shown and described above, it is to be understood that the above embodiments are exemplary and not to be construed as limiting the present application, and that changes, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.