MATLAB Answers


How to perfectly align 2 scanned multiple choice paper images?

Asked by Vic
on 11 Jan 2013

I there a way somehow to align 2 scanned multiple choice paper images? Maybe by using a bar code to auto align them or using a specific shape so i can compare or find the differences in the answers between the two papers?

Thanking you in advance.


Log in to comment.

1 Answer

Answer by Image Analyst
on 11 Jan 2013

Yes. See the imregister() function in the Image Processing Toolbox.


ok but I want to aligh this image to he same position and alignment of this image ( ). I tried the code you have suggested by doing this : fixed = imread('aligned image'); moving = imread('wrongly aligned image');

... but i get some errors

Error using imregister>parseInputs (line 189) Argument 'MovingImage' failed validation with error: Expected input number 2, moving, to be two-dimensional.

Error in imregister (line 92) parsedInputs = parseInputs(varargin{:});

Error in Untitled12 (line 11) movingRegistered = imregister(moving,fixed,'rigid',optimizer,metric);

Any ideas?

Convert the images to grayscale before aligning them.

The alignment will probably be the same on a monochrome image as if you could do it on a color image. Just apply the transform you get to all three color channels one at a time and recombine into a color image.

Log in to comment.

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today