WO2024251082A1 - 图像处理方法、装置、可读介质及电子设备 - Google Patents
图像处理方法、装置、可读介质及电子设备 Download PDFInfo
- Publication number
- WO2024251082A1 WO2024251082A1 PCT/CN2024/097046 CN2024097046W WO2024251082A1 WO 2024251082 A1 WO2024251082 A1 WO 2024251082A1 CN 2024097046 W CN2024097046 W CN 2024097046W WO 2024251082 A1 WO2024251082 A1 WO 2024251082A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- human
- graph
- posture graph
- posture
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/103—Static body considered as a whole, e.g. static pedestrian or occupant recognition
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/04—Context-preserving transformations, e.g. by using an importance map
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/18—Image warping, e.g. rearranging pixels individually
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V40/00—Recognition of biometric, human-related or animal-related patterns in image or video data
- G06V40/10—Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
- G06V40/16—Human faces, e.g. facial parts, sketches or expressions
- G06V40/168—Feature extraction; Face representation
- G06V40/171—Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships
Definitions
- the present disclosure relates to the field of computer technology, and in particular, to an image processing method, device, readable medium and electronic device.
- special effects processing of images can be performed based on image algorithms and rendering technologies.
- the style of the tasks in the original photos can be converted to obtain character images of another style. For example, adult photos can be changed into child-style or baby-style photos.
- an image processing method comprising:
- the first image includes a face part and a body part
- 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.
- an image processing apparatus comprising:
- a first acquisition module is configured to acquire a first image to be processed; the first image includes a face part and a body part;
- a second acquisition module is configured to acquire a first human body posture graph in the first image
- a first processing module is configured to adjust the proportion of the first human posture graph to obtain a second human posture graph
- the second processing module is configured to obtain a target image through an 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.
- a computer-readable medium on which a computer program and/or instructions are stored.
- the steps of the method described in the first aspect of the present disclosure are implemented.
- an electronic device including:
- the processing device is configured to execute the computer program and/or instructions in the storage device to implement the steps of the method described in the first aspect of the present disclosure.
- a computer program product comprising instructions, which, when executed by a processor, enable the processor to implement the steps of the method described in the first aspect of the present disclosure.
- a computer program comprising program code, which, when executed by a processor, causes the steps of the method described in the first aspect of the present disclosure to be implemented.
- Fig. 1 is a flow chart showing an image processing method according to an exemplary embodiment.
- Fig. 2 is a schematic diagram showing a method of processing a character image according to an exemplary embodiment.
- Fig. 3 is a schematic diagram of a human posture graph according to an exemplary embodiment.
- FIG. 4 is a flow chart showing step S104 according to the embodiment shown in FIG. 1 .
- Fig. 5 is a schematic diagram showing another method of processing a character image according to an exemplary embodiment.
- Fig. 6 is a schematic diagram showing another method of processing a character image according to an exemplary embodiment.
- Fig. 7 is a block diagram showing an image processing apparatus according to an exemplary embodiment.
- Fig. 8 is a block diagram of an electronic device according to an exemplary embodiment.
- At least one item (item) a can represent any number of a; for another example, one or more items (items) of a, b and c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c can be single or multiple; "and/or” is a description of the association relationship of associated objects, indicating that three relationships can exist, 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 associated objects before and after are in an "or” relationship.
- the singular forms "a”, “an”, “an item”, “said” and “the” are also intended to include plural forms, unless the context clearly indicates other meanings.
- 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.
- 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.
- the prompt information in response to receiving an active request from the user, 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.
- 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.
- FIG1 is a flow chart 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. As shown in FIG1 , the method may include:
- S101 Acquire a first image to be processed.
- the first image includes a face part and a body part.
- 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.
- the body part may be the entire body or a part of the body of the person.
- 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.
- S102 Acquire a first human body posture graph in a first image.
- the first human body posture graph may be a human body posture graph corresponding to a person in the first image.
- the first human posture graph may include a plurality of human key points and a plurality of skeleton lines.
- the key points of the human body may include key points of the head region and key points of the body region.
- 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 body posture of the person in the image may be displayed through the key points of the human body and the skeleton line.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- Fig. 2 is a schematic diagram of processing a person image according to an exemplary embodiment.
- picture 201 is an original image, that is, the first image mentioned above
- picture 202 is a deformed image obtained by performing a preset stylization process on the face part in the first image
- picture 203 is a first human posture image obtained by extracting key points of the person in the deformed image.
- 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.
- the first stylized model may be a Generative Adversarial Networks (GAN) model or other neural network models for stylizing human faces.
- GAN Generative Adversarial Networks
- the GAN 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.
- 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.
- the deformed image may 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 may be determined based on the plurality of human key points, thereby obtaining a first human posture graph.
- the key point extraction model may be a model obtained by training a preset neural network model based on sample images marked with real key points.
- the first human body posture graph may be scaled according to a preset scaling parameter to obtain a second human body posture graph.
- the preset zoom parameter may be a parameter preset by the user.
- the preset zoom parameter may be a fixed parameter preset based on manual experience.
- 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.
- Fig. 3 is a schematic diagram of a human body posture diagram according to an exemplary embodiment. As shown in Fig. 3, picture 203 is the first human body posture diagram, and picture 204 is a second human body posture diagram obtained by scaling the first human body posture diagram.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- S104 Acquire a target image through an image processing model according to the first image and the second human posture image.
- the second human posture graph is a posture constraint condition of the image processing model.
- 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.
- 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.
- 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.
- the image preprocessing may include at least one of image deformation processing, cropping processing and edge blurring processing.
- 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.
- 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.
- 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.
- Fig. 4 is a flow chart of step S104 according to the embodiment shown in Fig. 1. As shown in Fig. 4, the above step S104 may include the following sub-steps:
- 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.
- 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).
- S1042 Perform cropping and/or edge blurring processing on the first preprocessed image to obtain a second image.
- 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.
- 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.
- FIG5 is a schematic diagram of another method of processing a character image according to an exemplary embodiment.
- picture 201 is the first image mentioned above
- picture 205 is a 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
- picture 206 is a second image obtained by edge cropping the second pre-processed image.
- the first image can be deformed to obtain the first pre-processed image
- the first pre-processed image can be blurred to obtain the second pre-processed image
- the first pre-processed image is not shown in the accompanying drawings.
- the human body edge region may be the upper, lower, left, and right edge regions of the human body.
- 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. For example, in the lower region of the picture 201 (i.e., the first image) described in FIG. 5 , the legs or feet of the human body intersect with the image edge of the first image, and the intersection region may be used as the human body edge region.
- 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.
- 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.
- Fig. 6 is a schematic diagram showing another method of processing a character image according to an exemplary embodiment.
- the picture 206 is the second image
- the picture 204 is the second human posture diagram
- the second image and the second human posture diagram are input into the image processing model 301, and the target image 209 output by the image processing model 301 can be obtained. In this way, the final full-body deformation effect diagram can be generated.
- the target image output by the image processing model may be one or more.
- the image processing model may output multiple target images of different styles.
- 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.
- 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.
- the image processing device provided by the embodiment of the present disclosure can execute the image processing method provided by any embodiment of the present disclosure.
- the embodiment of the present disclosure can divide the device into functional units according to the above method examples. For example, each functional module/unit can be divided according to each function. Two or more functions can be integrated into one processing module. It is worth noting that the modules/units included in the above-mentioned device are only divided according to functional logic, but are not limited to the division described in the text.
- each module/unit can be implemented in various appropriate ways, such as hardware, firmware, or any appropriate combination.
- FIG. 7 is a block diagram of an image processing apparatus 1100 according to an exemplary embodiment. As shown in FIG. 7 , the apparatus 1100 may include:
- the first acquisition module 1101 is configured to acquire a first image to be processed; the first image includes a face part and a body part of a person;
- a second acquisition module 1102 is configured to acquire a first human body posture graph in the first image
- a first processing module 1103 is configured to adjust the proportion of the first human posture graph to obtain a second human posture graph
- the second processing module 1104 is configured 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.
- the second processing module 1104 is configured 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.
- the second processing module 1104 is configured 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.
- the first human body posture graph includes a plurality of human body key points and a plurality of skeleton lines
- the human body key points include key points of the human face and key points of the body.
- the first processing module 1103 is configured to perform scaling processing on the first human posture image 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.
- the second acquisition module 1102 is configured 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 posture map.
- the second acquisition module 1102 is configured to input the first image into a first style
- the deformed image is obtained from the stylized model; the first stylized model is used to perform preset stylization processing on the facial part in the first image.
- the electronic device includes a hardware structure and/or software module corresponding to the execution of each function.
- the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present disclosure.
- FIG8 shows a schematic diagram of the structure of an electronic device 2000 (e.g., a terminal device or a server) suitable for implementing an 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.
- the electronic device shown in FIG8 is only an example and should not impose any restrictions on the functions and scope of use of the embodiment of the present disclosure.
- 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.
- ROM read-only memory
- RAM random access memory
- 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.
- the following devices may be connected to the input/output interface 2005: input devices 2006 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 2007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 2008 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 2009.
- the communication devices 2009 may allow the electronic device 2000 to communicate wirelessly or wired with other devices to exchange data.
- FIG. 8 shows an electronic device 2000 with various devices, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.
- an embodiment of the present disclosure includes a computer program product, which includes a computer program product carried on a non-transitory computer.
- 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.
- 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.
- 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.
- 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.
- the client and 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).
- HTTP HyperText Transfer Protocol
- 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.
- the computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
- the computer-readable medium carries one or more programs.
- the electronic device can perform any step or combination of the image processing method provided in any embodiment of the present disclosure.
- Computer program code for carrying out 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 also 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 the remote computer or server.
- 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., through the Internet using an Internet service provider).
- LAN local area network
- WAN wide area network
- Internet service provider e.g., AT&T, MCI, Sprint, EarthLink, MSN, GTE, etc.
- 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.
- 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.
- 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.
- 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.
- the first acquisition module may also be described as a "module for acquiring a first image to be processed".
- exemplary types of hardware logic components 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.
- FPGAs field programmable gate arrays
- ASICs application specific integrated circuits
- ASSPs application specific standard products
- SOCs systems on chips
- CPLDs complex programmable logic devices
- 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.
- RAM random access memory
- ROM read-only memory
- EPROM or flash memory erasable programmable read-only memory
- CD-ROM portable compact disk read-only memory
- CD-ROM compact disk read-only memory
- magnetic storage device or any suitable combination of the foregoing.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Oral & Maxillofacial Surgery (AREA)
- Human Computer Interaction (AREA)
- Multimedia (AREA)
- General Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Processing Or Creating Images (AREA)
- Image Processing (AREA)
Abstract
涉及一种图像处理方法、装置、可读介质及电子设备。该方法包括:获取待处理的第一图像(S101),获取第一图像中的第一人体姿态图(S102),对第一人体姿态图进行比例调整,得到第二人体姿态图(S103),根据第一图像和第二人体姿态图,通过图像处理模型获取目标图像(S104);其中,该第二人体姿态图为图像处理模型的姿态约束条件,该第一图像包括中包括人脸部位和身体部位。
Description
相关申请的交叉引用
本申请是以申请号为202310659743.9、申请日为2023年6月5日的中国申请为基础,并主张其优先权,该中国申请的公开内容在此作为整体引入本申请中。
本公开涉及计算机技术领域,具体地,涉及一种图像处理方法、装置、可读介质及电子设备。
随着计算机技术的进步,可以基于图像算法与渲染技术进行图像的特效处理,通过特效处理,可以将原始照片中的任务进行风格转换,得到另一种风格的人物图像,例如可以将大人照片变更为小孩风格或宝宝风格的照片。
发明内容
提供该发明内容部分以便以简要的形式介绍构思,这些构思将在后面的具体实施方式部分被详细描述。该发明内容部分并不旨在标识要求保护的技术方案的关键特征或必要特征,也不旨在用于限制所要求的保护的技术方案的范围。
根据本公开实施例的第一方面,提供一种图像处理方法,所述方法包括:
获取待处理的第一图像;所述第一图像中包括人脸部位和身体部位;
获取所述第一图像中的第一人体姿态图;
对所述第一人体姿态图进行比例调整,得到第二人体姿态图;
根据所述第一图像和所述第二人体姿态图,通过图像处理模型获取目标图像;所述第二人体姿态图为所述图像处理模型的姿态约束条件。
根据本公开实施例的第二方面,提供一种图像处理装置,所述装置包括:
第一获取模块,被配置为获取待处理的第一图像;所述第一图像中包括人脸部位和身体部位;
第二获取模块,被配置为获取所述第一图像中的第一人体姿态图;
第一处理模块,被配置为对所述第一人体姿态图进行比例调整,得到第二人体姿态图;
第二处理模块,被配置为根据所述第一图像和所述第二人体姿态图,通过图像处理模型获取目标图像;所述第二人体姿态图为所述图像处理模型的姿态约束条件。
根据本公开实施例的第三方面,提供一种计算机可读介质,其上存储有计算机程序和/或指令,所述计算机程序和/或指令被处理装置执行时实现本公开第一方面所述方法的步骤。
根据本公开实施例的第四方面,提供一种电子设备,包括:
存储装置,其上存储有计算机程序和/或指令;
处理装置,被配置为执行所述存储装置中的所述计算机程序和/或指令,以实现本公开第一方面所述方法的步骤。
根据本公开实施例的第五方面,提供一种计算机程序产品,包含指令,该指令在由处理器执行时使得处理器实现本公开第一方面所述方法的步骤。
根据本公开实施例的第六方面,提供一种计算机程序,包括程序代码,该程序代码在由处理器执行时导致实现本公开第一方面所述方法的步骤。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。
结合附图并参考以下具体实施方式,本公开各实施例的上述和其他特征、优点及方面将变得更加明显。贯穿附图中,相同或相似的附图标记表示相同或相似的元素。应当理解附图是示意性的,原件和元素不一定按照比例绘制。在附图中:
图1是根据一示例性实施例示出的一种图像处理方法的流程图。
图2是根据一示例性实施例示出的一种对人物图像进行处理的示意图。
图3是根据一示例性实施例示出的一种人体姿态图的示意图。
图4是根据图1所示实施例示出的一种S104步骤的流程图。
图5是根据一示例性实施例示出的另一种对人物图像进行处理的示意图。
图6是根据一示例性实施例示出的另外一种对人物图像进行处理的示意图。
图7是根据一示例性实施例示出的一种图像处理装置的框图。
图8是根据一示例性实施例示出的一种电子设备的框图。
下面将参照附图更详细地描述本公开的实施例。虽然附图中显示了本公开的某些实施例,然而应当理解的是,本公开可以通过各种形式来实现,而且不应该被解释为限于
这里阐述的实施例,相反提供这些实施例是为了更加透彻和完整地理解本公开。应当理解的是,本公开的附图及实施例仅用于示例性作用,并非用于限制本公开的保护范围。
应当理解,本公开的方法实施方式中记载的各个步骤可以按照不同的顺序执行,和/或并行执行。此外,方法实施方式可以包括附加的步骤和/或省略执行示出的步骤。本公开的范围在此方面不受限制。
本公开使用的术语“包括”及其变形是开放性包括,即“包括但不限于”。术语“基于”是“至少部分地基于”。术语“一个实施例”表示“至少一个实施例”;术语“另一实施例”表示“至少一个另外的实施例”;术语“一些实施例”表示“至少一些实施例”。其他术语的相关定义将在下文描述中给出。
需要注意,本公开中提及的“第一”、“第二”等概念仅用于对不同的装置、模块或单元进行区分,并非用于限定这些装置、模块或单元所执行的功能的顺序或者相互依存关系。
需要注意,本公开中提及的“一个”、“多个”的修饰是示意性而非限制性的,本领域技术人员应当理解,除非在上下文另有明确指出,否则应该理解为“一个或多个”。在本公开的描述中,除非另有说明,“多个”是指两个或多于两个,其它量词与之类似;“至少一项(个)”、“一项(个)或多项(个)”或其类似表达,是指的这些项(个)中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,至少一项(个)a,可以表示任意数目个a;再例如,a,b和c中的一项(个)或多项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个;“和/或”是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,其中A,B可以是单数或者复数。字符“/”表示前后关联对象是一种“或”的关系。单数形式的“一个”、“一种”、“一项”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。
在本公开实施例中尽管在附图中以特定的顺序描述操作或步骤,但是不应将其理解为要求按照所示的特定顺序或是串行顺序来执行这些操作或步骤,或是要求执行全部所示的操作或步骤以得到期望的结果。在本公开的实施例中,可以串行执行这些操作或步骤;也可以并行执行这些操作或步骤;也可以执行这些操作或步骤中的一部分。
本公开实施方式中的多个装置之间所交互的消息或者信息的名称仅用于说明性的目的,而并不是用于对这些消息或信息的范围进行限制。
可以理解的是,在使用本公开各实施例公开的技术方案之前,均应当依据相关法律法规通过恰当的方式对本公开所涉及个人信息的类型、使用范围、使用场景等告知用户
并获得用户的授权。
例如,在响应于接收到用户的主动请求时,向用户发送提示信息,以明确地提示用户,其请求执行的操作将需要获取和使用到用户的个人信息。从而,使得用户可以根据提示信息来自主地选择是否向执行本公开技术方案的操作的电子设备、应用程序、服务器或存储介质等软件或硬件提供个人信息。
作为一种可选的但非限定性的实现方式,响应于接收到用户的主动请求,向用户发送提示信息的方式例如可以是弹窗的方式,弹窗中可以以文字的方式呈现提示信息。此外,弹窗中还可以承载供用户选择“同意”或者“不同意”向电子设备提供个人信息的选择控件。
可以理解的是,上述通知和获取用户授权过程仅是示意性的,不对本公开的实现方式构成限定,其它满足相关法律法规的方式也可应用于本公开的实现方式中。
此外,可以理解的是,本技术方案所涉及的数据(包括但不限于数据本身、数据的获取或使用)应当遵循相应法律法规及相关规定的要求。
在图像特效处理的相关技术中,往往只能对人物的脸部进行风格转换。鉴于此,本公开提出了改进的图像处理,下面结合具体实施例对本公开进行说明。
图1是根据一示例性实施例示出的一种图像处理方法的流程图。该方法可以应用于电子设备,该电子设备可以包括终端设备,例如智能手机、智能可穿戴设备、智能音箱、智能平板、PDA(Personal Digital Assistant,个人数字助理)、CPE(Customer Premise Equipment,客户终端设备)、个人计算机、车载终端等;该电子设备也可以包括服务器,例如本地服务器或云服务器。如图1所示,该方法可以包括:
S101、获取待处理的第一图像。
其中,该第一图像中包括人脸部位和身体部位。
示例地,该第一图像可以是一张或多张人物照片,该第一图像中可以包括该人物的人脸部位和身体部位,该第一图像也可以是视频中的包含人物的人脸部位和身体部位的一帧或多帧图片。
需要说明的是,该身体部位可以是人物的全部身体或部分身体。例如,人物的双脚或双腿的部分或全部可以在第一图像之外,也就是未包含在第一图像中,人物的手或胳膊也可以部分或全部在第一图像之外。
S102、获取第一图像中的第一人体姿态图。
示例地,该第一人体姿态图可以是该第一图像中的人物对应的人体姿态图。
在一些实施例中,该第一人体姿态图可以包括多个人体关键点和多个骨架线条,该
人体关键点可以包括头部区域的关键点和身体区域的关键点。该骨架线条可以是任意两个关键点之间的线条,该骨架线条可以是直线或曲线。通过人体关键点和骨架线条可以展现图像中的人物的人体姿态。
示例地,该骨架线条可以包括眼睛线条、鼻子线条、嘴线条、颈椎线条、头轮廓线条、肘线条、肩线条、腕线条、手部线条、膝盖线条、髋线条、脚部线条等骨架线条中的一项或多项。
在另一些实施例中,该人体姿态图可以包括上述多个人体关键点,该人体关键点可以包括头部区域的关键点和身体区域的关键点。通过该人体关键点可以展示图像中的人物的人体姿态。
在另外一些实施例中,该人体姿态图可以包括上述多个骨架线条。通过该骨架线条同样可以展示图像中的人物的人体姿态。
在一些实施例中,可以基于人体关键点提取算法,对第一图像进行人体关键点提取,例如,可以针对第一图像中的人物进行关键点提取,得到上述多个人体关键点,并根据多个人体关键点确定多个骨架线条。
示例地,可以将第一图像输入关键点提取模型中,得到该关键点提取模型输出的多个人体关键点。该关键点提取模型可以是根据标记有真实关键点的样本图像对预设神经网络模型进行训练而得到的模型。
在另一些实施例中,可以首先对第一图像中的人脸部位进行预设风格化处理,得到形变图像;然后对该形变图像中的人物进行关键点提取,获取第一人体姿态图。
图2是根据一示例性实施例示出的一种对人物图像进行处理的示意图。如图2所示,图片201是原始图像,也就是上述第一图像,图片202是对第一图像中的人脸部位进行预设风格化处理后得到的形变图像,图片203是对该形变图像中的人物进行关键点提取后获取的第一人体姿态图。
在一些实施例中,可以将第一图像输入第一风格化模型中,得到形变图像。其中,该第一风格化模型可以用于对第一图像中的人脸部位进行预设风格化处理,从而输出形变图像。
在一些实施例中,该第一风格化模型可以是生成式对抗网络(Generative Adversarial Networks,GAN)模型或者用于对人脸不问进行风格化处理的其他神经网络模型。该生成式对抗网络模型可以是一种深度学习模型,该模型可以包括生成模型(Generative Model)和判别模型(Discriminative Model),通过生成模型和判别模型的互相博弈学习产生准确的输出。
在一些实施例中,该第一风格化模型可以是宝宝风格的生成式对抗网络模型。可以将第一图像中的人脸部位进行宝宝风格化处理,得到宝宝风格的人脸图像。
在一些实施例中,进一步地,可以将上述形变图像输入关键点提取模型中,得到该关键点提取模型输出的多个人体关键点,并根据多个人体关键点确定多个骨架线条,从而得到第一人体姿态图。同样地,该关键点提取模型可以是根据标记有真实关键点的样本图像对预设神经网络模型进行训练而得到的模型。
S103、对第一人体姿态图进行比例调整,得到第二人体姿态图。
示例地,可以根据预设缩放参数对第一人体姿态图进行缩放处理,得到第二人体姿态图。
该预设缩放参数可以是由用户预先设定的参数。例如,该预设缩放参数可以是基于人工经验预先设定的固定参数。再例如,可以根据人工经验预先设定多个第一缩放参数,由用户根据需求从多个第一缩放参数中选择一个作为该预设缩放参数。
图3是根据一示例性实施例示出的一种人体姿态图的示意图。如图3所示,图片203是上述第一人体姿态图,图片204是对第一人体姿态图进行缩放处理后得到的第二人体姿态图。
在一些实施例中,该预设缩放参数可以是预设收缩参数,这样,根据该预设收缩参数对第一人体姿态图进行收缩处理,可以得到第二人体姿态图。该第一人体姿态图可以是大人的人体姿态图,也可以称为大人骨架图;收缩处理后得到的第二人体姿态图可以是小孩的人体姿态图,也可以称为小孩骨架图。
在另一些实施例中,该预设缩放参数可以是预设放大参数,这样,根据该预设放大参数对第一人体姿态图进行放大处理,可以得到第二人体姿态图。例如,该第一人体姿态图可以是小孩的人体姿态图,也可以称为小孩骨架图;收缩处理后得到的第二人体姿态图可以是大人的人体姿态图,也可以称为大人骨架图。再例如,该第一人体姿态图可以是普通人的人体姿态图,也可以称为普通人骨架图;收缩处理后得到的第二人体姿态图可以是巨人的人体姿态图,也可以称为巨人骨架图。
在一些实施例中,该预设缩放参数可以包括每个骨架线条对应的缩放比例,每个骨架线条可以分别设置各自的缩放比例,不同的骨架线体的缩放比例可以相同,也可以不同。这样,可以更加灵活地调整人体姿态图,从而使得处理后的图像更加形象。
在另一些实施例中,该预设缩放参数可以是一个参数,每个骨架线条对应的缩放比例均由该参数确定,也就是说,不同的骨架线条对应的缩放比例均相同。这样,可以是的人体姿态图的各个部位的比例保持一致。
S104、根据第一图像和第二人体姿态图,通过图像处理模型获取目标图像。
其中,第二人体姿态图为图像处理模型的姿态约束条件。
该图像处理模型可以是基于姿态条件ControlNet控制的扩散模型,或者,其他用于图像处理的神经网络模型。该图像处理模型可以基于训练样本预先生成。
在一些实施例中,可以直接将第一图像和第二姿态图,输入图像处理模型,得到该图像处理模型输出的目标图像。
在另一些实施例中,可以根据第一人体姿态图和第二人体姿态图,对第一图像进行图像预处理,得到第二图像;将第二图像和第二人体姿态图输入图像处理模型中,得到该图像处理模型输出的目标图像。
其中,该图像预处理可以包括图像形变处理、裁剪处理和边缘模糊处理中的至少一项。
示例地,可以根据第一人体姿态图和第二人体姿态图,对第一图像进行图像形变处理,得到第一预处理图像;对第一预处理图像进行裁剪处理和/或边缘模糊处理,得到第二图像。
采用上述方法,获取待处理的第一图像,以及第一图像中的第一人体姿态图,对第一人体姿态图进行比例调整,得到第二人体姿态图,根据第一图像和第二人体姿态图,通过图像处理模型获取目标图像;其中,该第二人体姿态图为图像处理模型的姿态约束条件。这样,可以实现对图像中的人物进行全身形变,例如可以将大人图像变为宝宝效果图像,或者将普通人图像变为巨人效果图像,实现更加灵活的图像特效玩法。
图4是根据图1所示实施例示出的一种S104步骤的流程图。如图4所示,上述S104步骤可以包括以下子步骤:
S1041、根据第一人体姿态图和第二人体姿态图,对第一图像进行图像形变处理,得到第一预处理图像。
示例地,可以根据第一人体姿态图和第二人体姿态图的各个骨架线条的比例,对第一图像中人物的各个部位进行缩放,可以使得第一预处理图像中的人物与第二人体姿态图相契合。
这样,可以利用人体姿态图(也就是人体骨骼)实现人物形变(例如大人变宝宝)的比例适配。
S1042、对所述第一预处理图像进行裁剪处理和/或边缘模糊处理,得到第二图像。
示例地,可以确定第一预处理图像中的人体边缘区域,根据该人体边缘区域对第一预处理图像进行裁剪处理和/或边缘模糊处理,得到第二图像。
在一些实施例中,可以对该第一预处理图像进行边缘模糊处理,得到第二预处理图像,然后对第二预处理图像进行边缘裁剪处理,得到第二图像。
这样,可以通过模糊和裁剪,消除形变产生的边缘区域。
图5是根据一示例性实施例示出的另一种对人物图像进行处理的示意图。如图5所示,图片201是上述第一图像,图片205是对根据第一人体姿态图和第二人体姿态图,对第一图像进行形变处理,并进行边缘模糊处理后得到的第二预处理图像,图片206是对第二预处理图像进行边缘裁剪后得到的第二图像。需要说明的是,可以对第一图像进行形变处理得到第一预处理图像,并对第一预处理图像进行边缘模糊处理后得到该第二预处理图像,附图中并未示出该第一预处理图像。
在一些实施例中,上述人体边缘区域可以是人物身体上下左右的边缘区域。在一些实施例中,上述人体边缘区域可以是第一图像中人物的身体与第一图像的图像边缘交接的区域。例如,在图5所述的图片201(也就是第一图像)的下部区域,人物的腿部或脚部与第一图像的图像边缘交接,可以将交接区域作为人体边缘区域。
S1043、将第二图像和第二人体姿态图输入图像处理模型中,得到该图像处理模型输出的目标图像。
需要说明的是,上述第二图像也可以称为粗糙图像,是进行了初步预处理后的图像,通过图像处理模型可以将该粗糙图像进一步处理,得到更加逼真的目标图像。
图6是根据一示例性实施例示出的另外一种对人物图像进行处理的示意图。如图6所示,图片206为上述第二图像,图片204为上述第二人体姿态图,将将第二图像和第二人体姿态图输入图像处理模型301,可以得到该图像处理模型301输出的目标图像209。这样,可以生成最终的全身形变效果图。
需要说明的是,图像处理模型输出的目标图像可以是一个或多个。例如,针对一个第二图像和第二人体姿态图,图像处理模型可以输出多个不同风格的目标图像。
采用上述方法,获取待处理的第一图像,以及第一图像中的第一人体姿态图,对第一人体姿态图进行比例调整,得到第二人体姿态图,根据第一图像和第二人体姿态图,通过图像处理模型获取目标图像;其中,该第二人体姿态图为图像处理模型的姿态约束条件。这样,可以实现对图像中的人物进行全身形变,例如可以将大人图像变为宝宝效果图像,或者将普通人图像变为巨人效果图像,实现更加灵活的图像特效玩法。
以下将描述根据本公开的实施例的图像处理装置。本公开实施例所提供的图像处理装置可执行本公开任意实施例所提供的图像处理方法,本公开实施例可以根据上述方法示例对装置进行功能单元的划分,例如,可以对应各个功能划分各个功能模块/单元,也
可以将两个或两个以上的功能集成在一个处理模块中。值得注意的是,上述装置所包括的各个模块/单元只是按照功能逻辑进行划分的,但并不局限于文中所述的划分,实际实现时可以有另外的划分方式,只要能够实现相应的功能即可;另外,各模块/单元的具体名称也只是为了便于相互区分,并不用于限制本公开实施例的保护范围。此外,各模块/单元可采用各种适当方式来实现,例如硬件、固件、或任何适当组合来实现的。
图7是根据一示例性实施例示出的一种图像处理装置1100的框图,如图7所示,该装置1100可以包括:
第一获取模块1101,被配置为获取待处理的第一图像;所述第一图像中包括人物的人脸部位和身体部位;
第二获取模块1102,被配置为获取所述第一图像中的第一人体姿态图;
第一处理模块1103,被配置为对所述第一人体姿态图进行比例调整,得到第二人体姿态图;
第二处理模块1104,被配置为根据所述第一图像和所述第二人体姿态图,通过预先生成的图像处理模型获取目标图像;所述第二人体姿态图为所述图像处理模型的姿态约束条件。
在一些实施例中,所述第二处理模块1104,被配置为根据所述第一人体姿态图和所述第二人体姿态图,对所述第一图像进行图像形变处理,得到第一预处理图像;对所述第一预处理图像进行裁剪处理和/或边缘模糊处理,得到第二图像;将所述第二图像和所述第二人体姿态图输入图像处理模型中,得到所述图像处理模型输出的目标图像。
在一些实施例中,所述第二处理模块1104,被配置为确定所述第一预处理图像中的人体边缘区域;根据所述人体边缘区域对所述第一预处理图像进行裁剪处理和/或边缘模糊处理,得到第二图像。
在一些实施例中,所述第一人体姿态图包括多个人体关键点和多个骨架线条,所述人体关键点包括所述人脸部位的关键点和所述身体部位的关键点。
在一些实施例中,所述第一处理模块1103,被配置为根据预设缩放参数对所述第一人体姿态图进行缩放处理,得到所述第二人体姿态图;所述预设缩放参数包括每个所述骨架线条对应的缩放比例。
在一些实施例中,所述第二获取模块1102,被配置为对所述第一图像中的所述人脸部位进行预设风格化处理,得到形变图像;对所述形变图像中的人物进行关键点提取,获取所述第一人体姿态图。
在一些实施例中,所述第二获取模块1102,被配置为将所述第一图像输入第一风格
化模型中,得到所述形变图像;所述第一风格化模型用于对所述第一图像中的所述人脸部位进行预设风格化处理。
关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
上述主要对本公开实施例提供的方案进行了介绍。可以理解的是,为了实现上述功能,电子设备包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本公开能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本公开的范围。
下面参考图8,其示出了适于用来实现本公开实施例的电子设备2000(例如终端设备或服务器)的结构示意图。本公开实施例中的终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。本公开实施例中的服务器可以包括但不限于诸如本地服务器、云服务器、单个服务器、分布式服务器等。图8示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图8所示,电子设备2000可以包括处理装置(例如中央处理器、图形处理器等)2001,其可以根据存储在只读存储器(ROM)2002中的程序或者从存储装置2008加载到随机访问存储器(RAM)2003中的程序而执行各种适当的动作和处理。在RAM2003中,还存储有电子设备2000操作所需的各种程序和数据。处理装置2001、ROM2002以及RAM2003通过总线2004彼此相连。输入/输出(I/O)接口2005也连接至总线2004。
通常,以下装置可以连接至输入/输出接口2005:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置2006;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置2007;包括例如磁带、硬盘等的存储装置2008;以及通信装置2009。通信装置2009可以允许电子设备2000与其他设备进行无线或有线通信以交换数据。虽然图8示出了具有各种装置的电子设备2000,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机
可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置2009从网络上被下载和安装,或者从存储装置2008被安装,或者从ROM2002被安装。在该计算机程序被处理装置2001执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质可以包括但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何当前已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字数据通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何当前已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备能够执行本公开任意实施例所提供的图像处理方法的任一步骤或组合。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言—诸如Java、
Smalltalk、C++,还包括常规的过程式程序设计语言——诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)——连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该模块本身的限定,例如,第一获取模块还可以被描述为“获取待处理的第一图像的模块”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员
应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。关于上述实施例中的装置,其中各个模块执行操作的具体方式已经在有关该方法的实施例中进行了详细描述,此处将不做详细阐述说明。
Claims (12)
- 一种图像处理方法,所述方法包括:获取待处理的第一图像;所述第一图像中包括人脸部位和身体部位;获取所述第一图像中的第一人体姿态图;对所述第一人体姿态图进行比例调整,得到第二人体姿态图;根据所述第一图像和所述第二人体姿态图,通过图像处理模型获取目标图像;所述第二人体姿态图为所述图像处理模型的姿态约束条件。
- 根据权利要求1所述的方法,其中,所述根据所述第一图像和所述第二人体姿态图,通过图像处理模型获取目标图像包括:根据所述第一人体姿态图和所述第二人体姿态图,对所述第一图像进行图像形变处理,得到第一预处理图像;对所述第一预处理图像进行裁剪处理和/或边缘模糊处理,得到第二图像;将所述第二图像和所述第二人体姿态图输入图像处理模型中,得到所述图像处理模型输出的目标图像。
- 根据权利要求2所述的方法,其中,对所述第一预处理图像进行裁剪处理和/或边缘模糊处理,得到第二图像包括:确定所述第一预处理图像中的人体边缘区域;根据所述人体边缘区域对所述第一预处理图像进行裁剪处理和/或边缘模糊处理,得到第二图像。
- 根据权利要求1至3中任一项所述的方法,其中,所述第一人体姿态图包括多个人体关键点和多个骨架线条,所述人体关键点包括所述人脸部位的关键点和所述身体部位的关键点。
- 根据权利要求4所述的方法,其中,对所述第一人体姿态图进行比例调整,得到第二人体姿态图包括:根据预设缩放参数对所述第一人体姿态图进行缩放处理,得到所述第二人体姿态图;所述预设缩放参数包括每个所述骨架线条对应的缩放比例。
- 根据权利要求1至3中任一项所述的方法,其中,所述获取所述第一图像中的人物对应的第一人体姿态图包括:对所述第一图像中的所述人脸部位进行预设风格化处理,得到形变图像;对所述形变图像中的人物进行关键点提取,获取所述第一人体姿态图。
- 根据权利要求6所述的方法,其中,所述对所述第一图像中的所述人脸部位进行预设风格化处理,得到形变图像包括:将所述第一图像输入第一风格化模型中,得到所述形变图像;所述第一风格化模型用于对所述第一图像中的所述人脸部位进行预设风格化处理。
- 一种图像处理装置,其中,所述装置包括:第一获取模块,被配置为获取待处理的第一图像;所述第一图像中包括人脸部位和身体部位;第二获取模块,被配置为获取所述第一图像中的第一人体姿态图;第一处理模块,被配置为对所述第一人体姿态图进行比例调整,得到第二人体姿态图;第二处理模块,被配置为根据所述第一图像和所述第二人体姿态图,通过图像处理模型获取目标图像;所述第二人体姿态图为所述图像处理模型的姿态约束条件。
- 一种计算机可读介质,其上存储有计算机程序,其中,所述计算机程序被处理装置执行时使得处理装置实现根据权利要求1至7中任一项所述方法。
- 一种电子设备,其中,包括:存储装置,其上存储有计算机程序;处理装置,被配置为执行所述存储装置中的所述计算机程序,以实现根据权利要求1至7中任一项所述方法。
- 一种计算机程序产品,包含指令,该指令在由处理器执行时使得处理器实现根据权利要求1到7中任一项所述的方法。
- 一种计算机程序,包括程序代码,该程序代码在由处理器执行时导致实现根据权利要求1到7中任一项所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310659743.9 | 2023-06-05 | ||
| CN202310659743.9A CN119090704A (zh) | 2023-06-05 | 2023-06-05 | 图像处理方法、装置、可读介质及电子设备 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024251082A1 true WO2024251082A1 (zh) | 2024-12-12 |
Family
ID=93700017
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2024/097046 Ceased WO2024251082A1 (zh) | 2023-06-05 | 2024-06-03 | 图像处理方法、装置、可读介质及电子设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN119090704A (zh) |
| WO (1) | WO2024251082A1 (zh) |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111402122A (zh) * | 2020-03-20 | 2020-07-10 | 北京字节跳动网络技术有限公司 | 图像的贴图处理方法、装置、可读介质和电子设备 |
| CN111860044A (zh) * | 2019-04-26 | 2020-10-30 | 北京陌陌信息技术有限公司 | 人脸换脸方法、装置、设备及计算机存储介质 |
| CN114638744A (zh) * | 2022-03-03 | 2022-06-17 | 厦门大学 | 人体姿态迁移方法及装置 |
| US20220358705A1 (en) * | 2020-02-18 | 2022-11-10 | Boe Technology Group Co., Ltd. | Method for generating animation figure, electronic device and storage medium |
-
2023
- 2023-06-05 CN CN202310659743.9A patent/CN119090704A/zh active Pending
-
2024
- 2024-06-03 WO PCT/CN2024/097046 patent/WO2024251082A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111860044A (zh) * | 2019-04-26 | 2020-10-30 | 北京陌陌信息技术有限公司 | 人脸换脸方法、装置、设备及计算机存储介质 |
| US20220358705A1 (en) * | 2020-02-18 | 2022-11-10 | Boe Technology Group Co., Ltd. | Method for generating animation figure, electronic device and storage medium |
| CN111402122A (zh) * | 2020-03-20 | 2020-07-10 | 北京字节跳动网络技术有限公司 | 图像的贴图处理方法、装置、可读介质和电子设备 |
| CN114638744A (zh) * | 2022-03-03 | 2022-06-17 | 厦门大学 | 人体姿态迁移方法及装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN119090704A (zh) | 2024-12-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN114693876B (zh) | 数字人生成方法、装置、存储介质和电子设备 | |
| WO2024240222A1 (zh) | 图像风格化处理方法、装置、设备、存储介质和程序产品 | |
| CN112330527A (zh) | 图像处理方法、装置、电子设备和介质 | |
| WO2014154111A1 (en) | Graphic processing method, system and server | |
| CN107277615A (zh) | 直播风格化处理方法、装置、计算设备及存储介质 | |
| WO2025218588A1 (zh) | 图像编辑方法、装置、设备及存储介质 | |
| US20230401764A1 (en) | Image processing method and apparatus, electronic device and computer readable medium | |
| CN111967397A (zh) | 人脸影像处理方法和装置、存储介质和电子设备 | |
| WO2022037602A1 (zh) | 表情变换方法、装置、电子设备和计算机可读介质 | |
| CN114004905A (zh) | 人物风格形象图的生成方法、装置、设备及存储介质 | |
| CN114841984B (zh) | 图像处理方法、装置、电子设备及存储介质 | |
| CN114418835B (zh) | 图像处理方法、装置、设备及介质 | |
| WO2024188132A1 (zh) | 特效处理方法、装置、电子设备及存储介质 | |
| CN110717467A (zh) | 头部姿势的估计方法、装置、设备及存储介质 | |
| WO2024120446A1 (zh) | 特效道具、特效图的生成方法、装置、设备及存储介质 | |
| CN111784726B (zh) | 人像抠图方法和装置 | |
| CN115311178A (zh) | 图像拼接方法、装置、设备及介质 | |
| CN115619904A (zh) | 图像处理方法、装置及设备 | |
| WO2024251082A1 (zh) | 图像处理方法、装置、可读介质及电子设备 | |
| CN114399590A (zh) | 一种基于人脸解析图的人脸遮挡移除和三维模型生成方法 | |
| WO2024131652A1 (zh) | 特效处理方法、装置、电子设备及存储介质 | |
| US20250356578A1 (en) | Image processing method and apparatus, electronic device, and storage medium | |
| US20140292778A1 (en) | Graphic processing method, system and server | |
| WO2024109646A1 (zh) | 图像渲染方法、装置、设备及存储介质 | |
| CN110545386A (zh) | 用于拍摄图像的方法和设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24818614 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |