CN107977934A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN107977934A
CN107977934A CN201711107082.XA CN201711107082A CN107977934A CN 107977934 A CN107977934 A CN 107977934A CN 201711107082 A CN201711107082 A CN 201711107082A CN 107977934 A CN107977934 A CN 107977934A
Authority
CN
China
Prior art keywords
grid
offset
vertex
pixel
picture
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
CN201711107082.XA
Other languages
Chinese (zh)
Other versions
CN107977934B (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 CN201711107082.XA priority Critical patent/CN107977934B/en
Publication of CN107977934A publication Critical patent/CN107977934A/en
Application granted granted Critical
Publication of CN107977934B publication Critical patent/CN107977934B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • G06T5/90
    • G06T3/02
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4007Interpolation-based scaling, e.g. bilinear interpolation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation

Abstract

The disclosure is directed to image processing method and device.This method includes:Picture human face region is divided into equal-sized grid;Wherein, each grid includes four vertex;According to the offset of human face characteristic point in picture, using the offset on each vertex of affine transform algorithm calculating grid;According to the offset on each vertex of grid, using the offset of each pixel in bilinear interpolation algorithm calculating grid;According to the offset of each pixel in the offset on each vertex of grid and grid, the pixel value of each pixel in picture after U.S.'s face is determined.The disclosure by picture human face region by being divided into grid, the offset of grid vertex is calculated using affine transform algorithm, and the offset of each pixel in grid is then calculated using bilinear interpolation algorithm, calculation amount can be reduced, image processing time is saved, improves user experience.

Description

Image processing method and device
Technical field
This disclosure relates to field of terminal technology, more particularly to image processing method and device.
Background technology
In general, terminal is supported to carry out face in picture or video the function of U.S. face;U.S. face function, which possesses, overturns traditional bat According to the function of effect, moment U.S. face automatically, such as it can realize thin face, big eye, whitening, face solid and other effects.
The content of the invention
To overcome problem present in correlation technique, the embodiment of the present disclosure provides a kind of image processing method and device.Institute It is as follows to state technical solution:
According to the first aspect of the embodiment of the present disclosure, there is provided a kind of image processing method, including:
Picture human face region is divided into equal-sized grid;Wherein, each grid includes four vertex;
According to the offset of human face characteristic point in the picture, using each vertex of the affine transform algorithm calculating grid Offset;
According to the offset on each vertex of the grid, each pixel in the grid is calculated using bilinear interpolation algorithm Offset;
According to the offset of each pixel in the offset on each vertex of the grid and the grid, scheme after determining U.S.'s face The pixel value of each pixel in piece.
In one embodiment, picture human face region is divided into equal-sized grid, including:
Determine to surround a little in the picture;Wherein, the encirclement line that forms of point is surrounded by described, to by the face characteristic Point surrounds;
By in the picture by the region division that crosses of encirclement line into equal-sized grid.
In one embodiment, according to the offset of human face characteristic point in the picture, calculated using affine transform algorithm The offset on each vertex of the grid, including:
According to the human face characteristic point and encirclement point, triangular mesh is carried out to the picture, obtains subdivision triangle Shape;
According to the offset of the human face characteristic point, to the subdivision triangle into line displacement;
Determine the subdivision triangle after the offset belonging to each vertex of the grid;
According to the offset of the corresponding human face characteristic point of subdivision vertex of a triangle after the offset, using affine transformation Algorithm determines the offset on each vertex of the grid respectively.
In one embodiment, the method further includes:
The data of each pixel of the picture are stored successively according to grid for unit.
In one embodiment, according to the offset on each vertex of the grid, institute is calculated using bilinear interpolation algorithm The offset of each pixel in grid is stated, including:
When offset on each vertex of the grid is respectively less than predetermined threshold value, by the offset on each vertex of the grid And the offset of each pixel is determined as zero in the grid;Alternatively,
When offset at least one vertex in each vertex of the grid is greater than or equal to the predetermined threshold value, using double Linear interpolation algorithm calculates the offset of each pixel in the grid.
In one embodiment, the number for the pixel that the grid includes is 8 multiple.
According to the second aspect of the embodiment of the present disclosure, there is provided a kind of image processing apparatus, including:
Division module, for picture human face region to be divided into equal-sized grid;Wherein, each grid includes four Vertex;
First computing module, for the offset according to human face characteristic point in the picture, using affine transform algorithm meter Calculate the offset on each vertex of the grid;
Second computing module, for the offset on each vertex according to the grid, is calculated using bilinear interpolation algorithm The offset of each pixel in the grid;
Determining module, the offset for each pixel in the offset on each vertex according to the grid and the grid Amount, determines the pixel value of each pixel in picture after U.S.'s face.
In one embodiment, division module, including:
First determination sub-module, for determining to surround a little in the picture;Wherein, by the encirclement surrounded point and formed Line, the human face characteristic point to be surrounded;
Divide submodule, for by the picture by the region division that crosses of encirclement line into equal-sized net Lattice.
In one embodiment, the first computing module, including:
Subdivision submodule, for according to the human face characteristic point and encirclement point, carrying out trigonometric ratio to the picture and cuing open Point, obtain subdivision triangle;
Submodule is deviated, for the offset according to the human face characteristic point, to the subdivision triangle into line displacement;
Second determination sub-module, for determining the subdivision triangle after the offset belonging to each vertex of the grid;
3rd determination sub-module, for according to the corresponding human face characteristic point of subdivision vertex of a triangle after the offset Offset, the offset on each vertex of the grid is determined using affine transform algorithm respectively.
In one embodiment, described device further includes:
Memory module, for the data of each pixel of the picture to be stored successively according to grid for unit.
In one embodiment, the second computing module, the offset on each vertex of the grid are respectively less than predetermined threshold value When, the offset of each pixel in the offset on each vertex of the grid and the grid is determined as zero;In the net When the offset at least one vertex in each vertex of lattice is greater than or equal to the predetermined threshold value, calculated using bilinear interpolation algorithm The offset of each pixel in the grid.
According to the third aspect of the embodiment of the present disclosure, there is provided a kind of image processing apparatus, including:
Processor;
For storing the memory of processor-executable instruction;
Wherein, the processor is configured as:
Picture human face region is divided into equal-sized grid;Wherein, each grid includes four vertex;
According to the offset of human face characteristic point in the picture, using each vertex of the affine transform algorithm calculating grid Offset;
According to the offset on each vertex of the grid, each pixel in the grid is calculated using bilinear interpolation algorithm Offset;
According to the offset of each pixel in the offset on each vertex of the grid and the grid, scheme after determining U.S.'s face The pixel value of each pixel in piece.
According to the fourth aspect of the embodiment of the present disclosure, there is provided a kind of computer-readable recording medium, is stored thereon with calculating The step of machine instructs, which realizes above-mentioned first aspect the method when being executed by processor.
The technical scheme provided by this disclosed embodiment can include the following benefits:The technical solution is by by picture Human face region is divided into equal-sized grid, and the offset of grid vertex is calculated using affine transform algorithm, and in grid The calculating of the offset of each pixel does not use affine transform algorithm, but it is each in grid to use bilinear interpolation algorithm to calculate The offset of pixel, compared to correlation technique, can reduce calculation amount, save image processing time, improve user experience.
It should be appreciated that the general description and following detailed description of the above are only exemplary and explanatory, not The disclosure can be limited.
Brief description of the drawings
Attached drawing herein is merged in specification and forms the part of this specification, shows the implementation for meeting the disclosure Example, and be used to together with specification to explain the principle of the disclosure.
Fig. 1 is the flow chart of the image processing method according to an exemplary embodiment.
Fig. 2 is the flow chart of the image processing method according to an exemplary embodiment.
Fig. 3 a are the schematic diagram of a scenario of the image processing method according to an exemplary embodiment.
Fig. 3 b are the schematic diagram of a scenario of the image processing method according to an exemplary embodiment.
Fig. 4 is the block diagram of the image processing apparatus according to an exemplary embodiment.
Fig. 5 is the block diagram of the image processing apparatus according to an exemplary embodiment.
Fig. 6 is the block diagram of the image processing apparatus according to an exemplary embodiment.
Fig. 7 is the block diagram of the image processing apparatus according to an exemplary embodiment.
Fig. 8 is the block diagram of the image processing apparatus according to an exemplary embodiment.
Fig. 9 is the block diagram of the image processing apparatus according to an exemplary embodiment.
Figure 10 is the block diagram of the image processing apparatus according to an exemplary embodiment.
Embodiment
Here exemplary embodiment will be illustrated in detail, its example is illustrated in the accompanying drawings.Following description is related to During attached drawing, unless otherwise indicated, the same numbers in different attached drawings represent the same or similar key element.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the disclosure.On the contrary, they be only with it is such as appended The example of the consistent apparatus and method of some aspects be described in detail in claims, the disclosure.
In general, terminal such as smart mobile phone, supports to carry out face in picture or video U.S. face processing.In correlation technique, Human face region in picture is deformed according to positioning feature point;However, during U.S. face processing is carried out to picture, Need to calculate the offset of each pixel in the picture after U.S. face respectively using affine transform algorithm, calculation amount is larger, compares consumption When, computational efficiency is relatively low, influences user experience.
To solve the above-mentioned problems, the embodiment of the present disclosure provides a kind of image processing method, and method includes:By picture people Face region division is into equal-sized grid;Wherein, each grid includes four vertex;According in picture human face characteristic point it is inclined Shifting amount, the offset on each vertex of grid is calculated using affine transform algorithm;According to the offset on each vertex of grid, using double Linear interpolation algorithm calculates the offset of each pixel in grid;According to each pixel in the offset on each vertex of grid and grid The offset of point, determines the pixel value of each pixel in picture after U.S.'s face.
The image processing method that the embodiment of the present disclosure provides, by the way that picture human face region is divided into equal-sized net Lattice, the offset of grid vertex is calculated using affine transform algorithm, and the calculating to the offset of each pixel in grid is not Affine transform algorithm is used, but uses the offset of each pixel in bilinear interpolation algorithm calculating grid, compared to correlation Technology, can reduce calculation amount, save image processing time, improve user experience.
It is pointed out that terminal is, for example, smart mobile phone, tablet computer, desktop computer, notebook in the embodiment of the present disclosure The equipment such as computer or Wearable (such as bracelet, intelligent glasses).
Based on above-mentioned analysis, following specific embodiment is proposed.
Fig. 1 is a kind of flow chart of image processing method according to an exemplary embodiment, the execution master of this method Body can be terminal, as shown in Figure 1, this method comprises the following steps 101-104:
In a step 101, picture human face region is divided into equal-sized grid;Wherein, each grid includes four Vertex.
Exemplary, face is carried out in the scene of U.S. face processing in picture or video, and it is special to carry out face to picture first Point location is levied, human face characteristic point in picture is determined and surrounds point;By surrounding the encirclement line that forms of point, to by human face characteristic point bag Enclose;The border of picture cannot be exceeded in itself by surrounding line, when carrying out U.S. face processing for face in picture, to the deformation range of face It is only limited to carry out in encirclement line;In U.S. face processing procedure, surround line and remain stationary as, that is, surround the offset at any point on line Measure as 0;Determine the offset of each human face characteristic point in picture;According to the offset of human face characteristic point, mobile human face characteristic point is extremely Opposite position.
It is exemplary, facial modeling is carried out to picture using face key point location algorithm, orients people in picture Face characteristic point;Face key point location algorithm can for example include:Active appearance models (AAM, active appearance Models), there are the gradient descent method (SDM, supervised descent method) or convolutional neural networks of supervision (CNN, convolutional neural networks) etc..
It is exemplary, by picture by the region division that encirclement line crosses into equal-sized grid, grid be, for example, grid; Exemplary, the number for the pixel that grid includes is 8 multiple.For example, single grid can include the 8N pictures such as 8,16 or 32 Vegetarian refreshments, N are positive integer.Each sizing grid is the same, and includes the pixel of 8 multiple, can align with memory, memory address Usually 8 multiple, facilitates data access, improves data access efficiency.
Image data is usually stored row wise or column wise in correlation technique;However, needing to calculate respectively in units of grid During the offset of the pixel of grid, in order to read the data of all pixels of grid point from memory, that can not will keep away Read the data of the pixel of adjacent mesh with exempting from, so as to waste cache resources, reduce data reading performance using redundancy.Asked to solve this Topic, by picture by the region division that encirclement line crosses into after equal-sized grid, can be by each pixel of picture Data stored successively for unit according to grid;By the data of each pixel of picture it is unit according to grid different from the disclosure It is centrally stored, by taking single grid includes 64 pixels (8 row * 8 arrange a pixel) as an example, the 64 of first grid is stored first The data of a pixel, then store 64 pixel number evidences of second grid, to the last the data storage of a grid Finish;The data of the pixel such as coordinate including pixel.When calculating the offset of pixel of grid, due to grid The data of pixel are centrally stored, this just can continuously read the data of the pixel of grid, therefore need not frequently read Access evidence, facilitates digital independent, improves data reading performance using redundancy.
In a step 102, according to the offset of human face characteristic point in picture, each of grid is calculated using affine transform algorithm The offset on vertex.
It is exemplary, according to human face characteristic point and point is surrounded, triangular mesh is carried out to picture, obtains subdivision triangle;Root According to the offset of human face characteristic point, to subdivision triangle into line displacement;Determine the subdivision after the offset belonging to each vertex of grid Triangle;According to the offset of the corresponding human face characteristic point of subdivision vertex of a triangle after offset, using affine transform algorithm The offset on each vertex of grid is determined respectively.
In step 103, according to the offset on each vertex of grid, each picture in grid is calculated using bilinear interpolation algorithm The offset of vegetarian refreshments.
Exemplary, after the offset on each vertex of grid is obtained, judging the offset on each vertex of grid respectively is It is no to be less than predetermined threshold value:When offset on each vertex of grid is respectively less than predetermined threshold value, illustrate face area corresponding to the grid The amplitude of deformation in domain does not become seldom or, human face region corresponding to the grid can not be deformed, can reduce calculation amount, Save image processing time;The offset of each pixel in the offset on each vertex of grid and grid is determined as zero; When the offset at least one vertex in each vertex of grid is greater than or equal to predetermined threshold value, net is calculated using bilinear interpolation algorithm The offset of each pixel in lattice.
At step 104, according to the offset of each pixel in the offset on each vertex of grid and grid, U.S.'s face is determined Afterwards in picture each pixel pixel value.
The technical scheme provided by this disclosed embodiment, by the way that picture human face region is divided into equal-sized grid, The offset of grid vertex is calculated using affine transform algorithm, and the calculating to the offset of each pixel in grid does not use Affine transform algorithm, but use bilinear interpolation algorithm to calculate the offset of each pixel in grid, compared to correlation technique, Calculation amount can be reduced, saves image processing time, so, it is possible to improve user experience.
Fig. 2 is a kind of flow chart of image processing method according to an exemplary embodiment.As shown in Fig. 2, in Fig. 1 On the basis of illustrated embodiment, this disclosure relates to image processing method may comprise steps of 201-212:
In step 201, facial modeling is carried out to picture, determines human face characteristic point in picture and surround point;Its In, by surrounding an encirclement line formed, human face characteristic point to be surrounded.
Exemplary, the border of picture cannot be exceeded in itself by surrounding line, when carrying out U.S. face processing for face in picture, to people The deformation range of face is only limited to carry out in encirclement line;In U.S. face processing procedure, surround line and remain stationary as, that is, surround line and take up an official post The offset of any of anticipating is 0.
In step 202, the offset of each human face characteristic point in picture is determined.
In step 203, according to human face characteristic point and encirclement point, triangular mesh is carried out to picture, obtains subdivision triangle Shape.
In step 204, according to the offset of human face characteristic point, to subdivision triangle into line displacement, after being deviated Subdivision triangle.
It is exemplary, according to the offset of human face characteristic point, human face characteristic point is moved to the offset with human face characteristic point Corresponding position, then the subdivision vertex of a triangle corresponding to the human face characteristic point also deviated;Complete to subdivision three After the offset on whole vertex on angular in addition to surrounding point, the subdivision triangle after being deviated.Shown referring to Fig. 3 a Offset after subdivision triangle, white bar for surround line, surround line on point for surround point.
In step 205, by picture by the region division that encirclement line crosses into equal-sized grid;Wherein, each Grid includes four vertex.
Referring to Fig. 3 b, the region crossed in picture by encirclement line is divided into equal-sized grid.
Exemplary, the number for the pixel that grid includes is 8 multiple.
In correlation technique, image data is usually stored by row or column, still, is needing to count respectively in units of grid When calculating the offset of the pixel of grid, in order to read the data of all pixels of grid point from memory, that can not just keep away The data of the pixel of adjacent mesh can be read with exempting from, so as to waste cache resources, cause data reading performance using redundancy relatively low.To solve The problem, can store the data of each pixel of picture successively according to grid for unit;Specifically, by picture by wrapping The region division that contour crosses is into after equal-sized grid, and the storage order to data recombinates, by each picture of picture The data of vegetarian refreshments are centrally stored successively for unit according to grid;Including 64 pixels with single grid, (8 row * 8 arrange a pixel Point) exemplified by, first store first grid 64 pixels data, then store second grid 64 pixel numbers According to the to the last data storage of a grid finishes.When calculating the offset of pixel of grid, due to the pixel of grid The data of point are centrally stored, this just can continuously read the data of the pixel of grid, therefore need not frequently read number According to facilitating digital independent, improve cache resources utilization rate, improve data reading performance using redundancy.
In step 206, the subdivision triangle after the offset belonging to each vertex of grid is determined.
In step 207, according to the offset of the corresponding human face characteristic point of subdivision vertex of a triangle after offset, use Affine transform algorithm determines the offset on each vertex of grid respectively.
In a step 208, judge whether the offset on each vertex of grid is less than predetermined threshold value respectively, on each top of grid When the offset of point is respectively less than predetermined threshold value, step 209 is gone to;Offset at least one vertex in each vertex of grid is more than Or during equal to predetermined threshold value, go to step 210.
In step 209, the offset of each pixel in the offset on each vertex of grid and grid is determined as zero; Go to step 211.
In step 210, the offset of each pixel in grid is calculated using bilinear interpolation algorithm;Go to step 211.
In correlation technique, when needing to calculate the offset of each pixel, the subdivision triangle after offset is got first Vertex correspondence human face characteristic point offset, then using affine transform algorithm calculate offset after subdivision triangle in The offset calculation amount of each pixel is larger, than relatively time-consuming.The embodiment of the present disclosure is needing to calculate the offset of each pixel When, by picture by the region division that encirclement line crosses into equal-sized grid, it is assumed that each grid includes 156 pixels (16*16 pixel), the offset on four vertex of grid is calculated using affine transform algorithm, then using bilinear interpolation The algorithm approximate offset for obtaining each pixel inside grid respectively;Compared to correlation technique, the embodiment of the present disclosure can be with Calculating speed is improved 256 times.
In step 211, according to the offset of each pixel in the offset on each vertex of grid and grid, U.S.'s face is determined Afterwards in picture each pixel pixel value.
In the step 212, after according to the offset of each pixel in the offset on each vertex of grid, grid and U.S. face The pixel value of each pixel in picture, determines picture after U.S.'s face.
The technical scheme provided by this disclosed embodiment, by the way that picture human face region is divided into equal-sized grid, Only need to calculate the offset of grid vertex using affine transform algorithm, but to the offset of each pixel in grid then using double Linear interpolation algorithm is calculated, and compared to correlation technique, can be reduced calculation amount, be saved image processing time, improve and calculate Efficiency;Meanwhile whether predetermined threshold value, and the offset on each vertex of grid are less than by the offset on each vertex for judging grid When amount is respectively less than predetermined threshold value, illustrate that the amplitude of deformation of human face region corresponding to the grid does not become seldom or, can not be to this Human face region is deformed corresponding to grid, can reduce calculation amount, saves image processing time;It so, it is possible to improve user Experience.
Following is embodiment of the present disclosure, can be used for performing embodiments of the present disclosure.
Fig. 4 is a kind of block diagram of image processing apparatus according to an exemplary embodiment;The device can use each Kind of mode is implemented, such as all components of implementation in the terminal, alternatively, in end side implementation in a coupled manner In component;The device can by software, hardware or both be implemented in combination with it is above-mentioned this disclosure relates to method, such as Fig. 4 Shown, which includes:Division module 401, the first computing module 402, the second computing module 403 and determining module 404, wherein:
Division module 401 is configured as picture human face region being divided into equal-sized grid;Wherein, each grid bag Include four vertex;
First computing module 402 is configured as the offset according to human face characteristic point in picture, using affine transform algorithm Calculate the offset on each vertex of grid;
Second computing module 403 is configured as the offset on each vertex according to grid, using bilinear interpolation algorithm meter Calculate the offset of each pixel in grid;
Determining module 404 is configured as the offset of each pixel in offset and grid according to each vertex of grid, Determine the pixel value of each pixel in picture after U.S.'s face.
The device that the embodiment of the present disclosure provides can be used in performing the technical solution of embodiment illustrated in fig. 1, its executive mode Similar with beneficial effect, details are not described herein again.
In a kind of possible embodiment, drawn as shown in figure 5, the image processing apparatus shown in Fig. 4 can also include handle Sub-module 401 is configured to include:First determination sub-module 501 and division submodule 502, wherein:
First determination sub-module 501, which is configured to determine that in picture, surrounds a little;Wherein, the encirclement line formed by surrounding point, Human face characteristic point to be surrounded;
Division submodule 502 be configured as by picture by the region division that encirclement line crosses into equal-sized grid.
In a kind of possible embodiment, as shown in fig. 6, image processing apparatus shown in Fig. 4 can also be included the One computing module 402 is configured to include:Subdivision submodule 601, offset submodule 602, the second determination sub-module 603 and the 3rd are true Stator modules 604, wherein:
Subdivision submodule 601 is configured as according to human face characteristic point and surrounds point, carries out triangular mesh to picture, obtains Subdivision triangle;
Offset submodule 602 is configured as offset according to human face characteristic point, to subdivision triangle into line displacement;
Second determination sub-module 603 is configured to determine that the subdivision triangle after the offset belonging to each vertex of grid;
3rd determination sub-module 604 is configured as according to the corresponding human face characteristic point of subdivision vertex of a triangle after offset Offset, using affine transform algorithm respectively determine grid each vertex offset.
In a kind of possible embodiment, as shown in fig. 7, the image processing apparatus shown in Fig. 4 can also include storage Module 701, is configured as according to grid storing the data of each pixel of picture successively for unit.
In a kind of possible embodiment, offset of second computing module 403 on each vertex of grid is respectively less than pre- If during threshold value, the offset of each pixel in the offset on each vertex of grid and grid is determined as zero;Second calculates mould When offset of the block 403 at least one vertex in each vertex of grid is greater than or equal to predetermined threshold value, calculated using bilinear interpolation Method calculates the offset of each pixel in grid.
Fig. 8 is a kind of block diagram of image processing apparatus 800 according to an exemplary embodiment, image processing apparatus 800 can adopt in various manners to implement, such as all components of implementation in the terminal, or in end side to couple Component in mode implementation;Image processing apparatus 800 includes:
Processor 801;
For storing the memory 802 of processor-executable instruction;
Wherein, processor 801 is configured as:
Picture human face region is divided into equal-sized grid;Wherein, each grid includes four vertex;
According to the offset of human face characteristic point in picture, the offset on each vertex of grid is calculated using affine transform algorithm Amount;
According to the offset on each vertex of grid, the offset of each pixel in grid is calculated using bilinear interpolation algorithm Amount;
According to the offset of each pixel in the offset on each vertex of grid and grid, each picture in picture after definite U.S.'s face The pixel value of vegetarian refreshments.
In one embodiment, above-mentioned processor 801 is also configured to:
Determine to surround a little in picture;Wherein, the encirclement line formed by surrounding point, human face characteristic point to be surrounded;
By in picture by the region division that encirclement line crosses into equal-sized grid.
In one embodiment, above-mentioned processor 801 is also configured to:
According to human face characteristic point and point is surrounded, triangular mesh is carried out to picture, obtains subdivision triangle;
According to the offset of human face characteristic point, to subdivision triangle into line displacement;
Determine the subdivision triangle after the offset belonging to each vertex of grid;
According to the offset of the corresponding human face characteristic point of subdivision vertex of a triangle after offset, using affine transform algorithm The offset on each vertex of grid is determined respectively.
In one embodiment, above-mentioned processor 801 is also configured to:
The data of each pixel of picture are stored successively according to grid for unit.
In one embodiment, above-mentioned processor 801 is also configured to:
When offset on each vertex of grid is respectively less than predetermined threshold value, by the offset on each vertex of grid and grid The offset of each pixel is determined as zero;Alternatively,
When offset at least one vertex in each vertex of grid is greater than or equal to predetermined threshold value, using bilinear interpolation Algorithm calculates the offset of each pixel in grid.
In one embodiment, the number for the pixel that grid includes is 8 multiple.
On the device in above-described embodiment, wherein modules perform the concrete mode of operation in related this method Embodiment in be described in detail, explanation will be not set forth in detail herein.
Fig. 9 is a kind of block diagram of image processing apparatus according to an exemplary embodiment;Image processing apparatus 900 is suitable For terminal;Image processing apparatus 900 can include following one or more assemblies:Processing component 902, memory 904, power supply Component 906, multimedia component 908, audio component 910, the interface 912 of input/output (I/O), sensor component 914, and Communication component 916.
Processing component 902 usually controls the integrated operation of image processing apparatus 900, such as with display, call, data The operation that communication, camera operation and record operation are associated.Processing component 902 can be including one or more processors 920 Execute instruction, to complete all or part of step of above-mentioned method.In addition, processing component 902 can include one or more Module, easy to the interaction between processing component 902 and other assemblies.For example, processing component 902 can include multi-media module, To facilitate the interaction between multimedia component 908 and processing component 902.
Memory 904 is configured as storing various types of data to support the operation in image processing apparatus 900.These The example of data includes the instruction of any application program or method for being operated on image processing apparatus 900, contacts number According to, telephone book data, message, picture, video etc..Memory 904 can be by any kind of volatibility or non-volatile memories Equipment or combinations thereof are realized, such as static RAM (SRAM), electrically erasable programmable read-only memory (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read only memory (PROM), read-only storage (ROM), magnetic memory, flash memory, disk or CD.
Power supply module 906 provides electric power for the various assemblies of image processing apparatus 900.Power supply module 906 can include electricity Management system, one or more power supplys, and other generate with for image processing apparatus 900, manage and to distribute electric power associated Component.
Multimedia component 908 is included in the screen of one output interface of offer between image processing apparatus 900 and user. In certain embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touch surface Plate, screen may be implemented as touch-screen, to receive input signal from the user.Touch panel includes one or more touch Sensor is to sense the gesture on touch, slip and touch panel.Touch sensor can not only sense touch or sliding action Border, but also detect with touch or the relevant duration and pressure of slide.In certain embodiments, multimedia group Part 908 includes a front camera and/or rear camera.When image processing apparatus 900 is in operator scheme, mould is such as shot When formula or video mode, front camera and/or rear camera can receive exterior multi-medium data.Each preposition shooting Head and rear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 910 is configured as output and/or input audio signal.For example, audio component 910 includes a Mike Wind (MIC), when image processing apparatus 900 is in operator scheme, during such as call model, logging mode and speech recognition mode, wheat Gram wind is configured as receiving external audio signal.The received audio signal can be further stored in memory 904 or warp Sent by communication component 916.In certain embodiments, audio component 910 further includes a loudspeaker, for exporting audio letter Number.
I/O interfaces 912 provide interface between processing component 902 and peripheral interface module, and above-mentioned peripheral interface module can To be keyboard, click wheel, button etc..These buttons may include but be not limited to:Home button, volume button, start button and lock Determine button.
Sensor component 914 includes one or more sensors, for providing various aspects for image processing apparatus 900 Status assessment.For example, sensor component 914 can detect opening/closed mode of image processing apparatus 900, the phase of component To positioning, such as the display and keypad that component is image processing apparatus 900, sensor component 914 can be with detection image The position of 900 1 components of processing unit 900 or image processing apparatus changes, and user deposits with what image processing apparatus 900 contacted Or be not present, 900 orientation of image processing apparatus or acceleration/deceleration and the temperature change of image processing apparatus 900.Sensor group Part 914 can include proximity sensor, be configured to detect presence of nearby objects without any physical contact.Pass Sensor component 914 can also include optical sensor, such as CMOS or ccd image sensor, for being used in imaging applications.One In a little embodiments, which can also include acceleration transducer, gyro sensor, Magnetic Sensor, pressure biography Sensor or temperature sensor.
Communication component 916 is configured to facilitate wired or wireless way between image processing apparatus 900 and other equipment Communication.Image processing apparatus 900 can access the wireless network based on communication standard, such as WiFi, 2G or 3G, or their group Close.In one exemplary embodiment, communication component 916 receives the broadcast from external broadcasting management system via broadcast channel Signal or broadcast related information.In one exemplary embodiment, communication component 916 further includes near-field communication (NFC) module, with Promote junction service.For example, can be based on radio frequency identification (RFID) technology in NFC module, Infrared Data Association (IrDA) technology, surpasses Broadband (UWB) technology, bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, image processing apparatus 900 can be by one or more application application-specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), scene can Program gate array (FPGA), controller, microcontroller, microprocessor or other electronic building bricks to realize, for performing the above method.
In the exemplary embodiment, there is provided a kind of non-transitorycomputer readable storage medium including instructing, such as Memory 904 including instruction, above-metioned instruction can be performed to complete the above method by the processor 920 of image processing apparatus 900. For example, non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk With optical data storage devices etc..
Figure 10 is a kind of block diagram of image processing apparatus according to an exemplary embodiment.For example, image procossing fills Put 1000 and may be provided as a server.Image processing apparatus 1000 includes processing component 1002, it further comprises one Or multiple processors, and as the memory resource representated by memory 1003, can holding by processing component 1002 for storing Capable instruction, such as application program.The application program stored in memory 1003 can include one or more each A module for corresponding to one group of instruction.In addition, processing component 1002 is configured as execute instruction, to perform the above method.
Image processing apparatus 1000 can also be configured as performing image processing apparatus including a power supply module 1006 1000 power management, a wired or wireless network interface 1005 are configured as image processing apparatus 1000 being connected to net Network, and input and output (I/O) interface 1008.Image processing apparatus 1000 can be operated based on being stored in memory 1003 Operating system, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or similar.
A kind of non-transitorycomputer readable storage medium, when the instruction in storage medium by image processing apparatus 900 or When the processor of image processing apparatus 1000 performs so that image processing apparatus 900 or image processing apparatus 1000 are able to carry out Following image processing method, method include:
Picture human face region is divided into equal-sized grid;Wherein, each grid includes four vertex;According to picture The offset of middle human face characteristic point, the offset on each vertex of grid is calculated using affine transform algorithm;According to each top of grid The offset of point, the offset of each pixel in grid is calculated using bilinear interpolation algorithm;According to the inclined of each vertex of grid The offset of each pixel in shifting amount and grid, determines the pixel value of each pixel in picture after U.S.'s face.
Those skilled in the art will readily occur to the disclosure its after considering specification and putting into practice disclosure disclosed herein Its embodiment.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or Person's adaptive change follows the general principle of the disclosure and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.Description and embodiments are considered only as exemplary, and the true scope and spirit of the disclosure are by following Claim is pointed out.
It should be appreciated that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by appended claim.

Claims (13)

  1. A kind of 1. image processing method, it is characterised in that including:
    Picture human face region is divided into equal-sized grid;Wherein, each grid includes four vertex;
    According to the offset of human face characteristic point in the picture, calculated using affine transform algorithm the grid each vertex it is inclined Shifting amount;
    According to the offset on each vertex of the grid, the inclined of each pixel in the grid is calculated using bilinear interpolation algorithm Shifting amount;
    According to the offset of each pixel in the offset on each vertex of the grid and the grid, after definite U.S.'s face in picture The pixel value of each pixel.
  2. 2. according to the method described in claim 1, it is characterized in that, picture human face region is divided into equal-sized grid, Including:
    Determine to surround a little in the picture;Wherein, the encirclement line that forms of point is surrounded by described, to by the human face characteristic point bag Enclose;
    By in the picture by the region division that crosses of encirclement line into equal-sized grid.
  3. 3. according to the method described in claim 2, it is characterized in that, according to the offset of human face characteristic point in the picture, adopt The offset on each vertex of the grid is calculated with affine transform algorithm, including:
    According to the human face characteristic point and encirclement point, triangular mesh is carried out to the picture, obtains subdivision triangle;
    According to the offset of the human face characteristic point, to the subdivision triangle into line displacement;
    Determine the subdivision triangle after the offset belonging to each vertex of the grid;
    According to the offset of the corresponding human face characteristic point of subdivision vertex of a triangle after the offset, using affine transform algorithm The offset on each vertex of the grid is determined respectively.
  4. 4. according to the method described in claim 1, it is characterized in that, the method further includes:
    The data of each pixel of the picture are stored successively according to grid for unit.
  5. 5. according to the method described in claim 1, it is characterized in that, according to the offset on each vertex of the grid, using double Linear interpolation algorithm calculates the offset of each pixel in the grid, including:
    When offset on each vertex of the grid is respectively less than predetermined threshold value, by the offset on each vertex of the grid and institute The offset for stating each pixel in grid is determined as zero;Alternatively,
    When offset at least one vertex in each vertex of the grid is greater than or equal to the predetermined threshold value, using bilinearity Interpolation algorithm calculates the offset of each pixel in the grid.
  6. 6. according to the method described in claim 1, it is characterized in that, the number for the pixel that the grid includes is 8 multiple.
  7. A kind of 7. image processing apparatus, it is characterised in that including:
    Division module, for picture human face region to be divided into equal-sized grid;Wherein, each grid includes four tops Point;
    First computing module, for the offset according to human face characteristic point in the picture, institute is calculated using affine transform algorithm State the offset on each vertex of grid;
    Second computing module, for the offset on each vertex according to the grid, calculated using bilinear interpolation algorithm described in The offset of each pixel in grid;
    Determining module, for the offset of each pixel in the offset on each vertex according to the grid and the grid, really After fixed U.S.'s face in picture each pixel pixel value.
  8. 8. device according to claim 7, it is characterised in that division module, including:
    First determination sub-module, for determining to surround a little in the picture;Wherein, by the encirclement line for surrounding point and forming, use The human face characteristic point to be surrounded;
    Divide submodule, for by the picture by the region division that crosses of encirclement line into equal-sized grid.
  9. 9. device according to claim 8, it is characterised in that the first computing module, including:
    Subdivision submodule, for according to the human face characteristic point and encirclement point, carrying out triangular mesh to the picture, obtaining To subdivision triangle;
    Submodule is deviated, for the offset according to the human face characteristic point, to the subdivision triangle into line displacement;
    Second determination sub-module, for determining the subdivision triangle after the offset belonging to each vertex of the grid;
    3rd determination sub-module, for the offset according to the corresponding human face characteristic point of subdivision vertex of a triangle after the offset Amount, the offset on each vertex of the grid is determined using affine transform algorithm respectively.
  10. 10. device according to claim 7, it is characterised in that described device further includes:
    Memory module, for the data of each pixel of the picture to be stored successively according to grid for unit.
  11. 11. device according to claim 7, it is characterised in that the second computing module, in the inclined of each vertex of the grid It is when shifting amount is respectively less than predetermined threshold value, the offset of each pixel in the offset on each vertex of the grid and the grid is equal It is determined as zero;When offset at least one vertex in each vertex of the grid is greater than or equal to the predetermined threshold value, use Bilinear interpolation algorithm calculates the offset of each pixel in the grid.
  12. A kind of 12. image processing apparatus, it is characterised in that including:
    Processor;
    For storing the memory of processor-executable instruction;
    Wherein, the processor is configured as:
    Picture human face region is divided into equal-sized grid;Wherein, each grid includes four vertex;
    According to the offset of human face characteristic point in the picture, calculated using affine transform algorithm the grid each vertex it is inclined Shifting amount;
    According to the offset on each vertex of the grid, the inclined of each pixel in the grid is calculated using bilinear interpolation algorithm Shifting amount;
    According to the offset of each pixel in the offset on each vertex of the grid and the grid, after definite U.S.'s face in picture The pixel value of each pixel.
  13. 13. a kind of computer-readable recording medium, is stored thereon with computer instruction, it is characterised in that the instruction is by processor The step of method any one of claim 1-6 is realized during execution.
CN201711107082.XA 2017-11-10 2017-11-10 Image processing method and device Active CN107977934B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711107082.XA CN107977934B (en) 2017-11-10 2017-11-10 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711107082.XA CN107977934B (en) 2017-11-10 2017-11-10 Image processing method and device

Publications (2)

Publication Number Publication Date
CN107977934A true CN107977934A (en) 2018-05-01
CN107977934B CN107977934B (en) 2022-04-01

Family

ID=62013285

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711107082.XA Active CN107977934B (en) 2017-11-10 2017-11-10 Image processing method and device

Country Status (1)

Country Link
CN (1) CN107977934B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108921798A (en) * 2018-06-14 2018-11-30 北京微播视界科技有限公司 The method, apparatus and electronic equipment of image procossing
CN109063560A (en) * 2018-06-28 2018-12-21 北京微播视界科技有限公司 Image processing method, device, computer readable storage medium and terminal
CN109741277A (en) * 2018-12-29 2019-05-10 广州华多网络科技有限公司 Image processing method, device, storage medium and server
CN110009559A (en) * 2019-03-19 2019-07-12 北京迈格威科技有限公司 Image processing method and device
CN113222844A (en) * 2021-05-14 2021-08-06 上海绚显科技有限公司 Image beautifying method and device, electronic equipment and medium
CN114095646A (en) * 2020-08-24 2022-02-25 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
WO2022062570A1 (en) * 2020-09-23 2022-03-31 北京达佳互联信息技术有限公司 Image processing method and device
CN114862663A (en) * 2022-05-17 2022-08-05 浙江省测绘科学技术研究院 Dynamic adjustment method for grid tile data precision

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110115786A1 (en) * 2009-11-16 2011-05-19 Sony Corporation Image processing apparatus, image processing method, and program
JP2011210054A (en) * 2010-03-30 2011-10-20 Secom Co Ltd Object detection device and learning device for the same
CN103824253A (en) * 2014-02-19 2014-05-28 中山大学 Figure five sense organ deformation method based on image local precise deformation
CN106648344A (en) * 2015-11-02 2017-05-10 重庆邮电大学 Screen content adjustment method and equipment
CN107330868A (en) * 2017-06-26 2017-11-07 北京小米移动软件有限公司 image processing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110115786A1 (en) * 2009-11-16 2011-05-19 Sony Corporation Image processing apparatus, image processing method, and program
JP2011210054A (en) * 2010-03-30 2011-10-20 Secom Co Ltd Object detection device and learning device for the same
CN103824253A (en) * 2014-02-19 2014-05-28 中山大学 Figure five sense organ deformation method based on image local precise deformation
CN106648344A (en) * 2015-11-02 2017-05-10 重庆邮电大学 Screen content adjustment method and equipment
CN107330868A (en) * 2017-06-26 2017-11-07 北京小米移动软件有限公司 image processing method and device

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108921798A (en) * 2018-06-14 2018-11-30 北京微播视界科技有限公司 The method, apparatus and electronic equipment of image procossing
CN109063560B (en) * 2018-06-28 2022-04-05 北京微播视界科技有限公司 Image processing method, image processing device, computer-readable storage medium and terminal
CN109063560A (en) * 2018-06-28 2018-12-21 北京微播视界科技有限公司 Image processing method, device, computer readable storage medium and terminal
WO2020001013A1 (en) * 2018-06-28 2020-01-02 北京微播视界科技有限公司 Image processing method and device, computer readable storage medium, and terminal
US11017580B2 (en) 2018-06-28 2021-05-25 Beijing Microlive Vision Technology Co., Ltd Face image processing based on key point detection
CN109741277A (en) * 2018-12-29 2019-05-10 广州华多网络科技有限公司 Image processing method, device, storage medium and server
CN110009559A (en) * 2019-03-19 2019-07-12 北京迈格威科技有限公司 Image processing method and device
CN110009559B (en) * 2019-03-19 2023-07-07 北京迈格威科技有限公司 Image processing method and device
CN114095646A (en) * 2020-08-24 2022-02-25 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN114095646B (en) * 2020-08-24 2022-08-26 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
WO2022062570A1 (en) * 2020-09-23 2022-03-31 北京达佳互联信息技术有限公司 Image processing method and device
CN113222844A (en) * 2021-05-14 2021-08-06 上海绚显科技有限公司 Image beautifying method and device, electronic equipment and medium
CN113222844B (en) * 2021-05-14 2023-11-24 上海绚显科技有限公司 Image beautifying method and device, electronic equipment and medium
CN114862663A (en) * 2022-05-17 2022-08-05 浙江省测绘科学技术研究院 Dynamic adjustment method for grid tile data precision
CN114862663B (en) * 2022-05-17 2023-01-20 浙江省测绘科学技术研究院 Dynamic adjustment method for grid tile data precision

Also Published As

Publication number Publication date
CN107977934B (en) 2022-04-01

Similar Documents

Publication Publication Date Title
CN107977934A (en) Image processing method and device
CN107680033A (en) Image processing method and device
CN105100609B (en) The adjusting method of mobile terminal and acquisition parameters
CN107492115B (en) Target object detection method and device
CN105550637B (en) Profile independent positioning method and device
CN107330868A (en) image processing method and device
CN107958439A (en) Image processing method and device
CN107818543A (en) Image processing method and device
WO2019174628A1 (en) Photographing method and mobile terminal
CN108712603B (en) Image processing method and mobile terminal
CN109726659A (en) Detection method, device, electronic equipment and the readable medium of skeleton key point
CN108388849B (en) Method and device for adjusting display image of terminal, electronic equipment and storage medium
CN110544272B (en) Face tracking method, device, computer equipment and storage medium
CN107657590B (en) Picture processing method and device and storage medium
CN107341777A (en) image processing method and device
US11488383B2 (en) Video processing method, video processing device, and storage medium
CN107464253A (en) eyebrow location method and device
KR20180043147A (en) Method and device for generating instruction
WO2020048392A1 (en) Application virus detection method, apparatus, computer device, and storage medium
US11216075B2 (en) Method, apparatus and device for triggering shooting mode, and storage medium
CN104036240A (en) Face feature point positioning method and device
CN107944367A (en) Face critical point detection method and device
CN108776957A (en) Face image processing process and device
CN112364799A (en) Gesture recognition method and device
CN106612396A (en) Photographing device, photographing terminal and photographing method

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