WO2022062570A1 - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
WO2022062570A1
WO2022062570A1 PCT/CN2021/105024 CN2021105024W WO2022062570A1 WO 2022062570 A1 WO2022062570 A1 WO 2022062570A1 CN 2021105024 W CN2021105024 W CN 2021105024W WO 2022062570 A1 WO2022062570 A1 WO 2022062570A1
Authority
WO
WIPO (PCT)
Prior art keywords
touch point
point
offset
grid point
image
Prior art date
Application number
PCT/CN2021/105024
Other languages
French (fr)
Chinese (zh)
Inventor
艾尼
Original Assignee
北京达佳互联信息技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京达佳互联信息技术有限公司 filed Critical 北京达佳互联信息技术有限公司
Publication of WO2022062570A1 publication Critical patent/WO2022062570A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present disclosure relates to the technical field of image processing, and in particular, to an image processing method and apparatus.
  • body beauty and beauty are performed based on key points such as the human body or the face, for example, the key points of the face based on the image to be processed, such as eyes, nose, etc., and the key points of the face after beauty, such as the eyes, nose, etc., the image to be processed Deformation is performed to generate a beautiful image. Since the key points are only a few points of the whole body, only a relatively limited body part can be adjusted. The image processing effect is also relatively poor.
  • the present disclosure provides an image processing method and device to at least solve the problem that in the related art, it is not possible to perform image processing such as free shaping and body shaping for any position of the entire image, such as the human body or face, etc. Single and the effect of beauty and body is relatively poor.
  • image processing such as free shaping and body shaping for any position of the entire image, such as the human body or face, etc.
  • Single and the effect of beauty and body is relatively poor.
  • the technical solutions of the present disclosure are as follows:
  • an image processing method comprising:
  • the image to be processed includes multiple grids and grid points corresponding to the multiple grids;
  • the offset of each grid point is determined according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, the The adjustment radius is used to control the offset degree of each grid point;
  • Corresponding texture information is added to the intermediate processed image to generate a target image.
  • an image processing apparatus comprising:
  • a first acquiring unit configured to acquire a start touch point and an end touch point for the image to be processed; wherein the image to be processed includes a plurality of grids and grid points corresponding to the plurality of grids;
  • a determining unit configured to determine the liquefaction area according to the position information of the start touch point and the end touch point
  • the generating unit is configured to determine the offset of each grid point according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; Shift amount; wherein, the adjustment radius is used to control the offset degree of each grid point;
  • control unit configured to move each grid point according to the offset of each grid point to obtain an intermediate processed image
  • a processing unit configured to add corresponding texture information to the intermediate processed image to generate a target image.
  • an electronic device comprising:
  • a memory for storing the processor-executable instructions
  • the processor is configured as the instruction to implement the image processing method described in the above embodiment.
  • a storage medium is provided, when the instructions in the storage medium are executed by the processor of the server, the server can execute the image processing method described in the above embodiments.
  • a computer program product when instructions in the computer program product are executed by a processor, the electronic device can execute the image processing method described in the above embodiments.
  • the start touch point and end touch point for the image to be processed; wherein the image to be processed includes multiple grids and grid points corresponding to the multiple grids, and according to the difference between the start touch point and the end touch point
  • the location information determines the liquefaction area; the offset of each grid point is determined according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; It is used to control the offset degree of each grid point; move each grid point according to the offset of each grid point to obtain an intermediate processed image; add corresponding texture information to the intermediate processed image to generate the target image.
  • image processing such as body beautification and beauty on the adjusted position of the human body or face by simply operating the position that needs to be adjusted in the image, so as to improve the beauty and body effect and the operation is simple and fast.
  • FIG. 1 is a flowchart of an image processing method according to an exemplary embodiment
  • FIG. 2 is a flowchart of another image processing method according to an exemplary embodiment
  • 3a-3b are scene graphs determined by an image to be processed including a plurality of grid points according to an exemplary embodiment
  • FIG. 4 is a scene diagram of a sliding operation according to an exemplary embodiment
  • FIG. 5 is a scene diagram illustrating a liquefaction region determination according to an exemplary embodiment
  • FIG. 6 is an example diagram illustrating an image processing effect according to an exemplary embodiment
  • FIG. 7 is a flowchart of yet another image processing method according to an exemplary embodiment
  • FIG. 8 is a scene diagram illustrating a click operation according to an exemplary embodiment
  • FIG. 9 is a block diagram of an image processing apparatus according to an exemplary embodiment.
  • FIG. 10 is a block diagram of another image processing apparatus according to an exemplary embodiment
  • FIG. 11 is a block diagram of yet another image processing apparatus according to an exemplary embodiment
  • FIG. 12 is a block diagram of still another image processing apparatus according to an exemplary embodiment
  • Fig. 13 is a schematic structural diagram of an electronic device according to the first exemplary embodiment.
  • liquefaction can be used to push, pull, and expand any area of the image, that is, body contouring, body contouring, etc.
  • the prior art methods for contouring and body contouring based on key points cannot be applied to scenes such as contouring and body contouring without key points. , and can not completely adjust the position of the entire image, such as the human body or face, to perform image processing such as free beauty and body beauty according to user needs, resulting in a single adjustment method and poor beauty and body effects.
  • the image processing method proposed in this application can adjust any position in the image, mainly for the position that needs to be adjusted such as the human body or the face in the image, by freely sliding the position of the human body or the face that needs to be adjusted to perform autonomous body beauty and beauty.
  • the shape, beauty shape, degree of beauty and the position of beauty shape and body are completely controlled by the user, which solves the limitation of the existing beauty shape based on key points that cannot be adjusted more autonomously.
  • the beauty scene, and the inability to adjust the position of the entire image, such as the human body or face, for free beauty, body beauty, etc., can not be completely adjusted according to user needs, resulting in a single adjustment method and poor beauty and body effects.
  • the image processing method of the present application can perform image processing on any position in the image, such as scene images, object images, animals, fruit images, etc. in the image, and the selection and settings are specifically selected according to the actual application scene.
  • Subsequent embodiments of the present application describe the image processing method proposed in the present application mainly by taking a face or a human body as an adjustment object.
  • Fig. 1 is a flowchart of an image processing method according to an exemplary embodiment. As shown in Fig. 1 , the image processing method is used in an electronic device, and the electronic device can be a smart phone, a tablet computer, and a smart terminal (such as TV, etc.), etc., including the following steps:
  • step S101 a start touch point and an end touch point for the image to be processed are acquired; wherein the image to be processed includes multiple grids and grid points corresponding to the multiple grids.
  • the user can send the operation instruction through one or more methods, such as a finger, a stylus, and a mouse, and the selection is specifically made according to the user's operation habit.
  • one or more methods such as a finger, a stylus, and a mouse
  • an image to be processed refers to an image to be processed that is divided into multiple grids and multiple grids with corresponding grid points after the image is acquired according to a preset step size; wherein , the preset step size is related to the number of pixels of the image to be processed. The smaller the value of the preset step size, the denser the grid points of the image to be processed, and the more natural effects such as beauty and body beauty.
  • the image may be a picture, each frame of picture in the video, etc., wherein, the video needs to be processed in advance to obtain each frame of picture.
  • the start touch point is any position point in the image to be processed
  • the end touch point is a position point different from any position point in the to-be-processed image and corresponding to the start touch point.
  • the touch point when the user starts to touch the to-be-processed image and the touch point when the user moves away from the to-be-processed image are acquired.
  • the touch points when the user clicks the to-be-processed image for the first time and the touch points when the user clicks the to-be-processed image for the second time are acquired.
  • step S102 the liquefaction area is determined according to the position information of the start touch point and the end touch point.
  • the liquefaction region refers to a region that needs to be liquefied (push, pull, expand, etc.).
  • the liquefaction area may be determined based on the position information of the start touch point and the position information of the end touch point, wherein the start touch point and the end touch point
  • the position information of the touch point can be represented by coordinate points, and the coordinate system can be selected as the width of the image as the horizontal axis and the height as the vertical axis; the starting touch point refers to the point where liquefaction needs to start (for example, it can be when the user slides his finger).
  • the point coordinates of the first touch, and the end touch point is the coordinate point when the finger is removed).
  • the starting touch point can be used as the starting point, denoted as (x0, y0), and the end touch point can be denoted as (x1, y1), and the liquefaction area can be determined according to the two coordinate points, Among them, the values of (x0, y0) and (x1, y1) are related to the origin.
  • the starting touch point can be used as the origin to take the values of (x0, y0) and (x1, y1), or wait Any vertex of the processed image is used as the origin to pair (x0, y0) and (x1, y1), which is selected according to actual application needs.
  • the minimum abscissa value, the minimum ordinate value of the start ordinate value and the minimum ordinate value of the end ordinate value in the The coordinate value, the minimum ordinate value of the start ordinate value and the end ordinate value are taken as the abscissa value of the second vertex of the liquefaction area, respectively, and the minimum abscissa value of the start abscissa value and the end abscissa value, the start The maximum ordinate value in the ordinate value and the end ordinate value is taken as the abscissa value of the third vertex of the liquefaction area, respectively, and the maximum abscissa value, the start ordinate value and the end abscissa value are obtained.
  • the maximum ordinate value in the end ordinate values is respectively used as the abscissa and ordinate values of the fourth vertex of the liquefaction area, and is obtained according to the abscissa and ordinate values of the first vertex, the second vertex, the third vertex and the fourth vertex of the liquefaction area.
  • Liquefaction area The liquefaction area is quickly obtained by the position information of the start touch point and the end touch point, which improves the processing efficiency.
  • the solution is based on the abscissa and ordinate values of multiple start touch points, the abscissa and ordinate values of multiple end touch points, and the abscissa values of the four vertices in the historical liquefaction area. , obtain multiple function parameters, and finally establish an objective function, which realizes that the abscissa and ordinate values of the start touch point and the abscissa value of the end touch point are input into the objective function to obtain the abscissa and ordinate values of the four vertices. The abscissa and ordinate values of each vertex are calculated to obtain the liquefaction area.
  • step S103 the offset of each grid point is determined according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, the adjustment radius is used for Controls how much each grid point is offset.
  • a circle is drawn with the starting touch point as the center, and the radius of the circle can be N pixels long, where N is a positive integer.
  • the grid points whose distance between the starting touch points is greater than the adjustment radius do not move, and only the grid points whose distance between the starting touch point and the starting touch point is less than or equal to the adjustment radius are moved, which further improves the liquefaction processing efficiency. That is to say, the present disclosure preferably adjusts the grid points in the circle corresponding to the radius for adjustment, and the adjustment radius is used to control the offset degree of each grid point, wherein the larger the adjustment radius, the more grid points the circle includes , that is, the more grid points that need to be adjusted, the smaller the offset of each grid point.
  • the adjustment radius can be set according to actual application requirements.
  • the start touch point and the end touch point are different positions in the image to be processed. Therefore, the position change from the start touch point to the end touch point can be seen. It can be understood that this The position change has not only distance but also direction, therefore, the offset of each grid point can be determined based on the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius quantity.
  • the offset strength of each grid point is calculated according to the coordinate information of the starting touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, each grid point
  • the offset strength of the point is used to represent the adjustment range of each grid point;
  • the offset vector is calculated according to the coordinate information of the start touch point and the coordinate information of the end touch point;
  • the direction of the offset vector is the start touch point Points in the direction of the ending touch point; calculates the offset for each grid point in the liquefaction region based on the offset vector and offset strength. Therefore, the offset vector can be quickly obtained by the position information of the start touch point and the end touch point, which further improves the accuracy and efficiency of image processing.
  • the offset coordinates are calculated according to the coordinate information of the start touch point and the coordinate information of the end touch point, the modulo length of the offset coordinates is obtained, and the offset vector is determined according to the ratio of the offset coordinates and the modulo length; wherein, the offset vector The direction of the start touch point points to the direction of the end touch point.
  • step S104 each grid point is moved according to the offset of each grid point to obtain an intermediate processed image.
  • step S105 corresponding texture information is added to the intermediate processing image to generate a target image.
  • each grid point in the liquefaction area is moved by a certain distance in a certain direction to obtain an intermediate processed image, and finally, the corresponding texture information is added to the intermediate processed image to obtain the target image, that is, the beauty model has been performed. , body beauty and other image processed images.
  • each grid point in the entire liquefaction area is directly moved.
  • the offset strength of each grid point calculate the offset of each grid point in the liquefaction area according to the offset vector and the offset strength, control each grid point to move according to the corresponding offset, and obtain the intermediate processing image.
  • the distance between the starting touch point and each grid point in the liquefaction area is greater than the target grid point corresponding to the adjusted radius, and when controlling each grid point to move according to the corresponding offset During the process, the position of the target grid point remains unchanged, and other grid points move according to the corresponding offset to obtain an intermediate processed image, which further improves the adjustment efficiency.
  • the image processing method of the embodiment of the present disclosure obtains the start touch point and the end touch point for the image to be processed; wherein the image to be processed includes multiple grids and grid points corresponding to the multiple grids ; Determine the liquefaction area according to the position information of the start touch point and end touch point; Determine each mesh according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area and the adjustment radius The offset of the grid point; among them, the adjustment radius is used to control the offset degree of each grid point; control each grid point to move according to the corresponding offset to generate the intermediate processing image; add to the intermediate processing image Corresponding texture information to generate the target image.
  • the user can perform image processing such as body beautification and beauty on the adjusted position of the human body or face by simply operating the position that needs to be adjusted in the image, so as to improve the beauty and body effect and the operation is simple and fast.
  • FIG. 2 is a flowchart of another image processing method according to an exemplary embodiment, as shown in FIG. 2 , including:
  • step 201 an image to be processed is acquired, and the image to be processed is divided into images to be processed including a plurality of grid points according to a preset step size; wherein the preset step size is related to the number of pixels of the image to be processed.
  • images such as pictures or videos manually uploaded by users, or downloaded pictures, or pictures or videos stored locally.
  • the to-be-processed image is divided into multiple grids and the to-be-processed images of the grid points corresponding to the multiple grids in advance according to a preset step size, wherein the preset step size and the to-be-processed image are It can be understood that the preset step size is generally related to the pixel size of the image to be processed, and generally takes about 10 pixels. Intensive, the effects of beauty and body are more natural.
  • obtaining the actual size of the image to be processed (for example, w pixels wide and h pixels high) will directly divide h/ n units, vertically divide w/n units, and calculate a grid of size (w/n)*(h/n), as shown in Figure 3a, the image to be processed is divided according to the preset step size. After segmentation, as shown in Figure 3b, a to-be-processed image of multiple grid points is generated.
  • step 202 the touch point when the user starts to touch the image to be processed and the touch point when the user moves away from the image to be processed are acquired, and the position information of the start touch point and the end touch point are acquired to determine four liquefaction regions.
  • the abscissa and ordinate values of the vertices are calculated according to the abscissa and ordinate values of the four vertices of the liquefaction area to obtain the liquefaction area.
  • the user performs image processing through a sliding operation, and the sliding operation can be performed by a finger or a stylus, as shown in FIG.
  • the point is the touch point when the user starts to touch the image to be processed, and the touch point is the start point, and the point B in FIG. 4 is the touch point when the user moves the image to be processed, and the touch point ends.
  • any position in Figure 4 can be point A or point B, and further realize image processing by sliding to improve image processing.
  • the flexibility of operation meets the needs of users.
  • the coordinate point where the adjustment starts can be used as the starting point
  • the position where the adjustment ends that is, the ending touch point
  • the coordinate points (x1, y1) of the touch point are used to determine the square area that needs to be liquefied, and the liquefaction area is quickly obtained by the position information of the start touch point and the end touch point, which improves the processing efficiency.
  • the coordinate point of a vertex in the liquefaction area is the upper left vertex
  • the x coordinate is min(x0, x1)
  • the y coordinate of the upper left vertex is min(y0, y1)
  • the coordinate point of a vertex is the upper right vertex
  • the x coordinate is max((x0, x1), the y-coordinate of the upper-right vertex is min(y0, y1)
  • the coordinate point of a vertex is the x-coordinate of the lower-left vertex is min(x0, x1), and the y-coordinate of the lower-left vertex is max(y0, y1)
  • the coordinate point of a vertex is the x coordinate of the lower right vertex is max(x0, x1)
  • the y coordinate of the lower right vertex is max(y0, y1).
  • the value of the coordinate point is related to the fixed coordinate system , for example, the upper left vertex coordinate is (0, 0).
  • the liquefaction area is obtained by calculating the abscissa and ordinate values of the four vertices of the upper left vertex, the lower left vertex, the upper right vertex and the lower right vertex of the liquefaction area, such as the start touch point A and the end touch point B shown in FIG.
  • the resulting liquefaction region X is obtained by calculating the abscissa and ordinate values of the four vertices of the upper left vertex, the lower left vertex, the upper right vertex and the lower right vertex of the liquefaction area, such as the start touch point A and the end touch point B shown in FIG.
  • an offset vector is calculated according to the coordinate information of the start touch point and the coordinate information of the end touch point; wherein, the direction of the offset vector is the direction in which the start touch point points to the end touch point.
  • the position change from the start touch point to the end touch point can be seen. It can be understood that this position change not only has a distance but also a direction.
  • the position change of the touch point and the end touch point generates the offset vector of the liquefaction area.
  • the offset coordinates are calculated by calculating the coordinate information of the start touch point and the coordinate information of the end touch point by a preset formula or algorithm, and the modulo length of the offset coordinates is obtained, and the offset is determined according to the ratio of the offset coordinates and the modulo length.
  • the direction of the offset vector is the direction from the start touch point to the end touch point. Therefore, the offset vector can be quickly obtained through the position information of the start touch point and the end touch point, which further improves the accuracy of image processing. performance and efficiency.
  • the offset strength of each grid point is calculated according to the coordinate information of the starting touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, the offset strength of each grid point is The size of the adjustment used to characterize each grid point.
  • step 205 the offset of each grid point in the liquefaction region is calculated according to the offset vector and the offset strength, and each grid point is controlled to move according to the corresponding offset, so as to obtain an intermediate processed image.
  • the processed image adds corresponding texture information to generate the target image.
  • the offset strength of each grid point is calculated according to the coordinate information of the starting touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius, and also That is to say, traverse each calculated grid point in the liquefaction area.
  • the point being traversed is recorded as point(px, py), and the distance from the point to the starting touch point is calculated.
  • the offset strength of each grid point so as to calculate the offset of each grid point in the liquefaction area according to the offset vector and the offset strength, and control each grid point to move according to the corresponding offset, and obtain Intermediate processed images.
  • the adjustment radius is preset, which is generally set according to requirements.
  • the corresponding texture information is added to the intermediate processed image to generate the target image, that is, the image after image processing such as beauty and body beauty, where the texture information describes the surface properties of the scene corresponding to the image.
  • the obtained target image is shown in FIG. 6b.
  • the image processing method acquires an image to be processed, and divides the image to be processed into an image to be processed including a plurality of grids and a plurality of grid points corresponding to the plurality of grids according to a preset step size;
  • the preset step size is related to the number of pixels of the image to be processed, and the touch point when the user starts to touch the image to be processed and the touch point when the user moves away from the image to be processed are obtained, and the start touch point and the end touch point are obtained.
  • the position information of the handle points determines the abscissa and ordinate values of the four vertices of the liquefaction area, and calculates the liquefaction area according to the abscissa and ordinate values of the four vertices of the liquefaction area.
  • the coordinate information of the start touch point and the coordinates of the end touch point Calculate the offset vector according to the information; wherein, the direction of the offset vector is the direction from the start touch point to the end touch point; calculate according to the coordinate information of the start touch point, the coordinate information of each grid point in the liquefaction area and the adjustment radius The offset strength of each grid point; wherein, the offset strength of each grid point is used to characterize the adjustment amplitude of each grid point, and each grid in the liquefaction region is calculated according to the offset vector and offset strength
  • the offset of the grid point control each grid point to move according to the corresponding offset, obtain the intermediate processing image, and add the corresponding texture information to the intermediate processing image to generate the target image.
  • the range of grid movement is calculated by starting the touch point, ending the touch point, and adjusting the radius, and then the adjusted grid point is calculated. Finally, the corresponding texture information is added to the intermediate processing image to obtain the target image, so as to realize the user's choice.
  • the areas that need to be adjusted, and the areas that you don't want to be adjusted remain unchanged, so that you can more freely perform image processing such as beauty and body beauty without relying on key points, improve image processing effects such as beauty and body beauty, and the operation is simple and fast.
  • Fig. 7 is a flow chart of still another image processing method according to an exemplary embodiment, as shown in Fig. 7 , including:
  • step 301 an image to be processed is acquired, and the image to be processed is divided into images to be processed including a plurality of grid points according to a preset step size; wherein the preset step size is related to the number of pixels of the image to be processed.
  • images such as pictures or videos manually uploaded by the user, or downloaded pictures, or locally stored pictures or videos.
  • the image to be processed is divided into images to be processed including a plurality of grids in advance according to a preset step size, wherein the preset step size is related to the number of pixels.
  • the preset step size is The step size is generally related to the size of the image to be processed. Generally, it is about 10 pixels. The smaller the preset step size is, the denser the grid is, and the effects of beauty and body are more natural.
  • obtaining the actual size of the image to be processed (for example, w pixels wide and h pixels high) will directly divide h/ n units, vertically divide w/n units, and calculate a grid of size (w/n)*(h/n), as shown in Figure 3a, the image to be processed is divided according to the preset step size. After segmentation, as shown in Figure 3b, multiple grid images are generated to be processed.
  • step 302 the touch points when the user clicks the to-be-processed image for the first time and the touch points when the user clicks the to-be-processed image for the second time are acquired.
  • the user performs image processing through a click operation, and the click operation can be performed by a finger or a stylus, as shown in FIG.
  • the point is the touch point when the user clicks the image to be processed for the first time, and the touch point starts
  • the point D in FIG. 8 is the touch point when the user clicks the image to be processed for the second time, and the touch point ends.
  • any position in Figure 4 can be point A or point B, and further realize image processing by clicking to improve image processing.
  • the flexibility of operation meets the needs of users.
  • step 303 the position information of the start touch point and the end touch point is obtained to determine the abscissa and ordinate values of the four vertices of the liquefaction area, and the liquefaction area is calculated according to the abscissa and ordinate values of the four vertices of the liquefaction area.
  • the coordinate point where the adjustment starts can be used as the starting point
  • the position where the adjustment ends that is, the ending touch point
  • the coordinate points (x1, y1) of the touch point are used to determine the square area that needs to be liquefied, and the liquefaction area is quickly obtained by the position information of the start touch point and the end touch point, which improves the processing efficiency.
  • the coordinate point of a vertex in the liquefaction area is the upper left vertex
  • the x coordinate is min(x0, x1)
  • the y coordinate of the upper left vertex is min(y0, y1)
  • the coordinate point of a vertex is the upper right vertex
  • the x coordinate is max((x0, x1), the y-coordinate of the upper-right vertex is min(y0, y1)
  • the coordinate point of a vertex is the x-coordinate of the lower-left vertex is min(x0, x1), and the y-coordinate of the lower-left vertex is max(y0, y1)
  • the coordinate point of a vertex is the x coordinate of the lower right vertex is max(x0, x1)
  • the y coordinate of the lower right vertex is max(y0, y1).
  • the value of the coordinate point is related to the fixed coordinate system , for example, the upper left vertex coordinate is (0, 0).
  • the liquefaction region is obtained by calculation according to the abscissa and vertical coordinate values of the four vertices of the liquefaction region, such as the liquefaction region X obtained from the start touch point A and the end touch point B shown in FIG. 5 .
  • step 304 the offset coordinates are calculated according to the coordinate information of the start touch point and the coordinate information of the end touch point, the modulo length of the offset coordinates is obtained, and the offset vector is determined according to the ratio of the offset coordinates and the modulo length; wherein, The direction of the offset vector is the direction from the start touch point to the end touch point.
  • the position change from the start touch point to the end touch point can be seen. It can be understood that this position change not only has a distance but also a direction.
  • the position information of the touch point and the end touch point determines the offset vector.
  • the offset coordinates are calculated by calculating the coordinate information of the start touch point and the coordinate information of the end touch point by a preset formula or algorithm, and the modulo length of the offset coordinates is obtained, and the offset is determined according to the ratio of the offset coordinates and the modulo length. vector; wherein, the direction of the offset vector is the direction from the start touch point to the end touch point. Therefore, the offset vector is determined by the position information of the start touch point and the end touch point, which further improves the accuracy of image processing. and efficiency.
  • step 305 the distance between the starting touch point and each grid point in the liquefaction area is greater than the target grid corresponding to the adjusted radius, and the distance between the starting touch point and each grid point in the liquefaction area is calculated , calculate the ratio of the distance between the starting touch point and each grid point in the liquefaction area to the adjustment radius, and get the offset strength of each grid point.
  • step 306 the offset of each grid point in the liquefaction area is obtained according to the product of the offset vector and the offset intensity, and each grid point is controlled to move according to the corresponding offset.
  • the position of the target grid remains unchanged, and an intermediate processing image is obtained.
  • the distance between the start touch point and each grid point in the liquefaction area is calculated, and the distance between the start touch point and each grid point in the liquefaction area is calculated.
  • the ratio of the distance to the adjustment radius to get the offset strength of each grid point that is to say, the calculated grid points in the liquefaction area are traversed.
  • the grid points being traversed are recorded as point(px, py), Calculate the distance from the point to the starting touch point, and obtain the offset strength of each grid point according to the ratio of the calculated distance to the adjusted radius, so as to quickly calculate each of the liquefaction areas according to the product of the offset vector and the offset strength.
  • Offset of grid points, so as to quickly and accurately obtain the offset of each grid point control each grid point to move according to the corresponding offset, obtain intermediate processing images, and further improve the efficiency of image processing.
  • step 307 corresponding texture information is added to the intermediate processed image to generate a target image.
  • the corresponding texture information is added to the intermediate processed image to generate the target image, that is, the image after image processing such as beauty and body beauty, where the texture information describes the surface properties of the scene corresponding to the image.
  • the moving range of each grid point in the liquefaction area is calculated through the start point and end point of the user operation and the adjustment radius, and the adjusted grid point is calculated, and finally the texture corresponding to the adjusted grid point is calculated.
  • the information adds corresponding texture information to the adjusted grid points to obtain the target image, so that the user can select a part of the area that needs to be adjusted, and the area that does not want to be adjusted remains unchanged, and does not depend on the key points, so that the image such as beauty and body beauty can be more freely performed. Treatment, improve beauty, body effect and simple and fast operation.
  • Fig. 9 is a block diagram of an image processing apparatus according to an exemplary embodiment.
  • the apparatus includes a first obtaining unit 121 , a determining unit 122 , a generating unit 123 , a control unit 124 and a processing unit 125 .
  • the first acquiring unit 121 is configured to acquire a start touch point and an end touch point for the image to be processed; wherein the image to be processed includes multiple grids and grid points corresponding to the multiple grids. .
  • the user can send the operation instruction through one or more methods, such as a finger, a stylus, and a mouse, and the selection is specifically made according to the user's operation habit.
  • one or more methods such as a finger, a stylus, and a mouse
  • the image to be processed refers to dividing the image into images to be processed including a plurality of grids according to a preset step size after acquiring the image, wherein the preset step size is related to the number of pixels.
  • the image may be a picture, each frame of picture in the video, etc., wherein, the video needs to be processed in advance to obtain each frame of picture.
  • the start touch point is any position point in the image to be processed
  • the end touch point is a position point different from any position point in the to-be-processed image and corresponding to the start touch point.
  • the first acquiring unit 121 is specifically configured to acquire the touch point when the user starts to touch the image to be processed and the touch point when the user moves away from the image to be processed.
  • the first obtaining unit 121 is specifically configured to obtain the touch points when the user clicks the to-be-processed image for the first time and the touch points when the user clicks the to-be-processed image for the second time.
  • the determining unit 122 is configured to determine the liquefaction area according to the position information of the start touch point and the end touch point.
  • the liquefaction region refers to a region that needs to be liquefied (push, pull, expand, etc.).
  • the liquefaction area may be determined based on the position information of the start touch point and the position information of the end touch point, wherein it can be understood that the Take the start touch point as the starting point, denoted as (x0, y0), and the end touch point as the end point, denoted as (x1, y1), and determine the liquefaction area according to the two coordinate points, where (x0, y0 ) and (x1, y1) are related to the origin. For example, you can take the starting touch point as the origin to take the values of (x0, y0) and (x1, y1), or you can take any vertex of the image to be processed. As the origin to pair (x0, y0) and (x1, y1), the selection is made according to actual application needs.
  • the determining unit 122 is specifically configured to obtain the start abscissa value and the start ordinate value of the start touch point, and obtain the end abscissa value and the end ordinate value of the end touch point;
  • the minimum abscissa value in the abscissa value and the end abscissa value, and the minimum ordinate value in the start ordinate value and the end ordinate value are respectively used as the abscissa value of the first vertex of the liquefaction area; obtain the start abscissa value and the end ordinate value.
  • the maximum abscissa value of the abscissa value, the minimum ordinate value of the start ordinate value and the end ordinate value are respectively used as the abscissa value of the second vertex of the liquefaction area; obtain the start abscissa value and the end abscissa value.
  • the minimum abscissa value, the maximum ordinate value of the start ordinate value and the end ordinate value of the value, the maximum ordinate value of the start ordinate value and the end ordinate value are respectively used as the abscissa and ordinate values of the fourth vertex of the liquefaction region; according to the abscissa and ordinate values of the first vertex, the second vertex, the third vertex and the fourth vertex value to get the liquefaction area.
  • the determining unit 122 is specifically configured to be based on the abscissa and ordinate values of the multiple start touch points, the abscissa values of the multiple end touch points, and the four vertices in the historical liquefaction area
  • the abscissa and ordinate values of the first touch point and the abscissa and ordinate values of the end touch point are input into the objective function to obtain the four vertices.
  • the abscissa and ordinate values so that the liquefaction area is calculated according to the abscissa and ordinate values of the four vertices.
  • the generating unit 123 is configured to determine the offset of each grid point according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, The adjustment radius is used to control how much each grid point is offset.
  • the start touch point and the end touch point are different positions in the image to be processed. Therefore, the position change from the start touch point to the end touch point can be seen. It can be understood that this A position change has not only a distance but also a direction, so the offset vector of the liquefaction region can be generated based on the position change of the start touch point and the end touch point.
  • the generating unit 123 is specifically configured to calculate the offset of each grid point according to the coordinate information of the starting touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius Intensity; among them, the offset intensity of each grid point is used to represent the adjustment range of each grid point, calculate the distance between the start touch point and the end touch point, according to the coordinate information of the start touch point and The offset coordinates are calculated from the coordinate information of the end touch point, and the offset vector is determined according to the ratio of the offset coordinates and the distance between the start touch point and the end touch point; wherein, the direction of the offset vector is the direction of the start touch point.
  • the direction of the end touch point, the offset of each grid point in the liquefaction area is calculated based on the offset vector and the offset strength.
  • the control unit 124 is configured to move each grid point according to the offset of each grid point to obtain an intermediate processed image.
  • the processing unit 125 is configured to add corresponding texture information to the intermediate processed image to generate a target image.
  • each grid point in the liquefaction area is moved a certain distance in a certain direction to obtain an intermediate processed image, and finally, corresponding texture information is added to the intermediate processed image to generate a target image.
  • the generating unit 123 includes: The first calculation subunit 1231 is configured to calculate the offset strength of each grid point according to the coordinate information of the starting touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, The offset strength of each grid point is used to represent the adjustment amplitude of each grid point; the second calculation subunit 1232 is configured to be based on the coordinate information of the start touch point and the coordinate information of the end touch point Calculate the offset vector; wherein, the direction of the offset vector is the direction from the start touch point to the end touch point; the third calculation subunit 1233 is configured to calculate the liquefaction area according to the offset vector and the offset strength. Offset for each grid point.
  • the first calculation subunit 1231 is specifically configured to: calculate the distance between the starting touch point and each grid point in the liquefaction area; calculate the ratio of each distance to the adjustment radius, and set the Ratio as the offset strength for each grid point.
  • the third calculation subunit 1233 is specifically configured to: calculate the product of the offset vector and the offset strength of each grid point, and use the product as the offset of each grid point quantity.
  • the image processing apparatus further includes: a second acquiring unit 126 and a dividing unit 127 .
  • the second acquiring unit 126 is configured to acquire the image to be processed.
  • the dividing unit 127 is configured to divide the image to be processed into images to be processed including a plurality of grid points according to a preset step size, wherein the preset step size is related to the number of pixels of the image to be processed.
  • the image processing apparatus further includes: a third acquiring unit 128 and a maintaining unit 129 .
  • the third acquiring unit 128 is configured to acquire the target grid point whose distance is greater than the adjustment radius.
  • the maintaining unit 129 is configured to keep the position of the target grid point unchanged during the process of controlling each grid point to move according to the corresponding offset.
  • FIG. 13 is a block diagram of an electronic device proposed according to the present disclosure.
  • the above-mentioned electronic device 200 includes:
  • the memory 210 and the processor 220 are connected to a bus 230 of different components (including the memory 210 and the processor 220).
  • the memory 210 stores a computer program.
  • the processor 220 executes the program, the image processing method of the embodiment of the present disclosure is implemented.
  • Bus 230 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures.
  • these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect ( PCI) bus.
  • Electronic device 200 typically includes a variety of electronic device-readable media. These media can be any available media that can be accessed by electronic device 200, including volatile and non-volatile media, removable and non-removable media.
  • Memory 210 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 240 and/or cache memory 250 .
  • Electronic device 200 may further include other removable/non-removable, volatile/non-volatile computer system storage media.
  • storage system 260 may be used to read and write to non-removable, non-volatile magnetic media (not shown in FIG. 21, commonly referred to as a "hard drive”).
  • a magnetic disk drive for reading and writing to removable non-volatile magnetic disks (eg "floppy disks") and removable non-volatile optical disks (eg CD-ROM, DVD-ROM) may be provided or other optical media) to read and write optical drives.
  • each drive may be connected to bus 230 through one or more data media interfaces.
  • the memory 210 may include at least one program product having a set (eg, at least one) of program modules configured to perform the functions of various embodiments of the present disclosure.
  • Program modules 270 generally perform the functions and/or methods in the embodiments described in this disclosure.
  • the electronic device 200 may also communicate with one or more external devices 290 (eg, keyboard, pointing device, display 291, etc.), with one or more devices that enable a user to interact with the electronic device 200, and/or with Any device (eg, network card, modem, etc.) that enables the electronic device 200 to communicate with one or more other computing devices. Such communication may take place through input/output (I/O) interface 292 . Also, the electronic device 200 may communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN), and/or a public network such as the Internet) through a network adapter 293 . As shown in FIG. 13 , the network adapter 293 communicates with other modules of the electronic device 200 through the bus 230 . It should be understood that, although not shown, other hardware and/or software modules may be used in conjunction with electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives and data backup storage systems.
  • the processor 220 executes various functional applications and data processing by executing programs stored in the memory 210 .
  • the present disclosure also proposes a storage medium.
  • the electronic device when the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the aforementioned image processing method.
  • the present disclosure also provides a computer program product, which, when executed by a processor of an electronic device, enables the electronic device to execute the image processing method as described above.

Abstract

The present disclosure relates to the technical field of image processing. Disclosed are an image processing method and device. The image processing method comprises: acquiring a start touch point and an end touch point for an image to be processed; determining a liquefaction area according to the position information of the start touch point and the end touch point; determining an offset amount of each grid point according to the coordinate information of the start touch point and the end touch point, and the coordinate information and adjustment radius of each grid point in the liquefaction area, the adjustment radius being used for controlling the degree of offset of each grid point; moving each grid point according to the offset amount of each grid point, to obtain an intermediate processed image; and adding corresponding texture information to the intermediate processed image, to generate a target image. Thus, by performing simple operations on a position, such as the human body or the face, that needs to be adjusted in an image, a user can perform body shape beautifying and appearance beautifying on the adjusted position, such as the human body or the face, so that the body shape beautifying and appearance beautifying effects are improved, and the operations are simple and quick.

Description

图像处理方法和装置Image processing method and device
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本公开基于申请号为202011009834.0、申请日为2020年09月23日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本申请作为参考。The present disclosure is based on a Chinese patent application with application number 202011009834.0 and an application date of September 23, 2020, and claims the priority of the Chinese patent application, the entire contents of which are incorporated herein by reference.
技术领域technical field
本公开涉及图像处理技术领域,尤其涉及一种图像处理方法和装置。The present disclosure relates to the technical field of image processing, and in particular, to an image processing method and apparatus.
背景技术Background technique
随着图像处理技术和终端设备的不断发展,对于图片中的人体或脸等进行美体、美型的操作越来越普遍。With the continuous development of image processing technology and terminal equipment, it is more and more common to perform body and shape operations on the human body or face in the picture.
相关技术中,基于人体或人脸等关键点进行美体、美型,比如基于待处理图像的人脸关键点比如眼睛、鼻子等、美型后的人脸关键点比如眼睛、鼻子等对待处理图像进行变形,生成美型图像,由于关键点仅仅是整个身体的几个点,只能调整比较局限的身体部位,不能够完全对身体各部位进行美型、美体,调整策略比较单一,最终显示的图像处理效果也比较差。In the related art, body beauty and beauty are performed based on key points such as the human body or the face, for example, the key points of the face based on the image to be processed, such as eyes, nose, etc., and the key points of the face after beauty, such as the eyes, nose, etc., the image to be processed Deformation is performed to generate a beautiful image. Since the key points are only a few points of the whole body, only a relatively limited body part can be adjusted. The image processing effect is also relatively poor.
发明内容SUMMARY OF THE INVENTION
本公开提供一种图像处理方法和装置,以至少解决相关技术中不能够完全根据用户需求对整个图像的任一位置比如人体或者脸等调整位置进行自由美型、美体等图像处理,导致调整方式单一以及美型、美体的效果比较差的问题。本公开的技术方案如下:The present disclosure provides an image processing method and device to at least solve the problem that in the related art, it is not possible to perform image processing such as free shaping and body shaping for any position of the entire image, such as the human body or face, etc. Single and the effect of beauty and body is relatively poor. The technical solutions of the present disclosure are as follows:
根据本公开的一些实施例,提供了一种图像处理方法,包括:According to some embodiments of the present disclosure, there is provided an image processing method, comprising:
获取针对待处理图像的开始触控点和结束触控点;其中,所述待处理图像包括多个网格和所述多个网格对应的网格点;acquiring a start touch point and an end touch point for the image to be processed; wherein the image to be processed includes multiple grids and grid points corresponding to the multiple grids;
根据所述开始触控点和所述结束触控点的位置信息确定液化区域;Determine the liquefaction area according to the position information of the start touch point and the end touch point;
根据所述开始触控点和所述结束触控点的坐标信息、所述液化区域中每个网格点的坐标信息和调整半径确定所述每个网格点的偏移量;其中,所述调整半径用于控制所述每个网格点的偏移程度;The offset of each grid point is determined according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, the The adjustment radius is used to control the offset degree of each grid point;
根据所述每个网格点的偏移量移动所述每个网格点,得到中间处理图像;以及Moving each grid point according to the offset of each grid point to obtain an intermediate processed image; and
对所述中间处理图像添加对应纹理信息,以生成目标图像。Corresponding texture information is added to the intermediate processed image to generate a target image.
根据本公开的一些实施例,提供一种图像处理装置,包括:According to some embodiments of the present disclosure, there is provided an image processing apparatus, comprising:
第一获取单元,被配置为获取针对待处理图像的开始触控点和结束触控点;其中,所述待处理图像包括多个网格和所述多个网格对应的网格点;a first acquiring unit, configured to acquire a start touch point and an end touch point for the image to be processed; wherein the image to be processed includes a plurality of grids and grid points corresponding to the plurality of grids;
确定单元,被配置为根据所述开始触控点和所述结束触控点的位置信息确定液化区域;a determining unit, configured to determine the liquefaction area according to the position information of the start touch point and the end touch point;
生成单元,被配置为根据所述开始触控点和所述结束触控点的坐标信息、所述液化区域中每个网格点的坐标信息和调整半径确定所述每个网格点的偏移量;其中,所述调整半径用于控制所述每个网格点的偏移程度;The generating unit is configured to determine the offset of each grid point according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; Shift amount; wherein, the adjustment radius is used to control the offset degree of each grid point;
控制单元,被配置为根据所述每个网格点的偏移量移动所述每个网格点,得到中间处理图像;以及a control unit configured to move each grid point according to the offset of each grid point to obtain an intermediate processed image; and
处理单元,被配置为对所述中间处理图像添加对应纹理信息,以生成目标图像。A processing unit configured to add corresponding texture information to the intermediate processed image to generate a target image.
根据本公开的一些实施例,提供了一种电子设备,包括:According to some embodiments of the present disclosure, there is provided an electronic device comprising:
处理器;processor;
用于存储所述处理器可执行指令的存储器;a memory for storing the processor-executable instructions;
其中,所述处理器被配置为所述指令,以实现上述实施例所述的图像处理方法。Wherein, the processor is configured as the instruction to implement the image processing method described in the above embodiment.
根据本公开的一些实施例,提供了一种存储介质,当所述存储介质中的指令由服务器的处理器执行时,使得服务器能够执行上述实施例所述的图像处理方法。According to some embodiments of the present disclosure, a storage medium is provided, when the instructions in the storage medium are executed by the processor of the server, the server can execute the image processing method described in the above embodiments.
根据本公开的一些实施例,提供了一种计算机程序产品,当所述计算机程序产品中的指令由处理器执行时,使得所述电子设备能够执行上述实施例所述的图像处理方法。According to some embodiments of the present disclosure, a computer program product is provided, when instructions in the computer program product are executed by a processor, the electronic device can execute the image processing method described in the above embodiments.
本公开的实施例提供的技术方案至少带来以下有益效果:The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:
获取针对待处理图像的开始触控点和结束触控点;其中,待处理图像包括多个网格和所述多个网格对应的网格点,根据开始触控点和结束触控点的位置信息确定液化区域;根据开始触控点和结束触控点的坐标信息、液化区域中每个网格点的坐标信息和调整半径确定每个网格点的偏移量;其中,调整半径用于控制每个网格点的偏移程度;根据每个网格点的偏移量移动每个网格点,得到中间处理图像;对中间处理图像添加对应纹理信息,以生成目标图像。由此,通过用户对图像中人体或者脸等需要调整的位置进行简单操作就可以对人体或者脸等调整位置进行美体、美型等图像处理,提高美型、美体效果和操作简单快速。Obtain the start touch point and end touch point for the image to be processed; wherein the image to be processed includes multiple grids and grid points corresponding to the multiple grids, and according to the difference between the start touch point and the end touch point The location information determines the liquefaction area; the offset of each grid point is determined according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; It is used to control the offset degree of each grid point; move each grid point according to the offset of each grid point to obtain an intermediate processed image; add corresponding texture information to the intermediate processed image to generate the target image. In this way, the user can perform image processing such as body beautification and beauty on the adjusted position of the human body or face by simply operating the position that needs to be adjusted in the image, so as to improve the beauty and body effect and the operation is simple and fast.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理,并不构成对本公开的不当限定。The accompanying drawings, which are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure and do not unduly limit the present disclosure.
图1是根据一示例性实施例示出的一种图像处理方法的流程图;1 is a flowchart of an image processing method according to an exemplary embodiment;
图2是根据一示例性实施例示出的另一种图像处理方法的流程图;FIG. 2 is a flowchart of another image processing method according to an exemplary embodiment;
图3a-3b是根据一示例性实施例示出的包括多个网格点的待处理图像确定的场景图;3a-3b are scene graphs determined by an image to be processed including a plurality of grid points according to an exemplary embodiment;
图4是根据一示例性实施例示出的滑动操作的场景图;4 is a scene diagram of a sliding operation according to an exemplary embodiment;
图5是根据一示例性实施例示出的液化区域确定的场景图;FIG. 5 is a scene diagram illustrating a liquefaction region determination according to an exemplary embodiment;
图6是根据一示例性实施例示出的图像处理效果的示例图;FIG. 6 is an example diagram illustrating an image processing effect according to an exemplary embodiment;
图7是根据一示例性实施例示出的又一种图像处理方法的流程图;FIG. 7 is a flowchart of yet another image processing method according to an exemplary embodiment;
图8是根据一示例性实施例示出的点击操作的场景图;FIG. 8 is a scene diagram illustrating a click operation according to an exemplary embodiment;
图9是根据一示例性实施例示出的一种图像处理装置框图;FIG. 9 is a block diagram of an image processing apparatus according to an exemplary embodiment;
图10是根据一示例性实施例示出的另一种图像处理装置框图;10 is a block diagram of another image processing apparatus according to an exemplary embodiment;
图11是根据一示例性实施例示出的又一种图像处理装置框图;11 is a block diagram of yet another image processing apparatus according to an exemplary embodiment;
图12是根据一示例性实施例示出的再一种图像处理装置框图;FIG. 12 is a block diagram of still another image processing apparatus according to an exemplary embodiment;
图13是根据第一示例性实施例示出的一种电子设备的结构示意图。Fig. 13 is a schematic structural diagram of an electronic device according to the first exemplary embodiment.
具体实施方式detailed description
为了使本领域普通人员更好地理解本公开的技术方案,下面将结合附图,对本公开实施例中的技术方案进行清楚、完整地描述。In order to make those skilled in the art better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。本公开的所有实施例均可以单独被执行,也可以与其他实施例相结合共同被执行,本公开对此不做限制。It should be noted that the terms "first", "second" and the like in the description and claims of the present disclosure and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific sequence or sequence. It is to be understood that the data so used may be interchanged under appropriate circumstances such that the embodiments of the disclosure described herein can be practiced in sequences other than those illustrated or described herein. The implementations described in the illustrative examples below are not intended to represent all implementations consistent with this disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as recited in the appended claims. All the embodiments of the present disclosure may be implemented independently or in combination with other embodiments, which are not limited in the present disclosure.
具体地,液化可用于推、拉和膨胀图像的任意区域即美体、美型等,针对现有技术中基于关键点进行美型、美体的方式不能适用于没有关键点的美型、美体等场景,以及不能够完全根据用户需求对整个图像的任一位置比如人体或者脸等调整位置进行自由美型、美体等图像处理,导致调整方式单一以及美型、美体等效果比较差的问题。Specifically, liquefaction can be used to push, pull, and expand any area of the image, that is, body contouring, body contouring, etc. The prior art methods for contouring and body contouring based on key points cannot be applied to scenes such as contouring and body contouring without key points. , and can not completely adjust the position of the entire image, such as the human body or face, to perform image processing such as free beauty and body beauty according to user needs, resulting in a single adjustment method and poor beauty and body effects.
本申请提出的图像处理方法,可以对图像中的任一位置进行调整,主要是针对图像中 人体或者脸等需要调整的位置,通过自由地滑动人体或人脸需要调整的位置进行自主美体、美型,以及美型、美体程度和美型、美体的位置完全是由用户自由把控,解决了现有的基于关键点进行美型不能更加自主地进行调整的局限性,也适用于没有关键点的美型场景,以及不能够完全根据用户需求对整个图像的任一位置比如人体或者脸等调整位置进行自由美型、美体等,导致调整方式单一以及美型、美体等效果比较差的问题。The image processing method proposed in this application can adjust any position in the image, mainly for the position that needs to be adjusted such as the human body or the face in the image, by freely sliding the position of the human body or the face that needs to be adjusted to perform autonomous body beauty and beauty. The shape, beauty shape, degree of beauty and the position of beauty shape and body are completely controlled by the user, which solves the limitation of the existing beauty shape based on key points that cannot be adjusted more autonomously. The beauty scene, and the inability to adjust the position of the entire image, such as the human body or face, for free beauty, body beauty, etc., can not be completely adjusted according to user needs, resulting in a single adjustment method and poor beauty and body effects.
需要说明的是,本申请的图像处理方法,可以对图像中的任一位置进行图像处理,比如图像中的景物图像、物品图像和动物、水果图像等等,具体根据实际应用场景进行选择设置,本申请后续实施例描述主要以人脸或者人体作为调整对象进行描述本申请提出的图像处理方法。It should be noted that, the image processing method of the present application can perform image processing on any position in the image, such as scene images, object images, animals, fruit images, etc. in the image, and the selection and settings are specifically selected according to the actual application scene. Subsequent embodiments of the present application describe the image processing method proposed in the present application mainly by taking a face or a human body as an adjustment object.
图1是根据一示例性实施例示出的一种图像处理方法的流程图,如图1所示,图像处理方法用于电子设备中,该电子设备可以是智能手机、平板电脑和智能终端(比如电视机等)等,包括以下步骤:Fig. 1 is a flowchart of an image processing method according to an exemplary embodiment. As shown in Fig. 1 , the image processing method is used in an electronic device, and the electronic device can be a smart phone, a tablet computer, and a smart terminal (such as TV, etc.), etc., including the following steps:
在步骤S101中,获取针对待处理图像的开始触控点和结束触控点;其中,待处理图像包括多个网格和多个网格对应的网格点。In step S101, a start touch point and an end touch point for the image to be processed are acquired; wherein the image to be processed includes multiple grids and grid points corresponding to the multiple grids.
在本公开实施例中,用户可以通过手指、触控笔和鼠标等一种或者多种方式发送操作指令,具体根据用户操作习惯进行选择。In this embodiment of the present disclosure, the user can send the operation instruction through one or more methods, such as a finger, a stylus, and a mouse, and the selection is specifically made according to the user's operation habit.
在本公开实施例中,待处理图像指的是在获取图像后,按照预设步长将待处理图像分割成多个网格和多个网格具有对应的网格点的待处理图像;其中,预设步长与待处理图像的像素个数相关,预设步长的取值越小待处理图像分割的网格点越密集,美型、美体等效果更加自然。其中,图像可以是图片、视频中的每一帧图片等,其中,需要提前对视频进行处理得到每一帧图片。In this embodiment of the present disclosure, an image to be processed refers to an image to be processed that is divided into multiple grids and multiple grids with corresponding grid points after the image is acquired according to a preset step size; wherein , the preset step size is related to the number of pixels of the image to be processed. The smaller the value of the preset step size, the denser the grid points of the image to be processed, and the more natural effects such as beauty and body beauty. Wherein, the image may be a picture, each frame of picture in the video, etc., wherein, the video needs to be processed in advance to obtain each frame of picture.
在本公开实施例中,开始触控点为待处理图像中任一位置点,结束触控点为与待处理图像中任一位置点且与开始触控点对应的位置点不同。In the embodiment of the present disclosure, the start touch point is any position point in the image to be processed, and the end touch point is a position point different from any position point in the to-be-processed image and corresponding to the start touch point.
在本公开实施例中,响应于用户的操作指令,获取待处理图像中的开始触控点和结束触控点的方式有很多种,举例说明如下:In the embodiment of the present disclosure, in response to the user's operation instruction, there are many ways to obtain the start touch point and the end touch point in the image to be processed. Examples are as follows:
第一种示例,响应于用户的滑动操作,获取用户开始触碰待处理图像时的触控点和用户移开待处理图像时的触控点。In the first example, in response to the user's sliding operation, the touch point when the user starts to touch the to-be-processed image and the touch point when the user moves away from the to-be-processed image are acquired.
第二种示例,响应于用户的点击操作,获取用户第一次点击操作待处理图像时的触控点和第二次点击待处理图像时的触控点。In the second example, in response to the user's click operation, the touch points when the user clicks the to-be-processed image for the first time and the touch points when the user clicks the to-be-processed image for the second time are acquired.
在步骤S102中,根据开始触控点和结束触控点的位置信息确定液化区域。In step S102, the liquefaction area is determined according to the position information of the start touch point and the end touch point.
在本公开实施例中,液化区域指的是需要液化(推,拉,膨胀等)的区域。In the embodiments of the present disclosure, the liquefaction region refers to a region that needs to be liquefied (push, pull, expand, etc.).
在本公开实施例中,在获取开始触控点和结束触控点后,可以基于开始触控点的位置 信息、结束触控点的位置信息来确定液化区域,其中,开始触控点和结束触控点的位置信息可以通过坐标点来表示,坐标系可以选择为图像的宽为横轴,高为纵轴;开始触控点指的是需要开始液化的点(比如可以是用户滑动手指时的第一次触碰的点坐标,结束触控点是移开手指时的坐标点)。In the embodiment of the present disclosure, after acquiring the start touch point and the end touch point, the liquefaction area may be determined based on the position information of the start touch point and the position information of the end touch point, wherein the start touch point and the end touch point The position information of the touch point can be represented by coordinate points, and the coordinate system can be selected as the width of the image as the horizontal axis and the height as the vertical axis; the starting touch point refers to the point where liquefaction needs to start (for example, it can be when the user slides his finger). The point coordinates of the first touch, and the end touch point is the coordinate point when the finger is removed).
可以理解的是,可以以开始触控点为起始点,记为(x0,y0),以结束触控点为结束点,记为(x1,y1),根据两个坐标点来确定液化区域,其中,(x0,y0)和(x1,y1)的取值与原点有关,比如可以以开始触控点为原点来对(x0,y0)和(x1,y1)进行取值,也可以以待处理图像的任一顶点为原点来对(x0,y0)和(x1,y1),具体根据实际应用需要进行选择。It can be understood that the starting touch point can be used as the starting point, denoted as (x0, y0), and the end touch point can be denoted as (x1, y1), and the liquefaction area can be determined according to the two coordinate points, Among them, the values of (x0, y0) and (x1, y1) are related to the origin. For example, the starting touch point can be used as the origin to take the values of (x0, y0) and (x1, y1), or wait Any vertex of the processed image is used as the origin to pair (x0, y0) and (x1, y1), which is selected according to actual application needs.
在本公开实施例中,根据开始触控点和结束触控点的位置信息确定液化区域的方式有很多种,举例说明如下:In the embodiment of the present disclosure, there are many ways to determine the liquefaction area according to the position information of the start touch point and the end touch point. Examples are as follows:
作为一种可能实现方式,获取开始触控点的开始横坐标值和开始纵坐标值,以及获取结束触控点的结束横坐标值和结束纵坐标值,获取开始横坐标值和结束横坐标值中的最小横坐标值、开始纵坐标值和结束纵坐标值中的最小纵坐标值分别作为液化区域的第一顶点的横纵坐标值,获取开始横坐标值和结束横坐标值中的最大横坐标值、开始纵坐标值和结束纵坐标值中的最小纵坐标值分别作为液化区域的第二顶点的横纵坐标值,获取开始横坐标值和结束横坐标值中的最小横坐标值、开始纵坐标值和结束纵坐标值中的最大纵坐标值分别作为液化区域的第三顶点的横纵坐标值,获取开始横坐标值和结束横坐标值中的最大横坐标值、开始纵坐标值和结束纵坐标值中的最大纵坐标值分别作为液化区域的第四顶点的横纵坐标值,根据液化区域的第一顶点、第二顶点、第三顶点和第四顶点的的横纵坐标值得到液化区域。通过开始触控点和结束触控点的位置信息快速获取液化区,提高处理效率。As a possible implementation, obtain the start abscissa value and start ordinate value of the start touch point, and obtain the end abscissa value and end ordinate value of the end touch point, and obtain the start abscissa value and end abscissa value The minimum abscissa value, the minimum ordinate value of the start ordinate value and the minimum ordinate value of the end ordinate value in the The coordinate value, the minimum ordinate value of the start ordinate value and the end ordinate value are taken as the abscissa value of the second vertex of the liquefaction area, respectively, and the minimum abscissa value of the start abscissa value and the end abscissa value, the start The maximum ordinate value in the ordinate value and the end ordinate value is taken as the abscissa value of the third vertex of the liquefaction area, respectively, and the maximum abscissa value, the start ordinate value and the end abscissa value are obtained. The maximum ordinate value in the end ordinate values is respectively used as the abscissa and ordinate values of the fourth vertex of the liquefaction area, and is obtained according to the abscissa and ordinate values of the first vertex, the second vertex, the third vertex and the fourth vertex of the liquefaction area. Liquefaction area. The liquefaction area is quickly obtained by the position information of the start touch point and the end touch point, which improves the processing efficiency.
作为另一种可能实现方式,根据多个开始触控点的横纵坐标值和多个结束触控点的横纵坐标值,以及历史液化区域中的四个顶点的横纵坐标值,进行求解,得到多个函数参数,最终建立目标函数,实现将开始触控点的横纵坐标值和结束触控点的横纵坐标值输入到目标函数得到四个顶点的横纵坐标值,从而根据四个顶点的横纵坐标值计算得到液化区域。As another possible implementation, the solution is based on the abscissa and ordinate values of multiple start touch points, the abscissa and ordinate values of multiple end touch points, and the abscissa values of the four vertices in the historical liquefaction area. , obtain multiple function parameters, and finally establish an objective function, which realizes that the abscissa and ordinate values of the start touch point and the abscissa value of the end touch point are input into the objective function to obtain the abscissa and ordinate values of the four vertices. The abscissa and ordinate values of each vertex are calculated to obtain the liquefaction area.
在步骤S103中,根据开始触控点和结束触控点的坐标信息、液化区域中每个网格点的坐标信息和调整半径确定每个网格点的偏移量;其中,调整半径用于控制每个网格点的偏移程度。In step S103, the offset of each grid point is determined according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, the adjustment radius is used for Controls how much each grid point is offset.
在本公开实施例中,以开始触控点为圆心画了一个圆,圆的半径可以为N个像素长其中,N为正整数,上述圆的半径也就是调整半径,可以针对网格点与开始触控点之间距离大于调整半径的网格点不进行移动,仅仅针对网格点与开始触控点之间距离小于等于调整 半径的网格点进行移动,进一步提高液化处理效率。也就是说本公开优选调整半径对应的圆里面的网格点进行调整,以及调整半径用于控制每个网格点的偏移程度,其中,调整半径越大,圆包括的网格点越多,即需要调整的网格点越多,但是每一个网格点的偏移程度越小。调整半径可以按照实际应用需求设置。In the embodiment of the present disclosure, a circle is drawn with the starting touch point as the center, and the radius of the circle can be N pixels long, where N is a positive integer. The grid points whose distance between the starting touch points is greater than the adjustment radius do not move, and only the grid points whose distance between the starting touch point and the starting touch point is less than or equal to the adjustment radius are moved, which further improves the liquefaction processing efficiency. That is to say, the present disclosure preferably adjusts the grid points in the circle corresponding to the radius for adjustment, and the adjustment radius is used to control the offset degree of each grid point, wherein the larger the adjustment radius, the more grid points the circle includes , that is, the more grid points that need to be adjusted, the smaller the offset of each grid point. The adjustment radius can be set according to actual application requirements.
在本公开实施例中,开始触控点和结束触控点为待处理图像中的不同位置点,因此,可以看到开始触控点到结束触控点的位置变化,可以理解的是,这个位置变化不仅仅具有距离而且具有方向,因此,可以基于开始触控点和结束触控点的坐标信息、液化区域中每个网格点的坐标信息和调整半径确定每个网格点的偏移量。In the embodiment of the present disclosure, the start touch point and the end touch point are different positions in the image to be processed. Therefore, the position change from the start touch point to the end touch point can be seen. It can be understood that this The position change has not only distance but also direction, therefore, the offset of each grid point can be determined based on the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius quantity.
具体地,作为一种可能实现方式,根据开始触控点的坐标信息、液化区域中的各个网格点的坐标信息和调整半径计算每个网格点的偏移强度;其中,每个网格点的偏移强度用于表征每个网格点的调整幅度大小;根据开始触控点的坐标信息和结束触控点的坐标信息计算偏移向量;其中,偏移向量的方向为开始触控点指向结束触控点的方向;根据偏移向量和偏移强度计算液化区域中的每个网格点的偏移量。由此,通过开始触控点和结束触控点的位置信息快速获取偏移向量,进一步提高图像处理的准确性和效率。Specifically, as a possible implementation manner, the offset strength of each grid point is calculated according to the coordinate information of the starting touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, each grid point The offset strength of the point is used to represent the adjustment range of each grid point; the offset vector is calculated according to the coordinate information of the start touch point and the coordinate information of the end touch point; the direction of the offset vector is the start touch point Points in the direction of the ending touch point; calculates the offset for each grid point in the liquefaction region based on the offset vector and offset strength. Therefore, the offset vector can be quickly obtained by the position information of the start touch point and the end touch point, which further improves the accuracy and efficiency of image processing.
其中,根据开始触控点的坐标信息和结束触控点的坐标信息计算偏移坐标,获取偏移坐标的模长,根据偏移坐标和模长的比值确定偏移向量;其中,偏移向量的方向为开始触控点指向结束触控点的方向。Among them, the offset coordinates are calculated according to the coordinate information of the start touch point and the coordinate information of the end touch point, the modulo length of the offset coordinates is obtained, and the offset vector is determined according to the ratio of the offset coordinates and the modulo length; wherein, the offset vector The direction of the start touch point points to the direction of the end touch point.
在步骤S104中,根据每个网格点的偏移量移动每个网格点,得到中间处理图像。In step S104, each grid point is moved according to the offset of each grid point to obtain an intermediate processed image.
在步骤S105中,对中间处理图像添加对应纹理信息,以生成目标图像。In step S105, corresponding texture information is added to the intermediate processing image to generate a target image.
在本公开实施例中,实现将液化区域中的各个网格点按照一定的方向移动一定的距离从而得到中间处理图像,最后对中间处理图像添加对应的纹理信息获取目标图像也就是已进行美型、美体等图像处理后的图像。In the embodiment of the present disclosure, each grid point in the liquefaction area is moved by a certain distance in a certain direction to obtain an intermediate processed image, and finally, the corresponding texture information is added to the intermediate processed image to obtain the target image, that is, the beauty model has been performed. , body beauty and other image processed images.
在本公开实施例中,控制每个网格点按照对应的偏移量进行移动,以生成中间处理图像的方式有很多种,可以根据应用场景需要进行选择设置。In the embodiment of the present disclosure, there are many ways to control each grid point to move according to the corresponding offset to generate the intermediate processing image, which can be selected and set according to the needs of the application scenario.
作为一种示例,直接将整个液化区域中的每一个网格点都进行移动,更具体地,根据开始触控点的坐标信息、液化区域中的各个网格点的坐标信息、调整半径计算每个网格点的偏移强度,根据偏移向量和偏移强度计算液化区域中的每个网格点的偏移量,控制每个网格点按照对应的偏移量进行移动,得到中间处理图像。As an example, each grid point in the entire liquefaction area is directly moved. The offset strength of each grid point, calculate the offset of each grid point in the liquefaction area according to the offset vector and the offset strength, control each grid point to move according to the corresponding offset, and obtain the intermediate processing image.
作为另一种示例,获取开始触控点和液化区域中的各个网格点之间的距离大于调整半径应的目标网格点,在控制每个网格点按照对应的偏移量进行移动的过程中,目标网格点的位置不变,其它网格点按照对应的偏移量进行移动,得到中间处理图像,进一步提高调整效率。As another example, the distance between the starting touch point and each grid point in the liquefaction area is greater than the target grid point corresponding to the adjusted radius, and when controlling each grid point to move according to the corresponding offset During the process, the position of the target grid point remains unchanged, and other grid points move according to the corresponding offset to obtain an intermediate processed image, which further improves the adjustment efficiency.
综上,本公开实施例的图像处理方法,获取针对待处理图像的开始触控点和结束触控点;其中,待处理图像包括多个网格和所述多个网格对应的网格点;根据开始触控点和结束触控点的位置信息确定液化区域;根据开始触控点和结束触控点的坐标信息、液化区域中每个网格点的坐标信息和调整半径确定每个网格点的偏移量;其中,调整半径用于控制每个网格点的偏移程度;控制每个网格点按照对应的偏移量进行移动,以生成中间处理图像;对中间处理图像添加对应纹理信息,以生成目标图像。由此,通过用户对图像中人体或者脸等需要调整的位置进行简单操作就可以对人体或者脸等调整位置进行美体、美型等图像处理,提高美型、美体效果和操作简单快速。To sum up, the image processing method of the embodiment of the present disclosure obtains the start touch point and the end touch point for the image to be processed; wherein the image to be processed includes multiple grids and grid points corresponding to the multiple grids ; Determine the liquefaction area according to the position information of the start touch point and end touch point; Determine each mesh according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area and the adjustment radius The offset of the grid point; among them, the adjustment radius is used to control the offset degree of each grid point; control each grid point to move according to the corresponding offset to generate the intermediate processing image; add to the intermediate processing image Corresponding texture information to generate the target image. In this way, the user can perform image processing such as body beautification and beauty on the adjusted position of the human body or face by simply operating the position that needs to be adjusted in the image, so as to improve the beauty and body effect and the operation is simple and fast.
基于上述实施例的描述,下面结合具体场景选择不同的方式进行图像处理进行描述。Based on the descriptions of the above embodiments, the following describes how to select different ways to perform image processing in combination with specific scenarios.
图2是根据一示例性实施例示出的另一种图像处理方法的流程图,如图2所示,包括:FIG. 2 is a flowchart of another image processing method according to an exemplary embodiment, as shown in FIG. 2 , including:
在步骤201中,获取待处理图像,按照预设步长将待处理图像分割成包括多个网格点的待处理图像;其中,预设步长与待处理图像的像素个数相关。In step 201, an image to be processed is acquired, and the image to be processed is divided into images to be processed including a plurality of grid points according to a preset step size; wherein the preset step size is related to the number of pixels of the image to be processed.
在本公开实施中,获取图像的方式有很多种方式,比如用户手动上传的图片或者视屏等,或者是下载的图片,还可以是本地存储的图片或视频等。In the implementation of the present disclosure, there are many ways to obtain images, such as pictures or videos manually uploaded by users, or downloaded pictures, or pictures or videos stored locally.
进一步地,在用户进行操作之前,预先按照预设步长将待处理图像分割成多个网格和多个网格对应的网格点的待处理图像,其中,预设步长与待处理图像的像素个数相关,可以理解的是,预设步长一般跟待处理图像的像素大小有关,一般取10个像素左右,预设步长的取值越小待处理图像分割的网格点越密集,美型、美体等效果更加自然。Further, before the user performs the operation, the to-be-processed image is divided into multiple grids and the to-be-processed images of the grid points corresponding to the multiple grids in advance according to a preset step size, wherein the preset step size and the to-be-processed image are It can be understood that the preset step size is generally related to the pixel size of the image to be processed, and generally takes about 10 pixels. Intensive, the effects of beauty and body are more natural.
举例而言,获取待处理图像的实际尺寸(例如:宽为w个像素,高为h个像素)将在横向和纵向两个方向直接以预设步长即n个像素为单位横向分割h/n个单位,纵向分割w/n个单位,计算出(w/n)*(h/n)大小的网格,如图3a所示的待处理图像,在按照预设步长将待处理图像分割后如图3b所示,生成多个网格点的待处理图像。For example, obtaining the actual size of the image to be processed (for example, w pixels wide and h pixels high) will directly divide h/ n units, vertically divide w/n units, and calculate a grid of size (w/n)*(h/n), as shown in Figure 3a, the image to be processed is divided according to the preset step size. After segmentation, as shown in Figure 3b, a to-be-processed image of multiple grid points is generated.
在步骤202中,获取用户开始触碰待处理图像时的触控点和用户移开待处理图像时的触控点,获取开始触控点和结束触控点的位置信息确定液化区域的四个顶点的横纵坐标值,根据液化区域的四个顶点的横纵坐标值计算得到液化区域。In step 202, the touch point when the user starts to touch the image to be processed and the touch point when the user moves away from the image to be processed are acquired, and the position information of the start touch point and the end touch point are acquired to determine four liquefaction regions. The abscissa and ordinate values of the vertices are calculated according to the abscissa and ordinate values of the four vertices of the liquefaction area to obtain the liquefaction area.
在本公开实施中,用户通过滑动操作来进行图像处理,执行滑动操作可以是手指也可以是触控笔等,如图4所示,用户通过手指滑动图片的示例图,如图4中的A点为用户开始触碰待处理图像时的触控点即开始触控点,以及图4中的B点为用户移开待处理图像时的触控点即结束触控点。In the implementation of the present disclosure, the user performs image processing through a sliding operation, and the sliding operation can be performed by a finger or a stylus, as shown in FIG. The point is the touch point when the user starts to touch the image to be processed, and the touch point is the start point, and the point B in FIG. 4 is the touch point when the user moves the image to be processed, and the touch point ends.
可以理解的是,用户可以根据实际应用操作需求对图像的任一位置进行操作,即图4中的任一位置都可以为A点或者B点,进一步通过滑动的方式实现图像处理,提高图像处理操作的灵活性,满足用户使用需求。It can be understood that the user can operate any position of the image according to the actual application operation requirements, that is, any position in Figure 4 can be point A or point B, and further realize image processing by sliding to improve image processing. The flexibility of operation meets the needs of users.
在本公开实施例中,开始调整的坐标点即开始触控点可以作为起始点,调整结束的位置即结束触控点作为结束点,通过开始触控点的坐标点(x0,y0)和结束触控点的坐标点(x1,y1)来确定需要液化的方形区域,通过开始触控点和结束触控点的位置信息快速获取液化区,提高处理效率。In the embodiment of the present disclosure, the coordinate point where the adjustment starts, that is, the starting touch point, can be used as the starting point, and the position where the adjustment ends, that is, the ending touch point, is used as the ending point. The coordinate points (x1, y1) of the touch point are used to determine the square area that needs to be liquefied, and the liquefaction area is quickly obtained by the position information of the start touch point and the end touch point, which improves the processing efficiency.
举例而言,液化区域一个顶点的坐标点为左上顶点的x坐标是min(x0,x1),左上顶点的y坐标是min(y0,y1);一个顶点的坐标点为右上顶点的x坐标是max((x0,x1),右上顶点的y坐标是min(y0,y1);一个顶点的坐标点为左下顶点的x坐标是min(x0,x1),左下顶点的y坐标是max(y0,y1);一个顶点的坐标点为右下顶点的x坐标是max(x0,x1),右下顶点的y坐标是max(y0,y1)。其中,坐标点的取值与定的坐标系有关,比如左上顶点坐标是(0,0)。For example, the coordinate point of a vertex in the liquefaction area is the upper left vertex, the x coordinate is min(x0, x1), the y coordinate of the upper left vertex is min(y0, y1); the coordinate point of a vertex is the upper right vertex The x coordinate is max((x0, x1), the y-coordinate of the upper-right vertex is min(y0, y1); the coordinate point of a vertex is the x-coordinate of the lower-left vertex is min(x0, x1), and the y-coordinate of the lower-left vertex is max(y0, y1); the coordinate point of a vertex is the x coordinate of the lower right vertex is max(x0, x1), and the y coordinate of the lower right vertex is max(y0, y1). Among them, the value of the coordinate point is related to the fixed coordinate system , for example, the upper left vertex coordinate is (0, 0).
进一步地,根据液化区域左上顶点、左下顶点、右上顶点和右下顶点这四个顶点的横纵坐标值计算得到液化区域,比如图5所示的开始触控点A、结束触控点B从而得到的液化区域X。Further, the liquefaction area is obtained by calculating the abscissa and ordinate values of the four vertices of the upper left vertex, the lower left vertex, the upper right vertex and the lower right vertex of the liquefaction area, such as the start touch point A and the end touch point B shown in FIG. The resulting liquefaction region X.
在步骤203中,根据开始触控点的坐标信息和结束触控点的坐标信息计算偏移向量;其中,偏移向量的方向为开始触控点指向结束触控点的方向。In step 203, an offset vector is calculated according to the coordinate information of the start touch point and the coordinate information of the end touch point; wherein, the direction of the offset vector is the direction in which the start touch point points to the end touch point.
在本公开实施例中,如图5所示,可以看到开始触控点到结束触控点的位置变化,可以理解的是,这个位置变化不仅仅具有距离而且具有方向,因此,可以基于开始触控点和结束触控点的位置变化生成液化区域的偏移向量。In the embodiment of the present disclosure, as shown in FIG. 5 , the position change from the start touch point to the end touch point can be seen. It can be understood that this position change not only has a distance but also a direction. The position change of the touch point and the end touch point generates the offset vector of the liquefaction area.
进一步地,通过预设公式或者算法计算开始触控点的坐标信息和结束触控点的坐标信息计算偏移坐标,获取偏移坐标的模长,根据偏移坐标和模长的比值确定偏移向量;其中,偏移向量的方向为开始触控点指向结束触控点的方向,由此,通过开始触控点和结束触控点的位置信息快速获取偏移向量,进一步提高图像处理的准确性和效率。Further, the offset coordinates are calculated by calculating the coordinate information of the start touch point and the coordinate information of the end touch point by a preset formula or algorithm, and the modulo length of the offset coordinates is obtained, and the offset is determined according to the ratio of the offset coordinates and the modulo length. The direction of the offset vector is the direction from the start touch point to the end touch point. Therefore, the offset vector can be quickly obtained through the position information of the start touch point and the end touch point, which further improves the accuracy of image processing. performance and efficiency.
举例而言,偏移坐标为(x=x1-x0,y=y1-y0),接着计算x平方+y平方再开根号算模长,向量的x,y坐标除以这个模长得到偏移向量。For example, the offset coordinate is (x=x1-x0, y=y1-y0), then calculate x square + y square and then take the square root to calculate the modulo length, the x, y coordinates of the vector are divided by this modulo length to get the offset shift vector.
在步骤204中,根据开始触控点的坐标信息、液化区域中的各个网格点的坐标信息和调整半径计算每个网格点的偏移强度;其中,每个网格点的偏移强度用于表征每个网格点的调整幅度大小。In step 204, the offset strength of each grid point is calculated according to the coordinate information of the starting touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, the offset strength of each grid point is The size of the adjustment used to characterize each grid point.
在步骤205中,根据偏移向量和偏移强度计算液化区域中的每个网格点的偏移量,控制每个网格点按照对应的偏移量进行移动,得到中间处理图像,对中间处理图像添加对应纹理信息,以生成目标图像。In step 205, the offset of each grid point in the liquefaction region is calculated according to the offset vector and the offset strength, and each grid point is controlled to move according to the corresponding offset, so as to obtain an intermediate processed image. The processed image adds corresponding texture information to generate the target image.
在本公开实施例中,为了进一步提高调整的准确性,根据开始触控点的坐标信息、液化区域中的各个网格点的坐标信息、调整半径计算每个网格点的偏移强度,也就是说遍历 液化区域中计算好的各个网格点,比如正在遍历的点记为point(px,py),计算point到开始触控点的距离,根据上述计算的距离与调整半径的比值,得到每个网格点的偏移强度,从而根据偏移向量和偏移强度计算液化区域中的每个网格点的偏移量,控制每个网格点按照对应的偏移量进行移动,得到中间处理图像。In the embodiment of the present disclosure, in order to further improve the accuracy of adjustment, the offset strength of each grid point is calculated according to the coordinate information of the starting touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius, and also That is to say, traverse each calculated grid point in the liquefaction area. For example, the point being traversed is recorded as point(px, py), and the distance from the point to the starting touch point is calculated. According to the ratio of the calculated distance and the adjusted radius, we get The offset strength of each grid point, so as to calculate the offset of each grid point in the liquefaction area according to the offset vector and the offset strength, and control each grid point to move according to the corresponding offset, and obtain Intermediate processed images.
其中,调整半径是预先设置,一般是按照需求设置,调整半径越大需要调整的网格点越多,但是每一个网格点的偏移程度越小。Among them, the adjustment radius is preset, which is generally set according to requirements. The larger the adjustment radius, the more grid points need to be adjusted, but the offset degree of each grid point is smaller.
需要说明的是,为了进一步提高调整效率,可以直接跳过上述计算的距离大于调整半径的网格点,即在控制每个网格点按照对应的偏移量进行移动的过程中,开始触控点和液化区域中的各个网格点之间的距离大于调整半径对应的网格点的位置不变。It should be noted that, in order to further improve the adjustment efficiency, you can directly skip the grid points whose calculated distance is greater than the adjustment radius, that is, in the process of controlling each grid point to move according to the corresponding offset, start the touch The distance between the point and each grid point in the liquefaction area is greater than the position of the grid point corresponding to the adjustment radius.
在本公开实施例中,对中间处理图像添加对应纹理信息生成目标图像也就是已进行美型、美体等图像处理后的图像,其中、纹理信息描述了图像所对应景物的表面性质。In the embodiment of the present disclosure, the corresponding texture information is added to the intermediate processed image to generate the target image, that is, the image after image processing such as beauty and body beauty, where the texture information describes the surface properties of the scene corresponding to the image.
举例而言,如图6a所示的中间处理图像,并对中间处理图像添加对应纹理信息,获取目标图像入图6b所示。For example, taking the intermediate processing image shown in FIG. 6a, and adding corresponding texture information to the intermediate processing image, the obtained target image is shown in FIG. 6b.
综上,本公开实施例的图像处理方法,获取待处理图像,按照预设步长将待处理图像分割成包括多个网格和多个网格对应的多个网格点的待处理图像;其中,预设步长与待处理图像的像素个数相关,获取用户开始触碰待处理图像时的触控点和用户移开待处理图像时的触控点,获取开始触控点和结束触控点的位置信息确定液化区域的四个顶点的横纵坐标值,根据液化区域的四个顶点的横纵坐标值计算得到液化区域,根据开始触控点的坐标信息和结束触控点的坐标信息计算偏移向量;其中,偏移向量的方向为开始触控点指向结束触控点的方向;根据开始触控点的坐标信息、液化区域中的各个网格点的坐标信息和调整半径计算每个网格点的偏移强度;其中,每个网格点的偏移强度用于表征每个网格点的调整幅度大小,根据偏移向量和偏移强度计算液化区域中的每个网格点的偏移量,控制每个网格点按照对应的偏移量进行移动,得到中间处理图像,对中间处理图像添加对应纹理信息,以生成目标图像。由此,通过开始触控点、结束触控点以及调整半径计算网格移动的幅度,并计算出调整后的网格点,最后对中间处理图像添加对应纹理信息获取目标图像,实现用户认为选择一部分需要调整的区域,不想调整的区域保持不动,不依赖与关键点从而更加自由的进行美型、美体等图像处理,提高美型、美体等图像处理效果和操作简单快速。To sum up, the image processing method according to the embodiment of the present disclosure acquires an image to be processed, and divides the image to be processed into an image to be processed including a plurality of grids and a plurality of grid points corresponding to the plurality of grids according to a preset step size; The preset step size is related to the number of pixels of the image to be processed, and the touch point when the user starts to touch the image to be processed and the touch point when the user moves away from the image to be processed are obtained, and the start touch point and the end touch point are obtained. The position information of the handle points determines the abscissa and ordinate values of the four vertices of the liquefaction area, and calculates the liquefaction area according to the abscissa and ordinate values of the four vertices of the liquefaction area. According to the coordinate information of the start touch point and the coordinates of the end touch point Calculate the offset vector according to the information; wherein, the direction of the offset vector is the direction from the start touch point to the end touch point; calculate according to the coordinate information of the start touch point, the coordinate information of each grid point in the liquefaction area and the adjustment radius The offset strength of each grid point; wherein, the offset strength of each grid point is used to characterize the adjustment amplitude of each grid point, and each grid in the liquefaction region is calculated according to the offset vector and offset strength The offset of the grid point, control each grid point to move according to the corresponding offset, obtain the intermediate processing image, and add the corresponding texture information to the intermediate processing image to generate the target image. Therefore, the range of grid movement is calculated by starting the touch point, ending the touch point, and adjusting the radius, and then the adjusted grid point is calculated. Finally, the corresponding texture information is added to the intermediate processing image to obtain the target image, so as to realize the user's choice. Part of the areas that need to be adjusted, and the areas that you don't want to be adjusted remain unchanged, so that you can more freely perform image processing such as beauty and body beauty without relying on key points, improve image processing effects such as beauty and body beauty, and the operation is simple and fast.
图7是根据一示例性实施例示出的又一种图像处理方法的流程图,如图7所示,包括:Fig. 7 is a flow chart of still another image processing method according to an exemplary embodiment, as shown in Fig. 7 , including:
在步骤301中,获取待处理图像,按照预设步长将待处理图像分割成包括多个网格点的待处理图像;其中,预设步长与待处理图像的像素个数相关。In step 301, an image to be processed is acquired, and the image to be processed is divided into images to be processed including a plurality of grid points according to a preset step size; wherein the preset step size is related to the number of pixels of the image to be processed.
在本公开实施中,获取图像的方式有很多种方式,比如用户手动上传的图片或者视屏 等,或者是下载的图片,还可以是本地存储的图片或视频等。In the implementation of the present disclosure, there are many ways to obtain images, such as pictures or videos manually uploaded by the user, or downloaded pictures, or locally stored pictures or videos.
进一步地,在用户进行操作之前,预先按照预设步长将待处理图像分割成包括多个网格的待处理图像,其中,预设步长与像素个数相关,可以理解的是,预设步长一般跟待处理图像大小有关,一般取10个像素左右,预设步长的取值越小网格越密集,美型、美体等效果更加自然。Further, before the user performs the operation, the image to be processed is divided into images to be processed including a plurality of grids in advance according to a preset step size, wherein the preset step size is related to the number of pixels. It can be understood that the preset step size is The step size is generally related to the size of the image to be processed. Generally, it is about 10 pixels. The smaller the preset step size is, the denser the grid is, and the effects of beauty and body are more natural.
举例而言,获取待处理图像的实际尺寸(例如:宽为w个像素,高为h个像素)将在横向和纵向两个方向直接以预设步长即n个像素为单位横向分割h/n个单位,纵向分割w/n个单位,计算出(w/n)*(h/n)大小的网格,如图3a所示的待处理图像,在按照预设步长将待处理图像分割后如图3b所示,生成多个网格的待处理图像。For example, obtaining the actual size of the image to be processed (for example, w pixels wide and h pixels high) will directly divide h/ n units, vertically divide w/n units, and calculate a grid of size (w/n)*(h/n), as shown in Figure 3a, the image to be processed is divided according to the preset step size. After segmentation, as shown in Figure 3b, multiple grid images are generated to be processed.
在步骤302中,获取用户第一次点击操作待处理图像时的触控点和第二次点击待处理图像时的触控点。In step 302, the touch points when the user clicks the to-be-processed image for the first time and the touch points when the user clicks the to-be-processed image for the second time are acquired.
在本公开实施中,用户通过点击操作来进行图像处理,执行点击操作可以是手指也可以是触控笔等,如图8所示,用户通过手指点击图片的示例图,如图8中的C点为用户第一次点击操作待处理图像时的触控点即开始触控点,以及图8中的D点为第二次点击待处理图像时的触控点即结束触控点。In the implementation of the present disclosure, the user performs image processing through a click operation, and the click operation can be performed by a finger or a stylus, as shown in FIG. The point is the touch point when the user clicks the image to be processed for the first time, and the touch point starts, and the point D in FIG. 8 is the touch point when the user clicks the image to be processed for the second time, and the touch point ends.
可以理解的是,用户可以根据实际应用操作需求对图像的任一位置进行操作,即图4中的任一位置都可以为A点或者B点,进一步通过点击的方式实现图像处理,提高图像处理操作的灵活性,满足用户使用需求。It can be understood that the user can operate any position of the image according to the actual application operation requirements, that is, any position in Figure 4 can be point A or point B, and further realize image processing by clicking to improve image processing. The flexibility of operation meets the needs of users.
在步骤303中,获取开始触控点和结束触控点的位置信息确定液化区域的四个顶点的横纵坐标值,根据液化区域的四个顶点的横纵坐标值计算得到液化区域。In step 303, the position information of the start touch point and the end touch point is obtained to determine the abscissa and ordinate values of the four vertices of the liquefaction area, and the liquefaction area is calculated according to the abscissa and ordinate values of the four vertices of the liquefaction area.
在本公开实施例中,开始调整的坐标点即开始触控点可以作为起始点,调整结束的位置即结束触控点作为结束点,通过开始触控点的坐标点(x0,y0)和结束触控点的坐标点(x1,y1)来确定需要液化的方形区域,通过开始触控点和结束触控点的位置信息快速获取液化区,提高处理效率。In the embodiment of the present disclosure, the coordinate point where the adjustment starts, that is, the starting touch point, can be used as the starting point, and the position where the adjustment ends, that is, the ending touch point, is used as the ending point. The coordinate points (x1, y1) of the touch point are used to determine the square area that needs to be liquefied, and the liquefaction area is quickly obtained by the position information of the start touch point and the end touch point, which improves the processing efficiency.
举例而言,液化区域一个顶点的坐标点为左上顶点的x坐标是min(x0,x1),左上顶点的y坐标是min(y0,y1);一个顶点的坐标点为右上顶点的x坐标是max((x0,x1),右上顶点的y坐标是min(y0,y1);一个顶点的坐标点为左下顶点的x坐标是min(x0,x1),左下顶点的y坐标是max(y0,y1);一个顶点的坐标点为右下顶点的x坐标是max(x0,x1),右下顶点的y坐标是max(y0,y1)。其中,坐标点的取值与定的坐标系有关,比如左上顶点坐标是(0,0)。For example, the coordinate point of a vertex in the liquefaction area is the upper left vertex, the x coordinate is min(x0, x1), the y coordinate of the upper left vertex is min(y0, y1); the coordinate point of a vertex is the upper right vertex The x coordinate is max((x0, x1), the y-coordinate of the upper-right vertex is min(y0, y1); the coordinate point of a vertex is the x-coordinate of the lower-left vertex is min(x0, x1), and the y-coordinate of the lower-left vertex is max(y0, y1); the coordinate point of a vertex is the x coordinate of the lower right vertex is max(x0, x1), and the y coordinate of the lower right vertex is max(y0, y1). Among them, the value of the coordinate point is related to the fixed coordinate system , for example, the upper left vertex coordinate is (0, 0).
进一步地,根据液化区域四个顶点的横纵坐标值计算得到液化区域,比如图5所示的开始触控点A、结束触控点B从而得到的液化区域X。Further, the liquefaction region is obtained by calculation according to the abscissa and vertical coordinate values of the four vertices of the liquefaction region, such as the liquefaction region X obtained from the start touch point A and the end touch point B shown in FIG. 5 .
在步骤304中,根据开始触控点的坐标信息和结束触控点的坐标信息计算偏移坐标,获取偏移坐标的模长,根据偏移坐标和模长的比值确定偏移向量;其中,偏移向量的方向为开始触控点指向结束触控点的方向。In step 304, the offset coordinates are calculated according to the coordinate information of the start touch point and the coordinate information of the end touch point, the modulo length of the offset coordinates is obtained, and the offset vector is determined according to the ratio of the offset coordinates and the modulo length; wherein, The direction of the offset vector is the direction from the start touch point to the end touch point.
在本公开实施例中,如图5所示,可以看到开始触控点到结束触控点的位置变化,可以理解的是,这个位置变化不仅仅具有距离而且具有方向,因此,可以基于开始触控点和结束触控点的位置信息确定偏移向量。In the embodiment of the present disclosure, as shown in FIG. 5 , the position change from the start touch point to the end touch point can be seen. It can be understood that this position change not only has a distance but also a direction. The position information of the touch point and the end touch point determines the offset vector.
进一步地,通过预设公式或者算法计算开始触控点的坐标信息和结束触控点的坐标信息计算偏移坐标,获取偏移坐标的模长,根据偏移坐标和模长的比值确定偏移向量;其中,偏移向量的方向为开始触控点指向结束触控点的方向,由此,通过开始触控点和结束触控点的位置信息确定偏移向量,进一步提高图像处理的准确性和效率。Further, the offset coordinates are calculated by calculating the coordinate information of the start touch point and the coordinate information of the end touch point by a preset formula or algorithm, and the modulo length of the offset coordinates is obtained, and the offset is determined according to the ratio of the offset coordinates and the modulo length. vector; wherein, the direction of the offset vector is the direction from the start touch point to the end touch point. Therefore, the offset vector is determined by the position information of the start touch point and the end touch point, which further improves the accuracy of image processing. and efficiency.
举例而言,偏移坐标为(x=x1-x0,y=y1-y0),接着计算x平方+y平方再开根号算模长,向量的x,y坐标除以这个模长得到偏移向量。For example, the offset coordinate is (x=x1-x0, y=y1-y0), then calculate x square + y square and then take the square root to calculate the modulo length, the x, y coordinates of the vector are divided by this modulo length to get the offset shift vector.
在步骤305中,获取开始触控点和液化区域中的各个网格点之间的距离大于调整半径应的目标网格,计算开始触控点和液化区域中的各个网格点之间的距离,计算开始触控点和液化区域中的各个网格点之间的距离与调整半径的比值,得到每个网格点的偏移强度。In step 305, the distance between the starting touch point and each grid point in the liquefaction area is greater than the target grid corresponding to the adjusted radius, and the distance between the starting touch point and each grid point in the liquefaction area is calculated , calculate the ratio of the distance between the starting touch point and each grid point in the liquefaction area to the adjustment radius, and get the offset strength of each grid point.
在步骤306中,根据偏移向量和偏移强度的乘积得到液化区域中的每个网格点的偏移量,控制每个网格点按照对应的偏移量进行移动,在控制每个网格点按照对应的偏移量进行移动的过程中,目标网格的位置不变,得到中间处理图像。In step 306, the offset of each grid point in the liquefaction area is obtained according to the product of the offset vector and the offset intensity, and each grid point is controlled to move according to the corresponding offset. In the process of moving the grid points according to the corresponding offset, the position of the target grid remains unchanged, and an intermediate processing image is obtained.
在本公开实施例中,为了进一步提高调整的准确性,计算开始触控点和液化区域中的各个网格点之间的距离,计算开始触控点和液化区域中的各个网格点之间的距离与调整半径的比值,得到每个网格点的偏移强度,也就是说遍历液化区域中计算好的各个网格点,比如正在遍历的网格点记为point(px,py),计算point到开始触控点的距离,根据上述计算的距离与调整半径的比值,得到每个网格点的偏移强度,从而根据偏移向量和偏移强度乘积快速计算液化区域中的每个网格点的偏移量,从而快速精确获取每个网格点的偏移量,控制每个网格点按照对应的偏移量进行移动,得到中间处理图像,进一步提高图像处理效率。In the embodiment of the present disclosure, in order to further improve the accuracy of adjustment, the distance between the start touch point and each grid point in the liquefaction area is calculated, and the distance between the start touch point and each grid point in the liquefaction area is calculated. The ratio of the distance to the adjustment radius to get the offset strength of each grid point, that is to say, the calculated grid points in the liquefaction area are traversed. For example, the grid points being traversed are recorded as point(px, py), Calculate the distance from the point to the starting touch point, and obtain the offset strength of each grid point according to the ratio of the calculated distance to the adjusted radius, so as to quickly calculate each of the liquefaction areas according to the product of the offset vector and the offset strength. Offset of grid points, so as to quickly and accurately obtain the offset of each grid point, control each grid point to move according to the corresponding offset, obtain intermediate processing images, and further improve the efficiency of image processing.
需要说明的是,为了进一步提高调整效率,可以直接跳过上述计算的距离大于调整半径的网格点,即在控制每个网格点按照对应的偏移量进行移动的过程中,开始触控点和液化区域中的各个网格点之间的距离大于调整半径应的网格点的位置不变。It should be noted that, in order to further improve the adjustment efficiency, you can directly skip the grid points whose calculated distance is greater than the adjustment radius, that is, in the process of controlling each grid point to move according to the corresponding offset, start the touch The distance between the point and each grid point in the liquefaction area is greater than the adjustment radius should the position of the grid point remain unchanged.
在步骤307中,对中间处理图像添加对应纹理信息,以生成目标图像。In step 307, corresponding texture information is added to the intermediate processed image to generate a target image.
在本公开实施例中,对中间处理图像添加对应纹理信息生成目标图像也就是已进行美型、美体等图像处理后的图像,其中、纹理信息描述了图像所对应景物的表面性质。In the embodiment of the present disclosure, the corresponding texture information is added to the intermediate processed image to generate the target image, that is, the image after image processing such as beauty and body beauty, where the texture information describes the surface properties of the scene corresponding to the image.
由此,通过用户操作的起始点和结束点以及调整半径计算液化区域中的每个网格点移动的幅度,并计算出调整后的网格点,最后根据调整后的网格点对应的纹理信息对调整后的网格点添加对应纹理信息获取目标图像,实现用户认为选择一部分需要调整的区域,不想调整的区域保持不动,不依赖与关键点从而更加自由的进行美型、美体等图像处理,提高美型、美体效果和操作简单快速。In this way, the moving range of each grid point in the liquefaction area is calculated through the start point and end point of the user operation and the adjustment radius, and the adjusted grid point is calculated, and finally the texture corresponding to the adjusted grid point is calculated. The information adds corresponding texture information to the adjusted grid points to obtain the target image, so that the user can select a part of the area that needs to be adjusted, and the area that does not want to be adjusted remains unchanged, and does not depend on the key points, so that the image such as beauty and body beauty can be more freely performed. Treatment, improve beauty, body effect and simple and fast operation.
图9是根据一示例性实施例示出的一种图像处理装置框图。参照图9,该装置包括第一获取单元121,确定单元122、生成单元123、控制单元124和处理单元125。Fig. 9 is a block diagram of an image processing apparatus according to an exemplary embodiment. Referring to FIG. 9 , the apparatus includes a first obtaining unit 121 , a determining unit 122 , a generating unit 123 , a control unit 124 and a processing unit 125 .
第一获取单元121,被配置为获取针对待处理图像的开始触控点和结束触控点;其中,待处理图像包括多个网格和多个网格对应的网格点。。The first acquiring unit 121 is configured to acquire a start touch point and an end touch point for the image to be processed; wherein the image to be processed includes multiple grids and grid points corresponding to the multiple grids. .
在本公开实施例中,用户可以通过手指、触控笔和鼠标等一种或者多种方式发送操作指令,具体根据用户操作习惯进行选择。In this embodiment of the present disclosure, the user can send the operation instruction through one or more methods, such as a finger, a stylus, and a mouse, and the selection is specifically made according to the user's operation habit.
在本公开实施例中,待处理图像指的是在获取图像后,按照预设步长将图像分割成包括多个网格的待处理图像;其中,预设步长与像素个数相关。其中,图像可以是图片、视频中的每一帧图片等,其中,需要提前对视频进行处理得到每一帧图片。In the embodiment of the present disclosure, the image to be processed refers to dividing the image into images to be processed including a plurality of grids according to a preset step size after acquiring the image, wherein the preset step size is related to the number of pixels. Wherein, the image may be a picture, each frame of picture in the video, etc., wherein, the video needs to be processed in advance to obtain each frame of picture.
在本公开实施例中,开始触控点为待处理图像中任一位置点,结束触控点为与待处理图像中任一位置点且与开始触控点对应的位置点不同。In the embodiment of the present disclosure, the start touch point is any position point in the image to be processed, and the end touch point is a position point different from any position point in the to-be-processed image and corresponding to the start touch point.
在本公开实施例中,响应于用户的操作指令,获取待处理图像中的开始触控点和结束触控点的方式有很多种,举例说明如下:In the embodiment of the present disclosure, in response to the user's operation instruction, there are many ways to obtain the start touch point and the end touch point in the image to be processed. Examples are as follows:
第一种示例,第一获取单元121,具体被配置为获取用户开始触碰待处理图像时的触控点和用户移开待处理图像时的触控点。In the first example, the first acquiring unit 121 is specifically configured to acquire the touch point when the user starts to touch the image to be processed and the touch point when the user moves away from the image to be processed.
第二种示例,第一获取单元121,具体被配置为获取用户第一次点击操作待处理图像时的触控点和第二次点击待处理图像时的触控点。In the second example, the first obtaining unit 121 is specifically configured to obtain the touch points when the user clicks the to-be-processed image for the first time and the touch points when the user clicks the to-be-processed image for the second time.
确定单元122,被配置为根据开始触控点和结束触控点的位置信息确定液化区域。The determining unit 122 is configured to determine the liquefaction area according to the position information of the start touch point and the end touch point.
在本公开实施例中,液化区域指的是需要液化(推,拉,膨胀等)的区域。In the embodiments of the present disclosure, the liquefaction region refers to a region that needs to be liquefied (push, pull, expand, etc.).
在本公开实施例中,在获取开始触控点和结束触控点后,可以基于开始触控点的位置信息、结束触控点的位置信息来确定液化区域,其中,可以理解的是,可以以开始触控点为起始点,记为(x0,y0),以结束触控点为结束点,记为(x1,y1),根据两个坐标点来确定液化区域,其中,(x0,y0)和(x1,y1)的取值与原点有关,比如可以以开始触控点为原点来对(x0,y0)和(x1,y1)进行取值,也可以以待处理图像的任一顶点为原点来对(x0,y0)和(x1,y1),具体根据实际应用需要进行选择。In the embodiment of the present disclosure, after the start touch point and the end touch point are acquired, the liquefaction area may be determined based on the position information of the start touch point and the position information of the end touch point, wherein it can be understood that the Take the start touch point as the starting point, denoted as (x0, y0), and the end touch point as the end point, denoted as (x1, y1), and determine the liquefaction area according to the two coordinate points, where (x0, y0 ) and (x1, y1) are related to the origin. For example, you can take the starting touch point as the origin to take the values of (x0, y0) and (x1, y1), or you can take any vertex of the image to be processed. As the origin to pair (x0, y0) and (x1, y1), the selection is made according to actual application needs.
在本公开实施例中,根据开始触控点和结束触控点的位置信息确定液化区域的方式有很多种,举例说明如下:In the embodiment of the present disclosure, there are many ways to determine the liquefaction area according to the position information of the start touch point and the end touch point. Examples are as follows:
作为一种可能实现方式,确定单元122,具体被配置为获取开始触控点的开始横坐标值和开始纵坐标值,以及获取结束触控点的结束横坐标值和结束纵坐标值;获取开始横坐标值和结束横坐标值中的最小横坐标值、开始纵坐标值结束纵坐标值中的最小纵坐标值分别作为液化区域的第一顶点的横纵坐标值;获取开始横坐标值和结束横坐标值中的最大横坐标值、开始纵坐标值和结束纵坐标值中的最小纵坐标值分别作为液化区域的第二顶点的横纵坐标值;获取开始横坐标值和结束横坐标值中的最小横坐标值、开始纵坐标值和结束纵坐标值中的最大纵坐标值分别作为液化区域的第三顶点的横纵坐标值;获取开始横坐标值和结束横坐标值中的最大横坐标值、开始纵坐标值结束纵坐标值中的最大纵坐标值分别作为液化区域的第四顶点的横纵坐标值;根据第一顶点、第二顶点、第三顶点和第四顶点的横纵坐标值得到液化区域。As a possible implementation manner, the determining unit 122 is specifically configured to obtain the start abscissa value and the start ordinate value of the start touch point, and obtain the end abscissa value and the end ordinate value of the end touch point; The minimum abscissa value in the abscissa value and the end abscissa value, and the minimum ordinate value in the start ordinate value and the end ordinate value are respectively used as the abscissa value of the first vertex of the liquefaction area; obtain the start abscissa value and the end ordinate value. The maximum abscissa value of the abscissa value, the minimum ordinate value of the start ordinate value and the end ordinate value are respectively used as the abscissa value of the second vertex of the liquefaction area; obtain the start abscissa value and the end abscissa value. The minimum abscissa value, the maximum ordinate value of the start ordinate value and the end ordinate value of the value, the maximum ordinate value of the start ordinate value and the end ordinate value are respectively used as the abscissa and ordinate values of the fourth vertex of the liquefaction region; according to the abscissa and ordinate values of the first vertex, the second vertex, the third vertex and the fourth vertex value to get the liquefaction area.
作为另一种可能实现方式,确定单元122,具体被配置为根据多个开始触控点的横纵坐标值和多个结束触控点的横纵坐标值,以及历史液化区域中的四个顶点的横纵坐标值,进行求解,得到多个函数参数,最终建立目标函数,实现将开始触控点的横纵坐标值和结束触控点的横纵坐标值输入到目标函数得到四个顶点的横纵坐标值,从而根据四个顶点的横纵坐标值计算得到液化区域。As another possible implementation manner, the determining unit 122 is specifically configured to be based on the abscissa and ordinate values of the multiple start touch points, the abscissa values of the multiple end touch points, and the four vertices in the historical liquefaction area The abscissa and ordinate values of the first touch point and the abscissa and ordinate values of the end touch point are input into the objective function to obtain the four vertices. The abscissa and ordinate values, so that the liquefaction area is calculated according to the abscissa and ordinate values of the four vertices.
生成单元123,被配置为根据开始触控点和所述结束触控点的坐标信息、液化区域中每个网格点的坐标信息和调整半径确定每个网格点的偏移量;其中,调整半径用于用于控制每个网格点的偏移程度。The generating unit 123 is configured to determine the offset of each grid point according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, The adjustment radius is used to control how much each grid point is offset.
在本公开实施例中,开始触控点和结束触控点为待处理图像中的不同位置点,因此,可以看到开始触控点到结束触控点的位置变化,可以理解的是,这个位置变化不仅仅具有距离而且具有方向,因此,可以基于开始触控点和结束触控点的位置变化生成液化区域的偏移向量。In the embodiment of the present disclosure, the start touch point and the end touch point are different positions in the image to be processed. Therefore, the position change from the start touch point to the end touch point can be seen. It can be understood that this A position change has not only a distance but also a direction, so the offset vector of the liquefaction region can be generated based on the position change of the start touch point and the end touch point.
具体地,作为一种可能实现方式,生成单元123,具体被配置为根据开始触控点的坐标信息、液化区域中的各个网格点的坐标信息和调整半径计算每个网格点的偏移强度;其中,每个网格点的偏移强度用于表征每个网格点的调整幅度大小,计算开始触控点和结束触控点之间的距离,根据开始触控点的坐标信息和结束触控点的坐标信息计算偏移坐标,根据偏移坐标和开始触控点和结束触控点之间的距离的比值确定偏移向量;其中,偏移向量的方向为开始触控点指向结束触控点的方向,根据偏移向量和偏移强度计算液化区域中的每个网格点的偏移量。Specifically, as a possible implementation manner, the generating unit 123 is specifically configured to calculate the offset of each grid point according to the coordinate information of the starting touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius Intensity; among them, the offset intensity of each grid point is used to represent the adjustment range of each grid point, calculate the distance between the start touch point and the end touch point, according to the coordinate information of the start touch point and The offset coordinates are calculated from the coordinate information of the end touch point, and the offset vector is determined according to the ratio of the offset coordinates and the distance between the start touch point and the end touch point; wherein, the direction of the offset vector is the direction of the start touch point. The direction of the end touch point, the offset of each grid point in the liquefaction area is calculated based on the offset vector and the offset strength.
控制单元124,被配置为根据每个网格点的偏移量移动每个网格点,得到中间处理图像。The control unit 124 is configured to move each grid point according to the offset of each grid point to obtain an intermediate processed image.
处理单元125,被配置为对中间处理图像添加对应纹理信息,以生成目标图像。The processing unit 125 is configured to add corresponding texture information to the intermediate processed image to generate a target image.
在本公开实施例中,实现将液化区域中的各个网格点按照一定的方向移动一定的距离从而得到中间处理图像,最后对中间处理图像添加对应纹理信息,以生成目标图像。In the embodiment of the present disclosure, each grid point in the liquefaction area is moved a certain distance in a certain direction to obtain an intermediate processed image, and finally, corresponding texture information is added to the intermediate processed image to generate a target image.
在本公开实施例中,控制每个网格点按照对应的偏移量进行移动,以生成中间处理图像的方式有很多种,可以根据应用场景需要进行选择设置。In the embodiment of the present disclosure, there are many ways to control each grid point to move according to the corresponding offset to generate the intermediate processing image, which can be selected and set according to the needs of the application scenario.
作为一种示例,直接将整个液化区域中的每一个网格都进行移动,在公开的一个实施例中,如图10所示,在如图9所示的基础上,生成单元123,包括:第一计算子单元1231,被配置为根据开始触控点的坐标信息、液化区域中的各个网格点的坐标信息和所述调整半径计算所述每个网格点的偏移强度;其中,每个网格点的偏移强度用于表征所述每个网格点的调整幅度大小;第二计算子单元1232,被配置为根据开始触控点的坐标信息和结束触控点的坐标信息计算偏移向量;其中,偏移向量的方向为开始触控点指向结束触控点的方向;第三计算子单元1233,被配置为根据偏移向量和偏移强度计算所述液化区域中的每个网格点的偏移量。As an example, each grid in the entire liquefaction region is directly moved. In a disclosed embodiment, as shown in FIG. 10 , on the basis of that shown in FIG. 9 , the generating unit 123 includes: The first calculation subunit 1231 is configured to calculate the offset strength of each grid point according to the coordinate information of the starting touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, The offset strength of each grid point is used to represent the adjustment amplitude of each grid point; the second calculation subunit 1232 is configured to be based on the coordinate information of the start touch point and the coordinate information of the end touch point Calculate the offset vector; wherein, the direction of the offset vector is the direction from the start touch point to the end touch point; the third calculation subunit 1233 is configured to calculate the liquefaction area according to the offset vector and the offset strength. Offset for each grid point.
在公开的一个实施例中,第一计算子单元1231,具体被配置为:计算开始触控点和液化区域中的各个网格点之间的距离;计算每个距离与调整半径的比值,将比值作为每个网格点的偏移强度。In one disclosed embodiment, the first calculation subunit 1231 is specifically configured to: calculate the distance between the starting touch point and each grid point in the liquefaction area; calculate the ratio of each distance to the adjustment radius, and set the Ratio as the offset strength for each grid point.
在公开的一个实施例中,第三计算子单元1233,具体被配置为:计算偏移向量和每个网格点的偏移强度的乘积,将乘积作为所述每个网格点的偏移量。In one disclosed embodiment, the third calculation subunit 1233 is specifically configured to: calculate the product of the offset vector and the offset strength of each grid point, and use the product as the offset of each grid point quantity.
在公开的一个实施例中,如图11所示,在如图9所示的基础上,图像处理装置,还包括:第二获取单元126和分割单元127。In one disclosed embodiment, as shown in FIG. 11 , on the basis of that shown in FIG. 9 , the image processing apparatus further includes: a second acquiring unit 126 and a dividing unit 127 .
第二获取单元126,被配置为获取待处理图像。The second acquiring unit 126 is configured to acquire the image to be processed.
分割单元127,被配置为按照预设步长将待处理图像分割成包括多个网格点的待处理图像;其中,预设步长与待处理图像的像素个数相关。The dividing unit 127 is configured to divide the image to be processed into images to be processed including a plurality of grid points according to a preset step size, wherein the preset step size is related to the number of pixels of the image to be processed.
在公开的一个实施例中,如图12所示,在如图9所示的基础上,图像处理装置,还包括:第三获取单元128和维持单元129。In one disclosed embodiment, as shown in FIG. 12 , on the basis of that shown in FIG. 9 , the image processing apparatus further includes: a third acquiring unit 128 and a maintaining unit 129 .
第三获取单元128,被配置为获取距离大于调整半径的目标网格点。The third acquiring unit 128 is configured to acquire the target grid point whose distance is greater than the adjustment radius.
维持单元129,被配置为在控制每个网格点按照对应的偏移量进行移动的过程中,目标网格点的位置不变。The maintaining unit 129 is configured to keep the position of the target grid point unchanged during the process of controlling each grid point to move according to the corresponding offset.
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。Regarding the apparatus in the above-mentioned embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be described in detail here.
为了实现上述实施例,本公开还提出了一种电子设备。图13是根据本公开提出的一种电子设备的框图。In order to realize the above embodiments, the present disclosure also proposes an electronic device. FIG. 13 is a block diagram of an electronic device proposed according to the present disclosure.
如图13所示,上述电子设备200包括:As shown in FIG. 13 , the above-mentioned electronic device 200 includes:
存储器210及处理器220,连接不同组件(包括存储器210和处理器220)的总线230,存储器210存储有计算机程序,当处理器220执行程序时实现本公开实施例的图像处理方法。The memory 210 and the processor 220 are connected to a bus 230 of different components (including the memory 210 and the processor 220). The memory 210 stores a computer program. When the processor 220 executes the program, the image processing method of the embodiment of the present disclosure is implemented.
总线230表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(ISA)总线,微通道体系结构(MAC)总线,增强型ISA总线、视频电子标准协会(VESA)局域总线以及外围组件互连(PCI)总线。 Bus 230 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of a variety of bus structures. By way of example, these architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect ( PCI) bus.
电子设备200典型地包括多种电子设备可读介质。这些介质可以是任何能够被电子设备200访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。 Electronic device 200 typically includes a variety of electronic device-readable media. These media can be any available media that can be accessed by electronic device 200, including volatile and non-volatile media, removable and non-removable media.
存储器210还可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(RAM)240和/或高速缓存存储器250。电子设备200可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统260可以用于读写不可移动的、非易失性磁介质(图21未显示,通常称为“硬盘驱动器”)。尽管图21中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如CD-ROM,DVD-ROM或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线230相连。存储器210可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本公开各实施例的功能。 Memory 210 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 240 and/or cache memory 250 . Electronic device 200 may further include other removable/non-removable, volatile/non-volatile computer system storage media. For example only, storage system 260 may be used to read and write to non-removable, non-volatile magnetic media (not shown in FIG. 21, commonly referred to as a "hard drive"). Although not shown in FIG. 21, a magnetic disk drive for reading and writing to removable non-volatile magnetic disks (eg "floppy disks") and removable non-volatile optical disks (eg CD-ROM, DVD-ROM) may be provided or other optical media) to read and write optical drives. In these cases, each drive may be connected to bus 230 through one or more data media interfaces. The memory 210 may include at least one program product having a set (eg, at least one) of program modules configured to perform the functions of various embodiments of the present disclosure.
具有一组(至少一个)程序模块270的程序/实用工具280,可以存储在例如存储器210中,这样的程序模块270包括——但不限于——操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块270通常执行本公开所描述的实施例中的功能和/或方法。A program/utility 280 having a set (at least one) of program modules 270, which may be stored, for example, in memory 210, such program modules 270 including, but not limited to, an operating system, one or more application programs, other programs Modules and program data, each or some combination of these examples may include an implementation of a network environment. Program modules 270 generally perform the functions and/or methods in the embodiments described in this disclosure.
电子设备200也可以与一个或多个外部设备290(例如键盘、指向设备、显示器291等)通信,还可与一个或者多个使得用户能与该电子设备200交互的设备通信,和/或与使得该电子设备200能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出(I/O)接口292进行。并且,电子设备200还可以通过网络适配器293与一个或者多个网络(例如局域网(LAN),广域网(WAN)和/或公共网络,例如因特网)通信。如图13所示,网络适配器293通过总线230与电子设备200的其它模块通信。应当明白,尽管图中未示出,可以结合电子设备200使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、RAID系统、磁带驱动器以及数据备份存储系统等。The electronic device 200 may also communicate with one or more external devices 290 (eg, keyboard, pointing device, display 291, etc.), with one or more devices that enable a user to interact with the electronic device 200, and/or with Any device (eg, network card, modem, etc.) that enables the electronic device 200 to communicate with one or more other computing devices. Such communication may take place through input/output (I/O) interface 292 . Also, the electronic device 200 may communicate with one or more networks (eg, a local area network (LAN), a wide area network (WAN), and/or a public network such as the Internet) through a network adapter 293 . As shown in FIG. 13 , the network adapter 293 communicates with other modules of the electronic device 200 through the bus 230 . It should be understood that, although not shown, other hardware and/or software modules may be used in conjunction with electronic device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives and data backup storage systems.
处理器220通过运行存储在存储器210中的程序,从而执行各种功能应用以及数据处理。The processor 220 executes various functional applications and data processing by executing programs stored in the memory 210 .
需要说明的是,本实施例的电子设备的实施过程和技术原理参见前述对本公开实施例的图像处理方法的解释说明,此处不再赘述。It should be noted that, for the implementation process and technical principle of the electronic device in this embodiment, reference may be made to the foregoing description of the image processing method in the embodiment of the present disclosure, and details are not repeated here.
本公开所有实施例均可以单独被执行,也可以与其他实施例相结合被执行,均视为本公开要求的保护范围。All the embodiments of the present disclosure can be implemented independently or in combination with other embodiments, which are all regarded as the protection scope required by the present disclosure.
为了实现上述实施例,本公开还提出一种存储介质。In order to realize the above embodiments, the present disclosure also proposes a storage medium.
其中,该存储介质中的指令由电子设备的处理器执行时,使得电子设备能够执行如前所述的图像处理方法。Wherein, when the instructions in the storage medium are executed by the processor of the electronic device, the electronic device can execute the aforementioned image processing method.
为了实现上述实施例,本公开还提供一种计算机程序产品,该计算机程序由电子设备的处理器执行时,使得电子设备能够执行如前所述的图像处理方法。In order to implement the above embodiments, the present disclosure also provides a computer program product, which, when executed by a processor of an electronic device, enables the electronic device to execute the image processing method as described above.
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其它实施方案。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由下面的权利要求指出。Other embodiments of the present disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common general knowledge or techniques in the technical field not disclosed by this disclosure . The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限制。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (22)

  1. 一种图像处理方法,包括:An image processing method, comprising:
    获取针对待处理图像的开始触控点和结束触控点;其中,所述待处理图像包括多个网格和所述多个网格对应的网格点;acquiring a start touch point and an end touch point for the image to be processed; wherein the image to be processed includes multiple grids and grid points corresponding to the multiple grids;
    根据所述开始触控点和所述结束触控点的位置信息确定液化区域;Determine the liquefaction area according to the position information of the start touch point and the end touch point;
    根据所述开始触控点和所述结束触控点的坐标信息、所述液化区域中每个网格点的坐标信息和调整半径确定所述每个网格点的偏移量;其中,所述调整半径用于控制所述每个网格点的偏移程度;The offset of each grid point is determined according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, the The adjustment radius is used to control the offset degree of each grid point;
    根据所述每个网格点的偏移量移动所述每个网格点,得到中间处理图像;以及Moving each grid point according to the offset of each grid point to obtain an intermediate processed image; and
    对所述中间处理图像添加对应纹理信息,以生成目标图像。Corresponding texture information is added to the intermediate processed image to generate a target image.
  2. 根据权利要求1所述的图像处理方法,其中,所述根据所述开始触控点和所述结束触控点的坐标信息、所述液化区域中每个网格点的坐标信息和预设半径确定所述每个网格点的偏移量,包括:The image processing method according to claim 1, wherein the coordinate information of the start touch point and the end touch point, the coordinate information and preset radius of each grid point in the liquefaction area Determine the offset of each grid point, including:
    根据所述开始触控点的坐标信息、所述液化区域中的各个网格点的坐标信息和所述调整半径计算所述每个网格点的偏移强度;其中,所述每个网格点的偏移强度用于表征所述每个网格点的调整幅度大小;The offset strength of each grid point is calculated according to the coordinate information of the starting touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, each grid point The offset strength of the point is used to characterize the adjustment amplitude of each grid point;
    根据所述开始触控点的坐标信息和所述结束触控点的坐标信息计算偏移向量;其中,所述偏移向量的方向为所述开始触控点指向所述结束触控点的方向;An offset vector is calculated according to the coordinate information of the start touch point and the coordinate information of the end touch point; wherein, the direction of the offset vector is the direction in which the start touch point points to the end touch point ;
    根据所述偏移向量和所述偏移强度计算所述液化区域中的每个网格点的偏移量。An offset amount for each grid point in the liquefaction region is calculated based on the offset vector and the offset strength.
  3. 根据权利要求1或2所述的图像处理方法,还包括:The image processing method according to claim 1 or 2, further comprising:
    获取所述待处理图像;obtain the to-be-processed image;
    按照预设步长将所述待处理图像分割成包括多个网格点的待处理图像;其中,所述预设步长与所述待处理图像的像素个数相关。The image to be processed is divided into images to be processed including a plurality of grid points according to a preset step size; wherein the preset step size is related to the number of pixels of the image to be processed.
  4. 根据权利要求1至3中任一项所述的图像处理方法,其中,所述根据所述开始触控点和所述结束触控点确定液化区域,包括:The image processing method according to any one of claims 1 to 3, wherein the determining the liquefaction area according to the start touch point and the end touch point comprises:
    获取所述开始触控点的开始横坐标值和开始纵坐标值,以及获取所述结束触控点的结束横坐标值和结束纵坐标值;obtaining the starting abscissa value and the starting ordinate value of the starting touch point, and obtaining the ending abscissa value and the ending ordinate value of the ending touch point;
    获取所述开始横坐标值和所述结束横坐标值中的最小横坐标值、所述开始纵坐标值所 述结束纵坐标值中的最小纵坐标值分别作为所述液化区域的第一顶点的横纵坐标值;Obtain the minimum abscissa value of the start abscissa value and the end abscissa value, and the minimum ordinate value of the start ordinate value and the end ordinate value, respectively, as the first vertex of the liquefaction region. Horizontal and vertical coordinate values;
    获取所述开始横坐标值和所述结束横坐标值中的最大横坐标值、所述开始纵坐标值和所述结束纵坐标值中的最小纵坐标值分别作为所述液化区域的第二顶点的横纵坐标值;Obtain the maximum abscissa value of the start abscissa value and the end abscissa value, and the minimum ordinate value of the start ordinate value and the end ordinate value as the second vertex of the liquefaction region, respectively The abscissa and ordinate values of ;
    获取所述开始横坐标值和所述结束横坐标值中的最小横坐标值、所述开始纵坐标值和所述结束纵坐标值中的最大纵坐标值分别作为所述液化区域的第三顶点的横纵坐标值;Obtain the minimum abscissa value of the start abscissa value and the end abscissa value, and the maximum ordinate value of the start ordinate value and the end ordinate value as the third vertex of the liquefaction region, respectively The abscissa and ordinate values of ;
    获取所述开始横坐标值和所述结束横坐标值中的最大横坐标值、所述开始纵坐标值所述结束纵坐标值中的最大纵坐标值分别作为所述液化区域的第四顶点的横纵坐标值;Obtain the maximum abscissa value of the start abscissa value and the end abscissa value, and the maximum ordinate value of the start ordinate value and the end ordinate value, respectively, as the fourth vertex of the liquefaction region. Horizontal and vertical coordinate values;
    根据所述第一顶点、所述第二顶点、所述第三顶点和所述第四顶点的横纵坐标值得到所述液化区域。The liquefaction region is obtained according to the abscissa and ordinate values of the first vertex, the second vertex, the third vertex and the fourth vertex.
  5. 根据权利要求2所述的图像处理方法,其中,所述根据所述开始触控点的坐标信息、所述液化区域中的各个网格点的坐标信息和所述调整半径计算每个网格点的偏移强度,包括:The image processing method according to claim 2, wherein the calculating each grid point according to the coordinate information of the starting touch point, the coordinate information of each grid point in the liquefaction area and the adjustment radius offset strength, including:
    计算所述开始触控点和所述液化区域中的各个网格点之间的距离;calculating the distance between the starting touch point and each grid point in the liquefaction region;
    计算每个所述距离与所述调整半径的比值,将所述比值作为所述每个网格点的偏移强度。A ratio of each of the distances to the adjusted radius is calculated, and the ratio is used as the offset strength of each grid point.
  6. 根据权利要求2所述的图像处理方法,其中,所述根据所述偏移向量和所述偏移强度计算所述液化区域中的每个网格点的偏移量,包括:The image processing method according to claim 2, wherein the calculating the offset of each grid point in the liquefaction region according to the offset vector and the offset intensity comprises:
    计算所述偏移向量和所述每个网格点的偏移强度的乘积,将所述乘积作为所述每个网格点的偏移量。The product of the offset vector and the offset strength of each grid point is calculated, and the product is used as the offset amount of each grid point.
  7. 根据权利要求1至6任一项所述的图像处理方法,还包括:The image processing method according to any one of claims 1 to 6, further comprising:
    获取所述距离大于所述调整半径的目标网格点;obtaining the target grid point whose distance is greater than the adjustment radius;
    在所述控制所述每个网格点按照对应的偏移量进行移动的过程中,所述目标网格点的位置不变。During the process of controlling each grid point to move according to the corresponding offset, the position of the target grid point remains unchanged.
  8. 一种图像处理装置,包括:An image processing device, comprising:
    第一获取单元,被配置为获取针对待处理图像的开始触控点和结束触控点;其中,所述待处理图像包括多个网格和所述多个网格对应的网格点;a first acquiring unit, configured to acquire a start touch point and an end touch point for the image to be processed; wherein the image to be processed includes a plurality of grids and grid points corresponding to the plurality of grids;
    确定单元,被配置为根据所述开始触控点和所述结束触控点的位置信息确定液化区域;a determining unit, configured to determine the liquefaction area according to the position information of the start touch point and the end touch point;
    生成单元,被配置为根据所述开始触控点和所述结束触控点的坐标信息、所述液化区 域中每个网格点的坐标信息和调整半径确定所述每个网格点的偏移量;其中,所述调整半径用于控制所述每个网格点的偏移程度;The generating unit is configured to determine the offset of each grid point according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; Shift amount; wherein, the adjustment radius is used to control the offset degree of each grid point;
    控制单元,被配置为根据所述每个网格点的偏移量移动所述每个网格点,得到中间处理图像;以及a control unit configured to move each grid point according to the offset of each grid point to obtain an intermediate processed image; and
    处理单元,被配置为对所述中间处理图像添加对应纹理信息,以生成目标图像。A processing unit configured to add corresponding texture information to the intermediate processed image to generate a target image.
  9. 根据权利要求8所述的图像处理装置,其中,所述生成单元,包括:The image processing apparatus according to claim 8, wherein the generating unit comprises:
    第一计算子单元,被配置为根据所述开始触控点的坐标信息、所述液化区域中的各个网格点的坐标信息和所述调整半径计算所述每个网格点的偏移强度;其中,所述每个网格点的偏移强度用于表征所述每个网格点的调整幅度大小;a first calculation subunit, configured to calculate the offset intensity of each grid point according to the coordinate information of the starting touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius ; Wherein, the offset strength of each grid point is used to characterize the adjustment amplitude of each grid point;
    第二计算子单元,被配置为根据所述开始触控点的坐标信息和所述结束触控点的坐标信息计算偏移向量;其中,所述偏移向量的方向为所述开始触控点指向所述结束触控点的方向;The second calculation subunit is configured to calculate an offset vector according to the coordinate information of the start touch point and the coordinate information of the end touch point; wherein, the direction of the offset vector is the start touch point Point to the direction of the end touch point;
    第三计算子单元,被配置为根据所述偏移向量和所述偏移强度计算所述液化区域中的每个网格点的偏移量。A third calculation subunit is configured to calculate the offset of each grid point in the liquefaction region according to the offset vector and the offset strength.
  10. 根据权利要求8或9所述的图像处理装置,还包括:The image processing device according to claim 8 or 9, further comprising:
    第二获取单元,被配置为获取所述待处理图像;a second acquiring unit, configured to acquire the to-be-processed image;
    分割单元,被配置为按照预设步长将所述待处理图像分割成包括多个网格点的待处理图像;其中,所述预设步长与所述待处理图像的像素个数相关。The dividing unit is configured to divide the image to be processed into images to be processed including a plurality of grid points according to a preset step size; wherein the preset step size is related to the number of pixels of the image to be processed.
  11. 根据权利要求8至10中任一项所述的图像处理装置,其中,所述确定单元,被配置为:The image processing apparatus according to any one of claims 8 to 10, wherein the determining unit is configured to:
    获取所述开始触控点的开始横坐标值和开始纵坐标值,以及获取所述结束触控点的结束横坐标值和结束纵坐标值;obtaining the starting abscissa value and the starting ordinate value of the starting touch point, and obtaining the ending abscissa value and the ending ordinate value of the ending touch point;
    获取所述开始横坐标值和所述结束横坐标值中的最小横坐标值、所述开始纵坐标值所述结束纵坐标值中的最小纵坐标值分别作为所述液化区域的第一顶点的横纵坐标值;Obtain the minimum abscissa value of the start abscissa value and the end abscissa value, and the minimum ordinate value of the start ordinate value and the end ordinate value, respectively, as the first vertex of the liquefaction region. Horizontal and vertical coordinate values;
    获取所述开始横坐标值和所述结束横坐标值中的最大横坐标值、所述开始纵坐标值和所述结束纵坐标值中的最小纵坐标值分别作为所述液化区域的第二顶点的横纵坐标值;Obtain the maximum abscissa value of the start abscissa value and the end abscissa value, and the minimum ordinate value of the start ordinate value and the end ordinate value as the second vertex of the liquefaction region, respectively The abscissa and ordinate values of ;
    获取所述开始横坐标值和所述结束横坐标值中的最小横坐标值、所述开始纵坐标值和所述结束纵坐标值中的最大纵坐标值分别作为所述液化区域的第三顶点的横纵坐标值;Obtain the minimum abscissa value of the start abscissa value and the end abscissa value, and the maximum ordinate value of the start ordinate value and the end ordinate value as the third vertex of the liquefaction region, respectively The abscissa and ordinate values of ;
    获取所述开始横坐标值和所述结束横坐标值中的最大横坐标值、所述开始纵坐标值所 述结束纵坐标值中的最大纵坐标值分别作为所述液化区域的第四顶点的横纵坐标值;Obtain the maximum abscissa value of the start abscissa value and the end abscissa value, and the maximum ordinate value of the start ordinate value and the end ordinate value, respectively, as the fourth vertex of the liquefaction region. Horizontal and vertical coordinate values;
    根据所述第一顶点、所述第二顶点、所述第三顶点和所述第四顶点的横纵坐标值得到所述液化区域。The liquefaction region is obtained according to the abscissa and ordinate values of the first vertex, the second vertex, the third vertex and the fourth vertex.
  12. 根据权利要求9所述的图像处理装置,其中,所述第一计算子单元,被配置为:The image processing apparatus according to claim 9, wherein the first calculation subunit is configured to:
    计算所述开始触控点和所述液化区域中的各个网格点之间的距离;calculating the distance between the starting touch point and each grid point in the liquefaction region;
    计算每个所述距离与所述调整半径的比值,将所述比值作为所述每个网格点的偏移强度。A ratio of each of the distances to the adjusted radius is calculated, and the ratio is used as the offset strength of each grid point.
  13. 根据权利要求9所述的图像处理装置,其中,所述第三计算子单元,被配置为:The image processing apparatus according to claim 9, wherein the third calculation subunit is configured to:
    计算所述偏移向量和所述每个网格点的偏移强度的乘积,将所述乘积作为所述每个网格点的偏移量。The product of the offset vector and the offset strength of each grid point is calculated, and the product is used as the offset amount of each grid point.
  14. 根据权利要求8至13任一项所述的图像处理装置,还包括:The image processing apparatus according to any one of claims 8 to 13, further comprising:
    第三获取单元,被配置为获取所述距离大于所述调整半径的目标网格点;a third acquiring unit, configured to acquire the target grid point whose distance is greater than the adjustment radius;
    维持单元,被配置为在所述控制所述每个网格点按照对应的偏移量进行移动的过程中,所述目标网格点的位置不变。The maintaining unit is configured to keep the position of the target grid point unchanged during the process of controlling each grid point to move according to the corresponding offset.
  15. 一种电子设备,包括:An electronic device comprising:
    处理器;processor;
    用于存储所述处理器可执行指令的存储器;a memory for storing the processor-executable instructions;
    其中,所述处理器被配置为执行所述指令,以实现如下步骤,包括:Wherein, the processor is configured to execute the instructions to implement the following steps, including:
    获取针对待处理图像的开始触控点和结束触控点;其中,所述待处理图像包括多个网格和所述多个网格对应的网格点;acquiring a start touch point and an end touch point for the image to be processed; wherein the image to be processed includes multiple grids and grid points corresponding to the multiple grids;
    根据所述开始触控点和所述结束触控点的位置信息确定液化区域;Determine the liquefaction area according to the position information of the start touch point and the end touch point;
    根据所述开始触控点和所述结束触控点的坐标信息、所述液化区域中每个网格点的坐标信息和调整半径确定所述每个网格点的偏移量;其中,所述调整半径用于控制所述每个网格点的偏移程度;The offset of each grid point is determined according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, the The adjustment radius is used to control the offset degree of each grid point;
    根据所述每个网格点的偏移量移动所述每个网格点,得到中间处理图像;以及Moving each grid point according to the offset of each grid point to obtain an intermediate processed image; and
    对所述中间处理图像添加对应纹理信息,以生成目标图像。Corresponding texture information is added to the intermediate processed image to generate a target image.
  16. 根据权利要求15所述的电子设备,其中,所述处理器被配置为执行所述指令,以 实现根据所述开始触控点和所述结束触控点的坐标信息、所述液化区域中每个网格点的坐标信息和预设半径确定所述每个网格点的偏移量,包括:The electronic device according to claim 15, wherein the processor is configured to execute the instruction to implement, according to the coordinate information of the start touch point and the end touch point, each of the liquefaction regions The coordinate information of each grid point and the preset radius determine the offset of each grid point, including:
    根据所述开始触控点的坐标信息、所述液化区域中的各个网格点的坐标信息和所述调整半径计算所述每个网格点的偏移强度;其中,所述每个网格点的偏移强度用于表征所述每个网格点的调整幅度大小;The offset strength of each grid point is calculated according to the coordinate information of the starting touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, each grid point The offset strength of the point is used to characterize the adjustment amplitude of each grid point;
    根据所述开始触控点的坐标信息和所述结束触控点的坐标信息计算偏移向量;其中,所述偏移向量的方向为所述开始触控点指向所述结束触控点的方向;An offset vector is calculated according to the coordinate information of the start touch point and the coordinate information of the end touch point; wherein, the direction of the offset vector is the direction in which the start touch point points to the end touch point ;
    根据所述偏移向量和所述偏移强度计算所述液化区域中的每个网格点的偏移量。An offset amount for each grid point in the liquefaction region is calculated based on the offset vector and the offset strength.
  17. 根据权利要求15或16所述的电子设备,其中,所述处理器被配置为执行所述指令,以实现如下步骤,还包括:The electronic device of claim 15 or 16, wherein the processor is configured to execute the instructions to implement the steps, further comprising:
    获取所述待处理图像;obtain the to-be-processed image;
    按照预设步长将所述待处理图像分割成包括多个网格点的待处理图像;其中,所述预设步长与所述待处理图像的像素个数相关。The image to be processed is divided into images to be processed including a plurality of grid points according to a preset step size; wherein the preset step size is related to the number of pixels of the image to be processed.
  18. 根据权利要求15至17中任一项所述的电子设备,其中,所述处理器被配置为执行所述指令,以实现根据所述开始触控点和所述结束触控点确定液化区域,包括:The electronic device according to any one of claims 15 to 17, wherein the processor is configured to execute the instructions to achieve determining the liquefaction region according to the start touch point and the end touch point, include:
    获取所述开始触控点的开始横坐标值和开始纵坐标值,以及获取所述结束触控点的结束横坐标值和结束纵坐标值;obtaining the starting abscissa value and the starting ordinate value of the starting touch point, and obtaining the ending abscissa value and the ending ordinate value of the ending touch point;
    获取所述开始横坐标值和所述结束横坐标值中的最小横坐标值、所述开始纵坐标值所述结束纵坐标值中的最小纵坐标值分别作为所述液化区域的第一顶点的横纵坐标值;Obtain the minimum abscissa value of the start abscissa value and the end abscissa value, and the minimum ordinate value of the start ordinate value and the end ordinate value, respectively, as the first vertex of the liquefaction region. Horizontal and vertical coordinate values;
    获取所述开始横坐标值和所述结束横坐标值中的最大横坐标值、所述开始纵坐标值和所述结束纵坐标值中的最小纵坐标值分别作为所述液化区域的第二顶点的横纵坐标值;Obtain the maximum abscissa value of the start abscissa value and the end abscissa value, and the minimum ordinate value of the start ordinate value and the end ordinate value as the second vertex of the liquefaction region, respectively The abscissa and ordinate values of ;
    获取所述开始横坐标值和所述结束横坐标值中的最小横坐标值、所述开始纵坐标值和所述结束纵坐标值中的最大纵坐标值分别作为所述液化区域的第三顶点的横纵坐标值;Obtain the minimum abscissa value of the start abscissa value and the end abscissa value, and the maximum ordinate value of the start ordinate value and the end ordinate value as the third vertex of the liquefaction region, respectively The abscissa and ordinate values of ;
    获取所述开始横坐标值和所述结束横坐标值中的最大横坐标值、所述开始纵坐标值所述结束纵坐标值中的最大纵坐标值分别作为所述液化区域的第四顶点的横纵坐标值;Obtain the maximum abscissa value of the start abscissa value and the end abscissa value, and the maximum ordinate value of the start ordinate value and the end ordinate value, respectively, as the fourth vertex of the liquefaction region. Horizontal and vertical coordinate values;
    根据所述第一顶点、所述第二顶点、所述第三顶点和所述第四顶点的横纵坐标值得到所述液化区域。The liquefaction region is obtained according to the abscissa and ordinate values of the first vertex, the second vertex, the third vertex and the fourth vertex.
  19. 根据权利要求16所述的电子设备,其中,所述处理器被配置为执行所述指令,以实现根据所述开始触控点的坐标信息、所述液化区域中的各个网格点的坐标信息和所述调 整半径计算每个网格点的偏移强度,包括:The electronic device according to claim 16, wherein the processor is configured to execute the instruction to implement the coordinate information of each grid point in the liquefaction region according to the coordinate information of the starting touch point and the adjusted radius to calculate the offset strength for each grid point, including:
    计算所述开始触控点和所述液化区域中的各个网格点之间的距离;calculating the distance between the starting touch point and each grid point in the liquefaction region;
    计算每个所述距离与所述调整半径的比值,将所述比值作为所述每个网格点的偏移强度。A ratio of each of the distances to the adjusted radius is calculated, and the ratio is used as the offset strength of each grid point.
  20. 根据权利要求16所述的电子设备,其中,所述处理器被配置为执行所述指令,以实现根据所述偏移向量和所述偏移强度计算所述液化区域中的每个网格点的偏移量,包括:17. The electronic device of claim 16, wherein the processor is configured to execute the instructions to implement the calculation of each grid point in the liquefaction region based on the offset vector and the offset strength offsets, including:
    计算所述偏移向量和所述每个网格点的偏移强度的乘积,将所述乘积作为所述每个网格点的偏移量。The product of the offset vector and the offset strength of each grid point is calculated, and the product is used as the offset amount of each grid point.
  21. 根据权利要求15至20中任一项所述的电子设备,其中,所述处理器被配置为执行所述指令,以实现如下步骤,还包括:The electronic device of any one of claims 15 to 20, wherein the processor is configured to execute the instructions to implement the steps, further comprising:
    获取所述距离大于所述调整半径的目标网格点;obtaining the target grid point whose distance is greater than the adjustment radius;
    在所述控制所述每个网格点按照对应的偏移量进行移动的过程中,所述目标网格点的位置不变。During the process of controlling each grid point to move according to the corresponding offset, the position of the target grid point remains unchanged.
  22. 一种存储介质,当所述存储介质中的指令由电子设备的处理器执行时,使得所述电子设备能够执行如下步骤,包括:A storage medium, when an instruction in the storage medium is executed by a processor of an electronic device, the electronic device can perform the following steps, including:
    获取针对待处理图像的开始触控点和结束触控点;其中,所述待处理图像包括多个网格和所述多个网格对应的网格点;acquiring a start touch point and an end touch point for the image to be processed; wherein the image to be processed includes a plurality of grids and grid points corresponding to the plurality of grids;
    根据所述开始触控点和所述结束触控点的位置信息确定液化区域;Determine the liquefaction area according to the position information of the start touch point and the end touch point;
    根据所述开始触控点和所述结束触控点的坐标信息、所述液化区域中每个网格点的坐标信息和调整半径确定所述每个网格点的偏移量;其中,所述调整半径用于控制所述每个网格点的偏移程度;The offset of each grid point is determined according to the coordinate information of the start touch point and the end touch point, the coordinate information of each grid point in the liquefaction area, and the adjustment radius; wherein, the The adjustment radius is used to control the offset degree of each grid point;
    根据所述每个网格点的偏移量移动所述每个网格点,得到中间处理图像;以及Move each grid point according to the offset of each grid point to obtain an intermediate processed image; and
    对所述中间处理图像添加对应纹理信息,以生成目标图像。Corresponding texture information is added to the intermediate processed image to generate a target image.
PCT/CN2021/105024 2020-09-23 2021-07-07 Image processing method and device WO2022062570A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011009834.0A CN114296622B (en) 2020-09-23 2020-09-23 Image processing method, device, electronic equipment and storage medium
CN202011009834.0 2020-09-23

Publications (1)

Publication Number Publication Date
WO2022062570A1 true WO2022062570A1 (en) 2022-03-31

Family

ID=80846167

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/105024 WO2022062570A1 (en) 2020-09-23 2021-07-07 Image processing method and device

Country Status (2)

Country Link
CN (1) CN114296622B (en)
WO (1) WO2022062570A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150003681A1 (en) * 2013-06-28 2015-01-01 Canon Kabushiki Kaisha Image processing apparatus and image processing method
CN105279732A (en) * 2015-10-16 2016-01-27 福建天晴数码有限公司 Method and system applied to quick deformation of plane image
CN107977934A (en) * 2017-11-10 2018-05-01 北京小米移动软件有限公司 Image processing method and device
CN109741277A (en) * 2018-12-29 2019-05-10 广州华多网络科技有限公司 Image processing method, device, storage medium and server
CN110223218A (en) * 2019-05-16 2019-09-10 北京达佳互联信息技术有限公司 Face image processing process, device, electronic equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9600713B2 (en) * 2015-04-27 2017-03-21 AprilAge Inc. Identification and processing of facial wrinkles in a digital image
CN110415164A (en) * 2018-04-27 2019-11-05 武汉斗鱼网络科技有限公司 Facial metamorphosis processing method, storage medium, electronic equipment and system
CN109087239B (en) * 2018-07-25 2023-03-21 腾讯科技(深圳)有限公司 Face image processing method and device and storage medium
CN109242765B (en) * 2018-08-31 2023-03-10 腾讯科技(深圳)有限公司 Face image processing method and device and storage medium
CN110502993B (en) * 2019-07-18 2022-03-25 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN111507925B (en) * 2020-04-29 2023-05-12 抖音视界有限公司 Repair processing method, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150003681A1 (en) * 2013-06-28 2015-01-01 Canon Kabushiki Kaisha Image processing apparatus and image processing method
CN105279732A (en) * 2015-10-16 2016-01-27 福建天晴数码有限公司 Method and system applied to quick deformation of plane image
CN107977934A (en) * 2017-11-10 2018-05-01 北京小米移动软件有限公司 Image processing method and device
CN109741277A (en) * 2018-12-29 2019-05-10 广州华多网络科技有限公司 Image processing method, device, storage medium and server
CN110223218A (en) * 2019-05-16 2019-09-10 北京达佳互联信息技术有限公司 Face image processing process, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN114296622B (en) 2023-08-08
CN114296622A (en) 2022-04-08

Similar Documents

Publication Publication Date Title
Kartynnik et al. Real-time facial surface geometry from monocular video on mobile GPUs
TWI752494B (en) Virtual object shaping method, apparatus, device, and storage medium
US9639914B2 (en) Portrait deformation method and apparatus
US10860838B1 (en) Universal facial expression translation and character rendering system
WO2018176958A1 (en) Adaptive mapping method and system depending on movement of key points in image
CN107730578B (en) Rendering method of light environment shielding diagram, and method and equipment for generating effect diagram
JP2018537755A (en) Foveal geometry tessellation
CN111161395B (en) Facial expression tracking method and device and electronic equipment
EP4147209A1 (en) Fast and deep facial deformations
US10109083B2 (en) Local optimization for curvy brush stroke synthesis
US10803660B2 (en) Real-time collision deformation
JP2009535696A (en) Collage generation using occlusion cost calculation
CN108282694B (en) Panoramic video rendering method and device and electronic equipment
CN109151540A (en) The interaction processing method and device of video image
CN105988566B (en) A kind of information processing method and electronic equipment
CN112766027A (en) Image processing method, device, equipment and storage medium
WO2021083133A1 (en) Image processing method and device, equipment and storage medium
CN116977522A (en) Rendering method and device of three-dimensional model, computer equipment and storage medium
US9342912B1 (en) Animation control retargeting
JP6852224B2 (en) Sphere light field rendering method in all viewing angles
WO2022062570A1 (en) Image processing method and device
WO2018140397A1 (en) System for interactive image based game
CN110008873B (en) Facial expression capturing method, system and equipment
US20240062495A1 (en) Deformable neural radiance field for editing facial pose and facial expression in neural 3d scenes
US10656722B2 (en) Sensor system for collecting gestural data in two-dimensional animation

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: 21870949

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21870949

Country of ref document: EP

Kind code of ref document: A1

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

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

122 Ep: pct application non-entry in european phase

Ref document number: 21870949

Country of ref document: EP

Kind code of ref document: A1