# What is the best way to detect lines or corners from possibly wavy handwritting?

I didnt know how to best word my title but I will try to explain it here. It is pretty simple, for example if I have a hand drawn square root symbol, for the most part it is made up of 3 lines.

If somone uses a ruler, I could easily get 3 lines extracted from the image, but the problem is that sometimes the lines will be quite wavy, like the above though that is a more exaggerated case. Does anyone know of a way I can get lines or even the corners from something like this, or should I just use my character classifier for these types of symbols too. I was able to use hough lines to detect a dash without using a classifier by just looking at the horizontal vs vertical lines but this is a bit more complex. (As far as I know)

Thanks for any suggestions, I know its maybe an unusual question.

Edit: In case this is of interest to anyone else: Using Mostafa Stataki's answer, I was able to acheive the following result with an extremely wavy square root symbol and a very high epsilon of 50 in approxPolyDP :

I couldn't have imagined a better result!

edit retag close merge delete

Sort by ยป oldest newest most voted

You can use approxPolyDP(Douglas-Peucker algorithm) for line approximation. You can use this sample. The best solution for solve this problem create skeleton of image then approximate skeleton by Douglas-Peucker algorithm.

more

Wow thanks +1 for using my answer from another question! And it worked great!

( 2012-12-30 10:37:37 -0600 )edit

Official site

GitHub

Wiki

Documentation