WO2022206353A1 - 图像处理方法、拍摄装置、图像处理装置及可读存储介质 - Google Patents

图像处理方法、拍摄装置、图像处理装置及可读存储介质 Download PDF

Info

Publication number
WO2022206353A1
WO2022206353A1 PCT/CN2022/080597 CN2022080597W WO2022206353A1 WO 2022206353 A1 WO2022206353 A1 WO 2022206353A1 CN 2022080597 W CN2022080597 W CN 2022080597W WO 2022206353 A1 WO2022206353 A1 WO 2022206353A1
Authority
WO
WIPO (PCT)
Prior art keywords
value
exposure value
brightness
frame
preview frame
Prior art date
Application number
PCT/CN2022/080597
Other languages
English (en)
French (fr)
Inventor
谭坤
郭奕滨
Original Assignee
影石创新科技股份有限公司
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 影石创新科技股份有限公司 filed Critical 影石创新科技股份有限公司
Publication of WO2022206353A1 publication Critical patent/WO2022206353A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene

Definitions

  • the present application relates to the technical field of image processing, and in particular, to a photographing device, an image processing device, and a computer-readable storage medium.
  • HDR High-Dynamic Range
  • EV Exposure Values
  • the short exposure time and the long exposure time are mostly fixed values.
  • the electronic device will use a fixed short exposure time and long exposure time to achieve HDR when shooting. Therefore, using a fixed EV interval for shooting in a more complex shooting scene, when the number of shooting frames is relatively small (3 frames), it cannot completely cover various environments, and the effect of the photos taken is not ideal; In the case of a large number of frames (9 frames), the shooting process will take a long time, and the algorithm synthesis time of the electronic device will also take a long time.
  • the hand shakes when shooting or there are moving objects in the shot it will also cause some serious smearing and artifacts.
  • the purpose of the present invention is to provide an image processing method, a photographing device, an image processing device and a computer-readable storage medium, aiming at solving the defects of existing HDR photos.
  • the present invention provides an image processing method, the method comprising:
  • Photos whose exposure values are the initial exposure value EV0, the final long exposure value EV5, and the final short exposure value EV6 are fused to obtain an HDR photo.
  • the present invention provides a photographing device, the device comprising:
  • a shooting module used to obtain the picture to be shot
  • an acquisition module used for acquiring the initial exposure value EV0 of the preview frame of the picture to be shot
  • a first calculation module configured to calculate the first long exposure value EV1 according to the pixels whose brightness value of the preview frame is less than the first brightness threshold value Y1;
  • the second calculation module is configured to calculate the first short exposure value EV2 according to the pixels whose brightness value of the preview frame is greater than the second brightness threshold value Y2;
  • the segmentation module is used to segment the preview frame into multiple frame blocks
  • a third calculation module configured to calculate the second long exposure value EV3 according to the frame blocks whose average luminance value is less than the third luminance threshold value Y3;
  • a fourth calculation module configured to calculate the second short exposure value EV4 according to the frame block whose average brightness value is greater than the fourth brightness threshold value Y4;
  • a fifth calculation module configured to calculate the final long exposure value EV5 according to the first long exposure value EV1 and the second long exposure value EV3;
  • a sixth calculation module configured to calculate the final short exposure value EV6 according to the first short exposure value EV2 and the second short exposure value EV4;
  • the photo fusion module is used to fuse the photos whose exposure values are the initial exposure value EV0, the final long exposure value EV5, and the final short exposure value EV6 to obtain an HDR photo.
  • the present invention provides an image processing device, comprising:
  • an image receiving module for receiving the image to be shot
  • an acquisition module used for acquiring the initial exposure value EV0 of the preview frame of the picture to be shot
  • a first calculation module configured to calculate the first long exposure value EV1 according to the pixels whose brightness value of the preview frame is less than the first brightness threshold value Y1;
  • the second calculation module is configured to calculate the first short exposure value EV2 according to the pixels whose brightness value of the preview frame is greater than the second brightness threshold value Y2;
  • the segmentation module is used to segment the preview frame into multiple frame blocks
  • a third calculation module configured to calculate the second long exposure value EV3 according to the frame blocks whose average luminance value is less than the third luminance threshold value Y3;
  • a fourth calculation module configured to calculate the second short exposure value EV4 according to the frame block whose average brightness value is greater than the fourth brightness threshold value Y4;
  • a fifth calculation module configured to calculate the final long exposure value EV5 according to the first long exposure value EV1 and the second long exposure value EV3;
  • a sixth calculation module configured to calculate the final short exposure value EV6 according to the first short exposure value EV2 and the second short exposure value EV4;
  • the photo fusion module is used to fuse the photos whose exposure values are the initial exposure value EV0, the final long exposure value EV5 and the final short exposure value EV6 to obtain HDR photos.
  • the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program implements the above image processing method when executed by a processor.
  • the present invention obtains a suitable EV interval through the overall brightness value of the preview frame of the picture to be shot and the brightness value of some frame blocks of the preview frame, and the captured HDR photo can be well preserved in the picture.
  • the details of the bright and dark parts reduce the artifacts and smear that are prone to occur in multi-frame (7 or more) HDR photos, and also improve the shooting speed.
  • FIG. 1 is a flowchart of an image processing method in Embodiment 1 of the present invention.
  • FIG. 2 is a first lookup table LUT1 in Embodiment 1 of the present invention.
  • FIG. 3 is a second lookup table LUT2 in Embodiment 1 of the present invention.
  • FIG. 4 is a second lookup table LUT3 in Embodiment 1 of the present invention.
  • FIG. 5 is a second lookup table LUT4 in Embodiment 1 of the present invention.
  • FIG. 6 is a block diagram of a photographing apparatus in Embodiment 2 of the present invention.
  • FIG. 7 is a block diagram of an image processing apparatus in Embodiment 3 of the present invention.
  • a preferred embodiment of the image processing method in this embodiment includes the following steps.
  • Step S0 Adjust the brightness of the preview frame of the image to be shot.
  • This step is mainly used to adjust the brightness of the preview frame of the image to be shot to an appropriate brightness.
  • the reference factors for brightness adjustment include the combination of photographing environment (eg, photographing time, photographing weather) and photographing content (eg, sky, people, scenery), etc.
  • the brightness values of these combinations are empirical values.
  • the exposure amount EV is a combination of shutter time, ISO value and aperture.
  • the brightness of the preview frame of the image to be shot is adjusted by adjusting the shutter time.
  • Step S1 Obtain the initial exposure value EV0 of the preview frame of the picture to be shot.
  • Step S2 Calculate the first long exposure value EV1 according to the pixels whose brightness value of the preview frame is smaller than the first brightness threshold value Y1.
  • the brightness value of each pixel of the preview frame is first calculated, and then calculated according to the weighted total S1 of all pixels whose brightness value is less than the first brightness threshold Y1, the initial exposure value EV0 and the first lookup table LUT1.
  • the first brightness threshold Y1 is set to 64
  • the relative weight value of the brightness value of 1 is 10
  • the relative weight value of the brightness value of 64 is 2
  • the relative weight value of the brightness value of the pixel is set to 2-63
  • the corresponding data of the first look-up table LUT1 is shown in FIG. 2 .
  • the specific calculation process is as follows, the weighted total S1 is the index of the horizontal data, and the initial exposure value EV0 is the index of the vertical data. According to the actual weighted total S1 and the initial exposure value EV0, the four nearest values are found, and then the first four values are obtained by interpolation calculation. A long exposure value EV2. Similar calculations can also be used when the first luminance threshold Y1 takes other values.
  • Step S3 Calculate the first short exposure value EV2 according to the pixels whose brightness value of the preview frame is greater than the second brightness threshold value Y2.
  • This step is similar to S2, and the first short exposure value EV2 is calculated according to the number and weight of pixels whose luminance value is greater than the second luminance threshold value Y2, the initial exposure value EV0 and the second lookup table LUT2.
  • the second brightness threshold Y2 is set to 192
  • the relative weight value of the brightness value of 192 is 2
  • the relative weight value of the brightness value of 255 is 10
  • the relative weight value of the pixel brightness value of 193-254 is set between 2-10.
  • the specific calculation process is as follows, the weighted total S2 is the index of the horizontal data, and the initial exposure value EV0 is the index of the vertical data. According to the actual weighted total S2 and the initial exposure value EV0, the four nearest values are found, and then the first four values are obtained by interpolation calculation. A short exposure value EV2.
  • Step S4 Divide the preview frame into a plurality of frame blocks.
  • the manner of dividing the preview frame into multiple frame blocks is not limited.
  • the preview frame can be divided according to a fixed size, or it can be divided according to the shape of the object in the preview frame.
  • the preview frame is evenly divided into 16*16 frame blocks with the same size and shape.
  • Step S5 Calculate the second long exposure value EV3 according to the frame blocks whose average luminance value is less than the third luminance threshold value Y3.
  • the average brightness of each frame block in step S4 is first counted. If the average brightness of a certain frame block is less than the third brightness threshold Y3, it is included in the calculation of the second long exposure value EV3, and then based on these Calculate the weighted total S3 of the average brightness and weight of the block, and then calculate EV3 in combination with the initial exposure value EV0 and the third lookup table LUT3.
  • the data in the third lookup table LUT3 (Look-Up-Table) is empirical data, which can be based on actual conditions. make adjustments.
  • the weight value WG3[j] is related to the picture content of the frame block j and/or its position in the preview frame; generally, the closer the frame block is to the center of the preview frame, the higher the weight, and the picture content in the frame block is the main shot. Objects or people, the higher the weight.
  • the third luminance threshold Y3 is 32, of course, other values may also be used.
  • the specific calculation process of the second long exposure value EV3 is as follows, the weighted total S3 is the index of the horizontal data, the initial exposure value EV0 is the index of the vertical data, and the four nearest values are found according to the actual weighted total S3 and the initial exposure value EV0, Then, the second long exposure value EV3 is obtained through interpolation calculation.
  • Step S6 Calculate the second short exposure value EV4 according to the frame blocks whose average luminance value is greater than the fourth luminance threshold value Y4.
  • step S4 according to the average brightness of each frame block in step S4, if the average brightness of a certain frame block is greater than the fourth brightness threshold Y4, it is included in the calculation of the second short exposure value EV4, and then according to these blocks
  • the average brightness and weight are calculated by the weighted total number S4, and then EV4 is calculated in combination with the initial exposure value EV0 and the third look-up table LUT4.
  • the data in the fourth look-up table LUT4 (Look-Up-Table) is empirical data, which can be adjusted according to the actual situation. .
  • the calculation of the average brightness of the frame block may refer to step S4.
  • the weight value WG3[j] is related to the picture content of the frame block j and/or its position in the preview frame; generally, the closer the frame block is to the center of the preview frame, the higher the weight, and the picture content in the frame block is the main shot. Objects or people, the higher the weight.
  • the third luminance threshold Y4 is 224. Of course, other values are also possible.
  • the specific calculation process of the second short exposure value EV4 is as follows, the weighted total S4 is the index of the horizontal data, the initial exposure value EV0 is the index of the vertical data, and the four nearest values are found according to the actual weighted total S4 and the initial exposure value EV0, Then, the second short exposure value EV4 is obtained through interpolation calculation.
  • Step S7 Calculate the final long exposure value EV5 according to the first long exposure value EV1 and the second long exposure value EV3.
  • Step S8 Calculate the final short exposure value EV6 according to the first short exposure value EV2 and the second short exposure value EV4.
  • Step S9 Integrate the photos whose exposure values are the initial exposure value EV0, the final long exposure value EV5, and the final short exposure value EV6 to obtain an HDR photo.
  • the photographing device includes: a photographing module (such as a camera) for acquiring a picture to be shot; an acquiring module for acquiring an initial exposure value EV0 of a preview frame of the picture to be shot; a brightness adjustment module for acquiring a preview of the picture to be shot
  • the brightness of the preview frame is adjusted before the initial exposure value of the frame;
  • the first calculation module is used to calculate the first long exposure value EV1 according to the pixels whose brightness value of the preview frame is less than the first brightness threshold Y1;
  • the second calculation module is used for Calculate the first short exposure value EV2 according to the pixels whose brightness value of the preview frame is greater than the second brightness threshold Y2;
  • the segmentation module is used to divide the preview frame into a plurality of frame blocks;
  • the third calculation module is used to calculate the first short exposure value EV2 according to the average brightness value less than the first
  • processing procedures and corresponding parameters of each module are the same as or similar to those in Embodiment 1.
  • This embodiment discloses an image processing apparatus, which includes an electronic device or a server that has an image processing function but does not have a photographing module.
  • the image processing device includes: an image receiving module for receiving images to be shot, and these shooting images are obtained by a camera or a shooting terminal (such as a camera, a smart phone, a law enforcement recorder and other shooting terminals equipped with a camera), and the image receiving module includes but does not It is limited to Bluetooth module, NFC module, WIFI module, etc.; the acquisition module is used to obtain the initial exposure value EV0 of the preview frame of the picture to be shot; the brightness adjustment module is used to preview the preview frame before obtaining the initial exposure value of the preview frame of the picture to be shot.
  • the brightness of the frame is adjusted; the first calculation module is used to calculate the first long exposure value EV1 according to the pixels whose brightness value of the preview frame is less than the first brightness threshold Y1; the second calculation module is used to calculate the first long exposure value EV1 according to the brightness value of the preview frame greater than the first
  • the first short exposure value EV2 is calculated by the pixels of the second luminance threshold Y2; the segmentation module is used to divide the preview frame into a plurality of frame blocks; the third calculation module is used to calculate according to the frame blocks whose average luminance value is less than the third luminance threshold value Y3
  • the second long exposure value EV3; the fourth calculation module is used to calculate the second short exposure value EV4 according to the frame blocks whose average brightness value is greater than the fourth brightness threshold value Y4; the fifth calculation module is used to calculate the second short exposure value EV4 according to the first long exposure value EV1 and
  • the second long exposure value EV3 calculates the final long exposure value EV5; the sixth calculation module is
  • processing procedures and corresponding parameters of each module are the same as or similar to those in Embodiment 1.
  • This embodiment discloses a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the image processing method in Embodiment 1 is implemented.
  • the storage medium can be a computer-readable storage medium, for example, a ferroelectric memory (FRAM, Ferromagnetic Random Access Memory), Read Only Memory (ROM, Read Only Memory), Programmable Read Only Memory (PROM, Programmable Read Only Memory), Erasable Programmable Read Only Memory (EPROM, Erasable Programmable Read Only Memory), electrified Erasable programmable read only memory (EEPROM, Electrically Erasable Programmable Read Only Memory), flash memory, magnetic surface memory, optical disk, or compact disk read only memory (CD-ROM, Compact Disk-Read Only Memory) and other memories; can also include Various devices of one or any combination of the above memories.
  • FRAM ferroelectric memory
  • ROM Read Only Memory
  • PROM Programmable Read Only Memory
  • EPROM Erasable Programmable Read Only Memory
  • EEPROM Electrically Erasable Programmable Read Only Memory
  • flash memory magnetic surface memory, optical disk, or compact disk read only memory (CD-ROM, Compact Disk-Read Only Memory) and other memories
  • CD-ROM Compact Dis

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Studio Devices (AREA)

Abstract

本发明揭示了一种图像处理方法,包括:获取待拍摄画面的预览帧的初始曝光值EV0;根据预览帧的亮度值小于第一亮度阈值Y1的像素计算第一长曝光值EV1;根据预览帧的亮度值大于第二亮度阈值Y2的像素计算第一短曝光值EV2;将预览帧分割成多个帧块;根据平均亮度值小于第三亮度阈值Y3的帧块计算第二长曝光值EV3;根据平均亮度值大于第四亮度阈值Y4的帧块计算第二短曝光值EV4;根据第一长曝光值EV1和第二长曝光值EV3计算最终长曝光值EV5;根据第一短曝光值EV2和第二短曝光值EV4计算最终短曝光值EV6;将曝光值分别为初始曝光值EV0、最终长曝光值EV5以及最终短曝光值EV6的照片融合以得到HDR照片。与现有技术相比,本发明通过待拍摄画面的预览帧的整体亮度值及该预览帧的部分帧块亮度值以得到合适的EV间隔,拍摄出的HDR照片能够很好的保留了画面中亮处和暗部的细节,减少了多帧(7帧以上)HDR照片容易出现的伪像、拖影等问题,同时也提高了拍摄速度。

Description

[根据细则26改正11.04.2022] 图像处理方法、拍摄装置、图像处理装置及可读存储介质 技术领域
本申请涉及图像处理技术领域,具体涉及一种拍摄装置、图像处理装置及计算机可读存储介质。
背景技术
现有的具有拍摄功能的电子设备(如数码相机或智能手机)大都具备HDR功能(High-Dynamic Range,简称HDR),HDR技术主要是用户获得高质量的照片,也就是让照片的暗部细节清楚,以及让照片的亮部场景没有过度曝光。因此在使用HDR功能进行拍摄拍摄时,往往会使用动态曝光值(Exposure Values,EV)进行HDR算法合成,其中动态EV为HDR算法中的多个输入帧所对应的不同的EV,且EV根据不同场景自适应。
技术问题
然而,在现有的技术中,短曝光时间与长曝光时间大多采用固定值。换言之,无论在任何场景下,电子装置在拍摄时都会采用固定的短曝光时间以及长曝光时间去实现HDR。因此,在较为复杂的拍摄场景下使用固定的EV间隔进行拍摄,在拍摄的帧数比较少(3帧)的情况下,则无法完全覆盖各种环境,拍摄的照片效果不理想;在拍摄的帧数比较多(9帧)的情况下,则会导致拍摄过程耗时较长,电子设备算法合成的时间也比较长。此外,在拍摄帧数较多的情况下,如果拍摄时手抖了或者拍摄的画面内有运动物体的话也会导致一些严重拖影、伪像的问题。
因此,有必要对现有的图像处理方法进行改进。
技术解决方案
本发明的目的在于提供一种图像处理方法、拍摄装置、图像处理装置及计算机可读存储介质,旨在解决现有的拍摄HDR照片存在的缺陷。
第一方面,本发明提供了一种图像处理方法,该方法包括:
获取待拍摄画面的预览帧的初始曝光值EV0;
根据预览帧的亮度值小于第一亮度阈值Y1的像素计算第一长曝光值EV1;
根据预览帧的亮度值大于第二亮度阈值Y2的像素计算第一短曝光值EV2;
将预览帧分割成多个帧块;
根据平均亮度值小于第三亮度阈值Y3的帧块计算第二长曝光值EV3;
根据平均亮度值大于第四亮度阈值Y4的帧块计算第二短曝光值EV4;
根据第一长曝光值EV1和第二长曝光值EV3计算最终长曝光值EV5;
根据第一短曝光值EV2和第二短曝光值EV4计算最终短曝光值EV6;
将曝光值分别为初始曝光值EV0、最终长曝光值EV5以及最终短曝光值EV6的照片融合以得到HDR照片。
第二方面,本发明提供了一种拍摄装置,该装置包括:
拍摄模块,用于获取待拍摄画面;
获取模块,用于获取待拍摄画面的预览帧的初始曝光值EV0;
第一计算模块,用于根据预览帧的亮度值小于第一亮度阈值Y1的像素计算第一长曝光值EV1;
第二计算模块,用于根据预览帧的亮度值大于第二亮度阈值Y2的像素计算第一短曝光值EV2;
分割模块,用于将预览帧分割成多个帧块;
第三计算模块,用于根据平均亮度值小于第三亮度阈值Y3的帧块计算第二长曝光值EV3;
第四计算模块,用于根据平均亮度值大于第四亮度阈值Y4的帧块计算第二短曝光值EV4;
第五计算模块,用于根据第一长曝光值EV1和第二长曝光值EV3计算最终长曝光值EV5;
第六计算模块,用于根据第一短曝光值EV2和第二短曝光值EV4计算最终短曝光值EV6;
照片融合模块,用于将曝光值分别为初始曝光值EV0、最终长曝光值EV5以及最终短曝光值EV6的照片融合以得到HDR照片。
第三方面,本发明提供了一种图像处理装置,包括:
图像接收模块,用于接收待拍摄画面;
获取模块,用于获取待拍摄画面的预览帧的初始曝光值EV0;
第一计算模块,用于根据预览帧的亮度值小于第一亮度阈值Y1的像素计算第一长曝光值EV1;
第二计算模块,用于根据预览帧的亮度值大于第二亮度阈值Y2的像素计算第一短曝光值EV2;
分割模块,用于将预览帧分割成多个帧块;
第三计算模块,用于根据平均亮度值小于第三亮度阈值Y3的帧块计算第二长曝光值EV3;
第四计算模块,用于根据平均亮度值大于第四亮度阈值Y4的帧块计算第二短曝光值EV4;
第五计算模块,用于根据第一长曝光值EV1和第二长曝光值EV3计算最终长曝光值EV5;
第六计算模块,用于根据第一短曝光值EV2和第二短曝光值EV4计算最终短曝光值EV6;
照片融合模块,用于将曝光值分别为初始曝光值EV0、最终长曝光值EV5以及最终短 曝光值EV6的照片融合以得到HDR照片。
第四方面,本发明提供了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现上述图像处理方法。
技术效果
与现有技术相比,本发明通过待拍摄画面的预览帧的整体亮度值及该预览帧的部分帧块亮度值以得到合适的EV间隔,拍摄出的HDR照片能够很好的保留了画面中亮处和暗部的细节,减少了多帧(7帧以上)HDR照片容易出现的伪像、拖影等问题,同时也提高了拍摄速度。
附图说明
图1为本发明实施例1中的图像处理方法的流程图。
图2为本发明实施例1中的第一查找表LUT1。
图3为本发明实施例1中的第二查找表LUT2。
图4为本发明实施例1中的第二查找表LUT3。
图5为本发明实施例1中的第二查找表LUT4。
图6为本发明实施例2中的拍摄装置的框图。
图7为本发明实施例3中的图像处理装置的框图。
本发明的实施方式
为了使本发明的目的、技术方案及有益效果更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
为了说明本发明所述的技术方案,下面通过具体实施例来进行说明。
实施例1
如图1所示,本实施例中的图像处理方法的一个优选实施例包括以下步骤。
步骤S0:对待拍摄画面的预览帧的亮度进行调整。
该步骤主要用于将待拍摄画面的预览帧的亮度调整至合适亮度。亮度的调整参考的因素包括拍照环境(如拍摄时间、拍摄天气)以及拍摄内容(如天空、人物、景色)等的组合,这些组合的亮度值为经验值。待拍摄画面的预览帧的亮度调节可以通过以下方式来实现:假设当前图像的亮度为La,当前图像的曝光量为EVa,对应的拍摄场景的参考亮度为Lb,则下一次输出的曝光量EVb=EVa*Lb/La。其中,曝光量EV是快门时间、ISO值和光圈的组合,本实施例中是通过调整快门的时间来调节待拍摄画面的预览帧的亮度。
步骤S1:获取待拍摄画面的预览帧的初始曝光值EV0。
获取拍摄该拍摄画面的预览帧的拍摄装置的曝光参数,包括曝光时间T和曝光增益值G,并根据曝光时间和曝光计算该待拍摄画面的预览帧的初始曝光值EV0,计算公式为:EV0=T*G。
步骤S2:根据预览帧的亮度值小于第一亮度阈值Y1的像素计算第一长曝光值EV1。
具体地,先计算预览帧的每个像素的亮度值,再根据所有的亮度值小于第一亮度阈值Y1的像素的加权总数S1、初始曝光值EV0和第一查找表LUT1计算得到。
在本实施例中,对预览帧的各像素进行亮度直方图统计,收集亮度分布信息。具体为:将每个像素的RGB转成亮度值Y,RGB值的区间是0~255,像素的亮度值Y的计算公式为:Y=R*0.299+G*0.587+B*0.114,然后将每个亮度的对应的像素的数目进行统计及存储。
计算亮度值Y小于第一亮度阈值Y1的像素的加权总数S1,S1=∑H[i]*WG1[i],其中,i小于Y1,H[i]表示预览帧中的亮度值为i的像素的数目,WG1[i]为亮度值为i的像素的权重值。然后根据加权总数S1、预览帧的初始曝光值EV0、第一查找表LUT1计算出EV1。其中,权重值WG1[i]与像素的亮度值相关,亮度值越小,其权重越高,以计算出更合适的第一长曝光值EV1,第一查找表LUT1(Look-Up-Table)中的数据为经验数据,可以根据实际情况进行调整。
在本实施例中,第一亮度阈值Y1取64,亮度值为1的相对权重值为10,亮度值为64的相对权重值为2,像素的亮度值为2-63的相对权重值则设置在2-10之间,其对应的第一查找表LUT1的数据如图2所示。具体计算过程如下,加权总数S1为横向数据的索引,初始曝光值EV0为纵向数据的索引,根据实际的加权总数S1及初始曝光值EV0查找出最邻近的四个值,再通过插值计算得到第一长曝光值EV2。第一亮度阈值Y1取其他值时,也可以用类似计算。
步骤S3:根据预览帧的亮度值大于第二亮度阈值Y2的像素计算第一短曝光值EV2。
本步骤与S2类似,第一短曝光值EV2根据亮度值大于第二亮度阈值Y2的像素的数目及权重、初始曝光值EV0和第二查找表LUT2计算得到。
由于步骤S2中已完成预览帧中的各像素的亮度值的统计及存储,本步骤的实现过程如下:计算亮度值Y大于第二亮度值Y2的像素的加权总数S2,S2=∑H[i]*WG2[i],其中,i大于Y2,H[i]表示预览帧中的亮度值为i的像素的数目,WG2[i]为亮度值为i的像素的权重值。然后根据根据加权总数S2、预览帧的初始曝光值EV0、第二查找表LUT2计算出EV2。其中,权重值WG2[i]与像素的亮度值相关,亮度值越大,其权重越高,以计算出更合适的第一短曝光值EV2,同样地,第二查找表LUT2(Look-Up-Table)中的数据为经验数据,可以根据实际情况进行调整。
在本实施例中,第二亮度阈值Y2取192,亮度值为192的相对权重值为2,亮度值为255的相对权重值为10,像素的亮度值为193-254的相对权重值则设置在2-10之间。具体计算过程如下,加权总数S2为横向数据的索引,初始曝光值EV0为纵向数据的索引,根据实际的加权总数S2及初始曝光值EV0查找出最邻近的四个值,再通过插值计算得到第一短曝光值EV2。
步骤S4:将预览帧分割成多个帧块。
本步骤中,预览帧的分割成多个帧块的方式不限制。例如,可以将预览帧按固定的大小 进行分割,也可以根据预览帧中的物体形状进行分割。在本实施例中,将预览帧平均分成16*16的大小和形状都相同的帧块。
步骤S5:根据平均亮度值小于第三亮度阈值Y3的帧块计算第二长曝光值EV3。
本步骤中,先统计步骤S4中的每个帧块的平均亮度,如果某个帧块的平均亮度小于第三亮度阈值Y3,则将其列入第二长曝光值EV3的计算,然后根据这些块的平均亮度及权重的计算加权总数S3,再结合初始曝光值EV0及第三查找表LUT3计算EV3,第三查找表LUT3(Look-Up-Table)中的数据为经验数据,可以根据实际情况进行调整。
帧块的平均亮度计算可以通过以下公式计算得到:
Figure PCTCN2022080597-appb-000001
其中,m为帧块的像素总数目,P[k]为帧块中的第k个像素的亮度值,P[k]的范围为0-255,亮度值P[k]=R*0.299+G*0.587+B*0.114。
加权总数S3的计算方式为S3=∑L[j]*WG3[j],其中,L[j]为第j个帧块的平均亮度值,WG3[j]为第j个帧块的权重值,L[j]小于第三亮度阈值Y3。权重值WG3[j]和帧块j的画面内容和/或在预览帧中的位置相关;一般来说,帧块越靠近预览帧中心,其权重越高,帧块中的画面内容为主要拍摄物体或人物时,其权重越高。在本实施例中,第三亮度阈值Y3取32,当然,也可以取其他值。
第二长曝光值EV3具体计算过程如下,加权总数S3为横向数据的索引,初始曝光值EV0为纵向数据的索引,根据实际的加权总数S3及初始曝光值EV0查找出最邻近的四个值,再通过插值计算得到第二长曝光值EV3。
步骤S6:根据平均亮度值大于第四亮度阈值Y4的帧块计算第二短曝光值EV4。
本步骤中,根据步骤S4中的每个帧块的平均亮度,如果某个帧块的平均亮度大于第四亮度阈值Y4,则将其列入第二短曝光值EV4的计算,然后根据这些块的平均亮度及权重计算加权总数S4,再结合初始曝光值EV0及第三查找表LUT4计算EV4,第四查找表LUT4(Look-Up-Table)中的数据为经验数据,可以根据实际情况进行调整。帧块的平均亮度的 计算可参考步骤S4。
加权总数S4的计算方式为S4=∑L[j]*WG4[j],其中,L[j]为第j个帧块的平均亮度值,WG4[j]为第j个帧块的权重值。权重值WG3[j]和帧块j的画面内容和/或在预览帧中的位置相关;一般来说,帧块越靠近预览帧中心,其权重越高,帧块中的画面内容为主要拍摄物体或人物时,其权重越高。在本实施例中,第三亮度阈值Y4取224。当然,也可以取其他值。
第二短曝光值EV4具体计算过程如下,加权总数S4为横向数据的索引,初始曝光值EV0为纵向数据的索引,根据实际的加权总数S4及初始曝光值EV0查找出最邻近的四个值,再通过插值计算得到第二短曝光值EV4。
步骤S7:根据第一长曝光值EV1和第二长曝光值EV3计算最终长曝光值EV5。
最终长曝光值EV5的计算公式为:EV5=EV1*r+EV3*(1-r1),r1为权重调节系数,可根据拍摄者对照片的整体及局部的关注度的不同以进行调节。本实施例中,r1取0.5,即EV5=(EV1+EV3)/2。
步骤S8:根据第一短曝光值EV2和第二短曝光值EV4计算最终短曝光值EV6。
最终短曝光值EV6的计算公式为:EV6=EV2*r2+EV4*(1-r2),r2为权重调节系数,可根据拍摄者对照片的整体及局部的关注度的不同以进行调节。本实施例中,r2取0.5,即EV6=(EV2+EV4)/2。
步骤S9:将曝光值分别为初始曝光值EV0、最终长曝光值EV5以及最终短曝光值EV6的照片融合以得到HDR照片。
将曝光值分别设置为初始曝光值EV0、最终长曝光值EV5以及最终短曝光值EV6,对待拍摄画面各拍摄一张照片,然后再将这三张照片进行融合处理以以得到HDR照片。
需要说明的是,本实施例中的各步骤的实施过程不一定按照标号顺序先后进行,除非该步骤必须依赖于前面的一个步骤或多个步骤。
实施例2
本实施例中揭示了一种拍摄装置,包括但不限于智能手机、相机或执法记录仪等拍摄终端。该拍摄装置包括:拍摄模块(如摄像头),用于获取待拍摄画面;获取模块,用于获取待拍摄画面的预览帧的初始曝光值EV0;亮度调整模块,用于在获取待拍摄画面的预览帧的初始曝光值之前对预览帧的亮度进行调整;第一计算模块,用于根据预览帧的亮度值小于第一亮度阈值Y1的像素计算第一长曝光值EV1;第二计算模块,用于根据预览帧的亮度值大于第二亮度阈值Y2的像素计算第一短曝光值EV2;分割模块,用于将预览帧分割成多个帧块;第三计算模块,用于根据平均亮度值小于第三亮度阈值Y3的帧块计算第二长曝光值EV3;第四计算模块,用于根据平均亮度值大于第四亮度阈值Y4的帧块计算第二短曝光值EV4;第五计算模块,用于根据第一长曝光值EV1和第二长曝光值EV3计算最终长曝光值EV5;第六计算模块,用于根据第一短曝光值EV2和第二短曝光值EV4计算最终短曝光值EV6;照片融合模块,用于将曝光值分别为初始曝光值EV0、最终长曝光值EV5以及最终短曝光值EV6的照片融合以得到HDR照片。
本实施例中,各模块的处理过程和对应的参数与实施例1中的相同或相似。
实施例3
本实施例中揭示了一种图像处理装置,包括具备图像处理功能但没有拍摄模块的电子设备或服务器。该图像处理装置包括:图像接收模块,用于接收待拍摄画面,这些拍摄画面通过摄像头或拍摄终端(如相机、智能手机、执法记录仪等具备摄像头的拍摄终端)获得,图像接收模块包括但不限于蓝牙模块、NFC模块、WIFI模块等;获取模块,用于获取待拍摄画面的预览帧的初始曝光值EV0;亮度调整模块,用于在获取待拍摄画面的预览帧的初始曝光值之前对预览帧的亮度进行调整;第一计算模块,用于根据预览帧的亮度值小于第一亮度阈值Y1的像素计算第一长曝光值EV1;第二计算模块,用于根据预览帧的亮度值大于第二亮度阈值Y2的像素计算第一短曝光值EV2;分割模块,用于将预览帧分割成多个帧块;第三计算模块,用于根据平均亮度值小于第三亮度阈值Y3的帧块计算第二长曝光值EV3;第 四计算模块,用于根据平均亮度值大于第四亮度阈值Y4的帧块计算第二短曝光值EV4;第五计算模块,用于根据第一长曝光值EV1和第二长曝光值EV3计算最终长曝光值EV5;第六计算模块,用于根据第一短曝光值EV2和第二短曝光值EV4计算最终短曝光值EV6;照片融合模块,用于将曝光值分别为初始曝光值EV0、最终长曝光值EV5以及最终短曝光值EV6的照片融合以得到HDR照片;图像发送模块,用于将HDR照片发送至其他终端,这里的其他终端包括但不限于拍摄终端。
本实施例中,各模块的处理过程和对应的参数与实施例1中的相同或相似。
实施例4
本实施例揭示了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现实施例1中的图像处理方法。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,存储介质可以是计算机可读存储介质,例如,铁电存储器(FRAM,Ferromagnetic Random Access Memory)、只读存储器(ROM,Read Only Memory)、可编程只读存储器(PROM,Programmable Read Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read Only Memory)、带电可擦可编程只读存储器(EEPROM,Electrically Erasable Programmable Read Only Memory)、闪存、磁表面存储器、光盘、或光盘只读存储器(CD-ROM,Compact Disk-Read Only Memory)等存储器;也可以是包括上述存储器之一或任意组合的各种设备。
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。

Claims (13)

  1. 一种图像处理方法,其特征在于,包括:
    获取待拍摄画面的预览帧的初始曝光值EV0;
    根据预览帧的亮度值小于第一亮度阈值Y1的像素计算第一长曝光值EV1;
    根据预览帧的亮度值大于第二亮度阈值Y2的像素计算第一短曝光值EV2;
    将预览帧分割成多个帧块;
    根据平均亮度值小于第三亮度阈值Y3的帧块计算第二长曝光值EV3;
    根据平均亮度值大于第四亮度阈值Y4的帧块计算第二短曝光值EV4;
    根据第一长曝光值EV1和第二长曝光值EV3计算最终长曝光值EV5;
    根据第一短曝光值EV2和第二短曝光值EV4计算最终短曝光值EV6;
    将曝光值分别为初始曝光值EV0、最终长曝光值EV5以及最终短曝光值EV6的照片融合以得到HDR照片。
  2. 如权利要求1所述的图像处理方法,其特征在于,在获取待拍摄画面的预览帧的初始曝光值之前,对待拍摄画面的预览帧的亮度进行调整。
  3. 如权利要求1所述的图像处理方法,其特征在于,所述根据预览帧的亮度值小于第一亮度阈值的像素计算第一长曝光值EV1具体为:计算预览帧的亮度值小于第一亮度阈值Y1的像素的加权总数S1,S1=∑H[i]*WG1[i],其中,i小于Y1,H[i]表示预览帧中的亮度值为i的像素的数目,WG1[i]为亮度值为i的像素的权重值,再根据亮度值小于第一亮度阈值Y1的像素的亮度值及权重、初始曝光值EV0和第一查找表LUT1计算得到。
  4. 如权利要求1所述的图像处理方法,其特征在于,所述根据预览帧的亮度值大于第二亮度阈值Y2的像素计算第一短曝光值EV2具体为:计算预览帧的亮度值大于第二亮度值Y2的像素的加权总数S2,S2=∑H[i]*WG2[i],其中,i大于Y2,H[i]表示预览帧中的亮度值为i的像素的数目,WG2[i]为亮度值为i的像素的权重值,再根据亮度值大于第二亮度阈 值Y2的像素的亮度值及权重、初始曝光值EV0和第二查找表LUT2计算得到。
  5. 如权利要求1所述的图像处理方法,其特征在于,所述将预览帧分割成多个帧块包括:将预览帧分割成多个形状相同的帧块或根据预览帧中的物体将预览帧分割成多个帧块。
  6. 如权利要求1所述的图像处理方法,其特征在于,所述根据平均亮度值小于第三亮度阈值Y3的帧块计算第二长曝光值EV3具体为:计算每个帧块的平均亮度值,再根据平均亮度值小于第三亮度阈值Y3的帧块的平均亮度值及权重的加权总数、初始曝光值EV0和第三查找表LUT3计算得到。
  7. 如权利要求1所述的图像处理方法,其特征在于,所述根据平均亮度值大于第四亮度阈值Y4的帧块计算第二短曝光值EV4具体为:计算每个帧块的平均亮度值,再根据平均亮度值大于第四亮度阈值Y4的帧块的平均亮度值及权重的加权总数、初始曝光值EV0和第四查找表LUT4计算得到。
  8. 一种拍摄装置,其特征在于,包括:
    拍摄模块,用于获取待拍摄画面;
    获取模块,用于获取待拍摄画面的预览帧的初始曝光值EV0;
    第一计算模块,用于根据预览帧的亮度值小于第一亮度阈值Y1的像素计算第一长曝光值EV1;
    第二计算模块,用于根据预览帧的亮度值大于第二亮度阈值Y2的像素计算第一短曝光值EV2;
    分割模块,用于将预览帧分割成多个帧块;
    第三计算模块,用于根据平均亮度值小于第三亮度阈值Y3的帧块计算第二长曝光值EV3;
    第四计算模块,用于根据平均亮度值大于第四亮度阈值Y4的帧块计算第二短曝光值EV4;
    第五计算模块,用于根据第一长曝光值EV1和第二长曝光值EV3计算最终长曝光值EV5;
    第六计算模块,用于根据第一短曝光值EV2和第二短曝光值EV4计算最终短曝光值EV6;
    照片融合模块,用于将曝光值分别为初始曝光值EV0、最终长曝光值EV5以及最终短曝光值EV6的照片融合以得到HDR照片。
  9. 如权利要求8所述的拍摄装置,其特征在于,还包括:
    亮度调整模块,用于在获取待拍摄画面的预览帧的初始曝光值之前对预览帧的亮度进行调整。
  10. 一种图像处理装置,其特征在于,包括:
    图像接收模块,用于接收待拍摄画面;
    获取模块,用于获取待拍摄画面的预览帧的初始曝光值EV0;
    第一计算模块,用于根据预览帧的亮度值小于第一亮度阈值Y1的像素计算第一长曝光值EV1;
    第二计算模块,用于根据预览帧的亮度值大于第二亮度阈值Y2的像素计算第一短曝光值EV2;
    分割模块,用于将预览帧分割成多个帧块;
    第三计算模块,用于根据平均亮度值小于第三亮度阈值Y3的帧块计算第二长曝光值EV3;
    第四计算模块,用于根据平均亮度值大于第四亮度阈值Y4的帧块计算第二短曝光值EV4;
    第五计算模块,用于根据第一长曝光值EV1和第二长曝光值EV3计算最终长曝光值EV5;
    第六计算模块,用于根据第一短曝光值EV2和第二短曝光值EV4计算最终短曝光值EV6;
    照片融合模块,用于将曝光值分别为初始曝光值EV0、最终长曝光值EV5以及最终短曝光值EV6的照片融合以得到HDR照片。
  11. 如权利要求10所述的图像处理装置,其特征在于,还包括:
    亮度调整模块,用于在获取待拍摄画面的预览帧的初始曝光值之前对预览帧的亮度进行调整。
  12. 如权利要求10所述的图像处理装置,其特征在于,还包括:
    图像发送模块,用于将HDR照片发送至其他终端。
  13. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现权利要求1至7中任一项所述的图像处理方法。
PCT/CN2022/080597 2021-03-27 2022-03-14 图像处理方法、拍摄装置、图像处理装置及可读存储介质 WO2022206353A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110328957.9 2021-03-27
CN202110328957.9A CN115134508A (zh) 2021-03-27 2021-03-27 图像处理方法、拍摄装置、图像处理装置及可读存储介质

Publications (1)

Publication Number Publication Date
WO2022206353A1 true WO2022206353A1 (zh) 2022-10-06

Family

ID=83374848

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/080597 WO2022206353A1 (zh) 2021-03-27 2022-03-14 图像处理方法、拍摄装置、图像处理装置及可读存储介质

Country Status (2)

Country Link
CN (1) CN115134508A (zh)
WO (1) WO2022206353A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115412678A (zh) * 2022-10-20 2022-11-29 荣耀终端有限公司 曝光处理方法、装置及电子设备

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117440253B (zh) * 2023-12-22 2024-07-09 荣耀终端有限公司 图像处理方法和相关装置
CN117499779B (zh) * 2023-12-27 2024-05-10 荣耀终端有限公司 一种图像预览方法、设备以及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007053617A (ja) * 2005-08-18 2007-03-01 Fujifilm Holdings Corp 露出値演算方法及び撮像装置
CN102143326A (zh) * 2010-01-28 2011-08-03 比亚迪股份有限公司 一种自动曝光装置及其方法
US20130307922A1 (en) * 2012-05-17 2013-11-21 Hong-Long Chou Image pickup device and image synthesis method thereof
CN105578068A (zh) * 2015-12-21 2016-05-11 广东欧珀移动通信有限公司 一种高动态范围图像的生成方法、装置及移动终端
CN106791472A (zh) * 2016-12-29 2017-05-31 努比亚技术有限公司 一种曝光方法及终端
US10855931B1 (en) * 2019-11-07 2020-12-01 Novatek Microelectronics Corp. High dynamic range image sensing method for image sensing device
CN112219391A (zh) * 2018-06-07 2021-01-12 杜比实验室特许公司 从单拍摄hdr彩色图像传感器生成hdr图像

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007053617A (ja) * 2005-08-18 2007-03-01 Fujifilm Holdings Corp 露出値演算方法及び撮像装置
CN102143326A (zh) * 2010-01-28 2011-08-03 比亚迪股份有限公司 一种自动曝光装置及其方法
US20130307922A1 (en) * 2012-05-17 2013-11-21 Hong-Long Chou Image pickup device and image synthesis method thereof
CN105578068A (zh) * 2015-12-21 2016-05-11 广东欧珀移动通信有限公司 一种高动态范围图像的生成方法、装置及移动终端
CN106791472A (zh) * 2016-12-29 2017-05-31 努比亚技术有限公司 一种曝光方法及终端
CN112219391A (zh) * 2018-06-07 2021-01-12 杜比实验室特许公司 从单拍摄hdr彩色图像传感器生成hdr图像
US10855931B1 (en) * 2019-11-07 2020-12-01 Novatek Microelectronics Corp. High dynamic range image sensing method for image sensing device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115412678A (zh) * 2022-10-20 2022-11-29 荣耀终端有限公司 曝光处理方法、装置及电子设备

Also Published As

Publication number Publication date
CN115134508A (zh) 2022-09-30

Similar Documents

Publication Publication Date Title
WO2022206353A1 (zh) 图像处理方法、拍摄装置、图像处理装置及可读存储介质
EP3723035A1 (en) Method and apparatus for image processing
CN111418201B (zh) 一种拍摄方法及设备
US10171786B2 (en) Lens shading modulation
US9613408B2 (en) High dynamic range image composition using multiple images
CN107925751B (zh) 用于多视点降噪和高动态范围的系统和方法
CN105208281B (zh) 一种夜景拍摄方法及装置
TWI602152B (zh) 影像擷取裝置及其影像處理方法
US9710895B2 (en) Image processing device, image capture device, image processing method, and program
JP2014078926A (ja) 画像調整装置、画像調整方法およびプログラム
WO2022253014A1 (zh) 水下图像色彩还原方法和装置
WO2020143257A1 (zh) 一种抗运动伪影的hdr方法及便携式终端
WO2019223635A1 (zh) 一种抗运动鬼影的hdr方法及便携式终端
CN107613190B (zh) 一种拍照方法及终端
CN105578062A (zh) 测光模式的选择方法与其图像获取装置
CN107682611B (zh) 对焦的方法、装置、计算机可读存储介质和电子设备
EP3179716B1 (en) Image processing method, computer storage medium, device, and terminal
WO2015192545A1 (zh) 拍照的方法、装置及计算机存储介质
CN117135293B (zh) 图像处理方法和电子设备
CN112598609A (zh) 一种动态图像的处理方法及装置
WO2023000878A1 (zh) 拍摄方法、装置、控制器、设备和计算机可读存储介质
EP2446414B1 (en) Lens roll-off correction operation using values corrected based on brightness information
CN116437222B (zh) 图像处理方法与电子设备
CN113870300A (zh) 图像处理方法、装置、电子设备及可读存储介质
JP2017068513A (ja) 画像処理装置及びその方法、プログラム、記憶媒体

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22778537

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22778537

Country of ref document: EP

Kind code of ref document: A1