WO2020056693A1 - 一种图片合成方法、装置及电子设备 - Google Patents

一种图片合成方法、装置及电子设备 Download PDF

Info

Publication number
WO2020056693A1
WO2020056693A1 PCT/CN2018/106788 CN2018106788W WO2020056693A1 WO 2020056693 A1 WO2020056693 A1 WO 2020056693A1 CN 2018106788 W CN2018106788 W CN 2018106788W WO 2020056693 A1 WO2020056693 A1 WO 2020056693A1
Authority
WO
WIPO (PCT)
Prior art keywords
picture
sub
target portrait
face
target
Prior art date
Application number
PCT/CN2018/106788
Other languages
English (en)
French (fr)
Inventor
菲永奥利维尔
李建亿
Original Assignee
太平洋未来科技(深圳)有限公司
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 太平洋未来科技(深圳)有限公司 filed Critical 太平洋未来科技(深圳)有限公司
Priority to PCT/CN2018/106788 priority Critical patent/WO2020056693A1/zh
Priority to CN201811140095.1A priority patent/CN109447924B/zh
Publication of WO2020056693A1 publication Critical patent/WO2020056693A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G03PHOTOGRAPHY; CINEMATOGRAPHY; ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ELECTROGRAPHY; HOLOGRAPHY
    • G03BAPPARATUS OR ARRANGEMENTS FOR TAKING PHOTOGRAPHS OR FOR PROJECTING OR VIEWING THEM; APPARATUS OR ARRANGEMENTS EMPLOYING ANALOGOUS TECHNIQUES USING WAVES OTHER THAN OPTICAL WAVES; ACCESSORIES THEREFOR
    • G03B5/00Adjustment of optical system relative to image or object surface other than for focusing
    • 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/168Feature extraction; Face representation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/02Constructional features of telephone sets
    • H04M1/04Supports for telephone transmitters or receivers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • H04M1/7243User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages
    • H04M1/72439User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality with interactive means for internal management of messages for image or video messaging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Definitions

  • the present invention relates to the field of image processing technology, and in particular, to a method, device, and electronic device for picture synthesis.
  • the method, device, and electronic device for synthesizing pictures provided by the embodiments of the present invention are used to solve at least the foregoing problems in related technologies.
  • An embodiment of the present invention provides a picture synthesis method, including:
  • the second picture includes a face image; extracting a sub-image of a nasal region in the face image, based on The weighted center of the light intensity of the sub-image and the weighted center of the face image are used to obtain the light angle of the second picture; the face orientation angle of the target portrait is obtained, and according to the face orientation angle and the The light angle of the second picture determines the target position of the target portrait on the second picture; and according to the target position, the target portrait and the second picture are synthesized.
  • the obtaining the face orientation angle of the target portrait includes: identifying feature points of the target portrait, determining position information of the target portrait features based on the feature points; and based on the positions of the target portrait features.
  • the information calculates the relative positions of the facial features of the target portrait; and determines the face orientation angle of the target portrait based on the relative positions of the facial features.
  • the obtaining the face orientation angle of the target portrait includes: identifying a face area of the target portrait, determining the face orientation of the target portrait based on the face area, and calculating a distance between the face areas. Area ratio; determining the face orientation angle of the target portrait according to the face orientation of the target portrait and the area ratio.
  • determining the target position of the target portrait on the second picture according to the face orientation angle and the light angle of the second picture includes: based on the face orientation angle and the first picture.
  • the light angles of the two pictures determine whether the face of the target portrait is in a forward-lighting state in the second picture; if it is not in a forward-lighting state, look in the second picture to block the second picture Position of the light, using the position as the target position.
  • obtaining the light angle of the second picture based on the weighted center of the light intensity of the sub-image and the weighted center of the face image includes: dividing the sub-image into a plurality of sub-areas, and determining each Weighting center of the sub-light intensity of the sub-region; comparing each weighting center of the sub-light intensity with the weighting center of the face image to obtain a sub-ray estimation angle of each of the sub-regions; The sub-light intensity, and the weight of the sub-ray estimation angle of the sub-region is determined according to the sub-light intensity of the sub-region; the second sub-ray estimation angle and the weight of the sub-ray estimation angle are calculated to obtain the second The light angle of the picture.
  • a recognition module for obtaining a first picture and a second picture, identifying and extracting a target portrait in the first picture, wherein the second picture includes a face image; an extraction module for extracting the face The sub-image of the nasal region in the image, based on the light-weighted center of the sub-image and the weighted center of the face image, to obtain the light angle of the second picture; a determining module for obtaining the target image's A face orientation angle, and a target position of the target portrait on the second picture is determined according to the face orientation angle and a light angle of the second picture; and a synthesis module is configured to The target portrait is synthesized with the second picture.
  • the determining module includes: a first recognition unit for identifying feature points of the target portrait, and determining position information of the features of the target portrait based on the feature points; and a first calculation unit for based on the feature
  • the position information of the facial features of the target portrait calculates the relative positions of the facial features of the target portrait.
  • the first determining unit is configured to determine a face orientation angle of the target portrait according to the relative positions of the facial features.
  • the determining module includes: a second recognition unit for identifying a face area of the target portrait, and determining a face orientation of the target portrait based on the face area; a second calculation unit for calculating the face An area ratio between face areas; a second determining unit, configured to determine a face orientation angle of the target portrait according to the face orientation of the target portrait and the area ratio.
  • the determining module is configured to determine, based on the face orientation angle and the light angle of the second picture, whether the face of the target portrait is in a smooth light state in the second picture; When the light is not in the forward light state, a position in the second picture that can block the light of the second picture is found, and the position is used as a target position.
  • the extraction module is configured to divide the sub-image into a plurality of sub-regions, and determine a sub-light intensity weighting center of each of the sub-regions; The weighted centers are compared to obtain the sub-ray estimated angle of each sub-region; the sub-light intensity of each of the sub-regions is calculated, and the weight of the sub-ray estimated angle of the sub-region is determined according to the sub-light intensity of the sub-region; The light angle of the second picture is calculated and calculated according to the weight of each of the sub-ray estimated angles and the sub-ray estimated angle.
  • Another aspect of the embodiments of the present invention provides an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a memory that can be used by the at least one processor An executed instruction, where the instruction is executed by the at least one processor, so that the at least one processor can execute any one of the foregoing image synthesis methods.
  • the electronic device further includes an image acquisition module including a lens, an auto-focusing voice coil motor, a mechanical image stabilizer, and an image sensor, and the lens is fixed on the auto-focusing voice coil motor.
  • the lens is used to acquire an image
  • the image sensor transmits the image acquired by the lens to the recognition module
  • the autofocus voice coil motor is mounted on the mechanical image stabilizer
  • the processing module is based on the inside of the lens
  • the feedback of the lens shake detected by the gyroscope drives the action of the mechanical image stabilizer to achieve lens shake compensation.
  • the mechanical anti-shake device includes a movable plate, a movable frame, an elastic restoring mechanism, a base plate, and a compensation mechanism; a central portion of the movable plate is provided with a through hole through which the lens passes, and the auto-focusing voice coil motor Installed on the movable plate, the movable plate is installed in the movable frame, and the opposite sides of the movable plate are slidingly fitted with the inner walls of the opposite sides of the movable frame so that the movable plate can be moved along Reciprocating sliding in the first direction; the size of the movable frame is smaller than that of the substrate, and two opposite sides of the movable frame are connected to the substrate through two elastic restoring mechanisms, respectively.
  • the compensation mechanism includes a drive shaft, gears, A gear track and a limit track, the drive shaft is mounted on the base plate, the drive shaft is connected with the gear drive;
  • the gear track is provided on the movable plate, and the gear is mounted In the gear track, when the gear rotates, the gear track enables the movable plate to generate a displacement in a first direction and a displacement in a second direction, wherein the first direction is perpendicular to the second direction;
  • the limit track is disposed on the movable plate or the base plate, and the limit track is used to prevent the gear from detaching from the gear track.
  • a side of the movable plate is provided with a waist-shaped hole, and the waist-shaped hole is provided with a plurality of teeth that mesh with the gear along a circumferential direction thereof, and the waist-shaped hole and the plurality of teeth together constitute the A gear track, wherein the gear is located in the waist-shaped hole and meshes with the teeth; the limit track is disposed on the base plate, and a bottom of the movable plate is provided with a limit position within the limit track Piece, the limit track makes the movement track of the limit piece in a waist shape.
  • the limiting member is a protrusion provided on the bottom surface of the movable plate.
  • the gear track includes a plurality of cylindrical protrusions provided on the movable plate, the plurality of cylindrical protrusions are evenly spaced along the second direction, and the gear is in phase with the plurality of protrusions.
  • the limit track is a first arc-shaped stopper and a second arc-shaped stopper provided on the movable plate, and the first arc-shaped stopper and the second arc-shaped stopper are respectively It is arranged on two opposite sides of the gear track in the first direction, and the first arc-shaped stopper, the second arc-shaped stopper, and a plurality of the protrusions cooperate to make the moving track of the movable plate Waist-shaped.
  • the elastic recovery mechanism includes a telescopic spring.
  • the image acquisition module includes a mobile phone and a bracket for mounting the mobile phone.
  • the bracket includes a mobile phone mounting base and a retractable support rod;
  • the mobile phone mounting base includes a retractable connection plate and a folding plate group installed at opposite ends of the connection plate, and one end of the support rod is connected to the connection The middle portions of the plates are connected by a damping hinge;
  • the folded plate group includes a first plate body, a second plate body, and a third plate body, wherein one of two opposite ends of the first plate body is in phase with the connecting plate.
  • the other end of the opposite ends of the first plate body is hinged to one of the opposite ends of the second plate body; the other end of the opposite ends of the second plate body is connected to the third plate One end of the two opposite ends of the body is hinged; the second plate body is provided with an opening for the corner of the mobile phone to be inserted; when the mobile phone mount is used to install the mobile phone, the first plate body, the second plate body, and the first plate body
  • the three plates are folded in a right triangle state, the second plate is a hypotenuse of a right triangle, and the first plate and the third plate are right angles of a right triangle, wherein the third plate is One side of the side is attached to one side of the connecting plate , One of the opposite ends of the third plate member and the other end opposite ends of the first plate against body.
  • a first connection portion is provided on one side surface of the third plate body, and a first connection portion that is matched with the first connection portion is provided on a side surface where the connection plate is in contact with the third plate body.
  • a second connection portion is provided at one end of the opposite ends of the first plate body, and a second connection is provided at the other end of the opposite ends of the third plate body to cooperate with the second connection portion.
  • the other end of the support rod is detachably connected to a base.
  • the method, device and electronic device for picture synthesis provided by the embodiments of the present invention can quickly synthesize the target person in the first picture into the second picture, and ensure that the target person is not affected by the light in the second picture
  • the effect of improving the quality of the synthesized picture without the need for professionals to process the picture synthesis, saving time and effort and improving the user experience.
  • the anti-shake hardware structure of the mobile phone camera and the mobile phone self-timer bracket also further enhance the shooting effect, which is more conducive to subsequent image processing.
  • FIG. 1 is a flowchart of a picture composition method according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a picture composition method according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a picture composition method according to an embodiment of the present invention.
  • FIG. 4 is a structural diagram of a picture synthesis device according to an embodiment of the present invention.
  • FIG. 5 is a structural diagram of a picture synthesis device according to an embodiment of the present invention.
  • FIG. 6 is a structural diagram of a picture synthesizing apparatus according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a hardware structure of an electronic device that executes a picture composition method provided by an embodiment of the method of the present invention.
  • FIG. 8 is a schematic structural diagram of an image acquisition module according to an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of a first mechanical vibration stabilizer provided by an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a bottom surface of a first movable board according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of a second mechanical vibration stabilizer provided by an embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of a bottom surface of a second movable board provided by an embodiment of the present invention.
  • FIG. 13 is a structural diagram of a stent provided by an embodiment of the present invention.
  • FIG. 14 is a schematic state diagram of a stent provided by an embodiment of the present invention.
  • FIG. 15 is a schematic view of another state of a stent according to an embodiment of the present invention.
  • FIG. 16 is a structural state diagram when the mounting base and the mobile phone are connected according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a picture composition method according to an embodiment of the present invention.
  • a picture synthesis method provided by an embodiment of the present invention includes:
  • S101 Acquire a first picture and a second picture, and identify and extract a target portrait in the first picture.
  • the second picture includes a face image.
  • the operation may be triggered based on the selection of any area in the first picture by the user to identify and extract the portrait included in the area as the target portrait; or it may be performed automatically on the face image included in the first picture.
  • Recognition when more than one face image is recognized, it is displayed to the user for selection, a target portrait is determined based on the user's selection, and the target portrait is extracted.
  • the recognition process can use the image recognition technology to identify the target portrait, such as contour extraction, pattern matching, or feature comparison through multiple types of face images stored in a preset database, etc.
  • Image recognition technology is not limited. After the target portrait is identified, it can be matted along the outline of the identified target portrait, or image matting technology, such as related matting technology in Photoshop, can be used to extract the target portrait from the first picture.
  • the light and shadow effects of the first picture need to be determined.
  • face detection algorithms and facial feature extraction based on color, shape, and symmetry cost functions published by Eli Saber et al. are well known to those skilled in the art; for example, a new one published by Karin Sobottka et al. Automatic face segmentation, face feature extraction and tracking methods; classifier-based face feature detection method published by Phillip Ian Wilson, etc .; Alan L. Yuille et al. Used deformable templates to extract features from faces), or Any CNN-based face detection algorithm, etc., extracts facial features from the face image. Because the nose is protruding from the face in the facial features, the light and darkness of the nose area are more likely to be affected by the ambient light when taking pictures. Therefore, in this embodiment, the nose in the facial features is extracted to obtain a sub-image of the nose area in the face image. .
  • the corresponding light intensity weighting center is determined according to the image moment of the sub-image.
  • An image moment is a set of moments calculated from digital graphics. It usually describes the global features of the image and provides a lot of information about the different types of geometric features of the image, such as size, position, orientation, and shape. For example, a The order moment is related to the shape, the second order moment shows the degree of expansion of the curve around the straight line average value, and the third order moment is a measure of the symmetry of the average value. From the second and third order moments, a group of 7 constants can be derived. Order moments and invariant order moments are statistical characteristics of images, which can be used to classify images based on this, which are common knowledge in the art, and the present invention will not repeat them here.
  • the light intensity weighting center of the sub-picture is determined, it is compared with the weighting center of the sub-image (the weighting center is the collection center of the image), and the coordinate position of the weighting center of the image is compared with that of the sub-picture.
  • the coordinate position of the light intensity weighted center is compared.
  • the direction from the geometric center to the light intensity weighted center is the direction of the ambient light.
  • we can establish the coordinate system by selecting the coordinate origin and obtain the angle between the vector and the X axis. , As the light estimation angle of the second picture.
  • the light estimation angle can also be calculated by other non-proprietary algorithms, which is not limited in the present invention. It should be noted that, in the embodiment of the present invention, the ambient light will be considered to be unidirectional and uniform.
  • the sub-image in order to make the light estimation angle more accurate, may be divided into several sub-regions, and a sub-light intensity weighting center of each of the sub-regions is determined;
  • the light intensity weighted center is compared with the weighted center of the face image to obtain the estimated sub-ray angle of each of the sub-regions; the sub-light intensity of each of the sub-regions is calculated;
  • a weight of the sub-ray estimation angle of the sub-region; and a light angle of the second picture is calculated according to each of the sub-ray estimation angle and the weight of the sub-ray estimation angle.
  • the sub-images can be divided into four equal parts to obtain four sub-regions, and the sub-light intensity weighting center of each sub-region and the sub-ray estimation angle of each sub-region are determined according to the above method.
  • the light intensity corresponding to the sub-picture is obtained according to the light and dark contrast information therein.
  • the sub-light intensity of each sub-region is used as the weight of the sub-light estimation angle of the sub-region; finally ,
  • the sub-ray estimation angles of the four sub-areas are calculated by adding and averaging according to their corresponding weights to obtain the average ray estimation angle.
  • the calculation of the light angle can be performed for each face image in the above manner, and then the average summation can be performed; it can also be determined by the position and posture of each face image on the second picture
  • the corresponding weights are weighted and summed according to the weights to obtain the final light angle of the second picture.
  • S103 Obtain a face orientation angle of the target portrait, and determine a target position of the target portrait on the second picture according to the face orientation angle and a light angle of the second picture.
  • the light and shadow effects of the portrait in the picture will vary with the relative position of the face and the light source.
  • the target position of the target portrait in the second picture needs to be determined with reference to the face orientation angle of the target portrait. Therefore, the face orientation angle of the target portrait needs to be obtained first.
  • the face orientation angle of the target portrait is obtained through the following steps.
  • the eyebrows, eyes, nose, chin, and mouth in a human face are respectively composed of several of the feature points, so a preset number of key points can be identified in advance to represent the features of the human face.
  • a feature point recognition model can be used to obtain the feature points.
  • a certain number of training sets can be obtained, and the training set is a picture carrying the facial feature point identifier and its corresponding coordinate position; the training set is used to form an initial regression function and initial training set, and the initial training set and initial The regression function iterates to form the next training set and regression function; each iteration of the regression function uses a gradient boosting algorithm to learn, so when the facial feature point information in the nth training set and the training set meets the convergence conditions, the corresponding The regression function is the trained facial feature point recognition model.
  • a preset number of feature points and feature point coordinates (x i , y i ) are obtained by identifying the input target portrait through the trained feature point recognition model, where i represents the i-th feature obtained through recognition. Points, and through these feature points, the local organs in the facial features of the target portrait and the corresponding coordinate positions of the local organs can be determined.
  • a coordinate that can best represent the feature point of each local organ can be selected as the corresponding coordinate position of the local organ, or the characteristics of each local organ can be selected The coordinates of the points are averaged as the coordinate position corresponding to the local organ.
  • the coordinate system is established using the second picture.
  • the bottom left corner of the second picture can be used as the origin
  • the left side of the second picture is the y-axis
  • the bottom side of the second picture is x-axis.
  • the embodiment of the present invention determines the face orientation of the target portrait by calculating the relative position of the local organs. angle.
  • several relative positions in the target portrait are determined according to the coordinate positions of the local organs in the facial features. These relative positions include, but are not limited to, the relative positions between the nose, upper lip, lower lip, eye, pupil to nostril, eyebrow to chin, nostril to chin, pupil to corner of mouth, corner of mouth to chin, eyebrow to, etc. position.
  • some face sample sets can be prepared in advance.
  • the face sample set includes faces with different face orientation angles. Each face carries orientation angle and relative position information of local organs.
  • the angle model is trained. In this step, the above several relative positions can be directly input into the model to obtain the face orientation angle of the target portrait.
  • the face orientation angle of the target portrait is obtained through the following steps.
  • the face area of the target portrait can be divided by the facial feature points.
  • the face area can be divided into three parts.
  • Above the hairline and below the hairline are the upper sub-areas of the face, with the nose and mouth as the central axis, ears as the left / right boundary, eyebrows as the upper boundary, and chin as the lower boundary.
  • Sub-region and right sub-region are different.
  • the area distribution ratio of each sub-region is different.
  • the area of each sub-region when the face is facing directly forward can be used as the standard state.
  • the left sub-region and the right sub-region The area of the area should be the same or within a preset range; when the face is facing to the left, the area of the left sub-region is much smaller than the area of the right sub-region; when the target portrait looks up, the upper sub-region The area should be significantly smaller than the corresponding area of the upper subregion in the standard state. Therefore, in this step, the area of each sub-region can be compared with the standard state to obtain the face orientation of the target portrait (such as left, right, up, etc.)
  • S1033 ' Determine the face orientation angle of the target portrait according to the face orientation of the target portrait and the area ratio.
  • a correspondence table of area proportions and face orientation angles may be established in advance, and the table may be obtained by statistical analysis of a large number of face data with different orientation angles.
  • the relationship table stores the corresponding relationship between the face ratio of each face, the area ratio of each sub-region, and the face orientation angle.
  • the correspondence relationship may be one-to-one or many-to-one.
  • the face's deflection angle to the left may be determined by the area ratio of the left sub-region to the right sub-region.
  • the corresponding relationship is one-to-one; but for more accurate angle calculation results, you can use the left
  • the area ratio of the sub-region to the right sub-region, the area ratio of the upper sub-region to the left sub-region, and the area ratio of the upper sub-region and the right sub-region are determined by these three ratios.
  • the corresponding relationship is multiple pairs. One.
  • step S1031 ' After calculating the area ratio of each sub-region, first determine the face orientation of the target portrait according to step S1031 ', and lock the corresponding relationship of the face orientation in the correspondence table; after calculating the area ratio, based on This correspondence determines the face orientation angle of the target portrait.
  • the face orientation angle After determining the face orientation angle, according to the face orientation angle and the light angle of the second picture, determine whether the face of the target portrait in the second picture is in a smooth light state; if it is in a smooth light state, it indicates that the The human face will not be in an excessively dark or uneven brightness state in the second picture. At this time, there is no need to limit the position of the target portrait in the second image, and the target portrait can be located according to the user's operation instruction. If it is not in the normal light state, it means that the face of the target portrait will be in the state of backlight or side light in the second picture. Therefore, you need to find the position in the second picture that can block the light of the second picture, and use this position as the target. position.
  • a target object can be determined along the light angle in the second picture, and the target object can block the light in the second picture, thereby changing the backlight or side light state of the face of the target portrait, and the target object.
  • the corresponding position is used as the target position.
  • the target location may be a building, an animal, a plant, a person, or the like.
  • S104. Combine the target portrait and the second picture according to the target position.
  • the target portrait is directly synthesized on the target position obtained in step S103 to obtain a synthesized picture.
  • the picture synthesis method provided by the embodiment of the present invention can quickly synthesize the target person in the first picture into the second picture, and ensure that the target person is not affected by the light in the second picture, which improves the quality of the synthesized picture without requiring Professionals process picture synthesis, saving time and effort and improving user experience.
  • FIG. 4 is a structural diagram of a picture synthesis device according to an embodiment of the present invention. As shown in FIG. 3, the device specifically includes: an identification module 100, an extraction module 200, a determination module 300, and a synthesis module 400. among them,
  • a recognition module 100 configured to obtain a first picture and a second picture, to identify and extract a target portrait in the first picture, wherein the second picture includes a face image; an extraction module 200, configured to extract the The sub-image of the nasal region in the face image is obtained based on the light-weighted center of the sub-image and the weighted center of the face image to obtain the light angle of the second picture; a determining module 300 is configured to obtain the The face orientation angle of the target portrait, and the target position of the target portrait on the second picture is determined according to the face orientation angle and the light angle of the second picture; a synthesis module 400 is configured according to the target Position to synthesize the target portrait with the second picture.
  • the picture synthesizing device provided by the embodiment of the present invention is specifically configured to execute the method provided by the embodiment shown in FIG. 1, and the implementation principle, method, and functional use thereof are similar to the embodiment shown in FIG. 1, and details are not described herein again.
  • FIG. 5 is a structural diagram of a picture synthesis device according to an embodiment of the present invention. As shown in FIG. 5, the device specifically includes: an identification module 100, an extraction module 200, a determination module 300, and a synthesis module 400. among them,
  • a recognition module 100 configured to obtain a first picture and a second picture, to identify and extract a target portrait in the first picture, wherein the second picture includes a face image; an extraction module 200, configured to extract the The sub-image of the nasal region in the face image is obtained based on the light-weighted center of the sub-image and the weighted center of the face image to obtain the light angle of the second picture; a determining module 300 is configured to obtain the The face orientation angle of the target portrait, and the target position of the target portrait on the second picture is determined according to the face orientation angle and the light angle of the second picture; a synthesis module 400 is configured according to the target Position to synthesize the target portrait with the second picture.
  • the determination module 300 includes a first identification unit 310, a first calculation unit 320, and a first determination unit 330. among them,
  • a first recognition unit 310 is configured to identify feature points of the target portrait, and determine position information of the target portrait features based on the feature points; a first calculation unit 320 is configured to calculate based on the position information of the target portrait features. A relative position of the facial features of the target portrait; a first determining unit 330, configured to determine a face orientation angle of the target portrait according to the relative positions of the facial features.
  • the determining module 300 is configured to determine, based on the face orientation angle and the light angle of the second picture, whether the face of the target portrait is in a smooth light state in the second picture; When the light is not in the forward light state, a position in the second picture that can block the light of the second picture is found, and the position is used as a target position.
  • the extraction module 200 is configured to divide the sub-image into a plurality of sub-regions, and determine a sub-light intensity weighting center of each of the sub-regions; The weighted centers are compared to obtain the sub-ray estimated angle of each sub-region; the sub-light intensity of each of the sub-regions is calculated, and the weight of the sub-ray estimated angle of the sub-region is determined according to the sub-light intensity of the sub-region; Calculate the light angle of the second picture according to the weight of each of the sub-ray estimated angles and the sub-ray estimated angle
  • the picture synthesizing device provided by the embodiment of the present invention is specifically configured to execute the method provided by the embodiment shown in FIG. 1 and FIG. 2, and its implementation principles, methods, and functional uses are similar to the embodiments shown in FIG. 1 and FIG. 2. No longer.
  • FIG. 6 is a structural diagram of a picture synthesis device according to an embodiment of the present invention. As shown in FIG. 6, the device specifically includes: an acquisition module 100, an output module 200, an adjustment module 300, a replacement module 400, and a processing module 500. Its identification module 100, extraction module 200, determination module 300, and synthesis module 400. among them,
  • a recognition module 100 configured to obtain a first picture and a second picture, to identify and extract a target portrait in the first picture, wherein the second picture includes a face image; an extraction module 200, configured to extract the The sub-image of the nasal region in the face image is obtained based on the light-weighted center of the sub-image and the weighted center of the face image to obtain the light angle of the second picture; a determining module 300 is configured to obtain the The face orientation angle of the target portrait, and the target position of the target portrait on the second picture is determined according to the face orientation angle and the light angle of the second picture; a synthesis module 400 is configured according to the target Position to synthesize the target portrait with the second picture.
  • the determination module 300 includes a second identification unit 340, a second calculation unit 350, and a second determination unit 360. among them,
  • a second recognition unit 340 is used to identify a face area of the target portrait, and determines a face orientation of the target portrait based on the face area; a second calculation unit 350 is used to calculate an area ratio between the face areas A second determining unit 360, configured to determine a face orientation angle of the target portrait according to the face orientation of the target portrait and the area ratio.
  • the determining module 300 is configured to determine, based on the face orientation angle and the light angle of the second picture, whether the face of the target portrait is in a smooth light state in the second picture; When the light is not in the forward light state, a position in the second picture that can block the light of the second picture is found, and the position is used as a target position.
  • the extraction module 200 is configured to divide the sub-image into a plurality of sub-regions, and determine a sub-light intensity weighting center of each of the sub-regions; The weighted centers are compared to obtain the sub-ray estimated angle of each sub-region; the sub-light intensity of each of the sub-regions is calculated, and the weight of the sub-ray estimated angle of the sub-region is determined according to the sub-light intensity of the sub-region; Calculate the light angle of the second picture according to the weight of each of the sub-ray estimated angles and the sub-ray estimated angle
  • the picture synthesizing apparatus provided by the embodiment of the present invention is specifically configured to execute the method provided by the embodiment shown in FIG. 1 and FIG. 3, and its implementation principles, methods, and functional uses are similar to the embodiments shown in FIG. 1 and FIG. No longer.
  • the above-mentioned picture synthesizing apparatus may be used as one of the software or hardware functional units, which may be independently provided in the above-mentioned electronic device, or may be used as one of the functional modules integrated in the processor to perform picture synthesizing in the embodiments of the present invention. method.
  • FIG. 7 is a schematic diagram of a hardware structure of an electronic device that executes a picture composition method provided by a method embodiment of the present invention.
  • the electronic device includes:
  • One or more processors 710 and a memory 720 are taken as an example in FIG. 7.
  • the apparatus for performing the picture synthesis method may further include: an input device 730 and an output device 730.
  • the processor 710, the memory 720, the input device 730, and the output device 740 may be connected through a bus or in other manners. In FIG. 7, the connection through the bus is taken as an example.
  • the memory 720 is a non-volatile computer-readable storage medium, and may be used to store a non-volatile software program, a non-volatile computer executable program, and a module, as corresponding to the picture composition method in the embodiment of the present invention.
  • the processor 710 executes various functional applications and data processing of the server by running non-volatile software programs, instructions, and modules stored in the memory 720, that is, implementing the picture composition method.
  • the memory 720 may include a storage program area and a storage data area, where the storage program area may store an operating system and an application program required for at least one function; the storage data area may store the image created by using a picture composition device according to an embodiment of the present invention. Data, etc.
  • the memory 720 may include a high-speed random access memory 720, and may further include a non-volatile memory 720, such as at least one magnetic disk memory 720, a flash memory device, or other non-volatile solid-state memory 720.
  • the memory 720 may optionally include a memory 720 remotely set relative to the processor 77, and these remote memories 720 may be connected to the picture composition device through a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
  • the input device 730 may receive inputted numeric or character information, and generate key signal inputs related to user settings and function control of the picture synthesis device.
  • the input device 730 may include a device such as a pressing module.
  • the one or more modules are stored in the memory 720, and when executed by the one or more processors 710, execute the picture composition method.
  • the electronic devices in the embodiments of the present invention exist in various forms, including but not limited to:
  • Mobile communication equipment This type of equipment is characterized by mobile communication functions, and its main goal is to provide voice and data communication.
  • Such terminals include: smart phones (such as iPhone), multimedia phones, feature phones, and low-end phones.
  • Ultra-mobile personal computer equipment This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has the characteristics of mobile Internet access.
  • Such terminals include: PDA, MID and UMPC devices, such as iPad.
  • Portable entertainment equipment This type of equipment can display and play multimedia content.
  • Such devices include: audio and video players (such as iPod), handheld game consoles, e-books, as well as smart toys and portable car navigation devices.
  • the electronic device includes an image acquisition module.
  • the image acquisition module in this embodiment includes a lens 1000, an autofocus voice coil motor 2000, a mechanical image stabilizer 3000, and an image sensor 4000.
  • the lens 1000 is fixed on the auto-focusing voice coil motor 2000, and the lens 1000 is fixed on the auto-focusing voice coil motor 2000.
  • the lens 1000 is used to acquire an image, and the image sensor 4000 sets the lens 1000
  • the acquired image is transmitted to the recognition module, the auto-focusing voice coil motor 2000 is mounted on the mechanical image stabilizer 3000, and the processing module drives the camera based on the feedback of the lens 1000 shake detected by the gyroscope in the lens 1000.
  • the operation of the mechanical image stabilizer 3000 is described to realize the shake compensation of the lens 1000.
  • the lens 1000 needs to be driven in at least two directions, which means that multiple coils need to be arranged. It brings certain challenges to the miniaturization of the overall structure, and is easily affected by external magnetic fields, which affects the anti-shake effect. Therefore, the Chinese patent published as CN106131435A provides a miniature optical anti-shake camera module, which realizes memory through temperature changes.
  • the alloy wire is stretched and shortened to pull the auto-focusing voice coil motor 2000 to achieve the shake compensation of the lens 1000.
  • the control chip of the micro memory alloy optical anti-shake actuator can control the change of the driving signal to change the memory alloy wire.
  • the temperature is used to control the elongation and shortening of the memory alloy wire, and the position and moving distance of the actuator are calculated based on the resistance of the memory alloy wire.
  • the micro memory alloy optical image stabilization actuator moves to the specified position, the resistance of the memory alloy wire at this time is fed back. By comparing the deviation of this resistance value and the target value, the movement on the micro memory alloy optical image stabilization actuator can be corrected. deviation.
  • the structure of the above technical solution alone cannot achieve accurate compensation for the lens 1000 in the case of multiple shakes, which is due to the heating of the shape memory alloy It takes a certain time to cool down and cool down.
  • the above technical solution can achieve the compensation of the lens 1000 for the shake in the first direction, but when the subsequent shake in the second direction occurs, due to the memory alloy It is too late to deform in an instant, so it is easy to cause compensation in a timely manner, and it is impossible to accurately achieve 1000-shake compensation for a lens that has multiple shakes and continuous shakes in different directions, so it is necessary to improve its structure.
  • this embodiment improves the optical image stabilizer and design it as a mechanical image stabilizer 3000.
  • the specific structure is as follows:
  • the mechanical image stabilizer 3000 of this embodiment includes a movable plate 3100, a movable frame 3200, an elastic restoring mechanism 3300, a base plate 3400, and a compensation mechanism 3500.
  • the movable plate 3100 and the base plate 3400 are provided in the middle of the plate for the lens to pass through.
  • the auto-focusing voice coil motor is installed on the movable plate 3100, and the movable plate 3100 is installed in the movable frame 3200.
  • the movable plate 3100 of this embodiment The width in the left-to-right direction is substantially the same as the internal width of the movable frame 3200, so that the opposite sides (left and right sides) of the movable plate 3100 and the inner walls of the opposite sides (left and right sides) of the movable frame 3200 slide to fit.
  • the movable plate 3100 can slide back and forth along the first direction within the movable frame 3200.
  • the first direction in this embodiment is the vertical direction in the figure.
  • the size of the movable frame 3200 in this embodiment is smaller than the size of the substrate 3400, and two opposite sides of the movable frame 3200 are connected to the substrate 3400 through two elastic recovery mechanisms 3300, respectively.
  • the elastic restoring mechanism 3300 is a telescopic spring or other elastic member, and it should be noted that the elastic restoring mechanism 3300 of this embodiment only allows it to expand and retract in the left-right direction in the figure (that is, the second direction described below). The ability to move along the first direction cannot be designed.
  • the purpose of designing the elastic recovery mechanism 3300 is also to facilitate the movable frame 3200 to reset the movable plate 3100 after the movable frame 3200 compensates for displacement.
  • the specific action process of this embodiment will be described below. The process is described in detail.
  • the compensation mechanism 3500 of this embodiment drives the movable plate 3100 and the lens on the movable plate 3100 under the driving of the processing module (which may be an action instruction sent by the processing module) to implement lens shake compensation.
  • the compensation mechanism 3500 in this embodiment includes a driving shaft 3510, a gear 3520, a gear track 3530, and a limit track 3540.
  • the driving shaft 3510 is mounted on the substrate 3400, and specifically is mounted on the substrate 3400. On the surface, the drive shaft 3510 is drivingly connected to the gear 3520.
  • the drive shaft 3510 can be driven by a structure such as a micro motor (not shown), and the micro motor is controlled by the processing module described above; the gear track 3530 is provided On the movable plate 3100, the gear 3520 is installed in the gear track 3530 and moves in a preset direction of the gear track 3530.
  • the gear track 3530 makes the movement
  • the plate 3100 can generate a displacement in a first direction and a displacement in a second direction, wherein the first direction is perpendicular to the second direction; the limit track 3540 is disposed on the movable plate 3100 or the base plate 3400 In the above, the limit track 3540 is used to prevent the gear 3520 from leaving the gear track 3530.
  • gear track 3530 and the limit track 3540 of this embodiment have the following two structural forms:
  • a waist-shaped hole 3550 is provided on the lower side of the movable plate 3100 in this embodiment, and a plurality of waist-shaped holes 3550 are provided along the circumferential direction (that is, the surrounding direction of the waist-shaped hole 3550).
  • a tooth 3560 meshing with the gear 3520, the waist-shaped hole 3550 and a plurality of the teeth 3560 together form the gear track 3530, and the gear 3520 is located in the waist-shaped hole 3550 and communicates with the tooth 3560.
  • the meshing makes the gear 3520 move the gear track 3530 when it rotates, and then directly drives the movement of the movable plate 3100.
  • this embodiment describes A limiting rail 3540 is provided on the base plate 3400, and a bottom of the movable plate 3100 is provided with a limiting member 3570 installed in the limiting rail 3540.
  • the limiting rail 3540 enables the limiting member 3570 to be located therein.
  • the movement trajectory is waist-shaped, that is, the movement trajectory of the limiter 3570 in the current track is the same as the movement trajectory of the movable plate 3100.
  • the limiter 3570 of this embodiment is provided on the movable plate 3100. Bulge on the bottom.
  • the gear track 3530 of this embodiment may also be composed of a plurality of cylindrical protrusions 3580 provided on the movable plate 3100.
  • the gears 3520 are arranged at regular intervals in the second direction, and the gears 3520 are engaged with a plurality of the protrusions; and the limit track 3540 is a first arc-shaped stopper 3590 and a second arc provided on the movable plate 3100.
  • Shape limiting member 3600, the first arc-shaped limiting member 3590 and the second arc-shaped limiting member 3600 are respectively disposed on opposite sides of the gear rail 3530 in the first direction to prevent movement on the movable plate 3100
  • the gear 3520 is located on one side of the gear rail 3530.
  • the gear 3520 is easily separated from the gear rail 3530 formed by the cylindrical protrusion 3580.
  • the first arc-shaped stopper 3590 or the second arc-shaped stopper 3600 can Plays a guiding role, so that the movable plate 3100 can move in a preset direction of the gear track 3530, that is, the first arc-shaped limiting member 3590, the second arc-shaped limiting member 3600, and a plurality of the protrusions cooperate
  • the motion trajectory of the movable board 3100 is waist-shaped.
  • the following describes the working process of the mechanical image stabilizer 3000 of this embodiment in detail with reference to the above structure.
  • the two shake directions are opposite, and the movable plate 3100 needs to be compensated once in the first direction. And then motion compensation once in the second direction.
  • the gyroscope feeds back the detected lens 1000 shake direction and distance to the processing module in advance, and the processing module calculates the required moving distance of the movable plate 3100, so that the driving shaft 3510 drives The gear 3520 rotates.
  • the gear 3520 cooperates with the gear track 3530 and the limit track 3540, and the processing module wirelessly sends a driving signal, thereby driving the movable plate 3100 to move to the compensation position in the first direction.
  • the processing module wirelessly sends a driving signal, thereby driving the movable plate 3100 to move to the compensation position in the first direction.
  • the movable plate is driven again by the driving shaft 3510. 3100 reset.
  • the elastic recovery mechanism 3300 also provides a reset force for resetting the movable plate 3100, which is more convenient for the movable plate 3100 to return to the initial position.
  • the processing method is the same as the compensation steps in the first direction described above.
  • the mechanical compensator provided in this embodiment not only does not receive interference from external magnetic fields and has a good anti-shake effect, but also can accurately compensate the lens 1000 in the event of multiple shakes, and the compensation is timely and accurate.
  • the mechanical anti-shake device using this embodiment is not only simple in structure, but also requires small installation space for each component, which facilitates the integration of the entire anti-shake device and has higher compensation accuracy.
  • the electronic device in this embodiment includes a mobile phone and a bracket for mounting the mobile phone.
  • the purpose of the electronic device including a bracket is to support and fix the electronic device due to the uncertainty of the image acquisition environment.
  • the bracket 5000 in this embodiment includes a mobile phone mounting base 5100 and a retractable supporting rod 5200.
  • the supporting rod 5200 and the middle portion of the mobile phone mounting base 5100 pass through a damping hinge.
  • the bracket 5000 may form a selfie stick structure
  • the bracket 5000 may form a mobile phone bracket 5000 structure.
  • the applicant found that the mobile phone mount 5100 combined with the support pole 5200 occupies a large space. Even if the support pole 5200 is retractable, the mobile phone mount 5100 cannot undergo structural changes and the volume will not be further reduced. Putting it in a pocket or a small bag causes the inconvenience of carrying the stent 5000. Therefore, in this embodiment, a second step improvement is made to the stent 5000, so that the overall storability of the stent 5000 is further improved.
  • the mobile phone mounting base 5100 of this embodiment includes a retractable connecting plate 5110 and a folding plate group 5120 installed at opposite ends of the connecting plate 5110.
  • the support rod 5200 and the connecting plate 5110 The middle part is connected by a damping hinge;
  • the folding plate group 5120 includes a first plate body 5121, a second plate body 5122, and a third plate body 5123, wherein one of the two opposite ends of the first plate body 5121 is connected to the first plate body 5121.
  • the connecting plate 5110 is hinged, the other end of the opposite ends of the first plate body 5121 is hinged with one of the opposite ends of the second plate body 5122, and the opposite ends of the second plate body 5122 The other end is hinged to one of opposite ends of the third plate body 5123; the second plate body 5122 is provided with an opening 5130 for a corner of the mobile phone to be inserted.
  • the first plate 5121, the second plate 5122, and the third plate 5123 are folded into a right triangle state, and the second plate 5122 is a hypotenuse of a right-angled triangle, and the first plate body 5121 and the third plate 5123 are right-angled sides of a right triangle, wherein one side surface of the third plate body 5123 and one of the connection plate 5110 are The side is attached side by side, and the other end of the opposite ends of the third plate body 5123 and the one of the opposite ends of the first plate body 5121 are against each other.
  • This structure can make the three folding plates in a self-locking state, and When the two lower corners of the mobile phone are inserted into the two openings 5130 on both sides, the lower sides of the mobile phone 6000 are located in two right-angled triangles.
  • the mobile phone 6000 can be completed through the joint work of the mobile phone, the connecting plate 5110, and the folding plate group 5120.
  • the triangle state cannot be opened under external force.
  • the triangle state of 5120 pieces of folding plate group can only be released after the mobile phone is pulled out from the opening 5130.
  • the connecting plate 5110 When the mobile phone mounting base 5100 is not in working state, the connecting plate 5110 is reduced to a minimum length, and the folding plate group 5120 and the connecting plate 5110 are folded to each other.
  • the user can fold the mobile phone mounting base 5100 to a minimum volume. Due to the scalability of the lever 5200, the entire bracket 5000 can be accommodated in the smallest state, which improves the collection of the bracket 5000. The user can even put the bracket 5000 directly into the pocket or small handbag, which is very convenient.
  • a first connection portion is also provided on one side of the third plate body 5123, and a side surface where the connection plate 5110 is in contact with the third plate body 5123 is provided with the first connection portion.
  • a first mating portion that mates with the connecting portion.
  • the first connecting portion of this embodiment is a convex strip or protrusion (not shown in the figure), and the first matching portion is a card slot (not shown in the figure) opened on the connecting plate 5110.
  • This structure not only improves the stability when the 5120 pieces of the folding plate group are in a triangular state, but also facilitates the connection of the 5120 pieces of the folding plate group and the connecting plate 5110 when the mobile phone mounting base 5100 needs to be folded to a minimum state.
  • a second connection portion is also provided at one end of the opposite ends of the first plate body 5121, and the other end of the opposite ends of the third plate body 5123 is provided with the second connection portion.
  • the second connection portion may be a protrusion (not shown in the figure), and the second mating portion is an opening 5130 or a card slot (not shown in the figure) that cooperates with the protrusion.
  • a base (not shown in the figure) can be detachably connected to the other end of the support rod 5200.
  • the support rod 5200 can be stretched to A certain length, put the bracket 5000 on a plane through the base, and then place the mobile phone in the mobile phone mount 5100 to complete the fixing of the mobile phone; and the detachable connection of the support rod 5200 and the base can make the two can be carried separately, further The accommodating and carrying convenience of the bracket 5000 are improved.
  • the device embodiments described above are only schematic, and the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, which may be located in One place, or can be distributed to multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the objective of the solution of this embodiment. Those of ordinary skill in the art can understand and implement without creative labor.
  • An embodiment of the present invention provides a non-transitory computer-readable storage storage medium, where the computer storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by an electronic device, the electronic device is caused.
  • An embodiment of the present invention provides a computer program product, wherein the computer program product includes a computer program stored on a non-transitory computer-readable storage medium, the computer program includes program instructions, and when the program instructions When executed by an electronic device, the electronic device is caused to execute the picture composition method in any of the foregoing method embodiments.
  • each embodiment can be implemented by means of software plus a necessary universal hardware platform, and of course, also by hardware.
  • the above-mentioned technical solution in essence or a part that contributes to the existing technology may be embodied in the form of a software product, and the computer software product may be stored in a computer-readable storage medium, the computer-readable record A medium includes any mechanism for storing or transmitting information in a form readable by a computer (eg, a computer).
  • machine-readable media include read-only memory (ROM), random-access memory (RAM), magnetic disk storage media, optical storage media, flash storage media, electrical, optical, acoustic, or other forms of propagation signals (e.g., carrier waves , Infrared signals, digital signals, etc.), the computer software product includes a number of instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute various embodiments or certain parts of the embodiments Methods.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • General Health & Medical Sciences (AREA)
  • Business, Economics & Management (AREA)
  • General Business, Economics & Management (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

一种图片合成方法、装置及电子设备,包括:获取第一图片和第二图片,识别并提取所述第一图片中的目标人像,其中,所述第二图片中包括人脸图像;提取所述人脸图像中鼻部区域的子图像,基于所述子图像的光强加权中心与所述人脸图像的加权中心,得到所述第二图片的光线角度;获取所述目标人像的人脸朝向角度,根据所述人脸朝向角度和所述第二图片的光线角度确定所述目标人像在所述第二图片上的目标位置;依据所述目标位置,将所述目标人像与所述第二图片进行合成。能够实现将第一图片中的目标人物快速合成到第二图片中,且保证目标人物不会受到第二图片中的光线的影响,提高图片合成效率。

Description

一种图片合成方法、装置及电子设备 技术领域
本发明涉及图像处理技术领域,尤其涉及一种图片合成方法、装置及电子设备。
背景技术
随着科学技术的发展,越来越多的照片处理方法进入了人们的生活,例如,用户在和朋友进行在线沟通时,可能会把自己和朋友的照片合成到一起,增加趣味和感情。对于用户来说,其最在意的是快速简单的完成照片的合成,从而得到自己想要的照片。在这个过程中,如何实现不同照片中目标人物的人脸不受光线影响,且能够高效的完成照片的合成,成了从业人员亟待解决的问题。
此外,图片或照片越来越多的通过移动装置拍摄完成,但是移动装置的摄像头获取视频或图片的效果不但受周围环境光的影响,也受到拍摄稳定度的影响,幅度较大的抖动会影响拍摄质量且不利于后续图片或视频的处理,移动装置的支架或自拍杆也使用灵活度也不能满足要求。
发明内容
本发明实施例提供的图片合成方法、装置及电子设备,用以至少解决相关技术中的上述问题。
本发明实施例一方面提供了一种图片合成方法,包括:
获取第一图片和第二图片,识别并提取所述第一图片中的目标人像,其中,所述第二图片中包括人脸图像;提取所述人脸图像中鼻部区域的子图像,基于所述子图像的光强加权中心与所述人脸图像的加权中心,得到所述第二图片的光线角度;获取所述目标人像的人脸朝向角度,根据所述人脸朝向角度和所述第二图片的光线角度确定所述目标人像在所述第二图片上的目标位置;依据所述目标位置,将所述目标人像与所述第二图片进行合成。
进一步地,所述获取所述目标人像的人脸朝向角度,包括:识别所述目标人像的特征点,基于所述特征点确定所述目标人像五官的位置信息;基于所述目标人像五官的位置信息计算所述目标人像的五官的相对位置;根据所述五官的相对位置确定所述目标人像的人脸朝向角度。
进一步地,所述获取所述目标人像的人脸朝向角度,包括:识别所述目标人像的脸庞区域,基于所述脸庞区域确定所述目标人像的人脸朝向;计算所述脸庞区域之 间的面积比例;根据所述目标人像的人脸朝向及所述面积比例,确定所述目标人像的人脸朝向角度。
进一步地,所述根据所述人脸朝向角度和所述第二图片的光线角度确定所述目标人像在所述第二图片上的目标位置,包括:基于所述人脸朝向角度和所述第二图片的光线角度,确定在所述第二图片中,所述目标人像的人脸是否处于顺光状态;若未处于顺光状态,在所述第二图片中查找能够遮挡所述第二图片的光线的位置,将所述位置作为目标位置。
进一步地,所述基于所述子图像的光强加权中心与所述人脸图像的加权中心,得到所述第二图片的光线角度包括:将所述子图像分为若干个子区域,确定各所述子区域的子光强加权中心;将各所述子光强加权中心与所述人脸图像的加权中心进行比较,得到各所述子区域的子光线估计角度;计算各所述子区域的子光照强度,根据所述子区域的子光照强度确定所述子区域的子光线估计角度的权重;根据各所述子光线估计角度及所述子光线估计角度的权重,计算得到所述第二图片的光线角度。
本发明实施例的另一方面提供了一种图片合成装置,包括:
识别模块,用于获取第一图片和第二图片,识别并提取所述第一图片中的目标人像,其中,所述第二图片中包括人脸图像;提取模块,用于提取所述人脸图像中鼻部区域的子图像,基于所述子图像的光强加权中心与所述人脸图像的加权中心,得到所述第二图片的光线角度;确定模块,用于获取所述目标人像的人脸朝向角度,根据所述人脸朝向角度和所述第二图片的光线角度确定所述目标人像在所述第二图片上的目标位置;合成模块,用于依据所述目标位置,将所述目标人像与所述第二图片进行合成。
进一步地,所述确定模块包括:第一识别单元,用于识别所述目标人像的特征点,基于所述特征点确定所述目标人像五官的位置信息;第一计算单元,用于基于所述目标人像五官的位置信息计算所述目标人像的五官的相对位置;第一确定单元,用于根据所述五官的相对位置确定所述目标人像的人脸朝向角度。
进一步地,所述确定模块包括:第二识别单元,用于识别所述目标人像的脸庞区域,基于所述脸庞区域确定所述目标人像的人脸朝向;第二计算单元,用于计算所述脸庞区域之间的面积比例;第二确定单元,用于根据所述目标人像的人脸朝向及所述面积比例,确定所述目标人像的人脸朝向角度。
进一步地,所述确定模块用于,基于所述人脸朝向角度和所述第二图片的光线角度,确定在所述第二图片中,所述目标人像的人脸是否处于顺光状态;若未处于顺光状态,在所述第二图片中查找能够遮挡所述第二图片的光线的位置,将所述位置作为目标位置。
进一步地,所述提取模块用于,将所述子图像分为若干个子区域,确定各所述子区域的子光强加权中心;将各所述子光强加权中心与所述人脸图像的加权中心进 行比较,得到各所述子区域的子光线估计角度;计算各所述子区域的子光照强度,根据所述子区域的子光照强度确定所述子区域的子光线估计角度的权重;根据各所述子光线估计角度及所述子光线估计角度的权重,计算得到所述第二图片的光线角度。
本发明实施例的又一方面提供一种电子设备,包括:至少一个处理器;以及,与所述至少一个处理器通信连接的存储器;其中,所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述任一项图片合成方法。
进一步的,所述电子设备还包括图像获取模块,所述图像获取模块包括镜头、自动聚焦音圈马达、机械防抖器以及图像传感器,所述镜头固装在所述自动聚焦音圈马达上,所述镜头用于获取图像,所述图像传感器将所述镜头获取的图像传输至所述识别模块,所述自动聚焦音圈马达安装在所述机械防抖器上,所述处理模块根据镜头内的陀螺仪检测到的镜头抖动的反馈驱动所述机械防抖器的动作,实现镜头的抖动补偿。
进一步的,所述机械防抖器包括活动板、活动框、弹性回复机构、基板以及补偿机构;所述活动板的中部设有供所述镜头穿过的通孔,所述自动聚焦音圈马达安装在所述活动板上,所述活动板安装在所述活动框内,所述活动板的相对两侧与所述活动框相对两侧的内壁滑动配合,以使所述活动板可沿着第一方向往复滑动;所述活动框的尺寸小于所述基板的尺寸,所述活动框的相对两侧分别通过两个弹性回复机构与所述基板相连接,所述基板的中部也设有所述镜头穿过的通孔;所述补偿机构在所述处理模块的驱动下带动所述活动板和活动板上的镜头动作,以实现镜头的抖动补偿;所述补偿机构包括驱动轴、齿轮、齿轮轨道以及限位轨道,所述驱动轴安装在所述基板上,所述驱动轴与所述齿轮传动连接;所述齿轮轨道设置在所述活动板上,所述齿轮安装在所述齿轮轨道内,所述齿轮转动时通过所述齿轮轨道使得所述活动板能够产生向第一方向的位移和第二方向的位移,其中所述第一方向与所述第二方向垂直;所述限位轨道设置在所述活动板上或所述基板上,所述限位轨道用于防止所述齿轮脱离所述齿轮轨道。
进一步的,所述活动板一侧设有一腰型孔,所述腰型孔沿其周向设有多个与所述齿轮相啮合的齿,所述腰型孔和多个所述齿共同构成所述齿轮轨道,所述齿轮位于所述腰型孔内并与所述齿相啮合;所述限位轨道设置在所述基板上,所述活动板底部设有位于所述限位轨道内的限位件,所述限位轨道使所述限位件在其中的运动轨迹呈腰型。
进一步的,所述限位件为设置在所述活动板底面上的凸起。
进一步的,所述齿轮轨道包括设置在所述活动板上的多个圆柱凸起,多个所述圆柱凸起沿所述第二方向均匀间隔布设,所述齿轮与多个所述凸起相啮合;所述限位轨道为设置在所述活动板上的第一弧形限位件和第二弧形限位件,所述第一弧形限 位件和第二弧形限位件分别设置在所述齿轮轨道沿第一方向上的相对两侧,所述第一弧形限位件和第二弧形限位件及多个所述凸起相配合使得所述活动板的运动轨迹呈腰型。
进一步的,所述弹性回复机构包括伸缩弹簧。
进一步的,所述图像获取模块包括手机和用于安装所述手机的支架。
进一步的,所述支架包括手机安装座和可伸缩的支撑杆;所述手机安装座包括可伸缩的连接板和安装于连接板相对两端的折叠板组,所述支撑杆的一端与所述连接板中部通过阻尼铰链相连接;所述折叠板组包括第一板体、第二板体及第三板体,其中,所述第一板体的相对两端中的一端与所述连接板相铰接,所述第一板体的相对两端中的另一端与所述第二板体的相对两端中的一端相铰接;所述第二板体相对两端的另一端与所述第三板体相对两端中的一端相铰接;所述第二板体设有供手机边角插入的开口;所述手机安装座用于安装手机时,所述第一板体、第二板体和第三板体折叠呈直角三角形状态,所述第二板体为直角三角形的斜边,所述第一板体和所述第三板体为直角三角形的直角边,其中,所述第三板体的一个侧面与所述连接板的一个侧面并排贴合,所述第三板体相对两端中的另一端与所述第一板体相对两端中的一端相抵。
进一步的,所述第三板体的一个侧面设有第一连接部,所述连接板与所述第三板体相贴合的侧面设有与所述第一连接部相配合的第一配合部,所述支架手机安装座用于安装手机时,所述第一连接部和所述第一配合部卡合连接。
进一步的,所述第一板体相对两端中的一端设有第二连接部,所述第三板体相对两端中的另一端设有与所述第二连接部相配合的第二配合部,所述支架手机安装座用于安装手机时,所述第二连接部和所述第二配合部卡合连接。
进一步的,所述支撑杆的另一端可拆卸连接有底座。
由以上技术方案可见,本发明实施例提供的图片合成方法、装置及电子设备,能够实现将第一图片中的目标人物快速合成到第二图片中,且保证目标人物不受第二图片中光线的影响,提高了合成图片的质量,无需专业人员对图片合成进行处理,省时省力,提升了用户体验。手机摄像头的防抖动硬件结构和手机自拍支架也进一步增强了拍摄效果,更利于后续的图像处理。
附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明实施例中记载的一些实施例,对于本领域普通技术人员来讲,还可以根据 这些附图获得其他的附图。
图1为本发明一个实施例提供的图片合成方法流程图;
图2为本发明一个实施例提供的图片合成方法流程图;
图3为本发明一个实施例提供的图片合成方法流程图;
图4为本发明一个实施例提供的图片合成装置结构图;
图5为本发明一个实施例提供的图片合成装置结构图;
图6为本发明一个实施例提供的图片合成装置结构图;
图7为执行本发明方法实施例提供的图片合成方法的电子设备的硬件结构示意图;
图8为本发明一个实施例提供的图像获取模块的结构示意图;
图9为本发明一个实施例提供的第一种机械防抖器的结构示意图;
图10为本发明一个实施例提供的第一种活动板的底面结构示意图;
图11为本发明一个实施例提供的第二种机械防抖器的结构示意图;
图12为本发明一个实施例提供的第二种活动板的底面结构示意图;
图13为本发明一个实施例提供的支架的结构图;
图14为本发明一个实施例提供的支架的一个状态示意图;
图15为本发明一个实施例提供的支架的另一个状态示意图;
图16为本发明一个实施例提供的安装座与手机相连接时的结构状态图。
具体实施方式
为了使本领域的人员更好地理解本发明实施例中的技术方案,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅是本发明实施例一部分实施例,而不是全部的实施例。基于本发明实施例中的实施例,本领域普通技术人员所获得的所有其他实施例,都应当属于本发明实施例保护的范围。
下面结合附图,对本发明的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互结合。图1为本发明实施例提供的图片合成方法流程图。如图1所示,本发明实施例提供的图片合成方法,包括:
S101,获取第一图片和第二图片,识别并提取所述第一图片中的目标人像。其中,所述第二图片中包括人脸图像。
在本步骤中,可以是基于用户对第一图片中任一区域的选择触发操作,识别并提取该区域中包括的人像作为目标人像;也可以是自动对第一图片中包括的人脸图像进行识别,当识别出的人脸图像超过一个时,显示给用户进行选择,基于用户的选择确定目标人像,并对该目标人像进行提取。
具体地址,识别过程可以采用图像识别技术识别出目标人像,比如采用轮廓提取、模式匹配或通过在预设数据库库中存储的多类型的人脸图像进行特征比对等等,本发明实施例对图像识别技术不做限定。当识别出目标人像后,可以沿着识别得到的目标人像的轮廓进行抠图,也可以使用图像抠出技术,例如Photoshop中相关的抠图技术,将目标人像从第一图片中提取出来。
S102,提取所述人脸图像中鼻部区域的子图像,基于所述子图像的光强加权中心与所述人脸图像的加权中心,得到所述第二图片的光线角度。
由于第一图片和第二图片拍摄过程中的光线条件是不一致的,因此为了能让目标人像与第二图片有更好的光影效果的融合,需要对第一图片进行光影效果的确定。
具体地,通过本领域技术人员熟知的人脸检测算法(例如,Eli Saber等发表的基于颜色、形状和对称性的成本函数进行正面人脸检测和面部特征提取;Karin Sobottka等发表的一种新的自动人脸分割、人脸特征提取和跟踪方法;Phillip Ian Wilson等发表的基于分类器的人脸特征检测方法;Alan L.Yuille等发表的使用可变形模板从人脸中提取特征)、或者任何基于CNN的人脸检测算法等,从该人脸图像中提取人脸特征。由于五官当中鼻子是凸出于人脸的,鼻部区域的明暗更容易受到拍照时环境光的影响,因此本实施例提取人脸特征中的鼻子,得到人脸图像中鼻部区域的子图像。
在本步骤中,根据子图像的图像矩来确定其对应的光强加权中心。图像矩是一个从数字图形中计算出来的矩集,通常描述了该图像的全局特征,并提供大量的关于该图像不同类型的几何特征信息,比如大小、位置、方向及形状等,例如,一阶矩与形状有关、二阶矩显示了曲线围绕直线平均值的扩展程度、三阶矩则是关于平均值的对称性测量,由二阶矩和三阶矩可以导出一组共有7个不变阶矩,不变阶矩是图像统计特征,其可以据此对图像进行分类操作,属于本领域的公知常识,本发明在此不再赘述。
可选地,在确定了子图片的光强加权中心之后,将其与子图像的加权中心进行比较(该加权中心即为图像的集合中心),将图像的加权中心的坐标位置与子图片的光强加权中心的坐标位置进行比较,从几何中心到光强加权中心的方向即是环境光的光线方向,同时,我们可以通过选择坐标原点来建立坐标系,得到该向量与X轴的夹角,作为第二图片的光线估计角度。此外,也可以通过其他非专有算法来对光线估计角度进行计算,本发明在此不做限制。需要说明的是,在本发明实施例中,环境光将被认为是单向的和均匀的。
作为本发明实施例的一些可选实施方式,为了让光线估计角度更加准确,可以将所述子图像分为若干个子区域,确定各所述子区域的子光强加权中心;将各所述子光强加权中心与所述人脸图像的加权中心进行比较,得到各所述子区域的子光线估计角度;计算各所述子区域的子光照强度,根据所述子区域的子光照强度确定所述子区域的子光线估计角度的权重;根据各所述子光线估计角度及所述子光线估计角度的权重,计算得到所述第二图片的光线角度。
具体地,首先,可以将子图像平均分成四份,得到四个子区域,按照上述方法确定每个子区域的子光强加权中心、以及每个子区域的子光线估计角度;其次,对于每一张子图片,根据其中的明暗对比度信息等获得该子图片对应的光线强度,在得到每个子区域的子光照强度后,将每个子区域的子光照强度作为该子区域的子光线估计角度的权重;最后,对四个子区域的子光线估计角度根据其分别对应的权重进行加和求平均值的计算,得到平均光线估计角度。
当第二图片中存在多个人脸图像时,可以对每个人脸图像通过上述方式进行光线角度的计算,再进行平均求和;也可以通过每个人脸图像在第二图片上的位置和姿态确定其对应的权重,再根据权重进行加权求和,得到最终确定的第二图片的光线角度。
S103,获取所述目标人像的人脸朝向角度,根据所述人脸朝向角度和所述第二图片的光线角度确定所述目标人像在所述第二图片上的目标位置。
图片中人像的光影效果会随着人脸朝向与光源的相对位置的不同而有所差异。通过步骤S102确定得到第二图片的光线角度后,需要参照目标人像的人脸朝向角度对该目标人像在第二图片中进行目标位置的确定。因此,首先需要获取目标人像的人脸朝向角度。
作为第一种可选的实施方式,如图2所示,通过如下步骤获取目标人像的人脸朝向角度。
S1031,识别所述目标人像的特征点,基于所述特征点确定所述目标人像五官的位置信息。
人脸中的眉毛、眼睛、鼻子、下巴和嘴巴等分别由若干个所述特征点组成,因此可以预先识别预设数量的关键点来代表人脸的特征。具体地,可以利用特征点识别模型来获取特征点。例如,可以获取一定数量的训练集,该训练集中为携带有人脸特征点标识及其对应的坐标位置的图片;利用该训练集训练形成初始回归函数和初始训练集,利用该初始训练集和初始回归函数迭代形成下一次训练集和回归函数;每次迭代回归函数均使用梯度提升算法进行学习,从而当第n次训练集与训练集中的人脸特征点信息满足收敛条件时,则其对应的回归函数即为训练完成的人脸特征点识别模型。
在本步骤中,通过训练好的特征点识别模型对输入的目标人像识别得到预设数量的特征点、以及特征点坐标(x i,y i),其中,i代表识别得到的第i个特征点,通过这些特征点即可确定出来目标人像五官中各个局部器官、以及局部器官对应的坐标位置。在具体实施过程中,由于每个局部器官中包括多个特征点,因此可以选择一个最能代表各局部器官的特征点的坐标作为该局部器官对应的坐标位置,也可以将各个局部器官的特征点的坐标求平均值、作为该局部器官对应的坐标位置。
需要说明的是,坐标系是利用第二图片进行建立的,示例性的,可以以第二图 片的左下角为原点,第二图片的左侧边为y轴,第二图片的底侧边为x轴。
S1032,基于所述目标人像五官的位置信息计算所述目标人像的五官的相对位置。
S1033,根据所述五官的相对位置确定所述目标人像的人脸朝向角度。
具体地,当人脸进行偏转的时候,其局部器官上的相对位置会随着偏转角度的变化而变化,因此,本发明实施例通过计算局部器官的相对位置,来确定目标人像的人脸朝向角度。可选地,根据五官中各局部器官的坐标位置来确定目标人像中的若干个相对位置。这些相对位置包括但不限于鼻子、上唇、下唇、眼部之间的相对位置,瞳孔到鼻孔、眉毛到下巴、鼻孔到下巴、瞳孔到嘴角、嘴角到下巴、眉毛到等等之间的相对位置。在这之前,可以预先准备一些人脸样本集,该人脸样本集中包括不同人脸朝向角度的人脸,每个人脸携带有朝向角度和局部器官相对位置信息,通过该样本集对人脸朝向角度模型进行训练。在本步骤中,可以直接将上述若干个相对位置输入值该模型中,得到该目标人像的人脸朝向角度。
作为第二种可选的实施方式,如图3所示,通过如下步骤获取目标人像的人脸朝向角度。
S1031’,识别所述目标人像的脸庞区域,基于所述脸庞区域确定所述目标人像的人脸朝向。
本实施方式可以通过人脸特征点对目标人像的脸庞区域进行划分。脸庞区域可以分成三部分,眉毛以上发际线以下作为脸庞的上部子区域,以鼻子、嘴巴作为中轴线、耳朵作为左/右边界、眉毛作为上边界、下巴作为下边界,得到与脸庞的左部子区域和右部子区域。当人脸朝向不同时,各个子区域的面积分布比例是不同的,例如,可以将人脸朝向正前方时各个子区域的面积作为标准状态,该种状态下,左部子区域和右部子区域的面积应该是相同的或者相差在预设范围内;当人脸朝向左侧时,左部子区域的面积远远小于右部子区域的面积;当目标人像抬头向上看时,上部子区域的面积应该明显小于标准状态下上部子区域对应的面积。因此,本步骤中,可以将各子区域的面积与标准状态进行比对,得到目标人像的人脸朝向(比如向左、向右、向上等)
S1032’,计算所述脸庞区域之间的面积比例。
S1033’,根据所述目标人像的人脸朝向及所述面积比例,确定所述目标人像的人脸朝向角度。
在进行上述步骤之前,可以预先建立一个面积比例与人脸朝向角度的对应关系表,该表可以是针对大量不同朝向角度的人脸数据统计分析得到的。该关系表中存储有每个人脸朝向下,各子区域面积比例与人脸朝向角度的对应关系。该对应关系可以是一对一,也可以是多对一。例如,人脸向左偏转角度,可能通过左部子区域与右部子区域的面积比例即可确定,此时对应关系就是一对一;但如果为了得到更精确的角 度计算结果,可以通过左部子区域与右部子区域的面积比例、上部子区域与左部子区域的面积比例,上部子区域和右部子区域的面积比例,这三个比例来确定,此时对应关系就是多对一。
具体地,在计算得到各子区域的面积比例之后,首先根据步骤S1031’确定目标人像的人脸朝向,锁定对应关系表中该人脸朝向下的对应关系;在根据计算得到的面积比例、基于该对应关系确定目标人像的人脸朝向角度。
在确定了人脸朝向角度之后,根据该人脸朝向角度和第二图片的光线角度,确定在第二图片中目标人像的人脸是否处于顺光状态;若处于顺光状态,说明目标人像的人脸在第二图片中不会处于过暗或明暗不均的状态,此时不需要对目标人像在第二图像中的位置进行限定,可以根据用户的操作指令进行目标人像的定位。若未处于顺光状态,说明目标人像的人脸在第二图片中会处于逆光或侧光的状态,因此需要在第二图片中查找能够遮挡第二图片的光线的位置,将该位置作为目标位置。具体地,可以在第二图片中沿着该光线角度确定目标对象,通过该目标对象能够对第二图片的光线进行遮挡,从而改变目标人像的人脸的逆光或侧光状态,将该目标对象对应的位置作为目标位置。可选地,该目标位置可以是建筑物、动物、植物、人物等。S104,依据所述目标位置,将所述目标人像与所述第二图片进行合成。
在本步骤中,直接将目标人像合成在步骤S103中得到的目标位置上,得到合成后的图片。
本发明实施例提供的图片合成方法,能够实现将第一图片中的目标人物快速合成到第二图片中,且保证目标人物不受第二图片中光线的影响,提高了合成图片的质量,无需专业人员对图片合成进行处理,省时省力,提升了用户体验。
图4为本发明实施例提供的图片合成装置结构图。如图3所示,该装置具体包括:识别模块100、提取模块200、确定模块300和合成模块400。其中,
识别模块100,用于获取第一图片和第二图片,识别并提取所述第一图片中的目标人像,其中,所述第二图片中包括人脸图像;提取模块200,用于提取所述人脸图像中鼻部区域的子图像,基于所述子图像的光强加权中心与所述人脸图像的加权中心,得到所述第二图片的光线角度;确定模块300,用于获取所述目标人像的人脸朝向角度,根据所述人脸朝向角度和所述第二图片的光线角度确定所述目标人像在所述第二图片上的目标位置;合成模块400,用于依据所述目标位置,将所述目标人像与所述第二图片进行合成。
本发明实施例提供的图片合成装置具体用于执行图1所示实施例提供的所述方法,其实现原理、方法和功能用途等与图1所示实施例类似,在此不再赘述。
图5为本发明实施例提供的图片合成装置结构图。如图5所示,该装置具体包括:识别模块100、提取模块200、确定模块300和合成模块400。其中,
识别模块100,用于获取第一图片和第二图片,识别并提取所述第一图片中的目 标人像,其中,所述第二图片中包括人脸图像;提取模块200,用于提取所述人脸图像中鼻部区域的子图像,基于所述子图像的光强加权中心与所述人脸图像的加权中心,得到所述第二图片的光线角度;确定模块300,用于获取所述目标人像的人脸朝向角度,根据所述人脸朝向角度和所述第二图片的光线角度确定所述目标人像在所述第二图片上的目标位置;合成模块400,用于依据所述目标位置,将所述目标人像与所述第二图片进行合成。
进一步地,确定模块300包括第一识别单元310、第一计算单元320和第一确定单元330。其中,
第一识别单元310,用于识别所述目标人像的特征点,基于所述特征点确定所述目标人像五官的位置信息;第一计算单元320,用于基于所述目标人像五官的位置信息计算所述目标人像的五官的相对位置;第一确定单元330,用于根据所述五官的相对位置确定所述目标人像的人脸朝向角度。
可选地,确定模块300用于,基于所述人脸朝向角度和所述第二图片的光线角度,确定在所述第二图片中,所述目标人像的人脸是否处于顺光状态;若未处于顺光状态,在所述第二图片中查找能够遮挡所述第二图片的光线的位置,将所述位置作为目标位置。
可选地,提取模块200用于,将所述子图像分为若干个子区域,确定各所述子区域的子光强加权中心;将各所述子光强加权中心与所述人脸图像的加权中心进行比较,得到各所述子区域的子光线估计角度;计算各所述子区域的子光照强度,根据所述子区域的子光照强度确定所述子区域的子光线估计角度的权重;根据各所述子光线估计角度及所述子光线估计角度的权重,计算得到所述第二图片的光线角度
本发明实施例提供的图片合成装置具体用于执行图1和图2所示实施例提供的所述方法,其实现原理、方法和功能用途和图1和图2所示实施例类似,在此不再赘述。
图6为本发明实施例提供的图片合成装置结构图。如图6所示,该装置具体包括:获取模块100,输出模块200、调整模块300、替换模块400和处理模块500。其识别模块100、提取模块200、确定模块300和合成模块400。其中,
识别模块100,用于获取第一图片和第二图片,识别并提取所述第一图片中的目标人像,其中,所述第二图片中包括人脸图像;提取模块200,用于提取所述人脸图像中鼻部区域的子图像,基于所述子图像的光强加权中心与所述人脸图像的加权中心,得到所述第二图片的光线角度;确定模块300,用于获取所述目标人像的人脸朝向角度,根据所述人脸朝向角度和所述第二图片的光线角度确定所述目标人像在所述第二图片上的目标位置;合成模块400,用于依据所述目标位置,将所述目标人像与所述第二图片进行合成。
进一步地,确定模块300包括第二识别单元340、第二计算单元350和第二确定 单元360。其中,
第二识别单元340,用于识别所述目标人像的脸庞区域,基于所述脸庞区域确定所述目标人像的人脸朝向;第二计算单元350,用于计算所述脸庞区域之间的面积比例;第二确定单元360,用于根据所述目标人像的人脸朝向及所述面积比例,确定所述目标人像的人脸朝向角度。
可选地,确定模块300用于,基于所述人脸朝向角度和所述第二图片的光线角度,确定在所述第二图片中,所述目标人像的人脸是否处于顺光状态;若未处于顺光状态,在所述第二图片中查找能够遮挡所述第二图片的光线的位置,将所述位置作为目标位置。
可选地,提取模块200用于,将所述子图像分为若干个子区域,确定各所述子区域的子光强加权中心;将各所述子光强加权中心与所述人脸图像的加权中心进行比较,得到各所述子区域的子光线估计角度;计算各所述子区域的子光照强度,根据所述子区域的子光照强度确定所述子区域的子光线估计角度的权重;根据各所述子光线估计角度及所述子光线估计角度的权重,计算得到所述第二图片的光线角度
本发明实施例提供的图片合成装置具体用于执行图1和图3所示实施例提供的所述方法,其实现原理、方法和功能用途和图1和图3所示实施例类似,在此不再赘述。
上述这些本发明实施例的图片合成装置可以作为其中一个软件或者硬件功能单元,独立设置在上述电子设备中,也可以作为整合在处理器中的其中一个功能模块,执行本发明实施例的图片合成方法。
图7为执行本发明方法实施例提供的图片合成方法的电子设备的硬件结构示意图。根据图7所示,该电子设备包括:
一个或多个处理器710以及存储器720,图7中以一个处理器710为例。执行所述的图片合成方法的设备还可以包括:输入装置730和输出装置730。
处理器710、存储器720、输入装置730和输出装置740可以通过总线或者其他方式连接,图7中以通过总线连接为例。
存储器720作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块,如本发明实施例中的所述图片合成方法对应的程序指令/模块。处理器710通过运行存储在存储器720中的非易失性软件程序、指令以及模块,从而执行服务器的各种功能应用以及数据处理,即实现所述图片合成方法。
存储器720可以包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需要的应用程序;存储数据区可存储根据本发明实施例提供的图片合成装置的使用所创建的数据等。此外,存储器720可以包括高速随机存取存储 器720,还可以包括非易失性存储器720,例如至少一个磁盘存储器720件、闪存器件、或其他非易失性固态存储器720件。在一些实施例中,存储器720可选包括相对于处理器77远程设置的存储器720,这些远程存储器720可以通过网络连接至所述图片合成装置。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
输入装置730可接收输入的数字或字符信息,以及产生与图片合成装置的用户设置以及功能控制有关的键信号输入。输入装置730可包括按压模组等设备。
所述一个或者多个模块存储在所述存储器720中,当被所述一个或者多个处理器710执行时,执行所述图片合成方法。
本发明实施例的电子设备以多种形式存在,包括但不限于:
(1)移动通信设备:这类设备的特点是具备移动通信功能,并且以提供话音、数据通信为主要目标。这类终端包括:智能手机(例如iPhone)、多媒体手机、功能性手机,以及低端手机等。
(2)超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:PDA、MID和UMPC设备等,例如iPad。
(3)便携式娱乐设备:这类设备可以显示和播放多媒体内容。该类设备包括:音频、视频播放器(例如iPod),掌上游戏机,电子书,以及智能玩具和便携式车载导航设备。
(4)服务器。
(5)其他具有数据交互功能的电子装置。
具体的,电子设备中包括图像获取模块,如图8所示,本实施例的所述图像获取模块包括镜头1000、自动聚焦音圈马达2000、机械防抖器3000以及图像传感器4000,所述镜头1000固装在所述自动聚焦音圈马达2000上,所述镜头1000固装在所述自动聚焦音圈马达2000上,所述镜头1000用于获取图像,所述图像传感器4000将所述镜头1000获取的图像传输至所述识别模块,所述自动聚焦音圈马达2000安装在所述机械防抖器3000上,所述处理模块根据镜头1000内的陀螺仪检测到的镜头1000抖动的反馈驱动所述机械防抖器3000的动作,实现镜头1000的抖动补偿。
现有的防抖器大多由通电线圈在磁场中产生洛伦磁力驱动镜头1000移动,而要实现光学防抖,需要在至少两个方向上驱动镜头1000,这意味着需要布置多个线圈,会给整体结构的微型化带来一定挑战,而且容易受外界磁场干扰,进而影响防抖效果,因此公开号为CN106131435A的中国专利提供了一种微型光学防抖摄像头模组,其通过温度变化实现记忆合金丝的拉伸和缩短,以此拉动自动聚焦音圈马达2000移动,实现镜头1000的抖动补偿,微型记忆合金光学防抖致动器的控制芯片可以控制驱动信号的变化来改变记忆合金丝的温度,以此控制记忆合金丝的伸长和缩短,并且根据记忆合金丝的电阻来计算致动器的位置和移动距离。当微型记忆合金光学防抖致动器上移动到指定位置后反馈记忆合金丝此时的电阻,通过比较这个电阻值与目 标值的偏差,可以校正微型记忆合金光学防抖致动器上的移动偏差。
但是申请人发现,由于抖动的随机性和不确定性,仅仅依靠上述技术方案的结构是无法实现在多次抖动发生的情况下能够对镜头1000进行精确的补偿,这是由于形状记忆合金的升温和降温均需要一定的时间,当抖动向第一方向发生时,上述技术方案可以实现镜头1000对第一方向抖动的补偿,但是当随之而来的第二方向的抖动发生时,由于记忆合金丝来不及在瞬间变形,因此容易造成补偿不及时,无法精准实现对多次抖动和不同方向的连续抖动的镜头1000抖动补偿,因此需要对其结构上进行改进。
结合附图9-12所示,本实施例对光学防抖器进行改进,将其设计为机械防抖器3000,其具体结构如下:
本实施例的所述机械防抖器3000包括活动板3100、活动框3200、弹性回复机构3300、基板3400以及补偿机构3500;所述活动板3100和基板3400的中部均设有供所述镜头穿过的通孔3700,所述自动聚焦音圈马达安装在所述活动板3100上,所述活动板3100安装在所述活动框3200内,由图中可以看出,本实施例的活动板3100的左右方向的宽度与活动框3200的内部宽度大致相同,使得所述活动板3100的相对两侧(左右两侧)与所述活动框3200相对两侧(左右两侧)的内壁滑动配合,以使所述活动板3100在活动框3200内可沿着第一方向往复滑动,本实施例的第一方向即图中的上下方向。
具体的,本实施例的所述活动框3200的尺寸小于所述基板3400的尺寸,所述活动框3200的相对两侧分别通过两个弹性回复机构3300与所述基板3400相连接,本实施例的弹性回复机构3300为伸缩弹簧或者其他弹性件,而且需要说明的是,本实施例的弹性回复机构3300只允许其具有沿着图中左右方向(即下述的第二方向)伸缩和回弹的能力,无法沿着第一方向运动,设计弹性回复机构3300的目的也是在于当活动框3200发生补偿位移后便于活动框3200带动活动板3100复位,而具体的动作过程本实施例会在下述的工作过程进行具体描述。
本实施例的所述补偿机构3500在所述处理模块的驱动(可以是处理模块发送的动作指令)下带动所述活动板3100和活动板3100上的镜头动作,以实现镜头的抖动补偿。
具体的,本实施例的所述补偿机构3500包括驱动轴3510、齿轮3520、齿轮轨道3530以及限位轨道3540,所述驱动轴3510安装在所述基板3400上,具体是安装在基板3400的上表面,所述驱动轴3510与所述齿轮3520传动连接,驱动轴3510可以通过微型电机(图中未示出)等结构驱动,并且微型电机受控于上述的处理模块;所述齿轮轨道3530设置在所述活动板3100上,所述齿轮3520安装在所述齿轮轨道3530内并沿着所述齿轮轨道3530的预设方向运动,所述齿轮3520转动时通过所述齿轮轨道3530使得所述活动板3100能够产生向第一方向的位移和第二方向的位移, 其中所述第一方向与所述第二方向垂直;所述限位轨道3540设置在所述活动板3100上或所述基板3400上,所述限位轨道3540用于防止所述齿轮3520脱离所述齿轮轨道3530。
具体的,本实施例的齿轮轨道3530和限位轨道3540具有以下两种结构形式:
如图8-10所示,本实施例的所述活动板3100下侧设有一腰型孔3550,所述腰型孔3550沿其周向(即腰型孔3550的环绕方向)设有多个与所述齿轮3520相啮合的齿3560,所述腰型孔3550和多个所述齿3560共同构成所述齿轮轨道3530,所述齿轮3520位于所述腰型孔3550内并与所述齿3560相啮合,使得齿轮3520在转动时能够带动齿轮轨道3530运动,进而直接带动活动板3100的运动;而为了使得齿轮3520在转动时时刻能够保证与齿轮轨道3530时刻保持啮合,本实施例将所述限位轨道3540设置在所述基板3400上,所述活动板3100底部设有安装在所述限位轨道3540内的限位件3570,所述限位轨道3540使所述限位件3570在其中的运动轨迹呈腰型,即限位件3570在现为轨道内的运动轨迹与活动板3100的运动轨迹相同,具体的,本实施例的所述限位件3570为设置在所述活动板3100底面上的凸起。
再结合附图11和12所示,本实施例的所述齿轮轨道3530还可以由设置在所述活动板3100上的多个圆柱凸起3580组成,多个所述圆柱凸起3580沿所述第二方向均匀间隔布设,所述齿轮3520与多个所述凸起相啮合;而所述限位轨道3540为设置在所述活动板3100上的第一弧形限位件3590和第二弧形限位件3600,所述第一弧形限位件3590和第二弧形限位件3600分别设置在所述齿轮轨道3530沿第一方向上的相对两侧,防,在活动板3100运动至预设位置时,齿轮3520位于齿轮轨道3530的一侧,齿轮3520容易脱离圆柱凸起3580组成的齿轮轨道3530,因此通过第一弧形限位件3590或第二弧形限位件3600可以起到引导作用,使得活动板3100能够沿着齿轮轨道3530的预设方向运动,即所述第一弧形限位件3590和第二弧形限位件3600及多个所述凸起相配合使得所述活动板3100的运动轨迹呈腰型。
下面结合上述结构对本实施例的机械防抖器3000的工作过程进行详细的描述,以镜头1000两次抖动为例,两次抖动方向相反,且需要使得活动板3100向第一方向运动补偿一次,并随后向第二方向运动补偿一次。需要活动板3100向第一方向运动补偿时,陀螺仪事先将检测到的镜头1000抖动方向和距离反馈给所述处理模块,处理模块计算出需要活动板3100的运动距离,进而使得驱动轴3510带动齿轮3520转动,齿轮3520通过与齿轮轨道3530和限位轨道3540的配合,处理模块无线发送驱动信号,进而带动活动板3100向第一方向运动至补偿位置,补偿后再次通过驱动轴3510带动活动板3100复位,在复位过程中,弹性回复机构3300也为活动板3100的复位提供复位力,更加便于活动板3100恢复到初始位置。需要活动板3100向第二方向运动补偿时,处理方式与上述第一方向的补偿步骤相同,这里不过多赘述。
当然上述仅仅为简单的两次抖动,当发生多次抖动时,或者抖动的方向并非往 复运动时,可以通过驱动多个补偿组件以补偿抖动,其基础工作过程与上述描述原理相同,这里不过多赘述,另外关于陀螺仪的检测反馈、处理模块向驱动轴3510发送控制指令等均为现有技术,这里也不过多描述。
结合上述说明可知,本实施例提供的机械补偿器不仅不会受到外界磁场干扰,防抖效果好,而且可以实现在多次抖动发生的情况下能够对镜头1000进行精确的补偿,补偿及时准确。另外,采用本实施例的机械防抖器不仅结构简单,各个部件所需的安装空间小,便于整个防抖器的集成化,而且具有较高的补偿精度。
具体的,本实施例的所述电子设备包括手机和用于安装所述手机的支架。电子设备包含支架的目的是由于图像获取环境的不确定性,因此需要使用支架对电子设备进行支撑和固定。
另外,申请人发现,现有的手机支架仅仅具有支撑手机的功能,而不具有自拍杆的功能,因此申请人对支架做出第一步改进,将手机支架5000和支撑杆5200相结合,结合附图13所示,本实施例的所述支架5000包括手机安装座5100和可伸缩的支撑杆5200,支撑杆5200与手机安装座5100的中部(具体为下述基板3200的中部)通过阻尼铰链相连接,使得支撑杆5200在转动至图13的状态时,支架5000可形成自拍杆结构,而支撑杆5200在转动至图14的状态时,支架5000可形成手机支架5000结构。
而结合上述支架结构申请人又发现,手机安装座5100与支撑杆5200结合后占用空间较大,即使支撑杆5200可伸缩,但是手机安装座5100无法进行结构的变化,体积不会进一步缩小,无法将其放入衣兜或者小型的包内,造成支架5000携带不便的问题,因此本实施例对支架5000做出第二步改进,使得支架5000的整体收容性得到进一步的提高。
结合图13-16所示,本实施例的所述手机安装座5100包括可伸缩的连接板5110和安装于连接板5110相对两端的折叠板组5120,所述支撑杆5200与所述连接板5110中部通过阻尼铰链相连接;所述折叠板组5120包括第一板体5121、第二板体5122及第三板体5123,其中,所述第一板体5121的相对两端中的一端与所述连接板5110相铰接,所述第一板体5121的相对两端中的另一端与所述第二板体5122的相对两端中的一端相铰接;所述第二板体5122相对两端的另一端与所述第三板体5123相对两端中的一端相铰接;所述第二板体5122设有供手机边角插入的开口5130。
结合附图16所示,所述手机安装座5100用于安装手机时,所述第一板体5121、第二板体5122和第三板体5123折叠呈直角三角形状态,所述第二板体5122为直角三角形的斜边,所述第一板体5121和所述第三板体5123为直角三角形的直角边,其中,所述第三板体5123的一个侧面与所述连接板5110的一个侧面并排贴合,所述第三板体5123相对两端中的另一端与所述第一板体5121相对两端中的一端相抵,该结构可以使得三个折叠板处于自锁状态,并且将手机下部的两个边角插入到两侧的两 个开口5130时,手机6000的下部两侧位于两个直角三角形内,通过手机、连接板5110和折叠板组5120件的共同作可以完成手机6000的固定,三角形状态在外力情况下无法打开,只有从开口5130抽出手机后才能解除折叠板组5120件的三角形状态。
而在手机安装座5100不处于工作状态时,将连接板5110缩小至最小长度,并且将折叠板组5120件与连接板5110相互折叠,用户可以将手机安装座5100折叠呈最小体积,而由于支撑杆5200的可伸缩性,因此可以将整个支架5000收容呈体积最小的状态,提高了支架5000的收荣幸,用户甚至可以直接将支架5000放入衣兜或小的手包内,十分方便。
优选的,本实施例还在所述第三板体5123的一个侧面设有第一连接部,所述连接板5110与所述第三板体5123相贴合的侧面设有与所述第一连接部相配合的第一配合部,所述支架5000手机安装座5100用于安装手机时,所述第一连接部和所述第一配合部卡合连接。具体的,本实施例的第一连接部为一个凸条或凸起(图中未示出),第一配合部为开设在连接板5110上的卡槽(图中未示出)。该结构不仅提高了折叠板组5120件处于三角形状态时的稳定性,而且在需要将手机安装座5100折叠至最小状态时也便于折叠板组5120件与连接板5110的连接。
优选的,本实施例还在所述第一板体5121相对两端中的一端设有第二连接部,所述第三板体5123相对两端中的另一端设有与所述第二连接部相配合的第二配合部,所述支架5000手机安装座5100用于安装手机时,所述第二连接部和所述第二配合部卡合连接。第二连接部可以是凸起(图中未示出),第二配合部为与凸起相配合的开口5130或卡槽(图中未示出)。该结构提高了叠板组件处于三角形状态时的稳定性
另外,本实施例还可以在所述支撑杆5200的另一端可拆卸连接有底座(图中未示出),在需要固定手机并且使手机6000具有一定高度时,可以将支撑杆5200拉伸呈一定长度,并通过底座将支架5000置于一个平面上,再将手机放置到手机安装座5100内,完成手机的固定;而支撑杆5200和底座的可拆卸连接可以使得两者可以单独携带,进一步提高了支架5000的收容性和携带的方便性。
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。
本发明实施例提供了一种非暂态计算机可读存存储介质,所述计算机存储介质存储有计算机可执行指令,其中,当所述计算机可执行指令被电子设备执行时,使所述电子设备上执行上述任意方法实施例中的图片合成方法。
本发明实施例提供了一种计算机程序产品,其中,所述计算机程序产品包括存 储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,其中,当所述程序指令被电子设备执行时,使所述电子设备执行上述任意方法实施例中的图片合成方法。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到各实施方式可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件。基于这样的理解,上述技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在计算机可读存储介质中,所述计算机可读记录介质包括用于以计算机(例如计算机)可读的形式存储或传送信息的任何机制。例如,机器可读介质包括只读存储器(ROM)、随机存取存储器(RAM)、磁盘存储介质、光存储介质、闪速存储介质、电、光、声或其他形式的传播信号(例如,载波、红外信号、数字信号等)等,该计算机软件产品包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行各个实施例或者实施例的某些部分所述的方法。
最后应说明的是:以上实施例仅用以说明本发明实施例的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims (10)

  1. 一种图片合成方法,其特征在于,包括:
    获取第一图片和第二图片,识别并提取所述第一图片中的目标人像,其中,所述第二图片中包括人脸图像;
    提取所述人脸图像中鼻部区域的子图像,基于所述子图像的光强加权中心与所述人脸图像的加权中心,得到所述第二图片的光线角度;
    获取所述目标人像的人脸朝向角度,根据所述人脸朝向角度和所述第二图片的光线角度确定所述目标人像在所述第二图片上的目标位置;
    依据所述目标位置,将所述目标人像与所述第二图片进行合成。
  2. 根据权利要求1所述的方法,其特征在于,所述获取所述目标人像的人脸朝向角度,包括:
    识别所述目标人像的特征点,基于所述特征点确定所述目标人像五官的位置信息;
    基于所述目标人像五官的位置信息计算所述目标人像的五官的相对位置;
    根据所述五官的相对位置确定所述目标人像的人脸朝向角度。
  3. 根据权利要求1所述的方法,其特征在于,所述获取所述目标人像的人脸朝向角度,包括:
    识别所述目标人像的脸庞区域,基于所述脸庞区域确定所述目标人像的人脸朝向;
    计算所述脸庞区域之间的面积比例;
    根据所述目标人像的人脸朝向及所述面积比例,确定所述目标人像的人脸朝向角度。
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述根据所述人脸朝向角度和所述第二图片的光线角度确定所述目标人像在所述第二图片上的目标位置,包括:
    基于所述人脸朝向角度和所述第二图片的光线角度,确定在所述第二图片中,所述目标人像的人脸是否处于顺光状态;
    若未处于顺光状态,在所述第二图片中查找能够遮挡所述第二图片的光线的位置,将所述位置作为目标位置。
  5. 根据权利要求1-3任一项所述的方法,其特征在于,所述基于所述子图像的光强加权中心与所述人脸图像的加权中心,得到所述第二图片的光线角度包括:
    将所述子图像分为若干个子区域,确定各所述子区域的子光强加权中心;
    将各所述子光强加权中心与所述人脸图像的加权中心进行比较,得到各所述子区域的子光线估计角度;
    计算各所述子区域的子光照强度,根据所述子区域的子光照强度确定所述子区 域的子光线估计角度的权重;
    根据各所述子光线估计角度及所述子光线估计角度的权重,计算得到所述第二图片的光线角度。
  6. 一种图片合成装置,其特征在于,包括:
    识别模块,用于获取第一图片和第二图片,识别并提取所述第一图片中的目标人像,其中,所述第二图片中包括人脸图像;
    提取模块,用于提取所述人脸图像中鼻部区域的子图像,基于所述子图像的光强加权中心与所述人脸图像的加权中心,得到所述第二图片的光线角度;
    确定模块,用于获取所述目标人像的人脸朝向角度,根据所述人脸朝向角度和所述第二图片的光线角度确定所述目标人像在所述第二图片上的目标位置;
    合成模块,用于依据所述目标位置,将所述目标人像与所述第二图片进行合成。
  7. 根据权利要求6所述的装置,其特征在于,所述确定模块包括:
    第一识别单元,用于识别所述目标人像的特征点,基于所述特征点确定所述目标人像五官的位置信息;
    第一计算单元,用于基于所述目标人像五官的位置信息计算所述目标人像的五官的相对位置;
    第一确定单元,用于根据所述五官的相对位置确定所述目标人像的人脸朝向角度。
  8. 根据权利要求6所述的装置,其特征在于,所述确定模块包括:
    第二识别单元,用于识别所述目标人像的脸庞区域,基于所述脸庞区域确定所述目标人像的人脸朝向;
    第二计算单元,用于计算所述脸庞区域之间的面积比例;
    第二确定单元,用于根据所述目标人像的人脸朝向及所述面积比例,确定所述目标人像的人脸朝向角度。
  9. 根据权利要求6-8任一项所述的装置,其特征在于,所述确定模块用于,基于所述人脸朝向角度和所述第二图片的光线角度,确定在所述第二图片中,所述目标人像的人脸是否处于顺光状态;若未处于顺光状态,在所述第二图片中查找能够遮挡所述第二图片的光线的位置,将所述位置作为目标位置。
  10. 一种电子设备,其特征在于,包括:至少一个处理器;以及,
    与所述至少一个处理器通信连接的存储器;其中,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行权利要求1至5中任一项所述的图片合成方法。
PCT/CN2018/106788 2018-09-20 2018-09-20 一种图片合成方法、装置及电子设备 WO2020056693A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/106788 WO2020056693A1 (zh) 2018-09-20 2018-09-20 一种图片合成方法、装置及电子设备
CN201811140095.1A CN109447924B (zh) 2018-09-20 2018-09-28 一种图片合成方法、装置及电子设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/106788 WO2020056693A1 (zh) 2018-09-20 2018-09-20 一种图片合成方法、装置及电子设备

Publications (1)

Publication Number Publication Date
WO2020056693A1 true WO2020056693A1 (zh) 2020-03-26

Family

ID=65544568

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/106788 WO2020056693A1 (zh) 2018-09-20 2018-09-20 一种图片合成方法、装置及电子设备

Country Status (2)

Country Link
CN (1) CN109447924B (zh)
WO (1) WO2020056693A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113191956B (zh) * 2021-01-19 2024-02-09 西安理工大学 基于深度抠图的逆光图像增强方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104424624A (zh) * 2013-08-28 2015-03-18 中兴通讯股份有限公司 一种图像合成的优化方法及装置
CN105279737A (zh) * 2015-07-10 2016-01-27 深圳市美贝壳科技有限公司 一种生成人物照片素材的装置及方法
CN105893419A (zh) * 2015-11-30 2016-08-24 乐视致新电子科技(天津)有限公司 一种多媒体照片生成方法、装置、设备及手机
CN106408536A (zh) * 2016-09-14 2017-02-15 北京小米移动软件有限公司 图像合成方法及装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7324688B2 (en) * 2005-02-14 2008-01-29 Mitsubishi Electric Research Laboratories, Inc. Face relighting for normalization of directional lighting
US8203764B2 (en) * 2007-06-27 2012-06-19 Lexmark International, Inc. Phased illumination method for image capture system
CN108171775B (zh) * 2017-12-28 2023-09-08 努比亚技术有限公司 图片合成方法、移动终端及计算机可读存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104424624A (zh) * 2013-08-28 2015-03-18 中兴通讯股份有限公司 一种图像合成的优化方法及装置
CN105279737A (zh) * 2015-07-10 2016-01-27 深圳市美贝壳科技有限公司 一种生成人物照片素材的装置及方法
CN105893419A (zh) * 2015-11-30 2016-08-24 乐视致新电子科技(天津)有限公司 一种多媒体照片生成方法、装置、设备及手机
CN106408536A (zh) * 2016-09-14 2017-02-15 北京小米移动软件有限公司 图像合成方法及装置

Also Published As

Publication number Publication date
CN109447924B (zh) 2020-07-17
CN109447924A (zh) 2019-03-08

Similar Documents

Publication Publication Date Title
CN108596827B (zh) 三维人脸模型生成方法、装置及电子设备
WO2020037679A1 (zh) 视频处理方法、装置及电子设备
WO2020056689A1 (zh) 一种ar成像方法、装置及电子设备
WO2020037676A1 (zh) 三维人脸图像生成方法、装置及电子设备
WO2020056690A1 (zh) 一种视频内容关联界面的呈现方法、装置及电子设备
US10691934B2 (en) Real-time visual feedback for user positioning with respect to a camera and a display
WO2020037678A1 (zh) 基于遮挡图像生成三维人脸图像方法、装置及电子设备
WO2020037681A1 (zh) 视频生成方法、装置及电子设备
WO2019205284A1 (zh) Ar成像方法和装置
CN106161939B (zh) 一种照片拍摄方法及终端
WO2020037680A1 (zh) 基于光线的三维人脸优化方法、装置及电子设备
WO2020056692A1 (zh) 一种信息交互方法、装置及电子设备
CN108377398B (zh) 基于红外的ar成像方法、系统、及电子设备
WO2020056691A1 (zh) 一种交互对象的生成方法、装置及电子设备
CN108537870B (zh) 图像处理方法、装置及电子设备
BR112015014629A2 (pt) método para operar um sistema que possui um monitor, uma câmera e um processador
CN107231529A (zh) 图像处理方法、移动终端及存储介质
WO2022001806A1 (zh) 图像变换方法和装置
US20110187882A1 (en) Digital image capturing device providing photographing composition and method thereof
WO2020056693A1 (zh) 一种图片合成方法、装置及电子设备
CN107835373A (zh) 一种移动终端及其拍照美化方法和系统
CN113850709A (zh) 图像变换方法和装置
WO2016090759A1 (zh) 一种智能拍照的方法和装置
CN220820449U (zh) 一种磁吸结构的指读投影仪
WO2022178724A1 (zh) 图像拍摄方法、终端设备、拍摄装置和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18934241

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 13.08.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 18934241

Country of ref document: EP

Kind code of ref document: A1