A kind of image processing method and system for realizing eyes amplificationTechnical field
The present invention relates to image procossing and mode identification technology, in particular at a kind of image for realizing eyes amplificationManage method and system.
Background technique
In recent years, with the rapid development of smart phone, demand of the people to cell-phone function is more and more diversified.Wherein,One important function of smart phone is self-timer.It can be applied to production head portrait, social networks using the photo that mobile phone is filmedThe numerous areas such as sharing.The U.S. face processing that self-timer image is realized on smart phone, is more emphasis concerned by people, wherein weighingThe U.S. face processing wanted just includes the processing of eyes, amplifies human eye by image procossing, so that everyone can possess a pair of fanThe oxeye of people.
Eyes enhanced processing belongs to a kind of bird caging of image, and existing processing technique is all by carrying out eye manuallyThe amplification of eyeball, generally require three parameters of manual setting: central point, paintbrush size and dynamics, this Series Manual are operated to useIt makes troubles at family.
Summary of the invention
The purpose of the present invention is to provide a kind of image processing methods and system for realizing eyes amplification, to solve existing skillArt needs that the problem of making troubles to user is manually operated.
In order to solve the above technical problems, the present invention provides a kind of image processing method for realizing eyes amplification, feature existsIn, comprising:
It is described according to the Gabor wavelet that the facial image of an input and Gabor wavelet establish face;
Floor projection carried out to the top half of the facial image and upright projection generates floor projection curve and verticalDrop shadow curve;
The floor projection curve and upright projection curve are normalized, floor projection curve and vertical is establishedDrop shadow curve's expression formula;
The peak value of floor projection and upright projection is obtained according to the floor projection curve and upright projection curve representation formula,Determine the coordinate of pupil in face;
It is handled according to the coordinate pair eye areas every bit pixel of a pre-set radius and pupil, realizes eyes amplification.
Further, in the image processing method for realizing eyes amplification, the face figure according to an inputThe step of describing as the Gabor wavelet of establishing face with Gabor wavelet include:
Facial image and Gabor wavelet to input carry out convolution algorithm, and improve convolution speed using Fourier transformation;
Image Gabor wavelet transformation in different center frequency and different directions is normalized.
Further, in the described image processing method for realizing eyes amplification, the facial image of described pair of input withGabor wavelet carries out convolution algorithm and is completed by following formula:Wherein, G(x, y) is the facial image of input, and Θ indicates convolution algorithm,Corresponding to radial center frequency be X0, direction isThe wavelet convolution result of H.
Further, in the described image processing method for realizing eyes amplification, it is described by different center frequency and notImage Gabor wavelet transformation on equidirectional is normalized to be completed by following formula:Wherein, n is the centre frequency number selected, and m is the side selectedTo number, C becomes the Gabor characteristic vector of image.
Further, in the described image processing method for realizing eyes amplification, the floor projection curve and verticalDrop shadow curve's expression formula are as follows:
Wherein, H (x) is floor projection curve, and V (y) is upright projection curve, and G (x, y) is the facial image of input.
Further, described according to a pre-set radius and pupil in the image processing method for realizing eyes amplificationThe step of coordinate pair eye areas every bit pixel in hole is handled include:
By pupil coordinate C1 (X1, Y1), C2 (X2, Y2) and pre-set radius R, every bit pixel A 1 in pair radius (x1,Y1 it) is handled with A2 (x2, y2);
The ratio of the distance between A1 and C1 and R are calculated, reduced value size carries out judging laggard row pixel value replacement;
The ratio of the distance between A2 and C2 and R are calculated, reduced value size carries out judging laggard row pixel value replacement.
Further, in the described image processing method for realizing eyes amplification, it is described calculate between A1 and C1 away fromFrom the ratio with R, reduced value size carries out judging that the step of laggard row pixel value is replaced includes:
If ratio is greater than 1, its pixel value is changed to the pixel value of point A ' (x1 ', y1 ') into, the position of A ' passes through following public affairsFormula obtains:
If its pixel value less than 1, is changed into the pixel value of point A ' (x1 ', y1 '), the position of A ' passes through following public affairs by ratioFormula obtains:
If ratio is equal to 1, its pixel value is constant.
Further, in the described image processing method for realizing eyes amplification, it is described calculate between A2 and C2 away fromFrom the ratio with R, reduced value size carries out judging that the step of laggard row pixel value is replaced includes:
If ratio is greater than 1 into, its pixel value is changed to the pixel value of point A2 ' (x2 ', y2 '), the position of A2 ' passes through followingFormula obtains:
If its pixel value less than 1, is changed into the pixel value of point A2 ' (x1 ', y1 ') by ratio, the position of A2 ' passes through followingFormula obtains:
If ratio is equal to 1, its pixel value is constant.
Correspondingly, the present invention also provides a kind of image processing systems for realizing eyes amplification, comprising:
Gabor wavelet describing module establishes the Gabor of face for the facial image and Gabor wavelet according to an inputSmall echo description;
Projection module carries out floor projection for the top half to the facial image and upright projection generates horizontal throwShadow curve and upright projection curve;
Curve representation formula generation module, for place to be normalized to the floor projection curve and upright projection curveReason, establishes floor projection curve and upright projection curve representation formula;
Pupil coordinate generation module, for obtaining level according to the floor projection curve and upright projection curve representation formulaThe peak value of projection and upright projection, determines the coordinate of pupil in face;
Processes pixel module, at the coordinate pair eye areas every bit pixel according to a pre-set radius and pupilReason realizes eyes amplification.
Further, in the image processing system for realizing eyes amplification, the Gabor wavelet describing module packetIt includes:
Convolution algorithm module for the facial image and Gabor wavelet progress convolution algorithm to input, and uses FourierTransformation improves convolution speed;
Normalized module is carried out for converting the image Gabor wavelet in different center frequency and different directionsNormalized.
Further, right in the convolution algorithm module in the image processing system for realizing eyes amplificationThe facial image and Gabor wavelet of input carry out convolution algorithm and are completed by following formula:Wherein, G (x, y) is the facial image of input, and Θ indicates convolution algorithm,Corresponding to the wavelet convolution result that radial center frequency is X0, direction is H.
Further, in the image processing system for realizing eyes amplification, in the normalized module,Image Gabor wavelet transformation in different center frequency and different directions is normalized and is completed by following formula:Wherein, n is the centre frequency number selected, and m is the side selectedTo number, C becomes the Gabor characteristic vector of image.
Further, in the image processing system for realizing eyes amplification, mould is generated in the curve representation formulaIn block, floor projection curve and upright projection curve representation formula are as follows:
Wherein, H (x) is floor projection curve, and V (y) is upright projection curve, and G (x, y) is the facial image of input.
Further, in the image processing system for realizing eyes amplification, the processes pixel module includes:
Processing module, it is every in pair radius for passing through pupil coordinate C1 (X1, Y1), C2 (X2, Y2) and pre-set radius RSome pixel As 1 (x1, y1) and A2 (x2, y2) are handled;
First computing module, for calculating the ratio of the distance between A1 and C1 with R, reduced value size judge laggardRow pixel value replacement;
Second computing module, for calculating the ratio of the distance between A2 and C2 with R, reduced value size judge laggardRow pixel value replacement.
Further, in the image processing system for realizing eyes amplification, in first computing module:
If ratio is greater than 1, its pixel value is changed to the pixel value of point A ' (x1 ', y1 ') into, the position of A ' passes through following public affairsFormula obtains:
If its pixel value less than 1, is changed into the pixel value of point A ' (x1 ', y1 '), the position of A ' passes through following public affairs by ratioFormula obtains:
If ratio is equal to 1, its pixel value is constant.
Further, in the image processing system for realizing eyes amplification, in second computing module:
If ratio is greater than 1 into, its pixel value is changed to the pixel value of point A2 ' (x2 ', y2 '), the position of A2 ' passes through followingFormula obtains:
If its pixel value less than 1, is changed into the pixel value of point A2 ' (x1 ', y1 ') by ratio, the position of A2 ' passes through followingFormula obtains:
If ratio is equal to 1, its pixel value is constant.
The image processing method and system provided by the invention for realizing eyes amplification, has the advantages that and passes throughGabor wavelet models face characteristic, calculates the floor projection and upright projection of facial image top half, thusTo the accurate coordinates of human eye, human eye area every bit pixel is handled, from eyeball get over into those of pixel variation it is smaller,And remoter transformation is bigger, to realize that human eye equal proportion is amplified, and guarantees that amplification effect is natural, true.
Detailed description of the invention
Fig. 1 is the flow chart of the image processing method for realizing eyes amplification of the embodiment of the present invention;
Fig. 2 is that the distance between pixel A 1 and pupil coordinate C1 of the embodiment of the present invention and the ratio of pre-set radius R are greater than 1When schematic diagram;
Fig. 3 is the distance between pixel A 1 and pupil coordinate C1 of the embodiment of the present invention with the ratio of pre-set radius R less than 1When schematic diagram;
Fig. 4 is that the distance between pixel A 1 and pupil coordinate C1 of the embodiment of the present invention and the ratio of pre-set radius R are equal to 1When schematic diagram;
Fig. 5 is that the distance between pixel A 2 and pupil coordinate C2 of the embodiment of the present invention and the ratio of pre-set radius R are greater than 1When schematic diagram;
Fig. 6 is the distance between pixel A 2 and pupil coordinate C2 of the embodiment of the present invention with the ratio of pre-set radius R less than 1When schematic diagram;
Fig. 7 is that the distance between pixel A 2 and pupil coordinate C2 of the embodiment of the present invention and the ratio of pre-set radius R are equal to 1When schematic diagram.
Specific embodiment
To the image processing method of realization eyes amplification proposed by the present invention and it is below in conjunction with the drawings and specific embodimentsSystem is described in further detail.According to following explanation and claims, advantages and features of the invention will be become apparent from.It needs to illustrate, attached drawing is all made of very simplified form and using non-accurate ratio, only conveniently, lucidly to aid in illustrating originallyThe purpose of inventive embodiments.
Referring to FIG. 1, it is the flow chart of the image processing method for realizing eyes amplification of the embodiment of the present invention.Such as Fig. 1It is shown, the present invention provide it is a kind of realize eyes amplification image processing method include:
Step 1: it is described according to the Gabor wavelet that the facial image of an input and Gabor wavelet establish face;
Specifically, convolution algorithm first is carried out to the facial image of input and Gabor wavelet, it may be assumed thatWherein, G (x, y) is the facial image of input, and Θ indicates convolution algorithm,Corresponding to the wavelet convolution result that radial center frequency is X0, direction is H.Then it is mentioned using Fourier transformationFinally the image Gabor wavelet transformation in different center frequency and different directions is normalized for high convolution speed,That is:Wherein, n is the centre frequency number selected, and m is to selectDirection number, C become the Gabor characteristic vector of image.It, can since Gabor wavelet has stronger response in image edgeTo utilize the characteristic, the Gabor wavelet description of face is established.
Step 2: floor projection is carried out to the top half of the facial image and upright projection generates floor projection curveWith upright projection curve;
Step 3: being normalized the floor projection curve and upright projection curve, establishes floor projection songLine and upright projection curve representation formula, in the floor projection H (x) in the region image [y1, y2] and the upright projection in the region [x1, x2]V (y) is indicated are as follows:
Wherein, H (x) is floor projection curve, and V (y) is upright projection curve, and G (x, y) is the facial image of input.
Step 4: floor projection and upright projection are obtained according to the floor projection curve and upright projection curve representation formulaPeak value, determine the X of pupil in face, Y-coordinate;
Step 5: being handled according to the coordinate pair eye areas every bit pixel of a pre-set radius R and pupil, realizes eyeEyeball amplification.
Pass through pupil coordinate C1 (X1, Y1), C2 (X2, Y2) and pre-set radius R, the every bit pixel A 1 in pair radius first(x1, y1) and A2 (x2, y2) are handled;
Then, the ratio of the distance between A1 and C1 and R are calculated, reduced value size carries out judging that laggard row pixel value is replacedIt changes;
Specifically, as shown in Fig. 2,
If ratio is greater than 1 into, its pixel value is changed to the pixel value of point A1 ' (x1 ', y1 '), the position of A1 ' passes through followingFormula obtains:
As shown in figure 3, if its pixel value less than 1, is changed into the pixel value of point A1 ' (x1 ', y1 '), the position of A1 ' by ratioIt sets and is obtained by following formula:
As shown in figure 4, if ratio be equal to 1, its pixel value is constant.
Finally, calculating the ratio of the distance between A2 and C2 and R, reduced value size carries out judging that laggard row pixel value is replacedIt changes.
Specifically, as shown in figure 5,
If ratio is greater than 1 into, its pixel value is changed to the pixel value of point A2 ' (x2 ', y2 '), the position of A2 ' passes through followingFormula obtains:
As shown in fig. 6, if its pixel value less than 1, is changed into the pixel value of point A2 ' (x1 ', y1 '), the position of A2 ' by ratioIt sets and is obtained by following formula:
As shown in fig. 7, if ratio be equal to 1, its pixel value is constant.
Correspondingly, the present invention also provides a kind of image processing systems for realizing eyes amplification, comprising: Gabor wavelet descriptionModule, projection module, curve representation formula generation module, pupil coordinate generation module and processes pixel module;
The Gabor wavelet describing module, for establishing face according to the facial image and Gabor wavelet of an inputGabor wavelet description;
Further, the Gabor wavelet describing module further include:
Convolution algorithm module, for the facial image and Gabor wavelet progress convolution algorithm to input, it may be assumed thatWherein, G (x, y) is the facial image of input, and Θ indicates convolution algorithm,Corresponding to the wavelet convolution that radial center frequency is X0, direction is H as a result, and being improved using Fourier transformationConvolution speed;
Normalized module is carried out for converting the image Gabor wavelet in different center frequency and different directionsNormalized, it may be assumed thatWherein, n is the centre frequency selectedNumber, m are the direction number selected, and C becomes the Gabor characteristic vector of image.
The projection module carries out floor projection for the top half to the facial image and upright projection generates waterFlat drop shadow curve and upright projection curve;
The curve representation formula generation module, for the floor projection curve and upright projection curve to be normalizedProcessing, establishes floor projection curve and upright projection curve representation formula;The region image [y1, y2] floor projection H (x) andThe upright projection V (y) in the region [x1, x2] is indicated are as follows:
Wherein, H (x) is floor projection curve, and V (y) is upright projection curve, and G (x, y) is the facial image of input.
The pupil coordinate generation module, for being obtained according to the floor projection curve and upright projection curve representation formulaThe peak value of floor projection and upright projection determines the coordinate of pupil in face;
The processes pixel module, for according to the coordinate pair eye areas every bit pixel of a pre-set radius and pupil intoEyes amplification is realized in row processing.
Further, the processes pixel module includes:
Processing module, it is every in pair radius for passing through pupil coordinate C1 (X1, Y1), C2 (X2, Y2) and pre-set radius RSome pixel As 1 (x1, y1) and A2 (x2, y2) are handled;
First computing module, for calculating the ratio of the distance between A1 and C1 with R, reduced value size judge laggardRow pixel value replacement;
Specifically, if ratio is greater than 1 into its pixel value to be changed to the pixel value of point A1 ' (x1 ', y1 '), the position of A1 ' is logicalCross following formula acquisition:
If its pixel value less than 1, is changed into the pixel value of point A1 ' (x1 ', y1 ') by ratio, the position of A1 ' passes through followingFormula obtains:
If ratio is equal to 1, its pixel value is constant.
Second computing module, for calculating the ratio of the distance between A2 and C2 with R, reduced value size judge laggardRow pixel value replacement.
Specifically, if ratio is greater than 1 into its pixel value to be changed to the pixel value of point A2 ' (x2 ', y2 '), the position of A2 ' is logicalCross following formula acquisition:
If its pixel value less than 1, is changed into the pixel value of point A2 ' (x1 ', y1 ') by ratio, the position of A2 ' passes through followingFormula obtains:
If ratio is equal to 1, its pixel value is constant.
In conclusion the present invention models face characteristic by Gabor wavelet, facial image top half is calculatedFloor projection and upright projection human eye area every bit pixel is handled, to obtain the accurate coordinates of human eye from eyePearl get over into those of pixel variation it is smaller, and remoter transformation is bigger, to realize that human eye equal proportion is amplified, and guarantees amplificationEffect is natural, true.
Foregoing description is only the description to present pre-ferred embodiments, not to any restriction of the scope of the invention, this hairAny change, the modification that the those of ordinary skill in bright field does according to the disclosure above content, belong to the protection of claimsRange.