Woods Moschus moschiferous iris locating method
Technical field
The invention belongs to animal iris identification field, particularly relate to a kind of iris locating method for woods Moschus moschiferous.
Background technology
Iris is a part for animal eyes structure, it it is one of lifelong identity of the most reliable animal organism, the uniqueness of iris tissue and stability is the highest, inalterability and anti-fraudulence are the strongest, is ideal identification foundation, and animal will not be had infringement. Adopting iris to be authenticated woods Moschus moschiferous identity identifying, it is possible to the effective Different Individual distinguishing woods Moschus moschiferous, the endangered woods Moschus moschiferous of protection is exempted to indiscriminately slaughter and has great importance by this.
Compared with identifying technology with more ripe human iris, animal iris identification research is less, and woods Moschus moschiferous iris identification rarely has people to study especially. Currently for the localization method of animal iris, the main localization method using for reference human eye iris. Owing to woods Moschus moschiferous iris image feature and human iris have notable difference, outer sub-circular in human iris, and woods Moschus moschiferous iris outer sub-elliptical, interior edge also sub-elliptical, and often change, existing human iris's location technology is made can not directly to use for reference use, it is necessary to the method finding applicable woods Moschus moschiferous Iris Location.
Method about animal Iris Location technology mainly has at present:
Application number CN101447025, denomination of invention is " a kind of method for identifying iris of large animals ": mainly comprise the steps that iris image is carried out threshold transformation and rim detection realizes pretreatment, with approximate circle fitting algorithm to iris region inner boundary circle and external boundary circle location, with iris region segmentation be normalized to determine feature extraction region, determine feature coding by 2DGabor filter bank. This method is based on human eye iris identification method, choose respective algorithms in conjunction with larger animal eye feature and solve the noise jamming problem that larger animal eyelashes are long, it is achieved that the location of irregular pupil region, the determination of iris of large animals feature coding and finally identify. The present invention can realize the individual traceability that larger animal effectively manages, information trace and meat product pollute.
The Iris Location technology that foregoing invention relates to, adopt approximate circle fitting algorithm to iris region inner boundary circle and external boundary circle location, and woods Moschus moschiferous iris feature has obvious difference with it, Main Differences is in that: the inside and outside border of woods Moschus moschiferous iris is approximately oval mostly, inside and outside border central point is scarcely same, it is impossible to adopt the location technology in foregoing invention method to position the inside and outside border of woods Moschus moschiferous iris.
Summary of the invention
The present invention is the deficiency overcoming present technology, it is proposed to an elite stand Moschus moschiferous iris locating method, adopts the method that woods Moschus moschiferous iris is positioned, effectively it can be carried out individual identification, thus carrying out population management, improving cultivation level, alleviating the demand pressure to Moschus.
The technical scheme is that
The inside and outside border of woods Moschus moschiferous iris is considered as having two oval borders at different center, length semiaxis, inclination angle, utilize the distribution characteristics of woods Moschus moschiferous iris gray scale and gradient, try to achieve corresponding partitioning parameters, and convert in conjunction with make and break computing etc., by thick to essence, it is gradually completing the location of woods Moschus moschiferous iris.
Woods Moschus moschiferous iris locating method, specifically comprises the following steps that
S1, gray-scale map to woods Moschus moschiferous iris image carry out gaussian filtering process, obtain the woods Moschus moschiferous iris gray-scale map I after denoising;
S2, to woods Moschus moschiferous exterior iris boundary coarse positioning, obtain image I3;
S3, calculating woods Moschus moschiferous iris bound parameter, including: woods Moschus moschiferous pupil gradient upper bound pupilg, woods Moschus moschiferous pupil gray scale upper bound pupilmax, woods Moschus moschiferous iris greatest gradient irisg=Xmax, the upper bound irismax=Ymax and woods Moschus moschiferous iris gray scale lower bound irismin=Ymin of woods Moschus moschiferous iris gray scale;
S4, bound parameter described in S3 is modified, i.e. woods Moschus moschiferous pupil gradient upper bound pupilg is modified to pupilg+0.5, woods Moschus moschiferous pupil gray scale upper bound pupilmax and is modified to pupilmax+10, and woods Moschus moschiferous iris greatest gradient irisg is modified to irisg+0.5;
S5, woods Moschus moschiferous exterior iris boundary is accurately positioned, particularly as follows: remove in image the point more than irisg, irismax, removes the point less than irismin in image I3 described in S2, use sobel operator, detected edge points, goes out bounding ellipse with least square fitting, obtains accurate exterior iris boundary;
S6, to woods Moschus moschiferous iris inner boundary coarse positioning, concretely comprise the following steps:
S61, remove the part beyond exterior iris boundary in woods Moschus moschiferous iris gray-scale map I described in S1, obtain image I4;
S62, remove in image I4 described in S61 the point of revised pupilg more than described in S4, remove in image I9 the point of revised pupilmax more than described in S4, obtain image I5;
S63, image I5 described in S62 is carried out make and break computing, obtain image I6;
S64, medium filtering is utilized to filter image I6 noise section described in S63, the marginal point of the image I6 after detection filter, go out bounding ellipse with least square fitting, obtain rough iris inner boundary;
S7, woods Moschus moschiferous iris inner boundary is accurately positioned, including:
S71, go the part beyond iris inner boundary coarse positioning border in image I4 described in S61, obtain image I7;
S72, gradient image Grad7 to I7, adopt local elongation, strengthens the contrast of Grad7, obtains image Grad7hance;
S73, Grad7hance is closed, opening operation, obtain image I8;
S74, image I8 is carried out medium filtering filtering noise, try to achieve maximum communicating portion, obtain image I9;
S75, detection image I9 marginal point, and go out bounding ellipse with least square fitting, obtain accurate iris inner boundary.
Further, described in S2, woods Moschus moschiferous exterior iris boundary coarse positioning is specifically included:
S21, according to formulaCalculate gray-scale map I midpoint described in S1 (x, Grad Grad y) (and x, y), wherein, GxFor the gradient in horizontal direction, GyFor the gradient in vertical direction, Gx(x, y)=I (x+1, y)-I (x-1, y) }/2, if x+1 or x-1 beyond image coordinate scope, then maps that to x value nearest in image. In like manner we can also obtain Gy(x, y), finally obtain Grad (x, y);
Gray-scale map I midpoint (x described in S22, calculating S1, y) (x, y), obtains ladder gray scale image RIG to terraced gray scale RIG, wherein, RIG (x, y)=Grad (x, y)/I (x, y), (x, y) represents point (x, gray value y) to I;
S23, ladder gray scale image RIG described in S22 is carried out Laplce strengthens conversion, obtain image I2;
Each point ladder gray scale in S24, calculating image I2, using the border of maximum ladder ash ratio as the coarse positioning of exterior iris boundary, removes the image outside coarse positioning border in gray-scale map I, obtains image I3.
Further, calculate woods Moschus moschiferous iris bound parameter described in S3 to specifically comprise the following steps that
S31, calculating image I3 gradient gray scale joint probability distribution Px, y (G, I), wherein,I refers to that the gray value of image I3, �� g are empirical value;
Meeting the point of regular constraints in Px, y (G, I) described in S32, reservation S31, be designated as Pint (G, I), wherein, described constraints is empirical condition;
S33, calculating Pint (G, I) the marginal probability Pg=Pint (G) to gradient, calculate the Pint (G, I) the marginal probability Pi=Pint (I) to gray scale;
S34, set maxPg=Pg (g ')=max{Pint (G) }, then using g ' corresponding for maxPg as pupil gradient upper bound pupilg, it may be assumed that pupilg=g ',
If maxPi=Ph (i ')=max{Pint (I) }, then using i ' corresponding for maxPh as pupil gray scale upper bound pupilmax, it may be assumed that pupilmax=i ';
S35, calculating Pxy '=�� * Px, y (G, I)/maxPgi, wherein, maxPgi=max{Px, y (G, I) }, �� is proportionality coefficient, is empirical value;
S36, isolate the part of higher value in Pxy ', obtain the coordinate on x and the y direction of correspondence interval [Xmin, Xmax] and [Ymin, Ymax], obtain woods Moschus moschiferous iris portion greatest gradient irisg=Xmax, the upper bound irismax=Ymax and gray scale lower bound irismin=Ymin of gray scale.
Further, constraints described in S32 is that { G��t1, t2��I��t3}, wherein, t1, t2 and t3 is constraint threshold value, and described constraint threshold value is empirical value.
Further, ��=17 described in S35.
The invention has the beneficial effects as follows:
Adopt method of the invention, it is possible to effectively remove the interference to iris image such as a small amount of foreign material, a small amount of hot spot, all can effectively position when dilatation within 10% to woods Moschus moschiferous iris image, left or right rotation within 1.5 degree.
Accompanying drawing explanation
Fig. 1 is inventive algorithm flow chart.
Fig. 2 is woods Moschus moschiferous Iris Location effect emulation figure.
Detailed description of the invention
Below in conjunction with embodiment and accompanying drawing, describe technical scheme in detail.
Due to impacts such as the mismatching of woods Moschus moschiferous, ambient lightings, its iris image acquiring difficulty is bigger, it is necessary to choose that image is clear, foreign material block less, reflective few iris image carries out Iris Location process in advance.
As it is shown in figure 1,
S1, gray-scale map to woods Moschus moschiferous iris image carry out gaussian filtering process, obtain the woods Moschus moschiferous iris gray-scale map I after denoising;
S2, to woods Moschus moschiferous exterior iris boundary coarse positioning, obtain image I3, particularly as follows:
S21, according to formulaCalculate gray-scale map I midpoint described in S1 (x, Grad Grad y) (and x, y), wherein, GxFor the gradient in horizontal direction, GyFor the gradient in vertical direction, Gx(x, y)=I (x+1, y)-I (x-1, y) }/2, if x+1 or x-1 beyond image coordinate scope, then maps that to x value nearest in image. In like manner we can also obtain Gy(x, y), finally obtain Grad (x, y);
Gray-scale map I midpoint (x described in S22, calculating S1, y) (x, y), obtains ladder gray scale image RIG to terraced gray scale RIG, wherein, RIG (x, y)=Grad (x, y)/I (x, y), (x, y) represents point (x, gray value y) to I;
S23, ladder gray scale image RIG described in S22 is carried out Laplce strengthen conversion, strengthen ladder gray scale picture contrast and obtain image I2;
Each point ladder gray scale in S24, calculating image I2, using the border of maximum ladder ash ratio as the coarse positioning of exterior iris boundary, removes the image outside coarse positioning border in gray-scale map I, obtains image I3.
S3, calculating woods Moschus moschiferous iris bound parameter, including: woods Moschus moschiferous pupil gradient upper bound pupilg, woods Moschus moschiferous pupil gray scale upper bound pupilmax, woods Moschus moschiferous iris greatest gradient irisg=Xmax, the upper bound irismax=Ymax and woods Moschus moschiferous iris gray scale lower bound irismin=Ymin of woods Moschus moschiferous iris gray scale, particularly as follows:
S31, calculating image I3 gradient gray scale joint probability distribution Px, y (G, I), wherein,
Px, y (G, I) described in S32, reservation S31 meet the point of regular constraints, is designated as Pint (G, I), wherein, described constraints is { G��t1, t2��I��t3}, t1, t2 and t3 are constraint threshold value, and described constraint threshold value is empirical value;
S33, calculating Pint (G, I) the marginal probability Pg=Pint (G) to gradient, calculate the Pint (G, I) the marginal probability Pi=Pint (I) to gray scale;
S34, set maxPg=Pg (g ')=max{Pint (G) }, then using g ' corresponding for maxPg as pupil gradient upper bound pupilg, it may be assumed that pupilg=g ',
If maxPi=Ph (i ')=max{Pint (I) }, then using i ' corresponding for maxPh as pupil gray scale upper bound pupilmax, it may be assumed that pupilmax=i ';
S35, calculating Pxy '=�� * Px, y (G, I)/maxPgi, wherein, maxPgi=max{Px, y (G, I) }, ��=17;
S36, isolate the part of higher value in Pxy ', obtain the coordinate on x and the y direction of correspondence interval [Xmin, Xmax] and [Ymin, Ymax], obtain woods Moschus moschiferous iris portion greatest gradient irisg=Xmax, the upper bound irismax=Ymax and gray scale lower bound irismin=Ymin of gray scale.
Bound parameter described in S3 is modified by S4, impact in order to eliminate local noise, namely, woods Moschus moschiferous pupil gradient upper bound pupilg is modified to pupilg+0.5, woods Moschus moschiferous pupil gray scale upper bound pupilmax and is modified to pupilmax+10, and woods Moschus moschiferous iris greatest gradient irisg is modified to irisg+0.5;
S5, woods Moschus moschiferous exterior iris boundary is accurately positioned, particularly as follows: remove in image the point more than irisg, irismax, removes the point less than irismin in image I3 described in S2, use sobel operator, detected edge points, goes out bounding ellipse with least square fitting, obtains accurate exterior iris boundary;
S6, to woods Moschus moschiferous iris inner boundary coarse positioning, concretely comprise the following steps:
S61, remove the part beyond exterior iris boundary in woods Moschus moschiferous iris gray-scale map I described in S1, obtain image I4;
S62, remove in image I4 described in S61 the point of revised pupilg more than described in S4, remove in image I9 the point of revised pupilmax more than described in S4, obtain image I5;
S63, image I5 described in S62 is carried out make and break computing, obtain image I6;
S64, medium filtering is utilized to filter image I6 noise section described in S63, the marginal point of the image I6 after detection filter, go out bounding ellipse with least square fitting, obtain rough iris inner boundary;
S7, woods Moschus moschiferous iris inner boundary is accurately positioned, including:
S71, go the part beyond iris inner boundary coarse positioning border in image I4 described in S61, obtain image I7;
S72, gradient image Grad7 to I7, adopt local elongation, strengthens the contrast of Grad7, obtains image Grad7hance;
S73, Grad7hance is closed, opening operation, obtain image I8;
S74, image I8 is carried out medium filtering filtering noise, try to achieve maximum communicating portion, obtain image I9;
S75, detection image I9 marginal point, and go out bounding ellipse with least square fitting, obtain accurate iris inner boundary.
Fig. 2 is the locating effect analogous diagram of the inventive method, it can be seen that the inventive method can effectively remove the interference to iris image such as a small amount of foreign material, a small amount of hot spot.