WO2022062570A1 - Image processing method and device - Google Patents
Image processing method and device Download PDFInfo
- 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
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 32
- 238000012545 processing Methods 0.000 claims abstract description 63
- 238000000034 method Methods 0.000 claims description 19
- 238000004364 calculation method Methods 0.000 claims description 12
- 230000008569 process Effects 0.000 claims description 9
- 230000000694 effects Effects 0.000 abstract description 13
- 230000037237 body shape Effects 0.000 abstract 2
- 230000003796 beauty Effects 0.000 description 38
- 238000010586 diagram Methods 0.000 description 11
- 230000008859 change Effects 0.000 description 10
- 230000006870 function Effects 0.000 description 6
- 238000004590 computer program Methods 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000011218 segmentation Effects 0.000 description 2
- 238000007493 shaping process Methods 0.000 description 2
- 241001465754 Metazoa Species 0.000 description 1
- 230000001133 acceleration Effects 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction 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/04845—Interaction 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
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy 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
Description
Claims (22)
- 一种图像处理方法,包括: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.
- 根据权利要求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.
- 根据权利要求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.
- 根据权利要求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.
- 根据权利要求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.
- 根据权利要求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.
- 根据权利要求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.
- 一种图像处理装置,包括: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.
- 根据权利要求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.
- 根据权利要求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.
- 根据权利要求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.
- 根据权利要求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.
- 根据权利要求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.
- 根据权利要求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.
- 一种电子设备,包括: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.
- 根据权利要求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.
- 根据权利要求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.
- 根据权利要求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.
- 根据权利要求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.
- 根据权利要求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.
- 根据权利要求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.
- 一种存储介质,当所述存储介质中的指令由电子设备的处理器执行时,使得所述电子设备能够执行如下步骤,包括: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.
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)
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)
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 |
-
2020
- 2020-09-23 CN CN202011009834.0A patent/CN114296622B/en active Active
-
2021
- 2021-07-07 WO PCT/CN2021/105024 patent/WO2022062570A1/en active Application Filing
Patent Citations (5)
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 |