Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Line Thinning by Line Following

This repository contains an unofficial python implementation of the Line Thinning by Line Following (LF) described in "Pattern Recogniion Letters" by Orit Baruch (1988).

Original Paper

Line Thinning by Line Following [PDF] How would we, humans, perform line thinning? The most natural way is by following the line with our eyes, and marking the approximate center between the line edges. Sesing the global picture enables us to ignore noise and identify easily line ends. Why not make the computer do the same thing?

How does it work

  • The line-follower is called to follow each encountered line.
  • While following, the line follower erases the line in the input image and creates the skeleton in the target image.
  • The line following is based on two pointers and a dynamic window:

    LP A pointer to follow the left edge of a line
    RP A pointer to follow the right edge of a line
    W A rectangular window whose sides are parallel to the sides of the matrix
    d The distance of a point to a line is measured as usual by the length (in pixels) of the normal from the point to that line
  • When the follow identifies branching of the line, it calls itself recursively to follow each of the branches.

The process illustrated:

single-branch
(d=1)
two-branch
(d=1)
multi-branch
(d=1)

Usage

$ python thin.py --input ./data/no-branch.jpg -out output.jpg

License

This project is under the MIT License. See the LICENSE file for the full license text.

About

This repository contains an unofficial python implementation of the "Line Thinning" research paper

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages