2

I need to obtain something like is shown on these pictures:

enter image description here enter image description here

I think it's relative to medial axis transform, but I need vertical or horizontal lines only. any suggestions?

casperOne
  • 73,706
  • 19
  • 184
  • 253
mrgloom
  • 20,061
  • 36
  • 171
  • 301

1 Answers1

1

Thinning should work, though in standard implementations it's hard to enforce desired directions (vertical or horizontal here).

Matthias Odisio
  • 2,038
  • 12
  • 19
  • Yes, thinning works(I use Zhang-Suen algorithm), but I want to have only horizontal and vertical lines. I think maybe I must to obtain all posible lines in blob and then to solve some optimisation problem? – mrgloom Mar 05 '12 at 06:21
  • I try to do median filtration->otsu threshold->Zhang-Suen thinnning->some filtration of skeleton->straightening of skeleton(fitting connected segments to lines) but maybe I just need to fit straight lines just in blolbs? – mrgloom Mar 07 '12 at 08:49
  • Your question is an interesting problem. For now I'm sorry not to be of further help. Recasting as an optimization problem might be very expensive. – Matthias Odisio Mar 07 '12 at 10:38