WO2022227929A1 - 一种图像处理方法、装置、设备及存储介质 - Google Patents
一种图像处理方法、装置、设备及存储介质 Download PDFInfo
- 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
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/77—Retouching; Inpainting; Scratch removal
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/80—Geometric correction
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—Two-dimensional [2D] image generation
- G06T11/20—Drawing from basic elements
- G06T11/23—Drawing from basic elements using straight lines or curves
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—Two-dimensional [2D] image generation
- G06T11/60—Creating or editing images; Combining images with text
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/18—Image warping, e.g. rearranging pixels individually
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/60—Image enhancement or restoration using machine learning, e.g. neural networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30196—Human being; Person
- G06T2207/30201—Face
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2210/00—Indexing scheme for image generation or computer graphics
- G06T2210/44—Morphing
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
Claims (19)
- 一种图像处理方法,其特征在于,所述方法包括:确定待处理图像上的目标对象的第一轮廓点和第二轮廓点;其中,所述第一轮廓点属于所述目标对象的第一轮廓线上的点,所述第二轮廓点属于所述目标对象的第二轮廓线上的点;基于所述第一轮廓点和所述第二轮廓点,构造所述目标对象对应的网格;基于所述目标对象对应的形变参数,对所述网格中的所述第二轮廓点进行偏移,得到形变后网格;其中,所述形变参数用于确定所述第二轮廓点的偏移数据;基于所述形变后网格,生成所述目标对象对应的形变后图像。
- 根据权利要求1所述的方法,其特征在于,所述基于所述第一轮廓点和所述第二轮廓点,构造所述目标对象对应的网格之前,还包括:确定所述目标对象的第三轮廓点;其中,所述第三轮廓点属于所述目标对象的第三轮廓线上的点;相应的,所述基于所述第一轮廓点和所述第二轮廓点,构造所述目标对象对应的网格,包括:基于所述第一轮廓点、所述第二轮廓点和所述第三轮廓点,构造所述目标对象对应的网格。
- 根据权利要求1所述的方法,其特征在于,所述形变参数包括形变输入参数和预设形变关键点,所述形变输入参数用于表征期望所述目标对象的形变程度的参数,所述预设形变关键点用于确定所述第二轮廓点的偏移数据。
- 根据权利要求3所述的方法,其特征在于,所述基于所述目标对象对应的形变参数,对所述网格中的所述第二轮廓点进行偏移,得到形变后网格,包括:从所述网格中的所述第二轮廓点中确定目标第二轮廓点,以及从所述预设形变关键点中确定目标形变关键点;基于所述目标第二轮廓点与所述目标形变关键点之间的距离,确定所述目标第二轮廓点是否处于所述目标形变关键点的影响区域,并得到确定结果;其中,所述确定结果用于表征所述目标第二轮廓点是否处于所述目标形变关键点的影响区域;基于所述确定结果,确定所述目标第二轮廓点对应的偏移数据;基于所述偏移数据,对所述网格中的所述目标第二轮廓点进行偏移,得到所述形变后网格。
- 根据权利要求4所述的方法,其特征在于,基于所述确定结果,确定所述目标第二轮廓点对应的偏移数据,包括:如果所述确定结果表征所述目标第二轮廓点处于所述目标形变关键点的影响区域,则基于所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量,确定所述目标第二轮廓点对应的偏移数据;其中,所述目标第二轮廓点对应的偏移数据包括所述目标第二轮廓点的偏移方向和偏移距离,所述形变输入参数用于确定所述偏移方向和所述偏移距离,所述预设方向向量用 于确定所述偏移方向。
- 根据权利要求5所述的方法,其特征在于,所述基于所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量,确定所述目标第二轮廓点对应的偏移数据,包括:基于所述目标第二轮廓点与所述目标形变关键点之间的距离,确定所述目标第二轮廓点对应的第一偏移参数;基于所述第一偏移参数、所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量,确定所述目标第二轮廓点对应的偏移数据。
- 根据权利要求6所述的方法,其特征在于,所述基于所述第一偏移参数、所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量,确定所述目标第二轮廓点对应的偏移数据,包括:将所述第一偏移参数、所述目标对象对应的形变输入参数以及所述目标形变关键点对应的预设方向向量之间的乘积,确定为所述目标第二轮廓点对应的偏移数据。
- 根据权利要求5-6任一项所述的方法,其特征在于,所述目标形变关键点包括预设关键点对,所述目标形变关键点对应的预设方向向量由所述预设关键点对确定。
- 根据权利要求1所述的方法,其特征在于,所述确定待处理图像上的目标对象的第一轮廓点和第二轮廓点,包括:基于机器学习模型,分别确定待处理图像上的目标对象的第一轮廓点和第二轮廓点。
- 根据权利要求2所述的方法,其特征在于,所述基于所述形变后网格,生成所述目标对象对应的形变后图像,包括:确定所述形变后网格中由偏移前后的所述第二轮廓点构成的目标区域;根据所述目标区域与所述目标对象的预定区域之间的位置关系,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像,所述位置关系用于表征所述目标区域是否处于所述目标对象的预定区域。
- 根据权利要求10所述的方法,其特征在于,根据所述目标区域与所述目标对象的预定区域之间的位置关系,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像,包括:如果确定所述目标区域未处于所述目标对象的预定区域,则基于所述待处理图像上的所述第一轮廓线和所述第二轮廓线构成的区域内的图像数据,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像。
- 根据权利要求11所述的方法,其特征在于,所述得到所述目标对象对应的形变后图像之前,还包括:基于所述待处理图像上的所述第二轮廓线和所述第三轮廓线构成的区域内的图像数据,对所述形变后网格中由偏移后的所述第二轮廓点与所述第三轮廓点构成的区域进行压缩绘制。
- 根据权利要求10所述的方法,其特征在于,根据所述目标区域与所述目标对象的预定区域之间的位置关系,对所述目标区域进行绘制,得到所述目标对象对应的形变后图 像,包括:如果确定所述目标区域处于所述目标对象的预定区域,则基于所述待处理图像上的所述第二轮廓线和所述第三轮廓线构成的区域内的图像数据,对所述目标区域进行绘制,得到所述目标对象对应的形变后图像。
- 根据权利要求13所述的方法,其特征在于,所述得到所述目标对象对应的形变后图像之前,还包括:基于所述待处理图像上的所述第二轮廓线和所述第三轮廓线构成的区域内的图像数据,对所述形变后网格中由偏移后的所述第二轮廓点与所述第三轮廓点构成的区域进行拉伸绘制。
- 根据权利要求1所述的方法,其特征在于,所述待处理图像包括人像,所述目标对象为所述人像上的目标颅顶,所述第一轮廓线为所述目标颅顶上的发际线,所述第二轮廓线为所述目标颅顶上的颅顶边缘线。
- 一种图像处理装置,其特征在于,所述装置包括:第一确定模块,用于确定待处理图像上的目标对象的第一轮廓点和第二轮廓点;其中,所述第一轮廓点属于所述目标对象的第一轮廓线上的点,所述第二轮廓点属于所述目标对象的第二轮廓线上的点;构造模块,用于基于所述第一轮廓点和所述第二轮廓点,构造所述目标对象对应的网格;偏移模块,用于基于所述目标对象对应的形变参数,对所述网格中的所述第二轮廓点进行偏移,得到形变后网格;其中,所述形变参数用于确定所述第二轮廓点的偏移数据;生成模块,用于基于所述形变后网格,生成所述目标对象对应的形变后图像。
- 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当所述指令在终端设备上运行时,使得所述终端设备实现如权利要求1-15任一项所述的方法。
- 一种设备,其特征在于,包括:存储器,处理器,及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时,实现如权利要求1-12任一项所述的方法。
- 一种计算机程序产品,其特征在于,所述计算机程序产品包括计算机程序/指令,所述计算机程序/指令被处理器执行时实现如权利要求1-15任一项所述的方法。
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)
| 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)
| 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 | 北京百度网讯科技有限公司 | 一种人脸美化方法、装置、电子设备及存储介质 |
-
2021
- 2021-04-30 CN CN202110482197.7A patent/CN115272089A/zh active Pending
-
2022
- 2022-03-21 WO PCT/CN2022/081881 patent/WO2022227929A1/zh not_active Ceased
- 2022-03-21 US US18/551,783 patent/US12524854B2/en active Active
Patent Citations (4)
| 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 |