Answers.Body: <p>It turned out that my intuition was not far off. The skeletonization is a good step. The Hough transform though is not a good way to create a graph of the roadmap. It seems that the Ramer–Douglas–Peucker algorithm can help out here. This algorithm first takes all the skeleton pixels as input, and sees this as a starting graph. The algorithm then proceeds to remove intermediary pixels that do not add information to the shape of the graph.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-05-08T13:32:50.390Z
Answers.LastActivityDate: 2020-07-07T07:42:36.663Z
Answers.LastEditDate: 2020-07-07T07:42:36.663Z
Answers.UserDisplayName: spdrnl
Body: <p>What would be the best way to create a vector representation of roadmap like scans? The goal I am trying to achieve is illustrated below. The left side represents the source image, the right side the output in the form of three vectors. The fussiness on the left is a simulation, not the actual source image:</p>
  
  <p><a href="https://i.sstatic.net/9l7B3.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/9l7B3.png" alt="enter image description here"></a>  </p>
  
  <p>The actual source image would look more like:</p>
  
  <p><a href="https://i.sstatic.net/qYV42.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/qYV42.jpg" alt="enter image description here"></a></p>
  
  <p>Currently I am looking at a combination of skeletonization and Hough transform. The result is rather messy though, and seems to warrant quite some extra engineering. Any other suggestions?</p>
  
Tags: <image-processing><image-segmentation>
Title: How to create vector representation of roadmap like scans
UserDisplayName: spdrnl
ThreadText: # How to create vector representation of roadmap like scans
  
  (Asked by: username_0 on 2020-05-07)
  
  What would be the best way to create a vector representation of roadmap like scans? The goal I am trying to achieve is illustrated below. The left side represents the source image, the right side the output in the form of three vectors. The fussiness on the left is a simulation, not the actual source image:
  
  [![enter image description here](https://i.sstatic.net/9l7B3.png)](https://i.sstatic.net/9l7B3.png)
  
  The actual source image would look more like:
  
  [![enter image description here](https://i.sstatic.net/qYV42.jpg)](https://i.sstatic.net/qYV42.jpg)
  
  Currently I am looking at a combination of skeletonization and Hough transform. The result is rather messy though, and seems to warrant quite some extra engineering. Any other suggestions?
  
  **Tags:** image-processing, image-segmentation
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2020-05-08. Score: 1
  
  It turned out that my intuition was not far off. The skeletonization is a good step. The Hough transform though is not a good way to create a graph of the roadmap. It seems that the Ramer–Douglas–Peucker algorithm can help out here. This algorithm first takes all the skeleton pixels as input, and sees this as a starting graph. The algorithm then proceeds to remove intermediary pixels that do not add information to the shape of the graph.
  
  
  ---
  
  