CN108710848A - The flaw of face-image determines method and apparatus - Google Patents

The flaw of face-image determines method and apparatus Download PDF

Info

Publication number
CN108710848A
CN108710848A CN201810466683.8A CN201810466683A CN108710848A CN 108710848 A CN108710848 A CN 108710848A CN 201810466683 A CN201810466683 A CN 201810466683A CN 108710848 A CN108710848 A CN 108710848A
Authority
CN
China
Prior art keywords
image
flaw
face
pixel
gray
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810466683.8A
Other languages
Chinese (zh)
Inventor
周桂文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Shuliantianxia Intelligent Technology Co Ltd
Original Assignee
Shenzhen Het Data Resources and Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Het Data Resources and Cloud Technology Co Ltd filed Critical Shenzhen Het Data Resources and Cloud Technology Co Ltd
Priority to CN201810466683.8A priority Critical patent/CN108710848A/en
Publication of CN108710848A publication Critical patent/CN108710848A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation

Landscapes

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

Abstract

The invention discloses the flaws of face-image to determine method and apparatus, wherein the method includes:Obtain initial face-image;Gray proces are carried out to the face-image and obtain the corresponding gray level image of the face-image;Median filter process is carried out to the gray level image and obtains the corresponding filtering image of the gray level image;The corresponding flaw image of the face-image is determined according to the gray level image and the filtering image;By comparing the flaw image and the face-image, the flaw in the face-image is determined.Technical solution using the present invention can be accurately detected and handled to the flaw in face-image.

Description

The flaw of face-image determines method and apparatus
Technical field
The present invention relates to the flaws of computer realm more particularly to face-image to determine method and apparatus.
Background technology
As digital imaging technique is increasingly mature, digital photograph is substantially instead of conventional film.Photo it is biometrics Not only so that shooting and preserve it is more convenient, also so that can be modified photo to beautify photo after shooting photo.Number The resolution ratio of code camera is higher and higher, captured by obtained photo it is also more and more clear, photo can more clearly be shown The various details of object captured by digital camera.For the face-image that main body is face, photo can clearly be shown The various details of face skin are shown.And with advancing age, the facial skin of people inevitably will appear some flaw points, flaw Point may be the sunburn occurred due to localised skin pigmentation, freckle, senile plaque etc., it is also possible to the acne that long whelk leaves Print, acne hole etc. correspondingly can also clearly show these flaw points by the photo captured by digital camera out.Scheming The epoch of piece social activity, user wish to show oneself fine looks in social platform, and user wishes will by certain mode Flaw in face-image removes to be shown again, and to remove the flaw in face-image, then firstly the need of to face-image In flaw detection is identified.
For the flaw in processing face-image, traditional face flaw handling implement, such as Photoshop tools, processing Facial image can play relatively good effect, but the operating procedure of this professional tool is complicated, and user is needed to understand and grasp The operating method of this tool, the case where handling image, place one's entire reliance upon user to the Grasping level of this tool.In addition, at present Some beautification cameras and beautification application can also play the role of beautifying facial image, still, these beautification cameras or beautification Using mostly using the effect integrally beautified to facial image, such that the loss in detail of facial image, such as Dermatoglyph etc. thickens, and cannot achieve accurate detection and processing to the flaw in face-image.
Invention content
The embodiment of the present invention provide face-image flaw determine method and apparatus, can to the flaw in face-image into Row is accurately detected and is handled.
In a first aspect, the embodiment of the present invention, which provides a kind of flaw of face-image, determines method, including:
Obtain initial face-image;
Gray proces are carried out to the face-image and obtain the corresponding gray level image of the face-image;
Median filter process is carried out to the gray level image and obtains the corresponding filtering image of the gray level image;
The corresponding flaw image of the face-image is determined according to the gray level image and the filtering image;
By comparing the flaw image and the face-image, the flaw in the face-image is determined.
With reference to first aspect, in one possible implementation, described to be schemed according to the gray level image and the filtering Picture determines that the corresponding flaw image of the face-image includes:
Calculus of differences is carried out to the gray level image and the filtering image to handle to obtain the corresponding difference of the face-image It is worth image;
Binary conversion treatment is carried out to the error image and obtains the corresponding flaw image of the face-image.
With reference to first aspect, in one possible implementation, described to the gray level image and the filtering image Progress calculus of differences handles to obtain the corresponding error image of the face-image:
The gray value of each pixel in the gray level image and the filtering image is determined respectively;
The absolute value of the difference of the gray value of first pixel and the gray value of the second pixel is determined as third pixel The gray value of point, first pixel are the pixel in the gray level image, and second pixel is in the filter Position pixel corresponding with first pixel in wave image, the third pixel be the error image in position with The corresponding pixel of first pixel.
With reference to first aspect, in one possible implementation, described that binary conversion treatment is carried out to the error image Obtaining the corresponding flaw image of the face-image includes:
Determine that the 4th pixel and the 5th pixel, the 4th pixel are more than for gray value in the error image Or the pixel equal to gray threshold, the 5th pixel are the pixel that gray value is less than the gray threshold;
The gray value of the 4th pixel is adjusted to the first gray value in the error image, and by the 5th picture The gray value of vegetarian refreshments is adjusted to the second gray value, forms flaw image.
With reference to first aspect, in one possible implementation, described by comparing the flaw image and the face Portion's image determines that the flaw in the face-image includes:
Determine that first position is gathered, first position set includes gray value in the flaw image equal to described the Position of the pixel of one gray value in the flaw image;
Determine that the second position is gathered, the second position set includes being not belonging to facial characteristics in the face-image Position of the image characteristic point in described image, and, the image characteristic point of face feature is belonged in the face-image in institute State the position in image;
The third place set, the third place collection are determined according to first position set and second position set It closes and is included in the set of the first position and the not position in the second position is gathered;
The pixel that target location is in the face-image is determined as the flaw in the face-image, the mesh Cursor position belongs to the third place set.
With reference to first aspect, in one possible implementation, described by comparing the flaw image and the face Portion's image determines that the flaw in the face-image further includes later:
Determine the size of the flaw;
According to the size adjusting medium filtering coefficient of the flaw, the medium filtering coefficient and the size positive correlation;
The flaw progress median filter process in the face-image is obtained according to the medium filtering coefficient after adjustment light Change the face-image after flaw.
With reference to first aspect, in one possible implementation, further include before the size of the determination flaw:
The flaw is classified to obtain the classification of each flaw;
Obtain the clearance order of the flaw for target category;
The flaw of the target category is removed according to the classification of each flaw in the face-image.
With reference to first aspect, in one possible implementation, described to be schemed according to the gray level image and the filtering Further include as determining the corresponding flaw image of the face-image later:
Export the face-image and the flaw image.
Second aspect, the embodiment of the present invention provide a kind of flaw determination device of face-image, including:
Acquisition module, for obtaining initial face-image;
First processing module obtains the corresponding gray scale of the face-image for carrying out gray proces to the face-image Image;
Second processing module, it is corresponding for obtaining the gray level image to gray level image progress median filter process Filtering image;
Third processing module, for determining that the face-image is corresponding according to the gray level image and the filtering image Flaw image;
Flaw determining module, for by comparing the flaw image and the face-image, determining the face-image In flaw.
The third aspect, the present invention implement to provide the flaw determination device of another face-image, including processor, memory And input/output interface, the processor, memory and input/output interface are connected with each other, wherein the input and output connect Mouth is for input or output data data, and the memory is for storing program code, and the processor is for calling the journey Sequence code executes any one method in above-mentioned first aspect and the various possible realization methods of first aspect.
Fourth aspect, the embodiment of the present invention provide a kind of computer storage media, and the computer storage media is stored with Computer program, the computer program include program instruction, and described program instruction makes the calculating when executed by a computer Machine executes any one method in above-mentioned first aspect and each possible realization method of first aspect.
In the embodiment of the present invention, by carrying out gray proces respectively to original face-image and median filter process obtains Its corresponding gray level image and filtering image, gray level image can reflect the feature of original face-image, filtering image reflection Be situation after beautifying to original face-image, the flaw image handled gray level image and filtering image can To reflect the difference of the image after original face-image and beautification, then by comparing original image and flaw image, In detail and the flaw in face-image then can be accurately detected out, so as to realize the accurate feedback to flaw and handle.
Description of the drawings
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to needed in the embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for ability For the those of ordinary skill of domain, without creative efforts, it can also be obtained according to these attached drawings other attached Figure.
Fig. 1 is that a kind of flaw of face-image provided in an embodiment of the present invention determines the flow diagram of method;
Fig. 2 is the schematic diagram of the process provided in an embodiment of the present invention that median filter process is carried out to an image-region;
Fig. 3 is the schematic diagram of the process provided in an embodiment of the present invention that median filter process is carried out to gray level image;
Fig. 4 is provided in an embodiment of the present invention to establish coordinate system coordinate representation pixel position in the picture in the picture Schematic diagram;
Fig. 5 is that offer of the embodiment of the present invention handles to obtain error image to gray level image and filtering image progress calculus of differences Process schematic diagram;
Fig. 6 is that the flaw of another face-image provided in an embodiment of the present invention determines the flow diagram of method;
Fig. 7 is the schematic diagram of flaw provided in an embodiment of the present invention;
Fig. 8 is that the flaw of another face-image provided in an embodiment of the present invention determines the flow chart of method;
Fig. 9 is a kind of structural schematic diagram of the flaw determination device of face-image provided in an embodiment of the present invention;
Figure 10 is the composed structure schematic diagram of the flaw determination device of another face-image provided in an embodiment of the present invention.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation describes, it is clear that described embodiment is only a part of the embodiment of the present invention, instead of all the embodiments.Based on this Embodiment in invention, every other reality obtained by those of ordinary skill in the art without making creative efforts Example is applied, shall fall within the protection scope of the present invention.
The flow signal of method is determined referring to the flaw that Fig. 1, Fig. 1 are a kind of face-images provided in an embodiment of the present invention Figure, as shown, the method includes:
S101 obtains initial face-image.
In the embodiment of the present invention, initial face-image can be to have using digital camera, camera, slr camera etc. Face-image that the equipment or component of shooting function are shot and untreated.It can be obtained initially by input interface Face-image.In some possible realization methods, initial face-image, example can be directly acquired by the input interface Such as, the device for executing the method for the embodiment of the present invention be mobile phone, laptop etc., then mobile phone or laptop by its from The camera that body has shoots facial image, which is to be schemed by the initial face that camera is directly obtained Picture;In other possible realization methods, can also by the initial face-image of the input interface indirect gain, for example, The device for executing the method for the embodiment of the present invention is laptop, and initial face-image is the people obtained by slr camera Face image, the facial image are stored in safe digital (SecureDigital, the SD) card of slr camera, then can will be single anti- The SD card of camera is inserted into the card reading interface of laptop etc., and laptop passes through the initial face of card reading interface indirect gain Portion's image.
S102 carries out gray proces to the face-image and obtains the corresponding gray level image of the face-image.
In the embodiment of the present invention, obtaining the corresponding gray level image of face-image to face-image progress gray proces is substantially Change the brightness of the pixel in face-image or the process of coloration.The color of each pixel in coloured image is by red (R), green (G), blue (B) three components determine, the value range of each component is 1~255.Gray level image is taking for tri- components of R, G, B It is worth a kind of identical special coloured image.
In the embodiment of the present invention, following two methods may be used to carry out gray proces to face-image:
1, the value of the corresponding R, G of each pixel in determining face-image, B component, then determining each picture respectively respectively This average value is determined as R, G of each pixel, the value of B component by the average value of the corresponding R, G of vegetarian refreshments, B component.
For example, the R, G of pixel 1, the value of B component in face-image are respectively 200,180,190, it is determined that pixel 1 R, G, the average value of B component are 190, are determined as R, G of pixel 1, the value of B component by 190.
The component of R, G, B of each pixel in face-image are adjusted to the average value of R, G, B component, then can be incited somebody to action Face-image processing is gray level image.
2, the gray value that image is expressed with brightness value establishes brightness Y according to the variation relation of RGB and YUC color spaces It is corresponding with tri- color components of R, G, B:Y=0.3R+0.59G+0.11B determines the bright of each pixel according to this formula After angle value, the brightness value of each pixel in face-image is modified, then can be gray level image by face-image processing.
In the specific implementation, can carry out gray proces to face-image by function tool obtains the corresponding ash of face-image Image is spent, for example, the library function in can calling the cross-platform computer vision library (OpenCV) for permitting hair style based on BSD is to coloured silk The face-image of color carries out gray proces, to obtain the corresponding gray level image of face-image.
S103 carries out median filter process according to the gray level image and obtains the corresponding filtering image of the gray level image.
In the embodiment of the present invention, median filter process is carried out to gray level image and obtains the corresponding filtering image reality of gray level image Matter is the process for the gray value for changing each pixel in gray level image.Median filtering algorithm is with to each in an image-region Based on the sequence of the gray value of a pixel, the pixel in image-region center is replaced with the Mesophyticum of gray scale in image-region The value of point, wherein the dimension relationship of image-region is in medium filtering coefficient.
For example, medium filtering coefficient is 3*3, then the size of image-region is 3 pixel *, 3 pixels, totally 9 pixels.
It is illustrated below to be illustrated to median filtering algorithm, still by taking medium filtering coefficient is 3*3 as an example, as shown in Fig. 2, Image-region respectively includes 1~pixel of pixel 9, and corresponding gray value distinguishes 220,200,200,200,220,190, 180,210,200, then in these gray values, the intermediate value of gray scale is 200, and the pixel in image-region center is pixel 5, The gray value of pixel 5 is then adjusted to 200 by 220.
The corresponding image-region of medium filtering coefficient is moved in gray level image, changes be in image-region center successively The gray value of pixel then can will be at gray level image so as to change the gray value of each pixel in gray level image Reason is filtering image.
It specifically can be as shown in Figure 3, it is assumed that the size of gray level image is 10*10, is the image of 3*3 with medium filtering coefficient It is moved in gray level image in region.The pixel at the center in image-region can be 12~19,22~29 ..., 82~89, The gray value of pixel 12~19,22~29 ..., 82~89 is sequentially adjusted according to intermediate value principle shown in Fig. 2, then it can be by face Portion's image procossing is filtering image.
Medium filtering coefficient can also have other values, such as can also be 5*5, and 7*7 etc., the embodiment of the present invention does not limit System.Wherein, medium filtering coefficient is bigger, then filter effect is better.
S104 determines the corresponding flaw image of the face-image according to the gray level image and the filtering image.
Specifically, determining that the corresponding flaw image of face-image may include following step according to gray level image and filtering image Suddenly:Calculus of differences is carried out to gray level image and filtering image to handle to obtain the corresponding error image of face-image;To the differential chart The corresponding flaw image of the face-image is obtained as carrying out binary conversion treatment.
In the embodiment of the present invention, to gray level image and filtering image carry out calculus of differences handle to obtain face-image it is corresponding Error image is substantially by the gray scale of the gray value of the pixel in gray level image and the corresponding pixel points in filtering gray level image Value subtracts each other the process so that it is determined that the gray value of corresponding pixel points in error image.It is poor to be carried out to gray level image and filtering image The process that point calculation process obtains the corresponding error image of face-image may include:It determines in gray level image and filtering image respectively Each pixel gray value;The gray value of first pixel and the absolute value of the difference of the gray value of the second pixel is true It is set to the gray value of third pixel, first pixel is the pixel in the gray level image, second pixel Point is the position pixel corresponding with first pixel in the filtering image, and the third pixel is the difference Position pixel corresponding with first pixel in image.
It is above-mentioned that gray level image and filtering image progress calculus of differences are handled to obtain the corresponding error image of face-image Process can be indicated with following formula:
Id(x, y)=|Igray(x,y)-Ifiling(x,y)|X=1,2 ..., M;Y=1,2 ..., N
Wherein, Id(x, y) is the gray value of third pixel, Igray(x, y) is the gray value of the first pixel, Ifiling (x, y) is the gray value of the second pixel.M and N refers to the height and width of face-image, is highly picture with the unit of width Element, such as face-image are the image of 10*10 pixels, then M=10, N=10.The combination of x and y can indicate pixel in image In specific location, for example, as shown in figure 4, establish coordinate-system in the picture, then x is equal to 1 and y=1 and indicates pixel 1 Position in the picture.
Coordinate-system is established in gray level image and in the same fashion in filtering image, then x, y value are identical Igray(x, y) and Ifiling(x, y) is respectively the gray value of the first pixel and the second pixel in corresponding position, for example, Igray(1,2) indicate that the coordinate in gray level image is the gray value of the pixel A of (1,2), Ifiling(1,2) it indicates filtering Coordinate in image is the gray value of the pixel B of (1,2), and pixel B is position pixel corresponding with pixel A.
The gray value for determining the third pixel of each position successively according to above-mentioned formula, then with gray level image or filtering Based on image, the gray value of each pixel in gray level image or filtering image is adjusted to the third pixel of corresponding position The gray value of point, then can obtain the corresponding error image of face-image.
It illustrates below and handles to obtain the corresponding difference of face-image to carry out calculus of differences to gray level image and filtering image Image illustrates, as shown in figure 5, gray level image and filtering image are 10*12 pixels, gray level image a include pixel 1~ Pixel 120, filtering image b include pixel 1'~pixel 120', then the ash of 1~pixel of pixel 120 is determined respectively Angle value, and, pixel 1'~pixel 120'Gray value, due to position of the pixel 1 in gray level image and pixel 1'Position in filtering image is identical, then by the gray value g1 of pixel 1 and pixel 1'Gray value g1'Difference it is exhausted Gray value g1 " is determined as to value;Due to position of the pixel 2 in gray level image and pixel 2'Position in filtering image It is identical, then by the gray value g2 of pixel 2 and pixel 2'Gray value g2'The absolute value of difference be determined as gray value g2 "; Due to position of the pixel 3 in gray level image and pixel 3'Position in filtering image is identical, then by the ash of pixel 3 Angle value g3 and pixel 3'Gray value g3'The absolute value of difference be determined as gray value g3 ";And so on, until by pixel The gray value g120 and pixel 120&apos of point 120;Gray value g120'The absolute value of difference be determined as gray value g120 ";So Afterwards, the gray value of the pixel of gray level image 1 is adjusted to gray value g1 ", the gray value of the pixel 2 of gray level image is adjusted For gray value g2 ", and so on, until the gray value of the pixel 120 of gray level image is adjusted to gray value g120 ", adjust The corresponding error image of gray level image, that is, face-image after gray value.
In the embodiment of the present invention, binary conversion treatment is carried out to error image and obtains the corresponding flaw image tool of the face-image Body may include:Determine that the 4th pixel and the 5th pixel, the 4th pixel are greater than or equal to for gray value in error image The pixel of gray threshold, the 5th pixel are the pixel that gray value is less than gray threshold;By the 4th pixel in error image The gray value of point is adjusted to the first gray value, and the gray value of the 5th pixel is adjusted to the second gray value, forms flaw Image.
Here, the first gray value and the second gray value can the larger gray value of two differences, for example, the first gray value can Think 0, the second gray value can be 255;Alternatively, the first gray value can be 255, the second gray value can be 0;Or First gray value can be 2, and the second gray value can be 254 or 255, etc..
Gray threshold can be a bigger numerical value, such as can be 200~249 in one of numerical value, by In filtering image obtained by median filter process by gray level image, the gray value and gray level image of pixel in filtering image The difference of the pixel of middle corresponding position is larger, illustrates changing greatly for the pixel of the position, then illustrates the pixel and its Neighbouring pixel differs greatly, then the pixel is then higher for the possibility of flaw point.That is, in error image, as The 4th pixel that vegetarian refreshments is more than gray threshold is the possibility higher of flaw point, and is carried out at binaryzation to error image After reason, the gray value of the 4th pixel is adjusted to the first gray value, that is, in flaw image, gray value is the first gray value Pixel is the possibility higher of flaw point.
Optionally, after determining the corresponding flaw image of face-image, the face-image and flaw image, example can be exported Such as, the face-image and flaw image can be shown by display screen.By exporting the face-image and flaw image, Yong Huke To determine the flaw in face-image according to flaw image.
S105 determines the flaw in the face-image by comparing the flaw image and the face-image.
By step S104 it is found that in flaw image, gray value is that the pixel of the first gray value may be flaw point, The as pixel larger with the grey value difference of other pixels, and in face-image, in addition to flaw point and other pixels The gray value of point differs greatly, and the part of the face feature such as eyebrow, eyes on face and others are not belonging to face Part is also larger with the difference of the face skin of face-image, and therefore, it is necessary in the pixel that gray value is the first gray value It excludes to represent the pixel that face feature is not belonging to face with other.
By above-mentioned introduction it is found that comparison flaw image determines that the flaw in face-image is substantially to determine with face-image and looks for To the process of the set of flaw point, can specifically include:Determine that first position is gathered, the first position set includes flaw Gray value in image is equal to position of the pixel of the first gray value in the flaw image;Determine that the second position is gathered, institute It includes position of the image characteristic point for being not belonging to facial characteristics in described image in the face-image to state second position set It sets, and, position of the image characteristic point of face feature in described image is belonged in the face-image;According to described first Location sets and second position set determine that the third place set, the third place set are included in the first position In the set and not position in the second position is gathered;The pixel that target location is in the face-image is true The flaw being set in the face-image, the target location belong to the third place set.
Since gray level image is compared with original face-image, other than the brightness of pixel is different, the figure of gray level image As feature in alternate embodiments, can also pass through comparison with the characteristics of image in the original face-image of accurate feedback Gray level image determines that the flaw in face-image, specific implementation can refer to comparison flaw image and face with flaw image Image determines the process of the flaw in face-image.
In the embodiment of the present invention, gray proces, median filter process, difference fortune are being carried out successively to original face-image After calculating processing and binary conversion treatment, obtained flaw image can reflect the difference of the image after original face-image and beautification It is different, then by comparing original image and flaw image, then in detail and the flaw in face-image can be accurately detected out Defect, so as to realize to the accurate feedback of flaw and processing.
After the flaw during face-image is determined, can targetedly to the flaw in face-image at Reason, to retain the other details in face-image while beautifying picture.It is provided in an embodiment of the present invention referring to Fig. 6, Fig. 6 The flaw of another face-image determines the flow diagram of method, as shown, the method includes:
S201 obtains initial face-image.
S202 carries out gray proces to the face-image and obtains the corresponding gray level image of the face-image.
S203 carries out median filter process according to the gray level image and obtains the corresponding filtering image of the gray level image.
S204 determines the corresponding flaw image of the face-image according to the gray level image and the filtering image.
S205 determines the flaw in the face-image by comparing the flaw image and the face-image.
Here, the specific implementation of step S201~S205 can refer to step S101 in the corresponding embodiments of Fig. 1~ The specific implementation of S105, details are not described herein again.
S206 determines the size of the flaw.
In the embodiment of the present invention, flaw is made of continuous one or more pixel in the picture, the size of flaw Can be characterized with the number for the pixel that the flaw is included, for example, as shown in fig. 7, image be 20*20 pixels, flaw 1 by 1~pixel of pixel 3 forms, and the size of flaw 1 is 3 pixels, flaw 2 by pixel 21, pixel 22, pixel 32, as Vegetarian refreshments 33 forms, then the size of flaw 2 is 4 pixels.
S207, according to the size adjusting medium filtering coefficient of the flaw, the medium filtering coefficient and the size are just It is related.
Flaw only there are one in the case of, can be according to the size adjusting medium filtering coefficient of the flaw;Have in flaw In the case of multiple, it may be determined that the maximum flaw of size in this multiple flaw, then according to the size of the maximum flaw of size Adjust medium filtering coefficient.Wherein, flaw size is bigger, then medium filtering coefficient is bigger, the big little finger of toe of medium filtering coefficient It is the size of the corresponding image-region of medium filtering coefficient.
S208 carries out median filter process to the flaw in the face-image according to the medium filtering coefficient after adjustment and obtains Face-image to after desalination flaw.
In one possible implementation, the corresponding image-region of medium filtering coefficient may be used in face-image Flaw carry out the median filter process of part, i.e. the corresponding image-region of moving median filter coefficient makes in image-region Center is followed successively by each pixel in flaw, so as to adjust the gray value of each pixel in flaw.For example, flaw point packet The pixel contained is pixel 13~16, and pixel 24~27, for the medium filtering coefficient used for 3*3, then it is 9 to make size first The center of the image-region of pixel is pixel 13, and the gray value of pixel 13 is then adjusted according to median filtering algorithm, then, The center of image-region is adjusted to pixel 14 again, the gray value of pixel 14 is adjusted according to median filtering algorithm, is moved successively Motion video region, it is pixel 15,16 and 24~27 to make the center of image-region, so as to adjust pixel 15,16 and 24 ~27 gray value makes the gray value of the pixel in these flaws close to the gray value of its neighbouring pixel, to rise To the effect of desalination flaw.
It is further possible that in realization method, in order to realize better filter effect and make image seem more from So, after the flaw in portion's image carries out local median filter process over there, medium filtering coefficient can also be used corresponding Image-region carries out whole filtering to face-image, wherein the mode integrally filtered to face-image can be right with reference chart 1 The description of step S103 in the embodiment answered, details are not described herein again.
In the embodiment of the present invention, after the flaw during face-image is determined, local median filter process is carried out to flaw, Due to changing the gray value of the pixel in flaw, makes it closer to the gray value of its neighbouring pixel, retaining image Edge while play the role of desalinate flaw;After carrying out local filtering, image is carried out at whole medium filtering Reason, on the one hand, play the role of further desalinating flaw, on the other hand, relative to directly to face-image progress entirety Median filter process, since the gray value of the pixel in flaw is once adjusted excessively so that phase between the gray value of image It is smaller to the adjustment of the amplitude of the gray value of each pixel in entirety to close, so that image is more natural.
In some possible scenes, it can also classify to the flaw detected, so as to clear according to the demand of user Except the flaw of a certain classification.Method is determined referring to the flaw that Fig. 8, Fig. 8 are another face-images provided in an embodiment of the present invention Flow chart, as shown, the method includes:
S301 obtains initial face-image.
S302 carries out gray proces to the face-image and obtains the corresponding gray level image of the face-image.
S303 carries out median filter process according to the gray level image and obtains the corresponding filtering image of the gray level image.
S304 determines the corresponding flaw image of the face-image according to the gray level image and the filtering image.
S305 determines the flaw in the face-image by comparing the flaw image and the face-image.
Here, the specific implementation of step S301~S305 can refer to step S101 in the corresponding embodiments of Fig. 1~ The description of S105, details are not described herein again.
S306 classifies the flaw to obtain the classification of each flaw.
In one possible implementation, can be classified to flaw according to the flaws type such as small pox, spot, mole, In further realize, can also further it be classified to small pox and spot, for example, can powder be further divided into small pox Thorn, acne, tumour etc.;For another example, spot can be further divided into chloasma, sunburn, color spot, freckle etc..
In alternatively possible realization method, can also according to the shade of the size of flaw or flaw to flaw into Row classification.For example, flaw can be divided into big flaw, medium flaw, nibs three by being classified to flaw according to the size of flaw A classification;For another example, flaw can be divided into dark flaw and light flaw by being classified to flaw according to the shade of flaw.
In another possible realization method, the size of flaw, shade, flaw type are can be combined with to flaw Classify.
In the specific implementation, the factors such as position that can be according to the size, shade situation, flaw of flaw in face-image Classify to flaw.
S307 obtains the clearance order of the flaw for target category.
In the embodiment of the present invention, it can be sent out, can be passed through by user for the clearance order of the flaw of target category Several options of the classification of flaw are shown to user, are then selected to determine target category according to user.
For example, classified to flaw according to flaw type, and the classification of flaw respectively includes small pox, spot, three kinds of mole Classification then can show that three kinds of small pox, spot, mole options, user can select at least one from these three options to user Kind classification, determines target category according to the user's choice, for example, user has selected small pox and spot from these three options, Then determine that target category is small pox and spot.
S308 removes the flaw of the target category in the face-image according to the classification of each flaw.
In the specific implementation, can according to the classification of each flaw from all flaws determine target category flaw and Position of the flaw of target category in face-image, then corresponding position in face-image remove the flaw of target category Defect, wherein the mode for removing the flaw of target category can refer in the corresponding embodiments of above-mentioned Fig. 6 and remove all facial defects Mode.
In the embodiment of the present invention, after the flaw on face-image is determined by a series of processing, flaw is divided Class can remove specified flaw when getting the clearance order for being directed to a certain classification according to the classification of flaw, and realization has Pointedly remove flaw.
The device of inventive embodiments is described below in the method that inventive embodiments are described above.
It is a kind of structural representation of the flaw determination device of face-image provided in an embodiment of the present invention referring to Fig. 9, Fig. 9 Figure, as shown, described device 40 includes:
Acquisition module 401, for obtaining initial face-image;
First processing module 402, it is corresponding for obtaining the face-image to face-image progress gray proces Gray level image;
Second processing module 403 obtains the gray level image pair for carrying out median filter process to the gray level image The filtering image answered;
Third processing module 404, for determining the face-image pair according to the gray level image and the filtering image The flaw image answered;
Flaw determining module 405, for by comparing the flaw image and the face-image, determining the face figure Flaw as in.
Optionally, the third processing module 404 includes:
Calculation process submodule handles to obtain institute for carrying out calculus of differences to the gray level image and the filtering image State the corresponding error image of face-image;
Binary conversion treatment submodule obtains the face-image correspondence for carrying out binary conversion treatment to the error image Flaw image.
Optionally, the calculation process submodule is specifically used for:
The gray value of each pixel in the gray level image and the filtering image is determined respectively;
The absolute value of the difference of the gray value of first pixel and the gray value of the second pixel is determined as third pixel The gray value of point, first pixel are the pixel in the gray level image, and second pixel is in the filter Position pixel corresponding with first pixel in wave image, the third pixel be the error image in position with The corresponding pixel of first pixel.
Optionally, the binary conversion treatment submodule is specifically used for:
Determine that the 4th pixel and the 5th pixel, the 4th pixel are more than for gray value in the error image Or the pixel equal to gray threshold, the 5th pixel are the pixel that gray value is less than gray threshold;
The gray value of the 4th pixel is adjusted to the first gray value in the error image, and by the 5th picture The gray value of vegetarian refreshments is adjusted to the second gray value, forms flaw image.
Optionally, the flaw determining module 405 includes:
First set determination sub-module, for determining that first position is gathered, the first position set includes the flaw Gray value in image is equal to position of the pixel of first gray value in the flaw image;
Second set determination sub-module, for determining that the second position is gathered, the second position set includes the face Position of the image characteristic point for being not belonging to facial characteristics in described image in image, and, belong in the face-image Position of the image characteristic point of face feature in described image;
Third set determination sub-module, for determining third according to first position set and second position set Location sets, the third place set are included in the first position set and not in the second position is gathered Position;
Flaw determination sub-module, for the pixel for being in target location in the face-image to be determined as the face Flaw in image, the target location belong to the third place set.
Optionally, described device 40 further includes:
Size determining module 406, the size for determining the flaw;
Filter factor determining module 407, for the size adjusting medium filtering coefficient according to the flaw, the intermediate value filter Wave system number and the size positive correlation;
Fourth processing module 408, for according to the medium filtering coefficient after adjustment to the flaw in the face-image into Row median filter process obtains the face-image after desalination flaw.
Optionally, described device 40 further includes:
Sort module 409 obtains the classification of each flaw for being classified to the flaw;
Clearance order acquisition module 410, the clearance order for obtaining the flaw for target category;
Flaw processing module 411, for removing the mesh according to the classification of each flaw in the face-image Mark the flaw of classification.
Optionally, described device further includes:
Output module 412, for exporting the face-image and the flaw image.
It should be noted that unmentioned content can be found in the description of embodiment of the method in the corresponding embodiments of Fig. 9, here It repeats no more.
In the embodiment of the present invention, the flaw determination device of face-image by carrying out gray scale respectively to original face-image Processing obtains its corresponding gray level image and filtering image with median filter process, and gray level image can reflect original face figure The feature of picture, what filtering image reflected is the situation after beautifying to original face-image, is schemed to gray level image and filtering As the obtained flaw image of processing can reflect the difference of the image after original face-image and beautification, then by by original graph Picture and flaw image are compared, then in detail and can accurately detect out the flaw in face-image, so as to realize pair The accurate feedback of flaw and processing.
It is the composition knot of the flaw determination device of another face-image provided in an embodiment of the present invention referring to Figure 10, Figure 10 Structure schematic diagram, as shown, the device 50 includes processor 501, memory 502 and input/output interface 503.Processor 501 are connected to memory 502 and input/output interface 503, such as processor 501 can be connected to memory 502 by bus With input/output interface 503.
Processor 501 is configured as supporting the face that the flaw determination device of the face-image executes described in Fig. 1-Fig. 8 The flaw of image determines corresponding function in method.The processor 501 can be central processing unit (Central Processing Unit, CPU), network processing unit (Network Processor, NP), hardware chip or its arbitrary combine.Above-mentioned hardware core Piece can be application-specific integrated circuit (Application-Specific Integrated Circuit, ASIC), programmable logic Device (Programmable Logic Device, PLD) or combinations thereof.Above-mentioned PLD can be Complex Programmable Logic Devices (Complex Programmable Logic Device, CPLD), field programmable gate array (Field- Programmable Gate Array, FPGA), Universal Array Logic (Generic Array Logic, GAL) or its arbitrary group It closes.
Memory 502 is for storing program code etc..Memory 502 includes internal storage, and internal storage can wrap It includes at least one of following:Volatile memory (such as dynamic random access memory (DRAM), static state RAM (SRAM), synchronize it is dynamic State RAM (SDRAM) etc.) and nonvolatile memory (such as disposable programmable read only memory (OTPROM), programming ROM (PROM), erasable programmable ROM (EPROM), electrically erasable ROM (EEPROM).Memory 502 can also include outer Portion's memory, external memory may include at least one of following:Hard disk (Hard Disk Drive, HDD) or solid state disk (Solid-State Drive, SSD), flash drive, for example, high density flash memory (CF), secure digital (SD), miniature SD, mini SD, Extreme digital (xD), memory stick etc..
The input/output interface 503 is for input or output data.
Processor 501 can call said program code to execute following operation:
Obtain initial face-image;
Gray proces are carried out to the face-image and obtain the corresponding gray level image of the face-image;
Median filter process is carried out to the gray level image and obtains the corresponding filtering image of the gray level image;
The corresponding flaw image of the face-image is determined according to the gray level image and the filtering image;
By comparing the flaw image and the face-image, the flaw in the face-image is determined.
It should be noted that the realization of each operation can also correspond to the phase of referring to Fig.1-embodiment of the method shown in Fig. 8 It should describe;The processor 501 can be also used for executing other operations in above method embodiment.
The embodiment of the present invention also provides a kind of computer storage media, and the computer storage media is stored with computer journey Sequence, the computer program include program instruction, and described program instruction makes the computer execute such as when executed by a computer Method described in previous embodiment, the computer can be one of the flaw determination device of face-image mentioned above Point.For example, above-mentioned processor 501.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in a computer read/write memory medium In, the program is when being executed, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
The above disclosure is only the preferred embodiments of the present invention, cannot limit the right model of the present invention with this certainly It encloses, therefore equivalent changes made in accordance with the claims of the present invention, is still within the scope of the present invention.

Claims (14)

1. a kind of flaw of face-image determines method, which is characterized in that including:
Obtain initial face-image;
Gray proces are carried out to the face-image and obtain the corresponding gray level image of the face-image;
Median filter process is carried out to the gray level image and obtains the corresponding filtering image of the gray level image;
The corresponding flaw image of the face-image is determined according to the gray level image and the filtering image;
By comparing the flaw image and the face-image, the flaw in the face-image is determined.
2. according to the method described in claim 1, it is characterized in that, described true according to the gray level image and the filtering image Determining the corresponding flaw image of the face-image includes:
Calculus of differences is carried out to the gray level image and the filtering image to handle to obtain the corresponding differential chart of the face-image Picture;
Binary conversion treatment is carried out to the error image and obtains the corresponding flaw image of the face-image.
3. according to the method described in claim 2, it is characterized in that, described carry out the gray level image and the filtering image Calculus of differences handles to obtain the corresponding error image of the face-image:
The gray value of each pixel in the gray level image and the filtering image is determined respectively;
The absolute value of the difference of the gray value of first pixel and the gray value of the second pixel is determined as third pixel Gray value, first pixel are the pixel in the gray level image, and second pixel is to scheme in the filtering The position pixel corresponding with first pixel as in, the third pixel for position in the error image with it is described The corresponding pixel of first pixel.
4. according to the method described in claim 2, it is characterized in that, described obtain error image progress binary conversion treatment The corresponding flaw image of the face-image includes:
Determine that the 4th pixel and the 5th pixel, the 4th pixel are that gray value is more than or waits in the error image In the pixel of gray threshold, the 5th pixel is the pixel that gray value is less than the gray threshold;
The gray value of the 4th pixel is adjusted to the first gray value in the error image, and by the 5th pixel Gray value be adjusted to the second gray value, form flaw image.
5. according to the method described in claim 4, it is characterized in that, described schemed by comparing the flaw image with the face Picture determines that the flaw in the face-image includes:
Determine that first position is gathered, the first position set includes that the gray value in the flaw image is equal to first ash Position of the pixel of angle value in the flaw image;
Determine that the second position is gathered, the second position set includes the image for being not belonging to facial characteristics in the face-image Position of the characteristic point in described image, and, the image characteristic point of face feature is belonged in the face-image in the figure Position as in;
The third place set, the third place set packet are determined according to first position set and second position set Include the first position gather in and not the second position gather in position;
The pixel that target location is in the face-image is determined as the flaw in the face-image, the target position It sets and belongs to the third place set.
6. according to claim 1-5 any one of them methods, which is characterized in that described by comparing the flaw image and institute Face-image is stated, determines that the flaw in the face-image further includes later:
Determine the size of the flaw;
According to the size adjusting medium filtering coefficient of the flaw, the medium filtering coefficient and the size positive correlation;
Median filter process is carried out to the flaw in the face-image according to the medium filtering coefficient after adjustment and obtains the desalination flaw Face-image after defect.
7. according to claim 1-5 any one of them methods, which is characterized in that the flaw in the determination face-image Further include later:
The flaw is classified to obtain the classification of each flaw;
Obtain the clearance order of the flaw for target category;
The flaw of the target category is removed according to the classification of each flaw in the face-image.
8. according to claim 1-5 any one of them methods, which is characterized in that described according to the gray level image and the filter Wave image determines that the corresponding flaw image of the face-image further includes later:
Export the face-image and the flaw image.
9. a kind of flaw determination device of face-image, which is characterized in that including:
Acquisition module, for obtaining initial face-image;
First processing module obtains the corresponding gray-scale map of the face-image for carrying out gray proces to the face-image Picture;
Second processing module obtains the corresponding filtering of the gray level image for carrying out median filter process to the gray level image Image;
Third processing module, for determining the corresponding flaw of the face-image according to the gray level image and the filtering image Image;
Flaw determining module, for by comparing the flaw image and the face-image, determining in the face-image Flaw.
10. device according to claim 9, which is characterized in that the third processing module includes:
Calculation process submodule handles to obtain the face for carrying out calculus of differences to the gray level image and the filtering image The corresponding error image of portion's image;
Binary conversion treatment submodule obtains the corresponding flaw of the face-image for carrying out binary conversion treatment to the error image Defect image.
11. device according to claim 10, which is characterized in that the calculation process submodule is specifically used for:
The gray value of each pixel in the gray level image and the filtering image is determined respectively;
The absolute value of the difference of the gray value of first pixel and the gray value of the second pixel is determined as third pixel Gray value, first pixel are the pixel in the gray level image, and second pixel is to scheme in the filtering The position pixel corresponding with first pixel as in, the third pixel for position in the error image with it is described The corresponding pixel of first pixel.
12. device according to claim 10, which is characterized in that the binary conversion treatment submodule is specifically used for:
Determine that the 4th pixel and the 5th pixel, the 4th pixel are that gray value is more than or waits in the error image In the pixel of gray threshold, the 5th pixel is the pixel that gray value is less than the gray threshold;
The gray value of the 4th pixel is adjusted to the first gray value in the error image, and by the 5th pixel Gray value be adjusted to the second gray value, form flaw image.
13. a kind of flaw determination device of face-image, which is characterized in that connect including processor, memory and input and output Mouthful, the processor, the memory and the input/output interface are connected with each other, wherein the input/output interface is used for Input or output data, the memory are executed for storing program code, the processor for calling said program code Such as claim 1-8 any one of them methods.
14. a kind of computer storage media, which is characterized in that the computer storage media is stored with computer program, described Computer program includes program instruction, and described program instruction makes the computer execute such as claim when executed by a computer 1-8 any one of them methods.
CN201810466683.8A 2018-05-15 2018-05-15 The flaw of face-image determines method and apparatus Pending CN108710848A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810466683.8A CN108710848A (en) 2018-05-15 2018-05-15 The flaw of face-image determines method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810466683.8A CN108710848A (en) 2018-05-15 2018-05-15 The flaw of face-image determines method and apparatus

Publications (1)

Publication Number Publication Date
CN108710848A true CN108710848A (en) 2018-10-26

Family

ID=63868935

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810466683.8A Pending CN108710848A (en) 2018-05-15 2018-05-15 The flaw of face-image determines method and apparatus

Country Status (1)

Country Link
CN (1) CN108710848A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109523527A (en) * 2018-11-12 2019-03-26 北京地平线机器人技术研发有限公司 The detection method in dirty region, device and electronic equipment in image
CN110866488A (en) * 2019-11-13 2020-03-06 维沃移动通信有限公司 Image processing method and device
CN111428552A (en) * 2019-12-31 2020-07-17 深圳数联天下智能科技有限公司 Black eye recognition method and device, computer equipment and storage medium
CN111428553A (en) * 2019-12-31 2020-07-17 深圳数联天下智能科技有限公司 Face pigment spot recognition method and device, computer equipment and storage medium

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103312940A (en) * 2013-06-17 2013-09-18 中国航天科工集团第三研究院第八三五八研究所 Self-adaptive median filter method based on FPGA (filed programmable gate array)

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103312940A (en) * 2013-06-17 2013-09-18 中国航天科工集团第三研究院第八三五八研究所 Self-adaptive median filter method based on FPGA (filed programmable gate array)

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
VLADIMIR CRNOJEVIC ET AL.: "Advanced Impulse Detection Based on Pixel-Wise MAD", 《IEEE》 *
杨倩倩 等: "一种改进的基于中值滤波的睫毛检测方法", 《2015国防无线电&电学计量与测试学术交流会》 *
马学磊 等: "基于噪声点检测的中值滤波方法", 《电子技术》 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109523527A (en) * 2018-11-12 2019-03-26 北京地平线机器人技术研发有限公司 The detection method in dirty region, device and electronic equipment in image
CN110866488A (en) * 2019-11-13 2020-03-06 维沃移动通信有限公司 Image processing method and device
CN111428552A (en) * 2019-12-31 2020-07-17 深圳数联天下智能科技有限公司 Black eye recognition method and device, computer equipment and storage medium
CN111428553A (en) * 2019-12-31 2020-07-17 深圳数联天下智能科技有限公司 Face pigment spot recognition method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108710848A (en) The flaw of face-image determines method and apparatus
CN107808136B (en) Image processing method, image processing device, readable storage medium and computer equipment
CN107800966B (en) Method, apparatus, computer readable storage medium and the electronic equipment of image procossing
US9495582B2 (en) Digital makeup
JP4708909B2 (en) Method, apparatus and program for detecting object of digital image
JP4395789B2 (en) Image processing apparatus, imaging apparatus, image processing method, and program
US9813614B2 (en) Method and system for analog/digital image simplification and stylization
Gerstner et al. Pixelated image abstraction
US11776129B2 (en) Semantic refinement of image regions
CN105979122B (en) Image processing apparatus and image processing method
CN108604293A (en) The device and method for improving picture quality
CN110706174A (en) Image enhancement method, terminal equipment and storage medium
CN107862659A (en) Image processing method, device, computer equipment and computer-readable recording medium
CN108090876A (en) A kind of image processing method and device
CN113822830A (en) Multi-exposure image fusion method based on depth perception enhancement
CN111161281A (en) Face region identification method and device and storage medium
KR102466061B1 (en) Apparatus for denoising using hierarchical generative adversarial network and method thereof
Lecca et al. An image contrast measure based on Retinex principles
Kapah et al. Demosaicking using artificial neural networks
JP5286215B2 (en) Outline extracting apparatus, outline extracting method, and outline extracting program
CN104935805B (en) Image processing apparatus, image processing method and recording medium
CN113781330A (en) Image processing method, device and electronic system
CN105160329B (en) A kind of tooth recognition methods, system and camera terminal based on YUV color spaces
CN113609998A (en) Bottom layer spot detection method, electronic device and readable storage medium
Scott et al. Laplacian based image fusion

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20191028

Address after: 518000, building 10, building ten, building D, Shenzhen Institute of Aerospace Science and technology, 6 hi tech Southern District, Nanshan District, Shenzhen, Guangdong 1003, China

Applicant after: Shenzhen heertai Home Furnishing Online Network Technology Co. Ltd.

Address before: 518000 Shenzhen space science and Technology Innovation Research Institute building D 10 building 1004, Nanshan District hi-tech South ten road, Nanshan District hi-tech South District, Nanshan District

Applicant before: Shenzhen heertai data resources and cloud Technology Co. Ltd.

TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20200413

Address after: 1706, Fangda building, No. 011, Keji South 12th Road, high tech Zone, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen shuliantianxia Intelligent Technology Co., Ltd

Address before: 518000, building 10, building ten, building D, Shenzhen Institute of Aerospace Science and technology, 6 hi tech Southern District, Nanshan District, Shenzhen, Guangdong 1003, China

Applicant before: SHENZHEN H & T HOME ONLINE NETWORK TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20181026

RJ01 Rejection of invention patent application after publication