opencv - A good approach for detecting lines in an image? -
i've written code uses opencv libraries detect white lines painted on grass. need someone's opinion on approach used (as i'm sure there's better way mine). also, results i'm getting not expected because slight variations in image require tweaking parameters (and need operate on fixed parameters).
my approach far:
- grab image webcam (and turn grayscale obviously)
- run through threshold filter (using thresh_to_zero mode, zeros out pixels below threshold value).
- blur image
- run through erosion filter
- run through canny edge detector
- finally, take processed image , find lines using probabilistic hough transform houghlinesp
should change sequence of filters?
p.s. i'm not concerned processing power; i'm running houghlinesp on gpu b-)
also, here sample image:
the results i'm getting: canny without canny (slightly tweaked parameters)
any or guidance appreciated! have no idea improve it!
update after using quick skeleton implementation (with tons of blur) per chosen answer, got this:
i try use skeleton representation of image. problem canny, here, results in 2 lines because of width of line.
then apply hough transform on it.
Comments
Post a Comment