Primitive text direction feature detector

Simple and slow text direction feature detector.
Can work pretty reliable with text shreds without lines and handwritten text.

Probably we should use some simple algo to find extrema here?