Ask Your Question

A question about registration function in Opencv2.4.2

asked 2012-07-17 04:45:54 -0600

Guobiao gravatar image

You know that the registration is about a pair of image was superimposed on the other image based on a perspective transformation model,or it is equivalent to the image fusion. Now I used the function of findHomography,but I don"t know what should be do next? Any friend would like to help me?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2012-07-17 05:57:20 -0600

Michael Burdinov gravatar image

First lets make some order with terminology:

  1. Registration process is not always performed between 2 images. It can be image to set of points, or image to set of polygons, or set of points to set of points, and so on.

  2. It is not limited to just perspective transformation. It can be simple shift, or rigid transformation, or similarity transformation, or affine transformation, or ellastic transformation, and so on and so forth. They may have some restrictions. Amount of possible transformation is countless.

  3. One of most popular approaches for registration (but not the only one!) is extraction of points of interest from both images and then finding transformation that creates good match between them. There countless ways to extract those points, countless ways to find good match, and even countless ways to define what is the good match. Purpose of findHomography function you mentioned is to find good perspective transformation between two sets of points. Are you sure that is what you need?

  4. If you are talking about superimposition of images, you will also need function to transform one of the images, and another one to stitch the results.

OpenCV has very rich repository of algorithms to help you in all those stages:

You can use matchTemplate() to find good shift between images.

You can use FAST, ORB, MSER, FREAK to find points of interest and their descriptors.

You can use this for stitching, or this for image transformation.

Those are just a small part of functions that might help you. Whole list will be just too long. If this is the first time you are dealing with registration I recommend you to check books about the issue first, and to decide how you want to solve your problem. Without that it will be impossible to choose right tools from OpenCV.

edit flag offensive delete link more


is there any code is available that will help me and most of the peoples

wasi069 gravatar imagewasi069 ( 2013-02-13 19:49:35 -0600 )edit

I guess you can start with tutorials at This section is not the most updated one but hopefully it will help you to start your projects.

Michael Burdinov gravatar imageMichael Burdinov ( 2013-02-14 01:33:01 -0600 )edit

answered 2012-07-18 04:42:04 -0600

Rui Marques gravatar image

Michael Burdinov already did a very complete answer.

The short answer for the question "What to do after findHomography?" is: use warpPerspective.

Assuming that you used one of the interest point detectors (FAST, ORB, MSER, FREAK) on both images and then findHomography on the resulting points.

Your next step is to use warpPerspective on one of those images. It will transform the image with the transformation matrix estimated by findHomography.

edit flag offensive delete link more


I am aware that Michael Burdinov already mentioned warpPerspective. This answer is to clarify that point a bit.

Rui Marques gravatar imageRui Marques ( 2012-07-18 04:43:10 -0600 )edit

Question Tools


Asked: 2012-07-17 04:45:54 -0600

Seen: 3,749 times

Last updated: Jul 18 '12