diff --git a/README.md b/README.md index 67e4d2d..8173a33 100644 --- a/README.md +++ b/README.md @@ -6,19 +6,24 @@ The following is a simple pure python implementation of forward addative registr # Simple example : -import LKForwardAddativeImageReg as LKReg +```python +from LKReg import LKForwardAddativeImageReg as LKReg import cv2 - -#load images + ``` +##### Load images +```python fixed = cv2.cvtColor(cv2.imread('fixed.png'), cv2.COLOR_BGR2GRAY) moving = cv2.cvtColor(cv2.imread('moving.png'), cv2.COLOR_BGR2GRAY) - -#perform registration +``` +##### Perform registration +```python tforms, deltas = LKReg.iterativeReg(fixed, moving, niter = 150, npyramids = 2) - -#show before and after +``` +##### Show before and after +```python LKReg.imshowpair(fixed,moving,tforms[0], figureTitle = 'before') LKReg.imshowpair(fixed,moving,tforms[-1], figureTitle = 'after') +``` # In depth : This module allows for fast, subpixel accurate, robust registration. It essentially performs stochatic gradient decent using a first order taylor polynomial aproximation of the gradient. This is very similar to whats found in cv2 / matlab imregister. The ECC ( enhanced correlation coefficient ) algorithm is also implemented which adds robustness and reduces the numbers of needed itterations. This registration can use pyramiding ( or not - npyramids = 1 ) to deal with relatively large transformations. The registration is homography only ( no affine, translation, similarity ...etc options ( yet )).