WO2022227929A1 - 一种图像处理方法、装置、设备及存储介质 - Google Patents

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

Info

Publication number
WO2022227929A1
WO2022227929A1 PCT/CN2022/081881 CN2022081881W WO2022227929A1 WO 2022227929 A1 WO2022227929 A1 WO 2022227929A1 CN 2022081881 W CN2022081881 W CN 2022081881W WO 2022227929 A1 WO2022227929 A1 WO 2022227929A1
Authority
WO
WIPO (PCT)
Prior art keywords
target
target object
contour point
contour
point
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.)
Ceased
Application number
PCT/CN2022/081881
Other languages
English (en)
French (fr)
Inventor
余丽娟
邓启力
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to US18/551,783 priority Critical patent/US12524854B2/en
Publication of WO2022227929A1 publication Critical patent/WO2022227929A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/80Geometric correction
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/00Two-dimensional [2D] image generation
    • G06T11/20Drawing from basic elements
    • G06T11/23Drawing from basic elements using straight lines or curves
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/00Two-dimensional [2D] image generation
    • G06T11/60Creating or editing images; Combining images with text
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/60Image enhancement or restoration using machine learning, e.g. neural networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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 the field of image processing, and in particular, to an image processing method, apparatus, device, and storage medium.
  • the appropriate cranial crest height is one of the important factors.
  • the appropriate cranial crest height refers to the ratio between the distance from the frontal hairline to the top of the head and the distance from the hairline to the eyebrows. Equal to 1:1, as 1a in Figure 1. If the ratio is greater than 1:1, the cranial roof is too high, as shown in Figure 1b; on the contrary, if the ratio is much smaller than 1:1, the cranial roof is too low, as shown in Figure 1c. Whether the top of the skull is too high or the top of the skull is too low will affect the beauty of the portrait.
  • the present disclosure provides an image processing method, apparatus, device and storage medium, which realizes the image processing function by deforming the grid of the target object on the image to be processed, The display effect of the target object on the to-be-processed image can be improved, thereby improving the user experience.
  • the present disclosure provides an image processing method, the method comprising:
  • first contour point belongs to a point on the first contour line of the target object
  • second contour point belongs to the a point on the second contour of the target object
  • a deformed image corresponding to the target object is generated.
  • the method before the grid corresponding to the target object is constructed based on the first contour point and the second contour point, the method further includes:
  • the constructing the grid corresponding to the target object based on the first contour point and the second contour point includes:
  • a grid corresponding to the target object is constructed.
  • the deformation parameters include deformation input parameters and preset deformation key points
  • the second contour point in the grid is performed based on the deformation parameters corresponding to the target object. Offset to get the deformed mesh, including:
  • the target second contour point Based on the distance between the target second contour point and the target deformation key point, determine whether the target second contour point is in the influence area of the target deformation key point, and obtain a determination result; wherein, the determining The result is used to characterize whether the second contour point of the target is in the influence area of the target deformation key point;
  • the target second contour point in the grid is offset to obtain the deformed grid.
  • determining the offset data corresponding to the second contour point of the target including:
  • the determination result indicates that the second contour point of the target is in the influence area of the target deformation key point, then based on the deformation input parameters corresponding to the target object and the preset direction vector corresponding to the target deformation key point, determine offset data corresponding to the second contour point of the target;
  • the offset data corresponding to the second target contour point includes the offset direction and offset distance of the target second contour point, and the deformation input parameter is used to determine the offset direction and the offset distance , the preset direction vector is used to determine the offset direction.
  • determining the offset data corresponding to the second contour point of the target based on the deformation input parameter corresponding to the target object and the preset direction vector corresponding to the target deformation key point including: :
  • the offset data corresponding to the second contour point of the target is determined.
  • the target deformation key point includes a preset key point pair, and the preset direction vector corresponding to the target deformation key point is determined by the preset key point pair.
  • the determining of the first contour point and the second contour point of the target object on the image to be processed includes:
  • the first contour point and the second contour point of the target object on the image to be processed are respectively determined.
  • generating the deformed image corresponding to the target object based on the deformed mesh includes:
  • the target area is drawn to obtain a deformed image corresponding to the target object.
  • the target area is drawn to obtain a deformed image corresponding to the target object, including:
  • the target area is drawn to obtain the deformed image corresponding to the target object.
  • the method before obtaining the deformed image corresponding to the target object, the method further includes:
  • the target area is drawn to obtain a deformed image corresponding to the target object, including:
  • the target area is in the predetermined hair area of the target cranial parietal subject, based on the image data in the area formed by the second contour line and the third contour line on the image to be processed, the The target area is drawn, and the deformed image corresponding to the target object is obtained.
  • the method before obtaining the deformed image corresponding to the target object, the method further includes:
  • the present disclosure also provides an image processing device, the device comprising:
  • a first determining module configured to determine a first contour point and a second contour point of the target object on the image to be processed; wherein, the first contour point belongs to a point on the first contour line of the target object, and the The second contour point belongs to a point on the second contour line of the target object;
  • a construction module configured to construct a grid corresponding to the target object based on the first contour point and the second contour point;
  • an offset module configured to offset the second contour point in the mesh based on the deformation parameter corresponding to the target object to obtain a deformed mesh; wherein the deformation parameter is used to determine the offset data of the second contour point;
  • a generating module is configured to generate a deformed image corresponding to the target object based on the deformed mesh.
  • the present disclosure provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a terminal device, the terminal device is made to implement the above method.
  • the present disclosure provides a device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, when the processor executes the computer program, Implement the above method.
  • the present disclosure provides a computer program product, wherein the computer program product includes a computer program/instruction, and the computer program/instruction implements the above method when executed by a processor.
  • An embodiment of the present disclosure provides an image processing method. First, a first contour point and a second contour point of a target object on an image to be processed are determined, wherein the first contour point belongs to a point on a first contour line of the target object , the second contour point belongs to the point on the second contour line of the target object. Secondly, based on the first contour point and the second contour point, a grid corresponding to the target object is constructed, and based on the deformation parameters corresponding to the target object, the second contour point in the grid is offset to obtain a deformed grid. Then, based on the deformed mesh, a deformed image corresponding to the target object is generated. It can be seen that the embodiments of the present disclosure realize the image processing function by deforming the grid of the target object on the image to be processed, and can improve the display effect of the target object on the image to be processed, thereby improving user experience.
  • Fig. 1 is a kind of contrast schematic diagram of cranial top effect
  • FIG. 2 is a flowchart of an image processing method according to an embodiment of the present disclosure
  • FIG. 3 is a schematic diagram of the distribution of a first contour point and a second contour point according to an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of a grid corresponding to a target cranial top provided by an embodiment of the present disclosure
  • FIG. 5 is a schematic diagram of a preset deformation key point according to an embodiment of the present disclosure.
  • FIG. 6 is a flowchart of another image processing method provided by an embodiment of the present disclosure.
  • FIG. 7 is a schematic diagram of the distribution of a first contour point, a second contour point, and a third contour point according to an embodiment of the present disclosure
  • FIG. 8 is a schematic diagram of a grid of another target cranial top provided by an embodiment of the present disclosure.
  • FIG. 9 is a schematic diagram of a target area provided by an embodiment of the present disclosure.
  • FIG. 10 is a drawing rendering effect diagram of the target cranial top in a target portrait provided by an embodiment of the present disclosure after being raised or lowered;
  • FIG. 11 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic structural diagram of an image processing device according to an embodiment of the present disclosure.
  • cranial crest height is an important factor affecting the aesthetics of a portrait.
  • the cranial crest height can be adjusted by means of image processing to improve the display effect of the cranial crest.
  • a first contour point and a second contour point of a target object on an image to be processed are determined, wherein the first contour point belongs to the first contour point of the target object.
  • the point on the contour line, the second contour point belongs to the point on the second contour line of the target object.
  • a grid corresponding to the target object is constructed, and based on the deformation parameters corresponding to the target object, the second contour point in the grid is offset to obtain a deformed grid.
  • a deformed image corresponding to the target object is generated.
  • the embodiments of the present disclosure realize the image processing function by deforming the grid of the target object on the image to be processed, and can improve the display effect of the target object on the image to be processed, thereby improving user experience. It can be seen that in the embodiment of the present disclosure, by offsetting the points located on the edge line of the cranial crest, the grid of the target cranial crest is deformed, thereby obtaining the deformed cranial crest, improving the aesthetics of the target cranial crest, and further improving the user experience. aesthetic experience.
  • an embodiment of the present disclosure provides an image processing method.
  • a flowchart of an image processing method provided by an embodiment of the present disclosure includes:
  • S201 Determine the first contour point and the second contour point of the target object on the image to be processed.
  • the first contour point belongs to a point on the first contour line of the target object
  • the second contour point belongs to a point on the second contour line of the target object
  • the images to be processed in the embodiments of the present disclosure may include images of types such as portraits and animal images, and the target object may be a human body part such as a cranial top and a human face on a portrait, or a cranial top, a face, etc. on an animal image. .
  • the embodiment of the present disclosure taking a portrait as an example for illustration, before determining the first contour point and the second contour point, first determine the portrait to be processed and the target object on the image to be processed.
  • 1a, 1b and 1c can all be used as images to be processed.
  • the image to be processed may be an image captured in real time, an image selected by a user, or the like, and the embodiment of the present disclosure does not limit the source of the image to be processed.
  • the image to be processed in the embodiment of the present disclosure includes the target object, and the embodiment of the present disclosure realizes the processing of the target object on the image to be processed by deforming the grid corresponding to the target object, and improves the aesthetics of the target object.
  • the first contour point and the second contour point of the target object are further determined.
  • the first contour point is a point determined from the first contour line of the target object
  • the second contour point is a point determined from the second contour line of the target object.
  • the first contour point and the second contour point of the target object on the image to be processed may be determined respectively based on a machine learning model. It should be noted that the embodiments of the present disclosure do not limit other ways of determining the first contour point and the second contour point.
  • the image to be processed in the embodiment of the present disclosure may include a portrait
  • the target object may include the target cranial top on the portrait
  • the first contour line may refer to the hairline on the target cranial top
  • the second contour line may refer to the target cranial top cranial top edge line.
  • an embodiment of the present disclosure provides a schematic diagram of the distribution of the first contour point and the second contour point, wherein the point on the hairline is the first contour point, The point on the cranial parietal edge line is the second contour point.
  • the first contour points and the second contour points can be evenly distributed.
  • taking the first contour point No. 0 as the center point there are 6 first contour points around No. 0, that is, a total of 13 first contour points can be determined on the target cranial top.
  • the second contour points corresponding to the respective first contour points are respectively determined on the cranial top edge line of the target cranial top.
  • S202 Construct a grid corresponding to the target object based on the first contour point and the second contour point.
  • a grid corresponding to the target object is constructed based on the first contour point and the second contour point.
  • the first contour point and the second contour point are both vertices in the grid corresponding to the target object.
  • FIG. 4 is a schematic diagram of a grid corresponding to the target object according to an embodiment of the present disclosure. Specifically, the grid is constructed based on the first contour point and the second contour point in the above-mentioned FIG. 3 .
  • the embodiment of the present disclosure does not limit the way of constructing the grid of the target object.
  • the deformation parameter is used to determine the offset data of the second contour point.
  • the second contour point in the grid is offset based on the deformation parameters corresponding to the target object to obtain the deformed grid.
  • the deformation parameters corresponding to the target object include a deformation input parameter and a preset deformation key point, wherein the deformation input parameter is a parameter input by the user and used to characterize the degree of deformation of the desired target object, and the preset deformation
  • the key point is a preset key point used for determining the offset data of the second contour point.
  • the user can trigger the deformation adjustment operation of the target object through a slide bar on the operation interface or the like.
  • determine the deformation parameter corresponding to the target object For example, assuming that the target object is the target cranial top, the sliding range of the slider is 0-100. If the slider is adjusted to 0-50, it means that the user expects to depress the target cranial. On the contrary, if the slider is adjusted to 50-100, It means that the user expects to elevate the target cranial top.
  • the sliding range of the slider is centered at 0, and 50 is the range of the sliding radius (-50-50).
  • the slider is adjusted to -50-0, it means that the user expects to depress the target cranial top. On the contrary, If the slider is adjusted to 0-50, the user expects to raise the target cranial roof.
  • the embodiment of the present disclosure does not limit the setting manner of the sliding range of the sliding bar.
  • the preset deformation key points are used to determine the offset data of the second contour point, where the offset data may include an offset direction, an offset distance, and the like.
  • the second contour point of the target is determined from the second contour point in the grid corresponding to the target object, and the second contour point of the target is determined from the preset deformation key points. Identify target deformation keypoints.
  • FIG. 5 it is a schematic diagram of a preset deformation key point according to an embodiment of the present disclosure. It is assumed that the target second contour point is the second contour point corresponding to No. 0 in the above-mentioned Figure 5, and the target deformation key point is a1. It is worth noting that the target deformation key point can be any point on the image to be processed.
  • the target deformation key point can include points that are not on the grid of the target object.
  • the target deformation key points can be set in the hair area.
  • the offset data corresponding to the target second contour point is further determined, and further, based on the offset data, the target second contour point in the grid is offset to obtain a deformed grid.
  • a plurality of target deformation key points can be determined respectively based on the preset deformation key points.
  • a2 and a3 can also be respectively determined as target deformation key points, and the above process can be performed to respectively complete the target deformation.
  • the key points a2 and a3 are used to offset the second contour point of the target in the grid.
  • the specific implementation method can be understood by referring to the description for the target deformation key point a1, which is not repeated here.
  • the target first contour point is determined. offset data corresponding to the two contour points, and then offset the target second contour point in the grid based on the offset data.
  • each second contour point in the grid is used as the target second contour point, and the preset deformation key points are respectively used as the target deformation key point in turn, so as to realize the offset of each second contour point in the grid, and finally Get the deformed mesh.
  • the deformation input parameter in the embodiment of the present disclosure is used to determine the offset direction and offset distance of the second target contour point, and the preset direction vector is used to determine the offset direction of the target second contour point.
  • the first offset parameter corresponding to the target second contour point is determined; wherein, the The first offset parameter is proportional to the distance. Then, the product of the first offset parameter, the deformation input parameter corresponding to the target object, and the preset direction vector corresponding to the target deformation key point is determined as the offset corresponding to the target second contour point move data. Further, based on the offset data, the target second contour point in the grid is offset to obtain a deformed grid.
  • the distance distance (curPoint, a) between the target second contour point and the target deformation key point can be calculated first, where curPoint is used to represent the target second contour point, and a is used to represent the target deformation key point. Then, based on the distance distance(curPoint, a), it is determined whether the target second contour point curPoint is in the influence area of the target deformation key point a.
  • the distance distance(curPoint,a) is less than the preset threshold, it means that the target second contour point curPoint is in the influence area of the target deformation key point a, and if the distance distance(curPoint,a) is not less than the preset threshold, it means that The target second contour point curPoint is not in the influence area of the target deformation key point a.
  • the first offset parameter corresponding to the target second contour point curPoint may be determined based on the distance distance(curPoint, a). Specifically, the first offset parameter infect can be calculated by the following formula (1):
  • radius is used to characterize the control range of the target deformation key point a, which is usually a preset empirical constant value.
  • curPoint curPoint+T
  • T is used to represent the offset data of the target second contour point curPoint
  • the offset data includes the offset direction and the offset distance
  • hardnessAdjust() is the concentration adjustment function
  • the data value of hardnessAdjust(infect,movHardness) is inversely proportional to infect, so hardnessAdjust(infect,movHardness)
  • the data value is inversely proportional to distance(curPoint,a). The larger distance(curPoint,a) is, the smaller the data value of hardnessAdjust(infect,movHardness) is.
  • the offset distance of the second contour point of the target corresponding to T is greater. Small, that is, within the influence range of the target deformation key point, the farther away from the target deformation key point, the smaller the offset distance of the second contour point of the target.
  • Intensity is used to represent the deformation input parameter, which is usually between [-1, 1]. Assuming that the target object is the target cranial top, if the intensity is greater than 0, it means that the user expects to raise the cranial top; if the intensity is less than 0, it means that the user expects to lower the cranial top. cranial top.
  • direction(b, a) is used to represent the preset direction vector corresponding to the target deformation key point a, and used to represent the offset direction of the second target contour point curPoint.
  • the target deformation key point may include a preset key point pair, and by presetting the point b corresponding to the target deformation key point a to form the (a, b) key point pair, based on the target deformation key point Point a and point b determine the preset direction vector direction(b, a).
  • each second contour point on the grid of the target object may be offset respectively based on the above method, and finally a deformed grid is obtained.
  • the preset deformation key points in the embodiments of the present disclosure may include at least three pairs of key points, for example including (a1, b1), (a2 , b2) and (a3, b3), as shown in Figure 5, where a1, a2 and a3 can be a certain point on the connection line between the first contour point No. 3 and the corresponding second contour point, the No. 0 No. A point on the connecting line between a contour point and the corresponding second contour point and a point on the connecting line between the first contour point No.
  • b1, b2 and b3 can be on the connection line of a1, a2 and a3 and the corresponding second contour point respectively, direction(b1, a1) refers to the direction vector of a1 pointing to b1.
  • direction(b1, a1) refers to the direction vector of a1 pointing to b1.
  • S204 Generate a deformed image corresponding to the target object based on the deformed mesh.
  • a deformed image corresponding to the target object is generated based on the deformed grid.
  • the deformed cranial crest in the deformed image has the effect of raising or lowering the cranial crest relative to the target cranial crest, thereby improving the aesthetics of the target cranial crest .
  • the embodiments of the present disclosure realize the image processing function by deforming the grid of the target object on the image to be processed, and can improve the display effect of the target object on the image to be processed, thereby improving user experience.
  • a grid corresponding to the target object can be constructed by combining the points on the third contour line of the target object.
  • an embodiment of the present disclosure further provides an image processing method.
  • FIG. 6 it is a flowchart of another image processing method provided by an embodiment of the present disclosure. The method includes:
  • S601 Determine the first contour point, the second contour point and the third contour point of the target object on the image to be processed.
  • the first contour point belongs to the point on the first contour line of the target object
  • the second contour point belongs to the point on the second contour line of the target object
  • the third contour point belongs to the point on the third contour line of the target object.
  • the third contour point is determined on the third contour line of the target object.
  • the first contour line is the hairline on the target cranial top
  • the second contour line is the cranial top edge line on the target cranial top
  • the third contour line is the outer cranial top corresponding to the target cranial top.
  • Curve, the extra-parietal curve can be a curve that is a certain distance from the edge of the cranial parietal. As shown in FIG.
  • FIG. 7 a schematic diagram of the distribution of a first contour point, a second contour point, and a third contour point provided by an embodiment of the present disclosure, wherein the third contour point may be located at a certain distance from the cranial top edge line. on the top outer curve.
  • the third contour point of the target object may have a one-to-one correspondence with the second contour point. It should be noted that the embodiments of the present disclosure do not limit the number and distribution of the first contour points, the second contour points, and the third contour points.
  • the third contour point of the target object on the image to be processed may be determined based on a machine learning model. This embodiment of the present disclosure does not limit other ways of determining the third contour point.
  • S602 Construct a grid corresponding to the target object based on the first contour point, the second contour point and the third contour point.
  • the grid of the target object may be constructed based on the first contour point, the second contour point and the third contour point .
  • FIG. 8 another schematic grid diagram of the target cranial top provided by the embodiment of the present disclosure is specifically constructed according to the first contour point, the second contour point and the third contour point Schematic diagram of the grid of the target object, it is worth noting that the embodiment of the present disclosure does not limit the structure of the grid of the target cranial top.
  • the embodiment of the present disclosure constructs the grid of the target object based on the first contour point, the second contour point and the third contour point, which can ensure that the grid deformation caused by the offset of the second contour point in the grid of the target object will not be affected. It will affect the display of the background area outside the third contour line formed by the third contour points, avoid the background area being covered by the deformation of the target object, and reduce the influence on the display content of the background area before and after the deformation of the target object.
  • the deformation parameter is used to determine the offset data of the second contour point.
  • S603 in the embodiment of the present disclosure is similar to that of S203 in the above-mentioned embodiment, which can be understood by reference, and will not be repeated here.
  • S604 Generate a deformed image corresponding to the target object based on the deformed mesh.
  • a deformed image corresponding to the target object is drawn based on the deformed grid.
  • the positional relationship may refer to whether the target area is in a predetermined area of the target object.
  • the target area is drawn based on the positional relationship, and a deformed image corresponding to the target object is obtained.
  • FIG. 9 is a schematic diagram of a target area provided by an embodiment of the present disclosure.
  • the contour line formed by the second contour point after deformation namely the dotted line in Figure 9, and the area surrounded by the second contour line formed by the second contour point before deformation (ie cranial top edge line) is the target area, if the target area If it is in the predetermined area of the target object (for example, the hair area), it means that the cranial crest is deformed to lower the target cranial crest; on the contrary, if the target area is not in the predetermined area of the target object, it means that the cranial crest is deformed to raise the cranial crest.
  • the predetermined area of the target object for example, the hair area
  • the target area in Fig. 9 is not in the predetermined area of the target object, that is, the target area is not in the hair area, indicating that the target cranial top needs to be raised.
  • the target area is drawn based on the image data in the area formed by the first contour line and the second contour line on the image to be processed to obtain the target area.
  • the deformed image corresponding to the target object is drawn based on the image data in the area formed by the first contour line and the second contour line on the image to be processed to obtain the target area.
  • the target area needs to be drawn based on the image data in the hair area. Specifically, the image data in the area formed by the first contour line and the second contour line on the image to be processed is acquired, and then the target area is drawn based on the image data to obtain a deformed image corresponding to the target object.
  • the target area is drawn based on the image data in the area formed by the second contour line and the third contour line on the image to be processed, to obtain The deformed image corresponding to the target object.
  • the target object is the target cranial top and the target area is in the hair area
  • the target object is the target cranial top
  • the deformation of the cranial top has raised the target cranial top, and can be based on the image to be processed.
  • the image data in the area formed by the second contour line and the third contour line for the image data in the deformed grid formed by the offset second contour point and the third contour point The area is compressed and drawn. The elevation of the target cranial crest caused by the cranial crest deformation will cause the background area around the cranial crest to deform.
  • the area is compressed and drawn, so that the impact of cranial top deformation on the background area is controlled within the outer cranial curve, and the display effect of covering the background area around the target cranial top due to cranial top deformation will not appear, and the effect of image processing will be improved.
  • the target area is in the hair area of the target cranial top, it means that the deformation of the cranial top has pulled down the target cranial top.
  • the image data in the area formed by the third contour line is drawn, and the area formed by the offset second contour point and the third contour point in the deformed grid is drawn.
  • FIG. 10 it is a drawing effect diagram of the target cranial top being raised or lowered according to an embodiment of the present disclosure. It can be seen that after raising or lowering the target cranial crest through the cranial crest deformation, the aesthetics of the target cranial crest is improved.
  • the embodiments of the present disclosure realize the image processing function by deforming the grid of the target object on the image to be processed, and can improve the display effect of the target object on the image to be processed, thereby improving user experience.
  • the second contour point in the grid of the target object is offset, causing the grid to deform, so as to realize the deformation of the target object, while the first contour point and the third contour in the grid of the target object are deformed.
  • the points are not offset, which can ensure that the background area affected by the deformation of the target object is limited to the third contour line where the third contour point is located, avoid the background area being covered by the deformation of the target object, and reduce the deformation of the target object.
  • the influence of the front and back on the display content of the background area improves the user experience.
  • the present disclosure further provides an image processing apparatus.
  • FIG. 11 a schematic structural diagram of an image processing apparatus provided in an embodiment of the present disclosure, the apparatus includes:
  • the first determination module 1101 is configured to determine the first contour point and the second contour point of the target object on the image to be processed; wherein, the first contour point belongs to the point on the first contour line of the target object, so the The second contour point belongs to the point on the second contour line of the target object;
  • a construction module 1102 configured to construct a grid corresponding to the target object based on the first contour point and the second contour point;
  • the offset module 1103 is configured to offset the second contour point in the mesh based on the deformation parameter corresponding to the target object to obtain the deformed mesh; wherein the deformation parameter is used to determine the the offset data of the second contour point;
  • the generating module 1104 is configured to generate a deformed image corresponding to the target object based on the deformed mesh.
  • the device further includes:
  • a second determining module configured to determine a third contour point of the target object; wherein, the third contour point belongs to a point on the third contour line of the target object;
  • construction module is specifically used for:
  • a grid corresponding to the target object is constructed.
  • the deformation parameters include deformation input parameters and preset deformation key points
  • the offset module includes:
  • a first determination submodule configured to determine a target second contour point from the second contour points in the grid, and determine a target deformation key point from the preset deformation key points;
  • the second determination sub-module is configured to determine whether the second target contour point is in the influence area of the target deformation key point based on the distance between the target second contour point and the target deformation key point, and obtain A determination result; wherein, the determination result is used to characterize whether the second contour point of the target is in the influence area of the target deformation key point;
  • a third determination submodule configured to determine offset data corresponding to the second contour point of the target based on the determination result
  • the first offset sub-module is configured to offset the target second contour point in the grid based on the offset data to obtain the deformed grid.
  • the third determination sub-module is specifically used for:
  • the offset data corresponding to the second target contour point includes the offset direction and offset distance of the target second contour point, and the deformation input parameter is used to determine the offset direction and the offset distance , the preset direction vector is used to determine the offset direction.
  • the third determination sub-module includes:
  • a fourth determination submodule configured to determine a first offset parameter corresponding to the second target contour point based on the distance between the target second contour point and the target deformation key point;
  • the fifth determination sub-module is configured to determine the second contour point corresponding to the target based on the first offset parameter, the deformation input parameter corresponding to the target object, and the preset direction vector corresponding to the target deformation key point offset data.
  • the target deformation key point includes a preset key point pair, and the preset direction vector corresponding to the target deformation key point is determined by the preset key point pair.
  • the first determining module is specifically used for:
  • the first contour point and the second contour point of the target object on the image to be processed are respectively determined.
  • the generation module includes:
  • the sixth determination sub-module is used to determine the target area formed by the second contour points before and after the offset in the deformed grid
  • the first drawing sub-module is configured to draw the target area according to the positional relationship between the target area and a predetermined area of the target object to obtain a deformed image corresponding to the target object.
  • the first drawing sub-module is specifically used for:
  • the target area is drawn to obtain the deformed image corresponding to the target object.
  • the device further includes:
  • the second drawing sub-module is configured to, based on the image data in the area formed by the second contour line and the third contour line on the image to be processed, perform a process on the deformed grid by the offset
  • the area formed by the second contour point and the third contour point is compressed and drawn.
  • the first drawing sub-module is specifically used for:
  • the target area is Drawing is performed to obtain a deformed image corresponding to the target object.
  • the device further includes:
  • the third drawing sub-module is configured to, based on the image data in the area formed by the second contour line and the third contour line on the to-be-processed image, draw the image data in the deformed grid by the offset
  • the area formed by the second contour point and the third contour point is drawn by stretching.
  • the first contour point and the second contour point of the target object on the image to be processed are determined, wherein the first contour point belongs to the point on the first contour line of the target object,
  • the second contour point belongs to a point on the second contour line of the target object.
  • a grid corresponding to the target cranial object is constructed, and based on the deformation parameters corresponding to the target object, the second contour point in the grid is offset to obtain a deformed grid.
  • a deformed image corresponding to the target object is generated.
  • embodiments of the present disclosure also provide a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a terminal device, the terminal device is made to implement the present invention.
  • the image processing methods described in the embodiments are disclosed.
  • Embodiments of the present disclosure also provide a computer program product, including computer programs/instructions, characterized in that, when the computer program/instructions are executed by a processor, the image processing methods described in the embodiments of the present disclosure are implemented.
  • an embodiment of the present disclosure further provides an image processing device, as shown in FIG. 12 , which may include:
  • the number of processors 1201 in the image processing device may be one or more, and one processor is taken as an example in FIG. 12 .
  • the processor 1201 , the memory 1202 , the input device 1203 , and the output device 1204 may be connected by a bus or other means, wherein the connection by a bus is taken as an example in FIG. 12 .
  • the memory 1202 can be used to store software programs and modules, and the processor 1201 executes various functional applications and data processing of the image processing apparatus by running the software programs and modules stored in the memory 1202 .
  • the memory 1202 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function, and the like. Additionally, memory 1202 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
  • the input device 1203 may be used to receive input numerical or character information, and generate signal input related to user settings and function control of the image processing apparatus.
  • the processor 1201 loads the executable files corresponding to the processes of one or more application programs into the memory 1202 according to the following instructions, and the processor 1201 executes the executable files stored in the memory 1202 application program, thereby realizing various functions of the above-mentioned image processing device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

本公开提供了一种图像处理方法、装置、设备及存储介质,所述方法包括:首先,确定待处理图像上的目标对象的第一轮廓点和第二轮廓点,其中,第一轮廓点属于目标对象的第一轮廓线上的点,第二轮廓点属于目标对象的第二轮廓线上的点。其次,基于第一轮廓点和第二轮廓点,构造目标对象对应的网格,并基于目标对象对应的形变参数,对网格中的第二轮廓点进行偏移,得到形变后网格。然后,基于形变后网格,生成目标对象对应的形变后图像。可见,本公开实施例通过对待处理图像上的目标对象的网格进行形变,实现图像处理功能,能够提升待处理图像上的目标对象的显示效果,从而提升用户的体验。

Description

一种图像处理方法、装置、设备及存储介质
本申请要求于2021年4月30日提交的申请号为202110482197.7、申请名称为“一种图像处理方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开涉及图像处理领域,尤其涉及一种图像处理方法、装置、设备及存储介质。
背景技术
随着计算机技术的发展,人们对图像处理的需求越来越高。例如,在对人像的审美中,合适的颅顶高度是重要影响因素之一,通常合适的颅顶高度是指正面发际线到头顶的距离与发际线到眉毛的距离之间的比例约等于1:1,如图1中的1a。如果该比例大于1:1,则为颅顶过高,如图1中的1b;相反,如果该比例远小于1:1,则为颅顶过低,如图1中的1c,而无论是颅顶过高还是颅顶过低都会影响人像的美观度。
因此,如何丰富图像处理的方式,满足用户对图像处理的需求,进而提升图像处理的效果,是图像处理领域不断探索的技术问题。
发明内容
为了解决上述技术问题或者至少部分地解决上述技术问题,本公开提供了一种图像处理方法、装置、设备及存储介质,通过对待处理图像上的目标对象的网格进行形变,实现图像处理功能,能够提升待处理图像上的目标对象的显示效果,从而提升用户的体验。
第一方面,本公开提供了一种图像处理方法,所述方法包括:
确定待处理图像上的目标对象的第一轮廓点和第二轮廓点;其中,所述第一轮廓点属于所述目标对象的第一轮廓线上的点,所述第二轮廓点属于所述目标对象的第二轮廓线上的点;
基于所述第一轮廓点和所述第二轮廓点,构造所述目标对象对应的网格;
基于所述目标对象对应的形变参数,对所述网格中的所述第二轮廓点进行偏移,得到形变后网格;其中,所述形变参数用于确定所述第二轮廓点的偏移数据;
基于所述形变后网格,生成所述目标对象对应的形变后图像。
一种可选的实施方式中,所述基于所述第一轮廓点和所述第二轮廓点,构造所述目标对象对应的网格之前,还包括:
确定所述目标对象的第三轮廓点;其中,所述第三轮廓点属于所述目标对象的第三轮廓线上的点;
相应的,所述基于所述第一轮廓点和所述第二轮廓点,构造所述目标对象对应的网格,包括:
基于所述第一轮廓点、所述第二轮廓点和所述第三轮廓点,构造所述目标对象对应的网格。
一种可选的实施方式中,所述形变参数包括形变输入参数和预设形变关键点,所述基于所述目标对象对应的形变参数,对所述网格中的所述第二轮廓点进行偏移,得到形变后网格,包括:
从所述网格中的所述第二轮廓点中确定目标第二轮廓点,以及从所述预设形变关键点中确定目标形变关键点;
基于所述目标第二轮廓点与所述目标形变关键点之间的距离,确定所述目标第二轮廓点是否处于所述目标形变关键点的影响区域,并得到确定结果;其中,所述确定结果用于表征所述目标第二轮廓点是否处于所述目标形变关键点的影响区域;
基于所述确定结果,确定所述目标第二轮廓点对应的偏移数据;
基于所述偏移数据,对所述网格中的所述目标第二轮廓点进行偏移,得到所述形变后网格。
一种可选的实施方式中,基于所述确定结果,确定所述目标第二轮廓点对应的偏移数据,包括:
如果所述确定结果表征所述目标第二轮廓点处于所述目标形变关键点的影响区域,则基于所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量,确定所述目标第二轮廓点对应的偏移数据;
其中,所述目标第二轮廓点对应的偏移数据包括所述目标第二轮廓点的偏移方向和偏移距离,所述形变输入参数用于确定所述偏移方向和所述偏移距离,所述预设方向向量用于确定所述偏移方向。
一种可选的实施方式中,所述基于所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量,确定所述目标第二轮廓点对应的偏移数据,包括:
基于所述目标第二轮廓点与所述目标形变关键点之间的距离,确定所述目标第二轮廓点对应的第一偏移参数;
基于所述第一偏移参数、所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量,确定所述目标第二轮廓点对应的偏移数据。
一种可选的实施方式中,所述目标形变关键点包括预设关键点对,所述目标形变关键点对应的预设方向向量由所述预设关键点对确定。
一种可选的实施方式中,所述确定待处理图像上的目标对象的第一轮廓点和第二轮廓点,包括:
基于机器学习模型,分别确定待处理图像上的目标对象的第一轮廓点和第二轮廓点。
一种可选的实施方式中,所述基于所述形变后网格,生成所述目标对象对应的形变后图像,包括:
确定所述形变后网格中由偏移前后的所述第二轮廓点构成的目标区域;
根据所述目标区域与所述目标对象的预定区域之间的位置关系,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像。
一种可选的实施方式中,根据所述目标区域与所述目标对象的预定区域之间的位置关系,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像,包括:
如果确定所述目标区域未处于所述目标对象的预定区域,则基于所述待处理图像上的所述第一轮廓线和所述第二轮廓线构成的区域内的图像数据,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像。
一种可选的实施方式中,所述得到所述目标对象对应的形变后图像之前,还包括:
基于所述待处理图像上的所述第二轮廓线和所述第三轮廓线构成的区域内的图像数据,对所述形变后网格中由偏移后的所述第二轮廓点与所述第三轮廓点构成的区域进行压缩绘制。
一种可选的实施方式中,根据所述目标区域与所述目标对象的预定区域之间的位置关系,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像,包括:
如果确定所述目标区域处于所述目标颅顶对象的头发预定区域,则基于所述待处理图像上的所述第二轮廓线和所述第三轮廓线构成的区域内的图像数据,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像。
一种可选的实施方式中,所述得到所述目标对象对应的形变后图像之前,还包括:
基于所述待处理图像上的所述第二轮廓线和所述第三轮廓线构成的区域内的图像数据,对所述形变后网格中由偏移后的所述第二轮廓点与所述第三轮廓点构成的区域进行拉伸绘制。
第二方面,本公开还提供了一种图像处理装置,所述装置包括:
第一确定模块,用于确定待处理图像上的目标对象的第一轮廓点和第二轮廓点;其中,所述第一轮廓点属于所述目标对象的第一轮廓线上的点,所述第二轮廓点属于所述目标对象的第二轮廓线上的点;
构造模块,用于基于所述第一轮廓点和所述第二轮廓点,构造所述目标对象对应的网格;
偏移模块,用于基于所述目标对象对应的形变参数,对所述网格中的所述第二轮廓点进行偏移,得到形变后网格;其中,所述形变参数用于确定所述第二轮廓点的偏移数据;
生成模块,用于基于所述形变后网格,生成所述目标对象对应的形变后图像。
第三方面,本公开提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备实现上述的方法。
第四方面,本公开提供了一种设备,包括:存储器,处理器,及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现上述的方法。
第五方面,本公开提供了一种计算机程序产品,所述计算机程序产品包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现上述的方法。
本公开实施例提供的技术方案与现有技术相比,至少具有如下优点:
本公开实施例提供了一种图像处理方法,首先,确定待处理图像上的目标对象的第一轮廓点和第二轮廓点,其中,第一轮廓点属于目标对象的第一轮廓线上的点,第二轮廓点属于目标对象的第二轮廓线上的点。其次,基于第一轮廓点和第二轮廓点,构造目标对象对应的网格,并基于目标对象对应的形变参数,对网格中的第二轮廓点进行偏移,得到形变后网格。然后,基于形变后网格,生成目标对象对应的形变后图像。可见,本公开实施例通过对待处理图像上的目标对象的网格进行形变,实现图像处理功能,能够提升待处理图像上的目标对象的显示效果,从而提升用户的体验。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为一种颅顶效果的对比示意图;
图2为本公开实施例提供的一种图像处理方法的流程图;
图3为本公开实施例提供的一种第一轮廓点和第二轮廓点的分布示意图;
图4为本公开实施例提供的一种目标颅顶对应的网格的示意图;
图5为本公开实施例提供的一种预设形变关键点的示意图;
图6为本公开实施例提供的另一种图像处理方法的流程图;
图7为本公开实施例提供的一种第一轮廓点、第二轮廓点和第三轮廓点的分布示意图;
图8为本公开实施例提供的另一种目标颅顶的网格示意图;
图9为本公开实施例提供的一种目标区域的示意图;
图10为本公开实施例提供的一种目标人像中的目标颅顶抬高或拉低后的绘制效果图;
图11为本公开实施例提供的一种图像处理装置的结构示意图;
图12为本公开实施例提供的一种图像处理设备的结构示意图。
具体实施方式
为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本公开,但本公开还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本公开的一部分实施例,而不是全部的实施例。
随着计算机技术的发展,人们对图像处理的需求越来越高。例如,合适的颅顶高度是影响人像的美观度的一个重要因素,为了提高人像的整体美观度,可以通过图像处理的方式,调整颅顶高度,提升颅顶的显示效果。
为了丰富图像处理的方式,本公开提供了一种图像处理方法,首先,确定待处理图像上的目标对象的第一轮廓点和第二轮廓点,其中,第一轮廓点属于目标对象的第一轮廓线上的点,第二轮廓点属于目标对象的第二轮廓线上的点。其次,基于第一轮廓点和第二轮廓点,构造目标对象对应的网格,并基于目标对象对应的形变参数,对网格中的第二轮廓点进行偏移,得到形变后网格。然后,基于形变后网格,生成目标对象对应的形变后图像。可见,本公开实施例通过对待处理图像上的目标对象的网格进行形变,实现图像处理功能,能够提升待处理图像上的目标对象的显示效果,从而提升用户的体验。可见,本公开实施例通过对位于颅顶边缘线上的点进行偏移,使得目标颅顶的网格发生形变,从而得到形变后颅顶,提高了目标颅顶的美观度,进而提升了用户的审美体验。
基于此,本公开实施例提供了一种图像处理方法,参考图2,为本公开实施例提供的一种图像处理方法的流程图,该方法包括:
S201:确定待处理图像上的目标对象的第一轮廓点和第二轮廓点。
其中,所述第一轮廓点属于所述目标对象的第一轮廓线上的点,所述第二轮廓点属于所述目标对象的第二轮廓线上的点。
本公开实施例中的待处理图像可以包括人像、动物图像等类型的图像,而目标对象可以为人像上的颅顶、人脸等人体部位,也可以为动物图像上的颅顶、脸部等。
本公开实施例中,以人像为例进行说明,在确定第一轮廓点和第二轮廓点之前,首先确定待处理人像以及待处理图像上的目标对象。如上述图1所示,1a、1b和1c均可以作为待处理图像。具体的,待处理图像可以是实时拍摄的图像,也可以是由用户选择的图像等,本公开实施例不限制待处理图像的来源。
本公开实施例中的待处理图像上包括目标对象,本公开实施例通过对目标对象对应的网格进行形变,实现对待处理图像上的目标对象的处理,提高目标对象的美观度。
实际应用中,在确定待处理图像上的目标对象之后,进一步确定目标对象的第一轮廓点和第二轮廓点。其中,第一轮廓点是从目标对象的第一轮廓线上确定的点,而第二轮廓点是从目标对象的第二轮廓线上确定的点。
一种可选的实施方式中,可以基于机器学习模型,分别确定待处理图像上的目标对象的第一轮廓点和第二轮廓点。值得注意的是,本公开实施例对于其他确定第一轮廓点和第二轮廓点的方式不做限制。
本公开实施例中的待处理图像可以包括人像,目标对象可以包括人像上的目标颅顶,第一轮廓线可以指目标颅顶上的发际线,而第二轮廓线可以指目标颅顶上的颅顶边缘线。
如图3所示,假设目标对象为目标颅顶,本公开实施例提供的一种第一轮廓点和第二轮廓点的分布示意图,其中,位于发际线上的点为第一轮廓点,位于颅顶边缘线上的点为第二轮廓点。
为了保证目标颅顶的形变效果,第一轮廓点和第二轮廓点可以均匀分布。一种可选的实施方式中,以0号第一轮廓点为中心点,在0号左右各6个第一轮廓点,也就是说,在目标颅顶上可以总共确定13个第一轮廓点。在目标颅顶的颅顶边缘线上分别确定与各个第一轮廓点对应的第二轮廓点。
值得注意的是,本公开实施例对于第一轮廓点和第二轮廓点的个数和分布情况等未做限制。
S202:基于所述第一轮廓点和所述第二轮廓点,构造所述目标对象对应的网格。
本公开实施例中,在确定目标对象的第一轮廓点和第二轮廓点之后,基于第一轮廓点和第二轮廓点,构建目标对象对应的网格。其中,第一轮廓点和第二轮廓点均为目标对象对应的网格中的顶点。
假设目标对象为目标颅顶,如图4所示,为本公开实施例提供的一种目标对象对应的网格的示意图。具体的,该网格是基于上述图3中的第一轮廓点和第二轮廓点构造的。
值得注意的是,本公开实施例对于目标对象的网格的构造方式不做限制。
S203:基于所述目标对象对应的形变参数,对所述网格中的第二轮廓点进行偏移,得到形变后网格。
其中,所述形变参数用于确定所述第二轮廓点的偏移数据。
本公开实施例中,在完成目标对象对应的网格的构造之后,基于该目标对象对应的形变参数,对网格中的第二轮廓点进行偏移,得到形变后网格。
一种可选的实施方式中,目标对象对应的形变参数包括形变输入参数和预设形变关键点,其中,形变输入参数为用户输入的用于表征期望目标对象的形变程度的参数,预设形变关键点为预先设置的用于确定第二轮廓点的偏移数据的关键点。本公开实施例基于目标对象对应的形变输入参数和预设形变关键点,对网格中的第二轮廓点进行偏移,而网格中除第二轮廓点之外的其他点的位置保持不变(即不发生偏移),因此网格会发生形变。
一种可选的实施方式中,用户可以通过操作界面上的滑杆等触发对目标对象的形变调整操作。在接收到针对目标对象的形变调整操作后,确定该目标对象对应的形变参数。例如,假设目标对象为目标颅顶,滑杆的滑动范围为0-100,如果滑杆调整到0-50,则说明用户期望压低目标颅顶,相反的,如果滑杆调整到50-100,则说明用户期望抬高目标颅顶。又例如,滑杆的滑动范围为以0为中心,50为滑动半径的范围即(-50—50),如果滑杆调整到-50—0,则说明用户期望压低目标颅顶,相反的,如果滑杆调整到0-50,则说明用户期望抬高目标颅顶。针对滑杆的滑动范围的设置方式,本公开实施例不做限制。
本公开实施例中,预设形变关键点用于确定第二轮廓点的偏移数据,其中,偏移数据可以包括偏移方向和偏移距离等。
实际应用中,在确定目标对象对应的形变输入参数和预设形变关键点之后,从目标对象对应的网格中的第二轮廓点,确定目标第二轮廓点,以及从预设形变关键点中确定目标形变关键点。如图5所示,为本公开实施例提供的一种预设形变关键点的示意图。假设目标第二轮廓点为上述图5中的0号对应的第二轮廓点,而目标形变关键点为a1。值得注意的是,目标形变关键点可以是待处理图像上任意点,例如,目标形变关键点可以包括未处于目标对象的网格上的点,优选的,在目标对象为目标颅顶的场景下,基于颅顶形变需求,可以将目标形变关键点设置在头发区域内。在确定目标第二轮廓点和目标形变关键点之后,可以基于目标第二轮廓点与目标形变关键点之间的距离,确定目标第二轮廓点是否处于目标形变关键点的影响区域,并得到确定结果。然后,基于该确定结果,进一步确定目标第二轮廓点对应的偏移数据,进而,基于该偏移数据,对网格中的目标第二轮廓点进行偏移,得到形变后网格。
依照上述方式,可以基于预设形变关键点分别确定多个目标形变关键点,如图5所示,还可以分别将a2和a3确定为目标形变关键点,执行上述流程,以分别完成针对目标形变关键点a2和a3,对网格中的目标第二轮廓点进行偏移,具体实现方式可参照上述针对目标形变关键点a1的描述方式理解,在此不再赘述。
一种可选的实施方式中,如果确定结果表征目标第二轮廓点处于目标形变关键点的影响区域,则基于目标对象的形变输入参数以及目标形变关键点对应的预设方向向量,确定目标第二轮廓点对应的偏移数据,进而基于该偏移数据对网格中的目标第二轮廓点进行偏 移。依照上述方式将网格中的各个第二轮廓点分别作为目标第二轮廓点,依次将预设形变关键点分别作为目标形变关键点,实现对网格中各个第二轮廓点的偏移,最终得到形变后网格。
本公开实施例中的形变输入参数用于确定目标第二轮廓点的偏移方向和偏移距离,预设方向向量用于确定目标第二轮廓点的偏移方向。
一种可选的实施方式中,首先,基于所述目标第二轮廓点与所述目标形变关键点之间的距离,确定所述目标第二轮廓点对应的第一偏移参数;其中,所述第一偏移参数与所述距离成正比例关系。然后,将所述第一偏移参数、所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量之间的乘积,确定为所述目标第二轮廓点对应的偏移数据。进而,基于所述偏移数据,对所述网格中的所述目标第二轮廓点进行偏移,得到形变后网格。
实际应用中,可以首先计算目标第二轮廓点与目标形变关键点之间的距离distance(curPoint,a),其中,curPoint用于表示目标第二轮廓点,a用于表示目标形变关键点。然后基于距离distance(curPoint,a)确定目标第二轮廓点curPoint是否处于目标形变关键点a的影响区域。具体的,如果距离distance(curPoint,a)小于预设阈值,则说明目标第二轮廓点curPoint处于目标形变关键点a的影响区域,如果距离distance(curPoint,a)不小于预设阈值,则说明目标第二轮廓点curPoint未处于目标形变关键点a的影响区域。
当目标第二轮廓点curPoint处于目标形变关键点a的影响区域时,则可以基于距离distance(curPoint,a)确定目标第二轮廓点curPoint对应的第一偏移参数。具体的,第一偏移参数infect可以通过如下公式(1)进行计算得到:
infect=distance(curPoint,a)/radius      (1)
其中,radius用于表征目标形变关键点a的控制作用范围,通常为预设的经验常数值。在确定第一偏移参数infect之后,将第一偏移参数infect、目标颅顶对应的形变输入参数以及目标形变关键点对应的预设方向向量之间的乘积,确定为目标第二轮廓点的偏移数据。
一种可选的实施方式中,可以利用如下公式(2)和(3)对网格中的目标第二轮廓点进行偏移:
curPoint=curPoint+T;        (2)
T=hardnessAdjust(infect,movHardness)*intensity*direction(b,a);   (3)
其中,T用于表示目标第二轮廓点curPoint的偏移数据,该偏移数据包括偏移方向和偏移距离,hardnessAdjust()为浓度调节函数,movHardness为预设的经验常数值,基于公式(1)infect=distance(curPoint,a)/radius可以确定distance(curPoint,a)与infect成正比例关系,而hardnessAdjust(infect,movHardness)的数据值与infect成反比例关系,因此hardnessAdjust(infect,movHardness)的数据值与distance(curPoint,a)成反比例关系,distance(curPoint,a)越大,hardnessAdjust(infect,movHardness)的数据值越小,相应的,T对应的目标第二轮廓点的偏移距离越小,即在目标形变关键点的影响范围内,距离目标形变关键点越远的目标第二轮廓点的偏移距离越小。intensity用于表示形变输入参数,通常处于[-1,1]之间,假设目标对象为目标颅顶,则intensity大于0,则说明用户期望抬高颅顶;intensity 小于0,则说明用户期望压低颅顶。direction(b,a)用于表示目标形变关键点a对应的预设方向向量,用于表征目标第二轮廓点curPoint的偏移方向。
一种可选的实施方式中,目标形变关键点可以包括预设关键点对,通过预先设置与目标形变关键点a对应的点b构成(a,b)关键点对的方式,基于目标形变关键点a与点b确定预设方向向量direction(b,a)。
本公开实施例中,在获得上述公式的计算结果之后,可以基于上述方式分别对目标对象的网格上的各个第二轮廓点进行偏移,最终得到形变后网格。
另外,为了保证目标对象的形变效果,避免形变不均匀导致的美观度降低,本公开实施例中的预设形变关键点可以包括至少三对关键点对,例如包括(a1,b1)、(a2,b2)和(a3,b3),如图5所示,其中,a1、a2和a3可以分别为3号第一轮廓点与对应的第二轮廓点的连线上的某点、0号第一轮廓点与对应的第二轮廓点的连线上的某点和41号第一轮廓点与对应的第二轮廓点的连线上的某点,其中,第一轮廓点的编号为随机的,不具有任何意义,b1、b2和b3可以分别处于a1、a2和a3与对应的第二轮廓点的连线上,direction(b1,a1)是指a1指向b1的方向向量。假设目标对象为目标颅顶,如图5所示,由于a1、a2和a3分别分布在目标颅顶的不同方向上,有利于保证颅顶形变的效果,避免因某个方向形变过大等形变不均匀导致的目标颅顶的美观度降低。
S204:基于所述形变后网格,生成所述目标对象对应的形变后图像。
本公开实施例中,在对网格中的第二轮廓点进行偏移得到形变后网格之后,基于形变后网格,生成目标对象对应的形变后图像。
本公开实施例中,假设目标对象为目标颅顶,则形变后图像中的形变后颅顶相对于目标颅顶具有抬高颅顶或者压低颅顶的效果,从而提高了目标颅顶的美观度。
本公开实施例提供的图像处理方法,首先,确定待处理图像上的目标对象的第一轮廓点和第二轮廓点,其中,第一轮廓点属于目标对象的第一轮廓线上的点,第二轮廓点属于目标对象的第二轮廓线上的点。其次,基于第一轮廓点和第二轮廓点,构造目标对象对应的网格,并基于目标对象对应的形变参数,对网格中的第二轮廓点进行偏移,得到形变后网格。然后,基于形变后网格,生成目标对象对应的形变后图像。可见,本公开实施例通过对待处理图像上的目标对象的网格进行形变,实现图像处理功能,能够提升待处理图像上的目标对象的显示效果,从而提升用户的体验。
在上述实施例的基础上,为了降低目标对象发生形变后对待处理图像上的背景区域的影响,可以结合目标对象的第三轮廓线上的点,构造目标对象对应的网格。
为此,本公开实施例还提供了一种图像处理方法,参考图6,为本公开实施例提供的另一种图像处理方法的流程图。该方法包括:
S601:确定待处理图像上的目标对象的第一轮廓点、第二轮廓点和第三轮廓点。
其中,所述第一轮廓点属于所述目标对象的第一轮廓线上的点,所述第二轮廓点属于所述目标对象的第二轮廓线上的点,所述第三轮廓点属于所述目标对象的第三轮廓线上的点。
本公开实施例中,在目标对象的第三轮廓线上确定第三轮廓点。假设目标对象为目标 颅顶,第一轮廓线为目标颅顶上的发际线,第二轮廓线为目标颅顶上的颅顶边缘线,第三轮廓线为目标颅顶对应的颅顶外曲线,颅顶外曲线可以为距离颅顶边缘线一定距离的曲线。如图7所示,为本公开实施例提供的一种第一轮廓点、第二轮廓点和第三轮廓点的分布示意图,其中,第三轮廓点可以位于距离颅顶边缘线一定距离的颅顶外曲线上。
一种可选的实施方式中,目标对象的第三轮廓点可以与第二轮廓点具有一一对应关系。值得注意的是,本公开实施例对于第一轮廓点、第二轮廓点和第三轮廓点的数量和分布情况等未做限制。
一种可选的实施方式中,可以基于机器学习模型,确定待处理图像上的目标对象的第三轮廓点。本公开实施例对于其他确定第三轮廓点的方式不做限制。
S602:基于所述第一轮廓点、所述第二轮廓点和所述第三轮廓点,构造所述目标对象对应的网格。
本公开实施例中,在确定目标人像上的第一轮廓点、第二轮廓点和第三轮廓点之后,可以基于第一轮廓点、第二轮廓点和第三轮廓点构造目标对象的网格。
假设目标对象为目标颅顶,如图8所示,为本公开实施例提供的另一种目标颅顶的网格示意图,具体为根据第一轮廓点、第二轮廓点和第三轮廓点构造的目标对象的网格示意图,值得注意的是,本公开实施例不限制目标颅顶的网格的构造方式。
本公开实施例基于第一轮廓点、第二轮廓点和第三轮廓点构造目标对象的网格,能够保证因目标对象的网格中的第二轮廓点发生偏移引起的网格形变,不会影响由第三轮廓点构成的第三轮廓线之外的背景区域的显示,避免该背景区域因目标对象形变而被覆盖,降低了目标对象形变前后对背景区域的显示内容的影响。
S603:基于所述目标对象对应的形变参数,对所述网格中的所述第二轮廓点进行偏移,得到形变后网格。
其中,所述形变参数用于确定所述第二轮廓点的偏移数据。
本公开实施例中的S603与上述实施例中的S203的实现方式相似,可参照理解,在此不再赘述。
S604:基于所述形变后网格,生成所述目标对象对应的形变后图像。
本公开实施例中,在确定形变后网格之后,基于形变后网格绘制目标对象对应的形变后图像。
一种可选的实施方式中,首先确定形变后网格中由偏移前后的第二轮廓点构成的目标区域,然后,确定该目标区域与目标对象的预定区域之间的位置关系,具体的,该位置关系可以指目标区域是否处于目标对象的预定区域。进而,基于该位置关系对目标区域进行绘制,得到目标对象对应的形变后图像。
假设目标对象为目标颅顶,如图9所示,为本公开实施例提供的一种目标区域的示意图。其中,形变后第二轮廓点构成的轮廓线,即图9中的虚线,与形变前第二轮廓点构成的第二轮廓线(即颅顶边缘线)包围的区域为目标区域,如果目标区域处于目标对象的预定区域(例如头发区域),则说明颅顶形变后产生拉低目标颅顶的效果;相反的,如果目标区域未处于目标对象的预定区域,则说明颅顶形变后产生抬高目标颅顶的效果。例如,如 图9所示,图9中的目标区域未处于目标对象的预定区域,也就是说,目标区域未处于头发区域,则说明该目标颅顶需要抬高。
如果确定目标区域未处于目标对象的预定区域,则基于待处理图像上的所述第一轮廓线和所述第二轮廓线构成的区域内的图像数据,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像。
假设目标对象为目标颅顶,目标区域未处于头发区域,则需要基于头发区域内的图像数据对目标区域进行绘制。具体的,获取待处理图像上的第一轮廓线和第二轮廓线构成的区域内的图像数据,然后基于该图像数据对目标区域进行绘制,得到目标对象对应的形变后图像。
如果确定目标区域处于目标对象的预定区域,则基于所述待处理图像上的所述第二轮廓线和所述第三轮廓线构成的区域内的图像数据,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像。
假设目标对象为目标颅顶,目标区域处于头发区域,则需要基于颅顶外曲线与颅顶边缘线构成的区域内的图像数据,对目标区域进行绘制,得到目标颅顶对应的形变后图像。
一种可选的实施方式中,假设目标对象为目标颅顶,如果确定目标区域未处于目标颅顶的头发区域,则说明颅顶形变抬高了目标颅顶,可以基于所述待处理图像上的所述第二轮廓线和所述第三轮廓线构成的区域内的图像数据,对所述形变后网格中由偏移后的所述第二轮廓点与所述第三轮廓点构成的区域进行压缩绘制。由于颅顶形变引起的目标颅顶抬高会导致颅顶周围的背景区域发生形变,为了控制颅顶形变对背景区域的影响范围,将目标颅顶的颅顶边缘线与颅顶外曲线之间的区域压缩绘制,使得颅顶形变对背景区域的影响控制在颅顶外曲线之内,不会出现因颅顶形变而覆盖目标颅顶周围的背景区域的显示效果,提升图像处理的效果。
一种可选的实施方式中,如果确定目标区域处于目标颅顶的头发区域,则说明颅顶形变拉低了目标颅顶,可以基于所述待处理图像上的所述第二轮廓线和所述第三轮廓线构成的区域内的图像数据,对所述形变后网格中由偏移后的所述第二轮廓点与所述第三轮廓点构成的区域进行拉伸绘制。
假设目标对象为目标颅顶,参考图10,为本公开实施例提供的一种目标颅顶抬高或拉低后的绘制效果图。可见,通过颅顶形变抬高或拉低目标颅顶之后,提高了目标颅顶的美观度。
本公开实施例提供的图像处理方法,首先,确定待处理图像上的目标对象的第一轮廓点和第二轮廓点,其中,第一轮廓点属于目标对象的第一轮廓线上的点,第二轮廓点属于目标对象的第二轮廓线上的点。其次,基于第一轮廓点和第二轮廓点,构造目标对象对应的网格,并基于目标对象对应的形变参数,对网格中的第二轮廓点进行偏移,得到形变后网格。然后,基于形变后网格,生成目标对象对应的形变后图像。可见,本公开实施例通过对待处理图像上的目标对象的网格进行形变,实现图像处理功能,能够提升待处理图像上的目标对象的显示效果,从而提升用户的体验。
另外,本公开实施例通过目标对象的网格中的第二轮廓点发生偏移,导致网格发生形 变,实现目标对象的形变,而目标对象的网格中的第一轮廓点和第三轮廓点均未发生偏移,可以保证因目标对象形变而受到影响的背景区域被限制在第三轮廓点所在的第三轮廓线之内,避免背景区域因目标对象形变而被覆盖,降低目标对象形变前后对背景区域的显示内容的影响,提升用户的体验。
基于上述方法实施例,本公开还提供了一种图像处理装置,参考图11,为本公开实施例提供的一种图像处理装置的结构示意图,所述装置包括:
第一确定模块1101,用于确定待处理图像上的目标对象的第一轮廓点和第二轮廓点;其中,所述第一轮廓点属于所述目标对象的第一轮廓线上的点,所述第二轮廓点属于所述目标对象的第二轮廓线上的点;
构造模块1102,用于基于所述第一轮廓点和所述第二轮廓点,构造所述目标对象对应的网格;
偏移模块1103,用于基于所述目标对象对应的形变参数,对所述网格中的所述第二轮廓点进行偏移,得到形变后网格;其中,所述形变参数用于确定所述第二轮廓点的偏移数据;
生成模块1104,用于基于所述形变后网格,生成所述目标对象对应的形变后图像。
一种可选的实施方式中,所述装置还包括:
第二确定模块,用于确定所述目标对象的第三轮廓点;其中,所述第三轮廓点属于所述目标对象的第三轮廓线上的点;
相应的,所述构造模块,具体用于:
基于所述第一轮廓点、所述第二轮廓点和所述第三轮廓点,构造所述目标对象对应的网格。
一种可选的实施方式中,所述形变参数包括形变输入参数和预设形变关键点,所述偏移模块,包括:
第一确定子模块,用于从所述网格中的所述第二轮廓点中确定目标第二轮廓点,以及从所述预设形变关键点中确定目标形变关键点;
第二确定子模块,用于基于所述目标第二轮廓点与所述目标形变关键点之间的距离,确定所述目标第二轮廓点是否处于所述目标形变关键点的影响区域,并得到确定结果;其中,所述确定结果用于表征所述目标第二轮廓点是否处于所述目标形变关键点的影响区域;
第三确定子模块,用于基于所述确定结果,确定所述目标第二轮廓点对应的偏移数据;
第一偏移子模块,用于基于所述偏移数据,对所述网格中的所述目标第二轮廓点进行偏移,得到所述形变后网格。
一种可选的实施方式中,所述第三确定子模块,具体用于:
在所述确定结果表征出所述目标第二轮廓点处于所述目标形变关键点的影响区域,则基于所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量,确定所述目标第二轮廓点对应的偏移数据;
其中,所述目标第二轮廓点对应的偏移数据包括所述目标第二轮廓点的偏移方向和偏移距离,所述形变输入参数用于确定所述偏移方向和所述偏移距离,所述预设方向向量用 于确定所述偏移方向。
一种可选的实施方式中,所述第三确定子模块,包括:
第四确定子模块,用于基于所述目标第二轮廓点与所述目标形变关键点之间的距离,确定所述目标第二轮廓点对应的第一偏移参数;
第五确定子模块,用于基于所述第一偏移参数、所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量,确定为所述目标第二轮廓点对应的偏移数据。
一种可选的实施方式中,所述目标形变关键点包括预设关键点对,所述目标形变关键点对应的预设方向向量由所述预设关键点对确定。
一种可选的实施方式中,所述第一确定模块,具体用于:
基于机器学习模型,分别确定待处理图像上的目标对象的第一轮廓点和第二轮廓点。
一种可选的实施方式中,所述生成模块,包括:
第六确定子模块,用于确定所述形变后网格中由偏移前后的所述第二轮廓点构成的目标区域;
第一绘制子模块,用于根据所述目标区域与所述目标对象的预定区域之间的位置关系,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像。
一种可选的实施方式中,所述第一绘制子模块,具体用于:
在确定所述目标区域未处于所述目标对象的预定区域,则基于所述待处理图像上的所述第一轮廓线和所述第二轮廓线构成的区域内的图像数据,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像。
一种可选的实施方式中,所述装置还包括:
第二绘制子模块,用于基于所述待处理图像上的所述第二轮廓线和所述第三轮廓线构成的区域内的图像数据,对所述形变后网格中由偏移后的所述第二轮廓点与所述第三轮廓点构成的区域进行压缩绘制。
一种可选的实施方式中,所述第一绘制子模块,具体用于:
在确定所述目标区域处于所述目标对象的预定区域,则基于所述待处理图像上的所述第二轮廓线和所述第三轮廓线构成的区域内的图像数据,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像。
一种可选的实施方式中,所述装置还包括:
第三绘制子模块,用于基于所述待处理图像上的所述第二轮廓线和所述第三轮廓线构成的区域内的图像数据,对所述形变后网格中由偏移后的所述第二轮廓点与所述第三轮廓点构成的区域进行拉伸绘制。
本公开实施例提供的图像处理装置中,首先,确定待处理图像上的目标对象的第一轮廓点和第二轮廓点,其中,第一轮廓点属于目标对象的第一轮廓线上的点,第二轮廓点属于目标对象的第二轮廓线上的点。其次,基于第一轮廓点和第二轮廓点,构造目标颅对象对应的网格,并基于目标对象对应的形变参数,对网格中的第二轮廓点进行偏移,得到形变后网格。然后,基于形变后网格,生成目标对象对应的形变后图像。可见,本公开实施例通过对待处理图像上的目标对象的网格进行形变,实现图像处理功能,能够提升待处理 图像上的目标对象的显示效果,从而提升用户的体验。
除了上述方法和装置以外,本公开实施例还提供了一种计算机可读存储介质,计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备实现本公开实施例所述的图像处理方法。
本公开实施例还提供了一种计算机程序产品,包括计算机程序/指令,其特征在于,该计算机程序/指令被处理器执行时实现本公开实施例所述的图像处理方法。
另外,本公开实施例还提供了一种图像处理设备,参见图12所示,可以包括:
处理器1201、存储器1202、输入装置1203和输出装置1204。图像处理设备中的处理器1201的数量可以一个或多个,图12中以一个处理器为例。在本公开的一些实施例中,处理器1201、存储器1202、输入装置1203和输出装置1204可通过总线或其它方式连接,其中,图12中以通过总线连接为例。
存储器1202可用于存储软件程序以及模块,处理器1201通过运行存储在存储器1202的软件程序以及模块,从而执行图像处理设备的各种功能应用以及数据处理。存储器1202可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等。此外,存储器1202可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。输入装置1203可用于接收输入的数字或字符信息,以及产生与图像处理设备的用户设置以及功能控制有关的信号输入。
具体在本实施例中,处理器1201会按照如下的指令,将一个或一个以上的应用程序的进程对应的可执行文件加载到存储器1202中,并由处理器1201来运行存储在存储器1202中的应用程序,从而实现上述图像处理设备的各种功能。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所述的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (19)

  1. 一种图像处理方法,其特征在于,所述方法包括:
    确定待处理图像上的目标对象的第一轮廓点和第二轮廓点;其中,所述第一轮廓点属于所述目标对象的第一轮廓线上的点,所述第二轮廓点属于所述目标对象的第二轮廓线上的点;
    基于所述第一轮廓点和所述第二轮廓点,构造所述目标对象对应的网格;
    基于所述目标对象对应的形变参数,对所述网格中的所述第二轮廓点进行偏移,得到形变后网格;其中,所述形变参数用于确定所述第二轮廓点的偏移数据;
    基于所述形变后网格,生成所述目标对象对应的形变后图像。
  2. 根据权利要求1所述的方法,其特征在于,所述基于所述第一轮廓点和所述第二轮廓点,构造所述目标对象对应的网格之前,还包括:
    确定所述目标对象的第三轮廓点;其中,所述第三轮廓点属于所述目标对象的第三轮廓线上的点;
    相应的,所述基于所述第一轮廓点和所述第二轮廓点,构造所述目标对象对应的网格,包括:
    基于所述第一轮廓点、所述第二轮廓点和所述第三轮廓点,构造所述目标对象对应的网格。
  3. 根据权利要求1所述的方法,其特征在于,所述形变参数包括形变输入参数和预设形变关键点,所述形变输入参数用于表征期望所述目标对象的形变程度的参数,所述预设形变关键点用于确定所述第二轮廓点的偏移数据。
  4. 根据权利要求3所述的方法,其特征在于,所述基于所述目标对象对应的形变参数,对所述网格中的所述第二轮廓点进行偏移,得到形变后网格,包括:
    从所述网格中的所述第二轮廓点中确定目标第二轮廓点,以及从所述预设形变关键点中确定目标形变关键点;
    基于所述目标第二轮廓点与所述目标形变关键点之间的距离,确定所述目标第二轮廓点是否处于所述目标形变关键点的影响区域,并得到确定结果;其中,所述确定结果用于表征所述目标第二轮廓点是否处于所述目标形变关键点的影响区域;
    基于所述确定结果,确定所述目标第二轮廓点对应的偏移数据;
    基于所述偏移数据,对所述网格中的所述目标第二轮廓点进行偏移,得到所述形变后网格。
  5. 根据权利要求4所述的方法,其特征在于,基于所述确定结果,确定所述目标第二轮廓点对应的偏移数据,包括:
    如果所述确定结果表征所述目标第二轮廓点处于所述目标形变关键点的影响区域,则基于所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量,确定所述目标第二轮廓点对应的偏移数据;
    其中,所述目标第二轮廓点对应的偏移数据包括所述目标第二轮廓点的偏移方向和偏移距离,所述形变输入参数用于确定所述偏移方向和所述偏移距离,所述预设方向向量用 于确定所述偏移方向。
  6. 根据权利要求5所述的方法,其特征在于,所述基于所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量,确定所述目标第二轮廓点对应的偏移数据,包括:
    基于所述目标第二轮廓点与所述目标形变关键点之间的距离,确定所述目标第二轮廓点对应的第一偏移参数;
    基于所述第一偏移参数、所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量,确定所述目标第二轮廓点对应的偏移数据。
  7. 根据权利要求6所述的方法,其特征在于,所述基于所述第一偏移参数、所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量,确定所述目标第二轮廓点对应的偏移数据,包括:
    将所述第一偏移参数、所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量之间的乘积,确定为所述目标第二轮廓点对应的偏移数据。
  8. 根据权利要求5-6任一项所述的方法,其特征在于,所述目标形变关键点包括预设关键点对,所述目标形变关键点对应的预设方向向量由所述预设关键点对确定。
  9. 根据权利要求1所述的方法,其特征在于,所述确定待处理图像上的目标对象的第一轮廓点和第二轮廓点,包括:
    基于机器学习模型,分别确定待处理图像上的目标对象的第一轮廓点和第二轮廓点。
  10. 根据权利要求2所述的方法,其特征在于,所述基于所述形变后网格,生成所述目标对象对应的形变后图像,包括:
    确定所述形变后网格中由偏移前后的所述第二轮廓点构成的目标区域;
    根据所述目标区域与所述目标对象的预定区域之间的位置关系,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像,所述位置关系用于表征所述目标区域是否处于所述目标对象的预定区域。
  11. 根据权利要求10所述的方法,其特征在于,根据所述目标区域与所述目标对象的预定区域之间的位置关系,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像,包括:
    如果确定所述目标区域未处于所述目标对象的预定区域,则基于所述待处理图像上的所述第一轮廓线和所述第二轮廓线构成的区域内的图像数据,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像。
  12. 根据权利要求11所述的方法,其特征在于,所述得到所述目标对象对应的形变后图像之前,还包括:
    基于所述待处理图像上的所述第二轮廓线和所述第三轮廓线构成的区域内的图像数据,对所述形变后网格中由偏移后的所述第二轮廓点与所述第三轮廓点构成的区域进行压缩绘制。
  13. 根据权利要求10所述的方法,其特征在于,根据所述目标区域与所述目标对象的预定区域之间的位置关系,对所述目标区域进行绘制,得到所述目标对象对应的形变后图 像,包括:
    如果确定所述目标区域处于所述目标对象的预定区域,则基于所述待处理图像上的所述第二轮廓线和所述第三轮廓线构成的区域内的图像数据,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像。
  14. 根据权利要求13所述的方法,其特征在于,所述得到所述目标对象对应的形变后图像之前,还包括:
    基于所述待处理图像上的所述第二轮廓线和所述第三轮廓线构成的区域内的图像数据,对所述形变后网格中由偏移后的所述第二轮廓点与所述第三轮廓点构成的区域进行拉伸绘制。
  15. 根据权利要求1所述的方法,其特征在于,所述待处理图像包括人像,所述目标对象为所述人像上的目标颅顶,所述第一轮廓线为所述目标颅顶上的发际线,所述第二轮廓线为所述目标颅顶上的颅顶边缘线。
  16. 一种图像处理装置,其特征在于,所述装置包括:
    第一确定模块,用于确定待处理图像上的目标对象的第一轮廓点和第二轮廓点;其中,所述第一轮廓点属于所述目标对象的第一轮廓线上的点,所述第二轮廓点属于所述目标对象的第二轮廓线上的点;
    构造模块,用于基于所述第一轮廓点和所述第二轮廓点,构造所述目标对象对应的网格;
    偏移模块,用于基于所述目标对象对应的形变参数,对所述网格中的所述第二轮廓点进行偏移,得到形变后网格;其中,所述形变参数用于确定所述第二轮廓点的偏移数据;
    生成模块,用于基于所述形变后网格,生成所述目标对象对应的形变后图像。
  17. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备实现如权利要求1-15任一项所述的方法。
  18. 一种设备,其特征在于,包括:存储器,处理器,及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如权利要求1-12任一项所述的方法。
  19. 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现如权利要求1-15任一项所述的方法。
PCT/CN2022/081881 2021-04-30 2022-03-21 一种图像处理方法、装置、设备及存储介质 Ceased WO2022227929A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/551,783 US12524854B2 (en) 2021-04-30 2022-03-21 Image processing method and apparatus, device and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110482197.7 2021-04-30
CN202110482197.7A CN115272089A (zh) 2021-04-30 2021-04-30 一种图像处理方法、装置、设备及存储介质

Publications (1)

Publication Number Publication Date
WO2022227929A1 true WO2022227929A1 (zh) 2022-11-03

Family

ID=83745314

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/081881 Ceased WO2022227929A1 (zh) 2021-04-30 2022-03-21 一种图像处理方法、装置、设备及存储介质

Country Status (3)

Country Link
US (1) US12524854B2 (zh)
CN (1) CN115272089A (zh)
WO (1) WO2022227929A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5999651A (en) * 1997-06-06 1999-12-07 Matsushita Electric Industrial Co., Ltd. Apparatus and method for tracking deformable objects
CN110288519A (zh) * 2019-06-29 2019-09-27 北京字节跳动网络技术有限公司 图像美化方法、装置及电子设备
CN111652795A (zh) * 2019-07-05 2020-09-11 广州虎牙科技有限公司 脸型的调整、直播方法、装置、电子设备和存储介质
CN112102198A (zh) * 2020-09-17 2020-12-18 广州虎牙科技有限公司 图像处理方法、装置、电子设备和计算机可读存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
SG11202002606UA (en) * 2017-10-05 2020-04-29 Agency Science Tech & Res Method and system for geometrical reconstruction of an internal anatomical structure
US10789784B2 (en) * 2018-05-23 2020-09-29 Asustek Computer Inc. Image display method, electronic device, and non-transitory computer readable recording medium for quickly providing simulated two-dimensional head portrait as reference after plastic operation
CN110533761B (zh) * 2018-05-23 2024-01-12 华硕电脑股份有限公司 影像显示方法、电子装置及非瞬时电脑可读取记录媒体
CN109584151B (zh) * 2018-11-30 2022-12-13 腾讯科技(深圳)有限公司 人脸美化方法、装置、终端及存储介质
US10943375B2 (en) * 2019-04-17 2021-03-09 Adobe Inc. Multi-state vector graphics
CN111489311B (zh) * 2020-04-09 2023-08-08 北京百度网讯科技有限公司 一种人脸美化方法、装置、电子设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5999651A (en) * 1997-06-06 1999-12-07 Matsushita Electric Industrial Co., Ltd. Apparatus and method for tracking deformable objects
CN110288519A (zh) * 2019-06-29 2019-09-27 北京字节跳动网络技术有限公司 图像美化方法、装置及电子设备
CN111652795A (zh) * 2019-07-05 2020-09-11 广州虎牙科技有限公司 脸型的调整、直播方法、装置、电子设备和存储介质
CN112102198A (zh) * 2020-09-17 2020-12-18 广州虎牙科技有限公司 图像处理方法、装置、电子设备和计算机可读存储介质

Also Published As

Publication number Publication date
CN115272089A (zh) 2022-11-01
US12524854B2 (en) 2026-01-13
US20240177379A1 (en) 2024-05-30

Similar Documents

Publication Publication Date Title
CN109063560B (zh) 图像处理方法、装置、计算机可读存储介质和终端
US10990804B2 (en) Face image processing method and device, and storage medium
CN109859098B (zh) 人脸图像融合方法、装置、计算机设备及可读存储介质
JP7125545B2 (ja) ビデオ画面調整方法、装置、コンピュータ装置および記憶媒体
WO2020207270A1 (zh) 一种三维人脸重建方法及其系统、装置、存储介质
CN108986016B (zh) 图像美化方法、装置及电子设备
CN109146991B (zh) 一种图片格式转换方法、装置、设备和存储介质
US11409794B2 (en) Image deformation control method and device and hardware device
CN105320929A (zh) 拍照的同步美化方法及其拍照装置
CN102971769A (zh) 图像变形装置、电子设备、图像变形方法、图像变形程序、以及记录有该程序的记录介质
CN109064525B (zh) 一种图片格式转换方法、装置、设备和存储介质
CN111476151B (zh) 眼球检测方法、装置、设备及存储介质
WO2017088605A1 (zh) 图片编辑中的图片显示控制方法及装置
CN111652795A (zh) 脸型的调整、直播方法、装置、电子设备和存储介质
CN109003224A (zh) 基于人脸的形变图像生成方法和装置
CN111833399A (zh) 基于鱼眼图像的目标检测方法及相关设备
WO2021169736A1 (zh) 美颜处理方法及装置
CN112150387B (zh) 对照片中的人像增强五官立体感的方法及装置
CN105869116A (zh) 一种移动终端及照片处理方法
CN113920282B (zh) 图像处理方法和装置、计算机可读存储介质、电子设备
WO2022227929A1 (zh) 一种图像处理方法、装置、设备及存储介质
CN110610469B (zh) 一种人脸图像隐私保护方法、装置、设备及存储介质
CN112070854A (zh) 一种图像生成方法、装置、设备及存储介质
CN109146770B (zh) 一种形变图像生成方法、装置、电子设备及计算机可读存储介质
CN118397202B (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: 22794405

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18551783

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22794405

Country of ref document: EP

Kind code of ref document: A1

WWG Wipo information: grant in national office

Ref document number: 18551783

Country of ref document: US