سؤال

As part of an Offline Handwriting Recognition program, i have a large set of hand written digits written by about 100 people of the numbers 0 to 9. Before getting the program to classify each of the images, i want to do a little pre processing to get them in a more standard form.

All the images are currently a 64x64 grid made up of 1s and 0s (0 for white, 1 for black), but due to the variance in handwriting styles, some numbers are bigger than others, some are positioned differently and some have odd slants (like people have drawn ones as diagonal lines)

I have already roughly figured out how to move them all to the same centre and get them roughly the same size, and i know that to correct the skew/slant i will need to rotate them by a certain amount. The problem is: How do i know what amount to rotate the images by? Is there some standard algorithm out there our resource i could be pointed to to figure it out?

هل كانت مفيدة؟

المحلول

I would look into applying a principal component analysis algorithm on the pixels of each image and that should give you the two main directions of the lines. You can then rotate according to the corresponding coordinate frame.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top