The chain code generation works as follows.
Load prepocessed image |
Clean image |
Create point coordinates |
Then the starting point of the line has to be found. It can be done by simply examining the edges of the picture. Then the algorithm simply walks through the line and returns point coordinates. Not all points are reported, only points after a certain step, for example every 10th point.
(5,12), (12,34), (43,54), ...
Chain code generation |
step_length, rotaion_angle, step_length, rotation_angle, ...The calculation is the following:
Then this path can be drawn with different scale and rotation
Implementation details |
[ Main | Previous: Step 1 - preprocessing | Next: Step 3 - detection ]