CN109255814A - Method and apparatus for handling image - Google Patents
Method and apparatus for handling image Download PDFInfo
- Publication number
- CN109255814A CN109255814A CN201811102337.8A CN201811102337A CN109255814A CN 109255814 A CN109255814 A CN 109255814A CN 201811102337 A CN201811102337 A CN 201811102337A CN 109255814 A CN109255814 A CN 109255814A
- Authority
- CN
- China
- Prior art keywords
- image
- eyebrow
- processed
- target image
- target
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 53
- 210000004709 eyebrow Anatomy 0.000 claims abstract description 237
- 238000012545 processing Methods 0.000 claims description 46
- 238000012549 training Methods 0.000 claims description 32
- 238000004590 computer program Methods 0.000 claims description 7
- 210000004209 hair Anatomy 0.000 claims description 7
- 238000010801 machine learning Methods 0.000 claims description 4
- 230000006870 function Effects 0.000 description 12
- 238000010586 diagram Methods 0.000 description 8
- 230000006854 communication Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000001815 facial effect Effects 0.000 description 5
- 238000013528 artificial neural network Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000005611 electricity Effects 0.000 description 2
- 230000005291 magnetic effect Effects 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 210000004556 brain Anatomy 0.000 description 1
- 238000013527 convolutional neural network Methods 0.000 description 1
- 238000013136 deep learning model Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 210000003127 knee Anatomy 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 210000004218 nerve net Anatomy 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000000306 recurrent effect Effects 0.000 description 1
- 238000009738 saturating Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/20—Image preprocessing
- G06V10/22—Image preprocessing by selection of a specific region containing or referencing a pattern; Locating or processing of specific regions to guide the detection or recognition
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/168—Feature extraction; Face representation
- G06V40/171—Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Multimedia (AREA)
- General Health & Medical Sciences (AREA)
- Human Computer Interaction (AREA)
- Image Processing (AREA)
Abstract
The embodiment of the present application discloses the method and apparatus for handling image.One specific embodiment of this method includes: to obtain image to be processed;The location information of position of the image-region that obtain image to be processed, display eyebrow in image to be processed;According to location information, the eyebrow shown in image to be processed is replaced, the image to be processed that obtains that treated.The embodiment realizes the replacement to the eyebrow shown in image to be processed, so that showing new eyebrow in image to be processed, and no longer shows original eyebrow in image to be processed.
Description
Technical field
The invention relates to field of computer technology, and in particular to the method and apparatus for handling image.
Background technique
The special effect processings such as the beautification about eyebrow usually first orient the image-region that eyebrow is shown in image, then
Preset eyebrow image is chosen to be covered in the image-region oriented.This processing mode is only able to display preset eyebrow figure
Picture, and when the eyebrow of display originally cannot be completely covered in preset eyebrow image, still have the eyebrow of part display originally
In the image that is shown in that treated.
Summary of the invention
The embodiment of the present application proposes the method and apparatus for handling image.
In a first aspect, the embodiment of the present application provides a kind of method for handling image, this method comprises: obtaining wait locate
Manage image;The location information of position of the image-region that obtain image to be processed, display eyebrow in image to be processed;According to
Location information replaces the eyebrow shown in image to be processed, the image to be processed that obtains that treated.
In some embodiments, according to location information, the eyebrow shown in image to be processed is replaced, is handled
Image to be processed afterwards, comprising: image-region is handled, not shown the image to be processed of eyebrow;According to position
Information handles the image to be processed for not showing eyebrow, to obtain showing the image to be processed of new eyebrow, and will show
Show the image to be processed of the new eyebrow image to be processed that is determined as that treated.
In some embodiments, according to location information, the image to be processed for not showing eyebrow is handled, to be shown
Show the image to be processed of new eyebrow, comprising: the image and location information to be processed that do not show eyebrow are input to preparatory training
Eyebrow replace model, obtain the image to be processed for showing new eyebrow.
In some embodiments, image-region is handled, not shown the image to be processed of eyebrow, comprising:
The color or transparency of the pixel in image-region are adjusted, not shown the image to be processed of eyebrow.
In some embodiments, image to be processed is obtained, comprising: obtain target image;Adjustment target image size be
Pre-set dimension, and the target image of pre-set dimension is determined as image to be processed.
In some embodiments, training obtains eyebrow replacement model as follows: target image set is obtained,
In, the target image in target image set shows eyebrow;For the target image in target image set, the target is obtained
The location information of position of image, the display eyebrow image-region in the target image;And the target image is carried out
Processing, to obtain the corresponding target image for not showing eyebrow of the target image;Determine initial eyebrow replacement model;Utilize machine
The method of study, using the corresponding location information of the target image in target image set and do not show the target image of eyebrow as
The input of initial eyebrow replacement model, using the target image as the desired output of initial eyebrow replacement model, training obtains eyebrow
Hair replacement model.
Second aspect, the embodiment of the present application provide it is a kind of for handling the device of image, the device include: image obtain
Unit is configured to obtain image to be processed;Location information acquiring unit is configured to obtain image to be processed, display eyebrow
The location information of position of the image-region of hair in image to be processed;Processing unit is configured to be treated according to location information
The eyebrow that shows is replaced in processing image, the image to be processed that obtains that treated.
In some embodiments, above-mentioned processing unit is further configured to: being handled image-region, to obtain not
Show the image to be processed of eyebrow;According to location information, the image to be processed for not showing eyebrow is handled, to be shown
The image to be processed of new eyebrow, and by the image to be processed for the showing new eyebrow image to be processed that is determined as that treated.
In some embodiments, above-mentioned processing unit is further configured to: by do not show eyebrow image to be processed and
Location information is input to eyebrow replacement model trained in advance, obtains the image to be processed for showing new eyebrow.
In some embodiments, above-mentioned processing unit is further configured to: the face of the pixel in adjustment image-region
Color or transparency, not shown the image to be processed of eyebrow.
In some embodiments, above-mentioned image acquisition unit is further configured to: obtaining target image;Adjust target figure
The size of picture is pre-set dimension, and the target image of pre-set dimension is determined as image to be processed.
In some embodiments, training obtains eyebrow replacement model as follows: target image set is obtained,
In, the target image in target image set shows eyebrow;For the target image in target image set, the target is obtained
The location information of position of image, the display eyebrow image-region in the target image;And the target image is carried out
Processing, to obtain the corresponding target image for not showing eyebrow of the target image;Determine initial eyebrow replacement model;Utilize machine
The method of study, using the corresponding location information of the target image in target image set and do not show the target image of eyebrow as
The input of initial eyebrow replacement model, using the target image as the desired output of initial eyebrow replacement model, training obtains eyebrow
Hair replacement model.
The third aspect, the embodiment of the present application provide a kind of electronic equipment, which includes: one or more processing
Device;Storage device, for storing one or more programs;When one or more programs are executed by one or more processors, make
Obtain method of the one or more processors realization as described in implementation any in first aspect.
Fourth aspect, the embodiment of the present application provide a kind of computer-readable medium, are stored thereon with computer program, should
The method as described in implementation any in first aspect is realized when computer program is executed by processor.
Method and apparatus provided by the embodiments of the present application for handling image, by obtaining image to be processed;Obtain to
The location information of position of the image-region that handle image, display eyebrow in image to be processed;According to location information, treat
The eyebrow that shows is replaced in processing image, the image to be processed that obtains that treated, to realize in image to be processed
The replacement of the eyebrow of display so that showing new eyebrow in image to be processed, and no longer shows original eyebrow in image to be processed
Hair.
Detailed description of the invention
By reading a detailed description of non-restrictive embodiments in the light of the attached drawings below, the application's is other
Feature, objects and advantages will become more apparent upon:
Fig. 1 is that one embodiment of the application can be applied to exemplary system architecture figure therein;
Fig. 2 is the flow chart according to one embodiment of the method for handling image of the application;
Fig. 3 is the flow chart according to another embodiment of the method for handling image of the application;
Fig. 4 is the schematic diagram according to an application scenarios of the method for handling image of the embodiment of the present application;
Fig. 5 is the structural schematic diagram according to one embodiment of the device for handling image of the application;
Fig. 6 is adapted for the structural schematic diagram for the computer system for realizing the electronic equipment of the embodiment of the present application.
Specific 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 related invention, rather than the restriction to the invention.It also should be noted that in order to
Convenient for description, part relevant to related invention is illustrated only in attached drawing.
It should be noted that in the absence of conflict, the features in the embodiments and the embodiments of the present application can phase
Mutually combination.The application is described in detail below with reference to the accompanying drawings and in conjunction with the embodiments.
Fig. 1 is shown can be using the method for handling image of the application or the implementation of the device for handling image
The exemplary architecture 100 of example.
As shown in Figure 1, system architecture 100 may include terminal device 101,102,103, network 104 and server 105.
Network 104 between terminal device 101,102,103 and server 105 to provide the medium of communication link.Network 104 can be with
Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
Terminal device 101,102,103 is interacted by network 104 with server 105, to receive or send message etc..Terminal
Various client applications can be installed in equipment 101,102,103.Such as the application of camera shooting class, image processing class application etc..
Terminal device 101,102,103 can be hardware, be also possible to software.When terminal device 101,102,103 is hard
When part, it can be the various electronic equipments for supporting image storage and image transmitting, including but not limited to smart phone, plate electricity
Brain, E-book reader, pocket computer on knee and desktop computer etc..When terminal device 101,102,103 is software
When, it may be mounted in above-mentioned cited electronic equipment.Multiple softwares or software module may be implemented into (such as mentioning in it
For the multiple softwares or software module of Distributed Services), single software or software module also may be implemented into.It does not do herein specific
It limits.
Server 105 can be to provide the server of various services, for example, terminal device 101,102,103 send to
The image processing server that processing image is handled.Further, image processing server can also be by treated wait locate
Reason image is back to terminal device 101,102,103.
It should be noted that above-mentioned image to be processed can also be stored directly in the local of server 105, server 105
The local image to be processed stored can directly be extracted and handled, at this point it is possible to there is no terminal device 101,102,
103 and network 104.
It should be noted that the method provided by the embodiment of the present application for handling image is generally held by server 105
Row, correspondingly, the device for handling image is generally positioned in server 105.
It may also be noted that can also be equipped with image processing class application in terminal device 101,102,103, terminal is set
Standby 101,102,103 can also be based on image processing class using handling image to be processed, at this point, for handling image
Method can also be executed by terminal device 101,102,103, and correspondingly, the device for handling image also can be set in terminal
In equipment 101,102,103.At this point, server 105 and network 104 can be not present in exemplary system architecture 100.
It should be noted that server can be hardware, it is also possible to software.When server is hardware, may be implemented
At the distributed server cluster that multiple servers form, individual server also may be implemented into.It, can when server is software
It, can also be with to be implemented as multiple softwares or software module (such as providing multiple softwares of Distributed Services or software module)
It is implemented as single software or software module.It is not specifically limited herein.
It should be understood that the number of terminal device, network and server in Fig. 1 is only schematical.According to realization need
It wants, can have any number of terminal device, network and server.
With continued reference to Fig. 2, it illustrates the processes according to one embodiment of the method for handling image of the application
200.This be used for handle image method the following steps are included:
Step 201, image to be processed is obtained.
In the present embodiment, can lead to for handling the executing subject (server 105 as shown in Figure 1) of the method for image
Cross the mode of wired connection or wireless connection from local or other storage equipment (terminal device as shown in Figure 1 101,102,
103) image to be processed is obtained.Wherein, image to be processed can be the image for showing eyebrow.
It is alternatively possible to first obtain target image, the size for then adjusting target image is pre-set dimension, and will be preset
The target image of size is determined as image to be processed.Wherein, target image can be arbitrary image.For example, target image can
To be the image specified in advance by technical staff, it is also possible to the current accessed image etc. of above-mentioned executing subject.
Pre-set dimension can be pre-set by technical staff.Specifically, it is logical that some image processing softwares be can use
It crosses and zooms in or out the size of mesh image to realize the adjustment to the size of target image, it can also be by way of cutting come real
Now to the adjustment of the size of target image.
Step 202, the position of position of the image-region that obtain image to be processed, display eyebrow in image to be processed
Information.
In the present embodiment, location information can be used to indicate the image-region of display eyebrow relative to image to be processed
Position.According to actual application demand, location information can have various representations.
For example, location information may include the coordinate for showing each pixel in the image-region of eyebrow.Location information
It also may include showing the coordinate of the pixel at image-region edge of eyebrow, or can also be the image district from display eyebrow
In domain, according to the coordinate for the pixel that preset condition (for example, the pixel of surrounding comprising not showing eyebrow) filters out.Position letter
Breath can also include the coordinate of the geometric center of the image-region of display eyebrow, show and cross geometric center in the image-region of eyebrow
Longest line segment length, show length of shortest line segment etc. that geometric center is crossed in the image-region of eyebrow.
In the present embodiment, position of the image-region of display eyebrow in image to be processed can be obtained by various modes
Confidence breath.For example, can use existing some image processing softwares to obtain location information, it can also be first with various detections
Method (as using the algorithm based on key point come the image-region of locating and displaying eyebrow, utilize the nerve net based on semantic segmentation
Network carrys out the image-region etc. of locating and displaying eyebrow) it first detects to show the image-region of eyebrow.Result work can directly be will test
For location information, location information can also be further extracted on the basis of testing result.
Step 203, according to location information, the eyebrow shown in image to be processed is replaced, obtain that treated to
Handle image.
In the present embodiment, target eyebrow image can first be obtained, wherein target eyebrow image, which can be, to be preset
, it is also possible to the eyebrow image selected from preset eyebrow image collection by user, can also be according to location information
Identified eyebrow image is (for example, the eyebrow figure fitted well on the contour line of the image-region of the display eyebrow of image to be processed
Picture).
Later, target eyebrow image can be covered on the image-region of display eyebrow according to location information.Later,
It can determine what target eyebrow image can not cover according to the position of location information and target eyebrow image in image to be processed
The eyebrow image-region shown originally in image to be processed.Further, in the eyebrow image-region that can not be covered for these
Pixel, the pixel that can use in the immediate target eyebrow image of the pixel is replaced, and treats to realize
The replacement of the eyebrow shown originally in processing image.
Optionally, can also the image-region of the first display eyebrow to image to be processed handle, not shown
The image to be processed of eyebrow.Then according to location information, the image to be processed for not showing eyebrow is handled, to be shown
The image to be processed of new eyebrow, and it is to be processed that the image to be processed of the new eyebrow of obtained display is determined as that treated
Image.
Wherein it is possible to which benefit is in various manners handled image to be processed, not shown the figure to be processed of eyebrow
Picture.
It is alternatively possible to adjust the color or saturating of each pixel in the image-region of the display eyebrow of image to be processed
Lightness is not shown the image to be processed of eyebrow.For example, the color of each pixel can be uniformly adjusted to white,
The color of each pixel can be adjusted to apart from each pixel it is nearest and not show eyebrow image-region in picture
The color of vegetarian refreshments.In another example the transparency of each pixel can also be both configured to it is fully transparent, to not shown eyebrow
The image to be processed of hair.
The method provided by the above embodiment of the application is according to the image-region of the display eyebrow of image to be processed wait locate
The position in image is managed to realize the replacement to the eyebrow shown in image to be processed, so that showing new eyebrow in image to be processed
Hair, and no longer shows original eyebrow in image to be processed, helps to be promoted the eyebrow shown in treated image to be processed
Ornamental.
With further reference to Fig. 3, it illustrates the processes 300 of another embodiment of the method for handling image.The use
In the process 300 of the method for processing image, comprising the following steps:
Step 301, image to be processed is obtained.
Step 302, the position of position of the image-region that obtain image to be processed, display eyebrow in image to be processed
Information.
Step 303, image-region is handled, not shown the image to be processed of eyebrow.
The specific implementation procedure of above-mentioned steps 301,302 and 303 can refer to step 201 in Fig. 2 corresponding embodiment and
202 related description, details are not described herein.
Step 304, the image and location information to be processed that do not show eyebrow eyebrow trained in advance is input to more to change the mold
Type obtains the image to be processed for showing new eyebrow.
In the present embodiment, eyebrow replacement model can be used for according to location information to the image to be processed for not showing eyebrow
It is handled, so that not showing that the image to be processed of eyebrow shows new eyebrow.Above-mentioned eyebrow replacement model can be by a variety of
Mode training obtains.
It is alternatively possible to which obtaining above-mentioned eyebrow by following step training replaces model:
Step 1 obtains training sample set.Wherein, each training sample includes the image of a display eyebrow.Training sample
This collection can be the image chosen or generated according to actual application demand by technical staff.For example, training sample set can be
It is generated using some image processing softwares, is also possible to download from some third-party image libraries.In practice, using need
Beautified if asking and being intended to treat the eyebrow that shows in processing image, some thinks to show then can be chosen by related personnel
The more good-looking image of eyebrow as training sample set.
Step 2 determines initial eyebrow processing model.Wherein, initial eyebrow processing model may include initial eyebrow erasing
Model and the initial eyebrow connecting with initial eyebrow erasing model replace model.Initial eyebrow erasing model can be used for image
The eyebrow of middle display is wiped, not shown the image of eyebrow.Initial eyebrow replacement model wipes mould with initial eyebrow
The output of type is as input.Technical staff can according to actual application demand (such as need include which layer, every layer of the number of plies,
The size etc. of convolution kernel) the initial eyebrow of building wipes model and initial eyebrow replaces model.
Step 3, the initial eyebrow of training handle model.Specifically, the figure in training sample that training sample can be concentrated
Input and desired output as handling model as initial eyebrow, are based on preset loss function, handle model to initial eyebrow
It is trained, obtains the initial eyebrow processing model of training completion.
Wherein, the value of loss function can be used to indicate in the reality output and training sample of initial eyebrow processing model
Difference degree between image.It is then possible to which the value based on loss function, is adjusted at initial eyebrow using the method for backpropagation
The parameter of model is managed, and in the case where meeting preset trained termination condition, terminates training.After the completion of training, it can will instruct
The initial eyebrow replacement model for practicing the training completion that the initial eyebrow processing model completed includes is determined as above-mentioned eyebrow and more changes the mold
Type.
Preset trained termination condition can include but is not limited at least one of following: the training time be more than preset duration,
Frequency of training is more than preset times, the value of loss function less than default discrepancy threshold etc..
Optionally, above-mentioned eyebrow can also be obtained by the training of following step replace model:
Step 1 obtains target image set.Wherein, the target image in target image set shows eyebrow.Specifically
Ground, target image can be the image chosen or generated according to actual application demand by technical staff.For example, target image can
Being generated using some image processing softwares, it is also possible to download from some third-party image libraries.In practice, answer
If being intended to treat the eyebrow shown in processing image with demand to be beautified, think to show then can be chosen by related personnel
The more good-looking image of eyebrow as target image.
Step 2 obtains the target image, display eyebrow image district for the target image in target image set
The location information of position of the domain in the target image.Later, the eyebrow shown in the target image can be handled, with
Obtain the corresponding target image for not showing eyebrow.
Step 3 determines initial eyebrow replacement model.Wherein, initial eyebrow replacement model can be it is various types of without
Artificial neural network trained or that training is not completed, such as deep learning model.Initial eyebrow replacement model is also possible to pair
The model that artificial neural network a variety of unbred or that training is not completed is combined.For example, initial eyebrow replacement
Model can be to unbred convolutional neural networks, unbred Recognition with Recurrent Neural Network and unbred full articulamentum
The model being combined.
It is alternatively possible to first obtain existing some network models (such as semantic segmentation network based on full convolutional network
U-net), the adjustment that technical staff can carry out adaptability to network structure according to demand later obtains initial eyebrow and more changes the mold
Type.
Step 4, using the method for machine learning, by target image set the corresponding location information of target image and
Input of the target image of eyebrow as initial eyebrow replacement model is not shown, is more changed the mold the target image as initial eyebrow
The desired output of type, training obtain above-mentioned eyebrow replacement model.
With continued reference to the signal that Fig. 4, Fig. 4 are according to the application scenarios of the method for handling image of the present embodiment
Figure.In the application scenarios of Fig. 4, above-mentioned executing subject can obtain facial image 401 first.It is then based on key-point analysis
Method obtains the eyebrow location information 402 for indicating the position of the eyebrow shown in facial image 401.It later, can be by face figure
As showing that the color of the pixel of eyebrow is adjusted to white in 401, the facial image 403 of eyebrow is not shown.It later, can be with
The facial image 403 for not showing eyebrow and eyebrow location information 402 are input to eyebrow replacement model 404, obtain showing newly
The facial image 505 of eyebrow.
From figure 3, it can be seen that the method for handling image compared with the corresponding embodiment of Fig. 2, in the present embodiment
Process 300 highlight according to location information, to not showing the step of image to be processed of eyebrow is handled.This reality as a result,
The scheme for applying example description can be replaced according to the image and corresponding location information for not showing eyebrow using eyebrow trained in advance
Model obtains the image to be processed for showing new eyebrow, further also contribute to promoted display new eyebrow diversity and
Flexibility, so that the generation of new eyebrow is no longer limited by the quantity and pattern of pre-set eyebrow image to be replaced.
With further reference to Fig. 5, as the realization to method shown in above-mentioned each figure, this application provides for handling image
One embodiment of device, the Installation practice is corresponding with embodiment of the method shown in Fig. 2, which specifically can be applied to
In various electronic equipments.
As shown in figure 5, the device 500 provided in this embodiment for handling image includes image acquisition unit 501, position
Information acquisition unit 502 and processing unit 503.Wherein, image acquisition unit 501 is configured to obtain image to be processed;Position
Information acquisition unit 502 is configured to obtain position of image to be processed, the display eyebrow image-region in image to be processed
The location information set;Processing unit 503 is configured to carry out more the eyebrow shown in image to be processed according to location information
It changes, the image to be processed that obtains that treated.
In the present embodiment, in the device 500 for handling image: image acquisition unit 501, location information acquiring unit
502 and processing unit 503 specific processing and its brought technical effect can be respectively with reference to the step in Fig. 2 corresponding embodiment
201, the related description of step 202 and step 203, details are not described herein.
In some optional implementations of the present embodiment, above-mentioned processing unit 503 is further configured to: to image
Region is handled, not shown the image to be processed of eyebrow;According to location information, to the figure to be processed for not showing eyebrow
As being handled, to obtain showing the image to be processed of new eyebrow, and the image to be processed for showing new eyebrow is determining
The image to be processed for treated.
In some optional implementations of the present embodiment, above-mentioned processing unit 503 is further configured to: will not be shown
Show that the image and location information to be processed of eyebrow are input in advance trained eyebrow replacement model, obtain showing new eyebrow to
Handle image.
In some optional implementations of the present embodiment, above-mentioned processing unit 503 is further configured to: adjustment figure
As the color or transparency of the pixel in region, not shown the image to be processed of eyebrow.
In some optional implementations of the present embodiment, above-mentioned image acquisition unit 501 is further configured to: being obtained
Take target image;The size for adjusting target image is pre-set dimension, and the target image of pre-set dimension is determined as to be processed
Image.
In some optional implementations of the present embodiment, training obtains eyebrow replacement model as follows: obtaining
Take target image set, wherein the target image in target image set shows eyebrow;For the mesh in target image set
Logo image, the location information of position of the image-region that obtain the target image, display eyebrow in the target image;And
The target image is handled, to obtain the corresponding target image for not showing eyebrow of the target image;Determine initial eyebrow
Replace model;Using the method for machine learning, by the corresponding location information of target image in target image set and do not show
Input of the target image of eyebrow as initial eyebrow replacement model, using the target image as the phase of initial eyebrow replacement model
Output, training is hoped to obtain eyebrow replacement model.
The device provided by the above embodiment of the application obtains image to be processed by image acquisition unit;Location information
Acquiring unit obtains the location information of position of image to be processed, the display eyebrow image-region in image to be processed;Place
Unit is managed according to location information, the eyebrow shown in image to be processed is replaced, the image to be processed that obtains that treated, from
And the replacement to the eyebrow shown in image to be processed is realized, so that new eyebrow is shown in image to be processed, and it is no longer aobvious
Show original eyebrow in image to be processed.
Below with reference to Fig. 6, it illustrates the computer systems 600 for the electronic equipment for being suitable for being used to realize the embodiment of the present application
Structural schematic diagram.Electronic equipment shown in Fig. 6 is only an example, function to the embodiment of the present application and should not use model
Shroud carrys out any restrictions.
As shown in fig. 6, computer system 600 includes central processing unit (CPU) 601, it can be read-only according to being stored in
Program in memory (ROM) 602 or be loaded into the program in random access storage device (RAM) 603 from storage section 608 and
Execute various movements appropriate and processing.In RAM 603, also it is stored with system 600 and operates required various programs and data.
CPU 601, ROM 602 and RAM 603 are connected with each other by bus 604.Input/output (I/O) interface 605 is also connected to always
Line 604.
I/O interface 605 is connected to lower component: the importation 606 including keyboard, mouse etc.;It is penetrated including such as cathode
The output par, c 607 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 608 including hard disk etc.;
And the communications portion 609 of the network interface card including LAN card, modem etc..Communications portion 609 via such as because
The network of spy's net executes communication process.Driver 610 is also connected to I/O interface 605 as needed.Detachable media 611, such as
Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 610, in order to read from thereon
Computer program be mounted into storage section 608 as needed.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description
Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium
On computer program, which includes the program code for method shown in execution flow chart.In such reality
It applies in example, which can be downloaded and installed from network by communications portion 609, and/or from detachable media
611 are mounted.When the computer program is executed by central processing unit (CPU) 601, limited in execution the present processes
Above-mentioned function.
It should be noted that the computer-readable medium of the application can be computer-readable signal media or computer
Readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but it is unlimited
In system, device or the device of --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor, or any above combination.It calculates
The more specific example of machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, portable of one or more conducting wires
Formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable programmable read only memory
(EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device or
The above-mentioned any appropriate combination of person.In this application, computer readable storage medium can be it is any include or storage program
Tangible medium, which can be commanded execution system, device or device use or in connection.And in this Shen
Please in, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal,
In carry computer-readable program code.The data-signal of this propagation can take various forms, including but not limited to
Electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable
Any computer-readable medium other than storage medium, the computer-readable medium can send, propagate or transmit for by
Instruction execution system, device or device use or program in connection.The journey for including on computer-readable medium
Sequence code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned
Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the application, method and computer journey
The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation
A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use
The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box
The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually
It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse
Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding
The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction
Combination realize.
Being described in unit involved in the embodiment of the present application can be realized by way of software, can also be by hard
The mode of part is realized.Described unit also can be set in the processor, for example, can be described as: a kind of processor, packet
Include image acquisition unit, location information acquiring unit and processing unit.Wherein, the title of these units is not under certain conditions
The restriction to the unit itself is constituted, for example, image acquisition unit is also described as " obtaining the unit of image to be processed ".
As on the other hand, present invention also provides a kind of computer-readable medium, which be can be
Included in electronic equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when said one or multiple programs are held by the electronic equipment
When row, so that the electronic equipment: obtaining image to be processed;Image-region that obtain image to be processed, display eyebrow is wait locate
Manage the location information of the position in image;According to location information, the eyebrow shown in image to be processed is replaced, is obtained everywhere
Image to be processed after reason.
Above description is only the preferred embodiment of the application and the explanation to institute's application technology principle.Those skilled in the art
Member is it should be appreciated that invention scope involved in the application, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic
Scheme, while should also cover in the case where not departing from foregoing invention design, it is carried out by above-mentioned technical characteristic or its equivalent feature
Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed herein
Can technical characteristic replaced mutually and the technical solution that is formed.
Claims (14)
1. a kind of method for handling image, comprising:
Obtain image to be processed;
The position letter of position of the image-region that obtain the image to be processed, display eyebrow in the image to be processed
Breath;
According to the positional information, the eyebrow shown in the image to be processed is replaced, it is to be processed to obtain that treated
Image.
2. according to the method described in claim 1, wherein, it is described according to the positional information, shown in the image to be processed
The eyebrow shown is replaced, the image to be processed that obtains that treated, comprising:
Described image region is handled, not shown the image to be processed of eyebrow;
According to the positional information, the image to be processed for not showing eyebrow is handled, to obtain showing new eyebrow
Image to be processed, and the image to be processed of the new eyebrow of the display is determined as treated the image to be processed.
3. according to the method described in claim 2, wherein, it is described according to the positional information, to it is described do not show eyebrow to
Processing image is handled, to obtain showing the image to be processed of new eyebrow, comprising:
The image to be processed for not showing eyebrow and the location information are input to eyebrow trained in advance and replace model, is obtained
To the image to be processed for showing new eyebrow.
4. it is described that described image region is handled according to the method described in claim 2, wherein, not shown eyebrow
The image to be processed of hair, comprising:
The color or transparency of the pixel in described image region are adjusted, not shown the image to be processed of eyebrow.
5. described to obtain image to be processed according to the method described in claim 1, wherein, comprising:
Obtain target image;
The size for adjusting the target image is pre-set dimension, and the target image of pre-set dimension is determined as described to be processed
Image.
6. according to the method described in claim 3, wherein, training obtains the eyebrow replacement model as follows:
Obtain target image set, wherein the target image in the target image set shows eyebrow;
For the target image in the target image set, image-region that obtain the target image, display eyebrow is at this
The location information of position in target image;And the target image is handled, it is corresponding not to obtain the target image
Show the target image of eyebrow;
Determine initial eyebrow replacement model;
Using the method for machine learning, eyebrow is not shown the corresponding location information of target image in the target image set and
Input of the target image of hair as initial eyebrow replacement model, using the target image as the expectation of initial eyebrow replacement model
Output, training obtain the eyebrow replacement model.
7. a kind of for handling the device of image, comprising:
Image acquisition unit is configured to obtain image to be processed;
Location information acquiring unit, be configured to obtain the image to be processed, display eyebrow image-region it is described to
Handle the location information of the position in image;
Processing unit is configured to according to the positional information, replace the eyebrow shown in the image to be processed, obtain
The image to be processed to treated.
8. device according to claim 7, wherein the processing unit is further configured to:
Described image region is handled, not shown the image to be processed of eyebrow;
According to the positional information, the image to be processed for not showing eyebrow is handled, to obtain showing new eyebrow
Image to be processed, and the image to be processed of the new eyebrow of the display is determined as treated the image to be processed.
9. device according to claim 8, wherein the processing unit is further configured to:
The image to be processed for not showing eyebrow and the location information are input to eyebrow trained in advance and replace model, is obtained
To the image to be processed for showing new eyebrow.
10. device according to claim 8, wherein the processing unit is further configured to:
The color or transparency of the pixel in described image region are adjusted, not shown the image to be processed of eyebrow.
11. device according to claim 7, wherein described image acquiring unit is further configured to:
Obtain target image;
The size for adjusting the target image is pre-set dimension, and the target image of pre-set dimension is determined as described to be processed
Image.
12. device according to claim 9, wherein training obtains the eyebrow replacement model as follows:
Obtain target image set, wherein the target image in the target image set shows eyebrow;
For the target image in the target image set, image-region that obtain the target image, display eyebrow is at this
The location information of position in target image;And the target image is handled, it is corresponding not to obtain the target image
Show the target image of eyebrow;
Determine initial eyebrow replacement model;
Using the method for machine learning, eyebrow is not shown the corresponding location information of target image in the target image set and
Input of the target image of hair as initial eyebrow replacement model, using the target image as the expectation of initial eyebrow replacement model
Output, training obtain the eyebrow replacement model.
13. a kind of electronic equipment, comprising:
One or more processors;
Storage device is stored thereon with one or more programs;
When one or more of programs are executed by one or more of processors, so that one or more of processors are real
Now such as method as claimed in any one of claims 1 to 6.
14. a kind of computer-readable medium, is stored thereon with computer program, wherein the realization when program is executed by processor
Such as method as claimed in any one of claims 1 to 6.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811102337.8A CN109255814A (en) | 2018-09-20 | 2018-09-20 | Method and apparatus for handling image |
PCT/CN2018/115970 WO2020056901A1 (en) | 2018-09-20 | 2018-11-16 | Method and device for processing image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811102337.8A CN109255814A (en) | 2018-09-20 | 2018-09-20 | Method and apparatus for handling image |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109255814A true CN109255814A (en) | 2019-01-22 |
Family
ID=65048382
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811102337.8A Pending CN109255814A (en) | 2018-09-20 | 2018-09-20 | Method and apparatus for handling image |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN109255814A (en) |
WO (1) | WO2020056901A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112307245A (en) * | 2020-03-02 | 2021-02-02 | 北京字节跳动网络技术有限公司 | Method and apparatus for processing image |
CN113590250A (en) * | 2021-07-29 | 2021-11-02 | 网易(杭州)网络有限公司 | Image processing method, device, equipment and storage medium |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113256660B (en) * | 2021-06-04 | 2024-07-26 | 北京有竹居网络技术有限公司 | Picture processing method and device and electronic equipment |
CN113642612B (en) * | 2021-07-19 | 2022-11-18 | 北京百度网讯科技有限公司 | Sample image generation method and device, electronic equipment and storage medium |
CN113870388A (en) * | 2021-09-23 | 2021-12-31 | 浙江大华技术股份有限公司 | Image processing method, device, equipment and medium |
CN114565512B (en) * | 2022-03-03 | 2024-10-25 | 广州虎牙科技有限公司 | Eyebrow deformation method, device, electronic equipment and readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130170766A1 (en) * | 2011-12-28 | 2013-07-04 | HeHuan Xu | Method of performing eyebrow shaping on an image and related computing device |
CN104657974A (en) * | 2013-11-25 | 2015-05-27 | 腾讯科技(上海)有限公司 | Image processing method and device |
CN108022207A (en) * | 2017-11-30 | 2018-05-11 | 广东欧珀移动通信有限公司 | Image processing method, device, storage medium and electronic equipment |
CN108491780A (en) * | 2018-03-16 | 2018-09-04 | 广东欧珀移动通信有限公司 | Image landscaping treatment method, apparatus, storage medium and terminal device |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107025629B (en) * | 2017-04-27 | 2021-03-26 | 维沃移动通信有限公司 | Image processing method and mobile terminal |
CN107464253B (en) * | 2017-07-10 | 2020-11-20 | 北京小米移动软件有限公司 | Eyebrow positioning method and device |
CN107945188A (en) * | 2017-11-20 | 2018-04-20 | 北京奇虎科技有限公司 | Personage based on scene cut dresss up method and device, computing device |
CN107895358A (en) * | 2017-12-25 | 2018-04-10 | 科大讯飞股份有限公司 | The Enhancement Method and system of facial image |
CN108062742B (en) * | 2017-12-31 | 2021-05-04 | 广州二元科技有限公司 | Eyebrow replacing method by digital image processing and deformation |
CN108537725A (en) * | 2018-04-10 | 2018-09-14 | 光锐恒宇(北京)科技有限公司 | A kind of method for processing video frequency and device |
-
2018
- 2018-09-20 CN CN201811102337.8A patent/CN109255814A/en active Pending
- 2018-11-16 WO PCT/CN2018/115970 patent/WO2020056901A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130170766A1 (en) * | 2011-12-28 | 2013-07-04 | HeHuan Xu | Method of performing eyebrow shaping on an image and related computing device |
CN104657974A (en) * | 2013-11-25 | 2015-05-27 | 腾讯科技(上海)有限公司 | Image processing method and device |
CN108022207A (en) * | 2017-11-30 | 2018-05-11 | 广东欧珀移动通信有限公司 | Image processing method, device, storage medium and electronic equipment |
CN108491780A (en) * | 2018-03-16 | 2018-09-04 | 广东欧珀移动通信有限公司 | Image landscaping treatment method, apparatus, storage medium and terminal device |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112307245A (en) * | 2020-03-02 | 2021-02-02 | 北京字节跳动网络技术有限公司 | Method and apparatus for processing image |
CN112307245B (en) * | 2020-03-02 | 2024-03-26 | 北京字节跳动网络技术有限公司 | Method and apparatus for processing image |
CN113590250A (en) * | 2021-07-29 | 2021-11-02 | 网易(杭州)网络有限公司 | Image processing method, device, equipment and storage medium |
CN113590250B (en) * | 2021-07-29 | 2024-02-27 | 网易(杭州)网络有限公司 | Image processing method, device, equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
WO2020056901A1 (en) | 2020-03-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109255814A (en) | Method and apparatus for handling image | |
CN108446387A (en) | Method and apparatus for updating face registration library | |
CN108985257A (en) | Method and apparatus for generating information | |
CN108898185A (en) | Method and apparatus for generating image recognition model | |
CN109308681A (en) | Image processing method and device | |
CN109191514A (en) | Method and apparatus for generating depth detection model | |
CN109344752A (en) | Method and apparatus for handling mouth image | |
CN108595628A (en) | Method and apparatus for pushed information | |
CN108986169A (en) | Method and apparatus for handling image | |
CN109087377B (en) | Method and apparatus for handling image | |
CN109118456A (en) | Image processing method and device | |
CN108960110A (en) | Method and apparatus for generating information | |
CN109410253B (en) | For generating method, apparatus, electronic equipment and the computer-readable medium of information | |
CN108491823A (en) | Method and apparatus for generating eye recognition model | |
CN109255767A (en) | Image processing method and device | |
CN109241934A (en) | Method and apparatus for generating information | |
CN108363999A (en) | Operation based on recognition of face executes method and apparatus | |
CN109117758A (en) | Method and apparatus for generating information | |
CN108882025A (en) | Video frame treating method and apparatus | |
CN109214501A (en) | The method and apparatus of information for identification | |
CN109919089A (en) | Method and apparatus for pushed information | |
CN108491812A (en) | The generation method and device of human face recognition model | |
CN108521516A (en) | Control method and device for terminal device | |
CN108011949A (en) | Method and apparatus for obtaining data | |
CN110427915A (en) | Method and apparatus for output information |
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: 20190122 |
|
RJ01 | Rejection of invention patent application after publication |