Coastline Matching Algorithm

Step 2 - chain code generation

[ Main | Previous: Step 1 - preprocessing | Next: Step 3 - detection ]

The chain code generation works as follows.

Load prepocessed image
We start from preprocessed images.

Clean image
The preprocessed image is cleaned from errors, and noise caused by texts on the map. If we assume satellite images this step can be omitted. The process is made by hand, because the lack of time, though it could be done automatically.

Create point coordinates
First a thinning algorithm is used.

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
From the point list the chain code is generated directly. The format of the chain code is the following:

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 ]