CN111626920A - Picture processing method and device and electronic equipment - Google Patents

Picture processing method and device and electronic equipment Download PDF

Info

Publication number
CN111626920A
CN111626920A CN202010387800.9A CN202010387800A CN111626920A CN 111626920 A CN111626920 A CN 111626920A CN 202010387800 A CN202010387800 A CN 202010387800A CN 111626920 A CN111626920 A CN 111626920A
Authority
CN
China
Prior art keywords
region
head
human body
picture
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010387800.9A
Other languages
Chinese (zh)
Inventor
黄佳斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010387800.9A priority Critical patent/CN111626920A/en
Publication of CN111626920A publication Critical patent/CN111626920A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • G06T3/04
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4023Decimation- or insertion-based scaling, e.g. pixel or line decimation
    • G06T5/77
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • G06V40/171Local features and components; Facial parts ; Occluding parts, e.g. glasses; Geometrical relationships

Abstract

The embodiment of the disclosure provides a picture processing method, a picture processing device and electronic equipment, belonging to the technical field of image processing, wherein the method comprises the following steps: identifying a head region and a body region of a human body in a picture to be processed, wherein the body region is a region of the human body except the head region; amplifying the head area of the human body in the picture; taking the lower boundary line of the head region after the enlargement processing as the upper boundary line of the body region, and carrying out reduction processing on the body region; and performing skin tendering and body beautifying treatment on the head area subjected to the amplification treatment. The method has the advantages that the children-like body beautifying treatment can be performed on the human body in the picture, so that the human body in the picture has the children-like special effect, the body beautifying effect is more real, and the diversity of the human body beautifying treatment in the picture is improved.

Description

Picture processing method and device and electronic equipment
Technical Field
The present disclosure relates to the field of image processing technologies, and in particular, to a method and an apparatus for processing an image, and an electronic device.
Background
With the development of image processing technology, the function of beautifying human body in pictures is increasingly popularized, and the requirement of image processing is higher and higher. The existing picture processing scheme mainly aims at beautification processing such as stretching and slimming of the whole proportion of a human body in a picture.
In the process of realizing the present disclosure, the inventor finds that the above-mentioned mode at least has the technical problems of poor beautifying effect and single beautifying type of the picture human body beautifying method.
Disclosure of Invention
In view of this, embodiments of the present disclosure provide an image processing method, an image processing apparatus, and an electronic device, which at least partially solve the problems in the prior art.
In a first aspect, an embodiment of the present disclosure provides an image processing method, including:
identifying a head region and a body region of a human body in a picture to be processed, wherein the body region is a region of the human body except the head region;
amplifying the head area of the human body in the picture;
and taking the lower boundary line of the head region after the enlargement processing as the upper boundary line of the body region, and carrying out reduction processing on the body region.
According to a specific implementation manner of the embodiment of the present disclosure, the step of identifying the head region and the body region of the human body in the picture to be processed includes:
according to key points of the human body in the picture, a complete region of the human body is framed and selected;
determining a head center point of the human body, and a height and a width of the head region;
determining a head region of the human body in the full region according to the head center point and the height and width of the head region;
regarding an area other than the head area in the full area as a body area of the human body.
According to a specific implementation manner of the embodiment of the present disclosure, the step of determining the head center point of the human body and the height and width of the head region includes:
determining a head central point of the human body according to a target key point of the human body, which is associated with the head;
determining the size of a reference center line of the human body in the picture;
determining a height and a width of the head region based on a size of the reference midline.
According to a specific implementation manner of the embodiment of the present disclosure, the step of determining the head center point of the human body according to the target key point of the human body associated with the head includes:
identifying eye, nose and ear key points of the human body;
connecting the eye key points, the nose key points and the ear key points to draw key point region graphs;
and determining the geometric center of the key point region graph as the head center point of the human body.
According to a specific implementation manner of the embodiment of the present disclosure, the step of determining the size of the reference centerline of the human body in the picture includes:
determining a shoulder midpoint between two shoulder key points of the human body and a hip midpoint between two hip key points;
determining a reference midline between a shoulder midpoint and a hip midpoint of the human body;
measuring a dimension of a reference midline of the human body.
According to a specific implementation of the embodiment of the present disclosure, the step of determining the height and the width of the head region according to the size of the reference midline includes:
multiplying the size of the reference midline of the human body by a first scaling factor to obtain the width of the head region, and multiplying the size of the reference midline of the human body by a second scaling factor to obtain the height of the head region.
According to a specific implementation manner of the embodiment of the present disclosure, the step of performing an enlargement process on the head region of the human body in the picture includes:
determining a first direction and a second direction of the head region, wherein the first direction is a direction parallel to a lower boundary line of the head region, and the second direction is a direction perpendicular to the lower boundary line of the head region;
stretching the head region towards two ends along the first direction at the head center point of the head region;
and stretching the head area towards two ends along the second direction at the head central point of the head area.
According to a specific implementation manner of the embodiment of the present disclosure, the step of performing a reduction process on the body region by using the lower boundary line of the head region after the enlargement process as the upper boundary line of the body region includes:
determining the lower boundary line of the head region after the amplification treatment as the upper boundary line of the body region stretching, and determining the foot region of the body region as a stretching starting point;
stretching the body region from the stretch starting point toward the upper boundary line such that the body region is scaled down in the first direction and the second direction.
According to a specific implementation of the embodiment of the present disclosure, after the step of performing the reduction processing on the body region, the method further includes at least one of:
carrying out amplification processing on an eye region of the head region;
adding a blush image layer in the face area of the head area;
performing retraction treatment on a chin region of the head region;
and performing skin tendering and body beautifying treatment on the head area.
According to a specific implementation manner of the embodiment of the present disclosure, before the step of performing the enlargement processing on the head region of the human body in the picture, the method further includes:
receiving body beauty request information;
determining a requested target beauty position according to the beauty request information;
the step of amplifying the head region of the human body in the picture comprises the following steps:
carrying out amplification processing corresponding to the target beauty body gear on the head area of the human body in the picture;
the step of performing a reduction process on the body region includes:
and carrying out reduction processing corresponding to the target beauty body position on the body area.
In a second aspect, an embodiment of the present disclosure provides a picture processing apparatus, including:
the identification module is used for identifying a head region and a body region of a human body in a picture to be processed, wherein the body region is a region of the human body except the head region;
the amplifying module is used for amplifying the head area of the human body in the picture;
the reduction module is used for taking the lower boundary line of the head area subjected to the amplification processing as the upper boundary line of the body area and reducing the body area;
and the body beautifying module is used for performing skin tendering and body beautifying on the head region after amplification treatment.
In a third aspect, an embodiment of the present disclosure further provides an electronic device, where the electronic device includes:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the picture processing method of the first aspect or any implementation manner of the first aspect.
In a fourth aspect, the disclosed embodiments also provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the picture processing method in the first aspect or any implementation manner of the first aspect.
In a fifth aspect, the disclosed embodiments also provide a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions that, when executed by a computer, cause the computer to perform the picture processing method in the foregoing first aspect or any implementation manner of the first aspect.
The picture processing scheme in the embodiment of the present disclosure includes: identifying a head region and a body region of a human body in a picture to be processed, wherein the body region is a region of the human body except the head region; amplifying the head area of the human body in the picture; and taking the lower boundary line of the head region after the enlargement processing as the upper boundary line of the body region, and carrying out reduction processing on the body region. Through the scheme disclosed by the invention, the children-like body beautifying treatment can be carried out on the human body in the picture, so that the human body in the picture presents a children-like special effect, the body beautifying effect is more real, and the diversity of the human body beautifying treatment in the picture is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings needed to be used in the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present disclosure, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a picture processing method according to an embodiment of the present disclosure;
fig. 2 and fig. 3 are schematic human body diagrams according to an image processing method provided by an embodiment of the present disclosure;
fig. 4 is a partial schematic flow chart of another image processing method according to an embodiment of the present disclosure;
fig. 5 is a partial schematic flow chart of another image processing method according to an embodiment of the present disclosure;
fig. 6 is a partial flowchart of another image processing method according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a picture processing apparatus according to an embodiment of the present disclosure;
fig. 8 is a schematic view of an electronic device provided in an embodiment of the present disclosure.
Detailed Description
The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
The embodiments of the present disclosure are described below with specific examples, and other advantages and effects of the present disclosure will be readily apparent to those skilled in the art from the disclosure in the specification. It is to be understood that the described embodiments are merely illustrative of some, and not restrictive, of the embodiments of the disclosure. The disclosure may be embodied or carried out in various other specific embodiments, and various modifications and changes may be made in the details within the description without departing from the spirit of the disclosure. It is to be noted that the features in the following embodiments and examples may be combined with each other without conflict. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
It is noted that various aspects of the embodiments are described below within the scope of the appended claims. It should be apparent that the aspects described herein may be embodied in a wide variety of forms and that any specific structure and/or function described herein is merely illustrative. Based on the disclosure, one skilled in the art should appreciate that one aspect described herein may be implemented independently of any other aspects and that two or more of these aspects may be combined in various ways. For example, an apparatus may be implemented and/or a method practiced using any number of the aspects set forth herein. Additionally, such an apparatus may be implemented and/or such a method may be practiced using other structure and/or functionality in addition to one or more of the aspects set forth herein.
It should be noted that the drawings provided in the following embodiments are only for illustrating the basic idea of the present disclosure, and the drawings only show the components related to the present disclosure rather than the number, shape and size of the components in actual implementation, and the type, amount and ratio of the components in actual implementation may be changed arbitrarily, and the layout of the components may be more complicated.
In addition, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects may be practiced without these specific details.
The embodiment of the disclosure provides a picture processing method. The image processing method provided by the embodiment can be executed by a computing device, the computing device can be implemented as software, or implemented as a combination of software and hardware, and the computing device can be integrally arranged in a server, a terminal device and the like.
Referring to fig. 1, an image processing method provided in the embodiment of the present disclosure includes:
s101, identifying a head region and a body region of a human body in a picture to be processed, wherein the body region is a region of the human body except the head region;
the method provided by the embodiment is mainly applied to a process of performing child body beautification on a human body in a picture in terminal beauty application, so that the human body in the picture can present a special effect which looks like a child. As shown in fig. 2, the human body in the picture is a normal adult body type, and after the child body beautification treatment is performed on the human body in the picture, as shown in fig. 3, the human body in the picture is a child body type.
Considering that the body size of a child is large in head and a body part appears short compared to the body size of an adult, the treatment can be performed separately for the head area and the body area of a human body. In specific implementation, the head region and the body region of the human body in the picture to be processed need to be identified first, where the body region may include other parts of the human body, such as the neck, the trunk, and the limbs, except the head.
When the picture is processed, the terminal identifies pixel points corresponding to the human body in the picture according to an algorithm, and determines key points of main parts, such as shoulder key points, eye key points, nose key points, hip key points and the like, so as to determine the head area and the body area of the human body in the picture.
S102, amplifying the head area of the human body in the picture;
after the head region and the body region of the human body are determined according to the above steps, the head region and the body region can be processed respectively. Considering that the head region has a small change in area and the body region has a large change in area, in order to ensure a good reference contrast effect, the head region is processed first, that is, the head region of the human body in the picture is amplified.
The display effect of the body shape of the child is that the head is larger, the trunk is smaller, and when the child body beautification treatment is carried out, the head area of the human body in the picture needs to be amplified. The amplification treatment can be diffusion from the middle part to the periphery, and the effect of uniform amplification is displayed.
And S103, taking the lower boundary line of the head region after the enlargement processing as the upper boundary line of the body region, and carrying out reduction processing on the body region.
The body area of the adult body type is larger than that of the child, when the child body beautifying treatment is carried out, the body area of the human body needs to be reduced, the reduction can be carried out by reducing the upper body and the lower body of the human body in the same proportion, and the horizontal and vertical reduction proportion can be adjusted adaptively, so that the whole body is more uniform.
In order to ensure the connectivity of the head area and the body area of the human body, after the head area is amplified, the lower boundary line of the head area after the amplification is used as the upper boundary line when the body area is processed, namely, the body area is contracted and closed from the foot area to the upper boundary line, so that the technical problem of body beautifying processing distortion caused by the separation of the head area and the body area in the childhood processing process is solved.
Furthermore, after the step of subjecting the body region to a reduction process, the method may further comprise at least one of:
carrying out amplification processing on an eye region of the head region;
adding a blush image layer in the face area of the head area;
performing retraction treatment on a chin region of the head region;
and performing skin tendering and body beautifying treatment on the head area.
And S104, performing skin tendering and body beautifying treatment on the head region subjected to the amplification treatment.
In the process of child body shaping, in addition to the enlargement processing of the head region and the reduction processing of the body region in the above-mentioned process, in order to achieve a more realistic child body shaping effect, it is necessary to perform specific body shaping processing on the head region after the enlargement processing, for example, to perform skin tendering processing on the head region of the human body, so that the head region, especially the face region, exhibits special effects similar to children, such as large eyes, face blush, and small chin, so that the whole human body is closer to the children, and the childhood effect is more realistic.
In the skin tendering and body beautifying treatment process, the eye region in the head region can be obtained according to a conventional human eye recognition mode, and the center of the eye region is taken as a reference point to be uniformly expanded outwards. The adding of the blush layer to the face area is a special effect of adding the blush layer to the face of the human body, and the chin retraction treatment is an effect of recovering the chin in the human body and is not described in detail.
In the method for treating the skin beautification of the human body in the picture by children provided by the embodiment of the invention, the pixels in the head area are stretched outwards from the central point, so that the effect of big head is obtained. Meanwhile, the area below the head is stretched upwards, namely the upper half body and the legs are shortened, so that the effect of reducing the body is achieved. In addition, the image buffing and other treatments are combined to buff the face area, so that the face area looks smooth, people look younger, and the effect of low age is achieved.
According to a specific implementation manner of the embodiment of the present disclosure, the step of identifying the human body region in the picture is further defined. As shown in fig. 4, the step of identifying the head region and the body region of the human body in the picture to be processed may include:
s401, according to key points of the human body in the picture, framing a complete region of the human body;
when the picture is processed, the key points of the human body, including shoulder key points, hip key points, foot key points, leg key points, eye key points, nose key points, ear key points and the like, can be obtained firstly according to a preset human body recognition algorithm.
S402, determining the head central point of the human body and the height and width of the head area;
according to the key points of the human body, the key points of the head of the human body and the height and the width of the head area of the human body can be determined firstly.
S403, determining a head region of the human body in the full region according to the head center point and the height and width of the head region;
the head area is an approximate ellipse or a prototype area, and after the head central point of the human body area is determined, the height and the width of the determined head area are combined, so that the head area of the human body can be determined.
S404, regarding an area other than the head area in the complete area as a body area of the human body.
The above-mentioned complete region of the human body and the head region of the human body are determined, the region of the complete region except the head region can be used as the body region of the human body, and then the head region of the human body is enlarged and the body region is reduced.
According to a specific implementation manner of the embodiment of the present disclosure, as shown in fig. 5, the step of determining the head center point of the human body and the height and width of the head region may include:
s501, determining a head central point of the human body according to a target key point of the human body, which is associated with the head;
when determining the head region, the head center point of the head region needs to be determined first. Specifically, the head center point of the human body is determined according to the target key points of the human body, which are associated with the head.
Optionally, the step of determining the head center point of the human body according to the target key point of the human body associated with the head includes:
identifying eye, nose and ear key points of the human body;
connecting the eye key points, the nose key points and the ear key points to draw key point region graphs;
and determining the geometric center of the key point region graph as the head center point of the human body.
The target key points of the human body, which are associated with the head, are key points with eyes, nose and ears, and according to the positions of the key points, the head central point can be obtained through the operation of taking the central point.
S502, determining the size of a reference central line of the human body in the picture;
considering that the distance of the human body from the screen in the picture affects the size of the head region of the human body, the size of the head region of the human body from the reference center line of the screen is determined before the head region of the human body is determined. In specific implementation, the size of the reference midline can be determined according to the shoulder key points, the hip key points and the like of the human body.
Specifically, the step of determining the size of the reference centerline of the human body in the picture includes:
determining a shoulder midpoint between two shoulder key points of the human body and a hip midpoint between two hip key points;
determining a reference midline between a shoulder midpoint and a hip midpoint of the human body;
measuring a dimension of a reference midline of the human body.
S503, determining the height and the width of the head area according to the size of the reference middle line.
After the size of the reference centerline of the human body in the picture is determined, the width and height of the head region can be determined. For example, the step of determining the height and width of the head region based on the dimensions of the reference midline comprises:
multiplying the size of the reference midline of the human body by a first scaling factor to obtain the width of the head region, and multiplying the size of the reference midline of the human body by a second scaling factor to obtain the height of the head region.
The following is defined for a specific process. According to a specific implementation manner of the embodiment of the present disclosure, the step of performing an enlargement process on the head region of the human body in the picture may include:
determining a first direction and a second direction of the head region, wherein the first direction is a direction parallel to a lower boundary line of the head region, and the second direction is a direction perpendicular to the lower boundary line of the head region;
stretching the head region towards two ends along the first direction at the head center point of the head region;
and stretching the head area towards two ends along the second direction at the head central point of the head area.
In this embodiment, when the head region is enlarged, not only the first direction, i.e. the horizontal direction shown in the figure, but also the second direction, i.e. the numerical direction, of the head region is also outwardly extended, and of course, the two mutually perpendicular directions with a transverse included angle of 45 ° may also be extended, so that the head region of the human body is uniformly enlarged outward in a spherical shape, and the head is uniformly enlarged.
According to another specific implementation manner of the embodiment of the present disclosure, the step of performing a reduction process on the body region by using the lower boundary line of the head region after the enlargement process as the upper boundary line of the body region includes:
determining the lower boundary line of the head region after the amplification treatment as the upper boundary line of the body region stretching, and determining the foot region of the body region as a stretching starting point;
stretching the body region from the stretch starting point toward the upper boundary line such that the body region is scaled down in the first direction and the second direction.
In the present embodiment, when the reduction processing is performed on the body region, the lower end of the head region is used as a boundary line in the upward stretching, and the regions below this boundary line are all stretched upward, and the stretching is reduced in an equal proportion, and the position where the stretching is completed is the foot region. In this way, the body region stretches more evenly, realistically simulating the inverse process of a human body growing from a child to an adult.
According to a specific implementation manner of the embodiment of the present disclosure, as shown in fig. 6, before the step of performing the enlargement processing on the head region of the human body in the picture, the method may further include:
s601, receiving body beauty request information;
in this embodiment, it is considered that the children beauty requirements of different users are different, for example, the children beauty degree of the requirement is the beauty degree of a two-year-old child or the beauty degree of a seven-eight-year-old child, and the beauty parameters corresponding to different children beauty requirements are different.
In order to provide different user-specific beauty requirements, the terminal may receive user's beauty request information, for example, the user inputs beauty request information through a stretch bar control, an input interface, and the like. The body beautifying request information may be, but is not limited to, the age of the child corresponding to the requested child body beautifying treatment, or the body length of the child requested to be treated by the child body beautifying treatment.
S602, determining a requested target beauty position according to the beauty request information;
different body beautifying gears are preset in the terminal, and the body beautifying effect is different due to different body beautifying parameters corresponding to each body beautifying gear. For example, the larger the beauty shift position is, the higher the child beautification degree is, and the smaller the age of the treated simulated child is, whereas the smaller the beauty shift position is, the lower the child beautification degree is, and the larger the age of the treated simulated child is.
After receiving the beauty request information input by the user, the terminal can determine the requested target beauty gear according to the beauty request information.
The step of amplifying the head region of the human body in the picture comprises the following steps:
s603, carrying out amplification processing corresponding to the target beauty body gear on the head area of the human body in the picture;
after determining the corresponding target beauty grade according to the above steps, the enlargement processing of the head region may be performed in combination with the target beauty grade. For example, if the target beauty level is larger, the enlargement factor of the head region is larger.
The step of performing a reduction process on the body region includes:
s604, carrying out reduction processing corresponding to the target beauty body position on the body area.
Correspondingly, after the target beauty grade is determined, corresponding reduction processing needs to be carried out in combination with the target beauty grade. For example, as the target beauty level decreases, the reduction coefficient of the body region increases, and the corresponding reduced size decreases.
In addition, the terminal can not only specifically control the child body shaping degree according to the user request, but also limit the limit value of the child body shaping grade, namely, an upper limit maximum value is preset, so that excessive distortion of the effect is avoided. Of course, the maximum value is adjusted according to the actual situation, for example, if an exaggerated special effect is required in the actual situation, the maximum value is larger, and if we want to pursue the nature, the maximum value is smaller without being exaggerated too much.
Corresponding to the above method embodiment, referring to fig. 7, an embodiment of the present disclosure further provides a picture processing apparatus 70, including:
an identifying module 701, configured to identify a head region and a body region of a human body in a picture to be processed, where the body region is a region of the human body other than the head region;
the amplifying module 702 is configured to amplify a head region of a human body in the picture;
a reducing module 703, configured to perform a reducing process on the body region by using the lower boundary line of the head region after the enlarging process as the upper boundary line of the body region.
The apparatus shown in fig. 7 may correspondingly execute the content in the above method embodiment, and details of the part not described in detail in this embodiment refer to the content described in the above method embodiment, which is not described again here.
Referring to fig. 8, an embodiment of the present disclosure also provides an electronic device 80, which includes:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the picture processing method of the foregoing method embodiments.
The disclosed embodiments also provide a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the picture processing method in the foregoing method embodiments.
The disclosed embodiments also provide a computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions that, when executed by a computer, cause the computer to perform the picture processing method in the aforementioned method embodiments.
Referring now to FIG. 8, a block diagram of an electronic device 80 suitable for use in implementing embodiments of the present disclosure is shown. The electronic devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 8, the electronic device 80 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 801 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage means 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the electronic apparatus 80 are also stored. The processing apparatus 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
Generally, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touch pad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, or the like; output devices 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage 808 including, for example, magnetic tape, hard disk, etc.; and a communication device 809. The communication means 809 may allow the electronic device 80 to communicate wirelessly or by wire with other devices to exchange data. While the figures illustrate an electronic device 80 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 809, or installed from the storage means 808, or installed from the ROM 802. The computer program, when executed by the processing apparatus 801, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, enable the electronic device to implement the schemes provided by the method embodiments.
Alternatively, the computer readable medium carries one or more programs, which when executed by the electronic device, enable the electronic device to implement the schemes provided by the method embodiments.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".
It should be understood that portions of the present disclosure may be implemented in hardware, software, firmware, or a combination thereof.
The above description is only for the specific embodiments of the present disclosure, but the scope of the present disclosure is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present disclosure should be covered within the scope of the present disclosure. Therefore, the protection scope of the present disclosure shall be subject to the protection scope of the claims.

Claims (13)

1. An image processing method, comprising:
identifying a head region and a body region of a human body in a picture to be processed, wherein the body region is a region of the human body except the head region;
amplifying the head area of the human body in the picture;
and taking the lower boundary line of the head region after the enlargement processing as the upper boundary line of the body region, and carrying out reduction processing on the body region.
2. The method according to claim 1, wherein the step of identifying the head region and the body region of the human body in the picture to be processed comprises:
according to key points of the human body in the picture, a complete region of the human body is framed and selected;
determining a head center point of the human body, and a height and a width of the head region;
determining a head region of the human body in the full region according to the head center point and the height and width of the head region;
regarding an area other than the head area in the full area as a body area of the human body.
3. The method of claim 2, wherein the step of determining the head center point of the human body and the height and width of the head region comprises:
determining a head central point of the human body according to a target key point of the human body, which is associated with the head;
determining the size of a reference center line of the human body in the picture;
determining a height and a width of the head region based on a size of the reference midline.
4. The method of claim 3, wherein the step of determining the head center point of the human body from the target key points of the human body associated with the head comprises:
identifying eye, nose and ear key points of the human body;
connecting the eye key points, the nose key points and the ear key points to draw key point region graphs;
and determining the geometric center of the key point region graph as the head center point of the human body.
5. The method according to claim 3, wherein the step of determining the size of the reference centerline of the human body in the picture comprises:
determining a shoulder midpoint between two shoulder key points of the human body and a hip midpoint between two hip key points;
determining a reference midline between a shoulder midpoint and a hip midpoint of the human body;
measuring a dimension of a reference midline of the human body.
6. The method of claim 5, wherein said step of determining the height and width of said head region based on the dimensions of said reference midline comprises:
multiplying the size of the reference midline of the human body by a first scaling factor to obtain the width of the head region, and multiplying the size of the reference midline of the human body by a second scaling factor to obtain the height of the head region.
7. The method according to claim 1, wherein the step of magnifying the head region of the human body in the picture comprises:
determining a first direction and a second direction of the head region, wherein the first direction is a direction parallel to a lower boundary line of the head region, and the second direction is a direction perpendicular to the lower boundary line of the head region;
stretching the head region towards two ends along the first direction at the head center point of the head region;
and stretching the head area towards two ends along the second direction at the head central point of the head area.
8. The method according to claim 7, wherein the step of performing a reduction process on the body region with the lower boundary line of the head region subjected to the enlargement process as the upper boundary line of the body region comprises:
determining the lower boundary line of the head region after the amplification treatment as the upper boundary line of the body region stretching, and determining the foot region of the body region as a stretching starting point;
stretching the body region from the stretch starting point toward the upper boundary line such that the body region is scaled down in the first direction and the second direction.
9. The method according to any one of claims 1 to 8, wherein after the step of subjecting the body region to a reduction process, the method further comprises at least one of:
carrying out amplification processing on an eye region of the head region;
adding a blush image layer in the face area of the head area;
performing retraction treatment on a chin region of the head region;
and performing skin tendering and body beautifying treatment on the head area.
10. The method according to claim 9, wherein before the step of magnifying the head region of the human body in the picture, the method further comprises:
receiving body beauty request information;
determining a requested target beauty position according to the beauty request information;
the step of amplifying the head region of the human body in the picture comprises the following steps:
carrying out amplification processing corresponding to the target beauty body gear on the head area of the human body in the picture;
the step of performing a reduction process on the body region includes:
and carrying out reduction processing corresponding to the target beauty body position on the body area.
11. A picture processing apparatus, comprising:
the identification module is used for identifying a head region and a body region of a human body in a picture to be processed, wherein the body region is a region of the human body except the head region;
the amplifying module is used for amplifying the head area of the human body in the picture;
and the reduction module is used for taking the lower boundary line of the head area subjected to the amplification processing as the upper boundary line of the body area and reducing the body area.
12. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the picture processing method of any one of the preceding claims 1-10.
13. A non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the picture processing method of any one of the preceding claims 1-10.
CN202010387800.9A 2020-05-09 2020-05-09 Picture processing method and device and electronic equipment Pending CN111626920A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010387800.9A CN111626920A (en) 2020-05-09 2020-05-09 Picture processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010387800.9A CN111626920A (en) 2020-05-09 2020-05-09 Picture processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN111626920A true CN111626920A (en) 2020-09-04

Family

ID=72259885

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010387800.9A Pending CN111626920A (en) 2020-05-09 2020-05-09 Picture processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111626920A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115862115A (en) * 2022-12-23 2023-03-28 宁波星巡智能科技有限公司 Infant respiration detection area positioning method, device and equipment based on vision

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104463779A (en) * 2014-12-18 2015-03-25 北京奇虎科技有限公司 Portrait caricature generating method and device
CN105869116A (en) * 2016-03-25 2016-08-17 捷开通讯(深圳)有限公司 Mobile terminal and photo processing method
CN106558040A (en) * 2015-09-23 2017-04-05 腾讯科技(深圳)有限公司 Character image treating method and apparatus
CN110288519A (en) * 2019-06-29 2019-09-27 北京字节跳动网络技术有限公司 Image beautification method, device and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104463779A (en) * 2014-12-18 2015-03-25 北京奇虎科技有限公司 Portrait caricature generating method and device
CN106558040A (en) * 2015-09-23 2017-04-05 腾讯科技(深圳)有限公司 Character image treating method and apparatus
CN105869116A (en) * 2016-03-25 2016-08-17 捷开通讯(深圳)有限公司 Mobile terminal and photo processing method
CN110288519A (en) * 2019-06-29 2019-09-27 北京字节跳动网络技术有限公司 Image beautification method, device and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115862115A (en) * 2022-12-23 2023-03-28 宁波星巡智能科技有限公司 Infant respiration detection area positioning method, device and equipment based on vision
CN115862115B (en) * 2022-12-23 2023-08-04 宁波星巡智能科技有限公司 Infant respiration detection area positioning method, device and equipment based on vision

Similar Documents

Publication Publication Date Title
CN110766777B (en) Method and device for generating virtual image, electronic equipment and storage medium
CN110058685B (en) Virtual object display method and device, electronic equipment and computer-readable storage medium
CN111210485B (en) Image processing method and device, readable medium and electronic equipment
CN110069191B (en) Terminal-based image dragging deformation implementation method and device
CN110070495B (en) Image processing method and device and electronic equipment
US20190340726A1 (en) Projection image construction method and device
CN111339971B (en) Human shoulder and neck processing method and device in video and electronic equipment
CN110288532B (en) Method, apparatus, device and computer readable storage medium for generating whole body image
CN115311178A (en) Image splicing method, device, equipment and medium
CN114693876A (en) Digital human generation method, device, storage medium and electronic equipment
CN111753685B (en) Method and device for adjusting facial hairline in image and electronic equipment
CN111626920A (en) Picture processing method and device and electronic equipment
WO2020077912A1 (en) Image processing method, device, and hardware device
CN111311519A (en) Human waist body beautifying processing method and device in video and electronic equipment
CN110264430B (en) Video beautifying method and device and electronic equipment
CN110059739B (en) Image synthesis method, image synthesis device, electronic equipment and computer-readable storage medium
CN111325668A (en) Training method and device for image processing deep learning model and electronic equipment
CN116684394A (en) Media content processing method, apparatus, device, readable storage medium and product
CN116596748A (en) Image stylization processing method, apparatus, device, storage medium, and program product
CN111415306A (en) Method and device for processing human chest body beautification in picture and electronic equipment
CN111583139B (en) Blush adjustment method, blush adjustment device, electronic equipment and computer readable medium
CN111696041B (en) Image processing method and device and electronic equipment
CN111402116A (en) Method and device for processing human waist body beautification in picture and electronic equipment
CN114723600A (en) Method, device, equipment, storage medium and program product for generating cosmetic special effect
CN111415382B (en) Method and device for processing human body arm body beautification in picture and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200904