CN109146774A - A kind of face image processing process towards publicity against drugs - Google Patents

A kind of face image processing process towards publicity against drugs Download PDF

Info

Publication number
CN109146774A
CN109146774A CN201810920791.8A CN201810920791A CN109146774A CN 109146774 A CN109146774 A CN 109146774A CN 201810920791 A CN201810920791 A CN 201810920791A CN 109146774 A CN109146774 A CN 109146774A
Authority
CN
China
Prior art keywords
image
image img
facial
texture
img
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
CN201810920791.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.)
Hohai University Changzhou Campus
Original Assignee
Hohai University Changzhou Campus
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 Hohai University Changzhou Campus filed Critical Hohai University Changzhou Campus
Priority to CN201810920791.8A priority Critical patent/CN109146774A/en
Publication of CN109146774A publication Critical patent/CN109146774A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/0006Affine transformations
    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/0012Context preserving transformation, e.g. by using an importance map

Abstract

The invention discloses a kind of face image processing process towards publicity against drugs, carry out Face datection and face characteristic critical point detection to collected facial image first;The texture feature extraction from drug addict's face-image obtains drug addict's face texture picture;Affine transformation is carried out to facial texture image, image after being converted makes the facial area of face texture image fitting facial image;Image after the transformation and facial image are subjected to graph cut and obtain blending image;Smooth change in location carried out to the face contour of the blending image after graph cut, i.e., face contour deforms, the image that obtains that treated.The present invention takes into account face texture variation and face contour variation by the simulation of realization drug abuse face image variation, keeps simulation effect truer.

Description

A kind of face image processing process towards publicity against drugs
Technical field
The invention belongs to technical field of image processing, and in particular to a kind of face image processing side towards publicity against drugs Method.
Background technique
Now, the seriousness of drug-taking problem is increasingly sharpened, and is not only seriously endangered human health, is induced various diseases, breaks The mental health of residual smoker corrupts social values, and may cause or induce various crimes, threatens unipolitics and stablizes And economic development, serious disaster is brought to smoker, family or even society.
In current publicity against drugs, more single publicity mode is often used, such as carries out special topic lecture, put up sea Report, granting leaflet etc..And mostly using the case of smoker as promotional content, emphasize drugs to harm caused by smoker, by Many senses of participation are not strong, it is also difficult to it is not remote from the life of oneself to experience drug issue.
Summary of the invention
To solve the above problems, the present invention proposes a kind of face image processing process towards publicity against drugs, realizes and take drugs The simulation of face image variation takes into account face texture variation and face contour variation, keeps simulation effect truer.
The present invention adopts the following technical scheme that a kind of face image processing process towards publicity against drugs, specific steps are such as Under:
1) to collected facial image Img1Carry out Face datection and face characteristic critical point detection;
2) from drug addict's face-image Img2Middle texture feature extraction obtains drug addict's face texture picture Img3
3) to facial texture image Img3Carry out affine transformation, image Img after being converted4, make face texture image Img3 It is bonded facial image Img1Facial area;
4) by image Img after the transformation4With facial image Img1It carries out graph cut and obtains blending image Img5
5) to the blending image Img after graph cut5Face contour carry out smooth change in location, i.e., face contour becomes Shape, the image Img that obtains that treated6
Preferably, carrying out Face datection with face characteristic critical point detection specific method is to be based on histograms of oriented gradients The neural network model that feature combination supporting vector machine is built is to facial image Img1Carry out Face datection;It is mentioned using based on gradient The face critical point detection neural network model for rising decision Tree algorithms determines facial image Img1Face characteristic key point position.
Preferably, carrying out affine transformation is specially by face texture image Img3With facial image Img1Target area meter It calculates and obtains affine transformation matrix, then by the face texture image Img3Carry out affine transformation.
Preferably, carrying out graph cut is specially that SeamlessClone function in the library OpenCV is called to pass through Poisson image Blending algorithm carries out graph cut and obtains blending image Img5
Preferably, face contour deformation is carried out specifically, starting point coordinate and coordinate of ground point are determined, according to following formula So that the preimage vegetarian refreshments for changing round constituency around starting point is mobile to target point:
Wherein, vector is represented as pixel coordinate,For starting point coordinate, i.e. coordinate origin,For the seat of preimage vegetarian refreshments Mark,For the pixel coordinate after movement,For coordinate of ground point, and rmaxTo change round constituency radius, i.e. image becomes Change range.
Preferably, the step 1) further includes acquisition facial image Img1With detection face's integrality, specifically:
It opens camera and acquires facial image Img1
Carry out Face datection and face characteristic critical point detection;
When collected user's facial image is previously used, prompt information is exported, the picture is prompted to do drug abuse simulation, It need to re-shoot;
When face is not detected to collected user's facial image, prompt information is exported, prompts that face is not detected, It need to re-shoot;
When detecting collected user's facial image comprising face but face shows imperfect, output prompt letter Breath is prompted to leak out full face, need to be re-shoot.
It invents achieved the utility model has the advantages that the present invention is a kind of face image processing process towards publicity against drugs, realizes The simulation of drug abuse face image variation takes into account face texture variation and face contour variation, keeps simulation effect truer.The present invention True drug addict's case can be used in middle drug abuse face-image, and utilization orientation histogram of gradients algorithm carries out facial feature points detection, Merge the back of source images and target image well while guaranteeing source images gradient information by Poisson Image Fusion Scape accomplishes the seamless fusion of boundary, keeps analog result more true to nature reliable;Treated simulation drug abuse face image to user compared with Strong substitution sense and fright sense, can effectively act as publicity against drugs effect.
Detailed description of the invention
Fig. 1 is the face image processing flow chart of the embodiment of the present invention;
Fig. 2 is the integrity test flow chart of the embodiment of the present invention;
Fig. 3 is the face characteristic key point schematic diagram of the embodiment of the present invention.
Specific embodiment
Below in conjunction with the attached drawing in the present embodiment, the technical solution in the present embodiment is clearly and completely described, Obvious described embodiment is only a part of the embodiments of the present invention, instead of all the embodiments.Based in the present invention Embodiment, those of ordinary skill in the art's every other embodiment obtained under that premise of not paying creative labor, It shall fall within the protection scope of the present invention.
Embodiment 1:
Fig. 1 is the face image processing flow chart of the embodiment of the present invention;A kind of face image processing towards publicity against drugs Method specifically comprises the following steps:
1) photo is shot, to collected facial image Img1Carry out Face datection and face characteristic critical point detection;
2) from drug addict's face-image Img2Middle texture feature extraction obtains drug addict's face texture picture Img3
3) to facial texture image Img3Carry out affine transformation, image Img after being converted4, make face texture image Img3 It is bonded facial image Img1Facial area;
4) by image Img after the transformation4With facial image Img1It carries out graph cut and obtains blending image Img5
5) to the blending image Img after graph cut5Face contour carry out smooth change in location, i.e., face contour becomes Shape, the image Img that obtains that treated6
The Face datection is to be based on histograms of oriented gradients with face characteristic critical point detection specific method The neural network model that (Histogram of Oriented Gradient, HOG) feature combination supporting vector machine is built is to people Face image Img1Face datection is carried out, promotes decision Tree algorithms (Gradient Boosting Decision using based on gradient Tree, GBDT) face critical point detection neural network model determine facial image Img1Face characteristic key point position, it is real Now to the Face datection of individual static images and face characteristic critical point detection;
In one embodiment in the specific implementation, realizing that Face datection and face characteristic key point are examined by third party library It surveys, such as the library dlib.
In one embodiment in the specific implementation, passing through third party software Photoshop from drug addict's face-image Img2 Crucial texture is extracted, the texture texture information of reserved high-frequency gives up the skin background color information of low frequency, obtains drug addict's face texture Picture Img3, specifically:
To drug addict's face-image Img in Photoshop2Using layer mask, retain facial range to be processed, one As blue channel retain mottled grain it is most, retain blue channel in the present embodiment, give up other ranges, protected using high contrast It stays filter to be filtered operation, by the strong optical mode that is set as of figure layer blend options, protrudes the details such as the texture spot of face, Obtain drug addict's face-image Img2Corresponding drug addict's face texture picture Img3
The affine transformation is specially by face texture image Img3With facial image Img1Target area calculate imitated Transformation matrix is penetrated, then by the face texture image Img3Carry out affine transformation;It is called in the library OpenCV in the present embodiment GetAffineTransform function, which calculates, obtains affine transformation matrix, then calls warpAffine function by the facial line Manage image Img3Carry out affine transformation:
By the feature key points in each region of the available face of foregoing description face characteristic critical point detection, the feature is closed Key point has number to indicate specific position, as shown in figure 3, target area is by No. 56, No. 11 and No. 15 face spies in the present embodiment Levy the parallelogram region S that key point determines1(No. 56 and No. 15 is to angular vertexs) and No. 60, No. 7 and No. 3 face characteristics The parallelogram region S that key point determines2(No. 60 and No. 3 is to angular vertexs);Facial texture image Img is detected first3Figure As apex coordinate and facial image Img1S in target area1Corresponding points coordinate, obtain right face affine transformation matrix Mat1, detection Face texture image Img3Image apex coordinate and facial image Img1S in target area2Corresponding points coordinate, obtain left face Affine transformation matrix Mat2;Utilize the radiation transformation matrix Mat1To facial texture image Img3Affine transformation is carried out, is recycled The radiation transformation matrix Mat2To facial texture image Img3Carry out affine transformation, image Img after being converted4, make facial line Manage image Img3It is bonded facial image Img1Facial area;
The graph cut is specially that SeamlessClone function in the library OpenCV is called to pass through Poisson Image Fusion It carries out graph cut and obtains blending image Img5
It usually will appear the series of features such as canthus is sagging, skim under the corners of the mouth, face is very thin after taking drugs, simulate features described above Face contour deformation can make that treated image is more life-like, the face contour deformation is specifically, determine that starting point is sat Mark and coordinate of ground point make the preimage vegetarian refreshments for changing round constituency around starting point mobile to target point according to following formula:
Wherein, vector is represented as pixel coordinate,For starting point coordinate, i.e. coordinate origin,For the seat of preimage vegetarian refreshments Mark,For the pixel coordinate after movement,For coordinate of ground point, and rmaxTo change round constituency radius, i.e. image becomes Change range;
A kind of specific steps of profile deformation in the present embodiment are as follows:
Facial image Img1Feature key points in the distance of No. 3 points and No. 13 points be the wide L of face, the wide L of face is respectively multiplied by pre- If factor alpha1And α2Obtain control point offset l1And variation constituency radius rmax1, l is moved to the left by No. 6 points1Determine starting point, No. 17 points are set as target point, according to above-mentioned realization image from starting point toward the smooth change in target point direction, complete left face Deformation effect:
Similarly, it is moved right l by No. 12 points1It determines starting point, No. 1 point is set as target point, change round constituency radius For rmax1, realize that image from starting point toward the smooth change in target point direction, completes the deformation effect of right face according to above-mentioned formula.
By the wide L of face respectively multiplied by predetermined coefficient α3And α4Obtain control point offset l2With variation circle constituency radius rmax2, L is moved up by No. 42 points2It determines starting point, No. 7 points is set as target point, realize that image is past from starting point according to above-mentioned formula The smooth change in target point direction completes the deformation effect of left eye;
Similarly, l is moved up by No. 47 points2It determines starting point, No. 11 points is set as target point, change round constituency radius For rmax2, realize that image from starting point toward the smooth change in target point direction, completes the deformation effect of right eye according to above-mentioned formula.
By the wide L of face respectively multiplied by predetermined coefficient α5And α6Obtain control point offset l3With variation circle constituency radius rmax3, It is moved right l by No. 61 points3It determines starting point, No. 7 points is set as target point, realize that image is past from starting point according to above-mentioned formula The smooth change in target point direction completes the deformation effect of the left corners of the mouth;
Similarly, l is moved to the left by No. 65 points3It determines starting point, No. 11 points is set as target point, change round constituency radius For rmax2, realize that image, toward the smooth change in target point direction, completes the deformation effect of the right corners of the mouth from starting point according to above-mentioned formula Fruit.
To sum up, facial image Img is utilized1The face characteristic key point information of middle determination, to blending image Img5Middle face into The deformation of row profile with simulate take drugs after the series of features such as canthus is sagging, skim under the corners of the mouth, face is very thin, the figure that obtains that treated As Img6
Embodiment 2:
On the basis of embodiment 1, as shown in Fig. 2, Face datection and face characteristic critical point detection further include acquisition people Face image Img1With detection face's integrality, picture editor (image procossing) is entered back into after meeting condition, is otherwise re-shoot, had Body are as follows:
It opens camera and acquires facial image Img1
Carry out Face datection and face characteristic critical point detection;
When collected user's facial image is previously used, prompt information is exported, the picture is prompted to do drug abuse simulation, It need to re-shoot;
When face is not detected to collected user's facial image, prompt information is exported, prompts that face is not detected, It need to re-shoot;
When detecting collected user's facial image comprising face but face shows imperfect, output prompt letter Breath is prompted to leak out full face, need to be re-shoot.
It should be understood by those ordinary skilled in the art that: the above is only a specific embodiment of the present invention, and It is not used in the limitation present invention, all within the spirits and principles of the present invention, made any modification, equivalent replacement, improve etc., It should be included within protection scope of the present invention.

Claims (6)

1. a kind of face image processing process towards publicity against drugs, which comprises the steps of:
1) to collected facial image Img1Carry out Face datection and face characteristic critical point detection;
2) from drug addict's face-image Img2Middle texture feature extraction obtains drug addict's face texture picture Img3
3) to facial texture image Img3Carry out affine transformation, image Img after being converted4, make face texture image Img3Fitting Facial image Img1Facial area;
4) by image Img after the transformation4With facial image Img1It carries out graph cut and obtains blending image Img5
5) to the blending image Img after graph cut5Face contour carry out smooth change in location, i.e., face contour deforms, and obtains To treated image Img6
2. a kind of face image processing process towards publicity against drugs according to claim 1, which is characterized in that the step Rapid 1) middle progress Face datection is to combine branch based on histograms of oriented gradients feature with face characteristic critical point detection specific method Neural network model that vector machine is built is held to facial image Img1Carry out Face datection;It is calculated using decision tree is promoted based on gradient The face critical point detection neural network model of method determines facial image Img1Face characteristic key point position.
3. a kind of face image processing process towards publicity against drugs according to claim 1, which is characterized in that the step Rapid 3) the middle affine transformation that carries out is specially by face texture image Img3With facial image Img1Target area calculate obtain it is affine Transformation matrix, then by the face texture image Img3Carry out affine transformation.
4. a kind of face image processing process towards publicity against drugs according to claim 1, which is characterized in that the step It is rapid 4) in carry out graph cut be specially call the library OpenCV in SeamlessClone function by Poisson Image Fusion into Row graph cut obtains blending image Img5
5. a kind of face image processing process towards publicity against drugs according to claim 1, which is characterized in that the step Rapid 5) middle progress face contour deformation is specifically, determining starting point coordinate and coordinate of ground point, to originate according to following formula The preimage vegetarian refreshments for changing round constituency around selecting is mobile to target point:
Wherein, vector is represented as pixel coordinate,For starting point coordinate, i.e. coordinate origin,For the coordinate of preimage vegetarian refreshments,For Pixel coordinate after movement,For coordinate of ground point, and rmaxTo change round constituency radius, i.e. image change range.
6. a kind of face image processing process towards publicity against drugs according to claim 1, which is characterized in that the step 1) rapid further includes acquisition facial image Img1With detection face's integrality, specifically:
It opens camera and acquires facial image Img1
Carry out Face datection and face characteristic critical point detection;
When collected user's facial image is previously used, prompt information is exported, prompts the picture to do drug abuse simulation, needs weight New shooting;
When face is not detected to collected user's facial image, prompt information is exported, prompts that face is not detected, needs weight New shooting;
When detecting collected user's facial image comprising face but face shows imperfect, prompt information is exported, Prompt leaks out full face, need to re-shoot.
CN201810920791.8A 2018-08-14 2018-08-14 A kind of face image processing process towards publicity against drugs Pending CN109146774A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810920791.8A CN109146774A (en) 2018-08-14 2018-08-14 A kind of face image processing process towards publicity against drugs

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810920791.8A CN109146774A (en) 2018-08-14 2018-08-14 A kind of face image processing process towards publicity against drugs

Publications (1)

Publication Number Publication Date
CN109146774A true CN109146774A (en) 2019-01-04

Family

ID=64793185

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810920791.8A Pending CN109146774A (en) 2018-08-14 2018-08-14 A kind of face image processing process towards publicity against drugs

Country Status (1)

Country Link
CN (1) CN109146774A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109993067A (en) * 2019-03-07 2019-07-09 北京旷视科技有限公司 Facial key point extracting method, device, computer equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109993067A (en) * 2019-03-07 2019-07-09 北京旷视科技有限公司 Facial key point extracting method, device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN104794693B (en) A kind of portrait optimization method of face key area automatic detection masking-out
CN108319953B (en) Occlusion detection method and device, electronic equipment and the storage medium of target object
CN108805040A (en) It is a kind of that face recognition algorithms are blocked based on piecemeal
CN109344693A (en) A kind of face multizone fusion expression recognition method based on deep learning
CN109146774A (en) A kind of face image processing process towards publicity against drugs
CN106960202A (en) A kind of smiling face's recognition methods merged based on visible ray with infrared image
CN108229458A (en) A kind of intelligent flame recognition methods based on motion detection and multi-feature extraction
CN106980852B (en) Based on Corner Detection and the medicine identifying system matched and its recognition methods
CN109829877A (en) A kind of retinal fundus images cup disc ratio automatic evaluation method
CN106503614A (en) A kind of photo acquisition methods and device
CN107123088A (en) A kind of method of automatic replacing photo background color
CN110580445A (en) Face key point detection method based on GIoU and weighted NMS improvement
CN106779054A (en) A kind of PM2.5 methods of estimation based on Misty Image
CN106503275A (en) The tone color collocation method of chat robots and device
CN109859139A (en) The blood vessel Enhancement Method of colored eye fundus image
Shin et al. Korean sign language recognition based on image and convolution neural network
CN106570447A (en) Face photo sunglass automatic removing method based on gray histogram matching
CN107977618A (en) A kind of face alignment method based on Cascaded Double-layer neutral net
CN111898569A (en) Face identification method based on living body detection
CN109978884B (en) Multi-person image scoring method, system, equipment and medium based on face analysis
CN109712095A (en) A kind of method for beautifying faces that rapid edge retains
CN110322438A (en) The training method and automatic checkout system of the automatic detection model of mycobacterium tuberculosis
CN108470424A (en) A kind of forest safety monitoring system based on characteristics of image
TWI263944B (en) Naked body image detection method
CN206363347U (en) Based on Corner Detection and the medicine identifying system that matches

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