CN110956576A - Image processing method, device, equipment and storage medium - Google Patents

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

Info

Publication number
CN110956576A
CN110956576A CN201811132655.9A CN201811132655A CN110956576A CN 110956576 A CN110956576 A CN 110956576A CN 201811132655 A CN201811132655 A CN 201811132655A CN 110956576 A CN110956576 A CN 110956576A
Authority
CN
China
Prior art keywords
image
portrait
type
area
neural network
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.)
Granted
Application number
CN201811132655.9A
Other languages
Chinese (zh)
Other versions
CN110956576B (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 Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201811132655.9A priority Critical patent/CN110956576B/en
Publication of CN110956576A publication Critical patent/CN110956576A/en
Application granted granted Critical
Publication of CN110956576B publication Critical patent/CN110956576B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • G06T3/04
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • 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
    • 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 application discloses an image processing method, an image processing device, image processing equipment and a storage medium, and relates to the field of image processing. The method comprises the following steps: identifying the portrait type in the framing image through a neural network model; when the portrait type accords with the preset type, background blurring is carried out on a non-portrait area in the view-finding image; the problem that at least 6 steps are needed to obtain a background virtual character image in the related technology is solved, the aim of automatically identifying the type of the character in the image in the shooting process is achieved, when the type of the character accords with the preset type, the user can obtain the background virtual image of a non-character area after pressing a shutter, the later-stage image repairing is not needed, the manual operation steps of the user are reduced, and the human-computer interaction efficiency is improved. And even if the user does not have the picture correcting function, the user can obtain a background blurring picture which can be shot only by a professional single lens reflex.

Description

Image processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of image processing, and in particular, to an image processing method, an image processing apparatus, an image processing device, and a storage medium.
Background
In daily life, a user can use the mobile terminal to shoot people. Sometimes, in order to highlight the person, the user needs to blur the shooting background.
In the related art, a process of blurring a captured image by a user includes the following steps: 1. after a user shoots a person by using the intelligent terminal, uploading an image to a computer; 2. on the premise that the computer is provided with the retouching software (if the computer is not provided with the retouching software, the retouching software needs to be installed firstly), the retouching software is opened; 3. opening an image in the retouching software; 4. manually selecting a blurring region of the image using a tool; 5. setting blurring parameters, such as blurring by using Gaussian blur, and setting the size of a blur radius to be 10 pixels; 6. and saving the modified image.
The mobile terminal obtains the character image with the blurred background through the at least 6 steps, and the method is complex in operation, complex in steps and low in human-computer interaction efficiency.
Disclosure of Invention
The embodiment of the application provides an image processing method, device, equipment, system and storage medium, which can solve the problems that in the related art, the operation of performing background blurring operation on a non-person part in an image by a user is complex and has more steps. The technical scheme is as follows:
according to a first aspect of the present application, there is provided an image processing method, the method comprising:
acquiring a view finding image in the shooting process;
identifying the portrait type in the framing image through a neural network model;
and when the portrait type accords with the preset type, performing background blurring on a non-portrait area in the viewfinder image.
In some embodiments, identifying the portrait type in the framing image via the neural network model includes:
calling a first neural network model to identify the framing image to obtain the portrait type in the framing image;
the portrait type comprises a whole body portrait type and a half body portrait type.
In some embodiments, identifying the portrait type in the framing image via the neural network model includes:
calling a second neural network model to identify the framing image to obtain a face area in the framing image;
determining the portrait type of the viewfinder image according to the proportion occupied by the face area in the viewfinder image;
the portrait type comprises a whole body portrait type and a half body portrait type.
In some embodiments, identifying the portrait type in the framing image via the neural network model includes:
calling a third neural network model to identify the framing image to obtain a head area and a body area in the framing image;
determining the portrait type of the viewfinder image according to the proportion of the head area and the body area;
the portrait type comprises a whole body portrait type and a half body portrait type.
In some embodiments, when the portrait type conforms to the preset type, background blurring is performed on the non-portrait area in the viewfinder image, including:
when the portrait type is in line with the half-length portrait type, background blurring is performed on the non-portrait area in the viewfinder image.
In some embodiments, background blurring of non-portrait areas in the viewfinder image includes:
determining a portrait area in the framing image through a neural network model;
background blurring is performed on non-portrait areas except for the portrait area in the through-view image.
In some embodiments, background blurring non-portrait areas other than portrait areas in the viewfinder image includes:
performing background blurring on non-portrait areas except the portrait area in the view finding image by adopting an image blurring algorithm;
or the like, or, alternatively,
acquiring a blurred image shot by an auxiliary camera; and replacing non-portrait areas except the portrait area in the view finding image with pixel points in the blurring image.
According to a second aspect of the present application, there is provided an image processing apparatus comprising:
an acquisition module configured to acquire a through image during shooting;
a recognition module configured to recognize a portrait type in the through-view image through a neural network model;
and the processing module is configured to perform background blurring on the non-portrait area in the viewfinder image when the portrait type accords with the preset type.
In some embodiments, the identification module comprises:
the figure recognition submodule is configured to call the first neural network model to recognize the framing image, and the figure type in the framing image is obtained; the portrait type comprises a whole body portrait type and a half body portrait type.
In some embodiments, the identification module comprises:
the face recognition submodule is configured to call the second neural network model to recognize the framing image to obtain a face area in the framing image;
a first determining submodule configured to determine a portrait type of the through image according to a proportion occupied by the face area in the through image; the portrait type comprises a whole body portrait type and a half body portrait type.
In some embodiments, the identification module comprises:
the image recognition submodule is configured to call the third neural network model to recognize the framing image, and a head area and a body area in the framing image are obtained;
a first determination submodule configured to determine a portrait type of the through-image based on a ratio of the head region and the body region; the portrait type comprises a whole body portrait type and a half body portrait type.
In some embodiments, a processing module, comprising:
and the background blurring submodule is configured to perform background blurring on the non-portrait area in the viewfinder image when the portrait type conforms to the bust type.
In some embodiments, a processing module, comprising:
a second determination submodule configured to determine a portrait area in the through image through the neural network model;
and the background blurring submodule is configured to perform background blurring on non-portrait areas except the portrait area in the viewfinder image.
In some embodiments, the background blurring sub-module is configured to perform background blurring on non-portrait areas except the portrait area in the viewfinder image by using an image blurring algorithm; or acquiring a blurred image shot by the auxiliary camera; and replacing non-portrait areas except the portrait area in the view finding image with pixel points in the blurring image.
According to a third aspect of the present application, there is provided a terminal comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by the processor to implement the image processing method as described in any of the first aspect of the present application and its optional embodiments above.
According to a fourth aspect of the present application, there is provided a computer-readable storage medium having stored therein at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by the processor to implement the image processing method as described in any one of the first aspect of the present application and its optional embodiments above.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
identifying the portrait type in the framing image through a neural network model; when the portrait type accords with the preset type, background blurring is carried out on a non-portrait area in the view-finding image; the problem that at least 6 steps are needed to obtain a background virtual character image in the related technology is solved, the aim of automatically identifying the type of the character in the image in the shooting process is achieved, when the type of the character accords with the preset type, the user can obtain the background virtual image of a non-character area after pressing a shutter, the later-stage image repairing is not needed, the manual operation steps of the user are reduced, and the human-computer interaction efficiency is improved. And even if the user does not have the picture correcting function, the user can obtain a background blurring picture which can be shot only by a professional single lens reflex.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a block diagram of a terminal provided in an exemplary embodiment of the present application;
fig. 2 is a block diagram of a terminal according to another exemplary embodiment of the present application;
FIG. 3 is a flow chart of an image processing method provided by an exemplary embodiment of the present application;
FIG. 4 is a schematic diagram of a user interface for an image processing method provided by an exemplary embodiment of the present application;
FIG. 5 is a schematic diagram of a user interface for an image processing method provided by another exemplary embodiment of the present application;
FIG. 6 is a flow chart of an image processing method provided by another exemplary embodiment of the present application;
FIG. 7 is a flow chart of an image processing method provided by another exemplary embodiment of the present application;
FIG. 8 is a flow chart of an image processing method provided by another exemplary embodiment of the present application;
FIG. 9 is a flow chart of an image processing method provided by another exemplary embodiment of the present application;
FIG. 10 is a flow chart of an image processing method provided by another exemplary embodiment of the present application;
FIG. 11 is a flow chart of an image processing method provided by another exemplary embodiment of the present application;
FIG. 12 is a flow chart of an image processing method provided by another exemplary embodiment of the present application;
FIG. 13 is a flow chart of an image processing method provided by another exemplary embodiment of the present application;
fig. 14 is a block diagram of an image processing apparatus provided in an exemplary embodiment of the present application;
fig. 15 is a block diagram of an image processing apparatus provided in another exemplary embodiment of the present application;
fig. 16 is a block diagram of an image processing apparatus provided in another exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
First, several terms related to the embodiments of the present application are explained:
a neural network model: the artificial neural network is formed by connecting n neurons, wherein n is a positive integer. In the present application, the neural network model is an artificial neural network for identifying a type of portrait in a through-view image. Illustratively, the neural network model can be divided into an input layer, a hidden layer and an output layer, the terminal inputs the view-finding image into the input layer of the neural network model, the hidden layer performs downsampling on the input view-finding image, namely convolution calculation is performed on pixel points in the view-finding image, and finally the type of the obtained portrait is output and identified through the output layer. The Neural Network model includes a CNN (convolutional Neural Network) model, an FCN (full convolutional Neural Network) model, a DNN (Deep Neural Network) model, an RNN (recurrentneural Network) model, an embedding model, a GBDT (gradient boosting decision Tree) model, an LR (Logistic Regression) model, and the like.
CNN model: is a deep feedforward artificial neural network. CNN includes but is not limited to the following three parts: the sensor comprises an input layer, a combination of n convolutional layers and a pooling layer, and a fully-connected multilayer sensor, wherein n is a positive integer. The CNN includes a feature extractor consisting of convolutional and pooling layers. And the characteristic extractor performs characteristic extraction on the samples input by the input layer to obtain model parameters, and completes final model training in the perceptron according to the model parameters. In recent years, CNN models are widely applied to speech recognition, general object recognition, face recognition, image recognition, motion analysis, natural language processing, brain wave analysis, and the like, and the application takes the application of CNN models to image recognition as an example, and the specific content is to recognize the portrait type in an image through CNN models.
FCN model: is a deep feedforward artificial neural network. The distinct output layer from the CNN model described above is a convolutional layer, and the output layer of the CNN model is a fully connected layer. The FCN model is subjected to convolution, pooling and deconvolution processes, and finally the identified image is output.
DNN model: is a deep learning framework. The DNN model includes an input layer, at least one hidden layer (or intermediate layer), and an output layer. Optionally, the input layer, the at least one hidden layer (or intermediate layer), and the output layer each include at least one neuron, and the neuron is configured to process the received data. Alternatively, the number of neurons between different layers may be the same; alternatively, it may be different.
RNN model: is a neural network with a feedback structure. In the RNN model, the output of a neuron can be directly applied to itself at the next time stamp, i.e., the input of the i-th layer neuron at time m includes its own output at time (m-1) in addition to the output of the (i-1) layer neuron at that time.
Imbedding model: relationships in each triplet instance are treated as translations from entity head to entity tail based on the entity and relationship distributed vector representations. The triple instance comprises a subject, a relation and an object, and can be expressed as (subject, relation and object); the subject is an entity head, and the object is an entity tail. Such as: dad of the small is large, then represented by the triple instance as (small, dad, large).
GBDT model: is an iterative decision tree algorithm, which consists of a plurality of decision trees, and the results of all the trees are accumulated to be the final result. Each node of the decision tree obtains a predicted value, and taking age as an example, the predicted value is an average value of ages of all people belonging to the node corresponding to the age.
LR model: the method is a model established by applying a logic function on the basis of linear regression.
The portrait type: the portrait type in the present application is an image type obtained by dividing the image according to the integrity of each part of the human body in the image, and may be divided into a half-length type and a whole-length type, for example, when the image includes 1/3 points from the head to the body, the image is the half-length type; the image includes 3/4 of the body from the head, which is a full body image type.
The portrait recognition model: the model is established according to at least one of a CNN model, an FCN model, a DNN model, an RNN model, an embedding model, a GBDT model and an LR model, and is used for identifying the portrait type in the image.
Viewing images: and the image data collected by the photosensitive device is used for displaying the image in the shooting preview interface. If a shutter signal triggered by a user is received, the framing image can be processed and stored as a target image.
Shooting an image: and storing the viewfinder image according to the shutter signal to obtain an image.
Referring to fig. 1, a block diagram of a terminal according to an exemplary embodiment of the present application is shown. The terminal includes: a light receiving device 101, an ISP (Image Signal Processing) module 102, a processor 103, and a memory 104.
And a light sensing device 101 configured to sense a shooting environment to obtain a through image. The light sensing device 101 may be a CCD (charge coupled device) image sensor or a CMOS (complementary metal Oxide Semiconductor) image sensor.
The ISP module 102 is electrically connected to the light sensing device 101. Optionally, the ISP module 102 and the photosensitive device 101 are connected by a bus, or the ISP module 102 and the photosensitive device 101 are integrated into the same electrical package or chip. The photosensitive device 101 transmits the acquired image data to the ISP module 102 for processing.
The ISP module 102 is configured to acquire and buffer a through image captured by the light sensing device 101, and when a shutter signal is received, a captured image is captured from the through image. In some embodiments, the ISP module 102 is also configured to perform auto-exposure, auto-focus, auto-adjust white balance, and the like.
The processor 103 is electrically connected to the ISP module 102. Optionally, the processor 103 and the ISP module 102 are connected by a bus, or the processor 103 and the ISP module 102 are integrated into the same electrical package or chip. The processor 103 may include one or more processing cores for transmitting a shutter signal to the ISP module 102, and for acquiring a photographed image photographed by the ISP module 102 and storing the photographed image in the memory 104. Optionally, the processor 103 includes a neural network model; the processor 103 is further configured to acquire the viewfinder image cached in the ISP module 102, identify a portrait type in the viewfinder image through the neural network model, and perform blurring processing on a background image of a non-portrait area portion in the viewfinder image.
The memory 104 is electrically connected to the processor 103. Optionally, the memory 104 is connected to the processor 103 via a bus. The Memory 104 may include a RAM (Random Access Memory) or a ROM (Read-Only Memory). The memory 104 is used for storing the image sent by the processor 103.
In some embodiments, the terminal further comprises: an AI (Artificial Intelligence) chip 105. Referring to fig. 2, the AI chip 105 is electrically connected to the ISP module 102. Optionally, the AI chip 105 is connected to the ISP module 102 via a bus. The AI chip includes a neural network model. In some embodiments, the AI chip identifies the portrait type in the viewfinder image through the neural network identification model, and in other embodiments, blurs the background image of the non-portrait area portion in the viewfinder image.
The AI chip 105 is also electrically connected to the memory 104. Optionally, the AI chip 105 is connected to the memory 104 via a bus. The AI chip is also used to send the shot image to the memory 104.
Referring to fig. 3, a flowchart of an image processing method provided in an exemplary embodiment of the present application is shown, where the present embodiment is illustrated by applying the method to the terminal shown in fig. 1 or fig. 2, and the method includes:
step 201, acquiring a view image in the shooting process.
In the shooting process, a photosensitive device on the terminal collects image data of a framing image and caches the image data.
Optionally, the terminal obtains image data of a viewfinder image during a shooting process using an API (Application Programming Interface) function.
Before the user does not trigger the shutter signal, the terminal acquires a frame of framing image through the API, and displays the framing image on a preview screen for the user to view. Optionally, the terminal may buffer the last n frames of the viewfinder images.
In step 202, the portrait type in the viewfinder image is identified through the neural network model.
And the terminal calls a neural network model to identify the portrait type in the framing image. The portrait type may be a half-body portrait type or a whole-body portrait type. The portrait type is distinguished according to the integrity of each part of the human body in the portrait. Schematically, dividing a human body in proportion, and when the proportion of the human body in the viewfinder image is smaller than or equal to a preset proportion, determining that the portrait type in the viewfinder image is a half-length portrait type; when the proportion of the human body in the view finding image is larger than the preset proportion, the portrait type in the view finding image is a whole body portrait type; the human body scale is a scale in which the portrait from the head occupies the whole human body. For example, the human body is divided into 5 parts according to the proportion, the preset proportion is set to 3/5, and when the proportion of the human body in the viewfinder image is less than or equal to 3/5, the portrait type is the half-length type; when the proportion of the human body in the through image is larger than 3/5, the portrait type is a half-length type.
Optionally, the portrait in the viewfinder image includes a person's clothing, such as a hat worn on the head, glasses worn on the face, or ornaments worn on the wrist or ankle. Optionally, the portrait in the viewfinder image also includes objects carried by a person, such as a hand-held or shoulder-carried bag, a pet held in arms.
Optionally, the neural network model is at least one of a CNN model, an FCN model, a DNN model, an RNN model, an embedding model, a GBDT model, and an LR model.
In a possible implementation mode, the terminal calls the first neural network model to identify the framing image, and the portrait type in the framing image is obtained.
In another possible implementation mode, the terminal calls a second neural network model to identify the framing image to obtain a face area in the framing image; and determining the portrait type of the viewfinder image according to the occupied proportion of the face area in the viewfinder image.
In another possible implementation manner, the terminal calls a third neural network model to identify the framing image to obtain a head area and a body area in the framing image; the portrait type of the through image is determined according to the proportion of the head area and the body area.
Step 203, judging whether the portrait type accords with a preset type.
If the portrait type is in accordance with the preset type, entering step 204;
if the portrait type does not conform to the preset type, go to step 205.
Taking the preset type as the bust type as an example, the terminal judges whether the portrait type is in line with the bust type.
And 204, when the portrait type accords with the preset type, performing background blurring on a non-portrait area in the viewfinder image.
The non-portrait area refers to an area other than the portrait area in the through-view image. And background blurring is carried out on the non-portrait area in the viewfinder image, namely, the terminal blurring pixel points of the remaining area except the portrait area in the viewfinder image, so that the image definition of the non-portrait area is reduced, the portrait area is clear, and the aim of highlighting the portrait area is fulfilled.
Optionally, when the portrait type is consistent with the bust type, background blurring is performed on the non-portrait area in the viewfinder image.
And the terminal receives a shutter signal triggered by a user, and shoots the image with the background blurred to obtain a blurred image.
Schematically, referring to fig. 4, the top end of the user interface of the terminal in the left image is displayed with the word "AI" 31, that is, the camera is in an AI shooting mode, and before the user triggers the shutter signal, the terminal collects and buffers a framing image 32; then the terminal calls a neural network model to identify, and the portrait type in the viewfinder image 32 is obtained and is the half-length portrait type; the terminal determines that the portrait type in the through-image 32 conforms to a preset type (bust type); the terminal blurring the background of the non-portrait area in the viewfinder image 32; when the user presses the shutter control 33, the terminal stores the viewfinder image 32 as a shot image according to the shutter signal, and obtains an image 34 with a blurred background, as shown in the right diagram of fig. 4, in which it can be clearly seen that the non-portrait area of the image 34 is blurred.
And step 205, when the portrait type does not accord with the preset type, normally shooting the viewfinder image.
When the portrait type does not accord with the preset type, the terminal does not perform blurring processing on the framing image, the terminal receives a shutter signal triggered by a user, and the terminal shoots the framing image to obtain a clear image which is not subjected to blurring processing.
Optionally, when the portrait type does not conform to the bust type, the terminal receives a shutter signal triggered by a user, and shoots a clear image which is not subjected to blurring processing; or when the portrait type accords with the whole body portrait type, the terminal receives a shutter signal triggered by the user and shoots a clear image which is not subjected to blurring processing.
Schematically, referring to fig. 5, the terminal invokes the neural network model to recognize that the portrait type in the viewfinder image 35 is the whole-body portrait type; the preset type in the terminal is a bust type, and the portrait type in the viewfinder image 35 is determined not to be in accordance with the bust type; the terminal does not perform background blurring processing on the viewfinder image 35; the user presses the shutter control 33, and the terminal receives the triggered shutter signal to shoot an image, so as to obtain an image 36 with a blurred background, as shown in the right diagram of fig. 5, where it can be clearly seen that the image 36 is the same as the viewfinder image 35, and the non-portrait area of the image 36 is not blurred.
It should be noted that, in the present application, the real image is schematically illustrated in fig. 4 and 5 by replacing the real image with a simple stroke, and the background blurring effect of the real image may be slightly different, but this is a part that should be understood by those skilled in the art and is not described herein again.
In summary, the image processing method provided in this embodiment identifies the portrait type in the viewfinder image through the neural network model; when the portrait type accords with the preset type, background blurring is carried out on a non-portrait area in the view-finding image; the problem that at least 6 steps are needed to obtain a background virtual character image in the related technology is solved, the aim of automatically identifying the type of the character in the image in the shooting process is achieved, when the type of the character accords with the preset type, the user can obtain the background virtual image of a non-character area after pressing a shutter, the later-stage image repairing is not needed, the manual operation steps of the user are reduced, and the human-computer interaction efficiency is improved. And even if the user does not have the picture correcting function, the user can obtain a background blurring picture which can be shot only by a professional single lens reflex.
In the embodiment, the clear image which is not subjected to blurring processing is shot by judging that the portrait type is a non-preset type, so that a user can obtain two different images without changing the setting, and the user experience is improved.
It should be noted that the terminal identifies the portrait type in the viewfinder image through the neural network model, and the method includes:
1. identifying the view image through a first neural network model, wherein the first neural network model is an artificial neural network used for identifying the portrait type in the view image;
2. identifying the framing image through a first neural network model, wherein a second neural network model is an artificial neural network used for identifying a face area in the framing image;
3. the through image is recognized by a third neural network model, which is an artificial neural network for recognizing a head region and a body region in the through image.
Based on fig. 3, fig. 6 and 7 are illustrations of the image processing method in the first case; fig. 8 is an explanatory view of the image processing method in the second case described above; fig. 9 is an explanatory view of an image processing method in the third case described above.
Referring to fig. 6, which shows a flowchart of an image processing method provided in another exemplary embodiment of the present application, in an alternative embodiment based on fig. 3, when the neural network model is the first neural network model, step 202 is replaced with step 2021, which is schematically described as follows:
step 2021, calling the first neural network model to identify the framing image, and obtaining the portrait type in the framing image.
The first neural network is used for identifying the type of the portrait in the viewfinder image, wherein the type of the portrait comprises: a bust type and a full body portrait type. The first neural network is a model with the ability to recognize bust type and whole body image type.
Optionally, the first neural network model includes, but is not limited to, at least one of CNN model, FCN model, DNN model, RNN model, embedding model, GBDT model, LR model.
In conclusion, the terminal identifies the portrait type in the view image through the first neural network model; when the portrait type accords with the preset type, background blurring is carried out on a non-portrait area in the view-finding image; identifying the portrait type in the framing image through a neural network model; when the portrait type accords with the preset type, background blurring is carried out on a non-portrait area in the view-finding image; the problem that at least 6 steps are needed to obtain a background virtual character image in the related technology is solved, the aim of automatically identifying the type of the character in the image in the shooting process is achieved, when the type of the character accords with the preset type, the user can obtain the background virtual image of a non-character area after pressing a shutter, the later-stage image repairing is not needed, the manual operation steps of the user are reduced, and the human-computer interaction efficiency is improved. And even if the user does not have the picture correcting function, the user can obtain a background blurring picture which can be shot only by a professional single lens reflex.
In the embodiment, the portrait type is judged to be a non-preset type, blurring processing is not performed on the portrait in the view finding image, a clear shooting image is obtained, a user can obtain two different images without changing the setting, and user experience is improved.
Before the terminal calls the first neural network, a first neural network model capable of identifying the type of the portrait in the viewfinder image needs to be obtained through image training.
Schematically, fig. 7 shows a flowchart of a method for obtaining a neural network model capable of identifying a portrait type in a through image by a terminal performing image training according to an exemplary embodiment, where the steps are as follows:
and step 21, extracting sample image characteristics from the image samples for at least two groups of historical image samples.
The at least two sets of historical image samples include at least one set of bust samples and at least one set of bust samples. And the terminal extracts a sample image characteristic 1 and a sample image characteristic 2 from at least one group of the half-length image samples and at least one group of the whole-body image samples respectively.
Optionally, the preset image processing algorithm is a pHash (Perceptual hash) algorithm. And the terminal calculates the perceptual hash value corresponding to the historical image sample through a pHash algorithm, and determines the calculated perceptual hash value as the image characteristic of the sample. Illustratively, the terminal respectively calculates perceptual hash values of at least one group of bust image samples and at least one group of full-body image samples through a pHash algorithm, correspondingly obtains a perceptual hash value 1 and a perceptual hash value 2, determines the perceptual hash value 1 as a sample image feature 1, and determines the perceptual hash value 2 as a sample image feature 2. Each image sample also corresponds to a calibration result, for example, the half-length image sample corresponds to a calibration result of the half-length image type, and the whole-body image sample corresponds to a calibration result of the whole-body image type.
And step 22, inputting the sample image characteristics into the neural network model to obtain a training result.
Optionally, the neural network model includes, but is not limited to, at least one of CNN model, FCN model, DNN model, RNN model, embedding model, GBDT model, LR model.
Illustratively, for each group of historical image samples, the terminal creates an input-output pair corresponding to the group of historical image samples, wherein the input parameters of the input-output pair are the sample image characteristics of the group of historical image samples, and the output parameters are the identification results of the portrait type in the viewfinder image; the terminal inputs the input parameters into the neural network model to obtain a training result; wherein the neural network model is used for identifying the type of the portrait in the viewfinder image.
For example, the sample image feature is "sample image feature 1", the recognition result of the portrait type is "half-length type", and the input/output pair created by the terminal is (sample image feature 1)
Figure BDA0001813960860000122
Wherein, the 'sample image characteristic 1' is an input parameter, and the 'bust type' is an output parameter; the sample image feature is 'sample image feature 2', the identification result of the portrait type is 'whole body portrait type', and the input and output pair created by the terminal is (sample image feature 2)
Figure BDA0001813960860000121
Wherein, the "sample image feature 2" is an input parameter, and the "whole body image type" is an output parameter.
Alternatively, the input-output pairs are represented by feature vectors.
And step 23, comparing the training result with the standard result to obtain a calculation loss, wherein the calculation loss is used for indicating an error between the training result and the calibration result.
The calibration result refers to the portrait type to which the portrait in the image sample belongs, and the distinguishing standard of the portrait type is explained in the embodiment shown in fig. 3, and is not described herein again.
Optionally, the calculated loss is expressed by cross-entropy (cross-entropy), and optionally, the terminal calculates the calculated loss H (p, q) by the following formula:
Figure BDA0001813960860000131
wherein p (x) and q (x) are discrete distribution vectors of equal length, and p (x) represents the training result; q (x) represents an output parameter; x is a vector in the training results or output parameters.
And 24, training by adopting an error back propagation algorithm according to the respective calculation loss of at least two groups of historical image samples to obtain a first neural network model.
Optionally, the terminal determines a gradient direction of the first neural network model according to the computational loss through a back propagation algorithm, and updates the model parameters in the first neural network model layer by layer from an output layer of the first neural network model.
Optionally, before each error back propagation, the terminal detects whether the current iteration meets a training end condition, where the training end condition may be that the computation loss is less than the error threshold, or that the number of iterations reaches a preset number (for example, 20000). When the training end condition is not met, entering step 24; and when the training end condition is met, obtaining a trained first neural network model.
It should be noted that the model training method provided in this embodiment is only an exemplary description, and does not constitute a limitation on the training mode of the first neural network.
Referring to fig. 8, which shows a flowchart of an image processing method provided in another exemplary embodiment of the present application, in an alternative embodiment based on fig. 3, when the neural network model is a second neural network model, step 202 is replaced with step 2022 and step 2023, which are schematically described as follows:
step 2022, calling the second neural network model to identify the framing image, and obtaining the face region in the framing image.
The second neural network model is used for identifying a face region in the viewfinder image, and the face region refers to the face region of a person. Optionally, the face region includes five sense organs of the person. Optionally, the second neural network is further configured to output pixel coordinates (or pixel point positions) corresponding to the face region.
Optionally, the second neural network model may include, but is not limited to, at least one of a CNN model, an FCN model, a DNN model, an RNN model, an embedding model, a GBDT model, and an LR model.
Optionally, the training sample set of the second neural network model comprises: the method comprises the steps of obtaining a first image sample of a face area, a second image sample of a non-face area and a calibration result corresponding to each image sample. The first image sample comprises at least one group of face images, and the faces in the face images comprise face images of front faces, side faces and other angles. Optionally, except that the training sample sets are different, the training process of the second neural network may refer to the training process of the first neural network model in the embodiment shown in fig. 7, and details are not repeated here.
Step 2023, determining the portrait type of the viewfinder image according to the occupied proportion of the face area in the viewfinder image.
Optionally, after the terminal identifies the face region in the viewfinder image through the second neural network model, acquiring pixel points occupied by the face region and the total number of pixel points in the viewfinder image; and calculating the proportion of the total number of the pixels occupied by the pixel points occupied by the face area, and determining the proportion as the proportion occupied by the face area in the view-finding image.
Optionally, the terminal sets a first ratio in advance, and when the ratio occupied by the face region in the viewfinder image is equal to or greater than the first ratio, determines that the portrait type of the viewfinder image is a half-length portrait type; and when the proportion occupied by the face area in the viewfinder image is smaller than the first proportion, determining that the portrait type of the viewfinder image is a whole-body portrait type.
In conclusion, the terminal identifies the face area in the viewfinder image through the second neural network model; determining the portrait type of the viewfinder image according to the proportion occupied by the face area in the viewfinder image; when the portrait type accords with the preset type, background blurring is carried out on a non-portrait area in the view-finding image; the problem that at least 6 steps are needed to obtain a background virtual character image in the related technology is solved, the aim of automatically identifying the type of the character in the image in the shooting process is achieved, when the type of the character accords with the preset type, the user can obtain the background virtual image of a non-character area after pressing a shutter, the later-stage image repairing is not needed, the manual operation steps of the user are reduced, and the human-computer interaction efficiency is improved. And even if the user does not have the picture correcting function, the user can obtain a background blurring picture which can be shot only by a professional single lens reflex.
In the embodiment, the portrait type is judged to be a non-preset type, blurring processing is not performed on the portrait in the view finding image, a clear shooting image is obtained, a user can obtain two different images without changing the setting, and user experience is improved.
Referring to fig. 9, which shows a flowchart of an image processing method provided in another exemplary embodiment of the present application, in an alternative embodiment based on fig. 3, when the neural network model is a third neural network model, step 202 is replaced with step 2024 and step 2025, which are schematically described as follows:
step 2024, calling the third neural network model to identify the framing image, and obtaining a head region and a body region in the framing image.
The third neural network model is used for identifying a head region and a body region in the viewfinder image, wherein the head region refers to the head above the neck, and the body region refers to the body below the neck; alternatively, the head refers to the head at or below the neck, and the body region refers to the body below the neck.
Optionally, the third neural network model may include, but is not limited to, at least one of a CNN model, an FCN model, a DNN model, an RNN model, an embedding model, a GBDT model, and an LR model.
Optionally, the training sample set of the third neural network model includes: the calibration result comprises a third image sample of the head region, a fourth image sample of the body region, a fifth image sample of the non-head region and the non-body region, and a calibration result corresponding to each image sample. Except that the training sample sets are different, the training process of the third neural network may refer to the training process of the first neural network model in the embodiment shown in fig. 7, and details are not repeated here.
Step 2025, determining the portrait type of the viewfinder image according to the ratio of the head area and the body area.
Optionally, after the terminal identifies the head region and the body region in the viewfinder image through the third neural network model, pixel points occupied by the head region and the body region are respectively obtained; and calculating the proportion between the pixel points occupied by the head area and the pixel points occupied by the body area, and determining the proportion as the proportion of the head area and the body area.
Optionally, the terminal respectively obtains the highest and lowest pixel points of the head region and the body region, and respectively calculates the lengths of the head region and the body region through the highest and lowest pixel points; the ratio of the length of the head region to the length of the body region is then calculated and determined as the ratio of the head region to the body region.
Optionally, the terminal presets a second proportion, and when the proportion of the head area and the body area is smaller than or equal to the second proportion, the portrait type of the viewfinder image is determined to be a bust type; and when the proportion of the head area and the body area is larger than the second proportion, determining that the portrait type of the viewfinder image is a whole-body portrait type.
In conclusion, the terminal identifies a head region and a body region in the viewfinder image through the third neural network model; determining the portrait type of the viewfinder image according to the proportion of the head area and the body area; when the portrait type accords with the preset type, background blurring is carried out on a non-portrait area in the view-finding image; the problem that at least 6 steps are needed to obtain a background virtual character image in the related technology is solved, the aim of automatically identifying the type of the character in the image in the shooting process is achieved, when the type of the character accords with the preset type, the user can obtain the background virtual image of a non-character area after pressing a shutter, the later-stage image repairing is not needed, the manual operation steps of the user are reduced, and the human-computer interaction efficiency is improved. And even if the user does not have the picture correcting function, the user can obtain a background blurring picture which can be shot only by a professional single lens reflex.
In the embodiment, the portrait type is judged to be a non-preset type, blurring processing is not performed on the portrait in the view finding image, a clear shooting image is obtained, a user can obtain two different images without changing the setting, and user experience is improved.
Referring to fig. 10, which shows a flowchart of an image processing method according to another exemplary embodiment of the present application, based on fig. 3, when the preset type is a half-length type, step 203 is replaced with step 2031, step 204 is replaced with step 2041, and step 205 is replaced with step 2051, which is schematically described as follows:
step 2031, determine if the portrait type matches the bust type.
If the terminal judges that the portrait type accords with the half-length portrait type, the step 2041 is carried out; if the bust type is not matched, the process proceeds to step 2051.
Step 2041, when the portrait type is matched with the bust type, background blurring is performed on the non-portrait area in the viewfinder image.
In step 2051, when the portrait type does not match the bust type, the finder image is normally photographed.
In summary, the image processing method provided in this embodiment identifies the portrait type in the viewfinder image through the neural network model; when the portrait type accords with the half-length portrait type, background blurring is carried out on a non-portrait area in the viewfinder image; the problem that at least 6 steps are needed to obtain a background virtual character image in the related technology is solved, the aim of automatically identifying the type of the character in the image in the shooting process is achieved, when the type of the character accords with the preset type, the user can obtain the background virtual image of a non-character area after pressing a shutter, the later-stage image repairing is not needed, the manual operation steps of the user are reduced, and the human-computer interaction efficiency is improved. And even if the user does not have the picture correcting function, the user can obtain a background blurring picture which can be shot only by a professional single lens reflex.
In the embodiment, the clear image which is not subjected to blurring processing is shot by judging that the portrait type is a non-preset type, so that a user can obtain two different images without changing the setting, and the user experience is improved.
Referring to fig. 11, which shows a flowchart of an image processing method provided in another exemplary embodiment of the present application, in an alternative embodiment based on fig. 10, step 2041 is replaced with step 2042 and step 2043, and background blurring is performed on a non-portrait area in a viewfinder image, which is schematically described as follows:
and step 2042, when the portrait type is in line with the bust type, determining a portrait area in the viewfinder image through the neural network model.
Optionally, the terminal divides the pixels in the view image into pixels in a portrait area and pixels in a non-portrait area through the neural network model.
Step 2043, background blurring is performed on the non-portrait area in the viewfinder image except for the portrait area.
In summary, the image processing method provided in this embodiment identifies the portrait type in the viewfinder image through the neural network model; when the portrait type accords with the half-length portrait type, background blurring is carried out on a non-portrait area in the viewfinder image; the problem that at least 6 steps are needed to obtain a background virtual character image in the related technology is solved, the aim of automatically identifying the type of the character in the image in the shooting process is achieved, when the type of the character accords with the preset type, the user can obtain the background virtual image of a non-character area after pressing a shutter, the later-stage image repairing is not needed, the manual operation steps of the user are reduced, and the human-computer interaction efficiency is improved. And even if the user does not have the picture correcting function, the user can obtain a background blurring picture which can be shot only by a professional single lens reflex.
In the embodiment, the clear image which is not subjected to blurring processing is shot by judging that the portrait type is a non-preset type, so that a user can obtain two different images without changing the setting, and the user experience is improved.
Referring to fig. 12, which shows a flowchart of an image processing method provided in another exemplary embodiment of the present application, it should be noted that the method for background blurring includes performing background blurring by using a background blurring algorithm, and in an alternative embodiment based on fig. 11, step 2043 is implemented instead as step 2044, which is schematically described as follows:
step 2044, perform background blurring on the non-portrait areas except the portrait area in the viewfinder image by using an image blurring algorithm.
And the terminal takes the pixel points of the non-portrait area as input data, calculates to obtain virtualized pixel points by adopting an image virtualization algorithm, and correspondingly replaces the pixel points of the non-portrait area in the view-finding image with the virtualized pixel points to finish background virtualization.
Optionally, the image blurring algorithm is an algorithm that takes the pixel point as input and calculates to obtain a corresponding pixel point after blurring processing.
Optionally, the terminal performs background blurring on the non-portrait area through a gaussian fuzzy algorithm, where the gaussian fuzzy algorithm specifically includes: taking pixel points of the non-portrait area as input values, and calculating the weight corresponding to each pixel point by adopting a two-dimensional Gaussian formula; taking the weight corresponding to a pixel point as a center, wherein the pixel point is a central pixel point, forming a matrix according to the distance of coordinates of each pixel point, setting a fuzzy radius as a, wherein the fuzzy radius can be taken as the matrix radius and comprises a weights within the a-th weight from the weight, correspondingly forming 8a +1 weights into another matrix, and calculating the weight sum of the 8a +1 weights taking the weight corresponding to the pixel point as the center; dividing the weight of each pixel point of the other matrix by the sum of the weights to obtain the final weight corresponding to each pixel point in the matrix; and correspondingly multiplying each pixel point in the other matrix by the final weight, and summing the 8a +1 values obtained by calculation to obtain a Gaussian blur value of the central pixel point, namely the virtualized pixel point.
The gaussian blurring algorithm is only an illustrative description of the image blurring algorithm, and does not limit the image blurring algorithm, and other image blurring algorithms may be used in other embodiments.
In summary, the image processing method provided in this embodiment identifies the portrait type in the viewfinder image through the neural network model; when the portrait type accords with the half-length portrait type, background blurring is carried out on a non-portrait area in the viewfinder image; the problem that at least 6 steps are needed to obtain a background virtual character image in the related technology is solved, the aim of automatically identifying the type of the character in the image in the shooting process is achieved, when the type of the character accords with the preset type, the user can obtain the background virtual image of a non-character area after pressing a shutter, the later-stage image repairing is not needed, the manual operation steps of the user are reduced, and the human-computer interaction efficiency is improved. And even if the user does not have the picture correcting function, the user can obtain a background blurring picture which can be shot only by a professional single lens reflex.
In the embodiment, the clear image which is not subjected to blurring processing is shot by judging that the portrait type is a non-preset type, so that a user can obtain two different images without changing the setting, and the user experience is improved.
Referring to fig. 13, which shows a flowchart of an image processing method provided in another exemplary embodiment of the present application, it should be noted that the background blurring method further includes replacing a pixel point of a non-portrait area captured by the main camera with a blurring pixel point captured by the auxiliary camera, in an alternative embodiment based on fig. 11, step 2043 is implemented instead as step 2045, which is schematically described as follows:
step 2045, acquiring a blurred image shot by the auxiliary camera; and replacing non-portrait areas except the portrait area in the view finding image with pixel points in the blurring image.
In some embodiments, the terminal includes a main camera through which the terminal captures a clear image and an auxiliary camera. Compared with the main camera, the auxiliary camera is large in aperture and long in focal length, when the focal distance is short, the depth of field is shallow, and the terminal can shoot virtual images in the same view-finding range through the auxiliary camera.
Optionally, the terminal obtains the pixel points of the non-portrait area in the blurred image shot by the auxiliary camera by using a bayesian matting algorithm to replace the pixel points of the non-portrait area in the viewfinder image, so as to obtain the background blurred picture.
In summary, the image processing method provided in this embodiment identifies the portrait type in the viewfinder image through the neural network model; when the portrait type accords with the half-length portrait type, background blurring is carried out on a non-portrait area in the viewfinder image; the problem that at least 6 steps are needed to obtain a background virtual character image in the related technology is solved, the aim of automatically identifying the type of the character in the image in the shooting process is achieved, when the type of the character accords with the preset type, the user can obtain the background virtual image of a non-character area after pressing a shutter, the later-stage image repairing is not needed, the manual operation steps of the user are reduced, and the human-computer interaction efficiency is improved. And even if the user does not have the picture correcting function, the user can obtain a background blurring picture which can be shot only by a professional single lens reflex.
In the embodiment, the clear image which is not subjected to blurring processing is shot by judging that the portrait type is a non-preset type, so that a user can obtain two different images without changing the setting, and the user experience is improved.
Referring to fig. 14, a block diagram of an image processing apparatus provided by an exemplary embodiment of the present application, which may be implemented as a mobile terminal itself or as a part of the mobile terminal through software, hardware, or a combination of the two, is shown, and the apparatus includes:
an acquisition module 401 configured to acquire a through image during shooting;
an identification module 402 configured to identify a portrait type in the framing image through a neural network model;
and the processing module 403 is configured to perform background blurring on the non-portrait area in the viewfinder image when the portrait type conforms to the preset type.
In summary, the image processing apparatus provided in this embodiment solves the problem that in the related art, at least 6 steps are required to obtain a virtual character image of a background, and achieves the purpose of automatically identifying the type of the character in the image during the shooting process, when the type of the character meets the preset type, a user can obtain the background blurred image of a non-character area after pressing a shutter, and no later-stage image repairing is required, so that the number of manual operation steps of the user is reduced, and the human-computer interaction efficiency is improved. And even if the user does not have the picture correcting function, the user can obtain a background blurring picture which can be shot only by a professional single lens reflex.
In the embodiment, the clear image which is not subjected to blurring processing is shot by judging that the portrait type is a non-preset type, so that a user can obtain two different images without changing the setting, and the user experience is improved.
Referring to fig. 15, a block diagram of an image processing apparatus provided by another exemplary embodiment of the present application, which may be implemented as or as part of a mobile terminal by software, hardware, or a combination of both, is shown, the apparatus including:
an acquisition module 401 configured to acquire a through image during shooting;
an identification module 402 configured to identify a portrait type in the framing image through a neural network model;
and the processing module 403 is configured to perform background blurring on the non-portrait area in the viewfinder image when the portrait type conforms to the preset type.
In some embodiments, the identifying module 402 includes:
the figure identification submodule 41 is configured to invoke a first neural network model to identify the framing image, so as to obtain the figure type in the framing image; the portrait type comprises a whole body portrait type and a half body portrait type.
In some embodiments, the identifying module 402 includes:
the human face identification submodule 41 is configured to call a second neural network model to identify the framing image, so as to obtain a human face area in the framing image;
a first determining sub-module 42 configured to determine a portrait type of the through image according to a proportion occupied by the face area in the through image; the portrait type comprises a whole body portrait type and a half body portrait type.
In some embodiments, the identifying module 402 includes:
the portrait identification submodule 41 is configured to invoke a third neural network model to identify the framing image, so as to obtain a head area and a body area in the framing image;
a first determination submodule 42 configured to determine a portrait type of the through image based on a ratio of the head region and the body region; the portrait type comprises a whole body portrait type and a half body portrait type.
In some embodiments, the processing module 403 includes:
a background blurring sub-module 43 configured to perform background blurring on the non-portrait area in the through-view image when the portrait type corresponds to the bust type.
In some embodiments, the processing module 403 includes:
a second determination submodule 44 configured to determine a portrait area in the through image by the neural network model;
and a background blurring sub-module 43 configured to perform background blurring on non-portrait areas other than the portrait area in the through-view image.
In some embodiments, the background blurring sub-module 43 is configured to perform background blurring on non-portrait areas except the portrait area in the viewfinder image by using an image blurring algorithm; or acquiring a blurred image shot by the auxiliary camera; and replacing non-portrait areas except the portrait area in the view finding image with pixel points in the blurring image.
In summary, the image processing apparatus provided in this embodiment identifies the type of the portrait in the viewfinder image through the neural network model; when the portrait type accords with the preset type, background blurring is carried out on a non-portrait area in the view-finding image; the problem that at least 6 steps are needed to obtain a background virtual character image in the related technology is solved, the aim of automatically identifying the type of the character in the image in the shooting process is achieved, when the type of the character accords with the preset type, the user can obtain the background virtual image of a non-character area after pressing a shutter, the later-stage image repairing is not needed, the manual operation steps of the user are reduced, and the human-computer interaction efficiency is improved. And even if the user does not have the picture correcting function, the user can obtain a background blurring picture which can be shot only by a professional single lens reflex.
In the embodiment, the clear image which is not subjected to blurring processing is shot by judging that the portrait type is a non-preset type, so that a user can obtain two different images without changing the setting, and the user experience is improved.
Fig. 16 is a block diagram of an image processing apparatus 500 according to an exemplary embodiment of the present application. The device can be used as a mobile terminal. For example, the apparatus 500 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 16, the apparatus 500 may include one or more of the following components: processing component 502, memory 504, power component 506, multimedia component 508, audio component 510, input/output (I/O) interface 512, sensor component 514, and communication component 516.
The processing component 502 generally controls overall operation of the device 500, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 502 may include one or more processors 518 to execute instructions to perform all or a portion of the steps performed by the UE20 in the method embodiments described above. Further, the processing component 502 can include one or more modules that facilitate interaction between the processing component 502 and other components. For example, the processing component 502 can include a multimedia module to facilitate interaction between the multimedia component 508 and the processing component 502.
The memory 504 is configured to store various types of data to support operations at the apparatus 500. Examples of such data include instructions for any application or method operating on device 500, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 504 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 506 provides power to the various components of the device 500. The power components 506 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 500.
The multimedia component 508 includes a screen that provides an output interface between the device 500 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 508 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 500 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 510 is configured to output and/or input audio signals. For example, audio component 510 includes a Microphone (MIC) configured to receive external audio signals when apparatus 500 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 504 or transmitted via the communication component 516. In some embodiments, audio component 510 further includes a speaker for outputting audio signals.
The I/O interface 512 provides an interface between the processing component 502 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 514 includes one or more sensors for providing various aspects of status assessment for the device 500. For example, the sensor assembly 514 may detect an open/closed state of the apparatus 500, the relative positioning of the components, such as a display and keypad of the apparatus 500, the sensor assembly 514 may also detect a change in the position of the apparatus 500 or a component of the apparatus 500, the presence or absence of user contact with the apparatus 500, orientation or acceleration/deceleration of the apparatus 500, and a change in the temperature of the apparatus 500. The sensor assembly 514 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 514 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 514 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 516 is configured to facilitate communication between the apparatus 500 and other devices in a wired or wireless manner. The apparatus 500 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 516 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel.
In an exemplary embodiment, the apparatus 500 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the image processing methods in the above method embodiments.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 504 comprising instructions, executable by the processor 518 of the apparatus 500 to perform the image processing method of the above-described method embodiments is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer-readable storage medium is also provided, and the computer-readable storage medium is a non-volatile computer-readable storage medium, and a computer program is stored in the computer-readable storage medium, and when being executed by a processing component, the stored computer program can implement the image processing method provided by the above-mentioned embodiment of the present disclosure.
The disclosed embodiments also provide a computer program product having instructions stored therein, which when run on a computer, enable the computer to perform the image processing method provided by the disclosed embodiments.
The embodiment of the present disclosure also provides a chip, which includes a programmable logic circuit and/or a program instruction, and when the chip runs, the chip can execute the image processing method provided by the embodiment of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (16)

1. An image processing method, characterized in that the method comprises:
acquiring a view finding image in the shooting process;
identifying a portrait type in the framing image through a neural network model;
and when the portrait type accords with a preset type, carrying out background blurring on a non-portrait area in the viewfinder image.
2. The method of claim 1, wherein identifying the portrait type in the viewfinder image by a neural network model comprises:
calling a first neural network model to identify the framing image to obtain the portrait type in the framing image;
wherein the portrait type includes a whole body portrait type and a half body portrait type.
3. The method of claim 1, wherein identifying the portrait type in the viewfinder image by a neural network model comprises:
calling a second neural network model to identify the framing image to obtain a face area in the framing image;
determining the portrait type of the viewfinder image according to the proportion occupied by the face area in the viewfinder image;
wherein the portrait type includes a whole body portrait type and a half body portrait type.
4. The method of claim 1, wherein identifying the portrait type in the viewfinder image by a neural network model comprises:
calling a third neural network model to identify the framing image to obtain a head area and a body area in the framing image;
determining the portrait type of the viewfinder image according to the proportion of the head area and the body area;
wherein the portrait type includes a whole body portrait type and a half body portrait type.
5. The method according to any one of claims 1 to 4, wherein the background blurring the non-portrait area in the viewfinder image when the portrait type conforms to a preset type includes:
and when the portrait type is in line with the half-length portrait type, carrying out background blurring on a non-portrait area in the viewfinder image.
6. The method of claim 5, wherein background blurring the non-portrait areas in the viewfinder image comprises:
determining a portrait area in the viewfinder image through the neural network model;
and performing background blurring on the non-portrait area except the portrait area in the viewfinder image.
7. The method of claim 6, wherein background blurring the non-portrait area of the viewfinder image other than the portrait area comprises:
performing background blurring on the non-portrait area except the portrait area in the view finding image by adopting an image blurring algorithm;
or the like, or, alternatively,
acquiring a blurred image shot by an auxiliary camera; and replacing the non-portrait area except the portrait area in the view finding image with a pixel point in the virtual image.
8. An image processing apparatus, characterized in that the apparatus comprises:
an acquisition module configured to acquire a through image during shooting;
a recognition module configured to recognize a portrait type in the framing image through a neural network model;
and the processing module is configured to perform background blurring on the non-portrait area in the viewfinder image when the portrait type accords with a preset type.
9. The apparatus of claim 8, wherein the identification module comprises:
the figure recognition submodule is configured to call a first neural network model to recognize the framing image, and the figure type in the framing image is obtained; wherein the portrait type includes a whole body portrait type and a half body portrait type.
10. The apparatus of claim 8, wherein the identification module comprises:
the face recognition submodule is configured to call a second neural network model to recognize the framing image to obtain a face area in the framing image;
a first determining submodule configured to determine a portrait type of the through image according to a proportion occupied by the face region in the through image; wherein the portrait type includes a whole body portrait type and a half body portrait type.
11. The apparatus of claim 8, wherein the identification module comprises:
the portrait identification submodule is configured to call a third neural network model to identify the framing image, so that a head area and a body area in the framing image are obtained;
the first determination submodule is configured to determine a portrait type of the through-view image according to a ratio of the head region and the body region; wherein the portrait type includes a whole body portrait type and a half body portrait type.
12. The apparatus of any one of claims 8 to 11, wherein the processing module comprises:
a background blurring sub-module configured to perform background blurring on a non-portrait area in the viewfinder image when the portrait type conforms to a bust type.
13. The apparatus of claim 12, wherein the processing module comprises:
a second determination submodule configured to determine a portrait area in the through-view image through the neural network model;
the background blurring sub-module is configured to perform background blurring on the non-portrait area except the portrait area in the viewfinder image.
14. The apparatus of claim 13,
the background blurring submodule is configured to perform background blurring on the non-portrait area except the portrait area in the view-finding image by adopting an image blurring algorithm; or acquiring a blurred image shot by the auxiliary camera; and replacing the non-portrait area except the portrait area in the view finding image with a pixel point in the virtual image.
15. A terminal, characterized in that it comprises a processor and a memory in which at least one instruction, at least one program, set of codes or set of instructions is stored, which is loaded and executed by the processor to implement the image processing method according to any one of claims 1 to 7.
16. A computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement the image processing method according to any one of claims 1 to 7.
CN201811132655.9A 2018-09-27 2018-09-27 Image processing method, device, equipment and storage medium Active CN110956576B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811132655.9A CN110956576B (en) 2018-09-27 2018-09-27 Image processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811132655.9A CN110956576B (en) 2018-09-27 2018-09-27 Image processing method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110956576A true CN110956576A (en) 2020-04-03
CN110956576B CN110956576B (en) 2024-03-22

Family

ID=69968064

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811132655.9A Active CN110956576B (en) 2018-09-27 2018-09-27 Image processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110956576B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116193275A (en) * 2022-12-15 2023-05-30 荣耀终端有限公司 Video processing method and related equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105809174A (en) * 2016-03-29 2016-07-27 北京小米移动软件有限公司 Method and device for identifying image
CN107392933A (en) * 2017-07-12 2017-11-24 维沃移动通信有限公司 A kind of method and mobile terminal of image segmentation
CN107633237A (en) * 2017-09-30 2018-01-26 北京金山安全软件有限公司 Image background segmentation method, device, equipment and medium
CN107729805A (en) * 2017-09-01 2018-02-23 北京大学 The neutral net identified again for pedestrian and the pedestrian based on deep learning recognizer again
JP2018055138A (en) * 2016-09-26 2018-04-05 株式会社デンソーウェーブ Authentication system, authentication data management apparatus, gate management apparatus and authentication method
CN107948517A (en) * 2017-11-30 2018-04-20 广东欧珀移动通信有限公司 Preview screen virtualization processing method, device and equipment
CN108154465A (en) * 2017-12-19 2018-06-12 北京小米移动软件有限公司 Image processing method and device
CN108307110A (en) * 2018-01-18 2018-07-20 维沃移动通信有限公司 A kind of image weakening method and mobile terminal
CN108335258A (en) * 2017-12-29 2018-07-27 维沃移动通信有限公司 A kind of image processing method and device of mobile terminal
CN108401112A (en) * 2018-04-23 2018-08-14 Oppo广东移动通信有限公司 Image processing method, device, terminal and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105809174A (en) * 2016-03-29 2016-07-27 北京小米移动软件有限公司 Method and device for identifying image
JP2018055138A (en) * 2016-09-26 2018-04-05 株式会社デンソーウェーブ Authentication system, authentication data management apparatus, gate management apparatus and authentication method
CN107392933A (en) * 2017-07-12 2017-11-24 维沃移动通信有限公司 A kind of method and mobile terminal of image segmentation
CN107729805A (en) * 2017-09-01 2018-02-23 北京大学 The neutral net identified again for pedestrian and the pedestrian based on deep learning recognizer again
CN107633237A (en) * 2017-09-30 2018-01-26 北京金山安全软件有限公司 Image background segmentation method, device, equipment and medium
CN107948517A (en) * 2017-11-30 2018-04-20 广东欧珀移动通信有限公司 Preview screen virtualization processing method, device and equipment
CN108154465A (en) * 2017-12-19 2018-06-12 北京小米移动软件有限公司 Image processing method and device
CN108335258A (en) * 2017-12-29 2018-07-27 维沃移动通信有限公司 A kind of image processing method and device of mobile terminal
CN108307110A (en) * 2018-01-18 2018-07-20 维沃移动通信有限公司 A kind of image weakening method and mobile terminal
CN108401112A (en) * 2018-04-23 2018-08-14 Oppo广东移动通信有限公司 Image processing method, device, terminal and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116193275A (en) * 2022-12-15 2023-05-30 荣耀终端有限公司 Video processing method and related equipment
CN116193275B (en) * 2022-12-15 2023-10-20 荣耀终端有限公司 Video processing method and related equipment

Also Published As

Publication number Publication date
CN110956576B (en) 2024-03-22

Similar Documents

Publication Publication Date Title
CN110084775B (en) Image processing method and device, electronic equipment and storage medium
CN106845398B (en) Face key point positioning method and device
US11030733B2 (en) Method, electronic device and storage medium for processing image
CN110602527A (en) Video processing method, device and storage medium
CN111047526A (en) Image processing method and device, electronic equipment and storage medium
WO2016165614A1 (en) Method for expression recognition in instant video and electronic equipment
CN109325908B (en) Image processing method and device, electronic equipment and storage medium
CN114266840A (en) Image processing method, image processing device, electronic equipment and storage medium
CN112188091B (en) Face information identification method and device, electronic equipment and storage medium
WO2021042364A1 (en) Method and device for taking picture
CN112509005B (en) Image processing method, image processing device, electronic equipment and storage medium
CN114007099A (en) Video processing method and device for video processing
CN111757007B (en) Image shooting method, device, terminal and storage medium
CN112258380A (en) Image processing method, device, equipment and storage medium
CN108154093B (en) Face information identification method and device, electronic equipment and machine-readable storage medium
CN108259767B (en) Image processing method, image processing device, storage medium and electronic equipment
CN108154090B (en) Face recognition method and device
CN110956063A (en) Image processing method, device, equipment and storage medium
CN107239758B (en) Method and device for positioning key points of human face
CN110956576B (en) Image processing method, device, equipment and storage medium
CN112887615A (en) Shooting method and device
CN110135329B (en) Method, device, equipment and storage medium for extracting gestures from video
CN111160240A (en) Image object recognition processing method and device, intelligent device and storage medium
CN111507131A (en) Living body detection method and apparatus, electronic device, and storage medium
CN115623313A (en) Image processing method, image processing apparatus, electronic device, and storage medium

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