Embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouchedThe specific embodiment stated is used only for explaining the application, rather than the restriction to the application.It also should be noted that in order to justIt illustrate only part relevant with the application rather than entire infrastructure in description, attached drawing.
Fig. 1 is a kind of flow chart of the generation method of sketch provided by the embodiments of the present application, the present embodiment be applicable to byNormal picture generates the situation of corresponding sketch picture, and this method can be performed by the generating means of sketch, which can collectIn the terminal devices such as Cheng Yuru mobile phones, tablet computer.As shown in Figure 1, this method comprises the following steps.
Step 110, the face feature of facial image is obtained.
Wherein, facial image can be the picture for including face, can be the photo that user utilizes terminal device shooting, orPhoto sent by other-end equipment that person is received by social software etc..Face can refer to each position of face, includingEar, eyebrow, eyes, nose and lip, face feature can include face position and face attribute, can under this application sceneTo only focus on the eyebrow in face, eyes, nose and lip, to the feature of ear without considering.Face position can be fiveOfficial is located at the position of face, and face attribute can characterize the type of face.Wherein, the type of face can be with existing classification sideFormula is determined.For example, eyebrow type can include crescent or half moon eyebrow, synophrys, triangle eyebrow, arched eyebrows, slanted eyebrows and straight eyebrows slanting upwards and outwards etc.;Ocular form canWith including peach blossom eye, auspicious phoenix eyes, sleep phoenix eyes, willow leaf eye, apricot eye, fox eye, copper bell eye, longan, slim eye and fawn eye etc.;NoseType can include ultra-narrow nose, narrow nose, middle nose, platyrrhiny and super platyrrhiny etc.;Lip can be included under thin slim, roomy type, the corners of the mouthIncline type, cola type, doll type and cupid's type etc..
In the present embodiment, obtaining the mode of face position can be, using the location algorithm in correlation technique to face intoRow positioning, location algorithm can be supervision descending method (Supervised Descent Method, SDM), active list item model(Active Appearance Model, AAM) algorithm or active shape model (Active Shape Model, ASM) algorithmDeng.The mode for obtaining face attribute can be that the face of facial image are compared with standard form respectively, obtain faceAttribute, wherein, standard form can be the face graphic template made according to the different type of each face.Exemplary, it is rightAfter facial image analysis, the face attribute of acquisition is arched eyebrows, fawn eye, middle nose and cola type lip.
Specifically, it can carry out recognition of face to facial image first to obtain the process of the face feature of facial image,Extraction includes the region of face, and then the face in face are positioned using the location algorithm in correlation technique, obtains fiveOfficial position, subsequently respectively analyzes the type of face, or the face in facial image and standard form are comparedIt is right, face attribute is obtained, so as to obtain the face feature of facial image.
Step 120, facial image is labeled according to face feature.
Wherein, facial image being labeled can mark face feature in facial image.To facial image intoThe mode of the mark of row face position can be, using the location algorithm of correlation technique to the facial feature localization of facial image after, rootThe mark of face position is completed according to the characteristic point of positioning result.The mode being labeled to the face attribute of facial image can be withIt is to be added to the type of each face in corresponding face in the form of a flag respectively.
Step 130, the facial image after mark is inputted to sketch and generates model, obtain the corresponding sketch map of facial imagePiece.
Wherein, sketch generation model includes the model based on machine learning algorithm generation, can be carried out based on sample setThe model that constantly training obtains.Sketch generation model can be the model that normal picture can be converted into sketch picture.SketchPicture can a kind of show the stylized picture of personage by the way of lines.
In the present embodiment, the facial image for carrying out face feature mark is inputted after generating model to sketch, sketch generationModel carries out facial image sketch processing, the corresponding sketch map of generation facial image according to the face feature of facial imagePiece.Under this application scene, the process that facial image is converted into sketch picture by sketch generation model can be, according to default faceEach face region is converted into sketch image by order successively, exemplary, it is assumed that default face order is eyebrow, eyeEyeball, nose and lip, after the facial image input sketch generation model after mark, are first handled eyebrow region, rootBe converted into corresponding sketch image according to eyebrow type, then eyes region handled, subsequently to nose region atReason, is finally handled lip region, so as to obtain the corresponding sketch picture of whole facial image;Alternatively, according to fiveOfficial's feature carries out sketch conversion to each face region at the same time.
Optionally, facial image can be converted into the element of different-style information by the sketch generation model in the present embodimentTrace designs piece.Wherein, stylized information can include common style, cartoon style and distorting mirror style etc..People after by markBefore face image input sketch generation model, user can select stylized information, sketch generation model according to the hobby of oneselfFacial image is converted into by corresponding stylized sketch picture according to the stylized information that user selects.The advantage of doing so is thatThe diversity of sketch picture can be improved.
The technical solution of the present embodiment, obtains the face feature of facial image, then according to face feature to face firstImage is labeled, and is finally inputted the facial image after mark to sketch and is generated model, obtains the corresponding sketch of facial imagePicture, wherein, sketch generation model includes the model based on machine learning algorithm generation.Sketch provided by the embodiments of the present applicationGeneration method, the facial image for carrying out face feature mark is inputted to sketch and generates model, obtains the corresponding element of facial imageTrace designs piece, can improve the convenience of generation sketch.
Optionally, face feature includes face position and face attribute.Facial image is labeled according to face feature,It can also be implemented by following manner:
First, facial image is split according to face position, obtains multiple face subgraphs.
Wherein, the criterion split to facial image can be face sub-picture pack after segmentation containing at least one completeFace.For example, facial image can be divided into respectively comprising six left eye, right eye, Zuo Mei, right eyebrow, nose, lip facesSubgraph, or be divided into respectively comprising three left eyebrow left eye, right eyebrow right eye, nose lip people's face images etc..The present embodimentIn, on the basis of ensureing that everyone face image includes at least one complete face, facial image can be carried out anyThe segmentation of form, does not limit herein.
Specifically, after the face position of facial image is obtained, facial image is split according to face position, is obtainedMultiple face subgraphs.
Then, at least one target person face image is chosen from multiple face subgraphs.
After segmentation is carried out to facial image and obtains multiple face subgraphs, at least one is chosen from multiple face subgraphsA target person face image.Exemplary, it is assumed that facial image is divided into respectively comprising left eye, right eye, Zuo Mei, right eyebrow, noseSon, after six people's face images of lip, choose comprising nose, lip the two face subgraphs as target person face image.
In the present embodiment, choosing the mode of at least one target person face image can be, be chosen according to preset rules, orPerson is chosen according to the manual operation of user.Wherein preset rules can choose the face subgraph or bag for including eyesFace subgraph containing eyebrow or the face subgraph comprising nose etc..It can be that user works as according to itself that user chooses manuallyPreceding operation is intended to be chosen, such as user currently wants that by the regioinvertions comprising lip be sketch image, then can selectFace subgraph comprising lip.
Finally, the target person face image of selection is labeled according to face attribute.
In this implementation, can be according to the mode that face attribute is labeled the target person face image of selection, according toThe attribute for the face that target person face image includes is labeled target person face image.Exemplary, it is assumed that facial imageFace attribute be arched eyebrows, fawn eye, middle nose and cola type lip, if the target person face image chosen is includes left eyeFace subgraph, then be labeled target person face image according to the attribute of eyes, and addition is labeled as " fawn eye ".
Optionally, the facial image after mark is inputted to sketch and generates model, obtain the corresponding sketch map of facial imagePiece, can be implemented by following manner:Target person face image after mark is inputted to sketch and generates model, obtains target faceThe corresponding first sketch picture of subgraph.
In the present embodiment, the target person face image for carrying out face attribute labeling is inputted after generating model to sketch, elementThe attribute for the face that generation model is included according to target person face image is retouched, sketch processing is carried out to target person face image,Generate the corresponding first sketch picture of target person face image.Exemplary, it is assumed that included in the target person face image of selectionTwo face of nose and lip, after the nose of target person face image and lip are carried out face attribute labeling, input sketch lifeInto model, nose and the corresponding sketch image of lip are obtained.
Optionally, after the corresponding first sketch picture of target person face image is obtained, following steps are further included:ByOne sketch picture is merged with remaining face subgraph, obtains the second sketch picture.
Wherein, remaining face subgraph is the face subgraph in addition to target person face image in multiple face subgraphsPicture.Specifically, after the corresponding first sketch picture of target subgraph is obtained, by the first sketch picture and remaining face subgraphMerge, obtain the second sketch picture.Exemplary, it is assumed that facial image is divided into respectively comprising left eyebrow left eye, right eyebrowThree right eye, nose lip people's face images, wherein the face subgraph comprising right eyebrow right eye is chosen for target person face figureAs being converted into sketch picture, by the sketch picture and remaining two people's face image, that is, the face subgraph of left eyebrow left eye is includedPicture and face subgraph comprising nose lip merge, and obtain the second sketch image, and the second sketch picture of acquisition only hasRight eyebrow right eye region is converted into sketch, remaining region also keeps the style of original image.
The technical solution of the present embodiment, first splits facial image according to face position, obtains multiple people's facesImage, then chooses at least one target person face image from multiple face subgraphs, subsequently according to face attribute to choosingThe target person face image taken is labeled, and is subsequently inputted the target person face image after mark to sketch and is generated model,The corresponding first sketch picture of target person face image is obtained, is finally closed the first sketch picture and remaining face subgraphAnd obtain the second sketch picture.The subregion of facial image is converted into sketch image, improves the diversity of sketch conversion.
Optionally, facial image is split according to face position, obtains multiple face subgraphs, following sides can be passed throughFormula is implemented:Split according to the connectivity pair facial image of face position region, obtain multiple face subgraphs.
Wherein, the connectedness in region can be the continuity of face region.Such as:Region where left eyebrow and left eyeThere are connectedness, and connectedness is then not present due to being separated by nose in left eyebrow and right eye region.In the present embodiment, according toThe connectivity pair target facial image segmentation of face position region, is to ensure that face are not divided.
Optionally, at least one target person face image is chosen from multiple face subgraphs, can be real by following mannerApply:At least one target person face image is chosen from multiple face subgraphs, target person face image includes at least oneFace.
Split according to the connectivity pair facial image of face position region, after obtaining multiple face subgraphs, from moreAt least one target person face image is chosen in personal face image so that target person face image includes at least one fiveOfficial.
The technical solution of the present embodiment, splits according to the connectivity pair target facial image of face position region, obtainsTo multiple face subgraphs, at least one target person face image, target person face image are chosen from multiple face subgraphsInclude at least one face.So that including at least one complete face in face subgraph, face can be prevented to be divided,So as to improve the accuracy of sketch conversion.
Fig. 2 is the flow chart of the generation method of another sketch provided by the embodiments of the present application.As shown in Fig. 2, this methodInclude the following steps.
Step 210, human face sketch pictures are obtained, and obtain the face feature of human face sketch pictures.
Wherein, human face sketch pictures can be searched for from network data base and obtained.Obtain human face sketch picturesThe process of face feature can be that recognition of face is carried out to every pictures in human face sketch pictures, utilizes correlation techniqueIn location algorithm the face in face are positioned, obtain face position, then the type of face is analyzed, obtainFace attribute, so as to obtain the face feature of human face sketch pictures.
Step 220, the gray value of each pixel in human face sketch pictures is obtained.
In the present embodiment, obtaining the mode of the gray value of pixel can be, be read using existing picture handling implementAfter human face sketch picture, the corresponding gray matrix of sketch picture is obtained, the ash of each pixel is achieved with from gray matrixAngle value.
Step 230, human face sketch pictures are labeled according to the face feature of human face sketch pictures and gray value,Obtain human face sketch picture sample collection.
In the present embodiment, human face sketch pictures are labeled according to the face feature of human face sketch pictures modeSimilar with the above-mentioned mode being labeled according to face feature to facial image, details are not described herein again.According to gray value to faceThe mode that sketch pictures are labeled can be, by the corresponding gray value mark of each pixel in corresponding pixel.
Step 240, according to human face sketch picture sample collection, preset model is instructed based on setting machine learning algorithmPractice, obtain sketch generation model.
Specifically, after human face sketch picture sample collection is obtained, setting machine is based on using human face sketch picture sample collectionLearning algorithm is trained preset model, preset model is constantly learnt face feature and the pass before pixel gray valueSystem, makes preset model have the ability that facial image is converted into sketch picture, so as to obtain sketch generation model.
Step 250, the face feature of facial image is obtained.
Step 260, facial image is labeled according to face feature.
Step 270, the facial image after mark is inputted to sketch and generates model, obtain the corresponding sketch map of facial imagePiece.
Optionally, human face sketch pictures are obtained, can also be implemented by following manner:According to default style information to peopleFace sketch pictures are classified, and obtain human face sketch picture subset.
Wherein, default style information includes cartoon style, common style and distorting mirror style etc..Specifically, obtainingAfter substantial amounts of human face sketch picture, the style of every sketch picture is analyzed, is then classified to affiliated default styleChange in the corresponding human face sketch picture subset of information.Exemplary, it is assumed that include 1000 sketches in human face sketch picturesPicture, wherein 300 belong to cartoon style, 400 belong to common style, and 300 belong to distorting mirror style.
Optionally, human face sketch pictures are labeled according to the face feature of human face sketch pictures and gray value,Human face sketch picture sample collection is obtained, can be implemented by following manner:According to the face feature and gray scale of human face sketch picturesValue is labeled human face sketch picture subset, obtains human face sketch picture sample subset.
In the present embodiment, human face sketch picture subset is carried out according to the face feature of human face sketch pictures and gray valueThe mode of mark, is labeled human face sketch pictures with above-mentioned face feature and gray value according to human face sketch picturesMode it is similar, details are not described herein again.After obtaining human face sketch picture sample subset, according to human face sketch picture sample subset,Preset model is trained based on setting machine learning algorithm, obtains sketch generation model so that sketch generation model hasGenerate the ability of different-style sketch picture.The advantage of doing so is that the diversity of generation sketch picture can be improved.
The technical solution of the present embodiment, according to the face feature of human face sketch pictures and gray value to human face sketch pictureCollection is labeled, and obtains human face sketch picture sample collection, according to human face sketch picture sample collection, based on setting machine learning algorithmPreset model is trained, obtains sketch generation model.Utilize the human face sketch picture sample set pair preset model after markIt is trained, the accuracy of sketch generation model generation sketch picture can be improved.
Optionally, the facial image after mark is inputted to sketch and generates model, obtain the corresponding element of the facial imageTrace designs piece, can be implemented by following manner:Selection target default style information, the facial image after mark is inputted to sketchModel is generated, obtains the corresponding target default style sketch picture of facial image.
Specifically, after user can select the target default style information of the sketch picture of desired generation, after markFacial image input to sketch generate model, so as to obtain the corresponding target default style sketch map of target facial imagePiece.Exemplary, user selects distorting mirror style, the facial image after mark is inputted after generating model to sketch, so that it may obtainObtain distorting mirror style sketch picture.The advantage of doing so is that user can like selection sketch style according to oneself, so as to carryHigh user experience.
Fig. 3 is the flow chart of the generation method of another sketch provided by the embodiments of the present application.As to above-described embodimentBe explained further, as shown in figure 3, this method comprises the following steps.
Step 301, classified according to default style information to human face sketch pictures, obtain human face sketch pictureCollection.
Step 302, human face sketch picture subset is carried out according to the face feature of human face sketch picture subset and gray valueMark, obtains human face sketch picture sample subset.
Step 303, according to this collection of human face sketch picture appearance, preset model is instructed based on setting machine learning algorithmPractice, obtain sketch generation model.
Step 304, the face feature of facial image is obtained, face feature includes face position and face attribute.
Step 305, facial image is split according to face position, obtains multiple face subgraphs.
Step 306, at least one target person face image is chosen from multiple face subgraphs.
Step 307, the target person face image of selection is labeled according to face attribute.
Step 308, selection target default style information.
Step 309, the target person face image after mark is inputted to sketch and generates model, obtain target person face imageCorresponding stylized first sketch picture.
Step 310, the first sketch picture of stylization is merged with remaining face subgraph, obtains the second sketch mapPiece.
The technical solution of the present embodiment, the target person face image after mark is inputted to sketch and generates model, obtains meshThe corresponding stylized first sketch picture of face subgraph is marked, stylized first sketch picture is carried out with remaining face subgraphMerge, obtain the second sketch picture.Not only the subregion of face picture can be made to be converted into sketch image, part can also be madeSketch image is shown with default style, improves the diversity of sketch picture.
Fig. 4 is a kind of structure diagram of the generating means of sketch provided by the embodiments of the present application.As shown in figure 4, the dressPut including:Face feature acquisition module 410, facial image labeling module 420 and sketch picture acquisition module 430.
Face feature acquisition module 410, for obtaining the face feature of facial image;
Facial image labeling module 420, for being labeled according to the face feature to the facial image;
Sketch picture acquisition module 430, generates model, described in acquisition for inputting the facial image after mark to sketchThe corresponding sketch picture of facial image, wherein, the sketch generation model includes the model based on machine learning algorithm generation.
Optionally, face feature includes face position and face attribute, and facial image labeling module 420, is additionally operable to:
Facial image is split according to face position, obtains multiple face subgraphs;
At least one target person face image is chosen from multiple face subgraphs;
The target person face image of selection is labeled according to face attribute;
Correspondingly, sketch picture acquisition module 430, is additionally operable to:
Target person face image after mark is inputted to sketch and generates model, obtains target person face image corresponding theOne sketch picture.
Optionally, sketch picture acquisition module 430, is additionally operable to:
First sketch picture and remaining face subgraph are merged, obtain the second sketch picture, remaining face subgraphAs being the face subgraph in multiple face subgraphs in addition to target person face image.
Optionally, facial image labeling module 420, is additionally operable to:
Split according to the connectivity pair facial image of face position region, obtain multiple face subgraphs;
At least one target person face image is chosen from multiple face subgraphs, target person face image is included at leastOne face.
Optionally, including:
Human face sketch pictures acquisition module, for obtaining human face sketch pictures, and obtains human face sketch picturesFace feature;
Gray value acquisition module, for obtaining the gray value of each pixel in human face sketch pictures;
Human face sketch picture sample collection acquisition module, for the face feature and gray value pair according to human face sketch picturesHuman face sketch pictures are labeled, and obtain human face sketch picture sample collection;
Sketch generates model acquisition module, for according to human face sketch picture sample collection, based on setting machine learning algorithmPreset model is trained, obtains sketch generation model.
Optionally, human face sketch pictures acquisition module, is additionally operable to:
Classified according to default style information to human face sketch pictures, obtain human face sketch picture subset;Wherein,Default style information includes cartoon style, common style and distorting mirror style;
Correspondingly, human face sketch picture sample collection acquisition module, is additionally operable to:
Human face sketch picture subset is labeled according to the face feature of human face sketch pictures and gray value, obtains peopleFace sketch picture sample set.
Optionally, sketch picture acquisition module 430, is additionally operable to:
Selection target default style information;
Facial image after mark is inputted to sketch and generates model, obtains the corresponding target default style of facial imageSketch picture.
Above device can perform the method that the foregoing all embodiments of the application are provided, and it is corresponding to possess the execution above methodFunction module and beneficial effect.Not ins and outs of detailed description in the present embodiment, reference can be made to the foregoing all implementations of the applicationThe method that example is provided.
Fig. 5 is a kind of structure diagram of terminal device provided by the embodiments of the present application.As shown in figure 5, terminal device 500Including memory 501 and processor 502, wherein processor 502 is used to perform following steps:
Obtain the face feature of facial image;
The facial image is labeled according to the face feature;
Facial image after mark is inputted to sketch and generates model, obtains the corresponding sketch picture of the facial image,Wherein, the sketch generation model includes the model based on machine learning algorithm generation.
Fig. 6 is the structure diagram of another terminal device provided by the embodiments of the present application.As shown in fig. 6, the terminal canWith including:Housing (not shown), memory 601, central processing unit (Central Processing Unit, CPU) 602(also known as processor, hereinafter referred to as CPU), the computer program that is stored on memory 601 and can be run on processor 602,Circuit board (not shown) and power circuit (not shown).The circuit board is placed in the space that the housing surroundsPortion;The CPU602 and the memory 601 are arranged on the circuit board;The power circuit, for for the terminalEach circuit or device power supply;The memory 601, for storing executable program code;The CPU602 is by readingThe executable program code that is stored in memory 601 is stated to run program corresponding with the executable program code.
The terminal further includes:Peripheral Interface 603, RF (Radio Frequency, radio frequency) circuit 605, voicefrequency circuit606th, loudspeaker 611, power management chip 608, input/output (I/O) subsystem 609, touch-screen 612, other input/controlsEquipment 610 and outside port 604, these components are communicated by one or more communication bus or signal wire 607.
It should be understood that graphic terminal 600 is only an example of terminal, and terminal device 600 can be withWith than more or less components shown in figure, two or more components can be combined, or can haveDifferent component configurations.Various parts shown in figure can be including one or more signal processings and/or special integratedHardware, software including circuit are realized in the combination of hardware and software.
Below just it is provided in this embodiment for sketch generation terminal device be described in detail, the terminal device withExemplified by smart mobile phone.
Memory 601, the memory 601 can be accessed by CPU602, Peripheral Interface 603 etc., and the memory 601 canIncluding high-speed random access memory, can also include nonvolatile memory, such as one or more disk memories,Flush memory device or other volatile solid-state parts.
The peripheral hardware that outputs and inputs of equipment can be connected to CPU602 and deposited by Peripheral Interface 603, the Peripheral Interface 603Reservoir 601.
I/O subsystems 609, the I/O subsystems 609 can be by the input/output peripherals in equipment, such as touch-screen 612With other input/control devicess 610, Peripheral Interface 603 is connected to.I/O subsystems 609 can include 6091 He of display controllerFor controlling one or more input controllers 6092 of other input/control devicess 610.Wherein, one or more input controlsDevice 6092 processed receives electric signal from other input/control devicess 610 or sends electric signal to other input/control devicess 610,Other input/control devicess 610 can include physical button (pressing button, rocker buttons etc.), dial, slide switch, behaviourVertical pole, click on roller.What deserves to be explained is input controller 6092 can with it is following any one be connected:Keyboard, infrared port,The instruction equipment of USB interface and such as mouse.
Wherein, according to touch-screen operation principle and transmission information medium classification, touch-screen 612 can be resistance-type,Capacitor induction type, infrared-type or surface acoustic wave type.Classify according to mounting means, touch-screen 612 can be:It is external hanging type, built-inFormula or monoblock type.Classify according to technical principle, touch-screen 612 can be:Vector pressure sensing technology touch-screen, resistive technologies are touchedTouch screen, capacitance technology touch-screen, infrared technology touch-screen or surface acoustic wave technique touch-screen.
Touch-screen 612, the touch-screen 612 are the input interface and output interface between user terminal and user, canUser is shown to depending on output, visual output can include figure, text, icon, video etc..Optionally, touch-screen 612 is by userThe electric signal (electric signal of such as contact surface) triggered on touch screen curtain, is sent to processor 602.
Display controller 6091 in I/O subsystems 609 receives electric signal from touch-screen 612 or is sent out to touch-screen 612Electric signals.Touch-screen 612 detects the contact on touch-screen, and the contact detected is converted to and shown by display controller 6091The interaction of user interface object on touch-screen 612, that is, realize human-computer interaction, the user interface being shown on touch-screen 612Icon that object can be the icon of running game, be networked to corresponding network etc..What deserves to be explained is equipment can also include lightMouse, light mouse is not show the touch sensitive surface visually exported, or the extension of the touch sensitive surface formed by touch-screen.
RF circuits 605, are mainly used for establishing the communication of intelligent sound box and wireless network (i.e. network side), realize intelligent sound boxData receiver and transmission with wireless network.Such as transmitting-receiving short message, Email etc..
Voicefrequency circuit 606, is mainly used for receiving voice data from Peripheral Interface 603, which is converted to telecommunicationsNumber, and the electric signal is sent to loudspeaker 611.
Loudspeaker 611, for the voice signal for receiving intelligent sound box from wireless network by RF circuits 605, is reduced toSound simultaneously plays the sound to user.
Power management chip 608, the hardware for being connected by CPU602, I/O subsystem and Peripheral Interface are poweredAnd power management.
In the present embodiment, central processing unit 602 is used for:
Obtain the face feature of facial image;
The facial image is labeled according to the face feature;
Facial image after mark is inputted to sketch and generates model, obtains the corresponding sketch picture of the facial image,Wherein, the sketch generation model includes the model based on machine learning algorithm generation.
Further, the face feature includes face position and face attribute, it is described according to the face feature to instituteFacial image is stated to be labeled, including:
The facial image is split according to the face position, obtains multiple face subgraphs;
At least one target person face image is chosen from the multiple face subgraph;
The target person face image of selection is labeled according to the face attribute;
Model is generated correspondingly, inputting the facial image after mark to sketch, obtains the corresponding element of the facial imageTrace designs piece, including:
Target person face image after mark is inputted to sketch and generates model, the target person face image is obtained and corresponds toThe first sketch picture.
Further, after the corresponding first sketch picture of the target person face image is obtained, further include:
The first sketch picture and remaining face subgraph are merged, obtain the second sketch picture, it is described remainingFace subgraph is the face subgraph in addition to the target person face image in the multiple face subgraph.
Further, it is described that the facial image is split according to the face position, obtain multiple face subgraphsPicture, including:
Split according to facial image described in the connectivity pair of the face position region, obtain multiple face subgraphsPicture;
It is described to choose at least one target person face image from the multiple face subgraph, including:
At least one target person face image is chosen from the multiple face subgraph, in the target person face imageIncluding at least one face.
Further, before the face feature of facial image is obtained, including:
Human face sketch pictures are obtained, and obtain the face feature of the human face sketch pictures;
Obtain the gray value of each pixel in the human face sketch pictures;
The human face sketch pictures are carried out according to the face feature of the human face sketch pictures and the gray valueMark, obtains human face sketch picture sample collection;
According to the human face sketch picture sample collection, preset model is trained based on setting machine learning algorithm, is obtainedObtain sketch generation model.
Further, the acquisition human face sketch pictures include:
Classified according to default style information to the human face sketch pictures, obtain human face sketch picture subset;Wherein, the default style information includes cartoon style, common style and distorting mirror style;
Correspondingly, according to the face feature of the human face sketch pictures and the gray value to the human face sketch pictureCollection is labeled, and obtains human face sketch picture sample collection, including:
According to the face feature of the human face sketch pictures and the gray value to the human face sketch picture subset intoRower is noted, and obtains human face sketch picture sample subset.
Further, the facial image by after mark inputs to sketch and generates model, obtains the facial image pairThe sketch picture answered, including:
Selection target default style information;
Facial image after mark is inputted to sketch and generates model, the corresponding target of the facial image is obtained and presets windFormat sketch picture.
The embodiment of the present application also provides a kind of storage medium for including terminal device executable instruction, and the terminal device canExecute instruction by terminal device processor when being performed for performing a kind of generation method of sketch.
The computer-readable storage medium of the embodiment of the present application, can use any of one or more computer-readable mediaCombination.Computer-readable medium can be computer-readable signal media or computer-readable recording medium.It is computer-readableStorage medium for example may be-but not limited to-the system of electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, device orDevice, or any combination above.The more specifically example (non exhaustive list) of computer-readable recording medium includes:ToolThere are the electrical connections of one or more conducting wires, portable computer diskette, hard disk, random access memory (RAM), read-only storage(ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disc read-only storage (CD-ROM), light storage device, magnetic memory device or above-mentioned any appropriate combination.In this document, computer-readable storageMedium can be any includes or the tangible medium of storage program, the program can be commanded execution system, device or deviceUsing or it is in connection.
Computer-readable signal media can include in a base band or as carrier wave a part propagation data-signal,Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimitedIn electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer canAny computer-readable medium beyond storage medium is read, which, which can send, propagates or transmit, is used forBy instruction execution system, device either device use or program in connection.
The program code included on computer-readable medium can be transmitted with any appropriate medium, including --- but it is unlimitedIn wireless, electric wire, optical cable, RF etc., or above-mentioned any appropriate combination.
Can with one or more programming languages or its combination come write for perform the application operation computerProgram code, programming language include object oriented program language-such as Java, Smalltalk, C++, also wrapInclude conventional procedural programming language-such as " C " language or similar programming language.Program code can be completeGround is performed, partly performed on the user computer on the user computer, the software kit independent as one performs, partly existsPart performs or is performed completely on remote computer or server on the remote computer on subscriber computer.It is being related toIn the situation of remote computer, remote computer can pass through the network of any kind --- including LAN (LAN) or wide areaNet (WAN)-be connected to subscriber computer, or, it may be connected to outer computer (such as utilize ISPTo pass through Internet connection).
Certainly, a kind of storage medium for including computer executable instructions that the embodiment of the present application is provided, its computerThe generation operation for the sketch that executable instruction is not limited to the described above, can also carry out the element that the application any embodiment is providedRelevant operation in the generation method retouched.
Note that it above are only preferred embodiment and the institute's application technology principle of the application.It will be appreciated by those skilled in the art thatThe application is not limited to specific embodiment described here, can carry out for a person skilled in the art various obvious changes,The protection domain readjusted and substituted without departing from the application.Therefore, although being carried out by above example to the applicationIt is described in further detail, but the application is not limited only to above example, in the case where not departing from the application design, alsoIt can include other more equivalent embodiments, and scope of the present application is determined by scope of the appended claims.