CN111784604B - Image processing method, device, equipment and computer readable storage medium - Google Patents

Image processing method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN111784604B
CN111784604B CN202010611135.7A CN202010611135A CN111784604B CN 111784604 B CN111784604 B CN 111784604B CN 202010611135 A CN202010611135 A CN 202010611135A CN 111784604 B CN111784604 B CN 111784604B
Authority
CN
China
Prior art keywords
image
pupil area
pupil
liquefaction
optimization
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.)
Active
Application number
CN202010611135.7A
Other languages
Chinese (zh)
Other versions
CN111784604A (en
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 CN202010611135.7A priority Critical patent/CN111784604B/en
Publication of CN111784604A publication Critical patent/CN111784604A/en
Application granted granted Critical
Publication of CN111784604B publication Critical patent/CN111784604B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Landscapes

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

Abstract

The invention provides an image processing method, an image processing device, image processing equipment and a computer readable storage medium, wherein the method comprises the following steps: responding to an image optimization instruction, and acquiring a face image to be processed; determining a pupil area in the face image according to the image optimization instruction, and performing optimization operation on the pupil area to obtain an optimized target image; and displaying the optimized target image. Therefore, the pupil area can be optimized only, the technical problems that the reality of the image is not strong and the appearance is not attractive due to the fact that the whole eye area is optimized are avoided, and user experience can be improved.

Description

Image processing method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of artificial intelligence, and in particular, to an image processing method, apparatus, device, and computer-readable storage medium.
Background
With the development of science and technology, more and more application software goes into the life of users, and the amateur life of the users is gradually enriched, such as short video APP and the like. The user can record life by adopting modes of videos, photos and the like and upload the life on the short-time video APP. However, the type of the video or the photo shot only by the image capturing device of the terminal device is single, which results in poor user experience.
In order to improve the interest of food or pictures, an image processing method is provided in the prior art, and when an image including human face features is acquired, the region of eyes in the image can be automatically amplified, so that the eyes of a user in the acquired image are larger and more attractive, and the user experience is improved.
However, when image processing is performed by the above method, the entire eye area in the image is enlarged, which may result in poor image reality. And when the eyes are enlarged too much, the image may be not beautiful enough, which may result in poor user experience.
Disclosure of Invention
The invention provides an image processing method, an image processing device, image processing equipment and a computer readable storage medium, which are used for solving the technical problems that an image processed by the existing image processing method is not beautiful enough and not strong in reality.
A first aspect of the present invention provides an image processing method, including:
responding to an image optimization instruction, and acquiring a face image to be processed;
determining a pupil area in the face image according to the image optimization instruction, and performing optimization operation on the pupil area to obtain an optimized target image;
and displaying the optimized target image.
In the image processing method provided by this embodiment, the pupil area in the face area of the image to be processed is determined in response to the image optimization instruction sent by the user, the pupil area is optimized, and the optimized target image is displayed. Therefore, the pupil area can be optimized only, the technical problems that the reality of the image is not strong and the appearance is not attractive due to the fact that the whole eye area is optimized are avoided, and user experience can be improved.
In one possible design, the optimizing the pupil area to obtain an optimized target image includes:
carrying out liquefaction operation on the pupil area to obtain a deformation array of each pixel in the pupil area, wherein the deformation array represents the deformation of each pixel on an X/Y axis;
acquiring key point information of eyes in the face image, and generating a smooth mask according to the key point information;
and according to the deformation array and the smooth mask, carrying out amplification operation on the pupil area to obtain an optimized target image.
In one possible design, the value corresponding to the smooth mask is between 0 and 1, and the value of the smooth mask is in direct proportion to the probability that the pixel point belongs to the pupil region;
correspondingly, the amplifying the pupil area according to the deformation array and the smooth mask to obtain an optimized target image includes:
and multiplying the deformation array by the numerical value of the smooth mask, and carrying out amplification operation on the pupil area to obtain an optimized target image.
In one possible design, the performing a liquefaction operation on the pupil region to obtain a set of deformations for each pixel in the pupil region includes:
carrying out liquefaction operation on the pupil area according to preset liquefaction parameters; and/or the presence of a gas in the gas,
and acquiring liquefaction parameters input by a user, and carrying out liquefaction operation on the pupil area according to the liquefaction parameters input by the user to obtain a deformation array of each pixel in the pupil area.
In one possible design, the obtaining the liquefaction parameters input by the user includes:
acquiring a click parameter input by the user in clicking the pupil area in a preset display interface, wherein the click parameter comprises click time and a click position;
and determining the liquefaction parameter according to the click parameter, wherein the click time is in direct proportion to the size of the liquefaction parameter.
In one possible design, the optimizing the pupil area to obtain an optimized target image includes:
obtaining optimization parameters input by a user, wherein the optimization parameters comprise color parameters and pattern parameters;
and carrying out optimization operation on the pupil area according to the optimization parameters to obtain an optimized target image.
In one possible design, the acquiring a face image includes:
responding to an image selection instruction input by a user, wherein the image selection instruction comprises a storage path and an identification of a face image;
acquiring the face image from the storage path according to the image selection instruction; or the like, or, alternatively,
and responding to a shooting instruction input by a user, shooting an image according to the shooting instruction, and obtaining the face image.
In one possible design, the determining the pupil area in the face image according to the image optimization instruction includes:
and acquiring pupil key points in the face image according to the image optimization instruction, determining the central point and the radius of the pupil, and acquiring the pupil area.
The image processing method according to the present embodiment can optimize only the pupil region by performing liquefaction processing on the pupil region, determining the smoothing mask of the eye region, and multiplying the smoothing mask by the deformation group after the liquefaction processing. In addition, by setting the value of the smoothing mask between 0 and 1, the value of the pupil region is close to 1, and the value of the non-pupil region is close to 0, thereby further improving the accuracy of optimization of the pupil region. The technical problems of poor image authenticity and insufficient attractiveness caused by optimization of the whole eye area are avoided, and user experience can be improved.
A second aspect of the present invention provides an image processing apparatus comprising:
the acquisition module is used for responding to the image optimization instruction and acquiring a face image to be processed;
the processing module is used for determining a pupil area in the face image according to the image optimization instruction, and performing optimization operation on the pupil area to obtain an optimized target image;
and the display module is used for displaying the optimized target image.
The image processing apparatus provided in this embodiment determines a pupil area in a face area of an image to be processed by responding to an image optimization instruction sent by a user, performs optimization operation on the pupil area, and displays the optimized target image. Therefore, the pupil area can be optimized only, the technical problems that the reality of the image is not strong and the appearance is not attractive due to the fact that the whole eye area is optimized are avoided, and user experience can be improved.
In one possible design, the processing module is configured to:
the first processing unit is used for carrying out liquefaction operation on the pupil area and obtaining a deformation array of each pixel in the pupil area, wherein the deformation array represents the deformation of each pixel on an X/Y axis;
the second processing unit is used for acquiring key point information of eyes in the face image and generating a smooth mask according to the key point information;
and the third processing unit is used for carrying out amplification operation on the pupil area according to the deformation array and the smooth mask to obtain an optimized target image.
The image processing apparatus according to the present embodiment can optimize only the pupil region by performing liquefaction processing on the pupil region, determining the smoothing mask of the eye region, and multiplying the smoothing mask by the deformation group after the liquefaction processing. The technical problems of poor image authenticity and insufficient attractiveness caused by optimization of the whole eye area are avoided, and user experience can be improved.
In one possible design, the value corresponding to the smooth mask is between 0 and 1, and the value of the smooth mask is in direct proportion to the probability that the pixel point belongs to the pupil region;
accordingly, the third processing unit is configured to:
and multiplying the deformation array by the numerical value of the smooth mask, and carrying out amplification operation on the pupil area to obtain an optimized target image.
In one possible design, the first processing unit is configured to:
carrying out liquefaction operation on the pupil area according to preset liquefaction parameters; and/or the presence of a gas in the gas,
and acquiring liquefaction parameters input by a user, and carrying out liquefaction operation on the pupil area according to the liquefaction parameters input by the user to obtain a deformation array of each pixel in the pupil area.
In one possible design, the first processing unit is configured to:
acquiring a click parameter input by the user in clicking the pupil area in a preset display interface, wherein the click parameter comprises click time and a click position;
and determining the liquefaction parameter according to the click parameter, wherein the click time is in direct proportion to the size of the liquefaction parameter.
In one possible design, the processing module is configured to:
obtaining optimization parameters input by a user, wherein the optimization parameters comprise color parameters and pattern parameters;
and carrying out optimization operation on the pupil area according to the optimization parameters to obtain an optimized target image.
In one possible design, the obtaining module is configured to:
responding to an image selection instruction input by a user, wherein the image selection instruction comprises a storage path and an identification of a face image;
acquiring the face image from the storage path according to the image selection instruction; or the like, or, alternatively,
and responding to a shooting instruction input by a user, shooting an image according to the shooting instruction, and obtaining the face image.
In one possible design, the processing module is configured to:
and acquiring pupil key points in the face image according to the image optimization instruction, determining the central point and the radius of the pupil, and acquiring the pupil area.
A third aspect of the present invention provides an image processing apparatus comprising: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to perform the image processing method according to the first aspect by the processor.
A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon computer-executable instructions for implementing the image processing method according to the first aspect when the computer-executable instructions are executed by a processor.
The image processing method, the image processing device, the image processing equipment and the computer-readable storage medium provided by the invention respond to an image optimization instruction sent by a user, determine a pupil area in a face area of an image to be processed, perform optimization operation on the pupil area, and display an optimized target image. Therefore, the pupil area can be optimized only, the technical problems that the reality of the image is not strong and the appearance is not attractive due to the fact that the whole eye area is optimized are avoided, and user experience can be improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 is a schematic diagram of a network architecture on which the present invention is based;
fig. 2 is a schematic flowchart of an image processing method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an image optimization effect provided by an embodiment of the present invention;
fig. 4 is a schematic flowchart of an image processing method according to a second embodiment of the present invention;
FIG. 5 is a schematic diagram of the setting of liquefaction parameters provided in this embodiment;
fig. 6 is a schematic structural diagram of an image processing apparatus according to a third embodiment of the present invention;
fig. 7 is a schematic structural diagram of an image processing apparatus according to a fourth embodiment of the present invention;
fig. 8 is a schematic structural diagram of an image processing apparatus according to a fifth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other examples obtained based on the examples in the present invention are within the scope of the present invention.
In order to solve the above-mentioned technical problems of poor appearance and poor authenticity of an image processed by the existing image processing method, the invention provides an image processing method, an image processing device, an image processing apparatus and a computer readable storage medium.
It should be noted that the image processing method, apparatus, device and computer-readable storage medium provided in the present application may be applied to scenes in which various human faces are photographed.
The existing image processing method generally enlarges the whole user eye area in the image, and the enlarged eye area may not be matched with other face areas. And the simple amplification operation on the eye area can not change the beautification degree of the eyes and can not meet the requirement of the user on image optimization.
In the face of the problems in the prior art, the inventor finds out through research that the details of the eye area need to be adjusted in order to meet the requirements of users for image optimization. Specifically, the human eyeball is generally divided into a pupil area and an eye white area, and when the pupil area occupies a relatively large area, the human eyeball can appear that the eye is very eye-conscious, and the human eyeball can visually play a role in enlarging the eye.
The inventor further researches and discovers that when a human face image to be processed and an image optimization instruction sent by a terminal device are received, a pupil area in the human face image is specifically determined according to the image optimization instruction, and the pupil area is optimized, so that details of an eye area can be optimized.
Fig. 1 is a schematic diagram of a network architecture based on the present invention, and as shown in fig. 1, the network architecture based on the present invention at least includes: a terminal device 1 and an image processing apparatus 2 mounted on the terminal device 1. Wherein, the testing device 2 is written by C/C + +, Java, Shell or Python; the terminal device 1 may be a desktop computer, a tablet computer, or the like. The terminal device 1 is connected to the image processing apparatus 2 in a communication manner, so that the terminal device 1 and the image processing apparatus 2 can perform information interaction.
Fig. 2 is a schematic flowchart of an image processing method according to an embodiment of the present invention, and as shown in fig. 2, the method includes:
step 101, responding to an image optimization instruction, and acquiring a face image to be processed.
The execution subject of the embodiment is an image processing device which is connected with the terminal equipment in a communication way, so that information interaction can be carried out with the terminal equipment. Alternatively, the image processing apparatus may be installed in the terminal device, or may be an apparatus independent from the terminal device, which is not limited in the present invention.
The image processing device can respond to an image optimization instruction triggered by a user to acquire a face image to be processed. Specifically, the image optimization instruction may be generated by triggering an image optimization icon preset on a display interface of the terminal device by a user, where the triggering may be any one of a single click, a double click, and a long press.
Specifically, on the basis of the above embodiment, the step 101 specifically includes:
responding to an image selection instruction input by a user, wherein the image selection instruction comprises a storage path and an identification of a face image;
acquiring the face image from the storage path according to the image selection instruction; or the like, or, alternatively,
and responding to a shooting instruction input by a user, shooting an image according to the shooting instruction, and obtaining the face image.
In this embodiment, the face image may be acquired from the storage path by the image processing apparatus, or it may also be photographed by the user in real time, which is not limited in the present invention. Specifically, the method can respond to an image selection instruction input by a user, wherein the image selection instruction comprises a storage path and an identification of the face image. And the image processing device can further obtain the face image from the storage path according to the image selection instruction and the identification information.
Alternatively, the image processing apparatus may respond to a shooting instruction input by the user, and may further shoot an image according to the shooting instruction to obtain a face image. When the image processing apparatus is installed in the terminal device, after the shooting instruction is acquired, the terminal device may be controlled to turn on the camera according to the shooting instruction to shoot the image. When the image processing apparatus is an apparatus independent from the terminal device, after receiving the shooting instruction, the shooting instruction may be sent to the terminal device, so that the terminal device performs image shooting according to the received shooting instruction, and sends the shot face image to the image processing apparatus.
And step 102, determining a pupil area in the face image according to the image optimization instruction, and performing optimization operation on the pupil area to obtain an optimized target image.
In this embodiment, in order to optimize details of the eye region, after the face image to be processed and the image optimization instruction are acquired, the position of the pupil region in the face image may be determined according to the image optimization instruction. And then, optimization operation can be carried out on the pupil area only to obtain an optimized image. Optionally, the position information of the pupil region may be determined according to the historical experience value, or a preset network model may be adopted to input the face image into the network model to obtain the position of the pupil region, which is not limited in the present invention. Fig. 3 is a schematic diagram of an image optimization effect provided by an embodiment of the present invention, and as shown in fig. 3, after the optimization operation, the pupil region in the face image can be enlarged, so that a visual effect of eye enlargement is realized, and user experience is improved.
Specifically, on the basis of the foregoing embodiment, step 103 specifically includes:
and acquiring pupil key points in the face image according to the image optimization instruction, determining the central point and the radius of the pupil, and acquiring the pupil area.
In this embodiment, a pupil key point in the face image may be obtained according to the image optimization instruction, and a central point and a radius of a pupil are determined according to the pupil key point, so as to obtain a pupil region. Specifically, the data after labeling the pupil area may be adopted in advance to train a preset model to be trained, so as to obtain a pupil identification model. After the face image is acquired, the face image can be input into the pupil identification model, so that the pupil area can be determined.
And 103, displaying the optimized target image.
In the present embodiment, the pupil area is optimized, and after the target image is obtained, the target image can be displayed. Therefore, after the user views the target image through the display interface, whether the target image needs to be subjected to personalized optimization operation or not can be determined according to the requirement of the user.
In the image processing method provided by this embodiment, the pupil area in the face area of the image to be processed is determined in response to the image optimization instruction sent by the user, the pupil area is optimized, and the optimized target image is displayed. Therefore, the pupil area can be optimized only, the technical problems that the reality of the image is not strong and the appearance is not attractive due to the fact that the whole eye area is optimized are avoided, and user experience can be improved.
Fig. 4 is a schematic flowchart of an image processing method according to a second embodiment of the present invention, and based on any of the above embodiments, as shown in fig. 4, step 102 specifically includes:
step 201, performing liquefaction operation on the pupil area to obtain a deformation array of each pixel in the pupil area, wherein the deformation array represents the deformation of each pixel on an X/Y axis;
step 202, obtaining key point information of eyes in the face image, and generating a smooth mask according to the key point information;
and 203, performing amplification operation on the pupil area according to the deformation array and the smooth mask to obtain an optimized target image.
In this embodiment, in order to implement the optimization operation on the pupil region, first, a liquefaction operation may be performed on the pupil region, and after the liquefaction operation is obtained, a deformation array of each pixel point in the pupil region is obtained, where the deformation array specifically characterizes a deformation size of each pixel on an X/Y axis. The liquefaction operation is particularly useful for magnifying the pupillary region. And aiming at the face image, acquiring key point information of an eye region in the face image, and generating a smooth mask according to the key point information. It should be noted that the method for determining the eye region key point information may be implemented by a preset eye recognition model, which is not limited in the present invention. After the smooth mask and the deformation array are obtained, the amplification operation of the pupil area can be realized according to the smooth mask and the deformation array, and an optimized image is obtained.
Specifically, on the basis of any of the above embodiments, the value corresponding to the smooth mask is between 0 and 1, and the value of the smooth mask is proportional to the probability that the pixel belongs to the pupil region;
correspondingly, step 202 specifically includes:
and multiplying the deformation array by the numerical value of the smooth mask, and carrying out amplification operation on the pupil area to obtain an optimized target image.
In this embodiment, the value corresponding to the smooth mask is specifically between 0 and 1, and the more the value tends to 1, the greater the probability that the pixel point belongs to the pupil region is, and the more the value tends to 0, the greater the probability that the pixel point belongs to the eye white is. Based on the numerical values, the deformation array can be multiplied by the numerical value of the smooth mask, so that the accurate optimization operation of the pupil area is realized, and the optimized target image is obtained. For example, in practical applications, in the smoothing mask, the numerical value of the pupil region may be specifically 1, and the numerical value of the non-pupil region may be specifically 0, and by multiplying the deformation array by the numerical value of the smoothing mask, the numerical value of the deformation array of the pupil region is unchanged, and the deformation array of the non-pupil region is 0, so that the optimization operation of only the pupil region can be realized.
Further, on the basis of any of the above embodiments, step 201 specifically includes:
carrying out liquefaction operation on the pupil area according to preset liquefaction parameters; and/or the presence of a gas in the gas,
and acquiring liquefaction parameters input by a user, and carrying out liquefaction operation on the pupil area according to the liquefaction parameters input by the user to obtain a deformation array of each pixel in the pupil area.
In this embodiment, the liquefaction parameter corresponding to the liquefaction operation may be a preset empirical value or a numerical value manually set by a user. Specifically, the liquefaction operation may be performed on the pupil region according to preset liquefaction parameters, wherein the preset liquefaction parameters may be set according to historical experience.
Optionally, a liquefaction parameter input by a user may also be acquired, and a liquefaction operation on the pupil region is implemented according to the liquefaction parameter input by the user, so as to obtain a deformation array of each pixel in the pupil region.
The two embodiments described above may be implemented individually or in combination. When the liquefaction operation is performed separately, the specific implementation may be as described in the above embodiments, and when the liquefaction operation is performed in combination, the liquefaction operation may be performed on the pupil region by using preset liquefaction parameters, and a result after the liquefaction operation is displayed to a user, so that whether the personalized liquefaction operation is required or not may be determined according to the result. When the user needs to perform personalized adjustment, the liquefaction parameters input by the user are obtained, the liquefaction operation of the pupil area is realized according to the liquefaction parameters input by the user, and the deformation array of each pixel in the pupil area is obtained.
Further, on the basis of any one of the above embodiments, the acquiring the liquefaction parameter input by the user includes:
acquiring a click parameter input by the user in clicking the pupil area in a preset display interface, wherein the click parameter comprises click time and a click position;
and determining the liquefaction parameter according to the click parameter, wherein the click time is in direct proportion to the size of the liquefaction parameter.
In this embodiment, the user may specifically realize the input of the liquefaction parameter through human-computer interaction. Fig. 5 is a schematic view illustrating setting of a liquefaction parameter provided in this embodiment, and as shown in fig. 5, a user may click on a pupil area in a face image to generate a click parameter. The click parameters specifically include click time and click position. And the image processing device may determine the liquefaction parameter based on the click parameter. For example, the longer the user clicks on the pupil region, the larger the size characterizing the user's need to zoom in. In addition, the click position can be a pupil center area or a pupil edge area, and the user can realize optimization of the pupil shape by clicking different areas.
As a practical implementation manner, on the basis of any of the foregoing embodiments, the step 102 specifically includes:
obtaining optimization parameters input by a user, wherein the optimization parameters comprise color parameters and pattern parameters;
and carrying out optimization operation on the pupil area according to the optimization parameters to obtain an optimized target image.
In this embodiment, in addition to the mode of implementing image optimization by enlarging the pupil area, the optimization of the pupil area can be implemented by changing the color of the pupil in the face image, adding patterns to the pupil, and the like. Specifically, optimization parameters input by a user may be obtained, and the optimization parameters include color parameters and pattern parameters. And further, the optimization operation of the pupil area can be realized according to the optimization parameters, and an optimized target image is obtained. For example, in practical application, the pupil area can be optimized to be blue according to the optimized parameters input by the user, so that the visual effect of mixed blood is created, the beautification degree of the image is improved, and the user experience can be further improved.
The image processing method according to the present embodiment can optimize only the pupil region by performing liquefaction processing on the pupil region, determining the smoothing mask of the eye region, and multiplying the smoothing mask by the deformation group after the liquefaction processing. In addition, by setting the value of the smoothing mask between 0 and 1, the value of the pupil region is close to 1, and the value of the non-pupil region is close to 0, thereby further improving the accuracy of optimization of the pupil region. The technical problems of poor image authenticity and insufficient attractiveness caused by optimization of the whole eye area are avoided, and user experience can be improved.
Fig. 6 is a schematic structural diagram of an image processing apparatus according to a third embodiment of the present invention, and as shown in fig. 6, the apparatus includes: the system comprises an acquisition module 31, a processing module 32 and a sending module 33, wherein a face image to be processed is acquired in response to an image optimization instruction; the processing module 32 is configured to determine a pupil area in the face image according to the image optimization instruction, perform optimization operation on the pupil area, and obtain an optimized target image; and a display module 33, configured to display the optimized target image.
Further, on the basis of any of the above embodiments, the obtaining module is configured to:
responding to an image selection instruction input by a user, wherein the image selection instruction comprises a storage path and an identification of a face image;
acquiring the face image from the storage path according to the image selection instruction; or the like, or, alternatively,
and responding to a shooting instruction input by a user, shooting an image according to the shooting instruction, and obtaining the face image.
Further, on the basis of any of the above embodiments, the processing module is configured to:
and acquiring pupil key points in the face image according to the image optimization instruction, determining the central point and the radius of the pupil, and acquiring the pupil area.
The image processing apparatus provided in this embodiment determines a pupil area in a face area of an image to be processed by responding to an image optimization instruction sent by a user, performs optimization operation on the pupil area, and displays the optimized target image. Therefore, the pupil area can be optimized only, the technical problems that the reality of the image is not strong and the appearance is not attractive due to the fact that the whole eye area is optimized are avoided, and user experience can be improved.
Fig. 7 is a schematic structural diagram of an image processing apparatus according to a fourth embodiment of the present invention, where on the basis of the third embodiment, the processing module includes: a first processing unit 41, a second processing unit 42, and a third processing unit 43, where the first processing unit 41 is configured to perform a liquefaction operation on the pupil area to obtain a deformation array of each pixel in the pupil area, where the deformation array represents a deformation size of each pixel in an X/Y axis; the second processing unit 42 is configured to obtain key point information of eyes in the face image, and generate a smooth mask according to the key point information; a third processing unit 43, configured to perform an enlarging operation on the pupil area according to the deformation group and the smooth mask, so as to obtain an optimized target image.
Further, on the basis of any of the above embodiments, the value corresponding to the smooth mask is between 0 and 1, and the value of the smooth mask is proportional to the probability that the pixel belongs to the pupil region;
accordingly, the third processing unit is configured to:
and multiplying the deformation array by the numerical value of the smooth mask, and carrying out amplification operation on the pupil area to obtain an optimized target image.
Further, on the basis of any of the above embodiments, the first processing unit is configured to:
carrying out liquefaction operation on the pupil area according to preset liquefaction parameters; and/or the presence of a gas in the gas,
and acquiring liquefaction parameters input by a user, and carrying out liquefaction operation on the pupil area according to the liquefaction parameters input by the user to obtain a deformation array of each pixel in the pupil area.
Further, on the basis of any of the above embodiments, the first processing unit is configured to:
acquiring a click parameter input by the user in clicking the pupil area in a preset display interface, wherein the click parameter comprises click time and a click position;
and determining the liquefaction parameter according to the click parameter, wherein the click time is in direct proportion to the size of the liquefaction parameter.
Further, on the basis of any of the above embodiments, the processing module is configured to:
obtaining optimization parameters input by a user, wherein the optimization parameters comprise color parameters and pattern parameters;
and carrying out optimization operation on the pupil area according to the optimization parameters to obtain an optimized target image.
The image processing apparatus that this embodiment provided, through carrying out liquefaction processing to the pupil region, confirm the smooth mask in eye region, multiply through the deformation group with smooth mask and liquefaction processing after to can only optimize the pupil region, avoid because optimizing whole eye region and cause the image authenticity weak, not enough pleasing to the eye technical problem, and then can improve user experience.
Fig. 8 is a schematic structural diagram of an image processing apparatus according to a fifth embodiment of the present invention, and as shown in fig. 8, the image processing apparatus includes: a memory 51, a processor 52;
a memory 51; a memory 51 for storing instructions executable by the processor 52;
wherein the processor 52 is configured to execute the image processing method according to any of the above embodiments by the processor 52.
The memory 51 stores programs. In particular, the program may include program code comprising computer operating instructions. The memory 51 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The processor 52 may be a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention.
Alternatively, in a specific implementation, if the memory 51 and the processor 52 are implemented independently, the memory 51 and the processor 52 may be connected to each other through a bus and perform communication with each other. The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
Alternatively, in a specific implementation, if the memory 51 and the processor 52 are integrated on a chip, the memory 51 and the processor 52 may complete the same communication through an internal interface.
The invention further provides a computer-readable storage medium, in which computer-executable instructions are stored, and the computer-executable instructions are executed by a processor to implement the image processing method according to any one of the above embodiments.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working process of the apparatus described above may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (14)

1. An image processing method, comprising:
responding to an image optimization instruction, and acquiring a face image to be processed;
determining a pupil area in the face image according to the image optimization instruction, and performing optimization operation on the pupil area to obtain an optimized target image;
displaying the optimized target image;
the optimizing operation of the pupil area to obtain the optimized target image includes:
carrying out liquefaction operation on the pupil area to obtain a deformation array of each pixel in the pupil area, wherein the deformation array represents the deformation of each pixel on an X/Y axis;
acquiring key point information of eyes in the face image, and generating a smooth mask according to the key point information;
according to the deformation array and the smooth mask, carrying out amplification operation on the pupil area to obtain an optimized target image;
the numerical value corresponding to the smooth mask is between 0 and 1, and the numerical value of the smooth mask is in direct proportion to the probability that the pixel point belongs to the pupil region;
correspondingly, the amplifying the pupil area according to the deformation array and the smooth mask to obtain an optimized target image includes:
and multiplying the deformation array by the numerical value of the smooth mask, and carrying out amplification operation on the pupil area to obtain an optimized target image.
2. The method of claim 1, wherein the performing a liquefaction operation on the pupil region to obtain a set of deformations for each pixel in the pupil region comprises:
carrying out liquefaction operation on the pupil area according to preset liquefaction parameters; and/or the presence of a gas in the gas,
and acquiring liquefaction parameters input by a user, and carrying out liquefaction operation on the pupil area according to the liquefaction parameters input by the user to obtain a deformation array of each pixel in the pupil area.
3. The method of claim 2, wherein the obtaining user-entered liquefaction parameters comprises:
acquiring a click parameter input by the user in clicking the pupil area in a preset display interface, wherein the click parameter comprises click time and a click position;
and determining the liquefaction parameter according to the click parameter, wherein the click time is in direct proportion to the size of the liquefaction parameter.
4. The method of claim 1, wherein the optimizing the pupil region to obtain an optimized target image comprises:
obtaining optimization parameters input by a user, wherein the optimization parameters comprise color parameters and pattern parameters;
and carrying out optimization operation on the pupil area according to the optimization parameters to obtain an optimized target image.
5. The method according to any one of claims 1 to 4, wherein the acquiring the face image to be processed comprises:
responding to an image selection instruction input by a user, wherein the image selection instruction comprises a storage path and an identification of a face image;
acquiring the face image from the storage path according to the image selection instruction; or the like, or, alternatively,
and responding to a shooting instruction input by a user, shooting an image according to the shooting instruction, and obtaining the face image.
6. The method according to any one of claims 1-4, wherein the determining the pupil area in the face image according to the image optimization instruction comprises:
and acquiring pupil key points in the face image according to the image optimization instruction, determining the central point and the radius of the pupil, and acquiring the pupil area.
7. An image processing apparatus characterized by comprising:
the acquisition module is used for responding to the image optimization instruction and acquiring a face image to be processed;
the processing module is used for determining a pupil area in the face image according to the image optimization instruction, and performing optimization operation on the pupil area to obtain an optimized target image;
the display module is used for displaying the optimized target image;
the processing module is configured to:
the first processing unit is used for carrying out liquefaction operation on the pupil area and obtaining a deformation array of each pixel in the pupil area, wherein the deformation array represents the deformation of each pixel on an X/Y axis;
the second processing unit is used for acquiring key point information of eyes in the face image and generating a smooth mask according to the key point information;
the third processing unit is used for carrying out amplification operation on the pupil area according to the deformation array and the smooth mask to obtain an optimized target image;
the numerical value corresponding to the smooth mask is between 0 and 1, and the numerical value of the smooth mask is in direct proportion to the probability that the pixel point belongs to the pupil region;
accordingly, the third processing unit is configured to:
and multiplying the deformation array by the numerical value of the smooth mask, and carrying out amplification operation on the pupil area to obtain an optimized target image.
8. The apparatus of claim 7, wherein the first processing unit is configured to:
carrying out liquefaction operation on the pupil area according to preset liquefaction parameters; and/or the presence of a gas in the gas,
and acquiring liquefaction parameters input by a user, and carrying out liquefaction operation on the pupil area according to the liquefaction parameters input by the user to obtain a deformation array of each pixel in the pupil area.
9. The apparatus of claim 8, wherein the first processing unit is configured to:
acquiring a click parameter input by the user in clicking the pupil area in a preset display interface, wherein the click parameter comprises click time and a click position;
and determining the liquefaction parameter according to the click parameter, wherein the click time is in direct proportion to the size of the liquefaction parameter.
10. The apparatus of claim 7, wherein the processing module is configured to:
obtaining optimization parameters input by a user, wherein the optimization parameters comprise color parameters and pattern parameters;
and carrying out optimization operation on the pupil area according to the optimization parameters to obtain an optimized target image.
11. The apparatus of any one of claims 7-10, wherein the obtaining module is configured to:
responding to an image selection instruction input by a user, wherein the image selection instruction comprises a storage path and an identification of a face image;
acquiring the face image from the storage path according to the image selection instruction; or the like, or, alternatively,
and responding to a shooting instruction input by a user, shooting an image according to the shooting instruction, and obtaining the face image.
12. The apparatus according to any one of claims 7-10, wherein the processing module is configured to:
and acquiring pupil key points in the face image according to the image optimization instruction, determining the central point and the radius of the pupil, and acquiring the pupil area.
13. An image processing apparatus characterized by comprising: a memory, a processor;
a memory; a memory for storing the processor-executable instructions;
wherein the processor is configured to perform the image processing method of any one of claims 1-6 by the processor.
14. A computer-readable storage medium having computer-executable instructions stored therein, which when executed by a processor, are configured to implement the image processing method of any one of claims 1 to 6.
CN202010611135.7A 2020-06-29 2020-06-29 Image processing method, device, equipment and computer readable storage medium Active CN111784604B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010611135.7A CN111784604B (en) 2020-06-29 2020-06-29 Image processing method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010611135.7A CN111784604B (en) 2020-06-29 2020-06-29 Image processing method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111784604A CN111784604A (en) 2020-10-16
CN111784604B true CN111784604B (en) 2022-02-18

Family

ID=72761283

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010611135.7A Active CN111784604B (en) 2020-06-29 2020-06-29 Image processing method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111784604B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112733794B (en) * 2021-01-22 2021-10-15 腾讯科技(深圳)有限公司 Method, device and equipment for correcting sight of face image and storage medium
CN114331824A (en) * 2021-12-30 2022-04-12 北京字跳网络技术有限公司 Image processing method, image processing device, electronic equipment and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105631391B (en) * 2014-11-05 2019-03-22 联芯科技有限公司 A kind of image processing method and system for realizing eyes amplification
CN105608722B (en) * 2015-12-17 2018-08-31 成都品果科技有限公司 It is a kind of that pouch method and system are gone based on face key point automatically
CA3053571A1 (en) * 2017-02-23 2018-08-30 Magic Leap, Inc. Display system with variable power reflector
CN107705248A (en) * 2017-10-31 2018-02-16 广东欧珀移动通信有限公司 Image processing method, device, electronic equipment and computer-readable recording medium
CN109523461A (en) * 2018-11-09 2019-03-26 北京达佳互联信息技术有限公司 Method, apparatus, terminal and the storage medium of displaying target image
CN110378839A (en) * 2019-06-28 2019-10-25 北京字节跳动网络技术有限公司 Face image processing process, device, medium and electronic equipment
CN111340691B (en) * 2020-03-27 2024-06-04 北京达佳互联信息技术有限公司 Image processing method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111784604A (en) 2020-10-16

Similar Documents

Publication Publication Date Title
CN110675310B (en) Video processing method and device, electronic equipment and storage medium
US10410327B2 (en) Shallow depth of field rendering
US11132770B2 (en) Image processing methods and apparatuses, computer readable storage media and electronic devices
US20190206031A1 (en) Facial Contour Correcting Method and Device
US9838616B2 (en) Image processing method and electronic apparatus
JP2017059235A (en) Apparatus and method for adjusting brightness of image
CN108810406B (en) Portrait light effect processing method, device, terminal and computer readable storage medium
CN112019739A (en) Shooting control method and device, electronic equipment and storage medium
CN111784604B (en) Image processing method, device, equipment and computer readable storage medium
WO2023030139A1 (en) Image fusion method, electronic device, and storage medium
JP2014048766A (en) Image generating device, image generating method, and program
CN111340691B (en) Image processing method, device, electronic equipment and storage medium
CN111182212A (en) Image processing method, image processing apparatus, storage medium, and electronic device
CN111066026A (en) Techniques for providing virtual light adjustments to image data
WO2023001110A1 (en) Neural network training method and apparatus, and electronic device
CN117891330A (en) Screen display control method and device of intelligent glasses, computer equipment and medium
CN115037867B (en) Shooting method, shooting device, computer readable storage medium and electronic equipment
CN113938597B (en) Face recognition method, device, computer equipment and storage medium
WO2020020172A1 (en) Method for adjusting output parameters for multimedia information, terminal and storage medium
CN112561787A (en) Image processing method, image processing device, electronic equipment and storage medium
US8223220B2 (en) Image processing device, image processing method, and information storage medium
CN114092323A (en) Image processing method, image processing device, storage medium and electronic equipment
CN117459828B (en) Remote control self-timer method and device, computer equipment and storage medium
CN113489901B (en) Shooting method and device thereof
US20240331264A1 (en) Systems, Devices, and Methods for Generating a Display

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
GR01 Patent grant
GR01 Patent grant