CN108513069A - Image processing method, image processing device, storage medium and electronic equipment - Google Patents
Image processing method, image processing device, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN108513069A CN108513069A CN201810276764.1A CN201810276764A CN108513069A CN 108513069 A CN108513069 A CN 108513069A CN 201810276764 A CN201810276764 A CN 201810276764A CN 108513069 A CN108513069 A CN 108513069A
- Authority
- CN
- China
- Prior art keywords
- image
- wide
- face
- scene
- angle
- 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.)
- Granted
Links
- 238000012545 processing Methods 0.000 title claims abstract description 97
- 238000003672 processing method Methods 0.000 title claims abstract description 30
- 238000004590 computer program Methods 0.000 claims description 16
- 238000013508 migration Methods 0.000 claims description 11
- 230000005012 migration Effects 0.000 claims description 11
- 239000000284 extract Substances 0.000 claims description 6
- 230000001360 synchronised effect Effects 0.000 claims description 4
- 238000011946 reduction process Methods 0.000 claims 1
- 230000001815 facial effect Effects 0.000 description 156
- 230000014509 gene expression Effects 0.000 description 37
- 239000000872 buffer Substances 0.000 description 17
- 238000010586 diagram Methods 0.000 description 17
- 238000000034 method Methods 0.000 description 17
- 230000006870 function Effects 0.000 description 11
- 238000005286 illumination Methods 0.000 description 10
- 230000000994 depressogenic effect Effects 0.000 description 5
- 230000003139 buffering effect Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 238000000605 extraction Methods 0.000 description 4
- 230000000694 effects Effects 0.000 description 3
- 238000003384 imaging method Methods 0.000 description 3
- 238000007726 management method Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000001960 triggered effect Effects 0.000 description 3
- 238000003705 background correction Methods 0.000 description 2
- 238000004891 communication Methods 0.000 description 2
- 230000008921 facial expression Effects 0.000 description 2
- 238000009434 installation Methods 0.000 description 2
- 239000004973 liquid crystal related substance Substances 0.000 description 2
- 238000012937 correction Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000000354 decomposition reaction Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000007599 discharging Methods 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 210000000887 face Anatomy 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000010354 integration Effects 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/80—Camera processing pipelines; Components thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/168—Feature extraction; Face representation
- G06V40/171—Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/61—Control of cameras or camera modules based on recognised objects
- H04N23/611—Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N23/00—Cameras or camera modules comprising electronic image sensors; Control thereof
- H04N23/60—Control of cameras or camera modules
- H04N23/698—Control of cameras or camera modules for achieving an enlarged field of view, e.g. panoramic image capture
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30196—Human being; Person
- G06T2207/30201—Face
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Health & Medical Sciences (AREA)
- Oral & Maxillofacial Surgery (AREA)
- General Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
- Studio Devices (AREA)
Abstract
Description
技术领域technical field
本申请涉及图像处理技术领域,具体涉及一种图像处理方法、装置、存储介质及电子设备。The present application relates to the technical field of image processing, and in particular to an image processing method, device, storage medium and electronic equipment.
背景技术Background technique
如手机等电子设备通常为使用者提供有拍照功能,随着摄像模组等硬件和图像处理算法的不断进步,电子设备的拍摄功能也越来越强大,用户也越来越频繁地使用电子设备进行拍照。Electronic devices such as mobile phones usually provide users with a camera function. With the continuous advancement of camera modules and other hardware and image processing algorithms, the camera functions of electronic devices are becoming more and more powerful, and users are using electronic devices more and more frequently. Take a picture.
目前,电子设备除了提供基础的拍照功能之外,还进一步提供了图像处理功能,比如,可以对图像中的人脸进行美化和修饰等。而实现图像处理的前提是识别到图像中的人脸特征,但是,电子设备在对距离较远的人物进行拍摄,或者是进行多人合影时,拍摄得到的图像中人脸会较小,难以准确的提取到人脸特征,影响后续对该图像进行图像处理的准确度。At present, in addition to basic camera functions, electronic devices further provide image processing functions, such as beautifying and modifying human faces in images. The premise of realizing image processing is to recognize the facial features in the image. However, when the electronic device is shooting a person at a distance, or taking a group photo with multiple people, the face in the captured image will be small, which is difficult to realize. Accurate extraction of facial features affects the accuracy of subsequent image processing on the image.
发明内容Contents of the invention
本申请实施例提供了一种图像处理方法、装置、存储介质及电子设备,能够提高图像处理的准确度。Embodiments of the present application provide an image processing method, device, storage medium, and electronic equipment, which can improve the accuracy of image processing.
第一方面,本申请实施例了提供了的一种图像处理方法,包括:In the first aspect, an embodiment of the present application provides an image processing method, including:
获取同步采集的、同一场景的长焦场景图像以及广角场景图像;Obtain synchronously acquired telephoto scene images and wide-angle scene images of the same scene;
对所述长焦场景图像进行人脸识别,得到所述长焦场景图像的人脸特征;Perform face recognition on the telephoto scene image to obtain facial features of the telephoto scene image;
将所述人脸特征与所述广角场景图像绑定;Binding the facial features to the wide-angle scene image;
根据所述广角场景图像所绑定的人脸特征,对所述广角场景图像进行预设处理。Preset processing is performed on the wide-angle scene image according to the facial features bound to the wide-angle scene image.
第二方面,本申请实施例了提供了的一种图像处理装置,包括:In the second aspect, an embodiment of the present application provides an image processing device, including:
图像获取模块,用于获取同步采集的、同一场景的长焦场景图像以及广角场景图像;An image acquisition module, configured to acquire synchronously acquired telephoto scene images and wide-angle scene images of the same scene;
图像识别模块,用于对所述长焦场景图像进行人脸识别,得到所述长焦场景图像的人脸特征;An image recognition module, configured to perform face recognition on the telephoto scene image to obtain facial features of the telephoto scene image;
特征绑定模块,用于将所述人脸特征与所述广角场景图像绑定;A feature binding module, configured to bind the facial features to the wide-angle scene image;
图像处理模块,用于根据所述广角场景图像所绑定的人脸特征,对所述广角场景图像进行预设处理。The image processing module is configured to perform preset processing on the wide-angle scene image according to the facial features bound to the wide-angle scene image.
第三方面,本申请实施例提供的存储介质,其上存储有计算机程序,当所述计算机程序在计算机上运行时,使得所述计算机执行如本申请任一实施例提供的图像处理方法。In the third aspect, the storage medium provided by the embodiments of the present application has a computer program stored thereon, and when the computer program is run on a computer, the computer is made to execute the image processing method provided in any embodiment of the present application.
第四方面,本申请实施例提供了一种电子设备,包括中央处理器和存储器,所述存储器有计算机程序,所述中央处理器通过调用所述计算机程序,用于执行如本申请任一实施例提供的图像处理方法。In a fourth aspect, the embodiment of the present application provides an electronic device, including a central processing unit and a memory, the memory has a computer program, and the central processor is used to execute any one of the implementations of the present application by invoking the computer program. The image processing method provided by the example.
本申请实施例首先获取同步采集的、同一场景的长焦场景图像以及广角场景图像;然后对长焦场景图像进行人脸识别,得到长焦场景图像的人脸特征;再将长焦场景图像的人脸特征与广角场景图像绑定;最后根据广角场景图像所绑定的人脸特征,对广角场景图像进行预设处理。将本申请实施例提供的技术方案应用于远距离的人像拍摄或者多人合影时,可以通过取景范围小但人像占比较大的长焦场景图像提取出待拍摄场景中人物的人脸特征,之后将提取出的人脸特征与取景范围大但人像占比较小的广角场景图像,用于对该广角场景图像进行处理,从而能够克服人脸特征提取难的问题,达到提高图像处理准确度的目的。In the embodiment of the present application, at first, the synchronously acquired telephoto scene image and wide-angle scene image of the same scene are acquired; then face recognition is performed on the telephoto scene image to obtain the face features of the telephoto scene image; The face feature is bound to the wide-angle scene image; finally, the wide-angle scene image is preset to be processed according to the face feature bound to the wide-angle scene image. When the technical solution provided by the embodiment of the present application is applied to long-distance portrait shooting or a group photo of multiple people, the facial features of the people in the scene to be shot can be extracted from the telephoto scene image with a small viewing range but a large proportion of portraits, and then The extracted face features and wide-angle scene images with a large viewing range but a small proportion of portraits are used to process the wide-angle scene images, so as to overcome the difficulty of face feature extraction and achieve the purpose of improving the accuracy of image processing .
附图说明Description of drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings that need to be used in the description of the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1为本申请实施例提供的图像处理方法的一个流程示意图。FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
图2是本申请实施例中长焦摄像头和广角摄像头的设置位置示意图。FIG. 2 is a schematic diagram of installation positions of a telephoto camera and a wide-angle camera in an embodiment of the present application.
图3是本申请实施例中采集得到待拍摄场景的长焦场景图像以及广角场景图像的示例图。FIG. 3 is an example diagram of a telephoto scene image and a wide-angle scene image of a scene to be photographed collected in an embodiment of the present application.
图4是本申请实施例中一种绑定人脸特征的操作示意图。Fig. 4 is a schematic diagram of an operation of binding facial features in the embodiment of the present application.
图5是本申请实施例中另一种绑定人脸特征的操作示意图。Fig. 5 is a schematic diagram of another operation of binding facial features in the embodiment of the present application.
图6是本申请实施例中从多个广角场景图像中确定出待处理图像的示意图。Fig. 6 is a schematic diagram of determining an image to be processed from multiple wide-angle scene images in the embodiment of the present application.
图7是本申请实施例中从待处理图像中确定出待处理脸部图像的操作示意图。Fig. 7 is a schematic diagram of the operation of determining the face image to be processed from the images to be processed in the embodiment of the present application.
图8是本申请实施例中从其它广角场景图像中获取目标脸部图像的操作示意图。FIG. 8 is a schematic diagram of the operation of acquiring a target face image from other wide-angle scene images in the embodiment of the present application.
图9是本申请实施例中一种将待处理脸部图像替换为目标脸部图像的操作示意图。FIG. 9 is a schematic diagram of an operation for replacing a face image to be processed with a target face image in the embodiment of the present application.
图10是本申请实施例中从脸部图像库中获取目标脸部图像的操作示意图。Fig. 10 is a schematic diagram of the operation of acquiring a target facial image from a facial image database in the embodiment of the present application.
图11是本申请实施例中另一种将待处理脸部图像替换为目标脸部图像的操作示意图。Fig. 11 is a schematic diagram of another operation for replacing the face image to be processed with the target face image in the embodiment of the present application.
图12是本申请实施例中从目标电子设备获取目标脸部图像的操作示意图。Fig. 12 is a schematic diagram of the operation of acquiring a target face image from the target electronic device in the embodiment of the present application.
图13是本申请实施例中提供的图像处理方法的又一个流程示意图。Fig. 13 is another schematic flowchart of the image processing method provided in the embodiment of the present application.
图14是本申请实施例提供的图像处理装置的一结构示意图。FIG. 14 is a schematic structural diagram of an image processing device provided by an embodiment of the present application.
图15是本申请实施例提供的电子设备的一个结构示意图。FIG. 15 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
图16是本申请实施例提供的电子设备的另一结构示意图。FIG. 16 is another schematic structural diagram of an electronic device provided by an embodiment of the present application.
图17是本申请实施例中图像处理电路的一个细化结构示意图。FIG. 17 is a schematic diagram of a detailed structure of the image processing circuit in the embodiment of the present application.
图18是本申请实施例中图像处理电路的另一个细化结构示意图。FIG. 18 is a schematic diagram of another detailed structure of the image processing circuit in the embodiment of the present application.
具体实施方式Detailed ways
请参照图式,其中相同的组件符号代表相同的组件,本申请的原理是以实施在一适当的运算环境中来举例说明。以下的说明是基于所例示的本申请具体实施例,其不应被视为限制本申请未在此详述的其它具体实施例。Referring to the drawings, wherein the same reference numerals represent the same components, the principles of the present application are exemplified by being implemented in a suitable computing environment. The following description is based on illustrated specific embodiments of the present application, which should not be construed as limiting other specific embodiments of the present application that are not described in detail here.
在以下的说明中,本申请的具体实施例将参考由一部或多部计算机所执行的步骤及符号来说明,除非另有述明。因此,这些步骤及操作将有数次提到由计算机执行,本文所指的计算机执行包括了由代表了以一结构化型式中的数据的电子信号的计算机处理单元的操作。此操作转换该数据或将其维持在该计算机的内存系统中的位置处,其可重新配置或另外以本领域测试人员所熟知的方式来改变该计算机的运作。该数据所维持的数据结构为该内存的实体位置,其具有由该数据格式所定义的特定特性。但是,本申请原理以上述文字来说明,其并不代表为一种限制,本领域测试人员将可了解到以下所述的多种步骤及操作亦可实施在硬件当中。In the following description, specific embodiments of the present application will be described with reference to steps and symbols executed by one or more computers, unless otherwise stated. Accordingly, these steps and operations will several times be referred to as being computer-implemented, which herein refers to operations by a computer processing unit of electronic signals representing data in a structured form. This operation transforms the data or maintains it at a location in the computer's memory system that can reconfigure or otherwise alter the operation of the computer in a manner well known to testers in the art. The data structures maintained by the data are physical locations in the memory that have certain characteristics defined by the data format. However, the principle of the present application is described in the above text, which is not meant to be a limitation, and testers in the field will understand that the various steps and operations described below can also be implemented in hardware.
本文所使用的术语“模块”可看做为在该运算系统上执行的软件对象。本文所述的不同组件、模块、引擎及服务可看做为在该运算系统上的实施对象。而本文所述的装置及方法可以以软件的方式进行实施,当然也可在硬件上进行实施,均在本申请保护范围之内。The term "module" as used herein may be considered a software object that executes on the computing system. The various components, modules, engines and services described herein can be considered as implementation objects on the computing system. The devices and methods described herein can be implemented in the form of software, and of course can also be implemented in hardware, all of which are within the protection scope of the present application.
本申请中的术语“第一”、“第二”和“第三”等是用于区别不同对象,而不是用于描述特定顺序。此外,术语“包括”和“具有”以及它们任何变形,意图在于覆盖不排他的包含。比如包含了一系列步骤或模块的过程、方法、系统、产品或设备没有限定于已列出的步骤或模块,而是某些实施例还包括没有列出的步骤或模块,或某些实施例还包括对于这些过程、方法、产品或设备固有的其它步骤或模块。The terms "first", "second" and "third" in this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "include" and "have", as well as any variations thereof, are intended to cover a non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or modules is not limited to the listed steps or modules, but some embodiments also include steps or modules that are not listed, or some embodiments Other steps or modules inherent to these processes, methods, products or devices are also included.
在本文中提及“实施例”意味着,结合实施例描述的特定特征、结构或特性可以包含在本申请的至少一个实施例中。在说明书中的各个位置出现该短语并不一定均是指相同的实施例,也不是与其它实施例互斥的独立的或备选的实施例。本领域技术人员显式地和隐式地理解的是,本文所描述的实施例可以与其它实施例相结合。Reference herein to an "embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the present application. The occurrences of this phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is understood explicitly and implicitly by those skilled in the art that the embodiments described herein can be combined with other embodiments.
本申请实施例提供一种图像处理方法,该图像处理方法的执行主体可以是本申请实施例提供的图像处理装置,或者集成了该图像处理装置的电子设备,其中该图像处理装置可以采用硬件或者软件的方式实现。其中,电子设备可以是智能手机、平板电脑、掌上电脑、笔记本电脑、或者台式电脑等设备。An embodiment of the present application provides an image processing method. The execution subject of the image processing method may be the image processing device provided in the embodiment of the present application, or an electronic device integrated with the image processing device, wherein the image processing device may use hardware or realized by software. Wherein, the electronic device may be a device such as a smart phone, a tablet computer, a palmtop computer, a notebook computer, or a desktop computer.
请参照图1,图1为本申请实施例提供的图像处理方法的流程示意图。本申请实施例提供的图像处理方法的具体流程可以如下:Please refer to FIG. 1 , which is a schematic flowchart of an image processing method provided in an embodiment of the present application. The specific flow of the image processing method provided in the embodiment of the present application may be as follows:
在步骤101中,获取同步采集的、同一场景的长焦场景图像以及广角场景图像。In step 101, a synchronously acquired telephoto scene image and a wide-angle scene image of the same scene are acquired.
请参照图2,在本申请实施例中,电子设备包括长焦摄像头和广角摄像头,如图2所示的一种设置方式中,长焦摄像头和广角摄像头水平并列设置于电子设备的同一平面,且长焦摄像头和广角摄像头之间具有一定的距离。此外,电子设备配置有长焦图像缓存队列和广角图像缓存队列,其中长焦图像缓存队列用于缓存长焦摄像头采集到的图像,广角图像缓存队列用于缓存广角摄像头采集到的图像。需要说明的是,在具体实施时,长焦摄像头和广角摄像头的设置方式可由本领域技术人员根据实际需要进行设置。Please refer to FIG. 2. In the embodiment of the present application, the electronic device includes a telephoto camera and a wide-angle camera. In one arrangement shown in FIG. 2, the telephoto camera and the wide-angle camera are horizontally arranged on the same plane of the electronic device. And there is a certain distance between the telephoto camera and the wide-angle camera. In addition, the electronic device is configured with a telephoto image buffer queue and a wide-angle image buffer queue, wherein the telephoto image buffer queue is used for buffering images collected by the telephoto camera, and the wide-angle image buffer queue is used for buffering images collected by the wide-angle camera. It should be noted that during specific implementation, the arrangement of the telephoto camera and the wide-angle camera can be set by those skilled in the art according to actual needs.
本申请实施例中,电子设备在启动拍照类应用之后,将同步启动长焦摄像头和广角摄像头,且控制长焦摄像头和广角摄像头按照相同的帧率同步采集待拍摄场景的图像,分别得到待拍摄场景的长焦场景图像和广角场景图像。其中,长焦摄像头将采集到的长焦场景图像存入长焦图像缓存队列中,广角摄像头将采集到的广角场景图像存入广角图像缓存队列中。In the embodiment of the present application, after the electronic device starts the camera application, it will start the telephoto camera and the wide-angle camera synchronously, and control the telephoto camera and the wide-angle camera to synchronously collect the images of the scenes to be shot at the same frame rate, and obtain the images to be shot respectively. A telephoto scene image and a wide-angle scene image of the scene. Wherein, the telephoto camera stores the collected telephoto scene image into the telephoto image buffer queue, and the wide-angle camera stores the collected wide-angle scene image into the wide-angle image buffer queue.
比如,请参照图3,在图3所示待拍摄场景中,包括人物丙、人物丁和人物戊3个不同的人物,在某采集时刻,电子设备通过长焦摄像头采集到该待拍摄场景的长焦场景图像,通过广角摄像头采集到该待拍摄场景的广角场景图像,显而易见的,长焦场景图像中的人像相对于广角场景图像中的人像更大,更易于辨识。For example, please refer to FIG. 3. In the scene to be shot shown in FIG. 3, there are three different characters including character C, character D, and character E. For the telephoto scene image, the wide-angle scene image of the scene to be shot is collected by the wide-angle camera. Obviously, the portrait in the telephoto scene image is larger and easier to identify than the portrait in the wide-angle scene image.
本申请实施例中,电子设备在接收到触发的图像拍摄请求时,从长焦场景图像队列以及广角场景图像队列中,分别提取出长焦摄像头和广角摄像头同步采集的、同一场景的长焦场景图像以及广角场景图像。In the embodiment of the present application, when the electronic device receives the triggered image capture request, it extracts the telephoto scene of the same scene that is synchronously collected by the telephoto camera and the wide-angle camera respectively from the queue of telephoto scene images and the queue of wide-angle scene images. images as well as wide-angle scene images.
可选的,在一实施例中,获取同步采集的、同一场景的长焦场景图像以及广角场景图像,可以包括:Optionally, in an embodiment, obtaining synchronously acquired telephoto scene images and wide-angle scene images of the same scene may include:
获取多个采集时刻同步采集的、同一场景的长焦场景图像以及广角场景图像,得到长焦场景图像集合和广角场景图像集合。Telephoto scene images and wide-angle scene images of the same scene that are synchronously collected at multiple collection moments are acquired to obtain a telephoto scene image set and a wide-angle scene image set.
其中,长焦场景图像集合中长焦场景图像的个数、和广角场景图像集合中广角场景图像的个数相同。获取长焦场景图像/广角长焦图像的目标个数可以根据长焦摄像头/广角摄像头的帧率信息进行确定。Wherein, the number of telephoto scene images in the set of telephoto scene images is the same as the number of wide-angle scene images in the set of wide-angle scene images. The number of objects to acquire the telephoto scene image/wide-angle telephoto image may be determined according to the frame rate information of the telephoto camera/wide-angle camera.
具体的,电子设备在接收到触发的图像拍摄请求时,首先获取长焦摄像头/广角摄像头的帧率信息,其中,帧率信息用于描述长焦摄像头/广角摄像头在单位时间内采集到场景图像的个数,比如,在获取到的帧率信息为30fps时,说明长焦摄像头每秒采集待拍摄场景的30个长焦场景图像,广角摄像头每秒采集待拍摄场景的30个广角场景图像;又比如,在获取到的帧率信息为15fps时,说明长焦摄像头每秒采集待拍摄场景的15个长焦场景图像,广角摄像头每秒采集待拍摄场景的15个广角场景图像。Specifically, when the electronic device receives the triggered image capture request, it first obtains the frame rate information of the telephoto camera/wide-angle camera, where the frame rate information is used to describe the scene image captured by the telephoto camera/wide-angle camera within a unit time For example, when the obtained frame rate information is 30fps, it means that the telephoto camera collects 30 telephoto scene images of the scene to be shot per second, and the wide-angle camera collects 30 wide-angle scene images of the scene to be shot per second; For another example, when the obtained frame rate information is 15fps, it means that the telephoto camera collects 15 telephoto scene images of the scene to be shot per second, and the wide-angle camera collects 15 wide-angle scene images of the scene to be shot per second.
其中,影响长焦摄像头/广角摄像头帧率信息的主要原因是环境光亮度,当环境光亮度较高(或者说电子设备处于亮光环境)时,长焦摄像头/广角摄像头可以在较短的时间内(如30ms)完成曝光,从而使得其能够以较高的帧率采集场景图像;而当环境光亮度较低(或者说电子设备处于暗光环境)时,长焦摄像头/广角摄像头需要花费较长的时间(如40ms-60ms,或更多)来完成曝光,从而使得其仅能以较低的帧率采集场景图像。Among them, the main reason affecting the frame rate information of the telephoto camera/wide-angle camera is the brightness of the ambient light. When the brightness of the ambient light is high (or the electronic device is in a bright light environment), the telephoto camera/wide-angle camera can display in a short period of time. (such as 30ms) to complete the exposure, so that it can capture scene images at a higher frame rate; and when the ambient light brightness is low (or the electronic device is in a dark environment), the telephoto camera/wide-angle camera takes a long time The time (such as 40ms-60ms, or more) to complete the exposure, so that it can only capture scene images at a lower frame rate.
之后,根据长焦摄像头/广角摄像头的帧率信息,确定对应该帧率信息的目标个数,其中,目标个数和帧率信息可以成正比关系,比如,在长焦摄像头/广角摄像头的帧率信息为30fps,可以确定目标个数为8,在长焦摄像头/广角摄像头的帧率信息为15fps时,可以确定目标个数为6。Afterwards, according to the frame rate information of the telephoto camera/wide-angle camera, determine the number of targets corresponding to the frame rate information, wherein the number of targets and the frame rate information can be proportional to each other, for example, in the frame rate of the telephoto camera/wide-angle camera If the rate information is 30fps, the number of targets can be determined to be 8. When the frame rate information of the telephoto camera/wide-angle camera is 15 fps, the number of targets can be determined to be 6.
在确定目标个数之后,从长焦图像缓存队列和广角图像缓存队列中提取出数量为目标个数的长焦场景图像和广角场景图像,其中,采集时刻相同(或者说同步采集)的长焦场景图像和广角场景图像构成一个图像组,共得到目标个数的图像组。After determining the target number, extract the telephoto scene images and wide-angle scene images whose number is the target number from the telephoto image cache queue and the wide-angle image cache queue, wherein the telephoto scene images with the same collection time (or synchronous collection) The scene image and the wide-angle scene image constitute an image group, and a target number of image groups is obtained in total.
比如,在确定目标个数为“4”时,从长焦图像缓存队列中提取出采集时刻分别为t1、t2、t3以及t4的4个长焦场景图像,从广角图像缓存队列中提取出采集时刻分别为t1、t2、t3以及t4的4个广角场景图像,这样将得到4个图像组,分别对应采集时刻t1、t2、t3以及t4。For example, when the number of targets is determined to be "4", four telephoto scene images with acquisition times t1, t2, t3 and t4 are extracted from the telephoto image buffer queue, and the acquisition time is extracted from the wide-angle image buffer queue. The four wide-angle scene images at time t1, t2, t3 and t4 respectively will obtain 4 image groups corresponding to the acquisition time t1, t2, t3 and t4 respectively.
在步骤102中,对获取到的长焦场景图像进行人脸识别,得到长焦场景图像的人脸特征;In step 102, face recognition is performed on the obtained telephoto scene image to obtain the face features of the telephoto scene image;
本申请实施例中,在获取到的长焦场景图像为多个时,则分别对获取到的多个长焦场景图像进行人脸识别;在获取到长焦场景图像仅为一个时,则对获取到的一个长焦场景图像进行人脸识别。In the embodiment of the present application, when there are multiple telephoto scene images obtained, face recognition is performed on the multiple telephoto scene images obtained; when only one telephoto scene image is obtained, the Face recognition is performed on an acquired telephoto scene image.
其中,人脸特征用于描述长焦场景图像所包含的脸部图像,包括但不限于脸部大小、眼睛开合度以及表情类型(如生气、厌恶、恐惧、高兴、悲伤和吃惊等)等。Among them, the face feature is used to describe the facial image contained in the telephoto scene image, including but not limited to face size, eye opening and closing degree, and expression type (such as anger, disgust, fear, happiness, sadness and surprise, etc.).
需要说明的是,对于采用何种人脸识别技术对长焦场景图像进行人脸识别本申请实施例对此不做具体限制,本领域技术人员可根据实际需要选择合适的人脸识别技术。It should be noted that the embodiment of the present application does not specifically limit which face recognition technology is used to perform face recognition on the telephoto scene image, and those skilled in the art can select an appropriate face recognition technology according to actual needs.
在步骤103中,将长焦场景图像的人脸特征与广角场景图像绑定;In step 103, the face feature of the telephoto scene image is bound to the wide-angle scene image;
其中,在完成对获取到长焦场景图像的人脸识别之后,将从长焦场景图像中识别到的人脸特征与其采集时刻的相同的广角场景图像绑定。Wherein, after the face recognition of the acquired telephoto scene image is completed, the face features recognized from the telephoto scene image are bound to the same wide-angle scene image at the time of collection.
比如,请参照图4,获取到采集时刻为t1的长焦场景图像和广角长焦图像,之后,从采集时刻为t1的长焦场景图像中识别出人脸特征,并将识别出的该人脸特征与采集时刻同为t1的广角场景图像绑定,作为该广角场景图像的人脸特征。For example, please refer to Figure 4, the telephoto scene image and the wide-angle telephoto image at the acquisition time t1 are obtained, and then the facial features are recognized from the telephoto scene image at the acquisition time t1, and the recognized person The face feature is bound to the wide-angle scene image at the same collection time as t1, and used as the face feature of the wide-angle scene image.
又比如,请参照图5,获取到采集时刻分别为t1、t2、t3以及t4的4个图像组,之后,从采集时刻为t1的长焦场景图像中识别出人脸特征1,并将识别出的该人脸特征1与采集时刻同为t1的广角场景图像绑定,从采集时刻为t2的长焦场景图像中识别出人脸特征2,并将识别出的该人脸特征2与采集时刻同为t2的广角场景图像绑定,从采集时刻为t3的长焦场景图像中识别出人脸特征3,并将识别出的该人脸特征3与采集时刻同为t3的广角场景图像绑定,从采集时刻为t4的长焦场景图像中识别出人脸特征4,并将识别出的该人脸特征4与采集时刻同为t4的广角场景图像绑定。For another example, please refer to Fig. 5, four image groups at the acquisition time t1, t2, t3, and t4 are obtained, and then, face feature 1 is recognized from the telephoto scene image at the acquisition time t1, and the recognition The detected face feature 1 is bound to the wide-angle scene image at the same collection time t1, and the face feature 2 is identified from the telephoto scene image at the collection time t2, and the recognized face feature 2 is combined with the collection time Bind the wide-angle scene image at the same time as t2, identify the face feature 3 from the telephoto scene image at the collection time t3, and bind the recognized face feature 3 with the wide-angle scene image at the same collection time as t3 It is determined that the face feature 4 is identified from the telephoto scene image at the acquisition time t4, and the recognized face feature 4 is bound to the wide-angle scene image at the same acquisition time t4.
在步骤104中,根据广角场景图像所绑定的人脸特征,对广角场景图像进行预设处理。In step 104, preset processing is performed on the wide-angle scene image according to the face features bound to the wide-angle scene image.
本申请实施例中,在完成人脸特征的绑定之后,进一步根据广角场景图像所绑定的人脸特征,对广角场景图像进行预设处理。可具体的,在一个可选的实施方式中,在获取到的广角场景图像为多个时,根据广角场景图像所绑定的人脸特征,对广角场景图像进行预设处理,包括:In the embodiment of the present application, after the binding of the facial features is completed, the wide-angle scene image is further subjected to preset processing according to the bound human face feature of the wide-angle scene image. Specifically, in an optional implementation manner, when there are multiple acquired wide-angle scene images, preset processing is performed on the wide-angle scene images according to the facial features bound to the wide-angle scene images, including:
根据各广角场景图像所绑定的人脸特征,确定各广角场景图像中包含的、符合预设条件的匹配脸部图像的个数;According to the facial features bound to each wide-angle scene image, determine the number of matching face images that meet the preset conditions contained in each wide-angle scene image;
将包含匹配脸部图像个数最多的广角场景图像作为待处理图像;The wide-angle scene image containing the largest number of matching face images is used as the image to be processed;
根据待处理图像所绑定的人脸特征,对待处理图像进行预设处理。Preset processing is performed on the image to be processed according to the facial features bound to the image to be processed.
其中,预设条件可根据实际拍摄需求进行设置,比如,在进行多人合影时,若需要拍摄大家都吃惊的表情,则可将预设条件配置为“表情类型为吃惊”;又比如,在进行多人合影时,若需要拍摄大家睁眼并微笑的表情,则可将预设脸部特征配置为“表情类型为微笑,且睁眼”。Among them, the preset condition can be set according to the actual shooting needs. For example, when taking a group photo with multiple people, if you need to shoot everyone’s surprised expression, you can configure the preset condition as “surprised expression type”; When taking a group photo with multiple people, if you need to capture the expressions of everyone opening their eyes and smiling, you can configure the preset facial features as "the expression type is smiling and eyes open".
比如,请参照图6,共获取到4个广角场景图像,分别为:广角场景图像A、广角场景图像B、广角场景图像C以及广角场景图像D,这4个广角场景图像所对应的待拍摄场景中包括丙丁戊3个不同的人物,且预设条件被配置为“表情为大笑”,根据这4个广角场景图像各自绑定的人脸特征,确定广角场景图像A中包括一个匹配脸部图像(即丙的脸部图像),确定广角场景图像B中不存在匹配脸部图像,确定广角场景图像C中包括两个匹配脸部图像(即丙的脸部图像和丁的脸部图像),确定广角场景图像D中包括一个匹配脸部图像(即戊的脸部图像),显然的,广角场景图像C包含的匹配脸部图像的个数最多,因此将广角场景图像C作为待处理图像。For example, referring to FIG. 6, four wide-angle scene images are obtained in total, namely: wide-angle scene image A, wide-angle scene image B, wide-angle scene image C, and wide-angle scene image D. The scene includes 3 different characters, Bing Ding Wu, and the preset condition is configured as "the expression is laughing". According to the facial features bound to each of the 4 wide-angle scene images, it is determined that the wide-angle scene image A contains a matching face It is determined that there is no matching facial image in the wide-angle scene image B, and it is determined that the wide-angle scene image C includes two matching facial images (that is, the facial image of C and the facial image of D ), it is determined that a matching facial image (i.e., the facial image of E) is included in the wide-angle scene image D, obviously, the number of matching facial images contained in the wide-angle scene image C is the largest, so the wide-angle scene image C is used as the pending processing image.
在确定待处理图像之后,即可根据待处理图像所绑定的人脸特征,对确定的待处理图像进行预设处理,可具体的,根据待处理图像所绑定的人脸特征,对待处理图像进行预设处理,包括:After the image to be processed is determined, preset processing can be performed on the determined image to be processed according to the facial features bound to the image to be processed. Specifically, according to the facial features bound to the image to be processed, the Images undergo preset processing, including:
根据待处理图像所绑定的人脸特征,确定待处理图像中不符合预设条件的待处理脸部图像;According to the facial features bound to the images to be processed, determine the facial images to be processed that do not meet the preset conditions in the images to be processed;
从除待处理图像之外的其它广角场景图像中,获取对应待处理脸部图像的目标脸部图像,该目标脸部图像符合预设条件,且与待处理脸部图像属于相同人物;Obtaining a target face image corresponding to the face image to be processed from other wide-angle scene images other than the image to be processed, the target face image meets a preset condition, and belongs to the same person as the face image to be processed;
将待处理脸部图像替换为目标脸部图像。Replace the pending face image with the target face image.
其中,在从获取到的多个广角场景图像中确定出待处理图像之后,进一步从待处理图像中确定出待处理脸部图像,其中,该待处理脸部图像的不符合预设条件。Wherein, after the image to be processed is determined from the acquired multiple wide-angle scene images, the face image to be processed is further determined from the images to be processed, wherein the face image to be processed does not meet the preset condition.
比如,请参照图7,确定出的待处理图像包括人物丙的脸部图像、人物丁的脸部图像以及人物戊的脸部图像,如图7所示,根据待处理图像所绑定的人脸特征,确定丙脸部图像的表情类型为“大笑”,丁脸部图像的表情类型同样为“大笑”,而戊脸部图像的表情类型为“沮丧”,若预设条件为“表情类型为大笑”,则丙脸部图像和丁脸部图像符合预设条件,戊脸部图像不符合预设条件,因此,将戊脸部图像确定为待处理脸部图像。For example, referring to FIG. 7, the determined image to be processed includes the face image of person C, the face image of person D, and the face image of person E. As shown in FIG. 7, according to the person bound to the image to be processed Face features, determine that the expression type of C’s face image is “big laugh”, the expression type of D’s face image is also “big smile”, and the expression type of E’s face image is “depressed”, if the preset condition is “ If the facial expression type is "laughing", then the facial images of C and D meet the preset conditions, and the facial image of E does not meet the preset conditions. Therefore, the facial image of E is determined as the facial image to be processed.
在确定出待处理图像之中的待处理脸部图像,进一步从除待处理图像之外的其它广角场景图像中,获取对应待处理脸部图像的目标脸部图像,其中,该目标脸部图像与待处理脸部图像属于相同人物,且该目标脸部图像符合预设条件。比如,请参照图8和图6,对于图6所示的四个广角场景图像中,广角场景图像C被确定为待处理图像,其中戊脸部图像的表情类型为“沮丧”,与预设条件“表情类型为大笑”不符,被进一步确定为待处理脸部图像。之后,在除待处理图像(此处为场景图像C)之外的其它广角场景图像(此处为场景图像A、场景图像B以及场景图像D)中,查找是否存在表情类型为“大笑”的戊脸部图像(即人物戊的脸部图像),显然的,如图6所示,广角场景图像D中存在表情类型为“大笑”的戊脸部图像,此时,将广角场景图像D中的戊脸部图像确定为目标脸部图像,并从广角场景图像D中提取出戊脸部图像,用作后续处理。After determining the facial image to be processed among the images to be processed, further obtain a target facial image corresponding to the facial image to be processed from other wide-angle scene images except the image to be processed, wherein the target facial image It belongs to the same person as the face image to be processed, and the target face image meets the preset condition. For example, referring to Fig. 8 and Fig. 6, among the four wide-angle scene images shown in Fig. 6, the wide-angle scene image C is determined as the image to be processed, and the expression type of the E face image is "depressed", which is the same as the preset The condition "the expression type is laughing" does not match, and it is further determined to be a face image to be processed. Afterwards, in other wide-angle scene images (here, scene image A, scene image B, and scene image D) except the image to be processed (here, scene image C), find whether there is an expression type that is "laughing" E’s face image (that is, the face image of character E), obviously, as shown in Figure 6, there is an E’s face image whose expression type is "big laugh" in the wide-angle scene image D, at this time, the wide-angle scene image The face image of E in D is determined as the target face image, and the face image of E is extracted from the wide-angle scene image D for subsequent processing.
在获取到对应待处理脸部图像的目标脸部图像之后,即可将待处理脸部图像替换为目标脸部图像。比如,请结合参照图9和图6,在获取到图6所示的四个广角场景图像(即广角场景图像A、广角场景图像B、广角场景图像C以及广角场景图像D)之后,将广角场景图像C确定为待处理图像,并进一步将广角场景图像C中的戊脸部图像(即人物戊的脸部图像)确定为待处理脸部图像;之后,将广角场景图像D中的戊脸部图像确定为目标脸部图像;之后,将广角场景图像C中的戊脸部图像替换为广角场景图像D中的戊脸部图像,从而得到替换处理后的广角场景图像C,如图9所示,替换后的广角场景图像C中,各人物脸部图像的表情类型均为“大笑”,均符合预设条件“表情类型为大笑”。After the target face image corresponding to the face image to be processed is acquired, the face image to be processed can be replaced with the target face image. For example, please refer to FIG. 9 and FIG. 6 in combination. After obtaining four wide-angle scene images (i.e. wide-angle scene image A, wide-angle scene image B, wide-angle scene image C and wide-angle scene image D) shown in FIG. Scene image C is determined as the image to be processed, and further the face image of E in the wide-angle scene image C (i.e. the face image of person E) is determined as the face image to be processed; after that, the face of E in the wide-angle scene image D The internal image is determined as the target facial image; afterward, the E facial image in the wide-angle scene image C is replaced with the E facial image in the wide-angle scene image D, thereby obtaining the replaced wide-angle scene image C, as shown in Figure 9 It is shown that in the replaced wide-angle scene image C, the expression types of the facial images of each person are "laughing", which all meet the preset condition "the expression type is laughing".
本申请实施例中,在完成图像替换之后,即可将替换后的待处理图像作为图像拍摄请求的结果图像。In the embodiment of the present application, after the image replacement is completed, the replaced image to be processed can be used as the result image of the image capture request.
可选的,在一实施例中,将待处理脸部图像替换为目标脸部图像之后,还包括:Optionally, in an embodiment, after replacing the face image to be processed with the target face image, it also includes:
根据除待处理图像之外的其它广角场景图像对替换后的待处理图像进行降噪处理。Noise reduction processing is performed on the replaced image to be processed according to other wide-angle scene images except the image to be processed.
其中,可以采用多帧降噪的方式对待处理图像进行降噪处理。比如,共获取到4个广角场景图像,分别为广角场景图像A、广角场景图像B、广角场景图像C、广角场景图像D,其中,广角场景图像D被确定为待处理图像,那么可以根据根据广角场景图像A、广角场景图像B以及广角场景图像C对广角场景图像D进行多帧降噪。Wherein, the image to be processed may be denoised in a multi-frame denoising manner. For example, a total of 4 wide-angle scene images are obtained, which are respectively wide-angle scene image A, wide-angle scene image B, wide-angle scene image C, and wide-angle scene image D, wherein the wide-angle scene image D is determined to be an image to be processed, then it can be determined according to The wide-angle scene image A, the wide-angle scene image B, and the wide-angle scene image C perform multi-frame noise reduction on the wide-angle scene image D.
具体的,在进行多帧降噪时,可以先将广角场景图像A、广角场景图像D、广角场景图像B以及广角场景图像C对齐,并获取每一组对齐像素的像素值。若同一组对齐像素的像素值相差不多,那么可以计算这组对齐像素的像素值均值,再用该像素值均值替换掉广角场景图像D的对应像素的像素值。若同一组对齐像素的像素值相差较多,那么可以不对广角场景图像D中的像素值进行调整。Specifically, when performing multi-frame noise reduction, the wide-angle scene image A, wide-angle scene image D, wide-angle scene image B, and wide-angle scene image C may be aligned first, and the pixel values of each group of aligned pixels are acquired. If the pixel values of the same group of aligned pixels are similar, then the mean value of the pixel values of the group of aligned pixels can be calculated, and then the pixel value of the corresponding pixel of the wide-angle scene image D can be replaced by the mean value of the pixel values. If the pixel values of the same group of aligned pixels differ greatly, then the pixel values in the wide-angle scene image D may not be adjusted.
比如,广角场景图像A中的像素P1、广角场景图像D中的像素P2、广角场景图像B中的像素P3以及广角场景图像C中的像素P4是一组相互对齐的像素,其中P1的像素值为101,P2的像素值为102,P3的像素值为103,P4的像素值为104,那么这组相互对齐的像素的像素值均值为102.5,那么终端就可以将广角场景图像D中的P2像素的像素值由102调整为102.5,从而对广角场景图像D中的P2像素进行降噪处理。若P1的像素值为80,P2的像素值为102,P3的像素值为83,P4的像素值为90,那么由于它们的像素值相差较多,此时终端可以不调整P2的像素值,即P2的像素值保持102不变。For example, pixel P1 in wide-angle scene image A, pixel P2 in wide-angle scene image D, pixel P3 in wide-angle scene image B, and pixel P4 in wide-angle scene image C are a group of mutually aligned pixels, where the pixel value of P1 is 101, the pixel value of P2 is 102, the pixel value of P3 is 103, and the pixel value of P4 is 104, then the average pixel value of this group of aligned pixels is 102.5, then the terminal can use the wide-angle scene image D in P2 The pixel value of the pixel is adjusted from 102 to 102.5, so as to perform noise reduction processing on the P2 pixel in the wide-angle scene image D. If the pixel value of P1 is 80, the pixel value of P2 is 102, the pixel value of P3 is 83, and the pixel value of P4 is 90, then the terminal does not need to adjust the pixel value of P2 at this time because there is a large difference between their pixel values. That is, the pixel value of P2 remains unchanged at 102.
可选的,在一实施例中,从除待处理图像之外的其它广角场景图像中,获取对应待处理脸部图像的目标脸部图像之后,还包括:Optionally, in an embodiment, after obtaining the target face image corresponding to the face image to be processed from other wide-angle scene images except the image to be processed, the method further includes:
在从其它广角场景图像中获取目标脸部图像失败时,判断本地预设的脸部图像库中是否存储有目标脸部图像;When failing to obtain the target facial image from other wide-angle scene images, it is determined whether the target facial image is stored in the locally preset facial image library;
在脸部图像库中存储有目标脸部图像时,提取脸部图像库中存储的目标脸部图像。When the target facial image is stored in the facial image library, the target facial image stored in the facial image library is extracted.
考虑到从其它广角场景图像中获取目标脸部图像失败的情况,此处提供一种备选的、获取目标脸部图像的方案。Considering the failure to acquire the target facial image from other wide-angle scene images, an alternative solution for acquiring the target facial image is provided here.
具体的,可以在电子设备本地预先创建一个脸部图像库中,该脸部图像库中用于存储电子设备获取到的脸部图像。比如,电子设备在每次对外部场景进行拍摄,得到对应该外部场景的广角场景图像之后,对该广角场景图像进行人脸识别,并将从广角场景图像中识别出的脸部图像存储至脸部图像库中。Specifically, a facial image library may be pre-created locally on the electronic device, and the facial image library is used to store facial images acquired by the electronic device. For example, after the electronic device captures the external scene each time and obtains the wide-angle scene image corresponding to the external scene, it performs face recognition on the wide-angle scene image, and stores the facial image recognized from the wide-angle scene image in the face in the image library.
相应的,在从其它广角场景图像中获取目标脸部图像失败时,可以在本地预设的脸部图像库中查找是否存储有对应待处理脸部图像的目标脸部图像。其中,目标脸部图像与待处理脸部图像属于相同人物,且目标脸部图像符合预设条件。Correspondingly, when the target facial image fails to be acquired from other wide-angle scene images, it may be searched in the locally preset facial image library whether there is a target facial image corresponding to the facial image to be processed stored. Wherein, the target face image and the face image to be processed belong to the same person, and the target face image meets a preset condition.
若在脸部图像库中查找到对应待处理脸部图像的目标脸部图像,则从脸部图像库中提取出对应待处理脸部图像的目标脸部图像。比如,请结合参照图10和图6,对于图6所示的待处理图像中确定出的待处理脸部图像(即戊脸部图像),从脸部图像库中提取出对应待处理脸部图像的目标脸部图像(该目标脸部图像为之前从历史拍摄的某图像中识别出,并存储在脸部图像库中),如图10所示,提取出的目标脸部图像和待处理脸部图像属于相同人物,即同属于人物戊,且目标脸部图像的表情类型为“大笑”,符合配置的预设条件“表情类型为大笑”。If the target face image corresponding to the face image to be processed is found in the face image library, the target face image corresponding to the face image to be processed is extracted from the face image library. For example, please refer to FIG. 10 and FIG. 6 in combination, for the facial image to be processed (ie, the facial image E) determined in the image to be processed shown in FIG. 6 , extract the corresponding facial image to be processed from the facial image library. The target facial image of the image (the target facial image is identified from a certain image taken in history before, and stored in the facial image library), as shown in Figure 10, the extracted target facial image and the target facial image to be processed The facial images belong to the same person, that is, they belong to the same person E, and the expression type of the target facial image is "laughing", which meets the configured preset condition "the expression type is laughing".
可具体的,提取脸部图像库中存储的目标脸部图像,包括:Specifically, the target facial image stored in the facial image library is extracted, including:
在脸部图像库中存储有多个目标脸部图像时,获取各目标脸部图像的存入时刻;When a plurality of target facial images are stored in the facial image database, the storage time of each target facial image is obtained;
提取脸部图像库中、存入时刻距离当前时刻最近的目标脸部图像。Extract the target face image in the face image library whose storage time is closest to the current time.
比如,在脸部图像库中查找到3个对应待处理图像的目标脸部图像,分别为目标脸部图像1、目标脸部图像2和目标脸部图像3,且获取到目标脸部图像1的存入时刻为t1,获取到目标脸部图像2的存入时刻为t2,获取到目标脸部图像3的存入时刻为t3,若存入时刻t1距离当前时刻的时长为1天,存入时刻t2距离当前时刻的时长为2天,存入时刻t3距离当前时刻的时长为7天,显然的,目标脸部图像1的存入时刻距离当前时刻最近,此时从脸部图像库中提取出目标图像1用作后续处理。For example, three target face images corresponding to the image to be processed are found in the face image database, which are target face image 1, target face image 2 and target face image 3 respectively, and target face image 1 is acquired The storage time of the target facial image 2 is t1, the storage time of the target facial image 2 is t2, and the storage time of the target facial image 3 is t3. If the storage time t1 is 1 day away from the current time, the storage time The time between the input time t2 and the current time is 2 days, and the time between the storage time t3 and the current time is 7 days. Obviously, the storage time of the target facial image 1 is the closest to the current time. The target image 1 is extracted for subsequent processing.
可具体的,由于此时目标脸部图像从脸部图像库中提取出,该目标脸部图像可能从不同的拍摄场景中采集得到,而拍摄场景不同,其光照也不相同,因此,为提升图像处理后图像效果,将待处理脸部图像替换为目标脸部图像,包括:Specifically, since the target facial image is extracted from the facial image library at this time, the target facial image may be collected from different shooting scenes, and the lighting of the shooting scenes is different, so in order to improve Image effects after image processing, replacing the face image to be processed with the target face image, including:
获取待处理脸部图像的光照信息;Obtain the illumination information of the face image to be processed;
将获取到的光照信息迁移至目标脸部图像;Migrate the obtained lighting information to the target face image;
将待处理脸部图像替换为迁移后的目标脸部图像。Replace the pending face image with the migrated target face image.
其中,在进行光照信息的迁移时,可根据实际需要选取合适的光照迁移算法,来将待处理图像的光照信息迁移至目标脸部图像。其中,可选的光照迁移算法包括但不限于:基于商图的光照迁移算法、基于3D模型的光照迁移算法、基于滤波分解的光照迁移算法以及基于本征分解的光照迁移算法等。Wherein, when migrating the illumination information, an appropriate illumination migration algorithm may be selected according to actual needs to migrate the illumination information of the image to be processed to the target facial image. Among them, the optional lighting migration algorithm includes but not limited to: lighting migration algorithm based on quotient map, lighting migration algorithm based on 3D model, lighting migration algorithm based on filter decomposition, lighting migration algorithm based on eigendecomposition, etc.
在完成光照信息的迁移之后,将确定的待处理脸部图像替换为迁移后的目标脸部图像,由此使得替换后的待处理图像中、所有脸部图像均符合预设条件,且光照信息一致。After the migration of the illumination information is completed, the determined facial image to be processed is replaced with the migrated target facial image, so that all facial images in the replaced image to be processed meet the preset conditions, and the illumination information unanimous.
比如,请参照图11,将确定的某待处理脸部图像的光照信息迁移至其对应的目标脸部图像之后,目标脸部图像和该待处理脸部图像获得相同的光照效果,之后,将确定的待处理脸部图像替换为迁移后的目标脸部图像,由此使得替换后的待处理图像中、所有脸部图像均符合预设条件,且光照信息一致。For example, referring to FIG. 11, after the determined lighting information of a facial image to be processed is migrated to its corresponding target facial image, the target facial image and the facial image to be processed obtain the same lighting effect, and then the The determined face image to be processed is replaced with the migrated target face image, so that all face images in the replaced image to be processed meet the preset conditions and the illumination information is consistent.
需要说明的是,对于采用何种光照迁移算法,本申请实施例不做具体限制,可由本领域技术人员根据实际需要进行选取,可以是本申请实施例所列出的光照迁移算法,也可以是本申请实施例中未列出的光照迁移算法。It should be noted that the embodiment of the present application does not specifically limit which light migration algorithm is used, and it can be selected by those skilled in the art according to actual needs. It can be the light migration algorithm listed in the embodiment of the present application, or it can be Light migration algorithms not listed in the examples of this application.
可选的,在一实施例中,判断本地预设的脸部图像库中是否存储有目标脸部图像之后,还包括:Optionally, in an embodiment, after judging whether the target facial image is stored in the locally preset facial image library, it also includes:
在脸部图像库中未存储有对应待处理脸部图像的目标脸部图像时,获取待处理脸部图像对应的人物信息;When the target facial image corresponding to the facial image to be processed is not stored in the facial image library, the person information corresponding to the facial image to be processed is obtained;
发送图像获取请求至获取到的人物信息所对应的目标电子设备,其中,图像获取请求用于指示目标电子设备查找并返回对应待处理脸部图像的目标脸部图像;Sending an image acquisition request to the target electronic device corresponding to the acquired person information, wherein the image acquisition request is used to instruct the target electronic device to search for and return the target face image corresponding to the face image to be processed;
接收目标电子设备返回的目标脸部图像。The target face image returned by the target electronic device is received.
考虑到从本地脸部图像库获取目标脸部图像失败的情况,也即是本地的脸部图像库中并未存储有对应待处理脸部图像的目标脸部图像时,此处提供另外一种获取目标脸部图像的方案。Considering the failure to obtain the target face image from the local face image library, that is, when the target face image corresponding to the face image to be processed is not stored in the local face image library, another method is provided here A scheme for obtaining target face images.
具体的,在完成对脸部图像库的查找,且未在脸部图像库中查找到对应待处理脸部图像的目标脸部图像时,也即是脸部图像库中未存储有对应待处理脸部图像的目标脸部图像时,获取待处理脸部图像对应的人物信息,换言之,即确定该待处理脸部图像是“谁”的脸部图像。Specifically, when the search of the face image library is completed, and the target face image corresponding to the face image to be processed is not found in the face image library, that is, no corresponding target face image to be processed is stored in the face image library. When the face image is the target face image, obtain the person information corresponding to the face image to be processed, in other words, determine the face image of "who" the face image to be processed is.
在获取得到待处理脸部图像对应的人物信息之后,进一步根据本地预存的人物信息和电子设备的关联关系(该关联关系用于描述一电子设备归属于哪一个使用者),确定获取到人物信息所对应目标电子设备。比如,请参照图6,对于图6所示的待处理图像,确定其中的待处理脸部图像为戊脸部图像,此时将获取到戊脸部图像对于的人物信息为“人物戊”,并进一步确定人物戊的手机为目标电子设备。After obtaining the character information corresponding to the face image to be processed, further according to the association between the locally pre-stored character information and the electronic device (the association is used to describe which user an electronic device belongs to), determine the obtained character information The corresponding target electronic device. For example, referring to FIG. 6, for the image to be processed shown in FIG. 6, it is determined that the face image to be processed is the face image of E, and the person information corresponding to the face image of E will be obtained at this time as "person E", And further determine the mobile phone of character E as the target electronic device.
在确定目标电子设备之后,按照预先约定的报文格式生成图像获取请求,并将生成的图像获取请求发送至确定的目标电子设备。其中,图像获取请求用于指示目标电子设备查找其本地是否存在对应待处理脸部图像的目标脸部图像,若查找到,则返回查找到的目标脸部图像。具体的,目标电子设备本地也预先创建有脸部图像库,在接收到图像获取请求时,根据该图像获取请求的指示,在其本地的脸部图像库中进行查找,若查找到对应待处理脸部图像的目标脸部图像,则将查找到的目标脸部图像返回。After the target electronic device is determined, an image acquisition request is generated according to a pre-agreed message format, and the generated image acquisition request is sent to the determined target electronic device. Wherein, the image acquisition request is used to instruct the target electronic device to search whether there is a target facial image corresponding to the facial image to be processed locally, and if found, return the found target facial image. Specifically, the target electronic device also pre-creates a local facial image library. When receiving an image acquisition request, it searches in its local facial image library according to the instruction of the image acquisition request. The target face image of the face image, then return the found target face image.
相应的,在向目标电子设备发送图像获取请求之后,接收目标电子设备返回的目标脸部图像。Correspondingly, after the image acquisition request is sent to the target electronic device, the target face image returned by the target electronic device is received.
比如,请参照图12,一方面,电子设备在获取到待处理图像(图示丙丁戊三人的合影图像)之后,确定待处理图像中的戊脸部图像为待处理脸部图像,通过对本地的脸部图像库进行查找,未查找到对应待处理脸部图像的目标脸部图像,此时确定戊的手机为目标电子设备,并发送图像获取请求至该目标电子设备;另一方面,目标电子设备在接收到来自电子设备的图像获取请求之后,在本地的脸部图像库中进行查找,并查找到对应待处理脸部图像的目标脸部图像,此时将查找到的目标脸部图像返回至电子设备。For example, please refer to FIG. 12. On the one hand, after the electronic device acquires the image to be processed (shown as a group photo image of three persons A, D, E), it determines that the face image of E in the image to be processed is the face image to be processed. The local facial image database is searched, and the target facial image corresponding to the facial image to be processed is not found. At this time, it is determined that E's mobile phone is the target electronic device, and an image acquisition request is sent to the target electronic device; on the other hand, After the target electronic device receives the image acquisition request from the electronic device, it searches in the local face image database, and finds the target face image corresponding to the face image to be processed. The image is returned to the electronic device.
可具体的,在一个可选的实施方式中,在获取到的广角场景图像为一个时,根据广角场景图像所绑定的人脸特征,对广角场景图像进行预设处理,包括:Specifically, in an optional implementation manner, when one wide-angle scene image is acquired, preset processing is performed on the wide-angle scene image according to the facial features bound to the wide-angle scene image, including:
根据广角场景图像所绑定的人脸特征,确定该广角场景图像中不符合预设条件的待处理脸部图像;According to the facial features bound to the wide-angle scene image, determine the face images to be processed that do not meet the preset conditions in the wide-angle scene image;
从本地预设的脸部图像库中、获取对应待处理脸部图像的目标脸部图像;Acquiring a target face image corresponding to the face image to be processed from a locally preset face image library;
将确定的待处理脸部图像替换为获取到的目标脸部图像。The determined facial image to be processed is replaced with the acquired target facial image.
比如,获取到的广角场景图像包括人物丙的脸部图像、人物丁的脸部图像以及人物戊的脸部图像,根据该广角场景图像所绑定的人脸特征,确定丙脸部图像的表情类型为“大笑”,丁脸部图像的表情类型同样为“大笑”,而戊脸部图像的表情类型为“沮丧”,若预设条件为“表情类型为大笑”,则丙脸部图像和丁脸部图像符合预设条件,戊脸部图像不符合预设条件,因此,将戊脸部图像确定为待处理脸部图像。For example, the obtained wide-angle scene image includes the face image of person C, the face image of person D, and the face image of person E, and the expression of person C's face image is determined according to the facial features bound to the wide-angle scene image. The type is "laughing", the expression type of D's facial image is also "laughing", and the expression type of E's facial image is "depressed", if the preset condition is "the expression type is laughing", then the expression type of C's face The face image and the face image D meet the preset condition, and the face image E does not meet the preset condition. Therefore, the face image E is determined as the face image to be processed.
在从广角场景图像中确定出待处理脸部图像之后,可以在本地预设的脸部图像库中查找是否存储有对应待处理脸部图像的目标脸部图像,其中,该目标脸部图像与待处理脸部图像属于相同人物,且目标脸部图像符合预设条件。After the facial image to be processed is determined from the wide-angle scene image, whether a target facial image corresponding to the facial image to be processed can be stored in the locally preset facial image library, wherein the target facial image is the same as The face images to be processed belong to the same person, and the target face image meets the preset condition.
在获取到对应待处理脸部图像的目标脸部图像之后,即可将待处理脸部图像替换为目标脸部图像。由于此时目标脸部图像从脸部图像库中提取出,该目标脸部图像可能从不同的拍摄场景中采集得到,而拍摄场景不同,其光照也不相同,因此,将确定的待处理脸部图像替换为获取到的目标脸部图像,先将待处理脸部图像的光照信息迁移至目标脸部图像,再将待处理脸部图像替换为迁移后的目标脸部图像,由此使得替换后的广角场景图像中、所有脸部图像均符合预设条件,且光照信息一致。After the target face image corresponding to the face image to be processed is acquired, the face image to be processed can be replaced with the target face image. Since the target face image is extracted from the face image library at this time, the target face image may be collected from different shooting scenes, and the lighting of the shooting scenes is different, so the determined face to be processed Replace the internal image with the acquired target face image, first migrate the illumination information of the face image to be processed to the target face image, and then replace the face image to be processed with the migrated target face image, thus making the replacement In the subsequent wide-angle scene image, all face images meet the preset conditions, and the illumination information is consistent.
由上可知,将本申请实施例提供的技术方案应用于远距离的人像拍摄或者多人合影时,可以通过取景范围小但人像占比较大的长焦场景图像提取出待拍摄场景中人物的人脸特征,之后将提取出的人脸特征与取景范围大但人像占比较小的广角场景图像,用于对该广角场景图像进行处理,从而能够克服人脸特征提取难的问题,达到提高图像处理准确度的目的。It can be seen from the above that when the technical solution provided by the embodiment of the present application is applied to long-distance portrait shooting or a group photo of multiple people, the person in the scene to be shot can be extracted from the telephoto scene image with a small viewing range but a large proportion of portraits. Face features, and then the extracted face features and wide-angle scene images with a large viewing area but a small proportion of portraits are used to process the wide-angle scene images, so as to overcome the difficulty of face feature extraction and improve image processing. purpose of accuracy.
下面将在上述实施例描述的方法基础上,对本申请的图像处理方法做进一步介绍。请参照图13,该图像处理方法可以包括:The image processing method of the present application will be further introduced below on the basis of the methods described in the above embodiments. Please refer to Figure 13, the image processing method may include:
在步骤201中,获取同一场景的多个图像组,各图像组中包括采集时刻相同的长焦场景图像和广角场景图像。In step 201, multiple image groups of the same scene are acquired, and each image group includes a telephoto scene image and a wide-angle scene image at the same acquisition time.
请参照图2,在本申请实施例中,电子设备包括长焦摄像头和广角摄像头,如图2所示的一种设置方式中,长焦摄像头和广角摄像头水平并列设置于电子设备的同一平面,且长焦摄像头和广角摄像头之间具有一定的距离。此外,电子设备配置有长焦图像缓存队列和广角图像缓存队列,其中长焦图像缓存队列用于缓存长焦摄像头采集到的图像,广角图像缓存队列用于缓存广角摄像头采集到的图像。需要说明的是,在具体实施时,长焦摄像头和广角摄像头的设置方式可由本领域技术人员根据实际需要进行设置。Please refer to FIG. 2. In the embodiment of the present application, the electronic device includes a telephoto camera and a wide-angle camera. In one arrangement shown in FIG. 2, the telephoto camera and the wide-angle camera are horizontally arranged on the same plane of the electronic device. And there is a certain distance between the telephoto camera and the wide-angle camera. In addition, the electronic device is configured with a telephoto image buffer queue and a wide-angle image buffer queue, wherein the telephoto image buffer queue is used for buffering images collected by the telephoto camera, and the wide-angle image buffer queue is used for buffering images collected by the wide-angle camera. It should be noted that during specific implementation, the arrangement of the telephoto camera and the wide-angle camera can be set by those skilled in the art according to actual needs.
本申请实施例中,电子设备在启动拍照类应用之后,将同步启动长焦摄像头和广角摄像头,且控制长焦摄像头和广角摄像头按照相同的帧率同步采集待拍摄场景的图像,分别得到待拍摄场景的长焦场景图像和广角场景图像。其中,长焦摄像头将采集到的长焦场景图像存入长焦图像缓存队列中,广角摄像头将采集到的广角场景图像存入广角图像缓存队列中。In the embodiment of the present application, after the electronic device starts the camera application, it will start the telephoto camera and the wide-angle camera synchronously, and control the telephoto camera and the wide-angle camera to synchronously collect the images of the scenes to be shot at the same frame rate, and obtain the images to be shot respectively. A telephoto scene image and a wide-angle scene image of the scene. Wherein, the telephoto camera stores the collected telephoto scene image into the telephoto image buffer queue, and the wide-angle camera stores the collected wide-angle scene image into the wide-angle image buffer queue.
比如,请参照图3,在图3所示待拍摄场景中,包括人物丙、人物丁和人物戊3个不同的人物,在某采集时刻,电子设备通过长焦摄像头采集到该待拍摄场景的长焦场景图像,通过广角摄像头采集到该待拍摄场景的广角场景图像,显而易见的,长焦场景图像中的人像相对于广角场景图像中的人像更大,更易于辨识。For example, please refer to FIG. 3. In the scene to be shot shown in FIG. 3, there are three different characters including character C, character D, and character E. For the telephoto scene image, the wide-angle scene image of the scene to be shot is collected by the wide-angle camera. Obviously, the portrait in the telephoto scene image is larger and easier to identify than the portrait in the wide-angle scene image.
具体的,电子设备在接收到触发的图像拍摄请求时,首先获取长焦摄像头/广角摄像头的帧率信息,其中,帧率信息用于描述长焦摄像头/广角摄像头在单位时间内采集到场景图像的个数,比如,在获取到的帧率信息为30fps时,说明长焦摄像头每秒采集待拍摄场景的30个长焦场景图像,广角摄像头每秒采集待拍摄场景的30个广角场景图像;又比如,在获取到的帧率信息为15fps时,说明长焦摄像头每秒采集待拍摄场景的15个长焦场景图像,广角摄像头每秒采集待拍摄场景的15个广角场景图像。Specifically, when the electronic device receives the triggered image capture request, it first obtains the frame rate information of the telephoto camera/wide-angle camera, where the frame rate information is used to describe the scene image captured by the telephoto camera/wide-angle camera within a unit time For example, when the obtained frame rate information is 30fps, it means that the telephoto camera collects 30 telephoto scene images of the scene to be shot per second, and the wide-angle camera collects 30 wide-angle scene images of the scene to be shot per second; For another example, when the obtained frame rate information is 15fps, it means that the telephoto camera collects 15 telephoto scene images of the scene to be shot per second, and the wide-angle camera collects 15 wide-angle scene images of the scene to be shot per second.
其中,影响长焦摄像头/广角摄像头帧率信息的主要原因是环境光亮度,当环境光亮度较高(或者说电子设备处于亮光环境)时,长焦摄像头/广角摄像头可以在较短的时间内(如30ms)完成曝光,从而使得其能够以较高的帧率采集场景图像;而当环境光亮度较低(或者说电子设备处于暗光环境)时,长焦摄像头/广角摄像头需要花费较长的时间(如40ms-60ms,或更多)来完成曝光,从而使得其仅能以较低的帧率采集场景图像。Among them, the main reason affecting the frame rate information of the telephoto camera/wide-angle camera is the brightness of the ambient light. When the brightness of the ambient light is high (or the electronic device is in a bright light environment), the telephoto camera/wide-angle camera can display in a short period of time. (such as 30ms) to complete the exposure, so that it can capture scene images at a higher frame rate; and when the ambient light brightness is low (or the electronic device is in a dark environment), the telephoto camera/wide-angle camera takes a long time The time (such as 40ms-60ms, or more) to complete the exposure, so that it can only capture scene images at a lower frame rate.
之后,根据长焦摄像头/广角摄像头的帧率信息,确定对应该帧率信息的目标个数,其中,目标个数和帧率信息可以成正比关系,比如,在长焦摄像头/广角摄像头的帧率信息为30fps,可以确定目标个数为8,在长焦摄像头/广角摄像头的帧率信息为15fps时,可以确定目标个数为6。Afterwards, according to the frame rate information of the telephoto camera/wide-angle camera, determine the number of targets corresponding to the frame rate information, wherein the number of targets and the frame rate information can be proportional to each other, for example, in the frame rate of the telephoto camera/wide-angle camera If the rate information is 30fps, the number of targets can be determined to be 8. When the frame rate information of the telephoto camera/wide-angle camera is 15 fps, the number of targets can be determined to be 6.
在确定目标个数之后,从长焦图像缓存队列和广角图像缓存队列中提取出数量为目标个数的长焦场景图像和广角场景图像,其中,采集时刻相同(或者说同步采集)的长焦场景图像和广角场景图像构成一个图像组,共得到目标个数的图像组。After determining the target number, extract the telephoto scene images and wide-angle scene images whose number is the target number from the telephoto image cache queue and the wide-angle image cache queue, wherein the telephoto scene images with the same collection time (or synchronous collection) The scene image and the wide-angle scene image constitute an image group, and a target number of image groups is obtained in total.
比如,在确定目标个数为“4”时,从长焦图像缓存队列中提取出采集时刻分别为t1、t2、t3以及t4的4个长焦场景图像,从广角图像缓存队列中提取出采集时刻分别为t1、t2、t3以及t4的4个广角场景图像,这样将得到4个图像组,分别对应采集时刻t1、t2、t3以及t4。For example, when the number of targets is determined to be "4", four telephoto scene images with acquisition times t1, t2, t3 and t4 are extracted from the telephoto image buffer queue, and the acquisition time is extracted from the wide-angle image buffer queue. The four wide-angle scene images at time t1, t2, t3 and t4 respectively will obtain 4 image groups corresponding to the acquisition time t1, t2, t3 and t4 respectively.
在步骤202中,获取各图像组中长焦场景图像的人脸特征,并将获取到的各长焦场景图像的人脸特征、与其组内的广角场景图像绑定。In step 202, the face features of the telephoto scene images in each image group are acquired, and the acquired face features of each telephoto scene image are bound to the wide-angle scene images in the group.
其中,人脸特征用于描述长焦场景图像所包含的脸部图像,包括但不限于脸部大小、眼睛开合度以及表情类型(如生气、厌恶、恐惧、高兴、悲伤和吃惊等)等。Among them, the face feature is used to describe the facial image contained in the telephoto scene image, including but not limited to face size, eye opening and closing degree, and expression type (such as anger, disgust, fear, happiness, sadness and surprise, etc.).
需要说明的是,对于采用何种人脸识别技术对长焦场景图像进行人脸识别本申请实施例对此不做具体限制,本领域技术人员可根据实际需要选择合适的人脸识别技术。It should be noted that the embodiment of the present application does not specifically limit which face recognition technology is used to perform face recognition on the telephoto scene image, and those skilled in the art can select an appropriate face recognition technology according to actual needs.
比如,请参照图5,获取到采集时刻分别为t1、t2、t3以及t4的4个图像组,之后,从采集时刻为t1的长焦场景图像中识别出人脸特征1,并将识别出的该人脸特征1与采集时刻同为t1的广角场景图像绑定,从采集时刻为t2的长焦场景图像中识别出人脸特征2,并将识别出的该人脸特征2与采集时刻同为t2的广角场景图像绑定,从采集时刻为t3的长焦场景图像中识别出人脸特征3,并将识别出的该人脸特征3与采集时刻同为t3的广角场景图像绑定,从采集时刻为t4的长焦场景图像中识别出人脸特征4,并将识别出的该人脸特征4与采集时刻同为t4的广角场景图像绑定。For example, please refer to Fig. 5, four image groups with acquisition time t1, t2, t3 and t4 are acquired respectively, after that, face feature 1 is recognized from the telephoto scene image at acquisition time t1, and the identified The face feature 1 is bound to the wide-angle scene image at the same collection time t1, and the face feature 2 is recognized from the telephoto scene image at the collection time t2, and the recognized face feature 2 is combined with the collection time Bind the wide-angle scene image at t2, identify the face feature 3 from the telephoto scene image at the collection time t3, and bind the recognized face feature 3 with the wide-angle scene image at the same collection time t3 , recognize the face feature 4 from the telephoto scene image at the collection time t4, and bind the recognized face feature 4 with the wide-angle scene image at the same collection time t4.
在步骤203中,根据各广角场景图像所绑定的人脸特征,确定各广角场景图像中包含的、符合预设条件的匹配脸部图像的个数。In step 203, according to the facial features bound to each wide-angle scene image, the number of matching face images that meet the preset conditions contained in each wide-angle scene image is determined.
在步骤204中,将包含匹配脸部图像个数最多的广角场景图像作为待处理图像。In step 204, the wide-angle scene image containing the largest number of matching facial images is taken as the image to be processed.
其中,预设条件可根据实际拍摄需求进行设置,比如,在进行多人合影时,若需要拍摄大家都吃惊的表情,则可将预设条件配置为“表情类型为吃惊”;又比如,在进行多人合影时,若需要拍摄大家睁眼并微笑的表情,则可将预设脸部特征配置为“表情类型为微笑,且睁眼”。Among them, the preset condition can be set according to the actual shooting needs. For example, when taking a group photo with multiple people, if you need to shoot everyone’s surprised expression, you can configure the preset condition as “surprised expression type”; When taking a group photo with multiple people, if you need to capture the expressions of everyone opening their eyes and smiling, you can configure the preset facial features as "the expression type is smiling and eyes open".
比如,请参照图6,共获取到4个广角场景图像,分别为:广角场景图像A、广角场景图像B、广角场景图像C以及广角场景图像D,这4个广角场景图像所对应的待拍摄场景中包括丙丁戊3个不同的人物,且预设条件被配置为“表情为大笑”,根据这4个广角场景图像各自绑定的人脸特征,确定广角场景图像A中包括一个匹配脸部图像(即丙的脸部图像),确定广角场景图像B中不存在匹配脸部图像,确定广角场景图像C中包括两个匹配脸部图像(即丙的脸部图像和丁的脸部图像),确定广角场景图像D中包括一个匹配脸部图像(即戊的脸部图像),显然的,广角场景图像C包含的匹配脸部图像的个数最多,因此将广角场景图像C作为待处理图像。For example, referring to FIG. 6, four wide-angle scene images are obtained in total, namely: wide-angle scene image A, wide-angle scene image B, wide-angle scene image C, and wide-angle scene image D. The scene includes 3 different characters, Bing Ding Wu, and the preset condition is configured as "the expression is laughing". According to the facial features bound to each of the 4 wide-angle scene images, it is determined that the wide-angle scene image A contains a matching face It is determined that there is no matching facial image in the wide-angle scene image B, and it is determined that the wide-angle scene image C includes two matching facial images (that is, the facial image of C and the facial image of D ), it is determined that a matching facial image (i.e., the facial image of E) is included in the wide-angle scene image D, obviously, the number of matching facial images contained in the wide-angle scene image C is the largest, so the wide-angle scene image C is used as the pending processing image.
在步骤205中,确定待处理图像中不符合预设条件的待处理脸部图像。In step 205, among the images to be processed, the face images to be processed that do not meet the preset conditions are determined.
其中,在从获取到的多个广角场景图像中确定出待处理图像之后,进一步从待处理图像中确定出待处理脸部图像,其中,该待处理脸部图像的不符合预设条件。Wherein, after the image to be processed is determined from the acquired multiple wide-angle scene images, the face image to be processed is further determined from the images to be processed, wherein the face image to be processed does not meet the preset condition.
比如,请参照图7,确定出的待处理图像包括人物丙的脸部图像、人物丁的脸部图像以及人物戊的脸部图像,如图7所示,根据待处理图像所绑定的人脸特征,确定丙脸部图像的表情类型为“大笑”,丁脸部图像的表情类型同样为“大笑”,而戊脸部图像的表情类型为“沮丧”,若预设条件为“表情类型为大笑”,则丙脸部图像和丁脸部图像符合预设条件,戊脸部图像不符合预设条件,因此,将戊脸部图像确定为待处理脸部图像。For example, referring to FIG. 7, the determined image to be processed includes the face image of person C, the face image of person D, and the face image of person E. As shown in FIG. 7, according to the person bound to the image to be processed Face features, determine that the expression type of C’s face image is “big laugh”, the expression type of D’s face image is also “big smile”, and the expression type of E’s face image is “depressed”, if the preset condition is “ If the facial expression type is "laughing", then the facial images of C and D meet the preset conditions, and the facial image of E does not meet the preset conditions. Therefore, the facial image of E is determined as the facial image to be processed.
在步骤206中,从除待处理图像之外的其它广角场景图像中,获取对应待处理脸部图像的目标脸部图像,该目标脸部图像符合预设条件,且与待处理脸部图像属于相同人物。In step 206, from other wide-angle scene images except the image to be processed, a target face image corresponding to the face image to be processed is obtained, the target face image meets the preset conditions, and belongs to the face image to be processed. same person.
在确定出待处理图像之中的待处理脸部图像,进一步从除待处理图像之外的其它广角场景图像中,获取对应待处理脸部图像的目标脸部图像,其中,该目标脸部图像与待处理脸部图像属于相同人物,且该目标脸部图像符合预设条件。比如,请参照图8和图6,对于图6所示的四个广角场景图像中,广角场景图像C被确定为待处理图像,其中戊脸部图像的表情类型为“沮丧”,与预设条件“表情类型为大笑”不符,被进一步确定为待处理脸部图像。之后,在除待处理图像(此处为场景图像C)之外的其它广角场景图像(此处为场景图像A、场景图像B以及场景图像D)中,查找是否存在表情类型为“大笑”的戊脸部图像(即人物戊的脸部图像),显然的,如图6所示,广角场景图像D中存在表情类型为“大笑”的戊脸部图像,此时,将广角场景图像D中的戊脸部图像确定为目标脸部图像,并从广角场景图像D中提取出戊脸部图像,用作后续处理。After determining the facial image to be processed among the images to be processed, further obtain a target facial image corresponding to the facial image to be processed from other wide-angle scene images except the image to be processed, wherein the target facial image It belongs to the same person as the face image to be processed, and the target face image meets the preset condition. For example, referring to Fig. 8 and Fig. 6, among the four wide-angle scene images shown in Fig. 6, the wide-angle scene image C is determined as the image to be processed, and the expression type of the E face image is "depressed", which is the same as the preset The condition "the expression type is laughing" does not match, and it is further determined to be a face image to be processed. Afterwards, in other wide-angle scene images (here, scene image A, scene image B, and scene image D) except the image to be processed (here, scene image C), find whether there is an expression type that is "laughing" E’s face image (that is, the face image of character E), obviously, as shown in Figure 6, there is an E’s face image whose expression type is "big laugh" in the wide-angle scene image D, at this time, the wide-angle scene image The face image of E in D is determined as the target face image, and the face image of E is extracted from the wide-angle scene image D for subsequent processing.
在步骤207中,将待处理脸部图像替换为目标脸部图像。In step 207, the face image to be processed is replaced with the target face image.
在获取到对应待处理脸部图像的目标脸部图像之后,即可将待处理脸部图像替换为目标脸部图像。比如,请结合参照图9和图6,在获取到图6所示的四个广角场景图像(即广角场景图像A、广角场景图像B、广角场景图像C以及广角场景图像D)之后,将广角场景图像C确定为待处理图像,并进一步将广角场景图像C中的戊脸部图像(即人物戊的脸部图像)确定为待处理脸部图像;之后,将广角场景图像D中的戊脸部图像确定为目标脸部图像;之后,将广角场景图像C中的戊脸部图像替换为广角场景图像D中的戊脸部图像,从而得到替换处理后的广角场景图像C,如图9所示,替换后的广角场景图像C中,各人物脸部图像的表情类型均为“大笑”,均符合预设条件“表情类型为大笑”。After the target face image corresponding to the face image to be processed is acquired, the face image to be processed can be replaced with the target face image. For example, please refer to FIG. 9 and FIG. 6 in combination. After obtaining four wide-angle scene images (i.e. wide-angle scene image A, wide-angle scene image B, wide-angle scene image C and wide-angle scene image D) shown in FIG. Scene image C is determined as the image to be processed, and further the face image of E in the wide-angle scene image C (i.e. the face image of person E) is determined as the face image to be processed; after that, the face of E in the wide-angle scene image D The internal image is determined as the target facial image; afterward, the E facial image in the wide-angle scene image C is replaced with the E facial image in the wide-angle scene image D, thereby obtaining the replaced wide-angle scene image C, as shown in Figure 9 It is shown that in the replaced wide-angle scene image C, the expression types of the facial images of each person are "laughing", which all meet the preset condition "the expression type is laughing".
本申请实施例中,在完成图像替换之后,即可将替换后的待处理图像作为图像拍摄请求的结果图像。In the embodiment of the present application, after the image replacement is completed, the replaced image to be processed can be used as the result image of the image capture request.
在一实施例中,还提供了一种图像处理装置400,请参阅图14,图14为本申请实施例提供的图像处理装置400的结构示意图。其中该图像处理装置400应用于电子设备,该图像处理装置400包括图像获取模块401、图像识别模块402、特征绑定模块403以及图像处理模块404,如下:In an embodiment, an image processing device 400 is also provided, please refer to FIG. 14 , which is a schematic structural diagram of the image processing device 400 provided in an embodiment of the present application. Wherein the image processing device 400 is applied to electronic equipment, the image processing device 400 includes an image acquisition module 401, an image recognition module 402, a feature binding module 403 and an image processing module 404, as follows:
图像获取模块401,用于获取同步采集的、同一场景的长焦场景图像以及广角场景图像;An image acquisition module 401, configured to acquire synchronously acquired telephoto scene images and wide-angle scene images of the same scene;
图像识别模块402,用于对获取到的长焦场景图像进行人脸识别,得到长焦场景图像的人脸特征;The image recognition module 402 is configured to perform face recognition on the acquired telephoto scene image to obtain the face features of the telephoto scene image;
特征绑定模块403,用于将长焦场景图像的人脸特征与广角场景图像绑定;The feature binding module 403 is used to bind the face feature of the telephoto scene image with the wide-angle scene image;
图像处理模块404,用于根据广角场景图像所绑定的人脸特征,对广角场景图像进行预设处理。The image processing module 404 is configured to perform preset processing on the wide-angle scene image according to the facial features bound to the wide-angle scene image.
在一实施例中,在图像获取模块401获取到的广角场景图像为多个时,图像处理模块404,具体用于:In an embodiment, when there are multiple wide-angle scene images acquired by the image acquisition module 401, the image processing module 404 is specifically used to:
根据各广角场景图像所绑定的人脸特征,确定各广角场景图像中包含的、符合预设条件的匹配脸部图像的个数;According to the facial features bound to each wide-angle scene image, determine the number of matching face images that meet the preset conditions contained in each wide-angle scene image;
将包含匹配脸部图像个数最多的广角场景图像作为待处理图像;The wide-angle scene image containing the largest number of matching face images is used as the image to be processed;
根据待处理图像所绑定的人脸特征,对待处理图像进行预设处理。Preset processing is performed on the image to be processed according to the facial features bound to the image to be processed.
在一实施例中,图像处理模块404,还具体用于:In an embodiment, the image processing module 404 is also specifically used for:
根据待处理图像所绑定的人脸特征,确定待处理图像中不符合预设条件的待处理脸部图像;According to the facial features bound to the images to be processed, determine the facial images to be processed that do not meet the preset conditions in the images to be processed;
从除待处理图像之外的其它广角场景图像中,获取对应待处理脸部图像的目标脸部图像,该目标脸部图像符合预设条件,且与待处理脸部图像属于相同人物;Obtaining a target face image corresponding to the face image to be processed from other wide-angle scene images other than the image to be processed, the target face image meets a preset condition, and belongs to the same person as the face image to be processed;
将待处理脸部图像替换为目标脸部图像。Replace the pending face image with the target face image.
在一实施例中,图像处理装置400还包括降噪处理模块,用于:In one embodiment, the image processing device 400 also includes a noise reduction processing module for:
根据除待处理图像之外的其它广角场景图像对替换后的待处理图像进行降噪处理。Noise reduction processing is performed on the replaced image to be processed according to other wide-angle scene images except the image to be processed.
在一实施例中,图像处理模块404,还用于:In an embodiment, the image processing module 404 is also used for:
在从除待处理图像之外的其它广角场景图像中获取目标脸部图像失败时,判断本地预设的脸部图像库中是否存储有目标脸部图像;When failing to obtain the target facial image from other wide-angle scene images except the image to be processed, it is determined whether the target facial image is stored in the locally preset facial image library;
在脸部图像库中存储有目标脸部图像时,提取脸部图像库中存储的目标脸部图像。When the target facial image is stored in the facial image library, the target facial image stored in the facial image library is extracted.
在一实施例中,图像处理模块404,具体用于:In one embodiment, the image processing module 404 is specifically used for:
获取待处理脸部图像的光照信息;Obtain the illumination information of the face image to be processed;
将获取到的光照信息迁移至目标脸部图像;Migrate the obtained lighting information to the target face image;
将待处理脸部图像替换为迁移后的目标脸部图像。Replace the pending face image with the migrated target face image.
在一实施例中,图像处理模块404,还用于:In an embodiment, the image processing module 404 is also used for:
在脸部图像库中未存储有目标脸部图像时,获取待处理脸部图像对应的人物信息;When the target face image is not stored in the face image library, obtain the person information corresponding to the face image to be processed;
发送图像获取请求至该人物信息对应的目标电子设备,该图像获取请求用于指示目标电子设备查找并返回目标脸部图像;Send an image acquisition request to the target electronic device corresponding to the person information, the image acquisition request is used to instruct the target electronic device to search for and return the target face image;
接收目标电子设备返回的目标脸部图像。The target face image returned by the target electronic device is received.
具体实施时,以上各个模块可以作为独立的实体实现,也可以进行任意组合,作为同一或若干个实体来实现,以上各个单位的具体实施可参见前面的实施例,在此不再赘述。During specific implementation, each of the above modules can be implemented as an independent entity, or can be combined arbitrarily as the same or several entities. The specific implementation of each of the above units can refer to the previous embodiments, and will not be repeated here.
由上可知,本实施例图像处理装置可以由图像获取模块401获取同步采集的、同一场景的长焦场景图像以及广角场景图像;由图像识别模块402对获取到的长焦场景图像进行人脸识别,得到长焦场景图像的人脸特征;由特征绑定模块403将长焦场景图像的人脸特征与广角场景图像绑定;由图像处理模块404根据广角场景图像所绑定的人脸特征,对广角场景图像进行预设处理。将本申请实施例提供的技术方案应用于远距离的人像拍摄或者多人合影时,可以通过取景范围小但人像占比较大的长焦场景图像提取出待拍摄场景中人物的人脸特征,之后将提取出的人脸特征与取景范围大但人像占比较小的广角场景图像,用于对该广角场景图像进行处理,从而能够克服人脸特征提取难的问题,达到提高图像处理准确度的目的。As can be seen from the above, the image processing device of this embodiment can use the image acquisition module 401 to acquire synchronously acquired telephoto scene images and wide-angle scene images of the same scene; the image recognition module 402 can perform face recognition on the acquired telephoto scene images , obtain the face feature of the telephoto scene image; bind the face feature of the telephoto scene image with the wide-angle scene image by the feature binding module 403; bind the face feature of the wide-angle scene image by the image processing module 404, Preset processing for wide-angle scene images. When the technical solution provided by the embodiment of the present application is applied to long-distance portrait shooting or a group photo of multiple people, the facial features of the people in the scene to be shot can be extracted from the telephoto scene image with a small viewing range but a large proportion of portraits, and then The extracted face features and wide-angle scene images with a large viewing range but a small proportion of portraits are used to process the wide-angle scene images, so as to overcome the difficulty of face feature extraction and achieve the purpose of improving the accuracy of image processing .
本申请实施例还提供一种电子设备。请参阅图15,电子设备500包括中央处理器501以及存储器502。其中,中央处理器501与存储器502电性连接。The embodiment of the present application also provides an electronic device. Referring to FIG. 15 , an electronic device 500 includes a central processing unit 501 and a memory 502 . Wherein, the CPU 501 is electrically connected to the memory 502 .
所述中央处理器500是电子设备500的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或加载存储在存储器502内的计算机程序,以及调用存储在存储器502内的数据,执行电子设备500的各种功能并处理数据,从而实现对用户性别的准确识别。The central processing unit 500 is the control center of the electronic device 500, using various interfaces and lines to connect various parts of the entire electronic device, by running or loading computer programs stored in the memory 502, and calling data stored in the memory 502 , executing various functions of the electronic device 500 and processing data, thereby realizing accurate identification of the user's gender.
所述存储器502可用于存储软件程序以及模块,中央处理器501通过运行存储在存储器502的计算机程序以及模块,从而执行各种功能应用以及数据处理。存储器502可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的计算机程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据电子设备的使用所创建的数据等。此外,存储器502可以包括高速随机存取存储器,还可以包括非易失性存储器,比如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器502还可以包括存储器控制器,以提供中央处理器501对存储器502的访问。The memory 502 can be used to store software programs and modules, and the central processing unit 501 executes various functional applications and data processing by running the computer programs and modules stored in the memory 502 . Memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store operating systems, computer programs required by at least one function (such as sound playback function, image playback function, etc.); Data created by the use of electronic devices, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage devices. Correspondingly, the memory 502 may also include a memory controller to provide the central processing unit 501 with access to the memory 502 .
在本申请实施例中,电子设备500中的中央处理器501通过运行存储在存储器502中的计算机程序,执行上述任一实施例中的图像处理方法,比如:获取同步采集的、同一场景的长焦场景图像以及广角场景图像;对获取到的长焦场景图像进行人脸识别,得到长焦场景图像的人脸特征;将得到的长焦场景图像的人脸特征与广角场景图像绑定;根据角场景图像所绑定的人脸特征,对广角场景图像进行预设处理。In this embodiment of the present application, the central processing unit 501 in the electronic device 500 executes the image processing method in any of the above-mentioned embodiments by running the computer program stored in the memory 502, for example: acquiring synchronously acquired long-term images of the same scene focus scene image and wide-angle scene image; perform face recognition on the obtained telephoto scene image to obtain the face features of the telephoto scene image; bind the obtained face features of the telephoto scene image with the wide-angle scene image; The face features bound to the corner scene images are preset to the wide-angle scene images.
请一并参阅图16,在某些实施方式中,电子设备500还可以包括:显示器503、射频电路504、音频电路505、电源506、图像处理电路507以及图形处理器508。其中,显示器503、射频电路504、音频电路505以及电源506分别与中央处理器501电性连接。Please also refer to FIG. 16 , in some embodiments, the electronic device 500 may further include: a display 503 , a radio frequency circuit 504 , an audio circuit 505 , a power supply 506 , an image processing circuit 507 and a graphics processor 508 . Wherein, the display 503 , the radio frequency circuit 504 , the audio circuit 505 and the power supply 506 are respectively electrically connected to the central processing unit 501 .
显示器503可以用于显示由用户输入的信息或提供给用户的信息以及各种图形用户接口,这些图形用户接口可以由图形、文本、图标、视频和其任意组合来构成。显示器503可以包括显示面板,在某些实施方式中,可以采用液晶显示器(Liquid Crystal Display,LCD)、或者有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板。The display 503 can be used to display information input by or provided to the user and various graphical user interfaces, and these graphical user interfaces can be composed of graphics, text, icons, videos and any combination thereof. The display 503 may include a display panel. In some implementation manners, the display panel may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD) or an organic light-emitting diode (Organic Light-Emitting Diode, OLED).
射频电路504可以用于收发射频信号,以通过无线通信与网络设备或其他电子设备建立无线通讯,与网络设备或其他电子设备之间收发信号。The radio frequency circuit 504 can be used to send and receive radio frequency signals to establish wireless communication with network equipment or other electronic equipment through wireless communication, and to send and receive signals with network equipment or other electronic equipment.
音频电路505可以用于通过扬声器、传声器提供用户与电子设备之间的音频接口。The audio circuit 505 can be used to provide an audio interface between the user and the electronic device through a speaker or a microphone.
电源506可以用于给电子设备500的各个部件供电。在一些实施例中,电源506可以通过电源管理系统与中央处理器501逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。The power supply 506 may be used to power various components of the electronic device 500 . In some embodiments, the power supply 506 can be logically connected to the central processing unit 501 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption through the power management system.
图像处理电路507可以利用硬件和/或软件组件实现,可包括定义ISP(ImageSignal Processing,图像信号处理)管线的各种处理单元,请参照图17,在一实施例中,图像处理电路507包括ISP处理器5071和控制逻辑器5072。摄像头5073捕捉的图像数据首先由ISP处理器5071处理,ISP处理器5071对图像数据进行分析以捕捉可用于确定和/或摄像头5073的一个或多个控制参数的图像统计信息。摄像头5073可包括具有一个或多个透镜50731和图像传感器50732的照相机。图像传感器50732可包括色彩滤镜阵列(如Bayer滤镜),图像传感器50732可获取用图像传感器50732的每个成像像素捕捉的光强度和波长信息,并提供可由ISP处理器5071处理的一组原始图像数据。传感器5074(如陀螺仪)可基于传感器5074接口类型把采集的图像处理的参数(如防抖参数)提供给ISP处理器5071。传感器5074接口可以利用SMIA(Standard Mobile Imaging Architecture,标准移动成像架构)接口、其它串行或并行照相机接口或上述接口的组合。The image processing circuit 507 can be implemented using hardware and/or software components, and can include various processing units defining an ISP (ImageSignal Processing, image signal processing) pipeline. Please refer to FIG. 17 . In one embodiment, the image processing circuit 507 includes an ISP Processor 5071 and control logic 5072. Image data captured by camera 5073 is first processed by ISP processor 5071 which analyzes the image data to capture image statistics that can be used to determine and/or control one or more parameters of camera 5073. The camera 5073 may include a camera having one or more lenses 50731 and an image sensor 50732 . The image sensor 50732 may include a color filter array (such as a Bayer filter), and the image sensor 50732 may acquire light intensity and wavelength information captured by each imaging pixel of the image sensor 50732 and provide a set of raw images that may be processed by the ISP processor 5071. image data. The sensor 5074 (such as a gyroscope) may provide the collected image processing parameters (such as anti-shake parameters) to the ISP processor 5071 based on the interface type of the sensor 5074 . The interface of the sensor 5074 may utilize a SMIA (Standard Mobile Imaging Architecture, Standard Mobile Imaging Architecture) interface, other serial or parallel camera interfaces, or a combination of the above interfaces.
此外,图像传感器50732也可将原始图像数据发送给传感器5074,传感器5074可基于传感器5074接口类型把原始图像数据提供给ISP处理器5071,或者传感器5074将原始图像数据存储到图像存储器5075中。In addition, the image sensor 50732 may also send raw image data to the sensor 5074, the sensor 5074 may provide the raw image data to the ISP processor 5071 based on the sensor 5074 interface type, or the sensor 5074 may store the raw image data in the image memory 5075.
ISP处理器5071按多种格式逐个像素地处理原始图像数据。比如,每个图像像素可具有8、10、12或14比特的位深度,ISP处理器5071可对原始图像数据进行一个或多个图像处理操作、收集关于图像数据的统计信息。其中,图像处理操作可按相同或不同的位深度精度进行。The ISP processor 5071 processes raw image data pixel by pixel in various formats. For example, each image pixel may have a bit depth of 8, 10, 12, or 14 bits, and the ISP processor 5071 may perform one or more image processing operations on the raw image data and collect statistical information about the image data. Among other things, image processing operations can be performed with the same or different bit depth precision.
ISP处理器5071还可从图像存储器5075接收图像数据。比如,传感器5074接口将原始图像数据发送给图像存储器5075,图像存储器5075中的原始图像数据再提供给ISP处理器5071以供处理。图像存储器5075可为存储器装置的一部分、存储设备、或电子设备内的独立的专用存储器,并可包括DMA(Direct Memory Access,直接直接存储器存取)特征。The ISP processor 5071 can also receive image data from the image memory 5075 . For example, the sensor 5074 interface sends the original image data to the image memory 5075, and the original image data in the image memory 5075 is provided to the ISP processor 5071 for processing. The image memory 5075 may be a part of a memory device, a storage device, or an independent dedicated memory in an electronic device, and may include a DMA (Direct Memory Access, Direct Memory Access) feature.
当接收到来自图像传感器50732接口或来自传感器5074接口或来自图像存储器5075的原始图像数据时,ISP处理器5071可进行一个或多个图像处理操作,如时域滤波。处理后的图像数据可发送给图像存储器5075,以便在被显示之前进行另外的处理。ISP处理器5071从图像存储器5075接收处理数据,并对所述处理数据进行原始域中以及RGB和YCbCr颜色空间中的图像数据处理。ISP处理器5071处理后的图像数据可输出给显示器503,以供用户观看和/或由图形引擎或图像处理器507进一步处理。此外,ISP处理器5071的输出还可发送给图像存储器5075,且显示器503可从图像存储器5075读取图像数据。在一个实施例中,图像存储器5075可被配置为实现一个或多个帧缓冲器。此外,ISP处理器5071的输出可发送给编码器/解码器5076,以便编码/解码图像数据。编码的图像数据可被保存,并在显示于显示器503设备上之前解压缩。编码器/解码器5076可由CPU或GPU或协处理器实现。When receiving raw image data from the image sensor 50732 interface or from the sensor 5074 interface or from the image memory 5075, the ISP processor 5071 may perform one or more image processing operations, such as temporal filtering. Processed image data may be sent to image memory 5075 for additional processing before being displayed. The ISP processor 5071 receives processed data from the image memory 5075, and performs image data processing in the original domain and in RGB and YCbCr color spaces on the processed data. The image data processed by the ISP processor 5071 may be output to the display 503 for viewing by the user and/or further processed by the graphics engine or image processor 507 . In addition, the output of the ISP processor 5071 can also be sent to the image memory 5075 , and the display 503 can read image data from the image memory 5075 . In one embodiment, image memory 5075 may be configured to implement one or more frame buffers. In addition, the output of the ISP processor 5071 may be sent to an encoder/decoder 5076 in order to encode/decode image data. The encoded image data may be saved and decompressed before being displayed on the display 503 device. Encoder/decoder 5076 can be implemented by CPU or GPU or coprocessor.
ISP处理器5071确定的统计数据可发送给控制逻辑器5072单元。比如,统计数据可包括自动曝光、自动白平衡、自动聚焦、闪烁检测、黑电平补偿、透镜50731阴影校正等图像传感器50732统计信息。控制逻辑器5072可包括执行一个或多个例程(如固件)的处理器和/或微控制器,一个或多个例程可根据接收的统计数据,确定摄像头5073的控制参数及ISP处理器5071的控制参数。比如,摄像头5073的控制参数可包括传感器5074控制参数(比如增益、曝光控制的积分时间、防抖参数等)、照相机闪光控制参数、透镜50731控制参数(比如聚焦或变焦用焦距)、或这些参数的组合。ISP控制参数可包括用于自动白平衡和颜色调整(比如,在RGB处理期间)的增益水平和色彩校正矩阵,以及透镜50731阴影校正参数等。Statistics determined by the ISP processor 5071 may be sent to the control logic 5072 unit. For example, statistical data may include image sensor 50732 statistical information such as automatic exposure, automatic white balance, automatic focus, flicker detection, black level compensation, lens 50731 shading correction, etc. The control logic 5072 can include a processor and/or a microcontroller that executes one or more routines (e.g., firmware) that can determine control parameters for the camera 5073 and the ISP processor based on statistics received. 5071 control parameters. For example, the control parameters of the camera 5073 may include sensor 5074 control parameters (such as gain, integration time of exposure control, anti-shake parameters, etc.), camera flash control parameters, lens 50731 control parameters (such as focal length for focusing or zooming), or these parameters The combination. ISP control parameters may include gain levels and color correction matrices for automatic white balance and color adjustment (eg, during RGB processing), and lens 50731 shading correction parameters, among others.
图像处理器508对电子设备需要进行显示的显示数据进行转换驱动,并向显示器503提供行扫描信号,控制显示器503的正确显示。The image processor 508 converts and drives the display data that the electronic device needs to display, and provides a row scan signal to the display 503 to control the correct display of the display 503 .
进一步地,在上述实施例描述的图像处理电路507的基础上,对该图像处理电路507做进一步介绍,请参照图18,与上述实施例的区别在于,摄像头5073包括长焦摄像头507301和广角摄像头507302,长焦摄像头507301包括第一透镜507311和第一图像传感器507321,广角摄像头507302包括第二透镜507312和第二图像传感器507322。Further, on the basis of the image processing circuit 507 described in the above embodiment, the image processing circuit 507 is further introduced, please refer to FIG. 18 , the difference from the above embodiment is that the camera 5073 includes a telephoto camera 507301 and a wide-angle camera 507302, the telephoto camera 507301 includes a first lens 507311 and a first image sensor 507321, and the wide-angle camera 507302 includes a second lens 507312 and a second image sensor 507322.
其中,对长焦摄像头507301和广角摄像头507302的性能参数(例如,焦距、光圈大小、解像力等等)不做任何限制。长焦摄像头507301和广角摄像头507302可设置于电子设备的同一平面内,比如,同时设置在电子设备的背面或正面。双摄像头在电子设备的安装距离可根据电子设备的尺寸确定和/或拍摄效果等确定,比如,为了使长焦摄像头507301和广角摄像头507302拍摄的图像内容重叠度高,可将长焦摄像头507301和广角摄像头507302安装得越近越好,例如,10mm以内。Among them, there is no restriction on the performance parameters (such as focal length, aperture size, resolution, etc.) of the telephoto camera 507301 and the wide-angle camera 507302. The telephoto camera 507301 and the wide-angle camera 507302 can be arranged in the same plane of the electronic device, for example, they can be arranged on the back or front of the electronic device at the same time. The installation distance of the dual cameras on the electronic device can be determined according to the size of the electronic device and/or the shooting effect. For example, in order to make the images captured by the telephoto camera 507301 and the wide-angle camera 507302 have a high degree of overlap, the telephoto camera 507301 and the wide-angle camera 507302 can be combined. The wide-angle camera 507302 should be installed as close as possible, for example, within 10mm.
本申请实施例还提供一种存储介质,存储介质存储有计算机程序,当计算机程序在计算机上运行时,使得计算机执行上述任一实施例中的图像处理方法,比如:获取同步采集的、同一场景的长焦场景图像以及广角场景图像;对获取到的长焦场景图像进行人脸识别,得到长焦场景图像的人脸特征;将得到的长焦场景图像的人脸特征与广角场景图像绑定;根据角场景图像所绑定的人脸特征,对广角场景图像进行预设处理。The embodiment of the present application also provides a storage medium, the storage medium stores a computer program, and when the computer program is run on the computer, the computer is made to execute the image processing method in any of the above-mentioned embodiments, for example: to acquire the same scene captured synchronously The telephoto scene image and the wide-angle scene image; perform face recognition on the obtained telephoto scene image to obtain the face features of the telephoto scene image; bind the obtained face features of the telephoto scene image with the wide-angle scene image ; Perform preset processing on the wide-angle scene image according to the facial features bound to the angle scene image.
在本申请实施例中,存储介质可以是磁碟、光盘、只读存储器(Read Only Memory,ROM,)、或者随机存取记忆体(Random Access Memory,RAM)等。In the embodiment of the present application, the storage medium may be a magnetic disk, an optical disk, a read only memory (Read Only Memory, ROM), or a random access memory (Random Access Memory, RAM), or the like.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the foregoing embodiments, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.
需要说明的是,对本申请实施例的图像处理方法而言,本领域普通测试人员可以理解实现本申请实施例的图像处理方法的全部或部分流程,是可以通过计算机程序来控制相关的硬件来完成,计算机程序可存储于一计算机可读取存储介质中,如存储在电子设备的存储器中,并被该电子设备内的至少一个中央处理器执行,在执行过程中可包括如图像处理方法的实施例的流程。其中,的存储介质可为磁碟、光盘、只读存储器、随机存取记忆体等。It should be noted that, for the image processing method of the embodiment of the present application, ordinary testers in the field can understand that all or part of the flow of the image processing method of the embodiment of the present application can be completed by controlling the relevant hardware through a computer program , the computer program can be stored in a computer-readable storage medium, such as stored in the memory of an electronic device, and executed by at least one central processing unit in the electronic device, and the execution process can include, for example, the implementation of an image processing method example process. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory, a random access memory, and the like.
对本申请实施例的图像处理装置而言,其各功能模块可以集成在一个处理芯片中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中,存储介质譬如为只读存储器,磁盘或光盘等。For the image processing device of the embodiment of the present application, its various functional modules may be integrated into one processing chip, or each module may exist separately physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software function modules. If the integrated modules are implemented in the form of software function modules and sold or used as independent products, they can also be stored in a computer-readable storage medium, such as a read-only memory, magnetic disk or optical disk.
以上对本申请实施例所提供的一种图像处理方法、装置、存储介质及电子设备进行了详细介绍,本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上,本说明书内容不应理解为对本申请的限制。An image processing method, device, storage medium, and electronic equipment provided by the embodiments of the present application have been described in detail above. In this paper, specific examples are used to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only It is used to help understand the method and its core idea of this application; at the same time, for those skilled in the art, according to the idea of this application, there will be changes in the specific implementation and application scope. In summary, the content of this specification does not It should be understood as a limitation on the present application.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810276764.1A CN108513069B (en) | 2018-03-30 | 2018-03-30 | Image processing method, image processing device, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810276764.1A CN108513069B (en) | 2018-03-30 | 2018-03-30 | Image processing method, image processing device, storage medium and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108513069A true CN108513069A (en) | 2018-09-07 |
CN108513069B CN108513069B (en) | 2021-01-08 |
Family
ID=63379314
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810276764.1A Expired - Fee Related CN108513069B (en) | 2018-03-30 | 2018-03-30 | Image processing method, image processing device, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108513069B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110430359A (en) * | 2019-07-31 | 2019-11-08 | 北京迈格威科技有限公司 | Shoot householder method, device, computer equipment and storage medium |
CN112887613A (en) * | 2021-01-27 | 2021-06-01 | 维沃移动通信有限公司 | Shooting method, shooting device, electronic equipment and storage medium |
CN113014820A (en) * | 2021-03-15 | 2021-06-22 | 联想(北京)有限公司 | Processing method and device and electronic equipment |
CN113329172A (en) * | 2021-05-11 | 2021-08-31 | 维沃移动通信(杭州)有限公司 | Shooting method and device and electronic equipment |
CN113347355A (en) * | 2021-05-28 | 2021-09-03 | 维沃移动通信(杭州)有限公司 | Image processing method and device and electronic equipment |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104243818A (en) * | 2014-08-29 | 2014-12-24 | 小米科技有限责任公司 | Image processing method and device and image processing equipment |
CN105183734A (en) * | 2014-06-16 | 2015-12-23 | 西安中兴新软件有限责任公司 | Method and device for image file sharing |
CN105303161A (en) * | 2015-09-21 | 2016-02-03 | 广东欧珀移动通信有限公司 | Method and device for taking pictures of multiple people |
CN106454130A (en) * | 2016-11-29 | 2017-02-22 | 广东欧珀移动通信有限公司 | Control method, control device and electronic device |
CN106454121A (en) * | 2016-11-11 | 2017-02-22 | 努比亚技术有限公司 | Double-camera shooting method and device |
CN106454287A (en) * | 2016-10-27 | 2017-02-22 | 深圳奥比中光科技有限公司 | Combined camera shooting system, mobile terminal and image processing method |
US20170150061A1 (en) * | 2013-06-13 | 2017-05-25 | Corephotonics Ltd. | Dual aperture zoom digital camera |
CN106993135A (en) * | 2017-03-31 | 2017-07-28 | 维沃移动通信有限公司 | A kind of photographic method and mobile terminal |
CN107690649A (en) * | 2015-06-23 | 2018-02-13 | 三星电子株式会社 | Digital filming device and its operating method |
CN107833197A (en) * | 2017-10-31 | 2018-03-23 | 广东欧珀移动通信有限公司 | Method, apparatus, computer-readable recording medium and the electronic equipment of image procossing |
-
2018
- 2018-03-30 CN CN201810276764.1A patent/CN108513069B/en not_active Expired - Fee Related
Patent Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170150061A1 (en) * | 2013-06-13 | 2017-05-25 | Corephotonics Ltd. | Dual aperture zoom digital camera |
CN105183734A (en) * | 2014-06-16 | 2015-12-23 | 西安中兴新软件有限责任公司 | Method and device for image file sharing |
CN104243818A (en) * | 2014-08-29 | 2014-12-24 | 小米科技有限责任公司 | Image processing method and device and image processing equipment |
CN107690649A (en) * | 2015-06-23 | 2018-02-13 | 三星电子株式会社 | Digital filming device and its operating method |
CN105303161A (en) * | 2015-09-21 | 2016-02-03 | 广东欧珀移动通信有限公司 | Method and device for taking pictures of multiple people |
CN106454287A (en) * | 2016-10-27 | 2017-02-22 | 深圳奥比中光科技有限公司 | Combined camera shooting system, mobile terminal and image processing method |
CN106454121A (en) * | 2016-11-11 | 2017-02-22 | 努比亚技术有限公司 | Double-camera shooting method and device |
CN106454130A (en) * | 2016-11-29 | 2017-02-22 | 广东欧珀移动通信有限公司 | Control method, control device and electronic device |
CN106993135A (en) * | 2017-03-31 | 2017-07-28 | 维沃移动通信有限公司 | A kind of photographic method and mobile terminal |
CN107833197A (en) * | 2017-10-31 | 2018-03-23 | 广东欧珀移动通信有限公司 | Method, apparatus, computer-readable recording medium and the electronic equipment of image procossing |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110430359A (en) * | 2019-07-31 | 2019-11-08 | 北京迈格威科技有限公司 | Shoot householder method, device, computer equipment and storage medium |
CN112887613A (en) * | 2021-01-27 | 2021-06-01 | 维沃移动通信有限公司 | Shooting method, shooting device, electronic equipment and storage medium |
CN113014820A (en) * | 2021-03-15 | 2021-06-22 | 联想(北京)有限公司 | Processing method and device and electronic equipment |
CN113329172A (en) * | 2021-05-11 | 2021-08-31 | 维沃移动通信(杭州)有限公司 | Shooting method and device and electronic equipment |
WO2022237839A1 (en) * | 2021-05-11 | 2022-11-17 | 维沃移动通信(杭州)有限公司 | Photographing method and apparatus, and electronic device |
CN113347355A (en) * | 2021-05-28 | 2021-09-03 | 维沃移动通信(杭州)有限公司 | Image processing method and device and electronic equipment |
WO2022247766A1 (en) * | 2021-05-28 | 2022-12-01 | 维沃移动通信(杭州)有限公司 | Image processing method and apparatus, and electronic device |
Also Published As
Publication number | Publication date |
---|---|
CN108513069B (en) | 2021-01-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108322646B (en) | Image processing method, image processing device, storage medium and electronic equipment | |
CN116324878A (en) | Segmentation for Image Effects | |
CN108513069B (en) | Image processing method, image processing device, storage medium and electronic equipment | |
US20150244916A1 (en) | Electronic device and control method of the same | |
CN108805198A (en) | Image processing method, device, computer readable storage medium and electronic equipment | |
CN113706414B (en) | Training method of video optimization model and electronic equipment | |
US10769416B2 (en) | Image processing method, electronic device and storage medium | |
CN108520493A (en) | Image replacement processing method, device, storage medium and electronic equipment | |
CN108259767B (en) | Image processing method, image processing device, storage medium and electronic equipment | |
CN108093158A (en) | Image blurring processing method and device and mobile device | |
CN104869309A (en) | Method and device for taking pictures | |
CN117201930A (en) | Photographing method and electronic equipment | |
CN108495038B (en) | Image processing method, device, storage medium and electronic device | |
CN114926351B (en) | Image processing method, electronic device, and computer storage medium | |
CN108401109B (en) | Image acquisition method and device, storage medium and electronic equipment | |
CN116055895B (en) | Image processing method and its device, chip system and storage medium | |
CN115623319B (en) | Shooting method and electronic equipment | |
WO2024051697A1 (en) | Image fusion method and apparatus, electronic device, and storage medium | |
WO2023160221A1 (en) | Image processing method and electronic device | |
CN112367470B (en) | Image processing method and device and electronic equipment | |
CN111815531B (en) | Image processing method, device, terminal equipment and computer readable storage medium | |
HK1252690A1 (en) | Image processing method, device, storage medium, and electronic device | |
CN116708996B (en) | Photographing method, image optimization model training method and electronic equipment | |
CN118075574B (en) | Strategy determination method and electronic device for generating video | |
CN117692752B (en) | Image processing method, terminal, storage medium and program product |
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 | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20210108 |