algorithm - Trace a shape into a polygon of max n sides -
I am looking for an algorithm that will get an irregular shape, probably not random, such as the crushing cycle Detects a polygon of maximum N sides around the surface, and around the shape. 'N' can be based on the area of maximimum size.
I will do it like this For this you or Find Invex Point (Black) Code> is changing at these points Then but you need to handle the code> dang = 0.0 element properly (before and after it needs to be scanned). Add maximum number (green) to these points This point will be a fundamental skeleton for your point Tangent angle is among the closest differences, in order to find the maximum point between the index number Do not forget that then Now You should have all the important points of your closed polycurve ... It should look like this: CW / CCW or red / blue bus The output point type must be protected (Inks / MaxPoint) because it is used to compare and detect the shapes later on. A used ...
dang for all curve segments, measure tangent angles
atan2 Can use
ang [i] = accent (x [i] -x [i-1], y [i] -y [i-1]); Dang [I] = Ang [Ii] -ang [I-1];
Dang
Dang [i-1] * Dang [i + 1] is & lt; 0.0
i0 and
i1
the nearest angle to angavg Find = 0.5 * (ang [i0] + ang [i1])
| Ang [i] -gang & Lt; = PI
+/- 2.0 * PI if this is not true
dang [ii] ... [Notes]
Comments
Post a Comment