CN102592260B - Certificate image cutting method and system - Google Patents

Certificate image cutting method and system Download PDF

Info

Publication number
CN102592260B
CN102592260B CN201110442745XA CN201110442745A CN102592260B CN 102592260 B CN102592260 B CN 102592260B CN 201110442745X A CN201110442745X A CN 201110442745XA CN 201110442745 A CN201110442745 A CN 201110442745A CN 102592260 B CN102592260 B CN 102592260B
Authority
CN
China
Prior art keywords
ears
chin
curve
license image
portrait
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.)
Active
Application number
CN201110442745XA
Other languages
Chinese (zh)
Other versions
CN102592260A (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.)
GUANGZHOU SHANGJING NETWORK TECHNOLOGY Co Ltd
Original Assignee
GUANGZHOU SHANGJING NETWORK TECHNOLOGY 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 GUANGZHOU SHANGJING NETWORK TECHNOLOGY Co Ltd filed Critical GUANGZHOU SHANGJING NETWORK TECHNOLOGY Co Ltd
Priority to CN201110442745XA priority Critical patent/CN102592260B/en
Publication of CN102592260A publication Critical patent/CN102592260A/en
Application granted granted Critical
Publication of CN102592260B publication Critical patent/CN102592260B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention provides a certificate image cutting method and a system. The method comprises the following steps of: reading a certificate image and finding pupil positions of a portrait in the certificate image; determining a head position of the portrait in the certificate image according to the pupil positions; determining a lower jaw position and two ear positions of the portrait in the certificate image according to the pupil positions; determining a cutting region according to the determined head position, lower jaw position and two ear positions; and cutting the certificate image according to the determined cutting region. According to the certificate image cutting method and the system, disclosed by the invention, the disadvantage of manually selecting the cutting region to cause low efficiency in a traditional certificate manufacturing process is overcome; the automatic cutting of the certificate image based on multi-point checking and positioning is realized; the certificateimage cutting region can be rapidly, efficiently and accurately positioned so as to automatically cut out a photo meeting the requirements; and therefore, the certificate image cutting method and thesystem can be widely applied to automatically cutting out the certificate image meeting the requirements by self-help photographing equipment, and can also help non-professional ordinary people to have the convenience effect of photographing a certificate photo by oneself.

Description

License image method of cutting out and system
Technical field
The present invention relates to the computer software image processing field, particularly a kind of license image method of cutting out, a kind of license image cutting system.
Background technology
When bidding to host legal certificate, for example during certificate such as passport, visa, the pass, driving license, I.D., certificates handling office all can require the applicant when sending in one's application material, send in one's application simultaneously people, recent electronics photograph without a hat on, and strict technical requirement is arranged at aspects such as background, pixel, specification, color, expression, attitude, clothing.And, because area, the difference of certificate kind, specification requirement to photograph also has different, for example: the Guangdong exit and entry certificates requires portrait horizontal center in the photograph rectangle frame, general image length and width specification is: 567 pixels (height) * 390 pixels (wide), wide 248~283 pixels of portrait head wherein, head length is 354~402 pixels, interpupillary distance is 82~118 pixels, in (children's eyes position far from the distance of upper edge between 152~293 pixels) between 152~246 pixels, gain fame and fortune apart from photograph upper edge 25~35 pixels in the crown far from the distance of upper edge in the eyes position; The Certification of Second Generation identity photographs requires portrait horizontal center in the photograph rectangle frame, and the general image size is 441 pixels (height) * 358 pixels (wide), wide 207 ± 14 pixels of portrait face wherein, and gain fame and fortune apart from photograph upper edge 7 pixels~21 pixels in the crown; Driver's license requires portrait horizontal center in the photograph rectangle frame, general image size length and width specification is: 378 pixels (height) * 260 pixels (wide), wide 165 to 189 pixels of portrait head wherein, head length is 224 to 260 pixels, gain fame and fortune apart from photograph upper edge 10 pixels~20 pixels in the crown.
In the actual photographed manufacturing process of certificate photo, be not directly to take the certificate photo that becomes standard, but take pictures by basic demand earlier, with image processing software the photo of taking is handled again, thereby be made into satisfactory certificate photo.Therefore, in the shooting and producing process of certificate photo, often need by software program the license image to be carried out processing such as cutting, make it to satisfy the accreditation technical requirement, obviously, in license cutting process, locate how fast, efficiently, accurately and find the clipping region, be the very critical step that realizes the automatic cutting of license.
Traditional license disposal route mainly is to be handled by the image processor software of specialty by professional operator, selects the clipping region according to the license specification requirement at the image center, perhaps positions cutting by the particular point of manually choosing in the image.According to this processing mode, must possess certain image and handle the professional operating personnel on basis and hand-make with professional software, efficient is low, and to be not easy to be that ruck is grasped; Same, because existing method is too big to artificial dependence, efficient is not high, can't be applicable to the needs of the automatic cutting of self-service photographing device, do not satisfy Possum and cut out satisfactory license image demand for development automatically, can't be generalized to the application demand of the self-service shooting certificate photo of general population yet.Thereby cause can not navigating to the clipping region of license image fast, accurately when making certificate photo, the make efficiency of certificate photo is low, badly influences the collection service of certificate photo.
Summary of the invention
At above-mentioned problems of the prior art, the object of the present invention is to provide a kind of license image method of cutting out, a kind of license image cutting system, it can automatical and efficient, accurately navigate to the clipping region of license image, realization is cut out automatically to the license image, improves the make efficiency of license.
For achieving the above object, the present invention by the following technical solutions:
A kind of license image method of cutting out comprises step:
Read the license image, search the pupil position of portrait in the license image;
Determine the position, the crown of portrait in the license image according to described pupil position;
Determine chin position, the ears position of portrait in the license image according to described pupil position;
Determine the clipping region according to above-mentioned definite position, the crown, chin position, ears position, and according to the clipping region of determining the license image is carried out cutting.
A kind of license image cutting system comprises:
Pupil position is searched the unit, is used for reading the license image, searches the pupil position of portrait in the license image;
Crown position determination unit is for the position, the crown of determining license image portrait according to described pupil position;
The chin position determination unit is for the chin position of determining license image portrait according to described pupil position;
The ears position determination unit is for the ears position of determining license image portrait according to described pupil position;
The cutting unit is used for determining the clipping region according to position, the described crown, described chin position, described ears position, and according to the clipping region of determining the license image is carried out cutting.
According to the invention described above scheme, it is after reading the license image, at first find out the pupil position of portrait in the license image, then based on the pupil position of the portrait that finds out, determine the position, the crown of portrait in the license image, the ears position, the chin position, then according to the position, the crown of the portrait determined, the ears position, the clipping region is determined in the chin position, and according to the clipping region of determining the license image is carried out cutting, thereby realize the clipping region of license image automatical and efficient accordingly, accurate localization, realized the cutting out automatically of license image improved the make efficiency of license.
Description of drawings
Fig. 1 is the schematic flow sheet of license image method of cutting out embodiment of the present invention;
Fig. 2 is the schematic flow sheet of determining clipping region embodiment;
Fig. 3 is the structural representation of license image cutting system embodiment of the present invention.
Embodiment
Below in conjunction with wherein preferred embodiment the present invention program is described in detail.
Referring to shown in Figure 1, the schematic flow sheet of license image method of cutting out embodiment of the present invention has been shown among Fig. 1, as shown in Figure 1, the method in the present embodiment comprises step:
Step S101: read the license image, enter step S102;
Step S102: search the pupil position of portrait in the license image, enter step S103;
Step S103: determine the position, the crown of portrait in the license image to enter step S104 according to described pupil position;
Step S104: determine chin position, the ears position of portrait in the license image to enter step S105 according to described pupil position;
Step S105: determine the clipping region according to above-mentioned definite position, the crown, chin position, ears position, and according to the clipping region of determining the license image is carried out cutting.
According to the scheme in the above-mentioned present embodiment, it is after reading the license image, at first find out the pupil position of portrait in the license image, then based on the pupil position of the portrait that finds out, determine the position, the crown of portrait in the license image, the ears position, the chin position, then according to the position, the crown of the portrait determined, the ears position, the clipping region is determined in the chin position, and according to the clipping region of determining the license image is carried out cutting, thereby realize the clipping region of license image automatical and efficient accordingly, accurate localization, realized the cutting out automatically of license image improved the make efficiency of license.
Scheme among the invention described above embodiment determines that the process of the process of position, the crown and definite chin position, ears position can be to carry out synchronously, also can be that branch successively carries out.
When in above-mentioned steps S102, searching the pupil position of portrait in the license image, can in the license image, find pupil position fast by OpenCV.
OpenCV is the Intel computer vision storehouse (Computer Version) of increasing income, it is made of a series of C functions and a small amount of C++ class, have the cross-platform middle and high layer API that comprises more than 300 C function, the interface of language such as Python, Ruby, MATLAB is provided, has realized that image is handled and a lot of general-purpose algorithms of computer vision aspect.
In the present invention program's a embodiment, can realize accurately searching pupil position by the function that OpenCV provides.OpenCV has provided algorithm and the learning database that pupil is searched, but the learning database that OpenCV provides is at all portraits, there is not certain specific aim, therefore, in preferred embodiments of the present invention, the pupil image of standard certificate photo that can be by some is provided, for example 1000, carry out special study with these pictures, obtain the learning database at certificate photo, thereby when adopting OpenCV to search pupil position based on this learning database, can have more specific aim, can find more accurate pupil position.The mode that concrete employing OpenCV searches pupil position can be to adopt existing mode in the prior art, does not repeat them here.
By searching of OpenCV, the eyes coordinate that note finds out is: (x 1, y 1), (x 2, y 2), according to these 2 the coordinate P that can obtain the middle bridge of the nose of eyes Mid(x Mid, y Mid):
x mid = x 1 + x 2 2 y mid = y 1 + y 2 2
After the foundation aforesaid way obtains pupil position, when determining the position, the crown of portrait in the license image according to pupil position, in order to find position, the crown on the basis of the pupil position of determining fast and accurately, mainly can adopt following manner to carry out.
At first, determine the highest possible position in the crown, the minimum possible position in the crown according to pupil position, when the highest possible position in definite crown, the minimum possible position in the crown, can necessarily determine greater than the distance between eyes and less than the principle of 3 times eyes distance to the distance of pupil based on the crown, thereby have:
y h=max[0,y mid-3*(x 2-x 1)]
y l=[y mid-(x 2-x 1)]
Wherein, y hThe expression crown the highest possible position, i.e. the ordinate at the highest possible position in crown place, y lThe minimum possible position in the expression crown, the i.e. ordinate of the minimum possible position in the crown.
At [y h, y l] search for dichotomy in the interval, determine position, the crown.Concrete mode can be:
At first, choose the centre position
Figure BDA0000124628430000052
And with (x Mid, y p) centered by point choose the rectangle that length and width are respectively a, b, and the ratio of the shared number of background colour in the rectangle relatively:
If the ratio of the shared number of background colour is less than 1/2 in the rectangle, then adopt
Figure BDA0000124628430000053
Upgrade y p
If the ratio of the shared number of background colour is greater than 1/2 in the rectangle, then adopt Upgrade y p
Upgrade y pAfter, repeat said process, namely return again with the (x after upgrading Mid, y p) centered by point choose the process that length and width are respectively the rectangle of a, b, so circulation repeats, the ratio of the shared number of background colour in the gained rectangle equals 1/2, the last resulting y of iteration pBe the ordinate of position, the determined crown.
Wherein, during above-mentioned definite rectangle, the length and width a of rectangle, the value of b can rule of thumb be set.And in the actual computation process, as if a, the too little out of true that may cause of b value, then may cause the increase of operand too greatly as if a, b value.Therefore, generally, the value of a, b can be: a=x 2-x 1,
Figure BDA0000124628430000061
The length that is rectangle is the eyes distance, and rectangle wide is half of eyes distance.
Similarly, after obtaining pupil position, can also find other unique points of people's face by pupil position, for example the chin position of people face position and ears position.Because the feature of chin and ears can vary with each individual, therefore determining to have certain degree of difficulty.In the present invention program, be based on the feature learning storehouse and realize the chin position of people face position and the accurate location of ears position.
When the accurate location of realizing the ears position, consider that for the former figure photograph of the license image under the normal condition all there is considerable influence in the outside of ears to the cutting of certificate photo with the position of inboard.Therefore, in the present invention program, for ear's clear photograph, two edges of ears all can be found out, specifically can be the position of judging ears by CF.Below describe respectively from two angles of CF.
When coming based on the angle of color the position of ears judged, need to consider the incidence relation of ears and color in the license image.
In the license image, the inboard of ears is human face regions, is exactly the background area and the outside of ears is not hair.In photograph, the color of ears roughly is similar to the color of people face position, but owing to the light reason, the color of ears can be darker than the color of people face.Accordingly, can obtain the Position Approximate of ear by colouring information.The concrete mode of using can be to find out all than the darker location of pixels of people's face color at people's face bilateral.Concrete mode can be:
At the above-mentioned pupil position (x that obtains 1, y 1), (x 2, y 2) after, can be by the learn approximate region of people's face of organization of human body, according to pupil position, learn the process of determining the ears zone according to organization of human body and specifically can be:
The outside horizontal ordinate of left and right ear is respectively:
l 1 = x 1 + x 2 2 - x 2 - x 1 k 1 , l 3 = x 1 + x 2 2 + x 2 - x 1 k 1
The inboard horizontal ordinate of left and right ear is respectively:
l 2 = x 1 + x 2 2 - x 2 - x 1 k 2 , l 4 = x 1 + x 2 2 + x 2 - x 1 k 2
Wherein, the span of above-mentioned k1, k2 can be: k1 ∈ (0.63,0.9), k2 ∈ (0.8,1.22).
And then add up all kinds of colour of skin proportions in this zone, namely the sum of the pixel of all kinds of colours of skin when adding up, is a class with similar color statistics.
Judge two color C1 (r1, g1, b1), C2 (r2, g2 when b2) similar, can judge by following formula:
(r1-r2) 2+(g1-g2) 2+(b1-b2) 2≤a0
If two colors satisfy the condition in the following formula, namely the quadratic sum of the respective pixel values difference of C1 and C2 is less than or equal to preset threshold a0, then judges these two color similarities of C1, C2, otherwise is dissimilar.According to actual needs, above-mentioned a0 can be set at different values, and generally value is 100.
According to above-mentioned statistical conditions, can obtain the statistical conditions of all kinds of colours of skin in the human face region: note c iBe the average color of the similar color of a class, color constitutes s by R, G, three components of B iNumber for this class color.(1, n), n is the sum of classification to i ∈, thereby the information that can obtain each is c is i, and the variance yields that can calculate all categories number of color accordingly is:
σ 2 = 1 n Σ i = 1 n ( s i - 1 n Σ j = 1 n s i ) 2
Resulting variance yields and pre-determined variance threshold value are judged:
Work as σ 2>σ 0The time, expression people face color is relatively more consistent, thus the color average of that class color that can number is maximum is as face complexion c f
Work as σ 2≤ σ 0The time, illustrating that the color of people's face is more assorted, this situation generally appears at the elderly or face has on the human face region of color spot, in this case, the color average c of the three class colors that the peek order is maximum F1, c F2, c F3
With above-mentioned face complexion c fThe RGB component deduct the colour of skin difference c of setting m, can obtain the color c on people's lug areas e, search people's face both sides and c again eAll similar location of pixels, so just can obtain institute might be ear's color pixel point, these and c eIt possible be ear's color pixel point that similar location of pixels is.
Three kinds of color c that number is maximum have been got above-mentioned F1, c F2, c F3Situation under, respectively with c F1, c F2, c F3The RGB component deduct the colour of skin difference c of setting m, obtain the color c of three-type-person's lug areas E1, c E2, c E3, search people's face both sides and c again E1, c E2, c E3In any one all similar location of pixels, so just can obtain the institute might be ear's color pixel point.
After obtaining all possible ear pixel from the colour of skin, from these possible pixels, find out real ears zone with shape again.When accurately judging in conjunction with shape facility, at first need to draw some possible ears curves, be referred to as candidate's ears curve, candidate's ears curve can draw based on these all possible ear pixels, and concrete mode does not repeat them here.
Therefore the shape of people's ear is similar basically, can come people's ear is carried out roughly judgement by the shape of people's ear.In a concrete example, concrete determination methods can be as described below.
At first can set up a standard feature storehouse, stored the sample of some in the standard feature storehouse, and the sample of storing is a curve corresponding to ear shape, curve has certain width, therefore, an ear will be to there being two abscissa value, it specifically can be the certificate photo that from the certificate photo of standard, extracts earlier some, for example 1000, determine ear curve sample with these certificate photos then, remove the real photograph of match with these ear curve samples then, namely remove candidate's ear curve of match license image to be cut out.
Suppose to have extracted n ear curve sample, namely n opens the basic configuration of ear, and any one the ear curve sample that extracts is designated as (x i, y i), i ∈ (1, n).
This n that will extract from the standard feature storehouse ear curve sample carries out match with the license image for the treatment of cutting respectively then, namely with this n the ear curve sample of opening and the curve (x that treats the license image of cutting j, y j) carry out match, the (x here j, y j) refer to treat the candidate's ear curve in the license image of cutting.Here said match refers to according to the ear curve sample that takes out, and finds out, the curve of coupling the most suitable with these ear curve samples from all candidate's ear curves of the license image for the treatment of cutting.Concrete match, the mode of coupling can adopt existing mode in the prior art, do not repeat them here.
Above-mentioned when carrying out match, from all ear curve sample (x i, y i) in find out candidate's ear curve (x with the license image for the treatment of cutting j, y j) curve (x that is complementary most i, y i), judge that the mode that two curves are complementary can adopt existing mode in the prior art, has determined the curve (x that is complementary most i, y i) after, can and then determine the similarity of these two curves that are complementary, and with the similarity of these two curves that are complementary minor increment l mRepresent, then with this minor increment l mWith setpoint distance threshold value l 0Compare:
If l m>l 0, then think and do not find the curve that mates most, and its minor increment is made as a maximum value l M
If l m≤ l 0, then keep minor increment l mConstant.
Add up in all ear curve samples and the corresponding minor increment of candidate's ear curve for the treatment of the license image of cutting, just can obtain only candidate's ear curve approximate as the license image for the treatment of cutting, being about to this only candidate's ear curve approximation is the ear for the treatment of the license image of cutting.
Because the sample in the feature database is a curve, this curve has certain width, and therefore an ear is two abscissa value of correspondence (two positions of an ear comprise outline and interior profile), thereby can draw four abscissa value x coordinate figures of ears, x L1, x L2, x R1, x R2, represent the left ear outside, left ear inboard, auris dextra inboard, the auris dextra outside respectively.
Ears can can't be identified because of blocking of hair, if having only an ear covered this moment, then can judge this covered ear information by the ear information that another has been found out.Concrete account form can be that calculate the axis with the eyes bridge of the nose, and concrete account form can be:
If obtained the positional information x of left ear L1, x L2, the positional information that then can calculate auris dextra is: x R1=2x Mid-x L2, x R2=2x Mid-x L1
If obtained the positional information x of auris dextra R1, x R2, the positional information that then can calculate left ear is: x L1=2x Mid-x R2, x L2=2x Mid-x R1
If two ears all are blocked, then can only be by the position of pupil, roughly judge the position of ear x there is this moment with human face structure L1=x L2, x R1=x R2Because ears are symmetrical, after drawing a positional information of picking up the ears piece, can draw the positional information of opposite side ear according to pupil position.Concrete account form does not repeat them here.
According to above-mentioned computation process, the degree of accuracy that can also calculate the ears position accordingly is:
e ear = 1 n Σ i = 1 n l M - l mi l M + l mi
According to above-mentioned definite pupil position, can also determine the chin position of portrait in the license image.
When determining the chin position of portrait, can at first determine all possible chin curve, the chin curve of determining according to this mode may have many, can be referred to as candidate's chin curve, then a certain amount of chin curve sample in these candidate's chin curves and the standard feature storehouse is carried out match, select only candidate's chin curve from candidate's chin curve, this candidate's chin curve of selecting is definite chin curve, and then determines the chin position of portrait.
Because the influence of the three-dimensional factor of shooting effect and people's face, in general chin area can present hatching effect in photo, therefore can determine chin by this hatching effect.Specifically can be to identify to obtain candidate's chin curve by color, specifically by the color recognition method obtain candidate's chin curve mode can with above-mentioned identify might be ear color pixel point and and then to draw the mode of candidate's ear curve similar, just the setting meeting of colour of skin difference is different, does not repeat them here.
Yet, because the existence of special circumstances, for example beard, double chin or over-exposed etc., may cause situations such as shade is not obvious, in particular cases this, possibly can't identify concrete chin curve by color identification, therefore invariant that can face's shape is determined the position of chin, specifically can be to determine the chin curve by the sample chin curve in the face shape combined standard sample storehouse, namely determine the chin position of portrait in the license image, specifically can concern to determine by Invariant of Quadratic Curve, not repeat them here.
In a concrete example, determine that according to pupil position the mode of chin position can be as described below.
At first learn the chin area that can determine roughly according to above-mentioned definite pupil position and organization of human body, the regional available following formula on the longitudinal axis of chin is represented:
y = x 2 - x 1 k + y 1 + y 2 2
Wherein, the span of k is (0.47,0.63) between, here x1, y1, x2, y2 represent horizontal stroke, the ordinate of above-mentioned definite pupil position respectively, thereby can roughly judge the zone of chin accordingly according to pupil position, in following process, only need to search in the approximate region at the chin of determining here and get final product.
Then, find out the cheek edge, specifically can find out the candidate region of all chins with shadow character, i.e. all candidate's chin curve, remove to verify the shape invariance magnitude relation that whether satisfies with the cheek edge with these candidate's chin curves then, if do not find the chin candidate region of shade, then by cheek edge calculations chin area.
Concrete, the invariant relationship description be not subjected to the influence of object attitude, perspective projection and camera intrinsic parameter.
Cheek edge and chin constitute quafric curve, therefore can come match with the invariant in the plane quadratic curve, and a plane quadratic curve can be represented by a following such equation:
ax 2+bxy+cy 2+dx+ey+f=0
For x=(x, y, 1) TThen quafric curve also available following Matrix C define:
C = a b / 2 d / 2 b / 2 c e / 2 d / 2 e / 2 f
x TCx=0
For the quafric curve of being represented by Matrix C arbitrarily, and two coplanar straight lines that are not cut in clean curve, can define an invariant:
I = ( l 1 T C - 1 l 2 ) 2 ( l 1 T C - 1 l 1 ) ( l 2 T C - 1 l 2 )
Two coplanar points for a quafric curve can form same invariant.
For two normalization matrix c by them 1, c 2(| c i|=1) expression quafric curve, can determine two invariants.
I 1 = Trace [ C 1 - 1 C 2 ] , I 2 = Trace [ C 2 - 1 C 1 ]
Choose people's face of the standard of some, for example 1000, calculate the quadratic curve equation of chin area of people's face of these quantity, deposit the Matrix C of these quadratic curve equations in feature database, treat that with the chin in the picture to be identified curvilinear equation in matched curve and the learning database compares, namely to I 1, I 2Value compare.
Threshold values I sets up standard 1s, I 2s, with this threshold values calculate draw chin area at last degree of accuracy be:
e chine = 1 2 [ | I 1 - I 1 s I 1 s + | I 2 - I 2 s I 2 s ]
Obtain position, the crown, ears position and the chin position of license image at the foundation aforesaid way after, the cutting of license image is carried out according to the clipping region of determining then in the clipping region that can determine to treat cutting.
Determine the clipping region of license image, as long as determine the boundary rectangle of people's face, according to above-mentioned definite position, the crown, ears position and chin position, position, the crown can accurately be determined, and ears position, chin position may not can simultaneously accurately, and just can determine the boundary rectangle of people's face on the basis overhead again with the positional information of ears or chin, after calculating this rectangle, detect at this rectangle again, as long as meet the architectural feature of people's face, just can illustrate that the boundary rectangle that draws is correct, can carry out cutting accordingly.
Concrete, because the different existing difference of people's face, the unconspicuous situation of some face feature can appear, for example, man's beard may make that the chin feature is not obvious, Ms's hair may make that the feature of ears is not obvious, at this moment, just can select a human face region the most accurate as the foundation of cutting in chin and these two features of ears.
Provided the schematic flow sheet of determining the clipping region in the concrete example among Fig. 2, as shown in Figure 2, determined that the concrete mode of clipping region can be as described below.
The center line of at first choosing photo is x=x Mid, namely choose the point midway of pupil.
Set e oThe degree of accuracy threshold values of be setting, and the degree of accuracy e of the gained during with above-mentioned definite ears position, chin position Ear, e ChineWith this threshold value e 0Compare:
Work as e Ear>e 0The time, illustrate that the ears zone location is accurate;
Work as e Chine>e 0The time, the chin area location is described accurately.
At e Ear, e ChineAll greater than threshold value e 0Situation under, namely ears zone, chin area are all located more accurately under the situation, then to e EarMutual e ChineCompare, and determine the cutting foundation according to comparative result.
If e Ear>e Chine, illustrate that the ears position is more accurate than chin position, therefore can select for use ears as the cutting foundation, specifically can be:
Carry out the location of left and right edges by the axis of portrait:
If the distance in the inboard of ears and the outside is excessive, namely | x L1-x L2|>l e, then explanation then can have considerable influence to the cutting of certificate when type of credential is tight to the requirement of ear, and need handle accordingly this moment according to the actual specification requirement of certificate photo;
If certificate requires the distance at human face region and picture edge, then should use inside edge x L2, x R1Position;
If certificate photo requires ears to drop in certain zone, then need to use outer ledge x L1, x R2Position.
After having determined the crown and ears edge, can be by these 3 location of finishing the clipping region.
If e Ear<e ChineThe time, illustrating that ear information is not too obvious, the chin position is more accurate than ears position, and therefore approximate solution is come at available chin position, selects for use chin as the cutting foundation, specifically can be:
After pupil, the crown, chin position accurately obtain, at first determine the axis x of portrait by the position of two pupils Mid, position, crown y Top, chin position y Chine, use these three values can determine the position of portrait on y direction, again according to the requirement of specific certificate photo to the portrait length and width, can draw last former figure clipping region.
If e Ear=e Chine, illustrate that then the degree of accuracy of ears position, chin position is equally matched, then can select for use in ears position, the chin position one as the cutting foundation arbitrarily, identical in the mode of concrete location, clipping region and the aforesaid way.
If e Ear>e 0And e Chine<e 0, illustrating that then the ears position is more accurate, therefore the chin position is accurate inadequately, can select for use the ears position as the cutting foundation, identical in the mode of concrete location, clipping region and the aforesaid way.
If e Ear<e 0And e Chine>e 0, illustrating that then the ears position is accurate inadequately, therefore the chin position is more accurate, can select for use the chin position as the cutting foundation, identical in the mode of concrete location, clipping region and the aforesaid way.
If e Ear, e ChineAll be not more than threshold value e 0, i.e. ears position, chin position out of true all, the position of chin and ears does not all get access to accurately, then does equalization by pupil and approximate region and handles, and specifically can be:
By spacing and the position of pupil, and the zone that obtains ears, chin with the empirical value of human face structure; Generally speaking, the picture that chin, ears simultaneously all can not precision be found, use this method can reach 90% degree of accuracy, because of not obvious picture proportion less---general certificate photo all requires face characteristic clear, so this method can obtain higher accuracy under special circumstances.
According to the license image method of cutting out of the invention described above, the present invention also provides a kind of license image cutting system, and the structural representation of a kind of license image cutting system embodiment of the present invention has been shown among Fig. 3, and as shown in Figure 3, it comprises:
Pupil position is searched unit 201, is used for reading the license image, searches the pupil position of portrait in the license image;
Crown position determination unit 202 is for the position, the crown of determining license image portrait according to described pupil position;
Chin position determination unit 203 is for the chin position of determining license image portrait according to described pupil position;
Ears position determination unit 204 is for the ears position of determining license image portrait according to described pupil position;
Cutting unit 205 is used for determining the clipping region according to position, the described crown, described chin position, described ears position, and according to the clipping region of determining the license image is carried out cutting.
Wherein, when above-mentioned pupil position is searched unit 201 and is searched the pupil position of portrait in the license image, can search by OpenCV, when searching the pupil position of portrait in the license image by OpenCV, the certificate photo pupil image that the learning database that relies on can preset number.
In the license image cutting system of the present invention, pupil position is searched unit 201 and is searched mode of the mode of the concrete mode of the concrete mode of the concrete mode of pupil position, crown position determination unit 202 definite positions, the crown, chin position determination unit 203 definite chin positions, ears position determination unit 204 definite ears positions, 205 definite clipping regions, cutting unit and concrete cutting etc., can with the license image method of cutting out of the invention described above in identical, will not add to give unnecessary details at this.
Aforesaid the present invention program, be based on multiple spot checking location and realize the license automatic image cutting out method, the multiple spot here comprises the crown, ears, chin, thereby having overcome traditional license makes and need manually select the clipping region to cause the too low deficiency of efficient, can locate license image clipping region fast, efficiently, accurately, automatically cut out satisfactory photograph, can be widely used in self-service photographing device and cut out satisfactory license image automatically, also be conducive to the convenient effect of the self-service shooting certificate photo of non-professional ruck.
In addition, by adopting chin and binaural localization, find only point by CF among the present invention program, can allow the result of cutting more accurate.
In addition, when determining the clipping region, taken into full account the influence of chin and ears, simultaneously verify comparison with the characteristic curve storehouse in the zone of calculating chin and ears, calculate degree of accuracy, when determining the clipping region, determine in these two features, to select a human face region the most accurate as the foundation of cutting by the degree of accuracy of contrast chin and ears, thereby guarantee that cutting is more accurate then.
Above-described embodiment of the present invention only is the detailed description to preferred embodiment of the present invention, does not constitute the restriction to protection domain of the present invention.Any modification of doing within the spirit and principles in the present invention, be equal to and replace and improvement etc., all should be included within the claim protection domain of the present invention.

Claims (8)

1. a license image method of cutting out is characterized in that, comprises step:
Read the license image, search the pupil position of portrait in the license image;
Determine the position, the crown of portrait in the license image according to described pupil position;
Determine chin position, the ears position of portrait in the license image according to described pupil position;
Determine the clipping region according to above-mentioned definite position, the crown, chin position, ears position, and according to the clipping region of determining the license image is carried out cutting;
The mode of determining the position, the crown of portrait in the license image according to described pupil position comprises: determine the highest possible position y in the crown according to pupil position h, the minimum possible position y in the crown lChoose the centre position With y pCentered by point choose the rectangle of setting length and width, the ratio of the shared number of background colour in the rectangle relatively: if the ratio of the shared number of background colour is less than 1/2 in the rectangle, adopt
Figure FDA00003375479800012
Upgrade y pIf the ratio of the shared number of background colour is greater than 1/2 in the rectangle, adopt
Figure FDA00003375479800013
Upgrade y pRepeat said process, the ratio of the shared number of background colour in the gained rectangle equals 1/2, the last resulting y of iteration pOrdinate for position, the crown;
The mode of determining the ears position of portrait in the license image according to described pupil position comprises: according to the learn approximate region of people's face of pupil position and organization of human body, and colour of skin proportion of all categories is determined the pixel in all possible ears zone, people's face both sides in the approximate region according to people's face; Determine candidate's ears curve of license image according to the pixel in all possible ears zone, people's face both sides; The ears curve sample of the setting quantity in described candidate's ears curve and the preset standard database is carried out match, from candidate's ears curve, determine the ears curve the most similar to the ears curve sample of described setting quantity, and determine the ears position according to this ears curve;
The mode of determining the chin position of portrait in the license image according to described pupil position comprises: determine all possible candidate's chin curve according to described pupil position; The chin curve sample of the setting quantity in described candidate's chin curve and the default feature database is carried out match, from candidate's chin curve, select the chin curve the most similar to the chin curve sample of described setting quantity, determine the chin position of portrait according to this chin curve.
2. license image method of cutting out according to claim 1 is characterized in that, searches the pupil position of portrait in the license image by OpenCV.
3. license image method of cutting out according to claim 2 is characterized in that, when searching the pupil position of portrait in the license image by OpenCV, the learning database that relies on is the certificate photo pupil image of preset number.
4. license image method of cutting out according to claim 1 is characterized in that, colour of skin proportion of all categories determines that the mode of the pixel in all possible ears zone, people's face both sides comprises in the approximate region according to people's face:
Determine to calculate the variance yields of colour of skin number of all categories, relatively this variance yields and the difference of setting variance threshold values;
If this variance yields is selected the maximum colour of skin classification of number greater than setting variance threshold values;
If this variance yields is less than or equal to the setting variance threshold values, select three kinds of maximum colour of skin classifications of number;
The color value of determining selected colour of skin classification deducts the color value of setting colour of skin difference gained, searches people's face both sides all location of pixels similar to this color value, and these all location of pixels are determined to be the pixel in possible ears zone, people's face both sides.
5. according to claim 1 or 2 or 3 described license image method of cutting out, it is characterized in that:
Determine that according to above-mentioned definite position, the crown, chin position, ears position the mode of clipping region comprises: the chin degree of accuracy e that calculates the chin position of determining Chine, the ears position ears degree of accuracy e Ear, and with e Chine, e EarWith default precision threshold e 0Relatively:
If e Ear>e Chine>e 0Perhaps e Ear>e 0, e Chine<e 0, the clipping region is determined as the cutting foundation in described ears position;
If e Chine>e Ear>e 0Perhaps e Ear<e 0, e Chine>e 0, the clipping region is determined as the cutting foundation in described chin position,
If e Ear>e 0, e Chine>e 0And e Ear=e Chine, with in ears position, the chin position any one as cutting according to determining the clipping region;
If e Ear<e 0And e Chine<e 0, do equalization by pupil and approximate region and handle definite clipping region.
6. a license image cutting system is characterized in that, comprising:
Pupil position is searched the unit, is used for reading the license image, searches the pupil position of portrait in the license image;
Crown position determination unit is for the position, the crown of determining license image portrait according to described pupil position;
The chin position determination unit is for the chin position of determining license image portrait according to described pupil position;
The ears position determination unit is for the ears position of determining license image portrait according to described pupil position;
The cutting unit is used for determining the clipping region according to position, the described crown, described chin position, described ears position, and according to the clipping region of determining the license image is carried out cutting;
Described crown position determination unit determines that according to described pupil position the mode of the position, the crown of portrait in the license image comprises: determine the highest possible position y in the crown according to pupil position h, the minimum possible position y in the crown lChoose the centre position
Figure FDA00003375479800031
With y pCentered by point choose the rectangle of setting length and width, the ratio of the shared number of background colour in the rectangle relatively: if the ratio of the shared number of background colour is less than 1/2 in the rectangle, adopt
Figure FDA00003375479800032
Upgrade y pIf the ratio of the shared number of background colour is greater than 1/2 in the rectangle, adopt
Figure FDA00003375479800033
Upgrade y pRepeat said process, the ratio of the shared number of background colour in the gained rectangle equals 1/2, the last resulting y of iteration pOrdinate for position, the crown;
Described ears position determination unit determines that according to described pupil position the mode of the ears position of portrait in the license image comprises: according to the learn approximate region of people's face of pupil position and organization of human body, and colour of skin proportion of all categories is determined the pixel in all possible ears zone, people's face both sides in the approximate region according to people's face; Determine candidate's ears curve of license image according to the pixel in all possible ears zone, people's face both sides; The ears curve sample of the setting quantity in described candidate's ears curve and the preset standard database is carried out match, from candidate's ears curve, determine the ears curve the most similar to the ears curve sample of described setting quantity, and determine the ears position according to this ears curve;
Described chin position determination unit determines that according to described pupil position the mode of the chin position of portrait in the license image comprises: determine all possible candidate's chin curve according to described pupil position; The chin curve sample of the setting quantity in described candidate's chin curve and the default feature database is carried out match, from candidate's chin curve, select the chin curve the most similar to the chin curve sample of described setting quantity, determine the chin position of portrait according to this chin curve.
7. license image cutting system according to claim 6 is characterized in that, described pupil position is searched portrait in the license image is searched in the unit by OpenCV pupil position.
8. license image cutting system according to claim 7 is characterized in that, when searching the pupil position of portrait in the license image by OpenCV, the learning database that relies on is the certificate photo pupil image of preset number.
CN201110442745XA 2011-12-26 2011-12-26 Certificate image cutting method and system Active CN102592260B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110442745XA CN102592260B (en) 2011-12-26 2011-12-26 Certificate image cutting method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110442745XA CN102592260B (en) 2011-12-26 2011-12-26 Certificate image cutting method and system

Publications (2)

Publication Number Publication Date
CN102592260A CN102592260A (en) 2012-07-18
CN102592260B true CN102592260B (en) 2013-09-25

Family

ID=46480854

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110442745XA Active CN102592260B (en) 2011-12-26 2011-12-26 Certificate image cutting method and system

Country Status (1)

Country Link
CN (1) CN102592260B (en)

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105791665A (en) * 2014-12-23 2016-07-20 中兴通讯股份有限公司 Shooting method and shooting device
AU2016310451B2 (en) 2015-08-21 2021-04-22 Magic Leap, Inc. Eyelid shape estimation using eye pose measurement
EP3337383A4 (en) * 2015-08-21 2019-04-03 Magic Leap, Inc. Eyelid shape estimation
CN108352155A (en) * 2015-09-30 2018-07-31 惠普发展公司,有限责任合伙企业 Inhibit ambient sound
WO2017066296A1 (en) 2015-10-16 2017-04-20 Magic Leap, Inc. Eye pose identification using eye features
CN106156739B (en) * 2016-07-05 2019-06-18 华南理工大学 A kind of certificate photo ear detection and extracting method based on face mask analysis
CN106355548B (en) * 2016-08-24 2019-05-17 神思电子技术股份有限公司 A kind of China second-generation identity card photo cuts out transform method
CN107009412B (en) * 2017-04-12 2019-05-28 广东工业大学 A kind of certificate photo automatic cutting method, apparatus and system
CN107123088B (en) * 2017-04-21 2019-09-13 山东大学 A kind of method of automatic replacement photo background color
CN107580180B (en) * 2017-08-24 2020-07-10 深圳市华盛昌科技实业股份有限公司 Display method, device and equipment of view frame and computer readable storage medium
CN108898045B (en) * 2018-04-23 2021-05-25 杭州电子科技大学 Multi-label image preprocessing method based on deep learning gesture recognition
CN108805120A (en) * 2018-06-13 2018-11-13 广州视源电子科技股份有限公司 The treating method and apparatus of person's handwriting
CN108921167A (en) * 2018-06-22 2018-11-30 四川斐讯信息技术有限公司 A kind of color image automatic cutting method and system
CN109410138B (en) * 2018-10-16 2021-10-01 北京旷视科技有限公司 Method, device and system for modifying double chin
CN109639962B (en) * 2018-11-22 2020-12-18 新昌县鸿吉电子科技有限公司 Self-timer short video mode selection method and related product
CN109712103B (en) * 2018-11-26 2021-07-30 温岭卓致智能科技有限公司 Eye processing method for self-shot video Thor picture and related product
CN109658328A (en) * 2018-11-26 2019-04-19 深圳艺达文化传媒有限公司 From animal head ear processing method and the Related product of shooting the video
CN110288531B (en) * 2019-07-01 2023-06-13 山东浪潮科学研究院有限公司 Method and tool for assisting operator in making standard identity card photo
CN111191539B (en) * 2019-12-20 2021-01-29 江苏常熟农村商业银行股份有限公司 Certificate authenticity verification method and device, computer equipment and storage medium
CN111626166B (en) * 2020-05-19 2023-06-09 Oppo广东移动通信有限公司 Image processing method, device, electronic equipment and storage medium
CN117412158A (en) * 2023-10-09 2024-01-16 广州翼拍联盟网络技术有限公司 Method, device, equipment and medium for processing photographed original image into multiple credentials

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1658225A (en) * 2005-03-16 2005-08-24 沈阳工业大学 Personal identity recognising method based on pinna geometric parameter
CN1798237A (en) * 2004-12-10 2006-07-05 富士胶片株式会社 Method of and system for image processing and computer program
CN102063659A (en) * 2010-12-28 2011-05-18 广州商景网络科技有限公司 Method, server and system for collecting and making electronic photo

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3869635B2 (en) * 2000-07-21 2007-01-17 セイコープレシジョン株式会社 Image processing apparatus, image processing method, recording medium, and print system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1798237A (en) * 2004-12-10 2006-07-05 富士胶片株式会社 Method of and system for image processing and computer program
CN1658225A (en) * 2005-03-16 2005-08-24 沈阳工业大学 Personal identity recognising method based on pinna geometric parameter
CN102063659A (en) * 2010-12-28 2011-05-18 广州商景网络科技有限公司 Method, server and system for collecting and making electronic photo

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JP特开2002-42116A 2002.02.08

Also Published As

Publication number Publication date
CN102592260A (en) 2012-07-18

Similar Documents

Publication Publication Date Title
CN102592260B (en) Certificate image cutting method and system
US11017205B2 (en) Three-dimensional finger vein recognition method and system
CN108921100B (en) Face recognition method and system based on visible light image and infrared image fusion
KR102041906B1 (en) API engine for discrimination of facial skin disease based on artificial intelligence that discriminates skin disease by using image captured through facial skin photographing device
US7512255B2 (en) Multi-modal face recognition
Vijayan et al. Twins 3D face recognition challenge
US8345936B2 (en) Multispectral iris fusion for enhancement and interoperability
US20160371539A1 (en) Method and system for extracting characteristic of three-dimensional face image
Jana et al. Age estimation from face image using wrinkle features
Khairosfaizal et al. Eyes detection in facial images using circular hough transform
US8577094B2 (en) Image template masking
CN103632132A (en) Face detection and recognition method based on skin color segmentation and template matching
CN103116749A (en) Near-infrared face identification method based on self-built image library
CN101339607A (en) Human face recognition method and system, human face recognition model training method and system
US20110116707A1 (en) Method for grouping 3d models to classify constitution
CN105825163A (en) Retrieval system and method of face image
Bowyer et al. Face recognition using 2-D, 3-D, and infrared: Is multimodal better than multisample?
CN106570447A (en) Face photo sunglass automatic removing method based on gray histogram matching
Burgos-Artizzu et al. Distance estimation of an unknown person from a portrait
CN115953824A (en) Face skin image processing method and system
CN109598235B (en) Finger vein image authentication method and device
Sharma et al. 3D face recognition techniques-a review
CN109074471A (en) A kind of iris region segmentation method and device based on active appearance models
CN111626181A (en) Face recognition big data analysis method
Vezzetti et al. Application of geometry to rgb images for facial landmark localisation-a preliminary approach

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant