Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
After Image registration?

Subject: After Image registration?

From: Lulu Ardiansyah

Date: 18 Jan, 2010 15:15:06

Message: 1 of 6

I try to perform image, using algorithms as listed on Wikipedia (http://en.wikipedia.org/wiki/Image_registration). There were some questions about it, namely:
[-] I managed to find the delta x and delta y, then what should I do with that information?
[-] How do I combine several images into one image in MATLAB?
[-] If I use three images or more. how to register your image?
Previously I thank you for your response.

Subject: After Image registration?

From: Lulu Ardiansyah

Date: 19 Jan, 2010 07:16:04

Message: 2 of 6

"Rob Campbell" <matlab@robertREMOVEcampbell.removethis.co.uk> wrote in message <hj216m$kj7$1@fred.mathworks.com>...
> Firstly, if you want specific and detailed help you need to be more explicit in what you're trying to achieve. Your current questions are rather vague. More specific details on what you're trying to achieve would help.
>
> You say you calculated the deltas. I guess these refer to translation shifts. In which case you could create a matrix of zeros larger than your images and insert your images into the center plus the offset due to the deltas. Also see help padarray. May be useful if you want to overlay one image onto another but with an offset.
>
> > [-] How do I combine several images into one image in MATLAB?
> I'll assume the images are all the same size and that you want to overlay them rather than tile them. In which case you could make sure they are all normalised the same way then add them up and divide by the number of images. Very simple.
>
> > [-] If I use three images or more. how to register your image?
> I would choose one image as the baseline and register everything with respect to that. If noise is a concern you could choose the mean of several images and register to that.
>
> Finally, you will probably find this useful:
> www.mathworks.fr/matlabcentral/fileexchange/21451
>
> You don't say what sort of images these are. You may find this useful:
> www.mathworks.fr/matlabcentral/fileexchange/26322-mat2im

Sorry if my question is not clear, but I mean the same as your assumptions.
Yes, I want to find the value of translational shift in the existing method (http://en.wikipedia.org/wiki/Image_registration) and Extension of phase correlation to subpixel registration. (Foroosh, H., Zerubia, Berthod J. B.).

Maybe I'll ask again, now I will try your suggestion.

Oh, one more may be on the out-off-topic, am I allowed to upload the results of the implementation of a paper (Extension of phase correlation to subpixel registration (Foroosh, H., Zerubia, Berthod J. B.)) here? Because I am not sure of the implementation, and whether not violate rights? I think if I upload the implementation will be in response or even improved by others.

You have been very helpful, thank you very much. :)

Subject: After Image registration?

From: Rob Campbell

Date: 19 Jan, 2010 13:00:24

Message: 3 of 6

"
> Oh, one more may be on the out-off-topic, am I allowed to upload the results of the implementation of a paper (Extension of phase correlation to subpixel registration (Foroosh, H., Zerubia, Berthod J. B.)) here? Because I am not sure of the implementation, and whether not violate rights? I think if I upload the implementation will be in response

Research papers are public domain and if you've generated an implementation of an idea, then I'd say you're free to do as you like. The code sounds like it could be of general use so go ahead and send it to the file exchange.

Subject: After Image registration?

From: ImageAnalyst

Date: 19 Jan, 2010 13:32:43

Message: 4 of 6

Like Rob says, if someone publishes something then they pretty much
expect people to implement their idea. Otherwise, why publish? - just
keep it a trade secret. They might even hope that people do or even
be excited to help you. So even though their actual paper is
copyrighted, you own your implementation of that algorithm. People
test other people's algorithms and publish results all the time -
virtually every paper out there compares their work to the work of
other prior papers. There are very few cases where someone has
patented an algorithm, for examples, GIF, LZ compression (both now
expired), SIFT - http://en.wikipedia.org/wiki/Scale-invariant_feature_transform),
etc. And some pundits are questioning whether those will survive
after the Bilski case now in the US Supreme Court (http://
en.wikipedia.org/wiki/Bilski). Just check with the authors if you're
unsure.

Subject: After Image registration?

From: Lulu Ardiansyah

Date: 21 Jan, 2010 04:23:02

Message: 5 of 6

I still can not able to combine the images. The value of delta X and delta Y was very small, less than 1 pixel. How do I overlay them? Is there any code to perform this?

This is the code I use to get delta X and delta Y:

%===Start code===
clc
numImage = 4;
foldersName = 'dataset_30db';
fileNames = 'testimage.bmp';
%===Load base image=================
fileName = ['result_' int2str(1) '_' fileNames];
fullName = fullfile(foldersName, fileName);
baseImage = imread(fullName);
baseImage = rgb2gray(baseImage);
%===================================
dxs = zeros(1, numImage-1);
dys = zeros(1, numImage-1);
%===================================
for i=2:numImage
    %===Load target image===============
    fileName = ['result_' int2str(i) '_' fileNames];
    fullName = fullfile(foldersName, fileName);
    targetImage = imread(fullName);
    targetImage = rgb2gray(targetImage);
    %===Do phase correlation============
    [dxs(i-1), dys(i-1)] = ExtPhaseCorrelation(baseImage, targetImage);
    %===================================
end
%TODO next is combine the image based on dxs and dys
%===End code===

File 'ExtPhaseCorrelation.m' I've upload, please be downloaded at
( http://www.mathworks.com/matlabcentral/fileexchange/26417 )

Thank you for your help.

Subject: After Image registration?

From: Rob Campbell

Date: 21 Jan, 2010 05:19:04

Message: 6 of 6

Personally, when I've done this sort of thing I round to the nearest pixel. I have so many other problems with my images that if it's out by less then I pixel I'm happy. There are probably clever ways involving anti-aliasing of achieving sub-pixel resolution but this might not be necessary in practice.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us