WO2018049952A1 - Photo acquisition method and device - Google Patents

Photo acquisition method and device Download PDF

Info

Publication number
WO2018049952A1
WO2018049952A1 PCT/CN2017/096825 CN2017096825W WO2018049952A1 WO 2018049952 A1 WO2018049952 A1 WO 2018049952A1 CN 2017096825 W CN2017096825 W CN 2017096825W WO 2018049952 A1 WO2018049952 A1 WO 2018049952A1
Authority
WO
WIPO (PCT)
Prior art keywords
initial image
result
scoring
user
score
Prior art date
Application number
PCT/CN2017/096825
Other languages
French (fr)
Chinese (zh)
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 厦门幻世网络科技有限公司
Publication of WO2018049952A1 publication Critical patent/WO2018049952A1/en

Links

Images

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
    • G06V40/162Detection; Localisation; Normalisation using pixel segmentation or colour matching
    • 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
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships

Definitions

  • the present application relates to the field of image processing, and in particular, to a method and an apparatus for acquiring a photo.
  • Face recognition technology As an emerging biometric technology in the development of digital information, has been widely used in many fields. For example, in key security units such as schools, airports, and courts, people can pass people. Face recognition technology implements access control or security monitoring; in Internet applications, face recognition technology can be used to establish its own biometric identification for payment and other online services with high security requirements; in entertainment games, people can pass the game. Face recognition technology builds its own 3D model to enhance the experience of users in entertainment games.
  • the face image is often obtained by taking a picture of the user, and the user often subconsciously makes some actions when the picture is taken, and the expression causes the face image to be irregular, for example, oblique The upper 45° angle shooting, the side face chin, the bangs blocking the forehead, etc., these irregular movements and expressions will seriously affect the recognition of the face image.
  • the user's photo does not meet the standard, the user's 3D model cannot be reconstructed based on the user's face photo. Therefore, how to obtain a standard photo that a user can reconstruct a 3D model has become an urgent problem to be solved.
  • the present application provides a photo acquisition method and device, which aims to obtain a photo that meets a specified standard for a user, and lays a foundation for reconstructing a 3D model.
  • the embodiment of the present application provides a photo acquisition method, including:
  • the scoring standard characterizes a correspondence between the detected result and the scoring score
  • the photo is output according to the result of the rating of the initial image.
  • the method further includes:
  • the user is prompted to adjust the posture based on the result of the detection and/or the result of the initial image.
  • the embodiment of the present application further provides a photo acquiring device, including:
  • An acquisition module configured to acquire an initial image of the user
  • a modeling module configured to acquire a face model of the user according to the initial image, where the face model includes a face feature point of the user;
  • a detecting module configured to detect the face model
  • a scoring module configured to score the initial image according to a scoring standard according to the result of the detecting; wherein the scoring standard characterizes a correspondence between the detected result and the scoring score;
  • an output module configured to output the photo according to the score result of the initial image.
  • This application first obtains the initial image of the user, detects and scores the face model established based on the initial image, quantitatively evaluates the initial image of the user according to the scoring standard, and then evaluates the imaging quality according to the score result, and then outputs the specified image. Standard photo. This ensures that the acquired photos can meet the specified criteria and meet the needs of 3D model reconstruction, so that the user's 3D model can be reconstructed based on these photos.
  • the present application may also remind the user according to the result of detection and/or scoring when the user has an action and/or an expression that does not meet the specified standard. Adjust the posture to the standard action and/or expression, and then re-acquire the initial image after the user adjusts the posture, and further process, score, etc. the initial image. In this way, it is possible to help and guide the user to adjust their movements and/or expressions to obtain photos that meet the specified criteria.
  • FIG. 1 is a schematic flowchart of a method for acquiring a photo in an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a method for acquiring a second photo in the embodiment of the present application
  • FIG. 3 is a schematic structural diagram of a photo acquiring apparatus according to an embodiment of the present application.
  • the embodiment of the present application provides a photo acquisition method, as shown in FIG. 1 , including:
  • S102 Acquire a face model of the user according to the initial image, where the face model includes a face feature point of the user;
  • the initial image is scored according to the scoring standard; wherein the scoring standard represents the correspondence between the detected result and the score score;
  • Each step in the above embodiment has multiple combinations of execution order and execution manner, for example:
  • Each step can be sequentially performed in sequence. For example, after the initial image of one frame is obtained in step S101, the face model of the user is acquired according to the initial image of the frame, and then the face model is detected, scored, and then output according to the score result corresponding to the face model. Photo.
  • step S101 When the initial image is acquired in step S101, it may be executed a plurality of times to acquire a plurality of initial images.
  • steps S102 to S104 When performing steps S102 to S104, a plurality of face models may be separately processed to obtain a plurality of face models, and then each face model may be detected and scored.
  • each item can be scored according to the test result of the item, or each item can be scored after detecting the entire item.
  • the processing may be performed by referring to the embodiment shown in FIG. 1.
  • the processing flow of an initial image may be ended, and the process returns to step S101 to reacquire.
  • An initial image or a face model is identified, detected, and/or scored for the next initial image.
  • the photo may be output and the user may be informed of the score of the photo for the user to choose, or may directly jump back to step S101 to reacquire an initial image.
  • the single thread may be sequentially performed (the steps may be sequentially performed sequentially or the steps may be performed in a certain step), or multiple threads may be used to execute multiple identical or different steps simultaneously (for example, multiple threads may be used)
  • a plurality of initial images are processed to obtain a face model, and multi-threads can also be used for acquiring a face model and detecting and/or scoring a face model, thereby completing multiple tasks simultaneously and improving resources.
  • the efficiency of use can increase the efficiency of the system.
  • the initial image acquired in step S101 includes the user's face information and the photographing background information, and the initial image can be acquired by using a camera, a camera, or the like to acquire an image.
  • the initial image may be automatically acquired by the system or device according to the embodiment (for example, an initial image may be preset every 1 second or 1 frame), or may be adopted by the user through buttons, switches, and the like. Obtained after issuing an instruction to the system or apparatus employing the present embodiment.
  • various face recognition algorithms can be used to process the initial image to obtain the user's face model.
  • the face detector can detect the location of the face from the initial image, and the location of the face feature point is located in the region where the face is located using a random forest-based algorithm, thereby realizing the determination of the user's face based on the initial image. model.
  • the number and position of the face feature points can be determined according to the implementation requirements. For example, 68 feature points or 77 feature points can be located and selected on the face model, and the relative feature can be further selected from the above. Feature points that do not change with the user's expression.
  • the face verification method based on Convolution Neural Networks may be used to judge the sequence according to the region of the face feature point. Is the initial image and/or face model obtained from the same user: if yes, continue after execution The continuation step detects and scores the obtained face model; if not, returns to step S101 to reacquire the initial image of the user.
  • CNN Convolution Neural Networks
  • performing the step S103 to detect the face model may include detecting the occlusion, the brightness, the area of the eye, the area of the lips, and the motion state and/or the degree of clarity of the face model on the face model.
  • Each test content is directed to a feature on the face model. For example, if the occlusion object on the face model is detected, it can be checked whether the face information of the user has been fully embodied in the face model, and whether there are obstructions such as hair, hats, scarves, and the like that may affect the integrity of the face information; The brightness of the face model is detected.
  • one or more items of the items may be selected, and the quantity of the detected content and the order of detection are not affected; Performing multiple tests on a certain item, and performing the data processing result of the multiple detection results as the detection result of the content.
  • the initial image is scored according to the detected result.
  • the initial image can be scored according to a certain scoring standard, wherein the scoring standard characterizes the correspondence between the detected result and the scoring score.
  • the overall scoring results may be adjusted according to the detection results of different detection items, or each sub-scoring result may be scored separately for each detection item, and then multiple detection items are summarized. After the sub-scoring result, the overall scoring result of the initial image is obtained.
  • different weights can be further assigned to different detection items to reflect the influence of different detection items on the image quality and the degree of influence on the reconstruction of the 3D model. For example, the weight of the sub-score results of the occlusion detection can be set. The sub-scoring result is determined to be larger than the brightness detection, so that the sub-scoring result of the occlusion detection contributes more to the overall scoring result.
  • the occlusion object on the face model may be detected, which may specifically include:
  • a difference between the first average color value and the second average color value is calculated as a result of detecting whether the region to be tested has an occlusion.
  • one or more face regions that are easily occluded may be selected as the region to be tested, for example, a forehead that is easily blocked by the hair or the cap, and is easily blocked by the scarf. Chin, a nose mouth that is easily blocked by a mask, an eye that is easily blocked by an eye mask, and the like.
  • the difference between the first average color value and the second average color value can reflect the test Whether the area is occluded - if the area to be tested is not occluded, the color on the face model should be substantially uniform and there will be no excessive chromatic aberration. Therefore, when the score is scored according to the detection result, a difference threshold may be preset, and if the calculated difference between the first average color value and the second average color value is greater than the preset difference threshold, then I think there is an obstruction on the face model. Because the face shield will reduce the user's photo Quality, which has a negative impact on the reconstruction of the 3D model.
  • the system assumes that the higher the score, the better the quality of the photo, then the detection of the obscuration on the face model should be deducted to reduce the score; otherwise, If the system assumes that the lower the score, the better the photo quality, it should be added when the face model is detected to have an occlusion to increase the score. For example, it can be specified in the scoring standard that if an obstruction is detected on the face model, the score score is directly deducted by 10 points to lower the score of the score.
  • the arithmetic mean value may be calculated, or the weighted average color value may be calculated according to the preset color weight as the second average color value.
  • an obstruction such as a bangs
  • the preset color weight of the two sides of the area where the forehead is located may be set higher than the preset color weight of the middle portion of the area where the forehead is located.
  • the brightness on the face model may be detected, and specifically may include detecting one or more of the following:
  • the specific calculation process can include:
  • the difference between the luminance values of the pairs of pixels symmetric with respect to the central axis is calculated as a detection result of detecting whether the luminance on the face model is uniform.
  • the brightness difference threshold can be set in advance, and the difference between the brightness values can be used to reach the preset brightness difference threshold.
  • the number of pixels can be judged by determining whether the brightness of the person's face is uniform or not. The larger the above number, the more points indicating that the difference in luminance values in the symmetric pixel points is large, and the unevenness of the brightness on the human face, the greater the negative influence on the image quality.
  • the system assumes that the higher the score score, the better the photo quality, the larger the number of pixels whose difference between the luminance values reaches the preset luminance difference threshold, the lower the score of the bonus points, or the score of the deduction. Should be higher; vice versa.
  • the scoring standard it can be specified in the scoring standard that if the number of pixels whose difference in luminance value reaches the preset luminance difference threshold is greater than 20, it is considered that there is a significant "yin and yang face" phenomenon, and 25 points are deducted from the score to reduce the score.
  • the score if the difference between the brightness values reaches the preset brightness difference threshold, the number of pixels is less than 20 and greater than 10, then a weak "yin and yang face” phenomenon is considered, and 10 points are deducted from the score to reduce the score.
  • the average value of the difference between the brightness values of the pair of pixel points may be used to score, wherein the average Values may include an arithmetic mean and/or a weighted average.
  • the average value can reflect the average level of the brightness value difference of each pair of pixel points symmetric with respect to the central axis on the face model. The larger the average value, the larger the difference between the brightness values in the symmetric pixel points, the face of the person The more uneven the brightness, the greater the negative impact on image quality.
  • the above average value may be an arithmetic mean value or a weighted average value, and when determining the weight, it may be considered from the viewpoint of the possibility of occurrence of the luminance difference and/or the influence on the imaging quality, for example, the possibility of occurrence of the luminance difference may be The weight of the pixel points of the larger face area is increased, and the weight of the pixel points of the face area having a large influence on the imaging quality can also be increased.
  • the brightness on the face model when the brightness on the face model is detected, it is also possible to detect whether the brightness of the entire face model and/or the key area and the portion other than the face model on the initial image are uniform. By examining the difference between the brightness value of the face model and the brightness value of the image background, it can be judged whether the brightness of the entire initial image is uniform, and whether the face model part is insufficiently illuminated. This can be achieved in the following ways:
  • the difference between the first brightness average value and the second brightness average value is calculated as a detection result of whether the brightness of the entire face model and/or the key area and the portion other than the face model on the initial image are uniform.
  • the difference between the first brightness average value and the second brightness average value should not be too large, so if the system assumes the score The higher the score, the better the photo quality, the greater the difference between the first brightness average and the second brightness average, the lower the score of the bonus points, or the higher the score of the deduction, and vice versa. .
  • step S103 the area where the eye is located on the face model can be detected, including:
  • the distance between the upper eyelid and the lower eyelid was calculated as a result of the test.
  • the threshold area of the area where the eye is located may be firstly processed to screen out the information of the inner part of the eye. Extracting the binary image of the region where the eye is located, the contour information of the region where the eye is located can be extracted, thereby positioning the upper eyelid and the lower eyelid of the eye, and the distance between the upper eyelid and the lower eyelid is used as the detection result and the basis of the score.
  • a distance threshold may be preset. If the distance between the upper eyelid and the lower eyelid is less than the preset distance threshold, the user is considered to close the eye when taking a picture, and the image quality of the initial image acquired at this time does not meet the requirement.
  • the reconstruction of the 3D model has a negative impact. Therefore, if the system assumes that the higher the score is, the better the photo quality is. If the closed eye is detected on the face model, the score should be deducted to reduce the score; otherwise, if the system assumes that the score is lower, the photo quality is higher. Well, it should be added when the closed eye is detected on the face model to increase the score. For example, it can be specified in the scoring standard that if the face model is detected to be closed, the score is directly deducted by 8 points to reduce the score of the score.
  • step S103 the area where the upper lip is located on the face model can be detected, including:
  • a ratio of a first distance between the inner edge of the upper lip and the inner edge of the lower lip to a second distance between the outer edge of the upper lip and the outer edge of the lower lip is calculated as a result of the detection.
  • 20 or so feature points can be selected in the area where the lips are located to determine the inner and outer edges of the upper and lower lips.
  • a lip ratio threshold may be preset. If the ratio of the first distance to the second distance is greater than the preset lip ratio threshold, the user may be considered to be open when taking a photo.
  • the score on the face model should be deducted to reduce the score score; Conversely, if the system assumes that the lower the score, the better the photo quality, the score on the face model should be added to increase the score. For example, it can be specified in the scoring standard that if a face model opening is detected, 8 points are directly deducted from the score score to lower the score of the score.
  • step S103 the motion state of the face model can be detected, including:
  • the color value, the brightness value, or the inter-frame variation of each pixel of the two initial images separated by the preset number of frames may be extracted, and the difference between the two images, that is, the inter-frame difference value, is calculated.
  • the preset number of preset frames can be taken as 1 frame, 5 frames, 10 frames, etc., and is not limited herein. If the user is not in motion when taking a picture, the inter-frame difference value should not be too large. Therefore, an inter-frame difference threshold (equivalent to the above-mentioned tenth preset value) can be preset as a measure, if the inter-frame difference value is smaller than the above.
  • the inter-frame difference threshold indicates that the difference between the two initial images of the preset number of frames is small enough.
  • the face model corresponding to the user is not in motion; otherwise, if the inter-frame difference value is greater than or equal to the inter-frame difference
  • the threshold value indicates that the difference between the two initial images of the preset number of frames is large, and it can be considered that the face model corresponding to the user is in a motion state. Since the face model acquired when the user is in motion will have a negative impact on the reconstruction of the 3D model, if the system assumes that the higher the score score, the better the photo quality is, the buckle model should be deducted when it detects that the face model is in motion.
  • the face model should be added to increase the score when it is detected to be in motion. For example, it can be specified in the scoring standard that if the face model is detected to be in motion, 15 points are directly deducted from the score score to reduce the score of the score.
  • step S103 the degree of clarity of the face model can be detected, including:
  • the degree of clarity of the face model is determined by calculating the variance of the initial image. For the same image content, the larger the variance of the image, the clearer the image is. Therefore, the variance threshold (corresponding to the eleventh preset value above) can be set in advance as a measure if the variance is greater than or equal to the variance. The threshold value indicates that the image is clear enough to meet the specified criteria; if the variance is less than the variance threshold, the image is not clear enough and will have a negative impact on the reconstruction of the 3D model. Therefore, if the system assumes that the higher the score is, the better the photo quality is. If the face model is not clear enough, the score should be deducted to reduce the score.
  • the system assumes that the score is lower, the photo quality is better. If the face model is not clear enough, it should be added to increase the score. For example, it can be specified in the scoring standard that if the face model is detected to be not clear enough, 20 points are directly deducted from the score score to reduce the score of the score.
  • the above movements on the face model, the brightness, the area of the eye, the area of the lips, and the movement of the face model can be performed for the face model of the plane, or the 3D model of the face model can be established according to the face feature points on the face model, and then the 3D model is detected.
  • the deflection of the head portion of the 3D model in the three-dimensional direction can be detected in accordance with the 3D model, and in particular includes the angle of rotation of the head portion relative to the imaging device such as the camera/camera with respect to the X-axis, the Y-axis, and the Z-axis.
  • the following methods can be used:
  • the stable point is a feature point that changes only with the posture of the user's head
  • the deflection angle of the preset head 3D model in the three-dimensional direction is extracted as the deflection angle of the head portion of the 3D model in the three-dimensional direction.
  • the face 3D model established based on the acquired initial image will have a deflection angle on the X-axis, the Y-axis, and/or the Z-axis, which will be a 3D model. Reconstruction has a negative impact, and the greater the deflection angle, the worse the image quality.
  • the system assumes that the higher the score score, the better the photo quality, the larger the deflection angle, the lower the score of the bonus points, or the higher the score of the deduction points; if the system assumes that the score score is lower, The better the quality of the photo, the greater the deflection angle, the higher the score of the bonus points, or the lower the score of the deduction.
  • the scoring standard it can be specified in the scoring standard that if the deflection angle is 0 to 3°, the score is deducted by 0 to 5 points; when the deflection angle is 3 to 10 degrees, 5 to 20 points are deducted from the score. When the deflection angle is greater than 10°, the score of the score is deducted by 3 times the deflection angle. Deflection in different directions can also specify different deductions or bonus points in the scoring criteria.
  • the user may continue to perform the score according to the detection result, or may prompt the user to adjust the posture according to the detection result. For example, if the user is closed, the prompt is prompted. The user opens his eyes; if it detects that the user's head is deflected 30° to the right, the user is prompted to deflect 30° to the left, and the like. After scoring according to the detection result, the user may also be prompted to adjust the posture according to the scoring result. For example, if the user is deducted for the opening, the user may be prompted to close the mouth; if the user is detected that the forehead is blocked, the user is deducted.
  • the user may be prompted to reveal the forehead; if it is detected that the user's score score does not meet the prescribed criteria, the user may be prompted to adjust the gesture.
  • the process returns to step S101 to reacquire the initial image after the user presets the preset number of frames.
  • the preset number of frames referred to herein may be any preset value according to actual needs.
  • the scoring criterion for scoring based on the result of the detection may be a correspondence between the result of the detection established by the effect of the reference detection on the reconstruction of the 3D model and the score score.
  • the scoring standard can be adjusted and/or the scoring result can be adjusted according to the photographing duration and/or the scoring result of the initial image.
  • the degree of reduction of the score based on the result of the test may be reduced, or the degree of increase of the score based on the result of the test may be increased.
  • the scoring result When adjusting the scoring result, the scoring result may be multiplied by a coefficient greater than 1, and a certain degree of amplification may be performed as an adjusted scoring result; or the scoring result may be multiplied by a coefficient less than 1, to be reduced to some extent as an adjustment. Post rating results.
  • the duration of the photographing it can be determined whether the photographing duration reaches a preset time (which can be recorded as the first preset time), and if the time is reached, the user can be considered to have spent a sufficient time (ie, a preset Time)
  • a preset time which can be recorded as the first preset time
  • the scoring criteria can be adjusted to make the scores higher or the points are less, and/or the method of directly amplifying the scoring results can be improved.
  • the score of the initial image (the higher the score of the system is assumed to be, the better the photo quality is), so that the score of the initial image is more likely to reach the specified standard.
  • the process may return to step S101 to reacquire the initial image.
  • the rating criteria may be actively adjusted so that the score is higher or the penalty is less, and / Or by directly magnifying the scoring result, the scoring score of the initial image is increased, so that the scoring score of the image is closer to the first preset value, and more likely to meet the specified standard.
  • the change value of the score result of the initial image is smaller than a preset value (recorded as a second preset value) according to the score result of the initial image, and if the change value of the score result is smaller than the second
  • the preset value indicates that the initial image acquired by the user does not change much, and the improvement is not obvious. It can be considered that the user has not obtained the initial image with higher score score and can conform to the standard (the system assumes that the score score is higher) The better the quality of the photo, at this time, you can actively adjust the scoring standard so that the score is higher or the deduction is less, and/or the score of the initial image is improved by directly magnifying the scoring result, so that the score of the initial image is obtained. Scores are more likely to meet specified criteria.
  • the change value of the score result is too small, it is also possible to judge the change of the score of the initial image of the user by examining the statistics of the score result. For example, it may be determined whether the average value of the score results of the initial image of the preset number (recorded as the first preset number) reaches the third preset value, or may determine the preset number (recorded as the second preset number). Whether the standard deviation of the score result of the initial image reaches the fourth preset value.
  • the reference value of the above judgment may be adjusted, for example, the first preset value is lowered, so that the scoring score of the initial image is closer to the first A preset value is more likely to meet the specified criteria.
  • the photo acquisition method also includes:
  • step S101 If not, return to step S101 to obtain the initial image of the user.
  • the initial image After scoring the initial image, it may be determined whether the score of the initial image (also referred to as a score score) reaches a preset score (remarked as a fifth preset value, and may also be regarded as a preset cache). Value) to judge the initial Whether the image meets the specified criteria for image caching. If the score score reaches the fifth preset value, the initial image may be considered to meet the cache standard, so the image conforming to the cache standard may be buffered for the user to select the output; if the score score does not reach the fifth preset value, It is considered that the initial image does not reach the specified cache standard, and the initial image can be discarded, and the process returns to step S101 to reacquire the initial image of the user.
  • the image When the system caches the initial image, the image may be stored corresponding to the score of the score, or the detection result of the image and the image may be stored corresponding to the score score.
  • a preset threshold (recorded as a sixth preset value) may be used to determine whether to output a photo. Specifically, it is determined whether the score of the initial image reaches a sixth preset value. Output photos.
  • the values of the fifth preset value and the sixth preset value may be the same or different, that is, when the score result satisfies a certain condition (the condition indicates that the quality of the acquired initial image has reached the specified standard), the condition that satisfies the condition may be met.
  • the image is directly output, or it can be cached first, and the optimal output is obtained after obtaining more images satisfying the condition.
  • the fifth preset value and/or the sixth preset value may also be adjusted according to the photographing duration and/or the scoring result of the initial image. Specifically, the fifth preset value and/or the sixth preset value may be lowered or raised according to the value, the change value, the average value, and/or the standard deviation of the score result of the preset number of initial images.
  • the scoring result of the initial image does not reach the preset value
  • the change value of the scoring result is less than the preset value
  • the average value of the scoring result of the preset number of initial images does not reach the preset value
  • the fifth preset value may be lowered, and the buffering of the standard may be implemented by reducing the cached standard, and the foregoing may also be reduced.
  • Six preset values are selected by the user for the output of the photo by reducing the score standard of the output photo.
  • the preset value may be restored to the original level to obtain a better quality photo.
  • the system can also increase the standard of the buffer or output, and raise the fifth preset value or the sixth preset. Set values to get better quality images.
  • the multiplication by the coefficient may be adopted, or the method may be performed by increasing or decreasing a certain amplitude, for example,
  • the fifth preset value may be multiplied by a coefficient smaller than 1, as the adjusted fifth preset value.
  • the user may be prompted when a certain condition is met. Keep taking photos and get the user's initial image according to the preset rules.
  • the condition required to be met may be one or more of the following conditions:
  • the number of initial images acquired has reached the fifth preset number
  • the average value of the scoring results of the initial image reaches a seventh preset value
  • the standard deviation of the scoring result of the initial image reaches an eighth preset value
  • the lowest score of the score result of the initial image reaches the ninth preset value.
  • the step of prompting the user to keep taking a picture may be performed after the initial image is cached in step S107, and the initial image of the cached image may be directly considered by the cache step of S107. Whether you can prompt the user to keep taking photos.
  • the fifth preset number represents an upper limit value of the number of initial images preset by the system, and may be the number of images stored in the cache, or may be the number of initial images acquired by the system. . Get the beginning The number of initial images has reached the fifth preset number, and it can be considered that the system has acquired enough images to meet certain criteria.
  • the seventh preset value is used to check whether the average value of the score result reaches a preset value
  • the eighth preset value is used to check whether the standard deviation of the score result reaches a preset limit value
  • the ninth preset value is used for examination.
  • the image can be directly output for the user to select, or the user can be prompted to keep taking a picture, and the initial image of the user is obtained according to a preset rule. It can be considered that, when the user obtains the initial image that satisfies certain requirements, the user will better maintain the posture after receiving the prompt to keep the photograph, thereby obtaining a better image.
  • acquiring the initial image of the user according to the preset rule may include: acquiring the initial image of the user according to the preset interval frame number, the preset interval time, the preset image number, and/or the preset acquisition time.
  • the preset number of images represents the total number of images acquired after prompting the user to keep taking a photo.
  • the preset acquisition time indicates a continuous photographing time after prompting the user to keep taking a photo.
  • the preset interval frame number indicates that the user is prompted to keep taking a photo after acquiring the photo. The number of frames spaced between two adjacent images.
  • the preset interval time indicates the time interval between two adjacent images acquired after prompting the user to keep taking a picture.
  • the rule can be preset to obtain an initial image every 1 second (preset interval time), and a total of 10 (preset image number) initial images can be obtained, or the rule can be preset to be 5 minutes (pre-pre Let an initial image be acquired every 5 frames (preset interval frame number) within the acquisition time.
  • the image can be directly output for the user to choose, can be cached, or can be directly discarded without caching (for example, detecting the image).
  • the scoring is used to monitor whether the user's posture during the photographing phase is stable and whether there is a change, and there is no need to cache the image. In determining whether to output or cache, the scoring results may be examined using the aforementioned criteria, and different criteria may be used.
  • the initial image is cached, the image may be directly stored, or the initial image with the lowest score in the original cache may be deleted, and then the initial image obtained by prompting the user to keep taking the photo may be stored.
  • the user may also determine whether to continue to acquire the initial image of the user according to the preset rule according to the detection result and/or the score result of the initial image obtained after the user is prompted to take the picture.
  • the detection result of the initial image and/or the scoring result it is determined whether the user always maintains a posture sufficient to satisfy the requirement after receiving the prompt to keep the photograph. For example, if the obtained consecutive multiple initial images do not meet the requirements of output or buffer, it can be considered that the user has not satisfied the condition for maintaining the photographing, so the image should not be continuously acquired according to the preset rule, and the process proceeds to step S101 to obtain the initial image. .
  • the image should not be continuously acquired according to the preset rule, and the process proceeds to step S101 to obtain the initial image.
  • the user image that prompts the user to keep taking a picture is monitored (monitoring with a preset interval frame number and/or a preset interval time), which is beneficial to ensure that the user is prompted to keep the initial user after taking the picture.
  • the image quality of the image is beneficial to ensure that the user is prompted to keep the initial user after taking the picture.
  • the prompt for keeping the photo taken by the user may be prompted by a combination of any one or more of voice, text, image, animation, and the like. It can be considered that the user will pay more attention to maintaining the posture after getting the prompt.
  • the initial image acquired at this stage should be of better quality and the score should be higher (the system assumes that the higher the score, the better the photo quality), therefore, the user is prompted.
  • the original image of the user acquired after taking the photo can be adjusted to the result of the initial image.
  • the adjusted score result is used as the score result of the initial image. Specifically, the score result may be multiplied by a coefficient greater than 1 or less than 1, as an adjusted score result.
  • all the cached photos may be output to the user in a certain order according to the scoring result of the initial image, or a photo that reaches a certain score or other conditions may be output in real time, or may be in the following manner. get on:
  • the preset number of photos with the highest score results are output based on the scored results of the filtered initial images.
  • screening can be performed according to strict conditions.
  • the face deflection angle should not be greater than 3°, and closed eyes or openings should not occur.
  • the images that meet the requirements are sorted according to the score results, and finally Output the preset number of photos with the highest score; if all the photos are not satisfactory when screening according to strict conditions, you can relax the conditions for screening, for example, adjust the head deflection angle to no more than 3° to no more than 10°, then Then sort the output according to the score result for the user to select.
  • the result of the occlusion detection can be first screened as the initial image without the occlusion, and then filtered according to other detection items.
  • the scoring result may be the overall scoring result of the initial image, or may be the scoring result of a certain detection item, which may be selected according to different requirements of the photo, and is not limited herein.
  • the 3D model can be reconstructed based on the photo to meet the application requirements. For example, the overall score of image 1 is 88 points, the obstruction detection reaches 95 points, the brightness detection reaches 80 points, the overall score of image 2 is 90 points, the obstruction detection reaches 91 points, and the brightness detection reaches 88 points.
  • the image 1 will be given priority for the user to select.
  • the specific values of the preset time, the preset number, the preset value, the preset threshold, the preset frame, the preset frame number, and the preset buffer value may be the same, Can be different.
  • the first preset value, the fifth preset value, and the sixth preset value may be the same or different.
  • the present application also provides a photo acquisition device, as shown in FIG. 3, comprising:
  • the obtaining module 101 is configured to acquire an initial image of the user
  • the modeling module 102 is configured to acquire a face model of the user according to the initial image, where the face model includes a face feature point of the user;
  • a detecting module 103 configured to detect a face model
  • the scoring module 104 is configured to score the initial image according to the scoring standard according to the result of the detecting; wherein the scoring standard represents a correspondence between the detected result and the scoring score;
  • the output module 105 is configured to output a photo according to the score result of the initial image.
  • the above apparatus may further include:
  • the posture adjustment prompting module is configured to prompt the user to adjust the posture according to the detected result and/or the score result of the initial image
  • a caching module configured to cache an initial image and a scoring result when the scoring result of the initial image reaches a preset cache value
  • the prompting photo module is configured to prompt the user to keep taking a photo when the preset condition is met.
  • the above-mentioned photo acquisition device corresponds to the description of the flow of the photo acquisition method described above, and the deficiencies refer to the description of the above method flow, and will not be further described.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data.
  • Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), Dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, only Read compact disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape storage or other magnetic storage device or any other non-transportable medium that can be used for storage can be calculated Information accessed by the device.
  • computer readable media does not include temporary storage of computer readable media, such as modulated data signals and carrier waves.
  • embodiments of the present application can be provided as a method, system, or computer program product.
  • the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment in combination of software and hardware.
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.

Abstract

A photo acquisition method, comprising: acquiring an initial image of a user (S101); acquiring a face model of the user according to the initial image (S102), the face model comprising facial feature points of the user; performing detection on the face model (S103); scoring the initial image according to a scoring standard on the basis of the detection result (S104), the scoring standard represents a corresponding relation between a detection result and a score value; and outputting a photo according to the scoring result of the initial image (S105). The method can further prompt the user to adjust the posture according to the detection result and/or the scoring result of the initial image. The method can further prompt the user to keep photographing when a particular condition is met, and acquire the initial image of the user according to a preset rule. Also disclosed is a photo acquisition device, comprising an acquisition module, a modeling module, a detection module, a scoring module, and an output module. By means of the technical solution, detection is performed on a photo of a user and the photo is scored, so that a photo conforming to a specified standard is acquired, and a foundation for rebuilding a 3D model is laid.

Description

一种照片获取方法及装置Photo acquisition method and device
本申请要求于2016年09月14日提交中国专利局、申请号为201610824078.4、申请名称为“一种照片获取方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims the priority of the Chinese Patent Application, the entire disclosure of which is hereby incorporated by reference. .
技术领域Technical field
本申请涉及图像处理领域,尤其涉及一种照片的获取方法及装置。The present application relates to the field of image processing, and in particular, to a method and an apparatus for acquiring a photo.
背景技术Background technique
随着现代科技的不断发展,人脸识别技术作为数字信息发展中的一项新兴生物特征识别技术,在许多领域得到了广泛应用,例如,在学校、机场、法院等重点安防单位,可以通过人脸识别技术实现门禁或进行安全监控;在互联网应用中,可以通过人脸识别技术建立自己的生物特征标识,用于支付等对安全性要求较高的在线业务;在娱乐游戏中,可以通过人脸识别技术建立自己的3D模型,从而提高在娱乐游戏用户的体验。With the continuous development of modern science and technology, face recognition technology, as an emerging biometric technology in the development of digital information, has been widely used in many fields. For example, in key security units such as schools, airports, and courts, people can pass people. Face recognition technology implements access control or security monitoring; in Internet applications, face recognition technology can be used to establish its own biometric identification for payment and other online services with high security requirements; in entertainment games, people can pass the game. Face recognition technology builds its own 3D model to enhance the experience of users in entertainment games.
在人脸识别技术的各种应用场景中,人脸图像往往通过对用户进行拍照的方式获取,而用户在拍照时常常会下意识的做出一些动作、表情导致人脸图像不规范,例如,斜上方45°角拍摄、侧脸收下巴、刘海遮挡额头等,这些不规范的动作、表情将会严重影响对人脸图像的识别效果。尤其在娱乐游戏中,若用户的照片不符合标准,则无法依据用户的人脸照片重建出用户的3D模型。因此,如何获取用户能够重建3D模型的标准照片成为了亟待解决的问题。In various application scenarios of the face recognition technology, the face image is often obtained by taking a picture of the user, and the user often subconsciously makes some actions when the picture is taken, and the expression causes the face image to be irregular, for example, oblique The upper 45° angle shooting, the side face chin, the bangs blocking the forehead, etc., these irregular movements and expressions will seriously affect the recognition of the face image. Especially in entertainment games, if the user's photo does not meet the standard, the user's 3D model cannot be reconstructed based on the user's face photo. Therefore, how to obtain a standard photo that a user can reconstruct a 3D model has become an urgent problem to be solved.
发明内容Summary of the invention
为了解决上述问题,本申请提供了一种照片获取方法及装置,旨在为用户获取到符合指定标准的照片,为重建3D模型奠定基础。In order to solve the above problem, the present application provides a photo acquisition method and device, which aims to obtain a photo that meets a specified standard for a user, and lays a foundation for reconstructing a 3D model.
本申请实施例提供一种照片获取方法,包括:The embodiment of the present application provides a photo acquisition method, including:
获取用户的初始图像;Obtain the initial image of the user;
依据所述初始图像,获取用户的人脸模型,所述人脸模型包括用户的人脸特征点;Acquiring a face model of the user according to the initial image, where the face model includes a face feature point of the user;
对所述人脸模型进行检测;Testing the face model;
依据检测的结果,按照评分标准对所述初始图像进行评分;其中,所述评分标准表征所述检测的结果与评分分值的对应关系;And determining, according to the result of the detection, the initial image according to a scoring standard; wherein the scoring standard characterizes a correspondence between the detected result and the scoring score;
依据所述初始图像的评分结果,输出所述照片。The photo is output according to the result of the rating of the initial image.
可选地,本申请实施例提供的照片获取方法中,在对所述人脸模型进行检测之后,还包括:Optionally, in the photo acquiring method provided by the embodiment of the present application, after detecting the face model, the method further includes:
依据所述检测的结果和/或初始图像的评分结果,提示用户调整姿态。The user is prompted to adjust the posture based on the result of the detection and/or the result of the initial image.
本申请实施例还提供了一种照片获取装置,包括: The embodiment of the present application further provides a photo acquiring device, including:
获取模块,用于获取用户的初始图像;An acquisition module, configured to acquire an initial image of the user;
建模模块,用于依据所述初始图像,获取用户的人脸模型,所述人脸模型包括用户的人脸特征点;a modeling module, configured to acquire a face model of the user according to the initial image, where the face model includes a face feature point of the user;
检测模块,用于对所述人脸模型进行检测;a detecting module, configured to detect the face model;
评分模块,用于依据检测的结果,按照评分标准对所述初始图像进行评分;其中,所述评分标准表征所述检测的结果与评分分值的对应关系;a scoring module, configured to score the initial image according to a scoring standard according to the result of the detecting; wherein the scoring standard characterizes a correspondence between the detected result and the scoring score;
输出模块,用于依据所述初始图像的评分结果,输出所述照片。And an output module, configured to output the photo according to the score result of the initial image.
本申请实施例采用的上述至少一个技术方案能够达到以下有益效果:The above at least one technical solution adopted by the embodiment of the present application can achieve the following beneficial effects:
(1)本申请先获取用户的初始图像,对依据初始图像建立的人脸模型进行检测和评分,对用户的初始图像按照评分标准进行量化评价,再依据评分结果评估成像质量,进而输出符合指定标准的照片。这就保证了获取到的照片能够符合指定标准,满足3D模型重建的需要,从而能够依据这些照片重建用户的3D模型。(1) This application first obtains the initial image of the user, detects and scores the face model established based on the initial image, quantitatively evaluates the initial image of the user according to the scoring standard, and then evaluates the imaging quality according to the score result, and then outputs the specified image. Standard photo. This ensures that the acquired photos can meet the specified criteria and meet the needs of 3D model reconstruction, so that the user's 3D model can be reconstructed based on these photos.
(2)本申请在对获取到的用户的初始图像进行检测的基础上,还可以依据检测和/或评分的结果,在用户出现了不符合指定标准的动作和/或表情时,可以提醒用户调整姿态至符合标准的动作和/或表情,再重新获取用户调整姿态之后的初始图像,对该初始图像做进一步的检测、评分等处理。采用这种方式,能够帮助和指导用户对自己的动作和/或表情进行调整,从而获得符合指定标准的照片。(2) On the basis of detecting the obtained initial image of the user, the present application may also remind the user according to the result of detection and/or scoring when the user has an action and/or an expression that does not meet the specified standard. Adjust the posture to the standard action and/or expression, and then re-acquire the initial image after the user adjusts the posture, and further process, score, etc. the initial image. In this way, it is possible to help and guide the user to adjust their movements and/or expressions to obtain photos that meet the specified criteria.
附图说明DRAWINGS
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described herein are intended to provide a further understanding of the present application, and are intended to be a part of this application. In the drawing:
图1为本申请实施例中一种照片获取方法的流程示意图;1 is a schematic flowchart of a method for acquiring a photo in an embodiment of the present application;
图2为本申请实施例中第二种照片获取方法的流程示意图;2 is a schematic flowchart of a method for acquiring a second photo in the embodiment of the present application;
图3为本申请实施例中一种照片获取装置的结构示意图。FIG. 3 is a schematic structural diagram of a photo acquiring apparatus according to an embodiment of the present application.
具体实施方式detailed description
为使本申请的目的、技术方案和优点更加清楚,下面将结合本申请具体实施例及相应的附图对本申请技术方案进行清楚、完整地描述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions of the present application will be clearly and completely described in the following with reference to the specific embodiments of the present application and the corresponding drawings. It is apparent that the described embodiments are only a part of the embodiments of the present application, and not all of them. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without departing from the inventive scope are the scope of the present application.
以下结合附图,详细说明本申请各实施例提供的技术方案。The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
本申请实施例提供了一种照片获取方法,参见图1所示,包括:The embodiment of the present application provides a photo acquisition method, as shown in FIG. 1 , including:
S101:获取用户的初始图像;S101: Acquire an initial image of the user;
S102:依据初始图像,获取用户的人脸模型,人脸模型包括用户的人脸特征点; S102: Acquire a face model of the user according to the initial image, where the face model includes a face feature point of the user;
S103:对人脸模型进行检测;S103: detecting a face model;
S104:依据检测的结果,按照评分标准对初始图像进行评分;其中,评分标准表征检测的结果与评分分值的对应关系;S104: According to the result of the detection, the initial image is scored according to the scoring standard; wherein the scoring standard represents the correspondence between the detected result and the score score;
S105:依据初始图像的评分结果,输出照片。S105: Output a photo according to the score result of the initial image.
上述实施例中的各步骤有多种可组合的执行顺序和执行方式,例如:Each step in the above embodiment has multiple combinations of execution order and execution manner, for example:
(1)各步骤可以依次顺序执行。例如,可以执行步骤S101获取了一帧初始图像后,依据这一帧初始图像获取用户的人脸模型,接下来对这一人脸模型进行检测、评分,再依据评分结果输出与该人脸模型对应的照片。(1) Each step can be sequentially performed in sequence. For example, after the initial image of one frame is obtained in step S101, the face model of the user is acquired according to the initial image of the frame, and then the face model is detected, scored, and then output according to the score result corresponding to the face model. Photo.
(2)各步骤中某一步骤或者多个步骤可以根据需要循环执行后再执行下一步骤。例如,在执行步骤S101获取初始图像时,可以循环执行多次从而获取多幅初始图像。在执行步骤S102~步骤104时,可以对多幅初始图像分别处理获取多个人脸模型后,再对各人脸模型进行检测和评分。在进行检测和评分时,可以每检测完一个项目就依据该项目的检测结果进行评分,也可以检测完全部项目后再对各项目分别进行评分。(2) One step or multiple steps in each step may be executed as needed after the loop is executed. For example, when the initial image is acquired in step S101, it may be executed a plurality of times to acquire a plurality of initial images. When performing steps S102 to S104, a plurality of face models may be separately processed to obtain a plurality of face models, and then each face model may be detected and scored. When testing and scoring, each item can be scored according to the test result of the item, or each item can be scored after detecting the entire item.
(3)对于获取的每一幅初始图像,都可参照图1所示实施例进行处理,在满足一定条件时,也可以结束对某幅初始图像的处理流程,而跳转回步骤S101重新获取一幅初始图像或者对下一幅初始图像进行人脸模型的识别、检测和/或评分。例如,当对初始图像的评分结果未达到预设要求时,可以输出照片并告知用户该照片的得分,供用户取舍,也可以直接跳转回步骤S101重新获取一幅初始图像。(3) For each initial image obtained, the processing may be performed by referring to the embodiment shown in FIG. 1. When a certain condition is met, the processing flow of an initial image may be ended, and the process returns to step S101 to reacquire. An initial image or a face model is identified, detected, and/or scored for the next initial image. For example, when the result of the scoring of the initial image does not reach the preset requirement, the photo may be output and the user may be informed of the score of the photo for the user to choose, or may directly jump back to step S101 to reacquire an initial image.
在具体实现上述各步骤时,可以采用单线程依次进行(各步骤依次顺序执行或某步骤循环执行均可),也可以采用多线程同时执行多个相同或不同的步骤(例如,可以使用多线程同时对多幅初始图像进行处理,获取人脸模型,也可以使用多线程分别用于获取人脸模型和对人脸模型的检测和/或评分),从而能够同步完成多项任务,提高了资源使用效率从而能够提高系统的效率。When the above steps are specifically implemented, the single thread may be sequentially performed (the steps may be sequentially performed sequentially or the steps may be performed in a certain step), or multiple threads may be used to execute multiple identical or different steps simultaneously (for example, multiple threads may be used) At the same time, a plurality of initial images are processed to obtain a face model, and multi-threads can also be used for acquiring a face model and detecting and/or scoring a face model, thereby completing multiple tasks simultaneously and improving resources. The efficiency of use can increase the efficiency of the system.
在上述实施例中,执行步骤S101获取的初始图像上,包括用户的人脸信息和拍照背景信息,初始图像可以采用摄像头、照相机等能够获取图像的方式获取。在获取初始图像时,可以由采用本实施例的系统或装置自动获取(例如,可预设每隔1秒或1帧获取一幅初始图像),也可以由用户通过按钮、开关等各种方式向采用本实施例的系统或装置发出指令后获取。In the above embodiment, the initial image acquired in step S101 includes the user's face information and the photographing background information, and the initial image can be acquired by using a camera, a camera, or the like to acquire an image. When the initial image is acquired, it may be automatically acquired by the system or device according to the embodiment (for example, an initial image may be preset every 1 second or 1 frame), or may be adopted by the user through buttons, switches, and the like. Obtained after issuing an instruction to the system or apparatus employing the present embodiment.
在初始图像的基础上,可以采用各种人脸识别算法对初始图像进行处理,获取用户的人脸模型。具体地,可以通过人脸检测器从初始图像中检测出人脸所在区域,在人脸所在区域使用基于随机森林的算法定位人脸特征点的位置,从而实现了依据初始图像确定用户的人脸模型。在选取人脸特征点时,可以根据实施需要确定人脸特征点的数量和位置,例如,可以在人脸模型上定位并选取68个特征点或77个特征点,也可以进一步从中选取相对稳定、不随用户表情变化的特征点。Based on the initial image, various face recognition algorithms can be used to process the initial image to obtain the user's face model. Specifically, the face detector can detect the location of the face from the initial image, and the location of the face feature point is located in the region where the face is located using a random forest-based algorithm, thereby realizing the determination of the user's face based on the initial image. model. When selecting a face feature point, the number and position of the face feature points can be determined according to the implementation requirements. For example, 68 feature points or 77 feature points can be located and selected on the face model, and the relative feature can be further selected from the above. Feature points that do not change with the user's expression.
作为一种可选的实施方式,在获取了用户的人脸模型后,还可以依据人脸特征点所在区域,采用基于卷积神经网络(Convolution Neural Networks,简称CNN)的人脸验证方法判断先后获取到的初始图像和/或人脸模型是不是来自同一个用户:如果是,则继续执行后 续的步骤对获取到的人脸模型进行检测、评分;如果不是,则返回步骤S101重新获取用户的初始图像。As an optional implementation manner, after obtaining the face model of the user, the face verification method based on Convolution Neural Networks (CNN) may be used to judge the sequence according to the region of the face feature point. Is the initial image and/or face model obtained from the same user: if yes, continue after execution The continuation step detects and scores the obtained face model; if not, returns to step S101 to reacquire the initial image of the user.
在上述实施例中,执行步骤S103对人脸模型进行检测,可以包括对人脸模型上的遮挡物、亮度、眼睛所在区域、嘴唇所在区域、人脸模型的运动状态和/或清晰程度进行检测,每一项检测内容都针对人脸模型上的某一特点进行。例如,对人脸模型上的遮挡物进行检测,可以考查用户的人脸信息是否已全部体现在人脸模型中,是否存在头发、帽檐、围巾等可能影响人脸信息完整性的遮挡物;对人脸模型的亮度进行检测,可以考查用户在拍照时光照是否充足,是否均匀,是否会影响人脸信息的提取;对人脸模型上眼睛所在区域的检测,可以考查用户在拍照时是否闭眼;对嘴唇所在区域的检测,可以考查用户在拍照时是否张口;对人脸模型的运动状态进行检测,可以考查用户是否在安静状态下拍照,能否形成稳定的成像效果;对人脸模型的清晰程度进行检测,可以考查初始图像是否模糊,是否能清晰反映出用户的面部信息。以上诸项检测内容各有侧重,因此,在按照本实施例进行检测时,可以任选诸项检测内容中的一项或多项,检测内容的数量和检测时的顺序均不影响;还可以对某项内容进行多次检测,将多次检测的结果进行数据处理后的结果作为该项内容的检测结果。In the above embodiment, performing the step S103 to detect the face model may include detecting the occlusion, the brightness, the area of the eye, the area of the lips, and the motion state and/or the degree of clarity of the face model on the face model. Each test content is directed to a feature on the face model. For example, if the occlusion object on the face model is detected, it can be checked whether the face information of the user has been fully embodied in the face model, and whether there are obstructions such as hair, hats, scarves, and the like that may affect the integrity of the face information; The brightness of the face model is detected. It can be checked whether the illumination is sufficient when the user takes a picture, whether it is uniform, whether it will affect the extraction of face information; for the detection of the area of the eye on the face model, it is possible to check whether the user closes the eye when taking a picture. For the detection of the area where the lips are located, it is possible to check whether the user opens the mouth when taking a picture; to detect the motion state of the face model, it is possible to check whether the user takes a picture in a quiet state, whether a stable imaging effect can be formed; The degree of clarity is detected, and it is possible to check whether the initial image is blurred and whether the user's facial information can be clearly reflected. Each of the above detection contents has a certain emphasis. Therefore, when detecting according to the embodiment, one or more items of the items may be selected, and the quantity of the detected content and the order of detection are not affected; Performing multiple tests on a certain item, and performing the data processing result of the multiple detection results as the detection result of the content.
在本申请的实施例中,对人脸模型进行检测后,依据检测的结果对初始图像进行评分。在评分时,可以按照一定的评分标准对初始图像进行评分,其中,评分标准表征检测的结果与评分分值的对应关系。在对某一初始图像进行评分时,既可以依据不同检测项目的检测结果依次对总体的评分结果进行调整,也可以对每一检测项目分别进行评分得到多个子评分结果,再汇总多项检测项目的子评分结果后得到该初始图像的总体的评分结果。在汇总时,可以进一步对不同的检测项目分配不同的权重,以体现不同检测项目对图像质量的影响程度和对3D模型重建的影响程度,例如,可以将遮挡物检测的子评分结果的权重设定得大于亮度检测的子评分结果,从而遮挡物检测的子评分结果对总体的评分结果的贡献更大。In the embodiment of the present application, after the face model is detected, the initial image is scored according to the detected result. At the time of scoring, the initial image can be scored according to a certain scoring standard, wherein the scoring standard characterizes the correspondence between the detected result and the scoring score. When scoring an initial image, the overall scoring results may be adjusted according to the detection results of different detection items, or each sub-scoring result may be scored separately for each detection item, and then multiple detection items are summarized. After the sub-scoring result, the overall scoring result of the initial image is obtained. In the summary, different weights can be further assigned to different detection items to reflect the influence of different detection items on the image quality and the degree of influence on the reconstruction of the 3D model. For example, the weight of the sub-score results of the occlusion detection can be set. The sub-scoring result is determined to be larger than the brightness detection, so that the sub-scoring result of the occlusion detection contributes more to the overall scoring result.
以下将逐项举例说明对各项检测内容的具体检测过程和评分过程。The specific detection process and scoring process for each test content will be illustrated item by item below.
在执行步骤S103时,可以对人脸模型上的遮挡物进行检测,具体可包括:When the step S103 is performed, the occlusion object on the face model may be detected, which may specifically include:
计算人脸模型整体的第一平均颜色值;计算人脸模型上待测区域的第二平均颜色值;Calculating a first average color value of the entire face model; calculating a second average color value of the area to be tested on the face model;
计算第一平均颜色值与第二平均颜色值的差值,作为对待测区域是否有遮挡物的检测的结果。A difference between the first average color value and the second average color value is calculated as a result of detecting whether the region to be tested has an occlusion.
在采用上述方法对人脸模型上的遮挡物进行检测时,可以先选取容易被遮挡的一个或者多个面部区域作为待测区域,例如,容易被头发或帽檐遮挡的额头,容易被围巾遮挡的下巴,容易被口罩遮挡的鼻子嘴巴,容易被眼罩遮挡的眼睛等等。然后针对人脸模型的整体区域计算出第一平均颜色值,针对待测区域计算出第二平均颜色值,则第一平均颜色值与第二平均颜色值的差值,就能反映出待测区域是否被遮挡——若待测区域未被遮挡,则人脸模型上颜色应基本均匀,不会出现过大的色差。因此,在依据这一项检测结果进行评分时,可以预先设定一个差值阈值,若计算出的第一平均颜色值与第二平均颜色值的差值大于该预设的差值阈值,则认为人脸模型上有遮挡物。由于面部遮挡物将降低用户照片的 质量,对3D模型的重建构成负面影响,因此,若系统假定评分分值越高表示照片质量越好,则检测到人脸模型上有遮挡物时应进行扣分以降低评分分值;反之,若系统假定评分分值越低表示照片质量越好,则检测到人脸模型上有遮挡物时应加分以增加评分分值。例如,可以在评分标准中规定,若检测到人脸模型上有遮挡物,在评分分值中直接扣除10分以降低评分的分值。When the occlusion on the face model is detected by the above method, one or more face regions that are easily occluded may be selected as the region to be tested, for example, a forehead that is easily blocked by the hair or the cap, and is easily blocked by the scarf. Chin, a nose mouth that is easily blocked by a mask, an eye that is easily blocked by an eye mask, and the like. Then calculating a first average color value for the entire area of the face model, and calculating a second average color value for the area to be tested, the difference between the first average color value and the second average color value can reflect the test Whether the area is occluded - if the area to be tested is not occluded, the color on the face model should be substantially uniform and there will be no excessive chromatic aberration. Therefore, when the score is scored according to the detection result, a difference threshold may be preset, and if the calculated difference between the first average color value and the second average color value is greater than the preset difference threshold, then I think there is an obstruction on the face model. Because the face shield will reduce the user's photo Quality, which has a negative impact on the reconstruction of the 3D model. Therefore, if the system assumes that the higher the score, the better the quality of the photo, then the detection of the obscuration on the face model should be deducted to reduce the score; otherwise, If the system assumes that the lower the score, the better the photo quality, it should be added when the face model is detected to have an occlusion to increase the score. For example, it can be specified in the scoring standard that if an obstruction is detected on the face model, the score score is directly deducted by 10 points to lower the score of the score.
更具体地,以将额头作为待测区域为例,在计算第二平均颜色值时,可以计算算数平均值,也可以按照预设颜色权重计算加权平均颜色值,作为所述第二平均颜色值;其中,考虑到额头所在区域的两侧部位(即眉毛正上方)出现遮挡物(例如刘海)的可能性比额头所在区域的中间部分(即眉心正上方)出现遮挡物的可能性大,因此,可以将额头所在区域的两侧部分的预设颜色权重设定得高于额头所在区域的中间部分的预设颜色权重。More specifically, taking the forehead as the area to be tested as an example, when calculating the second average color value, the arithmetic mean value may be calculated, or the weighted average color value may be calculated according to the preset color weight as the second average color value. In view of the fact that it is more likely that an obstruction (such as a bangs) will appear on both sides of the area where the forehead is located (ie, directly above the eyebrows) than the middle part of the area where the forehead is located (ie, directly above the eyebrow), so The preset color weight of the two sides of the area where the forehead is located may be set higher than the preset color weight of the middle portion of the area where the forehead is located.
在执行步骤S103时,可以对人脸模型上的亮度进行检测,具体可包括对以下一项或多项的检测:When performing step S103, the brightness on the face model may be detected, and specifically may include detecting one or more of the following:
对人脸模型上的亮度是否均匀进行检测;Detecting whether the brightness on the face model is uniform;
对人脸模型整体和/或关键区域与初始图像上除人脸模型以外的部分的亮度是否均匀进行检测。Whether the brightness of the entire face model and/or the key area and the portion other than the face model on the initial image are uniform is detected.
更具体地,对人脸模型上的亮度是否均匀进行检测,通过计算人脸模型两侧的亮度值之差,可以反映人脸上亮度是否均匀,即是否出现“阴阳脸”现象。具体计算过程可以包括:More specifically, whether the brightness on the face model is uniform is detected, and by calculating the difference between the brightness values on both sides of the face model, it is possible to reflect whether the brightness of the person's face is uniform, that is, whether a "yin and yang face" phenomenon occurs. The specific calculation process can include:
以人脸模型的中轴线为中心线,在中轴线的两边对称地提取预设对像素点的亮度值;Taking the central axis of the face model as a center line, symmetrically extracting the brightness values of the preset pair of pixels on both sides of the central axis;
计算相对于中轴线对称的各对像素点的亮度值之差,作为对人脸模型上的亮度是否均匀进行检测的检测结果。The difference between the luminance values of the pairs of pixels symmetric with respect to the central axis is calculated as a detection result of detecting whether the luminance on the face model is uniform.
若人脸上亮度均匀,则相对于中轴线对称的各对像素点的亮度值之差不应过大,因此,可以预先设定亮度差阈值,通过统计亮度值之差达到预设亮度差阈值的像素点的数量即可判断人脸上亮度是否均匀,从而进行评分。上述数量越大,表示对称的像素点中亮度值之差较大的点越多,人脸上亮度越不均匀,对成像质量的负面影响越大。因此,若系统假定评分分值越高表示照片质量越好,则亮度值之差达到预设亮度差阈值的像素点的数量越大,加分的分值应越低,或者扣分的分值应越高;反之亦然。例如,可以在评分标准中规定,若亮度值之差达到预设亮度差阈值的像素点的数量大于20,则认为存在明显的“阴阳脸”现象,从评分分值中扣除25分以降低评分分值;若亮度值之差达到预设亮度差阈值的像素点的数量小于20且大于10,则认为存在微弱的“阴阳脸”现象,从评分分值中扣除10分以降低评分分值。If the brightness of the face is uniform, the difference between the brightness values of the pairs of pixels symmetric with respect to the central axis should not be too large. Therefore, the brightness difference threshold can be set in advance, and the difference between the brightness values can be used to reach the preset brightness difference threshold. The number of pixels can be judged by determining whether the brightness of the person's face is uniform or not. The larger the above number, the more points indicating that the difference in luminance values in the symmetric pixel points is large, and the unevenness of the brightness on the human face, the greater the negative influence on the image quality. Therefore, if the system assumes that the higher the score score, the better the photo quality, the larger the number of pixels whose difference between the luminance values reaches the preset luminance difference threshold, the lower the score of the bonus points, or the score of the deduction. Should be higher; vice versa. For example, it can be specified in the scoring standard that if the number of pixels whose difference in luminance value reaches the preset luminance difference threshold is greater than 20, it is considered that there is a significant "yin and yang face" phenomenon, and 25 points are deducted from the score to reduce the score. The score; if the difference between the brightness values reaches the preset brightness difference threshold, the number of pixels is less than 20 and greater than 10, then a weak "yin and yang face" phenomenon is considered, and 10 points are deducted from the score to reduce the score.
除了采用以上统计亮度值之差达到预设亮度差阈值的像素点的数量进行评分的方式之外,还可以采用计算各对像素点的亮度值之差的平均值的方式进行评分,其中,平均值可包括算数平均值和/或加权平均值。上述平均值能够反映人脸模型上相对于中轴线对称的各对像素点的亮度值差距的平均水平,上述平均值越大,表示对称的像素点中亮度值之差整体越大,人脸上亮度越不均匀,对成像质量的负面影响越大。因此,若系统假定评分分值越低表示照片质量越好,则亮度值之差的平均值越大,加分的分值应越高,或者扣分的分 值应越低;反之亦然。上述平均值可以是算数平均值,也可以是加权平均值,在确定权重时,可以从出现亮度差的可能性和/或对成像质量的影响等角度考虑,例如,可以将出现亮度差可能性较大的面部区域的像素点的权重加大,也可以将对成像质量影响较大的面部区域的像素点的权重加大。In addition to the method of scoring the number of pixels in which the difference between the above statistical brightness values reaches the preset brightness difference threshold, the average value of the difference between the brightness values of the pair of pixel points may be used to score, wherein the average Values may include an arithmetic mean and/or a weighted average. The average value can reflect the average level of the brightness value difference of each pair of pixel points symmetric with respect to the central axis on the face model. The larger the average value, the larger the difference between the brightness values in the symmetric pixel points, the face of the person The more uneven the brightness, the greater the negative impact on image quality. Therefore, if the system assumes that the lower the score, the better the photo quality, the greater the average of the difference between the luminance values, the higher the score of the bonus points, or the points deducted. The lower the value should be; vice versa. The above average value may be an arithmetic mean value or a weighted average value, and when determining the weight, it may be considered from the viewpoint of the possibility of occurrence of the luminance difference and/or the influence on the imaging quality, for example, the possibility of occurrence of the luminance difference may be The weight of the pixel points of the larger face area is increased, and the weight of the pixel points of the face area having a large influence on the imaging quality can also be increased.
更具体地,在对人脸模型上的亮度进行检测时,也可以对人脸模型整体和/或关键区域与初始图像上除人脸模型以外的部分的亮度是否均匀进行检测。通过考查人脸模型的亮度值与图像背景的亮度值的差距,可以判断整幅初始图像的亮度是否均匀,人脸模型部分是否光照不足。具体可采用以下方式实现:More specifically, when the brightness on the face model is detected, it is also possible to detect whether the brightness of the entire face model and/or the key area and the portion other than the face model on the initial image are uniform. By examining the difference between the brightness value of the face model and the brightness value of the image background, it can be judged whether the brightness of the entire initial image is uniform, and whether the face model part is insufficiently illuminated. This can be achieved in the following ways:
计算人脸模型整体和/或关键区域的第一亮度平均值;Calculating a first brightness average of the overall and/or key regions of the face model;
计算初始图像上除人脸模型以外的部分的第二亮度平均值;Calculating a second brightness average value of a portion other than the face model on the initial image;
计算第一亮度平均值与第二亮度平均值之差,作为对人脸模型整体和/或关键区域与初始图像上除人脸模型以外的部分的亮度是否均匀进行检测的检测结果。The difference between the first brightness average value and the second brightness average value is calculated as a detection result of whether the brightness of the entire face model and/or the key area and the portion other than the face model on the initial image are uniform.
若人脸模型与初始图像上除人脸模型以外的部分(即图像背景)的亮度均匀,则上述第一亮度平均值与第二亮度平均值的差不应过大,因此,若系统假定评分分值越高表示照片质量越好,则上述第一亮度平均值与第二亮度平均值的差越大,加分的分值应越低,或者扣分的分值应越高;反之亦然。If the brightness of the face model and the portion other than the face model (ie, the image background) on the initial image is uniform, the difference between the first brightness average value and the second brightness average value should not be too large, so if the system assumes the score The higher the score, the better the photo quality, the greater the difference between the first brightness average and the second brightness average, the lower the score of the bonus points, or the higher the score of the deduction, and vice versa. .
在执行步骤S103时,可以对人脸模型上眼睛所在区域进行检测,包括:When step S103 is performed, the area where the eye is located on the face model can be detected, including:
依据人脸特征点的位置,确定人脸模型上眼睛所在区域;Determining the area of the eye on the face model according to the position of the face feature point;
提取人脸模型上眼睛所在区域的二值图像;Extracting a binary image of the area of the eye on the face model;
在二值图像上定位眼睛的上眼皮和下眼皮;Positioning the upper and lower eyelids of the eye on the binary image;
计算上眼皮与下眼皮之间的距离,作为检测的结果。The distance between the upper eyelid and the lower eyelid was calculated as a result of the test.
在提取眼睛所在区域的二值图像前,可以先对眼睛所在区域进行阈值处理,将眼睛内部眼球部分的信息筛除。提取眼睛所在区域的二值图像,可以提取眼睛所在区域的轮廓信息,从而定位眼睛的上眼皮和下眼皮,并将上眼皮与下眼皮之间的距离作为检测的结果和评分的依据。具体地,可以预先设定一距离阈值,若上眼皮与下眼皮之间的距离小于该预设距离阈值,则认为用户在拍照时闭眼,此时获取的初始图像成像质量不符合要求,对3D模型的重建形成负面影响。因此,若系统假定评分分值越高表示照片质量越好,则检测到人脸模型上闭眼时应进行扣分以降低评分分值;反之,若系统假定评分分值越低表示照片质量越好,则检测到人脸模型上闭眼时应加分以增加评分分值。例如,可以在评分标准中规定,若检测到人脸模型闭眼,在评分分值中直接扣除8分以降低评分的分值。Before extracting the binary image of the area where the eye is located, the threshold area of the area where the eye is located may be firstly processed to screen out the information of the inner part of the eye. Extracting the binary image of the region where the eye is located, the contour information of the region where the eye is located can be extracted, thereby positioning the upper eyelid and the lower eyelid of the eye, and the distance between the upper eyelid and the lower eyelid is used as the detection result and the basis of the score. Specifically, a distance threshold may be preset. If the distance between the upper eyelid and the lower eyelid is less than the preset distance threshold, the user is considered to close the eye when taking a picture, and the image quality of the initial image acquired at this time does not meet the requirement. The reconstruction of the 3D model has a negative impact. Therefore, if the system assumes that the higher the score is, the better the photo quality is. If the closed eye is detected on the face model, the score should be deducted to reduce the score; otherwise, if the system assumes that the score is lower, the photo quality is higher. Well, it should be added when the closed eye is detected on the face model to increase the score. For example, it can be specified in the scoring standard that if the face model is detected to be closed, the score is directly deducted by 8 points to reduce the score of the score.
在执行步骤S103时,可以对人脸模型上嘴唇所在区域进行检测,包括:When step S103 is performed, the area where the upper lip is located on the face model can be detected, including:
依据人脸特征点的位置,确定人脸模型上嘴唇的上嘴唇内边缘、下嘴唇内边缘、上嘴唇外边缘和下嘴唇外边缘;Determining an inner lip of the upper lip, an inner edge of the lower lip, an outer edge of the upper lip, and an outer edge of the lower lip of the upper face of the face model according to the position of the feature point of the face;
计算上嘴唇内边缘与下嘴唇内边缘之间的第一距离与上嘴唇外边缘与下嘴唇外边缘之间的第二距离的比值,作为检测的结果。A ratio of a first distance between the inner edge of the upper lip and the inner edge of the lower lip to a second distance between the outer edge of the upper lip and the outer edge of the lower lip is calculated as a result of the detection.
具体地,可以在嘴唇所在区域选取20个左右特征点,确定上下嘴唇的内边缘和外边缘, 通过计算上述上嘴唇内边缘与下嘴唇内边缘之间的第一距离与上嘴唇外边缘与下嘴唇外边缘之间的第二距离的比值,判断用户在拍照时是否开口。在实施时,可以预先设定一嘴唇比值阈值,若第一距离与第二距离的比值大于预设嘴唇比值阈值,则可认为用户在拍照时开口。由于用户的开口表情会对3D模型的重建造成负面影响,因此,若系统假定评分分值越高表示照片质量越好,则检测到人脸模型上开口时应进行扣分以降低评分分值;反之,若系统假定评分分值越低表示照片质量越好,则检测到人脸模型上开口时应加分以增加评分分值。例如,可以在评分标准中规定,若检测到人脸模型开口,则在评分分值中直接扣除8分以降低评分的分值。Specifically, 20 or so feature points can be selected in the area where the lips are located to determine the inner and outer edges of the upper and lower lips. By calculating the ratio of the first distance between the inner edge of the upper lip and the inner edge of the lower lip to the second distance between the outer edge of the upper lip and the outer edge of the lower lip, it is determined whether the user is open when taking a picture. In implementation, a lip ratio threshold may be preset. If the ratio of the first distance to the second distance is greater than the preset lip ratio threshold, the user may be considered to be open when taking a photo. Since the user's opening expression will have a negative impact on the reconstruction of the 3D model, if the system assumes that the higher the score score, the better the photo quality, the score on the face model should be deducted to reduce the score score; Conversely, if the system assumes that the lower the score, the better the photo quality, the score on the face model should be added to increase the score. For example, it can be specified in the scoring standard that if a face model opening is detected, 8 points are directly deducted from the score score to lower the score of the score.
在执行步骤S103时,可以对人脸模型的运动状态进行检测,包括:When step S103 is performed, the motion state of the face model can be detected, including:
计算人脸模型所在的间隔预设帧数的初始图像的帧间差分值;Calculating an interframe difference value of an initial image of the preset number of frames in which the face model is located;
判断帧间差分值是否小于第十预设值,将判断的结果作为检测的结果。It is determined whether the inter-frame difference value is smaller than the tenth preset value, and the result of the judgment is used as a result of the detection.
具体地,可以提取间隔预设帧数的两幅初始图像的每个像素点的颜色值、亮度值或者帧间变化量,计算两幅图像的差值,即帧间差分值。间隔的预设帧数可以取为1帧、5帧、10帧等,此处无需限定。若用户在拍照时未处于运动状态,则帧间差分值不应过大,因此可以预设一帧间差分阈值(相当于上述第十预设值)作为衡量标准,若帧间差分值小于上述帧间差分阈值,则表示间隔预设帧数的两幅初始图像的区别足够小,可以认为用户所对应的人脸模型未处于运动状态;反之,若帧间差分值大于或等于上述帧间差分阈值,则表示间隔预设帧数的两幅初始图像的区别较大,可以认为用户所对应的人脸模型处于运动状态。由于用户处于运动状态时获取的人脸模型会对3D模型的重建造成负面影响,因此,若系统假定评分分值越高表示照片质量越好,则检测到人脸模型处于运动状态时应进行扣分以降低评分分值;反之,若系统假定评分分值越低表示照片质量越好,则检测到人脸模型处于运动状态时应加分以增加评分分值。例如,可以在评分标准中规定,若检测到人脸模型处于运动状态,则在评分分值中直接扣除15分以降低评分的分值。Specifically, the color value, the brightness value, or the inter-frame variation of each pixel of the two initial images separated by the preset number of frames may be extracted, and the difference between the two images, that is, the inter-frame difference value, is calculated. The preset number of preset frames can be taken as 1 frame, 5 frames, 10 frames, etc., and is not limited herein. If the user is not in motion when taking a picture, the inter-frame difference value should not be too large. Therefore, an inter-frame difference threshold (equivalent to the above-mentioned tenth preset value) can be preset as a measure, if the inter-frame difference value is smaller than the above. The inter-frame difference threshold indicates that the difference between the two initial images of the preset number of frames is small enough. It can be considered that the face model corresponding to the user is not in motion; otherwise, if the inter-frame difference value is greater than or equal to the inter-frame difference The threshold value indicates that the difference between the two initial images of the preset number of frames is large, and it can be considered that the face model corresponding to the user is in a motion state. Since the face model acquired when the user is in motion will have a negative impact on the reconstruction of the 3D model, if the system assumes that the higher the score score, the better the photo quality is, the buckle model should be deducted when it detects that the face model is in motion. To reduce the score score; conversely, if the system assumes that the score score is lower, the better the photo quality, then the face model should be added to increase the score when it is detected to be in motion. For example, it can be specified in the scoring standard that if the face model is detected to be in motion, 15 points are directly deducted from the score score to reduce the score of the score.
在执行步骤S103时,可以对人脸模型的清晰程度进行检测,包括:When step S103 is performed, the degree of clarity of the face model can be detected, including:
计算人脸模型所在初始图像的方差;Calculating the variance of the initial image in which the face model is located;
判断方差是否达到第十一预设值,将判断的结果作为检测的结果。It is judged whether the variance reaches the eleventh preset value, and the result of the judgment is taken as the result of the detection.
具体地,通过计算初始图像的方差来判断人脸模型的清晰程度。对于相同的图像内容而言,图像的方差越大,表示图像越清晰,因此,可以预先设定一方差阈值(相当于上述第十一预设值)作为衡量标准,若方差大于或等于该方差阈值,则表示图像足够清晰,达到指定标准;若方差小于该方差阈值,则表示图像不够清晰,会对3D模型的重建造成负面影响。因此,若系统假定评分分值越高表示照片质量越好,则检测到人脸模型不够清晰时应进行扣分以降低评分分值;反之,若系统假定评分分值越低表示照片质量越好,则检测到人脸模型不够清晰时应加分以增加评分分值。例如,可以在评分标准中规定,若检测到人脸模型不够清晰,则在评分分值中直接扣除20分以降低评分的分值。Specifically, the degree of clarity of the face model is determined by calculating the variance of the initial image. For the same image content, the larger the variance of the image, the clearer the image is. Therefore, the variance threshold (corresponding to the eleventh preset value above) can be set in advance as a measure if the variance is greater than or equal to the variance. The threshold value indicates that the image is clear enough to meet the specified criteria; if the variance is less than the variance threshold, the image is not clear enough and will have a negative impact on the reconstruction of the 3D model. Therefore, if the system assumes that the higher the score is, the better the photo quality is. If the face model is not clear enough, the score should be deducted to reduce the score. Conversely, if the system assumes that the score is lower, the photo quality is better. If the face model is not clear enough, it should be added to increase the score. For example, it can be specified in the scoring standard that if the face model is detected to be not clear enough, 20 points are directly deducted from the score score to reduce the score of the score.
以上对人脸模型上的遮挡物、亮度、眼睛所在区域、嘴唇所在区域、人脸模型的运动 状态和/或清晰程度的检测,既可以针对平面的人脸模型进行,也可以先依据人脸模型上的人脸特征点,建立人脸模型的3D模型,然后再针对该3D模型进行检测。尤其是,可以依据3D模型,检测3D模型的头部部位在三维方向上的偏转,尤其包括头部部位相对于摄像头/照相机等成像装置关于X轴、Y轴和Z轴的旋转角度。在具体实施时,可采用以下方式:The above movements on the face model, the brightness, the area of the eye, the area of the lips, and the movement of the face model The detection of the state and/or the degree of clarity can be performed for the face model of the plane, or the 3D model of the face model can be established according to the face feature points on the face model, and then the 3D model is detected. In particular, the deflection of the head portion of the 3D model in the three-dimensional direction can be detected in accordance with the 3D model, and in particular includes the angle of rotation of the head portion relative to the imaging device such as the camera/camera with respect to the X-axis, the Y-axis, and the Z-axis. In the specific implementation, the following methods can be used:
依据3D模型,确定人脸特征点中的稳定点所在位置;稳定点为仅随着用户的头部姿态变化的特征点;Determining a location of a stable point in a facial feature point according to the 3D model; the stable point is a feature point that changes only with the posture of the user's head;
将预设头部3D模型与稳定点所在位置进行匹配;Matching the preset head 3D model with the location of the stable point;
当预设头部3D模型与稳定点所在位置相匹配时,提取预设头部3D模型在三维方向上的偏转角度,作为3D模型的头部部位在三维方向上的偏转角度。When the preset head 3D model matches the position of the stable point, the deflection angle of the preset head 3D model in the three-dimensional direction is extracted as the deflection angle of the head portion of the 3D model in the three-dimensional direction.
若用户在拍照时没有正面面对摄像头、照相机等成像装置,则依据获取到的初始图像建立的人脸3D模型将在X轴、Y轴和/或Z轴有偏转角度,会对3D模型的重建造成负面影响,而且偏转角度越大,成像质量越差。因此,若系统假定评分分值越高表示照片质量越好,则偏转角度越大,加分的分值应越低,或者扣分的分值应越高;若系统假定评分分值越低表示照片质量越好,则偏转角度越大,加分的分值应越高,或者扣分的分值应越低。例如,可以在评分标准中规定,若偏转角度在0~3°时,在评分分值中扣除0~5分;偏转角度在3°~10°时,在评分分值中扣除5~20分;偏转角度大于10°时,在评分分值中扣除偏转角度的3倍分值。对不同方向上的偏转也可以在评分标准中规定不同的扣分或加分分值。If the user does not face the imaging device such as a camera or a camera at the time of photographing, the face 3D model established based on the acquired initial image will have a deflection angle on the X-axis, the Y-axis, and/or the Z-axis, which will be a 3D model. Reconstruction has a negative impact, and the greater the deflection angle, the worse the image quality. Therefore, if the system assumes that the higher the score score, the better the photo quality, the larger the deflection angle, the lower the score of the bonus points, or the higher the score of the deduction points; if the system assumes that the score score is lower, The better the quality of the photo, the greater the deflection angle, the higher the score of the bonus points, or the lower the score of the deduction. For example, it can be specified in the scoring standard that if the deflection angle is 0 to 3°, the score is deducted by 0 to 5 points; when the deflection angle is 3 to 10 degrees, 5 to 20 points are deducted from the score. When the deflection angle is greater than 10°, the score of the score is deducted by 3 times the deflection angle. Deflection in different directions can also specify different deductions or bonus points in the scoring criteria.
在上述各实施例中,对人脸模型进行一项或多项检测后,可以依据检测结果继续进行评分,也可以依据检测的结果提示用户调整姿态,例如,若检测到用户闭眼,则提示用户睁开眼睛;若检测到用户头部向右偏转30°,则提示用户向左偏转30°等。在依据检测结果进行评分后,也可以依据评分结果提示用户调整姿态,例如,若用户因开口被扣分,则可提示用户闭上嘴巴;若检测到用户因额头被遮挡而被扣分,则可提示用户露出额头;若检测到用户的评分分值未达到规定的标准,可以提示用户调整姿态。提示用户调整姿态的方式有很多,可以择一或组合的应用语音、文字、动画等多种方式指导用户调整到符合标准、能够取得更优检测结果或者能够得到更优评分分值的姿态。在提示用户调整姿态之后,可返回步骤S101重新获取用户间隔预设帧数后的初始图像。此处所称的预设帧数,可以是根据实际需要的任意预设数值。In the foregoing embodiments, after performing one or more detections on the face model, the user may continue to perform the score according to the detection result, or may prompt the user to adjust the posture according to the detection result. For example, if the user is closed, the prompt is prompted. The user opens his eyes; if it detects that the user's head is deflected 30° to the right, the user is prompted to deflect 30° to the left, and the like. After scoring according to the detection result, the user may also be prompted to adjust the posture according to the scoring result. For example, if the user is deducted for the opening, the user may be prompted to close the mouth; if the user is detected that the forehead is blocked, the user is deducted. The user may be prompted to reveal the forehead; if it is detected that the user's score score does not meet the prescribed criteria, the user may be prompted to adjust the gesture. There are many ways to prompt the user to adjust the posture. You can choose one or a combination of voice, text, animation and other methods to guide the user to adjust to the standard, to obtain better test results or to get a better score. After prompting the user to adjust the gesture, the process returns to step S101 to reacquire the initial image after the user presets the preset number of frames. The preset number of frames referred to herein may be any preset value according to actual needs.
在上述各实施例中,依据检测的结果进行评分的评分标准,可以是参照检测的结果对3D模型重建的影响建立的检测的结果与评分分值的对应关系。在此基础上,还可以依据拍照持续时间和/或对初始图像的评分结果,对评分标准进行调整和/或对评分结果进行调整。在调整评分标准时,可以减少依据检测的结果对评分分值的降低程度,或者增加依据检测的结果对评分分值的升高程度。在调整评分结果时,可以将评分结果乘以大于1的系数,进行一定程度的放大,作为调整后的评分结果;或者可以将评分结果乘以小于1的系数,进行一定程度的缩小,作为调整后的评分结果。In each of the above embodiments, the scoring criterion for scoring based on the result of the detection may be a correspondence between the result of the detection established by the effect of the reference detection on the reconstruction of the 3D model and the score score. On this basis, the scoring standard can be adjusted and/or the scoring result can be adjusted according to the photographing duration and/or the scoring result of the initial image. When adjusting the scoring standard, the degree of reduction of the score based on the result of the test may be reduced, or the degree of increase of the score based on the result of the test may be increased. When adjusting the scoring result, the scoring result may be multiplied by a coefficient greater than 1, and a certain degree of amplification may be performed as an adjusted scoring result; or the scoring result may be multiplied by a coefficient less than 1, to be reduced to some extent as an adjustment. Post rating results.
更具体地,可以依据拍照持续时间,判断拍照持续时间是否达到预先设定的时间(可记为第一预设时间),若达到该时间,可以认为用户已经花费了足够长的时间(即第一预设 时间)进行拍照准备,在当前情况下难以获得更符合指定标准的图像,从而可以放宽标准,调整评分标准使得得分更高或扣分更少、和/或通过对评分结果直接放大处理的方式提高对初始图像的评分分值(此时系统假定评分分值越高表示照片质量越好),使得初始图像的评分分值更可能达到指定标准。More specifically, according to the duration of the photographing, it can be determined whether the photographing duration reaches a preset time (which can be recorded as the first preset time), and if the time is reached, the user can be considered to have spent a sufficient time (ie, a preset Time) Prepare for photographing, in the current situation it is difficult to obtain images that are more in line with the specified criteria, so that the criteria can be relaxed, the scoring criteria can be adjusted to make the scores higher or the points are less, and/or the method of directly amplifying the scoring results can be improved. The score of the initial image (the higher the score of the system is assumed to be, the better the photo quality is), so that the score of the initial image is more likely to reach the specified standard.
更具体地,也可以依据对初始图像的评分结果,判断初始图像的评分结果是否未达到预先设定的数值(记为第一预设值),若未达到该第一预设值,表示用户的初始图像的评分分值还不够高,可以认为还未获取到符合标准的初始图像(此时系统假定评分分值越高表示照片质量越好),此时,可以返回步骤S101重新获取初始图像,也可以在某些情况下,例如用户主观上认可该图像时,或者客观上用户已经进行了足够长时间的拍照准备时,可以主动调整评分标准使得得分更高或扣分更少、和/或通过对评分结果直接放大处理的方式提高对初始图像的评分分值,使得该图像的评分分值更接近第一预设值,更可能符合指定标准。More specifically, based on the result of the scoring of the initial image, it may be determined whether the scoring result of the initial image does not reach a preset value (recorded as a first preset value), and if the first preset value is not reached, the user is represented. The score of the initial image is not high enough, and it can be considered that the initial image conforming to the standard has not been obtained (at this time, the higher the score of the system is, the better the photo quality is). At this time, the process may return to step S101 to reacquire the initial image. In some cases, for example, when the user subjectively approves the image, or objectively, the user has already prepared for a long enough time, the rating criteria may be actively adjusted so that the score is higher or the penalty is less, and / Or by directly magnifying the scoring result, the scoring score of the initial image is increased, so that the scoring score of the image is closer to the first preset value, and more likely to meet the specified standard.
更具体地,也可以依据对初始图像的评分结果,判断初始图像的评分结果的变化值是否小于预先设定的数值(记为第二预设值),若评分结果的变化值小于上述第二预设值,表示用户获取的多幅初始图像变化不大,改善不明显,可以认为用户已经无法获取到评分分值更高、能够符合标准的初始图像(此时系统假定评分分值越高表示照片质量越好),此时,可以主动调整评分标准使得得分更高或扣分更少、和/或通过对评分结果直接放大处理的方式提高对初始图像的评分分值,使得初始图像的评分分值更可能达到指定标准。More specifically, it may be determined whether the change value of the score result of the initial image is smaller than a preset value (recorded as a second preset value) according to the score result of the initial image, and if the change value of the score result is smaller than the second The preset value indicates that the initial image acquired by the user does not change much, and the improvement is not obvious. It can be considered that the user has not obtained the initial image with higher score score and can conform to the standard (the system assumes that the score score is higher) The better the quality of the photo, at this time, you can actively adjust the scoring standard so that the score is higher or the deduction is less, and/or the score of the initial image is improved by directly magnifying the scoring result, so that the score of the initial image is obtained. Scores are more likely to meet specified criteria.
除通过考查评分结果的变化值是否过小外,还可以通过考查评分结果的统计量来判断用户的初始图像的评分分值变化情况。例如,可以判断预设数量(记为第一预设数量)的初始图像的评分结果的平均值是否达到第三预设值,也可以判断预设数量的(记为第二预设数量)的初始图像的评分结果的标准差是否达到第四预设值,若未达到,可以认为用户已经无法获取到评分分值更高、能够符合标准的初始图像(此时系统假定评分分值越高表示照片质量越好),此时,可以主动调整评分标准使得得分更高或扣分更少、和/或通过对评分结果直接放大处理的方式提高对初始图像的评分分值,使得初始图像的评分分值更可能达到指定标准。In addition to checking whether the change value of the score result is too small, it is also possible to judge the change of the score of the initial image of the user by examining the statistics of the score result. For example, it may be determined whether the average value of the score results of the initial image of the preset number (recorded as the first preset number) reaches the third preset value, or may determine the preset number (recorded as the second preset number). Whether the standard deviation of the score result of the initial image reaches the fourth preset value. If it is not reached, it can be considered that the user has not obtained the initial image with higher score score and can meet the standard (the system assumes that the score score is higher) The better the quality of the photo, at this time, you can actively adjust the scoring standard so that the score is higher or the deduction is less, and/or the score of the initial image is improved by directly magnifying the scoring result, so that the score of the initial image is obtained. Scores are more likely to meet specified criteria.
与以上各种对评分标准和/或评分结果的调整方式相对地,也可以对上述判断的基准值进行调整,例如,降低上述第一预设值,使得初始图像的评分分值更接近该第一预设值,更可能符合指定标准。In contrast to the above various adjustment methods for the scoring standard and/or the scoring result, the reference value of the above judgment may be adjusted, for example, the first preset value is lowered, so that the scoring score of the initial image is closer to the first A preset value is more likely to meet the specified criteria.
在本申请的实施例中,参照图2所示,在执行步骤S104依据检测的结果,按照评分标准对初始图像进行评分之后,在执行步骤S105依据初始图像的评分结果,输出照片之前,本申请的照片获取方法还包括:In the embodiment of the present application, referring to FIG. 2, after performing the step S104 according to the result of the detection, after scoring the initial image according to the scoring standard, before performing the step S105 according to the scoring result of the initial image, the present application The photo acquisition method also includes:
S106:判断初始图像的评分结果是否达到第五预设值;S106: Determine whether the score result of the initial image reaches a fifth preset value;
S107:若是,则缓存初始图像及其评分结果;S107: If yes, the initial image and the result of the scoring are cached;
若否,则返回重新执行步骤S101,获取用户的初始图像。If not, return to step S101 to obtain the initial image of the user.
在对初始图像进行评分后,可以通过判断初始图像的评分结果(又可称为评分分值)是否达到预先设定的评分分值(记为第五预设值,也可认为是预设缓存值)来判断该初始 图像是否符合图像缓存的指定标准。若评分分值达到第五预设值,可以认为该初始图像符合缓存标准,因此可将该符合缓存标准的图像进行缓存,供用户选择输出;若评分分值未达到第五预设值,可以认为该初始图像未达到指定缓存标准,可以放弃该初始图像,返回步骤S101重新获取用户的初始图像。系统在缓存初始图像时,可以将图像与其评分分值相对应的存储,也可以将图像、图像的检测结果与评分分值三者相对应的存储。需要说明的是,也可以设定一预设的阈值(记为第六预设值)用于判断是否输出照片,具体地,判断初始图像的评分结果是否达到第六预设值,若达到则输出照片。上述第五预设值与第六预设值的数值可以相同也可以不同,即当评分结果满足一定条件时(该条件表示获取的初始图像的质量已达到指定标准),则可以将满足条件的图像直接输出,也可以先进行缓存,待获取更多满足条件的图像后择优输出。After scoring the initial image, it may be determined whether the score of the initial image (also referred to as a score score) reaches a preset score (remarked as a fifth preset value, and may also be regarded as a preset cache). Value) to judge the initial Whether the image meets the specified criteria for image caching. If the score score reaches the fifth preset value, the initial image may be considered to meet the cache standard, so the image conforming to the cache standard may be buffered for the user to select the output; if the score score does not reach the fifth preset value, It is considered that the initial image does not reach the specified cache standard, and the initial image can be discarded, and the process returns to step S101 to reacquire the initial image of the user. When the system caches the initial image, the image may be stored corresponding to the score of the score, or the detection result of the image and the image may be stored corresponding to the score score. It should be noted that a preset threshold (recorded as a sixth preset value) may be used to determine whether to output a photo. Specifically, it is determined whether the score of the initial image reaches a sixth preset value. Output photos. The values of the fifth preset value and the sixth preset value may be the same or different, that is, when the score result satisfies a certain condition (the condition indicates that the quality of the acquired initial image has reached the specified standard), the condition that satisfies the condition may be met. The image is directly output, or it can be cached first, and the optimal output is obtained after obtaining more images satisfying the condition.
当满足一定条件时,还可以依据拍照持续时间和/或对初始图像的评分结果,对第五预设值和/或第六预设值进行调整。具体地,可以依据预设数量的初始图像的评分结果的数值、变化值、平均值和/或标准差,对第五预设值和/或第六预设值进行降低或升高。例如,当拍照持续时间达到预设时间、初始图像的评分结果未达到预设值、评分结果的变化值小于预设值、预设数量的初始图像的评分结果的平均值未达到预设值、和/或预设数量的初始图像的评分结果的标准差未达到预设值时,可以降低上述第五预设值,通过降低缓存的标准实现对更多初始图像的缓存,也可以降低上述第六预设值,通过降低输出照片的分值标准的方式由用户对输出的照片进行取舍。若降低了第五预设值或者第六预设值后,用户能够获取到评分值更高的初始图像,则也可以将上述预设值恢复至原有水平,以获得质量更好的照片。除此之外,若连续多幅初始图像的评分结果都达到了第五预设值或者第六预设值,系统也可以提高缓存或输出的标准,升高第五预设值或者第六预设值,从而获取到质量更好的图像。对上述预设值(第五预设值和/或第六预设值)进行升高或降低的调整时,可以采用乘以系数的方式,也可以采用增减一定幅度的方式进行,例如,需降低上述第五预设值时,可以将第五预设值乘以小于1的系数,作为调整后的第五预设值。When certain conditions are met, the fifth preset value and/or the sixth preset value may also be adjusted according to the photographing duration and/or the scoring result of the initial image. Specifically, the fifth preset value and/or the sixth preset value may be lowered or raised according to the value, the change value, the average value, and/or the standard deviation of the score result of the preset number of initial images. For example, when the photographing duration reaches the preset time, the scoring result of the initial image does not reach the preset value, the change value of the scoring result is less than the preset value, and the average value of the scoring result of the preset number of initial images does not reach the preset value, And/or the standard deviation of the scoring result of the preset number of initial images does not reach the preset value, the fifth preset value may be lowered, and the buffering of the standard may be implemented by reducing the cached standard, and the foregoing may also be reduced. Six preset values are selected by the user for the output of the photo by reducing the score standard of the output photo. If the user can obtain the initial image with a higher score after the fifth preset value or the sixth preset value is lowered, the preset value may be restored to the original level to obtain a better quality photo. In addition, if the scores of successive initial images reach the fifth preset value or the sixth preset value, the system can also increase the standard of the buffer or output, and raise the fifth preset value or the sixth preset. Set values to get better quality images. When the preset value (the fifth preset value and/or the sixth preset value) is adjusted to be raised or lowered, the multiplication by the coefficient may be adopted, or the method may be performed by increasing or decreasing a certain amplitude, for example, When the fifth preset value needs to be lowered, the fifth preset value may be multiplied by a coefficient smaller than 1, as the adjusted fifth preset value.
更进一步地,在执行步骤S104依据检测的结果,按照评分标准对所述初始图像进行评分之后,在执行步骤S105依据初始图像的评分结果,输出照片之前,还可以在满足一定条件时,提示用户保持拍照,按照预设规则获取用户的初始图像。要求满足的条件可以是以下条件中的一个或多个:Further, after performing the step S104 according to the result of the detection, after the initial image is scored according to the scoring standard, before the photo is output according to the scoring result of the initial image in step S105, the user may be prompted when a certain condition is met. Keep taking photos and get the user's initial image according to the preset rules. The condition required to be met may be one or more of the following conditions:
获取的初始图像的数量已达到第五预设数量;The number of initial images acquired has reached the fifth preset number;
初始图像的评分结果的平均值达到第七预设值;The average value of the scoring results of the initial image reaches a seventh preset value;
初始图像的评分结果的标准差达到第八预设值;The standard deviation of the scoring result of the initial image reaches an eighth preset value;
初始图像的评分结果的最低分值达到第九预设值。The lowest score of the score result of the initial image reaches the ninth preset value.
上述提示用户保持拍照的步骤,可以在执行步骤S107缓存初始图像之后对缓存的初始图像的数量和评分结果进行考量,也可以不经过S107的缓存步骤对完成评分的初始图像直接进行考量,以判断是否可以提示用户保持拍照。The step of prompting the user to keep taking a picture may be performed after the initial image is cached in step S107, and the initial image of the cached image may be directly considered by the cache step of S107. Whether you can prompt the user to keep taking photos.
在以上列出的诸项条件中,第五预设数量表示系统预先设定的初始图像的数量的上限值,可以是缓存中存储的图像数量,也可以是系统累计获取的初始图像的数量。获取的初 始图像的数量已达到第五预设数量,可以认为系统已经获取了足够多满足一定标准的图像。第七预设值用来考查评分结果的平均值是否达到预先设定的数值,第八预设值用来考查评分结果的标准差是否达到预设限定的数值,第九预设值用来考查评分结果的最低分值是否达到预设限定的数值,任一条件或多项条件的满足,表示系统获取的初始图像的评分结果已经达到了一定的标准(平均值达到第七预设值、标准差达到第八预设值、和/或最低分值达到第九预设值),表示系统获取的初始图像的质量已经满足了一定的要求。在这种情况下,既可以直接将图像输出供用户选择,也可以提示用户保持拍照,按照预设规则获取用户的初始图像。可以认为,用户在获取到满足一定要求的初始图像的情况下,接收到保持拍照的提示后将会更好的维持姿态,从而获取到更好的图像。Among the items listed above, the fifth preset number represents an upper limit value of the number of initial images preset by the system, and may be the number of images stored in the cache, or may be the number of initial images acquired by the system. . Get the beginning The number of initial images has reached the fifth preset number, and it can be considered that the system has acquired enough images to meet certain criteria. The seventh preset value is used to check whether the average value of the score result reaches a preset value, and the eighth preset value is used to check whether the standard deviation of the score result reaches a preset limit value, and the ninth preset value is used for examination. Whether the lowest score of the score result reaches the preset limit value, and the satisfaction of any condition or multiple conditions indicates that the score of the initial image obtained by the system has reached a certain standard (the average value reaches the seventh preset value, the standard The difference reaches the eighth preset value, and/or the lowest score reaches the ninth preset value, indicating that the quality of the initial image acquired by the system has met certain requirements. In this case, the image can be directly output for the user to select, or the user can be prompted to keep taking a picture, and the initial image of the user is obtained according to a preset rule. It can be considered that, when the user obtains the initial image that satisfies certain requirements, the user will better maintain the posture after receiving the prompt to keep the photograph, thereby obtaining a better image.
在提示用户保持拍照之后,按照预设规则获取用户的初始图像可具体包括:按照预设间隔帧数、预设间隔时间、预设图像数量和/或预设获取时间获取用户的初始图像。其中,预设图像数量表示在提示用户保持拍照后获取的图像的总数量,预设获取时间表示在提示用户保持拍照后持续的拍照时间,预设间隔帧数表示在提示用户保持拍照后获取的相邻两幅图像间间隔的帧数,预设间隔时间表示在提示用户保持拍照后获取的相邻两幅图像间间隔的时间。例如,可以将规则预设为每间隔1秒钟(预设间隔时间)获取一幅初始图像,共获取10幅(预设图像数量)初始图像,也可以将规则预设为在5分钟(预设获取时间)内每间隔5帧(预设间隔帧数)获取一幅初始图像。After the user is prompted to take a photo, acquiring the initial image of the user according to the preset rule may include: acquiring the initial image of the user according to the preset interval frame number, the preset interval time, the preset image number, and/or the preset acquisition time. The preset number of images represents the total number of images acquired after prompting the user to keep taking a photo. The preset acquisition time indicates a continuous photographing time after prompting the user to keep taking a photo. The preset interval frame number indicates that the user is prompted to keep taking a photo after acquiring the photo. The number of frames spaced between two adjacent images. The preset interval time indicates the time interval between two adjacent images acquired after prompting the user to keep taking a picture. For example, the rule can be preset to obtain an initial image every 1 second (preset interval time), and a total of 10 (preset image number) initial images can be obtained, or the rule can be preset to be 5 minutes (pre-pre Let an initial image be acquired every 5 frames (preset interval frame number) within the acquisition time.
对于在上述提示保持拍照后获得的初始图像,可以进行检测和评分,对于达到一定标准的图像可以直接输出供用户取舍,可以进行缓存,也可以不进行缓存而直接放弃(例如,对图像的检测和评分用于监测保持拍照阶段的用户姿态是否稳定、是否发生变化时,无需对图像进行缓存)。在确定是否输出或缓存时,可以采用前述的判断标准对评分结果进行考查,也可以采用不同的判断标准。在缓存初始图像时,可以直接存储该图像,也可以将原缓存中评分结果最低的初始图像删除后再存储提示用户保持拍照后获取的初始图像。For the initial image obtained after the above prompts are kept photographed, detection and scoring can be performed. For a certain standard, the image can be directly output for the user to choose, can be cached, or can be directly discarded without caching (for example, detecting the image). And the scoring is used to monitor whether the user's posture during the photographing phase is stable and whether there is a change, and there is no need to cache the image. In determining whether to output or cache, the scoring results may be examined using the aforementioned criteria, and different criteria may be used. When the initial image is cached, the image may be directly stored, or the initial image with the lowest score in the original cache may be deleted, and then the initial image obtained by prompting the user to keep taking the photo may be stored.
在提示用户保持拍照之后,还可以依据提示用户保持拍照之后获取的初始图像的检测结果和/或评分结果,确定是否继续按照预设规则获取用户的初始图像。通过对初始图像的检测结果和/或评分结果的监控判断,确定用户在收到保持拍照的提示后是否始终保持了足够满足要求的姿态。例如,若获取的连续多幅初始图像未达到输出或缓存的要求,可以认为用户已不满足保持拍照的条件,因此应不再继续按照预设规则获取图像,而转入执行步骤S101获取初始图像。再例如,检测到用户头部偏转或闭眼、用户的姿态已不满足预设的标准时,此时应不再继续按照预设规则获取图像,而转入执行步骤S101获取初始图像。采用这种方式,对提示用户保持拍照之后的用户图像进行监测(以预设间隔帧数和/或预设间隔时间为周期进行监测),有利于确保提示用户保持拍照后获取到的用户的初始图像的图像质量。After prompting the user to keep taking a picture, the user may also determine whether to continue to acquire the initial image of the user according to the preset rule according to the detection result and/or the score result of the initial image obtained after the user is prompted to take the picture. By monitoring and judging the detection result of the initial image and/or the scoring result, it is determined whether the user always maintains a posture sufficient to satisfy the requirement after receiving the prompt to keep the photograph. For example, if the obtained consecutive multiple initial images do not meet the requirements of output or buffer, it can be considered that the user has not satisfied the condition for maintaining the photographing, so the image should not be continuously acquired according to the preset rule, and the process proceeds to step S101 to obtain the initial image. . For example, when it is detected that the user's head is deflected or closed, and the posture of the user does not meet the preset criteria, the image should not be continuously acquired according to the preset rule, and the process proceeds to step S101 to obtain the initial image. In this way, the user image that prompts the user to keep taking a picture is monitored (monitoring with a preset interval frame number and/or a preset interval time), which is beneficial to ensure that the user is prompted to keep the initial user after taking the picture. The image quality of the image.
对用户进行保持拍照的提示,可以采用语音、文字、图像、动画等任一或多种方式的结合进行提示。可以认为用户得到该提示后会更加注意保持姿态,在这一阶段获取的初始图像应该质量更好,评分理应更高(系统假定评分分值越高表示照片质量越好),因此,对于提示用户保持拍照之后获取到的用户的初始图像,可以对该初始图像的评分结果进行调 整,将调整后的评分结果作为该初始图像的评分结果。具体地,可以将评分结果乘以大于1或者小于1的系数,作为调整后的评分结果。The prompt for keeping the photo taken by the user may be prompted by a combination of any one or more of voice, text, image, animation, and the like. It can be considered that the user will pay more attention to maintaining the posture after getting the prompt. The initial image acquired at this stage should be of better quality and the score should be higher (the system assumes that the higher the score, the better the photo quality), therefore, the user is prompted. The original image of the user acquired after taking the photo can be adjusted to the result of the initial image. The adjusted score result is used as the score result of the initial image. Specifically, the score result may be multiplied by a coefficient greater than 1 or less than 1, as an adjusted score result.
在本申请中,输出照片时,可以依据初始图像的评分结果,按照一定顺序将所有缓存的照片向用户输出,也可以实时输出达到一定评分分值或满足其他条件的照片,还可以按照以下方式进行:In the present application, when the photo is output, all the cached photos may be output to the user in a certain order according to the scoring result of the initial image, or a photo that reaches a certain score or other conditions may be output in real time, or may be in the following manner. get on:
依据检测的结果,对初始图像进行筛选;Screening the initial image based on the results of the test;
依据筛选出的初始图像的评分结果,输出评分结果最高的预设数量的照片。The preset number of photos with the highest score results are output based on the scored results of the filtered initial images.
在依据检测的结果对初始图像进行筛选时,可以采用多种不同的方式。例如,可以先按照严格的条件进行筛选,例如要求头部检测的结果中人脸偏转角度不能大于3°,不能出现闭眼或开口现象等,将筛选出符合要求的图像按照评分结果排序,最终输出评分结果最高的预设数量的照片;若按照严格条件进行筛选时所有照片都无法满足要求,则可以放宽条件进行筛选,例如将头部偏转角度不大于3°调整为不大于10°,然后再按照评分结果进行排序输出供用户选择。相对应地,也可以按照先宽松后严格的筛选方式逐步加严要求,筛选出符合标准的照片。在依据检测的结果对初始图像进行筛选时,还可以依据不同检测项目对图像质量影响程度的不同,优先考虑对图像质量影响更大的检测项目的检测结果,将存在严重缺陷的初始图像直接筛除(即使评分结果更高也同样筛除)。例如,用户面部的遮挡物对图像质量影响很大,因此,可以首先筛选出遮挡物检测的结果为无遮挡物的初始图像,然后在依据其他检测项目进行筛选。在输出评分结果最高的照片时,评分结果可以是初始图像的整体评分结果,也可以是某项检测项目的评分结果,可以依据对照片的不同要求选定,在此不作限定。用户得到符合标准的照片后,可以在此照片的基础上重建3D模型,满足应用需求。例如,图像1的总体评分为88分,遮挡物检测达到95分,亮度检测达到80分;图像2的总体评分为90分,遮挡物检测达到91分,亮度检测达到88分。对于重建3D模型来说,有无遮挡物比亮度的影响更大,因此,在输出时,会更优先提供图像1供用户选择。When screening the initial image based on the results of the detection, a number of different ways can be employed. For example, screening can be performed according to strict conditions. For example, in the result of head detection, the face deflection angle should not be greater than 3°, and closed eyes or openings should not occur. The images that meet the requirements are sorted according to the score results, and finally Output the preset number of photos with the highest score; if all the photos are not satisfactory when screening according to strict conditions, you can relax the conditions for screening, for example, adjust the head deflection angle to no more than 3° to no more than 10°, then Then sort the output according to the score result for the user to select. Correspondingly, it is also possible to gradually tighten the requirements according to the first loose and strict screening methods, and screen out photos that meet the standards. When screening the initial image according to the detection result, it is also possible to prioritize the detection result of the detection item with greater influence on the image quality according to the difference degree of the influence of different detection items on the image quality, and directly screen the initial image with serious defects. In addition to (even if the score is higher, it is also screened out). For example, the occlusion of the user's face has a great influence on the image quality. Therefore, the result of the occlusion detection can be first screened as the initial image without the occlusion, and then filtered according to other detection items. When the photo with the highest score is output, the scoring result may be the overall scoring result of the initial image, or may be the scoring result of a certain detection item, which may be selected according to different requirements of the photo, and is not limited herein. After the user gets the photo that meets the standard, the 3D model can be reconstructed based on the photo to meet the application requirements. For example, the overall score of image 1 is 88 points, the obstruction detection reaches 95 points, the brightness detection reaches 80 points, the overall score of image 2 is 90 points, the obstruction detection reaches 91 points, and the brightness detection reaches 88 points. For the reconstruction of the 3D model, there is no obstruction than the brightness, so in the output, the image 1 will be given priority for the user to select.
需要说明的是,上述各实施例中,各预设时间、预设数量、预设值、预设阈值、预设帧、预设帧数、预设缓存值等量的具体数值可以相同,也可以不同。例如,第一预设值、第五预设值和第六预设值可以取得相同,也可以不同。It should be noted that, in each of the foregoing embodiments, the specific values of the preset time, the preset number, the preset value, the preset threshold, the preset frame, the preset frame number, and the preset buffer value may be the same, Can be different. For example, the first preset value, the fifth preset value, and the sixth preset value may be the same or different.
本申请还提供了一种照片获取装置,参见图3所示,包括:The present application also provides a photo acquisition device, as shown in FIG. 3, comprising:
获取模块101,用于获取用户的初始图像;The obtaining module 101 is configured to acquire an initial image of the user;
建模模块102,用于依据初始图像,获取用户的人脸模型,人脸模型包括用户的人脸特征点;The modeling module 102 is configured to acquire a face model of the user according to the initial image, where the face model includes a face feature point of the user;
检测模块103,用于对人脸模型进行检测;a detecting module 103, configured to detect a face model;
评分模块104,用于依据检测的结果,按照评分标准对初始图像进行评分;其中,所述评分标准表征所述检测的结果与评分分值的对应关系;The scoring module 104 is configured to score the initial image according to the scoring standard according to the result of the detecting; wherein the scoring standard represents a correspondence between the detected result and the scoring score;
输出模块105,用于依据初始图像的评分结果,输出照片。 The output module 105 is configured to output a photo according to the score result of the initial image.
上述装置还可进一步包括:The above apparatus may further include:
姿态调整提示模块,用于依据检测的结果和/或初始图像的评分结果,提示用户调整姿态;The posture adjustment prompting module is configured to prompt the user to adjust the posture according to the detected result and/or the score result of the initial image;
缓存模块,用于当初始图像的评分结果达到预设缓存值时,缓存初始图像及其评分结果;a caching module, configured to cache an initial image and a scoring result when the scoring result of the initial image reaches a preset cache value;
提示拍照模块,用于当满足预设条件时,提示用户保持拍照。The prompting photo module is configured to prompt the user to keep taking a photo when the preset condition is met.
上述照片获取装置与前述的照片获取方法的流程描述相对应,不足之处参考上述方法流程的叙述,不再一一赘述。The above-mentioned photo acquisition device corresponds to the description of the flow of the photo acquisition method described above, and the deficiencies refer to the description of the above method flow, and will not be further described.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (system), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory. Memory is an example of a computer readable medium.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、 动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer readable media includes both permanent and non-persistent, removable and non-removable media. Information storage can be implemented by any method or technology. The information can be computer readable instructions, data structures, modules of programs, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), Dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, only Read compact disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape storage or other magnetic storage device or any other non-transportable medium that can be used for storage can be calculated Information accessed by the device. As defined herein, computer readable media does not include temporary storage of computer readable media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、商品或者设备中还存在另外的相同要素。It is also to be understood that the terms "comprises" or "comprising" or "comprising" or any other variations are intended to encompass a non-exclusive inclusion, such that a process, method, article, Other elements not explicitly listed, or elements that are inherent to such a process, method, commodity, or equipment. An element defined by the phrase "comprising a ..." does not exclude the presence of additional equivalent elements in the process, method, item, or device including the element.
本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present application can be provided as a method, system, or computer program product. Thus, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment in combination of software and hardware. Moreover, the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
以上所述仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。 The above description is only an embodiment of the present application and is not intended to limit the application. Various changes and modifications can be made to the present application by those skilled in the art. Any modifications, equivalents, improvements, etc. made within the spirit and scope of the present application are intended to be included within the scope of the appended claims.

Claims (20)

  1. 一种照片获取方法,其特征在于,包括:A photo acquisition method, comprising:
    获取用户的初始图像;Obtain the initial image of the user;
    依据所述初始图像,获取用户的人脸模型,所述人脸模型包括用户的人脸特征点;Acquiring a face model of the user according to the initial image, where the face model includes a face feature point of the user;
    对所述人脸模型进行检测;Testing the face model;
    依据检测的结果,按照评分标准对所述初始图像进行评分;其中,所述评分标准表征所述检测的结果与评分分值的对应关系;And determining, according to the result of the detection, the initial image according to a scoring standard; wherein the scoring standard characterizes a correspondence between the detected result and the scoring score;
    依据所述初始图像的评分结果,输出所述照片。The photo is output according to the result of the rating of the initial image.
  2. 按照权利要求1所述方法,其特征在于,在对所述人脸模型进行检测之后,还包括:The method according to claim 1, wherein after detecting the face model, the method further comprises:
    依据所述检测的结果和/或初始图像的评分结果,提示用户调整姿态。The user is prompted to adjust the posture based on the result of the detection and/or the result of the initial image.
  3. 按照权利要求1所述方法,其特征在于,所述方法还包括:The method of claim 1 wherein the method further comprises:
    依据拍照持续时间和/或对初始图像的评分结果,对所述评分标准进行调整和/或对所述评分结果进行调整。The scoring criteria are adjusted and/or adjusted based on the duration of the photographing and/or the scoring results of the initial image.
  4. 按照权利要求3所述方法,其特征在于,依据拍照持续时间和/或对初始图像的评分结果,对所述评分标准进行调整和/或对所述评分结果进行调整,包括:The method according to claim 3, wherein the scoring criteria are adjusted and/or adjusted according to the photographing duration and/or the scoring result of the initial image, including:
    若满足以下一项或多项条件,则对所述评分标准进行调整和/或对所述评分结果进行调整:Adjusting and/or adjusting the rating criteria if one or more of the following conditions are met:
    所述拍照持续时间达到第一预设时间;The photographing duration reaches a first preset time;
    初始图像的评分结果未达到第一预设值;The score of the initial image does not reach the first preset value;
    初始图像的评分结果的变化值小于第二预设值;The change value of the score result of the initial image is smaller than the second preset value;
    第一预设数量的初始图像的评分结果的平均值未达到第三预设值;The average of the score results of the first preset number of initial images does not reach the third preset value;
    第二预设数量的初始图像的评分结果的标准差未达到第四预设值。The standard deviation of the scoring results of the second predetermined number of initial images does not reach the fourth preset value.
  5. 按照权利要求4所述方法,其特征在于,对所述评分标准进行调整,包括:The method of claim 4 wherein the rating criteria are adjusted to include:
    减少依据所述检测的结果对评分分值的降低程度,或者增加依据所述检测的结果对评分分值的升高程度。The degree of decrease in the score score based on the result of the test is reduced, or the degree of increase in the score score based on the result of the test is increased.
  6. 按照权利要求4所述方法,其特征在于,对所述评分结果进行调整,包括:The method of claim 4, wherein the adjusting the score results comprises:
    将所述评分结果乘以大于1或者小于1的系数,作为调整后的评分结果。The score result is multiplied by a coefficient greater than 1 or less than 1, as an adjusted score result.
  7. 按照权利要求1所述方法,其特征在于,在依据检测的结果,按照评分标准对所述初始图像进行评分之后,在依据所述初始图像的评分结果,输出所述照片之前,所述方法还包括:The method according to claim 1, wherein after the initial image is scored according to a scoring standard according to the result of the detection, the method is further processed before the photo is output according to the scoring result of the initial image. include:
    若所述初始图像的评分结果达到第五预设值,则缓存所述初始图像及其评分结果。If the result of the scoring of the initial image reaches a fifth preset value, the initial image and its scoring result are cached.
  8. 按照权利要求1所述方法,其特征在于,依据所述初始图像的评分结果,输出所述照片,包括: The method according to claim 1, wherein the outputting the photo according to the result of the scoring of the initial image comprises:
    若所述初始图像的评分结果达到第六预设值,则输出所述照片。If the result of the scoring of the initial image reaches a sixth preset value, the photo is output.
  9. 按照权利要求7或8所述方法,其特征在于,在依据检测的结果,按照评分标准对所述初始图像进行评分之后,所述方法还包括:The method according to claim 7 or 8, wherein after the initial image is scored according to the scoring standard according to the result of the detecting, the method further comprises:
    依据拍照持续时间和/或对初始图像的评分结果,对第五预设值和/或第六预设值进行调整。The fifth preset value and/or the sixth preset value are adjusted according to the photographing duration and/or the scoring result of the initial image.
  10. 按照权利要求9所述方法,其特征在于,依据对初始图像的评分结果,对第五预设值和/或第六预设值进行调整,包括:The method according to claim 9, wherein the adjusting the fifth preset value and/or the sixth preset value according to the result of scoring the initial image comprises:
    依据预设数量的初始图像的评分结果的数值、变化值、平均值和/或标准差,对所述第五预设值和/或所述第六预设值进行降低或升高。The fifth preset value and/or the sixth preset value are lowered or increased according to a value, a change value, an average value, and/or a standard deviation of a score result of a preset number of initial images.
  11. 按照权利要求1所述方法,其特征在于,在依据检测的结果,按照评分标准对所述初始图像进行评分之后,在依据所述初始图像的评分结果,输出所述照片之前,还包括:The method according to claim 1, wherein after the initial image is scored according to the scoring standard according to the result of the detecting, before the outputting the photo according to the scoring result of the initial image, the method further comprises:
    若满足以下任一条件,则提示用户保持拍照,按照预设规则获取用户的初始图像:If any of the following conditions are met, the user is prompted to take a photo and obtain the initial image of the user according to a preset rule:
    获取的所述初始图像的数量已达到第五预设数量;The number of the obtained initial images has reached a fifth preset number;
    所述初始图像的评分结果的平均值达到第七预设值;The average value of the scoring results of the initial image reaches a seventh preset value;
    所述初始图像的评分结果的标准差达到第八预设值;The standard deviation of the score result of the initial image reaches an eighth preset value;
    所述初始图像的评分结果的最低分值达到第九预设值。The lowest score of the score result of the initial image reaches a ninth preset value.
  12. 按照权利要求11所述方法,其特征在于,按照预设规则获取用户的初始图像,包括:The method according to claim 11, wherein the initial image of the user is obtained according to a preset rule, including:
    按照预设间隔帧数、预设间隔时间、预设图像数量和/或预设获取时间获取用户的初始图像。The initial image of the user is obtained according to the preset interval frame number, the preset interval time, the preset image number, and/or the preset acquisition time.
  13. 按照权利要求11所述方法,其特征在于,提示用户保持拍照,按照预设规则获取用户的初始图像,包括:The method according to claim 11, wherein the prompting the user to keep taking a photo and acquiring the initial image of the user according to the preset rule comprises:
    依据提示用户保持拍照之后获取的初始图像的检测结果和/或评分结果,确定是否继续按照所述预设规则获取用户的初始图像。The initial image of the user is determined to be continued according to the preset rule according to the detection result and/or the scoring result of the initial image obtained after the user is prompted to take the photo.
  14. 按照权利要求11~13之任一所述方法,其特征在于,A method according to any one of claims 11 to 13, wherein
    对于提示用户保持拍照之后获取到的用户的初始图像,对该初始图像的评分结果进行调整,将调整后的评分结果作为该初始图像的评分结果。For the initial image of the user that is obtained after the user is prompted to take a photo, the scoring result of the initial image is adjusted, and the adjusted scoring result is used as the scoring result of the initial image.
  15. 按照权利要求1所述方法,其特征在于,对所述人脸模型进行检测,包括对所述人脸模型上的遮挡物、亮度、眼睛所在区域、嘴唇所在区域、所述人脸模型的运动状态和/或清晰程度进行检测。The method according to claim 1, wherein the detecting of the face model comprises: obstructing, brightness, area of the eye, area of the lips, movement of the face model on the face model State and/or clarity are tested.
  16. 按照权利要求1所述方法,其特征在于,在依据所述初始图像,获取用户的人脸模型之后,在对所述人脸模型进行检测之前,还包括:The method according to claim 1, wherein after the capturing of the face model of the user according to the initial image, before detecting the face model, the method further comprises:
    依据所述人脸模型上的所述人脸特征点,建立所述人脸模型的3D模型;Establishing a 3D model of the face model according to the face feature point on the face model;
    则对所述人脸模型进行检测具体包括: The detecting the face model specifically includes:
    依据所述3D模型,检测所述3D模型的头部部位在三维方向上的偏转。According to the 3D model, the deflection of the head portion of the 3D model in a three-dimensional direction is detected.
  17. 按照权利要求16所述方法,其特征在于,依据所述3D模型,检测所述3D模型的头部部位在三维方向上的偏转,包括:The method according to claim 16, wherein detecting the deflection of the head portion of the 3D model in a three-dimensional direction according to the 3D model comprises:
    依据所述3D模型,确定所述人脸特征点中的稳定点所在位置;所述稳定点为仅随着用户的头部姿态变化的特征点;Determining, according to the 3D model, a location of a stable point in the facial feature point; the stable point is a feature point that changes only with a posture of a user's head;
    将预设头部3D模型与所述稳定点所在位置进行匹配;Matching the preset head 3D model with the location of the stable point;
    当所述预设头部3D模型与所述稳定点所在位置相匹配时,提取所述预设头部3D模型在三维方向上的偏转角度,作为所述3D模型的头部部位在三维方向上的偏转角度。When the preset head 3D model matches the position of the stable point, extracting a deflection angle of the preset head 3D model in a three-dimensional direction as a head portion of the 3D model in a three-dimensional direction Deflection angle.
  18. 按照权利要求1所述方法,其特征在于,依据所述初始图像的评分结果,输出所述照片,包括:The method according to claim 1, wherein the outputting the photo according to the result of the scoring of the initial image comprises:
    依据所述检测的结果,对所述初始图像进行筛选;Filtering the initial image according to the result of the detection;
    依据筛选出的所述初始图像的评分结果,输出评分结果最高的预设数量的照片。The preset number of photos with the highest score result is output according to the scored result of the filtered initial image.
  19. 一种照片获取装置,其特征在于,包括:A photo acquisition device, comprising:
    获取模块,用于获取用户的初始图像;An acquisition module, configured to acquire an initial image of the user;
    建模模块,用于依据所述初始图像,获取用户的人脸模型,所述人脸模型包括用户的人脸特征点;a modeling module, configured to acquire a face model of the user according to the initial image, where the face model includes a face feature point of the user;
    检测模块,用于对所述人脸模型进行检测;a detecting module, configured to detect the face model;
    评分模块,用于依据检测的结果,按照评分标准对所述初始图像进行评分;其中,所述评分标准表征所述检测的结果与评分分值的对应关系;a scoring module, configured to score the initial image according to a scoring standard according to the result of the detecting; wherein the scoring standard characterizes a correspondence between the detected result and the scoring score;
    输出模块,用于依据所述初始图像的评分结果,输出所述照片。And an output module, configured to output the photo according to the score result of the initial image.
  20. 按照权利要求19所述装置,其特征在于,所述装置还包括:The device according to claim 19, wherein said device further comprises:
    姿态调整提示模块,用于依据所述检测的结果和/或初始图像的评分结果,提示用户调整姿态;a posture adjustment prompting module, configured to prompt the user to adjust the posture according to the result of the detection and/or the result of the initial image;
    缓存模块,用于当所述初始图像的评分结果达到预设缓存值时,缓存所述初始图像及其评分结果;a caching module, configured to cache the initial image and the scoring result when the scoring result of the initial image reaches a preset cache value;
    提示拍照模块,用于当满足预设条件时,提示用户保持拍照。 The prompting photo module is configured to prompt the user to keep taking a photo when the preset condition is met.
PCT/CN2017/096825 2016-09-14 2017-08-10 Photo acquisition method and device WO2018049952A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610824078.4A CN106503614B (en) 2016-09-14 2016-09-14 Photo obtaining method and device
CN201610824078.4 2016-09-14

Publications (1)

Publication Number Publication Date
WO2018049952A1 true WO2018049952A1 (en) 2018-03-22

Family

ID=58290457

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/096825 WO2018049952A1 (en) 2016-09-14 2017-08-10 Photo acquisition method and device

Country Status (2)

Country Link
CN (1) CN106503614B (en)
WO (1) WO2018049952A1 (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110222624A (en) * 2019-05-31 2019-09-10 广州群安电子科技有限公司 A kind of dynamic human face detection device
CN110908754A (en) * 2019-11-06 2020-03-24 维沃移动通信有限公司 Image display method and electronic equipment
CN111199165A (en) * 2018-10-31 2020-05-26 浙江宇视科技有限公司 Image processing method and device
CN111259751A (en) * 2020-01-10 2020-06-09 北京百度网讯科技有限公司 Video-based human behavior recognition method, device, equipment and storage medium
CN111311581A (en) * 2020-02-20 2020-06-19 杭州涂鸦信息技术有限公司 Image scoring method based on illumination and system and device thereof
CN112733575A (en) * 2019-10-14 2021-04-30 北京字节跳动网络技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN113435428A (en) * 2021-08-27 2021-09-24 深圳市爱深盈通信息技术有限公司 Photo album-based photo sticker selection method, electronic equipment and storage medium
CN113536991A (en) * 2021-06-29 2021-10-22 北京百度网讯科技有限公司 Training set generation method, human face image processing method, device and electronic equipment
CN113673286A (en) * 2020-05-15 2021-11-19 深圳市光鉴科技有限公司 Depth reconstruction method, system, device and medium based on target area
EP3944136A1 (en) * 2020-07-23 2022-01-26 Bundesdruckerei GmbH Id document and method for personalizing id document

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106503614B (en) * 2016-09-14 2020-01-17 厦门黑镜科技有限公司 Photo obtaining method and device
CN107169093B (en) * 2017-05-12 2019-12-13 北京奇艺世纪科技有限公司 target image acquisition method and device
CN108961306A (en) * 2017-05-17 2018-12-07 北京芝麻力量运动科技有限公司 Image processing method, image processing apparatus and body-sensing system
CN107358149B (en) * 2017-05-27 2020-09-22 深圳市深网视界科技有限公司 Human body posture detection method and device
CN107292261B (en) * 2017-06-16 2021-07-13 深圳天珑无线科技有限公司 Photographing method and mobile terminal thereof
CN109215055A (en) 2017-06-30 2019-01-15 杭州海康威视数字技术股份有限公司 A kind of target's feature-extraction method, apparatus and application system
CN108875485A (en) * 2017-09-22 2018-11-23 北京旷视科技有限公司 A kind of base map input method, apparatus and system
CN107590807A (en) * 2017-09-29 2018-01-16 百度在线网络技术(北京)有限公司 Method and apparatus for detection image quality
CN107872619B (en) * 2017-10-30 2020-04-07 维沃移动通信有限公司 Photographing processing method, device and equipment
CN108446651A (en) * 2018-03-27 2018-08-24 百度在线网络技术(北京)有限公司 Face identification method and device
CN111199210B (en) * 2019-12-31 2023-05-30 武汉星巡智能科技有限公司 Expression-based video generation method, device, equipment and storage medium
CN111524123B (en) 2020-04-23 2023-08-08 北京百度网讯科技有限公司 Method and apparatus for processing image
CN114275416B (en) * 2022-01-19 2023-07-21 平安国际智慧城市科技股份有限公司 Kitchen waste classification method, device, equipment and medium based on image recognition

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101226524A (en) * 2007-01-18 2008-07-23 华硕电脑股份有限公司 Image picture automatic selection method as well as computer system thereof
CN105205462A (en) * 2015-09-18 2015-12-30 北京百度网讯科技有限公司 Shooting promoting method and device
CN105528786A (en) * 2015-12-04 2016-04-27 小米科技有限责任公司 Image processing method and device
CN105550671A (en) * 2016-01-28 2016-05-04 北京麦芯科技有限公司 Face recognition method and device
CN106503614A (en) * 2016-09-14 2017-03-15 厦门幻世网络科技有限公司 A kind of photo acquisition methods and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101212702B (en) * 2006-12-29 2011-05-18 华晶科技股份有限公司 Image scoring method
CN101887514B (en) * 2009-05-13 2013-10-30 联咏科技股份有限公司 Human face detecting device and human face detecting method thereof
CN105373767A (en) * 2015-07-23 2016-03-02 中山大学深圳研究院 Eye fatigue detection method for smart phones
CN105205479A (en) * 2015-10-28 2015-12-30 小米科技有限责任公司 Human face value evaluation method, device and terminal device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101226524A (en) * 2007-01-18 2008-07-23 华硕电脑股份有限公司 Image picture automatic selection method as well as computer system thereof
CN105205462A (en) * 2015-09-18 2015-12-30 北京百度网讯科技有限公司 Shooting promoting method and device
CN105528786A (en) * 2015-12-04 2016-04-27 小米科技有限责任公司 Image processing method and device
CN105550671A (en) * 2016-01-28 2016-05-04 北京麦芯科技有限公司 Face recognition method and device
CN106503614A (en) * 2016-09-14 2017-03-15 厦门幻世网络科技有限公司 A kind of photo acquisition methods and device

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111199165A (en) * 2018-10-31 2020-05-26 浙江宇视科技有限公司 Image processing method and device
CN111199165B (en) * 2018-10-31 2024-02-06 浙江宇视科技有限公司 Image processing method and device
CN110222624A (en) * 2019-05-31 2019-09-10 广州群安电子科技有限公司 A kind of dynamic human face detection device
CN110222624B (en) * 2019-05-31 2023-04-28 深圳群安电子科技有限公司 Dynamic human face detection device
CN112733575A (en) * 2019-10-14 2021-04-30 北京字节跳动网络技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN110908754A (en) * 2019-11-06 2020-03-24 维沃移动通信有限公司 Image display method and electronic equipment
CN111259751B (en) * 2020-01-10 2023-08-29 北京百度网讯科技有限公司 Human behavior recognition method, device, equipment and storage medium based on video
CN111259751A (en) * 2020-01-10 2020-06-09 北京百度网讯科技有限公司 Video-based human behavior recognition method, device, equipment and storage medium
CN111311581A (en) * 2020-02-20 2020-06-19 杭州涂鸦信息技术有限公司 Image scoring method based on illumination and system and device thereof
CN113673286B (en) * 2020-05-15 2024-04-16 深圳市光鉴科技有限公司 Depth reconstruction method, system, equipment and medium based on target area
CN113673286A (en) * 2020-05-15 2021-11-19 深圳市光鉴科技有限公司 Depth reconstruction method, system, device and medium based on target area
EP3944136A1 (en) * 2020-07-23 2022-01-26 Bundesdruckerei GmbH Id document and method for personalizing id document
CN113536991B (en) * 2021-06-29 2023-06-23 北京百度网讯科技有限公司 Training set generation method, face image processing method, device and electronic equipment
CN113536991A (en) * 2021-06-29 2021-10-22 北京百度网讯科技有限公司 Training set generation method, human face image processing method, device and electronic equipment
CN113435428A (en) * 2021-08-27 2021-09-24 深圳市爱深盈通信息技术有限公司 Photo album-based photo sticker selection method, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN106503614A (en) 2017-03-15
CN106503614B (en) 2020-01-17

Similar Documents

Publication Publication Date Title
WO2018049952A1 (en) Photo acquisition method and device
US20180089499A1 (en) Face recognition method and device and apparatus
US11849998B2 (en) Method for pupil detection for cognitive monitoring, analysis, and biofeedback-based treatment and training
JP6282769B2 (en) Engagement value processing system and engagement value processing device
US20230030267A1 (en) Method and apparatus for selecting face image, device, and storage medium
CN109978884B (en) Multi-person image scoring method, system, equipment and medium based on face analysis
WO2021237968A1 (en) Living body detection method and apparatus applied to blocked face scene
JP6906717B2 (en) Status determination device, status determination method, and status determination program
WO2015158087A1 (en) Method and apparatus for detecting health status of human eyes and mobile terminal
CN108742656A (en) Fatigue state detection method based on face feature point location
KR20200012355A (en) Online lecture monitoring method using constrained local model and Gabor wavelets-based face verification process
CN111008971A (en) Aesthetic quality evaluation method of group photo image and real-time shooting guidance system
CN107862298B (en) Winking living body detection method based on infrared camera device
Li et al. Buccal: low-cost cheek sensing for inferring continuous jaw motion in mobile virtual reality
CN110276313B (en) Identity authentication method, identity authentication device, medium and computing equipment
WO2020222785A1 (en) Facial action unit detection
US11800975B2 (en) Eye fatigue prediction based on calculated blood vessel density score
CN111588345A (en) Eye disease detection method, AR glasses and readable storage medium
WO2022117096A1 (en) First person point-of-view image recognition method and apparatus, and computer-readable storage medium
JP2013009700A (en) Data processing method of hair photographic image, and data comparison method
KR102038413B1 (en) Online lecture monitoring method using face verification and gaze tracking technology
CN112052721A (en) Wink oscillogram generation method, device and equipment based on deep learning
KR102447912B1 (en) Blinking training method and system
Daza et al. mEBAL2 database and benchmark: Image-based multispectral eyeblink detection
KR102616230B1 (en) Method for determining user's concentration based on user's image and operating server performing the same

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: 17850154

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 22/08/2019)

122 Ep: pct application non-entry in european phase

Ref document number: 17850154

Country of ref document: EP

Kind code of ref document: A1