CN108875479A - The acquisition methods and device of facial image - Google Patents

The acquisition methods and device of facial image Download PDF

Info

Publication number
CN108875479A
CN108875479A CN201710697492.8A CN201710697492A CN108875479A CN 108875479 A CN108875479 A CN 108875479A CN 201710697492 A CN201710697492 A CN 201710697492A CN 108875479 A CN108875479 A CN 108875479A
Authority
CN
China
Prior art keywords
facial image
boxed area
initial
image
amendment
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
CN201710697492.8A
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.)
Beijing Megvii Technology Co Ltd
Beijing Maigewei Technology Co Ltd
Original Assignee
Beijing Megvii Technology Co Ltd
Beijing Maigewei 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 Beijing Megvii Technology Co Ltd, Beijing Maigewei Technology Co Ltd filed Critical Beijing Megvii Technology Co Ltd
Priority to CN201710697492.8A priority Critical patent/CN108875479A/en
Publication of CN108875479A publication Critical patent/CN108875479A/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

Landscapes

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

Abstract

The present invention provides a kind of acquisition methods of facial image and devices, belong to image identification technical field.The acquisition methods of the facial image include:Obtain the location information of the facial image in target image;Determine the deflection angle of face in the facial image;According to the deflection angle, rotation amendment is carried out to the facial image, obtains the revised location information of the facial image.This method can be improved the detection accuracy and robustness of the detection of the facial image under multi-angle posture.

Description

The acquisition methods and device of facial image
Technical field
The present invention relates to image identification technical fields, more particularly, to the acquisition methods and device of a kind of facial image.
Background technique
Human face detection tech has a wide range of applications in security protection, live video, many fields such as photography, and its object is to will Human face region is distinguished with other regions in image or video, and then determines the position of all faces in image or video, big Small, posture.
In the actual application of Face datection, the problems such as due to shooting angle, personage's posture, image is usually present rotation The face turned, this will lead to the accuracy rate of Face datection and recall ratio and reduces.Traditional method for detecting human face generallys use expansion Sample constructs the modes such as invariable rotary feature to handle problems, but cannot all guarantee the face under such scene well Detection accuracy.
In view of the above-mentioned problems, not putting forward effective solutions also.
Summary of the invention
In view of this, can be improved more the purpose of the present invention is to provide a kind of acquisition methods of facial image and device The detection accuracy and robustness of facial image detection under angular pose.
In a first aspect, the embodiment of the invention provides a kind of acquisition methods of facial image, including:
Obtain the location information of the facial image in target image;
Determine the deflection angle of face in the facial image;
According to the deflection angle, rotation amendment is carried out to the location information of the facial image and obtains the facial image Revised location information.
With reference to first aspect, the embodiment of the invention provides the first possible embodiments of first aspect, wherein institute The deflection angle for determining face in the facial image is stated, is specifically included:
Determine at least two characteristic points of face in the facial image;
The central axes of the face are determined according to the multiple characteristic point;
Using the central axes and horizontal angle as the deflection angle.
With reference to first aspect, the embodiment of the invention provides second of possible embodiments of first aspect, wherein institute The location information for obtaining the facial image in target image is stated, is specifically included;
Obtain the initial boxed area where the facial image in target image;
Determine coordinate x of the initial boxed area in the target image1、x2、y1、y2
Wherein, x1For the abscissa of the left end of the initial boxed area, x2For the cross of the right end of the initial boxed area Coordinate, y1For the ordinate of the upper end of the initial boxed area, y2For the ordinate of the lower end of the initial boxed area.
With reference to first aspect, the embodiment of the invention provides the third possible embodiments of first aspect, wherein institute It states according to the deflection angle, rotation amendment is carried out to the facial image, obtain the revised position of the facial image Information specifically includes:
According to the deflection angle, the target image is rotated, the central axes of the face and horizontal line is made to hang down Directly;
It converts to the coordinate of the initial boxed area, the amendment boxed area where obtaining the facial image exists Coordinate x' in the target image1、x'2、y'1、y'2
Wherein, x'1For the abscissa of the left end of the amendment boxed area, x'2For the right end for correcting boxed area Abscissa, y'1For the ordinate of the upper end of the amendment boxed area, y'2For the vertical seat of the lower end of the amendment boxed area Mark.
With reference to first aspect, the embodiment of the invention provides the 4th kind of possible embodiments of first aspect, wherein institute It states and converts to the coordinate of the initial boxed area, obtain the coordinate of the amendment boxed area where the facial image x'1、x'2、y'1、y'2, specifically include:
By following formula, converts to the coordinate of the initial boxed area, obtain the amendment where the facial image The coordinate x' of boxed area1、x'2、y'1、y'2
Wherein xc、ycThe respectively abscissa and ordinate at target image center, θ are the deflection angle, i=1 or 2.
With reference to first aspect, the embodiment of the invention provides the 5th kind of possible embodiments of first aspect, wherein should Method further includes:
According to the revised location information of the facial image, revised face figure is intercepted on the target image Picture.
Second aspect, the embodiment of the invention also provides a kind of acquisition device of facial image, including:
Position module, for obtaining the location information of the facial image in target image;
Angle module, for determining the deflection angle of face in the facial image;
Correction module, for carrying out rotation amendment to the location information of the facial image and obtaining according to the deflection angle Obtain the revised location information of the facial image.
In conjunction with second aspect, the embodiment of the invention provides the first possible embodiments of second aspect, wherein institute Angle module is stated to be specifically used for:
At least two characteristic points for determining face in the facial image determine the face according to the multiple characteristic point Central axes, using the central axes and horizontal angle as the deflection angle.
In conjunction with second aspect, the embodiment of the invention provides second of possible embodiments of second aspect, wherein institute Position module is stated to be specifically used for:
The initial boxed area where the facial image in target image is obtained, determines the initial boxed area described Coordinate x in target image1、x2、y1、y2
Wherein, x1For the abscissa of the left end of the initial boxed area, x2For the cross of the right end of the initial boxed area Coordinate, y1For the ordinate of the upper end of the initial boxed area, y2For the ordinate of the lower end of the initial boxed area.
In conjunction with second aspect, the embodiment of the invention provides the third possible embodiments of second aspect, wherein institute Correction module is stated, is specifically included:
Rotary unit, for being rotated to the target image, making the axis of the face according to the deflection angle Line and horizontal line;
Scaling unit converts for the coordinate to the initial boxed area, where obtaining the facial image Correct coordinate x' of the boxed area in the target image1、x'2、y'1、y'2
Wherein, x'1For the abscissa of the left end of the amendment boxed area, x'2For the right end for correcting boxed area Abscissa, y'1For the ordinate of the upper end of the amendment boxed area, y'2For the vertical seat of the lower end of the amendment boxed area Mark.
In conjunction with second aspect, the embodiment of the invention provides the 4th kind of possible embodiments of second aspect, wherein institute Scaling unit is stated to be specifically used for:
By following formula, converts to the coordinate of the initial boxed area, obtain the amendment where the facial image The coordinate x' of boxed area1、x'2、y'1、y'2
Wherein xc、ycThe respectively abscissa and ordinate at target image center, θ are the deflection angle, i=1 or 2.
In conjunction with second aspect, the embodiment of the invention provides the 5th kind of possible embodiments of second aspect, wherein should Device further includes interception module, for the revised location information according to the facial image, is cut on the target image Take revised facial image.
The third aspect, the embodiment of the invention also provides a kind of electronic equipment, including memory and processor, the storages The computer program that can be run on the processor is stored in device, the processor is realized when executing the computer program The step of acquisition methods of above-mentioned facial image.
Fourth aspect, it is described computer-readable to deposit the embodiment of the invention also provides a kind of computer readable storage medium Computer program is stored on storage media, the computer program executes the acquisition side of above-mentioned facial image when being run by processor The step of method.
The embodiment of the present invention brings following beneficial effect:The acquisition methods of facial image provided in an embodiment of the present invention In, angle estimation task is increased, multi task model is formed.In the target image for needing to carry out Face datection, there is rotation Face when, can obtain target image in facial image location information while, determine face in facial image Deflection angle.Later, rotation amendment is carried out according to location information of the deflection angle to facial image, and then obtains facial image Revised location information.Therefore, the acquisition methods of facial image provided in an embodiment of the present invention, especially suitable for multi-angle The facial image of rotation can be modified to the image of proper angle, improve multi-angle by the detection of the facial image under posture The detection accuracy and robustness of facial image detection under posture.
Other features and advantages of the present invention will illustrate in the following description, also, partly become from specification It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention are in specification, claims And specifically noted structure is achieved and obtained in attached drawing.
To enable the above objects, features and advantages of the present invention to be clearer and more comprehensible, preferred embodiment is cited below particularly, and cooperate Appended attached drawing, is described in detail below.
Detailed description of the invention
It, below will be to specific in order to illustrate more clearly of the specific embodiment of the invention or technical solution in the prior art Embodiment or attached drawing needed to be used in the description of the prior art be briefly described, it should be apparent that, it is described below Attached drawing is some embodiments of the present invention, for those of ordinary skill in the art, before not making the creative labor It puts, is also possible to obtain other drawings based on these drawings.
Fig. 1 is the schematic diagram for the electronic equipment that the embodiment of the present invention one provides;
Fig. 2 is the flow chart of the acquisition methods of facial image provided by Embodiment 2 of the present invention;
Fig. 3 is the flow chart of the acquisition methods for the facial image that the embodiment of the present invention three provides;
Fig. 4 is the schematic diagram of facial image acquisition process in the embodiment of the present invention three;
Fig. 5 is the schematic diagram of the acquisition device for the facial image that the embodiment of the present invention four provides.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with attached drawing to the present invention Technical solution be clearly and completely described, it is clear that described embodiments are some of the embodiments of the present invention, rather than Whole embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative work premise Under every other embodiment obtained, shall fall within the protection scope of the present invention.
Embodiment one:
As shown in Figure 1, being set for realizing the acquisition methods of the facial image of the embodiment of the present invention and the exemplary electron of device Standby 100, including one or more processors 102, one or more storage devices 104, input unit 106, output device 108 with And image collecting device 110, these components pass through the interconnection of bindiny mechanism's (not shown) of bus system 112 and/or other forms. It should be noted that the component and structure of electronic equipment 100 shown in FIG. 1 be it is illustrative, and not restrictive, as needed, The electronic equipment also can have other assemblies and structure.
The processor 102 can be central processing unit (CPU) or have data-handling capacity and/or instruction execution The processing unit of the other forms of ability, and the other components that can control in the electronic equipment 100 are desired to execute Function.
The storage device 104 may include one or more computer program products, and the computer program product can To include various forms of computer readable storage mediums, such as volatile memory and/or nonvolatile memory.It is described easy The property lost memory for example may include that random access memory (Random Access Memory, abbreviation RAM) and/or high speed are slow Rush memory (cache) etc..The nonvolatile memory for example may include read-only memory (Read-Only Memory, Abbreviation ROM), hard disk, flash memory etc..It can store one or more computer programs on the computer readable storage medium to refer to It enables, processor 102 can run described program instruction, to realize in invention described below embodiment and (be realized by processor) Client functionality and/or other desired functions.It can also be stored in the computer readable storage medium various Application program and various data, such as application program use and/or the various data generated etc..
The input unit 106 can be the device that user is used to input instruction, and may include keyboard, mouse, wheat One or more of gram wind and touch screen etc..
The output device 108 can export various information (for example, image or sound) to external (for example, user), and It and may include one or more of display, loudspeaker etc..
Described image acquisition device 110 can shoot the desired image of user (such as photo, video etc.), and will be clapped The image taken the photograph is stored in the storage device 104 for the use of other components.
Illustratively, for realizing the acquisition methods of the facial image provided according to embodiments of the present invention and the example of device Electronic equipment may be implemented as on the mobile terminals such as smart phone, tablet computer.
Embodiment two:
The embodiment of the invention provides a kind of acquisition methods of facial image.
According to embodiments of the present invention, a kind of embodiment of the acquisition methods of facial image is provided, it should be noted that The step of process of attached drawing illustrates can execute in a computer system such as a set of computer executable instructions, also, It, in some cases, can be to be different from shown in sequence execution herein although logical order is shown in flow charts The step of out or describing.
As shown in Fig. 2, the acquisition methods of the facial image of the embodiment of the present invention include the following steps:
S101:Obtain the location information of the facial image in target image.
Specifically, obtaining target image by image collecting device, one or more faces in target image are detected Image, and obtain the location information of each facial image in the target image.
S102:Determine the deflection angle of face in facial image.
Specifically, the estimation of deflection angle is carried out to each facial image that step S101 is detected, so that it is determined that each The deflection angle of facial image.
S103:According to deflection angle, rotation amendment is carried out to the location information of facial image, obtains the amendment of facial image Location information afterwards.
Specifically, being carried out according to the deflection angle of the step S102 face determined to the location information of each facial image Rotation amendment, to form the facial image for rectifying angle.The facial image for rectifying angle is obtained in target image by operation again In location information, that is, the revised location information of facial image.
In the acquisition methods of facial image provided in an embodiment of the present invention, angle estimation task is increased, forms multitask Model.In the target image for needing to carry out Face datection, there are when the face of rotation, the people in target image can obtained While the location information of face image, the deflection angle of face in facial image is determined.Later, according to the deflection angle to face The location information of image carries out rotation amendment, and then obtains the revised location information of facial image.Therefore, the present invention is implemented The acquisition methods for the facial image that example provides can will be rotated especially suitable for the detection of the facial image under multi-angle posture Facial image be modified to the image of proper angle, improve detection accuracy and the Shandong of the facial image detection under multi-angle posture Stick.
Embodiment three:
According to embodiments of the present invention, a kind of more detailed embodiment of the acquisition methods of facial image is provided, is needed Illustrate, step shown in the flowchart of the accompanying drawings can be in a computer system such as a set of computer executable instructions It executes, although also, logical order is shown in flow charts, and it in some cases, can be to be different from herein suitable Sequence executes shown or described step.
As shown in figure 3, the acquisition methods of the facial image of the embodiment of the present invention include the following steps:
S201:Obtain the location information of the facial image in target image.
It detects one or more facial images in target image, and obtains each facial image in the target image Location information specifically may include following steps:
S2011:Obtain the initial boxed area where the facial image in target image.
One or more people in target image can be detected according to histogram feature, color characteristic, template characteristic etc. Face image, and box delimited to each facial image, as initial boxed area.
As shown in figure 4, for a facial image in the photo shown in Fig. 4 a, through after this step process Obtain initial boxed area shown in the box in Fig. 4 b.
S2012:Determine coordinate x of the initial boxed area in the target image1、x2、y1、y2
For the initial boxed area of any one facial image, coordinate can be established as unit of pixel.For convenience It calculates, usually using the upper left corner of target image as coordinate origin, and according to every one end (each edge) distance of initial boxed area The pixel number of coordinate origin determines the coordinate x of initial boxed area1、x2、y1、y2.Wherein, x1For the left end of initial boxed area Abscissa, x2For the abscissa of the right end of initial boxed area, y1For the ordinate of the upper end of initial boxed area, y2It is first The ordinate of the lower end of beginning boxed area.
S202:Determine the deflection angle of face in facial image.
The estimation that deflection angle is carried out to each facial image that step S201 is detected, so that it is determined that each facial image Deflection angle, specifically include following steps:
S2021:Determine at least two characteristic points of face in facial image.
For any one facial image, multiple characteristic points in face can be found out.For example, the feature that the present embodiment uses Point includes the midpoint of mouth, the midpoint of nose, the midpoint between two.
S2022:The central axes of face are determined according to multiple characteristic points.
Find in step S2021 three characteristic points are connected as straight line, the central axes of face can be formed.
S2023:Using central axes and horizontal angle as deflection angle.
In the present embodiment, using the angle between the central axes of face and horizontal line (i.e. axis of abscissas) as deflection angle θ, The degree of deflection of facial image is described with the size of deflection angle θ.When θ=90 °, then it represents that current facial image is in Rectify angle.
For example, can get the angle theta between the central axes and horizontal line is 45 ° according to the central axes of the face in Fig. 4 a (as illustrated in fig. 4 c).
It certainly, in other embodiments, can also will be between the central axes of face and vertical line (i.e. axis of ordinates) Angle is as deflection angle.
S203:According to deflection angle, rotation amendment is carried out to the location information of facial image, obtains the amendment of facial image Location information afterwards.
According to the deflection angle θ of the step S202 face determined, rotation is carried out to the location information of each facial image and is repaired Just, to form the facial image for rectifying angle.The location information for rectifying the facial image of angle is obtained by operation again, that is, The revised location information of facial image, specifically includes following steps:
S2031:According to deflection angle, target image is rotated, makes central axes and the horizontal line of face.
Based on the reference axis that step S2012 is established, target image is rotated around centre coordinate, to correct face figure The angle of picture makes central axes and the horizontal line of face.This process only rotates target image, and coordinate origin and coordinate Axis remains stationary.As shown in figure 4d, after the above makeover process, deflection angle θ=90 ° of facial image, therefore correct Facial image afterwards, which is in, rectifies angle.
S2032:It converts to the coordinate of initial boxed area, the amendment boxed area where acquisition facial image is in institute State the coordinate x' in target image1、x'2、y'1、y'2
Wherein, x'1For the abscissa of the left end of amendment boxed area, x'2For correct boxed area right end abscissa, y'1For the ordinate of the upper end of amendment boxed area, y'2For the ordinate of the lower end of amendment boxed area.
As a preferred embodiment, this step can be by following formula, to the coordinate x of initial boxed area1、x2、y1、y2It carries out Conversion obtains the coordinate x' of the amendment boxed area where facial image1、x'2、y'1、y'2
Wherein xc、ycThe respectively abscissa and ordinate at target image center, θ are the deflection angle, i=1 or 2.
Wherein, θ is the deflection angle that step S2023 is determined.I=1 or 2, that is, in i=1 to x1And y1It is changed It calculates, obtains x'1And y'1, in i=2 to x2And y2It converts, obtains x'2And y'2
By converting above, the amendment boxed area where facial image shown in Fig. 4 d can be obtained.
Further, the acquisition methods of facial image provided in an embodiment of the present invention further include:
S204:According to the revised location information of facial image, revised facial image is intercepted on target image.
It, can be to facial image after the facial image and its location information that obtain proper angle by above-mentioned steps Color, position, angle etc. are finely adjusted, later can be in (postrotational) target image or characteristic image (feature Map it is intercepted on), obtains the local picture of facial image, to apply in the various reality such as security protection, photography, live video In scene.
In the acquisition methods of facial image provided in an embodiment of the present invention, angle estimation task is increased, forms multitask Model.In the target image for needing to carry out Face datection, there are when the face of rotation, the people in target image can obtained While the location information of face image, the deflection angle of face in facial image is determined.Later, according to the deflection angle to face The location information of image carries out rotation amendment, and then obtains the revised location information of facial image, intercepts facial image It can be used in the various actual scenes such as security protection, photography, live video after local picture.
Therefore, the acquisition methods of facial image provided in an embodiment of the present invention, especially suitable for the people under multi-angle posture The facial image of rotation can be modified to the image of proper angle, improve the people under multi-angle posture by the detection of face image The detection accuracy and robustness of face image detection.Experiments verify that using the acquisition of facial image provided in an embodiment of the present invention Method can promote 15% to the Average Accuracy (Average Precision) of the facial image detection under multi-angle posture, inspection Survey rate (Recall) can be improved 20%.
In addition, the acquisition methods of facial image provided in an embodiment of the present invention use multi task model, the training of the model Process is:On the basis of Face datection task, increase angle estimation task, addition angle estimation loss, and additional angle is believed The supervisory signals of breath form the model of multitask to carry out angle estimation while detecting face location.The model is most Loss Loss=λ eventually1Lossboxes2Lossangle3Lossothers, wherein λ1、λ2、λ3For weight coefficient, LossboxesFor box Recurrence loss, LossangleFor angle estimation loss, LossothersFor unknown losses item, such as regular terms, Classification Loss etc..
Example IV:
The embodiment of the present invention also provides a kind of acquisition device of facial image, and the acquisition device of the facial image is mainly used for The acquisition methods for executing facial image provided by above content of the embodiment of the present invention, below to people provided in an embodiment of the present invention The acquisition device of face image does specific introduction.
As shown in figure 5, the acquisition device of the facial image mainly includes:Position module 510, angle module 520 and amendment Module 530.
Position module 510 is used to obtain the location information of the facial image in target image.Position module 510 detects mesh One or more facial images in logo image, and obtain the location information of each facial image in the target image.This implementation Position module 510 in example is specifically used for:
Firstly, the initial boxed area where the facial image in target image is obtained, it can be according to histogram feature, face Color characteristic, template characteristic etc. detect one or more facial images in target image, and to each facial image delimitation side Frame, as initial boxed area.
Then, it is determined that coordinate x of the initial boxed area in the target image1、x2、y1、y2.For any one individual The initial boxed area of face image, can establish coordinate as unit of pixel.For convenience of calculating, usually by the upper left of target image Angle is as coordinate origin, and the pixel number according to every one end (each edge) of initial boxed area apart from coordinate origin, determines just The coordinate x of beginning boxed area1、x2、y1、y2.Wherein, x1For the abscissa of the left end of initial boxed area, x2For initial box area The abscissa of the right end in domain, y1For the ordinate of the upper end of initial boxed area, y2For the vertical seat of the lower end of initial boxed area Mark.
Angle module 520 is used to determine the deflection angle of face in facial image, that is, detects to position module 510 Each facial image carry out deflection angle estimation, so that it is determined that the deflection angle of each facial image.In the present embodiment Angle module 520 is specifically used for:
Firstly, determining at least two characteristic points of face in facial image.For any one facial image, people can be found out Multiple characteristic points in face.For example, the characteristic point that the present embodiment uses includes the midpoint of mouth, the midpoint of nose, between two Midpoint.
Then, the central axes of face are determined according to multiple characteristic points.Found three characteristic points are connected as one directly Line can form the central axes of face.
Finally, using central axes and horizontal angle as deflection angle.In the present embodiment, by the central axes of face and water Angle between horizontal line (i.e. axis of abscissas) describes the deflection of facial image with the size of deflection angle θ as deflection angle θ Degree.When θ=90 °, then it represents that current facial image, which is in, rectifies angle.
It certainly, in other embodiments, can also will be between the central axes of face and vertical line (i.e. axis of ordinates) Angle is as deflection angle.
Correction module 530, for carrying out rotation amendment to the location information of facial image, obtaining people according to deflection angle The revised location information of face image.Specifically, the deflection angle θ of the face determined according to angle module 520, to everyone The location information of face image carries out rotation amendment, to form the facial image for rectifying angle.It is obtained again by operation and rectifies angle Facial image location information, that is, the revised location information of facial image.
In the present embodiment, correction module 530 specifically includes rotary unit 5301 and scaling unit 5302.
Rotary unit 5301 is used to rotate target image according to deflection angle, makes central axes and the level of face Line is vertical.Based on reference axis, target image is rotated around centre coordinate, to correct the angle of facial image, makes face Central axes and horizontal line, make deflection angle θ=90 ° of facial image, therefore revised facial image is in and rectifies Angle.This process only rotates target image, and coordinate origin and reference axis remain stationary.
Scaling unit 5302 obtains the amendment side where facial image for converting to the coordinate of initial boxed area Coordinate x' of the frame region in the target image1、x'2、y'1、y'2.Wherein, x'1For the horizontal seat of the left end of amendment boxed area Mark, x'2For the abscissa of the right end of amendment boxed area, y'1For the ordinate of the upper end of amendment boxed area, y'2For amendment side The ordinate of the lower end of frame region.
As a preferred embodiment, scaling unit 5302 can convert to the coordinate of initial boxed area by following formula, Obtain the coordinate x' of the amendment boxed area where facial image1、x'2、y'1、y'2
Wherein xc、ycThe respectively abscissa and ordinate at target image center, θ are the deflection angle, i=1 or 2.
Wherein, θ is deflection angle.I=1 or 2, that is, in i=1 to x1And y1It converts, obtains x'1And y'1, In i=2 to x2And y2It converts, obtains x'2And y'2
Further, the acquisition device of facial image provided in an embodiment of the present invention further includes interception module 540, it is used for According to the revised location information of facial image, revised facial image is intercepted on target image.
After correction module 530 obtains the facial image and its location information of proper angle, interception module 540 can be right The color of facial image, position, angle etc. are finely adjusted, later can be in (postrotational) target image or characteristic pattern It is intercepted as on, obtains the local picture of facial image, to apply in the various actual fields such as security protection, photography, live video Jing Zhong.
The acquisition device of facial image provided in an embodiment of the present invention, the acquisition with facial image provided by the above embodiment Method technical characteristic having the same reaches identical technical effect so also can solve identical technical problem.
In the description of the embodiment of the present invention, it should be noted that term " center ", "upper", "lower", "left", "right", The orientation or positional relationship of the instructions such as "vertical", "horizontal", "inner", "outside" is to be based on the orientation or positional relationship shown in the drawings, Be merely for convenience of description of the present invention and simplification of the description, rather than the device or element of indication or suggestion meaning must have it is specific Orientation, be constructed and operated in a specific orientation, therefore be not considered as limiting the invention.
It is apparent to those skilled in the art that for convenience and simplicity of description, the device of foregoing description, The specific work process of module and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In several embodiments provided by the present invention, it should be understood that disclosed systems, devices and methods, it can be with It realizes by another way.The apparatus embodiments described above are merely exemplary, for example, the division of the module, Only a kind of logical function partition, there may be another division manner in actual implementation, in another example, multiple module or components can To combine or be desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or beg for The mutual coupling, direct-coupling or communication connection of opinion can be through some communication interfaces, device or module it is indirect Coupling or communication connection can be electrical property, mechanical or other forms.
The module as illustrated by the separation member may or may not be physically separated, aobvious as module The component shown may or may not be physical module, it can and it is in one place, or may be distributed over multiple On network module.Some or all of the modules therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
In addition, each functional module in each embodiment of the present invention can integrate in a first processing module, It can be modules to physically exist alone, can also be integrated in two or more modules in a module.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent product It is stored in the executable non-volatile computer-readable storage medium of a processor.Based on this understanding, of the invention Technical solution substantially the part of the part that contributes to existing technology or the technical solution can be with software in other words The form of product embodies, which is stored in a storage medium, including some instructions use so that One computer equipment (can be personal computer, server or the network equipment etc.) executes each embodiment institute of the present invention State all or part of the steps of method.And storage medium above-mentioned includes:USB flash disk, mobile hard disk, read-only memory (ROM, Read- Only Memory), random access memory (RAM, Random Access Memory), magnetic or disk etc. are various can be with Store the medium of program code.
Finally it should be noted that:Embodiment described above, only a specific embodiment of the invention, to illustrate the present invention Technical solution, rather than its limitations, scope of protection of the present invention is not limited thereto, although with reference to the foregoing embodiments to this hair It is bright to be described in detail, those skilled in the art should understand that:Anyone skilled in the art In the technical scope disclosed by the present invention, it can still modify to technical solution documented by previous embodiment or can be light It is readily conceivable that variation or equivalent replacement of some of the technical features;And these modifications, variation or replacement, do not make The essence of corresponding technical solution is detached from the spirit and scope of technical solution of the embodiment of the present invention, should all cover in protection of the invention Within the scope of.Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (14)

1. a kind of acquisition methods of facial image, which is characterized in that including:
Obtain the location information of the facial image in target image;
Determine the deflection angle of face in the facial image;
According to the deflection angle, rotation amendment is carried out to the location information of the facial image and obtains repairing for the facial image Location information after just.
2. the method according to claim 1, wherein in the determination facial image face deflection angle Degree, specifically includes:
Determine at least two characteristic points of face in the facial image;
The central axes of the face are determined according to multiple characteristic points;
Using the central axes and horizontal angle as the deflection angle.
3. method according to claim 1 or 2, which is characterized in that the position for obtaining the facial image in target image Confidence breath, specifically includes;
Obtain the initial boxed area where the facial image in target image;
Determine coordinate x of the initial boxed area in the target image1、x2、y1、y2
Wherein, x1For the abscissa of the left end of the initial boxed area, x2For the horizontal seat of the right end of the initial boxed area Mark, y1For the ordinate of the upper end of the initial boxed area, y2For the ordinate of the lower end of the initial boxed area.
4. according to the method described in claim 3, it is characterized in that, described according to the deflection angle, to the facial image Rotation amendment is carried out, the revised location information of the facial image is obtained, specifically includes:
According to the deflection angle, the target image is rotated, makes central axes and the horizontal line of the face;
It converts to the coordinate of the initial boxed area, obtains the amendment boxed area where the facial image described Coordinate x' in target image1、x'2、y'1、y'2
Wherein, x'1For the abscissa of the left end of the amendment boxed area, x'2For the horizontal seat of the right end of the amendment boxed area Mark, y'1For the ordinate of the upper end of the amendment boxed area, y'2For the ordinate of the lower end of the amendment boxed area.
5. according to the method described in claim 4, it is characterized in that, the coordinate to the initial boxed area changes It calculates, obtains the coordinate x' of the amendment boxed area where the facial image1、x'2、y'1、y'2, specifically include:
It by following formula, converts to the coordinate of the initial boxed area, obtains the amendment box where the facial image The coordinate x' in region1、x'2、y'1、y'2
Wherein xc、ycThe respectively abscissa and ordinate at target image center, θ are the deflection angle, i=1 or 2.
6. the method according to claim 1, wherein further including:
According to the revised location information of the facial image, revised facial image is intercepted on the target image.
7. a kind of acquisition device of facial image, which is characterized in that including:
Position module, for obtaining the location information of the facial image in target image;
Angle module, for determining the deflection angle of face in the facial image;
Correction module, for carrying out rotation amendment to the location information of the facial image and obtaining institute according to the deflection angle State the revised location information of facial image.
8. device according to claim 7, which is characterized in that the angle module is specifically used for:
At least two characteristic points for determining face in the facial image determine in the face according to multiple characteristic points Axis, using the central axes and horizontal angle as the deflection angle.
9. device according to claim 7 or 8, which is characterized in that the position module is specifically used for:
The initial boxed area where the facial image in target image is obtained, determines the initial boxed area in the target Coordinate x in image1、x2、y1、y2
Wherein, x1For the abscissa of the left end of the initial boxed area, x2For the horizontal seat of the right end of the initial boxed area Mark, y1For the ordinate of the upper end of the initial boxed area, y2For the ordinate of the lower end of the initial boxed area.
10. device according to claim 9, which is characterized in that the correction module specifically includes:
Rotary unit rotates the target image for according to the deflection angle, make the central axes of the face with Horizontal line;
Scaling unit converts for the coordinate to the initial boxed area, obtains the amendment where the facial image Coordinate x' of the boxed area in the target image1、x'2、y'1、y'2
Wherein, x'1For the abscissa of the left end of the amendment boxed area, x'2For the horizontal seat of the right end of the amendment boxed area Mark, y'1For the ordinate of the upper end of the amendment boxed area, y'2For the ordinate of the lower end of the amendment boxed area.
11. device according to claim 10, which is characterized in that the scaling unit is specifically used for:
It by following formula, converts to the coordinate of the initial boxed area, obtains the amendment box where the facial image The coordinate x' in region1、x'2、y'1、y'2
Wherein xc、ycThe respectively abscissa and ordinate at target image center, θ are the deflection angle, i=1 or 2.
12. device according to claim 7, which is characterized in that further include interception module, for according to the facial image Revised location information, revised facial image is intercepted on the target image.
13. a kind of electronic equipment, including memory and processor, it is stored with and can runs on the processor in the memory Computer program, which is characterized in that the processor realizes the claims 1 to 6 when executing the computer program The step of method described in one.
14. a kind of computer readable storage medium, computer program, feature are stored on the computer readable storage medium The step of being, the described in any item methods of the claims 1 to 6 executed when the computer program is run by processor.
CN201710697492.8A 2017-08-15 2017-08-15 The acquisition methods and device of facial image Pending CN108875479A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710697492.8A CN108875479A (en) 2017-08-15 2017-08-15 The acquisition methods and device of facial image

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710697492.8A CN108875479A (en) 2017-08-15 2017-08-15 The acquisition methods and device of facial image

Publications (1)

Publication Number Publication Date
CN108875479A true CN108875479A (en) 2018-11-23

Family

ID=64325443

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710697492.8A Pending CN108875479A (en) 2017-08-15 2017-08-15 The acquisition methods and device of facial image

Country Status (1)

Country Link
CN (1) CN108875479A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109905596A (en) * 2019-02-13 2019-06-18 深圳市云之梦科技有限公司 Photographic method, device, computer equipment and storage medium
CN110097021A (en) * 2019-05-10 2019-08-06 电子科技大学 Face pose estimation based on MTCNN
CN110610171A (en) * 2019-09-24 2019-12-24 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment and computer readable storage medium
CN111078926A (en) * 2019-12-19 2020-04-28 青岛海信电器股份有限公司 Method for determining portrait thumbnail image and display equipment
CN111259703A (en) * 2018-12-03 2020-06-09 北京嘀嘀无限科技发展有限公司 Face inclination angle detection method and device
CN111274848A (en) * 2018-12-04 2020-06-12 北京嘀嘀无限科技发展有限公司 Image detection method and device, electronic equipment and storage medium
CN112932407A (en) * 2021-01-29 2021-06-11 上海市内分泌代谢病研究所 Face front calibration method and system
CN113011230A (en) * 2019-12-20 2021-06-22 杭州萤石软件有限公司 Method and device for determining human face deflection angle
CN113900525A (en) * 2021-10-29 2022-01-07 深圳Tcl数字技术有限公司 Digital human display method and device and display equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101377814A (en) * 2007-08-27 2009-03-04 索尼株式会社 Face image processing apparatus, face image processing method, and computer program
CN103605965A (en) * 2013-11-25 2014-02-26 苏州大学 Multi-pose face recognition method and device
CN105279473A (en) * 2014-07-02 2016-01-27 深圳Tcl新技术有限公司 Face image correction method and device and face recognition method and system
CN106650665A (en) * 2016-12-26 2017-05-10 北京旷视科技有限公司 Human face tracing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101377814A (en) * 2007-08-27 2009-03-04 索尼株式会社 Face image processing apparatus, face image processing method, and computer program
CN103605965A (en) * 2013-11-25 2014-02-26 苏州大学 Multi-pose face recognition method and device
CN105279473A (en) * 2014-07-02 2016-01-27 深圳Tcl新技术有限公司 Face image correction method and device and face recognition method and system
CN106650665A (en) * 2016-12-26 2017-05-10 北京旷视科技有限公司 Human face tracing method and device

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111259703A (en) * 2018-12-03 2020-06-09 北京嘀嘀无限科技发展有限公司 Face inclination angle detection method and device
CN111274848A (en) * 2018-12-04 2020-06-12 北京嘀嘀无限科技发展有限公司 Image detection method and device, electronic equipment and storage medium
CN109905596A (en) * 2019-02-13 2019-06-18 深圳市云之梦科技有限公司 Photographic method, device, computer equipment and storage medium
CN110097021A (en) * 2019-05-10 2019-08-06 电子科技大学 Face pose estimation based on MTCNN
CN110097021B (en) * 2019-05-10 2022-09-06 电子科技大学 MTCNN-based face pose estimation method
CN110610171A (en) * 2019-09-24 2019-12-24 Oppo广东移动通信有限公司 Image processing method and device, electronic equipment and computer readable storage medium
CN111078926A (en) * 2019-12-19 2020-04-28 青岛海信电器股份有限公司 Method for determining portrait thumbnail image and display equipment
CN113011230A (en) * 2019-12-20 2021-06-22 杭州萤石软件有限公司 Method and device for determining human face deflection angle
CN112932407A (en) * 2021-01-29 2021-06-11 上海市内分泌代谢病研究所 Face front calibration method and system
CN113900525A (en) * 2021-10-29 2022-01-07 深圳Tcl数字技术有限公司 Digital human display method and device and display equipment

Similar Documents

Publication Publication Date Title
CN108875479A (en) The acquisition methods and device of facial image
WO2021103648A1 (en) Hand key point detection method, gesture recognition method, and related devices
CN108764048B (en) Face key point detection method and device
CN107704838B (en) Target object attribute identification method and device
WO2020199906A1 (en) Facial keypoint detection method, apparatus and device, and storage medium
CN108304829B (en) Face recognition method, device and system
WO2020019926A1 (en) Feature extraction model training method and apparatus, computer device, and computer readable storage medium
CN103839277B (en) A kind of mobile augmented reality register method of outdoor largescale natural scene
WO2019011249A1 (en) Method, apparatus, and device for determining pose of object in image, and storage medium
US9626552B2 (en) Calculating facial image similarity
CN105164700B (en) Detecting objects in visual data using a probabilistic model
CN110222703B (en) Image contour recognition method, device, equipment and medium
Dubská et al. Real Projective Plane Mapping for Detection of Orthogonal Vanishing Points.
CN111091075B (en) Face recognition method and device, electronic equipment and storage medium
Jung et al. Robust upright adjustment of 360 spherical panoramas
CN111008935B (en) Face image enhancement method, device, system and storage medium
CN105934757B (en) A kind of method and apparatus of the key point for detecting the first image and the incorrect incidence relation between the key point of the second image
CN113298158B (en) Data detection method, device, equipment and storage medium
US10600202B2 (en) Information processing device and method, and program
CN112507848B (en) Mobile terminal real-time human face attitude estimation method
CN109948624A (en) Method, apparatus, electronic equipment and the computer storage medium of feature extraction
Kim et al. Real-time panorama canvas of natural images
CN111598149B (en) Loop detection method based on attention mechanism
CN110032941A (en) Facial image detection method, facial image detection device and terminal device
CN111836058A (en) Method, device and equipment for real-time video playing and storage medium

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20181123