Movatterモバイル変換


[0]ホーム

URL:


CN116095503A - Terminal device and method for creating/displaying HDR images - Google Patents

Terminal device and method for creating/displaying HDR images
Download PDF

Info

Publication number
CN116095503A
CN116095503ACN202210675917.6ACN202210675917ACN116095503ACN 116095503 ACN116095503 ACN 116095503ACN 202210675917 ACN202210675917 ACN 202210675917ACN 116095503 ACN116095503 ACN 116095503A
Authority
CN
China
Prior art keywords
pixel
brightness
image
value
threshold
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210675917.6A
Other languages
Chinese (zh)
Inventor
丁岳
胡杰
陈国乔
雷财华
武理友
赫伽宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co LtdfiledCriticalHonor Device Co Ltd
Priority to CN202410531178.2ApriorityCriticalpatent/CN118590766A/en
Priority to CN202210675917.6Aprioritypatent/CN116095503A/en
Priority to CN202310012648.XAprioritypatent/CN117241145A/en
Publication of CN116095503ApublicationCriticalpatent/CN116095503A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The application provides terminal equipment and a method for creating/displaying an HDR image, and relates to the technical field of image processing. The HDR image may be made to have a higher dynamic range when displayed on a device with a higher dynamic range. The terminal device is configured to: obtaining a plurality of multi-frame images under a plurality of exposure parameters, performing tone mapping on the multi-frame images to obtain a first image, and respectively performing coding operation on brightness information and pixel values of each pixel point on the first image under the target exposure parameters to obtain an image file; then, when the image file is displayed, decoding the image file to obtain a pixel value of each pixel point in the first image and brightness information of each pixel point; dividing the first image into a dark region and a highlight region; respectively adjusting pixel values of pixel points in a dark area and a highlight area based on the first adjustment coefficient and the second adjustment coefficient to obtain an expanded image; increase screen brightness and display the expanded image.

Description

Translated fromChinese
终端设备及创建/显示HDR图像的方法Terminal device and method for creating/displaying HDR images

技术领域technical field

本申请涉及图像处理技术领域,尤其涉及一种终端设备及创建/显示HDR图像的方法。The present application relates to the technical field of image processing, and in particular to a terminal device and a method for creating/displaying an HDR image.

背景技术Background technique

随着终端行业的发展,大多终端设备都支持高动态范围(high dynamic range,HDR)摄影技术。HDR摄影技术可以在典型成像传感器和显示设备中可用的动态范围有限的情况下,捕获和显示真实世界的巨大动态范围。With the development of the terminal industry, most terminal devices support high dynamic range (high dynamic range, HDR) photography technology. HDR photography can capture and display the enormous dynamic range of the real world within the limited dynamic range available in typical imaging sensors and display devices.

目前,HDR摄影技术的实现方式通常为:拍摄多张同一场景的不同曝光程度的图像,将这些图像融合在一起成为单个图像,然后应用某种形式的“色调映射”操作将融合所得的图像带入标准动态范围(standard dynamic range,SDR)显示器的动态范围。融合所得的图像一般存储为8位图像,其最终动态范围大约为255∶1。Currently, HDR photography is typically implemented by taking multiple images of the same scene at different exposures, fusing these images together into a single image, and then applying some form of "tone mapping" to bring the resulting blended image to life. into the dynamic range of a standard dynamic range (SDR) display. The fused image is typically stored as an 8-bit image with a final dynamic range of approximately 255:1.

但随着显示技术的不断改进,目前的显示设备大多都能提供比255∶1更高的动态范围。而这些显示设备在显示融合所得的图像时,并不能将该图像以更高的动态范围显示出来。However, with the continuous improvement of display technology, most of the current display devices can provide a higher dynamic range than 255:1. However, when these display devices display the fused image, they cannot display the image with a higher dynamic range.

发明内容Contents of the invention

有鉴于此,本申请提供了一种终端设备及创建/显示HDR图像的方法,可以使HDR图像在动态范围更高的设备上显示时高光区域和暗部区域具有更高的对比度,具有更高的动态范围。In view of this, the present application provides a terminal device and a method for creating/displaying an HDR image, which can make the highlight area and the dark area have higher contrast when the HDR image is displayed on a device with a higher dynamic range, and have a higher Dynamic Range.

第一方面,本申请提供一种终端设备,终端设备包括显示屏、存储器和一个或多个处理器,一个或多个处理器与存储器耦合;其中,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令;一个或多个处理器被配置为执行计算机指令时,执行以下操作:响应于用户查看图像文件的操作,对图像文件进行解码操作,得到第一图像中每个像素点的像素值以及第一图像中每个像素点在目标曝光参数下的亮度信息;根据每个像素点的亮度信息,将第一图像划分为多个图像区域,多个图像区域包括第一区域和第二区域,第一区域为第一图像中的暗部区域,第二区域为第一图像中的高亮区域;根据显示屏的当前屏幕亮度和最大屏幕亮度确定目标屏幕亮度,目标屏幕亮度大于当前屏幕亮度,且小于等于最大屏幕亮度;基于第一调整系数调整第一区域内的像素点的像素值,基于第二调整系数调整第二区域内的像素点的像素值,得到扩展图像,其中,第一调整系数为当前屏幕亮度与目标屏幕亮度的比值,第二调整系数大于等于1;将显示屏的屏幕亮度调整为目标屏幕亮度,显示扩展图像。In a first aspect, the present application provides a terminal device. The terminal device includes a display screen, a memory, and one or more processors, and one or more processors are coupled to the memory; wherein the memory is used to store computer program codes, computer program codes Including computer instructions; when one or more processors are configured to execute the computer instructions, perform the following operations: in response to the operation of viewing the image file by the user, perform a decoding operation on the image file to obtain the pixel value of each pixel point in the first image and the brightness information of each pixel in the first image under the target exposure parameter; according to the brightness information of each pixel, the first image is divided into a plurality of image areas, and the plurality of image areas include the first area and the second area , the first area is the dark area in the first image, and the second area is the highlight area in the first image; the target screen brightness is determined according to the current screen brightness and the maximum screen brightness of the display screen, and the target screen brightness is greater than the current screen brightness, and be less than or equal to the maximum screen brightness; adjust the pixel values of the pixels in the first area based on the first adjustment coefficient, and adjust the pixel values of the pixels in the second area based on the second adjustment coefficient to obtain an extended image, wherein the first adjustment The coefficient is the ratio of the current screen brightness to the target screen brightness, and the second adjustment coefficient is greater than or equal to 1; the screen brightness of the display screen is adjusted to the target screen brightness to display the extended image.

在显示第一图像的过程中,通过增大手机的屏幕亮度,以增大每个像素点的观测亮度;同时通过降低第一区域内像素点的像素值,以降低第一区域内的像素点的观测亮度,以及增大或者保持第二区域内像素点的像素值,以增大或保持第二区域内的像素点的观测亮度,达到不改变第二区域内的像素点的观测亮度并增大第二区域内的像素点的观测亮度的效果。也就是说,在显示HDR图像(第一图像)的过程中,可使HDR图像中亮的区域更亮,暗的区域更暗或者保持不变,增大了HDR图像的明暗对比度,扩大了HDR图像的动态范围。In the process of displaying the first image, by increasing the screen brightness of the mobile phone, the observed brightness of each pixel is increased; at the same time, by reducing the pixel value of the pixels in the first area, the pixels in the first area are reduced The observation brightness of the pixel points in the second area is increased or maintained, and the pixel value of the pixel points in the second area is increased or maintained to increase or maintain the observation brightness of the pixel points in the second area, so as not to change the observation brightness of the pixels in the second area and increase the The effect of the observed brightness of the pixels in the large second area. That is to say, in the process of displaying the HDR image (the first image), the bright area in the HDR image can be made brighter, and the dark area can be darker or remain unchanged, which increases the contrast between light and dark of the HDR image and expands the HDR image. The dynamic range of the image.

在第一方面的一种实施方式中,一个或多个处理器还被配置为执行以下操作:获得多个曝光参数下的多帧图像,多帧图像与多个曝光参数一一对应;对多帧图像进行色调映射得到第一图像;获取第一图像中每个像素点的像素值;按照预设的像素点分组策略对第一图像中的像素点进行分组,获取每组像素点在目标曝光参数下的亮度信息,目标曝光参数为多个曝光参数中的一个曝光参数,或者为根据多个曝光参数中的至少两个曝光参数确定的参数;对亮度信息及每个像素点的像素值分别进行编码操作,得到图像文件。In an implementation manner of the first aspect, the one or more processors are further configured to perform the following operations: obtain multiple frames of images under multiple exposure parameters, where the multiple frames of images correspond to the multiple exposure parameters one by one; Perform tone mapping on multiple frames of images to obtain the first image; obtain the pixel value of each pixel in the first image; group the pixels in the first image according to the preset pixel grouping strategy, and obtain the pixel value of each group of pixels in the target Brightness information under exposure parameters, where the target exposure parameter is one of the multiple exposure parameters, or a parameter determined according to at least two of the multiple exposure parameters; for the brightness information and the pixel value of each pixel The encoding operation is performed separately to obtain an image file.

基于本申请实施方式得到的图像文件,既包括第一图像的像素值,又包括未进行色调映射前的亮度信息,该亮度信息可以更好地反映第一图像的真实亮度情况。如此,在显示第一图像的过程中基于该亮度信息对第一图像的动态范围进行调整,可使图片被显示后,更接近真实亮度。The image file obtained based on the embodiment of the present application includes not only the pixel values of the first image, but also brightness information before tone mapping, and the brightness information can better reflect the real brightness of the first image. In this way, adjusting the dynamic range of the first image based on the luminance information during the process of displaying the first image can make the picture displayed closer to the real luminance.

在第一方面的一种实施方式中,一个或多个处理器还被配置为执行以下操作:获取目标曝光参数对应的目标曝光图像,其中,若目标曝光参数为多个曝光参数中的第一参数,目标曝光图像为第一参数对应的图像帧;若目标曝光参数为根据多个曝光参数中的至少两个曝光参数确定的参数,目标曝光图像为至少两个曝光参数对应的图像帧融合得到的图像;获取每组像素点中的每个像素点在目标曝光图像中的亮度值;将每组像素点中所有像素点在目标曝光图像中的亮度值的均值作为该组像素点在目标曝光参数下的亮度信息。通过将像素点进行分组操作,可以减少亮度信息的数量,从而缩小文件的大小。In an implementation manner of the first aspect, the one or more processors are further configured to perform the following operations: acquire a target exposure image corresponding to the target exposure parameter, wherein, if the target exposure parameter is the first of the multiple exposure parameters parameter, the target exposure image is the image frame corresponding to the first parameter; if the target exposure parameter is a parameter determined according to at least two exposure parameters among multiple exposure parameters, the target exposure image is obtained by fusing the image frames corresponding to at least two exposure parameters image; obtain the brightness value of each pixel in each group of pixels in the target exposure image; use the mean value of the brightness values of all pixels in each group of pixels in the target exposure image as the group of pixels in the target exposure Brightness information under parameters. By grouping pixels, the amount of brightness information can be reduced, thereby reducing the file size.

在第一方面的一种实施方式中,一个或多个处理器还被配置为执行以下操作:对每个像素点的像素值进行编码操作得到第一编码数据;对亮度信息进行编码操作得到第二编码数据;将第二编码数据写入第一编码数据,得到图像文件。也就是说,可以将亮度信息写入图像中,仅得到一个图像文件。In an implementation manner of the first aspect, the one or more processors are further configured to perform the following operations: perform an encoding operation on the pixel value of each pixel to obtain the first encoded data; perform an encoding operation on the brightness information to obtain the second second encoding data; writing the second encoding data into the first encoding data to obtain an image file. That is, it is possible to write the brightness information into the image and get only one image file.

在第一方面的一种实施方式中,第二区域包括M个像素点,第二调整系数包括M个子调整系数,M个像素点与M个子调整系数一一对应,一个或多个处理器还被配置为执行以下操作:根据第j个像素点的亮度信息确定第j个像素点的亮度值,j≤M;根据第j个像素点的亮度值计算第j个像素点的子调整系数,其中,第j个像素点的子调整系数与第j个像素点的亮度值呈正相关,第j个像素点的子调整系数大于1;基于第j个像素点的子调整系数调整第j个像素点的像素值。In an implementation manner of the first aspect, the second area includes M pixels, the second adjustment coefficient includes M sub-adjustment coefficients, the M pixels correspond to the M sub-adjustment coefficients one-to-one, and one or more processors It is also configured to perform the following operations: determine the brightness value of the jth pixel according to the brightness information of the jth pixel, j≤M; calculate the sub-adjustment coefficient of the jth pixel according to the brightness value of the jth pixel , where the sub-adjustment coefficient of the jth pixel is positively correlated with the brightness value of the jth pixel, and the sub-adjustment coefficient of the jth pixel is greater than 1; the jth pixel is adjusted based on the sub-adjustment coefficient of the jth pixel The pixel value of the pixel point.

也就是说,每个像素点的第二调整系数可以不同。通过这种方式调整第二区域的像素值,可保留第二区域内每个像素点的明暗对比情况,使显示结果更加真实。That is to say, the second adjustment coefficient of each pixel can be different. By adjusting the pixel value of the second area in this way, the light and dark contrast of each pixel in the second area can be preserved, so that the display result is more realistic.

在第一方面的一种实施方式中,第二调整系数为1。In an implementation manner of the first aspect, the second adjustment coefficient is 1.

在第一方面的一种实施方式中,一个或多个处理器还被配置为执行以下操作:根据每个像素点的亮度信息确定对应像素点的亮度值;计算得到每个像素点的亮度值的亮度均值;根据亮度均值确定第一阈值,第一阈值大于亮度均值,且第一阈值与亮度均值呈正相关;若任意一个像素点的亮度值小于第一阈值,将任意一个像素点划分至第一区域;若任意一个像素点的亮度值大于等于第一阈值,将任意一个像素点划分至第二区域。In an implementation manner of the first aspect, the one or more processors are further configured to perform the following operations: determine the brightness value of the corresponding pixel according to the brightness information of each pixel; calculate and obtain the brightness value of each pixel The brightness mean value; determine the first threshold value according to the brightness mean value, the first threshold value is greater than the brightness mean value, and the first threshold value and the brightness mean value are positively correlated; if the brightness value of any pixel point is less than the first threshold value, any pixel point is divided into the second An area; if the brightness value of any pixel is greater than or equal to the first threshold, any pixel is divided into the second area.

在第一方面的一种实施方式中,多个图像区域还包括第三区域,一个或多个处理器还被配置为执行以下操作:根据每个像素点的亮度信息确定对应像素点的亮度值;计算得到每个像素点的亮度值的亮度均值;根据亮度均值确定第二阈值和第三阈值,第二阈值小于亮度均值,第三阈值大于亮度均值,且第二阈值、第三阈值与亮度均值呈正相关;若任意一个像素点的亮度值小于第二阈值,将任意一个像素点划分至第一区域;若任意一个像素点的亮度值大于等于第二阈值,且小于第三阈值,将任意一个像素点划分至第三区域;若任意一个像素点的亮度值大于等于第三阈值,将任意一个像素点划分至第二区域。In an implementation manner of the first aspect, the multiple image areas further include a third area, and the one or more processors are further configured to perform the following operations: determine the brightness value of the corresponding pixel according to the brightness information of each pixel ; calculate the brightness mean of the brightness value of each pixel; determine the second threshold and the third threshold according to the brightness mean, the second threshold is smaller than the brightness mean, the third threshold is greater than the brightness mean, and the second threshold, the third threshold and the brightness The mean value is positively correlated; if the brightness value of any pixel point is less than the second threshold, any pixel point is divided into the first area; if the brightness value of any pixel point is greater than or equal to the second threshold value and less than the third threshold value, any pixel point is divided into One pixel is divided into the third area; if the brightness value of any pixel is greater than or equal to the third threshold, any pixel is divided into the second area.

在第一方面的一种实施方式中,目标屏幕亮度为最大屏幕亮度。In an implementation manner of the first aspect, the target screen brightness is the maximum screen brightness.

在第一方面的一种实施方式中,目标屏幕亮度为最大屏幕亮度与第一亮度阈值中的较大值,第一亮度阈值为当前屏幕亮度与预设倍数的乘积。In an implementation manner of the first aspect, the target screen brightness is the larger value of the maximum screen brightness and a first brightness threshold, and the first brightness threshold is a product of the current screen brightness and a preset multiple.

第二方面,本申请实施例提供了一种终端设备,终端设备包括显示屏、存储器和一个或多个处理器,一个或多个处理器与存储器耦合;其中,存储器用于存储计算机程序代码,计算机程序代码包括计算机指令;一个或多个处理器被配置为执行计算机指令时,执行以下操作:获得多个曝光参数下的多帧图像,多帧图像与多个曝光参数一一对应;对多帧图像进行色调映射得到第一图像;获取第一图像中每个像素点的像素值;按照预设的像素点分组策略对第一图像中的像素点进行分组,获取每组像素点在目标曝光参数下的亮度信息,目标曝光参数为多个曝光参数中的一个曝光参数,或者为根据多个曝光参数中的至少两个曝光参数确定的参数;对亮度信息及每个像素点的像素值分别进行编码操作,得到图像文件。In a second aspect, an embodiment of the present application provides a terminal device, the terminal device includes a display screen, a memory, and one or more processors, and the one or more processors are coupled to the memory; wherein the memory is used to store computer program codes, The computer program code includes computer instructions; when one or more processors are configured to execute the computer instructions, perform the following operations: obtain multiple frames of images under multiple exposure parameters, and the multiple frames of images are in one-to-one correspondence with the multiple exposure parameters; Perform tone mapping on multiple frames of images to obtain the first image; obtain the pixel value of each pixel in the first image; group the pixels in the first image according to the preset pixel grouping strategy, and obtain the pixel value of each group of pixels in the target Brightness information under exposure parameters, where the target exposure parameter is one of the multiple exposure parameters, or a parameter determined according to at least two of the multiple exposure parameters; for the brightness information and the pixel value of each pixel The encoding operation is performed separately to obtain an image file.

可以看出,基于本申请实施方式得到的图像文件,既包括第一图像的像素值,又包括未进行色调映射前的亮度信息,该亮度信息可以更好地反映第一图像的真实亮度情况。如此,在显示第一图像的过程中基于该亮度信息对第一图像的动态范围进行调整,可使图片被显示后,更接近真实亮度。It can be seen that the image file obtained based on the embodiment of the present application includes not only the pixel values of the first image, but also brightness information before tone mapping, which can better reflect the real brightness of the first image. In this way, adjusting the dynamic range of the first image based on the luminance information during the process of displaying the first image can make the displayed picture closer to the real luminance.

在第二方面的一种实施方式中,一个或多个处理器还被配置为执行以下操作:获得多个曝光参数下的多帧图像,多帧图像与多个曝光参数一一对应;对多帧图像进行色调映射得到第一图像;获取第一图像中每个像素点的像素值;按照预设的像素点分组策略对第一图像中的像素点进行分组,获取每组像素点在目标曝光参数下的亮度信息,目标曝光参数为多个曝光参数中的一个曝光参数,或者为根据多个曝光参数中的至少两个曝光参数确定的参数;对亮度信息及每个像素点的像素值分别进行编码操作,得到图像文件。通过将像素点进行分组操作,可以减少亮度信息的数量,从而缩小文件的大小。In an implementation manner of the second aspect, the one or more processors are further configured to perform the following operations: obtain multiple frames of images under multiple exposure parameters, where the multiple frames of images correspond to the multiple exposure parameters one by one; Perform tone mapping on multiple frames of images to obtain the first image; obtain the pixel value of each pixel in the first image; group the pixels in the first image according to the preset pixel grouping strategy, and obtain the pixel value of each group of pixels in the target Brightness information under exposure parameters, where the target exposure parameter is one of the multiple exposure parameters, or a parameter determined according to at least two of the multiple exposure parameters; for the brightness information and the pixel value of each pixel The encoding operation is performed separately to obtain an image file. By grouping pixels, the amount of brightness information can be reduced, thereby reducing the file size.

在第二方面的一种实施方式中,一个或多个处理器还被配置为执行以下操作:对每个像素点的像素值进行编码操作得到第一编码数据;对亮度信息进行编码操作得到第二编码数据;将第二编码数据写入第一编码数据,得到图像文件。也就是说,可以将亮度信息写入图像中,仅得到一个图像文件。In an implementation manner of the second aspect, the one or more processors are further configured to perform the following operations: perform an encoding operation on the pixel value of each pixel to obtain the first encoded data; perform an encoding operation on the brightness information to obtain the second second encoding data; writing the second encoding data into the first encoding data to obtain an image file. That is, it is possible to write the brightness information into the image and get only one image file.

第三方面,本申请实施例提供了一种创建HDR图像的方法,应用于终端设备,方法包括:获得多个曝光参数下的多帧图像,多帧图像与多个曝光参数一一对应;对多帧图像进行色调映射得到第一图像;获取第一图像中每个像素点的像素值;按照预设的像素点分组策略对第一图像中的像素点进行分组,获取每组像素点在目标曝光参数下的亮度信息,目标曝光参数为多个曝光参数中的一个曝光参数,或者为根据多个曝光参数中的至少两个曝光参数确定的参数;对亮度信息及每个像素点的像素值分别进行编码操作,得到图像文件。In a third aspect, the embodiment of the present application provides a method for creating an HDR image, which is applied to a terminal device. The method includes: obtaining multiple frames of images under multiple exposure parameters, and the multiple frames of images correspond to the multiple exposure parameters one by one; Perform tone mapping on multiple frames of images to obtain the first image; obtain the pixel value of each pixel in the first image; group the pixels in the first image according to the preset pixel grouping strategy, and obtain each group of pixels in Brightness information under the target exposure parameter, where the target exposure parameter is one exposure parameter among multiple exposure parameters, or a parameter determined according to at least two exposure parameters among multiple exposure parameters; the brightness information and the pixel of each pixel point The values are encoded separately to obtain image files.

在第三方面的一种实施方式中,获取每组像素点在目标曝光参数下的亮度信息包括:获取目标曝光参数对应的目标曝光图像,其中,若目标曝光参数为多个曝光参数中的第一参数,目标曝光图像为第一参数对应的图像帧;若目标曝光参数为根据多个曝光参数中的至少两个曝光参数确定的参数,目标曝光图像为至少两个曝光参数对应的图像帧融合得到的图像;获取每组像素点中的每个像素点在目标曝光图像中的亮度值;将每组像素点中所有像素点在目标曝光图像中的亮度值的均值作为该组像素点在目标曝光参数下的亮度信息。In an implementation manner of the third aspect, acquiring the brightness information of each group of pixels under the target exposure parameter includes: acquiring a target exposure image corresponding to the target exposure parameter, wherein, if the target exposure parameter is the first One parameter, the target exposure image is the image frame corresponding to the first parameter; if the target exposure parameter is a parameter determined according to at least two exposure parameters in a plurality of exposure parameters, the target exposure image is the image frame fusion corresponding to at least two exposure parameters Obtained image; obtain the brightness value of each pixel in each group of pixels in the target exposure image; use the mean value of the brightness values of all pixels in each group of pixels in the target exposure image as the group of pixels in the target exposure Brightness information under exposure parameters.

在第三方面的一种实施方式中,对亮度信息及每个像素点的像素值分别进行编码操作,得到图像文件包括:对每个像素点的像素值进行编码操作得到第一编码数据;对亮度信息进行编码操作得到第二编码数据;将第二编码数据写入第一编码数据,得到图像文件。In an implementation manner of the third aspect, encoding the brightness information and the pixel value of each pixel to obtain the image file includes: encoding the pixel value of each pixel to obtain the first encoded data; The brightness information is encoded to obtain second encoded data; the second encoded data is written into the first encoded data to obtain an image file.

第四方面,本申请实施例还提供了一种显示HDR图像的方法,应用于终端设备,方法包括:响应于用户查看图像文件的操作,对图像文件进行解码操作,得到第一图像中每个像素点的像素值以及第一图像中每个像素点在目标曝光参数下的亮度信息;根据每个像素点的亮度信息,将第一图像划分为多个图像区域,多个图像区域包括第一区域和第二区域,第一区域为第一图像中的暗部区域,第二区域为第一图像中的高亮区域;根据显示屏的当前屏幕亮度和最大屏幕亮度确定目标屏幕亮度,目标屏幕亮度大于当前屏幕亮度,且小于等于最大屏幕亮度;基于第一调整系数调整第一区域内的像素点的像素值,基于第二调整系数调整第二区域内的像素点的像素值,得到扩展图像,其中,第一调整系数为当前屏幕亮度与目标屏幕亮度的比值,第二调整系数大于等于1;将显示屏的屏幕亮度调整为目标屏幕亮度,显示扩展图像。In the fourth aspect, the embodiment of the present application also provides a method for displaying an HDR image, which is applied to a terminal device. The method includes: responding to the operation of viewing the image file by the user, performing a decoding operation on the image file to obtain each The pixel value of the pixel and the brightness information of each pixel in the first image under the target exposure parameter; according to the brightness information of each pixel, the first image is divided into a plurality of image areas, and the plurality of image areas include the first area and the second area, the first area is the dark area in the first image, and the second area is the highlight area in the first image; the target screen brightness is determined according to the current screen brightness and the maximum screen brightness of the display screen, and the target screen brightness greater than the current screen brightness and less than or equal to the maximum screen brightness; adjusting the pixel values of the pixels in the first area based on the first adjustment coefficient, and adjusting the pixel values of the pixels in the second area based on the second adjustment coefficient to obtain the extended image, Wherein, the first adjustment coefficient is the ratio of the current screen brightness to the target screen brightness, and the second adjustment coefficient is greater than or equal to 1; the screen brightness of the display screen is adjusted to the target screen brightness to display the extended image.

在第四方面的一种实施方式中,第二区域包括M个像素点,第二调整系数包括M个子调整系数,M个像素点与M个子调整系数一一对应,基于第二调整系数调整第二区域内的像素点的像素值包括:根据第j个像素点的亮度信息确定第j个像素点的亮度值,j≤M;根据第j个像素点的亮度值计算第j个像素点的子调整系数,其中,第j个像素点的子调整系数与第j个像素点的亮度值呈正相关,第j个像素点的子调整系数大于1;基于第j个像素点的子调整系数调整第j个像素点的像素值。In an implementation manner of the fourth aspect, the second area includes M pixels, the second adjustment coefficient includes M sub-adjustment coefficients, the M pixels correspond to the M sub-adjustment coefficients one-to-one, and the adjustment is based on the second adjustment coefficient The pixel values of the pixels in the second area include: determining the brightness value of the j pixel according to the brightness information of the j pixel, j≤M; calculating the j pixel according to the brightness value of the j pixel The sub-adjustment coefficient of the j-th pixel is positively correlated with the brightness value of the j-th pixel, and the sub-adjustment coefficient of the j-th pixel is greater than 1; based on the sub-adjustment coefficient of the j-th pixel Adjust the pixel value of the jth pixel.

在第四方面的一种实施方式中,第二调整系数为1。In an implementation manner of the fourth aspect, the second adjustment coefficient is 1.

在第四方面的一种实施方式中,根据每个像素点的亮度信息,将第一图像划分为多个图像区域包括:根据每个像素点的亮度信息确定对应像素点的亮度值;计算得到每个像素点的亮度值的亮度均值;根据亮度均值确定第一阈值,第一阈值大于亮度均值,且第一阈值与亮度均值呈正相关;若任意一个像素点的亮度值小于第一阈值,将任意一个像素点划分至第一区域;若任意一个像素点的亮度值大于等于第一阈值,将任意一个像素点划分至第二区域。In an implementation manner of the fourth aspect, according to the brightness information of each pixel, dividing the first image into multiple image regions includes: determining the brightness value of the corresponding pixel according to the brightness information of each pixel; calculating to obtain The brightness mean value of the brightness value of each pixel point; determine the first threshold according to the brightness mean value, the first threshold value is greater than the brightness mean value, and the first threshold value and the brightness mean value are positively correlated; if the brightness value of any pixel point is less than the first threshold value, the Any pixel is divided into the first area; if the brightness value of any pixel is greater than or equal to the first threshold, any pixel is divided into the second area.

在第四方面的一种实施方式中,多个图像区域还包括第三区域,根据每个像素点的亮度信息,将第一图像划分为多个图像区域包括:根据每个像素点的亮度信息确定对应像素点的亮度值;计算得到每个像素点的亮度值的亮度均值;根据亮度均值确定第二阈值和第三阈值,第二阈值小于亮度均值,第三阈值大于亮度均值,且第二阈值、第三阈值与亮度均值呈正相关;若任意一个像素点的亮度值小于第二阈值,将任意一个像素点划分至第一区域;若任意一个像素点的亮度值大于等于第二阈值,且小于第三阈值,将任意一个像素点划分至第三区域;若任意一个像素点的亮度值大于等于第三阈值,将任意一个像素点划分至第二区域。In an implementation manner of the fourth aspect, the multiple image areas further include a third area, and dividing the first image into multiple image areas according to the brightness information of each pixel includes: according to the brightness information of each pixel Determine the luminance value of the corresponding pixel point; calculate the luminance mean value of the luminance value of each pixel point; determine the second threshold and the third threshold value according to the luminance mean value, the second threshold value is less than the luminance mean value, the third threshold value is greater than the luminance mean value, and the second The threshold, the third threshold and the brightness mean are positively correlated; if the brightness value of any pixel point is less than the second threshold value, any pixel point is divided into the first area; if the brightness value of any pixel point is greater than or equal to the second threshold value, and If the brightness value of any pixel is greater than or equal to the third threshold, any pixel is divided into the third area; if the brightness value of any pixel is greater than or equal to the third threshold, any pixel is divided into the second area.

在第四方面的一种实施方式中,目标屏幕亮度为最大屏幕亮度。In an implementation manner of the fourth aspect, the target screen brightness is the maximum screen brightness.

在第四方面的一种实施方式中,目标屏幕亮度为最大屏幕亮度与第一亮度阈值中的较大值,第一亮度阈值为当前屏幕亮度与预设倍数的乘积。In an implementation manner of the fourth aspect, the target screen brightness is the larger value of the maximum screen brightness and a first brightness threshold, and the first brightness threshold is a product of the current screen brightness and a preset multiple.

第五方面,本申请实施例还提供了一种计算机可读存储介质,包括计算机指令,当计算机指令在终端上运行时,使得终端执行第三方面、第四方面中任一项的方法。In the fifth aspect, the embodiment of the present application also provides a computer-readable storage medium, including computer instructions, and when the computer instructions are run on the terminal, the terminal is made to execute the method in any one of the third aspect and the fourth aspect.

第六方面,本申请实施例还提供了一种计算机程序产品,包括计算机指令,当计算机指令在终端上运行时,使得终端执行第三方面、第四方面中任一项的方法。In the sixth aspect, the embodiment of the present application further provides a computer program product, including computer instructions, which, when the computer instructions are run on the terminal, cause the terminal to execute the method in any one of the third aspect and the fourth aspect.

可以理解地,上述提供的第五方面的计算机可读存储介质,第六方面的计算机程序产品所能达到的有益效果,可参考如第一方面及其任一种可能的设计方式中的有益效果,此处不再赘述。It can be understood that the beneficial effects achieved by the computer-readable storage medium in the fifth aspect and the computer program product in the sixth aspect can refer to the beneficial effects in the first aspect and any possible design methods thereof. , which will not be repeated here.

附图说明Description of drawings

图1为本申请实施例提供的一种终端设备的结构示意图;FIG. 1 is a schematic structural diagram of a terminal device provided in an embodiment of the present application;

图2A为本申请实施例提供的一种创建HDR图像方法的流程图;FIG. 2A is a flowchart of a method for creating an HDR image provided by an embodiment of the present application;

图2B为本申请实施例提供的一种合成第一图像的示意图;FIG. 2B is a schematic diagram of a synthesized first image provided by an embodiment of the present application;

图3为一种拍摄示意图;Fig. 3 is a kind of shooting schematic diagram;

图4为一种像素点分组策略的示意图;Fig. 4 is a schematic diagram of a pixel point grouping strategy;

图5为另一种像素点分组策略的示意图;FIG. 5 is a schematic diagram of another pixel grouping strategy;

图6为本申请实施例提供的一种显示HDR图像方法的流程图;FIG. 6 is a flowchart of a method for displaying an HDR image provided in an embodiment of the present application;

图7为本申请实施例提供的一种以不同方法显示图像的示意图;FIG. 7 is a schematic diagram of displaying images in different ways provided by the embodiment of the present application;

图8为本申请实施例提供的一种芯片系统的结构示意图。FIG. 8 is a schematic structural diagram of a chip system provided by an embodiment of the present application.

具体实施方式Detailed ways

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。其中,在本申请的描述中,除非另有说明,“至少一个”是指一个或多个,“多个”是指两个或多于两个。另外,为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. Wherein, in the description of the present application, unless otherwise specified, "at least one" refers to one or more, and "multiple" refers to two or more than two. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same function and effect. Those skilled in the art can understand that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference.

为了下述各实施例的描述清楚简洁,首先给出相关概念或技术的简要介绍:In order to make the description of the following embodiments clear and concise, a brief introduction of related concepts or technologies is given first:

HDR,是指信号最高值和最低值之间的比值(即动态范围)大于或等于预设的第一阈值。将HDR反映在图像中,可以理解为图像中存在高光区域和暗部区域,高光区域的亮度值和暗部区域的亮度值之间的比值超过第一阈值。这样的图像也可称为HDR图像。HDR means that the ratio between the highest signal value and the lowest value (that is, the dynamic range) is greater than or equal to the preset first threshold. Reflecting HDR in an image can be understood as having a highlight area and a dark area in the image, and a ratio between a brightness value of the highlight area and a brightness value of the dark area exceeds a first threshold. Such images may also be referred to as HDR images.

SDR,是指信号最高值和最低值之间的比值(即动态范围)小于预设的第一阈值且大于或等于预设的第二阈值(第二阈值小于第一阈值)。将SDR反映在图像中,可以理解为图像中存在高光区域和暗部区域,高光区域的亮度值和暗部区域的亮度值之间的比值小于预设的第一阈值且大于或等于预设的第二阈值。这样的图像也可称为SDR图像。SDR means that the ratio between the highest signal value and the lowest value (that is, the dynamic range) is less than the preset first threshold and greater than or equal to the preset second threshold (the second threshold is smaller than the first threshold). Reflecting SDR in the image, it can be understood that there are highlight areas and dark areas in the image, and the ratio between the brightness value of the highlight area and the brightness value of the dark area is less than the preset first threshold and greater than or equal to the preset second threshold. threshold. Such images may also be referred to as SDR images.

曝光(exposure values,EV)值,可反映图像的曝光水平。通过调整摄像头的曝光参数,可使图像具有不同的EV。其中,曝光参数是指用于影响摄像头曝光量大小的参数,所述参数包括但不限于光圈、快门、曝光时间以及感光度等等。在本申请实施例中,将正常曝光的曝光值的表示为EV0,将欠曝光的曝光值表示为EV-,将过曝光的曝光值表示为EV+。另外,将曝光值EV0×2n表示为EVn。例如,EV-1表示曝光值为EV0的一半,EV-2表示曝光值为EV-1的一半;再例如,EV1表示曝光值为EV0的二倍,EV2表示曝光值为EV1的二倍。The exposure (exposure values, EV) value can reflect the exposure level of the image. By adjusting the exposure parameters of the camera, the images can have different EVs. Wherein, the exposure parameter refers to a parameter used to affect the exposure of the camera, and the parameter includes but is not limited to aperture, shutter, exposure time, sensitivity, and the like. In the embodiment of the present application, the exposure value of normal exposure is expressed as EV0, the exposure value of underexposure is expressed as EV-, and the exposure value of overexposure is expressed as EV+. In addition, the exposure value EV0×2n is expressed as EVn. For example, EV-1 means that the exposure value is half of EV0, and EV-2 means that the exposure value is half of EV-1; for another example, EV1 means that the exposure value is twice that of EV0, and EV2 means that the exposure value is twice that of EV1.

现有技术提供的一种方案中,终端设备可以拍摄多张同一场景下的不同曝光值的图像,将这些图像融合在一起成为“HDR”图像。不过这种“HDR”图像一般为8位图像,其最终动态范围大约为255∶1。这使得“HDR”图像的动态范围仍然在标准动态范围内。也就是说,这种“HDR”图像,实际上为SDR图像。In a solution provided by the prior art, a terminal device can take multiple images with different exposure values in the same scene, and fuse these images together to form an "HDR" image. Such "HDR" images, however, are typically 8-bit images with a final dynamic range of approximately 255:1. This allows the dynamic range of "HDR" images to still be within the standard dynamic range. In other words, this "HDR" image is actually an SDR image.

在具有更高动态范围的设备上显示“HDR”图像时,“HDR”图像的亮度可以随着设备屏幕的亮度增加或者减小。但在变化过程中,“HDR”图像的高光区域和暗部区域的亮度可以同比发生变化,这使得高光区域和暗部区域的对比度并不会发生变化。也就是说,设备所显示的“HDR图像”的动态范围并不会有所改变,并未充分利用设备更高的动态范围。When displaying an "HDR" image on a device with a higher dynamic range, the brightness of the "HDR" image can increase or decrease with the brightness of the device's screen. However, during the change process, the brightness of the highlight area and the dark area of the "HDR" image can change year-on-year, which makes the contrast between the highlight area and the dark area not change. In other words, the dynamic range of the "HDR image" displayed by the device does not change, and the higher dynamic range of the device is not fully utilized.

有鉴于此,本申请实施例提供了一种生成/显示HDR图像的方法,应用于终端设备,该终端设备可以在生成HDR图像的过程中,将可以反映HDR图像的真实亮度情况的亮度信息和HDR图像的像素值编码至图像文件中。以及,在显示HDR图像的过程中,可以根据该真实亮度情况和终端设备的亮度能力来增大或保持HDR图像高光区域,以及缩小暗部区域的像素值,使HDR图像的高光区域更亮,使HDR图像的暗部区域更暗或者接近HDR图像暗部区域原本的亮度,增大了高光区域和暗部区域具有更高的对比度,从而扩大了HDR图像的动态范围,使终端设备所显示的HDR图像更接近真实场景。In view of this, an embodiment of the present application provides a method for generating/displaying an HDR image, which is applied to a terminal device. During the process of generating the HDR image, the terminal device can use brightness information and The pixel values of the HDR image are encoded into the image file. And, in the process of displaying the HDR image, it is possible to increase or maintain the highlight area of the HDR image according to the real brightness situation and the brightness capability of the terminal device, and reduce the pixel value of the dark area to make the highlight area of the HDR image brighter, so that The dark area of the HDR image is darker or close to the original brightness of the dark area of the HDR image, which increases the contrast between the high light area and the dark area, thereby expanding the dynamic range of the HDR image and making the HDR image displayed by the terminal device closer. real scene.

本申请实施例提供的图像显示方法可以应用于终端设备。该终端设备可以为手机、平板、笔记本电脑等具备摄像头和显示屏的设备,本申请实施例对终端设备的具体形态不作具体限制。The image display method provided in the embodiment of the present application may be applied to a terminal device. The terminal device may be a device equipped with a camera and a display screen, such as a mobile phone, a tablet, and a notebook computer. The embodiment of the present application does not specifically limit the specific form of the terminal device.

如图1所示,上述终端设备具体可以为手机100。手机100可以包括:处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriberidentification module,SIM)卡接口195等。As shown in FIG. 1 , the foregoing terminal device may specifically be a mobile phone 100 . The mobile phone 100 may include: aprocessor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, acharging management module 140, a power management module 141, a battery 142, an antenna 1, and an antenna 2 ,mobile communication module 150,wireless communication module 160,audio module 170,speaker 170A,receiver 170B,microphone 170C,earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193, display screen 194, and A subscriber identification module (subscriber identification module, SIM)card interface 195 and the like.

其中,上述传感器模块180可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器和骨传导传感器等传感器。Wherein, the above-mentioned sensor module 180 may include sensors such as pressure sensor, gyroscope sensor, air pressure sensor, magnetic sensor, acceleration sensor, distance sensor, proximity light sensor, fingerprint sensor, temperature sensor, touch sensor, ambient light sensor and bone conduction sensor.

可以理解的是,本实施例示意的结构并不构成对手机100的具体限定。在另一些实施例中,手机100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure shown in this embodiment does not constitute a specific limitation on the mobile phone 100 . In other embodiments, the mobile phone 100 may include more or fewer components than shown, or combine certain components, or separate certain components, or arrange different components. The illustrated components can be realized in hardware, software or a combination of software and hardware.

处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。Theprocessor 110 may include one or more processing units, for example: theprocessor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (graphics processing unit, GPU), an image signal processor ( image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural network processor (neural-network processing unit, NPU), etc. . Wherein, different processing units may be independent devices, or may be integrated in one or more processors.

控制器可以是手机100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the handset 100 . The controller can generate an operation control signal according to the instruction opcode and timing signal, and complete the control of fetching and executing the instruction.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in theprocessor 110 for storing instructions and data. In some embodiments, the memory inprocessor 110 is a cache memory. The memory may hold instructions or data that theprocessor 110 has just used or recycled. If theprocessor 110 needs to use the instruction or data again, it can be called directly from the memory. Repeated access is avoided, and the waiting time of theprocessor 110 is reduced, thereby improving the efficiency of the system.

在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments,processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuitsound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver) /transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), general-purpose input and output (general-purpose input/output, GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and/or Universal serial bus (universal serial bus, USB) interface, etc.

可以理解的是,本实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对手机100的结构限定。在另一些实施例中,手机100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules shown in this embodiment is only a schematic illustration, and does not constitute a structural limitation of the mobile phone 100 . In some other embodiments, the mobile phone 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为终端设备供电。Thecharging management module 140 is configured to receive a charging input from a charger. Wherein, the charger may be a wireless charger or a wired charger. While thecharging management module 140 is charging the battery 142 , it can also supply power to the terminal device through the power management module 141 .

电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。在一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used for connecting the battery 142 , thecharging management module 140 and theprocessor 110 . The power management module 141 receives the input from the battery 142 and/or thecharging management module 140 to provide power for theprocessor 110 , the internal memory 121 , the external memory, the display screen 194 , the camera 193 , and thewireless communication module 160 . In some embodiments, the power management module 141 and thecharging management module 140 can also be set in the same device.

手机100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。在一些实施例中,手机100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得手机100可以通过无线通信技术与网络以及其他设备通信。The wireless communication function of the mobile phone 100 can be realized by the antenna 1, the antenna 2, themobile communication module 150, thewireless communication module 160, the modem processor and the baseband processor. In some embodiments, the antenna 1 of the mobile phone 100 is coupled to themobile communication module 150, and the antenna 2 is coupled to thewireless communication module 160, so that the mobile phone 100 can communicate with the network and other devices through wireless communication technology.

天线1和天线2用于发射和接收电磁波信号。手机100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in handset 100 can be used to cover single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization of the antennas. For example: Antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.

移动通信模块150可以提供应用在手机100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(lownoise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。Themobile communication module 150 can provide wireless communication solutions including 2G/3G/4G/5G applied on the mobile phone 100 . Themobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA) and the like. Themobile communication module 150 can receive electromagnetic waves through the antenna 1, filter and amplify the received electromagnetic waves, and send them to the modem processor for demodulation.

移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。Themobile communication module 150 can also amplify the signals modulated by the modem processor, and convert them into electromagnetic waves and radiate them through the antenna 1 . In some embodiments, at least part of the functional modules of themobile communication module 150 may be set in theprocessor 110 . In some embodiments, at least part of the functional modules of themobile communication module 150 and at least part of the modules of theprocessor 110 may be set in the same device.

无线通信模块160可以提供应用在手机100上的包括WLAN(如(wirelessfidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigationsatellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(nearfield communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。Thewireless communication module 160 can provide WLAN (such as (wireless fidelity, Wi-Fi) network), Bluetooth (bluetooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), nearfield communication technology (nearfield communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.

无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。Thewireless communication module 160 may be one or more devices integrating at least one communication processing module. Thewireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency-modulates and filters the electromagnetic wave signals, and sends the processed signals to theprocessor 110 . Thewireless communication module 160 can also receive the signal to be sent from theprocessor 110 , frequency-modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.

手机100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The mobile phone 100 realizes the display function through the GPU, the display screen 194, and the application processor. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering.Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

显示屏194用于显示图像,视频等。该显示屏194包括显示面板。The display screen 194 is used to display images, videos and the like. The display screen 194 includes a display panel.

手机100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。ISP用于处理摄像头193反馈的数据。摄像头193用于捕获静态图像或视频。在一些实施例中,手机100可以包括1个或N个摄像头193,N为大于1的正整数。The mobile phone 100 can realize the shooting function through ISP, camera 193 , video codec, GPU, display screen 194 and application processor. The ISP is used for processing the data fed back by the camera 193 . Camera 193 is used to capture still images or video. In some embodiments, the mobile phone 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展手机100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100. The external memory card communicates with theprocessor 110 through the external memory interface 120 to implement a data storage function. Such as saving music, video and other files in the external memory card.

内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行手机100的各种功能应用以及数据处理。例如,在本申请实施例中,处理器110可以通过执行存储在内部存储器121中的指令,内部存储器121可以包括存储程序区和存储数据区。The internal memory 121 may be used to store computer-executable program codes including instructions. Theprocessor 110 executes various functional applications and data processing of the mobile phone 100 by executing instructions stored in the internal memory 121 . For example, in the embodiment of the present application, theprocessor 110 may execute instructions stored in the internal memory 121, and the internal memory 121 may include a program storage area and a data storage area.

其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储手机100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flashstorage,UFS)等。Wherein, the stored program area can store an operating system, at least one application program required by a function (such as a sound playing function, an image playing function, etc.) and the like. The storage data area can store data (such as audio data, phone book, etc.) created during the use of the mobile phone 100 . In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (universal flash storage, UFS) and the like.

手机100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The mobile phone 100 can realize the audio function through theaudio module 170 , thespeaker 170A, thereceiver 170B, themicrophone 170C, theearphone interface 170D, and the application processor. Such as music playback, recording, etc.

按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和手机100的接触和分离。手机100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。The keys 190 include a power key, a volume key and the like. The key 190 may be a mechanical key. It can also be a touch button. The motor 191 can generate a vibrating reminder. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. The indicator 192 can be an indicator light, and can be used to indicate charging status, power change, and can also be used to indicate messages, missed calls, notifications, and the like. TheSIM card interface 195 is used for connecting a SIM card. The SIM card can be connected and separated from the mobile phone 100 by inserting it into theSIM card interface 195 or pulling it out from theSIM card interface 195 . The mobile phone 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1.SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card etc.

本申请实施例提供了一种可以创建/显示HDR图像的方法。下面将结合附图分别说明创建向后兼容的HDR图像以及显示HDR图像的过程。The embodiment of the present application provides a method for creating/displaying an HDR image. The process of creating a backward-compatible HDR image and displaying the HDR image will be described below with reference to the accompanying drawings.

在一些实施例中,如图2A所示,创建HDR图像方法的流程可以包括:In some embodiments, as shown in FIG. 2A, the flow of the method for creating an HDR image may include:

S201,获取多帧图像,多帧图像与多个曝光参数一一对应。S201. Acquire multiple frames of images, where the multiple frames of images are in one-to-one correspondence with multiple exposure parameters.

其中,多帧图像为手机处于同一场景下,在不同曝光参数下拍摄的图像。示例性的,如图3所示,手机可以显示拍摄预览界面301。该拍摄预览界面301可以包括快门302。响应于用户点击/触摸快门302的操作,手机拍摄多帧图像。在一种可能的实现方式中,手机可以包括第一摄像头、第二摄像头、第三摄像头,第一摄像头、第二摄像头及第三摄像头可分别以不同的曝光参数进行拍摄,以获得多帧图像。又或者,在另一种可能的实现方式中,手机可以不同的曝光参数,连续拍摄多帧图像,且每帧图像的拍摄时间尽量接近同步。Wherein, the multi-frame images are images captured by the mobile phone under different exposure parameters in the same scene. Exemplarily, as shown in FIG. 3 , the mobile phone may display ashooting preview interface 301 . Theshooting preview interface 301 may include a shutter 302 . In response to the user's operation of clicking/touching the shutter 302, the mobile phone captures multiple frames of images. In a possible implementation, the mobile phone may include a first camera, a second camera, and a third camera, and the first camera, the second camera, and the third camera may respectively shoot with different exposure parameters to obtain multiple frames of images . Or, in another possible implementation manner, the mobile phone can continuously shoot multiple frames of images with different exposure parameters, and the shooting time of each frame of images is as close to synchronization as possible.

示例性的,如图2B所示,多帧图像可以包括图像1和图像2。其中,图像1为摄像头基于曝光参数1进行拍摄的,图像2为摄像头基于曝光参数2进行拍摄的。可以看出,图像1对应的EV值小于图像2对应的EV值。图像1存在欠曝光的情况,这导致画面中的高光区域有较为清晰的轮廓,但暗部区域由于缺乏曝光较为模糊。图像2存在过曝光的情况,这使得画面中的高光区域由于过曝而失真,暗部区域则由于曝光值的补偿可以看清楚细节、轮廓。Exemplarily, as shown in FIG. 2B , the multiple frames of images may include image 1 and image 2 . Wherein, image 1 is taken by the camera based on exposure parameter 1, and image 2 is taken by the camera based on exposure parameter 2. It can be seen that the EV value corresponding to image 1 is smaller than the EV value corresponding to image 2. Image 1 is underexposed, which results in clearer outlines in the highlight areas of the frame, but blurred dark areas due to lack of exposure. Image 2 is overexposed, which makes the highlight area in the picture distorted due to overexposure, and the details and outlines of the dark area can be seen clearly due to the compensation of the exposure value.

需要说明的是,图2B仅以包括EV-、EV+下的图像帧为例,实际上手机还可以获取更多曝光情况下的图像帧,例如在EV0、EV-1、EV-2、EV+1、EV+2等情况下的图像帧,在此不做具体限制。It should be noted that Figure 2B only takes the image frames under EV- and EV+ as an example. In fact, the mobile phone can also obtain image frames under more exposure conditions, such as EV0, EV-1, EV-2, EV+ 1. The image frame in the case of EV+2, etc., is not specifically limited here.

S202,对多帧图像进行色调映射得到第一图像。S202. Perform tone mapping on multiple frames of images to obtain a first image.

手机可以色调映射的方式将多帧图像融合成第一图像。其中,色调映射可包括全局色调映射、局部色调映射。全局色调映射可使用直方图、伽马(Gamma)函数、Sigmoid非线性函数等进行映射。全局色调映射可以很好地保留全局对比度,但会损失一些局部细节。而局部色调映射可以先对第一图像进行区域划分,然后对划分后的每个区域按照类似全局色调映射的方式进行处理,最终保留相邻区域之间的相对对比度,可以很好地保留局部细节。The mobile phone may fuse multiple frames of images into the first image in a manner of tone mapping. Wherein, tone mapping may include global tone mapping and local tone mapping. Global tone mapping can be mapped using a histogram, a Gamma function, a Sigmoid nonlinear function, and the like. Global tone mapping does a good job of preserving global contrast at the expense of some local details. Local tone mapping can first divide the first image into regions, and then process each divided region in a manner similar to global tone mapping, and finally preserve the relative contrast between adjacent regions, which can well preserve local details. .

示例性的,得到的第一图像可以如图2B所示。该第一图像相对于单帧图像(例如图2B中的图像1和图像2)而言,其暗部区域和高光区域都有较为明显的细节和轮廓,具有更高的动态范围。也就是说,第一图像为HDR图像。Exemplarily, the obtained first image may be as shown in FIG. 2B. Compared with the single-frame image (for example, image 1 and image 2 in FIG. 2B ), the first image has more obvious details and outlines in the dark area and highlight area, and has a higher dynamic range. That is to say, the first image is an HDR image.

S203,获取第一图像中每个像素点的像素值。S203. Acquire the pixel value of each pixel in the first image.

根据捕获图像的图像传感器类型,每个像素点的像素值包括但不仅限于RGB值、RGGB值、RGBW值、RYYB值等。其中,RGB表示每个像素的颜色由红(red,R)、绿(green,G)和蓝(blue,B)三个分量构成。RGGB表示每个像素的颜色由红、绿、绿、蓝四个分量构成。RGBW表示每个像素的颜色由红、绿、蓝、白(white,W)四分量构成。RYYB表示每个像素的颜色由红、黄(yellow,Y)、黄、蓝四个分量构成。其中,每个像素点的像素值可以通过图像传感器获得。According to the image sensor type that captures the image, the pixel value of each pixel includes but not limited to RGB value, RGGB value, RGBW value, RYYB value, etc. Among them, RGB means that the color of each pixel is composed of three components: red (red, R), green (green, G) and blue (blue, B). RGGB means that the color of each pixel is composed of four components: red, green, green, and blue. RGBW means that the color of each pixel is composed of four components: red, green, blue, and white (white, W). RYYB indicates that the color of each pixel consists of four components: red, yellow (yellow, Y), yellow, and blue. Wherein, the pixel value of each pixel can be obtained by an image sensor.

S204,按照预设的像素点分组策略对第一图像所包括的像素点进行分组,获取每组像素点在目标曝光参数下的亮度信息。S204. Group the pixels included in the first image according to a preset pixel grouping strategy, and acquire brightness information of each group of pixels under the target exposure parameter.

其中,目标曝光参数可以为多个曝光参数中的一个,或者为多个曝光参数中的至少两个曝光参数的组合得到的参数,其可以根据实际拍摄需求进行设置。例如,若需求图像的暗部细节比较清晰,目标曝光参数可以较大;若需求图像的高光区域比较清晰且不存在过曝的情况,目标曝光参数可以较小;若需求图像有较为清晰的明暗对比度,且不存在过曝或者欠曝的情况,目标曝光参数可以适中。在一种可选的实施方式中,该目标曝光参数可以为多个曝光参数组合得到的参数,即该第一图像对应的曝光参数。Wherein, the target exposure parameter may be one of multiple exposure parameters, or a parameter obtained by combining at least two exposure parameters among multiple exposure parameters, which may be set according to actual shooting requirements. For example, if the details of the dark part of the image are required to be clear, the target exposure parameter can be larger; if the highlight area of the required image is relatively clear and there is no overexposure, the target exposure parameter can be smaller; if the image is required to have a clearer contrast between light and dark , and there is no overexposure or underexposure, the target exposure parameters can be moderate. In an optional implementation manner, the target exposure parameter may be a parameter obtained by combining multiple exposure parameters, that is, the exposure parameter corresponding to the first image.

示例性的,多个曝光参数包括EV-1、EV0、EV+1、EV+2。手机可以直接取EV-1、EV0、EV+1、EV+2中的任意一个参数作为目标曝光参数。又或者,若在某个场景下为了捕获图像中的暗部细节,需要EV介于EV+1、EV+2之间,则手机可以通过改变曝光时间以及感光度等参数使EV介于EV+1、EV+2之间,得到目标曝光参数。Exemplarily, the multiple exposure parameters include EV-1, EVO, EV+1, and EV+2. The mobile phone can directly take any parameter among EV-1, EV0, EV+1, and EV+2 as the target exposure parameter. Or, if in a certain scene, in order to capture the details of the dark part of the image, the EV needs to be between EV+1 and EV+2, then the mobile phone can make the EV between EV+1 by changing parameters such as exposure time and sensitivity , EV+2 to get the target exposure parameters.

在另一种可选的实施方式中,可以将多个曝光参数输入预训练好的神经网络模型,得到目标曝光参数。总之,目标曝光参数是可以根据实际拍摄需求而改变的值,其设置方法可以由维护者在后台进行设置、维护。In another optional implementation manner, multiple exposure parameters may be input into a pre-trained neural network model to obtain target exposure parameters. In short, the target exposure parameter is a value that can be changed according to actual shooting needs, and its setting method can be set and maintained by the maintainer in the background.

目标曝光参数对应的图像为目标曝光图像。目标曝光图像可以理解为手机以目标曝光参数进行拍摄时应当得到的曝光图像。若目标曝光参数为多个曝光参数中的一个,目标曝光图像可以是手机在目标曝光参数下拍摄得到的图像。若目标曝光参数为多个曝光参数中至少两个曝光参数组合得到的参数,该目标曝光图像可以为对该至少两个曝光参数对应的图像帧融合得到的图像。例如,多个曝光参数包括EV0、EV-、EV+,并分别对应EV0图像帧、EV-图像帧以及EV+图像帧。若目标曝光参数为EV0,则将该EV0图像帧作为目标曝光图像;若目标曝光参数为EV-、EV+组合得到的参数,则将EV-图像帧和EV+图像帧融合得到的图像作为目标曝光图像。又例如,目标曝光参数为上述多个曝光参数组合得到的参数,则将多个曝光参数对应的多帧图像融合得到的第一图像作为目标曝光图像。The image corresponding to the target exposure parameter is the target exposure image. The target exposure image can be understood as the exposure image that should be obtained when the mobile phone shoots with the target exposure parameters. If the target exposure parameter is one of multiple exposure parameters, the target exposure image may be an image captured by the mobile phone under the target exposure parameter. If the target exposure parameter is a parameter obtained by combining at least two exposure parameters among the plurality of exposure parameters, the target exposure image may be an image obtained by fusing image frames corresponding to the at least two exposure parameters. For example, the multiple exposure parameters include EVO, EV-, EV+, and correspond to the EVO image frame, EV- image frame, and EV+ image frame respectively. If the target exposure parameter is EV0, the EV0 image frame is used as the target exposure image; if the target exposure parameter is the parameter obtained by combining EV- and EV+, the image obtained by fusing the EV- image frame and EV+ image frame is used as the target exposure image . For another example, if the target exposure parameter is a parameter obtained by combining the above-mentioned multiple exposure parameters, then the first image obtained by fusing multiple frames of images corresponding to the multiple exposure parameters is used as the target exposure image.

每组像素点在目标曝光参数下的亮度信息,可以理解为每组像素点在目标曝光图像中的亮度信息。例如,手机拍摄了EV0图像、EV-图像以及EV+图像,并基于EV0图像、EV-图像以及EV+图像得到第一图像。若手机将EV0作为目标曝光参数,则第一图像中某组像素点在目标曝光参数下的亮度信息,即为该组像素点在EV0图像中的亮度信息。The brightness information of each group of pixels under the target exposure parameters can be understood as the brightness information of each group of pixels in the target exposure image. For example, the mobile phone captures the EV0 image, the EV-image and the EV+ image, and obtains the first image based on the EV0 image, the EV-image and the EV+ image. If the mobile phone uses EV0 as the target exposure parameter, the brightness information of a certain group of pixels in the first image under the target exposure parameter is the brightness information of the group of pixels in the EV0 image.

另外,预设的像素点分组策略可以根据实际需求进行设置。示例性的,预设的像素点分组策略可以将一个像素点划分为一组,又或者可以将n×m个像素点构成的像素矩阵划分为一组,例如,可以将2×2、3×2个像素点构成的像素矩阵划分为一组,在此不做具体限制。In addition, the preset pixel point grouping strategy can be set according to actual needs. Exemplarily, the preset pixel grouping strategy can divide one pixel into a group, or can divide a pixel matrix composed of n×m pixels into a group, for example, 2×2, 3× The pixel matrix formed by 2 pixels is divided into one group, which is not specifically limited here.

若手机将一个像素点划分为一组,则每组像素点在目标曝光参数下的亮度信息即为该像素点在目标图像中的亮度值。若手机将n×m个像素点构成的像素矩阵划分为一组,则该组像素点在目标曝光参数下的亮度信息可以为该组像素点中所有像素点在目标图像中的亮度值的平均值,或者为去除所有像素点的亮度值的离群值后剩余的亮度值的平均值,在此不做具体限制。If the mobile phone divides a pixel into a group, the brightness information of each group of pixels under the target exposure parameter is the brightness value of the pixel in the target image. If the mobile phone divides the pixel matrix composed of n×m pixels into a group, the brightness information of the group of pixels under the target exposure parameters can be the average of the brightness values of all pixels in the group of pixels in the target image value, or an average value of remaining brightness values after removing outliers of brightness values of all pixels, which is not specifically limited here.

示例性的,图4示出了一种像素点分组策略。在图4中,手机将每个像素点作为一个像素组。其中,像素点A1的像素值为R1G1B1,像素点A2的像素值为R2G2B2,且像素点A1与像素点A2在图像中的坐标相同。像素点A2在目标曝光参数下的亮度信息,为该像素点A2在目标曝光图像中的亮度信息,即为像素点A1的亮度信息。因此,可以通过像素点A1的像素值R1、G1、B1计算得到像素点A1的亮度信息L1,并将其作为像素点A2在目标曝光参数下的亮度信息。Exemplarily, FIG. 4 shows a strategy for grouping pixels. In Figure 4, the mobile phone regards each pixel as a pixel group. Wherein, the pixel value of the pixel point A1 is R1G1B1, the pixel value of the pixel point A2 is R2G2B2, and the coordinates of the pixel point A1 and the pixel point A2 in the image are the same. The brightness information of the pixel point A2 under the target exposure parameter is the brightness information of the pixel point A2 in the target exposure image, that is, the brightness information of the pixel point A1. Therefore, the brightness information L1 of the pixel point A1 can be calculated through the pixel values R1 , G1 , and B1 of the pixel point A1 , and used as the brightness information of the pixel point A2 under the target exposure parameters.

其中,亮度值与像素值可满足算式:L=0.299R+0.587G+0.114B。其中,L为亮度值。例如,像素点A1的像素值为(R100,G100,B100),可以确定像素点A1的亮度值为0.299R+0.587G+0.114B=29.9+58.7+11.4=100。从而该像素点A2在目标曝光参数下的亮度信息为100。Wherein, the luminance value and the pixel value may satisfy the formula: L=0.299R+0.587G+0.114B. Among them, L is the brightness value. For example, the pixel value of pixel A1 is (R100, G100, B100), and it can be determined that the brightness value of pixel A1 is 0.299R+0.587G+0.114B=29.9+58.7+11.4=100. Therefore, the brightness information of the pixel point A2 under the target exposure parameter is 100.

示例性的,图5示出了另一种像素点分组策略。在图5中,第一图像及目标曝光图像均包括9×4个像素点,手机将9×4个像素点划分为12组,每组像素点包括3×1个像素点。其中,像素组1包括像素点M1、像素点M2以及像素点M3。像素组2包括像素点N1、像素点N2、像素点N3。其中,像素点M1与像素点N1在图像中的坐标相同,像素点M2与像素点N2在图像中的坐标相同,像素点M3与像素点N3在图像中的坐标相同。像素点M1的像素值为R3、G3、B3、W3,像素点M2的像素值为R4、G4、B4、W4,像素点M3的像素值为R5、G5、B5、W5。像素点N1的像素值为R6、G6、B6、W6,像素点N2的像素值为R7、G7、B7、W7,像素点N3的像素值为R8、G8、B8、W8。像素组2在目标曝光参数下的亮度信息,为该像素组2在目标曝光图像中的亮度信息,即为像素组1的亮度信息。手机可以根据像素点M1的像素值(R3、G3、B3、W3)计算得到亮度值L3,根据像素点M2的像素值(R4、G4、B4、W4)计算得到亮度值L4,根据像素点M3的像素值(R5、G5、B5、W5)计算得到亮度值L5,然后将亮度值L3、亮度值L4、亮度值L5的均值L6作为像素组2在目标曝光参数下的亮度信息。Exemplarily, FIG. 5 shows another strategy for grouping pixels. In FIG. 5 , both the first image and the target exposure image include 9×4 pixel points, and the mobile phone divides the 9×4 pixel points into 12 groups, and each group of pixel points includes 3×1 pixel points. Wherein, the pixel group 1 includes a pixel point M1, a pixel point M2 and a pixel point M3. The pixel group 2 includes a pixel point N1, a pixel point N2, and a pixel point N3. Wherein, the coordinates of pixel M1 and pixel N1 in the image are the same, the coordinates of pixel M2 and pixel N2 in the image are the same, and the coordinates of pixel M3 and pixel N3 in the image are the same. The pixel values of the pixel point M1 are R3, G3, B3, W3, the pixel values of the pixel point M2 are R4, G4, B4, W4, and the pixel values of the pixel point M3 are R5, G5, B5, W5. The pixel values of pixel N1 are R6, G6, B6, W6, the pixel values of pixel N2 are R7, G7, B7, W7, and the pixel values of pixel N3 are R8, G8, B8, W8. The brightness information of the pixel group 2 under the target exposure parameters is the brightness information of the pixel group 2 in the target exposure image, that is, the brightness information of the pixel group 1 . The mobile phone can calculate the brightness value L3 according to the pixel value (R3, G3, B3, W3) of the pixel point M1, calculate the brightness value L4 according to the pixel value (R4, G4, B4, W4) of the pixel point M2, and obtain the brightness value L4 according to the pixel point M3 The pixel values (R5, G5, B5, W5) of the pixel value (R5, G5, B5, W5) are calculated to obtain the brightness value L5, and then the brightness value L3, the brightness value L4, and the average value L6 of the brightness value L5 are used as the brightness information of the pixel group 2 under the target exposure parameters.

S205,对亮度信息及像素值分别进行编码操作,得到图像文件。S205. Perform encoding operations on the luminance information and pixel values respectively to obtain an image file.

在本申请实施例中,手机可以利用联合图像专家组(Joint PhotographicExperts Group,JEPG)标准、高效率视频编码(high efficiency video coding,HEVC)、便携式网络图型(portable network graphics,PNG)、游程编码(run-length encoding,RLE)等方式对像素值进行编码,以得到第一编码数据。In this embodiment of the application, the mobile phone can use the Joint Photographic Experts Group (JEPG) standard, high efficiency video coding (HEVC), portable network graphics (PNG), run-length coding (run-length encoding, RLE) and other methods to encode the pixel value to obtain the first encoded data.

其中,第一编码数据的格式包括但不仅限于JEPG,高效率图像文件格式(highefficiency image file format,HEIF),HEIC,PNG,位图(Bitmap,BMP),图形交换格式(graphics interchangeformat,GIF)等,在此不做具体限制。Wherein, the format of the first encoded data includes but not limited to JEPG, high efficiency image file format (high efficiency image file format, HEIF), HEIC, PNG, bitmap (Bitmap, BMP), graphics interchange format (graphics interchange format, GIF), etc. , without any specific limitation here.

另外,手机可以采用线性编码或者非线性编码等编码方式对亮度信息进行编码操作,以得到第二编码数据。编码后的每个亮度信息可以有8bit、10bit或者更高的位宽。其中,非线性编码可包括利用伽马函数进行编码等方式,在此不做具体限制。另外,在对亮度信息进行编码时,还可以将像素组的分组方式一同编码至该第二编码数据中。In addition, the mobile phone may use a coding method such as linear coding or nonlinear coding to code the brightness information to obtain the second coded data. Each encoded luminance information may have a bit width of 8 bits, 10 bits or higher. Wherein, the non-linear encoding may include encoding using a gamma function, etc., which is not specifically limited here. In addition, when encoding the luminance information, the grouping manner of the pixel groups may also be encoded into the second encoded data.

手机还可以将第二编码数据写入第一编码数据的特定字段,生成图像文件。示例性的,以第一编码数据的格式为PNG为例,一个标准的PNG文件包括PNG文件署名域以及多个PNG数据块。手机可将该第二编码数据写入PNG数据块中,以生成图像文件。The mobile phone can also write the second coded data into a specific field of the first coded data to generate an image file. Exemplarily, taking the format of the first encoded data as PNG as an example, a standard PNG file includes a PNG file signature field and multiple PNG data blocks. The mobile phone can write the second encoded data into the PNG data block to generate an image file.

需要说明的不是,根据第一编码数据的格式不同,第二编码数据写入的字段并不一定相同,只需将第二编码数据写入第一编码数据中不影响第一编码数据本身携带的信息的字段即可,在此不做具体限制。It should be noted that, depending on the format of the first coded data, the fields written in the second coded data are not necessarily the same, and it is only necessary to write the second coded data into the first coded data without affecting the fields carried by the first coded data itself. The fields of the information can be used, and there is no specific limitation here.

如此,手机创建的图像文件中既包括第一图像的像素值,又包括未进行色调映射前的亮度信息,该亮度信息可以更好地反映第一图像的实际亮度情况,便于后续在显示第一图像的过程中对第一图像的亮度进行调整。In this way, the image file created by the mobile phone includes not only the pixel values of the first image, but also the brightness information before tone mapping. The brightness information can better reflect the actual brightness of the first image, which is convenient for subsequent display of the first image The brightness of the first image is adjusted during the image processing.

在一些实施例中,如图6所示,显示HDR图像的流程可以包括:In some embodiments, as shown in FIG. 6, the process of displaying an HDR image may include:

S301,响应于用户查看图像文件的操作,手机对图像文件进行解码得到亮度信息及第一图像的像素值。S301, in response to the user's operation of viewing the image file, the mobile phone decodes the image file to obtain brightness information and pixel values of the first image.

S302,根据亮度信息确定亮度均值。S302. Determine a brightness average value according to the brightness information.

其中,该亮度均值为所有亮度值的平均值,用于反映第一图像的真实亮度水平。示例性的,若亮度信息的位宽为8bit,则将其数字化后,亮度值的范围在0~255之间。将每个亮度值数字化后取平均值,便可得到亮度均值。Wherein, the average brightness value is an average value of all brightness values, which is used to reflect the real brightness level of the first image. Exemplarily, if the bit width of the brightness information is 8 bits, after it is digitized, the brightness value ranges from 0 to 255. The average brightness value can be obtained by digitizing each brightness value and taking the average value.

S303,根据亮度均值,将第一图像划分为多个图像区域,多个图像区域至少包括第一区域和第二区域。S303. Divide the first image into a plurality of image areas according to the average brightness value, where the plurality of image areas at least include a first area and a second area.

其中,第一区域为第一图像中的暗部区域,第二区域为第一图像中的高光区域。Wherein, the first area is a dark area in the first image, and the second area is a highlight area in the first image.

在一种可选的实施方式中,手机可以将第一图像划分为两个图像区域,两个图像区域分别为第一区域和第二区域。In an optional implementation manner, the mobile phone may divide the first image into two image areas, and the two image areas are respectively the first area and the second area.

手机可以先根据亮度均值确定第一阈值,然后基于第一阈值将第一图像划分为第一区域和第二区域。其中,第一阈值大于等于亮度均值,且亮度均值越大则第一阈值越大。第一阈值可以与亮度均值呈线性或者非线性变化的关系,在此不做具体限制。手机可以将亮度值低于第一阈值的像素点划分至第一区域,将亮度值高于第二阈值的像素点划分至第二区域。如此,可使得第一区域包含第一图像中较暗区域的像素点,使第二区域包含第一图像中较亮区域的像素点。The mobile phone may first determine the first threshold according to the average brightness value, and then divide the first image into a first area and a second area based on the first threshold. Wherein, the first threshold is greater than or equal to the average brightness value, and the larger the average brightness value is, the larger the first threshold is. The first threshold may have a linear or non-linear relationship with the average brightness value, which is not specifically limited here. The mobile phone may divide pixels with brightness values lower than the first threshold into the first area, and divide pixels with brightness values higher than the second threshold into the second area. In this way, the first area may include pixels in the darker area in the first image, and the second area may include pixels in the brighter area in the first image.

示例性的,第一阈值可以为165。若根据亮度信息确定像素点1的亮度值为100。由于100<165,将该像素点1划分至第一区域。若根据亮度信息确定像素点2的亮度值为188。又由于188>165,将该像素点2划分至第二区域。Exemplarily, the first threshold may be 165. If the brightness value of pixel 1 is determined to be 100 according to the brightness information. Since 100<165, the pixel point 1 is divided into the first area. If the brightness value of pixel 2 is determined to be 188 according to the brightness information. And because 188>165, the pixel point 2 is divided into the second area.

在另一种可选的实施方式中,手机可以将第一图像划分为第一区域、第二区域及第三区域。其中,第三区域为第一区域和第二区域的过渡区域。In another optional implementation manner, the mobile phone may divide the first image into a first area, a second area, and a third area. Wherein, the third area is a transition area between the first area and the second area.

手机可以根据亮度均值确定第二阈值和第三阈值,并基于第二阈值和第三阈值将第一图像划分为第一区域、第二区域和第三区域。其中,第二阈值小于亮度均值,第三阈值大于等于亮度均值,且亮度均值越大则第二阈值和第三阈值越大。第二阈值、第三阈值可以与亮度均值呈线性或者非线性变化的关系,在此不做具体限制。手机可以将亮度值低于第二阈值的像素点划分至第一区域,将亮度值大于等于第二阈值且小于第三阈值的像素点划分至第三区域,将亮度值大于等于第三阈值的像素点划分至第二区域。如此,第一区域即为第一图像中较暗的区域,第二区域即为第一图像中较亮的区域,第三区域为第一区域和第二区域的过大区域,亮度适中。The mobile phone may determine the second threshold and the third threshold according to the brightness average value, and divide the first image into the first area, the second area and the third area based on the second threshold and the third threshold. Wherein, the second threshold is smaller than the average brightness value, the third threshold is greater than or equal to the average brightness value, and the larger the average brightness value is, the larger the second threshold and the third threshold are. The second threshold and the third threshold may have a linear or non-linear relationship with the average brightness value, which is not specifically limited here. The mobile phone may divide pixels with brightness values lower than the second threshold into the first area, divide pixels with brightness values greater than or equal to the second threshold and less than the third threshold into the third area, and divide pixels with brightness values greater than or equal to the third threshold into the third area. The pixels are divided into the second area. In this way, the first area is a darker area in the first image, the second area is a brighter area in the first image, and the third area is an oversized area between the first area and the second area, with moderate brightness.

需要说明的是,上述仅仅示出了两种划分图像区域的方式,本申请实施例还可以使用更加精细的分区方法将第一图像划分为更多图像区域,在此不做具体限制。It should be noted that the above only shows two ways of dividing the image area, and the embodiment of the present application may also use a finer division method to divide the first image into more image areas, which is not specifically limited here.

S304,基于当前屏幕亮度及最大屏幕亮度确定目标屏幕亮度。S304. Determine the target screen brightness based on the current screen brightness and the maximum screen brightness.

在本申请实施例中,为了使第一图像看起来更亮,可增大屏幕亮度。其中,最大屏幕亮度为手机屏幕所支持的最大亮度。在一种可选的实施方式中,手机可以先根据当前屏幕亮度确定第一亮度阈值。例如,手机可以将当前屏幕亮度的预设倍数作为第一亮度阈值。该预设倍数可以为大于1的任意数值,例如为3。然后,手机可以比较第一亮度阈值与最大屏幕亮度,若第一亮度阈值小于等于该最大屏幕亮度,则确定目标屏幕亮度为第一亮度阈值。若第一亮度阈值大于该最大屏幕亮度,则确定目标屏幕亮度为最大屏幕亮度。In the embodiment of the present application, in order to make the first image look brighter, the brightness of the screen may be increased. Wherein, the maximum screen brightness is the maximum brightness supported by the mobile phone screen. In an optional implementation manner, the mobile phone may first determine the first brightness threshold according to the current screen brightness. For example, the mobile phone may use a preset multiple of the current screen brightness as the first brightness threshold. The preset multiple can be any value greater than 1, for example, 3. Then, the mobile phone may compare the first brightness threshold with the maximum screen brightness, and if the first brightness threshold is less than or equal to the maximum screen brightness, determine that the target screen brightness is the first brightness threshold. If the first brightness threshold is greater than the maximum screen brightness, it is determined that the target screen brightness is the maximum screen brightness.

在另一种可选的实施方式中,目标屏幕亮度可以固定为最大屏幕亮度。即不管当前屏幕亮度为多少,手机总是将最大屏幕亮度作为目标屏幕亮度。In another optional implementation manner, the target screen brightness may be fixed as the maximum screen brightness. That is, no matter how much the current screen brightness is, the mobile phone always uses the maximum screen brightness as the target screen brightness.

S305,基于第一调整系数调整第一区域内的像素点的像素值,基于第二调整系数调整第二区域内的像素点的像素值,得到扩展图像,其中,第一调整系数小于1,第二调整系数大于等于1。S305. Adjust pixel values of pixels in the first area based on the first adjustment coefficient, and adjust pixel values of pixels in the second area based on the second adjustment coefficient to obtain an extended image, wherein the first adjustment coefficient is less than 1, and the second adjustment coefficient is smaller than 1. 2. The adjustment factor is greater than or equal to 1.

具体的,手机可以将第一调整系数与第一区域内所有像素点的像素值相乘,分别得到每个像素点对应的新像素值;以及将第二调整系数与第二区域内所有像素点的像素值相乘,分别得到每个像素点对应的新像素值。Specifically, the mobile phone may multiply the first adjustment coefficient by the pixel values of all pixels in the first area to obtain new pixel values corresponding to each pixel; and multiply the second adjustment coefficient by all pixel values in the second area Multiply the pixel values of each pixel to get the new pixel value corresponding to each pixel.

其中,在手机通过比较第一亮度阈值和最大屏幕亮度的方式来确定目标屏幕亮度的情况下,若第一亮度阈值小于最大屏幕亮度,目标屏幕亮度为第一亮度阈值,该第一调整系数为当前屏幕亮度与第一亮度阈值的比值,即为预设倍数的倒数;若第一亮度阈值大于等于最大屏幕亮度,目标屏幕亮度为最大屏幕亮度,该第一调整系数为当前屏幕亮度与最大屏幕亮度的比值。在手机固定将最大屏幕亮度作为目标屏幕亮度的情况下,该第一调整系数为当前屏幕亮度与最大屏幕亮度的比值。可见,第一调整系数为当前屏幕亮度与目标屏幕亮度的比值。Wherein, when the mobile phone determines the target screen brightness by comparing the first brightness threshold with the maximum screen brightness, if the first brightness threshold is smaller than the maximum screen brightness, the target screen brightness is the first brightness threshold, and the first adjustment coefficient is The ratio of the current screen brightness to the first brightness threshold is the reciprocal of the preset multiple; if the first brightness threshold is greater than or equal to the maximum screen brightness, the target screen brightness is the maximum screen brightness, and the first adjustment factor is the ratio of the current screen brightness to the maximum screen brightness. Brightness ratio. In the case that the mobile phone fixes the maximum screen brightness as the target screen brightness, the first adjustment coefficient is the ratio of the current screen brightness to the maximum screen brightness. It can be seen that the first adjustment coefficient is the ratio of the current screen brightness to the target screen brightness.

其中,在第一调整系数Q1为预设倍数的倒数时,由于预设倍数大于1,可以得到Q1<1。此外,在第一调整系数Q1为当前屏幕亮度与最大屏幕亮度的比值时,以A Nits表征手机的当前屏幕亮度,以B Nits表征手机的最大屏幕亮度,可以得到第一调整系数Q1为A/B。Wherein, when the first adjustment coefficient Q1 is the reciprocal of the preset multiple, since the preset multiple is greater than 1, it can be obtained that Q1<1. In addition, when the first adjustment coefficient Q1 is the ratio of the current screen brightness to the maximum screen brightness, the current screen brightness of the mobile phone is represented by A Nits, and the maximum screen brightness of the mobile phone is represented by B Nits, the first adjustment coefficient Q1 can be obtained as A/ b.

在另一种可选的实施方式中,该第二调整系数为变值,且与第二区域内每个像素点的亮度信息有关。具体的,每个像素点的第二调整系数与该像素点的亮度信息有关。具体的,可以将每个像素点的亮度信息的数值化得到亮度值,然后基于亮度值计算该像素点的第二调整系数。若第二区域包括N个像素点,则第i个像素点的第二调整系数满足算式:Q2i=1+Li/Lmax。其中,Q2i表示第i个像素点的第二调整系数,Li表示第i个像素点的亮度值,Lmax表示像素点的最大亮度值。示例性的,以亮度信息为8bit为例,亮度信息可数字化为0~255。若某个像素点的亮度值为C,则该像素点对应的第二调整系数Q2=1+C/255。In another optional implementation manner, the second adjustment coefficient is a variable value and is related to the brightness information of each pixel in the second area. Specifically, the second adjustment coefficient of each pixel is related to the brightness information of the pixel. Specifically, the brightness information of each pixel can be digitized to obtain a brightness value, and then the second adjustment coefficient of the pixel can be calculated based on the brightness value. If the second area includes N pixels, the second adjustment coefficient of the i-th pixel satisfies the formula: Q2i =1+Li /Lmax . Wherein, Q2i represents the second adjustment coefficient of the i-th pixel, Li represents the brightness value of the i-th pixel, and Lmax represents the maximum brightness value of the pixel. Exemplarily, taking the brightness information as an example of 8 bits, the brightness information can be digitized as 0-255. If the luminance value of a certain pixel is C, then the second adjustment coefficient Q2 corresponding to the pixel is equal to 1+C/255.

这种方法可使不同的像素值具有不同的第二调整系数,可以尽可能保留第二区域内不同像素点之间的明暗关系。This method can make different pixel values have different second adjustment coefficients, and can preserve the light-dark relationship between different pixel points in the second area as much as possible.

在一种可选的实施方式中,该第二调整系数可以为1。在第二调整系数为1时,第二区域内的像素点的像素值不变。In an optional implementation manner, the second adjustment coefficient may be 1. When the second adjustment coefficient is 1, the pixel values of the pixels in the second area remain unchanged.

由于第一调整系数小于1,第一区域内每个像素点对应的新像素值小于该像素点对应的原始像素值。由于第二调整系数大于等于1,第二区域内每个像素点对应的新像素值大于等于该像素点对应的原始像素值。Since the first adjustment coefficient is less than 1, the new pixel value corresponding to each pixel in the first region is smaller than the original pixel value corresponding to the pixel. Since the second adjustment coefficient is greater than or equal to 1, the new pixel value corresponding to each pixel in the second area is greater than or equal to the original pixel value corresponding to the pixel.

S306,将手机的屏幕亮度调整为目标屏幕亮度,显示扩展图像。S306. Adjust the screen brightness of the mobile phone to the target screen brightness, and display the extended image.

在一种可选实施方式中,某个像素点的观测亮度与屏幕亮度的关系可以满足算式:Lg=Gray*Lp,其中,Lg为观测亮度,Lp为屏幕亮度,Gray为像素灰阶。某个像素点的观测亮度可以指示该像素点在显示屏上的明暗情况。像素点的像素灰阶与该像素点的像素值有关,其中,像素值越大,则像素灰阶越大。例如,像素灰阶与像素值可以满足算式:Gray=0.299R+0.587G+0.114B。In an optional implementation manner, the relationship between the observed luminance of a pixel and the screen luminance may satisfy the formula: Lg=Gray*Lp, where Lg is the observed luminance, Lp is the screen luminance, and Gray is the gray scale of the pixel. The observed brightness of a pixel can indicate how bright or dark the pixel is on the display. The pixel grayscale of a pixel is related to the pixel value of the pixel, wherein the larger the pixel value, the larger the pixel grayscale. For example, the pixel grayscale and pixel value may satisfy the formula: Gray=0.299R+0.587G+0.114B.

可以看出,在手机屏幕上显示图像时,手机的屏幕亮度和像素点的像素值都会影响该像素点在屏幕上的明暗情况。其中,在像素点的像素值一定的情况下,手机的屏幕亮度越大,则该像素点的观测亮度越大,即该像素点看起来越亮;在手机的屏幕亮度一定的情况下,像素点的像素值越大,则该像素点的观测亮度越大,即该像素点看起来越亮。反之,若在增大屏幕亮度的情况下,若要使某个像素点的观测亮度保持不变,则可以缩小该像素点的像素值。It can be seen that when an image is displayed on the screen of a mobile phone, both the brightness of the screen of the mobile phone and the pixel value of a pixel will affect the brightness and darkness of the pixel on the screen. Among them, when the pixel value of a pixel is constant, the greater the screen brightness of the mobile phone is, the greater the observed brightness of the pixel is, that is, the brighter the pixel looks; when the screen brightness of the mobile phone is constant, the pixel The larger the pixel value of the point, the greater the observed brightness of the pixel point, that is, the brighter the pixel point looks. Conversely, if the observed brightness of a certain pixel is to remain unchanged when the brightness of the screen is increased, the pixel value of the pixel can be reduced.

可以理解地,本申请显示第一图像的过程实际上为:在增大手机的屏幕亮度的情况下,缩小第一图像上第一区域上像素点的像素值,以使第一图像上第一区域上像素点的观测亮度接近未调整屏幕亮度前的观测亮度;同时保持或增大第一图像上第二区域上像素点的像素值,以使第二图像上第二区域上像素点的观测亮度比未调整屏幕亮度前的观测亮度更大。换句话说,使第一图像上的第一区域的亮度不变,增大第一图像上的第二区域的亮度。It can be understood that the process of displaying the first image in this application is actually: in the case of increasing the screen brightness of the mobile phone, reducing the pixel value of the pixel point on the first area on the first image, so that the first image on the first image The observed brightness of the pixels on the area is close to the observed brightness before the brightness of the screen is not adjusted; at the same time, the pixel value of the pixels on the second area on the first image is maintained or increased, so that the observed brightness of the pixels on the second area on the second image The brightness is greater than the observed brightness before the screen brightness was not adjusted. In other words, the brightness of the first region on the first image is kept constant, and the brightness of the second region on the first image is increased.

示例性的,以手机将屏幕亮度从当前屏幕亮度A调整为目标屏幕亮度C,第一调整系数为A/C,第二调整系数为1,说明显示第一图像的过程。手机可以先根据第一调整系数和第二调整系数生成扩展图像。在生成扩展图像的过程中,第一图像中第一区域上的像素点的像素值缩小了A/C倍,使得第一区域上像素点的像素灰阶缩小了A/C倍;第一图像中第二区域上的像素点的像素值不变。在手机将屏幕亮度从当前屏幕亮度A调整为目标屏幕亮度C时,第一图像上所有像素点的屏幕亮度均扩大C/A倍。可见,在显示第一图像后,第一区域上的像素点的观测亮度先缩小A/C倍,再扩大C/A倍,与其原本的观测亮度相同;第二区域上的像素点的观测亮度扩大C/A倍,高于其原本的观测亮度。这能增大第一图像上第一区域与第二区域的明暗对比度,扩大了第一图像的动态范围。Exemplarily, the mobile phone adjusts the screen brightness from the current screen brightness A to the target screen brightness C, the first adjustment coefficient is A/C, and the second adjustment coefficient is 1, and the process of displaying the first image is described. The mobile phone may first generate the extended image according to the first adjustment coefficient and the second adjustment coefficient. In the process of generating the extended image, the pixel values of the pixels on the first area in the first image are reduced by A/C times, so that the pixel grayscale of the pixels on the first area is reduced by A/C times; the first image The pixel values of the pixels on the second area in the middle remain unchanged. When the mobile phone adjusts the screen brightness from the current screen brightness A to the target screen brightness C, the screen brightness of all pixels on the first image is enlarged by C/A times. It can be seen that after the first image is displayed, the observed brightness of the pixels on the first area is first reduced by A/C times, and then expanded by C/A times, which is the same as the original observed brightness; the observed brightness of the pixels on the second area Expanded C/A times, higher than its original observed brightness. This can increase the light and dark contrast between the first area and the second area on the first image, and expand the dynamic range of the first image.

示例性的,第一图像可以如图7中(a)所示,第一图像701包括第一区域701a和第二区域701b。若手机不预先得到第一图像的扩展图像,直接增大屏幕亮度并显示第一图像,则可以得到如图7中的(b)所示的图像702,在图像702中,第一区域702a和第二区域702b的观测亮度均增大,但图像702的明暗对比度并未发生变化,与图像701的明暗对比度相同。而手机在得到第一图像的扩展图像后,再将屏幕亮度增大并显示该扩展图像,可以得到如图7中的(c)所示的图像703。可以看出,图像703中的第一区域703a的观测亮度与第一图像701中第一区域701a的观测亮度接近,图像703中的第二区域703b的观测亮度明显高于第一图像701中第二区域701b的观测亮度,相对于第一图像701而言,图像703中第一区域703a与第二区域703b具备更高的明暗对比度,图像703具备更大的动态范围。Exemplarily, the first image may be as shown in (a) of FIG. 7 , and the first image 701 includes afirst area 701a and asecond area 701b. If the mobile phone does not obtain the extended image of the first image in advance, and directly increases the brightness of the screen and displays the first image, an image 702 as shown in (b) in FIG. 7 can be obtained. In the image 702, thefirst area 702a and The observed brightness of thesecond region 702 b increases, but the light-dark contrast of the image 702 does not change, which is the same as the light-dark contrast of the image 701 . After obtaining the extended image of the first image, the mobile phone increases the brightness of the screen and displays the extended image to obtain an image 703 as shown in (c) in FIG. 7 . It can be seen that the observed brightness of thefirst region 703a in the image 703 is close to the observed brightness of thefirst region 701a in the first image 701, and the observed brightness of thesecond region 703b in the image 703 is obviously higher than that of thefirst region 701a in the first image 701. Compared with the observed brightness of thesecond region 701b, compared with the first image 701, thefirst region 703a and thesecond region 703b in the image 703 have a higher light-dark contrast, and the image 703 has a larger dynamic range.

需要说明的是,手机所显示的第一图像,可以是由其他终端设备创建后传输给该手机的,也可以是由手机自己创建的。也就是说,创建HDR图像的过程和显示HDR图像的过程,可以由同一个设备完成,也可以由不同的设备完成,在此不做具体限制。It should be noted that the first image displayed on the mobile phone may be created by other terminal devices and transmitted to the mobile phone, or may be created by the mobile phone itself. That is to say, the process of creating the HDR image and the process of displaying the HDR image may be completed by the same device or by different devices, which are not specifically limited here.

综上所述,本申请通过在显示第一图像的过程中,通过增大手机的屏幕亮度,以增大每个像素点的观测亮度;同时通过降低第一区域内像素点的像素值,以降低第一区域内的像素点的观测亮度,以及增大或者保持第二区域内像素点的像素值,以增大或保持第二区域内的像素点的观测亮度,达到不改变第二区域内的像素点的观测亮度并增大第二区域内的像素点的观测亮度的效果。也就是说,在显示HDR图像的过程中,可使HDR图像中亮的区域更亮,暗的区域更暗或者保持不变,增大了HDR图像的明暗对比度,扩大了HDR图像的动态范围。In summary, this application increases the observed brightness of each pixel by increasing the screen brightness of the mobile phone during the process of displaying the first image; at the same time, by reducing the pixel value of the pixel in the first area, Reduce the observed brightness of the pixels in the first area, and increase or maintain the pixel value of the pixels in the second area to increase or maintain the observed brightness of the pixels in the second area, so as not to change the brightness of the pixels in the second area The effect of increasing the observed brightness of the pixels in the second area and increasing the observed brightness of the pixels in the second area. That is to say, in the process of displaying the HDR image, the bright area in the HDR image can be made brighter, and the dark area can be made darker or remain unchanged, increasing the contrast between light and dark of the HDR image, and expanding the dynamic range of the HDR image.

另外,本申请实施例提供的HDR图像的显示方法,可以自适应终端设备的屏幕所支持的亮度能力,能够充分利用终端设备的亮度能力。In addition, the HDR image display method provided in the embodiment of the present application can adapt to the brightness capability supported by the screen of the terminal device, and can make full use of the brightness capability of the terminal device.

本申请实施例还提供一种芯片系统,如图8所示,该芯片系统包括至少一个处理器801和至少一个接口电路802。处理器801和接口电路802可通过线路互联。例如,接口电路802可用于从其它装置(例如,终端设备的存储器)接收信号。又例如,接口电路802可用于向其它装置(例如处理器801)发送信号。An embodiment of the present application further provides a chip system, and as shown in FIG. 8 , the chip system includes at least oneprocessor 801 and at least oneinterface circuit 802 . Theprocessor 801 and theinterface circuit 802 may be interconnected through wires. For example, theinterface circuit 802 may be used to receive signals from other devices (eg, memory of a terminal device). As another example, theinterface circuit 802 may be used to send signals to other devices (such as the processor 801).

例如,接口电路802可读取,终端设备中存储器中存储的指令,并将该指令发送给处理器801。当所述指令被处理器801执行时,可使得电子设备(如图1中的手机)执行上述实施例中的各个步骤。For example, theinterface circuit 802 may read instructions stored in the memory of the terminal device, and send the instructions to theprocessor 801 . When the instructions are executed by theprocessor 801, the electronic device (such as the mobile phone in FIG. 1) can be executed to execute various steps in the above-mentioned embodiments.

当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。Of course, the chip system may also include other discrete devices, which is not specifically limited in this embodiment of the present application.

本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质包括计算机指令,当所述计算机指令在电子设备(如图1中的手机)上运行时,使得电子设备执行上述方法实施例中电子设备执行的各个功能或者步骤。The embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium includes computer instructions, and when the computer instructions are run on an electronic device (such as the mobile phone in Figure 1), the electronic device is made to execute the above method Each function or step performed by the electronic device in the embodiment.

本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行上述方法实施例中电子设备执行的各个功能或者步骤。An embodiment of the present application further provides a computer program product, which, when running on an electronic device, causes the electronic device to perform the various functions or steps performed by the electronic device in the foregoing method embodiments.

在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be Incorporation or may be integrated into another device, or some features may be omitted, or not implemented. In another point, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The unit described as a separate component may or may not be physically separated, and the component displayed as a unit may be one physical unit or multiple physical units, that is, it may be located in one place, or may be distributed to multiple different places . Part or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist separately physically, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium Among them, several instructions are included to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: various media that can store program codes such as U disk, mobile hard disk, read only memory (ROM), random access memory (random access memory, RAM), magnetic disk or optical disk.

以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above content is only the specific implementation of the application, but the protection scope of the application is not limited thereto, and any changes or replacements within the technical scope disclosed in the application shall be covered within the protection scope of the application. Therefore, the protection scope of the present application should be determined by the protection scope of the claims.

Claims (24)

Translated fromChinese
1.一种终端设备,其特征在于,所述终端设备包括显示屏、存储器和一个或多个处理器,所述一个或多个处理器与所述存储器耦合;1. A terminal device, characterized in that the terminal device includes a display screen, a memory, and one or more processors, and the one or more processors are coupled to the memory;其中,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令;所述一个或多个处理器被配置为执行所述计算机指令时,执行以下操作:Wherein, the memory is used to store computer program codes, and the computer program codes include computer instructions; when the one or more processors are configured to execute the computer instructions, perform the following operations:响应于用户查看图像文件的操作,对所述图像文件进行解码操作,得到第一图像中每个像素点的像素值以及所述第一图像中每个像素点在目标曝光参数下的亮度信息;In response to the user's operation of viewing the image file, perform a decoding operation on the image file to obtain the pixel value of each pixel in the first image and the brightness information of each pixel in the first image under the target exposure parameter;根据每个所述像素点的亮度信息,将所述第一图像划分为多个图像区域,所述多个图像区域包括第一区域和第二区域,所述第一区域为所述第一图像中的暗部区域,所述第二区域为所述第一图像中的高亮区域;Divide the first image into multiple image areas according to the brightness information of each pixel, the multiple image areas include a first area and a second area, the first area is the first image the dark area in the second image, the second area is the highlight area in the first image;根据所述显示屏的当前屏幕亮度和最大屏幕亮度确定目标屏幕亮度,所述目标屏幕亮度大于所述当前屏幕亮度,且小于等于所述最大屏幕亮度;Determine the target screen brightness according to the current screen brightness and the maximum screen brightness of the display screen, the target screen brightness is greater than the current screen brightness and less than or equal to the maximum screen brightness;基于第一调整系数调整所述第一区域内的像素点的像素值,基于第二调整系数调整第二区域内的像素点的像素值,得到扩展图像,其中,所述第一调整系数为所述当前屏幕亮度与所述目标屏幕亮度的比值,所述第二调整系数大于等于1;Adjust the pixel values of the pixels in the first area based on the first adjustment coefficient, and adjust the pixel values of the pixels in the second area based on the second adjustment coefficient to obtain an extended image, wherein the first adjustment coefficient is the The ratio of the current screen brightness to the target screen brightness, the second adjustment coefficient is greater than or equal to 1;将所述显示屏的屏幕亮度调整为所述目标屏幕亮度,显示所述扩展图像。adjusting the screen brightness of the display screen to the target screen brightness, and displaying the extended image.2.根据权利要求1所述的终端设备,其特征在于,所述一个或多个处理器还被配置为执行以下操作:2. The terminal device according to claim 1, wherein the one or more processors are further configured to perform the following operations:获得多个曝光参数下的多帧图像,所述多帧图像与所述多个曝光参数一一对应;Obtaining multiple frames of images under multiple exposure parameters, where the multiple frames of images correspond to the multiple exposure parameters one by one;对所述多帧图像进行色调映射得到所述第一图像;performing tone mapping on the multiple frames of images to obtain the first image;获取所述第一图像中每个像素点的像素值;Obtain the pixel value of each pixel in the first image;按照预设的像素点分组策略对所述第一图像中的像素点进行分组,获取每组像素点在所述目标曝光参数下的亮度信息,所述目标曝光参数为所述多个曝光参数中的一个曝光参数,或者为根据所述多个曝光参数中的至少两个曝光参数确定的参数;Group the pixels in the first image according to a preset pixel point grouping strategy, and acquire brightness information of each group of pixels under the target exposure parameter, where the target exposure parameter is one of the plurality of exposure parameters one exposure parameter of the exposure parameter, or a parameter determined according to at least two exposure parameters in the plurality of exposure parameters;对所述亮度信息及每个像素点的像素值分别进行编码操作,得到所述图像文件。Encoding is performed on the brightness information and the pixel value of each pixel to obtain the image file.3.根据权利要求2所述的终端设备,其特征在于,所述一个或多个处理器还被配置为执行以下操作:3. The terminal device according to claim 2, wherein the one or more processors are further configured to perform the following operations:获取所述目标曝光参数对应的目标曝光图像,其中,若所述目标曝光参数为所述多个曝光参数中的第一参数,所述目标曝光图像为所述第一参数对应的图像帧;若所述目标曝光参数为根据所述多个曝光参数中的至少两个曝光参数确定的参数,所述目标曝光图像为所述至少两个曝光参数对应的图像帧融合得到的图像;Acquiring a target exposure image corresponding to the target exposure parameter, wherein, if the target exposure parameter is the first parameter among the plurality of exposure parameters, the target exposure image is an image frame corresponding to the first parameter; if The target exposure parameter is a parameter determined according to at least two exposure parameters among the plurality of exposure parameters, and the target exposure image is an image obtained by fusing image frames corresponding to the at least two exposure parameters;获取每组像素点中的每个像素点在所述目标曝光图像中的亮度值;Obtain the brightness value of each pixel in each group of pixels in the target exposure image;将每组像素点中所有像素点在所述目标曝光图像中的亮度值的均值作为该组像素点在所述目标曝光参数下的亮度信息。Taking the mean value of the brightness values of all the pixels in each group of pixels in the target exposure image as the brightness information of the group of pixels under the target exposure parameters.4.根据权利要求3所述的终端设备,其特征在于,所述一个或多个处理器还被配置为执行以下操作:4. The terminal device according to claim 3, wherein the one or more processors are further configured to perform the following operations:对每个像素点的像素值进行编码操作得到第一编码数据;performing an encoding operation on the pixel value of each pixel to obtain first encoded data;对所述亮度信息进行编码操作得到第二编码数据;performing an encoding operation on the brightness information to obtain second encoded data;将所述第二编码数据写入所述第一编码数据,得到所述图像文件。Writing the second encoded data into the first encoded data to obtain the image file.5.根据权利要求1-4中任意一项所述的终端设备,其特征在于,所述第二区域包括M个像素点,所述第二调整系数包括M个子调整系数,所述M个像素点与所述M个子调整系数一一对应,所述一个或多个处理器还被配置为执行以下操作:5. The terminal device according to any one of claims 1-4, wherein the second area includes M pixels, the second adjustment coefficient includes M sub-adjustment coefficients, and the M pixels Points are in one-to-one correspondence with the M sub-adjustment coefficients, and the one or more processors are further configured to perform the following operations:根据第j个像素点的亮度信息确定所述第j个像素点的亮度值,j≤M;Determine the brightness value of the jth pixel according to the brightness information of the jth pixel, j≤M;根据所述第j个像素点的亮度值计算所述第j个像素点的子调整系数,其中,所述第j个像素点的子调整系数与所述第j个像素点的亮度值呈正相关,所述第j个像素点的子调整系数大于1;Calculate the sub-adjustment coefficient of the j-th pixel according to the brightness value of the j-th pixel, wherein the sub-adjustment coefficient of the j-th pixel is positively correlated with the brightness value of the j-th pixel , the sub-adjustment coefficient of the jth pixel is greater than 1;基于第j个像素点的子调整系数调整所述第j个像素点的像素值。The pixel value of the jth pixel is adjusted based on the sub-adjustment coefficient of the jth pixel.6.根据权利要求1-4中任意一项所述的终端设备,其特征在于,所述第二调整系数为1。6. The terminal device according to any one of claims 1-4, wherein the second adjustment coefficient is 1.7.根据权利要求1-6中任意一项所述的终端设备,其特征在于,所述一个或多个处理器还被配置为执行以下操作:7. The terminal device according to any one of claims 1-6, wherein the one or more processors are further configured to perform the following operations:根据每个所述像素点的亮度信息确定对应像素点的亮度值;determining the brightness value of the corresponding pixel according to the brightness information of each pixel;计算得到每个所述像素点的亮度值的亮度均值;calculating the brightness mean value of the brightness value of each pixel;根据所述亮度均值确定第一阈值,所述第一阈值大于所述亮度均值,且所述第一阈值与所述亮度均值呈正相关;determining a first threshold according to the average brightness, the first threshold is greater than the average brightness, and the first threshold is positively correlated with the average brightness;若任意一个像素点的亮度值小于所述第一阈值,将所述任意一个像素点划分至所述第一区域;If the luminance value of any pixel is smaller than the first threshold, divide the any pixel into the first region;若任意一个像素点的亮度值大于等于所述第一阈值,将所述任意一个像素点划分至所述第二区域。If the luminance value of any pixel point is greater than or equal to the first threshold, the any pixel point is divided into the second region.8.根据权利要求1-6中任意一项所述的终端设备,其特征在于,所述多个图像区域还包括第三区域,所述一个或多个处理器还被配置为执行以下操作:8. The terminal device according to any one of claims 1-6, wherein the multiple image areas further include a third area, and the one or more processors are further configured to perform the following operations:根据每个所述像素点的亮度信息确定对应像素点的亮度值;determining the brightness value of the corresponding pixel according to the brightness information of each pixel;计算得到每个所述像素点的亮度值的亮度均值;calculating the brightness mean value of the brightness value of each pixel;根据所述亮度均值确定第二阈值和第三阈值,所述第二阈值小于亮度均值,所述第三阈值大于所述亮度均值,且所述第二阈值、所述第三阈值与所述亮度均值呈正相关;Determine a second threshold and a third threshold according to the brightness average, the second threshold is smaller than the brightness average, the third threshold is greater than the brightness average, and the second threshold, the third threshold and the brightness The mean is positively correlated;若任意一个像素点的亮度值小于所述第二阈值,将所述任意一个像素点划分至所述第一区域;If the luminance value of any pixel is smaller than the second threshold, divide the any pixel into the first region;若任意一个像素点的亮度值大于等于所述第二阈值,且小于所述第三阈值,将所述任意一个像素点划分至所述第三区域;If the luminance value of any pixel is greater than or equal to the second threshold and less than the third threshold, divide the any pixel into the third area;若任意一个像素点的亮度值大于等于所述第三阈值,将所述任意一个像素点划分至所述第二区域。If the luminance value of any pixel point is greater than or equal to the third threshold, the any pixel point is divided into the second region.9.根据权利要求1-6中任意一项所述的终端设备,其特征在于,所述目标屏幕亮度为所述最大屏幕亮度。9. The terminal device according to any one of claims 1-6, wherein the target screen brightness is the maximum screen brightness.10.根据权利要求1-6中任意一项所述的终端设备,其特征在于,所述目标屏幕亮度为所述最大屏幕亮度与第一亮度阈值中的较大值,所述第一亮度阈值为所述当前屏幕亮度与预设倍数的乘积。10. The terminal device according to any one of claims 1-6, wherein the target screen brightness is the larger value of the maximum screen brightness and a first brightness threshold, and the first brightness threshold is the product of the current screen brightness and a preset multiple.11.一种终端设备,其特征在于,所述终端设备包括显示屏、存储器和一个或多个处理器,所述一个或多个处理器与所述存储器耦合;11. A terminal device, characterized in that the terminal device includes a display screen, a memory, and one or more processors, and the one or more processors are coupled to the memory;其中,所述存储器用于存储计算机程序代码,所述计算机程序代码包括计算机指令;所述一个或多个处理器被配置为执行所述计算机指令时,执行以下操作:Wherein, the memory is used to store computer program code, and the computer program code includes computer instructions; when the one or more processors are configured to execute the computer instructions, perform the following operations:获得多个曝光参数下的多帧图像,所述多帧图像与所述多个曝光参数一一对应;Obtaining multiple frames of images under multiple exposure parameters, where the multiple frames of images correspond to the multiple exposure parameters one by one;对所述多帧图像进行色调映射得到第一图像;performing tone mapping on the multiple frames of images to obtain a first image;获取所述第一图像中每个像素点的像素值;Obtain the pixel value of each pixel in the first image;按照预设的像素点分组策略对所述第一图像中的像素点进行分组,获取每组像素点在所述目标曝光参数下的亮度信息,所述目标曝光参数为所述多个曝光参数中的一个曝光参数,或者为根据所述多个曝光参数中的至少两个曝光参数确定的参数;Group the pixels in the first image according to a preset pixel grouping strategy, and acquire brightness information of each group of pixels under the target exposure parameter, where the target exposure parameter is one of the plurality of exposure parameters one exposure parameter of the exposure parameter, or a parameter determined according to at least two exposure parameters in the plurality of exposure parameters;对所述亮度信息及每个像素点的像素值分别进行编码操作,得到图像文件。The brightness information and the pixel value of each pixel point are respectively encoded to obtain an image file.12.根据权利要求11所述的终端设备,其特征在于,所述一个或多个处理器还被配置为执行以下操作:12. The terminal device according to claim 11, wherein the one or more processors are further configured to perform the following operations:获得多个曝光参数下的多帧图像,所述多帧图像与所述多个曝光参数一一对应;Obtaining multiple frames of images under multiple exposure parameters, where the multiple frames of images correspond to the multiple exposure parameters one by one;对所述多帧图像进行色调映射得到第一图像;performing tone mapping on the multiple frames of images to obtain a first image;获取所述第一图像中每个像素点的像素值;Obtain the pixel value of each pixel in the first image;按照预设的像素点分组策略对所述第一图像中的像素点进行分组,获取每组像素点在所述目标曝光参数下的亮度信息,所述目标曝光参数为所述多个曝光参数中的一个曝光参数,或者为根据所述多个曝光参数中的至少两个曝光参数确定的参数;Group the pixels in the first image according to a preset pixel point grouping strategy, and acquire brightness information of each group of pixels under the target exposure parameter, where the target exposure parameter is one of the plurality of exposure parameters one exposure parameter of the exposure parameter, or a parameter determined according to at least two exposure parameters in the plurality of exposure parameters;对所述亮度信息及每个像素点的像素值分别进行编码操作,得到图像文件。The brightness information and the pixel value of each pixel point are respectively encoded to obtain an image file.13.根据权利要求11所述的终端设备,其特征在于,所述一个或多个处理器还被配置为执行以下操作:13. The terminal device according to claim 11, wherein the one or more processors are further configured to perform the following operations:对每个像素点的像素值进行编码操作得到第一编码数据;performing an encoding operation on the pixel value of each pixel to obtain first encoded data;对所述亮度信息进行编码操作得到第二编码数据;performing an encoding operation on the brightness information to obtain second encoded data;将所述第二编码数据写入所述第一编码数据,得到所述图像文件。Writing the second encoded data into the first encoded data to obtain the image file.14.一种创建HDR图像的方法,其特征在于,应用于终端设备,所述方法包括:14. A method for creating an HDR image, characterized in that it is applied to a terminal device, the method comprising:获得多个曝光参数下的多帧图像,所述多帧图像与所述多个曝光参数一一对应;Obtaining multiple frames of images under multiple exposure parameters, where the multiple frames of images correspond to the multiple exposure parameters one by one;对所述多帧图像进行色调映射得到第一图像;performing tone mapping on the multiple frames of images to obtain a first image;获取所述第一图像中每个像素点的像素值;Obtain the pixel value of each pixel in the first image;按照预设的像素点分组策略对所述第一图像中的像素点进行分组,获取每组像素点在所述目标曝光参数下的亮度信息,所述目标曝光参数为所述多个曝光参数中的一个曝光参数,或者为根据所述多个曝光参数中的至少两个曝光参数确定的参数;Group the pixels in the first image according to a preset pixel point grouping strategy, and acquire brightness information of each group of pixels under the target exposure parameter, where the target exposure parameter is one of the plurality of exposure parameters one exposure parameter of the exposure parameter, or a parameter determined according to at least two exposure parameters in the plurality of exposure parameters;对所述亮度信息及每个像素点的像素值分别进行编码操作,得到图像文件。The brightness information and the pixel value of each pixel point are respectively encoded to obtain an image file.15.根据权利要求14所述的方法,其特征在于,所述获取每组像素点在所述目标曝光参数下的亮度信息包括:15. The method according to claim 14, wherein said obtaining brightness information of each group of pixels under said target exposure parameters comprises:获取所述目标曝光参数对应的目标曝光图像,其中,若所述目标曝光参数为所述多个曝光参数中的第一参数,所述目标曝光图像为所述第一参数对应的图像帧;若所述目标曝光参数为根据所述多个曝光参数中的至少两个曝光参数确定的参数,所述目标曝光图像为所述至少两个曝光参数对应的图像帧融合得到的图像;Acquiring a target exposure image corresponding to the target exposure parameter, wherein, if the target exposure parameter is the first parameter among the plurality of exposure parameters, the target exposure image is an image frame corresponding to the first parameter; if The target exposure parameter is a parameter determined according to at least two exposure parameters among the plurality of exposure parameters, and the target exposure image is an image obtained by fusing image frames corresponding to the at least two exposure parameters;获取每组像素点中的每个像素点在所述目标曝光图像中的亮度值;Obtain the brightness value of each pixel in each group of pixels in the target exposure image;将每组像素点中所有像素点在所述目标曝光图像中的亮度值的均值作为该组像素点在所述目标曝光参数下的亮度信息。Taking the mean value of the brightness values of all the pixels in each group of pixels in the target exposure image as the brightness information of the group of pixels under the target exposure parameters.16.根据权利要求14所述的方法,其特征在于,所述对所述亮度信息及每个像素点的像素值分别进行编码操作,得到图像文件包括:16. The method according to claim 14, wherein the encoding operation is performed on the brightness information and the pixel value of each pixel point to obtain an image file comprising:对每个像素点的像素值进行编码操作得到第一编码数据;performing an encoding operation on the pixel value of each pixel to obtain first encoded data;对所述亮度信息进行编码操作得到第二编码数据;performing an encoding operation on the brightness information to obtain second encoded data;将所述第二编码数据写入所述第一编码数据,得到所述图像文件。Writing the second encoded data into the first encoded data to obtain the image file.17.一种显示HDR图像的方法,其特征在于,应用于终端设备,所述方法包括:17. A method for displaying an HDR image, characterized in that it is applied to a terminal device, the method comprising:响应于用户查看图像文件的操作,对所述图像文件进行解码操作,得到第一图像中每个像素点的像素值以及所述第一图像中每个像素点在目标曝光参数下的亮度信息;In response to the user's operation of viewing the image file, perform a decoding operation on the image file to obtain the pixel value of each pixel in the first image and the brightness information of each pixel in the first image under the target exposure parameter;根据每个所述像素点的亮度信息,将所述第一图像划分为多个图像区域,所述多个图像区域包括第一区域和第二区域,所述第一区域为所述第一图像中的暗部区域,所述第二区域为所述第一图像中的高亮区域;Divide the first image into multiple image areas according to the brightness information of each pixel, the multiple image areas include a first area and a second area, the first area is the first image the dark area in the second image, the second area is the highlight area in the first image;根据所述显示屏的当前屏幕亮度和最大屏幕亮度确定目标屏幕亮度,所述目标屏幕亮度大于所述当前屏幕亮度,且小于等于所述最大屏幕亮度;Determine the target screen brightness according to the current screen brightness and the maximum screen brightness of the display screen, the target screen brightness is greater than the current screen brightness and less than or equal to the maximum screen brightness;基于第一调整系数调整所述第一区域内的像素点的像素值,基于第二调整系数调整第二区域内的像素点的像素值,得到扩展图像,其中,所述第一调整系数为所述当前屏幕亮度与所述目标屏幕亮度的比值,所述第二调整系数大于等于1;Adjust the pixel values of the pixels in the first area based on the first adjustment coefficient, and adjust the pixel values of the pixels in the second area based on the second adjustment coefficient to obtain an extended image, wherein the first adjustment coefficient is the The ratio of the current screen brightness to the target screen brightness, the second adjustment coefficient is greater than or equal to 1;将所述显示屏的屏幕亮度调整为所述目标屏幕亮度,显示所述扩展图像。adjusting the screen brightness of the display screen to the target screen brightness, and displaying the extended image.18.根据权利要求17中所述的方法,其特征在于,所述第二区域包括M个像素点,所述第二调整系数包括M个子调整系数,所述M个像素点与所述M个子调整系数一一对应,所述基于第二调整系数调整第二区域内的像素点的像素值包括:18. The method according to claim 17, wherein the second area includes M pixels, the second adjustment coefficient includes M sub-adjustment coefficients, and the M pixels are related to the M sub-adjustment coefficients. The adjustment coefficients correspond to each other, and the adjustment of the pixel values of the pixels in the second area based on the second adjustment coefficient includes:根据第j个像素点的亮度信息确定所述第j个像素点的亮度值,j≤M;Determine the brightness value of the jth pixel according to the brightness information of the jth pixel, j≤M;根据所述第j个像素点的亮度值计算所述第j个像素点的子调整系数,其中,所述第j个像素点的子调整系数与所述第j个像素点的亮度值呈正相关,所述第j个像素点的子调整系数大于1;Calculate the sub-adjustment coefficient of the j-th pixel according to the brightness value of the j-th pixel, wherein the sub-adjustment coefficient of the j-th pixel is positively correlated with the brightness value of the j-th pixel , the sub-adjustment coefficient of the jth pixel is greater than 1;基于第j个像素点的子调整系数调整所述第j个像素点的像素值。The pixel value of the jth pixel is adjusted based on the sub-adjustment coefficient of the jth pixel.19.根据权利要求17所述的方法,其特征在于,所述第二调整系数为1。19. The method according to claim 17, wherein the second adjustment coefficient is 1.20.根据权利要求17-19中任意一项所述的方法,其特征在于,所述根据每个所述像素点的亮度信息,将所述第一图像划分为多个图像区域包括:20. The method according to any one of claims 17-19, wherein the dividing the first image into a plurality of image regions according to the brightness information of each pixel comprises:根据每个所述像素点的亮度信息确定对应像素点的亮度值;determining the brightness value of the corresponding pixel according to the brightness information of each pixel;计算得到每个所述像素点的亮度值的亮度均值;calculating the brightness mean value of the brightness value of each pixel;根据所述亮度均值确定第一阈值,所述第一阈值大于所述亮度均值,且所述第一阈值与所述亮度均值呈正相关;determining a first threshold according to the average brightness, the first threshold is greater than the average brightness, and the first threshold is positively correlated with the average brightness;若任意一个像素点的亮度值小于所述第一阈值,将所述任意一个像素点划分至所述第一区域;If the luminance value of any pixel is smaller than the first threshold, divide the any pixel into the first region;若任意一个像素点的亮度值大于等于所述第一阈值,将所述任意一个像素点划分至所述第二区域。If the luminance value of any pixel point is greater than or equal to the first threshold, the any pixel point is divided into the second region.21.根据权利要求17-19中任意一项所述的方法,其特征在于,所述多个图像区域还包括第三区域,所述根据每个所述像素点的亮度信息,将所述第一图像划分为多个图像区域包括:21. The method according to any one of claims 17-19, wherein the multiple image areas further include a third area, and the first An image is divided into multiple image areas including:根据每个所述像素点的亮度信息确定对应像素点的亮度值;determining the brightness value of the corresponding pixel according to the brightness information of each pixel;计算得到每个所述像素点的亮度值的亮度均值;calculating the brightness mean value of the brightness value of each pixel;根据所述亮度均值确定第二阈值和第三阈值,所述第二阈值小于亮度均值,所述第三阈值大于所述亮度均值,且所述第二阈值、所述第三阈值与所述亮度均值呈正相关;Determine a second threshold and a third threshold according to the brightness average, the second threshold is smaller than the brightness average, the third threshold is greater than the brightness average, and the second threshold, the third threshold and the brightness The mean is positively correlated;若任意一个像素点的亮度值小于所述第二阈值,将所述任意一个像素点划分至所述第一区域;If the luminance value of any pixel is smaller than the second threshold, divide the any pixel into the first region;若任意一个像素点的亮度值大于等于所述第二阈值,且小于所述第三阈值,将所述任意一个像素点划分至所述第三区域;If the luminance value of any pixel is greater than or equal to the second threshold and less than the third threshold, divide the any pixel into the third area;若任意一个像素点的亮度值大于等于所述第三阈值,将所述任意一个像素点划分至所述第二区域。If the luminance value of any pixel point is greater than or equal to the third threshold, the any pixel point is divided into the second region.22.根据权利要求17-19中任意一项所述的方法,其特征在于,所述目标屏幕亮度为所述最大屏幕亮度。22. The method according to any one of claims 17-19, wherein the target screen brightness is the maximum screen brightness.23.根据权利要求17-19中任意一项所述的方法,其特征在于,所述目标屏幕亮度为所述最大屏幕亮度与第一亮度阈值中的较大值,所述第一亮度阈值为所述当前屏幕亮度与预设倍数的乘积。23. The method according to any one of claims 17-19, wherein the target screen brightness is the larger value of the maximum screen brightness and a first brightness threshold, and the first brightness threshold is The product of the current screen brightness and a preset multiple.24.一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在终端上运行时,使得所述终端执行如权利要求14-23中任一项所述的方法。24. A computer-readable storage medium, comprising computer instructions, and when the computer instructions are run on a terminal, the terminal is made to execute the method according to any one of claims 14-23.
CN202210675917.6A2022-06-152022-06-15 Terminal device and method for creating/displaying HDR imagesPendingCN116095503A (en)

Priority Applications (3)

Application NumberPriority DateFiling DateTitle
CN202410531178.2ACN118590766A (en)2022-06-152022-06-15 Terminal device and method for creating/displaying HDR image
CN202210675917.6ACN116095503A (en)2022-06-152022-06-15 Terminal device and method for creating/displaying HDR images
CN202310012648.XACN117241145A (en)2022-06-152022-06-15Terminal device and method for creating/displaying HDR image

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202210675917.6ACN116095503A (en)2022-06-152022-06-15 Terminal device and method for creating/displaying HDR images

Related Child Applications (2)

Application NumberTitlePriority DateFiling Date
CN202410531178.2ADivisionCN118590766A (en)2022-06-152022-06-15 Terminal device and method for creating/displaying HDR image
CN202310012648.XADivisionCN117241145A (en)2022-06-152022-06-15Terminal device and method for creating/displaying HDR image

Publications (1)

Publication NumberPublication Date
CN116095503Atrue CN116095503A (en)2023-05-09

Family

ID=86199696

Family Applications (3)

Application NumberTitlePriority DateFiling Date
CN202210675917.6APendingCN116095503A (en)2022-06-152022-06-15 Terminal device and method for creating/displaying HDR images
CN202310012648.XAPendingCN117241145A (en)2022-06-152022-06-15Terminal device and method for creating/displaying HDR image
CN202410531178.2APendingCN118590766A (en)2022-06-152022-06-15 Terminal device and method for creating/displaying HDR image

Family Applications After (2)

Application NumberTitlePriority DateFiling Date
CN202310012648.XAPendingCN117241145A (en)2022-06-152022-06-15Terminal device and method for creating/displaying HDR image
CN202410531178.2APendingCN118590766A (en)2022-06-152022-06-15 Terminal device and method for creating/displaying HDR image

Country Status (1)

CountryLink
CN (3)CN116095503A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2024255266A1 (en)*2023-06-162024-12-19华为技术有限公司Image editing method and apparatus, and electronic device
WO2025036094A1 (en)*2023-08-112025-02-20华为技术有限公司Device connection method and device
WO2025044350A1 (en)*2023-08-292025-03-06华为技术有限公司Image display method and electronic device
WO2025130155A1 (en)*2023-12-202025-06-26荣耀终端股份有限公司Image display method and electronic device

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20250095207A1 (en)*2023-09-142025-03-20Qualcomm IncorporatedImage quality (iq) improvement
CN119520502A (en)*2024-05-142025-02-25华为技术有限公司 Information transmission method and electronic device
CN119211736B (en)*2024-11-112025-04-11荣耀终端股份有限公司 Image processing method and related device

Citations (12)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102497490A (en)*2011-12-162012-06-13上海富瀚微电子有限公司System and method for realizing image high dynamic range compression
CN103702116A (en)*2013-12-062014-04-02浙江宇视科技有限公司Wide dynamic compressing method and device for image
CN104427254A (en)*2013-09-102015-03-18联想(北京)有限公司Light sensing control method and light sensing control device
CN104853106A (en)*2014-02-192015-08-19联想(北京)有限公司Information processing method and electronic equipment
CN104881644A (en)*2015-05-252015-09-02华南理工大学Face image acquisition method under uneven lighting condition
CN105163039A (en)*2015-09-182015-12-16联想(北京)有限公司Control method and control device
CN108734644A (en)*2017-04-242018-11-02英特尔公司Enhanced using the HDR of time-multiplexed progress
CN112164007A (en)*2020-09-292021-01-01Oppo广东移动通信有限公司Image display method and apparatus, terminal and readable storage medium
WO2021036991A1 (en)*2019-08-302021-03-04华为技术有限公司High dynamic range video generation method and device
CN112750086A (en)*2020-08-312021-05-04腾讯科技(深圳)有限公司Image processing method and device, electronic equipment and storage medium
CN114096988A (en)*2019-07-252022-02-25微软技术许可有限责任公司 Controlling display brightness when rendering content about and outputting a composite scene
CN114257750A (en)*2020-09-232022-03-29苹果公司 Backward compatible high dynamic range (HDR) images

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US8346009B2 (en)*2009-06-292013-01-01Thomson LicensingAutomatic exposure estimation for HDR images based on image statistics
JP5335851B2 (en)*2011-04-202013-11-06シャープ株式会社 Liquid crystal display device, multi-display device, light emission amount determining method, program, and recording medium
CN110177221B (en)*2019-06-252021-02-26维沃移动通信有限公司 High dynamic range image capturing method and device
CN113497880A (en)*2020-03-202021-10-12华为技术有限公司Method for shooting image and electronic equipment
CN114286172B (en)*2021-08-232024-04-09腾讯科技(深圳)有限公司Data processing method and device

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN102497490A (en)*2011-12-162012-06-13上海富瀚微电子有限公司System and method for realizing image high dynamic range compression
CN104427254A (en)*2013-09-102015-03-18联想(北京)有限公司Light sensing control method and light sensing control device
CN103702116A (en)*2013-12-062014-04-02浙江宇视科技有限公司Wide dynamic compressing method and device for image
CN104853106A (en)*2014-02-192015-08-19联想(北京)有限公司Information processing method and electronic equipment
CN104881644A (en)*2015-05-252015-09-02华南理工大学Face image acquisition method under uneven lighting condition
CN105163039A (en)*2015-09-182015-12-16联想(北京)有限公司Control method and control device
CN108734644A (en)*2017-04-242018-11-02英特尔公司Enhanced using the HDR of time-multiplexed progress
CN114096988A (en)*2019-07-252022-02-25微软技术许可有限责任公司 Controlling display brightness when rendering content about and outputting a composite scene
WO2021036991A1 (en)*2019-08-302021-03-04华为技术有限公司High dynamic range video generation method and device
CN112750086A (en)*2020-08-312021-05-04腾讯科技(深圳)有限公司Image processing method and device, electronic equipment and storage medium
CN114257750A (en)*2020-09-232022-03-29苹果公司 Backward compatible high dynamic range (HDR) images
CN112164007A (en)*2020-09-292021-01-01Oppo广东移动通信有限公司Image display method and apparatus, terminal and readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2024255266A1 (en)*2023-06-162024-12-19华为技术有限公司Image editing method and apparatus, and electronic device
WO2025036094A1 (en)*2023-08-112025-02-20华为技术有限公司Device connection method and device
WO2025044350A1 (en)*2023-08-292025-03-06华为技术有限公司Image display method and electronic device
WO2025130155A1 (en)*2023-12-202025-06-26荣耀终端股份有限公司Image display method and electronic device

Also Published As

Publication numberPublication date
CN117241145A (en)2023-12-15
CN118590766A (en)2024-09-03

Similar Documents

PublicationPublication DateTitle
CN116095503A (en) Terminal device and method for creating/displaying HDR images
WO2021077878A1 (en)Image processing method and apparatus, and electronic device
CN113099233B (en)Video encoding method, apparatus, video encoding device and storage medium
CN115760652B (en)Method for expanding dynamic range of image and electronic equipment
CN114331918B (en) Image enhancement model training method, image enhancement method and electronic device
CN116668838B (en) Image processing methods and electronic equipment
CN117745620B (en)Image processing method and electronic equipment
CN117496391B (en)Image processing method and electronic equipment
CN115564659A (en) Video processing method and device
CN116048323B (en)Image processing method and electronic equipment
CN119277194A (en) Image processing method, electronic device, computer program product and storage medium
CN115546858B (en)Face image processing method and electronic equipment
CN115460343B (en)Image processing method, device and storage medium
CN117711300A (en) An image display method, electronic device, readable storage medium and chip
CN113364964B (en)Image processing method, image processing apparatus, storage medium, and terminal device
CN114363507A (en)Image processing method and device
WO2024148968A9 (en)Image preview method and terminal device
CN119273780B (en) Image processing method, electronic device, and computer-readable storage medium
EP4625986A1 (en)Image processing method based on system cache, and related apparatus
CN117974519B (en) Image processing method and related equipment
CN115861042B (en)Image processing method, electronic equipment and medium
CN118264889B (en) Image processing method and electronic device
CN119277045B (en) Defective pixel detection method and electronic device
CN115701129B (en)Image processing method and electronic equipment
CN119831908A (en)Image processing method and related equipment

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
CB02Change of applicant information

Country or region after:China

Address after:Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Applicant after:Honor Terminal Co.,Ltd.

Address before:3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Applicant before:Honor Device Co.,Ltd.

Country or region before:China

CB02Change of applicant information

[8]ページ先頭

©2009-2025 Movatter.jp