CN107967667A - Generation method, device, terminal device and the storage medium of sketch - Google Patents

Generation method, device, terminal device and the storage medium of sketch Download PDF

Info

Publication number
CN107967667A
CN107967667A CN201711392583.7A CN201711392583A CN107967667A CN 107967667 A CN107967667 A CN 107967667A CN 201711392583 A CN201711392583 A CN 201711392583A CN 107967667 A CN107967667 A CN 107967667A
Authority
CN
China
Prior art keywords
face
sketch
facial image
picture
image
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
CN201711392583.7A
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711392583.7A priority Critical patent/CN107967667A/en
Publication of CN107967667A publication Critical patent/CN107967667A/en
Pending legal-status Critical Current

Links

Classifications

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

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The embodiment of the present application discloses a kind of generation method of sketch, device, terminal device and storage medium.This method includes: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.The generation method of sketch provided by the embodiments of the present application, the facial image for carrying out face feature mark is inputted to sketch and generates model, obtains the corresponding sketch picture of facial image, can improve the convenience of generation sketch.

Description

Generation method, device, terminal device and the storage medium of sketch
Technical field
The invention relates to technical field of image processing, more particularly to a kind of generation method of sketch, device, terminal Equipment and storage medium.
Background technology
With the development of mobile communication technology and the popularization of intelligent terminal, intelligent mobile terminal has become people's life One of indispensable instrument in work.Terminal device not only has the function of to take pictures, and also has the function of picture processing, for example, Picture is converted into the picture of the different-styles such as cartoon, ink and wash.
Sketch is one kind of image stylization, and real-life sketch is showed mainly using pencil as instrument with lines Personage or the art form of landscape.If user want obtain sketch picture, it is necessary to specialty personage manually complete, not only into This height, and it is extremely inconvenient.
The content of the invention
The embodiment of the present application provides a kind of generation method of sketch, device, terminal device and storage medium, can improve element Trace designs the convenience that piece generates.
In a first aspect, the embodiment of the present application provides a kind of generation method of sketch, this method includes:
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.
Second aspect, the embodiment of the present application additionally provide a kind of generating means of sketch, which includes:
Face feature acquisition module, for obtaining the face feature of facial image;
Facial image labeling module, for being labeled according to the face feature to the facial image;
Sketch picture acquisition module, generating model for inputting the facial image after mark to sketch, obtaining the people The corresponding sketch picture of face image, wherein, the sketch generation model includes the model based on machine learning algorithm generation.
The third aspect, the embodiment of the present application additionally provide a kind of terminal device, including:Processor, memory and storage On a memory and the computer program that can run on a processor, the processor are realized such as when performing the computer program Generation method described in first aspect.
Fourth aspect, the embodiment of the present application additionally provide a kind of storage medium, are stored thereon with computer program, the program Generation method as described in relation to the first aspect is realized when being executed by processor.
The embodiment of the present application, first obtain facial image face feature, then according to face feature to facial image into Rower is noted, and is finally inputted the facial image after mark to sketch and is generated model, obtains the corresponding sketch picture of facial image, its In, sketch generation model includes the model based on machine learning algorithm generation.The generation side of sketch provided by the embodiments of the present application Method, the facial image for carrying out face feature mark is inputted to sketch and generates model, obtains the corresponding sketch picture of facial image, The convenience of generation sketch can be improved.
Brief description of the drawings
Fig. 1 is a kind of flow chart of the generation method of sketch in the embodiment of the present application;
Fig. 2 is the flow chart of the generation method of another sketch in the embodiment of the present application;
Fig. 3 is the flow chart of the generation method of another sketch in the embodiment of the present application;
Fig. 4 is a kind of structure diagram of the generating means of sketch in the embodiment of the present application;
Fig. 5 is a kind of structure diagram of terminal device in the embodiment of the present application;
Fig. 6 is the structure diagram of another terminal device in the embodiment of the present application.
Embodiment
The application is described in further detail with reference to the accompanying drawings and examples.It is understood that this place is retouched The 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 just It 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 by Normal picture generates the situation of corresponding sketch picture, and this method can be performed by the generating means of sketch, which can collect In 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, or Photo sent by other-end equipment that person is received by social software etc..Face can refer to each position of face, including Ear, eyebrow, eyes, nose and lip, face feature can include face position and face attribute, can under this application scene To only focus on the eyebrow in face, eyes, nose and lip, to the feature of ear without considering.Face position can be five Official 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 side Formula 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 can With 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.;Nose Type 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 mouth Incline 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 into Row 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) algorithm Deng.The mode for obtaining face attribute can be that the face of facial image are compared with standard form respectively, obtain face Attribute, wherein, standard form can be the face graphic template made according to the different type of each face.Exemplary, it is right After 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 five Official position, subsequently respectively analyzes the type of face, or the face in facial image and standard form are compared It 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 into The 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, root The 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 with It 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 image Piece.
Wherein, sketch generation model includes the model based on machine learning algorithm generation, can be carried out based on sample set The model that constantly training obtains.Sketch generation model can be the model that normal picture can be converted into sketch picture.Sketch Picture 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 generation Model carries out facial image sketch processing, the corresponding sketch map of generation facial image according to the face feature of facial image Piece.Under this application scene, the process that facial image is converted into sketch picture by sketch generation model can be, according to default face Each face region is converted into sketch image by order successively, exemplary, it is assumed that default face order is eyebrow, eye Eyeball, nose and lip, after the facial image input sketch generation model after mark, are first handled eyebrow region, root Be converted into corresponding sketch image according to eyebrow type, then eyes region handled, subsequently to nose region at Reason, is finally handled lip region, so as to obtain the corresponding sketch picture of whole facial image;Alternatively, according to five Official'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 embodiment Trace designs piece.Wherein, stylized information can include common style, cartoon style and distorting mirror style etc..People after by mark Before face image input sketch generation model, user can select stylized information, sketch generation model according to the hobby of oneself Facial image is converted into by corresponding stylized sketch picture according to the stylized information that user selects.The advantage of doing so is that The 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 first Image is labeled, and is finally inputted the facial image after mark to sketch and is generated model, obtains the corresponding sketch of facial image Picture, wherein, sketch generation model includes the model based on machine learning algorithm generation.Sketch provided by the embodiments of the present application Generation method, the facial image for carrying out face feature mark is inputted to sketch and generates model, obtains the corresponding element of facial image Trace 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 complete Face.For example, facial image can be divided into respectively comprising six left eye, right eye, Zuo Mei, right eyebrow, nose, lip faces Subgraph, or be divided into respectively comprising three left eyebrow left eye, right eyebrow right eye, nose lip people's face images etc..The present embodiment In, on the basis of ensureing that everyone face image includes at least one complete face, facial image can be carried out any The 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 obtained Multiple 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 subgraphs A target person face image.Exemplary, it is assumed that facial image is divided into respectively comprising left eye, right eye, Zuo Mei, right eyebrow, nose Son, 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, or Person is chosen according to the manual operation of user.Wherein preset rules can choose the face subgraph or bag for including eyes Face subgraph containing eyebrow or the face subgraph comprising nose etc..It can be that user works as according to itself that user chooses manually Preceding operation is intended to be chosen, such as user currently wants that by the regioinvertions comprising lip be sketch image, then can select Face 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 to The attribute for the face that target person face image includes is labeled target person face image.Exemplary, it is assumed that facial image Face attribute be arched eyebrows, fawn eye, middle nose and cola type lip, if the target person face image chosen is includes left eye Face 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 image Piece, can be implemented by following manner:Target person face image after mark is inputted to sketch and generates model, obtains target face The 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, element The 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 selection Two face of nose and lip, after the nose of target person face image and lip are carried out face attribute labeling, input sketch life Into 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:By One 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 subgraphs Picture.Specifically, after the corresponding first sketch picture of target subgraph is obtained, by the first sketch picture and remaining face subgraph Merge, obtain the second sketch picture.Exemplary, it is assumed that facial image is divided into respectively comprising left eyebrow left eye, right eyebrow Three right eye, nose lip people's face images, wherein the face subgraph comprising right eyebrow right eye is chosen for target person face figure As 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 included Picture and face subgraph comprising nose lip merge, and obtain the second sketch image, and the second sketch picture of acquisition only has Right 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 faces Image, then chooses at least one target person face image from multiple face subgraphs, subsequently according to face attribute to choosing The 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 subgraph And 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 through Formula 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 eye There 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 to The 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 manner Apply:At least one target person face image is chosen from multiple face subgraphs, target person face image includes at least one Face.
Split according to the connectivity pair facial image of face position region, after obtaining multiple face subgraphs, from more At least one target person face image is chosen in personal face image so that target person face image includes at least one five Official.
The technical solution of the present embodiment, splits according to the connectivity pair target facial image of face position region, obtains To multiple face subgraphs, at least one target person face image, target person face image are chosen from multiple face subgraphs Include 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 method Include 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 pictures The process of face feature can be that recognition of face is carried out to every pictures in human face sketch pictures, utilizes correlation technique In location algorithm the face in face are positioned, obtain face position, then the type of face is analyzed, obtain Face 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 implement After human face sketch picture, the corresponding gray matrix of sketch picture is obtained, the ash of each pixel is achieved with from gray matrix Angle 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 mode Similar 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 face The 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 algorithm Practice, 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 collection Learning algorithm is trained preset model, preset model is constantly learnt face feature and the pass before pixel gray value System, 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 image Piece.
Optionally, human face sketch pictures are obtained, can also be implemented by following manner:According to default style information to people Face 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, obtaining After substantial amounts of human face sketch picture, the style of every sketch picture is analyzed, is then classified to affiliated default style Change in the corresponding human face sketch picture subset of information.Exemplary, it is assumed that include 1000 sketches in human face sketch pictures Picture, 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 pictures Value 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 value The mode of mark, is labeled human face sketch pictures with above-mentioned face feature and gray value according to human face sketch pictures Mode 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 has Generate 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 picture Collection is labeled, and obtains human face sketch picture sample collection, according to human face sketch picture sample collection, based on setting machine learning algorithm Preset model is trained, obtains sketch generation model.Utilize the human face sketch picture sample set pair preset model after mark It 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 image Trace designs piece, can be implemented by following manner:Selection target default style information, the facial image after mark is inputted to sketch Model 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 mark Facial image input to sketch generate model, so as to obtain the corresponding target default style sketch map of target facial image Piece.Exemplary, user selects distorting mirror style, the facial image after mark is inputted after generating model to sketch, so that it may obtain Obtain distorting mirror style sketch picture.The advantage of doing so is that user can like selection sketch style according to oneself, so as to carry High 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 embodiment Be 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 picture Collection.
Step 302, human face sketch picture subset is carried out according to the face feature of human face sketch picture subset and gray value Mark, 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 algorithm Practice, 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 image Corresponding stylized first sketch picture.
Step 310, the first sketch picture of stylization is merged with remaining face subgraph, obtains the second sketch map Piece.
The technical solution of the present embodiment, the target person face image after mark is inputted to sketch and generates model, obtains mesh The corresponding stylized first sketch picture of face subgraph is marked, stylized first sketch picture is carried out with remaining face subgraph Merge, 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 made Sketch 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 dress Put 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 sketch The 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 the One 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 subgraph As 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 least One face.
Optionally, including:
Human face sketch pictures acquisition module, for obtaining human face sketch pictures, and obtains human face sketch pictures Face 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 pictures Human 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 algorithm Preset 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 people Face 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 image Sketch 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 method Function 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 application The 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 500 Including 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 can With 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 surrounds Portion;The CPU602 and the memory 601 are arranged on the circuit board;The power circuit, for for the terminal Each circuit or device power supply;The memory 601, for storing executable program code;The CPU602 is by reading The 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 circuit 606th, loudspeaker 611, power management chip 608, input/output (I/O) subsystem 609, touch-screen 612, other input/controls Equipment 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 with With than more or less components shown in figure, two or more components can be combined, or can have Different component configurations.Various parts shown in figure can be including one or more signal processings and/or special integrated Hardware, 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 with Exemplified by smart mobile phone.
Memory 601, the memory 601 can be accessed by CPU602, Peripheral Interface 603 etc., and the memory 601 can Including 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 603 Reservoir 601.
I/O subsystems 609, the I/O subsystems 609 can be by the input/output peripherals in equipment, such as touch-screen 612 With other input/control devicess 610, Peripheral Interface 603 is connected to.I/O subsystems 609 can include 6091 He of display controller For controlling one or more input controllers 6092 of other input/control devicess 610.Wherein, one or more input controls Device 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, behaviour Vertical 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-in Formula or monoblock type.Classify according to technical principle, touch-screen 612 can be:Vector pressure sensing technology touch-screen, resistive technologies are touched Touch 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, can User is shown to depending on output, visual output can include figure, text, icon, video etc..Optionally, touch-screen 612 is by user The 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 612 Electric signals.Touch-screen 612 detects the contact on touch-screen, and the contact detected is converted to and shown by display controller 6091 The interaction of user interface object on touch-screen 612, that is, realize human-computer interaction, the user interface being shown on touch-screen 612 Icon 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 light Mouse, 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 box Data 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 telecommunications Number, 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 to Sound simultaneously plays the sound to user.
Power management chip 608, the hardware for being connected by CPU602, I/O subsystem and Peripheral Interface are powered And 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 institute Facial 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 image Trace 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 to The 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 remaining Face 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 subgraphs Picture, including:
Split according to facial image described in the connectivity pair of the face position region, obtain multiple face subgraphs Picture;
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 image Including 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 value Mark, 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 obtained Obtain 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 picture Collection 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 into Rower 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 pair The 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 wind Format 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 can Execute 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 media Combination.Computer-readable medium can be computer-readable signal media or computer-readable recording medium.It is computer-readable Storage medium for example may be-but not limited to-the system of electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, device or Device, or any combination above.The more specifically example (non exhaustive list) of computer-readable recording medium includes:Tool There 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 storage Medium can be any includes or the tangible medium of storage program, the program can be commanded execution system, device or device Using 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 unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium beyond storage medium is read, which, which can send, propagates or transmit, is used for By 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 unlimited In 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 computer Program code, programming language include object oriented program language-such as Java, Smalltalk, C++, also wrap Include conventional procedural programming language-such as " C " language or similar programming language.Program code can be complete Ground is performed, partly performed on the user computer on the user computer, the software kit independent as one performs, partly exists Part performs or is performed completely on remote computer or server on the remote computer on subscriber computer.It is being related to In the situation of remote computer, remote computer can pass through the network of any kind --- including LAN (LAN) or wide area Net (WAN)-be connected to subscriber computer, or, it may be connected to outer computer (such as utilize ISP To 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 computer The 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 provided Relevant 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 that The 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 application It 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, also It can include other more equivalent embodiments, and scope of the present application is determined by scope of the appended claims.

Claims (10)

  1. A kind of 1. generation method of sketch, it is characterised in that including:
    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.
  2. 2. generation method according to claim 1, it is characterised in that the face feature includes face position and face category Property, it is described that the facial image is labeled according to the face feature, 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 sketch map of the facial image Piece, including:
    Target person face image after mark is inputted to sketch and generates model, obtains the target person face image corresponding the One sketch picture.
  3. 3. generation method according to claim 2, it is characterised in that obtaining the target person face image corresponding the After one sketch picture, further include:
    The first sketch picture and remaining face subgraph are merged, obtain the second sketch picture, remaining described face Subgraph is the face subgraph in addition to the target person face image in the multiple face subgraph.
  4. 4. generation method according to claim 2, it is characterised in that it is described according to the face position to the face figure As being split, multiple face subgraphs are obtained, including:
    Split according to facial image described in the connectivity pair of the face position region, obtain multiple face subgraphs Picture;
    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, the target person face image includes At least one face.
  5. 5. generation method according to claim 1, it is characterised in that before the face feature of facial image is obtained, bag Include:
    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 labeled according to the face feature of the human face sketch pictures and the gray value, Obtain 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, obtains element Retouch generation model.
  6. 6. generation method according to claim 5, it is characterised in that 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 pictures into Rower is noted, 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 into rower Note, obtains human face sketch picture sample subset.
  7. 7. generation method according to claim 6, it is characterised in that the facial image by after mark is inputted to sketch Model is generated, obtains the corresponding sketch picture of the facial image, including:
    Selection target default style information;
    Facial image after mark is inputted to sketch and generates model, obtains the corresponding target default style of the facial image Sketch picture.
  8. A kind of 8. generating means of sketch, it is characterised in that including:
    Face feature acquisition module, for obtaining the face feature of facial image;
    Facial image labeling module, for being labeled according to the face feature to the facial image;
    Sketch picture acquisition module, generating model for inputting the facial image after mark to sketch, obtaining the face figure As corresponding sketch picture, wherein, the sketch generation model includes the model based on machine learning algorithm generation.
  9. A kind of 9. terminal device, it is characterised in that including:Processor, memory and storage on a memory and can handled The computer program run on device, the processor are realized such as any one of claim 1-7 when performing the computer program The generation method.
  10. 10. a kind of storage medium, is stored thereon with computer program, it is characterised in that the program is realized when being executed by processor Generation method as described in any in claim 1-7.
CN201711392583.7A 2017-12-21 2017-12-21 Generation method, device, terminal device and the storage medium of sketch Pending CN107967667A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711392583.7A CN107967667A (en) 2017-12-21 2017-12-21 Generation method, device, terminal device and the storage medium of sketch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711392583.7A CN107967667A (en) 2017-12-21 2017-12-21 Generation method, device, terminal device and the storage medium of sketch

Publications (1)

Publication Number Publication Date
CN107967667A true CN107967667A (en) 2018-04-27

Family

ID=61994335

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711392583.7A Pending CN107967667A (en) 2017-12-21 2017-12-21 Generation method, device, terminal device and the storage medium of sketch

Country Status (1)

Country Link
CN (1) CN107967667A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109785439A (en) * 2018-12-27 2019-05-21 深圳云天励飞技术有限公司 Human face sketch image generating method and Related product
CN109816746A (en) * 2018-12-27 2019-05-28 深圳云天励飞技术有限公司 Sketch image generation method and Related product
CN112995534A (en) * 2021-02-05 2021-06-18 北京字跳网络技术有限公司 Video generation method, device, equipment and readable storage medium
CN113129208A (en) * 2019-12-31 2021-07-16 深圳云天励飞技术有限公司 Human face image generation method based on sketch and related product

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070036429A1 (en) * 2005-08-09 2007-02-15 Fuji Photo Film Co., Ltd. Method, apparatus, and program for object detection in digital image
CN1971615A (en) * 2006-11-10 2007-05-30 中国科学院计算技术研究所 Method for generating cartoon portrait based on photo of human face
CN102194131A (en) * 2011-06-01 2011-09-21 华南理工大学 Fast human face recognition method based on geometric proportion characteristic of five sense organs
CN102609964A (en) * 2012-01-17 2012-07-25 湖北莲花山计算机视觉和信息科学研究院 Portrait paper-cut generation method
CN102682420A (en) * 2012-03-31 2012-09-19 北京百舜华年文化传播有限公司 Method and device for converting real character image to cartoon-style image
CN104091174A (en) * 2014-07-13 2014-10-08 西安电子科技大学 Portrait style classification method based on support vector machine
CN104123741A (en) * 2014-06-24 2014-10-29 小米科技有限责任公司 Method and device for generating human face sketch
CN105279186A (en) * 2014-07-17 2016-01-27 腾讯科技(深圳)有限公司 Image processing method and system
CN105335990A (en) * 2014-06-05 2016-02-17 腾讯科技(深圳)有限公司 Human portrait material image generation method and apparatus
CN105654420A (en) * 2015-12-21 2016-06-08 小米科技有限责任公司 Face image processing method and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070036429A1 (en) * 2005-08-09 2007-02-15 Fuji Photo Film Co., Ltd. Method, apparatus, and program for object detection in digital image
CN1971615A (en) * 2006-11-10 2007-05-30 中国科学院计算技术研究所 Method for generating cartoon portrait based on photo of human face
CN102194131A (en) * 2011-06-01 2011-09-21 华南理工大学 Fast human face recognition method based on geometric proportion characteristic of five sense organs
CN102609964A (en) * 2012-01-17 2012-07-25 湖北莲花山计算机视觉和信息科学研究院 Portrait paper-cut generation method
CN102682420A (en) * 2012-03-31 2012-09-19 北京百舜华年文化传播有限公司 Method and device for converting real character image to cartoon-style image
CN105335990A (en) * 2014-06-05 2016-02-17 腾讯科技(深圳)有限公司 Human portrait material image generation method and apparatus
CN104123741A (en) * 2014-06-24 2014-10-29 小米科技有限责任公司 Method and device for generating human face sketch
CN104091174A (en) * 2014-07-13 2014-10-08 西安电子科技大学 Portrait style classification method based on support vector machine
CN105279186A (en) * 2014-07-17 2016-01-27 腾讯科技(深圳)有限公司 Image processing method and system
CN105654420A (en) * 2015-12-21 2016-06-08 小米科技有限责任公司 Face image processing method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
PAUL C. CONILIONE ;DIANHUI WANG: "Automatic localization and annotation of facial features using machine learning techniques", 《SOFT COMPUTING》 *
华博,李帅,湛永松: "基于相关分析的肖像素描漫画生成系统", 《计算机应用与软件》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109785439A (en) * 2018-12-27 2019-05-21 深圳云天励飞技术有限公司 Human face sketch image generating method and Related product
CN109816746A (en) * 2018-12-27 2019-05-28 深圳云天励飞技术有限公司 Sketch image generation method and Related product
CN109785439B (en) * 2018-12-27 2023-08-01 深圳云天励飞技术有限公司 Face sketch image generation method and related products
CN113129208A (en) * 2019-12-31 2021-07-16 深圳云天励飞技术有限公司 Human face image generation method based on sketch and related product
CN113129208B (en) * 2019-12-31 2024-03-26 深圳云天励飞技术有限公司 Sketch-based face image generation method and related products
CN112995534A (en) * 2021-02-05 2021-06-18 北京字跳网络技术有限公司 Video generation method, device, equipment and readable storage medium
CN112995534B (en) * 2021-02-05 2023-01-24 北京字跳网络技术有限公司 Video generation method, device, equipment and readable storage medium

Similar Documents

Publication Publication Date Title
US11798246B2 (en) Electronic device for generating image including 3D avatar reflecting face motion through 3D avatar corresponding to face and method of operating same
CN108833818B (en) Video recording method, device, terminal and storage medium
CN105830422B (en) Foldable electronic and its interface alternation method
CN105229673B (en) Apparatus and associated method
EP2720126B1 (en) Method and apparatus for generating task recommendation icon in a mobile device
CN107967667A (en) Generation method, device, terminal device and the storage medium of sketch
CN108021905A (en) image processing method, device, terminal device and storage medium
KR20160015727A (en) Method and apparatus for visualizing music information
KR101944112B1 (en) Method and apparatus for creating user-created sticker, system for sharing user-created sticker
US20230419582A1 (en) Virtual object display method and apparatus, electronic device, and medium
US11461949B2 (en) Electronic device for providing avatar and operating method thereof
KR20140079012A (en) Mobile apparatus having function of face recognition with additional component
CN105518579A (en) Information processing device and information processing method
KR102090948B1 (en) Apparatus saving conversation and method thereof
CN110827195B (en) Virtual article adding method and device, electronic equipment and storage medium
CN109331455A (en) Movement error correction method, device, storage medium and the terminal of human body attitude
JP2020507159A (en) Picture push method, mobile terminal and storage medium
CN111339938A (en) Information interaction method, device, equipment and storage medium
CN108665510A (en) Rendering intent, device, storage medium and the terminal of continuous shooting image
CN108055461B (en) Self-photographing angle recommendation method and device, terminal equipment and storage medium
CN109302563A (en) Stabilization processing method, device, storage medium and mobile terminal
CN108960213A (en) Method for tracking target, device, storage medium and terminal
CN107622473A (en) Image rendering method, device, terminal and computer-readable recording medium
CN112149599A (en) Expression tracking method and device, storage medium and electronic equipment
CN112766389B (en) Image classification method, training method, device and equipment of image classification model

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20180427

RJ01 Rejection of invention patent application after publication