c++ - OpenCV identify lines in this image -
i cannot apply houghlines transform opencv image posting. lines should oriented 15 degrees, results in lots of lines in several directions. how can this?!
this image.
yeah, hough won't apply here.. way many white pixels.
you can lines image processing. this:
- rotate image, lines vertical
- isolate each line.
rotate image
you can rotatedrect
using minarearect
of white pixels, , rotate original image knowing yourrect.angle
.
i suppose original image represents text. there lot of techniques in document analysis "rectify" image, i.e. correct skew.
isolate each line
you can use vertical (or horizontal) projection histograms. count number of white pixels each x (y) coordinate. can in opencv function reduce
giving argument cv_reduce_sum
. can identify spaces between lines histogram 0 (better apply small threshold). lines between 2 consecutive spaces.
hope helps!
Comments
Post a Comment