WO2021189927A1 - 图像处理方法、装置、电子设备及存储介质 - Google Patents

图像处理方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2021189927A1
WO2021189927A1 PCT/CN2020/132994 CN2020132994W WO2021189927A1 WO 2021189927 A1 WO2021189927 A1 WO 2021189927A1 CN 2020132994 W CN2020132994 W CN 2020132994W WO 2021189927 A1 WO2021189927 A1 WO 2021189927A1
Authority
WO
WIPO (PCT)
Prior art keywords
target object
target
image
recognized
variant
Prior art date
Application number
PCT/CN2020/132994
Other languages
English (en)
French (fr)
Inventor
刘莹
Original Assignee
北京达佳互联信息技术有限公司
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 北京达佳互联信息技术有限公司 filed Critical 北京达佳互联信息技术有限公司
Priority to JP2022549506A priority Critical patent/JP2023514340A/ja
Publication of WO2021189927A1 publication Critical patent/WO2021189927A1/zh
Priority to US17/820,026 priority patent/US20220392253A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/18Image warping, e.g. rearranging pixels individually
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T13/00Animation
    • G06T13/802D [Two Dimensional] animation, e.g. using sprites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/44Morphing

Definitions

  • the present disclosure relates to image processing technology, and in particular to an image processing method, device, electronic equipment, and storage medium.
  • the present disclosure provides an image processing method, device, electronic device, and storage medium, so as to at least solve the problem of poor processing effect on the modification of the target object in the image in the related art.
  • the technical solutions of the present disclosure are as follows:
  • an image processing method including: in response to a change in an object recognition result of a target object in an image, acquiring the last modified form of the target object before the change occurs as the The initial variant form of the target object; the target object is an object of variant processing; the target variant form of the target object corresponding to the change is acquired; the initial variant form and the target variant form are respectively regarded as gradual changes The starting form and ending form of, show the target object in a gradual manner.
  • an image processing device including: an initial form acquisition module, configured to respond to a change in the object recognition result of the target object in the image, and acquire the target object before the change occurs
  • the final variant form of the target object is used as the initial variant form of the target object;
  • the target object is a variant processed object;
  • the target form acquisition module is used to obtain the target variant form of the target object corresponding to the change;
  • the display module is configured to use the initial variant form and the target variant form as the starting form and the ending form of a gradual change, respectively, to display the target object in a gradual manner.
  • an electronic device including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to execute the instructions to implement a response
  • the processor is configured to execute the instructions to implement a response
  • a storage medium when instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the image processing method described above.
  • a computer program product includes a computer program, the computer program is stored in a readable storage medium, and at least one processor of the device obtains data from the readable storage medium.
  • the computer program is read and executed, so that the device executes the image processing method as described above.
  • Fig. 1 is an application environment diagram of an image processing method according to an embodiment
  • Fig. 2 is a flowchart of an image processing method according to an embodiment
  • Fig. 3 is a schematic diagram showing the effect of an image processing method according to an embodiment
  • Fig. 4 is a flowchart showing a method for displaying a target object according to an embodiment
  • Fig. 5 is a flow chart showing a method for obtaining a variation range according to an embodiment
  • Fig. 6 is a flow chart showing a method for obtaining a gradual change speed according to an embodiment
  • Fig. 7 is a flowchart showing an image processing method according to an embodiment
  • Fig. 8 is a block diagram of an image processing device according to an embodiment
  • Fig. 9 is an internal structure diagram of an electronic device according to an embodiment.
  • FIG. 1 is an application environment diagram of an image processing method according to an embodiment.
  • the application environment may include a terminal 100,
  • the terminal 100 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
  • the terminal 100 may collect an image of the user 10 through a camera configured on it, and perform modification processing on the face 11 of the user 10 based on the image.
  • the face-reduction processing is performed on the image corresponding to the face 11 of the user 10, so that the terminal 100 displays the face-reduction processing image on its display interface.
  • the terminal 100 may collect an image of the user 10 in real time, use the face as the target object of the modification processing, and perform face-lifting processing on the face.
  • the terminal 100 may display the first image 111 after the face-lifting process.
  • An image 111 may include a face 12 that has undergone face-lifting processing.
  • the obstruction 20 forms a certain degree of occlusion on the target object, namely the face 12, so that the face recognition model of the terminal 100 cannot recognize the face.
  • the face-lifting effect on the face 12 in the related technology is invalid, and the third image 113 is displayed directly on the display interface.
  • the face 13 in the third image 113 is not processed by face-lifting Face.
  • the terminal 100 can re-identify the face 13 in the fourth image 114.
  • the related art will The face-lifting process is performed on the face 13 again, and the fifth image 115 is directly displayed on the display interface of the fifth image 115, and the face 12 of the fifth image 115 is a face that has not undergone the face-lifting process.
  • the screen will flicker, and the effect of beautifying the target object is poor.
  • the terminal 100 can first determine whether the object recognition result of the target object in the image has changed, and when the object recognition result for the target object in the image changes, obtain the last target object before the change occurs.
  • the variant form is used as the initial variant form of the target object, and the target variant form of the target object corresponding to the change is also obtained.
  • the terminal 100 may use the initial variant form and the target variant form as gradual changes on its display interface.
  • the starting shape and ending shape show the target object in a gradual manner.
  • the terminal 100 can use the modified form of the face 12 in the first image 111 before the change as the initial modified form of the face 12.
  • the initial variant form may be the final form of the face-lifting process, and the original form of the face 12 before the face-lifting process may be used as the target variant form.
  • the target variant form corresponds to the variant form of the face 13 of the third image 113.
  • the terminal 100 may regard the initial variant form and the target variant form as the starting form and the ending form of the gradation, respectively, and display the face in a gradual manner on its display interface, that is, displaying the face 12 from the second image 112. A process of gradual change from the deformed form to the deformed form of the face 13 of the third image 113.
  • the terminal 100 changes from being unable to recognize the face on the image to being able to recognize the face on the image, as shown in the fourth image 114, so that the terminal 100 can
  • the deformed form of the face 13 in the third image 113 before the change is taken as the initial deformed form of the face 13.
  • the initial deformed form can be the original form of the face before the face-lifting process, and the final form of the face-lift can be changed.
  • the form is regarded as the target variant state, and the target variant state corresponds to the variant form of the face 12 of the fifth image 115.
  • the terminal 100 may regard the initial variant form and the target variant form as the starting form and the target variant form respectively.
  • Fig. 2 is a flowchart showing an image processing method according to an embodiment. As shown in Fig. 2, the image processing method can be applied to the terminal 100 shown in Fig. 1.
  • the terminal 100 may acquire each frame of image and identify the target object in the image when shooting a video or live broadcast in real time.
  • the target object in the image refers to an object subject to modification.
  • the target object may be a human face, arms, eyes, or chin.
  • the terminal 100 detects a change in the object recognition result of the target object in the image, the last modified form of the target object before the change occurs is acquired as the initial modified form of the target object.
  • the initial deformed form may be the original form of the target object that has not been deformed, or the final form of the target object that has undergone a complete deforming process, or it may be an intermediate form between the original form and the final form.
  • the terminal 100 will use the original shape as the initial modified shape of the target object, and if the last modified shape of the target object is before the change occurs In the final form, the terminal 100 uses the final form as the initial modified form of the target object.
  • the terminal 100 can determine whether the object recognition result has changed. First, the terminal 100 can obtain an object recognition result for a target object in an image in real time; the object recognition result may include the target object is recognized in the image or the target object is not recognized in the image. The terminal 100 can recognize the corresponding target object such as the face in the image through an object recognition model such as a face recognition model and obtain the object recognition result, for example, the target object is recognized in the image or the target object is not recognized in the image .
  • an object recognition model such as a face recognition model
  • the terminal 100 can determine that the result of the object recognition has changed.
  • the terminal 100 detects that the result of the object recognition changes from identifying the target object in the image to not recognizing the target object in the image, it means that the terminal 100 can originally recognize that the target object is in the image, and then it may be due to factors such as occlusion. As a result, the terminal 100 fails to recognize the target object in the image. At this time, the terminal 100 determines that the object recognition result has changed. In addition, if the terminal 100 detects that the object recognition result is that the target object is not recognized in the image to the target object is recognized in the image, it means that the terminal 100 may not originally recognize the target object in the image due to factors such as occlusion. Afterwards, the terminal 100 may be able to recognize the target object in the image again due to factors such as the removal of the obstruction. At this time, the terminal 100 may also determine that the object recognition result has changed.
  • the terminal 100 when the terminal 100 takes a human face as a photographing target, the terminal 100 can display the photographed human face on its screen in real time, and the terminal 100 can track the position of the human face in each frame, mark the key points of the human face for beauty processing .
  • the terminal 100 when a person moves relatively fast, or suddenly turns his head, or suddenly moves outside the screen, or is blocked by an object to the face, the corresponding frame image has actually lost the key points of the face, that is, the terminal 100 is in the corresponding frame
  • the key points of the human face cannot be recognized on the image, and the object recognition result obtained is that the human face is not recognized on the image.
  • the terminal 100 can detect it in the image again
  • the object recognition result obtained by the terminal 100 is that a human face is recognized on the image, and it can be determined that the object recognition result has changed.
  • the terminal 100 may acquire the target variant form of the target object corresponding to the change.
  • the target modified form corresponding to the change is the final form of the target object that has undergone complete deformation processing
  • the variant form of the object is the final form of the target object that has undergone complete variant processing
  • the target variant form is the original form of the target object that has not undergone variant processing
  • the variant form of the target object before the change is an intermediate form between the original form and the final form
  • the restored form corresponding to the intermediate form before the above-mentioned change can be regarded as the target variant form.
  • the intermediate form corresponds to the corresponding before the aforementioned change.
  • the restored form is the original form, that is, the original form is used as the target variant form.
  • the restored form corresponding to the intermediate form before the above-mentioned change is the final form The form, that is, the final form as the target variant form.
  • the starting variant form and the target variant form are respectively used as the starting form and the ending form of the gradual change, and the target object is displayed in a gradual way.
  • the terminal 100 may display the target object in the form of a gradient on its display interface.
  • the gradual change has a starting form and an ending form. After obtaining the starting form and the target form, the terminal 100 can use the starting form as the starting form of the gradation and the target form as the ending form.
  • the object is shown as a gradual change from the initial form to the target variant form.
  • FIG. 3 is a schematic diagram showing the effect of an image processing method according to an embodiment.
  • the face 30 in the sixth image 311 is used as the target object, and the face 30 is blocked by the obstruction 40.
  • the terminal 100 displays the image in a gradual manner. Face 30.
  • the first modified form 31 may be the final form of the face 30 that has undergone a complete transformation process.
  • the terminal 100 uses the fourth modified form 34 as the target modified form.
  • the target modified form is the original form of the face 30 that has not undergone the modification process, and is like the second variant
  • the form 32 and the third variant form 33 are two possible intermediate forms between the original form and the final form.
  • the gradual change method is to pass the face 30 from the first variant form 31 through the middle one by one.
  • the obstruction 40 is removed, and the terminal 100 can restore the deformed form of the face 30.
  • the gradual change process is that the terminal 100 changes the face 30 from the first deformed form 31 to the middle form, that is, the second variant
  • the form 32 and the third variant form 33 gradually transition to the fourth variant form 34.
  • the occluder 40 is removed.
  • the terminal 100 can remove the former first form.
  • the restored form corresponding to the three variant form 33, that is, the first variant form 31, is used as the target variant form, and the third variant form 33 itself is used as the initial variant form, showing that the face 30 changes from the third variant form 33 to the first variant form 31.
  • the dynamic adaptation of the deformation effect is made according to the dynamic changes of the target object such as the face in the image to avoid the screen from flickering, and to avoid the sudden change of the deformation effect caused by the sudden appearance or loss of the target object in the image.
  • the screen flickers in the scene where the face is beautified, it can avoid the appearance of the face in the image from scratch or from the moment the beauty process to the image, and optimize the deformation processing effect.
  • the terminal 100 when the terminal 100 detects that the object recognition result for the target object in the image has changed, the terminal 100 obtains the last modified form of the target object before the change occurs as the initial modified form of the target object , And obtain the target variant form of the target object corresponding to the above-mentioned changes, so that the terminal 100 regards the initial variant form and the target variant form as the starting form and the ending form of the gradual change respectively, and displays the target object in a gradual manner.
  • the solution of the embodiment of the present disclosure can perform dynamic adaptation modification processing for the target object according to the dynamic change of the object recognition result, and make the display on the terminal 100 through the gradual process of gradual change from the initial variant form of the target object to the target variant form.
  • the target object displayed on the interface gradually transitions from the initial variant form to the target variant form, avoiding sudden changes in the variant effect caused by the sudden appearance or loss of the target object in the image and causing the screen to flicker, and optimizing the variant processing effect of the target object .
  • the target variant form in S202 may be the final variant form of performing variant processing on the target object triggered by a change in the object recognition result.
  • the target variant form is the form of the target object without the variant processing;
  • the object recognition result is The change is from the target object not recognized in the image to when the target object is recognized in the image, the target variant form is the form in which the target object undergoes a complete variant processing.
  • the target variant form when the face recognition result changes from the recognition of the human face in the image to the non-recognized human face in the image, the target variant form can be a state without face-lifting effect;
  • the target variant form can be the final face-lifting effect state.
  • Fig. 4 is a flow chart showing a method for displaying a target object according to an embodiment.
  • the initial variant form and the target variant form are respectively used as the starting form and the ending form of the gradual change, and the target is displayed in a gradual manner.
  • Object
  • the variant range of the target object is obtained.
  • the terminal 100 may obtain the modification range of the target object according to the initial modification form and the target modification form of the target object; the modification range refers to the change range of the modification form of the target object.
  • the target object is displayed according to the gradual speed corresponding to the deformation range.
  • the terminal 100 may determine an appropriate gradual change speed according to the magnitude of the change amplitude.
  • the magnitude of the change range is related to the initial variant form and the target variant form.
  • the first case is: the initial variant form is the first variant form 31, the target variant form is the fourth variant form 34, and the second case is: the initial variant
  • the form is the third modification form 33, and the target modification form is the first modification form 31.
  • the first case corresponds to a larger deformation range than the second case, because it needs to change from the final form to the original form, while the second case only needs to change from the intermediate form to the final form. form.
  • the terminal 100 can set corresponding gradation speeds for the two variant amplitudes, and the gradation speed set in the first case is slightly faster than the gradation speed set in the second case, so that when the target object is in In different initial deformation forms, the corresponding gradual change speed can be flexibly adapted according to the corresponding deformation range to show the gradual change process of the target object.
  • FIG. 5 is a flow chart of a method for obtaining a modification range according to an embodiment.
  • Obtaining the modification range of the target object according to the initial modification shape and the target modification shape in S401 may include:
  • the key points of the target object are the pixels on the image used to deform the target object.
  • the terminal 100 can identify and mark the key points of the target object, such as a human face, on the image, and perform deformation processing such as liquefaction transformation on the target object through the key points, so as to achieve the beauty of the human face. And other variant effects.
  • the terminal 100 may obtain the initial position of the key point of the target object on the image according to the initial variant form of the target object, and obtain the key point of the target object according to the target variant form of the target object. The target location on the image.
  • the terminal 100 may use the distance between the initial position of the key point of the target object on the image and the target position as the variation range of the target object. Among them, if the distance between the starting position and the target position is greater, the range of the target object's deformation is greater, and the terminal 100 needs to make a relatively large gradual change of the target object. If the distance between the starting position and the target position is The smaller the value, the smaller the deformation range of the target object, that is, the terminal 100 only needs to perform a relatively small gradual deformation of the target object.
  • the solution of the embodiment of the present disclosure can accurately and efficiently determine the modification range of the target object, thereby optimizing the modification processing effect of the target object.
  • FIG. 6 is a flow chart of a method for acquiring a gradual speed according to an embodiment. Before the target object is displayed at the gradual speed adapted to the deformation amplitude in S502, the method may further include the following:
  • a preset modification duration threshold of the target object is acquired.
  • a modification speed threshold is obtained according to the modification amplitude and the modification duration threshold.
  • the terminal 100 may obtain a preset modification duration threshold for the target object.
  • the modification duration threshold can be the longest time of the gradual change process of the target object, and can be used to limit the gradual change speed of the target object, so that the gradual change process of the target object is relatively continuous and the change of the target object progresses slowly and slightly.
  • the modification speed threshold can be set to 2 seconds.
  • the terminal 100 may obtain the modification speed threshold according to the modification amplitude and the modification duration threshold.
  • the terminal 100 may use the ratio of the modification amplitude to the modification duration threshold as the modification speed threshold.
  • the modification range may be the distance between the starting position of the key point of the target object on the image and the target position, and the ratio of the distance to the modification speed threshold is used as the modification speed threshold.
  • the terminal 100 may obtain a suitable gradual speed according to the modified speed threshold.
  • the terminal 100 may use a gradual speed not greater than the threshold of the deformed speed as the gradual speed adapted to the extent of the deformed.
  • the gradual change speed may be a constant value not greater than the above-mentioned deformation speed threshold, so that the target object gradually changes from the initial deformation form to the target deformation form at a constant speed, further making the gradual change process more continuous and slightly deformed.
  • the terminal 100 may also directly use the deformation speed threshold as the gradual change speed.
  • displaying the target object at a gradual speed adapted to the magnitude of the deformation in S402 includes:
  • the key point of the target object is gradually moved from the starting position of the key point on the image to the target position of the key point on the image to show the gradual change of the target object from the initial form to the end form .
  • the embodiment of the present disclosure mainly realizes the gradual process of the target object from the initial form to the end form by moving the position of the key point of the target object on the image.
  • the position of the key point of the target object on the image includes the starting position and the target position. These two positions can be obtained according to the starting variant form and the target variant form respectively. Among them, the starting position can be obtained according to the starting variant form.
  • the target variant form can get the target position.
  • an appropriate setting can be made for the gradual movement process of the key point gradually moving from the initial position on the image to the target position.
  • the terminal 100 can obtain the preset variation duration threshold of the target object, and use the ratio of the distance to the variation duration threshold as the gradual speed, and according to the gradual speed, the key points of the target object are gradually moved from the starting position on the image to The target position moves, so as to realize the gradual change of the target object from the initial form to the end form.
  • Fig. 7 is a flowchart showing an image processing method according to an embodiment.
  • the image processing method may be executed by the terminal 100 shown in Fig. 1 or a similar device thereof.
  • the terminal 100 obtains an object recognition result for a target object in the image.
  • the target object refers to a modified object
  • the object recognition result includes: the target object is recognized in the image or the target object is not recognized in the image.
  • the terminal 100 acquires the last modified form of the target object before the change occurs, as the initial modified form of the target object.
  • the terminal 100 acquires the target variant form of the target object corresponding to the change.
  • the terminal 100 obtains the starting position and the target position of the key point of the target object on the image according to the initial variant form and the target variant form, respectively.
  • the key points are pixels on the image that are used to deform the target object.
  • the terminal 100 obtains the modification range according to the distance between the starting position and the target position.
  • the terminal 100 may use the distance between the starting position and the target position as the range of modification.
  • the terminal 100 obtains a preset modification duration threshold of the target object.
  • the terminal 100 obtains the modification speed threshold according to the modification amplitude and the modification duration threshold.
  • the terminal 100 may use the ratio of the modification amplitude to the modification duration threshold as the modification speed threshold.
  • the terminal 100 may use the modified speed threshold as the gradual speed.
  • the terminal 100 gradually moves the key point of the target object from the starting position of the key point on the image to the target position of the key point on the image according to the gradual speed to show that the target object is moving from the initial form to the target position on the image. End the morphological gradient.
  • the above-mentioned image processing method can perform dynamic adaptation of the modification processing for the target object based on the key points of the target object according to the dynamic change of the object recognition result, and optimize the modification processing effect of the target object.
  • the method is applied to beautify the face image for description.
  • the terminal 100 can obtain each frame of image, identify and mark the key points of the face in the image, and perform liquefaction and beautification processing on the face through the key points to achieve face-lifting And other beauty effects.
  • face-lifting when a person moves relatively fast, or suddenly turns his head, or suddenly comes out of the screen and then comes in, or is blocked by an object to the face, the corresponding frame image has actually lost the key points of the face. If the method is used for processing, the face-lifting effect on the face is no longer valid. When the face reappears in the image, the face will suddenly become thinner. The video will record the moment when the face changes. For the live broadcast room, the audience will directly see the face-lift In the mutation process, the effect of beautifying the face is relatively poor, and it also affects the user experience.
  • the image processing method provided by the present disclosure can perform beautification processing on the face in the image.
  • first when there is a human face in the image, it can be used to track the position of the human face in each frame through face recognition and tracking, and mark the key points of the human face for beauty processing.
  • the key point position of the human face in the last frame can be recorded, the face-lifting effect of the last frame can be retained, and then the gradation process can be performed.
  • the starting point of the gradient as the face-lifting effect of the last frame of the human face
  • the final point of the gradient as the original shape of the human face, that is, the shape when the face-lifting beauty effect is completely removed. Then, you can make a 2 from the starting point to the final point.
  • the constant speed gradual recovery in seconds the gradual effect is realized as the pixel movement from the key point of the human face at the starting point to the key point of the human face at the final point.
  • 2 seconds is the preset maximum time for gradual change from the final face-lifting effect to the original shape of the face, and this time can be set according to actual scene needs.
  • the key points of the face change slowly from the starting point to the final point, the user generally cannot perceive this process, and generally the face appears again within this time, and the face is thinned from scratch, so the actual shooting is When the face suddenly changes, there will be no more shaking.
  • the starting point is defined as the current state of the face, where the state may be the face without the face-lifting effect, or it may be an intermediate state where the face-lifting effect slowly disappears;
  • the key to obtain the face Point the current position;
  • the final point is defined as the final state of face-lifting.
  • the final state can be obtained by calculating the face-lifting effect based on the current state of the face and the positions of key points, and a uniform gradual change with a speed of v is made from the starting point to the final point.
  • the user loses the face on the screen to reappear, and begins to gradually lose face. This is a continuous and relatively slow and slight change. It is also difficult for the user to observe obvious changes. Through this beautiful gradual logic processing, it can effectively avoid people.
  • the key point of the face is the phenomenon of face-lifting effect from scratch or from there to the moment.
  • Fig. 8 is a block diagram showing an image processing device according to an embodiment.
  • the image processing device 800 includes an initial form acquisition module 801, a target form acquisition module 802, and an object display module 803.
  • the initial shape acquisition module 801 is used to respond to the change in the object recognition result of the target object in the image, acquire the last modified shape of the target object before the change occurs, and use it as the initial modified shape of the target object;
  • the target object is an object subject to modification processing;
  • the target form acquisition module 802 is used to acquire the target variant form of the target object corresponding to the change;
  • the object display module 803 is configured to use the initial variant form and the target variant form as the starting form and the ending form of the gradation, respectively, to display the target object in a gradual manner.
  • the object display module 803 includes:
  • the amplitude acquisition unit is used to obtain the deformation amplitude of the target object according to the initial deformation shape and the target deformation shape; the deformation amplitude is the change amplitude of the modification shape of the target object;
  • the object display unit is used to display the target object according to the gradual speed adapted to the deformation range.
  • the amplitude acquisition unit is further configured to obtain the starting position and the target position of the key points of the target object on the image according to the initial variant form and the target variant form; the key points are on the image and are used for matching The pixel point of the target object undergoing deformation processing; the deformation range is obtained according to the distance between the starting position and the target position.
  • the object display unit is further configured to obtain a preset modification duration threshold of the target object; obtain the modification speed threshold according to the modification amplitude and the modification duration threshold; obtain a gradual speed not greater than the modification speed threshold as the Gradual speed.
  • the gradual speed is a constant value that is not greater than the deformation speed threshold.
  • the object display unit is further configured to gradually move the key points of the target object from the starting position of the key point on the image to the target position of the key point on the image according to the gradual speed, so as to display the target object Gradually from the initial form to the end form; among them, the starting position and target position of the key point on the image are obtained according to the initial variant form and the target variant form, respectively.
  • the image processing apparatus 800 further includes:
  • the result obtaining module is used to obtain the object recognition result for the target object in the image;
  • the object recognition result includes: the target object is recognized in the image or the target object is not recognized in the image;
  • the change judgment module is used to respond to the object recognition result from the target object recognized in the image to the target object not recognized in the image, or from the target object not recognized in the image to the target recognized in the image Object, determining that the object recognition result has changed.
  • the target variant form is the final variant form for performing variant processing on the target object triggered by a change in the object recognition result.
  • the target object in response to the object recognition result, is changed from the target object recognized in the image to the target object is not recognized in the image, and the target variant form is the target object A form that has not been deformed; in response to the object recognition result being changed from the target object not recognized in the image to the target object recognized in the image, the target variant form is the target The form of the object undergoing complete transformation processing.
  • Fig. 9 is an internal structure diagram of an electronic device according to an embodiment.
  • the electronic device 900 may be a mobile phone, a computer, a digital broadcasting terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like.
  • the electronic device 900 may include one or more of the following components: a processing component 902, a memory 904, a power supply component 906, a multimedia component 908, an audio component 910, and an input/output (Input/Output, I/O) interface 912 , A sensor component 914, and a communication component 916.
  • the processing component 902 generally controls the overall operations of the electronic device 900, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
  • the processing component 902 may include one or more processors 920 to execute instructions to complete all or part of the steps of the foregoing method.
  • the processing component 902 may include one or more modules to facilitate the interaction between the processing component 902 and other components.
  • the processing component 902 may include a multimedia module to facilitate the interaction between the multimedia component 908 and the processing component 902.
  • the memory 904 is configured to store various types of data to support operations in the electronic device 900. Examples of these data include instructions for any application or method operating on the electronic device 900, contact data, phone book data, messages, pictures, videos, and the like.
  • the memory 904 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random-Access Memory, SRAM), electrically erasable programmable read-only memory (Electrically erasable programmable read-only memory).
  • EEPROM Erasable Programmable Read-Only Memory
  • EPROM Erasable Programmable Read-Only Memory
  • PROM Programmable Read Only Memory
  • Read Only Memory ROM
  • magnetic memory flash memory, magnetic or optical disk.
  • the power supply component 906 provides power for various components of the electronic device 900.
  • the power supply component 906 may include a power management system, one or more power supplies, and other components associated with the generation, management, and distribution of power for the electronic device 900.
  • the multimedia component 908 includes a screen that provides an output interface between the electronic device 900 and the user.
  • the screen may include a liquid crystal display (Liquid Crystal Display, LCD) and a touch panel (Touch Panel, TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touch, sliding, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure related to the touch or slide operation.
  • the multimedia component 908 includes a front camera and/or a rear camera. When the electronic device 900 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
  • the audio component 910 is configured to output and/or input audio signals.
  • the audio component 910 includes a microphone (Microphone, MIC).
  • the microphone is configured to receive an external audio signal.
  • the received audio signal may be further stored in the memory 904 or transmitted via the communication component 916.
  • the audio component 910 further includes a speaker for outputting audio signals.
  • the I/O interface 912 provides an interface between the processing component 902 and a peripheral interface module.
  • the above-mentioned peripheral interface module may be a keyboard, a click wheel, a button, and the like. These buttons may include, but are not limited to: home button, volume button, start button, and lock button.
  • the sensor component 914 includes one or more sensors for providing the electronic device 900 with various aspects of state evaluation.
  • the sensor component 914 can detect the on/off state of the electronic device 900 and the relative positioning of the components.
  • the component is the display and the keypad of the electronic device 900, and the sensor component 914 can also detect the electronic device 900 or the electronic device 900.
  • the position of the component changes, the presence or absence of contact between the user and the electronic device 900, the orientation or acceleration/deceleration of the electronic device 900, and the temperature change of the electronic device 900.
  • the sensor component 914 may include a proximity sensor configured to detect the presence of nearby objects when there is no physical contact.
  • the sensor component 914 may also include a light sensor, such as a Complementary Metal-Oxide Semiconductor (CMOS) or Charge Coupled Device (CCD) image sensor for use in imaging applications.
  • CMOS Complementary Metal-Oxide Semiconductor
  • CCD Charge Coupled Device
  • the sensor component 914 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • the communication component 916 is configured to facilitate wired or wireless communication between the electronic device 900 and other devices.
  • the electronic device 900 can access a wireless network based on a communication standard, such as Wireless-Fidelity (WiFi), an operator network (such as 2G, 3G, 4G, or 5G), or a combination thereof.
  • WiFi Wireless-Fidelity
  • the communication component 916 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 916 further includes a Near Field Communication (NFC) module to facilitate short-range communication.
  • NFC Near Field Communication
  • the NFC module can be based on Radio Frequency Identification (RFID) technology, Infrared Data Association (Infrared Data Association, IrDA) technology, Ultra Wide Band (UWB) technology, Bluetooth (Bluetooth, BT) technology and other technologies. Technology to achieve.
  • RFID Radio Frequency Identification
  • IrDA Infrared Data Association
  • UWB Ultra Wide Band
  • Bluetooth Bluetooth, BT
  • the electronic device 900 may be used by one or more application specific integrated circuits (ASIC), digital signal processors (Digital Signal Processor Device, DSP), and digital signal processing devices (Digital Signal Processor Device). , DSPD), Programmable Logic Device (PLD), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), controller, microcontroller, microprocessor or other electronic components for implementation The above-mentioned image processing method.
  • ASIC application specific integrated circuits
  • DSP Digital Signal Processor Device
  • DSP Digital Signal Processor Device
  • DSP Digital Signal Processor Device
  • DSP Digital Signal Processor Device
  • DSPD Programmable Logic Device
  • PLD Programmable Logic Device
  • Field-Programmable Gate Array Field-Programmable Gate Array
  • FPGA Field-Programmable Gate Array
  • controller microcontroller, microprocessor or other electronic components for implementation The above-mentioned image processing method.
  • non-transitory computer-readable storage medium including instructions, such as the memory 904 including instructions, which can be executed by the processor 920 of the electronic device 900 to complete the foregoing image processing method.
  • the non-transitory computer-readable storage medium may be ROM, random access memory (Random Access Memory, RAM), compact disk read only memory (CD-ROM), magnetic tape, floppy disk, and optical data storage Equipment, etc.
  • a computer program product includes a computer program, the computer program is stored in a readable storage medium, and at least one processor of the device reads from the readable storage medium And execute the computer program, so that the device executes the image processing method described in the above embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Studio Devices (AREA)

Abstract

一种图像处理方法、装置、电子设备及存储介质,该方法包括响应于图像中目标对象的对象识别结果发生变化,获取变化发生前目标对象的最后变型形态,作为起始变型形态,获取与上述变化相对应的目标变型形态,将起始变型形态和目标变型形态分别作为渐变的起始形态和结束形态,以渐变方式展示目标对象。该方法能够根据对象识别结果的动态变化为目标对象进行动态适配的变型处理,通过从目标对象的起始变型形态向目标变型形态渐变的渐变过程,使得在显示界面上所展示的目标对象从起始变型形态逐渐地向目标变型形态过渡。

Description

图像处理方法、装置、电子设备及存储介质
本申请要求在2020年03月23日提交中国专利局、申请号为202010208723.6、申请名称为“图像处理方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开涉及图像处理技术,尤其涉及一种图像处理方法、装置、电子设备及存储介质。
背景技术
随着图像处理技术的发展,出现了对图像进行变型处理的技术,该技术可以对待处理图像当中包含的如脸部、手臂等目标对象进行变型处理,以达到对图像中的目标对象进行优化显示的效果。现有技术过于依赖识别目标对象的关键点,当关键点不准或丢失,针对于目标对象的变型效果便会直接丢失,而在显示界面上直接展示出未经处理的目标对象的图像;当目标对象又重新出现时,会再针对当前的目标对象识别关键点做变型处理,而最终的变型效果也是直接在显示界面上再次生效,从而会造成画面闪动。
发明内容
本公开提供一种图像处理方法、装置、电子设备及存储介质,以至少解决相关技术中对图像中目标对象的变型处理效果较差的问题。本公开的技术方案如下:
根据本公开实施例的第一方面,提供一种图像处理方法,包括:响应于图像中目标对象的对象识别结果发生变化,获取所述变化发生前所述目标对象的最后变型形态,作为所述目标对象的起始变型形态;所述目标对象为变型处理的对象;获取所述目标对象的与所述变化对应的目标变型形态;将所述起始变型形态、所述目标变型形态分别作为渐变的起始形态和结束形态,以渐变方式展示所述目标对象。
根据本公开实施例的第二方面,提供一种图像处理装置,包括:起始形态获取模块,用于响应于图像中目标对象的对象识别结果发生变化,获取所述变化发生前所述目标对象的最后变型形态,作为所述目标对象的起始变型形态;所述目标对象为变型处理的对象;目标形态获取模块,用于获取所述目标对象的与所述变化对应的目标变型形态;对象展示模块,用于将所述起始变型形态、所述目标变型形态分别作为渐变的起始形态和结束形态,以渐变方式展示所述目标对象。
根据本公开实施例的第三方面,提供一种电子设备,包括:处理器;用于存储所述处理器可执行指令的存储器;其中,所述处理器被配置为执行所述指令以实现响应于图像中 目标对象的对象识别结果发生变化,获取变化发生前所述目标对象的最后变型形态,作为所述目标对象的起始变型形态;所述目标对象为变型处理的对象;获取所述目标对象的与所述变化对应的目标变型形态;将所述起始变型形态、所述目标变型形态分别作为渐变的起始形态和结束形态,以渐变方式展示所述目标对象。
根据本公开实施例的第四方面,提供一种存储介质,当所述存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行如上所述的图像处理方法。
根据本公开实施例的第五方面,提供一种计算机程序产品,所述程序产品包括计算机程序,所述计算机程序存储在可读存储介质中,设备的至少一个处理器从所述可读存储介质读取并执行所述计算机程序,使得设备执行如上所述的图像处理方法。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理,并不构成对本公开的不当限定。
图1是根据一实施例示出的一种图像处理方法的应用环境图;
图2是根据一实施例示出的一种图像处理方法的流程图;
图3是根据一实施例示出的一种图像处理方法的效果示意图;
图4是根据一实施例示出的一种展示目标对象的方法的流程图;
图5是根据一实施例示出的一种获取变型幅度的方法的流程图;
图6是根据一实施例示出的一种获取渐变速度的方法的流程图;
图7是根据一实施例示出的一种图像处理方法的流程图;
图8是根据一实施例示出的一种图像处理装置的框图;
图9是根据一实施例示出的一种电子设备的内部结构图。
具体实施方式
为了使本领域普通人员更好地理解本公开的技术方案,下面将结合附图,对本公开实施例中的技术方案进行清楚、完整地描述。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方 面相一致的装置和方法的例子。
本公开所提供的图像处理方法,可以应用于如图1所示的应用环境中,图1是根据一实施例示出的一种图像处理方法的应用环境图,该应用环境中可以包括终端100,该终端100可以但不限于是各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备。
终端100可以通过其上配置的摄像头采集的用户10的图像,基于该图像对用户10的脸部11进行变型处理,例如可以以采集的图像中的人脸的关键点为基础,采用液化变型处理的方式对用户10的脸部11对应的图像进行瘦脸处理,以使得终端100在其显示界面上展示出经过瘦脸处理的图像。
在一些实施例中,终端100可以实时采集用户10的图像,以脸部作为变型处理的目标对象,并对脸部进行瘦脸处理,终端100可以显示出经过瘦脸处理的第一图像111,该第一图像111当中可以包括经瘦脸处理的脸部12。而当该第一图像111当中出现遮挡物20时,如第二图像112所示,遮挡物20对目标对象即脸部12形成一定程度的遮挡而使得终端100的脸部识别模型无法识别出脸部12,在这种情况下,相关技术中对脸部12的瘦脸效果失效,而会直接在显示界面上显示出第三图像113,第三图像113中的脸部13为未经瘦脸处理的脸部。另外,当遮挡物20从第三图像113移除时,如第四图像114所示,终端100可在该第四图像114中重新识别出脸部13,在这种情况下,相关技术中会重新对该脸部13进行瘦脸处理,并在其显示界面直接显示出第五图像115,该第五图像115的脸部12未经过瘦脸处理的脸部。这样,相关技术中在如人脸等目标对象从图像上丢失、或者又重新出现时,会造成画面闪动,对目标对象进行美型处理的效果较差。
本公开提供的图像处理方法,终端100可先判断图像中的目标对象的对象识别结果是否发生变化,当针对于图像中的目标对象的对象识别结果发生变化时,获取变化发生前目标对象的最后变型形态作为目标对象的起始变型形态,还获取该目标对象的与该变化对应的目标变型形态,然后,终端100可以在其显示界面上,将起始变型形态、目标变型形态分别作为渐变的起始形态和结束形态,以渐变方式展示目标对象。
在一些实施例中,本公开提供的图像处理方法,终端100第二图像112中的脸部12被遮挡物20遮挡时判断对象识别结果发生变化,即从能在图像上识别到脸部变化成不能在图像上识别到脸部,如第二图像112所示,由此终端100可以将发生变化前的脸部12在第一图像111的变型形态作为该脸部12的起始变型形态,该起始变型形态可以是瘦脸的最终形态,而可以将瘦脸处理前的脸部12的原始形态作为目标变型形态,该目标变型形态对应于第三图像113的脸部13的变型形态,在这种情况下,终端100可以将起始变型形态、目标变型形态分别作为渐变的起始形态和结束形态,在其显示界面上以渐变方式展示脸部,即展示从第二图像112的脸部12的变型形态向第三图像113的脸部13的变型形态 的渐变过程。
当第三图像113中的遮挡物20被移除时,终端100从不能在图像上识别到脸部变化成能在图像上识别到脸部,如第四图像114所示,由此终端100可以将发生变化前的脸部13在第三图像113的变型形态作为该脸部13的起始变型形态,该起始变型形态可以为瘦脸处理前的脸部的原始形态,而可以将瘦脸的最终形态作为目标变型状态,该目标变型状态对应于第五图像115的脸部12的变型形态,在这种情况下,终端100可以将起始变型形态、目标变型形态分别作为渐变的起始形态和结束形态,在其显示界面上以渐变方式展示脸部,即展示从第四图像114的脸部13的变型形态向第五图像115的脸部12的变型形态的渐变过程,从而可以避免由于人脸等目标对象在图像中突然出现或丢失等原因引起变型效果突变而造成画面闪动,优化目标对象的变型处理效果。
图2是根据一实施例示出的一种图像处理方法的流程图,如图2所示,该图像处理方法可以应用于如图1所示的终端100。
在S201,当针对于图像中的目标对象的对象识别结果发生变化时,获取变化发生前目标对象的最后变型形态,作为目标对象的起始变型形态。
在一些实施例中,终端100可以在实时拍摄视频或者直播时,获取每一帧图像并识别图像中的目标对象。其中,图像中的目标对象是指变型处理的对象,例如,该目标对象可以是人的脸部、手臂、眼睛或者下巴等。
当终端100检测到图像中的目标对象的对象识别结果发生变化时,获取变化发生前该目标对象的最后变型形态,作为该目标对象的起始变型形态。其中,该起始变型形态可以是该目标对象未经过变型处理的原始形态,也可以是该目标对象经过完整变型处理的最终形态,还可以是处于原始形态和最终形态之间的中间形态。比如,若变化发生前,该目标对象的最后变型形态如果是原始形态,则终端100将原始形态作为该目标对象的起始变型形态,而若变化发生前,该目标对象的最后变型形态如果是最终形态,则终端100将最终形态作为目标对象的起始变型形态。
在一些实施例中,终端100可以判断对象识别结果是否发生变化。首先,终端100可以实时获取针对于图像中的目标对象的对象识别结果;该对象识别结果可以包括在图像中识别到目标对象或者在图像中未识别到目标对象。终端100可以通过如人脸识别模型等对象识别模型对相应的如图像中的脸部等目标对象进行识别并得到对象识别结果,例如在图像中识别到目标对象或者在图像中未识别到目标对象。其次,当终端100检测到对象识别结果从在图像中识别到目标对象,变化为在图像中未识别到目标对象时,或者,当对象识别结果从在图像中未识别到目标对象,变化为在图像中识别到目标对象时,终端100可以判断出对象识别结果发生变化。
其中,如果终端100检测到对象识别结果是从在图像中识别到目标对象变化为在图像 中未识别到目标对象,则说明原本终端100能够识别到目标对象位于图像当中,而后可能由于遮挡等因素造成终端100未能在图像中识别到目标对象,此时终端100判断对象识别结果发生变化。另外,如果终端100检测到对象识别结果是从图像中未识别到目标对象变化为在图像中识别到目标对象,则说明可能由于遮挡等因素造成终端100原本未能在图像中识别到目标对象,而后可能由于遮挡物被移除等因素,终端100又能重新在图像中识别到目标对象,此时终端100也可以判定对象识别结果发生变化。
例如,当终端100以人脸做为拍摄目标时,终端100可以在其屏幕上实时显示其拍摄的人脸,终端100可以追踪每一帧的人脸位置,标记人脸关键点进行美型处理。其中,当人移动比较快、或者突然转头、或者突然移到屏幕外面、或者被物体遮挡到人脸时,相应的帧图像其实都已经丢失了人脸关键点,即终端100在相应的帧图像上无法识别出人脸关键点,从而得到的对象识别结果为在图像上未识别到人脸,而当例如人脸从屏幕外面移回屏幕内时,终端100又可以重新在图像中检测到人脸,则终端100得到的对象识别结果为在图像上识别到人脸,并可以判断出对象识别结果发生了变化。
在S202,获取目标对象的与变化对应的目标变型形态。
在一些实施例中,终端100可以获取目标对象的与变化对应的目标变型形态。
在一些实施例中,如果变化之前目标对象的变型形态为该目标对象未经过变型处理的原始形态,则与变化对应的目标变型形态为该目标对象经过完整变型处理的最终形态;如果变化之前目标对象的变型形态为该目标对象经过完整变型处理的最终形态,则目标变型形态为该目标对象未经过变型处理的原始形态;如果变化之前目标对象的变型形态为原始形态与最终形态的中间形态,则可以将中间形态在发生上述变化之前所对应的还原形态作为目标变型形态,比如,如果在变化之前目标对象的变型形态从原始形态变化至中间形态,该中间形态在发生上述变化之前所对应的还原形态为原始形态,即将原始形态作为目标变型形态,同理,如果在变化之前目标对象的变型形态从最终形态变化至中间形态,则该中间形态在发生上述变化之前所对应的还原形态为最终形态,即将最终形态作为目标变型形态。
在S203,将起始变型形态、目标变型形态分别作为渐变的起始形态和结束形态,以渐变方式展示目标对象。
在一些实施例中,终端100可以在其显示界面上以渐变的形式展示目标对象。其中,渐变具有起始形态和结束形态,终端100在获取到起始变型形态和目标变型形态后,可将起始变型形态作为渐变的起始形态,以及将目标变型形态作为结束形态,将目标对象展示为从该起始形态向目标变型形态渐变。
图3是根据一实施例示出的一种图像处理方法的效果示意图,第六图像311中的脸部30作为目标对象,该脸部30被遮挡物40遮挡,此时终端100以渐变方式展示该脸部30。 假设该脸部30在该第六图像311的起始变型形态为第一变型形态31所示,该第一变型形态31可以是该脸部30的经过完整变型处理的最终形态,当该第一变型形态31下的脸部30被遮挡物40遮挡时,终端100将第四变型形态34作为目标变型形态,该目标变型形态为该脸部30未经过变型处理的原始形态,而如第二变型形态32、第三变型形态33为处于原始形态和最终形态之间的其中两种可能的中间形态,终端100展示目标对象时,渐变方式为,将脸部30从第一变型形态31依次通过中间形态即第二变型形态32和第三变型形态33,逐步过渡至第四变型形态34,反之亦然。
在渐变过程中,遮挡物40被移除,终端100可以将人脸30的变型形态进行恢复,例如,当渐变过程为终端100将脸部30从第一变型形态31依次中间形态即第二变型形态32和第三变型形态33,逐步过渡至第四变型形态34,假设当脸部30渐变至第三变型形态33时,遮挡物40被移除,此时终端100可以将移除前该第三变型形态33对应的还原形态即第一变型形态31作为目标变型形态,而第三变型形态33本身作为起始变型形态,展示脸部30从第三变型形态33渐变至第一变型形态31。通过这种方式,可以实现人脸从图像中丢失又重新在图像中出现等情况下的渐变瘦脸,而该过程可以控制为一个连续并且变化比较缓慢轻微的过程,以使得终端100的用户观察不到明显变化,从而根据人脸等目标对象在图像中的动态变化做变型效果的动态适配而避免画面发生闪动,避免由于目标对象在图像中突然出现或丢失等原因引起变型效果突变而造成画面闪动,在对人脸进行美型处理的场景之下,能够避免人脸在图像上从无到有或者从有到无时进行美型处理时产生露馅现象,优化变型处理效果。
上述图像处理方法中,当终端100检测到针对于图像中的目标对象的对象识别结果发生变化的时候,终端100获取变化发生之前该目标对象的最后变型形态,作为该目标对象的起始变型形态,并获取该目标对象的与上述变化相对应的目标变型形态,从而终端100将起始变型形态和目标变型形态分别作为渐变的起始形态和结束形态,以渐变方式展示目标对象。
本公开实施例的方案,能够根据对象识别结果的动态变化为目标对象进行动态适配的变型处理,通过从目标对象的起始变型形态向目标变型形态渐变的渐变过程,使得在终端100的显示界面上所展示的目标对象从起始变型形态逐渐地向目标变型形态过渡,避免由于目标对象在图像中突然出现或丢失等原因引起变型效果突变而造成画面闪动,优化目标对象的变型处理效果。
在一些实施例中,S202中的目标变型形态,可以是对象识别结果的变化所触发的对目标对象进行变型处理的最终变型形态。进一步的,当该对象识别结果的变化为从在图像中识别到目标对象,变化为在图像中未识别到目标对象时,目标变型形态为目标对象未经变型处理的形态;当对象识别结果的变化为从在图像中未识别到目标对象,变化为在图像中 识别到目标对象时,目标变型形态为目标对象经过完整变型处理的形态。
以人脸作为目标对象为例,当人脸识别结果的变化为从在图像中识别到人脸,变化为在图像中未识别到人脸时,目标变型形态可以为无瘦脸效果状态;当人脸识别结果的变化为从在图像中未识别到人脸,变化为在图像中识别到人脸时,目标变型形态可以为最终瘦脸效果状态。
图4是根据一实施例示出的一种展示目标对象的方法的流程图,S203中的将起始变型形态、目标变型形态分别作为渐变的起始形态和结束形态,以渐变方式展示所述目标对象。
在S401,根据起始变型形态和目标变型形态,得到目标对象的变型幅度。
其中,终端100可以根据目标对象的起始变型形态和目标变型形态,获取该目标对象的变型幅度;该变型幅度是指该目标对象的变型形态的变化幅度。
在S402,按照与变型幅度相适应的渐变速度,展示目标对象。
在一些实施例中,终端100可以根据变化幅度的大小,确定合适的渐变速度。一般来说,变化幅度越大,则渐变速度相应也越大,而变化幅度越小,渐变速度则越小。其中,变化幅度的大小与起始变型形态和目标变型形态有关。
结合图3进行说明,对其中两种情况进行分析,第一种情况为:起始变型形态为第一变型形态31、目标变型形态为第四变型形态34,第二种情况为:起始变型形态为第三变型形态33、目标变型形态为第一变型形态31。对此,第一种情况所对应的变型幅度比第二种情况所对应的变型幅度要大,因为其要从最终形态变型至原始形态,而第二种情况则只需要从中间形态变化至最终形态。这样,终端100可以为这两种变型幅度分别设置对应的渐变速度,而第一种情况下设置的渐变速度比第二种情况下设置的渐变速度要稍微快一点些,从而实现当目标对象处于不同的起始变型形态时,能够根据其对应的变型幅度灵活适配相应的渐变速度以展示目标对象的渐变过程。
在一些实施例中,图5是根据一实施例示出的一种获取变型幅度的方法的流程图,S401中的根据起始变型形态和目标变型形态,得到目标对象的变型幅度,可以包括:
在S501,根据起始变型形态和目标变型形态,分别得到目标对象的关键点在图像上的起始位置和目标位置。
其中,目标对象的关键点为图像上用于对目标对象进行变型处理的像素点。在具体的应用场景中,终端100可以在图像上识别并且标记出如人脸等目标对象的关键点,通过关键点对目标对象进行如液化变型等变型处理,从而达到如对人脸进行美型等变型效果。
在一些实施例中,终端100可以根据目标对象的起始变型形态,获取该目标对象的关键点在图像上的起始位置,根据该目标对象的目标变型形态,获取该目标对象的关键点在图像上的目标位置。
在S502,根据起始位置和目标位置之间的距离,得到变型幅度。
在一些实施例中,终端100可以将目标对象的关键点在图像上的起始位置与目标位置之间的距离,作为该目标对象的变型幅度。其中,如果起始位置与目标位置之间的距离越大,则目标对象的变型幅度越大,终端100需要对目标对象进行比较大幅度的渐变变型,如果起始位置与目标位置之间的距离越小,则目标对象的变型幅度越小,即终端100只需要对目标对象进行比较小幅度的渐变变型。
本公开实施例的方案可以准确且高效地确定出目标对象的变型幅度,以此优化目标对象的变型处理效果。
在一些实施例中,图6是根据一实施例示出的一种获取渐变速度的方法的流程图,在上述S502的按照与变型幅度相适应的渐变速度,展示目标对象之前,还可以包括如下:
在S601,获取预设的目标对象的变型时长阈值。
在S602,根据变型幅度和变型时长阈值,得到变型速度阈值。
在S603,获取不大于变型速度阈值的渐变速度,作为与变型幅度相适应的渐变速度。
在一些实施例中,终端100可以获取预先设置好的针对于目标对象的变型时长阈值。其中,该变型时长阈值可以是目标对象的渐变过程的最长时间,可以用于限制目标对象的渐变速度,以使得目标对象的渐变过程比较连续并使目标对象的变化缓慢轻微地进行,在一些实施例当中,该变型速度阈值可以设为2秒。然后,终端100可以根据变型幅度和变型时长阈值,得到变型速度阈值。终端100可以将变型幅度与变型时长阈值的比值作为变型速度阈值。比如,变型幅度可以是目标对象的关键点在图像上的起始位置与目标位置之间的距离,用该距离与变型速度阈值的比值作为变型速度阈值。
在得到变型速度阈值后,终端100可以根据该变型速度阈值,获取合适的渐变速度。本公开实施例中,为了使目标对象可以以较缓慢的速度从起始变型形态向目标变型形态渐变,终端100可将不大于变型速度阈值的渐变速度,作为与变型幅度相适应的渐变速度。进一步的,在一些实施例中,渐变速度可以是一个不大于上述变型速度阈值的恒定值,以使目标对象匀速地从起始变型形态向目标变型形态渐变,进一步使得渐变过程更连续而变型轻微,为便于渐变速度的设定,终端100也可以直接将变型速度阈值作为渐变速度。
在一些实施例中,S402中的按照与变型幅度相适应的渐变速度,展示目标对象,包括:
按照上述渐变速度,将目标对象的关键点,从该关键点在图像上的起始位置逐渐向该关键点在该图像上的目标位置移动,以展示目标对象从起始形态向结束形态的渐变。
本公开实施例主要是终端100通过将目标对象的关键点在图像上的位置移动,实现目标对象从起始形态向结束形态的渐变过程。该目标对象的关键点在图像上的位置包括起始位置和目标位置,这两个位置可以分别根据起始变型形态和目标变型形态得到,其中,根据起始变型形态可以得到起始位置,根据目标变型形态可以得到目标位置。
本公开实施例的方案,可以根据目标对象的关键点在图像上的起始位置与目标位置之 间的距离,为关键点从图像上的起始位置逐渐向目标位置移动的逐渐移动过程设置合适的渐变速度,终端100可以获取预设的目标对象的变型时长阈值,将距离与该变型时长阈值的比值作为渐变速度,按照该渐变速度将目标对象的关键点从图像上的起始位置逐渐向目标位置移动,从而实现目标对象从起始形态向结束形态的渐变。
图7是根据一实施例示出的一种图像处理方法的流程图,所述图像处理方法可以以图1所示的终端100或者其类似设备为执行主体。
在S701,终端100获取针对于图像中的目标对象的对象识别结果。
在一些实施例中,目标对象是指变型处理的对象,对象识别结果包括:在图像中识别到目标对象或者在图像中未识别到目标对象。
在S702,当对象识别结果从在图像中识别到目标对象,变化为在图像中未识别到目标对象时,或者,当对象识别结果从在图像中未识别到目标对象,变化为在图像中识别到目标对象时,终端100判断对象识别结果发生变化。
在S703,当针对于图像中的目标对象的对象识别结果发生变化时,终端100获取变化发生前目标对象的最后变型形态,作为目标对象的起始变型形态。
在S704,终端100获取目标对象的与变化对应的目标变型形态。
在S705,终端100根据起始变型形态和目标变型形态,分别得到目标对象的关键点在图像上的起始位置和目标位置。在一些实施例中,关键点为图像上,用于对目标对象进行变型处理的像素点。
在S706,终端100根据起始位置和目标位置之间的距离,得到变型幅度。
其中,终端100可以将起始位置和目标位置之间的距离作为变型幅度。
在S707,终端100获取预设的目标对象的变型时长阈值。
在S708,终端100根据变型幅度和变型时长阈值,得到变型速度阈值。终端100可以将变型幅度与变型时长阈值的比值作为变型速度阈值。
在S709,获取不大于变型速度阈值的渐变速度,作为与变型幅度相适应的渐变速度。
其中,终端100可以将变型速度阈值作为渐变速度。
在S710,终端100按照渐变速度,将目标对象的关键点,从该关键点在图像上的起始位置逐渐向该关键点在该图像上的目标位置移动,以展示目标对象从起始形态向结束形态渐变。
上述图像处理方法,可基于目标对象的关键点,根据对象识别结果的动态变化为目标对象进行动态适配的变型处理,优化目标对象的变型处理效果。
为了更清晰阐述本公开提供的图像处理方法,以该方法应用于对人脸图像进行美型处理进行说明。
总体来说,通过终端100进行实时拍摄视频或者直播时,终端100可取得每一帧图像, 识别并且标记出图像中人脸的关键点,通过关键点对人脸进行液化美型处理,达到瘦脸等美型效果。其中,当人移动比较快、或者突然转头、或者突然出到屏幕外面再进来时、或者被物体遮挡到人脸时,相应的帧图像其实都已经丢失了人脸的关键点,如果按照常规方式进行处理的话,对人脸的瘦脸效果已经失效,当图像中再出现脸时会再突然瘦脸,视频会录制上变脸抖动的一瞬间,而对于直播间里面,观众则会直接看到这个瘦脸突变过程,对人脸进行美型的效果比较差,也影响用户体验。
本公开提供的图像处理方法,可对图像中的人脸进行美型处理。在一些实施例中,首先,当图像上有人脸时,可以通过人脸识别与跟踪用于追踪每一帧的人脸位置,标记人脸的关键点做美型处理。
其次,当人脸丢失时,可以记录下最后一帧有人脸的关键点位置,保留下该最后一帧的瘦脸效果,然后进行渐变处理。定义渐变的起始点为有人脸的最后一帧的瘦脸效果,定义渐变的最终点是人脸的原始形态即完全去掉瘦脸美型效果时的形态,然后,可以从起始点到最终点做一个2秒的匀速渐变恢复,渐变效果实现为起始点的人脸的关键点到最终点的人脸的关键点的像素移动。其中,2秒为从最终瘦脸效果渐变到人脸原始形态的预设最长时间,该时间可以根据实际场景需要进行设定。由此,可以得到人脸的渐变的平均速度为v=人脸的关键点的变化幅度即人脸关键点像素之间的距离/预设最长时间2秒。其中,因为人脸的关键点从起始点到最终点的变化比较缓慢,用户一般无法察觉这个过程,并且一般在这个时间内又出现人脸,又开始从无到有的瘦脸,所以实际拍摄中人脸忽有忽无时,便不会再有抖动现象。
最后,当再次检测到人脸的关键点时,定义起始点为人脸目前的状态,其中,该状态可能是无瘦脸效果的人脸,也可能是瘦脸效果缓慢消失的中间态;获取人脸关键点目前的位置;定义最终点是瘦脸最终态,该最终态可以基于人脸目前的状态和关键点的位置计算瘦脸效果得到,从起始点到最终点做一个速度为v的匀速渐变变化。
由此,用户从画面丢失人脸到又出现人脸,开始渐变瘦脸,是一个连续并且变化比较缓慢轻微的过程,用户也难以观察到明显变化,通过这个美型渐变逻辑处理,能有效避免人脸的关键点从无到有或者从有到无时的瘦脸效果露馅现象。
应该理解的是,虽然图2、图4至图7的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2、图4至图7中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。
图8是根据一实施例示出的一种图像处理装置的框图。参照图8,该图像处理装置800包括起始形态获取模块801、目标形态获取模块802和对象展示模块803。
起始形态获取模块801,用于响应于图像中目标对象的对象识别结果发生变化,获取变化发生前目标对象的最后变型形态,作为目标对象的起始变型形态;目标对象为变型处理的对象;
目标形态获取模块802,用于获取目标对象的与变化对应的目标变型形态;
对象展示模块803,用于将起始变型形态、目标变型形态分别作为渐变的起始形态和结束形态,以渐变方式展示目标对象。
在一些实施例中,对象展示模块803,包括:
幅度获取单元,用于根据起始变型形态和目标变型形态,得到目标对象的变型幅度;变型幅度为目标对象的变型形态的变化幅度;
对象展示单元,用于按照与变型幅度相适应的渐变速度,展示目标对象。
在一些实施例中,幅度获取单元,进一步用于根据起始变型形态和目标变型形态,分别得到目标对象的关键点在图像上的起始位置和目标位置;关键点为图像上,用于对目标对象进行变型处理的像素点;根据起始位置和目标位置之间的距离,得到变型幅度。
在一些实施例中,对象展示单元,还用于获取预设的目标对象的变型时长阈值;根据变型幅度和变型时长阈值,得到变型速度阈值;获取不大于变型速度阈值的渐变速度,作为所述渐变速度。
在一些实施例中,渐变速度为不大于变型速度阈值的恒定值。
在一些实施例中,对象展示单元,进一步用于按照渐变速度,将目标对象的关键点,从关键点在图像上的起始位置逐渐向关键点在图像上的目标位置移动,以展示目标对象从起始形态向结束形态渐变;其中,关键点在图像上的起始位置和目标位置,分别根据起始变型形态和目标变型形态得到。
在一些实施例中,图像处理装置800,还包括:
结果获取模块,用于获取针对于图像中的目标对象的对象识别结果;对象识别结果包括:在图像中识别到目标对象或者在图像中未识别到目标对象;
变化判断模块,用于响应于所述对象识别结果由在图像中识别到目标对象变化为在图像中未识别到目标对象,或由在图像中未识别到目标对象变化为在图像中识别到目标对象,判断所述对象识别结果发生变化。
在一些实施例中,目标变型形态为对象识别结果的变化所触发的对目标对象进行变型处理的最终变型形态。
在一些实施例中,响应于所述对象识别结果从在所述图像中识别到所述目标对象变化为在所述图像中未识别到所述目标对象,所述目标变型形态为所述目标对象未经变型处理 的形态;响应于所述对象识别结果从在所述图像中未识别到所述目标对象变化为在所述图像中识别到所述目标对象,所述目标变型形态为所述目标对象经过完整变型处理的形态。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
图9是根据一实施例示出的一种电子设备的内部结构图。例如,电子设备900可以是移动电话、计算机、数字广播终端、消息收发设备、游戏控制台、平板设备、医疗设备、健身设备、个人数字助理等。
参照图9,电子设备900可以包括以下一个或多个组件:处理组件902、存储器904、电源组件906、多媒体组件908、音频组件910、输入/输出(Input/Output,I/O)的接口912、传感器组件914以及通信组件916。
处理组件902通常控制电子设备900的整体操作,诸如与显示、电话呼叫、数据通信、相机操作和记录操作相关联的操作。处理组件902可以包括一个或多个处理器920来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件902可以包括一个或多个模块,便于处理组件902和其他组件之间的交互。例如,处理组件902可以包括多媒体模块,以方便多媒体组件908和处理组件902之间的交互。
存储器904被配置为存储各种类型的数据以支持在电子设备900的操作。这些数据的示例包括用于在电子设备900上操作的任何应用程序或方法的指令、联系人数据、电话簿数据、消息、图片、视频等。存储器904可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(Static Random-Access Memory,SRAM)、电可擦除可编程只读存储器(Electrically-Erasable Programmable Read-Only Memory,EEPROM)、可擦除可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM)、可编程只读存储器(Programmable Read Only Memory,PROM)、只读存储器(Read Only Memory,ROM)、磁存储器、快闪存储器、磁盘或光盘。
电源组件906为电子设备900的各种组件提供电力。电源组件906可以包括电源管理系统,一个或多个电源,及其他与为电子设备900生成、管理和分配电力相关联的组件。
多媒体组件908包括在所述电子设备900和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(Liquid Crystal Display,LCD)和触摸面板(Touch Panel,TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件908包括一个前置摄像头和/或后置摄像头。当电子设备900处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜 系统或具有焦距和光学变焦能力。
音频组件910被配置为输出和/或输入音频信号。例如,音频组件910包括一个麦克风(Microphone,MIC),当电子设备900处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器904或经由通信组件916发送。在一些实施例中,音频组件910还包括一个扬声器,用于输出音频信号。
I/O接口912为处理组件902和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件914包括一个或多个传感器,用于为电子设备900提供各个方面的状态评估。例如,传感器组件914可以检测到电子设备900的打开/关闭状态,组件的相对定位,例如所述组件为电子设备900的显示器和小键盘,传感器组件914还可以检测电子设备900或电子设备900一个组件的位置改变,用户与电子设备900接触的存在或不存在,电子设备900方位或加速/减速和电子设备900的温度变化。传感器组件914可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件914还可以包括光传感器,如互补性氧化金属半导体(Complementary Metal-Oxide Semiconductor,CMOS)或电荷藕合器件(Charge Coupled Device,CCD)图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件914还可以包括加速度传感器、陀螺仪传感器、磁传感器、压力传感器或温度传感器。
通信组件916被配置为便于电子设备900和其他设备之间有线或无线方式的通信。电子设备900可以接入基于通信标准的无线网络,如无线保真(Wireless-Fidelity,WiFi),运营商网络(如2G、3G、4G或5G),或它们的组合。在一个实施例中,通信组件916经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个实施例中,所述通信组件916还包括近场通信(Near Field Communication,NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(Radio Frequency Identification,RFID)技术,红外数据协会(Infrared Data Association,IrDA)技术,超宽带(Ultra Wide Band,UWB)技术,蓝牙(Bluetooth,BT)技术和其他技术来实现。
在一些实施例中,电子设备900可以被一个或多个应用专用集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processor Device,DSP)、数字信号处理设备(Digital Signal Processor Device,DSPD)、可编程逻辑器件(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述图像处理方法。
在一些实施例中,还提供了一种包括指令的非临时性计算机可读存储介质,例如包括 指令的存储器904,上述指令可由电子设备900的处理器920执行以完成上述图像处理方法。例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(Random Access Memory,RAM)、光盘只读存储器(Compact Disk Read Only Memory,CD-ROM)、磁带、软盘和光数据存储设备等。
在一些实施例中,还提供了一种计算机程序产品,所述程序产品包括计算机程序,所述计算机程序存储在可读存储介质中,设备的至少一个处理器从所述可读存储介质读取并执行所述计算机程序,使得设备执行如上实施例所述的图像处理方法。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本申请旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。

Claims (28)

  1. 一种图像处理方法,包括:
    响应于图像中目标对象的对象识别结果发生变化,获取变化发生前所述目标对象的最后变型形态,作为所述目标对象的起始变型形态;所述目标对象为变型处理的对象;
    获取所述目标对象的与所述变化对应的目标变型形态;
    将所述起始变型形态、所述目标变型形态分别作为渐变的起始形态和结束形态,以渐变方式展示所述目标对象。
  2. 根据权利要求1所述的图像处理方法,所述将所述起始变型形态、所述目标变型形态分别作为渐变的起始形态和结束形态,以渐变方式展示所述目标对象,包括:
    根据所述起始变型形态和目标变型形态,得到所述目标对象的变型幅度;所述变型幅度为所述目标对象的变型形态的变化幅度;
    按照与所述变型幅度相适应的渐变速度,展示所述目标对象。
  3. 根据权利要求2所述的图像处理方法,所述根据所述起始变型形态和目标变型形态,得到所述目标对象的变型幅度,包括:
    根据所述起始变型形态和所述目标变型形态,分别得到所述目标对象的关键点在所述图像上的起始位置和目标位置;所述关键点为所述图像上,用于对所述目标对象进行变型处理的像素点;
    根据所述起始位置和目标位置之间的距离,得到所述变型幅度。
  4. 根据权利要求2所述的图像处理方法,还包括:
    获取预设的所述目标对象的变型时长阈值;
    根据所述变型幅度和变型时长阈值,得到变型速度阈值;
    获取不大于所述变型速度阈值的渐变速度,作为所述渐变速度。
  5. 根据权利要求4所述的图像处理方法,所述渐变速度为不大于所述变型速度阈值的恒定值。
  6. 根据权利要求2所述的图像处理方法,所述按照与所述变型幅度相适应的渐变速度,展示所述目标对象,包括:
    按照所述渐变速度,将所述目标对象的关键点,从所述关键点在所述图像上的起始位置逐渐向所述关键点在所述图像上的目标位置移动,以展示所述目标对象从所述起始形态向所述结束形态渐变;其中,所述关键点在所述图像上的所述起始位置和所述目标位置,分别根据所述起始变型形态和所述目标变型形态得到。
  7. 根据权利要求1所述的图像处理方法,确定所述图像中目标对象的对象识别结果发生变化包括:
    获取针对于所述图像中的目标对象的对象识别结果;所述对象识别结果包括:在图像 中识别到目标对象或者在图像中未识别到目标对象;
    响应于所述对象识别结果由在图像中识别到目标对象变化为在图像中未识别到目标对象,或由在图像中未识别到目标对象变化为在图像中识别到目标对象,判断所述对象识别结果发生变化。
  8. 根据权利要求1所述的图像处理方法,所述目标变型形态为所述对象识别结果的变化所触发的对所述目标对象进行变型处理的最终变型形态。
  9. 根据权利要求8所述的图像处理方法,
    响应于所述对象识别结果从在所述图像中识别到所述目标对象变化为在所述图像中未识别到所述目标对象,所述目标变型形态为所述目标对象未经变型处理的形态;
    响应于所述对象识别结果从在所述图像中未识别到所述目标对象变化为在所述图像中识别到所述目标对象,所述目标变型形态为所述目标对象经过完整变型处理的形态。
  10. 一种图像处理装置,包括:
    起始形态获取模块,用于响应于图像中目标对象的对象识别结果发生变化,获取变化发生前所述目标对象的最后变型形态,作为所述目标对象的起始变型形态;所述目标对象为变型处理的对象;
    目标形态获取模块,用于获取所述目标对象的与所述变化对应的目标变型形态;
    对象展示模块,用于将所述起始变型形态、所述目标变型形态分别作为渐变的起始形态和结束形态,以渐变方式展示所述目标对象。
  11. 根据权利要求10所述的图像处理装置,所述对象展示模块,包括:
    幅度获取单元,用于根据所述起始变型形态和目标变型形态,得到所述目标对象的变型幅度;所述变型幅度为所述目标对象的变型形态的变化幅度;
    对象展示单元,用于按照与所述变型幅度相适应的渐变速度,展示所述目标对象。
  12. 根据权利要求11所述的图像处理装置,所述幅度获取单元,进一步用于根据所述起始变型形态和所述目标变型形态,分别得到所述目标对象的关键点在所述图像上的起始位置和目标位置;所述关键点为所述图像上,用于对所述目标对象进行变型处理的像素点;根据所述起始位置和目标位置之间的距离,得到所述变型幅度。
  13. 根据权利要求11所述的图像处理装置,所述对象展示单元,还用于获取预设的所述目标对象的变型时长阈值;根据所述变型幅度和变型时长阈值,得到变型速度阈值;获取不大于所述变型速度阈值的渐变速度,作为所述渐变速度。
  14. 根据权利要求13所述的图像处理装置,所述渐变速度为不大于所述变型速度阈值的恒定值。
  15. 根据权利要求11所述的图像处理装置,所述对象展示单元,进一步用于按照所述渐变速度,将所述目标对象的关键点,从所述关键点在所述图像上的起始位置逐渐向所述 关键点在所述图像上的目标位置移动,以展示所述目标对象从所述起始形态向所述结束形态渐变;其中,所述关键点在所述图像上的所述起始位置和所述目标位置,分别根据所述起始变型形态和所述目标变型形态得到。
  16. 根据权利要求10所述的图像处理装置,所述图像处理装置,还包括:
    结果获取模块,用于获取针对于所述图像中的目标对象的对象识别结果;所述对象识别结果包括:在图像中识别到目标对象或者在图像中未识别到目标对象;
    变化判断模块,用于响应于所述对象识别结果由在图像中识别到目标对象变化为在图像中未识别到目标对象,或由在图像中未识别到目标对象变化为在图像中识别到目标对象,判断所述对象识别结果发生变化。
  17. 根据权利要求10所述的图像处理装置,所述目标变型形态为所述对象识别结果的变化所触发的对所述目标对象进行变型处理的最终变型形态。
  18. 根据权利要求17所述的图像处理装置,响应于所述对象识别结果从在所述图像中识别到所述目标对象变化为在所述图像中未识别到所述目标对象,所述目标变型形态为所述目标对象未经变型处理的形态;响应于所述对象识别结果从在所述图像中未识别到所述目标对象变化为在所述图像中识别到所述目标对象,所述目标变型形态为所述目标对象经过完整变型处理的形态。
  19. 一种电子设备,包括:
    处理器;
    用于存储所述处理器可执行指令的存储器;
    其中,所述处理器被配置为执行所述指令时,以实现响应于图像中目标对象的对象识别结果发生变化,获取变化发生前所述目标对象的最后变型形态,作为所述目标对象的起始变型形态;所述目标对象为变型处理的对象;获取所述目标对象的与所述变化对应的目标变型形态;将所述起始变型形态、所述目标变型形态分别作为渐变的起始形态和结束形态,以渐变方式展示所述目标对象。
  20. 根据权利要求19所述的电子设备,所述处理器具体被配置为执行根据所述起始变型形态和目标变型形态,得到所述目标对象的变型幅度;所述变型幅度为所述目标对象的变型形态的变化幅度;按照与所述变型幅度相适应的渐变速度,展示所述目标对象。
  21. 根据权利要求20所述的电子设备,所述处理器具体被配置为执行根据所述起始变型形态和所述目标变型形态,分别得到所述目标对象的关键点在所述图像上的起始位置和目标位置;所述关键点为所述图像上,用于对所述目标对象进行变型处理的像素点;根据所述起始位置和目标位置之间的距离,得到所述变型幅度。
  22. 根据权利要求20所述的电子设备,所述处理器还被配置为执行获取预设的所述目标对象的变型时长阈值;根据所述变型幅度和变型时长阈值,得到变型速度阈值;获取不 大于所述变型速度阈值的渐变速度,作为所述渐变速度。
  23. 根据权利要求22所述的电子设备,所述渐变速度为不大于所述变型速度阈值的恒定值。
  24. 根据权利要求20所述的电子设备,所述处理器具体被配置为执行按照所述渐变速度,将所述目标对象的关键点,从所述关键点在所述图像上的起始位置逐渐向所述关键点在所述图像上的目标位置移动,以展示所述目标对象从所述起始形态向所述结束形态渐变;其中,所述关键点在所述图像上的所述起始位置和所述目标位置,分别根据所述起始变型形态和所述目标变型形态得到。
  25. 根据权利要求19所述的电子设备,所述处理器还被配置为获取针对于所述图像中的目标对象的对象识别结果;所述对象识别结果包括:在图像中识别到目标对象或者在图像中未识别到目标对象;响应于所述对象识别结果由在图像中识别到目标对象变化为在图像中未识别到目标对象,或由在图像中未识别到目标对象变化为在图像中识别到目标对象,判断所述对象识别结果发生变化。
  26. 根据权利要求19所述的电子设备,所述目标变型形态为所述对象识别结果的变化所触发的对所述目标对象进行变型处理的最终变型形态。
  27. 根据权利要求26所述的电子设备,响应于所述对象识别结果从在所述图像中识别到所述目标对象变化为在所述图像中未识别到所述目标对象,所述目标变型形态为所述目标对象未经变型处理的形态;响应于所述对象识别结果从在所述图像中未识别到所述目标对象变化为在所述图像中识别到所述目标对象,所述目标变型形态为所述目标对象经过完整变型处理的形态。
  28. 一种存储介质,当所述存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行响应于图像中目标对象的对象识别结果发生变化,获取变化发生前所述目标对象的最后变型形态,作为所述目标对象的起始变型形态;所述目标对象为变型处理的对象;获取所述目标对象的与所述变化对应的目标变型形态;将所述起始变型形态、所述目标变型形态分别作为渐变的起始形态和结束形态,以渐变方式展示所述目标对象。
PCT/CN2020/132994 2020-03-23 2020-11-30 图像处理方法、装置、电子设备及存储介质 WO2021189927A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2022549506A JP2023514340A (ja) 2020-03-23 2020-11-30 画像処理方法、電子機器、および記憶媒体
US17/820,026 US20220392253A1 (en) 2020-03-23 2022-08-16 Method for processing images, electronic device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010208723.6 2020-03-23
CN202010208723.6A CN111340690B (zh) 2020-03-23 2020-03-23 图像处理方法、装置、电子设备及存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/820,026 Continuation US20220392253A1 (en) 2020-03-23 2022-08-16 Method for processing images, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
WO2021189927A1 true WO2021189927A1 (zh) 2021-09-30

Family

ID=71182531

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/132994 WO2021189927A1 (zh) 2020-03-23 2020-11-30 图像处理方法、装置、电子设备及存储介质

Country Status (4)

Country Link
US (1) US20220392253A1 (zh)
JP (1) JP2023514340A (zh)
CN (1) CN111340690B (zh)
WO (1) WO2021189927A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111340690B (zh) * 2020-03-23 2024-05-14 北京达佳互联信息技术有限公司 图像处理方法、装置、电子设备及存储介质
CN116503289B (zh) * 2023-06-20 2024-01-09 北京天工异彩影视科技有限公司 一种视觉特效应用处理方法和系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180204308A1 (en) * 2015-07-02 2018-07-19 Privowny, Inc. Systems and methods for media privacy
CN109040780A (zh) * 2018-08-07 2018-12-18 北京优酷科技有限公司 一种视频处理方法及服务器
CN109523461A (zh) * 2018-11-09 2019-03-26 北京达佳互联信息技术有限公司 显示目标图像的方法、装置、终端及存储介质
CN110333924A (zh) * 2019-06-12 2019-10-15 腾讯科技(深圳)有限公司 一种图像渐变调整方法、装置、设备及存储介质
CN111340690A (zh) * 2020-03-23 2020-06-26 北京达佳互联信息技术有限公司 图像处理方法、装置、电子设备及存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102567740B (zh) * 2010-12-14 2014-07-16 苏州大学 一种图像识别方法及系统
CN110580691A (zh) * 2019-09-09 2019-12-17 京东方科技集团股份有限公司 图像的动态处理方法、装置、设备及计算机可读存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180204308A1 (en) * 2015-07-02 2018-07-19 Privowny, Inc. Systems and methods for media privacy
CN109040780A (zh) * 2018-08-07 2018-12-18 北京优酷科技有限公司 一种视频处理方法及服务器
CN109523461A (zh) * 2018-11-09 2019-03-26 北京达佳互联信息技术有限公司 显示目标图像的方法、装置、终端及存储介质
CN110333924A (zh) * 2019-06-12 2019-10-15 腾讯科技(深圳)有限公司 一种图像渐变调整方法、装置、设备及存储介质
CN111340690A (zh) * 2020-03-23 2020-06-26 北京达佳互联信息技术有限公司 图像处理方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
JP2023514340A (ja) 2023-04-05
US20220392253A1 (en) 2022-12-08
CN111340690B (zh) 2024-05-14
CN111340690A (zh) 2020-06-26

Similar Documents

Publication Publication Date Title
US9674395B2 (en) Methods and apparatuses for generating photograph
WO2016011747A1 (zh) 肤色调整方法和装置
KR102018887B1 (ko) 신체 부위 검출을 이용한 이미지 프리뷰
CN108470322B (zh) 处理人脸图像的方法、装置及可读存储介质
CN108712603B (zh) 一种图像处理方法及移动终端
CN104484858B (zh) 人物图像处理方法及装置
CN107341777B (zh) 图片处理方法及装置
CN107330868A (zh) 图片处理方法及装置
EP3113071A1 (en) Method and device for acquiring iris image
CN107231505B (zh) 图像处理方法及装置
CN109325908B (zh) 图像处理方法及装置、电子设备和存储介质
WO2018098860A1 (zh) 照片合成方法及装置
WO2021189927A1 (zh) 图像处理方法、装置、电子设备及存储介质
CN108154466A (zh) 图像处理方法及装置
CN104301610A (zh) 图像拍摄控制方法及装置
WO2015196715A1 (zh) 图像重定位方法、装置及终端
CN110807769B (zh) 图像显示控制方法及装置
EP3211879A1 (en) Method and device for automatically capturing photograph, electronic device
US10846513B2 (en) Method, device and storage medium for processing picture
CN112004020B (zh) 图像处理方法、装置、电子设备及存储介质
CN107239758B (zh) 人脸关键点定位的方法及装置
EP3799415A2 (en) Method and device for processing videos, and medium
WO2019061203A1 (zh) 获取颜值变化的方法及终端
CN105635573B (zh) 摄像头视角调整方法和装置
CN105608469B (zh) 图像分辨率的确定方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20927147

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022549506

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 13.02.2023)

122 Ep: pct application non-entry in european phase

Ref document number: 20927147

Country of ref document: EP

Kind code of ref document: A1