how can i perform a registration to 2D images using ''rigid " transformation in matlab?
A rigid, or isometrie transformation, is a transformation in which the distances between the points that are transformed, are preserved. This means that an object formed by these points will have the same shape and size after transformation. Examples are rotations and translations. 

A 2D column vector can be rotated by $\theta$ as follows:

$\left(\begin{array}{c}x' \\ y'\end{array}\right) = \left ( \begin{array}{cc} \cos \theta &amp; - \sin \theta \\ \sin \theta &amp; \cos \theta \end{array} \right ) \left(\begin{array}{c}x \\ y\end{array}\right)$

In your case you will probably be seeking a combination of rotation and translation between two images meaning that the relation between the points of these images can be defined as follows:

$\left(\begin{array}{c}x' \\ y' \\ 1\end{array}\right) = \left ( \begin{array}{ccc} \cos \theta &amp; - \sin \theta &amp; t_x\\ \sin \theta &amp; \cos \theta &amp; t_y \\ 0 &amp; 0 &amp; 1 \end{array} \right ) \left(\begin{array}{c}x \\ y \\1\end{array}\right)$

Or short:

$\textbf{x}' = \textbf{A}\textbf{x}$

This particular transformation has 3 degrees of freedom, one for rotation and two for translation. This means that you can solve this matrix for 2 point correspondences $\{ \textbf{x}' \leftrightarrow \textbf{x} \}$. That means in your case that you need two points in the original image and two matching points in the distorted image to ascertain the translation and rotation between them.

Ultimate reference: Multiple View Geometry

EDIT

The deformation between these images is obviously not an isometrie. For one the branches appear and disappear between them. I played a little with a slightly more involved form of feature based registration based on the assumption that the distortion is a similarity transform with 4 degrees of freedom, and the features will make up for the difference in edges. In short:


SIFT feature detection and matching
RANSAC estimation to detect inliers
Direct Linear Transform (DLT) variant for estimation of scale and rotation
Run of the mill cross correlation to detect the translation


Results, not brilliant, but here goes





All code on Github, demo file is so_13_02_2012.m.