Reputation: 371
Here i am trying to trace lines from image. i used below steps
here i am getting vector lines at the both sides of edges of line. but i want to generate a single vector line at the middle of each line.
Any one one help me how to do this.
below is the result i got.
Upvotes: 0
Views: 888
Reputation: 495
One approach is to use a thinning algorithm. A thinning algorithm basically takes a thick line and finds the middle (depending on the impelmentation) so you're left with a single line.
So you'd do something like this.
Here are a few links on thinning. They're not OpenCvSharp but could be ported.
Answers.OpenCV
OpenCV-Code Blog by Nashruddin Amin
http://opencv-code.com/quick-tips/implementation-of-thinning-algorithm-in-opencv/
http://opencv-code.com/quick-tips/implementation-of-guo-hall-thinning-algorithm/
Upvotes: 1