CN114387157A - Image processing method and device and computer readable storage medium - Google Patents

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

Info

Publication number
CN114387157A
CN114387157A CN202111672535.XA CN202111672535A CN114387157A CN 114387157 A CN114387157 A CN 114387157A CN 202111672535 A CN202111672535 A CN 202111672535A CN 114387157 A CN114387157 A CN 114387157A
Authority
CN
China
Prior art keywords
face
distance
thinning
target
image
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
CN202111672535.XA
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Priority to CN202111672535.XA priority Critical patent/CN114387157A/en
Publication of CN114387157A publication Critical patent/CN114387157A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • G06T3/04
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06T5/77
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/57Mechanical or electrical details of cameras or camera modules specially adapted for being embedded in other devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/222Studio circuitry; Studio devices; Studio equipment
    • H04N5/262Studio circuits, e.g. for mixing, switching-over, change of character of image, other special effects ; Cameras specially adapted for the electronic generation of special effects
    • H04N5/2628Alteration of picture size, shape, position or orientation, e.g. zooming, rotation, rolling, perspective, translation
    • 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/10004Still image; Photographic image
    • 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

Abstract

The embodiment of the invention discloses an image processing method, an image processing device and a computer readable storage medium, which are used for meeting the face thinning requirement of photographing for multiple people. The method provided by the embodiment of the invention comprises the following steps: acquiring an image acquired by an image acquisition device; recognizing a face in the image, and acquiring the distance between a shooting object corresponding to the face and the image acquisition device when the image acquisition device acquires the image; and carrying out face thinning processing on the human face based on a preset face thinning strategy and the distance. The face thinning processing is carried out on the faces which are identified in a targeted manner through the distance, the problem that the face size is not uniform due to different distances between the shooting object and the image acquisition device in the group photo can be coordinated and processed, the face thinning requirement of multiple people can be met, face thinning processing does not need to be carried out on the faces one by one, and the face thinning processing method has the advantages of being intelligent and efficient.

Description

Image processing method and device and computer readable storage medium
Technical Field
The present invention relates to the field of image technologies, and in particular, to an image processing method and apparatus, and a computer-readable storage medium.
Background
In the modern times, people seek to be thin and beautiful, so various image beautifying processes are developed and widely applied, and especially the beautifying process of human faces is embodied on various intelligent devices.
However, for group photography, the face size in the image is greatly different due to the existing image beautification processing, and the demand of multiple people is difficult to meet.
Disclosure of Invention
The embodiment of the invention provides image processing, an image processing device and a computer readable storage medium, which are used for face thinning requirements of photographing for multiple people.
In a first aspect, an embodiment of the present invention provides an image processing method, where the method includes:
acquiring an image acquired by an image acquisition device;
recognizing a face in the image, and acquiring the distance between a shooting object corresponding to the face and the image acquisition device when the image acquisition device acquires the image;
and carrying out face thinning processing on the human face based on a preset face thinning strategy and the distance.
Optionally, based on predetermine face thinning strategy with the distance is right face thinning is handled to people's face, include:
performing face thinning processing on all the faces identified in the image based on the corresponding distances respectively; or the like, or, alternatively,
acquiring feature information of the human face;
and if the characteristic information of the target face in the face meets a preset condition, performing face thinning processing on the target face based on the distance.
Optionally, the feature information includes the distance and/or a size ratio of the face in the image.
Optionally, if the feature information of the target face in the face meets a preset condition, performing face thinning processing on the target face based on the distance, including:
and if the distance corresponding to the target face in the faces is smaller than a target distance, performing face thinning processing on the target face based on the distance corresponding to the target face, wherein the target distance is an average value of distances between all faces identified in the image and the image acquisition device when the image is acquired.
Optionally, if the feature information of the target face in the face meets a preset condition, performing face thinning processing on the target face based on the distance, including:
and if the size ratio corresponding to the target face in the faces is larger than the target size ratio, performing face thinning processing on the target face based on the distance corresponding to the target face, wherein the target size ratio is the average size ratio of all faces identified in the image.
Optionally, if the feature information of the target face in the face meets a preset condition, performing face thinning processing on the target face based on the distance, including:
if the distance corresponding to the target face in the face is smaller than the target distance and the size ratio corresponding to the target face in the face is larger than the target size ratio, performing face thinning processing on the target face based on the distance corresponding to the target face, wherein the target distance is an average value of distances between all faces recognized in the image and the image acquired by the image acquisition device, and the target size ratio is an average size ratio of all faces recognized in the image.
Optionally, the method further includes:
acquiring a user instruction;
selecting a target face-thinning mode from a plurality of face-thinning modes based on the user instruction;
based on predetermine thin face tactics with the distance is right face is thin face and is handled, include:
and carrying out face thinning processing on the human face based on a preset face thinning strategy, the target face thinning mode and the distance.
Optionally, based on predetermine face thinning strategy with the distance is right face thinning is handled to people's face, include:
acquiring a mapping relation between a preset distance and a face thinning proportion coefficient, and performing face thinning processing on the human face based on a preset face thinning strategy, the mapping relation and the distance; or the like, or, alternatively,
and inputting the distance into a preset face-thinning model to obtain a face-thinning strategy based on the distance, and performing face-thinning processing on the human face based on the preset face-thinning strategy and the face-thinning strategy based on the distance.
In a second aspect, an embodiment of the present invention provides an image processing apparatus, where the distance detection apparatus includes:
a memory for storing a computer program;
a processor for implementing the steps of the method of the first aspect when executing the computer program stored in the memory.
In a third aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of the method in the first aspect.
The embodiment of the invention provides an image processing method, an image processing device and a computer readable storage medium, wherein the method can further acquire the distance between a corresponding shooting object and an image acquisition device when a human face is acquired by identifying an image acquired by an image acquisition device, so that the human face can be thinned based on a preset face thinning strategy and the distance. Therefore, the face thinning processing is carried out on the face which is identified in a targeted manner through the distance, the problem that the face size is not uniform due to different distances between the shooting object and the image acquisition device in the group photo can be coordinated and processed, the face thinning requirement of multiple people can be met, the face thinning processing is not required to be carried out on the faces one by one, and the face thinning processing method has the characteristics of intelligence and high efficiency.
Drawings
Fig. 1 is a schematic flowchart of an image processing method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present invention.
Detailed Description
The embodiment of the invention provides an image processing method, an image processing device and a computer-readable storage medium, which are used for realizing quick search.
In order to make the technical solutions of the present invention better understood, 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 only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It can be understood that, during the shooting process, due to the principle of the near-far distance, the near-near object will appear larger, and the far-near object will appear smaller relatively. Under the condition of taking pictures by multiple persons, because the standing positions of the persons are different, the distances between each person and the image acquisition device are different, so that the occupation ratios of the figures in the pictures are different, particularly, the near-end person of the body image acquisition device easily forms a large face, the size of the face of the person is different from that of the far-end person of the body image acquisition device, the generated pictures are easily unpleasant for the near-end person of the body image acquisition device, and particularly, the times of slimming are beautiful nowadays.
Based on this, embodiments of the present invention provide a face slimming method, an apparatus, and a computer-readable storage medium, where the face slimming method identifies an image acquired by an image acquisition apparatus, and can further obtain a distance between a shooting object corresponding to a face when the face is acquired and the image acquisition apparatus when the face is identified, so that the face can be thinned based on a preset face slimming policy and the distance. Therefore, the face thinning processing is carried out on the face which is identified in a targeted manner through the distance, the problem that the face size is not uniform due to different distances between the shooting object and the image acquisition device in the group photo can be coordinated and processed, the face thinning requirement of multiple people can be met, the face thinning processing is not required to be carried out on the faces one by one, and the face thinning processing method has the characteristics of intelligence and high efficiency.
The method can be applied to any electronic equipment with an image processing function, such as a mobile phone, a tablet, a camera, a desktop computer, a laptop computer, an intelligent wearable electronic equipment and the like. Further, the electronic equipment can also have an image acquisition function so as to realize the integrated presentation of image acquisition and processing in the same product. Of course, it may be understood that the two functions may also be embodied in different products, but the electronic device with the image processing function may obtain the related information obtained by the electronic device with the image acquisition function, and the embodiment of the present invention is not limited in any way here.
Still further, at least one of the electronic device with the image acquisition function and the electronic device with the image processing function may further have a distance detection function to realize multi-functional integration. Of course, it may be understood that the distance detection function may also be embodied in a product other than the electronic device with the image acquisition function and the electronic device with the image processing function, but at least one of the electronic device with the image acquisition function and the electronic device with the image processing function may acquire the related information acquired by the electronic device with the distance detection function, so that the electronic device with the image processing function may perform face thinning processing based on the related information acquired by the electronic device with the distance detection function, which is not limited in any way in the embodiment of the present invention.
It should be noted that, when the electronic devices are different products, the electronic devices may be connected to each other in a communication manner to achieve information interaction, or obtain related information based on a form such as an SD card.
For convenience of understanding, a detailed flow in an embodiment of the present invention is described below, and with reference to fig. 1, an image processing method in an embodiment of the present invention includes:
01: acquiring an image acquired by an image acquisition device;
02: recognizing a face in the image, and acquiring the distance between a shooting object corresponding to the face and the image acquisition device when the image acquisition device acquires the image;
03: and carrying out face thinning processing on the human face based on a preset face thinning strategy and the distance.
The image processing method in this embodiment may be implemented by an image processing apparatus (that is, the electronic device with an image processing function) that may acquire an image acquired by an image acquisition apparatus. The image acquisition device may be integrated with or independent from the image processing device, and the image acquisition device may include, but is not limited to, a mobile phone, a tablet, a camera, and a smart wearable electronic device.
Specifically, after the image acquired by the image acquisition device is acquired, the face in the image can be identified, so that the face can be effectively and pertinently thinned. The face recognition method may refer to an image recognition method in the related art, for example, a face recognition model obtained by machine learning is used to recognize an image, which is not described herein again.
After the face in the image is identified, the distance between the corresponding shooting object and the image acquisition device when the face is acquired can be acquired. The distance between the corresponding shot object of each recognized face and the image acquisition device during the acquisition may also be the distance between the corresponding shot object of each recognized face and the image acquisition device during the acquisition, which may be determined specifically according to the requirement of face thinning processing, and the selection may be based on a predetermined rule, or selected by a user, which is not specifically limited herein.
In some embodiments, the image capturing device may be a device with a binocular camera, so as to be able to use the image captured by the image capturing device and obtain the distance between the corresponding shooting object of the human face and the image capturing device when capturing the human face based on the principle of image parallax.
In other embodiments, the image capturing device may be supported on a mobile device, and the movement of the mobile device may change the position of the image capturing device and make the image capturing device take pictures at different positions to achieve the effect of binocular shooting, so as to obtain the distance between the shooting object corresponding to the face and the image capturing device when the face is captured based on the principle of image parallax, and the mobile device may be, for example, a pan/tilt head.
In other embodiments, a distance detection device may be mounted on the image acquisition device to obtain a distance between a corresponding shooting object of the human face and the image acquisition device when the human face is acquired by the distance detection device, a sensing range of the distance detection device may cover a sensing range of the image acquisition device, and the distance detection device may be, for example, a time of flight TOF sensor or a laser radar.
Further, after the corresponding distance is obtained, face thinning processing can be performed on the corresponding face based on a preset face thinning strategy and the obtained corresponding distance. Therefore, the problem of the distance of the human faces in the multi-person picture caused by the distance can be solved through the intervention of the distance factor, the human face occupation ratio of the shooting object at the near end of the body image acquisition device in the picture is smaller than the human face occupation ratio of the shooting object at the far end of the body image acquisition device in the picture, and the face slimming requirement of the multi-person shooting is met.
In some embodiments, the face thinning processing based on the preset face thinning policy and the distance may include: and acquiring a mapping relation between a preset distance and a face thinning proportion coefficient, and thinning the face of the human face based on a preset face thinning strategy, the mapping relation and the distance. Specifically, to each predetermined distance, the face-thinning effect that a plurality of face-thinning scale coefficients correspond can be tested in advance, and after adjusting reasonable face-thinning scale coefficients, the mapping relation between the predetermined distance and the reasonable face-thinning scale coefficients that correspond is stored locally or in the high in the clouds in a form such as a table, so that after the distance that the face that needs face-thinning processing at present corresponds is obtained, corresponding face-thinning scale coefficients can be found in the form such as a table based on the distance, and face-thinning processing is performed on the face based on the face-thinning scale coefficients and a predetermined face-thinning strategy.
In other embodiments, the face thinning processing based on the preset face thinning policy and the distance may include: and inputting the distance into a preset face-thinning model to obtain a face-thinning strategy based on the distance, and performing face-thinning processing on the human face based on the preset face-thinning strategy and the face-thinning strategy based on the distance. Specifically, a face-thinning model associated with a distance can be trained in advance by machine learning, and the face-thinning model can be stored locally or in a cloud, so that after the distance corresponding to the face needing face-thinning processing currently is obtained, the distance can be input into the face-thinning model, a face-thinning strategy based on the distance is obtained, such as a face-thinning scale coefficient, and the face-thinning processing is performed on the face based on the distance and based on a preset face-thinning strategy. The lean face model associated with the distance is trained in advance by using machine learning, and the relevant machine learning technology can be referred to, which is not described herein again.
It can be understood that after the face-thinning model is trained, the face-thinning model can be continuously optimized based on the distance-based face-thinning strategy obtained by current face-thinning processing, so that the training sample of the face-thinning model is continuously increased, and the accuracy of the distance-based face-thinning strategy output by the face-thinning model is improved.
Wherein, predetermine face thinning strategy can preset, also can be by user-defined, should predetermine face thinning strategy and lie in carrying out the management and control to the quantity that face thinning was handled to the people's face of discerning to satisfy different face thinning demands, reach the different beautification effect of photo. How to perform face thinning processing on the human face based on the preset face thinning strategy and the distance is described as follows:
in some embodiments, the face thinning processing based on the preset face thinning policy and the distance may include: and performing face thinning processing on all the faces identified in the image based on the corresponding distances. That is, each face recognized in the image is subjected to face thinning processing based on the corresponding distance. It can be understood that, when a plurality of faces are recognized, since the distances between the corresponding shot objects and the image acquisition devices of the faces are different when the faces are acquired, the problem that the faces account for different sizes in the images is already caused, so that when face-thinning processing is performed based on the distances, the face-thinning degrees of the faces should be different, so as to keep the harmony of the proportion of the shot objects near the body image acquisition devices in the images and the proportion of the shot objects far from the body image acquisition devices in the images as much as possible, for example, the face-thinning degree may be inversely related to the distances.
In other embodiments, the face thinning processing based on the preset face thinning policy and the distance may include: acquiring feature information of the human face; and if the characteristic information of the target face in the face meets a preset condition, performing face thinning processing on the target face based on the distance. That is, each face recognized in the image is not necessarily subjected to face thinning processing based on the corresponding distance, and is specifically determined according to a comparison result between the feature information of the target face in the face and the preset condition.
Wherein the feature information comprises the distance and/or the size ratio of the human face in the image. As in some embodiments, the distance may be used to determine whether there is a target face that needs to be face thinned; in other embodiments, the size ratio of the human face in the image can be used to determine whether a target human face needing face thinning processing exists; in other embodiments, the distance and the size ratio of the face in the image can be used simultaneously to determine whether the target face needing face thinning processing exists. The specific selection method may be preset or may be customized by the user, and is not specifically limited herein.
Several ways of face thinning processing for the target face are respectively described below:
1. if the feature information of the target face in the face meets a preset condition, performing face thinning processing on the face meeting the target face based on the distance may include: and if the distance corresponding to the target face in the faces is smaller than a target distance, performing face thinning processing on the target face based on the distance corresponding to the target face, wherein the target distance is an average value of distances between all faces identified in the image and the image acquisition device when the image is acquired.
Specifically, when determining whether a target face needing face thinning processing exists by using the distance, the preset condition may be that the distance corresponding to the target face is smaller than the target distance. After the distance corresponding to the recognized face is obtained, the distance may be compared with a target distance, and if the distance is smaller than the target distance, it means that the face corresponding to the distance has a possibility of a large face proportion in the image, and the face corresponding to the distance is a target face if the face proportion in the image is possibly different from the face proportions of other shooting objects, and is relatively inconsistent, and the face corresponding to the distance is also used for face thinning processing of the target face. Therefore, face thinning processing can be performed based on pertinence instead of face thinning of the identified face in a whole disc, so that the face thinning processing method is beneficial to reducing the computing resources of the face thinning processing, and the face thinning efficiency is improved.
And the target distance is the average value of the distances between all the faces identified in the image and the image acquired by the image acquisition device. For example, if the face recognized in the image includes A, B, C, and the distance between the corresponding photographic subject and the image capturing device at the time of capturing the image is L1, L2, and L3 in this A, B, C, the target distance is an average value of three values, i.e., L1, L2, and L3.
It is to be understood that the target distance may be other than the above average value, for example, a fixed value set in advance, or a user-defined setting, and is not limited herein.
2. If the feature information of the target face in the face meets a preset condition, performing face thinning processing on the face meeting the target face based on the distance may include: and if the size ratio corresponding to the target face in the faces is larger than the target size ratio, performing face thinning processing on the target face based on the distance corresponding to the target face, wherein the target size ratio is the average size ratio of all faces identified in the image.
Specifically, when the size ratio of the face in the image is used to determine whether a target face needing face thinning processing exists, the preset condition may be that the size ratio corresponding to the target face is greater than the target size ratio. After the size ratio of the recognized face in the image is obtained, the size ratio may be compared with a target size ratio, and if the size ratio is greater than the target ratio, it means that the face corresponding to the size ratio may be different from the face ratios of other shooting objects in the image, and the face corresponding to the size ratio is a target face, and is relatively uncoordinated, and the face corresponding to the size ratio is also used for face thinning processing of the target face by using the distance corresponding to the target face. Therefore, face thinning processing can be performed based on pertinence instead of face thinning of the identified face in a whole disc, so that the face thinning processing method is beneficial to reducing the computing resources of the face thinning processing, and the face thinning efficiency is improved.
And the target size ratio is the average size ratio of all the faces recognized in the image. For example, if the face recognized in the image includes A, B, C, the size ratios of the A, B, C in the image are F1, F2, and F3, respectively, and the target size ratio is the average of three values F1, F2, and F3. The size ratio may be determined by the pixel ratio or the area ratio of the face in the image, the area occupied by the face in the image may be represented by the area occupied by the outline thereof, or may be represented by the area occupied by the labeling frame, the labeling frame may be a minimum frame covering the face, and the shape thereof is not particularly limited.
It is to be understood that the target size ratio may be other than the above average value, for example, a fixed value set in advance, or a user-defined setting, and is not limited herein.
3. If the feature information of the target face in the face meets a preset condition, performing face thinning processing on the face meeting the target face based on the distance may include: if the distance corresponding to the target face in the face is smaller than the target distance and the size ratio corresponding to the target face in the face is larger than the target size ratio, performing face thinning processing on the target face based on the distance corresponding to the target face, wherein the target distance is an average value of distances between all faces recognized in the image and the image acquired by the image acquisition device, and the target size ratio is an average size ratio of all faces recognized in the image.
Specifically, when determining whether a target face needing face thinning processing exists by using the distance and the size ratio of the face in the image, the preset condition may be that the distance corresponding to the target face is smaller than the target distance, and the size ratio corresponding to the target face is larger than the target size ratio. Compared with the two modes, the mode has the advantages that the condition for face thinning processing is relatively strict, the calculation resource is further optimized, and unnecessary face thinning processing is avoided.
For the related content, reference may be made to the content corresponding to the above two manners, which is not described herein again.
In order to provide relatively rich image beautification modes for users to meet different image beautification requirements, a plurality of face slimming modes can be set for the users to select actively.
In some embodiments, the image processing method may further include: acquiring a user instruction; a target face-thinning mode is selected among a plurality of face-thinning modes based on the user instruction. Further, the face thinning processing based on the preset face thinning strategy and the distance may include: and carrying out face thinning processing on the human face based on a preset face thinning strategy, the target face thinning mode and the distance.
Specifically, the image processing device may be integrated with a user interaction device, and the user interaction device may include a physical operation component, or may include a virtual operation component, such as a touch screen, a key, a slider, and the like. Through the user interaction device, a user can select from a plurality of face thinning modes, and a target face thinning mode selected by the user can be carried in a generated user instruction. Of course, the user instruction may be input through a user interaction device independent from the image processing device, but the user interaction device may be communicatively connected to the image processing device to transmit the user instruction to the image processing device.
In some embodiments, the plurality of face-thinning modes may be modes regarding what kind of target faces meeting what kind of preset conditions are subjected to face-thinning processing, for example, a first face-thinning mode may be to thin faces of target faces whose corresponding distances are smaller than a target distance, a second face-thinning mode may be to thin faces of target faces whose corresponding size ratios are larger than a target size ratio, and a third face-thinning mode may be to thin faces of target faces whose corresponding distances are smaller than the target distance and corresponding size ratios are larger than the target size ratio.
In other embodiments, the plurality of face-thinning modes may be modes whether to add other beautifying effects, for example, the first face-thinning mode may be a mode in which a key whitening is added on the basis of face thinning, the second face-thinning mode may be a mode in which a key filter is added on the basis of face thinning, and the third face-thinning mode may be a mode in which a beautifying effect is added on the basis of face thinning.
It can be understood that the face-thinning mode can be changed in various forms according to needs, and specifically can be designed in a diversified manner according to the needs of the user, and is not specifically limited herein.
Further, after face thinning processing is performed on the face based on a preset face thinning strategy and a preset distance, an image obtained after the face thinning processing can be stored in the local of the image processing device, and the image can be uploaded to the cloud. The user can also share according to the requirement.
It should be noted that, in the embodiment of the present invention, the image acquired by the image acquisition device may be an image acquired during a photographing scene, or an image acquired during video recording, which is not specifically limited herein.
The image processing method in the embodiment of the present invention is described above from the viewpoint of software processing, and the image processing apparatus in the embodiment of the present invention is described below from the viewpoint of hardware processing. Referring to fig. 2, an image processing apparatus according to an embodiment of the present invention includes:
a memory 201 for storing a computer program;
a processor 202 for implementing, when executing the computer program stored in the memory:
acquiring an image acquired by an image acquisition device;
recognizing a face in the image, and acquiring the distance between a shooting object corresponding to the face and the image acquisition device when the image acquisition device acquires the image;
and carrying out face thinning processing on the human face based on a preset face thinning strategy and the distance.
Optionally, the processor 201 is specifically configured to: performing face thinning processing on all the faces identified in the image based on the corresponding distances respectively; or acquiring the characteristic information of the human face; and if the characteristic information of the target face in the face meets a preset condition, performing face thinning processing on the target face based on the distance.
Optionally, the feature information includes the distance and/or a size ratio of the face in the image.
Optionally, the processor 201 is specifically configured to: and if the distance corresponding to the target face in the faces is smaller than a target distance, performing face thinning processing on the target face based on the distance corresponding to the target face, wherein the target distance is an average value of distances between all faces identified in the image and the image acquisition device when the image is acquired.
Optionally, the processor 201 is specifically configured to: and if the size ratio corresponding to the target face in the faces is larger than the target size ratio, performing face thinning processing on the target face based on the distance corresponding to the target face, wherein the target size ratio is the average size ratio of all faces identified in the image.
Optionally, the processor 201 is specifically configured to: if the distance corresponding to the target face in the face is smaller than the target distance and the size ratio corresponding to the target face in the face is larger than the target size ratio, performing face thinning processing on the target face based on the distance corresponding to the target face, wherein the target distance is an average value of distances between all faces recognized in the image and the image acquired by the image acquisition device, and the target size ratio is an average size ratio of all faces recognized in the image.
Optionally, the processor 201 is further configured to: acquiring a user instruction; selecting a target face-thinning mode from a plurality of face-thinning modes based on the user instruction; the face thinning processing is performed on the human face based on the distance, and the processing method comprises the following steps: and carrying out face thinning processing on the human face based on the target face thinning mode and the distance.
Optionally, the processor 201 is specifically configured to: acquiring a mapping relation between a preset distance and a face thinning proportion coefficient, and performing face thinning processing on the human face based on a preset face thinning strategy, the mapping relation and the distance; or inputting the distance into a preset face-thinning model to obtain a face-thinning strategy based on the distance, and performing face-thinning processing on the human face based on the preset face-thinning strategy and the face-thinning strategy based on the distance.
The image processing apparatus provided in the embodiment of the present invention is configured to execute the image processing method, and the content and the effect of the image processing apparatus may refer to the content and the effect of the foregoing method embodiment, which are not described herein again.
The embodiment of the invention also provides a computer readable storage medium. The computer-readable storage medium of an embodiment of the present invention stores a computer program that can be executed by a processor to perform the method of any one of the above-described embodiments.
For example, the computer program may be executed by a processor to perform the control method described in the following steps:
01: acquiring an image acquired by an image acquisition device;
02: recognizing a face in the image, and acquiring the distance between a shooting object corresponding to the face and the image acquisition device when the image acquisition device acquires the image;
03: performing face thinning processing on the human face based on a preset face thinning strategy and the distance;
as another example, the computer program may also be executable by a processor to perform the method described by the steps of:
031: performing face thinning processing on all the faces identified in the image based on the corresponding distances respectively; or the like, or, alternatively,
032: acquiring feature information of the human face;
and if the characteristic information of the target face in the face meets a preset condition, performing face thinning processing on the target face based on the distance.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. An image processing method, comprising:
acquiring an image acquired by an image acquisition device;
recognizing a face in the image, and acquiring the distance between a shooting object corresponding to the face and the image acquisition device when the image acquisition device acquires the image;
and carrying out face thinning processing on the human face based on a preset face thinning strategy and the distance.
2. The method according to claim 1, wherein the face thinning processing based on the preset face thinning strategy and the distance comprises:
performing face thinning processing on all the faces identified in the image based on the corresponding distances respectively; or the like, or, alternatively,
acquiring feature information of the human face;
and if the characteristic information of the target face in the face meets a preset condition, performing face thinning processing on the target face based on the distance.
3. The method of claim 2, wherein the feature information comprises the distance and/or a size fraction of the face in the image.
4. The method according to claim 3, wherein if the feature information of a target face in the faces meets a preset condition, performing face thinning processing on the face meeting the target face based on the distance includes:
and if the distance corresponding to the target face in the faces is smaller than a target distance, performing face thinning processing on the target face based on the distance corresponding to the target face, wherein the target distance is an average value of distances between all faces identified in the image and the image acquisition device when the image is acquired.
5. The method according to claim 3, wherein if the feature information of a target face in the faces meets a preset condition, performing face thinning processing on the face meeting the target face based on the distance includes:
and if the size ratio corresponding to the target face in the faces is larger than the target size ratio, performing face thinning processing on the target face based on the distance corresponding to the target face, wherein the target size ratio is the average size ratio of all faces identified in the image.
6. The method according to claim 3, wherein if the feature information of a target face in the faces meets a preset condition, performing face thinning processing on the face meeting the target face based on the distance includes:
if the distance corresponding to the target face in the face is smaller than the target distance and the size ratio corresponding to the target face in the face is larger than the target size ratio, performing face thinning processing on the target face based on the distance corresponding to the target face, wherein the target distance is an average value of distances between all faces recognized in the image and the image acquired by the image acquisition device, and the target size ratio is an average size ratio of all faces recognized in the image.
7. The method of claim 1, further comprising:
acquiring a user instruction;
selecting a target face-thinning mode from a plurality of face-thinning modes based on the user instruction;
based on predetermine thin face tactics with the distance is right face is thin face and is handled, include:
and carrying out face thinning processing on the human face based on a preset face thinning strategy, the target face thinning mode and the distance.
8. The method according to claim 1, wherein the face thinning processing based on the preset face thinning strategy and the distance comprises:
acquiring a mapping relation between a preset distance and a face thinning proportion coefficient, and performing face thinning processing on the human face based on a preset face thinning strategy, the mapping relation and the distance; or the like, or, alternatively,
and inputting the distance into a preset face-thinning model to obtain a face-thinning strategy based on the distance, and performing face-thinning processing on the human face based on the preset face-thinning strategy and the face-thinning strategy based on the distance.
9. An image processing apparatus characterized by comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method of any one of claims 1 to 8 when executing the computer program stored in the memory.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 8.
CN202111672535.XA 2021-12-31 2021-12-31 Image processing method and device and computer readable storage medium Pending CN114387157A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111672535.XA CN114387157A (en) 2021-12-31 2021-12-31 Image processing method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111672535.XA CN114387157A (en) 2021-12-31 2021-12-31 Image processing method and device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN114387157A true CN114387157A (en) 2022-04-22

Family

ID=81200231

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111672535.XA Pending CN114387157A (en) 2021-12-31 2021-12-31 Image processing method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114387157A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117058738A (en) * 2023-08-07 2023-11-14 深圳市华谕电子科技信息有限公司 Remote face detection and recognition method and system for mobile law enforcement equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117058738A (en) * 2023-08-07 2023-11-14 深圳市华谕电子科技信息有限公司 Remote face detection and recognition method and system for mobile law enforcement equipment
CN117058738B (en) * 2023-08-07 2024-05-03 深圳市华谕电子科技信息有限公司 Remote face detection and recognition method and system for mobile law enforcement equipment

Similar Documents

Publication Publication Date Title
US9740916B2 (en) Systems and methods for persona identification using combined probability maps
US11503205B2 (en) Photographing method and device, and related electronic apparatus
CN106161939B (en) Photo shooting method and terminal
US10110868B2 (en) Image processing to determine center of balance in a digital image
CN107771391B (en) Method and apparatus for determining exposure time of image frame
CN110300264B (en) Image processing method, image processing device, mobile terminal and storage medium
CN107820020A (en) Method of adjustment, device, storage medium and the mobile terminal of acquisition parameters
US11176355B2 (en) Facial image processing method and apparatus, electronic device and computer readable storage medium
KR101725884B1 (en) Automatic processing of images
CN109087376B (en) Image processing method, image processing device, storage medium and electronic equipment
US11070717B2 (en) Context-aware image filtering
US9607394B2 (en) Information processing method and electronic device
CN106529406B (en) Method and device for acquiring video abstract image
CN112135046A (en) Video shooting method, video shooting device and electronic equipment
CN109618098A (en) A kind of portrait face method of adjustment, device, storage medium and terminal
CN106815803B (en) Picture processing method and device
CN114387157A (en) Image processing method and device and computer readable storage medium
CN103353879B (en) Image processing method and apparatus
CN110177216B (en) Image processing method, image processing device, mobile terminal and storage medium
CN112188108A (en) Photographing method, terminal, and computer-readable storage medium
CN114677620A (en) Focusing method, electronic device and computer readable medium
CN112950641A (en) Image processing method and device, computer readable storage medium and electronic device
CN113938597B (en) Face recognition method, device, computer equipment and storage medium
CN113469164A (en) Background image display method and device, storage medium and electronic equipment
CN110545382A (en) Shooting control method, electronic equipment and related device

Legal Events

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