Image processing method and device, readable medium and electronic equipment
By extracting and adjusting the human posture map and combining the image processing model, the problem of only style conversion of the face of the character in the existing technology is solved, and the deformation processing of the whole body of the character is realized, and the flexibility of image special effects is expanded.
Patent Information
- Application Number
- CN202310659743.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-05
- Publication Date
- 2024-12-06
AI Technical Summary
The existing technology can only convert the face of the character, but cannot convert the whole body of the character, limiting the flexibility of image special effects.
By obtaining images containing faces and body parts, extracting human posture maps, performing proportional adjustments, and using image processing models combined with pose constraints to generate target images, thereby realizing deformation processing of the whole body of the character.
It realizes the full body deformation of the characters in the image, such as turning adults into babies or giants, expanding the flexibility of image special effects gameplay.
Smart Images

Figure CN119090704A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular, to an image processing method, device, readable medium and electronic device. Background Art
[0002] With the advancement of computer technology, special effects processing of images can be performed based on image algorithms and rendering technologies. Through special effects processing, the style of the image in the original photo can be transformed to obtain a person image of another style, for example, an adult photo can be changed into a child style or baby style photo. However, in the related technology, only the face of the person can be styled. Summary of the invention
[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method, the method comprising:
[0005] Acquire a first image to be processed; the first image includes a face part and a body part;
[0006] Acquire a first human body posture graph in the first image;
[0007] Adjusting the proportion of the first human posture graph to obtain a second human posture graph;
[0008] According to the first image and the second human posture graph, a target image is acquired through an image processing model; the second human posture graph is a posture constraint condition of the image processing model.
[0009] According to a second aspect of an embodiment of the present disclosure, there is provided an image processing apparatus, the apparatus comprising:
[0010] A first acquisition module, used to acquire a first image to be processed; the first image includes a face part and a body part;
[0011] A second acquisition module, used to acquire a first human body posture graph in the first image;
[0012] A first processing module, configured to adjust the proportion of the first human posture graph to obtain a second human posture graph;
[0013] The second processing module is used to obtain a target image through an image processing model according to the first image and the second human posture map; the second human posture map is a posture constraint condition of the image processing model.
[0014] According to a third aspect of an embodiment of the present disclosure, a computer-readable medium is provided, on which a computer program is stored, and when the computer program is executed by a processing device, the steps of the method described in the first aspect of the present disclosure are implemented.
[0015] According to a fourth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:
[0016] a storage device having a computer program stored thereon;
[0017] A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect of the present disclosure.
[0018] By adopting the above technical solution, a first image to be processed is obtained, a first human posture graph in the first image is obtained, the first human posture graph is proportionally adjusted to obtain a second human posture graph, and a target image is obtained through an image processing model according to the first image and the second human posture graph; wherein the second human posture graph is a posture constraint condition of the image processing model, and the first image includes a human face part and a human body part. In this way, the whole body deformation of the characters in the image can be achieved, for example, an adult image can be changed into a baby effect image, or an ordinary person image can be changed into a giant effect image, so as to achieve a more flexible image special effects gameplay.
[0019] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:
[0021] Figure 1 The figure is a flowchart of an image processing method according to an exemplary embodiment.
[0022] Figure 2 The figure is a schematic diagram showing a method of processing a character image according to an exemplary embodiment.
[0023] Figure 3 It is a schematic diagram of a human body posture graph according to an exemplary embodiment.
[0024] Figure 4 is based on Figure 1 The illustrated embodiment shows a flow chart of step S104.
[0025] Figure 5 The figure is a schematic diagram showing another method of processing a character image according to an exemplary embodiment.
[0026] Figure 6 The figure is a schematic diagram showing another method of processing a character image according to an exemplary embodiment.
[0027] Figure 7 is a block diagram of an image processing apparatus according to an exemplary embodiment.
[0028] Figure 8 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION
[0029] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0030] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0031] The term "including" and its variations used in the present disclosure are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0032] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0033] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise clearly indicated in the context, they should be understood as "one or more". In the description of the present disclosure, unless otherwise specified, "multiple" refers to two or more than two, and other quantifiers are similar; "at least one item", "one or more items" or similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one item a can represent any number of a; for another example, one or more items of a, b and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple; "and / or" is a kind of association relationship that describes the associated objects, indicating that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character “ / ” indicates that the preceding and following objects are in an “or” relationship. The singular forms “a”, “an”, “an”, “said” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise.
[0034] Although operations or steps are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood that it is required to perform these operations or steps in the specific order shown or in a serial order, or to perform all the operations or steps shown to obtain the desired results. In the embodiments of the present disclosure, these operations or steps can be performed in series; these operations or steps can also be performed in parallel; or some of these operations or steps can be performed.
[0035] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0036] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0037] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0038] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0039] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0040] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0041] The present disclosure is described below in conjunction with specific embodiments.
[0042] Figure 1 is a flowchart of an image processing method according to an exemplary embodiment. The method can be applied to electronic devices, which may include terminal devices, such as smart phones, smart wearable devices, smart speakers, smart tablets, PDAs (Personal Digital Assistants), CPEs (Customer Premise Equipment), personal computers, vehicle-mounted terminals, etc.; the electronic devices may also include servers, such as local servers or cloud servers. Figure 1 As shown, the method may include:
[0043] S101: Acquire a first image to be processed.
[0044] The first image includes a face part and a body part.
[0045] For example, the first image may be one or more photos of a person, and the first image may include the facial part and body part of the person. The first image may also be one or more frames of pictures in a video containing the facial part and body part of the person.
[0046] It should be noted that the body part may be the entire body or a part of the body of the person. For example, part or all of the feet or legs of the person may be outside the first image, that is, not included in the first image, and part or all of the hands or arms of the person may also be outside the first image.
[0047] S102: Acquire a first human body posture graph in a first image.
[0048] For example, the first human body posture graph may be a human body posture graph corresponding to a person in the first image.
[0049] In some embodiments, the first human posture image may include multiple human key points and multiple skeleton lines, and the human key points may include key points of the head area and key points of the body area. The skeleton line may be a line between any two key points, and the skeleton line may be a straight line or a curve. The human posture of the person in the image may be displayed through the human key points and the skeleton lines.
[0050] For example, the skeleton line may include one or more of eye lines, nose lines, mouth lines, cervical vertebrae lines, head contour lines, elbow lines, shoulder lines, wrist lines, hand lines, knee lines, hip lines, foot lines and the like.
[0051] In other embodiments, the human body posture graph may include the above-mentioned multiple human body key points, and the human body key points may include key points in the head area and key points in the body area. The human body posture of the person in the image can be displayed through the human body key points.
[0052] In some other embodiments, the human body posture diagram may include the above-mentioned multiple skeleton lines. The human body posture of the person in the image can also be displayed through the skeleton lines.
[0053] In some embodiments, human key points may be extracted from the first image based on a human key point extraction algorithm. For example, key points may be extracted from the person in the first image to obtain the above-mentioned multiple human key points, and multiple skeleton lines may be determined based on the multiple human key points.
[0054] For example, the first image can be input into a key point extraction model to obtain a plurality of human key points output by the key point extraction model. The key point extraction model can be a model obtained by training a preset neural network model based on sample images marked with real key points.
[0055] In other embodiments, a preset stylization process may be first performed on the facial part in the first image to obtain a deformed image; then key points of the person in the deformed image may be extracted to obtain a first human body posture diagram.
[0056] Figure 2 FIG. 1 is a schematic diagram showing a method of processing a character image according to an exemplary embodiment. Figure 2 As shown, picture 201 is the original image, that is, the first image mentioned above, picture 202 is the deformed image obtained after the face part in the first image is subjected to preset stylization processing, and picture 203 is the first human body posture diagram obtained after key points of the person in the deformed image are extracted.
[0057] In one implementation, the first image may be input into a first stylized model to obtain a deformed image, wherein the first stylized model may be used to perform a preset stylized process on a facial part in the first image, thereby outputting a deformed image.
[0058] Optionally, the first stylization model may be a Generative Adversarial Networks (GAN) model or other neural network models for stylizing human faces. The Generative Adversarial Network model may be a deep learning model, which may include a generative model and a discriminative model, and generates accurate output through mutual game learning between the generative model and the discriminative model.
[0059] Optionally, the first stylized model may be a baby-style generative adversarial network model. The facial part in the first image may be subjected to baby-style processing to obtain a baby-style facial image.
[0060] Furthermore, the deformed image can be input into a key point extraction model to obtain a plurality of human key points output by the key point extraction model, and a plurality of skeleton lines can be determined based on the plurality of human key points, thereby obtaining a first human posture graph. Similarly, the key point extraction model can be a model obtained by training a preset neural network model based on sample images marked with real key points.
[0061] S103: Adjust the proportion of the first human body posture graph to obtain a second human body posture graph.
[0062] For example, the first human body posture graph may be scaled according to a preset scaling parameter to obtain a second human body posture graph.
[0063] The preset zoom parameter may be a parameter preset by the user. For example, the preset zoom parameter may be a fixed parameter preset based on manual experience. For another example, multiple first zoom parameters may be preset based on manual experience, and the user may select one from the multiple first zoom parameters as the preset zoom parameter according to needs.
[0064] Figure 3 is a schematic diagram of a human posture graph according to an exemplary embodiment. Figure 3 As shown, picture 203 is the first human body posture diagram, and picture 204 is the second human body posture diagram obtained by scaling the first human body posture diagram.
[0065] In some embodiments, the preset scaling parameter may be a preset shrinking parameter, so that the first human posture graph is shrunk according to the preset shrinking parameter to obtain a second human posture graph. The first human posture graph may be an adult human posture graph, which may also be referred to as an adult skeleton graph; the second human posture graph obtained after the shrinking process may be a child human posture graph, which may also be referred to as a child skeleton graph.
[0066] In other embodiments, the preset scaling parameter may be a preset magnification parameter, so that the first human posture diagram is magnified according to the preset magnification parameter to obtain a second human posture diagram. For example, the first human posture diagram may be a human posture diagram of a child, which may also be referred to as a child skeleton diagram; the second human posture diagram obtained after the shrinking process may be a human posture diagram of an adult, which may also be referred to as an adult skeleton diagram. For another example, the first human posture diagram may be a human posture diagram of an ordinary person, which may also be referred to as an ordinary person skeleton diagram; the second human posture diagram obtained after the shrinking process may be a human posture diagram of a giant, which may also be referred to as a giant skeleton diagram.
[0067] In some embodiments, the preset scaling parameters may include a scaling ratio corresponding to each skeleton line, each skeleton line may be set with its own scaling ratio, and the scaling ratios of different skeleton lines may be the same or different. In this way, the human body posture diagram may be adjusted more flexibly, thereby making the processed image more vivid.
[0068] In other embodiments, the preset scaling parameter may be a parameter, and the scaling ratio corresponding to each skeleton line is determined by the parameter, that is, the scaling ratios corresponding to different skeleton lines are the same. In this way, the ratios of various parts of the human body posture diagram can be kept consistent.
[0069] S104: Acquire a target image through an image processing model according to the first image and the second human posture image.
[0070] The second human posture graph is a posture constraint condition of the image processing model.
[0071] The image processing model may be a diffusion model based on the posture condition ControlNet control, or other neural network models for image processing. The image processing model may be pre-generated based on training samples.
[0072] In some embodiments, the first image and the second posture image may be directly input into an image processing model to obtain a target image output by the image processing model.
[0073] In other embodiments, the first image may be preprocessed based on the first human posture map and the second human posture map to obtain a second image; the second image and the second human posture map may be input into an image processing model to obtain a target image output by the image processing model.
[0074] The image preprocessing may include at least one of image deformation processing, cropping processing and edge blurring processing.
[0075] For example, according to the first human posture graph and the second human posture graph, the first image may be deformed to obtain a first preprocessed image; and the first preprocessed image may be cropped and / or edge blurred to obtain a second image.
[0076] By adopting the above method, a first image to be processed and a first human posture graph in the first image are obtained, the first human posture graph is proportionally adjusted to obtain a second human posture graph, and a target image is obtained through an image processing model according to the first image and the second human posture graph; wherein the second human posture graph is a posture constraint condition of the image processing model. In this way, the whole body deformation of the characters in the image can be achieved, for example, an adult image can be changed into a baby effect image, or an ordinary person image can be changed into a giant effect image, so as to achieve a more flexible image special effects gameplay.
[0077] Figure 4 is based on Figure 1 The embodiment shown is a flow chart of step S104. Figure 4 As shown, the above step S104 may include the following sub-steps:
[0078] S1041. Perform image deformation processing on the first image according to the first human posture graph and the second human posture graph to obtain a first preprocessed image.
[0079] For example, various parts of the person in the first image may be scaled according to the ratio of the skeleton lines of the first human posture graph and the second human posture graph, so that the person in the first preprocessed image can be matched with the second human posture graph.
[0080] In this way, the human body posture diagram (that is, the human skeleton) can be used to achieve proportional adaptation of character deformation (for example, an adult becomes a baby).
[0081] S1042: Perform cropping and / or edge blurring processing on the first preprocessed image to obtain a second image.
[0082] For example, a human body edge region in the first pre-processed image may be determined, and the first pre-processed image may be cropped and / or edge blurred according to the human body edge region to obtain the second image.
[0083] In one implementation, the first preprocessed image may be subjected to edge blurring processing to obtain a second preprocessed image, and then the second preprocessed image may be subjected to edge cropping processing to obtain a second image.
[0084] In this way, the edge area caused by deformation can be eliminated by blurring and cropping.
[0085] Figure 5 FIG. 1 is a schematic diagram showing another method of processing a character image according to an exemplary embodiment. Figure 5 As shown, picture 201 is the first image, picture 205 is the second pre-processed image obtained by deforming the first image according to the first human posture diagram and the second human posture diagram and performing edge blurring, and picture 206 is the second image obtained by edge cropping the second pre-processed image. It should be noted that the first image can be deformed to obtain the first pre-processed image, and the first pre-processed image can be blurred to obtain the second pre-processed image, and the first pre-processed image is not shown in the drawings.
[0086] In some embodiments, the human body edge region may be the upper, lower, left, and right edge regions of the human body. Alternatively, the human body edge region may be the region where the human body in the first image intersects with the image edge of the first image. Figure 5 In the lower area of the picture 201 (ie, the first image), the legs or feet of the person intersect with the image edge of the first image, and the intersecting area can be used as the edge area of the human body.
[0087] S1043: Input the second image and the second human body posture diagram into the image processing model to obtain a target image output by the image processing model.
[0088] It should be noted that the second image may also be referred to as a rough image, which is an image that has undergone preliminary preprocessing. The rough image may be further processed through an image processing model to obtain a more realistic target image.
[0089] Figure 6 FIG. 1 is a schematic diagram showing another method of processing a character image according to an exemplary embodiment. Figure 6 As shown, picture 206 is the second image, picture 204 is the second human posture diagram, and the second image and the second human posture diagram are input into the image processing model 301 to obtain the target image 209 output by the image processing model 301. In this way, the final full-body deformation effect diagram can be generated.
[0090] It should be noted that the target image output by the image processing model may be one or more. For example, for a second image and a second human posture graph, the image processing model may output multiple target images of different styles.
[0091] By adopting the above method, a first image to be processed and a first human posture graph in the first image are obtained, the first human posture graph is proportionally adjusted to obtain a second human posture graph, and a target image is obtained through an image processing model according to the first image and the second human posture graph; wherein the second human posture graph is a posture constraint condition of the image processing model. In this way, the whole body deformation of the characters in the image can be achieved, for example, an adult image can be changed into a baby effect image, or an ordinary person image can be changed into a giant effect image, so as to achieve a more flexible image special effects gameplay.
[0092] Figure 7 is a block diagram of an image processing apparatus 1100 according to an exemplary embodiment. Figure 7 As shown, the device 1100 may include:
[0093] A first acquisition module 1101 is used to acquire a first image to be processed; the first image includes a face part and a body part of a person;
[0094] A second acquisition module 1102 is used to acquire a first human body posture diagram in the first image;
[0095] A first processing module 1103 is used to adjust the proportion of the first human posture graph to obtain a second human posture graph;
[0096] The second processing module 1104 is used to obtain a target image through a pre-generated image processing model according to the first image and the second human posture graph; the second human posture graph is a posture constraint condition of the image processing model.
[0097] In some embodiments, the second processing module 1104 is used to perform image deformation processing on the first image according to the first human posture map and the second human posture map to obtain a first preprocessed image; perform cropping processing and / or edge blurring processing on the first preprocessed image to obtain a second image; and input the second image and the second human posture map into an image processing model to obtain a target image output by the image processing model.
[0098] In some embodiments, the second processing module 1104 is used to determine a human body edge region in the first pre-processed image; and perform cropping and / or edge blurring processing on the first pre-processed image according to the human body edge region to obtain a second image.
[0099] In some embodiments, the first human body posture graph includes a plurality of human body key points and a plurality of skeleton lines, and the human body key points include key points of the human face and key points of the body.
[0100] In some embodiments, the first processing module 1103 is used to scale the first human posture image according to preset scaling parameters to obtain the second human posture image; the preset scaling parameters include the scaling ratio corresponding to each of the skeleton lines.
[0101] In some embodiments, the second acquisition module 1102 is used to perform preset stylization processing on the facial part in the first image to obtain a deformed image; and extract key points of the person in the deformed image to obtain the first human body posture map.
[0102] In some embodiments, the second acquisition module 1102 is used to input the first image into a first stylized model to obtain the deformed image; the first stylized model is used to perform a preset stylized processing on the facial part in the first image.
[0103] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0104] Reference below Figure 8 , which shows a schematic diagram of the structure of an electronic device 2000 (e.g., a terminal device or a server) suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The server in the embodiment of the present disclosure may include, but is not limited to, local servers, cloud servers, single servers, distributed servers, etc. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0105] like Figure 8As shown, the electronic device 2000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 2001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 2002 or a program loaded from a storage device 2008 into a random access memory (RAM) 2003. In the RAM 2003, various programs and data required for the operation of the electronic device 2000 are also stored. The processing device 2001, the ROM 2002, and the RAM 2003 are connected to each other via a bus 2004. An input / output (I / O) interface 2005 is also connected to the bus 2004.
[0106] Typically, the following devices may be connected to the input / output interface 2005: an input device 2006 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 2007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 2008 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 2009. The communication device 2009 may allow the electronic device 2000 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 2000 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0107] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 2009, or installed from the storage device 2008, or installed from the ROM 2002. When the computer program is executed by the processing device 2001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0108] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. Computer-readable storage media may include, but are not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0109] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0110] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0111] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: obtains a first image to be processed; the first image includes facial parts and body parts of a person; obtains a first human posture map corresponding to the person in the first image; wherein the first human posture map includes multiple human key points and multiple skeleton lines, and the human key points include key points of the facial parts and key points of the body parts; scales the first human posture map to obtain a second human posture map; and according to the first image and the second human posture map, obtains a target image through a pre-generated image processing model; the second human posture map is a posture constraint condition of the image processing model.
[0112] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0113] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession 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 square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0114] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module does not limit the module itself in some cases. For example, the first acquisition module may also be described as a "module for acquiring a first image to be processed".
[0115] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0116] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0117] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0118] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0119] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Claims
1. An image processing method, characterized in that: The method comprises: Acquire a first image to be processed; the first image includes a face part and a body part; Acquire a first human body posture graph in the first image; Adjusting the proportion of the first human posture graph to obtain a second human posture graph; According to the first image and the second human posture graph, a target image is acquired through an image processing model; the second human posture graph is a posture constraint condition of the image processing model.
2. The method according to claim 1, characterized in that: The acquiring a target image through an image processing model according to the first image and the second human posture graph comprises: According to the first human posture graph and the second human posture graph, performing image deformation processing on the first image to obtain a first preprocessed image; Performing cropping and / or edge blurring processing on the first preprocessed image to obtain a second image; The second image and the second human posture graph are input into an image processing model to obtain a target image output by the image processing model.
3. The method according to claim 2, characterized in that Performing cropping and / or edge blurring on the first preprocessed image to obtain a second image includes: Determining a human body edge region in the first preprocessed image; The first pre-processed image is cropped and / or edge blurred according to the human body edge area to obtain a second image.
4. The method according to any one of claims 1 to 3, characterized in that The first human body posture graph includes a plurality of human body key points and a plurality of skeleton lines, wherein the human body key points include key points of the human face and key points of the human body.
5. The method according to claim 4, characterized in that The first human posture graph is proportionally adjusted to obtain a second human posture graph, comprising: The first human posture image is scaled according to preset scaling parameters to obtain the second human posture image; the preset scaling parameters include a scaling ratio corresponding to each of the skeleton lines.
6. The method according to any one of claims 1 to 3, characterized in that The obtaining of a first human posture graph corresponding to the person in the first image comprises: Performing a preset stylization process on the facial part in the first image to obtain a deformed image; Key points of the person in the deformed image are extracted to obtain the first human body posture graph.
7. The method according to claim 6, characterized in that The performing a preset stylization process on the facial part in the first image to obtain a deformed image comprises: The first image is input into a first stylized model to obtain the deformed image; the first stylized model is used to perform a preset stylized processing on the facial part in the first image.
8. An image processing device, characterized in that: The device comprises: A first acquisition module, used to acquire a first image to be processed; the first image includes a face part and a body part; A second acquisition module, used to acquire a first human body posture graph in the first image; A first processing module, configured to adjust the proportion of the first human posture graph to obtain a second human posture graph; The second processing module is used to obtain a target image through an image processing model according to the first image and the second human posture map; the second human posture map is a posture constraint condition of the image processing model.
9. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 7 are implemented.
10. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 7.
