CN112150352A - Image processing method and device and electronic equipment - Google Patents

Image processing method and device and electronic equipment Download PDF

Info

Publication number
CN112150352A
CN112150352A CN202011048892.4A CN202011048892A CN112150352A CN 112150352 A CN112150352 A CN 112150352A CN 202011048892 A CN202011048892 A CN 202011048892A CN 112150352 A CN112150352 A CN 112150352A
Authority
CN
China
Prior art keywords
offset
image
data
processed
processing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011048892.4A
Other languages
Chinese (zh)
Inventor
刘俊贤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Huya Technology Co Ltd
Original Assignee
Guangzhou Huya Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huya Technology Co Ltd filed Critical Guangzhou Huya Technology Co Ltd
Priority to CN202011048892.4A priority Critical patent/CN112150352A/en
Publication of CN112150352A publication Critical patent/CN112150352A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/005General purpose rendering architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/18Image warping, e.g. rearranging pixels individually
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • G06V40/169Holistic features and representations, i.e. based on the facial image taken as a whole
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2210/00Indexing scheme for image generation or computer graphics
    • G06T2210/44Morphing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Computer Graphics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Image Processing (AREA)

Abstract

The application provides an image processing method, an image processing device and electronic equipment, wherein the method comprises the following steps: acquiring first outline data of a face outline in an image to be processed; the first outline data comprises the positions of key points of the human face; obtaining first offset data generated on the basis of the first contour data in response to an adjustment operation of a face contour in an image to be processed; the first offset data comprises the offset of each key point in the first outline data; fuzzy processing is carried out on each offset in the first offset data to obtain second offset data; and 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. When the face image is subjected to deformation processing, the offset of each pixel in the deformation processing process is subjected to fuzzy processing, so that abrupt change difference of the pixel offset is reduced, texture mapping can be performed according to the offset after the fuzzy processing, and the problem that the edge of the face image is not smooth is solved.

Description

Image processing method and device and electronic equipment
Technical Field
The present application relates to the field of image processing technologies, and in particular, to an image processing method and apparatus, and an electronic device.
Background
The image beauty technique is a technique for adjusting a photographed face photo image or video image to increase the aesthetic feeling or the taste of the image. Among them, the adjustment of the contour of the face contour is an important component in the beauty function, for example, the enlargement of the eye region, the reduction of the face region, the adjustment of the face shape, and the like.
In some image processing schemes for adjusting the facial contour, the image texture block is subjected to position mapping processing according to the position change of the key points before and after adjustment, so that the image texture block before adjustment is mapped to the adjusted position. However, such an adjustment method easily causes the edge image at the adjustment position to be not smooth enough, and affects the overall image effect.
Disclosure of Invention
To overcome at least one of the deficiencies of the prior art, it is an object of the present application to provide an image processing method comprising:
acquiring first outline data of a face outline in an image to be processed; the first outline data comprises positions of key points of the human face;
obtaining first offset data generated on the basis of the first outline data in response to an adjustment operation for a face outline in the image to be processed; the first offset data comprises an offset of each keypoint in the first outline data;
blurring each offset in the first offset data to obtain second offset data;
and 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.
Optionally, in a possible implementation manner, the step of performing fuzzy processing on each offset in the first offset data to obtain second offset data includes:
increasing a preset adjustment value for each offset in the first offset data to obtain a first mask layout composed of adjusted offsets; the preset adjustment value is a median of a range of values which can be processed when the GPU carries out texture coordinate processing;
performing fuzzy processing on the value in the first masking layout through the GPU to obtain a processed second masking layout;
and reducing the preset adjustment value of each data in the second masking layout to obtain the second offset data.
Optionally, in a possible implementation manner, the preset adjustment value is 0.5.
Optionally, in a possible implementation manner, the step of obtaining first outline data of a face outline in the image to be processed includes:
acquiring an image to be processed;
carrying out facial feature recognition on the image to be processed;
and performing triangulation according to the facial features obtained by identification to obtain the first outline data consisting of triangulation network data.
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:
performing offset processing on the first outline data according to the second offset data to obtain second outline data;
obtaining a plurality of image texture blocks split from the image to be processed according to the first outline data;
and mapping the plurality of image texture blocks to the second outline data to obtain a processed image.
Optionally, in a possible implementation manner, the step of blurring each offset in the first offset data includes:
and performing mean fuzzy processing on each offset in the first offset data.
The present application also provides an image processing apparatus, the apparatus comprising:
the contour acquisition module is used for acquiring first contour data of a face contour in an image to be processed; the first outline data comprises positions of key points of the human face;
a contour adjusting module for obtaining first offset data generated on the basis of the first outline contour data in response to an adjusting operation of a face contour in the image to be processed; the first offset data comprises an offset of each keypoint in the first outline data;
the fuzzy processing module is used for carrying out fuzzy processing on each offset in the first offset data to obtain second offset data;
and the texture mapping module is used for carrying out 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.
Optionally, in a possible implementation manner, the blur processing module is specifically configured to:
increasing a preset adjustment value for each offset in the first offset data to obtain a first mask layout composed of adjusted offsets; the preset adjustment value is a median of a range of values which can be processed when the GPU carries out texture coordinate processing;
performing fuzzy processing on the value in the first masking layout through the GPU to obtain a processed second masking layout;
and reducing the preset adjustment value of each data in the second masking layout to obtain the second offset data.
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 the machine-executable instructions, when executed by the processor, implement the image processing method provided by the present application.
Another object of the present application is to provide a machine-readable storage medium storing machine-executable instructions, which when executed by one or more processors, implement the image processing method provided by the present application.
Compared with the prior art, the embodiment of the application has the following beneficial effects:
according to the image processing method, the image processing device and the electronic equipment, when the face image is subjected to deformation processing, the offset of each pixel in the deformation processing process is subjected to fuzzy processing, abrupt change difference of the pixel offset is reduced, and therefore texture mapping can be performed according to the offset after the fuzzy processing, and the problem that the edge of the face image is not smooth is solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a block diagram of an electronic device according to an embodiment of the present disclosure;
FIG. 2 is a schematic flowchart illustrating steps of an image processing method according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an operation interface provided in an embodiment of the present application;
FIG. 4 is a schematic diagram of grid data provided by an embodiment of the present application;
fig. 5 is a schematic diagram of functional modules of an image processing apparatus according to an embodiment of the present application.
Icon: 100-an electronic device; 110-an image processing device; 111-a contour acquisition module; 112-profile adjustment module; 113-a blur processing module; 114-texture mapping module; 120-a machine-readable storage medium; 130-a processor.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures.
In the description of the present application, it is noted that the terms "first", "second", "third", and the like are used merely for distinguishing between descriptions and are not intended to indicate or imply relative importance.
In the description of the present application, it is further noted that, unless expressly stated or limited otherwise, the terms "disposed," "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art.
In some schemes for performing contour adjustment on a face image, a mesh of a face contour is usually constructed according to key points of the face in the face image to be processed. On the basis, the contour of the face is adjusted, so that the grids are changed to a certain extent, the adjusted grids are obtained, and the adjusted offset of each grid is determined. And then the image texture blocks in the original grids are transformed and mapped into new grids, so that the adjustment of the human face contour is realized.
However, through extensive research by the inventors, it has been found that when the adjustment range is relatively large, the mesh of the face edge may be disordered, and the adjusted image edge may not be smooth enough, or the image may be broken.
In view of the above-mentioned problems, the present embodiment provides an image processing method, an image processing apparatus, and an electronic device, which can reduce the problem that the image edge is not smooth enough when the contour of the face image is adjusted, and the scheme provided by the present embodiment is described in detail below.
The embodiment provides an electronic device capable of processing an image. In one possible implementation manner, the electronic device may be a user terminal, for example, the electronic device may be a smart phone, a tablet computer, a personal computer, or the like.
The electronic device may have an image capture component (e.g., a camera); or a data interface capable of communicating with the image acquisition component so as to acquire the image acquired by the image acquisition component. The electronic device may further have a component capable of Processing an image, such as a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), and the like, so as to execute the image Processing method provided by the present embodiment.
In another possible implementation manner, the electronic device may also be a server capable of communicating with the user terminal. The server can acquire photo or video data sent by the user terminal, process images in the photo or video data, and send the processed images to the user terminal or other user terminals.
Referring to fig. 1, fig. 1 is a block diagram of an electronic device 100. The electronic device 100 may include an image processing apparatus 110, a machine-readable storage medium 120, and a processor 130. The processing 130 may include a central processing unit CPU and/or a graphics processing unit GPU, among others.
The machine-readable storage medium 120 and the processor 130 are electrically connected to each other, directly or indirectly, to enable transmission or interaction of data. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The image processing apparatus 110 includes at least one software function module which may be stored in the form of software or firmware (firmware) in the machine-readable storage medium 120 or solidified in an Operating System (OS) of the electronic device 100. The processor 130 is configured to execute executable modules stored in the machine-readable storage medium 120, such as software functional modules and computer programs included in the image processing apparatus 110.
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 Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like. The machine-readable storage medium 120 is used for storing a program, and the processor 130 executes the program after receiving an execution instruction.
Referring to fig. 2, fig. 2 is a flowchart illustrating an image processing method applied to the electronic device 100 shown in fig. 1, and the method including various steps will be described in detail below.
Step S110, acquiring first outline data of a face outline in an image to be processed; the first contour data includes locations of key points of a face.
In this embodiment, the electronic device 100 may acquire the image to be processed through its own image capturing component, or may acquire the image to be processed through communication with another image capturing component or another terminal device.
After the to-be-processed image is obtained, the electronic device 100 may perform facial feature recognition on the to-be-processed image, and obtain first outline data of a face outline according to facial feature information. The first outline data may include position information of a plurality of face key points in the face image.
Step S120, in response to the adjustment operation on the face contour in the image to be processed, obtaining first offset data generated on the basis of the first outline contour data. Wherein the first offset data comprises an offset of each keypoint in the first outline data.
In this embodiment, an adjustment operation on the contour of the face in the image to be processed may cause positions of some key points in the first outline data to change, and the electronic device 100 may acquire, as the first offset data, an offset amount of each key point in the first outline data due to the adjustment operation.
Step S130, performing a blurring process on each offset in the first offset data to obtain second offset data.
In this embodiment, the electronic device 100 may perform a blurring process on each offset amount in the first offset data, where the blurring process may include adjusting a value of a target offset amount according to values of other offset amounts near the target offset amount, so as to reduce a difference between the target offset amount and the other offset amounts around the target offset amount.
Step S140, 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.
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, where the offset mapping processing includes performing deformation and position mapping on the image texture block according to the second offset data, so as to obtain an image composed of the image texture blocks after the offset mapping processing.
Based on the above processing manner, the image processing method provided in this embodiment reduces the amount of abrupt shift caused by the adjustment operation of the face contour by performing the blurring processing on the first shift data, so that the image texture of the face edge can be smoother when performing the image texture block mapping according to the second shift data obtained after the processing.
Optionally, in some possible implementations, the electronic device 100 may provide one or more preset adjustment templates for the user, and then obtain an adjustment degree parameter selected by the user based on the selected adjustment template.
For example, taking the electronic device 100 as a mobile terminal as an example, referring to fig. 3, the electronic device 100 may provide a plurality of adjustment templates, such as "face thinning," "hairline," "face thinning," "cheekbone thinning," and provide a dragging bar for acquiring an adjustment degree selected by a user. After the user selects an adjustment template through a click operation and selects an adjustment degree through a drag operation, the electronic device 100 may adjust the first outline data based on the adjustment template and the adjustment degree to obtain the first offset data.
In other possible implementations, the electronic device 100 may obtain an adjustment operation directly performed by the user with respect to the first outline data.
For example, the electronic device 100 may display the image to be processed on an image interface, acquire operations such as clicking and dragging performed on the image to be processed by a user, and adjust first outline profile data corresponding to the image to be processed according to a dragging position, a dragging distance, a clicking position, the number of times of clicking and the like, so as to obtain the first offset data.
Optionally, in some possible implementations, the first contour data may be triangulation data obtained according to a triangulation algorithm (Delaunay triangulation algorithm).
For example, in step S110, an image to be processed may be acquired, facial feature recognition may be performed on the image to be processed, and edges of each facial feature, such as edges of a cheek, eyes, a forehead and a nose, may be determined.
Then, according to the edge of each facial feature, the whole face image is triangulated by using a triangulation algorithm, and a triangular mesh corresponding to the face image is obtained, as shown in fig. 4. And recording the fixed point position of each triangle in the triangular mesh as the first outline data.
Accordingly, the first offset data may include an offset of each triangle vertex of the triangular mesh after performing the adjustment operation.
The second offset data may be obtained by performing offset processing on the first outline profile data based on the second offset data. For example, the second offset data may include data of positions of vertices of triangles in a new triangular mesh after the triangular mesh is adjusted according to the second offset data.
Optionally, in some possible implementations, the to-be-processed image may be split into a plurality of image texture blocks according to the triangular mesh, and when the image texture blocks in the to-be-processed image are subjected to offset mapping processing according to the second outline data, the plurality of image texture blocks split according to the first outline data may be mapped to positions indicated by the second outline data according to a correspondence relationship between each triangle in the first outline data and the second outline data, so as to obtain the processed image.
For example, for a certain texture block on the image to be processed, after the outline data is subjected to the offset processing, the shape and/or position of the triangle corresponding to the texture block in the outline number may be changed. When mapping the texture block, the texture block may be deformed to fit the shape of the texture block with the shape of the deformed triangle, and then the texture block may be mapped to the position indicated by the deformed triangle according to the vertex position of the deformed triangle. The plurality of texture blocks after the deformation and the position steganography are performed constitute the whole processed image.
It should be noted that, in this embodiment, the first outline data may also be in other data forms, such as a quadrilateral subdivision algorithm.
Optionally, in some possible implementations, the act of blurring the first offset data may be performed by a GPU in the electronic device 100. In addition, the action of performing the 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 the GPU in the electronic device 100.
In this case, the first offset data is subjected to some preprocessing according to the data processing range of the GPU and then to the blurring processing.
Typically, the offset is often recorded as the length of the positive or negative offset in the horizontal and vertical directions, e.g., an offset (0.3, -0.2) characterizes a positive movement of 0.3 in the horizontal direction and a negative movement of 0.2 in the vertical direction.
However, when the GPU processes the texture coordinates, the numerical processing range is 0 to a positive number, so in this embodiment, each offset in the first offset data may be increased by a preset adjustment value, and the first mask layout composed of adjusted offsets is obtained. The preset adjustment value is a median of a range of values that can be processed by the graphics processing unit GPU when texture coordinate processing is performed. Therefore, the offset after the preset adjusting value is increased can reflect the offset degrees in different directions within a positive number range.
And then, carrying out fuzzy processing on the values in the first masking layout through the graphics processor to obtain a processed second masking layout.
And then reducing the preset adjustment value of each data in the second mask layout to obtain second offset data.
Taking image processing based on an Open Graphics Library (OpenGL) as an example, in OpenGL, a deformation mapping relation of a texture image is processed in a texture coordinate system with a value range of [0, 1], where the size of a texture image block is also 1 × 1.
Therefore, in step S120, each value in the first offset data may be increased by 0.5 to obtain the first mask layout. For example, the position coordinates of a certain key point in the first outline data are (0.2, 0.3), and the shifted position of the key point is (0.3, 0.2), i.e., the key point is shifted to the lower right corner. By calculating the position difference before and after the shift, the shift amount corresponding to the key point in the first shift data can be determined to be (0.1, -0.1). Then, in the first mask layout, the value corresponding to the offset is (0.5+0.1, 0.5-0.1).
And then, carrying out fuzzy processing on the values in the first masking layout to obtain a processed second masking layout. And then reducing the preset adjustment value of each data in the second mask layout, and recovering the data into offset data to obtain the second offset data. For example, the coordinates of a certain target point in the first outline data are (0.2, 0.3), the value in the second mask layout corresponding to the target point is (0.6, 0.4), the offset corresponding to the second data is (0.6-0.5, 0.4-0.5), and the coordinates of the target point in the second outline data after offset are (0.2+0.1, 0.3-0.1).
In this way, the GPU can be enabled to process the blurring of the first offset data, so that the image processing method provided by the embodiment can be run on the electronic device 100, such as a mobile terminal, and perform real-time image processing by the GPU.
Optionally, in some possible implementations, the blurring process may be a mean blurring process. That is, the value of a certain target offset amount is adjusted to the average value of the target offset amount and a plurality of other offset amounts around the target offset amount.
It should be noted that, in this embodiment, the blurring processing may also include other processing manners that can be executed by the GPU, for example, gaussian blurring.
Referring to fig. 5, the present embodiment further provides an image processing apparatus 110 applied to the electronic device 100 shown in fig. 1, where the image processing apparatus 110 includes:
the contour acquisition module 111 is configured to acquire first contour data of a face contour in an image to be processed; the first contour data includes locations of key points of a face.
In this embodiment, the contour obtaining module 111 may be configured to execute step S110 shown in fig. 2, and for a detailed description of the contour obtaining module 111, reference may be made to the description of step S110.
The contour adjusting module 112 is configured to obtain first offset data generated on the basis of the first outline contour data in response to an adjusting operation on a face contour in the image to be processed; the first offset data includes an offset for each keypoint in the first outline data.
In this embodiment, the contour adjusting module 112 may be configured to perform step S120 shown in fig. 2, and the detailed description about the contour adjusting module 112 may refer to the description about step S120.
The blurring module 113 is configured to perform blurring processing on each offset in the first offset data to obtain second offset data.
In this embodiment, the blur processing module 113 may be configured to execute step S130 shown in fig. 2, and for a detailed description of the blur processing module 113, reference may be made to the description of step S130.
The texture mapping module 114 is configured to perform offset mapping processing on an image texture block in the image to be processed according to the second offset data, so as to obtain a processed image.
In this embodiment, the texture mapping module 114 can be configured to execute the step S140 shown in fig. 2, and the detailed description about the texture mapping module 114 can refer to the description about the step S140.
Optionally, in some possible implementations, the blur processing module 113 is specifically configured to:
increasing a preset adjustment value for each offset in the first offset data to obtain a first mask layout composed of adjusted offsets; the preset adjustment value is a median of a range of values which can be processed when the GPU carries out texture coordinate processing;
performing fuzzy processing on the value in the first masking layout through the GPU to obtain a processed second masking layout;
and reducing the preset adjustment value of each data in the second masking layout to obtain the second offset data.
In summary, the present application provides a method, an apparatus, an electronic device and a storage medium for beautifying a human body. The electronic equipment determines a local area corresponding to a body part in the figure image through the determined key point in the figure image area; and adjusting the occupied range in the image to be processed based on the preset beautifying mode and the beautifying parameters, thereby achieving the purpose of beautifying the image of the specific body part of the target person.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the 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.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only for various embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of changes or substitutions within the technical scope of the present application, and all such changes or substitutions are included in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. An image processing method, characterized in that the method comprises:
acquiring first outline data of a face outline in an image to be processed; the first outline data comprises positions of key points of the human face;
obtaining first offset data generated on the basis of the first outline data in response to an adjustment operation for a face outline in the image to be processed; the first offset data comprises an offset of each keypoint in the first outline data;
blurring each offset in the first offset data to obtain second offset data;
and 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.
2. The method of claim 1, wherein the step of blurring each of the offsets in the first offset data to obtain second offset data comprises:
increasing a preset adjustment value for each offset in the first offset data to obtain a first mask layout composed of adjusted offsets; the preset adjustment value is a median of a range of values which can be processed when the GPU carries out texture coordinate processing;
fuzzy processing is carried out on the values in the first masking layout through the GPU to obtain a processed second masking layout;
and reducing the preset adjustment value of each data in the second masking layout to obtain the second offset data.
3. The method of claim 2, wherein the preset adjustment value is 0.5.
4. The method of claim 1, wherein the step of obtaining first contour data of the face contour in the image to be processed comprises:
acquiring an image to be processed;
carrying out facial feature recognition on the image to be processed;
and performing triangulation according to the facial features obtained by identification to obtain the first outline data consisting of triangulation network data.
5. The method according to claim 4, wherein 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 the processed image comprises:
performing offset processing on the first outline data according to the second offset data to obtain second outline data;
obtaining a plurality of image texture blocks split from the image to be processed according to the first outline data;
and mapping the plurality of image texture blocks to the second outline data to obtain a processed image.
6. The method of claim 1, wherein the step of blurring each of the offset values in the first offset data comprises:
and performing mean fuzzy processing on each offset in the first offset data.
7. An image processing apparatus, characterized in that the apparatus comprises:
the contour acquisition module is used for acquiring first contour data of a face contour in an image to be processed; the first outline data comprises positions of key points of the human face;
a contour adjusting module for obtaining first offset data generated on the basis of the first outline contour data in response to an adjusting operation of a face contour in the image to be processed; the first offset data comprises an offset of each keypoint in the first outline data;
the fuzzy processing module is used for carrying out fuzzy processing on each offset in the first offset data to obtain second offset data;
and the texture mapping module is used for carrying out 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.
8. The apparatus of claim 7, wherein the blur processing module is specifically configured to:
increasing a preset adjustment value for each offset in the first offset data to obtain a first mask layout composed of adjusted offsets; the preset adjustment value is a median of a range of values which can be processed when the GPU carries out texture coordinate processing;
performing fuzzy processing on the value in the first masking layout through the GPU to obtain a processed second masking layout;
and reducing the preset adjustment value of each data in the second masking layout to obtain the second offset data.
9. An electronic device comprising a machine-readable storage medium and a processor, the machine-readable storage medium having stored thereon machine-executable instructions that, when executed by the processor, implement the method of any of claims 1-6.
10. A machine-readable storage medium having stored thereon machine-executable instructions which, when executed by one or more processors, perform the method of any one of claims 1-6.
CN202011048892.4A 2020-09-29 2020-09-29 Image processing method and device and electronic equipment Pending CN112150352A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011048892.4A CN112150352A (en) 2020-09-29 2020-09-29 Image processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011048892.4A CN112150352A (en) 2020-09-29 2020-09-29 Image processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN112150352A true CN112150352A (en) 2020-12-29

Family

ID=73895289

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011048892.4A Pending CN112150352A (en) 2020-09-29 2020-09-29 Image processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN112150352A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114339398A (en) * 2021-12-24 2022-04-12 天翼视讯传媒有限公司 Method for real-time special effect processing in large-scale video live broadcast

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110049351A (en) * 2019-05-23 2019-07-23 北京百度网讯科技有限公司 The method and apparatus of Facial metamorphosis, electronic equipment, computer-readable medium in video flowing
CN110119722A (en) * 2019-05-17 2019-08-13 北京字节跳动网络技术有限公司 Method and apparatus for generating information
CN110175558A (en) * 2019-05-24 2019-08-27 北京达佳互联信息技术有限公司 A kind of detection method of face key point, calculates equipment and storage medium at device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110119722A (en) * 2019-05-17 2019-08-13 北京字节跳动网络技术有限公司 Method and apparatus for generating information
CN110049351A (en) * 2019-05-23 2019-07-23 北京百度网讯科技有限公司 The method and apparatus of Facial metamorphosis, electronic equipment, computer-readable medium in video flowing
CN110175558A (en) * 2019-05-24 2019-08-27 北京达佳互联信息技术有限公司 A kind of detection method of face key point, calculates equipment and storage medium at device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
崔馨方: ""关于人脸关键点检测的若干问题研究"", 《硕士电子期刊》, 15 May 2020 (2020-05-15) *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114339398A (en) * 2021-12-24 2022-04-12 天翼视讯传媒有限公司 Method for real-time special effect processing in large-scale video live broadcast

Similar Documents

Publication Publication Date Title
US11514593B2 (en) Method and device for image processing
US11043011B2 (en) Image processing method, apparatus, terminal, and storage medium for fusing images of two objects
US9547908B1 (en) Feature mask determination for images
WO2022078041A1 (en) Occlusion detection model training method and facial image beautification method
CN106846241B (en) Image fusion method, device and equipment
CN107507216B (en) Method and device for replacing local area in image and storage medium
CN107507217B (en) Method and device for making certificate photo and storage medium
CN107610202B (en) Face image replacement method, device and storage medium
CN107564080B (en) Face image replacement system
KR20190129947A (en) Methods and apparatus for determining facial image quality, electronic devices and computer storage media
CN111008935B (en) Face image enhancement method, device, system and storage medium
CN110503704B (en) Method and device for constructing three-dimensional graph and electronic equipment
CN113962306A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN115439615B (en) Distributed integrated management system based on three-dimensional BIM
CN111680573B (en) Face recognition method, device, electronic equipment and storage medium
CN111047619B (en) Face image processing method and device and readable storage medium
CN112150352A (en) Image processing method and device and electronic equipment
CN113379623A (en) Image processing method, image processing device, electronic equipment and storage medium
CN113435367A (en) Social distance evaluation method and device and storage medium
CN112507766B (en) Face image extraction method, storage medium and terminal equipment
CN111652807B (en) Eye adjusting and live broadcasting method and device, electronic equipment and storage medium
CN114529962A (en) Image feature processing method and device, electronic equipment and storage medium
CN113628144B (en) Portrait restoration method and device, electronic equipment and storage medium
CN111612712B (en) Face correction degree determination method, device, equipment and medium
CN114610150A (en) Image processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination