CN113382169B - A photographing method and electronic device - Google Patents

A photographing method and electronic device Download PDF

Info

Publication number
CN113382169B
CN113382169B CN202110681582.4A CN202110681582A CN113382169B CN 113382169 B CN113382169 B CN 113382169B CN 202110681582 A CN202110681582 A CN 202110681582A CN 113382169 B CN113382169 B CN 113382169B
Authority
CN
China
Prior art keywords
image
images
electronic device
exposure
exposure parameters
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.)
Active
Application number
CN202110681582.4A
Other languages
Chinese (zh)
Other versions
CN113382169A (en
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 Ltd filed Critical Honor Device Co Ltd
Priority to CN202110681582.4A priority Critical patent/CN113382169B/en
Publication of CN113382169A publication Critical patent/CN113382169A/en
Application granted granted Critical
Publication of CN113382169B publication Critical patent/CN113382169B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • 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
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters
    • 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
    • H04N23/741Circuitry for compensating brightness variation in the scene by increasing the dynamic range of the image compared to the dynamic range of the electronic image sensors
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/265Mixing

Landscapes

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

Abstract

The application provides a photographing method and electronic equipment, and relates to the field of image processing. The method can shorten the photographing time and improve the user experience. The method comprises the following steps: in a photographing preview mode, collecting an image; after a first operation of a user for photographing is received, generating a composite image by using M frames of images containing a first acquisition image; the first collected image is an image collected in a photographing preview mode, the first collected image comprises at least one image with exposure parameters, M frames of images comprise N images with exposure parameters, and M and N are positive integers larger than 1 respectively. The method and the device are applied to photographing.

Description

一种拍照方法及电子设备A photographing method and electronic device

技术领域technical field

本申请涉及图像处理领域,尤其涉及一种拍照方法及电子设备。The present application relates to the field of image processing, in particular to a photographing method and electronic equipment.

背景技术Background technique

在实际环境中,可观测到的亮度差即最亮的物体亮度和最暗的物体亮度之比约为108,人类的眼睛所能够看到的最大亮度差约为105,而目前的图像显示设备、图像采集设备如显示器、照相机能表示的只有256种不同的亮度。因此,在用照相机拍摄时,一方面,可以通过减少照相机的曝光量,来使照片表现更多的暗处细节,但这样会牺牲亮度大的画面部分的细节;另一方面,可以通过增加照相机的曝光量,来使照片表现更多的亮处细节,但这样会牺牲亮度小的画面部分的细节。In the actual environment, the observable brightness difference, that is, the ratio of the brightness of the brightest object to the brightness of the darkest object is about 10 8 , and the maximum brightness difference that human eyes can see is about 10 5 , while the current image There are only 256 different brightnesses that can be represented by display devices and image acquisition devices such as monitors and cameras. Therefore, when shooting with a camera, on the one hand, you can reduce the exposure of the camera to make the photos show more details in dark places, but this will sacrifice the details of the brighter picture parts; Increase the exposure to make the photo show more details in bright places, but this will sacrifice the details of the parts of the picture with less brightness.

为了使照片能够表现更多的动态范围和画面细节,高动态范围(high-dynamicrange,HDR)技术应运而生。具体的,HDR通过连续拍摄多张照片,这些照片的曝光量依次增大(或减小),然后将这些照片进行融合,这样一来便可得到既包括亮处细节也包括暗处细节的照片。In order to enable photos to show more dynamic range and picture details, high-dynamic range (high-dynamic range, HDR) technology came into being. Specifically, HDR takes multiple photos continuously, the exposure of these photos increases (or decreases) in turn, and then these photos are fused, so that you can get photos that include both bright details and dark details. .

但由于HDR需要采集多张照片并且还需要对多张照片进行融合,整个流程的时间花费较大,因此导致拍照时间过长,影响用户使用体验。However, because HDR needs to collect multiple photos and also need to fuse multiple photos, the entire process takes a lot of time, which leads to a long time for taking pictures and affects the user experience.

发明内容Contents of the invention

本申请实施例提供一种拍照方法及电子设备,用于缩短拍照时间。Embodiments of the present application provide a photographing method and an electronic device for shortening the photographing time.

第一方面,提供一种拍照方法,包括:在拍照预览模式下,采集图像;在接收到用户用于拍照的第一操作后,利用包含第一采集图像的M帧图像,生成合成图像;其中,第一采集图像为在拍照预览模式下采集的图像,M帧图像中包括N种曝光参数的图像,M和N分别为大于1的正整数。本申请上述方法中,在接收到用户的第一操作后,能够利用在第一操作前采集的至少一种曝光参数的第一采集图像,来生成合成图像。这样一来,可以避免电子设备在接收第一操作之后,需要花费时间采集上述至少一种曝光参数(即第一采集图像的曝光参数)的图像,从而缩短了电子设备的出图时间,提高用户使用体验。In the first aspect, a photographing method is provided, including: capturing an image in the photographing preview mode; after receiving a first user operation for photographing, using M frames of images containing the first captured image to generate a composite image; wherein , the first captured image is an image captured in the photo preview mode, M frames of images include images of N kinds of exposure parameters, and M and N are positive integers greater than 1, respectively. In the above method of the present application, after receiving the first operation of the user, the composite image can be generated by using the first collected image of at least one exposure parameter collected before the first operation. In this way, it can avoid that the electronic device needs to spend time collecting images of the at least one exposure parameter (ie, the exposure parameter of the first collected image) after receiving the first operation, thereby shortening the drawing time of the electronic device and improving the user experience. Use experience.

在一种可能的设计中,该方法还包括:在接收第一操作之后采集第二采集图像。利用包含第一采集图像的M帧图像,生成合成图像,包括:利用第一采集图像和第二采集图像,生成合成图像;第一采集图像和第二采集图像中包括N种曝光参数的图像。上述设计中,通过利用在接收第一操作之前采集的第一采集图像和在接收第一操作之后采集的第二采集图像生成合成图像的这一方式,一方面可以避免在接收第一操作之后花费时间采集上述至少一种曝光参数(即第一采集图像的曝光参数)的图像,缩短了电子设备的出图时间;另一方面,还可以在接收第一操作后,根据当前的拍照需求,采集除上述至少一种曝光参数(即第一采集图像的曝光参数)之外其他曝光参数的第二采集图像,并利用第一采集图像和第二采集图像生成合成图像,这样可以提高最终合成图像的成像效果。In a possible design, the method further includes: acquiring a second acquired image after receiving the first operation. Using M frames of images including the first captured image to generate a composite image includes: using the first captured image and the second captured image to generate a composite image; the first captured image and the second captured image include images of N kinds of exposure parameters. In the above design, by using the first captured image captured before receiving the first operation and the second captured image captured after receiving the first operation to generate a composite image, on the one hand, it is possible to avoid spending a lot of money after receiving the first operation. Acquire the image of the above-mentioned at least one exposure parameter (that is, the exposure parameter of the first acquired image) in time, shortening the drawing time of the electronic device; on the other hand, after receiving the first operation, according to the current photographing demand, acquire In addition to the above-mentioned at least one exposure parameter (ie, the exposure parameter of the first captured image), the second captured image of other exposure parameters, and use the first captured image and the second captured image to generate a composite image, which can improve the quality of the final composite image Imaging effect.

在一种可能的设计中,第一采集图像为第一曝光参数的图像;第二采集图像中包括N种曝光参数中除第一曝光参数之外的曝光参数的图像。上述设计中,考虑到一些应用场景下,电子设备在拍照预览模式下只采集一种曝光参数(即上述第一曝光参数)的图像,此时可以通过在接收第一操作后采集第二采集图像(即N种曝光参数中除第一曝光参数之外的曝光参数的图像)的方式,采集到除第一采集图像之外生成合成图像所需要的其他图像,然后再生成合成图像,从而达到缩短电子设备的出图时间,提高用户使用体验的效果。In a possible design, the first captured image is an image of a first exposure parameter; the second captured image includes images of exposure parameters of N kinds of exposure parameters except the first exposure parameter. In the above design, considering that in some application scenarios, the electronic device only captures an image with one exposure parameter (namely the first exposure parameter) in the photo preview mode, at this time, the second captured image can be captured after receiving the first operation (that is, images of exposure parameters other than the first exposure parameter among N kinds of exposure parameters), collect other images required to generate a composite image except the first captured image, and then generate a composite image, thereby achieving shortening The drawing time of electronic equipment improves the effect of user experience.

在一种可能的设计中,第一曝光参数为图像正常曝光情况下的第一曝光参数。In a possible design, the first exposure parameter is the first exposure parameter under normal exposure of the image.

在一种可能的设计中,第一采集图像包括:W种曝光参数的图像;第二采集图像中包括N种曝光参数中除W种曝光参数之外的曝光参数的图像。上述设计中,考虑到一些应用场景下,电子设备在拍照预览模式下可以采集多种曝光参数(即W种曝光参数)的图像,此时可以通过在接收第一操作后采集第二采集图像(即N种曝光参数中除W种曝光参数之外的曝光参数的图像)的方式,采集到除第一采集图像之外生成合成图像所需要的其他图像,然后再生成合成图像,从而达到缩短电子设备的出图时间,提高用户使用体验的效果。In a possible design, the first collected image includes: images of W kinds of exposure parameters; the second collected image includes images of exposure parameters other than the W kinds of exposure parameters among the N kinds of exposure parameters. In the above design, considering some application scenarios, the electronic device can collect images of various exposure parameters (that is, W kinds of exposure parameters) in the photo preview mode. At this time, the second collection image can be collected after receiving the first operation ( That is, the image of the exposure parameters other than the W exposure parameters in the N exposure parameters) is used to collect other images required to generate the composite image except the first captured image, and then generate the composite image, thereby shortening the electronic The drawing time of the device can improve the effect of user experience.

在一种可能的设计中,在拍照预览模式下,采集图像,包括:在拍照预览模式下,采集N种曝光参数的图像。利用包含第一采集图像的M帧图像,生成合成图像,包括:融合第一采集图像,生成合成图像;第一采集图像中包括N种曝光参数的图像。上述设计中,考虑到一些应用场景下,电子设备在拍照预览模式下可以采集多种曝光参数,因此可以通过在拍照预览模式下采集足够生成合成图像的全部图像,这样一来在接收到第一操作后,只需要利用已经采集到的图像进行生成合同图像,而不需要花费时间采集图像,从而进一步缩短电子设备的出图时间,提高用户使用体验。In a possible design, in the photo preview mode, collecting images includes: in the photo preview mode, collecting images of N kinds of exposure parameters. Using M frames of images including the first collected image to generate a composite image includes: fusing the first collected image to generate a composite image; the first collected image includes images of N kinds of exposure parameters. In the above design, it is considered that in some application scenarios, the electronic device can collect various exposure parameters in the photo preview mode, so it is possible to collect all the images enough to generate a composite image in the photo preview mode, so that after receiving the first After the operation, it only needs to use the collected images to generate the contract images without spending time collecting images, thereby further shortening the drawing time of the electronic device and improving the user experience.

在一种可能的设计中,该方法还包括:在拍照预览模式下,显示预览图像;预览图像为融合Q种曝光参数的图像所生成的图像;其中,Q小于N。上述设计中,由于在拍照预览模式下所显示的预览图像是融合Q种曝光参数的图像所生成的图像,相比于融合N种曝光参数的图像所生成的图像而言,上述预览图像具有需要占用的系统资源更少、生成的速度更快等优点,所以通过上述设计可以达到在拍照预览模式下节省系统资源、保证预览图像显示的流畅性的效果。In a possible design, the method further includes: displaying a preview image in the photo preview mode; the preview image is an image generated by fusing Q kinds of exposure parameters; wherein, Q is less than N. In the above design, since the preview image displayed in the photo preview mode is an image generated by fusing Q kinds of exposure parameters, compared with the image generated by fusing N kinds of exposure parameters, the above-mentioned preview image has the need Occupying fewer system resources and faster generation speed, etc., so the above design can achieve the effect of saving system resources in the photo preview mode and ensuring the smoothness of preview image display.

在一种可能的设计中,第一采集图像为利用交错高动态范围Stagger HDR技术采集的图像。通过上述设计,可以实现在采用Stagger HDR技术的电子设备上,达到缩短电子设备的出图时间,提高用户使用体验的效果。In a possible design, the first collected image is an image collected by using an interleaved high dynamic range Stagger HDR technology. Through the above design, it can be implemented on electronic devices using Stagger HDR technology to shorten the drawing time of electronic devices and improve user experience.

在一种可能的设计中,第一采集图像为利用双转换增益DCG技术采集的图像。通过上述设计,可以实现在采用DCG技术的电子设备上,达到缩短电子设备的出图时间,提高用户使用体验的效果。In a possible design, the first acquired image is an image acquired by using a dual conversion gain DCG technique. Through the above design, it can be implemented on the electronic equipment adopting the DCG technology to shorten the drawing time of the electronic equipment and improve the user experience.

在一种可能的设计中,方法还包括:确定第一采集图像是否满足预设条件;预设条件包括以下至少一项:图像中物体的运动速度小于第一阈值、拍摄图像时电子设备的抖动幅度小于第二阈值、拍摄图像时自动对焦功能收敛和拍摄图像时自动曝光功能收敛。利用包含第一采集图像的M帧图像,生成合成图像,包括:在确定第一采集图像满足预设条件之后,利用包含第一采集图像的M帧图像,生成合成图像。通过上述设计,可以保证用于生成合成图像的第一采集图像的图像质量,进而降低最终生成的合成图像中出现鬼影、抖动等现象的可能性。In a possible design, the method further includes: determining whether the first captured image satisfies a preset condition; the preset condition includes at least one of the following: the moving speed of the object in the image is less than a first threshold, and the shaking of the electronic device when the image is taken If the amplitude is smaller than the second threshold value, the autofocus function converges when the image is captured and the auto exposure function converges when the image is captured. Using the M frames of images including the first captured image to generate a composite image includes: after determining that the first captured image satisfies a preset condition, using the M frames of images including the first captured image to generate a composite image. Through the above design, the image quality of the first captured image used to generate the composite image can be guaranteed, thereby reducing the possibility of ghosting, jitter and the like in the finally generated composite image.

在一种可能的设计中,第一采集图像为接收到用户用于拍照的第一操作前,最后存入ZSL buffer零秒延迟缓存中的图像。在上述设计中,通过选择ZSLbuffer中最接近的图像作为用于生成合成图像的第一采集图像,这样一来可以减小用于生成合成图像的各图像的间隔时长,降低最终生成的合成图像中出现鬼影、抖动等现象的可能性、提高生成合成图像的成功率。In a possible design, the first captured image is the last image stored in the zero-second delay buffer of the ZSL buffer before receiving the user's first operation for taking pictures. In the above design, by selecting the closest image in the ZSLbuffer as the first captured image used to generate the composite image, the interval between each image used to generate the composite image can be reduced, and the final generated composite image can be reduced. The possibility of ghosting, shaking and other phenomena will increase the success rate of generating composite images.

在一种可能的设计中,该方法还包括:从P帧图像中确定满足预设条件的第一采集图像。其中,P帧图像为在拍照预览模式下采集的图像,预设条件包括以下至少一项:图像中物体的运动速度小于第一阈值、拍摄图像时电子设备的抖动幅度小于第二阈值、拍摄图像时自动对焦功能收敛和拍摄图像时自动曝光功能收敛。通过上述设计,可以保证用于生成合成图像的第一采集图像的图像质量,进而降低最终生成的合成图像中出现鬼影、抖动等现象的可能性。In a possible design, the method further includes: determining a first captured image satisfying a preset condition from the P frame images. Wherein, the P frames of images are images collected in the photo preview mode, and the preset conditions include at least one of the following: the moving speed of the object in the image is less than the first threshold, the shaking amplitude of the electronic device when the image is taken is less than the second threshold, and the image is taken The autofocus function converges when the image is captured and the autoexposure function converges when the image is captured. Through the above design, the image quality of the first captured image used to generate the composite image can be guaranteed, thereby reducing the possibility of ghosting, jitter and the like in the finally generated composite image.

在一种可能的设计中,P帧图像为接收到用户用于拍照的第一操作后,最近存入ZSL buffer零秒延迟缓存中的图像。这样一来可以减小用于生成合成图像的各图像的间隔时长,降低最终生成的合成图像中出现鬼影、抖动等现象的可能性、提高生成合成图像的成功率。In a possible design, the P-frame image is the image that is recently stored in the ZSL buffer zero-second delay cache after receiving the user's first operation for taking pictures. In this way, the time interval between images used to generate the composite image can be reduced, the possibility of phenomena such as ghosting and shaking in the finally generated composite image can be reduced, and the success rate of generating the composite image can be improved.

第二方面,提高一种电子设备,包括:图像采集单元,用于在拍照预览模式下,采集图像;图像处理单元,用于在接收到用户用于拍照的第一操作后,利用包含第一采集图像的M帧图像,生成合成图像;其中,第一采集图像为在拍照预览模式下采集的图像,M帧图像中包括N种曝光参数的图像,M和N分别为大于1的正整数。In the second aspect, an electronic device is improved, including: an image acquisition unit, configured to acquire images in the photo preview mode; an image processing unit, configured to use the first operation including the first Collect M frames of images of the image to generate a composite image; wherein, the first captured image is an image collected in the photo preview mode, and the M frames of images include images of N kinds of exposure parameters, and M and N are positive integers greater than 1 respectively.

在一种可能的设计中,图像采集单元还用于在接收第一操作之后采集第二采集图像;图像处理单元,用于在接收到用户用于拍照的第一操作后,利用包含第一采集图像的M帧图像,生成合成图像,包括:图像处理单元,具体用于利用第一采集图像和第二采集图像,生成合成图像;第一采集图像和第二采集图像中包括N种曝光参数的图像。In a possible design, the image acquisition unit is further configured to acquire a second acquired image after receiving the first operation; the image processing unit is configured to, after receiving the user's first operation for taking pictures, use the M frames of images of the image to generate a composite image, including: an image processing unit, specifically configured to generate a composite image using the first collected image and the second collected image; the first collected image and the second collected image include N kinds of exposure parameters image.

在一种可能的设计中,第一采集图像为第一曝光参数的图像;第二采集图像中包括N种曝光参数中除第一曝光参数之外的曝光参数的图像。In a possible design, the first captured image is an image of a first exposure parameter; the second captured image includes images of exposure parameters of N kinds of exposure parameters except the first exposure parameter.

在一种可能的设计中,第一曝光参数为图像正常曝光情况下的第一曝光参数。In a possible design, the first exposure parameter is the first exposure parameter under normal exposure of the image.

在一种可能的设计中,第一采集图像包括:W种曝光参数的图像;第二采集图像中包括N种曝光参数中除W种曝光参数之外的曝光参数的图像。In a possible design, the first collected image includes: images of W kinds of exposure parameters; the second collected image includes images of exposure parameters other than the W kinds of exposure parameters among the N kinds of exposure parameters.

在一种可能的设计中,图像采集单元,用于在拍照预览模式下,采集图像,包括:图像采集单元,具体用于在拍照预览模式下,采集N种曝光参数的图像;图像处理单元,用于在接收到用户用于拍照的第一操作后,利用包含第一采集图像的M帧图像,生成合成图像,包括:图像处理单元,具体用于融合第一采集图像,生成合成图像;第一采集图像中包括N种曝光参数的图像。In a possible design, the image acquisition unit is used to acquire images in the photo preview mode, including: the image acquisition unit is specifically used to acquire images of N exposure parameters in the photo preview mode; the image processing unit, After receiving the user's first operation for taking pictures, using M frames of images including the first captured image to generate a composite image, including: an image processing unit, specifically used to fuse the first captured image to generate a composite image; A collected image includes images of N kinds of exposure parameters.

在一种可能的设计中,该电子设备还包括:显示单元,用于在拍照预览模式下,显示预览图像;预览图像为融合Q种曝光参数的图像所生成的图像;其中,Q小于N。In a possible design, the electronic device further includes: a display unit, configured to display a preview image in the photo preview mode; the preview image is an image generated by fusing Q exposure parameters; wherein, Q is less than N.

在一种可能的设计中,第一采集图像为利用交错高动态范围Stagger HDR技术采集的图像。In a possible design, the first collected image is an image collected by using an interleaved high dynamic range Stagger HDR technology.

在一种可能的设计中,第一采集图像为利用双转换增益DCG技术采集的图像。In a possible design, the first acquired image is an image acquired by using a dual conversion gain DCG technique.

在一种可能的设计中,图像处理单元,还用于确定第一采集图像是否满足预设条件;预设条件包括以下至少一项:图像中物体的运动速度小于第一阈值、拍摄图像时电子设备的抖动幅度小于第二阈值、拍摄图像时自动对焦功能收敛和拍摄图像时自动曝光功能收敛。图像处理单元,用于在接收到用户用于拍照的第一操作后,利用包含第一采集图像的M帧图像,生成合成图像,包括:图像处理单元,用于在确定第一采集图像满足预设条件之后,利用包含第一采集图像的M帧图像,生成合成图像。In a possible design, the image processing unit is further configured to determine whether the first captured image satisfies a preset condition; the preset condition includes at least one of the following: the moving speed of the object in the image is less than the first threshold, and the electronic The vibration amplitude of the device is smaller than the second threshold, the auto-focus function converges when the image is captured, and the auto-exposure function converges when the image is captured. The image processing unit is configured to generate a composite image using M frames of images containing the first captured image after receiving the user's first operation for taking pictures, including: an image processing unit configured to determine that the first captured image satisfies the predetermined After the conditions are set, a composite image is generated by using M frames of images including the first captured image.

在一种可能的设计中,第一采集图像为接收到用户用于拍照的第一操作前,最后存入ZSL buffer零秒延迟缓存中的图像。In a possible design, the first captured image is the last image stored in the zero-second delay buffer of the ZSL buffer before receiving the user's first operation for taking pictures.

在一种可能的设计中,图像处理单元,还用于从P帧图像中确定满足预设条件的第一采集图像;其中,P帧图像为在拍照预览模式下采集的图像,预设条件包括以下至少一项:图像中物体的运动速度小于第一阈值、拍摄图像时电子设备的抖动幅度小于第二阈值、拍摄图像时自动对焦功能收敛和拍摄图像时自动曝光功能收敛。In a possible design, the image processing unit is also used to determine the first captured image that meets the preset condition from the P frame images; wherein, the P frame image is an image captured in the photo preview mode, and the preset conditions include At least one of the following: the moving speed of the object in the image is less than the first threshold, the shaking amplitude of the electronic device is less than the second threshold when the image is captured, the autofocus function converges when the image is captured, and the auto exposure function converges when the image is captured.

在一种可能的设计中,P帧图像为接收到用户用于拍照的第一操作后,最近存入ZSL buffer零秒延迟缓存中的图像。In a possible design, the P-frame image is the image that is recently stored in the ZSL buffer zero-second delay cache after receiving the user's first operation for taking pictures.

第三方面,提供一种电子设备,包括:一个或多个处理器,一个或多个处理器和一个或多个存储器耦合,一个或多个存储器存储有计算机程序;当一个或多个处理器执行计算机程序时,使得电子设备执行如上述第一方面或第一方面中任一项设计所提供的拍照方法。In a third aspect, an electronic device is provided, including: one or more processors, one or more processors coupled with one or more memories, one or more memories storing computer programs; when one or more processors When the computer program is executed, the electronic device is made to execute the photographing method provided by the first aspect or any one of the designs of the first aspect.

第四方面,提供一种计算机可读存储介质,包括:计算机软件指令;当计算机软件指令在计算机中运行时,使得计算机执行如上述第一方面或第一方面中任一项设计所提供的拍照方法。In the fourth aspect, there is provided a computer-readable storage medium, including: computer software instructions; when the computer software instructions are run in the computer, the computer is made to perform the photographing as provided in the first aspect or any one of the designs of the first aspect method.

第五方面,提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如上述第一方面或第一方面中任一项设计所提供的拍照方法。In the fifth aspect, a computer program product is provided. When the computer program product is run on a computer, the computer is made to execute the photographing method provided in the first aspect or any one of the designs of the first aspect.

上述第二方面至第五方面的效果描述可以参考第一方面的效果描述,在此不再赘述。For the effect descriptions of the second aspect to the fifth aspect above, reference may be made to the effect descriptions of the first aspect, and details are not repeated here.

附图说明Description of drawings

图1为一种采用HDR拍照的效果示意图;Fig. 1 is a schematic diagram of the effect of taking pictures with HDR;

图2为一种采用HDR合成图像的流程示意图;Fig. 2 is a schematic flow chart of using HDR to synthesize images;

图3为一种电子设备采集图像的时序示意图之一;FIG. 3 is one of the timing diagrams of image acquisition by an electronic device;

图4为一种电子设备采集图像的时序示意图之二;Fig. 4 is the second schematic diagram of the sequence of image acquisition by an electronic device;

图5为一种电子设备采集图像的时序示意图之三;Fig. 5 is a third schematic diagram of the sequence of image acquisition by an electronic device;

图6为一种像素元电路的结构示意图;6 is a schematic structural diagram of a pixel element circuit;

图7为一种电子设备采集图像的时序示意图之四;Fig. 7 is a fourth schematic diagram of the sequence of image acquisition by an electronic device;

图8为本申请实施例提供的一种电子设备的结构示意图之一;FIG. 8 is one of the structural schematic diagrams of an electronic device provided in the embodiment of the present application;

图9为本申请实施例提供的一种拍照方法的流程示意图之一;FIG. 9 is one of the schematic flow charts of a photographing method provided in an embodiment of the present application;

图10为本申请实施例提供的一种电子设备采集图像的时序示意图之一;FIG. 10 is one of the timing schematic diagrams of an electronic device collecting images provided by an embodiment of the present application;

图11为本申请实施例提供的一种电子设备采集图像的时序示意图之二;FIG. 11 is the second schematic diagram of the sequence of image acquisition by an electronic device provided in the embodiment of the present application;

图12为本申请实施例提供的一种拍照方法的流程示意图之二;FIG. 12 is the second schematic flow diagram of a photographing method provided in the embodiment of the present application;

图13为本申请实施例提供的一种拍照方法的流程示意图之三;Fig. 13 is the third schematic flow diagram of a photographing method provided by the embodiment of the present application;

图14为本申请实施例提供的一种电子设备采集图像的时序示意图之三;FIG. 14 is the third schematic diagram of the sequence of image acquisition by an electronic device provided in the embodiment of the present application;

图15为本申请实施例提供的一种拍照方法的流程示意图之四;FIG. 15 is the fourth schematic flow diagram of a photographing method provided in the embodiment of the present application;

图16为本申请实施例提供的一种电子设备采集图像的时序示意图之四;FIG. 16 is the fourth schematic diagram of the sequence of capturing images by an electronic device provided in the embodiment of the present application;

图17为本申请实施例提供的一种电子设备采集图像的时序示意图之五;Fig. 17 is the fifth schematic diagram of the sequence of capturing images by an electronic device provided in the embodiment of the present application;

图18为本申请实施例提供的一种拍照方法的流程示意图之五;Fig. 18 is the fifth schematic flow diagram of a photographing method provided by the embodiment of the present application;

图19为本申请实施例提供的一种拍照方法的流程示意图之六;Fig. 19 is the sixth schematic flow diagram of a photographing method provided by the embodiment of the present application;

图20为本申请实施例提供的一种电子设备采集图像的时序示意图之六;FIG. 20 is the sixth schematic diagram of the sequence of capturing images by an electronic device according to the embodiment of the present application;

图21为本申请实施例提供的一种拍照方法的流程示意图之七;Fig. 21 is the seventh schematic flow diagram of a photographing method provided in the embodiment of the present application;

图22为本申请实施例提供的一种电子设备采集图像的时序示意图之七;Fig. 22 is the seventh schematic diagram of the sequence of image acquisition by an electronic device provided in the embodiment of the present application;

图23为本申请实施例提供的一种电子设备采集图像的时序示意图之八;FIG. 23 is the eighth schematic diagram of the sequence of image acquisition by an electronic device provided in the embodiment of the present application;

图24为本申请实施例提供的一种拍照方法的流程示意图之八;Fig. 24 is the eighth schematic flow diagram of a photographing method provided by the embodiment of the present application;

图25为本申请实施例提供的一种拍照方法的流程示意图之九;Fig. 25 is the ninth schematic flow diagram of a photographing method provided by the embodiment of the present application;

图26为本申请实施例提供的一种电子设备采集图像的时序示意图之九;FIG. 26 is the ninth schematic diagram of the sequence of capturing images by an electronic device according to the embodiment of the present application;

图27为本申请实施例提供的一种电子设备采集图像的时序示意图之十;FIG. 27 is the tenth schematic diagram of the sequence of image acquisition by an electronic device provided in the embodiment of the present application;

图28为本申请实施例提供的一种拍照方法的流程示意图之十;Fig. 28 is the tenth schematic flow diagram of a photographing method provided by the embodiment of the present application;

图29为本申请实施例提供的一种拍照方法的流程示意图之十一;Fig. 29 is the eleventh schematic flow diagram of a photographing method provided in the embodiment of the present application;

图30为本申请实施例提供的一种电子设备的结构示意图之二。FIG. 30 is a second schematic structural diagram of an electronic device 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. Among them, 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. At the same time, in the embodiments of the present application, words such as "exemplary" or "for example" are used as examples, illustrations or illustrations, and the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way , which is easy to understand.

首先,对本申请实施例中涉及的相关技术进行介绍:First, the relevant technologies involved in the embodiments of the present application are introduced:

1、高动态范围(high-dynamic range,HDR)1. High dynamic range (high-dynamic range, HDR)

HDR可以理解为将多种曝光亮度的多帧低动态范围(low-dynamic range,LDR)图像融合为一帧HDR图像的技术。在该HDR图像中可以包括更多画面细节。HDR can be understood as a technology that fuses multiple frames of low-dynamic range (LDR) images of various exposure brightnesses into one frame of HDR images. More picture details can be included in the HDR image.

示例性的,图1为拍摄的桌子上物体的照片示意图,其中图1的(a)为曝光亮度较大的LDR图像,图1的(b)为曝光亮度较小的LDR图像。可以看出,在图1的(a)中,由于曝光亮度较大,因此一方面可以清晰显示亮度较低的盒子内的画面细节,另一方面由于桌子上的篮球亮度较大,存在过度曝光的问题,所以只能显示桌子上篮球的轮廓;在图1的(b)中,由于曝光亮度较小,因此一方面可以清晰显示篮球部分的画面细节,另一方面无法显示亮度较低的盒子内的画面细节。进而,通过HDR可以将图1的(a)和(b)融合为图1的(c),可以看出图1的(c)中既能够显示篮球部分的画面细节还能够显示盒子内的画面细节。Exemplarily, FIG. 1 is a schematic diagram of photographs taken of objects on a table, wherein (a) of FIG. 1 is an LDR image with a relatively high exposure brightness, and FIG. 1 (b) is an LDR image with a relatively low exposure brightness. It can be seen that in (a) of Figure 1, due to the high exposure brightness, on the one hand, the details of the picture in the box with low brightness can be clearly displayed; on the other hand, due to the high brightness of the basketball on the table, there is overexposure Therefore, only the outline of the basketball on the table can be displayed; in (b) of Figure 1, due to the low exposure brightness, the details of the basketball part can be clearly displayed on the one hand, and the box with lower brightness cannot be displayed on the other hand The picture details inside. Furthermore, (a) and (b) in Figure 1 can be merged into (c) in Figure 1 through HDR, and it can be seen that (c) in Figure 1 can display not only the details of the basketball part but also the picture inside the box detail.

具体的,一般的HDR拍照流程如图2所示,包括:Specifically, the general HDR photographing process is shown in Figure 2, including:

S101、电子设备启动相机应用,进入拍照预览模式,并显示拍照预览画面。S101. The electronic device starts a camera application, enters a photo preview mode, and displays a photo preview image.

S102、电子设备接收用户的拍照操作。S102. The electronic device receives a user's photographing operation.

S103、电子设备响应于拍照操作,设置曝光参数。S103. The electronic device sets exposure parameters in response to the photographing operation.

例如,若需要四帧EV0图像、一帧EV-2图像、一帧EV-4图像,来进行HDR。则电子设备设置曝光参数,以使得摄像头按照设置的曝光参数依次采集四帧EV0图像、一帧EV-2图像、一帧EV-4图像。For example, if four frames of EVO images, one frame of EV-2 images, and one frame of EV-4 images are required for HDR. Then the electronic device sets exposure parameters, so that the camera sequentially captures four frames of EV0 images, one frame of EV-2 images, and one frame of EV-4 images according to the set exposure parameters.

需要说明的是,为了描述简洁,本申请实施例中将正常曝光的曝光亮度的表示为EV0,将曝光亮度EV0×2n表示为EVn。例如,EV-1表示曝光亮度为EV0的一半,EV-2表示曝光亮度为EV-1的一半;再例如,EV1表示曝光亮度为EV0的二倍,EV2表示曝光亮度为EV1的二倍。It should be noted that, for the sake of brevity, in the embodiment of the present application, the exposure brightness of the normal exposure is expressed as EV0, and the exposure brightness EV0×2 n is expressed as EVn. For example, EV-1 means that the exposure brightness is half of EV0, and EV-2 means that the exposure brightness is half of EV-1; for another example, EV1 means that the exposure brightness is twice that of EV0, and EV2 means that the exposure brightness is twice that of EV1.

S104、摄像头按照该曝光参数采集图像。S104. The camera collects images according to the exposure parameters.

继续上述示例,摄像头依次采集4帧EV0图像、一帧EV-2图像、一帧EV-4图像。Continuing with the above example, the camera captures four frames of EV0 images, one frame of EV-2 images, and one frame of EV-4 images in sequence.

S105、电子设备利用采集到的图像,合成图像,得到HDR图像。S105. The electronic device uses the collected images to synthesize images to obtain an HDR image.

具体的,图3为本申请实施例提供的一种拍照过程中的时序图。其中,该时序图中包括两条时间轴,上方的时间轴用于反映摄像头中感光元件进行图像曝光的时间,下方的时间轴用于反映摄像头读取感光数据的时间。Specifically, FIG. 3 is a sequence diagram of a photographing process provided by an embodiment of the present application. Wherein, the timing diagram includes two time axes, the upper time axis is used to reflect the image exposure time of the photosensitive element in the camera, and the lower time axis is used to reflect the time when the camera reads the photosensitive data.

其中,电子设备在t1时间点接收用户的拍照操作。电子设备在接收到拍照操作后,需要一段时间来生成曝光参数、将曝光参数发送至摄像头以及使摄像头执行该曝光参数。具体的,假设电子设备生成曝光参数、将曝光参数发送至摄像头以及使摄像头执行该曝光参数所占用时间为三个采集周期T,则如图3所示电子设备在虚线框中的6个采集周期中采集4帧EV0图像、一帧EV-2图像、一帧EV-4图像。之后,电子设备再根据采集到的6帧图像,合成HDR图像。Wherein, the electronic device receives the user's photographing operation at time point t1. After the electronic device receives the photographing operation, it takes a period of time to generate the exposure parameters, send the exposure parameters to the camera, and make the camera execute the exposure parameters. Specifically, assuming that the time taken by the electronic device to generate the exposure parameters, send the exposure parameters to the camera, and make the camera execute the exposure parameters is three acquisition periods T, then the six acquisition periods of the electronic device in the dotted line box as shown in Figure 3 Collect 4 frames of EV0 images, one frame of EV-2 images, and one frame of EV-4 images. Afterwards, the electronic device synthesizes an HDR image based on the collected 6 frames of images.

2、交错高动态范围(stagger high-dynamic range,stagger HDR)2. Stagger high-dynamic range (stagger HDR)

stagger HDR通过提高传感器的帧率,可以在一个采集周期内,采集不同曝光亮度的多帧图像的技术。例如,stagger HDR可以在一个采集周期内生成长曝图像和短曝图像,例如图4所示,电子设备在一个采集周期T内可以采集EV0和EV-4两帧图像。再例如,staggerHDR可以在一个采集周期内生成长曝图像、中曝图像和短曝图像,例如图5所示,电子设备在一个采集周期T内可以采集EV0、EV-2和EV-4三帧图像。相比较而言,在stagger HDR的场景下,由于要采集多种曝光参数的图像,因此两帧图像之间的空白的帧间隔(该帧间隔可称为VB)相比于非stagger HDR的场景下的帧间隔VB会更短。Stagger HDR is a technology that can collect multiple frames of images with different exposure brightness in one acquisition cycle by increasing the frame rate of the sensor. For example, stagger HDR can generate long-exposure images and short-exposure images within one acquisition period. For example, as shown in Figure 4, the electronic device can acquire EV0 and EV-4 two frames of images within one acquisition period T. For another example, staggerHDR can generate long-exposure images, medium-exposure images, and short-exposure images within one acquisition period. For example, as shown in Figure 5, the electronic device can acquire three frames of EV0, EV-2 and EV-4 within one acquisition period T image. In comparison, in the stagger HDR scene, due to the acquisition of images of various exposure parameters, the blank frame interval between two frames of images (the frame interval can be called VB) compared to the non-stagger HDR scene The lower frame interval VB will be shorter.

目前,stagger HDR主要应用于预览模式和视频拍摄模式中,用来增加视频或预览画面的HDR效果。由于stagger HDR的帧间隔VB短,因此可以很好的减小视频和预览过程中的鬼影的情况。At present, stagger HDR is mainly used in preview mode and video shooting mode to increase the HDR effect of video or preview screen. Since the frame interval VB of stagger HDR is short, it can well reduce the ghosting in the video and preview process.

3、双变频增益(dual conversion gain,DCG)3. Dual conversion gain (DCG)

DCG可以理解为在一个像素对应的感光单元当中有两个存储光子能量的电容,或者可以理解为在一个像素元电路当中做两次读取的能力。DCG can be understood as having two capacitors that store photon energy in the photosensitive unit corresponding to a pixel, or it can be understood as the ability to read twice in a pixel element circuit.

示例性的,如图6中(a)所示为传统的互补金属氧化物半导体(complementarymetal oxide semiconductor,CMOS)的一个像素元电路结构,其中,PD为光电二极管,TX为转移晶体管,RST为复位晶体管,SF为源跟随器,RS为行选择晶体管,VAA_PIX为模拟像素电源电压,VOUT为像素输出电压节点,FD为浮动扩散节点,CFD为FD节点处电容。图6中(b)所示为采用DCG的像素元电路结构。相比于图6中(a),图6中(b)所示电路结构在虚线框处增加了一个电容以及晶体管DCG,从而使其具有在电路当中做两次读取的能力。Exemplarily, as shown in (a) of FIG. 6, it is a traditional complementary metal oxide semiconductor (complementary metal oxide semiconductor, CMOS) pixel element circuit structure, wherein PD is a photodiode, TX is a transfer transistor, and RST is a reset Transistor, SF is the source follower, RS is the row selection transistor, V AA _PIX is the analog pixel power supply voltage, V OUT is the pixel output voltage node, FD is the floating diffusion node, and C FD is the capacitance at the FD node. (b) in FIG. 6 shows the circuit structure of a pixel element using DCG. Compared with (a) in FIG. 6, the circuit structure shown in (b) in FIG. 6 adds a capacitor and transistor DCG at the dotted box, so that it has the ability to read twice in the circuit.

因此,在采用DCG的场景下,在一次感光中,可以做到类似stagger HDR的读取结果。与stagger HDR不同的是,DCG得到的是曝光的叠加,stagger HDR得到的是新的曝光。Therefore, in the scene where DCG is used, in one exposure, the reading result similar to stagger HDR can be achieved. Unlike stagger HDR, what DCG gets is the superposition of exposures, and what stagger HDR gets is new exposures.

示例性的,图7为传统HDR、stagger HDR和DCG,三种HDR在采集图像过程中的时序图。可以看出,同样获取三种曝光参数的EV0、EV-2和EV-4的图像,DCG所占用的时间更短,因此DCG可以进一步减少鬼影现象,并且还可以增加长曝光的时间。Exemplarily, FIG. 7 is a timing diagram of traditional HDR, stagger HDR and DCG, three kinds of HDR in the process of acquiring images. It can be seen that DCG takes less time to acquire the images of EV0, EV-2 and EV-4 with the same three exposure parameters, so DCG can further reduce ghosting and increase the time of long exposure.

以下结合实例,对本申请所提供的拍照方法进行介绍:The following is an introduction to the photographing method provided by this application in conjunction with examples:

从上述S101-S105所描述的方案可以看出,该方案中从用户进行拍照操作,到电子设备采集到待融合的6帧图像,至少需要9个采集周期。另外,再加上电子设备合成HDR图像所需要的时间,整个拍照过程的时间花费较大,影响用户使用体验。It can be seen from the scheme described in S101-S105 above that, in this scheme, at least 9 acquisition cycles are required from the time when the user performs the photographing operation to when the electronic device acquires 6 frames of images to be fused. In addition, coupled with the time required for the electronic device to synthesize the HDR image, the entire photographing process takes a long time, which affects the user experience.

针对上述技术问题,本申请实施例提供一种拍照方法,该方法中可以利用用户触发拍照之前的图像(简称为第一采集图像),来生成合成图像。这样一来,可以避免电子设备在接收到用户用于触发拍照的操作之后,再花费时间采集上述第一采集图像的曝光参数的图像。In view of the above technical problems, an embodiment of the present application provides a photographing method, in which a synthetic image can be generated by using an image before the user triggers photographing (referred to as the first captured image for short). In this way, it can be avoided that the electronic device spends time collecting the image of the exposure parameter of the first collected image after receiving the user's operation for triggering the photographing.

这样一来,可以节省接收拍照操作后采集图像所需要的时间。从而加快拍照速度、提高用户使用体验。In this way, it is possible to save the time required for image acquisition after receiving the photographing operation. Thereby speeding up the speed of taking pictures and improving the user experience.

以下结合具体示例,对本申请实施例所提供的方案进行介绍:The following is an introduction to the solution provided by the embodiment of the present application in combination with specific examples:

本申请实施例提供一种拍照方法,可以应用于电子设备。其中,电子设备在检测到用户在触摸屏的特定位置输入操作后,可根据该操作显示对应界面、信息。An embodiment of the present application provides a photographing method, which can be applied to an electronic device. Wherein, after detecting that the user inputs an operation at a specific position on the touch screen, the electronic device may display a corresponding interface and information according to the operation.

示例性的,本申请实施例中的电子设备可以是手机、平板电脑、桌面型、膝上型、手持型计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本,以及蜂窝电话、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备等具有触摸屏的电子设备,本申请实施例对该设备的具体形态不作特殊限制。Exemplary, the electronic device in the embodiment of the present application may be a mobile phone, a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, and Cellular phones, personal digital assistants (personal digital assistant, PDA), augmented reality (augmented reality, AR)\virtual reality (virtual reality, VR) equipment and other electronic equipment with a touch screen, the embodiment of the present application does not make any reference to the specific form of the equipment. special restrictions.

以电子设备为手机为例,参照图8所示,该电子设备可以包括处理器310,外部存储器接口320,内部存储器321,通用串行总线(universal serial bus,USB)接口330,充电管理模块340,电源管理模块341,电池342,天线1,天线2,移动通信模块350,无线通信模块360,音频模块370,扬声器370A,受话器370B,麦克风370C,耳机接口370D,传感器模块380,按键390,马达391,指示器392,摄像头393,显示屏394,以及用户标识模块(subscriberidentification module,SIM)卡接口395等。Taking the electronic device as a mobile phone as an example, as shown in FIG. , power management module 341, battery 342, antenna 1, antenna 2, mobile communication module 350, wireless communication module 360, audio module 370, speaker 370A, receiver 370B, microphone 370C, earphone jack 370D, sensor module 380, button 390, motor 391, an indicator 392, a camera 393, a display screen 394, and a subscriber identification module (subscriber identification module, SIM) card interface 395, etc.

其中,上述传感器模块380可以包括压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,接近光传感器,温度传感器,触摸传感器,环境光传感器,骨传导传感器等。Wherein, the sensor module 380 may include a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.

可以理解的是,本申请实施例示意的结构并不构成对电子设备300的具体限定。在本申请另一些实施例中,电子设备300可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 300 . In other embodiments of the present application, the electronic device 300 may include more or fewer components than shown in the figure, 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.

处理器310可以包括一个或多个处理单元,例如:处理器310可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器神经网络处理器(neural-network processing unit,NPU),和/或微控制单元(micro controller unit,MCU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 310 may include one or more processing units, for example: the processor 310 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 neural network processor (neural-network processing unit, NPU), and/or microcontroller Control unit (micro controller unit, MCU), etc. Wherein, different processing units may be independent devices, or may be integrated in one or more processors.

其中,控制器可以是电子设备300的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。Wherein, the controller may be the nerve center and command center of the electronic device 300 . 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.

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

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

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

充电管理模块340用于从充电器接收充电输入。电源管理模块341用于连接电池342,充电管理模块340与处理器310。电源管理模块341接收电池342和/或充电管理模块340的输入,为处理器310,内部存储器321,外部存储器,显示屏394,摄像头393,和无线通信模块360等供电。在另一些实施例中,电源管理模块341和充电管理模块340也可以设置于同一个器件中。The charging management module 340 is configured to receive charging input from the charger. The power management module 341 is used for connecting the battery 342 , the charging management module 340 and the processor 310 . The power management module 341 receives the input of the battery 342 and/or the charging management module 340, and supplies power for the processor 310, the internal memory 321, the external memory, the display screen 394, the camera 393, and the wireless communication module 360, etc. In some other embodiments, the power management module 341 and the charging management module 340 may also be set in the same device.

电子设备300的无线通信功能可以通过天线1,天线2,移动通信模块350,无线通信模块360,调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。电子设备300中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。The wireless communication function of the electronic device 300 can be realized by the antenna 1 , the antenna 2 , the mobile communication module 350 , the wireless communication module 360 , a modem processor, a baseband processor, and the like. Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 300 may 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.

移动通信模块350可以提供应用在电子设备300上的包括2G/3G/4G/5G等无线通信的解决方案。无线通信模块360可以提供应用在电子设备300上的包括无线局域网(wireless local area networks,WLAN)(如Wi-Fi网络),蓝牙(blue tooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),NFC,红外技术(infrared,IR)等无线通信的解决方案。The mobile communication module 350 can provide wireless communication solutions including 2G/3G/4G/5G applied on the electronic device 300 . The wireless communication module 360 can provide applications on the electronic device 300 including wireless local area networks (wireless local area networks, WLAN) (such as Wi-Fi network), Bluetooth (blue tooth, BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), NFC, infrared technology (infrared, IR) and other wireless communication solutions.

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

显示屏394用于显示图像,视频等。该显示屏可以是触摸屏。在一些实施例中,电子设备300可以包括1个或N个显示屏394,N为大于1的正整数。The display screen 394 is used to display images, videos and the like. The display can be a touch screen. In some embodiments, the electronic device 300 may include 1 or N display screens 394, where N is a positive integer greater than 1.

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

NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备300的智能认知等应用,例如:贴膜状态识别,图像修复、图像识别,人脸识别,语音识别,文本理解等。The NPU is a neural-network (NN) computing processor. By referring to the structure of biological neural networks, such as the transfer mode between neurons in the human brain, it can quickly process input information and continuously learn by itself. Applications such as intelligent cognition of the electronic device 300 can be implemented through the NPU, for example: recognition of the film state, image restoration, image recognition, face recognition, speech recognition, text understanding, and the like.

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

内部存储器321可以用于存储计算机可执行程序代码,可执行程序代码包括指令。处理器310通过运行存储在内部存储器321的指令,从而执行电子设备300的各种功能应用以及数据处理。内部存储器321可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备300使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器321可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 321 may be used to store computer-executable program codes including instructions. The processor 310 executes various functional applications and data processing of the electronic device 300 by executing instructions stored in the internal memory 321 . The internal memory 321 may include an area for storing programs and an area for storing data. 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 electronic device 300 . In addition, the internal memory 321 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.

电子设备300可以通过音频模块370,扬声器370A,受话器370B,麦克风370C,耳机接口370D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 300 may implement audio functions through an audio module 370 , a speaker 370A, a receiver 370B, a microphone 370C, an earphone interface 370D, and an application processor. Such as music playback, recording, etc.

触摸传感器,也称“触控面板(TP)”。触摸传感器可以设置于显示屏394,由触摸传感器与显示屏394组成触摸屏,也称“触控屏”。触摸传感器用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏394提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器也可以设置于电子设备300的表面,与显示屏394所处的位置不同。Touch sensor, also known as "touch panel (TP)". The touch sensor can be arranged on the display screen 394, and the touch sensor and the display screen 394 form a touch screen, also called “touch screen”. The touch sensor is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to touch operations can be provided through the display screen 394 . In some other embodiments, the touch sensor can also be disposed on the surface of the electronic device 300 , which is different from the position of the display screen 394 .

按键390包括开机键,音量键等。马达391可以产生振动提示。指示器392可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口395用于连接SIM卡。The keys 390 include a power key, a volume key and the like. The motor 391 can generate a vibrating prompt. The indicator 392 can be an indicator light, which can be used to indicate the charging status, the change of the battery capacity, and can also be used to indicate messages, missed calls, notifications and the like. The SIM card interface 395 is used for connecting a SIM card.

为了在拍照过程中节省接收拍照操作后采集图像所需要的时间,从而加快拍照速度、提高用户使用体验,本申请实施例所提供方法可以通过两种方式来实现:In order to save the time required to collect images after receiving the photographing operation during the photographing process, thereby speeding up the photographing speed and improving the user experience, the method provided in the embodiment of the present application can be implemented in two ways:

方式一、可以利用拍照预览模式下采集到的第一采集图像和接收到用户用于拍照的第一操作后采集的第二采集图像,来生成合成图像。Method 1: A composite image may be generated by using the first captured image captured in the photo preview mode and the second captured image collected after receiving the user's first operation for taking pictures.

方式二、在拍照预览模式下采集生成合成图像所需要的全部图像,这种方式下在接收到第一操作后可以不需要再采集图像便可以生成合成图像。Method 2: Collect all the images required to generate the composite image in the photo preview mode. In this method, the composite image can be generated without collecting images after receiving the first operation.

下面结合实例,对上述两种方式的实现过程进行详细介绍:The following is a detailed introduction to the implementation process of the above two methods with examples:

方式一:method one:

在方式一中,一方面,考虑到合成HDR图像时,需要先获取多种曝光参数的多帧图像,然后才能根据多帧图像,确定HDR图像。另一方面,考虑到在一些场景中,电子设备在拍照预览模式下时,会按照预设的曝光参数来采集图像,在接收到用户用于拍照的第一操作后才开始生成合成HDR图像所需要的图像的曝光参数。In the first way, on the one hand, when compositing an HDR image, it is necessary to obtain multiple frames of images with various exposure parameters, and then determine the HDR image based on the multiple frames of images. On the other hand, considering that in some scenarios, when the electronic device is in the photo preview mode, it will collect images according to the preset exposure parameters, and start to generate the composite HDR image after receiving the user's first operation for taking pictures. The exposure parameters of the desired image.

例如,电子设备在拍照预览模式下可以先估计图像在正常曝光的情况下图像的曝光参数(称为第一曝光参数),然后按照第一曝光参数采集亮度为EV0的图像,如图3所示在接收用户的第一操作(即图中拍照操作)之前,电子设备采集EV0的图像;在接收到接收用户的第一操作之后,电子设备才开始生成合成HDR图像所需要的图像的曝光参数,并按照生成的曝光参数采集所需要的图像,即图3中在拍照操作的3个采集周期后采集四帧EV0图像、一帧EV-2图像、一帧EV-4图像。For example, in the photo preview mode, the electronic device can first estimate the exposure parameter of the image under normal exposure (called the first exposure parameter), and then collect an image with a brightness of EV0 according to the first exposure parameter, as shown in Figure 3 Before receiving the user's first operation (that is, the photographing operation in the figure), the electronic device collects the image of EVO; after receiving the user's first operation, the electronic device starts to generate the exposure parameters of the image required for the composite HDR image, The required images are collected according to the generated exposure parameters, that is, four frames of EV0 images, one frame of EV-2 images, and one frame of EV-4 images are collected after three acquisition cycles of the photographing operation in FIG. 3 .

因此,本申请实施例中所提供的拍照方法,可以利用两类图像来合成HDR图像。其中,一类图像是在拍照预览模式下按照预设曝光参数采集的图像(称为第一采集图像),另一类图像时在接收到用户用于拍照的第一操作后,电子设备根据生成的曝光参数采集到的图像。这样一来,由于在接收到用户的第一操作后不需要再花费时间采集预设曝光参数的图像,节省了采集这类图像的时间开销,因此可以加快拍照速度、提高用户使用体验。Therefore, the photographing method provided in the embodiment of the present application can use two types of images to synthesize an HDR image. Among them, one type of image is the image collected according to the preset exposure parameters in the photo preview mode (called the first collected image), and the other type of image is after receiving the user's first operation for taking pictures, the electronic device generates Images acquired with exposure parameters. In this way, since it is not necessary to spend time collecting images with preset exposure parameters after receiving the user's first operation, the time spent on collecting such images is saved, so the speed of taking pictures can be accelerated and the user experience can be improved.

具体的,如图9所示,本申请所提供的拍照方法,可以包括以下步骤:Specifically, as shown in Figure 9, the photographing method provided by this application may include the following steps:

S401、电子设备启动相机应用,进入拍照预览模式。S401. The electronic device starts a camera application and enters a photo preview mode.

具体的,用户可以通过点击电子设备的显示界面中的相机图标,以触发电子设备响应于该点击操作启动相机应用,并进入拍照预览模式。Specifically, the user may click the camera icon on the display interface of the electronic device to trigger the electronic device to start the camera application in response to the click operation and enter the photo preview mode.

本申请中,拍照预览模式可以理解为:在接收到用户用于拍照的第一操作之前,电子设备利用摄像头采集图像,以便将采集到的图像显示在界面上供用户预览的这种工作模式。在实际应用过程中,拍照预览模式也可以被称为其他名称,例如相机预览模式、浏览模式等等,只要电子设备在该模式下具有在接收到用户用于拍照的第一操作之前利用摄像头采集图像的功能,则该模式均可以理解为本申请中的拍照预览模式。In this application, the photo preview mode can be understood as: before receiving the user's first operation for taking pictures, the electronic device uses the camera to capture images, so as to display the captured images on the interface for the user to preview. In the actual application process, the photo preview mode can also be called other names, such as camera preview mode, browsing mode, etc., as long as the electronic device in this mode has the ability to use the camera to collect information before receiving the user's first operation for taking pictures. image function, then this mode can be understood as the photo preview mode in this application.

S402、电子设备估计在正常曝光的情况下图像的第一曝光参数。S402. The electronic device estimates a first exposure parameter of the image under normal exposure.

其中,曝光参数,可以为反映图像的曝光量的各类参数。例如,曝光参数可以包括通光时间、快门速度、通光面积、光圈大小中的一项或多项。其中,一种曝光参数可以对应一种图像的曝光亮度,也可以理解为:电子设备按照一种曝光参数采集图像时,可以采集到该曝光参数对应的曝光亮度的图像。Wherein, the exposure parameter may be various parameters reflecting the exposure of the image. For example, the exposure parameter may include one or more items of light transmission time, shutter speed, light transmission area, and aperture size. Wherein, one exposure parameter may correspond to one exposure brightness of an image, which may also be understood as: when the electronic device collects an image according to one exposure parameter, it may collect an image of the exposure brightness corresponding to the exposure parameter.

另外,本申请实施例中,正常曝光可以理解为使图像的显示效果满足预设条件所进行的曝光,在正常曝光的情况下图像的第一曝光参数可以理解为使图像的显示效果满足预设条件所对应的曝光参数。其中,预设条件可以根据实际应用场景设定。In addition, in the embodiment of the present application, normal exposure can be understood as the exposure performed to make the display effect of the image meet the preset conditions. In the case of normal exposure, the first exposure parameter of the image can be understood as making the display effect of the image meet the preset condition. The exposure parameters corresponding to the conditions. Wherein, the preset condition may be set according to an actual application scenario.

S403、电子设备采集第一曝光参数的图像。S403. The electronic device collects an image of the first exposure parameter.

需要说明的是,本实施例中是以正常曝光情况下的第一曝光参数为例进行说明。在一些实现方式中,在拍照预览模式下电子设备可以采用其他曝光参数采集图像,例如电子设备可以按照预设曝光参数采集图像,在这些实现方式中电子设备在拍照预览模式下也可以采集其他曝光参数的图像而不采集第一曝光参数的图像。It should be noted that, in this embodiment, the first exposure parameter in the case of normal exposure is taken as an example for illustration. In some implementations, the electronic device can collect images using other exposure parameters in the photo preview mode. For example, the electronic device can collect images according to preset exposure parameters. In these implementations, the electronic device can also collect other exposure parameters in the photo preview mode. parameter without acquiring an image of the first exposure parameter.

示例性的,如图10所示,电子设备在接收到拍照操作之前,在拍照预览模式下,根据第一曝光参数采集EV0的图像。在具体实施过程中,采集到的图像也可以是其他亮度的图像,例如可以是EV1、EV2、EV-1或者EV-2等等图像。Exemplarily, as shown in FIG. 10 , before receiving a photographing operation, the electronic device captures an image of EVO according to a first exposure parameter in a photographing preview mode. In a specific implementation process, the collected image may also be an image of other brightness, for example, it may be an image of EV1, EV2, EV-1 or EV-2 and so on.

具体的,电子设备在采集到第一曝光参数的图像后,可以将采集到的图像缓存到零秒延迟缓存(zero shutter lag buffer,ZSL buffer)中,以便后续处理。其中,ZSLbuffer可以采用先进先出的存储方式,当采集到新的图像时,ZSL buffer删除旧的图像并保存该新的图像。Specifically, after the electronic device acquires the image of the first exposure parameter, it may cache the acquired image in a zero-second delay buffer (zero shutter lag buffer, ZSL buffer) for subsequent processing. Among them, the ZSL buffer can adopt the first-in-first-out storage method. When a new image is collected, the ZSL buffer deletes the old image and saves the new image.

S404、电子设备接收用户用于拍照的第一操作。S404. The electronic device receives a first user operation for taking pictures.

例如,在拍照预览模式下,电子设备可以在界面上显示预设控件,该预设控件用于在用户点击该预设控件后拍照,此时第一操作可以为用户点击该预设控件的操作。For example, in the photo preview mode, the electronic device may display a preset control on the interface, and the preset control is used to take a picture after the user clicks the preset control, and the first operation at this time may be the operation of the user clicking the preset control .

S405、电子设备采集第二采集图像。S405. The electronic device collects a second collected image.

在实际实施过程中,电子设备在接收到第一操作后,可以将ZSL buffer中存储的第一曝光参数的图像存入内存,然后清空ZSL buffer,以便开始采集第二采集图像并将第二采集图像存入ZSL buffer。In the actual implementation process, after the electronic device receives the first operation, it can store the image of the first exposure parameter stored in the ZSL buffer into the memory, and then clear the ZSL buffer to start collecting the second image and save the second image. The image is stored in the ZSL buffer.

其中,第二采集图像包括N种曝光参数中除第一曝光参数之外的其他曝光参数的图像。其中,N表示合成HDR图像所需要的图像的曝光参数的个数。Wherein, the second collected image includes images of other exposure parameters in the N types of exposure parameters except the first exposure parameter. Wherein, N represents the number of exposure parameters of the image required to synthesize the HDR image.

具体的,由于在S403中已经采集到了第一曝光参数的EV0图像,因此这里可以只采集N种曝光参数中除第一曝光参数之外的其他曝光参数的图像,例如采集EV-2的图像和EV-4的图像。因此,第二采集图像可以只包括N种曝光参数中除第一曝光参数之外的其他曝光参数的图像。当然,为了达到更优的图像效果,第二采集图像中还可以包括第一曝光参数的图像,本申请实施例中对此不做限制。Specifically, since the EVO image of the first exposure parameter has been collected in S403, only images of exposure parameters other than the first exposure parameter among the N types of exposure parameters can be collected here, such as collecting images of EV-2 and Image of EV-4. Therefore, the second captured image may only include images of exposure parameters other than the first exposure parameter among the N types of exposure parameters. Of course, in order to achieve a better image effect, the second captured image may also include an image of the first exposure parameter, which is not limited in this embodiment of the present application.

在一种实现方式中,S405可以包括:In an implementation manner, S405 may include:

S4051、电子设备确定曝光序列。S4051. The electronic device determines an exposure sequence.

其中,曝光序列用于反映第二采集图像的个数和顺序。Wherein, the exposure sequence is used to reflect the number and sequence of the second collected images.

S4052、电子设备根据上述曝光序列,采集第二采集图像。S4052. The electronic device collects a second collected image according to the above exposure sequence.

示例性的,如图10中,电子设备在接收到第一操作后的第4个采集周期,采集EV-2和EV-4的图像。其中,需要说明的是,在图10所示示例中,由于电子设备在接收到第一操作后,会先执行确定曝光序列、生成曝光序列中各图像对应的各曝光参数以及电子设备根据曝光参数调节摄像头的光圈等动作,因此从电子设备接收第一操作到电子设备采集第二采集图像之间间隔3个采集周期。Exemplarily, as shown in FIG. 10 , the electronic device collects images of EV-2 and EV-4 in the fourth collection cycle after receiving the first operation. Wherein, it should be noted that, in the example shown in FIG. 10 , since the electronic device receives the first operation, it first executes determining the exposure sequence, generating the exposure parameters corresponding to each image in the exposure sequence, and the electronic device according to the exposure parameters. Actions such as adjusting the aperture of the camera, therefore, there are 3 acquisition periods between when the electronic device receives the first operation and when the electronic device acquires the second acquired image.

S406、电子设备根据第一采集图像和第二采集图像,生成合成图像。S406. The electronic device generates a composite image according to the first collected image and the second collected image.

其中,第一采集图像为在拍照预览模式下采集的图像,即第一采集图像为上述S403中采集到的第一曝光参数的图像。具体的,第一采集图像可以为接收用户的第一操作之前,最近存入ZSL buffer的图像。例如图10中,第一采集图像包括在接收拍照操作之前电子设备最近存入ZSL buffer的4帧EV0的图像。Wherein, the first captured image is an image captured in the photo preview mode, that is, the first captured image is an image of the first exposure parameter captured in S403 above. Specifically, the first captured image may be an image recently stored in the ZSL buffer before receiving the user's first operation. For example, in FIG. 10 , the first captured image includes the 4 frames of E0 images that the electronic device recently stored in the ZSL buffer before receiving the photographing operation.

具体的,电子设备可以按照各种HDR技术,融合第一采集图像和第二采集图像,得到合成图像(例如融合图10中的4帧EV0、1帧EV-2和1帧EV-4,得到合成图像)。本申请实施例中,对于电子设备融合第一采集图像和第二采集图像所采用的技术可以不做限制。Specifically, the electronic device can fuse the first captured image and the second captured image according to various HDR technologies to obtain a composite image (for example, fusing 4 frames of EVO, 1 frame of EV-2, and 1 frame of EV-4 in FIG. 10 to obtain Composite image). In the embodiment of the present application, no limitation may be imposed on the technology used by the electronic device to fuse the first collected image and the second collected image.

另外,因为在电子设备采集第二采集图像之前,需要消耗一些时间用来执行确定曝光序列、生成曝光序列中各图像对应的各曝光参数以及电子设备根据曝光参数调节摄像头的光圈等动作,例如图10中从电子设备接收第一操作到电子设备采集第二采集图像之间间隔了3个采集周期。所以,从电子设备接收到第一操作到采集第二采集图像之前,电子设备还可以获取到一些图像,例如图10中在电子设备接收到第一操作之后可以采集到三帧第一曝光参数的EV0的图像。In addition, before the electronic device collects the second captured image, it takes some time to perform actions such as determining the exposure sequence, generating the exposure parameters corresponding to each image in the exposure sequence, and adjusting the aperture of the camera according to the exposure parameters by the electronic device, as shown in Fig. In 10, there are 3 collection periods between when the electronic device receives the first operation and when the electronic device collects the second collected image. Therefore, before the electronic device receives the first operation and collects the second captured image, the electronic device can also obtain some images, for example, in FIG. 10 , three frames of the first exposure parameter can be collected after the electronic device receives the first operation. Image of EV0.

因此,在一种实现方式中,上述S406可以包括:Therefore, in an implementation manner, the above S406 may include:

S4061、电子设备根据第一采集图像、第二采集图像和第三采集图像,生成合成图像。S4061. The electronic device generates a composite image according to the first collected image, the second collected image, and the third collected image.

其中,第三采集图像为电子设备接收到第一操作之后并且电子设备采集第二采集图像之前采集到的图像。示例性的,如图11所示,第三采集图像可以包括电子设备接收到第一操作之后采集到三帧EV0的图像。Wherein, the third captured image is an image captured after the electronic device receives the first operation and before the electronic device captures the second captured image. Exemplarily, as shown in FIG. 11 , the third captured image may include images of three frames of EVO captured after the electronic device receives the first operation.

另外,一方面,在电子设备采集图像的过程中,可能存在鬼影现象。其中,鬼影现象可以理解为在采集图像过程中,图像中物体的位置变化幅度过大,导致的图像中出现物体的重影的现象。另一方面,在电子设备采集图像的过程中,还可以存在自动对焦功能不收敛或自动曝光功能不收敛的现象。其中,自动对焦功能不收敛,可以理解为电子设备在未对焦成功之前调节焦距的现象;自动曝光功能不收敛,可以理解为电子设备在未确定出正常曝光对应的曝光参数之前,调节摄像头曝光参数的现象。In addition, on the one hand, in the process of capturing images by the electronic device, there may be a ghost phenomenon. Wherein, the ghosting phenomenon can be understood as a phenomenon in which the position of the object in the image changes too much during the process of collecting the image, resulting in the phenomenon of ghosting of the object in the image. On the other hand, in the process of capturing images by the electronic device, there may also be a phenomenon that the auto-focus function does not converge or the auto-exposure function does not converge. Among them, the auto-focus function does not converge, which can be understood as the phenomenon that the electronic device adjusts the focal length before the focus is successful; the auto-exposure function does not converge, which can be understood as the electronic device adjusts the exposure parameters of the camera before determining the exposure parameters corresponding to the normal exposure. The phenomenon.

因此,为了提高图像合成的成功率,在一种实现方式中,在S404接收到用户的第一操作之后,如图12所示,该方法还可以包括:Therefore, in order to improve the success rate of image synthesis, in an implementation manner, after receiving the user's first operation at S404, as shown in FIG. 12 , the method may further include:

S407、判断第一采集图像中各图像是否满足预设条件。S407. Determine whether each image in the first collected image satisfies a preset condition.

其中,预设条件可以包括以下至少一项:图像中物体的运动速度小于第一阈值、拍摄图像时电子设备的抖动幅度小于第二阈值、拍摄图像时自动对焦功能收敛和拍摄图像时自动曝光功能收敛。其中,第一阈值和第二阈值,可根据实际需要确定。Wherein, the preset condition may include at least one of the following: the moving speed of the object in the image is less than the first threshold, the shaking amplitude of the electronic device is less than the second threshold when the image is taken, the autofocus function converges when the image is taken, and the automatic exposure function when the image is taken convergence. Wherein, the first threshold and the second threshold may be determined according to actual needs.

示例性的,在实际实施过程中:针对上述预设条件中“图像中物体的运动速度小于第一阈值”,可以通过以下方式中任一种方式来实现:Exemplarily, in the actual implementation process: for the above preset condition "the moving speed of the object in the image is less than the first threshold", it can be realized in any of the following ways:

方式一、利用电子设备中用于检测物体运动速度的传感器检测图像中物体的运动速度,然后判断该运动速度是否小于第一阈值;Method 1: Use a sensor in the electronic device for detecting the moving speed of the object to detect the moving speed of the object in the image, and then judge whether the moving speed is smaller than the first threshold;

方式二、检测图像中是否存在鬼影,若不存在鬼影则确定图像中物体的运动速度小于第一阈值。Method 2: Detect whether there is a ghost in the image, and if there is no ghost, determine that the moving speed of the object in the image is less than a first threshold.

针对上述预设条件中“拍摄图像时电子设备的抖动幅度小于第二阈值”,可以通过以下方法中任一种方式来实现:For the above preset condition "the shaking amplitude of the electronic device is smaller than the second threshold when taking an image", it can be realized by any of the following methods:

方式一、利用电子设备中用于检测抖动的传感器检测电子设备的抖动幅度,然后判断该抖动幅度是否小于第二阈值;Method 1: Use a sensor for detecting vibration in the electronic device to detect the vibration amplitude of the electronic equipment, and then determine whether the vibration amplitude is smaller than the second threshold;

方式二、检测图像中是否存在鬼影,若不存在鬼影则确定拍摄图像时电子设备的抖动幅度小于第二阈值。Method 2: Detect whether there is a ghost image in the image, and if there is no ghost image, determine that the vibration amplitude of the electronic device when the image is taken is smaller than a second threshold.

换句话讲,在一些场景下,可以通过检测图像中是否存在鬼影,进而确定图像中物体的运动速度和电子设备的抖动幅度是否满足条件,即运动速度是否小于第一阈值、抖动幅度是否小于第二阈值。In other words, in some scenarios, by detecting whether there is a ghost in the image, it can be determined whether the moving speed of the object in the image and the shaking amplitude of the electronic device meet the conditions, that is, whether the moving speed is less than the first threshold and whether the shaking amplitude is less than the second threshold.

针对上述预设条件中“拍摄图像时自动对焦功能收敛”,可以通过判断预设时间段内摄像头的焦距是否存在变化,或者图像中的物体是否清晰等方式来确定。Regarding the "autofocus function converges when shooting images" in the above preset condition, it can be determined by judging whether the focal length of the camera changes within the preset time period, or whether the objects in the image are clear or not.

针对上述预设条件中“拍摄图像时自动曝光功能收敛”,可以通过判断预设时间段内摄像头的通光时间、快门速度、通光面积以及光圈大小等参数是否存在改变,或者图像的曝光亮度是否正常等方式来确定。Aiming at the "automatic exposure function converges when shooting images" in the above preset conditions, it can be judged whether there are changes in the parameters such as the light transmission time, shutter speed, light transmission area and aperture size of the camera within the preset time period, or the exposure brightness of the image Whether it is normal and so on to determine.

进一步的,一方面,在通过S407,确定第一采集图像中各图像满足预设条件后,电子设备再执行S406,即根据第一采集图像和第二采集图像,生成合成图像。Further, on the one hand, after determining that each image in the first captured image satisfies the preset condition through S407, the electronic device then performs S406, that is, generates a composite image according to the first captured image and the second captured image.

另一方面,若通过S407,确定第一采集图像中包括不满足预设条件的图像,则如图12所示,该方法还包括:On the other hand, if it is determined through S407 that the first captured image includes an image that does not meet the preset condition, as shown in FIG. 12 , the method further includes:

S408、电子设备采集第四采集图像。S408. The electronic device collects a fourth collected image.

其中,第四采集图像包括合成HDR图像所需要的N种曝光参数的图像。示例性的,若合成HDR图像需要3种曝光参数的图像,即EV0、EV-2和EV-4的图像。则如图3所示,第四采集图像可以包括图中虚线框中的4帧EV0图像、1帧EV-2图像以及1帧EV-4图像。Wherein, the fourth collected image includes images of N kinds of exposure parameters required for synthesizing the HDR image. Exemplarily, if compositing an HDR image requires images of three exposure parameters, that is, images of EVO, EV-2 and EV-4. Then, as shown in FIG. 3 , the fourth captured image may include 4 frames of EVO images, 1 frame of EV-2 images, and 1 frame of EV-4 images in the dashed box in the figure.

S409、电子设备根据第四采集图像,生成合成图像。S409. The electronic device generates a composite image according to the fourth collected image.

与S406类似,电子设备可以按照各种HDR技术,根据第四采集图像生成合成图像。本申请实施例中,对于电子设备所采用的HDR技术可以不做限制。Similar to S406, the electronic device may generate a composite image according to the fourth collected image according to various HDR technologies. In the embodiment of the present application, there may be no limitation on the HDR technology adopted by the electronic device.

上述实现方式中,一方面,可以在确定第一采集图像满足预设条件后,再根据第一采集图像和第二采集图像生成合成图像,从而保证合成图像的质量;另一方面,在确定第一采集图像中包括不满足预设条件的图像后,则可以通过重新采集第四采集图像,并根据第四采集图像生成合成图像,以保证顺利生成合成图像。In the above implementation, on the one hand, after determining that the first captured image satisfies the preset condition, a composite image can be generated according to the first captured image and the second captured image, so as to ensure the quality of the composite image; After the first captured image includes an image that does not satisfy the preset condition, the fourth captured image may be re-captured, and a composite image may be generated based on the fourth captured image, so as to ensure smooth generation of the composite image.

在另一种实现方式中,在S404接收到用户的第一操作之后,如图13所示,该方法还可以包括:In another implementation manner, after the user's first operation is received at S404, as shown in FIG. 13 , the method may further include:

S410、电子设备从P帧图像中确定满足预设条件的第一采集图像。S410. The electronic device determines a first captured image that satisfies a preset condition from the P frames of images.

其中,P帧图像为在拍摄预览模式下采集的图像,即该P帧图像为上述S403中采集到的第一曝光参数的图像。具体的,P帧图像可以为接收用户的第一操作之前,最近存入ZSLbuffer的P帧图像,如图14中电子设备读取接收到第一操作(即图中拍照操作)之前最近存入ZSL buffer的6帧EV0图像。Wherein, the P frames of images are images collected in the shooting preview mode, that is, the P frames of images are the images of the first exposure parameters collected in S403 above. Specifically, the P-frame image can be the P-frame image that was recently stored in the ZSL buffer before receiving the user's first operation, as shown in Figure 14, the electronic device reads the most recently stored ZSL before receiving the first operation (that is, the photographing operation in the figure). The 6-frame EV0 image of the buffer.

其中,预设条件可以包括以下至少一项:图像中物体的运动速度小于第一阈值、拍摄图像时电子设备的抖动幅度小于第二阈值、拍摄图像时自动对焦功能收敛和拍摄图像时自动曝光功能收敛。其中,第一阈值和第二阈值,可根据实际需要确定。其中,判断图像是否满足上述预设条件的具体实现过程可参照上文S407中的相应描述,在此不再赘述。Wherein, the preset condition may include at least one of the following: the moving speed of the object in the image is less than the first threshold, the shaking amplitude of the electronic device is less than the second threshold when the image is taken, the autofocus function converges when the image is taken, and the automatic exposure function when the image is taken convergence. Wherein, the first threshold and the second threshold may be determined according to actual needs. Wherein, the specific implementation process of judging whether the image satisfies the above-mentioned preset conditions can refer to the corresponding description in S407 above, which will not be repeated here.

示例性的,在接收到第一操作后,电子设备先从ZSL buffer中读取接收到第一操作之前的P帧图像,例如图14中电子设备读取接收到第一操作(即图中拍照操作)之前采集到的6帧EV0图像。然后从这6帧图像中选择满足预设条件的4帧图像作为第一采集图像。Exemplarily, after receiving the first operation, the electronic device first reads the P frames of images before receiving the first operation from the ZSL buffer, for example, in FIG. Operation) 6 frames of E0 images collected before. Then select 4 frames of images satisfying the preset conditions from the 6 frames of images as the first collected images.

在通过上述S410确定出第一采集图像后,电子设备再执行S406,即根据第一采集图像和第二采集图像,生成合成图像。After the first captured image is determined through S410, the electronic device then executes S406, that is, generates a composite image according to the first captured image and the second captured image.

上述实现方式中,通过先获取帧数较多的P帧图像,然后从P帧图像中选择满足预设条件的第一采集图像,从而保证了第一采集图像所包括图像的质量,进而保证合成图像的质量。In the above implementation, by first acquiring P frames of images with a large number of frames, and then selecting the first captured image that meets the preset conditions from the P frames of images, the quality of the images included in the first captured image is guaranteed, and the composite Image quality.

可以理解的,本申请实施例中,电子设备可以执行本申请实施例中的部分或全部步骤,这些步骤或操作仅是示例,本申请实施例中,还可以执行其它操作或者各种操作的变形。此外,各个步骤可以按照本申请实施例呈现的不同的顺序来执行,并且有可能并非要执行本申请实施例中的全部操作。例如,上述S407可以在S405之前执行,也可以在S405之后执行;再例如,上述S410可以在S405之前执行,也可以在S405之后执行,本申请所提供方法对此可以不做限制。It can be understood that, in the embodiment of the present application, the electronic device may perform some or all of the steps in the embodiment of the present application, and these steps or operations are only examples. In the embodiment of the present application, other operations or variations of various operations may also be performed. . In addition, each step may be performed in a different order presented in the embodiment of the present application, and it may not be necessary to perform all operations in the embodiment of the present application. For example, the above S407 may be performed before S405 or after S405; for another example, the above S410 may be performed before S405 or after S405, and the method provided in this application may not limit this.

当电子设备支持在拍照预览模式中采集多种曝光参数的图像的情况下,例如在电子设备支持stagger HDR或DCG的场景下,如图15所示,本申请所提供的拍照方法,可以包括以下步骤:When the electronic device supports the collection of images with multiple exposure parameters in the photo preview mode, for example, in a scenario where the electronic device supports stagger HDR or DCG, as shown in Figure 15, the photo taking method provided by this application may include the following step:

S501、电子设备启动相机应用,进入拍照预览模式。S501. The electronic device starts a camera application and enters a photo preview mode.

S502、电子设备估计在正常曝光的情况下图像的第一曝光参数。S502. The electronic device estimates a first exposure parameter of the image under normal exposure.

上述S501和S502的实现过程可以参照上文中S401和S402中的相应描述,在此不再赘述。For the implementation process of S501 and S502 above, reference may be made to the corresponding descriptions in S401 and S402 above, and details will not be repeated here.

S503、电子设备根据第一曝光参数,采集W种曝光参数的图像。S503. The electronic device collects images of W exposure parameters according to the first exposure parameter.

具体的,在确定第一曝光参数(即EV0图像的曝光参数)后,电子设备还可以依次确定EV-1、EV-2、EV-4等等图像的曝光参数,然后根据确定出的曝光参数,利用stagger HDR技术在拍照预览模式中采集W种曝光参数的图像。Specifically, after determining the first exposure parameter (that is, the exposure parameter of the EVO image), the electronic device may also sequentially determine the exposure parameters of images such as EV-1, EV-2, EV-4, etc., and then according to the determined exposure parameter , using stagger HDR technology to collect images of W exposure parameters in photo preview mode.

其中,W的个数可以根据stagger HDR支持的同一采集周期内的曝光次数来确定。例如,所采用stagger HDR技术支持在同一采集周期内进行两次曝光,即在同一采集周期内可以采集两种曝光参数的图像,则W可以为2。再例如,所采用stagger HDR技术支持在同一采集周期内进行三次曝光,即在同一采集周期内可以采集三种曝光参数的图像,则W可以为2或3。再例如,所采用stagger HDR技术支持在同一采集周期内进行四次曝光,即在同一采集周期内可以采集四种曝光参数的图像,则W可以为2、3或4,依次类推。Among them, the number of W can be determined according to the number of exposures in the same acquisition cycle supported by stagger HDR. For example, the adopted stagger HDR technology supports two exposures in the same acquisition period, that is, images with two exposure parameters can be acquired in the same acquisition period, then W can be 2. For another example, the adopted stagger HDR technology supports three exposures in the same acquisition period, that is, images with three exposure parameters can be acquired in the same acquisition period, then W can be 2 or 3. For another example, the adopted stagger HDR technology supports four exposures in the same acquisition period, that is, images with four exposure parameters can be acquired in the same acquisition period, then W can be 2, 3 or 4, and so on.

需要说明的是,本实施例中主要以stagger HDR为例对本方法进行介绍,可以理解的是,该方法也可以适用于例如DCG等其他技术的场景下,对此本申请可以不做限制。It should be noted that this embodiment mainly uses stagger HDR as an example to introduce this method. It can be understood that this method can also be applied to scenarios of other technologies such as DCG, and this application does not need to limit this.

示例性的,如图16所示,电子设备在接收到拍照操作之前,在拍照预览模式下,采集两种曝光参数的图像,即EV0和EV-4的图像。Exemplarily, as shown in FIG. 16 , before receiving the photographing operation, the electronic device collects images of two exposure parameters, ie images of EVO and EV-4, in the photographing preview mode.

具体的,电子设备在采集到W种曝光参数的图像后,可以将采集到的图像缓存到ZSL buffer中,以便后续处理。Specifically, after the electronic device collects images of W kinds of exposure parameters, it can cache the collected images in the ZSL buffer for subsequent processing.

S504、电子设备接收用户用于拍照的第一操作。S504. The electronic device receives a first user operation for taking pictures.

其中S504的具体实现过程可参照上述S404的内容,在此不再赘述。The specific implementation process of S504 may refer to the content of S404 above, which will not be repeated here.

S505、设备采集第二采集图像。S505. The device collects a second collected image.

其中,电子设备在接收到第一操作后,可以将ZSL buffer中存储的图像(即S503中所描述的W种曝光参数的图像)存入内存中,然后清空ZSL buffer,以便开始采集第二采集图像并将第二采集图像存入ZSL buffer。Wherein, after the electronic device receives the first operation, the image stored in the ZSL buffer (that is, the image of the W exposure parameters described in S503) can be stored in the memory, and then the ZSL buffer is cleared to start collecting the second collection. image and store the second captured image into the ZSL buffer.

其中,第二采集图像中可以包括N种曝光参数中除W种曝光参数之外的其他曝光参数的图像。其中,N表示合成HDR图像所需要的图像的曝光参数的个数。Wherein, the second collected image may include images of exposure parameters other than the W exposure parameters among the N exposure parameters. Wherein, N represents the number of exposure parameters of the image required to synthesize the HDR image.

具体的,由于在S403中已经采集到了W种曝光参数的图像,因此这里只需要采集N种曝光参数中除W种曝光参数之外的其他曝光参数的图像。因此,第二采集图像可以只包括N种曝光参数中除W种曝光参数之外的其他曝光参数的图像。当然,为了达到更优的图像效果,第二采集图像中还可以包括W种曝光参数的图像,本申请实施例中对此不做限制。Specifically, since images of W types of exposure parameters have been collected in S403, it is only necessary to collect images of other exposure parameters among the N types of exposure parameters except W types of exposure parameters. Therefore, the second captured image may only include images of exposure parameters other than the W exposure parameters among the N exposure parameters. Of course, in order to achieve a better image effect, the second captured image may also include images of W exposure parameters, which is not limited in this embodiment of the present application.

在一种实现方式中,S505可以包括:In an implementation manner, S505 may include:

S5051、电子设备确定曝光序列。S5051. The electronic device determines an exposure sequence.

其中,曝光序列用于反映第二采集图像的个数和顺序。Wherein, the exposure sequence is used to reflect the number and sequence of the second collected images.

S5052、电子设备根据上述曝光序列,采集第二采集图像。S5052. The electronic device collects a second collected image according to the above exposure sequence.

示例性的,如图16所示,电子设备在接收到第一操作(即图中拍照操作)后的第4个采集周期,采集EV-2的图像。另外,由于在stagger HDR场景下可以在一个采集周期中采集两种曝光参数的图像,因此在采集EV-2图像的同时,还可以采集到一帧EV-4的图像,因此第二采集图像中可以包括一帧EV-2图像和一帧EV-4图像。Exemplarily, as shown in FIG. 16 , the electronic device collects the image of EV-2 in the fourth collection cycle after receiving the first operation (ie, the photographing operation in the figure). In addition, since images of two exposure parameters can be collected in one acquisition cycle in the stagger HDR scene, one frame of EV-4 images can also be collected while collecting EV-2 images, so the second captured image Can include one frame of EV-2 image and one frame of EV-4 image.

另外,与上文示例同理,在图16所示示例中,电子设备从接收第一操作到开始采集第二采集图像之间需要占用一定时间(图中3个采集周期)用于执行确定曝光序列、生成曝光序列中各图像对应的各曝光参数以及电子设备根据曝光参数调节摄像头的光圈等动作。In addition, similar to the above example, in the example shown in Figure 16, the electronic device needs to take a certain amount of time (three acquisition cycles in the figure) between receiving the first operation and starting to acquire the second acquired image to perform the determination of the exposure sequence, generating the exposure parameters corresponding to each image in the exposure sequence, and the electronic device adjusting the aperture of the camera according to the exposure parameters.

S506、电子设备根据第一采集图像和第二采集图像,生成合成图像。S506. The electronic device generates a composite image according to the first collected image and the second collected image.

其中,第一采集图像为在拍照预览模式下采集的图像,即第一采集图像为上述S503中采集到的W种曝光参数的图像。具体的,第一采集图像可以为接收用户的第一操作之前,最近存入ZSL buffer的图像。例如,图16中,第一采集图像包括在接收拍照操作之前,电子设备采集到的4帧EV0图像和4帧EV-4图像。第二采集图像包括1帧EV-2图像和1帧EV-4图像。Wherein, the first captured image is an image captured in the photographing preview mode, that is, the first captured image is an image of W kinds of exposure parameters collected in S503 above. Specifically, the first captured image may be an image recently stored in the ZSL buffer before receiving the user's first operation. For example, in FIG. 16 , the first captured image includes 4 frames of EVO images and 4 frames of EV-4 images collected by the electronic device before receiving the photographing operation. The second collected image includes 1 frame of EV-2 image and 1 frame of EV-4 image.

具体的,电子设备可以按照各种HDR技术,融合第一采集图像和第二采集图像,得到合成图像。本申请实施例中,对于电子设备融合第一采集图像和第二采集图像所采用的技术可以不做限制。Specifically, the electronic device may fuse the first collected image and the second collected image according to various HDR technologies to obtain a composite image. In the embodiment of the present application, no limitation may be imposed on the technology used by the electronic device to fuse the first collected image and the second collected image.

另外,在一种实现方式中,上述S506可以包括:In addition, in an implementation manner, the above S506 may include:

S5061、电子设备根据第一采集图像、第二采集图像和第三采集图像,生成合成图像。S5061. The electronic device generates a composite image according to the first collected image, the second collected image, and the third collected image.

其中,第三采集图像为电子设备接收到第一操作之后并且电子设备采集第二采集图像之前采集到的图像。示例性的,如图17所示,第三采集图像可以包括电子设备接收到第一操作之后采集到3帧EV0图像和3帧EV-2图像。Wherein, the third captured image is an image captured after the electronic device receives the first operation and before the electronic device captures the second captured image. Exemplarily, as shown in FIG. 17 , the third captured image may include 3 frames of EVO images and 3 frames of EV-2 images captured after the electronic device receives the first operation.

其中,关于S5061的具体实现过程和达到的有益效果可以参照上文S4061的相应描述,在此不再赘述。Wherein, for the specific implementation process and beneficial effects of S5061, reference may be made to the corresponding description of S4061 above, which will not be repeated here.

另外,为了提高图像合成的成功率,在一种实现方式中,在S504接收到用户的第一操作之后,如图18所示,该方法还包括:In addition, in order to improve the success rate of image synthesis, in an implementation manner, after receiving the user's first operation at S504, as shown in FIG. 18 , the method further includes:

S507、判断第一采集图像中各图像是否满足预设条件。S507. Determine whether each image in the first collected image satisfies a preset condition.

其中,预设条件可以包括以下至少一项:图像中物体的运动速度小于第一阈值、拍摄图像时电子设备的抖动幅度小于第二阈值、拍摄图像时自动对焦功能收敛和拍摄图像时自动曝光功能收敛。其中,第一阈值和第二阈值,可根据实际需要确定。Wherein, the preset condition may include at least one of the following: the moving speed of the object in the image is less than the first threshold, the shaking amplitude of the electronic device is less than the second threshold when the image is taken, the autofocus function converges when the image is taken, and the automatic exposure function when the image is taken convergence. Wherein, the first threshold and the second threshold may be determined according to actual needs.

进一步的,一方面,在通过S507,确定第一采集图像中各图像满足预设条件后,电子设备再执行S506,即根据第一采集图像和第二采集图像,生成合成图像。Further, on the one hand, after determining that each image in the first captured image satisfies the preset condition through S507, the electronic device then performs S506, that is, generates a composite image according to the first captured image and the second captured image.

另一方面,若通过S507,确定第一采集图像中包括不满足预设条件的图像,则如图18所示,该方法还包括:On the other hand, if it is determined through S507 that the first captured image includes an image that does not meet the preset condition, as shown in FIG. 18 , the method further includes:

S508、电子设备采集第四采集图像。S508. The electronic device collects a fourth collected image.

其中,第四采集图像包括合成HDR图像所需要的N种曝光参数的图像。Wherein, the fourth collected image includes images of N kinds of exposure parameters required for synthesizing the HDR image.

S509、电子设备根据第四采集图像,生成合成图像。S509. The electronic device generates a composite image according to the fourth collected image.

其中关于S507-S509的具体实现过程和达到的有益效果可以参照上文S407-S409的相应描述,在此不再赘述。For the specific implementation process of S507-S509 and the beneficial effects achieved, reference may be made to the corresponding descriptions of S407-S409 above, which will not be repeated here.

在另一种实现方式中,在S404接收到用户的第一操作之后,如图19所示,该方法还包括:In another implementation manner, after receiving the user's first operation at S404, as shown in FIG. 19 , the method further includes:

S510、电子设备从P帧图像中确定满足预设条件的第一采集图像。S510. The electronic device determines a first captured image that satisfies a preset condition from the P frame images.

其中,P帧图像为在拍摄预览模式下采集的图像,即该P帧图像为上述S503中采集到的N种曝光参数的图像中的P帧。具体的,P帧图像可以为接收用户的第一操作之前,最近存入ZSL buffer的P帧图像。Wherein, the P frames of images are images collected in the shooting preview mode, that is, the P frames of images are the P frames of the images of the N types of exposure parameters collected in S503 above. Specifically, the P-frame image may be the P-frame image recently stored in the ZSL buffer before receiving the user's first operation.

其中,预设条件可以包括以下至少一项:图像中物体的运动速度小于第一阈值、拍摄图像时电子设备的抖动幅度小于第二阈值、拍摄图像时自动对焦功能收敛和拍摄图像时自动曝光功能收敛。其中,第一阈值和第二阈值,可根据实际需要确定。其中,判断图像是否满足上述预设条件的具体实现过程可参照上文S407中的相应描述,在此不再赘述。Wherein, the preset condition may include at least one of the following: the moving speed of the object in the image is less than the first threshold, the shaking amplitude of the electronic device is less than the second threshold when the image is taken, the autofocus function converges when the image is taken, and the automatic exposure function when the image is taken convergence. Wherein, the first threshold and the second threshold may be determined according to actual needs. Wherein, the specific implementation process of judging whether the image satisfies the above-mentioned preset conditions can refer to the corresponding description in S407 above, which will not be repeated here.

示例性的,在接收到第一操作后,电子设备先从ZSL buffer中读取接收到第一操作之前的P帧图像,例如图20中电子设备读取接收到第一操作(即图中拍照操作)之前采集到的6个采集周期中所采集的12帧图像(包括6帧EV0图像和6帧EV-4图像)。然后从这12帧图像中选择满足预设条件的4帧EV0图像和1帧EV-4图像作为第一采集图像,以便和第二采集图像中包括的1帧EV-2合成HDR图像。Exemplarily, after receiving the first operation, the electronic device first reads the P frames of images before receiving the first operation from the ZSL buffer, for example, in FIG. Operation) 12 frames of images (including 6 frames of E0 images and 6 frames of EV-4 images) collected in the previous 6 acquisition cycles. Then select 4 frames of EVO images and 1 frame of EV-4 images that meet the preset conditions from the 12 frames of images as the first captured image, so as to synthesize an HDR image with 1 frame of EV-2 included in the second captured image.

其中关于S510所达到的有益效果可以参照上文S410的相应描述,在此不再赘述。For the beneficial effect achieved by S510, reference may be made to the corresponding description of S410 above, and details will not be repeated here.

方式二:Method 2:

在本方式二中,考虑到在电子设备支持在拍照预览模式中采集多种曝光参数的图像的情况下,电子设备可以在拍照预览模式下采集合成图像所需要的全部图像,这种方式下在接收到第一操作后可以不需要再采集图像。In this method 2, considering that the electronic device can collect all the images required for the composite image in the photo preview mode when the electronic device supports the collection of images with multiple exposure parameters in the photo preview mode, in this way After receiving the first operation, there may be no need to collect images.

具体的,如图21所示,该方法可以包括以下步骤:Specifically, as shown in Figure 21, the method may include the following steps:

S601、电子设备启动相机应用,进入拍照预览模式。S601. The electronic device starts a camera application and enters a photo preview mode.

S602、电子设备估计在正常曝光的情况下EV0图像的第一曝光参数。S602. The electronic device estimates a first exposure parameter of the EVO image under normal exposure.

上述S601和S602的实现过程可以参照上文中S401和S402中的相应描述,在此不再赘述。For the implementation process of S601 and S602 above, reference may be made to the corresponding descriptions in S401 and S402 above, and details will not be repeated here.

S603、电子设备根据第一曝光参数,采集N种曝光参数的图像。S603. The electronic device collects images of N kinds of exposure parameters according to the first exposure parameter.

其中,N的个数可以根据合成HDR图像所需要的曝光参数的个数以及电子设备所采用的HDR技术(例如stagger HDR或DCG)确定。Wherein, the number of N may be determined according to the number of exposure parameters required for synthesizing the HDR image and the HDR technology (such as stagger HDR or DCG) adopted by the electronic device.

其中,与上文S503类似,电子设备可以根据第一曝光参数,先确定N种曝光参数,例如N种曝光参数包括EV0图像、EV-2图像和EV-4图像,三种图像的曝光参数。然后采集这N种曝光参数的图像。Wherein, similar to S503 above, the electronic device may first determine N types of exposure parameters according to the first exposure parameter, for example, the N types of exposure parameters include exposure parameters of E0 image, EV-2 image and EV-4 image, three types of images. Then images of these N kinds of exposure parameters are collected.

例如,以stagger HDR为例,如图22所示,在接收到拍照操作之前,电子设备在每个采集周期采集EV0、EV-2和EV-4,三种曝光参数的图像。For example, taking stagger HDR as an example, as shown in Figure 22, before receiving the camera operation, the electronic device collects images of three exposure parameters, EV0, EV-2 and EV-4, in each collection cycle.

再例如,以DCG为例,如图23所示,在接收到到拍照操作之前,电子设备在每个采集周期采集EV0、EV-2和EV-4,三种曝光参数的图像。For another example, taking DCG as an example, as shown in FIG. 23 , before receiving the photographing operation, the electronic device collects images of three exposure parameters, E0, EV-2 and EV-4, in each collection cycle.

S604、电子设备接收用户用于拍照的第一操作。S604. The electronic device receives a first user operation for taking pictures.

其中S604的具体实现过程可参照上述S404的内容,在此不再赘述。The specific implementation process of S604 may refer to the content of S404 above, and will not be repeated here.

S605、电子设备融合第一采集图像,生成合成图像。S605. The electronic device fuses the first collected image to generate a composite image.

其中,第一采集图像为在拍照预览模式下采集的图像,即第一采集图像为上述S603中采集到的N种曝光参数的图像。具体的,第一采集图像可以为接收用户的第一操作之前,最近存入ZSL buffer的图像。例如,图22中,第一采集图像包括在接收拍照操作之前,电子设备最近存入ZSL buffer的4帧EV0图像、4帧EV-2图像和4帧EV-4图像。再例如,图23中,第一采集图像包括在接收拍照操作之前,电子设备最近存入ZSL buffer的4帧EV0图像、4帧EV-2图像和4帧EV-4图像。Wherein, the first captured image is an image captured in the photo preview mode, that is, the first captured image is an image of the N kinds of exposure parameters collected in S603. Specifically, the first captured image may be an image recently stored in the ZSL buffer before receiving the user's first operation. For example, in FIG. 22, the first captured image includes 4 frames of E0 images, 4 frames of EV-2 images and 4 frames of EV-4 images that the electronic device recently stored in the ZSL buffer before receiving the camera operation. For another example, in FIG. 23 , the first captured image includes 4 frames of EVO images, 4 frames of EV-2 images, and 4 frames of EV-4 images that the electronic device recently stored in the ZSL buffer before receiving the photographing operation.

具体的,电子设备可以按照各种HDR技术,融合第一采集图像,得到合成图像。本申请实施例中,对于电子设备融合第一采集图像所采用的技术可以不做限制。Specifically, the electronic device may fuse the first collected images according to various HDR technologies to obtain a composite image. In this embodiment of the present application, no limitation may be imposed on the technology used by the electronic device to fuse the first captured image.

另外,在一种实现方式中,如图24所示,该方法还包括:In addition, in an implementation manner, as shown in FIG. 24, the method further includes:

S606、判断第一采集图像中各图像是否满足预设条件。S606. Determine whether each image in the first collected image satisfies a preset condition.

其中,预设条件可以包括以下至少一项:图像中物体的运动速度小于第一阈值、拍摄图像时电子设备的抖动幅度小于第二阈值、拍摄图像时自动对焦功能收敛和拍摄图像时自动曝光功能收敛。其中,第一阈值和第二阈值,可根据实际需要确定。Wherein, the preset condition may include at least one of the following: the moving speed of the object in the image is less than the first threshold, the shaking amplitude of the electronic device is less than the second threshold when the image is taken, the autofocus function converges when the image is taken, and the automatic exposure function when the image is taken convergence. Wherein, the first threshold and the second threshold may be determined according to actual needs.

进一步的,一方面,在通过S606,确定第一采集图像中各图像满足预设条件后,电子设备再执行S605,即融合第一采集图像,生成合成图像。Further, on the one hand, after determining that each image in the first captured image satisfies the preset condition through S606, the electronic device then performs S605, that is, fuses the first captured image to generate a composite image.

另一方面,若通过S606,确定第一采集图像中包括不满足预设条件的图像,则如图24所示,该方法还包括:On the other hand, if it is determined through S606 that the first captured image includes an image that does not meet the preset condition, as shown in FIG. 24 , the method further includes:

S607、电子设备采集第四采集图像。S607. The electronic device collects a fourth collected image.

其中,第四采集图像包括合成HDR图像所需要的N种曝光参数的图像。Wherein, the fourth collected image includes images of N kinds of exposure parameters required for synthesizing the HDR image.

S608、电子设备根据第四采集图像,生成合成图像。S608. The electronic device generates a composite image according to the fourth collected image.

其中关于S606-S608的具体实现过程和达到的有益效果可以参照上文S407-S409的相应描述,在此不再赘述。For the specific implementation process of S606-S608 and the beneficial effects achieved, reference may be made to the corresponding descriptions of S407-S409 above, which will not be repeated here.

在另一种实现方式中,如图25所示,该方法还包括:In another implementation, as shown in Figure 25, the method further includes:

S609、电子设备从P帧图像中确定满足预设条件的第一采集图像。S609. The electronic device determines a first captured image that meets a preset condition from the P frame images.

其中,P帧图像为在拍摄预览模式下采集的图像,即该P帧图像为上述S603中采集到的N种曝光参数的图像中的P帧图像。具体的,P帧图像可以为接收用户的第一操作之前,最近存入ZSL buffer的P帧图像。Wherein, the P frames of images are images collected in the shooting preview mode, that is, the P frames of images are the P frames of images among the images of N kinds of exposure parameters collected in S603. Specifically, the P-frame image may be the P-frame image recently stored in the ZSL buffer before receiving the user's first operation.

其中,预设条件可以包括以下至少一项:图像中物体的运动速度小于第一阈值、拍摄图像时电子设备的抖动幅度小于第二阈值、拍摄图像时自动对焦功能收敛和拍摄图像时自动曝光功能收敛。其中,第一阈值和第二阈值,可根据实际需要确定。其中,判断图像是否满足上述预设条件的具体实现过程可参照上文S407中的相应描述,在此不再赘述。Wherein, the preset condition may include at least one of the following: the moving speed of the object in the image is less than the first threshold, the shaking amplitude of the electronic device is less than the second threshold when the image is taken, the autofocus function converges when the image is taken, and the automatic exposure function when the image is taken convergence. Wherein, the first threshold and the second threshold may be determined according to actual needs. Wherein, the specific implementation process of judging whether the image satisfies the above-mentioned preset conditions can refer to the corresponding description in S407 above, which will not be repeated here.

示例性的,在接收到第一操作后,电子设备先从ZSL buffer中读取接收到第一操作之前的P帧图像,例如图26中电子设备读取接收到第一操作(即图中拍照操作)之前采集到的6个采集周期中所采集的18帧图像(包括6帧EV0图像、6帧EV-2图像和6帧EV-4图像)。然后从这18帧图像中选择满足预设条件的4帧EV0图像、1帧EV-2图像和1帧EV-4图像作为第一采集图像,以便融合第一采集图像生成HDR图像。Exemplarily, after receiving the first operation, the electronic device first reads the P frames of images before receiving the first operation from the ZSL buffer, for example, in FIG. Operation) 18 frames of images (including 6 frames of E0 images, 6 frames of EV-2 images and 6 frames of EV-4 images) collected in the previous 6 acquisition cycles. Then select 4 frames of EVO image, 1 frame of EV-2 image and 1 frame of EV-4 image that meet the preset conditions from the 18 frames of images as the first captured image, so as to fuse the first captured image to generate an HDR image.

再示例性的,如图27中电子设备读取接收到第一操作(即图中拍照操作)之前采集到的6个采集周期中所采集的18帧图像(包括6帧EV0图像、6帧EV-2图像和6帧EV-4图像)。然后从这18帧图像中选择满足预设条件的4帧EV0图像、1帧EV-2图像和1帧EV-4图像作为第一采集图像,以便融合第一采集图像生成HDR图像。As another example, as shown in Figure 27, the electronic device reads 18 frames of images (including 6 frames of EVO images, 6 frames of EV -2 images and 6 frames of EV-4 images). Then select 4 frames of EVO image, 1 frame of EV-2 image and 1 frame of EV-4 image that meet the preset conditions from the 18 frames of images as the first captured image, so as to fuse the first captured image to generate an HDR image.

另外,在一种实现方式中,如图28所示,该方法还包括:In addition, in an implementation manner, as shown in FIG. 28, the method further includes:

S610、在拍照预览模式下,显示融合Q种曝光参数的图像所生成的图像。其中,Q小于N。S610. In the photo preview mode, display an image generated by fusing the images of Q kinds of exposure parameters. Among them, Q is smaller than N.

在一种可能的设计中,Q种曝光参数可以包括N种曝光参数中曝光亮度最小和曝光亮度最大的曝光参数。In a possible design, the Q types of exposure parameters may include exposure parameters with the smallest exposure brightness and the largest exposure brightness among the N types of exposure parameters.

示例性的,如图26所示,在接收拍照操作之前,电子设备在拍照预览模式下,可以采集到3种曝光参数的图像(即N为3)。这种情况下,若将3种曝光参数的图像融合得到的图像,作为预览图像显示在界面上,则需要占用较多的硬件资源,并且可能导致显示不流畅的问题。Exemplarily, as shown in FIG. 26 , before receiving the photographing operation, the electronic device may collect images with three exposure parameters (that is, N is 3) in the photographing preview mode. In this case, if the image obtained by fusing the images of the three exposure parameters is displayed on the interface as a preview image, it needs to occupy more hardware resources and may cause the problem of not smooth display.

因此,本设计中,在拍照预览模式下显示预览图像时,采用融合较少种类曝光参数的图像生成预览图像,并显示该预览图像的这种方式,来达到在拍照预览模式下能够更高效、流畅的显示预览图像的效果。Therefore, in this design, when the preview image is displayed in the photo preview mode, the preview image is generated by fusing images with fewer types of exposure parameters, and the preview image is displayed to achieve more efficient and Smoothly display the effect of the preview image.

例如继续上述示例,在电子设备在拍照预览模式下采集到3种曝光参数的图像的情况下,采用本申请上述设计,可以将采集到的两种曝光参数融合生成预览图像,并显示该预览图像。具体的,用于融合的两种曝光参数可以是3种曝光参数中曝光亮度最小和曝光亮度最大的两种曝光参数(即EV0图像和EV-4图像的曝光参数)。For example, continuing the above example, in the case that the electronic device collects images of three kinds of exposure parameters in the photo preview mode, using the above-mentioned design of the present application, the two kinds of exposure parameters collected can be fused to generate a preview image, and the preview image can be displayed . Specifically, the two exposure parameters used for fusion may be the two exposure parameters with the minimum exposure brightness and the maximum exposure brightness among the three exposure parameters (ie, the exposure parameters of the EVO image and the EV-4 image).

本申请实施例所提供的方法,在进行合成HDR图像的过程中,如图29所示,首先,电子设备在拍照预览模式下采集第一采集图像(即图中S201)。然后,在接收到用户用于拍照的第一操作后,利用第一采集图像来生成合成图像(即图中S202)。这样一来,可以节省接收拍照操作后采集图像所需要的时间。从而加快拍照速度、提高用户使用体验。In the method provided in the embodiment of the present application, in the process of synthesizing the HDR image, as shown in FIG. 29 , first, the electronic device captures the first captured image in the photo preview mode (ie, S201 in the figure). Then, after receiving the user's first operation for taking pictures, use the first captured image to generate a composite image (ie S202 in the figure). In this way, it is possible to save the time required for image acquisition after receiving the photographing operation. Thereby speeding up the speed of taking pictures and improving the user experience.

可以理解的是,上述电子设备为了实现对应的功能,其包括了执行各功能相应的硬件结构和/或软件模块。本申请实施例根据上述方法示例对电子设备进行功能模块的划分。例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。可选的,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。It can be understood that, in order to realize corresponding functions, the above-mentioned electronic device includes hardware structures and/or software modules corresponding to each function. In this embodiment of the present application, the electronic device is divided into functional modules according to the foregoing method examples. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. Optionally, the division of modules in this embodiment of the present application is schematic, and is only a logical function division, and there may be another division manner in actual implementation.

如图30所示,为本申请实施例提供的一种电子设备的组成示意图。该电子设备40可以是芯片或片上系统。该电子设备70包括:As shown in FIG. 30 , it is a schematic composition diagram of an electronic device provided in the embodiment of the present application. The electronic device 40 may be a chip or a system on a chip. The electronic equipment 70 includes:

图像采集单元701,用于在拍照预览模式下,采集图像;An image acquisition unit 701, configured to acquire images in the photo preview mode;

图像处理单元702,用于在接收到用户用于拍照的第一操作后,利用包含第一采集图像的M帧图像,生成合成图像。The image processing unit 702 is configured to generate a composite image by using M frames of images including the first captured image after receiving a first user operation for taking pictures.

其中,第一采集图像为在拍照预览模式下采集的图像,第一采集图像包括至少一种曝光参数的图像,M帧图像中包括N种曝光参数的图像,M和N分别为大于1的正整数。Wherein, the first captured image is an image captured in the photo preview mode, the first captured image includes images of at least one exposure parameter, and M frames of images include images of N kinds of exposure parameters, and M and N are positive values greater than 1, respectively. integer.

可选的,图像采集单元701还用于在接收第一操作之后采集第二采集图像。Optionally, the image acquisition unit 701 is further configured to acquire a second acquired image after receiving the first operation.

图像处理单元702,用于在接收到用户用于拍照的第一操作后,利用包含第一采集图像的M帧图像,生成合成图像,包括:图像处理单元,具体用于利用第一采集图像和第二采集图像,生成合成图像;第一采集图像和第二采集图像中包括N种曝光参数的图像。The image processing unit 702 is configured to, after receiving the user's first operation for taking pictures, use M frames of images containing the first captured image to generate a composite image, including: an image processing unit, specifically configured to use the first captured image and The second collected image generates a composite image; the first collected image and the second collected image include images of N kinds of exposure parameters.

可选的,第一采集图像为第一曝光参数的图像;第二采集图像中包括N种曝光参数中除第一曝光参数之外的曝光参数的图像。Optionally, the first captured image is an image of a first exposure parameter; the second captured image includes images of exposure parameters of N types of exposure parameters except the first exposure parameter.

可选的,第一曝光参数为图像正常曝光情况下的第一曝光参数。Optionally, the first exposure parameter is the first exposure parameter under normal exposure of the image.

可选的,第一采集图像包括:W种曝光参数的图像;第二采集图像中包括N种曝光参数中除W种曝光参数之外的曝光参数的图像。Optionally, the first collected image includes: images of W types of exposure parameters; the second collected image includes images of exposure parameters other than W types of exposure parameters among the N types of exposure parameters.

可选的,图像采集单元701,用于在拍照预览模式下,采集图像,包括:图像采集单元,具体用于在拍照预览模式下,采集N种曝光参数的图像。Optionally, the image acquisition unit 701, configured to acquire images in the photo preview mode, includes: an image acquisition unit specifically configured to acquire images of N exposure parameters in the photo preview mode.

图像处理单元702,用于在接收到用户用于拍照的第一操作后,利用包含第一采集图像的M帧图像,生成合成图像,包括:图像处理单元,具体用于融合第一采集图像,生成合成图像;第一采集图像中包括N种曝光参数的图像。The image processing unit 702 is configured to generate a composite image using M frames of images including the first captured image after receiving the user's first operation for taking pictures, including: an image processing unit specifically configured to fuse the first captured image, A composite image is generated; the first collected image includes images of N kinds of exposure parameters.

可选的,电子设备70还包括:显示单元703,用于在拍照预览模式下,显示预览图像。预览图像为融合Q种曝光参数的图像所生成的图像。其中,Q小于N。Optionally, the electronic device 70 further includes: a display unit 703, configured to display a preview image in the photo preview mode. The preview image is an image generated by fusing images of Q kinds of exposure parameters. Among them, Q is smaller than N.

可选的,第一采集图像为利用交错高动态范围Stagger HDR技术采集的图像。Optionally, the first collected image is an image collected using an interleaved high dynamic range Stagger HDR technology.

可选的,第一采集图像为利用双转换增益DCG技术采集的图像。Optionally, the first collected image is an image collected by using a dual conversion gain DCG technique.

可选的,图像处理单元702,还用于确定第一采集图像是否满足预设条件;预设条件包括以下至少一项:图像中物体的运动速度小于第一阈值、拍摄图像时电子设备的抖动幅度小于第二阈值、拍摄图像时自动对焦功能收敛和拍摄图像时自动曝光功能收敛。Optionally, the image processing unit 702 is also configured to determine whether the first captured image satisfies a preset condition; the preset condition includes at least one of the following: the moving speed of the object in the image is less than the first threshold, and the shaking of the electronic device when the image is taken If the amplitude is smaller than the second threshold value, the autofocus function converges when the image is captured and the auto exposure function converges when the image is captured.

图像处理单元702,用于在接收到用户用于拍照的第一操作后,利用包含第一采集图像的M帧图像,生成合成图像,包括:图像处理单元,用于在确定第一采集图像满足预设条件之后,利用包含第一采集图像的M帧图像,生成合成图像。The image processing unit 702 is configured to generate a composite image using M frames of images containing the first captured image after receiving the user's first operation for taking pictures, including: an image processing unit configured to determine that the first captured image satisfies After preset conditions, a composite image is generated by using M frames of images including the first captured image.

可选的,第一采集图像为接收到用户用于拍照的第一操作前,最后存入ZSLbuffer零秒延迟缓存中的图像。Optionally, the first captured image is the last image stored in the ZSLbuffer zero-second delay cache before receiving the user's first operation for taking pictures.

可选的,图像处理单元702,还用于从P帧图像中确定满足预设条件的第一采集图像。Optionally, the image processing unit 702 is further configured to determine a first captured image that satisfies a preset condition from the P frame images.

其中,P帧图像为在拍照预览模式下采集的图像,预设条件包括以下至少一项:图像中物体的运动速度小于第一阈值、拍摄图像时电子设备的抖动幅度小于第二阈值、拍摄图像时自动对焦功能收敛和拍摄图像时自动曝光功能收敛。Wherein, the P frames of images are images collected in the photo preview mode, and the preset conditions include at least one of the following: the moving speed of the object in the image is less than the first threshold, the shaking amplitude of the electronic device when the image is taken is less than the second threshold, and the image is taken The autofocus function converges when the image is captured and the autoexposure function converges when the image is captured.

可选的,P帧图像为接收到用户用于拍照的第一操作后,最近存入ZSL buffer零秒延迟缓存中的图像。本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令运行时,执行本申请实施例所提供的方法。Optionally, the P frame image is the image recently stored in the zero-second delay cache of the ZSL buffer after receiving the user's first operation for taking pictures. The embodiment of the present application also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instruction is executed, the method provided in the embodiment of the present application is executed.

本申请实施例还提供一种包含指令的计算机程序产品。当其在计算机上运行时,使得计算机可以执行本申请实施例所提供的方法。The embodiment of the present application also provides a computer program product including instructions. When it runs on a computer, the computer can execute the method provided by the embodiment of the present application.

在上述实施例中的功能或动作或操作或步骤等,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件程序实现时,可以全部或部分地以计算机程序产品的形式来实现。该计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或者数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包括一个或多个可以用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带),光介质(例如,DVD)、或者半导体介质(例如固态硬盘(solid state disk,SSD))等。The functions or actions or operations or steps in the above-mentioned embodiments may be fully or partially implemented by software, hardware, firmware or any combination thereof. When implemented using a software program, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present application will be generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website, computer, server, or data center Transmission to another website site, computer, server or data center by wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer, or may include one or more data storage devices such as servers and data centers that can be integrated with the medium. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, or a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (solid state disk, SSD)), etc.

尽管结合具体特征及其实施例对本申请进行了描述,显而易见的,在不脱离本申请的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本申请的示例性说明,且视为已覆盖本申请范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包括这些改动和变型在内。Although the application has been described in conjunction with specific features and embodiments thereof, it will be apparent that various modifications and combinations can be made thereto without departing from the spirit and scope of the application. Accordingly, the specification and drawings are merely illustrative of the application as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of this application. Obviously, those skilled in the art can make various changes and modifications to the application without departing from the spirit and scope of the application. In this way, if these modifications and variations of the application fall within the scope of the claims of the application and their equivalent technologies, the application also intends to include these modifications and variations.

Claims (8)

1. A photographing method, comprising:
in a photographing preview mode, collecting an image;
determining a first acquisition image meeting preset conditions from the P frame images; the first acquired image is an image stored in a ZSL buffer zero second delay buffer before receiving a first operation of photographing by a user, the P frame image is an image acquired in the photographing preview mode, and the preset condition comprises at least one of the following: the motion speed of an object in the image is smaller than a first threshold value, the jitter amplitude of the electronic equipment is smaller than a second threshold value when the image is shot, the automatic focusing function is converged when the image is shot, and the automatic exposure function is converged when the image is shot;
After the first operation of photographing by a user is received, storing the first acquired image stored in the ZSL buffer into a memory, and emptying the ZSL buffer;
collecting a second collected image, and storing the second collected image into the ZSL buffer;
generating a composite image using the first acquired image and the second acquired image; the first acquired image and the second acquired image comprise images with N exposure parameters, and N is a positive integer greater than 1.
2. The method of claim 1, wherein the first acquired image is an image of a first exposure parameter; the second acquired image includes an image of an exposure parameter other than the first exposure parameter of the N exposure parameters.
3. The method of claim 2, wherein the first exposure parameter is a first exposure parameter under normal exposure of the image.
4. The method of claim 1, wherein the first acquired image comprises: an image of W exposure parameters; the second acquired image includes images of exposure parameters other than the W exposure parameters among the N exposure parameters.
5. The method of claim 4, wherein the first acquired image is an image acquired using an interleaved high dynamic range stabger HDR technique.
6. The method of claim 4, wherein the first acquired image is an image acquired using a dual conversion gain DCG technique.
7. An electronic device, comprising: one or more processors coupled with one or more memories, the one or more memories storing a computer program;
the computer program, when executed by the one or more processors, causes the electronic device to perform the photographing method as provided in any of claims 1-6.
8. A computer-readable storage medium, comprising: computer software instructions;
the computer software instructions, when run in a computer, cause the computer to perform the photographing method as provided in any of claims 1-6.
CN202110681582.4A 2021-06-18 2021-06-18 A photographing method and electronic device Active CN113382169B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110681582.4A CN113382169B (en) 2021-06-18 2021-06-18 A photographing method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110681582.4A CN113382169B (en) 2021-06-18 2021-06-18 A photographing method and electronic device

Publications (2)

Publication Number Publication Date
CN113382169A CN113382169A (en) 2021-09-10
CN113382169B true CN113382169B (en) 2023-05-09

Family

ID=77577968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110681582.4A Active CN113382169B (en) 2021-06-18 2021-06-18 A photographing method and electronic device

Country Status (1)

Country Link
CN (1) CN113382169B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114143461B (en) * 2021-11-30 2024-04-26 维沃移动通信有限公司 Shooting method and device and electronic equipment
CN116452475B (en) * 2022-01-10 2024-05-31 荣耀终端有限公司 Image processing method and related device
CN116723418B (en) * 2022-02-28 2024-04-09 荣耀终端有限公司 Photographing method and related device
CN117911299A (en) * 2022-02-28 2024-04-19 荣耀终端有限公司 Video processing method and device
CN115297254B (en) * 2022-07-04 2024-03-29 北京航空航天大学 A portable high-dynamic imaging fusion system under high radiation conditions
CN115499579B (en) * 2022-08-08 2023-12-01 荣耀终端有限公司 Processing method and device based on zero-second delay ZSL
CN116055890B (en) * 2022-08-29 2024-08-02 荣耀终端有限公司 Method and electronic device for generating high dynamic range video
CN115842955A (en) * 2022-09-20 2023-03-24 Oppo广东移动通信有限公司 Photographing method, photographing device and electronic device
CN117135468B (en) * 2023-02-21 2024-06-07 荣耀终端有限公司 Image processing method and electronic equipment
CN116389885B (en) * 2023-02-27 2024-03-26 荣耀终端有限公司 Photography methods, electronic equipment and storage media
CN117156261B (en) * 2023-03-28 2024-07-02 荣耀终端有限公司 Image processing method and related equipment
CN116033275B (en) * 2023-03-29 2023-08-15 荣耀终端有限公司 Automatic exposure method, electronic equipment and computer readable storage medium
CN117692763B (en) * 2023-08-02 2024-10-25 荣耀终端有限公司 Photographing method, electronic device, storage medium and program product

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI530911B (en) * 2014-02-25 2016-04-21 宏碁股份有限公司 Dynamic exposure adjusting method and electronic apparatus using the same
CN105376473A (en) * 2014-08-25 2016-03-02 中兴通讯股份有限公司 Photographing method, device and equipment
CN106060422B (en) * 2016-07-06 2019-02-22 维沃移动通信有限公司 A kind of image exposure method and mobile terminal
CN107197169B (en) * 2017-06-22 2019-12-06 维沃移动通信有限公司 high dynamic range image shooting method and mobile terminal
WO2019071613A1 (en) * 2017-10-13 2019-04-18 华为技术有限公司 Image processing method and device
CN109951633B (en) * 2019-02-18 2022-01-11 华为技术有限公司 Method for shooting moon and electronic equipment

Also Published As

Publication number Publication date
CN113382169A (en) 2021-09-10

Similar Documents

Publication Publication Date Title
CN113382169B (en) A photographing method and electronic device
CN102857712B (en) There is the image sensor of HDR capture capability
CN110769152A (en) Image processing method, device, terminal device and storage medium
CN110572584A (en) Image processing method, device, storage medium and electronic device
CN112866576B (en) Image preview method, storage medium and display device
WO2021219141A1 (en) Photographing method, graphic user interface, and electronic device
CN116095476B (en) Camera switching method, device, electronic device and storage medium
CN116055857A (en) Photographing method and electronic equipment
CN118138876A (en) Method for switching cameras and electronic device
CN115689963B (en) An image processing method and electronic device
CN116048323B (en) Image processing method and electronic equipment
CN117692781B (en) Flickering light source detection method and electronic device
WO2024109203A1 (en) Photographing processing method and electronic device
CN117119285B (en) A method of shooting
CN117135257B (en) Image display method, electronic device and computer readable storage medium
WO2023160224A9 (en) Photographing method and related device
US20240155236A1 (en) Image processing method and electronic device
CN116723383B (en) A shooting method and related equipment
CN115379039B (en) Video shooting method and device and electronic equipment
CN118012319B (en) Image processing method, electronic equipment and computer readable storage medium
CN118450275B (en) A shooting method and related equipment
CN117692761B (en) Motion capture method and electronic equipment
CN117119276B (en) Underwater shooting method and electronic equipment
WO2023015959A1 (en) Filming method and electronic device
WO2024239792A1 (en) Motion snapshot method and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

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

Patentee after: Honor Terminal Co.,Ltd.

Country or region after: China

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

Patentee before: Honor Device Co.,Ltd.

Country or region before: China