[go: up one dir, main page]

CN109729268B - Face shooting method, device, equipment and medium - Google Patents

Face shooting method, device, equipment and medium Download PDF

Info

Publication number
CN109729268B
CN109729268B CN201811602998.7A CN201811602998A CN109729268B CN 109729268 B CN109729268 B CN 109729268B CN 201811602998 A CN201811602998 A CN 201811602998A CN 109729268 B CN109729268 B CN 109729268B
Authority
CN
China
Prior art keywords
face
target image
image
main face
unit
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811602998.7A
Other languages
Chinese (zh)
Other versions
CN109729268A (en
Inventor
张征
周一帆
廖军
杨培凯
许江
石晶
詹志海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Lanchuang Information Technology Co ltd
Original Assignee
Wuhan Lanchuang 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 Wuhan Lanchuang Information Technology Co ltd filed Critical Wuhan Lanchuang Information Technology Co ltd
Priority to CN201811602998.7A priority Critical patent/CN109729268B/en
Publication of CN109729268A publication Critical patent/CN109729268A/en
Application granted granted Critical
Publication of CN109729268B publication Critical patent/CN109729268B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Studio Devices (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a face shooting method, a face shooting device, electronic equipment and a medium, wherein the method comprises the following steps: acquiring a target image through a camera unit, and identifying a main face in the target image; if the main face is identified, determining the position of the main face on the target image; controlling the camera shooting unit to move according to the position so that the image of the main face is positioned in the middle of the image shot by the camera shooting unit; if the human face is not recognized in the target image, starting reset timing, and continuously acquiring images by the camera unit in the reset timing process; and if no human face is recognized in the images acquired within the first preset time after the reset timing is started, controlling the camera shooting unit to reset to the initial position. The invention solves the technical problem that face information is always missed to be collected in the camera unit of the self-service machine in the prior art. The technical effects of improving the acquisition quality of the main face and avoiding missing acquisition are achieved.

Description

Face shooting method, device, equipment and medium
Technical Field
The invention relates to the technical field of computers, in particular to a face shooting method, a face shooting device, face shooting equipment and a face shooting medium.
Background
At present, with the rapid development of the internet technology, various self-service machines enter the work and life of people, and great convenience and high efficiency are brought. For example, a bank's automated teller machine, a hospital's self-service kiosk, an airport's automated print boarding pass machine, or a hotel kiosk, etc.
For safety reasons, these self-service machines or self-service systems often have a camera unit to collect face information of the user for interfacing with the police department or the service provider. However, in the actual use process, due to the height difference of different users, the height difference of different self-service machines of different systems, the difference of the use posture habit of different users, and the like, part of the human face cannot be collected.
Therefore, the camera unit on the existing self-service machine often has the technical problem that the face information is missed to be collected.
Disclosure of Invention
The embodiment of the application provides a face shooting method, a face shooting device, face shooting equipment and a face shooting medium, and solves or partially solves the technical problem that face information is always missed to be collected in a camera unit on an existing self-service machine.
In a first aspect, a face shooting method is provided, including:
acquiring a target image through a camera unit, and identifying a main face in the target image;
if a primary face is identified, determining the position of the primary face on the target image; controlling the camera shooting unit to move according to the position so that the image of the main face is positioned in the middle of the image shot by the camera shooting unit;
if the human face is not recognized in the target image, starting reset timing, and continuously acquiring images by the camera unit in the reset timing process; and if no human face is recognized in the images acquired within the first preset time after the reset timing is started, controlling the camera shooting unit to reset to the initial position.
Optionally, the identifying a main face in the target image includes: recognizing a human face in the target image; if a plurality of faces are identified in the target image, acquiring a position parameter and a size parameter of each face in the target image; and determining a main face from the plurality of faces according to the position parameters and the size parameters.
Optionally, the position parameter is a distance between a center point of the corresponding face and a center point of the target image, or the position parameter is a preset marking value of an area where the corresponding face is located in the target image; the size parameter is the area of the region occupied by the corresponding face on the target image, or the size parameter is the horizontal width of the region occupied by the corresponding face on the target image.
Optionally, the determining a main face from the plurality of faces according to the position parameter and the size parameter includes: calculating the difference value of subtracting the position parameter from the size parameter of each face, and taking the face with the largest difference value as the main face; or, calculating a ratio of the size parameter divided by the position parameter of each face, and taking the face with the largest ratio as the main face; or determining the area of each face according to the position parameters, and taking the face with the largest size parameter in a preset central area as the main face.
Optionally, the controlling the camera unit to move according to the position includes: determining a target area where the main face is located in the target image according to the position of the main face in the target image, wherein the target image is divided into a plurality of areas in a preset mode; controlling the camera shooting unit to move according to a preset moving direction and a preset moving distance corresponding to the target area; or determining the relative position relation between the main face and the center of the target image according to the position of the main face in the target image; controlling the camera shooting unit to move according to the relative position relation; or determining the movement trend of the position of the main face according to the position of the main face in the target image and combining the position of the main face in the front image or the rear image; controlling the camera unit to move according to the movement trend; the front image is an image acquired by the image pickup unit before the target image is acquired, and the rear image is an image acquired by the image pickup unit after the target image is acquired.
Optionally, the controlling the image capturing unit to reset to the initial position includes: the control unit sends a reset message to the serial port and starts a reset monitoring function to monitor whether a serial port response of the camera unit after reset is received or not, wherein the control unit is communicated with the camera unit through the serial port; if the serial port response is received, the reset monitoring function is closed; and if the serial port response is not received within a second preset time length after the reset message is sent, retransmitting the reset message to the serial port.
In a second aspect, a face shooting device is provided, which includes:
the acquisition module is used for acquiring a target image through a camera unit and identifying a main face in the target image;
the control module is used for determining the position of the main face on the target image if the main face is identified; controlling the camera shooting unit to move according to the position so that the image of the main face is positioned in the middle of the image shot by the camera shooting unit;
the reset module is used for starting reset timing if the human face is not recognized in the target image, and the image pickup unit continues to acquire images in the reset timing process; and if no human face is recognized in the images acquired within the first preset time after the reset timing is started, controlling the camera shooting unit to reset to the initial position.
Optionally, the obtaining module is further configured to: recognizing a human face in the target image; if a plurality of faces are identified in the target image, acquiring a position parameter and a size parameter of each face in the target image; and determining a main face from the plurality of faces according to the position parameters and the size parameters.
In a third aspect, an electronic device is provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, the method of any one of the first aspect is implemented.
In a fourth aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of any of the first aspects.
One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
according to the face shooting method, the face shooting device, the face shooting equipment and the face shooting medium, after the main face is recognized in the target image acquired by the camera shooting unit, the camera shooting unit is controlled to move according to the position of the main face, so that the image of the main face is located in the position, which is more striking, in the middle of the image shot by the camera shooting unit, the collection quality of the main face is improved, and face missing collection is avoided. Further, if the human face is not recognized in the target image, resetting timing is started, if the human face is not shot in the first preset time after the resetting timing is started, the camera shooting unit is controlled to reset to the initial position, so that the camera shooting unit is prevented from moving to a position where the human face is difficult to capture, and the human face is further prevented from being collected in a missing mode.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a flowchart of a face shooting method in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a face shooting device in the embodiment of the present application;
FIG. 3 is a schematic structural diagram of an electronic device in an embodiment of the present application;
fig. 4 is a schematic structural diagram of a computer-readable storage medium in an embodiment of the present application.
Detailed Description
The embodiment of the application provides a face shooting method, a face shooting device, face shooting equipment and a face shooting medium, and solves or partially solves the technical problem that face information is easy to miss-collect in a shooting unit of an existing self-service machine. The technical effects of improving the acquisition quality of the main face and avoiding missing acquisition are achieved.
In order to solve the technical problems, the general idea of the embodiment of the application is as follows:
acquiring a target image through a camera unit, and identifying a main face in the target image;
if a primary face is identified, determining the position of the primary face on the target image; controlling the camera shooting unit to move according to the position so that the image of the main face is positioned in the middle of the image shot by the camera shooting unit;
if the human face is not recognized in the target image, starting reset timing, and continuously acquiring images by the camera unit in the reset timing process; and if no human face is recognized in the images acquired within the first preset time after the reset timing is started, controlling the camera shooting unit to reset to the initial position.
Specifically, after a main face is recognized in a target image acquired by a camera unit, the camera unit is controlled to move according to the position of the main face, so that an image of the main face is positioned in a more striking position in the middle of the image shot by the camera unit, the acquisition quality of the main face is improved, and missing acquisition of the face is avoided. Further, if the human face is not recognized in the target image, resetting timing is started, if the human face is not shot in the first preset time after the resetting timing is started, the camera shooting unit is controlled to reset to the initial position, so that the camera shooting unit is prevented from moving to a position where the human face is difficult to capture, and the human face is further prevented from being collected in a missing mode.
In order to better understand the technical solution, the technical solution will be described in detail with reference to the drawings and the specific embodiments.
Example one
As shown in fig. 1, the present embodiment provides a face shooting method, including:
step S101, acquiring a target image through a camera unit, and identifying a main face in the target image;
step S102, if a main face is identified, determining the position of the main face on the target image; controlling the camera shooting unit to move according to the position so that the image of the main face is positioned in the middle of the image shot by the camera shooting unit;
step S103, if no human face is recognized in the target image, resetting timing is started, and the image pickup unit continues to acquire images in the process of resetting timing; and if no human face is recognized in the images acquired within the first preset time after the reset timing is started, controlling the camera shooting unit to reset to the initial position.
It should be noted that the method provided in this embodiment may be applied to face shooting control of a camera unit on a self-service machine, may also be applied to face shooting control of a camera unit on a communication device such as a computer and a mobile phone, and may also be applied to face shooting control of a camera unit of a monitoring system, which is not limited herein.
The system to which the method is applied comprises: the device comprises a camera shooting unit and a control unit, wherein the camera shooting unit is used for shooting and acquiring images, and the control unit is used for identifying faces in the images, identifying main faces and controlling the movement of the camera shooting unit. The camera unit and the control unit may be separately and independently placed, or may be integrated into one device, which is not limited herein.
The following describes in detail specific implementation steps of the method for controlling an image capturing unit according to this embodiment with reference to fig. 1:
step S101, a target image is obtained through a camera unit, and a main face in the target image is identified.
In a specific implementation process, the camera unit may be continuously in an image shooting state, or may enter the image shooting state when a sensor is arranged to detect that a person approaches. After the camera shooting unit shoots a target image, the target image is transmitted to the control unit through the serial port, and the control unit can be a chip or a single chip microcomputer and the like. The control unit analyzes and recognizes a face in the target image.
In order to avoid communication between the camera unit and the control unit from being failed, serial handshaking can be performed before the camera unit is opened every time, namely, the program in the camera unit and the control unit perform one-time handshaking communication to ensure smooth communication between the program and the control unit, and the program sends a request message to the serial port every time and receives a response message from the serial port.
The control unit may use a face recognition technology for face recognition. Specifically, a deep learning algorithm or a feature matching algorithm may be used to perform face recognition. Taking the deep learning algorithm as an example, the deep learning technology can be adopted to extract the portrait feature points from the video and the photo, and the principle of the biometry is utilized to analyze and establish a mathematical model, namely a facial feature template. And performing feature analysis by using the established face feature template and the face image of the person to be detected, giving a similarity value according to the analysis result, finally searching the best matching face feature template, and identifying the face in the image or the video.
In the embodiment of the present application, recognizing the main face includes two cases, one is to recognize only one face, and this case may use the recognized face as the main face. The other is that a plurality of faces are recognized, the determination of the main face is required, and the specific determination process may be: if a plurality of faces are identified in the target image, acquiring a position parameter and a size parameter of each face in the target image; and determining a main face from the plurality of faces according to the position parameters and the size parameters.
There are various setting methods for the position parameter and the size parameter of the face recognized from the target image.
For example: the position parameter of the face can be the distance between the center point of the face and the center point of the target image; or the position parameter may be a preset indication value of the region where the face is located in the target image, that is, different values are set as indication values for different regions in advance, and the size of the indication value is positively correlated with the distance between the region and the center of the target image, and so on. The size parameter of the face is the area of the region occupied by the face on the target image, or the size parameter is the horizontal width of the region occupied by the face on the target image, and the like.
In the above example, the position parameter of the face is positively correlated with the distance between the center of the face and the center of the target image, and in the implementation process, the position parameter may also be set to be inversely correlated, for example, the position parameter is the inverse of the distance between the center of the face and the center of the target image, and is not limited herein. In the above example, the size parameter of the face is positively correlated with the size of the face on the target image, or may be set to be inversely correlated, for example, the size parameter of the face is the inverse of the area of the region occupied by the face on the target image, which is not limited herein, and is not listed.
In the specific implementation process, the physical meanings of the position parameters and the size parameters are different, and/or shooting scenes are different, and corresponding methods for determining the main face are different, but the general idea is as follows: the closer the face is to the center of the target image, the greater the chance that the face is selected as the primary face; the larger the size a face occupies on the target image, the greater the chance that the face is selected as the primary face. That is, a face closer to the center of the target image and occupying a larger size on the target image is selected as the main face.
In the following, taking the case that the position parameter of the face is positively correlated to the distance between the face and the target image center, and the size parameter of the face is positively correlated to the size of the face on the target image as an example, three methods for determining the main face are listed:
first, a difference value of a size parameter minus a position parameter of each face is calculated, and the face with the largest difference value is taken as the main face.
The size of the face on the target image is the positive correlation determining factor of the main face, and the position of the face on the target image according to the center of the image is the negative correlation determining factor of the main face.
For example, suppose that a face a and a face B are recognized, the position parameter is the distance between the face and the center of the target image, and the size parameter is the lateral width of the region occupied by the face on the target image. Wherein, the position parameter of the face A is 2cm, the position parameter of the face B is 1.5cm, the size parameter of the face A is 4, and the size parameter of the face B is 2, the face A is taken as the main face, because 4-2 is larger than 2-1.5.
If the number of the faces with the largest difference calculated by the method is multiple, the face with the largest size or the face closest to the center can be set as the main face.
Secondly, calculating the ratio of the size parameter divided by the position parameter of each face, and taking the face with the largest ratio as the main face.
The size of the face on the target image is the positive correlation determining factor of the main face, and the position of the face on the target image according to the center of the image is the negative correlation determining factor of the main face.
For example, suppose that a face a and a face B are recognized, the position parameter is the distance between the face and the center of the target image, and the size parameter is the lateral width of the region occupied by the face on the target image. Wherein, the position parameter of the face a is 2cm, the position parameter of the face B is 1.5cm, the size parameter of the face a is 4, and the size parameter of the face B is 2, the face a is taken as the main face, because 4/2 is greater than 2/1.5.
If the number of the faces with the maximum ratio calculated by the method is multiple, the face with the closest center or the largest size can be set as the main face.
Thirdly, determining the area of each face according to the position parameters, and taking the face with the largest size parameter in a preset central area as the main face.
The method comprises the steps of presetting a central area, determining the face in the central area according to the position parameters of each face, and then taking the face with the largest size parameter in the preset central area as the main face. The method is characterized in that the size of the face on the target image is the positive correlation determining factor of the main face, and the position of the face on the target image according to the center of the image is the negative correlation determining factor of the main face.
For example, a preset central area is assumed to be an area within 4cm of the center, a human face a, a human face B and a human face C are recognized, the position parameter is the distance of the human face from the center of the target image, and the size parameter is the transverse width of the area occupied by the human face on the target image. The position parameter of the face A is 2cm, the position parameter of the face B is 3cm, and the position parameter of the face C is 5 cm. And if the size parameter of the face A is 2, the size parameter of the face B is 4 and the size parameter of the face C is 3, determining the faces in the central area as the face A and the face B according to the position parameters, and taking the face B as a main face because the size parameters are larger.
Certainly, in a specific implementation process, the manners of determining the main face according to the position parameter and the size parameter are not limited to the three manners, and are not limited herein, and are not listed.
Step S102, if a main face is identified, determining the position of the main face on the target image; and controlling the camera shooting unit to move according to the position so as to enable the image of the main face to be positioned in the middle of the image shot by the camera shooting unit.
Specifically, the image pickup unit may be controlled to move to a target position so that the main face is located at a central position in an image acquired at the target position by the image pickup unit to highlight the main face and improve the acquisition quality thereof.
In a specific implementation process, there may be a plurality of methods for controlling the movement of the camera unit according to the position of the main face in the target image, and three methods are listed as follows:
first, the zone.
The method comprises the steps of determining a target area where a main face is located in a target image according to the position of the main face in the target image, wherein the target image is divided into a plurality of areas in a preset mode, and then controlling the camera unit to move according to a preset moving direction and a preset moving distance corresponding to the target area.
For example, the height of the image captured by the camera unit may be divided into five equal parts in advance, and if the center point of the position of the main avatar is located in the middle fifth of the target image, it is determined that the avatar of the user is centered and the camera does not need to move; if the central point of the head portrait is located in the upper two fifths area, it is judged that the head portrait is on the upper side, the angle of the camera needs to be adjusted upwards, the program sends an up-regulation message to the serial port, and the up-regulation distance is positively correlated with the distance of the area where the head portrait is located according to the central area; similarly, if the central point is located in the two fifths area of the lower side, the camera needs to adjust the angle downwards, the program sends a down-regulation message to the serial port, and the down-regulation distance is inversely related to the distance of the area where the camera is located according to the central area.
Second, in relative positional relationship from the center.
Namely, the relative position relationship between the main face and the center of the target image is determined according to the position of the main face in the target image, and then the camera shooting unit is controlled to move according to the relative position relationship.
Specifically, after the image pickup unit acquires the target image, the image pickup unit may recognize the center position of the displayed area of the main face in the target image, obtain a vector with the center of the image as a starting point and the center of the main face as an end point, generate a control instruction according to the vector, and control the camera to move in the direction indicated by the vector.
Third, multiple pictures determine the location of the movement.
Firstly, determining the movement trend of the position of the main face according to the position of the main face in the target image and combining the position of the main face in a front image or a rear image; controlling the camera unit to move according to the movement trend; the front image is an image acquired by the image pickup unit before the target image is acquired, and the rear image is an image acquired by the image pickup unit after the target image is acquired.
Other images are captured by the camera unit before or after the target image, and the camera is controlled to move according to the moving trend of the main face in the images shot by the camera unit along with the time sequence. For example, assuming that the main face is located below the image in the front image captured before the image capturing unit, as the user approaches, the position of the main face in the target image moves upward relative to the position in the front image, and the image capturing unit may be controlled to move upward accordingly, so as to prevent the face from moving out of the capturing range. Namely, the human face moves upwards in the image shot by the camera shooting unit along with time, and then the camera shooting unit is controlled to move upwards to adapt to the trend of the human face movement.
Of course, in the implementation process, the manner of controlling the movement of the camera unit is not limited to the above three, and is not limited herein, and is not listed.
Step S103, if no human face is recognized in the target image, resetting timing is started, and the image pickup unit continues to acquire images in the process of resetting timing; and if no human face is recognized in the images acquired within the first preset time after the reset timing is started, controlling the camera shooting unit to reset to the initial position.
Specifically, a reset function may be provided to prevent the face from being captured normally after the imaging unit has moved to a position shifted from the normal range. The resetting of step S103 has no precedence relationship limitation with step S102.
If the human face is not recognized in the target image shot by the camera shooting unit, resetting timing is started, the camera shooting unit continues to acquire images in the resetting timing process, and if the human face is not recognized in the images acquired within the first preset time after the resetting timing is started, the camera shooting unit is controlled to reset to the initial position.
Specifically, the controlling the camera unit to reset to the initial position includes: the control unit sends a reset message to the serial port and starts a reset monitoring function to monitor whether a serial port response of the camera unit after reset is received or not, wherein the control unit is communicated with the camera unit through the serial port; if the serial port response is received, the reset monitoring function is closed; and if the serial port response is not received within a second preset time length after the reset message is sent, retransmitting the reset message to the serial port.
For example, if the image of the target captured by the image capturing unit does not have a human face, the image capturing unit does not need to move, and the monitoring start timer is reset. If no human face is detected within 60s, the camera shooting unit is reset, namely a reset message is sent to the serial port, after the message is sent, a return message of the serial port, namely serial port response, is waited, if the return message is received, the reset is represented to be completed, and if the waiting time exceeds 10s, the reset message is retransmitted once and the reset operation is completed.
Based on the same inventive concept, the application provides a device corresponding to the method of the first embodiment, which is detailed in the second embodiment.
Example two
The present embodiment provides a face shooting device, as shown in fig. 2, including:
an obtaining module 201, configured to obtain a target image through a camera unit, and identify a main face in the target image;
a control module 202, configured to determine, if a primary face is identified, a position of the primary face on the target image; controlling the camera shooting unit to move according to the position so that the image of the main face is positioned in the middle of the image shot by the camera shooting unit;
the reset module 203 is configured to start reset timing if a human face is not recognized in the target image, and the image capturing unit continues to acquire an image during the reset timing; and if no human face is recognized in the images acquired within the first preset time after the reset timing is started, controlling the camera shooting unit to reset to the initial position.
In this embodiment of the application, the obtaining module 201 is further configured to:
recognizing a human face in the target image;
if a plurality of faces are identified in the target image, acquiring a position parameter and a size parameter of each face in the target image;
and determining a main face from the plurality of faces according to the position parameters and the size parameters.
Since the apparatus described in this embodiment is an apparatus for implementing the method in the first embodiment of the present application, a person skilled in the art can understand the specific implementation manner of the apparatus in this embodiment and various variations thereof based on the method described in the first embodiment of the present application, and therefore, how to implement the method in the first embodiment of the present application by the apparatus is not described in detail herein. The apparatus used by those skilled in the art to implement the method in the first embodiment of the present application is within the scope of the present application.
Based on the same inventive concept, the application provides an embodiment of the device corresponding to the first embodiment, which is detailed in the third embodiment.
EXAMPLE III
The present embodiment provides an electronic device, as shown in fig. 3, including a memory 310, a processor 320, and a computer program 311 stored in the memory 310 and executable on the processor 320, where the processor 320 executes the computer program 311 to implement the following steps:
acquiring a target image through a camera unit, and identifying a main face in the target image;
if a primary face is identified, determining the position of the primary face on the target image; controlling the camera shooting unit to move according to the position so that the image of the main face is positioned in the middle of the image shot by the camera shooting unit;
if the human face is not recognized in the target image, starting reset timing, and continuously acquiring images by the camera unit in the reset timing process; and if no human face is recognized in the images acquired within the first preset time after the reset timing is started, controlling the camera shooting unit to reset to the initial position.
In particular, when the processor 320 executes the computer program 311, any one of the first embodiment can be implemented.
Since the electronic device described in this embodiment is a device used for implementing the method in the first embodiment of the present application, based on the method described in the first embodiment of the present application, a specific implementation of the electronic device in this embodiment and various variations thereof can be understood by those skilled in the art, and therefore, how to implement the method in the first embodiment of the present application by the electronic device is not described in detail herein. The equipment used by those skilled in the art to implement the methods in the embodiments of the present application is within the scope of the present application.
Based on the same inventive concept, the application provides a storage medium corresponding to the fourth embodiment, which is described in detail in the fourth embodiment.
Example four
The present embodiment provides a computer-readable storage medium 400, as shown in fig. 4, on which a computer program 411 is stored, which computer program 411, when being executed by a processor, realizes the steps of:
acquiring a target image through a camera unit, and identifying a main face in the target image;
if a primary face is identified, determining the position of the primary face on the target image; controlling the camera shooting unit to move according to the position so that the image of the main face is positioned in the middle of the image shot by the camera shooting unit;
if the human face is not recognized in the target image, starting reset timing, and continuously acquiring images by the camera unit in the reset timing process; and if no human face is recognized in the images acquired within the first preset time after the reset timing is started, controlling the camera shooting unit to reset to the initial position.
In a specific implementation, when the computer program 411 is executed by a processor, any one of the first embodiment may be implemented.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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, embedded processor, 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, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (3)

1. A face shooting method is characterized by comprising the following steps:
acquiring a target image through a camera unit, and identifying a main face in the target image;
if a primary face is identified, determining the position of the primary face on the target image; controlling the camera shooting unit to move according to the position so that the image of the main face is positioned in the middle of the image shot by the camera shooting unit;
if the human face is not recognized in the target image, starting reset timing, and continuously acquiring images by the camera unit in the reset timing process; if no human face is recognized in the image acquired within a first preset time after the reset timing is started, controlling the camera shooting unit to reset to an initial position;
the recognizing a main face in the target image comprises:
recognizing a human face in the target image;
if a plurality of faces are identified in the target image, acquiring a position parameter and a size parameter of each face in the target image;
determining a main face from the plurality of faces according to the position parameters and the size parameters;
the position parameter is the distance between the center point of the corresponding face and the center point of the target image, or the position parameter is a preset marking value of the area of the corresponding face in the target image;
the size parameter is the area of the region occupied by the corresponding face on the target image, or the size parameter is the horizontal width of the region occupied by the corresponding face on the target image;
the determining a main face from the plurality of faces according to the position parameter and the size parameter includes:
calculating the difference value of subtracting the position parameter from the size parameter of each face, and taking the face with the largest difference value as the main face; or,
calculating a ratio of the size parameter divided by the position parameter of each face, and taking the face with the largest ratio as the main face; or,
determining the area of each face according to the position parameters, and taking the face with the largest size parameter in a preset central area as the main face;
the controlling the camera unit to move according to the position comprises:
determining a target area where the main face is located in the target image according to the position of the main face in the target image, wherein the target image is divided into a plurality of areas in a preset mode; controlling the camera shooting unit to move according to a preset moving direction and a preset moving distance corresponding to the target area; or,
determining the relative position relation between the main face and the center of the target image according to the position of the main face in the target image; controlling the camera shooting unit to move according to the relative position relation; or,
determining the movement trend of the position of the main face according to the position of the main face in the target image and combining the position of the main face in the front image or the rear image; controlling the camera unit to move according to the movement trend; the front image is an image acquired by the camera unit before the target image is acquired, and the rear image is an image acquired by the camera unit after the target image is acquired;
the controlling the camera unit to reset to an initial position includes:
the control unit sends a reset message to the serial port and starts a reset monitoring function to monitor whether a serial port response of the camera unit after reset is received or not, wherein the control unit is communicated with the camera unit through the serial port;
if the serial port response is received, the reset monitoring function is closed;
and if the serial port response is not received within a second preset time length after the reset message is sent, retransmitting the reset message to the serial port.
2. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of claim 1 when executing the program.
3. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of claim 1.
CN201811602998.7A 2018-12-26 2018-12-26 Face shooting method, device, equipment and medium Active CN109729268B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811602998.7A CN109729268B (en) 2018-12-26 2018-12-26 Face shooting method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811602998.7A CN109729268B (en) 2018-12-26 2018-12-26 Face shooting method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN109729268A CN109729268A (en) 2019-05-07
CN109729268B true CN109729268B (en) 2021-03-02

Family

ID=66297284

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811602998.7A Active CN109729268B (en) 2018-12-26 2018-12-26 Face shooting method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN109729268B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110245561B (en) * 2019-05-09 2021-11-09 深圳市锐明技术股份有限公司 Face recognition method and device
CN111083377A (en) * 2019-12-30 2020-04-28 维沃移动通信有限公司 Shooting method and electronic equipment
CN115171197B (en) * 2022-09-01 2023-05-16 广州市森锐科技股份有限公司 High-precision image information identification method, system, equipment and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102625036A (en) * 2011-01-25 2012-08-01 株式会社尼康 Image processing device, imaging device, and recording medium
CN103501411A (en) * 2013-10-09 2014-01-08 中科创达软件股份有限公司 Image shooting method and system
CN103607537A (en) * 2013-10-31 2014-02-26 北京智谷睿拓技术服务有限公司 Control method of camera and the camera
CN105554391A (en) * 2015-12-31 2016-05-04 广州广电运通金融电子股份有限公司 Camera control method and device and financial equipment terminal
CN105654512A (en) * 2015-12-29 2016-06-08 深圳羚羊微服机器人科技有限公司 Target tracking method and device
CN105898136A (en) * 2015-11-17 2016-08-24 乐视致新电子科技(天津)有限公司 Camera angle adjustment method, system and television
CN106713773A (en) * 2017-03-31 2017-05-24 联想(北京)有限公司 Shooting control method and electronic device
CN107257440A (en) * 2017-07-31 2017-10-17 深圳回收宝科技有限公司 It is a kind of to detect method, equipment and storage medium that video tracking is shot
CN107563979A (en) * 2017-08-31 2018-01-09 广东欧珀移动通信有限公司 Image processing method, device, computer-readable recording medium and computer equipment
CN108024065A (en) * 2017-12-28 2018-05-11 努比亚技术有限公司 A kind of method of terminal taking, terminal and computer-readable recording medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103905733B (en) * 2014-04-02 2018-01-23 哈尔滨工业大学深圳研究生院 A kind of method and system of monocular cam to real time face tracking

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102625036A (en) * 2011-01-25 2012-08-01 株式会社尼康 Image processing device, imaging device, and recording medium
CN103501411A (en) * 2013-10-09 2014-01-08 中科创达软件股份有限公司 Image shooting method and system
CN103607537A (en) * 2013-10-31 2014-02-26 北京智谷睿拓技术服务有限公司 Control method of camera and the camera
CN105898136A (en) * 2015-11-17 2016-08-24 乐视致新电子科技(天津)有限公司 Camera angle adjustment method, system and television
CN105654512A (en) * 2015-12-29 2016-06-08 深圳羚羊微服机器人科技有限公司 Target tracking method and device
CN105554391A (en) * 2015-12-31 2016-05-04 广州广电运通金融电子股份有限公司 Camera control method and device and financial equipment terminal
CN106713773A (en) * 2017-03-31 2017-05-24 联想(北京)有限公司 Shooting control method and electronic device
CN107257440A (en) * 2017-07-31 2017-10-17 深圳回收宝科技有限公司 It is a kind of to detect method, equipment and storage medium that video tracking is shot
CN107563979A (en) * 2017-08-31 2018-01-09 广东欧珀移动通信有限公司 Image processing method, device, computer-readable recording medium and computer equipment
CN108024065A (en) * 2017-12-28 2018-05-11 努比亚技术有限公司 A kind of method of terminal taking, terminal and computer-readable recording medium

Also Published As

Publication number Publication date
CN109729268A (en) 2019-05-07

Similar Documents

Publication Publication Date Title
JP6610906B2 (en) Activity detection method and device, and identity authentication method and device
US11006864B2 (en) Face detection device, face detection system, and face detection method
US10956715B2 (en) Decreasing lighting-induced false facial recognition
CN108124486A (en) Face living body detection method based on cloud, electronic device and program product
CN109729268B (en) Face shooting method, device, equipment and medium
WO2016187985A1 (en) Photographing device, tracking photographing method and system, and computer storage medium
CN110688914A (en) Gesture recognition method, intelligent device, storage medium and electronic device
US20150124277A1 (en) Information processing apparatus, information processing method, and non-transitory computer readable medium
CN104541498B (en) A kind of image-pickup method and device
CN108986245A (en) Work attendance method and terminal based on recognition of face
CN104519261B (en) information processing method and electronic equipment
JP2011095862A (en) Apparatus and method for processing image and program
CN110533015A (en) Verification method, verification device, electronic equipment and computer-readable storage medium
CN109788193B (en) Camera unit control method
CN104063041B (en) A kind of information processing method and electronic equipment
KR102576795B1 (en) Method for obtaining frontal image based on pose estimation and apparatus using the same
JP2018113660A (en) Information processing device, information processing method, and system
CN107749951A (en) A visual perception method and system for unmanned photography
CN115334241B (en) Focusing control method, device, storage medium and image pickup apparatus
CN110249340A (en) Face registration method, face identification device, identification equipment and can storage medium
CN109492585A (en) A kind of biopsy method and electronic equipment
CN110249339A (en) A kind of face registration method, face registration device, server and can storage medium
JP6471924B2 (en) Face authentication apparatus and face authentication method
CN114448952B (en) Streaming media data transmission method and device, storage medium and electronic equipment
CN108171121A (en) UAV Intelligent tracking and system

Legal Events

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