I have an image which is composed of multiple 'angles' which form a grid shape:
After some searching, Hough seemed like a good fit, because it isn't troubled by breaks in lines. However, the problem I have is that my lines are 'fat', and any edge detection I run (Canny in this case), picks out the edges of the line, and not the middle:
This means that the Hough transform ends up picking out one (or both) of the 'sides' of my grid lines, and not the middle.
Given that I know what I'm looking for (this grid-like shape, always in roughly the same orientation), is there a better way to perform the 'edge detection' part to give me the centre lines, or should I be looking at a totally different method?
Answer
The Hough Transform would indeed help in picking up the Grid in this case. To "thin" the lines, you might want to consider the operation of Skeletonization
That would produce an image like this one:
Due to the way that skeletonization works, it will still produce some lines that will seem irrelevant to the grid but these lines towards "erroneous" directions are not that many (at least in the given image) to confuse the line detection of the Hough Transform too much and it will clearly pick the two main sets of lines at distinct directions. (Here is how the HT output looks like: )
If you are using MATLAB, you might want to check this help page
No comments:
Post a Comment