Title: Finding Polygons
1Finding Polygons with K edges in an image
written by Gidi Sidis
2Motivation
- This is one step further in Perceptual
Organization (after lines circles). - Automated machines can use this function in order
to scan images and identify pieces - Analyzing satellite or airplane images (searching
for buildings and etc)
3How can it be done ?
- Let the following image be our subject
And lets say we want to find all polygons with 4
edges.
4- The main idea is to find all the lines in the
image by doing edge detection and using Hough
Transform on the result.
edge detection
5hough transform result
6Lines found - marked on image
7- After all lines have been found we search for
each line the appropriate segment(s) in the
image. When done, we create a matrix of size
num_segments num_segments
neighborhood matrix of size 55
Segments found - marked on image
Comment There are 2 matrixes do to the fact that
a point is represented by (x,y)
8- For each segment i and segment j that intersect,
we update the matrix(i,j) to be the intersecting
point.
neighborhood matrix after updating
X
Segment 5
Segment 3
Y
(62,94)
Segment 2
Segment 1
Segment 4
9- Basically, we found a neighborhood matrix of all
segments which represents a graph where each
segment is a vertex, and each intersecting point
is an edge.
10- All that remains to be done is to scan the graph
for all circles of size K. Each circle is a
polygon of K edges in the image.
neighborhood matrix after updating
11Some problems in implementation
- The algorithm is highly sensitive to inaccuracy
(which is a side product of transforming from
continuous to discrete and vice versa), plus
there is numeric inaccuracy done by the cpu which
have a finite memory space. - The algorithm is sensitive to noise in the image.
- The problem of finding all circles in a graph is
a NP Hard problem.
12Some solutions to the problems
- For the first and second problem as stated
previously, the simplest solution is to use an e
environment for all numeric calculations that
deals with binary comparison (as in the case of 2
segments intersection and etc).
13- For the third problem, there is no simple
solution (if there was I would be a very rich
man), however, we are not scanning the graph
for all circles but only the circle of size K
thus we can block the running time to NK where N
is the number of segments found in the image
(notice that the number of segments is much
smaller than the number of edge point which by
them the Hough Transform runs).
14Some Conclusions points
- The problem of finding polygons in a complex
image, especially a noisy one, is fairly hard and
will not be treated well by this algorithm /
program, however this algorithm could be useful
and will give pretty good results for simple
images. - You can check out the implementation pseudo code
and more information in my final report at
www.cs.bgu.ac.il/sidisg/vision_project_report.doc
- You can check out the MatLab program which
implements the algorithm at www.cs.bgu.ac.il/sid
isg/find_polygons_program.zip
15more examples
The result of searching for all 4 edges polygons
16more examples cont.
The result of searching for all 3 edges polygons
17more examples cont.
The result of searching for all 5 edges polygons
18more examples cont.
The result of searching for all 4 edges polygons