MATLAB: Image/Rectangle matching

image processing

Hi
I have a two image in which there is a fixed size rectangle on base image and I wanted to compare that rectangle with second scanned image.
I don’t know the position of rectangle in second image it might be skewd, scale or even tiled.
Does matlab has any function to compare rectangles and automatically scaled or deskew the second rectangle based on reference rectangle?
please help me out thanking you;

Best Answer

The question boils down to: "How can I find a rectangle in an image?" Once you have found the coordinates of the corners of the rectangles in the images, it is easy to find the transformation that maps one to the other, and apply it to one of the images.
How hard finding the rectangle is depends on what else is present in the image. It's hard to advise without knowing this. However, one approach worth exploring might be to use the Hough transform to find straight lines, and look for groups of these that satisfy some geometric conditions. The Hough transform is available in the Image Processing Toolbox.
Related Question