for each edge pixel P {
classify its pixel type using masks
case
1. isolated point : ignore it
2.
start point :
make a new segment
3. interior point : add to current segment
4.
end point :
add to current segment and finish it
5. junction or corner : add to incoming segment
finish incoming segment
make new outgoing segment(s)