Is there any algorithm to find the locations of rectangles in an image?
Show older comments
Hi
I have two images - on both the images i have some(same in both) nos of small rectangles.
I call one image to be base image and other to be row image(scanned).now i have the rectangles locations on the base image(used as a template) i want those rectangles locations on the row image (that is variable) means,
The row image might be skewed,waved or tiled. is there any algorithm available in MATLAB that can help me to find the rectangles on an image.
Please help me..
Thanking You
Accepted Answer
More Answers (1)
Sriram
on 25 Jul 2012
0 votes
Your question has to be in more clearer way! Up to my understanding - (Aim) You are trying to figure out the rectangles from a image - what you tried is using a template or pattern match with a known image!!. I don think so you need to go for correlation!
I would suggest you to use "regionprops" -which can measure the properties of image regions
2 Comments
meghna bhatt
on 25 Jul 2012
Sriram
on 25 Jul 2012
As you said regionprops doesn't gives the exact location. Using the below function after creating a template of the rectangular box, the position could be find !
normxcorr2 (template,original image)
the position of the rectangle which you required is found to be [34,31]
And are you going to use the same format/kind of OMR sheet ? If so check manually for the position in mm and based on the image size you can calibrate mm in pixels - allowing - automatically mark the position for different image provided the same format of OMR sheet is used! This would be the simplest way n will work better too !
Categories
Find more on Region and Image Properties in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!