Specific embodiment
To keep the purposes, technical schemes and advantages of the embodiment of the present application clearer, below in conjunction with the embodiment of the present application
In attached drawing, the technical scheme in the embodiment of the application is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the application, instead of all the embodiments.Based on the embodiment in the application, ordinary skill people
Member's every other embodiment obtained without making creative work, shall fall in the protection scope of this application.
Fig. 1 is the applied environment figure of image processing method in one embodiment.Referring to Fig.1, the image real time transfer
Method is applied to viewdata system.The viewdata system includes terminal 110 and server 120.Terminal 110 and server
120 pass through network connection.Terminal or server obtain the original image comprising face, by Face datection model inspection original image
Face, detect intermediate face, extract the face key feature of intermediate face, generated according to face key feature and go-between
The target face of face identical dimensional.Terminal 110 specifically can be terminal console or mobile terminal, and mobile terminal specifically can be with hand
At least one of machine, tablet computer, laptop etc..Server 120 can use independent server either multiple clothes
The server cluster of business device composition is realized.
As shown in Fig. 2, in one embodiment, providing a kind of image processing method.The present embodiment is mainly with this
Method is applied to the terminal 110 (or server 120) in above-mentioned Fig. 1 to illustrate.Referring to Fig. 2, the image real time transfer side
Method specifically comprises the following steps:
Step S201 obtains the original image comprising face.
Step S202 detects intermediate face by the face in Face datection model inspection original image.
Specifically, original image refers to the image of capture apparatus shooting, includes an at least face in original image.Face datection
Model is the mathematical model for being positioned to the face in image, which includes but is not limited to deep learning network
The model parameter of model, convolutional network model etc., mathematical model can be automatically learned by machine, be also possible to artificial root
According to the customized setting of demand.Intermediate face refers to the face obtained by Face datection model inspection, and Face datection model can
Face datection present in original image is come out, that is, determines the band of position of the face in original image, will be detected in original image
Face region as intermediate face, obtain the intermediate facial image comprising intermediate face.
Step S203 extracts the face key feature of intermediate face.
Step S204 generates the target face with intermediate face identical dimensional according to face key feature.
Specifically, face key feature is the data characteristics for describing face, and the method for extracting face key feature can
To use common feature extraction algorithm, customized feature extraction algorithm can also be used.Lift algorithm by feature to extract
The face key feature of intermediary personnel, face key feature can refer to the five features of face, the position feature of face, face
Contour feature etc..It is generated and intermediate face identical dimensional according to the face key feature of extraction and pre-set create-rule
Target face.Identical dimensional refer to the target face of generation dimensional information and corresponding intermediate face dimension it is identical.
It in one embodiment, include multiple faces in original image, the intermediate face detected includes multiple, is extracted each
The face key feature of intermediate face generates the target person with each intermediate face identical dimensional according to each face key feature
Face.
Specifically, it when detecting multiple faces in Face datection model, is detected by feature extraction algorithm extraction
The face key feature of each face generates mesh corresponding with each face according to the face key feature that each Face datection arrives
Mark face.
In one embodiment, the target face with intermediate face identical dimensional is generated according to face key feature, comprising:
The pixel value for retaining pixel relevant to face key feature is substituted relevant to face key feature using presetted pixel value
The pixel value of pixel.Wherein presetted pixel value is customized pixel value, and the calculating of the pixel value can be its in image
In the pixel mean value in region or the pixel mean value of each region or the particular pixel values of specific region etc..
In one embodiment, according to calculated for pixel values rule, and the pixel of pixel relevant to face key feature
Object pixel mean value is calculated in value, and the pixel of pixel relevant to face key feature is substituted using object pixel mean value
Value.Wherein pixel computation rule is preparatory customized computation rule, is such as weighted summation to pixel value, or from default picture
The pixel value of selected characteristic position is as object pixel etc. in element.
Above-mentioned image processing method obtains the original image comprising face, passes through Face datection model inspection original image
In face, detect intermediate face, extract the face key feature of intermediate face, according to face key feature generate with it is intermediate
The target face of face identical dimensional.The face in original image is detected by Face datection model, realizes oneself of face
Dynamic detection, extracts the face key feature detected, generates the target face with original image identical dimensional according to face key feature,
Since face key feature can represent the main feature of face, face key feature is obtained by carrying out data screening to face
The data characteristics arrived, therefore the face for using the production of face key to generate can effectively improve data-handling efficiency.
In one embodiment, the target face with intermediate face identical dimensional is generated according to face key feature, comprising:
Step S301 carries out region division to intermediate face according to default division rule, obtains multiple subregions.
Specifically, default division rule refers to the image division rule preset for being divided to intermediate face,
Sliding window is such as set, is determined according to the window size of sliding window and sliding step and divides region, obtain multiple sub-districts
Domain, the size of each sub-regions and the size of sliding window are identical.Overlapping region is wherein not present between each sub-regions, with
For the image of 100*100, window size 10*10, sliding step 10, then image is divided into the image of 100 10*10
Region.
Step S302 determines pixel unrelated with face key feature in each sub-regions according to face key feature.
Specifically, crucial special according to face since face key feature is the characteristics of image extracted from intermediate face
The corresponding relationship between intermediate face is levied, determines pixel related and unrelated to face key feature in each sub-regions
Point.Such as in a wherein sub-regions, face key feature is the eyes of user, then is and people in the unrelated pixel of eyes
The unrelated pixel of face key feature.
Step S303 calculates the first pixel mean value of the pixel of each sub-regions.
Step S304 substitutes unrelated picture corresponding with each sub-regions using the first pixel mean value of each sub-regions
The pixel value of vegetarian refreshments.
Specifically, the first pixel mean value of each sub-regions is that the pixel of whole pixels of corresponding each sub-regions is equal
Value, the first pixel mean value, which can be, is weighted and averaged the pixel value of whole pixels of corresponding subregion, adds
The weighting coefficient of each pixel can be customized according to demand when weight average.It is substituted using the first pixel mean value of each sub-regions
The pixel value of unrelated pixel in corresponding each sub-regions.As included the picture unrelated with face key feature in subregion A
Vegetarian refreshments is A1, A2, A3 etc., and the pixel mean value of subregion A is 70, then sets 70 for the pixel value of pixel A1, A2, A3.It is logical
Data for expressing image can be reduced by crossing pixel mean value and substituting the pixel value of unrelated pixel, to improve the place of image
Manage efficiency.
In one embodiment, it is crucial to be less than human body for the weighting coefficient of relevant pixel corresponding to human body key feature
The corresponding unrelated pixel of feature.
In another embodiment, the weighting coefficient of whole pixels in subregion is identical.
In yet another embodiment, it is determined at a distance from relevant pixel according to pixel unrelated in each sub-regions
Weighting coefficient.The weighting coefficient of unrelated pixel such as remoter apart from relevant pixel is bigger.
In one embodiment, above-mentioned image processing method, further includes:
Step S401 determines pixel relevant to face key feature in each sub-regions according to face key feature.
Step S402 calculates the second pixel mean value of relevant pixel in each sub-regions.
Step S403 substitutes the pixel value of relevant pixel corresponding to each sub-regions using the second pixel mean value.
Specifically, according to the corresponding relationship between face key feature and intermediate face, determine in each sub-regions with
The relevant pixel of face key feature calculates the second pixel mean value of relevant pixel in each sub-regions, by each height
The second pixel mean value in region substitutes the pixel value of relevant pixel in corresponding each sub-regions.Wherein the second pixel mean value
It can be the weighted average to whole pixels relevant to face key feature, the weighting coefficient of each pixel can be made by oneself
Justice setting, such as according to the empirically determined, determining according to the pixel value of each pixel of technical staff.It is reduced by calculating mean value
For indicating the data of face key feature, to improve data-handling efficiency.
In one embodiment, face key feature includes multiple face key subcharacters, and the second pixel mean value includes more
A sub-pixel mean value, above-mentioned image processing method, comprising:
Step S501 determines picture relevant to face key subcharacter in each sub-regions according to face key subcharacter
Vegetarian refreshments.
Step S502 is calculated in each sub-regions, the sub- picture of the pixel of the relevant feature of each face key subcharacter
Plain mean value.
Step S503, using the sub-pixel mean value of each face key subcharacter, substitution with it is each in each sub-regions
The pixel value of the pixel of the relevant feature of face key subcharacter.
Specifically, when the data characteristics set that face key feature is multiple face key subcharacters composition, each region
The second pixel mean value sub-pixel mean value quantity it is identical as the quantity of face key subcharacter in each region, such as sub-district
It include two face key subcharacters in the B of domain, one is chin, another is mouth, then calculates separately the son of chin and mouth
Pixel mean value, using the pixel value of the sub-pixel mean value substitution subregion B pixel relevant to chin of chin, using mouth
Sub-pixel mean value substitutes the pixel value of subregion B pixel relevant to mouth.The different corresponding phases of face key subcharacter
The pixel value for closing pixel, it is determining according to corresponding face key subcharacter, it, can while reducing the description data of image
Preferably retain the particularity of each face key subcharacter, to improve data while guarantee data certain accuracy
Treatment effeciency.
Fig. 2 is the flow diagram of image processing method in one embodiment.Although should be understood that Fig. 2's
Each step in flow chart is successively shown according to the instruction of arrow, but these steps are not necessarily to indicate according to arrow
Sequence successively executes.Unless expressly stating otherwise herein, there is no stringent sequences to limit for the execution of these steps, these steps
Suddenly it can execute in other order.Moreover, at least part step in Fig. 2 may include multiple sub-steps or multiple ranks
Section, these sub-steps or stage are not necessarily to execute completion in synchronization, but can execute at different times, this
The execution sequence in a little step perhaps stage be also not necessarily successively carry out but can be with other steps or other steps
Sub-step or at least part in stage execute in turn or alternately.
In one embodiment, as shown in figure 3, providing a kind of image processing apparatus 200, comprising:
Image collection module 201, for obtaining the original image comprising face.
Face detection module 202, for detecting go-between by the face in Face datection model inspection original image
Face.
Characteristic extracting module 203, for extracting the face key feature of intermediate face.
Face generation module 204, for generating the target face with intermediate face identical dimensional according to face key feature.
In one embodiment, face generation module, comprising:
Image division unit obtains multiple sub-districts for carrying out region division to intermediate face according to default division rule
Domain.
Pixel determination unit, for according to face key feature, determine in each sub-regions with face key feature without
The pixel of pass.
First average calculation unit, the first pixel mean value of the pixel for calculating each sub-regions.
Pixel value updating unit substitutes corresponding with each sub-regions for the first pixel mean value using each sub-regions
Unrelated pixel pixel value.
In one embodiment, face generation module, further includes:
Pixel determination unit is also used to according to face key feature, determine in each sub-regions with face key feature phase
The pixel of pass.
Second average calculation unit, for calculating the second pixel mean value of relevant pixel in each sub-regions.
Pixel value updating unit is also used to substitute relevant pixel corresponding to each sub-regions using the second pixel mean value
The pixel value of point.
In one embodiment, pixel determination unit is also used to determine each sub-regions according to face key subcharacter
In pixel relevant to face key subcharacter, wherein face key feature includes multiple face key subcharacters.
Second average calculation unit, for calculating in each sub-regions, the relevant feature of each face key subcharacter
The sub-pixel mean value of pixel, wherein the second pixel mean value includes multiple sub-pixel mean values.
Pixel value updating unit is also used to the sub-pixel mean value using each face key subcharacter, substitution and each sub-district
The pixel value of the pixel of the relevant feature of each face key subcharacter in domain.
In one embodiment, characteristic extracting module is also used to extract the face key feature of each intermediate face, wherein inspection
The intermediate face measured includes multiple.
Face generation module is also used to generate the mesh with each intermediate face identical dimensional according to each face key feature
Mark face.
Fig. 4 shows the internal structure chart of computer equipment in one embodiment.The computer equipment specifically can be Fig. 1
In terminal 110 (or server 120).As shown in figure 4, it includes total by system that the computer equipment, which includes the computer equipment,
Processor, memory, network interface, input unit and the display screen of line connection.Wherein, memory includes that non-volatile memories are situated between
Matter and built-in storage.The non-volatile memory medium of the computer equipment is stored with operating system, can also be stored with computer journey
Sequence when the computer program is executed by processor, may make processor to realize image processing method.In the built-in storage
Computer program can be stored, when which is executed by processor, processor may make to execute image real time transfer side
Method.The display screen of computer equipment can be liquid crystal display or electric ink display screen, the input unit of computer equipment
It can be the touch layer covered on display screen, be also possible to the key being arranged on computer equipment shell, trace ball or Trackpad,
It can also be external keyboard, Trackpad or mouse etc..
It will be understood by those skilled in the art that structure shown in Fig. 4, only part relevant to application scheme is tied
The block diagram of structure does not constitute the restriction for the computer equipment being applied thereon to application scheme, specific computer equipment
It may include perhaps combining certain components or with different component layouts than more or fewer components as shown in the figure.
In one embodiment, image data processing system provided by the present application can be implemented as a kind of computer program
Form, computer program can be run in computer equipment as shown in Figure 4.Composition can be stored in the memory of computer equipment
Each program module of the image data processing system, for example, image collection module shown in Fig. 3 201, face detection module
202, characteristic extracting module 203 and face generation module 204.The computer program that each program module is constituted holds processor
Step in the image processing method of the row each embodiment of the application described in this specification.
For example, computer equipment shown in Fig. 4 can be obtained by the image in image data processing system as shown in Figure 3
Modulus block 201, which executes, obtains the original image comprising face.Computer equipment can be executed by face detection module 202 passes through face
Detection model detects the face in original image, detects intermediate face.Computer equipment can be executed by characteristic extracting module 203
Extract the face key feature of intermediate face.Computer equipment can be executed crucial special according to face by face generation module 204
Sign generates the target face with intermediate face identical dimensional.
In one embodiment, a kind of computer equipment is provided, including memory, processor and storage are on a memory
And the computer program that can be run on a processor, processor perform the steps of acquisition and include people when executing computer program
The original image of face detects intermediate face by the face in Face datection model inspection original image, extracts the people of intermediate face
Face key feature generates the target face with intermediate face identical dimensional according to face key feature.
In one embodiment, the target face with intermediate face identical dimensional is generated according to face key feature, comprising:
Region division is carried out to intermediate face according to default division rule, obtains multiple subregions, according to face key feature, is determined each
The pixel unrelated with face key feature in sub-regions calculates the first pixel mean value of the pixel of each sub-regions, adopts
With the first pixel mean value of each sub-regions, the pixel value of unrelated pixel corresponding with each sub-regions is substituted.
In one embodiment, it also performs the steps of when processor executes computer program according to face key feature,
It determines pixel relevant to face key feature in each sub-regions, calculates second of relevant pixel in each sub-regions
Pixel mean value substitutes the pixel value of relevant pixel corresponding to each sub-regions using the second pixel mean value.
In one embodiment, face key feature includes multiple face key subcharacters, and the second pixel mean value includes more
A sub-pixel mean value determines that pixel relevant to face key feature includes: in each sub-regions according to face key feature
According to face key subcharacter, determines pixel relevant to face key subcharacter in each sub-regions, calculate each sub-district
Second pixel mean value of relevant pixel in domain, comprising: calculate in each sub-regions, each face key subcharacter is relevant
The sub-pixel mean value of the pixel of feature substitutes relevant pixel corresponding to each sub-regions using the second pixel mean value
Pixel value, comprising: using each face key subcharacter sub-pixel mean value, substitution with each sub-regions in each face
The pixel value of the pixel of the relevant feature of crucial subcharacter.
In one embodiment, the intermediate face detected includes multiple, extracts the face key feature of intermediate face, packet
It includes: extracting the face key feature of each intermediate face, the mesh with intermediate face identical dimensional is generated according to face key feature
Mark face, comprising: the target face with each intermediate face identical dimensional is generated according to each face key feature.
In one embodiment, a kind of computer readable storage medium is provided, computer program is stored thereon with, is calculated
Machine program performs the steps of when being executed by processor obtains the original image comprising face, and it is former to pass through Face datection model inspection
Face in image, detects intermediate face, extracts the face key feature of intermediate face, according to face key feature generate with
The target face of intermediate face identical dimensional.
In one embodiment, the target face with intermediate face identical dimensional is generated according to face key feature, comprising:
Region division is carried out to intermediate face according to default division rule, obtains multiple subregions, according to face key feature, is determined each
The pixel unrelated with face key feature in sub-regions calculates the first pixel mean value of the pixel of each sub-regions, adopts
With the first pixel mean value of each sub-regions, the pixel value of unrelated pixel corresponding with each sub-regions is substituted.
In one embodiment, it also performs the steps of when processor executes computer program according to face key feature,
It determines pixel relevant to face key feature in each sub-regions, calculates second of relevant pixel in each sub-regions
Pixel mean value substitutes the pixel value of relevant pixel corresponding to each sub-regions using the second pixel mean value.
In one embodiment, face key feature includes multiple face key subcharacters, and the second pixel mean value includes more
A sub-pixel mean value determines that pixel relevant to face key feature includes: in each sub-regions according to face key feature
According to face key subcharacter, determines pixel relevant to face key subcharacter in each sub-regions, calculate each sub-district
Second pixel mean value of relevant pixel in domain, comprising: calculate in each sub-regions, each face key subcharacter is relevant
The sub-pixel mean value of the pixel of feature substitutes relevant pixel corresponding to each sub-regions using the second pixel mean value
Pixel value, comprising: using each face key subcharacter sub-pixel mean value, substitution with each sub-regions in each face
The pixel value of the pixel of the relevant feature of crucial subcharacter.
In one embodiment, the intermediate face detected includes multiple, extracts the face key feature of intermediate face, packet
It includes: extracting the face key feature of each intermediate face, the mesh with intermediate face identical dimensional is generated according to face key feature
Mark face, comprising: the target face with each intermediate face identical dimensional is generated according to each face key feature.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a non-volatile computer and can be read
In storage medium, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, provided herein
Each embodiment used in any reference to memory, storage, database or other media, may each comprise non-volatile
And/or volatile memory.Nonvolatile memory may include that read-only memory (ROM), programming ROM (PROM), electricity can be compiled
Journey ROM (EPROM), electrically erasable ROM (EEPROM) or flash memory.Volatile memory may include random access memory
(RAM) or external cache.By way of illustration and not limitation, RAM is available in many forms, such as static state RAM
(SRAM), dynamic ram (DRAM), synchronous dram (SDRAM), double data rate sdram (DDRSDRAM), enhanced SDRAM
(ESDRAM), synchronization link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) directly RAM (RDRAM), straight
Connect memory bus dynamic ram (DRDRAM) and memory bus dynamic ram (RDRAM) etc..
It should be noted that, in this document, the relational terms of such as " first " and " second " or the like are used merely to one
A entity or operation with another entity or operate distinguish, without necessarily requiring or implying these entities or operation it
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant are intended to
Cover non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or setting
Standby intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in the process, method, article or apparatus that includes the element.
The above is only a specific embodiment of the invention, is made skilled artisans appreciate that or realizing this hair
It is bright.Various modifications to these embodiments will be apparent to one skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention
It is not intended to be limited to the embodiments shown herein, and is to fit to and applied principle and features of novelty phase one herein
The widest scope of cause.