2 ms·
My immediate thought was to do a hough transform. The equation for rectangles has very few parameters and finding "complete" rectangles at any given point would
by sinjax 15y ago
My immediate thought was to do a hough transform. The equation for rectangles has very few parameters and finding "complete" rectangles at any given point would fast, though slower than this technique in honesty
the bonus of the hough transform approach is that you'd get ALL the complete rectangles. Also you could (optionally) get the biggest rectangle which is almost complete (let's say missing one or two pixels). Which is nice in the practical case when you are looking for shapes because "noise is a bitch"
word.
- willvarfar 15y agoWhat jumped to my mind is that if you detect the vertical and horizontal lines - O(n) - and call those corners 'm'. You can then just run the O(n^2) bit on m rather than the whole n. Worst case n=m, but usually m will be massively smaller. http://stackoverflow.com/questions/289779/calculating-a-boundary-around-several-linked-rectangles/294549#294549 http://stackoverflow.com/questions/289779/calculating-a-boun...