Movatterモバイル変換


[0]ホーム

URL:


CN114449174B - Shooting method and device and electronic equipment - Google Patents

Shooting method and device and electronic equipment
Download PDF

Info

Publication number
CN114449174B
CN114449174BCN202210191281.8ACN202210191281ACN114449174BCN 114449174 BCN114449174 BCN 114449174BCN 202210191281 ACN202210191281 ACN 202210191281ACN 114449174 BCN114449174 BCN 114449174B
Authority
CN
China
Prior art keywords
image
magnification
target
shooting
area
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
CN202210191281.8A
Other languages
Chinese (zh)
Other versions
CN114449174A (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.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication 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 Vivo Mobile Communication Co LtdfiledCriticalVivo Mobile Communication Co Ltd
Priority to CN202210191281.8ApriorityCriticalpatent/CN114449174B/en
Publication of CN114449174ApublicationCriticalpatent/CN114449174A/en
Application grantedgrantedCritical
Publication of CN114449174BpublicationCriticalpatent/CN114449174B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The application discloses a shooting method, a shooting device and electronic equipment, and belongs to the technical field of shooting. In the embodiment of the application, after receiving shooting input of a user, an optical zoom lens is arranged in the electronic equipment, and a plurality of images are shot through the optical zoom lens in response to the shooting input, wherein the plurality of images at least comprise a first image corresponding to a first multiplying power of the optical zoom lens and a second image corresponding to a second multiplying power of the optical zoom lens, and the first multiplying power is smaller than the second multiplying power; and then synthesizing the target area corresponding to the second image with the first image to obtain a target image, wherein the target area is an area with the same object as the second image in the first image.

Description

Translated fromChinese
拍摄方法、装置和电子设备Shooting method, device and electronic equipment

技术领域Technical Field

本申请属于拍摄技术领域,具体涉及一种拍摄方法、装置和电子设备。The present application belongs to the field of photographing technology, and specifically relates to a photographing method, device and electronic equipment.

背景技术Background Art

为了满足用户对远景、微距等的拍摄需求,目前的电子设备上的相机模组大多数采用多颗不同焦距的定焦镜头组合,并通过数字变倍技术,实现拍照过程中变焦倍率的扩展。但由于数字变倍是把短焦画面内的像素面积放大,因此数字变倍得到的成像细节模糊、画质较低。In order to meet users' needs for long-range and macro photography, most camera modules on current electronic devices use a combination of multiple fixed-focus lenses with different focal lengths, and use digital zoom technology to achieve the expansion of zoom ratios during photography. However, since digital zoom enlarges the pixel area within the short-focus image, the image details obtained by digital zoom are blurred and the image quality is low.

发明内容Summary of the invention

本申请实施例的目的是提供一种拍摄方法、装置和电子设备,能够解决电子设备上的相机模组成像画质低的问题。The purpose of the embodiments of the present application is to provide a shooting method, device and electronic device, which can solve the problem of low image quality of camera modules on electronic devices.

第一方面,本申请实施例提供了一种拍摄方法,应用于电子设备,电子设备上设有光学变焦镜头,该方法包括:In a first aspect, an embodiment of the present application provides a shooting method, which is applied to an electronic device, wherein the electronic device is provided with an optical zoom lens, and the method includes:

接收用户的拍摄输入;Receive user's shooting input;

响应于拍摄输入,通过光学变焦镜头拍摄多张图像,多张图像中至少包括对应光学变焦镜头第一倍率的第一图像,和对应光学变焦镜头第二倍率的第二图像;In response to a shooting input, a plurality of images are shot through the optical zoom lens, wherein the plurality of images at least include a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens;

将第二图像对应目标区域,与第一图像合成,得到目标图像,目标区域为第一图像中与第二图像具有相同对象的区域。The target area corresponding to the second image is synthesized with the first image to obtain the target image, where the target area is the area in the first image that has the same object as the second image.

第二方面,本申请实施例提供了一种拍摄装置,应用于电子设备,电子设备上设有光学变焦镜头,该装置包括:In a second aspect, an embodiment of the present application provides a photographing device, which is applied to an electronic device, and an optical zoom lens is provided on the electronic device, and the device includes:

接收模块,用于接收用户的拍摄输入;A receiving module, used for receiving a user's shooting input;

拍摄模块,用于响应于拍摄输入,通过光学变焦镜头拍摄多张图像,所述多张图像中至少包括对应光学变焦镜头第一倍率的第一图像,和对应所述光学变焦镜头第二倍率的第二图像;A shooting module, configured to shoot a plurality of images through the optical zoom lens in response to a shooting input, wherein the plurality of images at least include a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens;

输出模块,用于将第二图像对应目标区域,与第一图像合成,得到目标图像,目标区域为第一图像中与第二图像具有相同对象的区域。The output module is used to synthesize the target area corresponding to the second image with the first image to obtain the target image, where the target area is the area in the first image that has the same object as the second image.

第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的拍摄方法的步骤。In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the shooting method described in the first aspect.

第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的拍摄方法的步骤。In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the shooting method described in the first aspect are implemented.

第五方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的拍摄方法。In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the shooting method as described in the first aspect.

第六方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面所述的拍摄方法。In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the shooting method as described in the first aspect.

在本申请实施例中,通过电子设备具有的光学变焦镜头,在接收用户的拍摄输入后,响应于该拍摄输入,通过光学变焦镜头拍摄多张图像,其中,多张图像中至少包括对应光学变焦镜头第一倍率的第一图像和对应光学变焦镜头第二倍率的第二图像,第一图像中的目标区域与第二图像具有相同对象。然后将第二图像对应目标区域,与第一图像合成得到目标图像。由于光学变焦镜头在不同倍率下的视场角不同,但得到的图像分辨率相同,所以将第二图像对应目标区域与第一图像中合成后,可以得到与第一图像中具有相同对象,且局部区域分辨率增强的目标图像,保证目标图像中的局部内容清晰,从而提升拍摄成像的画质。In an embodiment of the present application, after receiving a user's shooting input, the optical zoom lens of the electronic device shoots multiple images in response to the shooting input, wherein the multiple images include at least a first image corresponding to the first magnification of the optical zoom lens and a second image corresponding to the second magnification of the optical zoom lens, and the target area in the first image has the same object as the second image. Then the target area of the second image is synthesized with the first image to obtain the target image. Since the field of view of the optical zoom lens is different at different magnifications, but the image resolution obtained is the same, after synthesizing the target area of the second image with the first image, a target image with the same object as the first image and enhanced resolution of the local area can be obtained, ensuring that the local content in the target image is clear, thereby improving the image quality of the captured image.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是定焦镜头进行数字变倍的示意图;FIG1 is a schematic diagram of a fixed-focus lens performing digital zoom;

图2是本申请一个实施例中的光学变焦镜头的结构示意图;FIG2 is a schematic diagram of the structure of an optical zoom lens in one embodiment of the present application;

图3是本申请一个实施例中的拍摄方法的流程示意图;FIG3 is a schematic diagram of a process of a photographing method in one embodiment of the present application;

图4是本申请一个实施例中的拍摄界面的显示示意图;FIG4 is a display schematic diagram of a shooting interface in one embodiment of the present application;

图5是本申请另一个实施例中的拍摄界面的显示示意图;FIG5 is a display schematic diagram of a shooting interface in another embodiment of the present application;

图6是本申请再一个实施例中的光学变焦镜头变倍示意图;FIG6 is a schematic diagram of an optical zoom lens in another embodiment of the present application;

图7是本申请又一个实施例中的拍摄界面的显示示意图;FIG7 is a display schematic diagram of a shooting interface in yet another embodiment of the present application;

图8是本申请一个具体示例中,图像合成的示意图;FIG8 is a schematic diagram of image synthesis in a specific example of the present application;

图9是本申请另一个具体示例中,图像合成的示意图;FIG9 is a schematic diagram of image synthesis in another specific example of the present application;

图10是本申请另一个实施例中的拍摄装置的结构示意图;FIG10 is a schematic structural diagram of a photographing device in another embodiment of the present application;

图11是本申请再一个实施例中的电子设备的硬件结构示意图;FIG11 is a schematic diagram of the hardware structure of an electronic device in yet another embodiment of the present application;

图12是本申请又一个实施例中的电子设备的硬件结构示意图。FIG. 12 is a schematic diagram of the hardware structure of an electronic device in yet another embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and/or" in the specification and claims represents at least one of the connected objects, and the character "/" generally indicates that the objects associated with each other are in an "or" relationship.

目前具有相机模组的电子设备,其相机模组大都采用的是多颗不同焦距的定焦镜头,通过数字变倍技术实现对近景和远景的切换拍摄。例如,图1中示出了电子设备上相机模组中设置的5颗不同焦距的定焦镜头100,如果主摄是1X(即1倍率)焦距的镜头101,副摄包括0.5X、2X、5X和10X焦距的镜头(102,103,104,105),那么通过切换镜头,可以在主摄101和副摄(102,103,104,105)之间变焦。但是这种技术中,由于镜头数量有限,如果用户想要拍摄两个定焦镜头对应焦距之间的某个焦段时,是使用焦距较低的镜头捕捉画面后再通过数码放大算法,得到对应的图像。例如图1中所示的例子,如果拍摄3X焦距的图像,则使用2X镜头103捕捉画面后按照一定比例放大,相当于仅是放大短焦画面上的像素面积,导致得到的成像像素低,分辨率降低,尤其对得到的成像照片局部放大查看时,会发现照片存在明显虚化现象。故而,数字变倍技术得到的图像质量低,细节模糊。At present, most electronic devices with camera modules use multiple fixed-focus lenses with different focal lengths, and use digital zoom technology to switch between close-up and long-range shooting. For example, FIG1 shows five fixed-focus lenses 100 with different focal lengths set in the camera module of an electronic device. If the main camera is a lens 101 with a focal length of 1X (i.e., 1x magnification), and the secondary camera includes lenses with focal lengths of 0.5X, 2X, 5X, and 10X (102, 103, 104, 105), then by switching the lenses, the main camera 101 and the secondary camera (102, 103, 104, 105) can be zoomed in and out. However, in this technology, due to the limited number of lenses, if the user wants to shoot a focal length between the corresponding focal lengths of two fixed-focus lenses, the lens with a lower focal length is used to capture the picture and then the corresponding image is obtained through a digital magnification algorithm. For example, in the example shown in FIG1 , if an image with a 3X focal length is taken, the image is captured by a 2X lens 103 and then enlarged according to a certain ratio, which is equivalent to only enlarging the pixel area on the short-focus image, resulting in low image pixels and reduced resolution. In particular, when the imaged photo is partially enlarged for viewing, it will be found that the photo is obviously blurred. Therefore, the image quality obtained by the digital zoom technology is low and the details are blurred.

为了解决上述技术中存在的问题,本申请实施例提供了一种拍摄方法、装置和电子设备,通过电子设备上具有的光学变焦镜头,拍摄对应多个倍率的多张图像,并通过其中较高倍率的图像替换较低倍率图像中的焦点区域后进行合成,从而得到焦点区域分辨率增强的最终图像,提升最终得到的图像的成像效果。In order to solve the problems existing in the above-mentioned technology, the embodiments of the present application provide a shooting method, device and electronic device, which use an optical zoom lens on the electronic device to shoot multiple images corresponding to multiple magnifications, and replace the focus area in the lower magnification image with the higher magnification image and then synthesize them, so as to obtain a final image with enhanced resolution of the focus area, thereby improving the imaging effect of the final image.

下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的拍摄方法进行详细地说明。The following is a detailed description of the shooting method provided in the embodiment of the present application through specific embodiments and their application scenarios in conjunction with the accompanying drawings.

本申请实施例中的拍摄方法可以应用于电子设备,电子设备上包括光学变焦镜头。其中,如图2所示,光学变焦镜头200是设置在电子设备相机模组中且具有一定长度的光学焦距的镜头,可以包括两个或者多个位置可变的光学镜片201。光学变焦镜头200可以在驱动马达202的驱动下,实现多倍焦距连续可变光学变焦。The shooting method in the embodiment of the present application can be applied to an electronic device, which includes an optical zoom lens. As shown in FIG2 , the optical zoom lens 200 is a lens with an optical focal length of a certain length, which is arranged in a camera module of an electronic device and can include two or more position-variable optical lenses 201. The optical zoom lens 200 can achieve a multi-fold focal length continuously variable optical zoom under the drive of a drive motor 202.

图3示出了本申请实施例中的拍摄方法的流程示意图。参考图3所示,该方法可以包括S301~S303:FIG3 is a schematic diagram showing a flow chart of a photographing method in an embodiment of the present application. Referring to FIG3 , the method may include S301 to S303:

S301.接收用户的拍摄输入;S301. Receive user's shooting input;

S302.响应于拍摄输入,通过光学变焦镜头拍摄多张图像,多张图像中至少包括对应光学变焦镜头第一倍率的第一图像,和对应光学变焦镜头第二倍率的第二图像,第一倍率小于第二倍率。S302. In response to a shooting input, multiple images are shot through the optical zoom lens, the multiple images at least including a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens, the first magnification being smaller than the second magnification.

拍摄输入是用于使电子设备执行拍摄操作的输入,如在拍摄界面的点击输入、语音指令输入等。The shooting input is an input used to enable the electronic device to perform a shooting operation, such as a click input on a shooting interface, a voice command input, etc.

示例性的,参考图4所示,电子设备400的拍摄界面401可以显示有一些功能控件,如用于接收拍摄输入的拍摄键402,用于切换拍照、录像、专业拍摄等功能的按钮(403,404,405)、用于开关闪光灯功能的控件、以及用于供用户选择光学变焦镜头倍率的控件(如滑动杆控件)406等。该拍摄界面401还可以包括预览区域407,用于显示镜头捕捉的预览画面等。For example, referring to FIG4 , a shooting interface 401 of an electronic device 400 may display some functional controls, such as a shooting key 402 for receiving a shooting input, buttons (403, 404, 405) for switching between functions such as photo taking, video recording, and professional shooting, a control for turning on and off the flash function, and a control (such as a sliding bar control) 406 for allowing a user to select an optical zoom lens magnification, etc. The shooting interface 401 may also include a preview area 407 for displaying a preview image captured by the lens, etc.

示例性的,电子设备在拍摄过程中,可以配置默认镜头倍率(如1倍率),也可以通过拍摄界面401的对应控件406选择变倍的倍率,如3倍率。For example, during the shooting process, the electronic device may configure a default lens magnification (such as 1x), or may select a variable magnification, such as 3x, through a corresponding control 406 of the shooting interface 401 .

在用户确认拍摄的倍率(可以是默认倍率,也可以手动选择变倍到其他倍率)后,光学变焦镜头变倍到该倍率的焦距位置,并聚焦捕捉对应的物理场景的画面,生成对应的清晰的预览画面,显示在拍摄界面的预览区域407。After the user confirms the shooting magnification (which can be the default magnification or manually selected to change to another magnification), the optical zoom lens changes to the focal length position of the magnification, and focuses on capturing the corresponding physical scene, generating a corresponding clear preview image, which is displayed in the preview area 407 of the shooting interface.

用户可以根据电子设备的拍摄界面显示的预览画面,通过上述拍摄输入触发拍摄的操作。The user can trigger the shooting operation through the above shooting input according to the preview picture displayed on the shooting interface of the electronic device.

本实施例中,电子设备响应于拍摄输入,通过光学变焦镜头拍摄多张图像,其中至少包括对应光学变焦镜头第一倍率的第一图像,和对应所述光学变焦镜头第二倍率的第二图像,第一倍率小于第二倍率。In this embodiment, the electronic device responds to a shooting input and captures multiple images through an optical zoom lens, including at least a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens, wherein the first magnification is smaller than the second magnification.

例如,响应于拍摄输入,在默认倍率下(第一倍率)对观测物体拍摄得到第一图像,然后光学变焦镜头再变倍到第二倍率后对该观测物体拍摄,得到第二图像。For example, in response to a shooting input, the observed object is photographed at a default magnification (first magnification) to obtain a first image, and then the optical zoom lens is zoomed to a second magnification to photograph the observed object to obtain a second image.

根据光学变焦镜头的特性,光学变焦镜头在变倍到不同倍率时,焦距不同,视场角范围也不同。但光学变焦镜头在任意焦距下拍摄得到的图像,分辨率均相同。所以本实施例中第一图像和第二图像对应的视场角不同,但分辨率相同。According to the characteristics of the optical zoom lens, when the optical zoom lens is zoomed to different magnifications, the focal length is different and the field of view angle range is also different. However, the images captured by the optical zoom lens at any focal length have the same resolution. Therefore, in this embodiment, the first image and the second image have different field of view angles, but the same resolution.

S303.将第二图像对应目标区域,与第一图像合成,得到目标图像,目标区域为第一图像中与第二图像具有相同对象的区域。S303. Synthesize the target area corresponding to the second image with the first image to obtain the target image, where the target area is the area in the first image that has the same object as the second image.

本实施例中,在用户触发拍摄操作后,电子设备通过光学变焦镜头,拍摄得到对应多个倍率的多张图像。多张图像中有一张图像作为基础底片,本实施例中,可以将用户想要拍摄的图像(如1倍率时的图像)作为基础底片,剩余图像可以作为增强样片,用于增强基础底片中的局部区域的分辨率。In this embodiment, after the user triggers the shooting operation, the electronic device uses the optical zoom lens to shoot multiple images corresponding to multiple magnifications. Among the multiple images, one image is used as a basic negative film. In this embodiment, the image that the user wants to shoot (such as the image at 1 magnification) can be used as the basic negative film, and the remaining images can be used as enhanced samples to enhance the resolution of the local area in the basic negative film.

由于在拍摄过程中,在电子设备拍摄位置和角度不变的情况下,通过光学变焦镜头对同一观测物体在不同倍率下拍摄的多张图像中,各图像中呈现的图画内容的中心都对应实际观测物体的同一位置。例如拍摄一只在一片草地上吃草的兔子,在1倍率下,该镜头聚焦在兔子的头部进行拍摄,得到第一图像,第一图像全局呈现的画面内容是一片草地上吃草的兔子,第一图像的中心区域呈现的内容是兔子的头部。在拍摄位置和角度不变的情况下,该镜头变倍到3倍率,视场角范围缩小,镜头仍会聚焦在兔子的头部进行拍摄,则第二图像全局呈现的画面只包括吃草的兔子,第二图像的中心区域呈现的内容也是兔子的头部。所以在拍摄过程中,各图像对应的物体聚焦位置相同,且根据倍率的不同呈现对观测物体不同的拍摄范围(也即视场角),低倍率图像中至少一部分区域(即目标区域)所具有的对象,与高倍率图像的全局区域所具有的对象相同,该对象可以为拍摄画面中包含的所有对象,如所拍摄的物体、前景、背景等。During the shooting process, when the shooting position and angle of the electronic device remain unchanged, in the multiple images of the same observed object shot at different magnifications by the optical zoom lens, the center of the picture content presented in each image corresponds to the same position of the actual observed object. For example, when shooting a rabbit grazing on a meadow, at a magnification of 1, the lens focuses on the rabbit's head to shoot, and a first image is obtained. The picture content presented globally in the first image is a rabbit grazing on a meadow, and the content presented in the central area of the first image is the rabbit's head. When the shooting position and angle remain unchanged, the lens is zoomed to 3 times, the field of view angle range is reduced, and the lens will still focus on the rabbit's head for shooting, then the picture presented globally in the second image only includes the rabbit grazing, and the content presented in the central area of the second image is also the rabbit's head. Therefore, during the shooting process, the focus position of the object corresponding to each image is the same, and different shooting ranges (i.e., field angles) for the observed object are presented according to different magnifications. The object in at least a part of the area (i.e., the target area) in the low-magnification image is the same as the object in the global area of the high-magnification image. The object can be all objects contained in the shooting picture, such as the photographed object, foreground, background, etc.

这样可以将高倍率、对应小视场角的第二图像,覆盖或替换低倍率、对应大视场角的第一图像中的目标区域,继而合成后的目标图像中的局部区域的分辨率高于外围区域的分辨率,从而使图像局部区域分辨率增强,提高图像画质,在缩放目标图像后,也能保证目标图像上目标区域的内容清晰,图像缩放后内容不失真。In this way, a second image with a high magnification and a small field of view can cover or replace the target area in the first image with a low magnification and a large field of view. The resolution of the local area in the synthesized target image is higher than that of the peripheral area, thereby enhancing the resolution of the local area of the image and improving the image quality. After scaling the target image, the content of the target area on the target image can be ensured to be clear and the content is not distorted after the image is scaled.

为了提高拍摄灵活性,满足用户需求,可选的,本申请实施例中,在拍摄界面设有第一控件,该第一控件用于切换拍摄模式,拍摄模式包括普通模式和增强模式。其中,普通模式下,用户可以在默认倍率下拍摄得到对应图像,增强模式下,用户可以通过输入拍摄输入,得到增强等级下的多个目标倍率对应的图像,并由多个图像进行合成,得到局部画质增强的增强图像。具体地,本实施例中,在接收到用户的拍摄输入后,步骤S302响应于拍摄输入,通过光学变焦镜头拍摄多张图像,可以包括S3021~S3023:In order to improve shooting flexibility and meet user needs, optionally, in an embodiment of the present application, a first control is provided in the shooting interface, and the first control is used to switch shooting modes, and the shooting modes include normal mode and enhanced mode. Among them, in normal mode, the user can shoot at the default magnification to obtain the corresponding image, and in enhanced mode, the user can obtain images corresponding to multiple target magnifications at the enhanced level by inputting the shooting input, and synthesize the multiple images to obtain an enhanced image with local image quality enhancement. Specifically, in this embodiment, after receiving the user's shooting input, step S302 responds to the shooting input and shoots multiple images through the optical zoom lens, which may include S3021~S3023:

S3021.响应于拍摄输入,确定光学变焦镜头的变倍等级。S3021. In response to a photographing input, determine a zoom level of the optical zoom lens.

变倍等级为光学变焦镜头变倍的等级,该变倍等级根据用户对基础底片分辨率的强化等级确定。例如镜头默认倍率是1倍率时,用户想要对1倍率的基础底片的中心区域分辨率进行3倍强化,使合成后的目标图像中心区域的分辨率是外围区域的3倍。对应的,可以通过界面的第一控件,接收用户的拍摄输入,确定光学变焦镜头的变倍等级为3。The zoom level is the zoom level of the optical zoom lens, and the zoom level is determined according to the user's enhancement level of the basic film resolution. For example, when the default zoom ratio of the lens is 1, the user wants to enhance the resolution of the central area of the 1-magnification basic film by 3 times, so that the resolution of the central area of the synthesized target image is 3 times that of the peripheral area. Correspondingly, the user's shooting input can be received through the first control of the interface to determine that the zoom level of the optical zoom lens is 3.

S3022.根据变倍等级,确定对应变倍等级的多个目标倍率,多个目标倍率至少包括第一倍率和第二倍率;S3022. According to the zoom level, determine a plurality of target magnifications corresponding to the zoom level, the plurality of target magnifications including at least a first magnification and a second magnification;

S3023.根据多个目标倍率,拍摄对应多个目标倍率的多张图像。S3023. According to the multiple target magnifications, capture multiple images corresponding to the multiple target magnifications.

本实施例中,执行S3021~S3022确定对应变倍等级的多个目标倍率过程中,可以根据变倍等级,首先确定对应的最大倍率,然后基于默认倍率(即基础倍率)和最大倍率,进行均匀插值计算,得到介于默认倍率与最大倍率之间的一个或多个中间倍率。例如默认倍率为1倍率,变倍等级为3,则最大倍率为3倍率,根据默认倍率和最大倍率插值计算得到的中间倍率为2倍率,该1倍率、2倍率和3倍率都为目标倍率。确定目标倍率后,执行S3023,通过光学变焦镜头拍摄每个目标倍率对应的图像,可以得到多张视场角不同的图像。In this embodiment, in the process of executing S3021 to S3022 to determine multiple target magnifications corresponding to the magnification level, the corresponding maximum magnification can be first determined according to the magnification level, and then based on the default magnification (i.e., the basic magnification) and the maximum magnification, a uniform interpolation calculation is performed to obtain one or more intermediate magnifications between the default magnification and the maximum magnification. For example, if the default magnification is 1 and the magnification level is 3, then the maximum magnification is 3, and the intermediate magnification obtained by interpolation calculation based on the default magnification and the maximum magnification is 2, and the 1 magnification, 2 magnification, and 3 magnification are all target magnifications. After determining the target magnification, execute S3023, and use the optical zoom lens to capture images corresponding to each target magnification to obtain multiple images with different field of view angles.

示例性的,如果变倍等级较小,如基础倍率为1倍率,变倍等级为2,基础倍率与最大倍率之间可以不设置中间倍率。以基础倍率和最大倍率,拍摄至少两张图像。For example, if the zoom level is small, such as the base zoom is 1 and the zoom level is 2, no intermediate zoom may be set between the base zoom and the maximum zoom. At least two images are captured at the base zoom and the maximum zoom.

在一些具体场景中,可以通过界面上的控件启动图像增强功能,进而接收用户的拍摄输入,执行上述S3021~S3023。例如,参考图5所示,用户在图5中(5a)所示的拍摄界面501通过一些扩展控件502跳转到图5中(5b)所示的功能扩展界面503,在功能扩展界面503中的对第一控件504输入(如点击),开启或关闭图像增强模式。使得用户能够根据实际需求,拍摄增强图像或普通图像,为用户提供更多选择性。In some specific scenarios, the image enhancement function can be activated through the controls on the interface, and then the user's shooting input is received to execute the above S3021 to S3023. For example, referring to FIG5, the user jumps to the function extension interface 503 shown in FIG5 (5b) through some extended controls 502 in the shooting interface 501 shown in FIG5 (5a), and inputs (such as clicking) the first control 504 in the function extension interface 503 to turn on or off the image enhancement mode. This allows users to shoot enhanced images or ordinary images according to actual needs, providing users with more choices.

在增强模式下,可以通过步骤S3021~S3023得到增强图像(也即目标图像)。In the enhancement mode, an enhanced image (ie, a target image) can be obtained through steps S3021 to S3023.

为了得到画质增强的图像,可选的,本申请实施例基于电子设备具有的光学变焦镜头,在通过S3023拍摄对应多个目标倍率的多张图像过程中,可以通过控制镜头变倍以得到多张不同倍率的图像。具体的,S3023可以包括:In order to obtain an image with enhanced image quality, optionally, in the embodiment of the present application, based on the optical zoom lens of the electronic device, during the process of shooting multiple images corresponding to multiple target magnifications through S3023, the lens can be controlled to change magnification to obtain multiple images with different magnifications. Specifically, S3023 may include:

根据多个目标倍率的大小顺序,控制光学变焦镜头依次变倍到多个目标倍率;According to the order of the multiple target magnifications, the optical zoom lens is controlled to change the magnification to the multiple target magnifications in sequence;

在光学变焦镜头变倍到每个目标倍率的情况下,拍摄至少一张图像。When the optical zoom lens is zoomed to each target magnification, at least one image is captured.

本实施例中,对多个目标倍率排序,并根据多个目标倍率的大小顺序(如从小到大的顺序),控制光学变焦镜头依次变倍到多个目标倍率。示例性的,目标倍率包括第一倍率和第二倍率,且第一倍率小于第二倍率,本示例中第一倍率可以是默认倍率(如1倍率),也可以是用户选择的倍率(如3倍率)。光学变焦镜头在第一倍率时,拍摄第一图像,然后控制光学变焦镜头变倍到第二倍率(如5倍率),拍摄第二图像,这样得到的每一张图像的分辨率相同,在后续合成后,实现局部图像分辨率增强。In this embodiment, multiple target magnifications are sorted, and according to the size order of the multiple target magnifications (such as from small to large), the optical zoom lens is controlled to change magnification to multiple target magnifications in sequence. Exemplarily, the target magnification includes a first magnification and a second magnification, and the first magnification is less than the second magnification. In this example, the first magnification can be a default magnification (such as 1 magnification) or a magnification selected by the user (such as 3 magnifications). When the optical zoom lens is at the first magnification, it captures the first image, and then controls the optical zoom lens to change magnification to the second magnification (such as 5 magnifications) to capture the second image, so that the resolution of each image obtained is the same, and after subsequent synthesis, the local image resolution is enhanced.

具体地,在拍摄过程中,参考图6所示,在确定各目标倍率后,电子设备记录光学变焦镜头在各目标倍率的焦距位置。先在光学变焦镜头601最小的目标倍率,即第一倍率(如1x)下,针对当前场景,完成聚焦操作,保证捕捉的画面的清晰度,并拍摄至少一张图像。然后根据第二倍率(如10x),由驱动马达驱动该镜头601变焦到对应的焦距位置,拍摄第二图像。同理,如果目标倍率还包括介于第一倍率和第二倍率之间的第三倍率,则将镜头601变倍到第三倍率进行拍摄。该第三倍率可以为一个或多个倍率。例如第三倍率包括2倍率、4倍率、6倍率和8倍率,则在拍摄第一倍率(即1x)之后,可以将镜头601依次变倍到2倍率、4倍率、6倍率和8倍率对应的焦距位置,拍摄2倍率的图像、4倍率的图像、6倍率图像、8倍率图像,然后再变倍到第二倍率(即10x),拍摄第二图像。Specifically, during the shooting process, as shown in reference to FIG6 , after determining each target magnification, the electronic device records the focal length position of the optical zoom lens at each target magnification. First, at the minimum target magnification of the optical zoom lens 601, that is, the first magnification (such as 1x), the focusing operation is completed for the current scene to ensure the clarity of the captured picture and take at least one image. Then, according to the second magnification (such as 10x), the drive motor drives the lens 601 to zoom to the corresponding focal length position to take the second image. Similarly, if the target magnification also includes a third magnification between the first magnification and the second magnification, the lens 601 is zoomed to the third magnification for shooting. The third magnification can be one or more magnifications. For example, the third magnification includes 2x, 4x, 6x and 8x. After shooting the first magnification (i.e. 1x), the lens 601 can be magnified to the focal length positions corresponding to 2x, 4x, 6x and 8x in sequence to shoot 2x images, 4x images, 6x images, 8x images, and then magnified to the second magnification (i.e. 10x) to shoot the second image.

在一些具体示例中,可以根据基础倍率和最大倍率以及光学变焦镜头的变焦能力,进行插值计算来确定中间倍率,使基础倍率、中间倍率和最大倍率按照从小到大的顺序,构成增强序列,然后确定增强序列中各倍率对应的焦距位置。例如,用户设定变倍等级为N,光学变焦镜头基础倍率的焦距为fPhotograph,该镜头可变倍的最大焦距为fMax,则增强序列对应各目标倍率的焦距可以表示为其中,1<k<N,k和N均为整数,k表示增强序列中的中间倍率。确定增强序列对应各目标倍率的焦距位置后,控制该镜头依次变倍,拍摄多张图像,并按照步骤S301进行合成,得到局部区域增强的目标图像。In some specific examples, an interpolation calculation can be performed based on the basic magnification, the maximum magnification, and the zoom capability of the optical zoom lens to determine the intermediate magnification, so that the basic magnification, the intermediate magnification, and the maximum magnification form an enhancement sequence in ascending order, and then the focal length position corresponding to each magnification in the enhancement sequence is determined. For example, the user sets the zoom level to N, the focal length of the basic magnification of the optical zoom lens to fPhotograph , and the maximum focal length of the lens that can be zoomed is fMax , then the focal length of each target magnification in the enhancement sequence can be expressed as Wherein, 1<k<N, k and N are both integers, and k represents the intermediate magnification in the enhancement sequence. After determining the focal length position corresponding to each target magnification of the enhancement sequence, the lens is controlled to change magnification in sequence, multiple images are captured, and synthesis is performed according to step S301 to obtain a target image enhanced in a local area.

为了便于用户根据自身需求自由选择增强等级,可选的,本申请实施例中,参考图7所示,在增强模式下,拍摄界面701可以显示用于供用户选择光学变焦镜头变倍等级的控件(以下称为“第二控件”)702,如滑动杆控件。通过该控件702显示变倍等级(如2x、2.5x、5x等),并通过第二控件702接收用户的输入,确定变倍等级,进而根据变倍等级确定目标倍率。其中由于光学变焦镜头在焦距范围内连续可变焦,因此在一些示例中,变倍等级对应的目标倍率可以是整数倍率,也可以是非整数倍率。In order to facilitate the user to freely select the enhancement level according to their own needs, optionally, in the embodiment of the present application, as shown in FIG. 7, in the enhancement mode, the shooting interface 701 can display a control (hereinafter referred to as the "second control") 702 for the user to select the optical zoom lens magnification level, such as a sliding bar control. The control 702 displays the magnification level (such as 2x, 2.5x, 5x, etc.), and receives the user's input through the second control 702 to determine the magnification level, and then determines the target magnification according to the magnification level. Since the optical zoom lens can be continuously zoomed within the focal length range, in some examples, the target magnification corresponding to the magnification level can be an integer magnification or a non-integer magnification.

本实施例中,根据确定的多个目标倍率,控制光学变焦镜头依次变倍到对应的焦距位置,自动聚焦,捕捉观测场景的画面,得到多张图像,每张图像中的画面焦点位置具有对应关系,如都在图像的中心位置。In this embodiment, according to the determined multiple target magnifications, the optical zoom lens is controlled to change the magnification to the corresponding focal length position in sequence, automatically focus, capture the picture of the observed scene, and obtain multiple images. The picture focus position in each image has a corresponding relationship, such as being at the center of the image.

根据实际需求,可以直接以默认倍率下拍摄的图像为基础底片,其他目标倍率下拍摄的图像直接作为增强样片,执行步骤S303进行图像合成,快速得到目标图像。或者用户也可以从拍摄的多张图像(包括第一图像和第二图像)中选择出增强样片和基础底片,执行步骤S303进行合成,满足用户的个性化地拍摄需求。According to actual needs, the image shot at the default magnification can be directly used as the basic negative film, and the images shot at other target magnifications can be directly used as enhanced samples, and step S303 can be executed to perform image synthesis to quickly obtain the target image. Alternatively, the user can also select the enhanced sample film and the basic negative film from the multiple images shot (including the first image and the second image), and execute step S303 to synthesize them to meet the user's personalized shooting needs.

在执行步骤S303进行合成的过程中,可以对图像的视场角进行排序,如从大到小排序。按照图像的视场角大小顺序,对上述多张图像进行逐次叠加并合成。一个可选示例中,可以将高倍率的图像进行缩放,缩放至小于低倍率图像的尺寸,然后按照各图像中所包含对象的对应关系,将缩放后的高倍率图像叠加到低倍率图像上进行合成,使得合成后的图像局部区域分辨率增强,且不会改变原图像(低倍率图像)呈现的画面内容。在其他可选示例中,也可以将低倍率的图像进行放大,放大至大于高倍率图像的尺寸,然后按照各图像中所包含对象的对应关系,将高倍率图像叠加到放大后的低倍率图像上进行合成,这样合成后的图像局部区域分辨率也可以得到增强,且不会改变原图像(低倍率图像)呈现的画面内容。In the process of performing step S303 for synthesis, the field of view of the image can be sorted, such as from large to small. According to the order of the field of view of the image, the above-mentioned multiple images are successively superimposed and synthesized. In an optional example, the high-magnification image can be scaled to a size smaller than the low-magnification image, and then the scaled high-magnification image is superimposed on the low-magnification image for synthesis according to the correspondence between the objects contained in each image, so that the resolution of the local area of the synthesized image is enhanced, and the picture content presented by the original image (low-magnification image) is not changed. In other optional examples, the low-magnification image can also be enlarged to a size larger than the high-magnification image, and then the high-magnification image is superimposed on the enlarged low-magnification image for synthesis according to the correspondence between the objects contained in each image, so that the resolution of the local area of the synthesized image can also be enhanced, and the picture content presented by the original image (low-magnification image) is not changed.

示例性的,在得到第一图和的第二图像后,步骤S303将所述第二图像对应目标区域,与所述第一图像合成,得到目标图像,具体可以包括S3031~S3034:Exemplarily, after obtaining the first image and the second image, step S303 synthesizes the target area corresponding to the second image with the first image to obtain the target image, which may specifically include S3031 to S3034:

S3031.将第一图像和第二图像按照对应的视场角大小顺序进行层叠;S3031. stacking the first image and the second image in order of corresponding viewing angles;

S3032.将第二图像按照对应的第二倍率缩放,缩放后的第二图像与目标区域尺寸相等,且缩放后的第二图像的中心与目标区域的中心对齐,目标区域的中心为所述第一图像的中心。S3032. Scale the second image according to the corresponding second magnification, so that the scaled second image is equal to the size of the target area, and the center of the scaled second image is aligned with the center of the target area, and the center of the target area is the center of the first image.

第二倍率大于第一倍率,则第二图像对应的视场角小于第一图像,参考图8所示,将第二图像801层叠在第一图像802上,并将两图像中心对齐。If the second magnification is greater than the first magnification, the field of view corresponding to the second image is smaller than that of the first image. Referring to FIG. 8 , the second image 801 is superimposed on the first image 802 , and the centers of the two images are aligned.

因为在拍摄位置和角度不变的情况下,光学变焦镜头对应不同倍率变倍时,进行的是轴向运动,镜头的焦点位置不变,所以一张高倍率图像的全局区域所包含的对象,与另一张低倍率图像中部的一定区域所包含的对象相同。Because when the shooting position and angle remain unchanged, the optical zoom lens performs axial movement when changing magnifications, and the focal position of the lens remains unchanged, the object contained in the global area of a high-magnification image is the same as the object contained in a certain area in the middle of another low-magnification image.

因此基于图像之间对象的对应关系,通过步骤S3032,将第二图像按照对应的第二倍率缩放,如2倍率的图像缩放2倍。因为第一图像中的目标区域包含的对象与第二图像包含的对象相同,即表示目标区域对应的视场角范围实际与第二图像相同,而第二图像是在第一倍率的基础上控制镜头变倍到第二倍率拍摄的,所以按照第二倍率缩放后的第二图像与该目标区域的尺寸相等。使缩放后的第二图像的中心与目标区域的中心对齐,缩放后的第二图像层叠在第一图像上时,就可以覆盖住目标区域。Therefore, based on the correspondence between the objects in the images, through step S3032, the second image is scaled according to the corresponding second magnification, such as scaling the 2-magnification image by 2 times. Because the object contained in the target area in the first image is the same as the object contained in the second image, that is, the field of view corresponding to the target area is actually the same as the second image, and the second image is shot by controlling the lens to change the magnification to the second magnification based on the first magnification, so the second image scaled according to the second magnification is equal to the size of the target area. The center of the scaled second image is aligned with the center of the target area, and when the scaled second image is superimposed on the first image, it can cover the target area.

S3033.利用缩放后的第二图像,替换或覆盖目标区域;S3033. Replace or cover the target area with the scaled second image;

S3034.将缩放后的第二图像与第一图像合成,得到目标图像。S3034. Synthesize the scaled second image with the first image to obtain a target image.

缩放后的第二图像与目标区域中心对齐且尺寸相等,所以通过S3033将缩放后的第二图像替换或覆盖目标区域后,将缩放后的第二图像与第一图像合成,得到目标图像不改变第一图像中所包含的对象,且原来目标区域由于被替换为第二图像,所以局部区域像素密度增加,分辨率得到增强,这样将目标图像进行放大或缩小,目标区域中部区域也能保持良好的清晰度。The scaled second image is aligned with the center of the target area and is equal in size. Therefore, after the scaled second image replaces or covers the target area through S3033, the scaled second image is synthesized with the first image to obtain the target image without changing the object contained in the first image. Since the original target area is replaced by the second image, the pixel density of the local area is increased and the resolution is enhanced. In this way, when the target image is enlarged or reduced, the central area of the target area can also maintain good clarity.

示例性的,参考图8,第二倍率大于第一倍率,第二图像801(即增强样片)视场角小于第一图像(即基础底片)802。可以将第二图像801缩放至一定的尺寸,覆盖或替换第一图像802中与第二图像具有相同对象的目标区域803。合成得到的目标图像放大后,目标区域803显示的实际是第二图像的像素分辨率,从而实现第一图像的增强。应理解,图8中,第二图像801和第一图像802原图均为光学变倍镜头连续变倍拍摄,则属于等分辨率图像,其大小绘制示意仅仅代表实际场景拍摄下可拍摄视场画面变化效果。Exemplarily, referring to FIG8 , the second magnification is greater than the first magnification, and the field of view of the second image 801 (i.e., the enhanced sample) is smaller than that of the first image (i.e., the base film) 802. The second image 801 can be scaled to a certain size to cover or replace the target area 803 in the first image 802 that has the same object as the second image. After the synthesized target image is enlarged, the target area 803 actually displays the pixel resolution of the second image, thereby enhancing the first image. It should be understood that in FIG8 , the original images of the second image 801 and the first image 802 are both continuously zoomed with an optical zoom lens, and are equal-resolution images, and their size drawing schematically represents only the effect of the change in the field of view that can be captured under actual scene shooting.

本示例中,如果第一图像对应的焦距为f1,第二图像对应的焦距为f2,则目标图像的分辨率可以等效放大f2/f1倍。In this example, if the focal length corresponding to the first image is f1 and the focal length corresponding to the second image is f2, the resolution of the target image can be equivalently magnified by f2/f1 times.

可选的,在步骤S3031将第一图像和第二图像按照对应的视场角大小顺序进行层叠之前,方法还可以包括:Optionally, before stacking the first image and the second image in order of corresponding viewing angles in step S3031, the method may further include:

在第二图像具有畸变区域的情况下,裁剪和/或矫正第二图像中的畸变区域。In the case where the second image has a distorted region, the distorted region in the second image is cropped and/or corrected.

在第二图像具有畸变区域的情况下,如图像边缘位置存在扭曲、锯齿等畸变区域,则可以对第二图像的畸变区域进行裁剪,也可以通过预设的算法矫正修复该畸变区域后,再进行合成,保证第一图像和第二图像合成后的拼接位置完整。In the case where the second image has a distorted area, such as distortion, jaggedness, etc. at the edge of the image, the distorted area of the second image can be cropped, or the distorted area can be corrected and repaired using a preset algorithm and then synthesized to ensure that the splicing position of the first image and the second image after synthesis is complete.

在其他示例中,在进行图像的合成过程中,也可以将第一图像与第二图像按照视场角大小顺序对齐叠加,然后将第一图像按照第二倍率放大,使得目标区域的尺寸与第二图像相等。再将覆盖或替换放大后的第一图像的目标区域,将第二图像与放大后的第一图像合成,得到目标图像。In other examples, during the image synthesis process, the first image and the second image may be aligned and superimposed in the order of the field of view angle, and then the first image may be magnified at the second magnification so that the size of the target area is equal to that of the second image. Then, the target area of the magnified first image is covered or replaced, and the second image is synthesized with the magnified first image to obtain the target image.

为了逐步增强图像的局部画质,均衡整体图像的分辨率,可选的,本申请实施例中,在通过S301~S302的步骤获取的多张图像中,除了包括第一图像、第二图像之外,还可以包括第三图像,第三图像是对应光学变焦镜头第三倍率的图像,第三倍率介于第一倍率和第二倍率之间。在一些示例中,第三倍率可以是通过步骤S3021~S3022确定的目标倍率之一,则第三图像为通过S2023拍摄的图像。在其他示例中,第三图像可以是通过第二图像和第一图像进行插值计算得到的图像,所以第三图像的倍率介于第一倍率和第二倍率之间。In order to gradually enhance the local image quality and balance the resolution of the overall image, optionally, in an embodiment of the present application, in addition to the first image and the second image, the multiple images obtained through steps S301 to S302 may also include a third image, and the third image is an image corresponding to the third magnification of the optical zoom lens, and the third magnification is between the first magnification and the second magnification. In some examples, the third magnification may be one of the target magnifications determined through steps S3021 to S3022, and the third image is an image taken through S2023. In other examples, the third image may be an image obtained by interpolating the second image and the first image, so the magnification of the third image is between the first magnification and the second magnification.

示例性的,第三倍率作为中间倍率,可以为一个倍率,也可以为多个倍率,对应的,第三图像作为中间倍率的图像,可以为一张,也可以为多张。Exemplarily, the third magnification, as an intermediate magnification, may be one magnification or multiple magnifications. Correspondingly, the third image, as an image of an intermediate magnification, may be one image or multiple images.

当多张图像中包括第三图像时,步骤S303将第二图像对应目标区域,与第一图像合成,得到目标图像,具体可以包括:When the plurality of images include the third image, step S303 synthesizes the target area corresponding to the second image with the first image to obtain the target image, which may specifically include:

将第一图像、第三图像以及第二图像按照对应的视场角大小顺序进行层叠;The first image, the third image and the second image are stacked in order according to the corresponding viewing angles;

将第二图像按照第二倍率进行缩放,缩放后的第二图像与目标局部区域尺寸相等,且与第三图像的中心对齐,目标局部区域为第三图像中与第二图像具有相同对象的区域;The second image is scaled according to a second magnification, so that the scaled second image is equal in size to the target local area and is aligned with the center of the third image, and the target local area is an area in the third image that has the same object as the second image;

将缩放后的第二图像叠加在第三图像上,形成组合图像;superimposing the scaled second image on the third image to form a combined image;

将组合图像按照第三倍率缩放,缩放后的组合图像与目标区域尺寸相等,且与目标区域的中心对齐,目标区域的中心为第一图像的中心;Scaling the combined image according to a third magnification, so that the scaled combined image is equal in size to the target area and aligned with the center of the target area, and the center of the target area is the center of the first image;

利用组合图像,替换或覆盖目标区域;Using the combined image to replace or cover the target area;

将组合图像与第一图像合成,得到目标图像。The combined image is synthesized with the first image to obtain a target image.

本实施例中,对应多个目标倍率的各图像都是对同一观测物体的拍摄图像,但由于采用的镜头倍率不同,拍摄视场角范围不同,图像中呈现的拍摄范围也不同,倍率越大,视场角越小,图像中呈现的拍摄范围也越小。因此当多张图像中包括对应第三倍率的第三图像时,参考图9所示,第三图像903的倍率高于第一图901且低于第二图像902,第三图像903的视场角小于第一图像901且大于第二图像902。为了保证合成后的图像与原图像画面一致,需要按照视场角顺序对图像进行逐次合成。因此本实施例中,根据第二倍率和第三倍率形成的增强序列关系,首先将第一图像、第三图像以及第二图像按照对应的视场角大小顺序进行层叠,层叠后,第三图像位于第一图像和第二图像之间。In this embodiment, each image corresponding to a plurality of target magnifications is a photographic image of the same observed object, but due to different lens magnifications, the shooting field angle ranges are different, and the shooting ranges presented in the image are also different. The larger the magnification, the smaller the field angle, and the smaller the shooting range presented in the image. Therefore, when the plurality of images include a third image corresponding to a third magnification, as shown in reference to FIG9 , the magnification of the third image 903 is higher than the first image 901 and lower than the second image 902, and the field angle of the third image 903 is smaller than the first image 901 and larger than the second image 902. In order to ensure that the synthesized image is consistent with the original image, it is necessary to synthesize the images one by one in the order of the field angles. Therefore, in this embodiment, according to the enhanced sequence relationship formed by the second magnification and the third magnification, the first image, the third image, and the second image are first stacked in the order of the corresponding field angles, and after stacking, the third image is located between the first image and the second image.

如图9所示,第一图像901为第一倍率下拍摄的图像,作为基础底片;第二图像902为第二倍率下拍摄的图像,第三图像903为中间倍率的过渡图像,各图像(901,902,903)均为连续光学变倍镜头拍摄,属于等分辨率图像,其大小的示意仅仅表示图像中呈现的对应实际场景的拍摄视场画面效果。As shown in FIG9 , the first image 901 is an image shot at a first magnification and serves as a base film; the second image 902 is an image shot at a second magnification and the third image 903 is a transition image at an intermediate magnification. Each image (901, 902, 903) is shot with a continuous optical zoom lens and is an equal-resolution image. The size thereof merely indicates the shooting field of view effect of the corresponding actual scene presented in the image.

然后如图9所示的,将增强序列中倍率最大的第二图像902按照第二倍率进行缩放,缩放至与目标局部区域9031尺寸相等,目标局部区域即第三图像903中与第二图像902具有相同对象的区域。缩放后的第二图像902与第三图像903的中心对齐。这样对齐后的两图像之间具有相同对象的画面区域对齐。如第二图像中的全部画面在第三图像中的目标局部区域中的画面相同,第二图像可以覆盖在第三图像的目标局部区域。Then, as shown in FIG9 , the second image 902 with the largest magnification in the enhancement sequence is scaled according to the second magnification to be equal in size to the target local area 9031, which is the area in the third image 903 that has the same object as the second image 902. The scaled second image 902 is aligned with the center of the third image 903. In this way, the image areas with the same object are aligned between the two aligned images. If the entire image in the second image is the same as the image in the target local area in the third image, the second image can cover the target local area in the third image.

将缩放后的第二图像902对应目标局部区域9031,叠加在第三图像903上,形成组合图像904。然后将组合图像904按照第三倍率缩放,缩放后的组合图像904与第一图像901的目标区域9011尺寸相等,且缩放后的组合图像904与目标区域9011的中心对齐,目标区域的中心为第一图像的中心。The scaled second image 902 corresponding to the target local area 9031 is superimposed on the third image 903 to form a combined image 904. The combined image 904 is then scaled according to the third magnification, and the scaled combined image 904 is equal in size to the target area 9011 of the first image 901, and the scaled combined image 904 is aligned with the center of the target area 9011, and the center of the target area is the center of the first image.

再利用缩放后的组合图像904,替换或覆盖目标区域9011,并将缩放后的组合图像904与第一图像901合成,得到目标图905。The scaled combined image 904 is then used to replace or cover the target area 9011 , and the scaled combined image 904 is synthesized with the first image 901 to obtain a target image 905 .

因为每一帧增强样片均保持原有相机的分辨率,所以在最终目标图像合成时会增大其分辨率,目标图像中心部分保持原有分辨率呈现,外围部分的像素密度低于中心部分。如果基础底片的焦距为f1,增强样片中对应的最大焦距为f2,增强后目标图像分辨率将等效放大f2/f1倍。目标图像不缩放时,该图像中外围区域的分辨率效果等效于拍摄的基础底片,但中心部分的图像细节的清晰度高于基础底片。对目标图像的中心部分局部放大后,该中部部分为被第二图像所替换的区域,所以清晰度高于等效倍率拍摄图像,目标图像放大后无图像虚化的现象。Because each frame of enhanced sample film maintains the resolution of the original camera, its resolution will be increased when the final target image is synthesized. The center of the target image maintains the original resolution, and the pixel density of the peripheral part is lower than that of the center. If the focal length of the base film is f1, the corresponding maximum focal length in the enhanced sample film is f2, and the resolution of the enhanced target image will be equivalent to f2/f1 times. When the target image is not scaled, the resolution effect of the peripheral area in the image is equivalent to that of the basic film, but the clarity of the image details in the center is higher than that of the basic film. After the center part of the target image is partially enlarged, the middle part is the area replaced by the second image, so the clarity is higher than the image shot at the equivalent magnification, and there is no image blur after the target image is enlarged.

根据本实施例,先将最大倍率的图像缩放至与中间倍率图像的局部区域尺寸相等,形成组合图像后再进行缩放,将组合图像整体缩放至与目标区域尺寸相等,然后缩放后的组合图像与第一图像合成。这样不仅可以对第一图像中两部分区域的分辨率进行增强,还能保证合成后的图像与第一图像包含的对象相同。在不改变图像内容的情况下,实现从外围逐次到中部区域的合成增强,提高图像的局部分辨率,使得在拍摄过程中,最终得到的图像局部分辨率高,避免放大或缩小目标图像时存在失真的问题。According to this embodiment, the image with the maximum magnification is first scaled to be equal to the size of the local area of the image with the intermediate magnification, and then scaled after forming a combined image, and the combined image is scaled as a whole to be equal to the size of the target area, and then the scaled combined image is synthesized with the first image. In this way, not only can the resolution of the two parts of the first image be enhanced, but also the object contained in the synthesized image and the first image can be ensured to be the same. Without changing the image content, the synthetic enhancement is achieved from the periphery to the middle area successively, and the local resolution of the image is improved, so that during the shooting process, the local resolution of the image finally obtained is high, and the problem of distortion when the target image is enlarged or reduced is avoided.

示例性的,如果多张图像中存在畸变区域,如边缘扭曲、锯齿的区域,则剔除具有畸变区域的图像、或者裁剪掉图像中的畸变区域,或者通过预设算法矫正修复图像中的畸变区域,得到无畸变区域的图像,再进行合成。For example, if there are distorted areas in multiple images, such as areas with twisted edges or jagged edges, the images with distorted areas are eliminated, or the distorted areas in the images are cropped, or the distorted areas in the images are corrected and repaired using a preset algorithm to obtain images without distorted areas, which are then synthesized.

上述实施例中,都是第一图像作为基础底片,倍率低于增强样片的倍率。通过高倍率的增强样片优化基础底片的局部分辨率。在其他实施例中,也可以将高倍率的图像作为基础底片,低倍率的图像作为增强样片进行合成。合成方式也是高倍率的图像对应低倍率图像的目标区域,覆盖或替换低倍率图像的目标区域,与该低倍率图像合成。这样可以扩展基础底片的画面区域,得到的目标图像中部区域保持较高的分辨率,缩放后仍然能保证该中部区域的清晰度,从而在不降低原来图像分辨率的情况下,实现图像画面范围的扩展。In the above embodiments, the first image is used as the base film, and the magnification is lower than that of the enhanced sample. The local resolution of the base film is optimized by the high-magnification enhanced sample. In other embodiments, the high-magnification image can be used as the base film, and the low-magnification image can be synthesized as the enhanced sample. The synthesis method is also that the high-magnification image corresponds to the target area of the low-magnification image, covers or replaces the target area of the low-magnification image, and is synthesized with the low-magnification image. In this way, the picture area of the base film can be expanded, and the middle area of the obtained target image maintains a higher resolution. After scaling, the clarity of the middle area can still be guaranteed, thereby achieving the expansion of the image picture range without reducing the original image resolution.

为了逐步增强图像的局部画质,均衡整体图像的分辨率的同时,提高拍摄效率,本申请实施例中,在根据多个目标倍率,拍摄对应多个目标倍率的多张图像之后,该方法还可以包括:In order to gradually enhance the local image quality, balance the resolution of the overall image, and improve the shooting efficiency, in the embodiment of the present application, after shooting multiple images corresponding to multiple target magnifications according to multiple target magnifications, the method may further include:

根据第一图像和第二图像进行插值运算,得到对应光学变焦镜头第三倍率的第三图像,第三倍率为介于所述第一倍率与所述第二倍率之间的倍率。An interpolation operation is performed according to the first image and the second image to obtain a third image corresponding to a third magnification of the optical zoom lens, where the third magnification is a magnification between the first magnification and the second magnification.

在得到第一图像和第二图像后,可以根据预设算法进行插值计算或通过拟合算法,得到对应第三倍率的第三图像,作为中间倍率的图像,这样不必镜头变焦拍摄,减少硬件动作耗费的时间,从而提高拍摄效率。应理解,用于插值计算出的第三图像的两个图像需要为光学变焦镜头实际拍摄的,才能保证第三图像的分辨率不失真。After obtaining the first image and the second image, an interpolation calculation can be performed according to a preset algorithm or a fitting algorithm to obtain a third image corresponding to the third magnification as an image of the intermediate magnification, so that the lens does not need to be zoomed and photographed, reducing the time consumed by hardware actions, thereby improving shooting efficiency. It should be understood that the two images used for the interpolation calculation of the third image need to be actually photographed by the optical zoom lens to ensure that the resolution of the third image is not distorted.

本申请实施例,在通过拍摄或计算得到第三图像后,可以将第二图像和第三图像作为增强样片,与第一图像(基础底片)按照上述实施例中多张图像合成的方式进行逐次合成,得到局部画质增强的目标图像。In an embodiment of the present application, after obtaining the third image by shooting or calculating, the second image and the third image can be used as enhanced samples and synthesized successively with the first image (basic negative) in the manner of synthesizing multiple images in the above embodiment to obtain a target image with locally enhanced image quality.

本申请实施例中,在拍摄过程中,直接拍摄长焦、短焦镜头的多张图像进行融合,合成后的目标图像中呈现的近景和远景画面均具有高清晰度,较之于基础底片视觉效果更细腻、逼真,支持更大倍率的放大效果,放大后图像中的画面不模糊、不失真,画质高。而且拍摄过程中用户操作少,拍摄便捷高效。In the embodiment of the present application, during the shooting process, multiple images of the telephoto and short-focus lenses are directly shot and fused, and the near and distant views presented in the synthesized target image are both of high definition, and the visual effect is more delicate and realistic than the basic film, and a larger magnification effect is supported. The image in the magnified image is not blurred or distorted, and the image quality is high. In addition, the user operation is less during the shooting process, and the shooting is convenient and efficient.

需要说明的是,本申请实施例提供的拍摄方法,执行主体可以为拍摄装置,或者该拍摄装置中的用于执行拍摄方法的控制模块。本申请实施例中以拍摄装置执行拍摄方法为例,说明本申请实施例提供的拍摄装置。It should be noted that the shooting method provided in the embodiment of the present application can be executed by a shooting device or a control module in the shooting device for executing the shooting method. In the embodiment of the present application, the shooting device provided in the embodiment of the present application is described by taking the shooting method executed by the shooting device as an example.

图10中示出了本申请实施例提供的拍摄装置的结构示意图。该装置应用于电子设备,电子设备具有光学变焦镜头,如图10所示,该装置包括:FIG10 is a schematic diagram of the structure of a photographing device provided in an embodiment of the present application. The device is applied to an electronic device having an optical zoom lens. As shown in FIG10 , the device includes:

接收模块1001,用于接收用户的拍摄输入;Receiving module 1001, used to receive shooting input from the user;

拍摄模块1002,用于响应于拍摄输入,通过光学变焦镜头拍摄多张图像,多张图像中至少包括对应光学变焦镜头第一倍率的第一图像,和对应光学变焦镜头第二倍率的第二图像,第一倍率小于第二倍率;A shooting module 1002 is used to shoot a plurality of images through an optical zoom lens in response to a shooting input, wherein the plurality of images at least include a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens, wherein the first magnification is smaller than the second magnification;

合成模块1003,用于将第二图像对应目标区域,与第一图像中合成,得到目标图像,目标区域为第一图像中与第二图像具有相同对象的区域。The synthesis module 1003 is used to synthesize the target area corresponding to the second image with the first image to obtain the target image, where the target area is the area in the first image that has the same object as the second image.

拍摄输入是用于使电子设备执行拍摄操作的输入,如在拍摄界面的点击输入、语音指令输入等。The shooting input is an input used to enable the electronic device to perform a shooting operation, such as a click input on a shooting interface, a voice command input, etc.

示例性的,电子设备拍摄界面可以显示有一些功能控件,如用于接收拍摄输入的拍摄键,用于切换拍照、录像、全景拍摄等功能的按钮、用于开关闪光灯功能的控件、以及用于供用户选择光学变焦镜头倍率的控件(如滑动杆控件)等。该拍摄界面还可以包括预览区域,用于显示镜头捕捉的预览画面等。For example, the electronic device shooting interface may display some functional controls, such as a shooting key for receiving shooting input, a button for switching between functions such as photo taking, video recording, and panoramic shooting, a control for turning on and off the flash function, and a control for allowing the user to select the optical zoom lens ratio (such as a sliding bar control), etc. The shooting interface may also include a preview area for displaying a preview image captured by the lens, etc.

示例性的,电子设备在拍摄过程中,可以配置默认镜头倍率(如1倍率),也可以通过拍摄界面的对应控件选择变倍的倍率,如3倍率。For example, during the shooting process, the electronic device may configure a default lens magnification (such as 1x), or may select a variable magnification, such as 3x, through a corresponding control on the shooting interface.

在用户确认拍摄的倍率(可以是默认倍率,也可以手动选择变倍到其他倍率)后,光学变焦镜头调整到该倍率的焦距位置,并聚焦捕捉对应的物理场景的画面,生成对应的清晰的预览画面显示在拍摄界面的预览区域。After the user confirms the shooting magnification (it can be the default magnification or manually selected to change the magnification to another magnification), the optical zoom lens adjusts to the focal length position of the magnification, focuses on capturing the corresponding physical scene, and generates a corresponding clear preview image displayed in the preview area of the shooting interface.

用户可以根据电子设备的拍摄界面显示的预览画面,通过上述拍摄输入触发拍摄的操作。The user can trigger the shooting operation through the above shooting input according to the preview picture displayed on the shooting interface of the electronic device.

电子设备响应于拍摄输入,通过光学变焦镜头拍摄多张图像,其中至少包括对应光学变焦镜头第一倍率的第一图像,和对应所述光学变焦镜头第二倍率的第二图像,第一倍率小于第二倍率。In response to a shooting input, the electronic device shoots multiple images through an optical zoom lens, including at least a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens, wherein the first magnification is smaller than the second magnification.

根据光学变焦镜头的特性,光学变焦镜头在变倍到不同倍率时,焦距不同,视场角范围也不同。但光学变焦镜头在任意焦距下拍摄得到的图像,分辨率均相同。所以本实施例中第一图像和第二图像对应的视场角不同,但分辨率相同。According to the characteristics of the optical zoom lens, when the optical zoom lens is zoomed to different magnifications, the focal length is different and the field of view angle range is also different. However, the images captured by the optical zoom lens at any focal length have the same resolution. Therefore, in this embodiment, the first image and the second image have different field of view angles, but the same resolution.

本实施例中,在用户触发拍摄操作后,电子设备通过光学变焦镜头,拍摄得到对应多个倍率的多张图像。多张图像中有一张图像作为基础底片,本实施例中,可以将用户想要拍摄的图像(如1倍率时的图像)作为基础底片,剩余图像可以作为增强样片,用于增强基础底片中的局部区域的分辨率。In this embodiment, after the user triggers the shooting operation, the electronic device uses the optical zoom lens to shoot multiple images corresponding to multiple magnifications. Among the multiple images, one image is used as a basic negative film. In this embodiment, the image that the user wants to shoot (such as the image at 1 magnification) can be used as the basic negative film, and the remaining images can be used as enhanced samples to enhance the resolution of the local area in the basic negative film.

由于在拍摄过程中,在电子设备拍摄位置和角度不变的情况下,通过光学变焦镜头对同一观测物体在不同倍率下拍摄的多张图像中,各图像中呈现的图画内容的中心都对应实际观测物体的同一位置,所以在拍摄过程中,各图像对应的物体聚焦位置相同,且根据倍率的不同呈现对观测物体不同的拍摄范围(也即视场角),低倍率图像中至少一部分区域(即目标区域)所具有的对象,与高倍率图像的全局区域所具有的对象相同,该对象可以为拍摄画面中包含的所有对象,如所拍摄的物体、前景、背景等。During the shooting process, when the shooting position and angle of the electronic device remain unchanged, in the multiple images of the same observed object shot at different magnifications through the optical zoom lens, the center of the picture content presented in each image corresponds to the same position of the actual observed object. Therefore, during the shooting process, the focus position of the object corresponding to each image is the same, and different shooting ranges (i.e., field angles) of the observed object are presented according to different magnifications. The object contained in at least a part of the area (i.e., the target area) in the low-magnification image is the same as the object contained in the global area of the high-magnification image. The object may be all objects contained in the shooting picture, such as the photographed object, foreground, background, etc.

这样可以将高倍率、对应小视场角的第二图像,覆盖或替换低倍率、对应大视场角的第一图像中的目标区域,继而合成后的目标图像中的局部区域的分辨率高于外围区域的分辨率,从而使图像局部区域分辨率增强,提高图像画质,在缩放目标图像后,也能保证目标图像上目标区域的内容清晰,图像缩放后内容不失真。In this way, a second image with a high magnification and a small field of view can cover or replace the target area in the first image with a low magnification and a large field of view. The resolution of the local area in the synthesized target image is higher than that of the peripheral area, thereby enhancing the resolution of the local area of the image and improving the image quality. After scaling the target image, the content of the target area on the target image can be ensured to be clear and the content is not distorted after the image is scaled.

为了提高拍摄灵活性,满足用户需求,可选的,本申请实施例中,在拍摄界面设有第一控件,该第一控件用于切换拍摄模式,拍摄模式包括普通模式和增强模式,其中,普通模式下,用户可以在默认倍率下拍摄得到对应图像,增强模式下,用户可以通过输入拍摄输入,得到增强等级下的多个目标倍率对应的图像,并由多个图像进行合成,得到局部画质增强的增强图像。具体的,拍摄模块1002具体可以包括:In order to improve shooting flexibility and meet user needs, optionally, in the embodiment of the present application, a first control is provided in the shooting interface, and the first control is used to switch the shooting mode. The shooting mode includes a normal mode and an enhanced mode. In the normal mode, the user can shoot at the default magnification to obtain the corresponding image. In the enhanced mode, the user can input the shooting input to obtain images corresponding to multiple target magnifications at the enhanced level, and synthesize multiple images to obtain an enhanced image with local image quality enhancement. Specifically, the shooting module 1002 may specifically include:

第一确定子模块,用于响应于拍摄输入,确定光学变焦镜头的变倍等级;A first determination submodule, for determining a zoom level of the optical zoom lens in response to a shooting input;

第二确定子模块,用于根据变倍等级,确定对应变倍等级的多个目标倍率,多个目标倍率至少包括第一倍率和第二倍率;A second determination submodule is used to determine a plurality of target magnifications corresponding to the magnification level according to the magnification level, wherein the plurality of target magnifications include at least a first magnification and a second magnification;

拍摄子模块,用于根据多个目标倍率,拍摄对应多个目标倍率的多张图像。The shooting submodule is used to shoot multiple images corresponding to multiple target magnifications according to multiple target magnifications.

变倍等级为光学变焦镜头变倍的等级,该变倍等级根据用户对基础底片分辨率的强化等级确定。The zoom level is the zoom level of the optical zoom lens, which is determined according to the user's enhancement level of the basic film resolution.

本实施例中,确定对应变倍等级的多个目标倍率过程中,可以根据变倍等级,首先确定对应的最大倍率,然后基于默认倍率(即基础倍率)和最大倍率,进行均匀插值计算,得到介于默认倍率与最大倍率之间的一个或多个中间倍率。确定目标倍率后,通过光学变焦镜头拍摄每个目标倍率对应的图像,可以得到多张视场角不同的图像。In this embodiment, in the process of determining multiple target magnifications corresponding to the variable magnification level, the corresponding maximum magnification can be first determined according to the variable magnification level, and then a uniform interpolation calculation is performed based on the default magnification (i.e., the basic magnification) and the maximum magnification to obtain one or more intermediate magnifications between the default magnification and the maximum magnification. After determining the target magnification, the image corresponding to each target magnification is captured by the optical zoom lens to obtain multiple images with different field of view angles.

示例性的,如果变倍等级较小,如基础倍率为1倍率,变倍等级为2,基础倍率与最大倍率之间可以不设置中间倍率。以基础倍率和最大倍率,拍摄至少两张图像。For example, if the zoom level is small, such as the base zoom is 1 and the zoom level is 2, no intermediate zoom may be set between the base zoom and the maximum zoom. At least two images are captured at the base zoom and the maximum zoom.

为了得到画质增强的图像,可选的,本申请实施例基于电子设备具有的光学变焦镜头,在拍摄对应多个目标倍率的多张图像过程中,可以通过控制镜头变倍以得到多张不同倍率的图像。具体的,拍摄子模块可以包括:In order to obtain an image with enhanced image quality, optionally, the embodiment of the present application is based on the optical zoom lens of the electronic device, and in the process of shooting multiple images corresponding to multiple target magnifications, multiple images with different magnifications can be obtained by controlling the zoom of the lens. Specifically, the shooting submodule may include:

控制单元,用于根据多个目标倍率的大小顺序,控制光学变焦镜头依次变倍到多个目标倍率;A control unit, used for controlling the optical zoom lens to sequentially change the magnification to a plurality of target magnifications according to the order of the plurality of target magnifications;

拍摄单元,用于在光学变焦镜头变倍到每个目标倍率的情况下,拍摄至少一张图像。The shooting unit is used to shoot at least one image when the optical zoom lens is zoomed to each target magnification.

本实施例中,对多个目标倍率排序,并根据多个目标倍率的大小顺序(如从小到大的顺序),控制光学变焦镜头依次变倍到多个目标倍率。示例性的,目标倍率包括第一倍率和第二倍率,且第一倍率小于第二倍率,本示例中第一倍率可以是默认倍率(如1倍率),也可以是用户选择的倍率(如3倍率)。光学变焦镜头在第一倍率时,拍摄第一图像,然后控制光学变焦镜头变倍到第二倍率(如5倍率),拍摄第二图像,这样得到的每一张图像的分辨率相同,在后续合成后,实现局部图像分辨率增强。In this embodiment, multiple target magnifications are sorted, and according to the size order of the multiple target magnifications (such as from small to large), the optical zoom lens is controlled to change magnification to multiple target magnifications in sequence. Exemplarily, the target magnification includes a first magnification and a second magnification, and the first magnification is less than the second magnification. In this example, the first magnification can be a default magnification (such as 1 magnification) or a magnification selected by the user (such as 3 magnifications). When the optical zoom lens is at the first magnification, it captures the first image, and then controls the optical zoom lens to change magnification to the second magnification (such as 5 magnifications) to capture the second image, so that the resolution of each image obtained is the same, and after subsequent synthesis, the local image resolution is enhanced.

具体地,在拍摄过程中,在确定各目标倍率后,电子设备记录光学变焦镜头在各目标倍率的焦距位置。先在光学变焦镜头最小的目标倍率,即第一倍率(如1x)下,针对当前场景,完成聚焦操作,保证捕捉的画面的清晰度,并拍摄至少一张图像。然后根据第二倍率(如10x),由驱动马达驱动该镜头1变焦到对应的焦距位置,拍摄第二图像。同理,如果目标倍率还包括介于第一倍率和第二倍率之间的第三倍率,则将镜头变倍到第三倍率进行拍摄。该第三倍率可以为一个或多个倍率。Specifically, during the shooting process, after determining each target magnification, the electronic device records the focal length position of the optical zoom lens at each target magnification. First, at the smallest target magnification of the optical zoom lens, that is, the first magnification (such as 1x), the focusing operation is completed for the current scene to ensure the clarity of the captured picture and take at least one image. Then, according to the second magnification (such as 10x), the drive motor drives the lens 1 to zoom to the corresponding focal length position to take the second image. Similarly, if the target magnification also includes a third magnification between the first magnification and the second magnification, the lens is zoomed to the third magnification for shooting. The third magnification can be one or more magnifications.

在一些具体示例中,可以根据基础倍率和最大倍率以及光学变焦镜头的变焦能力,进行插值计算来确定中间倍率,使基础倍率、中间倍率和最大倍率按照从小到大的顺序,构成增强序列,然后确定增强序列中各倍率对应的焦距位置。例如,用户设定变倍等级为N,光学变焦镜头基础倍率的焦距为fPhotograph,该镜头可变倍的最大焦距为fMax,则增强序列对应各目标倍率的焦距可以表示为其中,1<k<N,k和N均为整数,k表示增强序列中的中间倍率。确定增强序列对应各目标倍率的焦距位置后,控制该镜头依次变倍,拍摄多张图像,并通过合成模块进行合成,得到局部区域增强的目标图像。In some specific examples, an interpolation calculation can be performed based on the basic magnification, the maximum magnification, and the zoom capability of the optical zoom lens to determine the intermediate magnification, so that the basic magnification, the intermediate magnification, and the maximum magnification form an enhancement sequence in ascending order, and then the focal length position corresponding to each magnification in the enhancement sequence is determined. For example, the user sets the zoom level to N, the focal length of the basic magnification of the optical zoom lens to fPhotograph , and the maximum focal length of the lens that can be zoomed is fMax , then the focal length of each target magnification in the enhancement sequence can be expressed as Wherein, 1<k<N, k and N are both integers, and k represents the intermediate magnification in the enhancement sequence. After determining the focal length position corresponding to each target magnification of the enhancement sequence, the lens is controlled to change magnification in sequence, multiple images are taken, and the images are synthesized through the synthesis module to obtain the target image enhanced in the local area.

为了便于用户根据自身需求自由选择增强等级,可选的,本申请实施例中,在增强模式下,拍摄界面可以显示用于供用户选择光学变焦镜头变倍等级的控件(以下称为“第二控件”),如滑动杆控件。通过该控件显示变倍等级,并通过第二控件接收用户的输入,确定变倍等级,进而根据变倍等级确定目标倍率。其中由于光学变焦镜头在焦距范围内连续可变焦,因此在一些示例中,变倍等级对应的目标倍率可以是整数倍率,也可以是非整数倍率。In order to facilitate users to freely select the enhancement level according to their own needs, optionally, in an embodiment of the present application, in the enhancement mode, the shooting interface can display a control (hereinafter referred to as the "second control") for the user to select the optical zoom lens zoom level, such as a sliding bar control. The zoom level is displayed through the control, and the user's input is received through the second control to determine the zoom level, and then the target magnification is determined according to the zoom level. Since the optical zoom lens can continuously zoom within the focal length range, in some examples, the target magnification corresponding to the zoom level can be an integer magnification or a non-integer magnification.

本实施例中,根据确定的多个目标倍率,控制光学变焦镜头依次变倍到对应的焦距位置,自动聚焦,捕捉观测场景的画面,得到多张图像,每张图像中的画面焦点位置具有对应关系,如都在图像的中心位置。In this embodiment, according to the determined multiple target magnifications, the optical zoom lens is controlled to change the magnification to the corresponding focal length position in sequence, automatically focus, capture the picture of the observed scene, and obtain multiple images. The picture focus position in each image has a corresponding relationship, such as being at the center of the image.

根据实际需求,可以直接以默认倍率下拍摄的图像为基础底片,其他目标倍率下拍摄的图像直接作为增强样片,通过合成模块1003进行图像合成,快速得到目标图像。或者用户也可以从拍摄的多张图像(包括第一图像和第二图像)中选择出增强样片和基础底片,通过合成模块1003进行合成,满足用户的个性化地拍摄需求。According to actual needs, the image shot at the default magnification can be directly used as the basic negative film, and the images shot at other target magnifications can be directly used as enhanced samples, and the images are synthesized by the synthesis module 1003 to quickly obtain the target image. Alternatively, the user can also select the enhanced sample and the basic negative film from the multiple images (including the first image and the second image) shot, and synthesize them by the synthesis module 1003 to meet the user's personalized shooting needs.

在通过合成模块1003进行图像合成的过程中,可以对图像的视场角进行排序,如从大到小排序。按照图像的视场角大小顺序,对上述多张图像进行逐次叠加并合成。一个可选示例中,可以将高倍率的图像进行缩放,缩放至小于低倍率图像的尺寸,然后按照各图像中所包含对象的对应关系,将缩放后的高倍率图像叠加到低倍率图像上进行合成,使得合成后的图像局部区域分辨率增强,且不会改变原图像(低倍率图像)呈现的画面内容。在其他可选示例中,也可以将低倍率的图像进行放大,放大至大于高倍率图像的尺寸,然后按照各图像中所包含对象的对应关系,将高倍率图像叠加到放大后的低倍率图像上进行合成,这样合成后的图像局部区域分辨率也可以得到增强,且不会改变原图像(低倍率图像)呈现的画面内容。In the process of performing image synthesis by the synthesis module 1003, the field of view of the image can be sorted, such as from large to small. According to the order of the field of view of the image, the above-mentioned multiple images are successively superimposed and synthesized. In an optional example, the high-magnification image can be scaled to a size smaller than the low-magnification image, and then the scaled high-magnification image is superimposed on the low-magnification image for synthesis according to the correspondence of the objects contained in each image, so that the local area resolution of the synthesized image is enhanced, and the screen content presented by the original image (low-magnification image) is not changed. In other optional examples, the low-magnification image can also be enlarged to a size larger than the high-magnification image, and then the high-magnification image is superimposed on the enlarged low-magnification image for synthesis according to the correspondence of the objects contained in each image, so that the local area resolution of the synthesized image can also be enhanced, and the screen content presented by the original image (low-magnification image) is not changed.

示例性的,合成模块1003具体可以包括:Exemplarily, the synthesis module 1003 may specifically include:

第一层叠子模块,用于将第一图像和第二图像按照对应的视场角大小顺序进行层叠;A first stacking submodule, used for stacking the first image and the second image in order of corresponding field angles;

第一缩放子模块,用于将第二图像按照对应的第二倍率缩放,缩放后的第二图像与目标区域尺寸相等,且缩放后的第二图像的中心与目标区域的中心对齐,目标区域的中心为所述第一图像的中心。The first scaling submodule is used to scale the second image according to the corresponding second magnification, so that the scaled second image is equal to the size of the target area, and the center of the scaled second image is aligned with the center of the target area, and the center of the target area is the center of the first image.

第一覆盖子模块,用于利用缩放后的第二图像,替换或覆盖目标区域;A first covering submodule is used to replace or cover the target area with the scaled second image;

第一合成子模块,用于将缩放后的第二图像与第一图像合成,得到目标图像。The first synthesis submodule is used to synthesize the scaled second image with the first image to obtain a target image.

因为在拍摄位置和角度不变的情况下,光学变焦镜头对应不同倍率变倍时,进行的是轴向运动,镜头的焦点位置不变,所以一张高倍率图像的全局区域所包含的对象,与另一张低倍率图像中部的一定区域所包含的对象相同。Because when the shooting position and angle remain unchanged, the optical zoom lens performs axial movement when changing magnifications, and the focal position of the lens remains unchanged, the object contained in the global area of a high-magnification image is the same as the object contained in a certain area in the middle of another low-magnification image.

因此基于图像之间对象的对应关系,将第二图像按照对应的第二倍率缩放。因为第一图像中的目标区域包含的对象与第二图像包含的对象相同,说明目标区域对应的视场角范围实际与第二图像相同,而第二图像是在第一倍率的基础上控制镜头变倍到第二倍率拍摄的,所以按照第二倍率缩放后的第二图像与该目标区域的尺寸相等。使缩放后的第二图像的中心与目标区域的中心对齐,缩放后的第二图像层叠在第一图像上时,就可以覆盖住目标区域。Therefore, based on the correspondence between the objects in the images, the second image is scaled according to the corresponding second magnification. Because the object contained in the target area in the first image is the same as the object contained in the second image, it means that the field of view corresponding to the target area is actually the same as that of the second image, and the second image is shot by controlling the lens to change the magnification to the second magnification based on the first magnification, so the second image scaled according to the second magnification is equal to the size of the target area. The center of the scaled second image is aligned with the center of the target area, and when the scaled second image is superimposed on the first image, it can cover the target area.

缩放后的第二图像与目标区域中心对齐且尺寸相等,将缩放后的第二图像替换或覆盖目标区域后,将缩放后的第二图像与第一图像合成,得到目标图像不改变第一图像中所包含的对象,但原来目标区域被替换第二图像图像后,局部区域像素密度增加,分辨率得到增强,这样将目标图像进行放大或缩小,目标区域中部区域也能保持良好的清晰度。The scaled second image is aligned with the center of the target area and is equal in size. After the scaled second image replaces or covers the target area, the scaled second image is synthesized with the first image to obtain the target image. The object contained in the first image does not change, but after the original target area is replaced by the second image, the pixel density of the local area increases and the resolution is enhanced. In this way, when the target image is enlarged or reduced, the central area of the target area can also maintain good clarity.

本示例中,如果第一图像对应的焦距为f1,第二图像对应的焦距为f2,则目标图像的分辨率可以等效放大f2/f1倍。In this example, if the focal length corresponding to the first image is f1 and the focal length corresponding to the second image is f2, the resolution of the target image can be equivalently magnified by f2/f1 times.

可选的,在装置还可以包括:Optionally, the device may further include:

矫正模块,用于在第二图像具有畸变区域的情况下,裁剪和/或矫正第二图像中的畸变区域。The correction module is used to crop and/or correct the distorted area in the second image when the second image has the distorted area.

在第二图像具有畸变区域的情况下,如图像边缘位置存在扭曲、锯齿等畸变区域,则可以对第二图像的畸变区域进行裁剪,也可以通过预设的算法矫正修复该畸变区域后,再进行合成,保证第一图像和第二图像合成后的拼接位置完整。In the case where the second image has a distorted area, such as distortion, jaggedness, etc. at the edge of the image, the distorted area of the second image can be cropped, or the distorted area can be corrected and repaired using a preset algorithm and then synthesized to ensure that the splicing position of the first image and the second image after synthesis is complete.

在其他示例中,合成模块1003在进行图像的合成过程中,也可以将第一图像与第二图像按照视场角大小顺序对齐叠加,然后将第一图像按照第二倍率放大,使得目标区域的尺寸与第二图像相等。再将覆盖或替换放大后的第一图像的目标区域,将第二图像与放大后的第一图像合成,得到目标图像。In other examples, during the image synthesis process, the synthesis module 1003 may also align and superimpose the first image and the second image in the order of the field of view angle, and then magnify the first image according to the second magnification so that the size of the target area is equal to that of the second image. Then, the target area of the enlarged first image is covered or replaced, and the second image is synthesized with the enlarged first image to obtain the target image.

为了逐步增强图像的局部画质,均衡整体图像的分辨率,可选的,本申请实施例中,多张图像包括第一图像、第二图像以及第三图像,第三图像是对应光学变焦镜头第三倍率的图像,第三倍率介于第一倍率和第二倍率之间。在一些示例中,第三倍率可以是上述目标倍率之一,第三图像为通过拍摄子模块拍摄的图像。在其他示例中,第三图像可以是通过第二图像和第一图像进行插值计算得到的图像,所以第三图像的倍率介于第一倍率和第二倍率之间。In order to gradually enhance the local image quality of the image and balance the resolution of the overall image, optionally, in an embodiment of the present application, the multiple images include a first image, a second image, and a third image, and the third image is an image corresponding to the third magnification of the optical zoom lens, and the third magnification is between the first magnification and the second magnification. In some examples, the third magnification can be one of the above-mentioned target magnifications, and the third image is an image captured by the shooting submodule. In other examples, the third image can be an image obtained by interpolating the second image and the first image, so the magnification of the third image is between the first magnification and the second magnification.

示例性的,第三倍率作为中间倍率,可以为一个倍率,也可以为多个倍率,对应的,第三图像作为中间倍率的图像,可以为一张,也可以为多张。Exemplarily, the third magnification, as an intermediate magnification, may be one magnification or multiple magnifications. Correspondingly, the third image, as an image of an intermediate magnification, may be one image or multiple images.

在一些示例中,合成模块1003具体可以包括:In some examples, the synthesis module 1003 may specifically include:

第二层叠子模块,用于将第一图像、第三图像以及第二图像按照对应的视场角大小顺序进行层叠;A second stacking submodule, used for stacking the first image, the third image and the second image in order of corresponding field angles;

第二缩放子模块,用于将第二图像按照第二倍率进行缩放,缩放后的第二图像与目标局部区域尺寸相等,且与第三图像的中心对齐,目标局部区域为第三图像中与第二图像具有相同对象的区域;A second scaling submodule is used to scale the second image according to a second magnification, so that the scaled second image is equal in size to the target local area and is aligned with the center of the third image, and the target local area is an area in the third image that has the same object as the second image;

形成子模块,用于将缩放后的第二图像叠加在第三图像上,形成组合图像;forming a submodule, for superimposing the scaled second image on the third image to form a combined image;

第三缩放子模块,用于将组合图像按照第三倍率缩放,缩放后的组合图像与目标区域尺寸相等,且与目标区域的中心对齐,目标区域的中心为第一图像的中心;A third scaling submodule is used to scale the combined image according to a third magnification, so that the scaled combined image is equal in size to the target area and is aligned with the center of the target area, and the center of the target area is the center of the first image;

第二覆盖子模块,用于利用组合图像,替换或覆盖目标区域;A second covering submodule is used to replace or cover the target area using the combined image;

第二合成子模块,用于将组合图像与第一图像合成,得到目标图像。The second synthesis submodule is used to synthesize the combined image and the first image to obtain a target image.

因为每一帧增强样片均保持原有相机的分辨率,所以在最终目标图像合成时会增大其分辨率,目标图像中心部分保持原有分辨率呈现,外围部分的像素密度低于中心部分。如果基础底片的焦距为f1,增强样片中对应的最大焦距为f2,增强后目标图像分辨率将等效放大f2/f1倍。目标图像不缩放时,该图像中外围区域的分辨率效果等效于拍摄的基础底片,但中心部分的图像细节的清晰度高于基础底片。对目标图像的中心部分局部放大后,该中部部分为被第二图像所替换的区域,所以清晰度高于等效倍率拍摄图像,目标图像放大后无图像虚化的现象。Because each frame of enhanced sample film maintains the resolution of the original camera, its resolution will be increased when the final target image is synthesized. The center of the target image maintains the original resolution, and the pixel density of the peripheral part is lower than that of the center. If the focal length of the base film is f1, the corresponding maximum focal length in the enhanced sample film is f2, and the resolution of the enhanced target image will be equivalent to f2/f1 times. When the target image is not scaled, the resolution effect of the peripheral area in the image is equivalent to that of the basic film, but the clarity of the image details in the center is higher than that of the basic film. After the center part of the target image is partially enlarged, the middle part is the area replaced by the second image, so the clarity is higher than the image shot at the equivalent magnification, and there is no image blur after the target image is enlarged.

根据本实施例,先将最大倍率的图像缩放至与中间倍率图像的局部区域尺寸相等,形成组合图像后再进行缩放,将组合图像整体缩放至与目标区域尺寸相等,然后缩放后的组合图像与第一图像合成。这样不仅可以对第一图像中两部分区域的分辨率进行增强,还能保证合成后的图像与第一图像包含的对象相同。在不改变图像内容的情况下,实现从外围逐次到中部区域的合成增强,提高图像的局部分辨率,使得在拍摄过程中,最终得到的图像局部分辨率高,避免放大或缩小目标图像时存在失真的问题。According to this embodiment, the image with the maximum magnification is first scaled to be equal to the size of the local area of the image with the intermediate magnification, and then scaled after forming a combined image, and the combined image is scaled as a whole to be equal to the size of the target area, and then the scaled combined image is synthesized with the first image. In this way, not only can the resolution of the two parts of the first image be enhanced, but also the object contained in the synthesized image and the first image can be ensured to be the same. Without changing the image content, the synthetic enhancement is achieved from the periphery to the middle area successively, and the local resolution of the image is improved, so that during the shooting process, the local resolution of the image finally obtained is high, and the problem of distortion when the target image is enlarged or reduced is avoided.

上述实施例中,都是第一图像作为基础底片,倍率低于增强样片的倍率。通过高倍率的增强样片优化基础底片的局部分辨率。在其他实施例中,也可以将高倍率的图像作为基础底片,低倍率的图像作为增强样片进行合成。合成方式也是高倍率的图像对应低倍率图像的目标区域,覆盖或替换低倍率图像的目标区域,与该低倍率图像合成。这样可以扩展基础底片的画面区域,得到的目标图像中部区域保持较高的分辨率,缩放后仍然能保证该中部区域的清晰度,从而在不降低原来图像分辨率的情况下,实现图像画面范围的扩展。In the above embodiments, the first image is used as the base film, and the magnification is lower than that of the enhanced sample. The local resolution of the base film is optimized by the high-magnification enhanced sample. In other embodiments, the high-magnification image can be used as the base film, and the low-magnification image can be synthesized as the enhanced sample. The synthesis method is also that the high-magnification image corresponds to the target area of the low-magnification image, covers or replaces the target area of the low-magnification image, and is synthesized with the low-magnification image. In this way, the picture area of the base film can be expanded, and the middle area of the obtained target image maintains a higher resolution. After scaling, the clarity of the middle area can still be guaranteed, thereby achieving the expansion of the image picture range without reducing the original image resolution.

为了逐步增强图像的局部画质,均衡整体图像的分辨率的同时,提高拍摄效率,本申请实施例中,装置还可以包括:In order to gradually enhance the local image quality, balance the resolution of the overall image, and improve the shooting efficiency, the device in the embodiment of the present application may further include:

运算模块,用于根据第一图像和第二图像进行插值运算,得到对应光学变焦镜头第三倍率的第三图像,第三倍率为介于所述第一倍率与所述第二倍率之间的倍率。The operation module is used to perform interpolation operation according to the first image and the second image to obtain a third image corresponding to a third magnification of the optical zoom lens, where the third magnification is a magnification between the first magnification and the second magnification.

在得到第一图像和第二图像后,可以根据预设算法进行插值计算或通过拟合算法,得到对应第三倍率的第三图像,作为中间倍率的图像,这样不必镜头变焦拍摄,减少硬件动作耗费的时间,从而提高拍摄效率。应理解,用于插值计算出的第三图像的两个图像需要为光学变焦镜头实际拍摄的,才能保证第三图像的分辨率不失真。After obtaining the first image and the second image, an interpolation calculation can be performed according to a preset algorithm or a fitting algorithm to obtain a third image corresponding to the third magnification as an image of the intermediate magnification, so that the lens does not need to be zoomed and photographed, reducing the time consumed by hardware actions, thereby improving shooting efficiency. It should be understood that the two images used for the interpolation calculation of the third image need to be actually photographed by the optical zoom lens to ensure that the resolution of the third image is not distorted.

本申请实施例,在通过拍摄或计算得到第三图像后,可以将第二图像和第三图像作为增强样片,与第一图像(基础底片)按照上述实施例中多张图像合成的方式进行逐次合成,得到局部画质增强的目标图像。In an embodiment of the present application, after obtaining the third image by shooting or calculating, the second image and the third image can be used as enhanced samples and synthesized successively with the first image (basic negative) in the manner of synthesizing multiple images in the above embodiment to obtain a target image with locally enhanced image quality.

本申请实施例中,在拍摄过程中,直接拍摄长焦、短焦镜头的多张图像进行融合,合成后的目标图像中呈现的近景和远景画面均具有高清晰度,较之于基础底片视觉效果更细腻、逼真,支持更大倍率的放大效果,放大后图像中的画面不模糊、不失真,画质高。而且拍摄过程中用户操作少,拍摄便捷高效。In the embodiment of the present application, during the shooting process, multiple images of the telephoto and short-focus lenses are directly shot and fused, and the near and distant views presented in the synthesized target image are both of high definition, and the visual effect is more delicate and realistic than the basic film, and a larger magnification effect is supported. The image in the magnified image is not blurred or distorted, and the image quality is high. In addition, the user operation is less during the shooting process, and the shooting is convenient and efficient.

本申请实施例中的拍摄装置可以是装置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personaldigital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(NetworkAttached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。The photographing device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

本申请实施例中的拍摄装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。The shooting device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

本申请实施例提供的拍摄装置能够实现图1至图9的方法实施例实现的各个过程,为避免重复,这里不再赘述。The shooting device provided in the embodiment of the present application can implement each process implemented by the method embodiments of Figures 1 to 9, and will not be described again here to avoid repetition.

可选地,如图11所示,本申请实施例还提供一种电子设备1100,包括处理器1101,存储器1102,存储在存储器1102上并可在所述处理器1101上运行的程序或指令,该程序或指令被处理器1101执行时实现上述拍摄方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, as shown in Figure 11, an embodiment of the present application also provides an electronic device 1100, including a processor 1101, a memory 1102, and a program or instruction stored in the memory 1102 and executable on the processor 1101. When the program or instruction is executed by the processor 1101, each process of the above-mentioned shooting method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

需要说明的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

图12为实现本申请实施例的一种电子设备的硬件结构示意图。FIG. 12 is a schematic diagram of the hardware structure of an electronic device implementing an embodiment of the present application.

该电子设备1200包括但不限于:射频单元1201、网络模块1202、音频输出单元1203、输入单元1204、传感器105、显示单元1206、用户输入单元1207、接口单元1208、存储器1209、以及处理器1210等部件。The electronic device 1200 includes but is not limited to: a radio frequency unit 1201, a network module 1202, an audio output unit 1203, an input unit 1204, a sensor 105, a display unit 1206, a user input unit 1207, an interface unit 1208, a memory 1209, and a processor 1210 and other components.

本领域技术人员可以理解,电子设备1200还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1210逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图12中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。Those skilled in the art will appreciate that the electronic device 1200 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 1210 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The electronic device structure shown in FIG12 does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown, or combine certain components, or arrange components differently, which will not be described in detail here.

其中,输入单元1204可以包括摄像头和图形处理器,摄像头包括光学变焦镜头;The input unit 1204 may include a camera and a graphics processor, and the camera includes an optical zoom lens;

用户输入单元1207,用于接收用户的拍摄输入;The user input unit 1207 is used to receive the user's shooting input;

输入单元1204,用于响应于所述拍摄输入,通过所述光学变焦镜头拍摄多张图像,所述多张图像中至少包括对应所述光学变焦镜头第一倍率的第一图像,和对应所述光学变焦镜头第二倍率的第二图像,第一倍率小于所述第二倍率;an input unit 1204, configured to capture a plurality of images through the optical zoom lens in response to the capture input, wherein the plurality of images at least include a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens, wherein the first magnification is smaller than the second magnification;

输入单元1204,还用于通过图形处理器,将第二图像对应目标区域,与第一图像合成,得到目标图像,目标区域为所述第一图像中与所述第二图像具有相同对象的区域。The input unit 1204 is further configured to synthesize the target area corresponding to the second image with the first image through a graphics processor to obtain a target image, where the target area is an area in the first image having the same object as that in the second image.

由于在拍摄过程中,在电子设备拍摄位置和角度不变的情况下,通过光学变焦镜头对同一观测物体在不同倍率下拍摄的多张图像中,各图像中呈现的图画内容的中心都对应实际观测物体的同一位置。所以在拍摄过程中,各图像对应的物体聚焦位置相同,且根据倍率的不同呈现对观测物体不同的拍摄范围(也即视场角),低倍率图像中至少一部分区域(即目标区域)所具有的对象,与高倍率图像的全局区域所具有的对象相同,该对象可以为拍摄画面中包含的所有对象,如所拍摄的物体、前景、背景等。Since during the shooting process, when the shooting position and angle of the electronic device remain unchanged, in the multiple images of the same observed object shot at different magnifications by the optical zoom lens, the center of the picture content presented in each image corresponds to the same position of the actual observed object. Therefore, during the shooting process, the focus position of the object corresponding to each image is the same, and different shooting ranges (i.e., field angles) of the observed object are presented according to different magnifications. The object in at least a part of the area (i.e., the target area) in the low-magnification image is the same as the object in the global area of the high-magnification image, and the object can be all objects contained in the shooting picture, such as the photographed object, foreground, background, etc.

这样可以将高倍率、对应小视场角的第二图像,覆盖或替换低倍率、对应大视场角的第一图像中的目标区域,继而合成后的目标图像中的局部区域的分辨率高于外围区域的分辨率,从而使图像局部区域分辨率增强,提高图像画质,在缩放目标图像后,也能保证目标图像上目标区域的内容清晰,图像缩放后内容不失真。In this way, a second image with a high magnification and a small field of view can cover or replace the target area in the first image with a low magnification and a large field of view. The resolution of the local area in the synthesized target image is higher than that of the peripheral area, thereby enhancing the resolution of the local area of the image and improving the image quality. After scaling the target image, the content of the target area on the target image can be ensured to be clear and the content is not distorted after the image is scaled.

为了得到画质增强的图像,可选的,处理器1210用于:In order to obtain an image with enhanced image quality, optionally, the processor 1210 is configured to:

响应于拍摄输入,确定光学变焦镜头的变倍等级;In response to a capture input, determining a zoom level of the optical zoom lens;

根据变倍等级,确定对应变倍等级的多个目标倍率,多个目标倍率至少包括第一倍率和第二倍率;According to the zoom level, determining a plurality of target magnifications corresponding to the zoom level, the plurality of target magnifications including at least a first magnification and a second magnification;

输入单元1204具体可以用于:根据多个目标倍率,拍摄对应多个目标倍率的多张图像。The input unit 1204 may be specifically configured to: capture multiple images corresponding to multiple target magnifications according to multiple target magnifications.

示例性的,第一倍率可以是默认倍率,也可以是用户选择的倍率。拍摄第一图像,然后控制光学变焦镜头变倍到所述第二倍率,拍摄第二图像,这样得到的每一张图像的分辨率相同,在后续合成后,实现局部图像增强。Exemplarily, the first magnification may be a default magnification or a magnification selected by a user. The first image is captured, and then the optical zoom lens is controlled to zoom to the second magnification to capture the second image, so that each image obtained has the same resolution, and local image enhancement is achieved after subsequent synthesis.

可选的,处理器1210具体可以用于:Optionally, the processor 1210 may be specifically configured to:

根据多个目标倍率的大小顺序,控制光学变焦镜头依次变倍到多个目标倍率;According to the order of the multiple target magnifications, the optical zoom lens is controlled to change the magnification to the multiple target magnifications in sequence;

输入单元1204具体可以用于:在光学变焦镜头变倍到每个目标倍率的情况下,拍摄至少一张图像。The input unit 1204 may be specifically configured to capture at least one image when the optical zoom lens is zoomed to each target magnification.

本实施例中,对多个目标倍率排序,并根据多个目标倍率的大小顺序(如从小到大的顺序),控制光学变焦镜头依次变倍到多个目标倍率。示例性的,目标倍率包括第一倍率和第二倍率,且第一倍率小于第二倍率,本示例中第一倍率可以是默认倍率(如1倍率),也可以是用户选择的倍率(如3倍率)。光学变焦镜头在第一倍率时,拍摄第一图像,然后控制光学变焦镜头变倍到第二倍率(如5倍率),拍摄第二图像,这样得到的每一张图像的分辨率相同,在后续合成后,实现局部图像分辨率增强。In this embodiment, multiple target magnifications are sorted, and according to the size order of the multiple target magnifications (such as from small to large), the optical zoom lens is controlled to change magnification to multiple target magnifications in sequence. Exemplarily, the target magnification includes a first magnification and a second magnification, and the first magnification is less than the second magnification. In this example, the first magnification can be a default magnification (such as 1 magnification) or a magnification selected by the user (such as 3 magnifications). When the optical zoom lens is at the first magnification, it captures the first image, and then controls the optical zoom lens to change magnification to the second magnification (such as 5 magnifications) to capture the second image, so that the resolution of each image obtained is the same, and after subsequent synthesis, the local image resolution is enhanced.

可选的,输入单元1204具体还可以通过图形处理器,用于:Optionally, the input unit 1204 may also be specifically configured through a graphics processor to:

将第一图像和第二图像按照对应的视场角大小顺序进行层叠;The first image and the second image are stacked in order of corresponding viewing angles;

将第二图像按照对应的第二倍率缩放,缩放后的第二图像与目标区域尺寸相等,且缩放后的第二图像的中心与目标区域的中心对齐,目标区域的中心为所述第一图像的中心;Scaling the second image according to the corresponding second magnification, so that the scaled second image is equal to the size of the target area, and the center of the scaled second image is aligned with the center of the target area, and the center of the target area is the center of the first image;

利用缩放后的第二图像,替换或覆盖目标区域;Using the scaled second image to replace or cover the target area;

将缩放后的第二图像与第一图像合成,得到目标图像。The scaled second image is synthesized with the first image to obtain a target image.

使缩放后的第二图像的中心与目标区域的中心对齐,缩放后的第二图像层叠在第一图像上时,就可以覆盖住目标区域。缩放后的第二图像与目标区域中心对齐且尺寸相等,所以将缩放后的第二图像替换或覆盖目标区域后,将缩放后的第二图像与第一图像合成,得到目标图像不改变第一图像中所包含的对象,但原来目标区域被替换第二图像后,局部区域像素密度增加,分辨率得到增强,这样将目标图像进行放大或缩小,目标区域中部区域也能保持良好的清晰度。The center of the scaled second image is aligned with the center of the target area, and when the scaled second image is superimposed on the first image, the target area can be covered. The scaled second image is aligned with the center of the target area and has the same size, so after the scaled second image replaces or covers the target area, the scaled second image is synthesized with the first image to obtain the target image without changing the object contained in the first image, but after the original target area is replaced by the second image, the pixel density of the local area increases and the resolution is enhanced, so that when the target image is enlarged or reduced, the central area of the target area can also maintain good clarity.

这样如果第一图像对应的焦距为f1,第二图像对应的焦距为f2,则目标图像的分辨率可以等效放大f2/f1倍。In this way, if the focal length corresponding to the first image is f1 and the focal length corresponding to the second image is f2, the resolution of the target image can be equivalently magnified by f2/f1 times.

可选的,输入单元1204具体还可以通过图形处理器,用于:Optionally, the input unit 1204 may also be specifically configured through a graphics processor to:

在第二图像具有畸变区域的情况下,裁剪和/或矫正第二图像中的畸变区域。In the case where the second image has a distorted region, the distorted region in the second image is cropped and/or corrected.

在其他示例中,在进行图像的合成过程中,也可以将第一图像与第二图像按照视场角大小顺序对齐叠加,然后将第一图像按照第二倍率放大,使得目标区域的尺寸与第二图像相等。再将覆盖或替换放大后的第一图像的目标区域,将第二图像与放大后的第一图像合成,得到目标图像。In other examples, during the image synthesis process, the first image and the second image may be aligned and superimposed in the order of the field of view angle, and then the first image may be magnified at the second magnification so that the size of the target area is equal to that of the second image. Then, the target area of the magnified first image is covered or replaced, and the second image is synthesized with the magnified first image to obtain the target image.

可选的,当多张图像中包括第三图像时,输入单元1204具体还可以通过图形处理器,用于:Optionally, when the plurality of images include the third image, the input unit 1204 may further be configured to:

将第一图像、第三图像以及第二图像按照对应的视场角大小顺序进行层叠;The first image, the third image and the second image are stacked in order according to the corresponding viewing angles;

将第二图像按照第二倍率进行缩放,缩放后的第二图像与目标局部区域尺寸相等,且与第三图像的中心对齐,目标局部区域为第三图像中与第二图像具有相同对象的区域;The second image is scaled according to a second magnification, so that the scaled second image is equal in size to the target local area and is aligned with the center of the third image, and the target local area is an area in the third image that has the same object as the second image;

将缩放后的第二图像叠加在第三图像上,形成组合图像;superimposing the scaled second image on the third image to form a combined image;

将组合图像按照第三倍率缩放,缩放后的组合图像与目标区域尺寸相等,且与目标区域的中心对齐,目标区域的中心为第一图像的中心;Scaling the combined image according to a third magnification, so that the scaled combined image is equal in size to the target area and aligned with the center of the target area, and the center of the target area is the center of the first image;

利用组合图像,替换或覆盖目标区域;Using the combined image to replace or cover the target area;

将组合图像与第一图像合成,得到目标图像。The combined image is synthesized with the first image to obtain a target image.

根据本实施例,先将最大倍率的图像缩放至与中间倍率图像的局部区域尺寸相等,形成组合图像后再进行缩放,将组合图像整体缩放至与目标区域尺寸相等,然后缩放后的组合图像与第一图像合成。这样不仅可以对第一图像中两部分区域的分辨率进行增强,还能保证合成后的图像与第一图像包含的对象相同。在不改变图像内容的情况下,实现从外围逐次到中部区域的合成增强,提高图像的局部分辨率,使得在拍摄过程中,最终得到的图像局部分辨率高,避免放大或缩小目标图像时存在失真的问题。According to this embodiment, the image with the maximum magnification is first scaled to be equal to the size of the local area of the image with the intermediate magnification, and then scaled after forming a combined image, and the combined image is scaled as a whole to be equal to the size of the target area, and then the scaled combined image is synthesized with the first image. In this way, not only can the resolution of the two parts of the first image be enhanced, but also the object contained in the synthesized image and the first image can be ensured to be the same. Without changing the image content, the synthetic enhancement is achieved from the periphery to the middle area successively, and the local resolution of the image is improved, so that during the shooting process, the local resolution of the image finally obtained is high, and the problem of distortion when the target image is enlarged or reduced is avoided.

应理解的是,本申请实施例中,输入单元1204可以包括图形处理器(GraphicsProcessing Unit,GPU)12041和麦克风,图形处理器12041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头12042)获得的静态图片或视频的图像数据进行处理。显示单元1206可包括显示面板12061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板12061。用户输入单元1207包括触控面板12071以及其他输入设备12072。触控面板12071,也称为触摸屏。触控面板12071可包括触摸检测装置和触摸控制器两个部分。其他输入设备12072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。存储器1209可用于存储软件程序以及各种数据,包括但不限于应用程序和操作系统。处理器1210可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1210中。It should be understood that in the embodiment of the present application, the input unit 1204 may include a graphics processor (Graphics Processing Unit, GPU) 12041 and a microphone, and the graphics processor 12041 processes the image data of the static picture or video obtained by the image capture device (such as camera 12042) in the video capture mode or the image capture mode. The display unit 1206 may include a display panel 12061, and the display panel 12061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 1207 includes a touch panel 12071 and other input devices 12072. The touch panel 12071 is also called a touch screen. The touch panel 12071 may include two parts: a touch detection device and a touch controller. Other input devices 12072 may include, but are not limited to, a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 1209 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 1210 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 1210.

本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述拍摄方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned shooting method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述拍摄方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned shooting method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

并且,本申请实施例还提供了一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述的拍摄方法实施例的各个过程。Furthermore, an embodiment of the present application further provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the various processes of the above-mentioned shooting method embodiment.

应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM/RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims (8)

Translated fromChinese
1.一种拍摄方法,应用于电子设备,所述电子设备上包括光学变焦镜头,其特征在于,所述方法包括:1. A shooting method, applied to an electronic device, wherein the electronic device includes an optical zoom lens, wherein the method comprises:接收用户的拍摄输入;Receive shooting input from the user;响应于所述拍摄输入,通过所述光学变焦镜头拍摄多张图像,所述多张图像中至少包括对应所述光学变焦镜头第一倍率的第一图像,和对应所述光学变焦镜头第二倍率的第二图像,所述第一倍率小于所述第二倍率;In response to the shooting input, a plurality of images are shot through the optical zoom lens, wherein the plurality of images at least include a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens, wherein the first magnification is smaller than the second magnification;将所述第二图像对应目标区域,与所述第一图像合成,得到目标图像,所述目标区域为所述第一图像中与所述第二图像具有相同对象的区域;The target area corresponding to the second image is synthesized with the first image to obtain a target image, wherein the target area is an area in the first image having the same object as the second image;所述多张图像还包括对应第三倍率的第三图像,所述第三倍率为介于所述第一倍率和第二倍率之间的倍率;所述将所述第二图像对应目标区域,与所述第一图像合成,得到目标图像,包括:The plurality of images further include a third image corresponding to a third magnification, wherein the third magnification is a magnification between the first magnification and the second magnification; and synthesizing the second image corresponding to the target area with the first image to obtain the target image includes:将所述第一图像、第三图像以及第二图像按照对应的视场角大小顺序进行层叠;stacking the first image, the third image and the second image in order of corresponding viewing angles;将所述第二图像按照第二倍率进行缩放,缩放后的第二图像与目标局部区域尺寸相等,且与所述第三图像的中心对齐,所述目标局部区域为所述第三图像中与所述第二图像具有相同对象的区域;Scaling the second image at a second magnification, so that the scaled second image is equal in size to the target local area and is aligned with the center of the third image, and the target local area is an area in the third image that has the same object as the second image;将所述缩放后的第二图像叠加在所述第三图像上,形成组合图像;superimposing the scaled second image on the third image to form a combined image;将所述组合图像按照第三倍率缩放,缩放后的组合图像与所述目标区域尺寸相等,且与所述目标区域的中心对齐,所述目标区域的中心为所述第一图像的中心;Scaling the combined image according to a third magnification, wherein the scaled combined image is equal in size to the target area and aligned with the center of the target area, and the center of the target area is the center of the first image;利用所述缩放后的组合图像,替换或覆盖所述目标区域;Using the scaled combined image to replace or cover the target area;将所述缩放后的组合图像与所述第一图像合成,得到所述目标图像。The scaled combined image is synthesized with the first image to obtain the target image.2.根据权利要求1所述的方法,其特征在于,所述响应于所述拍摄输入,通过所述光学变焦镜头拍摄多张图像,包括:2. The method according to claim 1, wherein in response to the shooting input, shooting a plurality of images through the optical zoom lens comprises:响应于所述拍摄输入,确定所述光学变焦镜头的变倍等级;In response to the shooting input, determining a zoom level of the optical zoom lens;根据所述变倍等级,确定对应所述变倍等级的多个目标倍率,所述多个目标倍率至少包括所述第一倍率和所述第二倍率;According to the zoom level, determining a plurality of target magnifications corresponding to the zoom level, the plurality of target magnifications including at least the first magnification and the second magnification;根据所述多个目标倍率,拍摄对应所述多个目标倍率的所述多张图像。According to the plurality of target magnifications, the plurality of images corresponding to the plurality of target magnifications are captured.3.根据权利要求2所述的方法,其特征在于,所述根据所述多个目标倍率,拍摄对应所述多个目标倍率的所述多张图像,包括:3. The method according to claim 2, wherein the step of capturing the plurality of images corresponding to the plurality of target magnifications comprises:根据所述多个目标倍率的大小顺序,控制所述光学变焦镜头依次变倍到所述多个目标倍率;According to the order of the multiple target magnifications, controlling the optical zoom lens to sequentially change the magnification to the multiple target magnifications;在所述光学变焦镜头变倍到每个目标倍率的情况下,拍摄至少一张图像。When the optical zoom lens is zoomed to each target magnification, at least one image is captured.4.根据权利要求1所述的方法,其特征在于,在所述将所述第一图像、第三图像以及第二图像按照对应的视场角大小顺序进行层叠之前,所述方法包括:4. The method according to claim 1, characterized in that before stacking the first image, the third image and the second image in order of corresponding field angles, the method comprises:在所述第二图像具有畸变区域的情况下,裁剪和/或矫正所述第二图像中的所述畸变区域。In the case where the second image has a distorted area, the distorted area in the second image is cropped and/or corrected.5.根据权利要求2所述的方法,其特征在于,在所述根据所述多个目标倍率,拍摄对应所述多个目标倍率的所述多张图像之后,所述方法还包括:5. The method according to claim 2, characterized in that after taking the plurality of images corresponding to the plurality of target magnifications according to the plurality of target magnifications, the method further comprises:根据所述第一图像和所述第二图像进行插值运算,得到对应所述光学变焦镜头第三倍率的第三图像,所述第三倍率为介于所述第一倍率与所述第二倍率之间的倍率。An interpolation operation is performed according to the first image and the second image to obtain a third image corresponding to a third magnification of the optical zoom lens, where the third magnification is a magnification between the first magnification and the second magnification.6.一种拍摄装置,应用于电子设备,所述电子设备上包括光学变焦镜头,其特征在于,所述装置包括:6. A photographing device, applied to an electronic device, wherein the electronic device includes an optical zoom lens, wherein the device comprises:接收模块,用于接收用户的拍摄输入;A receiving module, used for receiving a user's shooting input;拍摄模块,用于响应于所述拍摄输入,通过所述光学变焦镜头拍摄多张图像,所述多张图像中至少包括对应所述光学变焦镜头第一倍率的第一图像,和对应所述光学变焦镜头第二倍率的第二图像,所述第一倍率小于所述第二倍率;a photographing module, configured to photograph a plurality of images through the optical zoom lens in response to the photographing input, wherein the plurality of images at least include a first image corresponding to a first magnification of the optical zoom lens and a second image corresponding to a second magnification of the optical zoom lens, wherein the first magnification is smaller than the second magnification;合成模块,用于将所述第二图像对应目标区域,与第一图像合成,得到目标图像,所述目标区域为所述第一图像中与所述第二图像具有相同对象的区域;A synthesis module, used for synthesizing a target area corresponding to the second image with the first image to obtain a target image, wherein the target area is an area in the first image having the same object as the second image;所述合成模块具体包括:The synthesis module specifically includes:第二层叠子模块,用于将第一图像、第三图像以及第二图像按照对应的视场角大小顺序进行层叠;A second stacking submodule, used for stacking the first image, the third image and the second image in order of corresponding field angles;第二缩放子模块,用于将第二图像按照第二倍率进行缩放,缩放后的第二图像与目标局部区域尺寸相等,且与第三图像的中心对齐,目标局部区域为第三图像中与第二图像具有相同对象的区域;A second scaling submodule is used to scale the second image according to a second magnification, so that the scaled second image is equal in size to the target local area and is aligned with the center of the third image, and the target local area is an area in the third image that has the same object as the second image;形成子模块,用于将缩放后的第二图像叠加在第三图像上,形成组合图像;forming a submodule, for superimposing the scaled second image on the third image to form a combined image;第三缩放子模块,用于将组合图像按照第三倍率缩放,缩放后的组合图像与目标区域尺寸相等,且与目标区域的中心对齐,目标区域的中心为第一图像的中心;A third scaling submodule is used to scale the combined image according to a third magnification, so that the scaled combined image is equal in size to the target area and is aligned with the center of the target area, and the center of the target area is the center of the first image;第二覆盖子模块,用于利用组合图像,替换或覆盖目标区域;A second covering submodule is used to replace or cover the target area using the combined image;第二合成子模块,用于将组合图像与第一图像合成,得到目标图像。The second synthesis submodule is used to synthesize the combined image and the first image to obtain a target image.7.一种电子设备,其特征在于,包括处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1-5任一项所述的拍摄方法的步骤。7. An electronic device, characterized in that it comprises a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the shooting method as described in any one of claims 1 to 5.8.一种可读存储介质,其特征在于,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1-5任一项所述的拍摄方法的步骤。8. A readable storage medium, characterized in that the readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the shooting method according to any one of claims 1 to 5 are implemented.
CN202210191281.8A2022-02-282022-02-28Shooting method and device and electronic equipmentActiveCN114449174B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202210191281.8ACN114449174B (en)2022-02-282022-02-28Shooting method and device and electronic equipment

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202210191281.8ACN114449174B (en)2022-02-282022-02-28Shooting method and device and electronic equipment

Publications (2)

Publication NumberPublication Date
CN114449174A CN114449174A (en)2022-05-06
CN114449174Btrue CN114449174B (en)2024-10-25

Family

ID=81373268

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202210191281.8AActiveCN114449174B (en)2022-02-282022-02-28Shooting method and device and electronic equipment

Country Status (1)

CountryLink
CN (1)CN114449174B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115171200B (en)*2022-09-082023-01-31深圳市维海德技术股份有限公司Target tracking close-up method and device based on zooming, electronic equipment and medium
CN115880198B (en)*2023-02-012023-07-07荣耀终端有限公司Image processing method and device

Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112954195A (en)*2021-01-272021-06-11维沃移动通信有限公司Focusing method, focusing device, electronic equipment and medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111010506A (en)*2019-11-152020-04-14华为技术有限公司 A shooting method and electronic device
CN111182205B (en)*2019-12-302021-07-27维沃移动通信有限公司 Shooting method, electronic device and medium
WO2022022726A1 (en)*2020-07-312022-02-03华为技术有限公司Image capture method and device
CN113727016A (en)*2021-06-152021-11-30荣耀终端有限公司Shooting method and electronic equipment
CN113866782A (en)*2021-09-032021-12-31维沃移动通信(杭州)有限公司Image processing method and device and electronic equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN112954195A (en)*2021-01-272021-06-11维沃移动通信有限公司Focusing method, focusing device, electronic equipment and medium

Also Published As

Publication numberPublication date
CN114449174A (en)2022-05-06

Similar Documents

PublicationPublication DateTitle
JP2023551264A (en) Photography methods, devices, electronic devices and storage media
CN112887617B (en) A shooting method, device and electronic equipment
CN107395975A (en)A kind of image processing method and device
CN108377341A (en)photographing method, device, terminal and storage medium
CN114449174B (en)Shooting method and device and electronic equipment
CN112532808A (en)Image processing method and device and electronic equipment
CN113473018B (en)Video shooting method and device, shooting terminal and storage medium
US12363429B2 (en)Focusing method and apparatus for synthesizing multiple images
CN112584043B (en)Auxiliary focusing method and device, electronic equipment and storage medium
CN114125179B (en)Shooting method and device
CN113141450A (en)Shooting method, shooting device, electronic equipment and medium
JP2013009189A (en)Imaging device and imaging method
US9167150B2 (en)Apparatus and method for processing image in mobile terminal having camera
CN118044215B (en) Macro photography method, electronic device and computer-readable storage medium
WO2025036252A1 (en)Photographing method, and terminal, electronic device and readable storage medium
CN210867915U (en) Imaging modules and electronic devices
JP6116436B2 (en) Image processing apparatus and image processing method
JP7640718B2 (en) Photographing method, device, electronic device, and readable storage medium
CN113891018A (en) Shooting method, device and electronic device
CN115379075A (en)Moon shooting method and device, storage medium and shooting equipment
CN115314607B (en)Image pickup apparatus
CN115314606B (en) Camera device
KR20130024021A (en)Digital photographing apparatus and control method thereof
CN112887624B (en)Shooting method and device and electronic equipment
WO2022201819A1 (en)Imaging device, imaging device control method, and program

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp