CN117593777A - Face image processing method, device, equipment and storage medium - Google Patents

Face image processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN117593777A
CN117593777A CN202311579053.9A CN202311579053A CN117593777A CN 117593777 A CN117593777 A CN 117593777A CN 202311579053 A CN202311579053 A CN 202311579053A CN 117593777 A CN117593777 A CN 117593777A
Authority
CN
China
Prior art keywords
image
face
npu
target image
processing
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.)
Pending
Application number
CN202311579053.9A
Other languages
Chinese (zh)
Inventor
徐协增
张明华
汪帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Honghe Innovation Information Technology Co Ltd
Original Assignee
Shenzhen Honghe Innovation Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Honghe Innovation Information Technology Co Ltd filed Critical Shenzhen Honghe Innovation Information Technology Co Ltd
Priority to CN202311579053.9A priority Critical patent/CN117593777A/en
Publication of CN117593777A publication Critical patent/CN117593777A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the application discloses a face image processing method, a device, equipment and a storage medium, and relates to the technical field of artificial intelligence. In the embodiment of the application, at least one first image acquired by a camera is acquired through an entity camera node; transmitting each first image to the NPU so that the NPU carries out face detection on each first image to obtain face parameters of each first image; processing each first image according to the face parameters sent by the NPU to obtain at least one target image; each target image is written to at least one virtual camera node. That is, in the embodiment of the application, the NPU is integrated in the electronic device, face detection is performed through the NPU, and the processing of the face image is realized through interaction of the NPU and the CPU, so that an independent face image processing system is not required to be additionally developed, development cost is reduced, the electronic device is only required to be maintained, two sets of systems are not required to be maintained, and maintenance cost of the system is reduced.

Description

Face image processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of artificial intelligence technologies, and in particular, to a face image processing method, device, apparatus, and storage medium.
Background
With the development of technology, image processing and display technologies based on face recognition have been widely used in various fields.
In the related art, when face image processing and display are performed, an independent image processing system is usually developed in advance, the independent image processing system is connected with a camera to obtain a face image collected by the camera, then the obtained face image is processed by using algorithms such as artificial intelligence (Artificial Intelligence, AI) and the like to obtain a target image, and the purpose of displaying the target image is achieved by connecting the image processing system with a display device.
That is, the related art requires development of an independent system capable of processing a face image using an artificial intelligence algorithm such as an AI algorithm, and maintenance of the independent image processing system and display device, and development costs and maintenance costs are high.
Content of the application
The embodiment of the application provides a face image processing method, a device, equipment and a storage medium, which can reduce the processing cost of a face image.
In a first aspect, an embodiment of the present application provides a face image processing method, applied to an electronic device, where the electronic device includes a central processing unit CPU and a network processor NPU, the CPU is connected with the NPU, and the electronic device is connected with a camera, the method includes:
Acquiring at least one first image acquired by a camera through a solid camera node;
transmitting each first image to the NPU so that the NPU carries out face detection on each first image to obtain face parameters of each first image;
processing each first image according to the face parameters sent by the NPU to obtain at least one target image;
each target image is written into at least one virtual camera node to display a corresponding target image on a display screen of the electronic device through each virtual camera node.
In a second aspect, an embodiment of the present application provides a face image processing apparatus, applied to an electronic device, where the electronic device includes a central processing unit CPU and a network processor NPU, the CPU is connected with the NPU, and the electronic device is connected with a camera, the apparatus includes:
the acquisition module is used for acquiring at least one first image acquired by the camera through the entity camera node;
the sending module is used for sending each first image to the NPU so that the NPU carries out face detection on each first image to obtain face parameters of each first image;
the processing module is used for processing each first image according to the face parameters sent by the NPU to obtain at least one target image;
And the writing module is used for writing each target image into at least one virtual camera node so as to display the corresponding target image on a display screen of the electronic equipment through each virtual camera node.
In a third aspect, an embodiment of the present application provides an electronic device, including:
a processor;
a memory for storing computer program instructions;
the computer program instructions, when executed by a processor, implement the method as described in the first aspect.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement a method as described in the first aspect.
In the embodiment of the application, at least one first image acquired by a camera is acquired through an entity camera node; transmitting each first image to the NPU so that the NPU carries out face detection on each first image to obtain face parameters of each first image; processing each first image according to the face parameters sent by the NPU to obtain at least one target image; each target image is written into at least one virtual camera node to display a corresponding target image on a display screen of the electronic device through each virtual camera node. That is, in the embodiment of the application, the NPU is integrated in the electronic device, face detection is performed through the NPU, and the processing of the face image is realized through interaction of the NPU and the CPU, so that an independent face image processing system is not required to be additionally developed, development cost is reduced, the electronic device is only required to be maintained, two sets of systems are not required to be maintained, and maintenance cost of the system is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, and it is possible for a person skilled in the art to obtain other drawings from these drawings without inventive effort.
Fig. 1 is a schematic view of a scene of processing a face image according to the related art;
fig. 2 is a schematic view of a face image processing method according to an embodiment of the present application;
fig. 3 is a flowchart of a face image processing method provided in an embodiment of the present application;
fig. 4 is a flowchart of another face image processing method provided in an embodiment of the present application;
fig. 5 is a schematic diagram of a processing procedure of a face image according to an embodiment of the present application;
fig. 6 is a schematic diagram of another processing procedure of a face image according to an embodiment of the present application;
fig. 7 is a schematic diagram of another processing procedure of a face image according to an embodiment of the present application;
fig. 8 is a block diagram of a face image processing apparatus according to an embodiment of the present application;
fig. 9 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
Features and exemplary embodiments of various aspects of the present application are described in detail below, and in order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely configured to explain the present application and are not configured to limit the present application. It will be apparent to one skilled in the art that the present application may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present application by showing examples of the present application.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
Along with the development of artificial intelligence technology, at present, the AI algorithm is mainly used for detecting the human face in the image, and the AI algorithm has higher requirements on the running speed of the system and the like.
In the traditional scene of displaying images collected by a camera by using a large screen device, an independent system is mainly developed at present, the independent system comprises a hardware main board and a software system, then the independent system is connected with the camera to acquire the images collected by the camera, the images are subjected to face detection and processing to obtain target images, and then the target images are sent to the large screen device for display.
As shown in fig. 1, the independent system is integrated on a first electronic device 100, the first electronic device 100 is respectively connected with a second electronic device 101 and a camera 102, after the first electronic device 100 acquires an image from the camera 102, the image is processed to obtain a target image, and then the target image is sent to the second electronic device 101 for display. The second electronic device 101 is a large screen device.
As can be seen, the related art requires not only additional development of an independent face image processing system, i.e., the first electronic device 100, but also simultaneous maintenance of the first electronic device 100 and the second electronic device 101, and has high development cost and maintenance cost.
Therefore, the embodiment of the application provides a face image processing method, device, equipment and storage medium, and an independent face image processing system is not required to be additionally developed, so that development cost and maintenance cost are reduced.
The face image processing method provided by the embodiment of the application can be applied to a scene shown in fig. 2, the scene can comprise a large-screen device 200 and a camera 201, the large-screen device 200 is connected with the camera 201, the large-screen device 200 comprises a central processing unit (Central Processing Unit, CPU) 202 and a network processor (nerve-network Processing Units, NPU) 203, and the CPU202 is connected with the NPU 203.
The large screen device 200 may be, for example, a large screen television, a large screen projector, or the like. The large screen device 200 may be a device having a dual system, for example, an android system and a windows system.
The NPU203 mainly detects a face in an image by using an AI algorithm, and the NPU203 can execute the AI algorithm independently of the CPU202, so that the face detection speed of the image can be improved.
The CPU202 may perform subsequent image processing operations based on the face detection result of the NPU203, obtain a target image, and display the target image. Therefore, no additional development of new electronic equipment is needed, and only the large-screen equipment 200 is required to be maintained, so that development cost and maintenance cost are reduced.
The face image processing method provided by the embodiment of the present application is described below with reference to specific embodiments, and the face image processing method provided by the embodiment of the present application may be applied to a central processing unit (Central Processing Unit, CPU) of an electronic device, which may be a large-screen device in fig. 2.
Fig. 3 is a flowchart of a face image processing method provided in an embodiment of the present application, and as shown in fig. 3, the face image processing method may include the following steps:
s310, at least one first image acquired by a camera is acquired through a solid camera node.
And S320, transmitting each first image to the NPU so that the NPU performs face detection on each first image to obtain face parameters of each first image.
S330, processing each first image according to the face parameters sent by the NPU to obtain at least one target image.
And S340, writing each target image into at least one virtual camera node so as to display the corresponding target image on a display screen of the electronic equipment through each virtual camera node.
In the embodiment of the application, at least one first image acquired by a camera is acquired through an entity camera node; transmitting each first image to the NPU so that the NPU carries out face detection on each first image to obtain face parameters of each first image; processing each first image according to the face parameters sent by the NPU to obtain at least one target image; each target image is written into at least one virtual camera node to display a corresponding target image on a display screen of the electronic device through each virtual camera node. That is, in the embodiment of the application, the NPU is integrated in the electronic device, face detection is performed through the NPU, and the processing of the face image is realized through interaction of the NPU and the CPU, so that an independent face image processing system is not required to be additionally developed, development cost is reduced, the electronic device is only required to be maintained, two sets of systems are not required to be maintained, and maintenance cost of the system is reduced.
The following describes the above steps in detail, as follows:
in S310, the electronic device in the embodiment of the present application is connected to the camera, and the electronic device may acquire an image acquired by the camera through connection to the camera. In practical application, the electronic device and the camera can be connected through a universal serial bus, and plug and play is realized. Illustratively, the camera may support universal serial bus video class (Universal Serial Bus Video Class, UVC) drive protocols.
The entity camera node is a node generated by the CPU based on the entity camera, one entity camera may correspond to one entity camera node, for example, the electronic device is connected to one camera, and at this time, the CPU may create one entity camera node to read at least one first image acquired by the corresponding entity camera through the entity camera node.
The first image may be an original image including at least one face, for example.
In S320, after acquiring the first images acquired by the cameras based on the entity camera node, the CPU may send the first images to the NPU, and the NPU runs the AI algorithm to perform face detection on the first images, so as to obtain face parameters of each first image.
Because the NPU is an AI processing chip, the AI algorithm can be independently operated, so the time for detecting the human face can be greatly shortened through the NPU, and the performance of the CPU can not be influenced.
The face parameters may include, for example, parameters such as the number of faces and the position of the faces.
In S330, after obtaining the face parameter of the first image, the NPU may send the face parameter to the CPU, and the CPU performs subsequent image processing based on the face parameter.
After receiving the face parameters of each first image, the CPU may process each first image based on the face parameters to obtain at least one target image. That is, the target image may be obtained based on one first image or may be obtained based on a plurality of first images.
For example, faces in the first images may be cropped, then the cropped face images may be stitched, and the stitched face images may be recorded as target images.
For example, the face in each first image may be cropped, and the target image may be obtained by adjusting the size of the cropped face image.
Illustratively, filtering, denoising and other processes may be performed on the faces in each first image, so as to improve the definition of the faces and the like. Of course, other processing operations may also be performed on the faces in each first image, and the embodiments of the present application are not specifically limited.
In S340, the virtual camera node is a node created by the CPU and corresponding to the physical camera node, and after obtaining the target image, the CPU may write the target image into the corresponding virtual camera node, and each application of the electronic device may obtain the target image by accessing the virtual camera node. For example, one physical camera node may correspond to one or more virtual camera nodes.
For example, the number of virtual camera nodes may be determined based on the display requirements of the video stream, e.g., when a user has multiple video streams, multiple virtual camera nodes may be created, one virtual camera node may write each target image in a single video stream.
Illustratively, one or more virtual camera nodes may be generated by loading a ko file, installing a ko driver, creating a v4l2loopback driver through the ko driver, and generating one or more virtual camera nodes through the v4l2loopback driver.
The ko file is a linux driving file, can be directly installed in a kernel of the electronic equipment to run, and can also be installed and run through script commands when the electronic equipment is started.
v4l2loopback is a driver created at the bottom layer of the system, such as linux, for generating virtual camera nodes.
For example, in order to support the camera application of the electronic device, the virtual camera node x may be generated first, the entity node n is regenerated, and x < n, x and n are digital serial numbers, so that the camera application of the electronic device can be ensured to obtain the target image from the virtual camera node, not the first image, that is, the original image.
The application of the electronic device can acquire the corresponding target image through the virtual camera node and display the target image on a display screen of the electronic device.
Taking the face parameters including the number of faces and the positions of the faces as an example, as shown in fig. 4, the face image processing method may include the following steps:
s410, acquiring at least one first image acquired by a camera through a physical camera node.
And S420, sending each first image to the NPU so that the NPU carries out face detection on each first image to obtain face parameters of each first image.
S430, determining an image processing mode of each first image according to the display mode of the target image.
S440, generating at least one face clipping frame according to the number of faces, the positions of the faces and the display mode.
S450, clipping at least one face in the first image according to each face clipping frame to obtain a second image corresponding to each face.
S460, processing each second image according to the image processing mode to obtain at least one target image.
And S470, writing each target image into at least one virtual camera node so as to display the corresponding target image on a display screen of the electronic equipment through each virtual camera node.
The processes of S410-S420 and S460 are the same as those of S310-S320 and S340, and the above embodiments may be referred to specifically, and are not repeated here for brevity.
The following describes the other steps in detail, and is specifically as follows:
in S430, the display modes of the target image may include, for example, a mosaic mode, an zoom-in mode, a zoom-out mode, a view-finding mode, and the like. The display mode of the target image may be set in advance by the user.
Illustratively, prior to S430, the display mode of the target image may be determined by:
receiving an operation instruction sent by at least one application of the electronic equipment, wherein the operation instruction is generated by each application based on the operation of a user on a display screen;
and determining a display mode of the target image according to the operation instruction.
The operation instruction is generated by the corresponding application based on the operation of the user on the display screen, and the operation may be an operation related to the display mode of the target image, for example, a single click, a double click, a long press, or the like of a control related to the display mode. Different applications may correspond to the same or different image display modes, particularly in relation to the needs of the user.
The operation may be an operation to switch the display mode, and the operation instruction may be a display mode switching instruction.
The CPU can determine the display mode of the target image according to the operation instructions sent by each application, and is convenient for determining the processing mode of the image subsequently.
Illustratively, each application may send an operation instruction to the CPU through the Socket channel. Socket is a communication mechanism between processes, for example, in the embodiment of the present application, two-way communication can be performed between each application and the CPU based on a Socket channel.
According to the method and the device for determining the image processing mode, the display mode of the target image can be determined based on the operation of the user, the image processing mode can be determined conveniently according to the corresponding display mode, and the image processing effect is improved.
According to the display mode of the target image, the image processing mode of each first image can be determined, so that each first image can be conveniently processed later, and the target image corresponding to the display mode is obtained.
For example, when the display mode is a mosaic mode, the image processing method is to cut out the face in each first image and fill the cut face image into the corresponding region according to the mosaic method.
If the display mode is the view finding mode, the image processing mode is to cut out the face in each first image and then enlarge the face.
In S440, the cropping frame is used to crop the faces in the first image, and the number of cropping frames is related to the number of faces contained in the first image and the display mode.
Illustratively, the step S440 may include the steps of:
under the condition that the display mode is a view finding mode and the number of faces is 1, generating a first face clipping frame according to the positions of the faces;
generating a second face clipping frame according to the face positions of the faces under the condition that the display mode is a view finding mode and the number of the faces is larger than 1;
and under the condition that the display mode is a jigsaw mode and the number of faces is greater than 1, generating a third face clipping frame corresponding to each face according to the face position of each face.
For example, in the case where the display mode is the framing mode and the first image includes a face, the first face clipping frame may be generated based on the face position of the face, so that only the face is included in the image clipped based on the first face clipping frame as much as possible.
For example, the number of the first face cropping frames may be one, that is, in the case where the display mode is the framing mode and the first image contains only one face, one face cropping frame may be generated.
For example, in the case where the display mode is the framing mode and the first image includes a plurality of faces, the second face trim frame may be generated based on the positions of the faces such that the faces in the first image may be included in the image trimmed based on the second face trim frame.
For example, the number of second face crop frames may be one, i.e. when the first image comprises a plurality of faces, only one crop frame is generated.
For example, when the display mode is a jigsaw mode, corresponding cropping frames can be generated for all faces in the first image respectively, that is, the number of the third face cropping frames in the embodiment of the present application is the same as that of faces contained in the first image, so that the jigsaw requirement of the user can be satisfied.
According to the method and the device for generating the face clipping frames, corresponding face clipping frames are generated based on the display mode of the target image and the number of faces in the first image, subsequent image processing is facilitated, and the target image meeting the user requirements is obtained.
After the face clipping frame is generated in S450, the face in the first image may be clipped based on the face clipping frame, so as to obtain a second image.
After the second images are obtained in S460, each of the second images may be processed based on the image processing mode to obtain at least one target image.
Illustratively, the step S460 may include the steps of:
determining a second image corresponding to the face as a target image when the display mode is a view finding mode;
Under the condition that the display mode is a jigsaw mode, scaling the second image corresponding to each face;
and filling the scaled second image into a preset area according to a preset image filling rule to obtain a target image, wherein the size of the preset area is matched with the size of the display screen.
For example, in the case where the display mode is the viewfinder mode, the cropped second image may be directly determined as the target image.
As shown in fig. 5, in the case where the first image includes only one face, the second image including the face obtained by clipping may be directly used as the target image.
As shown in fig. 6, in the case where the first image includes a plurality of faces, the second image including the plurality of faces obtained by clipping may be directly used as the target image, and fig. 6 exemplifies that the first image includes two faces.
For example, in the case that the display mode is the jigsaw mode, the second image corresponding to each face may be scaled, and the scaled second image is filled into the preset area according to the preset image filling rule, and the filled image is used as the target image. The image filling rules may include, for example, a filling order of the images.
The size of the preset area is adapted to the size of the display screen, for example, the size of the preset area is changed in proportion to the size of the display screen, so that the problem that the watching of a user is influenced due to inconsistent proportion when the target image is displayed can be avoided.
For example, when filling the preset area, the whole preset area may be filled, or a partial area of the preset area may be filled, for example, 1/4 area of the preset area may be filled, where the 1/4 area may be divided into 4 parts, and a part of the 4 parts is selected to be filled.
As shown in fig. 7, the first image includes two faces, and in practical application, the faces in the jigsaw may come from different first images. The face 1 is amplified and then filled in the area A, and the face 2 is amplified and then filled in the area B. Fig. 7 illustrates filling the entire preset area.
According to the embodiment of the application, each second image is processed according to the image processing mode to obtain at least one target image, and other equipment is not required to be additionally developed, so that the processing cost of the face image is reduced.
In some embodiments, after S340, the face image processing method may further include the steps of:
Receiving an image reading request sent by at least one application of the electronic equipment, wherein the image reading request comprises image parameters of a first target image;
responding to the image reading request, and determining a target virtual camera node where the first target image is located according to the image parameters;
and sending the first target image on the target virtual camera node to the corresponding application.
The image parameters may include, for example, parameters of an application to which the first target image belongs, the number of first target images, and the like.
The camera virtual node may be associated with each application of the electronic device, and based on the image parameter of the first target image, an application to which the first target image belongs may be determined, and further, a virtual camera node corresponding to the application, that is, a target virtual camera node may be determined.
After the target virtual camera node is determined, the first target image on the target virtual camera node can be sent to the corresponding application, and the corresponding application displays the first target image through the display screen.
According to the method and the device for displaying the image, the image is displayed through interaction between the application and the virtual camera node, and the interaction is completed in the electronic device without external usb transmission, so that the transmission speed of the first target image is not limited by the bandwidth of a usb hardware circuit.
In some embodiments, before S310, the face image processing method may further include the steps of:
a physical camera node and at least one virtual camera node are created.
The creation process of the physical camera node and the virtual camera node may be referred to the above embodiments, and for brevity description, details are not repeated here.
The first image acquired by the camera can be read through the entity camera node, the target image is obtained through the processing of the processor (NPU+CPU), the target image is written into the virtual camera node, the display of the subsequent image is convenient, the transmission of the image data is not limited by bandwidth, the resources of the processor can be fully utilized, and the resource waste is avoided.
The electronic device may also be used as a slave device for a third party system, for example, the third party system may obtain a target image obtained by processing the electronic device by connecting with the electronic device.
Taking the example that the image processing process is operated on the android system of the electronic device, the electronic device and the third party system may be connected through a usb channel, and at this time, the target image in the electronic device may be sent to the third party system through the usb channel for use by a user of the third party system.
When the electronic equipment is switched from the android system to other systems such as windows system, the use of the target image by the third party system is not influenced, namely when the electronic equipment is switched from the android system to the other systems such as windows system, the electronic equipment can still send the target image to the third party system through the usb channel without switching the usb channel, so that the problems of unstable image transmission and poor display effect caused by switching the usb channel can be avoided.
The processing procedure of the image is executed in the electronic equipment, other equipment is not required to be additionally developed, and the electronic equipment is only required to be connected with a common camera when in use, so that the electronic equipment has a simple structure, is low in cost and is convenient to maintain. In addition, the face detection part independently operates in the NPU, and the operation efficiency is high. In addition, by creating the virtual camera node, the embodiment of the application only needs to write the obtained target image into the virtual camera node, and external usb transmission is not needed, so that the problem that transmission data is limited by the bandwidth of a usb hardware circuit can be avoided. And the electronic equipment can be used as slave equipment for the stable use of a third party system.
Based on the same inventive concept, the embodiment of the present application further provides a face image processing apparatus, and the face image processing apparatus provided in the embodiment of the present application is described in detail below with reference to fig. 8.
Fig. 8 is a block diagram of a face image processing apparatus according to an embodiment of the present application.
As shown in fig. 8, the face image processing apparatus 800 may include:
an acquiring module 801, configured to acquire at least one first image acquired by a camera through a physical camera node;
the sending module 802 is configured to send each first image to the NPU, so that the NPU performs face detection on each first image to obtain face parameters of each first image;
the processing module 803 is configured to process each first image according to the face parameter sent by the NPU, so as to obtain at least one target image;
a writing module 804, configured to write each target image into at least one virtual camera node, so as to display the corresponding target image on a display screen of the electronic device through each virtual camera node.
In the embodiment of the application, at least one first image acquired by a camera is acquired through an entity camera node; transmitting each first image to the NPU so that the NPU carries out face detection on each first image to obtain face parameters of each first image; processing each first image according to the face parameters sent by the NPU to obtain at least one target image; each target image is written into at least one virtual camera node to display a corresponding target image on a display screen of the electronic device through each virtual camera node. That is, in the embodiment of the application, the NPU is integrated in the electronic device, face detection is performed through the NPU, and the processing of the face image is realized through interaction of the NPU and the CPU, so that an independent face image processing system is not required to be additionally developed, development cost is reduced, the electronic device is only required to be maintained, two sets of systems are not required to be maintained, and maintenance cost of the system is reduced.
In some embodiments, the face parameters include the number of faces and the face position;
the processing module 803 is specifically configured to:
determining an image processing mode of each first image according to the display mode of the target image;
generating at least one face clipping frame according to the number of faces, the positions of the faces and the display mode;
cutting at least one face in the first image according to each face cutting frame to obtain a second image corresponding to each face;
and processing each second image according to the image processing mode to obtain at least one target image.
In some embodiments, the processing module 803 is specifically configured to:
under the condition that the display mode is a view finding mode and the number of faces is 1, generating a first face clipping frame according to the positions of the faces;
generating a second face clipping frame according to the face positions of the faces under the condition that the display mode is a view finding mode and the number of the faces is larger than 1;
and under the condition that the display mode is a jigsaw mode and the number of faces is greater than 1, generating a third face clipping frame corresponding to each face according to the face position of each face.
In some embodiments, the processing module 803 is specifically configured to:
determining a second image corresponding to the face as a target image when the display mode is a view finding mode;
Under the condition that the display mode is a jigsaw mode, scaling the second image corresponding to each face;
and filling the scaled second image into a preset area according to a preset image filling rule to obtain a target image, wherein the size of the preset area is matched with the size of the display screen.
In some embodiments, the face image processing apparatus 800 may further include:
the receiving module is configured to receive an operation instruction sent by at least one application of the electronic device before the processing module 803 generates at least one face clipping frame according to the number of faces, the positions of the faces, and the display mode, where the operation instruction is generated by each application based on an operation of a user on a display screen;
the processing module 803 is further configured to determine a display mode of the target image according to the operation instruction.
In some embodiments, the receiving module is further configured to receive an image reading request sent by at least one application of the electronic device after the writing module 804 writes each target image to at least one virtual camera node to display a corresponding target image on a display screen of the electronic device through each virtual camera node, where the image reading request includes image parameters of the first target image;
The processing module 803 is further configured to determine, according to the image parameter, a target virtual camera node where the first target image is located, in response to the image reading request;
the sending module 802 is further configured to send the first target image on the target virtual camera node to a corresponding application.
In some embodiments, the face image processing apparatus 800 may further include:
a creating module, configured to create the physical camera node and the at least one virtual camera node before the acquiring module 801 acquires the at least one first image acquired by the camera through the physical camera node.
Each module in the apparatus shown in fig. 8 has a function of implementing each step in fig. 3 to 4 and can achieve a corresponding technical effect, and for brevity description, a detailed description is omitted herein.
Based on the same inventive concept, the embodiments of the present application also provide an electronic device, which may be, for example, a large screen device, such as a large screen television, a large screen projector, or the like. An electronic device 900 provided in an embodiment of the present application is described in detail below with reference to fig. 9.
As shown in fig. 9, the electronic device 900 may include a processor 910 and a memory 920 for storing computer program instructions.
The processor 910 may include a central processing unit (Central Processing Unit, CPU), or an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or may be configured to implement one or more integrated circuits of embodiments of the present application.
Memory 920 may include mass storage for data or instructions. By way of example, and not limitation, memory 920 may include a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, magnetic tape, or universal serial bus (Universal Serial Bus, USB) Drive, or a combination of two or more of these. In one example, memory 920 may include removable or non-removable (or fixed) media, or memory 920 is a non-volatile solid state memory. In one example, memory 920 may be Read Only Memory (ROM). In one example, the ROM may be mask-programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
The processor 910 reads and executes the computer program instructions stored in the memory 920 to implement the method in the embodiment shown in fig. 3 to 4, and achieve the corresponding technical effects achieved by executing the method in the embodiment shown in fig. 3 to 4, which are not described herein for brevity.
In one example, the electronic device 900 may also include a communication interface 930 and a bus 940. As shown in fig. 9, the processor 910, the memory 920, and the communication interface 930 are connected and communicate with each other through a bus 940.
The communication interface 930 is mainly used to implement communication between each module, apparatus and/or device in the embodiments of the present application.
Bus 940 includes hardware, software, or both, that couple components of electronic device 900 to one another. By way of example, and not limitation, bus 940 may include an accelerated graphics port (Accelerated Graphics Port, AGP) or other graphics Bus, an enhanced industry standard architecture (Extended Industry Standard Architecture, EISA) Bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an industry standard architecture (Industry Standard Architecture, ISA) Bus, an infiniband interconnect, a Low Pin Count (LPC) Bus, a memory Bus, a micro channel architecture (MCa) Bus, a Peripheral Component Interconnect (PCI) Bus, a PCI-Express (PCI-X) Bus, a Serial Advanced Technology Attachment (SATA) Bus, a video electronics standards association local (VLB) Bus, or other suitable Bus, or a combination of two or more of the above. Bus 940 may include one or more buses, where appropriate. Although embodiments of the present application describe and illustrate a particular bus, the present application contemplates any suitable bus or interconnect.
The electronic device may execute the face image processing method in the embodiment of the present application after acquiring at least one first image acquired by the camera through the entity camera node, thereby implementing the face image processing method described in connection with fig. 3 to 4 and the face image processing apparatus described in connection with fig. 8.
In addition, in combination with the face image processing method in the above embodiment, the embodiment of the application may be implemented by providing a computer storage medium. The computer storage medium has stored thereon computer program instructions; the computer program instructions, when executed by a processor, implement any of the face image processing methods of the above embodiments.
It should be clear that the present application is not limited to the particular arrangements and processes described above and illustrated in the drawings. For the sake of brevity, a detailed description of known methods is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present application are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications, and additions, or change the order between steps, after appreciating the spirit of the present application.
The functional blocks shown in the above-described structural block diagrams may be implemented in hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), suitable firmware, a plug-in, a function card, or the like. When implemented in software, the elements of the present application are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine readable medium or transmitted over transmission media or communication links by a data signal carried in a carrier wave. A "machine-readable medium" may include any medium that can store or transfer information. Examples of machine-readable media include electronic circuitry, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio Frequency (RF) links, and the like. The code segments may be downloaded via computer networks such as the internet, intranets, etc.
It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, the present application is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be different from the order in the embodiments, or several steps may be performed simultaneously.
Aspects of embodiments of the present application are described above with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions/acts specified in the flowchart and/or block diagram block or blocks. Such a processor may be, but is not limited to being, a general purpose processor, a special purpose processor, an application specific processor, or a field programmable logic circuit. It will also be understood that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware which performs the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In the foregoing, only the specific embodiments of the present application are described, and it will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the systems, modules and units described above may refer to the corresponding processes in the foregoing method embodiments, which are not repeated herein. It should be understood that the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present application, which are intended to be included in the scope of the present application.

Claims (10)

1. The face image processing method is characterized by being applied to electronic equipment, wherein the electronic equipment comprises a Central Processing Unit (CPU) and a Network Processor (NPU), the CPU is connected with the NPU, and the electronic equipment is connected with a camera, and the method comprises the following steps:
acquiring at least one first image acquired by the camera through a physical camera node;
transmitting each first image to the NPU so that the NPU performs face detection on each first image to obtain face parameters of each first image;
processing each first image according to the face parameters sent by the NPU to obtain at least one target image;
and writing each target image into at least one virtual camera node so as to display the corresponding target image on a display screen of the electronic device through each virtual camera node.
2. The method of claim 1, wherein the face parameters include a number of faces and a face position;
and processing each first image according to the face parameters sent by the NPU to obtain at least one target image, including:
determining an image processing mode of each first image according to the display mode of the target image;
Generating at least one face clipping frame according to the number of faces, the face positions and the display mode;
cutting at least one face in the first image according to each face cutting frame to obtain a second image corresponding to each face;
and processing each second image according to the image processing mode to obtain at least one target image.
3. The method of claim 2, wherein the generating at least one face cropping frame based on the number of faces and the face position, and the display mode comprises:
generating a first face clipping frame according to the face position under the condition that the display mode is a view finding mode and the number of faces is 1;
generating a second face clipping frame according to the face positions of the faces when the display mode is a view finding mode and the number of the faces is greater than 1;
and generating a third face clipping frame corresponding to each face according to the face position of each face under the condition that the display mode is a jigsaw mode and the number of the faces is larger than 1.
4. The method according to claim 2, wherein said processing each of said second images according to said image processing means to obtain at least one target image comprises:
Determining a second image corresponding to the face as a target image when the display mode is a view finding mode;
performing scaling processing on the second image corresponding to each face under the condition that the display mode is a jigsaw mode;
and filling the scaled second image into a preset area according to a preset image filling rule to obtain a target image, wherein the size of the preset area is matched with the size of the display screen.
5. The method of claim 2, wherein prior to generating at least one face trim frame based on the number of faces and the face position, and the display mode, the method further comprises:
receiving an operation instruction sent by at least one application of the electronic equipment, wherein the operation instruction is generated by each application based on the operation of a user on the display screen;
and determining a display mode of the target image according to the operation instruction.
6. The method of claim 1, wherein after writing each of the target images to at least one virtual camera node to display a corresponding target image on a display screen of the electronic device through each of the virtual camera nodes, the method further comprises:
Receiving an image reading request sent by at least one application of the electronic equipment, wherein the image reading request comprises image parameters of a first target image;
responding to the image reading request, and determining a target virtual camera node where the first target image is located according to the image parameter;
and sending the first target image on the target virtual camera node to a corresponding application.
7. The method of any of claims 1-6, wherein prior to the acquiring, by the physical camera node, the at least one first image acquired by the camera, the method further comprises:
a physical camera node and at least one virtual camera node are created.
8. A facial image processing apparatus, characterized in that it is applied to an electronic device, the electronic device includes a central processing unit CPU and a network processor NPU, the CPU is connected with the NPU, the electronic device is connected with a camera, the apparatus includes:
the acquisition module is used for acquiring at least one first image acquired by the camera through the entity camera node;
the sending module is used for sending each first image to the NPU so that the NPU carries out face detection on each first image to obtain face parameters of each first image;
The processing module is used for processing each first image according to the face parameters sent by the NPU to obtain at least one target image;
and the writing module is used for writing each target image into at least one virtual camera node so as to display the corresponding target image on a display screen of the electronic equipment through each virtual camera node.
9. An electronic device, comprising:
a processor;
a memory for storing computer program instructions;
the touch screen is used for receiving and displaying the hand-drawn lines;
the computer program instructions, when executed by the processor, implement the method of any of claims 1-7.
10. A computer readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the method of any of claims 1-7.
CN202311579053.9A 2023-11-23 2023-11-23 Face image processing method, device, equipment and storage medium Pending CN117593777A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311579053.9A CN117593777A (en) 2023-11-23 2023-11-23 Face image processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311579053.9A CN117593777A (en) 2023-11-23 2023-11-23 Face image processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117593777A true CN117593777A (en) 2024-02-23

Family

ID=89919588

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311579053.9A Pending CN117593777A (en) 2023-11-23 2023-11-23 Face image processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117593777A (en)

Similar Documents

Publication Publication Date Title
US10110936B2 (en) Web-based live broadcast
CN110809101B (en) Image zooming processing method and device, electronic equipment and storage medium
WO2021179826A1 (en) Image processing method and related product
CN107295352B (en) Video compression method, device, equipment and storage medium
CN111866577B (en) Screen recording method, electronic device and computer readable storage medium
CN108965692B (en) Sticker setting method and device
CN105049695A (en) Video recording method and device
KR20200011000A (en) Device and method for augmented reality preview and positional tracking
CN114979785B (en) Video processing method, electronic device and storage medium
CN111415371B (en) Sparse optical flow determination method and device
CN111988526B (en) Mobile terminal and image data processing method
CN113706555A (en) Video frame processing method and device, electronic equipment and storage medium
CN105554375A (en) Method and device of video preview in digital video recorder
CN117593777A (en) Face image processing method, device, equipment and storage medium
CN109309784B (en) Mobile terminal
WO2022161261A1 (en) Image display method and apparatus, and electronic device
CN113506320B (en) Image processing method and device, electronic equipment and storage medium
CN115766988A (en) Video preview method, device and equipment and storage medium
CN112887515B (en) Video generation method and device
CN114339071A (en) Image processing circuit, image processing method and electronic device
CN108874343B (en) Preview window sharing method and device
CN113315913A (en) Image sensor control method and related product
CN112269957A (en) Picture processing method, device, equipment and storage medium
CN108924410B (en) Photographing control method and related device
CN112601029A (en) Video segmentation method, terminal and storage medium with known background prior information

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