Image processing method, device and electronic equipment
By blurring the offset data in facial image processing technology, the problem of uneven image edges is solved and better image processing effects are achieved.
Patent Information
- Application Number
- CN202011048892.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-29
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2040-09-29
AI Technical Summary
When adjusting the facial profile, the prior art can easily lead to the image edge being not smooth enough, affecting the overall image effect.
By obtaining the first shape contour data of the person's face outline in the image to be processed, the first offset data is obtained in response to the adjustment operation. The texture block is shifted and mapping.
The sudden difference in pixel offset is reduced, resulting in smoother edges of the face image and improved image processing effect.
Smart Images

Figure CN112150352B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to an image processing method, device and electronic device. Background Art
[0002] Image beautification technology is a technology that adjusts and processes facial photos or video images to increase the beauty or interest of the image. Among them, the adjustment of facial contours is an important part of the beautification function, for example, enlarging the eye area, reducing the face area, adjusting the face shape, etc.
[0003] In some image processing solutions for facial shape adjustment, the image texture blocks are mapped according to the position changes of key points before and after the adjustment, so as to map the image texture blocks before the adjustment to the position after the adjustment. However, this adjustment method easily leads to the image being not smooth enough at the edge of the adjustment position, affecting the overall image effect. Summary of the invention
[0004] In order to overcome at least one of the shortcomings of the prior art, the purpose of the present application includes providing an image processing method, the method comprising:
[0005] Acquire first outline data of a face outline in the image to be processed; the first outline data includes positions of key points of the face;
[0006] In response to the adjustment operation of the face contour in the image to be processed, obtaining first offset data generated on the basis of the first contour data; the first offset data includes the offset of each key point in the first contour data;
[0007] Performing fuzzy processing on each of the offsets in the first offset data to obtain second offset data;
[0008] An offset mapping process is performed on the image texture block in the image to be processed according to the second offset data to obtain a processed image.
[0009] Optionally, in a possible implementation manner, the step of performing blur processing on each of the offsets in the first offset data to obtain the second offset data includes:
[0010] Adding a preset adjustment value to each offset in the first offset data to obtain a first mask image composed of adjusted offsets; the preset adjustment value is the median of a processable value range when a graphics processor GPU performs texture coordinate processing;
[0011] Performing blur processing on the values in the first mask image by the graphics processor GPU to obtain a processed second mask image;
[0012] The preset adjustment value is reduced by each data in the second mask image to obtain the second offset data.
[0013] Optionally, in a possible implementation manner, the preset adjustment value is 0.5.
[0014] Optionally, in a possible implementation, the step of obtaining first outline data of a face outline in the image to be processed includes:
[0015] Get the image to be processed;
[0016] Performing facial feature recognition on the image to be processed;
[0017] The facial features obtained by recognition are triangulated to obtain the first appearance contour data composed of triangulated network data.
[0018] Optionally, in a possible implementation manner, the step of performing offset mapping processing on the image texture block in the image to be processed according to the second offset data to obtain a processed image includes:
[0019] Performing an offset process on the first shape contour data according to the second offset data to obtain second shape contour data;
[0020] Obtaining a plurality of image texture blocks split from the image to be processed according to the first shape contour data;
[0021] A plurality of image texture blocks are mapped to the second contour data to obtain a processed image.
[0022] Optionally, in a possible implementation manner, the step of performing blurring processing on each of the offsets in the first offset data includes:
[0023] A mean fuzzy process is performed on each of the offsets in the first offset data.
[0024] The present application also provides an image processing device, the device comprising:
[0025] A contour acquisition module, used to acquire first outline data of a face outline in an image to be processed; the first outline data includes positions of key points of the face;
[0026] A contour adjustment module, configured to obtain first offset data generated on the basis of the first contour data in response to an adjustment operation on the contour of the human face in the image to be processed; the first offset data includes an offset of each key point in the first contour data;
[0027] A fuzzy processing module, used for performing fuzzy processing on each of the offsets in the first offset data to obtain second offset data;
[0028] The texture mapping module is used to perform offset mapping processing on the image texture block in the image to be processed according to the second offset data to obtain a processed image.
[0029] Optionally, in a possible implementation manner, the fuzzy processing module is specifically used to:
[0030] Adding a preset adjustment value to each offset in the first offset data to obtain a first mask image composed of adjusted offsets; the preset adjustment value is the median of a processable value range when a graphics processor GPU performs texture coordinate processing;
[0031] Performing blur processing on the values in the first mask image by the graphics processor GPU to obtain a processed second mask image;
[0032] The preset adjustment value is reduced by each data in the second mask image to obtain the second offset data.
[0033] Another object of the present application is to provide an electronic device, which includes a machine-readable storage medium and a processor, wherein the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are executed by the processor, the image processing method provided by the present application is implemented.
[0034] Another object of the present application is to provide a machine-readable storage medium storing machine-executable instructions. The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are executed by one or more processors, the image processing method provided by the present application is implemented.
[0035] Compared with the prior art, the embodiments of the present application include the following beneficial effects:
[0036] The image processing method, device and electronic device provided in the embodiments of the present application reduce the sudden difference in pixel offset by blurring the offset of each pixel in the deformation process when deforming the facial image, so that texture mapping can be performed according to the offset after blurring to reduce the problem of uneven edges of the facial image. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0038] Figure 1 A block diagram of an electronic device provided in an embodiment of the present application;
[0039] Figure 2 A schematic diagram of the steps of the image processing method provided in the embodiment of the present application;
[0040] Figure 3 A schematic diagram of an operation interface provided in an embodiment of the present application;
[0041] Figure 4 A schematic diagram of grid data provided in an embodiment of the present application;
[0042] Figure 5 A schematic diagram of the functional modules of the image processing device provided in an embodiment of the present application.
[0043] Icons: 100 - electronic device; 110 - image processing device; 111 - contour acquisition module; 112 - contour adjustment module; 113 - blur processing module; 114 - texture mapping module; 120 - machine-readable storage medium; 130 - processor. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0045] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0046] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0047] In the description of the present application, it should be noted that the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0048] In the description of this application, it should also be noted that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0049] In some schemes for adjusting the contour of a face image, a mesh of the face contour is usually constructed first based on the facial key points in the face image to be processed. On this basis, the face contour is adjusted, resulting in a certain change in the mesh, and the adjusted mesh is obtained, and the offset of each mesh adjustment is determined. Then, the image texture blocks in the original meshes are deformed and mapped to the new meshes, thereby achieving the adjustment of the face contour.
[0050] However, after extensive research, the inventors found that using this adjustment method, when the adjustment range is relatively large, may cause the mesh at the edge of the face to become disordered, resulting in the edge of the adjusted image not being smooth enough, or the image having faults, etc.
[0051] In view of the discovery of the above problems, the present embodiment provides an image processing method, device and electronic device, which can reduce the problem of unclear image edge smoothness when adjusting the facial image contour. The solution provided by the present embodiment is described in detail below.
[0052] This embodiment provides an electronic device capable of processing an image. In a possible implementation, the electronic device may be a user terminal, for example, a smart phone, a tablet computer, a personal computer, etc.
[0053] The electronic device may have an image acquisition component (e.g., a camera); or a data interface capable of communicating with the image acquisition component, thereby acquiring an image acquired by the image acquisition component. The electronic device may also have a component capable of processing an image, such as a central processing unit (CPU), a graphics processing unit (GPU), etc., thereby executing the image processing method provided in this embodiment.
[0054] In another possible implementation, the electronic device may also be a server capable of communicating with a user terminal. The server may obtain photo or video data sent by the user terminal, process the image in the photo or video data, and send the processed image to the user terminal or other user terminals.
[0055] Please refer to Figure 1 , Figure 1 A block diagram of the electronic device 100. The electronic device 100 may include an image processing device 110, a machine-readable storage medium 120, and a processor 130. The processor 130 may include a central processing unit (CPU) and / or a graphics processing unit (GPU).
[0056] The machine-readable storage medium 120 and the processor 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these elements can be electrically connected to each other via one or more communication buses or signal lines. The image processing device 110 includes at least one software function module that can be stored in the machine-readable storage medium 120 in the form of software or firmware or solidified in the operating system (OS) of the electronic device 100. The processor 130 is used to execute the executable modules stored in the machine-readable storage medium 120, such as the software function modules and computer programs included in the image processing device 110.
[0057] The machine-readable storage medium 120 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The machine-readable storage medium 120 is used to store a program, and the processor 130 executes the program after receiving an execution instruction.
[0058] Please refer to Figure 2 , Figure 2 For application Figure 1 A flowchart of an image processing method of the electronic device 100 is shown, and the various steps of the method will be described in detail below.
[0059] Step S110, obtaining first outline data of a face outline in the image to be processed; the first outline data includes positions of key points of the face.
[0060] In this embodiment, the electronic device 100 can obtain the image to be processed through its own image acquisition component, or obtain the image to be processed by communicating with other image acquisition components or other terminal devices.
[0061] After acquiring the image to be processed, the electronic device 100 can perform facial feature recognition on the image to be processed and acquire first contour data of the face contour according to the facial feature information. The first contour data can include position information of multiple facial key points in the facial image.
[0062] Step S120, in response to the adjustment operation of the face contour in the image to be processed, obtaining first offset data generated based on the first contour data, wherein the first offset data includes the offset of each key point in the first contour data.
[0063] In this embodiment, the adjustment operation on the facial contour in the image to be processed may cause some key positions in the first shape contour data to change, and the electronic device 100 can obtain the offset of each key point in the first shape contour data caused by the adjustment operation as the first offset data.
[0064] Step S130: performing fuzzy processing on each of the offsets in the first offset data to obtain second offset data.
[0065] In this embodiment, the electronic device 100 can perform fuzzy processing on each offset in the first offset data, and the fuzzy processing can include adjusting the value of the target offset according to the values of other offsets near a certain target offset, thereby reducing the numerical difference between the target offset and other offsets around the target offset.
[0066] Step S140: performing an offset mapping process on the image texture block in the image to be processed according to the second offset data to obtain a processed image.
[0067] In this embodiment, the electronic device 100 performs offset mapping processing on the image texture block in the image to be processed according to the adjusted second offset data, and the offset mapping processing includes deforming and position mapping the image texture block according to the second offset data, thereby obtaining an image composed of the image texture blocks after the offset mapping processing.
[0068] Based on the above processing method, the image processing method provided in this embodiment reduces the sudden offset caused by the adjustment operation of the face contour by blurring the first offset data, so that when the image texture block mapping is performed according to the second offset data obtained after processing, the image texture of the face edge can be smoother.
[0069] Optionally, in some possible implementations, the electronic device 100 may provide one or more preset adjustment templates for the user, and then obtain the adjustment degree parameter selected by the user based on the selected adjustment template.
[0070] For example, taking the electronic device 100 as a mobile terminal, please refer to Figure 3 , the electronic device 100 can provide the user with a variety of adjustment templates such as "thin face", "hairline", "slim face", "thin cheekbones", etc., and provide a drag bar for obtaining the adjustment degree selected by the user. After the user selects the adjustment template by clicking and selects the adjustment degree by dragging, the electronic device 100 can adjust the first shape contour data based on the adjustment template and the adjustment degree to obtain the first offset data.
[0071] In some other possible implementations, the electronic device 100 may obtain an adjustment operation directly performed by the user on the first appearance contour data.
[0072] For example, the electronic device 100 can display the image to be processed on an image interface, and obtain click, drag and other operations performed by the user on the image to be processed, and adjust the first outline contour data corresponding to the image to be processed according to the drag position, drag distance, click position, number of clicks, etc., to obtain the first offset data.
[0073] Optionally, in some possible implementations, the first outline data may be triangular mesh data obtained according to a Delaunay triangulation algorithm.
[0074] For example, in step S110, an image to be processed may be first acquired, and facial feature recognition may be performed on the image to be processed to determine the edges of various facial features, such as the edges of cheeks, eyes, forehead, and nose.
[0075] Then, according to the edges of each facial feature, the triangulation algorithm is used to triangulate the entire face image to obtain the triangular mesh corresponding to the face image, such as Figure 4 And record the fixed point position of each triangle in the triangular mesh as the first shape contour data.
[0076] Accordingly, the first offset data may include the offset of each triangle vertex of the triangular mesh after performing the adjustment operation.
[0077] The second offset data may be obtained by performing an offset process on the first contour data according to the second offset data. For example, the second offset data may include position data of each triangle vertex in a new triangle mesh after the triangle mesh is adjusted according to the second offset data.
[0078] Optionally, in some possible implementations, the image to be processed can be split into multiple image texture blocks according to the triangular mesh. When the image texture blocks in the image to be processed are offset mapped according to the second outer contour data, the multiple image texture blocks split according to the first outer contour data can be respectively mapped to the positions indicated by the second outer contour data according to the correspondence between each triangle in the first outer contour data and the second outer contour data, so as to obtain a processed image.
[0079] For example, for a certain texture block on the image to be processed, after the shape contour data is offset, the triangle corresponding to the texture block in the shape contour data may change in shape and / or position. Then, when mapping the texture block, the texture block may be deformed first so that the shape of the texture block matches the shape of the deformed triangle, and then, according to the vertex position of the deformed triangle, the texture block is mapped to the position indicated by the deformed triangle. Multiple texture blocks that have been deformed and positionally mapped constitute the entire processed image.
[0080] It should be noted that, in this embodiment, the first outline data may also be in other data forms, such as a quadrilateral decomposition algorithm.
[0081] Optionally, in some possible implementations, the action of blurring the first offset data may be performed by a GPU in the electronic device 100. In addition, the action of performing offset mapping processing on the image texture block in the image to be processed according to the second offset data may also be performed by a GPU in the electronic device 100.
[0082] In this case, according to the data processing range of the GPU, some preprocessing needs to be performed on the first offset data before the blurring process is performed.
[0083] Typically, the offset is often recorded as the length of a positive or negative offset in the horizontal and vertical directions. For example, an offset (0.3, -0.2) represents a positive shift of 0.3 in the horizontal direction and a negative shift of 0.2 in the vertical direction.
[0084] When a GPU processes texture coordinates, the numerical processing range is usually from 0 to a positive number. Therefore, in this embodiment, each offset in the first offset data can be increased by a preset adjustment value to obtain a first mask image composed of adjusted offsets. The preset adjustment value is the median of the numerical range that can be processed when the graphics processor GPU processes texture coordinates. In this way, the offset after increasing the preset adjustment value can reflect the degree of offset in different directions within the positive range.
[0085] Next, the graphics processor performs fuzzy processing on the values in the first mask image to obtain a processed second mask image.
[0086] Then, each data in the second mask image is reduced by the preset adjustment value to obtain the second offset data.
[0087] Taking image processing based on the Open Graphics Library (OpenGL) as an example, in OpenGL, the deformation mapping relationship of the texture image is processed in a texture coordinate system with a numerical range of [0, 1], wherein the size of the texture image block is also 1*1.
[0088] Therefore, in step S120, each value in the first offset data can be increased by 0.5 to obtain the first mask map. For example, the position coordinates of a key point in the first contour data are (0.2, 0.3), and the position of the key point after offset is (0.3, 0.2), that is, offset to the lower right corner. By calculating the position difference before and after the offset, it can be determined that the offset corresponding to the key point in the first offset data is (0.1, -0.1). Then in the first mask map, the value corresponding to the offset is (0.5+0.1, 0.5-0.1).
[0089] Next, the values in the first mask image are blurred to obtain a processed second mask image. Then, each data in the second mask image is reduced by the preset adjustment value to restore the offset data to obtain the second offset data. For example, the coordinates of a target point in the first contour data are (0.2, 0.3), and the value of the target point in the second mask image is (0.6, 0.4), then the corresponding offset in the second data is (0.6-0.5, 0.4-0.5), then the coordinates of the target point in the second contour data after the offset are (0.2+0.1, 0.3-0.1).
[0090] Through the above-mentioned method, the GPU can process the blurring of the first offset data, so that the image processing method provided in this embodiment can be run on the electronic device 100 such as a mobile terminal, and perform real-time image processing through the GPU.
[0091] Optionally, in some possible implementations, the fuzzy processing may be mean fuzzy processing, that is, the value of a certain target offset is adjusted to the average value of the target offset and a plurality of other offsets around it.
[0092] It should be noted that, in this embodiment, the blur processing may also include other processing methods that can be executed by the GPU, such as Gaussian blur.
[0093] Please refer to Figure 5 This embodiment also provides a method for applying Figure 1 The image processing device 110 of the electronic device 100 shown in FIG. 1 includes:
[0094] The contour acquisition module 111 is used to acquire first contour data of a face contour in an image to be processed; the first contour data includes positions of key points of the face.
[0095] In this embodiment, the contour acquisition module 111 can be used to perform Figure 2 As shown in step S110 , for a detailed description of the contour acquisition module 111 , please refer to the description of step S110 .
[0096] The contour adjustment module 112 is used to obtain first offset data generated based on the first shape contour data in response to the adjustment operation on the face contour in the image to be processed; the first offset data includes the offset of each key point in the first shape contour data.
[0097] In this embodiment, the profile adjustment module 112 may be used to perform Figure 2 As shown in step S120 , for a detailed description of the contour adjustment module 112 , please refer to the description of step S120 .
[0098] The fuzzy processing module 113 is used to perform fuzzy processing on each of the offsets in the first offset data to obtain second offset data.
[0099] In this embodiment, the fuzzy processing module 113 can be used to perform Figure 2 As shown in step S130 , for a detailed description of the fuzzy processing module 113 , please refer to the description of step S130 .
[0100] The texture mapping module 114 is used to perform an offset mapping process on the image texture block in the image to be processed according to the second offset data to obtain a processed image.
[0101] In this embodiment, the texture mapping module 114 can be used to perform Figure 2As shown in step S140 , for a detailed description of the texture mapping module 114 , please refer to the description of step S140 .
[0102] Optionally, in some possible implementations, the fuzzy processing module 113 is specifically used to:
[0103] Adding a preset adjustment value to each offset in the first offset data to obtain a first mask image composed of adjusted offsets; the preset adjustment value is the median of a processable value range when a graphics processor GPU performs texture coordinate processing;
[0104] Performing blur processing on the values in the first mask image by the graphics processor GPU to obtain a processed second mask image;
[0105] The preset adjustment value is reduced by each data in the second mask image to obtain the second offset data.
[0106] In summary, the present application provides a human body beautification method, device, electronic device and storage medium. The electronic device determines the local area corresponding to the body part in the human image through the key points determined in the human image area; and adjusts the range occupied in the image to be processed based on the preset beautification method and beautification parameters, thereby achieving the purpose of beautifying the image of the specific body part of the target person.
[0107] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0108] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0109] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0110] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0111] The above are only various implementations of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire first outline data of a face outline in the image to be processed; the first outline data includes positions of key points of the face; In response to the adjustment operation of the face contour in the image to be processed, obtaining first offset data generated on the basis of the first contour data; the first offset data includes the offset of each key point in the first contour data; Performing fuzzy processing on each of the offsets in the first offset data to obtain second offset data; comprising: increasing each of the offsets in the first offset data by a preset adjustment value to obtain a first mask map composed of adjusted offsets; the preset adjustment value is the median of a processable value range when a graphics processor (GPU) performs texture coordinate processing; performing fuzzy processing on the values in the first mask map by the GPU to obtain a processed second mask map; reducing each of the data in the second mask map by the preset adjustment value to obtain the second offset data; An offset mapping process is performed on the image texture block in the image to be processed according to the second offset data to obtain a processed image.
2. The method according to claim 1, characterized in that The preset adjustment value is 0.
5.
3. The method according to claim 1, characterized in that The step of obtaining first outline data of a face outline in the image to be processed comprises: Get the image to be processed; Performing facial feature recognition on the image to be processed; The facial features obtained by recognition are triangulated to obtain the first appearance contour data composed of triangulated network data.
4. The method according to claim 3, characterized in that The step of performing offset mapping processing on the image texture block in the image to be processed according to the second offset data to obtain a processed image comprises: Performing an offset process on the first shape contour data according to the second offset data to obtain second shape contour data; Obtaining a plurality of image texture blocks split from the image to be processed according to the first shape contour data; A plurality of image texture blocks are mapped to the second contour data to obtain a processed image.
5. The method according to claim 1, characterized in that The step of performing blur processing on each of the offsets in the first offset data comprises: A mean fuzzy process is performed on each of the offsets in the first offset data.
6. An image processing device, characterized in that: The device comprises: A contour acquisition module, used to acquire first outline data of a face outline in an image to be processed; the first outline data includes positions of key points of the face; A contour adjustment module, configured to obtain first offset data generated on the basis of the first contour data in response to an adjustment operation on the contour of the human face in the image to be processed; the first offset data includes an offset of each key point in the first contour data; A fuzzy processing module, used for performing fuzzy processing on each of the offsets in the first offset data to obtain second offset data; A texture mapping module, configured to perform an offset mapping process on an image texture block in the image to be processed according to the second offset data to obtain a processed image; The fuzzy processing module is specifically used for: Adding a preset adjustment value to each offset in the first offset data to obtain a first mask image composed of adjusted offsets; the preset adjustment value is the median of a processable value range when a graphics processor GPU performs texture coordinate processing; Performing blur processing on the values in the first mask image by the graphics processor GPU to obtain a processed second mask image; The preset adjustment value is reduced by each data in the second mask image to obtain the second offset data.
7. An electronic device, characterized in that: The electronic device includes a machine-readable storage medium and a processor, wherein the machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are executed by the processor, the method described in any one of claims 1 to 5 is implemented.
8. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions, and when the machine-executable instructions are executed by one or more processors, the method described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Method and device for face deformation in video stream, electronic equipment and computer readable medium
CN110049351A
Method and device for generating information
CN110119722A