CN111263071B - A shooting method and electronic device - Google Patents

A shooting method and electronic device Download PDF

Info

Publication number
CN111263071B
CN111263071B CN202010119183.4A CN202010119183A CN111263071B CN 111263071 B CN111263071 B CN 111263071B CN 202010119183 A CN202010119183 A CN 202010119183A CN 111263071 B CN111263071 B CN 111263071B
Authority
CN
China
Prior art keywords
image
person
character
preset
person image
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
CN202010119183.4A
Other languages
Chinese (zh)
Other versions
CN111263071A (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 Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN202010119183.4A priority Critical patent/CN111263071B/en
Publication of CN111263071A publication Critical patent/CN111263071A/en
Priority to PCT/CN2021/076870 priority patent/WO2021169851A1/en
Application granted granted Critical
Publication of CN111263071B publication Critical patent/CN111263071B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body

Landscapes

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

Abstract

本发明提供一种拍摄方法及电子设备,其中,所述拍摄方法包括:通过摄像头实时获取第一图像,确定所述第一图像中的第一人物图像和第二人物图像;在所述第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到目标图像,实时显示所述目标图像。本发明提供的技术方案解决了现有的拍摄方式增加了拍摄图片的后期处理难度的问题。

Figure 202010119183

The present invention provides a shooting method and electronic device, wherein the shooting method includes: acquiring a first image in real time through a camera, determining a first person image and a second person image in the first image; In the image, the second person image is deleted, and the area corresponding to the second person image is filled with the background to obtain a target image, and the target image is displayed in real time. The technical solution provided by the present invention solves the problem that the existing shooting methods increase the difficulty of post-processing of the captured pictures.

Figure 202010119183

Description

一种拍摄方法及电子设备A shooting method and electronic device

技术领域technical field

本发明涉及通信技术领域,尤其涉及一种拍摄方法及电子设备。The present invention relates to the field of communication technologies, and in particular, to a photographing method and an electronic device.

背景技术Background technique

随着电子设备拍照功能越来越强大,人们对拍摄图片的要求也越来越高。现有的电子设备在进行拍摄时,通常会希望获得纯净的背景,以突出拍摄图像中的主体人物。但在实际拍摄中,特别是在公共空间(例如景区)内拍摄时,总会遇到拍摄预览背景中存在来往路人的情况。目前,通常是通过对拍摄图片进行后期处理,来突出拍摄图片中的主体人物;而后期处理对于电子设备的硬件以及处理人员的专业能力要求较高,增加了拍摄图片的处理难度。With the increasingly powerful photographing functions of electronic devices, people have higher and higher requirements for photographing pictures. When photographing with existing electronic equipment, it is usually desirable to obtain a pure background to stand out the subject in the photographed image. However, in actual shooting, especially when shooting in a public space (such as a scenic spot), there is always a situation where there are passers-by in the background of the shooting preview. At present, post-processing of the captured pictures is usually performed to highlight the main characters in the captured pictures; however, the post-processing requires higher hardware of the electronic equipment and the professional ability of the processing personnel, which increases the difficulty of processing the captured pictures.

可见,现有的拍摄方式增加了拍摄图片的后期处理难度。It can be seen that the existing photographing method increases the difficulty of post-processing of photographed images.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供一种拍摄方法及电子设备,以解决现有的拍摄方式增加了拍摄图片的后期处理难度的问题。Embodiments of the present invention provide a photographing method and an electronic device, so as to solve the problem that the existing photographing method increases the difficulty of post-processing of photographed pictures.

为了解决上述技术问题,本发明是这样实现的:In order to solve the above-mentioned technical problems, the present invention is achieved in this way:

第一方面,本发明实施例提供了一种拍摄方法,其特征在于,包括:In a first aspect, an embodiment of the present invention provides a photographing method, characterized in that it includes:

通过摄像头实时获取第一图像,确定所述第一图像中的第一人物图像和第二人物图像;Acquire the first image in real time through the camera, and determine the first person image and the second person image in the first image;

在所述第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到目标图像;In the first image, delete the second person image, and perform background filling on the area corresponding to the second person image to obtain a target image;

实时显示所述目标图像。The target image is displayed in real time.

第二方面,本发明实施例还提供了一种电子设备,包括:In a second aspect, an embodiment of the present invention also provides an electronic device, including:

确定模块,用于通过摄像头实时获取第一图像,确定所述第一图像中的第一人物图像和第二人物图像;a determining module, configured to acquire the first image in real time through the camera, and determine the first character image and the second character image in the first image;

处理模块,用于在所述第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到目标图像;a processing module, configured to delete the second person image in the first image, and perform background filling on the area corresponding to the second person image to obtain a target image;

显示模块,用于实时显示所述目标图像。The display module is used to display the target image in real time.

第三方面,本发明实施例还提供了一种电子设备,包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如第一方面中所述的拍摄方法的步骤。In a third aspect, an embodiment of the present invention further provides an electronic device, including a processor, a memory, and a computer program stored on the memory and executable on the processor, the computer program being executed by the processor When executed, the steps of the photographing method as described in the first aspect are realized.

第四方面,本发明实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如第一方面中所述的拍摄方法的步骤。In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps of the shooting method described in the first aspect.

本发明实施例提供的技术方案,电子设备通过摄像头实时获取第一图像,确定所述第一图像中的第一人物图像和第二人物图像;在所述第一图像中,删除所述第二人物图像,并对所述第二图像对应的区域进行背景填充,得到目标图像,实时显示所述目标图像。这样,电子设备能够在形成拍摄图像之前,已经自动对目标图像中的人物图像进行了处理,也就无需再对拍摄图像进行后期处理,降低了拍摄图像的处理难度,也简化了拍摄的处理流程,提升电子设备的用户使用体验。In the technical solution provided by the embodiment of the present invention, the electronic device acquires a first image in real time through a camera, and determines a first person image and a second person image in the first image; in the first image, deletes the second person image. image of a person, and background filling is performed on the area corresponding to the second image to obtain a target image, and the target image is displayed in real time. In this way, the electronic device can automatically process the image of the person in the target image before forming the captured image, so there is no need to perform post-processing on the captured image, which reduces the difficulty of processing the captured image and simplifies the processing flow of the captured image. , to improve the user experience of electronic devices.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对本发明实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments of the present invention. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative labor.

图1是本发明实施例提供的一种拍摄方法的流程图;1 is a flowchart of a shooting method provided by an embodiment of the present invention;

图2是应用图1提供的拍摄方法的电子设备显示界面的一种场景示意图;Fig. 2 is a scene schematic diagram of an electronic device display interface applying the shooting method provided in Fig. 1;

图3是应用图1提供的拍摄方法的电子设备显示界面的另一种场景示意图;Fig. 3 is another scene schematic diagram of the electronic device display interface applying the shooting method provided by Fig. 1;

图4是本发明实施例提供的一种电子设备的结构图;4 is a structural diagram of an electronic device provided by an embodiment of the present invention;

图5是本发明实施例提供的另一种电子设备的结构图。FIG. 5 is a structural diagram of another electronic device provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.

本发明实施例提供了一种拍摄方法,所述拍摄方法应用于具有摄像头的电子设备,如手机、平板电脑、可穿戴设备等。An embodiment of the present invention provides a shooting method, and the shooting method is applied to an electronic device having a camera, such as a mobile phone, a tablet computer, a wearable device, and the like.

请参见图1,图1是本发明实施例提供的一种拍摄方法的流程图,如图1所示,所述拍摄方法包括以下步骤:Please refer to FIG. 1. FIG. 1 is a flowchart of a shooting method provided by an embodiment of the present invention. As shown in FIG. 1, the shooting method includes the following steps:

步骤101、通过摄像头实时获取第一图像,确定所述第一图像中的第一人物图像和第二人物图像。Step 101: Acquire a first image in real time through a camera, and determine a first person image and a second person image in the first image.

需要说明的是,所述第一图像是指电子设备启动拍摄应用程序之后、执行拍摄操作之前,摄像头实时采集到的图像,所述第一图像也就并非拍摄图像。摄像头实时获取第一图像,那么第一图像并非特指某一张或者某一帧特定的图像,所述第一图像可以是摄像头连续采集的多张或者多帧图像中的任何一张。那么,在第一图像中包括人物图像的情况下,若人物图像对应的人物主体发生运动,那么同一人物图像在多张第一图像中的位置区域也就会发生变化。It should be noted that the first image refers to an image captured by the camera in real time after the electronic device starts the shooting application and before the shooting operation is performed, and the first image is not a captured image. The camera acquires the first image in real time, then the first image does not specifically refer to a certain image or a specific frame, and the first image may be any one of multiple images or multiple frames of images continuously collected by the camera. Then, when the first image includes a person image, if the main body of the person corresponding to the person image moves, the position area of the same person image in the multiple first images will also change.

本步骤中,电子设备在启动拍摄应用程序的情况下,通过摄像头实时获取第一图像,并确定所述第一图像中的第一人物图像和第二人物图像。所述第一人物图像对应的人物主体可以是一个,也可以是多个;同样地,所述第二人物图像对应的人物主体也可以是一个或者多个。In this step, the electronic device acquires the first image in real time through the camera when the shooting application is started, and determines the first person image and the second person image in the first image. There may be one or more character subjects corresponding to the first character image; similarly, there may also be one or more character subjects corresponding to the second character image.

例如,若所述第一图像中只包括两个人物图像,则其中一个为第一人物图像,另一个为第二人物图像;又如,若所述第一图像中包括多个人物图像,则其中某一个特定的人物图像为第一人物图像,剩下的都为第二人物图像;如图2中所示,确定第一图像中人物图像A为第一人物图像,剩余的人物图像B则为第二人物图像,第二人物图像为5个。For example, if the first image includes only two person images, one of them is the first person image and the other is the second person image; for another example, if the first image includes multiple person images, then One of the specific person images is the first person image, and the rest are the second person images; as shown in FIG. 2, it is determined that the person image A in the first image is the first person image, and the remaining person images B are is the second person image, and the number of second person images is 5.

可选地,所述步骤101可以包括:Optionally, the step 101 may include:

通过摄像头实时获取第一图像,若接收到目标操作,则确定所述第一图像中的第一人物图像和第二人物图像。The first image is acquired in real time through the camera, and if a target operation is received, the first person image and the second person image in the first image are determined.

也就是说,电子设备在接收到目标操作的情况下,才会获取所述第一图像中的第一人物图像和第二人物图像;若电子设备在启动摄像头的情况下,未接收到所述目标操作,也就不会执行确定所述第一图像中第一人物图像和第二人物图像的操作,进而也就不会对第一图像中的人物图像进行区分,同样也就不会执行后续的步骤,电子设备可以是处于普通拍摄模式。That is to say, the electronic device will only acquire the first person image and the second person image in the first image when it receives the target operation; target operation, the operation of determining the first person image and the second person image in the first image will not be performed, so that the person images in the first image will not be distinguished, and the follow-up image will not be performed. step, the electronic device may be in a normal shooting mode.

需要说明地,所述目标操作可以是有多种操作形式。例如,所述目标操作可以是指作用于显示屏上的特定的滑动轨迹,或者,所述目标操作可以是指用户触发电子设备上特定的物理按键,或者,所述目标操作可以是用户触发拍摄界面(也就是显示所述第一图像的界面)上特定的虚拟按键,等等。It should be noted that the target operation may have various operation forms. For example, the target operation may refer to a specific sliding track acting on the display screen, or the target operation may refer to a user triggering a specific physical button on the electronic device, or the target operation may be a user triggering a shooting Specific virtual keys on the interface (that is, the interface displaying the first image), and so on.

本发明实施例中,电子设备在通过摄像头实时获取第一图像后,若所述第一图像中显示有人物图像,则需要将人物图像区分为第一人物图像和第二人物图像。具体地,所述确定所述第一图像中的第一人物图像和第二人物图像,包括:In this embodiment of the present invention, after the electronic device acquires the first image through the camera in real time, if a person image is displayed in the first image, the person image needs to be distinguished into the first person image and the second person image. Specifically, the determining of the first person image and the second person image in the first image includes:

获取所述第一图像中各人物图像对应的人物主体与所述摄像头之间的距离,将所述距离小于预设距离的人物主体对应的人物图像确定为第一人物图像,将所述距离大于所述预设距离的人物主体对应的人物图像确定为第二人物图像;Obtaining the distance between the person subject corresponding to each person image in the first image and the camera, determining the person image corresponding to the person subject whose distance is less than a preset distance as the first person image, and determining the distance greater than The character image corresponding to the character subject at the preset distance is determined as the second character image;

或者,or,

获取所述第一图像中各人物图像的图像尺寸,将所述图像尺寸大于等于预设尺寸的人物图像确定为第一人物图像,将所述图像尺寸小于所述预设尺寸的人物图像确定为第二人物图像;Acquire the image size of each person image in the first image, determine the person image with the image size greater than or equal to a preset size as the first person image, and determine the person image with the image size smaller than the preset size as image of the second person;

或者,or,

获取所述第一图像中各人物图像的面部信息,将所述面部信息符合预设面部信息的人物图像确定为第一人物图像,将所述面部信息不符合所述预设面部信息的人物图像确定为第二人物图像;Obtain the facial information of each person image in the first image, determine the person image whose facial information conforms to the preset facial information as the first person image, and determine the person image whose facial information does not conform to the preset facial information Determined to be the second person image;

或者,or,

获取所述第一图像中各人物图像对应的人物主体的移动速度,将所述移动速度小于等于预设速度的人物主体对应的人物图像确定为第一人物图像,将所述移动速度大于所述预设速度的人物主体对应的人物图像确定为第二人物图像。Acquiring the moving speed of the character subject corresponding to each character image in the first image, determining the character image corresponding to the character subject whose moving speed is less than or equal to a preset speed as the first character image, and determining the moving speed greater than the The character image corresponding to the character subject at the preset speed is determined as the second character image.

以下将对以上提供的几种实施方式进行具体说明。Several embodiments provided above will be described in detail below.

在第一种实施方式中,也就是根据人物主体与摄像头之间的距离来进行区分。电子设备在获取第一图像后,获取各人物图像对应的人物主体与摄像头之间的距离;可以是将其中距离摄像头距离最近的人物主体对应的人物图像确定为第一人物图像(这种情况下,第一人物图像为一个),其余的人物图像则确定为第二人物图像;或者,可以是将与摄像头的距离小于等于预设距离的人物图像确定为第一人物图像(这种情况下,第一人物图像可以是一个也可以是多个),大于所述预设距离的人物图像则确定为第二人物图像。其中,电子设备可以是通过人脸识别、人体识别、多次对焦、激光对焦等方式先对人物主体进行确定,而后可以采用红外测距、激光测距等方式对人物主体与摄像头之间的距离进行检测。In the first embodiment, the distinction is made according to the distance between the main body and the camera. After the electronic device acquires the first image, it acquires the distance between the human subject corresponding to each human image and the camera; it may be to determine the human image corresponding to the human subject whose distance to the camera is the closest as the first human image (in this case , the first person image is one), and the rest of the person images are determined as the second person images; or, the person image whose distance from the camera is less than or equal to the preset distance may be determined as the first person image (in this case, The first character image may be one or multiple), and the character image greater than the preset distance is determined as the second character image. Among them, the electronic device can first determine the subject through face recognition, human body recognition, multiple focusing, laser focusing, etc., and then can use infrared ranging, laser ranging, etc. to determine the distance between the subject and the camera test.

在第二种实施方式中,是通过识别人物图像的图像尺寸大小来区分第一人物图像和第二人物图像。电子设备在显示第一图像的情况下,获取各人物图像的图像尺寸,可以是将其中图像尺寸最大的人物图像确定为第一人物图像(这种情况下,第一人物图像为一个),其余的人物图像则确定为第二人物图像,如图2中所示,将图像尺寸最大人物图像A的确定为第一人物图像,其余的人物图像B则为第二人物图像;或者,将图像尺寸大于等于预设尺寸的人物图像确定为第一人物图像(这种情况下,第一人物图像可以是一个也可以是多个),将图像尺寸小于所述预设尺寸的确定为第二人物图像。In the second embodiment, the first person image and the second person image are distinguished by recognizing the image size of the person image. In the case of displaying the first image, the electronic device obtains the image size of each character image, which may be to determine the character image with the largest image size as the first character image (in this case, the first character image is one), and the rest The image of the person with the largest image size is determined as the second person image. As shown in Figure 2, the person image A with the largest image size is determined as the first person image, and the rest of the person images B are the second person images; A person image larger than or equal to a preset size is determined as the first person image (in this case, the first person image may be one or more), and an image size smaller than the preset size is determined as the second person image .

在第三种实施方式中,通过人脸识别来区分第一人物图像和第二人物图像。可以理解地,电子设备可以是预先存储有一个或多个用户的面部信息(也即预设面部信息),当电子设备显示第一图像的情况下,通过识别第一图像中人物图像的面部信息来区分第一人物图像和第二人物图像。也就是说,当人物图像的面部信息与预设面部信息符合,则这类人物图像确定为第一人物图像,将面部信息与所述预设面部信息不符合的人物图像确定为第二人物图像。In the third embodiment, the first person image and the second person image are distinguished by face recognition. It can be understood that the electronic device may pre-store the facial information of one or more users (that is, preset facial information). When the electronic device displays the first image, the facial information of the person image in the first image is recognized by to distinguish the first person image and the second person image. That is to say, when the facial information of the person image matches the preset facial information, such a person image is determined as the first person image, and the person image whose facial information does not match the preset facial information is determined as the second person image .

在第四种实施方式中,通过获取第一图像中各人物图像对应的人物主体的移动速度来区分第一人物图像和第二人物图像。例如,可以是将其中移动速度最小的,或者是不移动的人物图像确定为第一人物图像,其余的确定为第二人物图像;或者,将移动速度小于等于预设速度的人物图像确定为第一人物图像,移动速度大于所述预设速度的人物图像确定为第二人物图像,所述预设速度可以是预先设置存储的移动速度,如预设速度可以是0,也就是将静止的人物主体对应的人物图像确定为第一人物图像。In a fourth embodiment, the first person image and the second person image are distinguished by acquiring the moving speed of the person subject corresponding to each person image in the first image. For example, the image of the person whose moving speed is the smallest or does not move may be determined as the first image, and the rest may be determined as the second image; or, the image of the person whose moving speed is less than or equal to the preset speed may be determined as the first image. A character image, the image of the character whose moving speed is greater than the preset speed is determined as the second image of the character, and the preset speed may be the moving speed that is preset and stored. For example, the preset speed may be 0, that is, the static character The person image corresponding to the subject is determined as the first person image.

步骤102、在所述第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到目标图像。Step 102: In the first image, delete the second person image, and perform background filling on a region corresponding to the second person image to obtain a target image.

也就是说,当确定第一图像中的第一人物图像和第二人物图像后,则删除第二人物图像,而第一人物图像会保留。需要说明的是,在第一图像中包括人物图像的情况下,可以是将第一图像中的人物图像区分为第一人物图像和第二人物图像,当删除第二人物图像,则第一图像中剩下的人物图像也就是第一人物图像。如图3所示,第一图像中已经删除了第二人物图像,只显示有第一人物图像A。这样,电子设备能够在形成拍摄图像之前,已经自动对第一图像中的人物图像进行了处理,也就无需再对拍摄图像进行后期处理,降低了拍摄图像的处理难度,也简化了拍摄的处理流程,提升电子设备的用户使用体验。That is, after the first person image and the second person image in the first image are determined, the second person image is deleted, and the first person image remains. It should be noted that, in the case where the first image includes a person image, the person image in the first image may be divided into the first person image and the second person image, and when the second person image is deleted, the first image The remaining character images in are also the first character images. As shown in FIG. 3 , the second person image has been deleted from the first image, and only the first person image A is displayed. In this way, the electronic device can automatically process the image of the person in the first image before forming the captured image, so there is no need to perform post-processing on the captured image, which reduces the difficulty of processing the captured image and simplifies the capturing process. process to improve the user experience of electronic devices.

在一种具体的实施方式中,当用户处于公共空间(例如景区)内拍摄时,第一图像中可能存在较多的人物图像,则电子设备能够通过上述几种方式来自动识别第一人物图像和第二人物图像,例如想要拍摄的人物主体通常是静止不动的,而路人通常是处于移动状态,移动速度较快,则电子设备能够基于移动速度自动将处于移动状态的路人确定为第二人物图像,从而也就会将路人从第一图像中删除,并能够对删除路人后的第一图像进行背景处理,使得第一图像中只保留了想要拍摄的人物主体(也即第一人物图像),也就能够快速获得较好的拍摄效果,用户能够直接基于第一图像进行拍摄,也就无需用户再对拍摄图像进行后期处理,提升了用户的拍摄体验。In a specific implementation manner, when the user is shooting in a public space (such as a scenic spot), there may be more person images in the first image, and the electronic device can automatically identify the first person image through the above several methods and the second person image, for example, the main body of the person you want to shoot is usually stationary, and the passerby is usually in a moving state, and the moving speed is fast, then the electronic device can automatically determine the moving passerby as the first person based on the moving speed. There are two images of people, so that passers-by will be deleted from the first image, and background processing can be performed on the first image after the passer-by is deleted, so that only the main body of the person you want to be photographed (that is, the first image) is retained in the first image. The user can shoot directly based on the first image, so that the user does not need to perform post-processing on the captured image, which improves the user's shooting experience.

具体地,对于如何实现第二人物图像的删除,以及对删除了第二人物图像后的第一图像进行背景填充以得到目标图像,可以是通过以下不同的方式来实现。Specifically, how to realize the deletion of the second person image and fill the background of the first image after the deletion of the second person image to obtain the target image can be achieved in the following different ways.

在一种实施方式中,所述步骤102可以包括:In one embodiment, the step 102 may include:

获取所述第一图像之前的预设帧图像中与所述第二人物图像对应的区域相对应的背景图像;acquiring a background image corresponding to the area corresponding to the second person image in the preset frame image before the first image;

删除所述第一图像中的所述第二人物图像,并将所述背景图像填充至所述第一图像中,得到目标图像。Deleting the second person image in the first image, and filling the background image into the first image to obtain a target image.

本实施方式中,电子设备在获取摄像头实时采集的第一图像,并确定其中的第一人物图像和第二人物图像后,需要将第二人物图像从第一图像中删除,则获取当前第一图像的前几帧图像(例如前一帧图像)中与所述第二人物图像对应的背景图像,删除当前第一图像中的第二人物图像,并将所述背景图像填充至删除的第二人物图像区域,以对删除了第二人物图像的第一图像进行填充,进而以得到目标图像;那么,目标图像中也就不包括第二人物图像,而是由背景图像替换了第二人物图像,以确保第一图像的完整性。这样,目标图像中的人物图像也就只包括第一人物图像,简化了对拍摄图像的后期处理。In this embodiment, after the electronic device acquires the first image captured by the camera in real time, and determines the first person image and the second person image, it needs to delete the second person image from the first image, and then acquires the current first image. The background image corresponding to the second person image in the first few frames of the image (for example, the previous frame image), delete the second person image in the current first image, and fill the background image to the deleted second person image. The person image area is filled with the first image with the second person image deleted, so as to obtain the target image; then, the target image does not include the second person image, but the second person image is replaced by the background image. , to ensure the integrity of the first image. In this way, the person image in the target image only includes the first person image, which simplifies the post-processing of the captured image.

在另一种实施方式中,所述步骤102可以包括:In another embodiment, the step 102 may include:

获取所述第二人物图像周边预设区域内的第一背景图像,复制所述第一背景图像得到复制图像;acquiring a first background image in a preset area around the second person image, and duplicating the first background image to obtain a duplicate image;

将所述复制图像与所述第二人物图像周边区域内的第二背景图像进行融合处理,以得到处理图像;Perform fusion processing on the duplicated image and the second background image in the peripheral area of the second person image to obtain a processed image;

删除所述第一图像中的所述第二人物图像,并将所述处理图像填充至所述第一图像中,得到目标图像。Deleting the second person image in the first image, and filling the processed image into the first image to obtain a target image.

本实施方式中,电子设备在获取摄像头实时采集的第一图像,并确定其中的第一人物图像和第二人物图像后,获取所述第二人物图像周边预设区域内的第一背景图像,将该第一背景图像进行复制以得到复制图像,并将所述复制图像与第二人物图像周边区域内的第二背景图像进行融合处理,以得到处理图像;其中,所述第一背景图像和第二背景图像可以是同一图像,或者,所述第二背景图像的图像范围要大于所述第一背景图像的图像范围,将复制图像与第二背景图像进行融合处理以得到处理图像,以使得复制图像能够与第二人物图像周边区域内的背景图像相融合以得到处理图像,删除第一图像中的第二人物图像,并将所述处理图像填充至第一图像中删除了第二人物图像的区域,以对删除了第二人物图像的第一图像进行填充,进而以得到目标图像,以确保第一图像的完整性。其中,将复制图像与第二背景图像进行融合处理可以是参照相关的图像处理技术,本发明对此不做赘述。In this embodiment, after acquiring the first image captured by the camera in real time, and determining the first person image and the second person image, the electronic device acquires the first background image in the preset area around the second person image, Duplicating the first background image to obtain a duplicated image, and performing fusion processing on the duplicated image and a second background image in the peripheral area of the second person image to obtain a processed image; wherein the first background image and The second background image may be the same image, or, the image range of the second background image is larger than the image range of the first background image, and the duplicated image and the second background image are fused to obtain the processed image, so that the The duplicated image can be merged with the background image in the peripheral area of the second person image to obtain a processed image, the second person image in the first image is deleted, and the processed image is filled into the first image with the second person image deleted to fill in the first image from which the second person image is deleted, so as to obtain the target image, so as to ensure the integrity of the first image. Wherein, the fusion processing of the duplicated image and the second background image may be performed with reference to a related image processing technology, which is not described in detail in the present invention.

可选地,本发明实施例提供的拍摄方法中,在所述步骤101之后还可以包括:Optionally, in the photographing method provided by the embodiment of the present invention, after the step 101, it may further include:

若在预设时长内获取的新的第一图像中,均未检测到所述第一人物图像对应的人物特征,则实时显示所述预设时长后获取的新的第一图像。If no character characteristic corresponding to the first character image is detected in the new first image obtained within the preset time period, the new first image obtained after the preset time period is displayed in real time.

可以理解地,第一图像中在包括人物图像的情况下,人物图像对应的人物主体可能是处于移动状态,由于人物主体的移动,例如人物主体移出摄像头的取景框之外了,或者由于拍摄者手机的晃动而使人物主体移出取景框之外,也就是第一人物图像对应的人物主体消失在摄像头的采集范围内,那么第一图像中可能会不包括第一人物图像。Understandably, if the first image includes a human image, the human subject corresponding to the human image may be in a moving state. If the mobile phone shakes and the subject moves out of the viewfinder, that is, the subject corresponding to the first image disappears within the capture range of the camera, the first image may not include the first image.

本发明实施例中,若在预设时长内获取的第一图像中,均未检测到所述第一人物图像对应的人物特征,则实时显示所述预设时长后获取的新的第一图像。这种情况下,电子设备可以不对新的第一图像中的人物图像进行区分,也就不执行所述步骤102的操作,进而不会对第二人物图像进行删除,而是将第二人物图像保留在新的第一图像中。或者,在实时显示所述预设时长后获取的新的第一图像后,可以是对所述新的第一图像中的人物图像进行区分,确定所述新的第一图像中的第一人物图像和第二人物图像,具体的人物图像区分方法可以是参照上述实施方式中的具体描述,此处不再赘述。其中,所述在预设时长内获取的第一图像,是指电子设备摄像头在预设时长内连续采集的多张或多帧新的第一图像中的任意一张或一帧。In this embodiment of the present invention, if no character characteristic corresponding to the first character image is detected in the first image obtained within the preset time period, a new first image obtained after the preset time period is displayed in real time . In this case, the electronic device may not distinguish the person image in the new first image, and thus does not perform the operation of step 102, and thus will not delete the second person image, but the second person image Remain in the new first image. Or, after the new first image acquired after the preset time period is displayed in real time, the image of the person in the new first image may be distinguished to determine the first person in the new first image For the image and the second person image, the specific method for distinguishing the person image may refer to the specific description in the above-mentioned embodiment, which will not be repeated here. Wherein, the first image acquired within the preset time period refers to any one or one frame of multiple or multiple new first images continuously collected by the camera of the electronic device within the preset time period.

需要说明的是,若在预设时长内获取的第一图像中,检测到所述第一人物图像对应的人物特征,则保持该人物特征对应的人物图像为第一人物图像。例如,若第一人物图像在预设时长内只是消失了小段时间,比如第一人物图像对应的人物主体移出了摄像头的取景框又回来,或者第一人物图像对应的人物主体被路过的路人遮挡等,则保持第一图像中的第一人物图像不变,仍然是对确定的第二人物图像进行删除,目标图像中只保留第一人物图像。It should be noted that, if a character feature corresponding to the first character image is detected in the first image acquired within the preset time period, the character image corresponding to the character feature is kept as the first character image. For example, if the first person image only disappears for a short period of time within the preset time period, for example, the person corresponding to the first person image moves out of the camera's viewfinder and returns, or the person corresponding to the first person image is blocked by passers-by. etc., the first person image in the first image is kept unchanged, the determined second person image is still deleted, and only the first person image is retained in the target image.

或者,本发明实施例还可以是通过特定的操作来避免执行第二人物图像的删除操作。例如,在电子设备显示第一图像,并确定所述第一图像中的第一人物图像和第二人物图像后,电子设备进入人物消除拍摄模式,若此时接收到用户作用于显示屏上的预设滑动轨迹,或者是接收到作用于电子设备预设物理按键上的触发操作,或者是接收到作用在预设虚拟按键上的触发操作,则电子设备可以退出当前的人物消除拍摄模式,回到普通拍摄模式,那么电子设备也就不会执行步骤102,也就不会对第一图像中的人物图像进行删除操作。这样,也就能够通过特定的操作来对电子设备的拍摄模式进行切换,更加方便用户的拍摄操作,提升拍摄体验。Alternatively, in this embodiment of the present invention, a specific operation may be used to avoid performing the delete operation of the second person image. For example, after the electronic device displays the first image and determines the first person image and the second person image in the first image, the electronic device enters the person elimination shooting mode. The preset sliding track, or receiving the trigger operation acting on the preset physical button of the electronic device, or receiving the trigger operation acting on the preset virtual button, the electronic device can exit the current character elimination shooting mode, and return to In the normal shooting mode, the electronic device will not execute step 102, and will not delete the person image in the first image. In this way, the shooting mode of the electronic device can be switched through a specific operation, which is more convenient for the user's shooting operation and improves the shooting experience.

步骤103、实时显示所述目标图像。Step 103 , displaying the target image in real time.

可以理解地,目标图像中显示的人物图像也就只保留了第一人物图像,用户可以基于显示的目标图像得到拍摄图像,这样也就无需用户再对拍摄图像进行后期处理,降低了拍摄图像的处理难度,为用户带来更好的拍摄体验。Understandably, the image of the person displayed in the target image only retains the image of the first person, and the user can obtain the captured image based on the displayed target image, which eliminates the need for the user to perform post-processing on the captured image and reduces the complexity of the captured image. Dealing with difficulty, bringing users a better shooting experience.

另外,在电子设备显示第一图像,并确定所述第一图像中的第一人物图像和第二人物图像后,电子设备能够对第一人物图像进行锁定。本发明实施例中,在所述步骤101之后,,所述方法还可以包括:In addition, after the electronic device displays the first image and determines the first person image and the second person image in the first image, the electronic device can lock the first person image. In this embodiment of the present invention, after step 101, the method may further include:

将实时获取的新的第一图像中新增的人物图像确定为第二人物图像;determining the newly added person image in the new first image acquired in real time as the second person image;

或者,or,

若实时获取的新的第一图像中,检测到所述第一人物图像对应的人物特征,则在所述新的第一图像中,保持所述人物特征对应的人物图像为第一人物图像,将其他人物图像确定为第二人物图像;If a character feature corresponding to the first character image is detected in the new first image acquired in real time, in the new first image, the character image corresponding to the character feature is kept as the first character image, determining other person images as the second person images;

在所述新的第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到新的目标图像;In the new first image, delete the second person image, and perform background filling on the area corresponding to the second person image to obtain a new target image;

显示所述新的目标图像。The new target image is displayed.

可以理解地,随着人物的移动,摄像头采集的图像中的人物图像也不会一成不变,有可能会有新的人物图像进入到摄像头的采集范围内,那么第一图像中也就会增加新的人物图像。本发明实施例中,对于新的第一图像中新增的人物图像均确定为第二人物图像,那么新增的人物图像也就会被删除,新的第一图像中保留的仍然是原来第一图像中确定的第一人物图像。Understandably, with the movement of the character, the image of the character in the image captured by the camera will not remain unchanged. It is possible that a new image of the character will enter the capture range of the camera, and then a new image will be added to the first image. image of people. In the embodiment of the present invention, the newly added person image in the new first image is determined as the second person image, then the newly added person image will also be deleted, and the original first image still remains in the new first image. An image of a first person identified in an image.

例如,当拍摄场景为景区或者是马路等人流量较大的场景时,来往的路人可能较多,摄像头实时采集的第一图像中可能会不断有新的人物增加,那么当确定第一人物图像和第二人物图像(例如路人)后,实时获取的新的第一图像中新增的人物图像都会被确定为第二人物图像,也就会被删除,以确保新的目标图像中只会显示第一人物图像。这样,使得电子设备的拍摄处理更为灵活,为用户带来了更好的拍摄体验。For example, when the shooting scene is a scenic spot or a road with high traffic flow, there may be many passers-by, and new characters may be added in the first image captured by the camera in real time. After the second person image (for example, a passerby), the newly added person image in the new first image acquired in real time will be determined as the second person image and will be deleted to ensure that only the new target image will be displayed. First person image. In this way, the shooting processing of the electronic device is made more flexible, and a better shooting experience is brought to the user.

另外,在实时获取的新的第一图像中,检测到上一帧第一图像中所述第一人物图像对应的人物特征,则在该新的第一图像中,保持所述人物特征对应的人物图像为第一人物图像,将其他人物图像确定为第二人物图像。可以理解地,第一人物图像和第二人物图像各自对应的人物主体也可能会发生移动,那么第一人物图像和第二人物图像在连续的几张或几帧第一图像中的位置也就是变化的,则电子设备还是将原来确定的第一人物图像仍然确定为第一人物图像,将其他人物图像确定为第二人物图像。也就是说,并不会因为人物主体的移动而重新确定第一人物图像和第二人物图像,例如,即使第二人物图像对应的人物主体移动至距离摄像头的距离最近,其仍然为第二人物图像。这样,电子设备能够持续追踪第一人物图像和第二人物图像,例如图2和图3所示,能够始终在第一人物图像和第二人物图像外部显示不同标记的边框,以方便用户能够直观地知道第一人物图像的位置,进一步提升了用户拍摄体验。In addition, in the new first image acquired in real time, the character feature corresponding to the first character image in the previous frame of the first image is detected, then in the new first image, the character feature corresponding to the character feature is kept. The person image is the first person image, and the other person images are determined as the second person image. It is understandable that the main characters corresponding to the first character image and the second character image may also move, so the positions of the first character image and the second character image in consecutive several or several frames of the first image are If it changes, the electronic device still determines the originally determined first person image as the first person image, and determines other person images as the second person image. That is to say, the first character image and the second character image will not be re-determined due to the movement of the character subject. For example, even if the character subject corresponding to the second character image moves to the closest distance to the camera, it is still the second character. image. In this way, the electronic device can continuously track the first person image and the second person image. For example, as shown in FIG. 2 and FIG. 3 , a frame with different marks can always be displayed outside the first person image and the second person image, so that the user can intuitively Knowing the position of the first person image further improves the user's shooting experience.

另外需要说明的是,对实时获取的新的第一图像中的人物图像的确定操作可以是在所述步骤103之前,当然也可以是在所述步骤103之后。例如,电子设备在获取新的第一图像,可能需要对该新的第一图像中的人物图像进行区分或者删除等处理操作,此时电子设备可以是显示上一帧的目标图像,在对新的第一图像进行删除等处理操作得到新的目标图像后,则电子设备显示所述新的目标图像。需要说明的是,所述新的目标图像仍然是指执行拍摄操作前显示的预览图像。In addition, it should be noted that, the operation of determining the person image in the new first image acquired in real time may be performed before the step 103 , and certainly may also be performed after the step 103 . For example, when the electronic device acquires a new first image, it may be necessary to distinguish or delete the person images in the new first image. After a new target image is obtained by performing processing operations such as deleting the first image, the electronic device displays the new target image. It should be noted that the new target image still refers to the preview image displayed before the shooting operation is performed.

本发明实施例提供的技术方案,电子设备通过摄像头实时获取第一图像,确定所述第一图像中的第一人物图像和第二人物图像;在所述第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到目标图像,然后实时显示所述目标图像。这样,电子设备能够在形成拍摄图像之前,已经自动对目标图像中的人物图像进行了处理,也就无需再对拍摄图像进行后期处理,降低了拍摄图像的处理难度,也简化了拍摄的处理流程,提升电子设备的用户使用体验。In the technical solution provided by the embodiment of the present invention, the electronic device acquires a first image in real time through a camera, and determines a first person image and a second person image in the first image; in the first image, deletes the second person image. A person image, and the background filling is performed on the area corresponding to the second person image to obtain a target image, and then the target image is displayed in real time. In this way, the electronic device can automatically process the image of the person in the target image before forming the captured image, so there is no need to perform post-processing on the captured image, which reduces the difficulty of processing the captured image and simplifies the processing flow of the captured image. , to improve the user experience of electronic devices.

请参见图4,图4是本发明实施例提供的一种电子设备的结构图,如图4所示,所述电子设备400包括:Please refer to FIG. 4. FIG. 4 is a structural diagram of an electronic device provided by an embodiment of the present invention. As shown in FIG. 4, the electronic device 400 includes:

确定模块401,用于通过摄像头实时获取第一图像,确定所述第一图像中的第一人物图像和第二人物图像;A determination module 401, configured to acquire a first image in real time through a camera, and determine a first person image and a second person image in the first image;

处理模块402,用于在所述第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到目标图像;The processing module 402 is configured to delete the second person image in the first image, and perform background filling on the area corresponding to the second person image to obtain a target image;

显示模块403,用于实时显示所述目标图像。The display module 403 is configured to display the target image in real time.

可选的,所述确定模块401还用于:Optionally, the determining module 401 is further configured to:

获取所述第一图像中各人物图像对应的人物主体与所述摄像头之间的距离,将所述距离小于等于预设距离的人物主体对应的人物图像确定为第一人物图像,将所述距离大于所述预设距离的人物主体对应的人物图像确定为第二人物图像;Obtaining the distance between the person subject corresponding to each person image in the first image and the camera, determining the person image corresponding to the person subject whose distance is less than or equal to a preset distance as the first person image, and determining the distance The character image corresponding to the character subject greater than the preset distance is determined as the second character image;

或者,or,

获取所述第一图像中各人物图像的图像尺寸,将所述图像尺寸大于等于预设尺寸的人物图像确定为第一人物图像,将所述图像尺寸小于所述预设尺寸的人物图像确定为第二人物图像;Acquire the image size of each person image in the first image, determine the person image with the image size greater than or equal to a preset size as the first person image, and determine the person image with the image size smaller than the preset size as image of the second person;

或者,or,

获取所述第一图像中各人物图像的面部信息,将所述面部信息符合预设面部信息的人物图像确定为第一人物图像,将所述面部信息不符合所述预设面部信息的人物图像确定为第二人物图像;Obtain the facial information of each person image in the first image, determine the person image whose facial information conforms to the preset facial information as the first person image, and determine the person image whose facial information does not conform to the preset facial information Determined to be the second person image;

或者,or,

获取所述第一图像中各人物图像对应的人物主体的移动速度,将所述移动速度小于等于预设速度的人物主体对应的人物图像确定为第一人物图像,将所述移动速度大于所述预设速度的人物主体对应的人物图像确定为第二人物图像。Acquiring the moving speed of the character subject corresponding to each character image in the first image, determining the character image corresponding to the character subject whose moving speed is less than or equal to a preset speed as the first character image, and determining the moving speed greater than the The character image corresponding to the character subject at the preset speed is determined as the second character image.

可选的,所述处理模块402还用于:Optionally, the processing module 402 is further configured to:

获取所述第一图像之前的预设帧图像中与所述第二人物图像对应的区域相对应的背景图像;acquiring a background image corresponding to the area corresponding to the second person image in the preset frame image before the first image;

删除所述第一图像中的所述第二人物图像,并将所述背景图像填充至所述第一图像中,得到目标图像。Deleting the second person image in the first image, and filling the background image into the first image to obtain a target image.

可选的,所述处理模块402还用于:Optionally, the processing module 402 is further configured to:

获取所述第二人物图像周边预设区域内的第一背景图像,复制所述第一背景图像得到复制图像;acquiring a first background image in a preset area around the second person image, and duplicating the first background image to obtain a duplicate image;

将所述复制图像与所述第二人物图像周边区域内的第二背景图像进行融合处理,以得到处理图像;Perform fusion processing on the duplicated image and the second background image in the peripheral area of the second person image to obtain a processed image;

删除所述第一图像中的所述第二人物图像,并将所述处理图像填充至所述第一图像中,得到目标图像。Deleting the second person image in the first image, and filling the processed image into the first image to obtain a target image.

可选的,所述确定模块401还用于:Optionally, the determining module 401 is further configured to:

若在预设时长内获取的第一图像中,均未检测到所述第一人物图像对应的人物特征,则实时显示所述预设时长后获取的新的第一图像。If no character characteristic corresponding to the first character image is detected in the first images obtained within the preset time period, a new first image obtained after the preset time period is displayed in real time.

可选的,所述确定模块401还用于:Optionally, the determining module 401 is further configured to:

将实时获取的新的第一图像中新增的人物图像确定为第二人物图像;determining the newly added person image in the new first image acquired in real time as the second person image;

或者,or,

若实时获取的新的第一图像中,检测到所述第一人物图像对应的人物特征,则在所述新的第一图像中,保持所述人物特征对应的人物图像为第一人物图像,将其他人物图像确定为第二人物图像;If a character feature corresponding to the first character image is detected in the new first image acquired in real time, in the new first image, the character image corresponding to the character feature is kept as the first character image, determining other person images as the second person images;

所述处理模块还用于:在所述新的第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到新的目标图像;The processing module is further configured to: in the new first image, delete the second person image, and perform background filling on the area corresponding to the second person image to obtain a new target image;

所述显示模块还用于:显示所述新的目标图像。The display module is further configured to: display the new target image.

需要说明的是,电子设备400能够实现图1所述的拍摄方法实施例的各个过程,并能达到相同的技术效果,为避免重复,这里不再赘述。It should be noted that the electronic device 400 can implement each process of the embodiment of the photographing method shown in FIG. 1 , and can achieve the same technical effect. To avoid repetition, details are not described here.

本发明实施例中,电子设备400通过摄像头实时获取第一图像,,确定所述第一图像中的第一人物图像和第二人物图像;在所述第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到目标图像;实时显示所述目标图像。这样,电子设备400能够在形成拍摄图像之前,已经自动对目标图像中的人物图像进行了处理,也就无需再对拍摄图像进行后期处理,降低了拍摄图像的处理难度,也简化了拍摄的处理流程,提升用户使用体验。In this embodiment of the present invention, the electronic device 400 acquires a first image in real time through a camera, and determines a first person image and a second person image in the first image; in the first image, deletes the second person image, and fill the background of the area corresponding to the second person image to obtain a target image; and display the target image in real time. In this way, the electronic device 400 can automatically process the human image in the target image before forming the captured image, so there is no need to perform post-processing on the captured image, which reduces the difficulty of processing the captured image and simplifies the capturing process. process to improve user experience.

请参照图5,图5为实现本发明实施例的另一种电子设备的结构图,电子设备500能够实现图1所述的拍摄方法实施例的各个过程,并能达到相同的技术效果。如图5所示,电子设备500包括但不限于:射频单元501、网络模块502、音频输出单元503、输入单元504、传感器505、显示单元506、用户输入单元507、接口单元508、存储器509、处理器510、以及电源511等部件。本领域技术人员可以理解,图5中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。在本发明实施例中,电子设备包括但不限于手机、平板电脑、笔记本电脑、掌上电脑、车载终端、可穿戴设备、以及计步器等。Please refer to FIG. 5 . FIG. 5 is a structural diagram of another electronic device implementing an embodiment of the present invention. The electronic device 500 can implement each process of the photographing method embodiment described in FIG. 1 and achieve the same technical effect. As shown in FIG. 5 , the electronic device 500 includes but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, The processor 510, the power supply 511 and other components. Those skilled in the art can understand that the structure of the electronic device shown in FIG. 5 does not constitute a limitation on the electronic device, and the electronic device may include more or less components than the one shown, or combine some components, or different components layout. In this embodiment of the present invention, the electronic devices include but are not limited to mobile phones, tablet computers, notebook computers, handheld computers, vehicle-mounted terminals, wearable devices, and pedometers.

其中,处理器510,用于:The processor 510 is used for:

通过摄像头实时获取第一图像,确定所述第一图像中的第一人物图像和第二人物图像;Acquire the first image in real time through the camera, and determine the first person image and the second person image in the first image;

在所述第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到目标图像;In the first image, delete the second person image, and perform background filling on the area corresponding to the second person image to obtain a target image;

实时显示所述目标图像。The target image is displayed in real time.

可选的,处理器510还可以用于:Optionally, the processor 510 may also be used for:

获取所述第一图像中各人物图像对应的人物主体与所述摄像头之间的距离,将所述距离小于等于预设距离的人物主体对应的人物图像确定为第一人物图像,将所述距离大于所述预设距离的人物主体对应的人物图像确定为第二人物图像;Obtaining the distance between the person subject corresponding to each person image in the first image and the camera, determining the person image corresponding to the person subject whose distance is less than or equal to a preset distance as the first person image, and determining the distance The character image corresponding to the character subject greater than the preset distance is determined as the second character image;

或者,or,

获取所述第一图像中各人物图像的图像尺寸,将所述图像尺寸大于等于预设尺寸的人物图像确定为第一人物图像,将所述图像尺寸小于所述预设尺寸的人物图像确定为第二人物图像;Acquire the image size of each person image in the first image, determine the person image with the image size greater than or equal to a preset size as the first person image, and determine the person image with the image size smaller than the preset size as image of the second person;

或者,or,

获取所述第一图像中各人物图像的面部信息,将所述面部信息符合预设面部信息的人物图像确定为第一人物图像,将所述面部信息不符合所述预设面部信息的人物图像确定为第二人物图像;Obtain the facial information of each person image in the first image, determine the person image whose facial information conforms to the preset facial information as the first person image, and determine the person image whose facial information does not conform to the preset facial information Determined to be the second person image;

或者,or,

获取所述第一图像中各人物图像对应的人物主体的移动速度,将所述移动速度小于等于预设速度的人物主体对应的人物图像确定为第一人物图像,将所述移动速度大于所述预设速度的人物主体对应的人物图像确定为第二人物图像。Acquiring the moving speed of the character subject corresponding to each character image in the first image, determining the character image corresponding to the character subject whose moving speed is less than or equal to a preset speed as the first character image, and determining the moving speed greater than the The character image corresponding to the character subject at the preset speed is determined as the second character image.

可选的,处理器510,还可以用于:Optionally, the processor 510 can also be used for:

获取所述第一图像之前的预设帧图像中与所述第二人物图像对应的区域相对应的背景图像;acquiring a background image corresponding to the area corresponding to the second person image in the preset frame image before the first image;

删除所述第一图像中的所述第二人物图像,并将所述背景图像填充至所述第一图像中,得到目标图像。Deleting the second person image in the first image, and filling the background image into the first image to obtain a target image.

可选的,处理器510,还可以用于:Optionally, the processor 510 can also be used for:

获取所述第二人物图像周边预设区域内的第一背景图像,复制所述第一背景图像得到复制图像;acquiring a first background image in a preset area around the second person image, and duplicating the first background image to obtain a duplicate image;

将所述复制图像与所述第二人物图像周边区域内的第二背景图像进行融合处理,以得到处理图像;Perform fusion processing on the duplicated image and the second background image in the peripheral area of the second person image to obtain a processed image;

删除所述第一图像中的所述第二人物图像,并将所述处理图像填充至所述第一图像中,得到目标图像。Deleting the second person image in the first image, and filling the processed image into the first image to obtain a target image.

可选的,处理器510,还可以用于:Optionally, the processor 510 can also be used for:

若在预设时长内获取的第一图像中,均未检测到所述第一人物图像对应的人物特征,则实时显示所述预设时长后获取的新的第一图像。If no character characteristic corresponding to the first character image is detected in the first images obtained within the preset time period, a new first image obtained after the preset time period is displayed in real time.

可选的,处理器510,还可以用于:Optionally, the processor 510 can also be used for:

将实时获取的新的第一图像中新增的人物图像确定为第二人物图像;determining the newly added person image in the new first image acquired in real time as the second person image;

或者,or,

若实时获取的新的第一图像中,检测到所述第一人物图像对应的人物特征,则在所述新的第一图像中,保持所述人物特征对应的人物图像为第一人物图像,将其他人物图像确定为第二人物图像;If a character feature corresponding to the first character image is detected in the new first image acquired in real time, in the new first image, the character image corresponding to the character feature is kept as the first character image, determining other person images as the second person images;

在所述新的第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到新的目标图像;In the new first image, delete the second person image, and perform background filling on the area corresponding to the second person image to obtain a new target image;

显示所述新的目标图像。The new target image is displayed.

本发明实施例中,电子设备500通过摄像头实时获取第一图像,确定所述第一图像中的第一人物图像和第二人物图像;在所述第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到目标图像,并实时显示所述目标图像。这样,电子设备500能够在形成拍摄图像之前,已经自动对目标图像中的人物图像进行了处理,也就无需再对拍摄图像进行后期处理,降低了拍摄图像的处理难度,也简化了拍摄的处理流程,提升用户使用体验。In this embodiment of the present invention, the electronic device 500 acquires a first image in real time through a camera, and determines a first person image and a second person image in the first image; in the first image, deletes the second person image , and perform background filling on the area corresponding to the second person image to obtain a target image, and display the target image in real time. In this way, the electronic device 500 can automatically process the person image in the target image before forming the captured image, so there is no need to perform post-processing on the captured image, which reduces the difficulty of processing the captured image and simplifies the capturing process. process to improve user experience.

应理解的是,本发明实施例中,射频单元501可用于收发信息或通话过程中,信号的接收和发送,具体的,将来自基站的下行数据接收后,给处理器510处理;另外,将上行的数据发送给基站。通常,射频单元501包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器、双工器等。此外,射频单元501还可以通过无线通信系统与网络和其他设备通信。It should be understood that, in this embodiment of the present invention, the radio frequency unit 501 can be used for receiving and sending signals during sending and receiving of information or during a call. Specifically, after receiving the downlink data from the base station, it is processed by the processor 510; The uplink data is sent to the base station. Generally, the radio frequency unit 501 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 501 can also communicate with the network and other devices through a wireless communication system.

电子设备500通过网络模块502为用户提供了无线的宽带互联网访问,如帮助用户收发电子邮件、浏览网页和访问流式媒体等。The electronic device 500 provides the user with wireless broadband Internet access through the network module 502, such as helping the user to send and receive emails, browse web pages, access streaming media, and the like.

音频输出单元503可以将射频单元501或网络模块502接收的或者在存储器509中存储的音频数据转换成音频信号并且输出为声音。而且,音频输出单元503还可以提供与电子设备500执行的特定功能相关的音频输出(例如,呼叫信号接收声音、消息接收声音等等)。音频输出单元503包括扬声器、蜂鸣器以及受话器等。The audio output unit 503 may convert audio data received by the radio frequency unit 501 or the network module 502 or stored in the memory 509 into audio signals and output as sound. Also, the audio output unit 503 may also provide audio output related to a specific function performed by the electronic device 500 (eg, call signal reception sound, message reception sound, etc.). The audio output unit 503 includes a speaker, a buzzer, a receiver, and the like.

输入单元504用于接收音频或视频信号。输入单元504可以包括图形处理器(Graphics Processing Unit,GPU)5041和麦克风5042,图形处理器5041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图像或视频的图像数据进行处理。处理后的图像帧可以显示在显示单元506上。经图形处理器5041处理后的图像帧可以存储在存储器509(或其它计算机可读存储介质)中或者经由射频单元501或网络模块502进行发送。麦克风5042可以接收声音,并且能够将这样的声音处理为音频数据。处理后的音频数据可以在电话通话模式的情况下转换为可经由射频单元501发送到移动通信基站的格式输出。The input unit 504 is used to receive audio or video signals. The input unit 504 may include a graphics processor (Graphics Processing Unit, GPU) 5041 and a microphone 5042, and the graphics processor 5041 is used for still images or video images obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode data is processed. The processed image frames may be displayed on the display unit 506 . The image frames processed by the graphics processor 5041 may be stored in the memory 509 (or other computer-readable storage medium) or transmitted via the radio frequency unit 501 or the network module 502 . The microphone 5042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format that can be transmitted to a mobile communication base station via the radio frequency unit 501 for output in the case of a telephone call mode.

电子设备500还包括至少一种传感器505,比如光传感器、运动传感器以及其他传感器。具体地,光传感器包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板5051的亮度,接近传感器可在电子设备500移动到耳边时,关闭显示面板5051和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别电子设备姿态(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;传感器505还可以包括指纹传感器、压力传感器、虹膜传感器、分子传感器、陀螺仪、气压计、湿度计、温度计、红外线传感器等,在此不再赘述。The electronic device 500 also includes at least one sensor 505, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 5051 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 5051 and the display panel 5051 when the electronic device 500 is moved to the ear. / or backlight. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (usually three axes), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the posture of electronic devices (such as horizontal and vertical screen switching, related games , magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 505 may also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, Infrared sensors, etc., are not repeated here.

显示单元506用于显示由用户输入的信息或提供给用户的信息。显示单元506可包括显示面板5051,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板5051。The display unit 506 is used to display information input by the user or information provided to the user. The display unit 506 may include a display panel 5051, and the display panel 5051 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.

用户输入单元507可用于接收输入的数字或字符信息,以及产生与电子设备500的用户设置以及功能控制有关的键信号输入。具体地,用户输入单元507包括触控面板5071以及其他输入设备5072。触控面板5071,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板5071上或在触控面板5071附近的操作)。触控面板5071可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器510,接收处理器510发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板5071。除了触控面板5071,用户输入单元507还可以包括其他输入设备5072。具体地,其他输入设备5072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。The user input unit 507 may be used to receive input numerical or character information, and generate key signal input related to user settings and function control of the electronic device 500 . Specifically, the user input unit 507 includes a touch panel 5071 and other input devices 5072 . The touch panel 5071, also referred to as a touch screen, can collect the user's touch operations on or near it (such as the user's finger, stylus, etc., any suitable object or accessory on or near the touch panel 5071). operate). The touch panel 5071 may include two parts, a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the touch controller. To the processor 510, the command sent by the processor 510 is received and executed. In addition, the touch panel 5071 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves. In addition to the touch panel 5071 , the user input unit 507 may also include other input devices 5072 . Specifically, other input devices 5072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be repeated here.

进一步的,触控面板5071可覆盖在显示面板5051上,当触控面板5071检测到在其上或附近的触摸操作后,传送给处理器510以确定触摸事件的类型,随后处理器510根据触摸事件的类型在显示面板5051上提供相应的视觉输出。虽然在图5中,触控面板5071与显示面板5051是作为两个独立的部件来实现电子设备500的输入和输出功能,但是在某些实施例中,可以将触控面板5071与显示面板5051集成而实现电子设备500的输入和输出功能,具体此处不做限定。Further, the touch panel 5071 can be overlaid on the display panel 5051. When the touch panel 5071 detects a touch operation on or near it, it transmits it to the processor 510 to determine the type of the touch event, and then the processor 510 determines the type of the touch event according to the touch The type of event provides a corresponding visual output on the display panel 5051. Although in FIG. 5, the touch panel 5071 and the display panel 5051 are used as two independent components to realize the input and output functions of the electronic device 500, in some embodiments, the touch panel 5071 and the display panel 5051 may be The input and output functions of the electronic device 500 are implemented through integration, which is not specifically limited here.

接口单元508为外部装置与电子设备500连接的接口。例如,外部装置可以包括有线或无线头戴式耳机端口、外部电源(或电池充电器)端口、有线或无线数据端口、存储卡端口、用于连接具有识别模块的装置的端口、音频输入/输出(I/O)端口、视频I/O端口、耳机端口等等。接口单元508可以用于接收来自外部装置的输入(例如,数据信息、电力等等)并且将接收到的输入传输到电子设备500内的一个或多个元件或者可以用于在电子设备500和外部装置之间传输数据。The interface unit 508 is an interface for connecting an external device to the electronic device 500 . For example, external devices may include wired or wireless headset ports, external power (or battery charger) ports, wired or wireless data ports, memory card ports, ports for connecting devices with identification modules, audio input/output (I/O) ports, video I/O ports, headphone ports, and more. The interface unit 508 may be used to receive input (eg, data information, power, etc.) from external devices and transmit the received input to one or more elements within the electronic device 500 or may be used between the electronic device 500 and external Transfer data between devices.

存储器509可用于存储软件程序以及各种数据。存储器509可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器509可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。The memory 509 may be used to store software programs as well as various data. The memory 509 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program (such as a sound playback function, an image playback function, etc.) required for at least one function, and the like; Data created by the use of the mobile phone (such as audio data, phone book, etc.), etc. Additionally, memory 509 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.

处理器510是电子设备500的控制中心,利用各种接口和线路连接整个电子设备500的各个部分,通过运行或执行存储在存储器509内的软件程序和/或模块,以及调用存储在存储器509内的数据,执行电子设备500的各种功能和处理数据,从而对电子设备500进行整体监控。处理器510可包括一个或多个处理单元;优选的,处理器510可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器510中。The processor 510 is the control center of the electronic device 500, uses various interfaces and lines to connect various parts of the entire electronic device 500, runs or executes the software programs and/or modules stored in the memory 509, and calls the software programs and/or modules stored in the memory 509. to perform various functions of the electronic device 500 and process data, so as to monitor the electronic device 500 as a whole. The processor 510 may include one or more processing units; preferably, the processor 510 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem The processor mainly handles wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 510.

电子设备500还可以包括给各个部件供电的电源511(比如电池),优选的,电源511可以通过电源管理系统与处理器510逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The electronic device 500 may also include a power supply 511 (such as a battery) for supplying power to various components. Preferably, the power supply 511 may be logically connected to the processor 510 through a power management system, so as to manage charging, discharging, and power consumption management through the power management system and other functions.

另外,电子设备500包括一些未示出的功能模块,在此不再赘述。In addition, the electronic device 500 includes some functional modules not shown, which will not be repeated here.

可选的,本发明实施例还提供一种电子设备,包括处理器,存储器,存储在存储器上并可在所述处理器上运行的计算机程序,该计算机程序被处理器执行时实现上述拍摄方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。Optionally, an embodiment of the present invention further provides an electronic device, including a processor, a memory, a computer program stored in the memory and executable on the processor, and the computer program is executed by the processor to implement the above-mentioned shooting method. Each process of the embodiment can achieve the same technical effect, and to avoid repetition, it will not be repeated here.

本发明实施例还提供一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该计算机程序被处理器执行时实现上述拍摄方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。其中,所述的计算机可读存储介质,如只读存储器(Read-Only Memory,简称ROM)、随机存取存储器(Random Access Memory,简称RAM)、磁碟或者光盘等。Embodiments of the present invention further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, each process of the above-mentioned embodiments of the shooting method can be realized, and the same technical effect can be achieved. , in order to avoid repetition, it will not be repeated here. The computer-readable storage medium is, for example, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk, or an optical disk.

需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

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

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention. should be included within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims (10)

1.一种拍摄方法,其特征在于,包括:1. a photographing method, is characterized in that, comprises: 通过摄像头实时获取第一图像,确定所述第一图像中的第一人物图像和第二人物图像;Acquire the first image in real time through the camera, and determine the first person image and the second person image in the first image; 在所述第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到目标图像;In the first image, delete the second person image, and perform background filling on the area corresponding to the second person image to obtain a target image; 实时显示所述目标图像;displaying the target image in real time; 所述通过摄像头实时获取第一图像,确定所述第一图像中的第一人物图像和第二人物图像之后,所述方法还包括:After obtaining the first image through the camera in real time and determining the first person image and the second person image in the first image, the method further includes: 将实时获取的新的第一图像中新增的人物图像确定为第二人物图像;determining the newly added person image in the new first image acquired in real time as the second person image; 或者,or, 若实时获取的新的第一图像中,检测到所述第一人物图像对应的人物特征,则在所述新的第一图像中,保持所述人物特征对应的人物图像为第一人物图像,将其他人物图像确定为第二人物图像;在所述新的第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到新的目标图像;If a character feature corresponding to the first character image is detected in the new first image acquired in real time, in the new first image, the character image corresponding to the character feature is kept as the first character image, Determining other person images as the second person image; in the new first image, delete the second person image, and perform background filling on the area corresponding to the second person image to obtain a new target image; 显示所述新的目标图像;displaying the new target image; 所述通过摄像头实时获取第一图像,确定所述第一图像中的第一人物图像和第二人物图像之后,所述方法还包括:After obtaining the first image through the camera in real time and determining the first person image and the second person image in the first image, the method further includes: 若在预设时长内获取的第一图像中,均未检测到所述第一人物图像对应的人物特征,则实时显示所述预设时长后获取的新的第一图像。If no character characteristic corresponding to the first character image is detected in the first images obtained within the preset time period, a new first image obtained after the preset time period is displayed in real time. 2.根据权利要求1所述的方法,其特征在于,所述确定所述第一图像中的第一人物图像和第二人物图像,包括:2. The method according to claim 1, wherein the determining the first person image and the second person image in the first image comprises: 获取所述第一图像中各人物图像对应的人物主体与所述摄像头之间的距离,将所述距离小于等于预设距离的人物主体对应的人物图像确定为第一人物图像,将所述距离大于所述预设距离的人物主体对应的人物图像确定为第二人物图像;Obtaining the distance between the person subject corresponding to each person image in the first image and the camera, determining the person image corresponding to the person subject whose distance is less than or equal to a preset distance as the first person image, and determining the distance The character image corresponding to the character subject greater than the preset distance is determined as the second character image; 或者,or, 获取所述第一图像中各人物图像的图像尺寸,将所述图像尺寸大于等于预设尺寸的人物图像确定为第一人物图像,将所述图像尺寸小于所述预设尺寸的人物图像确定为第二人物图像;Acquire the image size of each person image in the first image, determine the person image with the image size greater than or equal to a preset size as the first person image, and determine the person image with the image size smaller than the preset size as image of the second person; 或者,or, 获取所述第一图像中各人物图像的面部信息,将所述面部信息符合预设面部信息的人物图像确定为第一人物图像,将所述面部信息不符合所述预设面部信息的人物图像确定为第二人物图像;Obtain the facial information of each person image in the first image, determine the person image whose facial information conforms to the preset facial information as the first person image, and determine the person image whose facial information does not conform to the preset facial information Determined to be the second person image; 或者,or, 获取所述第一图像中各人物图像对应的人物主体的移动速度,将所述移动速度小于等于预设速度的人物主体对应的人物图像确定为第一人物图像,将所述移动速度大于所述预设速度的人物主体对应的人物图像确定为第二人物图像。Acquiring the moving speed of the character subject corresponding to each character image in the first image, determining the character image corresponding to the character subject whose moving speed is less than or equal to a preset speed as the first character image, and determining the moving speed greater than the The character image corresponding to the character subject at the preset speed is determined as the second character image. 3.根据权利要求1所述的方法,其特征在于,所述删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到目标图像,包括:3. The method according to claim 1, wherein the deleting the second person image, and performing background filling on a region corresponding to the second person image to obtain a target image, comprising: 获取所述第一图像之前的预设帧图像中与所述第二人物图像对应的区域相对应的背景图像;acquiring a background image corresponding to the area corresponding to the second person image in the preset frame image before the first image; 删除所述第一图像中的所述第二人物图像,并将所述背景图像填充至所述第一图像中,得到目标图像。Deleting the second person image in the first image, and filling the background image into the first image to obtain a target image. 4.根据权利要求1所述的方法,其特征在于,所述删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到目标图像,包括:4. The method according to claim 1, wherein the deleting the second person image, and performing background filling on a region corresponding to the second person image to obtain a target image, comprising: 获取所述第二人物图像周边预设区域内的第一背景图像,复制所述第一背景图像得到复制图像;acquiring a first background image in a preset area around the second person image, and duplicating the first background image to obtain a duplicate image; 将所述复制图像与所述第二人物图像周边区域内的第二背景图像进行融合处理,以得到处理图像;Perform fusion processing on the duplicated image and the second background image in the peripheral area of the second person image to obtain a processed image; 删除所述第一图像中的所述第二人物图像,并将所述处理图像填充至所述第一图像中,得到目标图像。Deleting the second person image in the first image, and filling the processed image into the first image to obtain a target image. 5.一种电子设备,其特征在于,包括:5. An electronic device, characterized in that, comprising: 确定模块,用于通过摄像头实时获取第一图像,确定所述第一图像中的第一人物图像和第二人物图像;a determining module, configured to acquire the first image in real time through the camera, and determine the first character image and the second character image in the first image; 处理模块,用于在所述第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到目标图像;a processing module, configured to delete the second person image in the first image, and perform background filling on the area corresponding to the second person image to obtain a target image; 显示模块,用于实时显示所述目标图像;a display module for displaying the target image in real time; 所述确定模块还用于:The determining module is also used for: 将实时获取的新的第一图像中新增的人物图像确定为第二人物图像;determining the newly added person image in the new first image acquired in real time as the second person image; 或者,or, 若实时获取的新的第一图像中,检测到所述第一人物图像对应的人物特征,则在所述新的第一图像中,保持所述人物特征对应的人物图像为第一人物图像,将其他人物图像确定为第二人物图像;If a character feature corresponding to the first character image is detected in the new first image acquired in real time, in the new first image, the character image corresponding to the character feature is kept as the first character image, determining other person images as the second person images; 所述处理模块还用于:在所述新的第一图像中,删除所述第二人物图像,并对所述第二人物图像对应的区域进行背景填充,得到新的目标图像;The processing module is further configured to: in the new first image, delete the second person image, and perform background filling on the area corresponding to the second person image to obtain a new target image; 所述显示模块还用于:显示所述新的目标图像;The display module is further configured to: display the new target image; 所述确定模块还用于:The determining module is also used for: 若在预设时长内获取的第一图像中,均未检测到所述第一人物图像对应的人物特征,则实时显示所述预设时长后获取的新的第一图像。If no character characteristic corresponding to the first character image is detected in the first images obtained within the preset time period, a new first image obtained after the preset time period is displayed in real time. 6.根据权利要求5所述的电子设备,其特征在于,所述确定模块还用于:6. The electronic device according to claim 5, wherein the determining module is further configured to: 获取所述第一图像中各人物图像对应的人物主体与所述摄像头之间的距离,将所述距离小于等于预设距离的人物主体对应的人物图像确定为第一人物图像,将所述距离大于所述预设距离的人物主体对应的人物图像确定为第二人物图像;Obtaining the distance between the person subject corresponding to each person image in the first image and the camera, determining the person image corresponding to the person subject whose distance is less than or equal to a preset distance as the first person image, and determining the distance The character image corresponding to the character subject greater than the preset distance is determined as the second character image; 或者,or, 获取所述第一图像中各人物图像的图像尺寸,将所述图像尺寸大于等于预设尺寸的人物图像确定为第一人物图像,将所述图像尺寸小于所述预设尺寸的人物图像确定为第二人物图像;Acquire the image size of each person image in the first image, determine the person image with the image size greater than or equal to a preset size as the first person image, and determine the person image with the image size smaller than the preset size as image of the second person; 或者,or, 获取所述第一图像中各人物图像的面部信息,将所述面部信息符合预设面部信息的人物图像确定为第一人物图像,将所述面部信息不符合所述预设面部信息的人物图像确定为第二人物图像;Obtain the facial information of each person image in the first image, determine the person image whose facial information conforms to the preset facial information as the first person image, and determine the person image whose facial information does not conform to the preset facial information Determined to be the second person image; 或者,or, 获取所述第一图像中各人物图像对应的人物主体的移动速度,将所述移动速度小于等于预设速度的人物主体对应的人物图像确定为第一人物图像,将所述移动速度大于所述预设速度的人物主体对应的人物图像确定为第二人物图像。Acquiring the moving speed of the character subject corresponding to each character image in the first image, determining the character image corresponding to the character subject whose moving speed is less than or equal to a preset speed as the first character image, and determining the moving speed greater than the The character image corresponding to the character subject at the preset speed is determined as the second character image. 7.根据权利要求5所述的电子设备,其特征在于,所述处理模块还用于:7. The electronic device according to claim 5, wherein the processing module is further used for: 获取所述第一图像之前的预设帧图像中与所述第二人物图像对应的区域相对应的背景图像;acquiring a background image corresponding to the area corresponding to the second person image in the preset frame image before the first image; 删除所述第一图像中的所述第二人物图像,并将所述背景图像填充至所述第一图像中,得到目标图像。Deleting the second person image in the first image, and filling the background image into the first image to obtain a target image. 8.根据权利要求5所述的电子设备,其特征在于,所述处理模块还用于:8. The electronic device according to claim 5, wherein the processing module is further configured to: 获取所述第二人物图像周边预设区域内的第一背景图像,复制所述第一背景图像得到复制图像;acquiring a first background image in a preset area around the second person image, and duplicating the first background image to obtain a duplicate image; 将所述复制图像与所述第二人物图像周边区域内的第二背景图像进行融合处理,以得到处理图像;Perform fusion processing on the duplicated image and the second background image in the peripheral area of the second person image to obtain a processed image; 删除所述第一图像中的所述第二人物图像,并将所述处理图像填充至所述第一图像中,得到目标图像。Deleting the second person image in the first image, and filling the processed image into the first image to obtain a target image. 9.一种电子设备,其特征在于,包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现如权利要求1至4中任一项所述的拍摄方法的步骤。9. An electronic device, characterized in that it comprises a processor, a memory, and a computer program stored on the memory and running on the processor, the computer program being executed by the processor to achieve the right The steps of the photographing method described in any one of requirements 1 to 4. 10.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至4中任一项所述的拍摄方法的步骤。10 . A computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of the photographing method according to any one of claims 1 to 4 are implemented.
CN202010119183.4A 2020-02-26 2020-02-26 A shooting method and electronic device Active CN111263071B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202010119183.4A CN111263071B (en) 2020-02-26 2020-02-26 A shooting method and electronic device
PCT/CN2021/076870 WO2021169851A1 (en) 2020-02-26 2021-02-19 Photographing method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010119183.4A CN111263071B (en) 2020-02-26 2020-02-26 A shooting method and electronic device

Publications (2)

Publication Number Publication Date
CN111263071A CN111263071A (en) 2020-06-09
CN111263071B true CN111263071B (en) 2021-12-10

Family

ID=70952710

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010119183.4A Active CN111263071B (en) 2020-02-26 2020-02-26 A shooting method and electronic device

Country Status (2)

Country Link
CN (1) CN111263071B (en)
WO (1) WO2021169851A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111263071B (en) * 2020-02-26 2021-12-10 维沃移动通信有限公司 A shooting method and electronic device
CN112422828B (en) * 2020-11-17 2023-04-28 维沃移动通信有限公司 Image processing method, image processing apparatus, electronic device, and readable storage medium
CN112468722B (en) * 2020-11-19 2022-05-06 惠州Tcl移动通信有限公司 Shooting method, device, equipment and storage medium
CN112887611A (en) * 2021-01-27 2021-06-01 维沃移动通信有限公司 Image processing method, device, equipment and storage medium
CN113873135A (en) * 2021-11-03 2021-12-31 乐美科技股份私人有限公司 Image obtaining method and device, electronic equipment and storage medium
CN114040129B (en) * 2021-11-30 2023-12-05 北京字节跳动网络技术有限公司 Video generation method, device, equipment and storage medium
CN115665544A (en) * 2022-10-14 2023-01-31 维沃移动通信有限公司 Image sharing method and device, electronic equipment and readable storage medium
CN116708995B (en) * 2023-08-01 2023-09-29 世优(北京)科技有限公司 Photographic composition method, photographic composition device and photographic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104349045A (en) * 2013-08-09 2015-02-11 联想(北京)有限公司 Image collecting method and electronic equipment
CN105827952A (en) * 2016-02-01 2016-08-03 维沃移动通信有限公司 Photographing method for removing specified object and mobile terminal
CN106331460A (en) * 2015-06-19 2017-01-11 宇龙计算机通信科技(深圳)有限公司 Image processing method and device, and terminal
CN109040604A (en) * 2018-10-23 2018-12-18 Oppo广东移动通信有限公司 Image processing method, device, storage medium and mobile terminal
CN109993688A (en) * 2017-12-29 2019-07-09 深圳市优必选科技有限公司 Robot, photo shooting and processing method thereof and storage device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2494498B1 (en) * 2009-10-30 2018-05-23 QUALCOMM Incorporated Method and apparatus for image detection with undesired object removal
JP2016042661A (en) * 2014-08-18 2016-03-31 キヤノン株式会社 Information processing unit, system, information processing method, and program
JP6324879B2 (en) * 2014-11-18 2018-05-16 富士フイルム株式会社 Imaging apparatus and control method thereof
JP6640460B2 (en) * 2015-03-30 2020-02-05 富士フイルム株式会社 Image capturing apparatus, image capturing method, program, and recording medium
CN107360366B (en) * 2017-06-30 2020-05-12 Oppo广东移动通信有限公司 Photographing method, device, storage medium and electronic device
CN108924418A (en) * 2018-07-02 2018-11-30 珠海市魅族科技有限公司 A kind for the treatment of method and apparatus of preview image, terminal, readable storage medium storing program for executing
CN111263071B (en) * 2020-02-26 2021-12-10 维沃移动通信有限公司 A shooting method and electronic device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104349045A (en) * 2013-08-09 2015-02-11 联想(北京)有限公司 Image collecting method and electronic equipment
CN106331460A (en) * 2015-06-19 2017-01-11 宇龙计算机通信科技(深圳)有限公司 Image processing method and device, and terminal
CN105827952A (en) * 2016-02-01 2016-08-03 维沃移动通信有限公司 Photographing method for removing specified object and mobile terminal
CN109993688A (en) * 2017-12-29 2019-07-09 深圳市优必选科技有限公司 Robot, photo shooting and processing method thereof and storage device
CN109040604A (en) * 2018-10-23 2018-12-18 Oppo广东移动通信有限公司 Image processing method, device, storage medium and mobile terminal

Also Published As

Publication number Publication date
WO2021169851A1 (en) 2021-09-02
CN111263071A (en) 2020-06-09

Similar Documents

Publication Publication Date Title
CN111263071B (en) A shooting method and electronic device
CN108668083B (en) Photographing method and terminal
CN110446097B (en) Screen recording method and mobile terminal
CN108471498B (en) Shooting preview method and terminal
CN109240577B (en) Screen capturing method and terminal
CN107682634A (en) A face image acquisition method and mobile terminal
CN109710349B (en) Screen capturing method and mobile terminal
CN108174109B (en) A kind of photographing method and mobile terminal
CN107864336B (en) Image processing method and mobile terminal
CN108196815B (en) Method for adjusting call sound and mobile terminal
WO2021190390A1 (en) Focusing method, electronic device, storage medium and program product
CN108898555B (en) An image processing method and terminal device
WO2021082772A1 (en) Screenshot method and electronic device
CN110505401A (en) A camera control method and electronic device
CN107608606A (en) A kind of image display method, mobile terminal and computer-readable recording medium
CN111510623A (en) Shooting method and electronic equipment
CN108924319B (en) Proximity detection method and mobile terminal
CN108881721B (en) A display method and terminal
CN108924422B (en) Panoramic photographing method and mobile terminal
CN110855921A (en) Video recording control method and electronic equipment
CN108174081B (en) A shooting method and mobile terminal
CN110908517B (en) Image editing method, device, electronic device and medium
CN108833796A (en) An image capturing method and terminal
CN108259756B (en) An image capturing method and mobile terminal
CN110865752A (en) A photo viewing method and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant