Image/Rectangle matching
6 ビュー (過去 30 日間)
古いコメントを表示
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;
0 件のコメント
採用された回答
David Young
2011 年 6 月 14 日
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.
5 件のコメント
David Young
2011 年 6 月 15 日
Thanks - it's easier to understand the problem now. I see that the rectangles are clearly visible.
My recent suggestion in a comment above, of using affine optic flow matching, is not a good idea - you can forget that one.
My original proposal, to use edge detection followed by the Hough transform, followed by finding the intersections of the most prominent lines, might work. Once you've found the rectangle corners in the two images, you can use maketform and imtransform to align the images.
However, as the rectangles are very dark and have thick boundaries, it might be simpler to find them by thresholding, and then using regionprops to (a) find the largest region and (b) find its extrema. It may even be that the extrema of the region will give you adequate corner coordinates. I would try this approach first, before going to the Hough transform, as it is simpler.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Image Segmentation and Analysis についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!