Image Registration Algorithm

Source: Internet
Author: User

Image Registration algorithms can be divided into registration algorithms based on the gray Statistical Characteristics of images, image feature registration algorithms, and image understanding-based registration algorithms.

The core steps of the feature-based image registration algorithm include feature extraction, feature matching, model parameter estimation, image transformation, and gray-scale interpolation.

 

The following is a summary of some opinions on the forum for future reference:

{
Logclickcount (this, 111 );
} "Href =" http://hi.csdn.net/gordon3000 "target =" _ blank "> gordon3000: find enough points of the same name on the other two images, and then use the polynomial model to forcibly correct them. The size, rotation, and noise are not problems.

You can construct an algorithm by yourself. Assume that a is the image at the correct position, and B is the image to be corrected. For any point (x, y) on the B plot, the position on the corrected image should be (u, v) (assuming that the polynomial is Level 2 ):
U = A0 + A1 * x + A2 * Y + A3 * X2 + A4 * y2 + A5 * x * y
V = b0 + B1 * x + B2 * Y + B3 * X2 + B4 * y2 + B5 * x * y
Scatter the x and y values on the B Chart, and take the u and v values on the Same Name of the chart. When the number of points is sufficient, 12 parameters A and B are obtained.
After obtaining the equation, traverse all vertices x and y in B and bring them into the above formula to obtain the positions u and v after all registration.
It is more difficult to automatically obtain the same name. This can be multi-order, but if the non-rigid change you mentioned is generally three-order is enough.

 

 

{
Logclickcount (this, 111 );
} "Href =" http://hi.csdn.net/littleplane "target =" _ blank "> littleplane: time efficiency requirements, you can look at the sift algorithm.

 

 

{
Logclickcount (this, 111 );
} "Href =" http://hi.csdn.net/xpjandy "target =" _ blank "> xpjandy: select the two points of the two images that should be the same (a total of four points) and get the coordinates of the four points, then, use the two-point line segment of the diagram and the two-point line segment of the B diagram to calculate the matrix of the square ing transformation, and then apply the Matrix to the entire graph. Let's take a look at opencv. There are a lot of ready-made API functions.

 

 

{
Logclickcount (this, 111 );
} "Href =" http://hi.csdn.net/Aniao "target =" _ blank "> aniao: It must be six-parameter registration (affine transformation.
Specific solution:
There are 6 parameters in total, including the angle of coordinate axis variation, rotation angle, X scale variation, y scale variation, X translation, and y translation.
After a series of operations, it can be converted into a linear algebraic formula (how to transform it is complex)
U = AX + by + c
V = dx + ey + F
Where, U and V are the horizontal and vertical coordinates of the target image, and X and Y are the horizontal and vertical coordinates of the source image.
That is to say
U a B C x
V = d e f * y
1 0 0 1 Z
The calculation of the six parameters of the specific A-F can find enough scale-unchanged feature points in the two images through sift, and then match these feature points. After matching, you can obtain many feature points. Then create
U = AX + by + c
V = dx + ey + F
Such an equation.
A total of three feature points and six equations are enough to solve six parameters.
But in fact, the three in the matrix space are far from enough. Generally, we need to take all of them together to solve the hyperdefinite equations.
U a B C x
V = d e f * y
1 0 0 1 Z
You may still be confused. In fact, you should first use the sift algorithm to find the scale unchanged points of the two images, then match these points, and then use each matching point to calculate the equation.

As far as I know, opencv does not have sift, but some people have used opencv to implement sift and can search. As for feature point matching, sift should be able to calculate 128-bit feature descriptors, And the Euclidean distance between the feature descriptors between the two points can be used for matching. In addition, this is not the case if we want to optimize the speed. We can use the gray correlation coefficient and some other algorithms to eliminate mismatching, such as ransac. In addition, we also use the new algorithms of my graduation thesis.

 

In fact, the 128-bit feature descriptor is only useful for initial registration. In addition, the Euclidean distance of the 128-bit space has a large computing overhead, and is usually approached by orthogonal arccosine. Therefore, if this is not the case, the time overhead will be less than 70%. So I only know some feature points. What is used for initial matching? The method is to use the gray correlation coefficient between feature points, which is lightweight.
I can show you the thesis and code, but the code is Matlab. In addition, removing mismatching is also an interesting innovation. Not ransac, not so academic, but something easy to understand

 

 

{
Logclickcount (this, 111 );
} "Href =" http://hi.csdn.net/leodream "target =" _ blank "> leodream: You have to consider three questions for image registration, they are the spatial transformation model used for punctuality, the similarity measurement criterion for registration, and the optimization method of the spatial transformation matrix.
I will explain it to you one by one:
1) spatial transformation model refers to the ing model between the two images to be registered. For example, only the rotation and translation operations are involved, that is, the rigid body transformation model, for example, there is a scaling operation, and even the zooming range in the X and Y directions is not the same, that is, the affine transformation or nonlinear transformation model. To achieve registration, you must first determine the ing model between the two images. If you are not clear about the transformation model, you can search Google or Wanfang for the "affine transformation" and "rigid body transformation" keywords. The post cannot be too detailed.
2) similarity measurement criterion for registration. After you confirm the transformation model, what will you do next? Of course, the parameters in the model are determined, but these parameters need to be determined (the number of parameters in different transformation models is different, for example, a rigid-body transform has three parameters: X translation, y translation, and Rotation Angle Sita, and an affine transform has six parameters. You have to tell the program what parameters are the best or correct. A correct criterion is the similarity measurement criterion of registration, which tells the program the degree of registration under a set of parameters, obviously, the group of parameters that make registration the most accurate is the one we are looking.
3) Space Transformation Matrix optimization method. In most cases, the parameters in the model are not obtained by decoding, but by "trying-judging, the Optimization of the spatial transformation matrix is simply how to optimize these parameters to find the set of parameters that make the best registration. There are many methods, such as genetic algorithms and particle swarm optimization algorithms. If you have no idea about these algorithms, you have to use the most stupid traversal search method, search all Parameter Combinations in a certain step, and then find the set of parameters that make the registration according to the similarity measurement criterion the highest degree.
All theoretical things are finished. The following is a simple example to illustrate this process.
For example, if there is an image a, I move a two pixels to the left, move 3 pixels down, and rotate 60 degrees clockwise, then the image is called B. If we want to register a and B, it is actually the process of determining the parameters 2, 3, 60, because once these three parameters are determined, I will know the ing between B and A. In other words, I will know which vertex corresponds to in a for any pixel in B.
Here, because I know that these two images only have translation and Rotation Transformations, the model we use is a rigid body transformation model (in actual situations, if you do not know what the two images are transformed, you can only speculate based on the location information of the image. Generally, the nonlinear transformation model is the most correct, but the maximum number of parameters ).
The similarity measurement criterion of registration is simple here (for example, it shows that the process is actually complicated in many cases ), the number of pixels for the two images after binarization prevails. That is to say, the group of parameters that make the two images overlap the most is the correct conversion parameter. Theoretically speaking, if the two images are strictly registered, it is clear that all their pixels overlap, otherwise there will be a wrong part.
The optimization method is too long. Any optimization algorithm is not clear in a few words. Use the traversal search method here.
Because three parameters need to be optimized, we traverse the space of the three parameters. For example, we can search for the number of translation pixels in the X direction from-100 to + 100, the step distance is 1 pixel. We also searched for the translation pixel in the Y direction from-100 to + 100, and the step distance is 1 pixel. We searched for the rotation angle from 0 to 360 degrees, the step distance is 1 degree. This means that we need to complete a 200*200*360 cycle, and then in each cycle, we will judge, the number of overlapping pixels of a image and B after transformation according to the parameters of the current loop, find the parameters used in the set of loops with the largest number of coincidence pixels in the 200*200*360 cycles. These parameters are what we want. If everything works properly, obviously, we will obtain the maximum number of overlapping pixels in the cycle of 2, 3, 60. The so-called optimization algorithm is actually a more intelligent way to get the 3, 3, 60 parameters.
This completes the registration process.

 

 

{
Logclickcount (this, 111 );
} "Href =" http://hi.csdn.net/bitsun1983 "target =" _ blank "> bitsun1983?
If yes, image alignment is used first to find the optimal transformation parameter (which is basically described above), and then calculate two image difference after the transformation, if the threshold value is smaller than a certain threshold value, it is a match. You need to experiment and find the threshold value yourself.
I will add:
1. Use sift with caution. You are similar to binary image. I don't think it applies to the sift algorithm. The extracted feature points should be unstable. In my personal experience, sift is suitable for normal gray image,
Appendix: There is no implementation of Sift in opencv. It is said that it should be because sift has been applied for a patent
2. The method to reduce the effect of brightness and contrast difference is very simple. image normalization is used to calculate the mean and STD of the image first, and then convert all pixel so that the final mean is 0 and STD is 1.
2. for image alignment, the recommended paper is: Lucas-kanade 20 years on: a unifying framework: Part1. The entire tr48 page is too long. I read only the first 10 pages and I used compositional algorithm, it is the slowest, but according to my experience, z is quite useful when the transformation is not very big (of course I am only used for normal gray image, theoretically, it is also applicable to approximate binary image ). It is applicable to the translation, scaling, and Rotation Transformations. Finding the optimal process is similar to finding the local minimum using the gradient of multi-variable function. However, if the conversion is too large, this method should not work.
3, about code, http://www.codeproject.com/KB/recipes/ImgAlign.aspx
Read the paper, and you can understand the code. Otherwise, you can read the tianshu.
Remark: if there are too many non-rigid transformations in the image, ignore all my recommendations.

 

1. Have you tried the sift algorithm? Although I highly doubt the applicability of Sift In such scenarios, if you have already tested it, You can roughly check whether the feature extraction is stable, if it is unstable, feature point vector extraction does not need to be considered.
2. Do you mean memory overflow? Is the out of memory error in MATLAB. I don't know what sift implementation you use, but I still feel that sift does not apply to such an image. Of course, I have no experience in this aspect, but if you are sure that the sift implementation you are using is credible, but the generated key point is tens of thousands, you should think of another algorithm.
3. There should be many false positives when Binary Image Subtraction is directly performed after matching. Maybe you should use morphological operation to remove some outliers. Of course, the specific problem is analyzed, I want to see the specific figure and give more detailed suggestions.

In any case, resize to a relatively small resolution for further processing. Otherwise, your feature points will be too many.
In short, you always need to experiment, view results, analyze, and make changes. It is hard to say that an algorithm can solve this problem.

 

 

{
Logclickcount (this, 111 );
} "Href =" http://hi.csdn.net/xq830210 "target =" _ blank "> xq830210: read several articles on Spie, IEEE, or springerlink, all algorithms for image registration are available on these pages.

 

 

{
Logclickcount (this, 111 );
} "Href =" http://hi.csdn.net/runley "target =" _ blank "> runley: surf algorithm opecv2.0.

 

{
Logclickcount (this, 111 );
} "Href =" http://hi.csdn.net/swimmingfish2004 "target =" _ blank "> cosine mingfish2004: Shi-Tomasi corner points feature + Lucas-kanade (optical flow)

Learning opencv, p318.
Harris's original definition involved taking the determinant of h (P), subtracting the trace of H (p) (with some weighting coefficient), and then comparing this difference to a predetermined threshold. it was later found by Shi and Tomasi [shi94] That good corners resulted as long as the smaller of the two eigenvalues was greater than a minimum threshold. shi and Tomasi's method was not only sufficient but in our cases gave more satisfactory results than Harris's method.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.