[Computer Vision] Rigid Registration

YeongHyeon Park
3 min readNov 27, 2020

--

Sometimes, we want to compare two images, taken at two different moments. Even if those were shot at different angles or different scales.

In this post, the simple method, for matching two images to very similar conditions, will be handled. The above method called ‘Rigid Registration’.

Target

The target image for registration is the following. The image is provided from the misc of the ‘scipy’ package.

Target image for Rigid Registration

Now, we have got one image as a target but we do not have the source image. So, we generate an arbitrary source image by transforming the target image. As shown in the following figure, a generated source image is placed.

Generated source image, target image, reversed source image (from generated source image), and the difference value (between the reversed source and target image) sequentially.

For generating the source image, two variables scale and rotation are used. Thus, the goal for successful rigid registration is to find the optimal scale and rotation value.

Method

How to find the optimal values? The simple answer is linear searching.

First, generate the linear space for each variable (scale and rotation). In this post, the ranges of scale and rotation are 0.05 to 2.0 and 0° to 360° respectively.

After generating the linear space, just apply them to the source image and measure the distance (eg. Mean Squared Error) to the target image for each spot. Then, finding the optimal spot by the minimum distance in linear space.

Note that, we can conduct scaling and rotation via the python package ‘scipy’ easily. Refer to the URLs for each function scaling and rotation.

The surface plot, with two viewpoints, of the mean squared error (MSE) shows. The lowest point of the surface means the optimal point for registration.

Confirmation

When you find an optimal spot for registration, the confirmation process is needed. Extract two variables scale and rotation from the optimal point and apply them to the source image.

Since the corners of the image discarded during the rotation and scaling processes, the results are compared using the center (remained region) that has not disappeared.

Source image, target image, source image after registration, and the difference value (between the image after registration and target image) sequentially.

In this post, we looked at a simple rigid registration. If you deal with various variables such as shift, you can achieve a more accurate registration result. Moreover, there is an additional method called non-rigid registration.

--

--

No responses yet