Summary of the invention
(1) technical problems to be solved
The present invention propose it is a kind of based on improve RANSAC algorithm in, LONG WAVE INFRARED method for registering images, with solve howImproving operational speed improves the technical issues of registration accuracy.
(2) technical solution
In order to solve the above-mentioned technical problem, the present invention propose it is a kind of based on improve RANSAC algorithm in, LONG WAVE INFRARED figureAs method for registering;It is characterized in that, method includes the following steps:
S1, Image Acquisition: respectively acquisition in, LONG WAVE INFRARED image, using medium-wave infrared image as benchmark image, long wave is redOuter image is as image subject to registration;
S2, feature point extraction: using Harris Corner Detection Algorithm, centering, LONG WAVE INFRARED image progress characteristic point are mentioned respectivelyIt takes;
S3, subregion are screened for the first time: LONG WAVE INFRARED image uniform being divided into the identical muti-piece region of size, respectively everyThe characteristic point of identical quantity is selected in block region, is then found in the medium-wave infrared image as benchmark image and LONG WAVE INFRAREDThe corresponding match point of the characteristic point of image, forms matched characteristic point pair;
S4, RANSAC algorithm postsearch screening: using RANSAC algorithm to the characteristic point after first screening to the secondary sieve of progressChoosing removes error hiding characteristic point pair;
S5, image registration: being registrated according to the result of RANSAC algorithm postsearch screening, obtains finally being registrated image.
Further, in step S3, long wave image is divided into 3 × 3 pieces, then randomly chooses two spies in every piece of regionPoint is levied, match point corresponding with them is then found in the medium-wave infrared image as benchmark image, is thus obtained 18 pairsThe match point being evenly distributed.
Further, it in step S4, obtains indicating that registration front and back image coordinate is converted by RANSAC algorithm postsearch screeningThe homography matrix of relationship;It in the step S5, is registrated using the homography matrix, obtains finally being registrated image.
(3) beneficial effect
It is proposed by the present invention based on improve in RANSAC algorithm, LONG WAVE INFRARED method for registering images, this method mainly wrapsInclude Image Acquisition, feature point extraction, subregion screen for the first time, five steps of the postsearch screening of RANSAC algorithm and image registration.ThisInvention is introduced into the detection of Harris Corner Detection Algorithm, the matching characteristic point in long wave image, makes during characteristic point is chosenMatching characteristic point is screened for the first time with region segmentation method, guarantees that characteristic point is uniformly distributed in the picture, then utilizesRANSAC algorithm carries out postsearch screening, can effectively remove error hiding characteristic point pair, effectively promotion quality of match.
Specific embodiment
To keep the purpose of the present invention, content and advantage clearer, with reference to the accompanying drawings and examples, to tool of the inventionBody embodiment is described in further detail.
The present embodiment propose it is a kind of based on improve RANSAC algorithm in, LONG WAVE INFRARED method for registering images, the registration sideThe process of method is as shown in Figure 1, mainly include the following steps:
S1, Image Acquisition: respectively acquisition in, LONG WAVE INFRARED image, using medium-wave infrared image as benchmark image, long wave is redOuter image is as image subject to registration.
S2, feature point extraction: using Harris Corner Detection Algorithm, centering, LONG WAVE INFRARED image progress characteristic point are mentioned respectivelyIt takes.
Harris Corner Detection Algorithm is a kind of point feature extraction algorithm, and with calculating, simple, point multiplicity is high and missesThe features such as inspection rate is low, even if image, there are the influence such as grey scale change, rotation, scaling or noise, the extraction of angle steel joint is also ratioMore stable.
It is in one group of square region that Harris Corner Detection Algorithm, which defines the autocorrelation value E (u, v) on any direction,The summation of image grayscale error, it may be assumed that
Its Taylor expansion is
Wherein, M is 2 × 2 symmetrical matrix
Wherein, u and v is window translational movement, is generated grey scale change E (u, v), and E (u, v) can be approximate as local cross-correlation letterNumber.
F (x, y) is image grayscale, and f (x+u, y+v) is the image grayscale after image translation, and w (x, y) is window function, fxAnd fyRespectively gradient value of the image in the direction x, y.
For Gaussian function.
If λ1And λ2For two characteristic values of matrix M, the receptance function R of angle point is calculated:
R=λ1λ2-k(λ1+λ2)2 (4)
In formula, k is constant, generally takes 0.04.
S3, subregion are screened for the first time: LONG WAVE INFRARED image uniform being divided into the identical muti-piece region of size, respectively everyThe characteristic point of identical quantity is selected in block region, is then found in the medium-wave infrared image as benchmark image and LONG WAVE INFRAREDThe corresponding match point of the characteristic point of image, forms matched characteristic point pair.
When randomly selecting match point, in order to guarantee the accuracy of model parameter, characteristic point is carried out as unit of regionIt chooses.Long wave image is divided into 3 × 3 pieces in the present embodiment, as shown in Fig. 2, randomly choosing two spies in every piece of region againPoint is levied, it is possible thereby to avoid because the characteristic point of selection is to excessively concentrating due to the accuracy of affecting parameters.Then as reference mapMatch point corresponding with them is found in the medium-wave infrared image of picture, and 18 pairs of relatively uniform match points of distribution are thus obtained,It is more stable, accurate with 18 pairs of calculated transformation matrixs of match point.
S4, RANSAC algorithm postsearch screening: using RANSAC algorithm to the characteristic point after first screening to the secondary sieve of progressChoosing removes error hiding characteristic point pair.
The principle of RANSAC algorithm is in alignment to be fitted using given point set.It is randomly selected first in a concentrationTwo points, the two points have determined straight line.The number of characteristic point within the scope of this straight line certain distance, as supportsPoint set number.RANSAC algorithm so repeats selection n times at random, and then the straight line with maximum support point set number is identified as a littleThe fitting of collection.Point within the scope of the error distance of fitting is considered as available point, it is on the contrary then be Null Spot.Its step are as follows:
1, a data point sample is randomly selected from feature point set S, and model of fit is initialized by this subset;
2, according to specific threshold T, the support point set S of "current" model is found outi, set SiIt is exactly the consistent collection of sample, is consideredIt is available point;
If 3, set SiSize be more than threshold value Ts, use SiIt reevaluates model and terminates;
If 4, set SiSize be less than threshold value Ts, then a new sample is chosen, above step is repeated;
5, it is attempted by n times, selects maximum consistent collection Si, and estimate new model accordingly, obtain to the end as a result, i.e. singleAnswering property matrix H:
S5, image registration: being registrated according to the result of RANSAC algorithm postsearch screening, obtains finally being registrated image.
H-matrix illustrates registration front and back image coordinate transformation relation, can obtain images after registration according to matrix multiplication accordinglyEach corresponding registration of coordinate points (m, n) before image corresponding coordinate (X, Y), as shown in formula (5).
Under normal circumstances, the value of X and Y is not integer, it is assumed that X=x+p, Y=y+q, wherein x, y indicate integer part,P and q indicates fractional part, so the pixel value of the position (m, n) can be obtained in images after registration such as according to bilinear interpolation algorithmShown in formula (6).
G ' (m, n)=G (X, Y)=(1-p) * (1-q) * G (x, y)+p* (1-q) * G (x+1, y)+(1-p) * q*G (x, y+1)+p*q*G(x+1,y+1) (6)
Wherein, G indicates that the image grayscale before registration, G ' indicate the image grayscale after registration.
According to above-mentioned steps, the pixel value of each pixel is calculated, obtains finally being registrated image.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the artFor member, without departing from the technical principles of the invention, several improvement and deformations can also be made, these improvement and deformationsAlso it should be regarded as protection scope of the present invention.