简体   繁体   中英

Corner detection by points location or image

I have some simple shapes which shapes are not necessarily regular. 在此处输入图片说明

I need an algorithm to find their corners, actually i want to summarize their points to minimum, to saving them in dxf format and I have their points location in array. Simple algorithms like harris or surf do not find proper points and return too much points as result. Can u please help me to solve this problem by algorithm or idea or code? (in c, c#,java ,...) or image processing thanks in advance.

What you want to achieve is called polygon vectorization .

In the first place, you need to apply a contour following algorithm to get the pixels in sequence. In this case, it seems that simply linking the pixels to their neighbor will do (beware that in your sample some of the shapes are open and you probably have to extend the neighborhoods to twoor three pixels.

Then detect the long straight edges by means of the Douglas-Peucker algorithm ( https://en.wikipedia.org/wiki/Ramer%E2%80%93Douglas%E2%80%93Peucker_algorithm ) or similar.

Some of your corners are blunt and you may want to put them right. I would suggest to discard the sequences of short segments forming flat angles and join the long adjoining segments to restore square corners.

在此处输入图片说明

在此处输入图片说明

Don't expect "perfect" results.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM