Code covered by the BSD License  

Highlights from
Autoposition

5.0

5.0 | 2 ratings Rate this file 16 Downloads (last 30 days) File Size: 2.18 KB File ID: #3911
image thumbnail

Autoposition

by Nathan Childress

 

29 Aug 2003 (Updated 02 Sep 2003)

Autoposition automatically registers two images

| Watch this File

File Information
Description

AUTOPOSITION automatically registers two images.

[image1 image2] = AUTOPOSITION(image1, image2) will register image1 to image2. Image2 must be smaller in both dimensions than image2. Image1 is cropped to image2's size, and image2 may be cropped if it is found to lie outside of image1. Most of the code is taken from an Image Processing Toolbox demo, but some extra lines have been added for
robustness. Both images must be grayscale images.
[image1 image2 offset] = AUTOPOSITION(image1, image2) returns the offset generated by the normxcorr2 function.
 
Example:
---------------
% If you have the IP Toolbox 4.0, you may have to change the TIF
% extenstions to PNG
im1 = imread('bacteria.tif');
im2 = im1(50:170, 100:150);
figure, subplot(2,2,1), imagesc(im1, [0 239]), title('Original')
axis image
subplot(2,2,2), imagesc(im2, [0 239]), axis image, title('Cropped')
[im3 im4 offset] = autoposition(im1, im2);
subplot(2,2,3), imagesc(im3, [0 239]), axis image, title('Aligned')
subplot(2,2,4), imagesc(imsubtract(im4,im3), [-5 5]), axis image, colorbar
title('Difference of registered images');
offset

Required Products Image Processing Toolbox
MATLAB release MATLAB 6.5 (R13)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
27 May 2004 jonathan haffarei

good documentation.
Quite precize.(0.1 pixel)
Simple interface.

07 Jul 2004 Mike Jung

This is an excellent function you made. I have one question, what type of registration technique does this function use? I looked at the code but I wasn't able to figure that one out. It doesn't look like mutual information. What is it?

29 Sep 2008 kinor kinor

the method used is normxcorr2, normalized crosscorrelation

the result can only pjrovide pixel accuracy as there is no further step or am I missing something?

18 Aug 2010 Rob Campbell

Kinor, you're right. You want submission #18401

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
geometric transformation Nathan Childress 22 Oct 2008 07:06:58
image registration Nathan Childress 22 Oct 2008 07:06:58
positioning Nathan Childress 22 Oct 2008 07:06:58
image processing Nathan Childress 22 Oct 2008 07:06:58
autoposition Nathan Childress 22 Oct 2008 07:06:58

Contact us at files@mathworks.com