I have a binary image obtained from a canny edge detector. The edges are not nicely detected in the center and I need to join them. The connection of edges is orientation and neighborhood dependent. I need to connect the vertices if they are below a threshold (say less than 5 pixel distance). If my almost linear features are nicely oriented, this threshold should be relaxed. (This is the best case.)
I tried the Hough transform, but it didn't work for me because I don't have straight lines. Dilation and erosion are also not good; they make the images messier.
The approach I am trying is to first detect vertices and nodes (in MATLAB with bwmorph
) and then make leaves as a separate feature. This is done as follows:
- Scanning in a 3x3 window, look for neighbors.
- Traverse the complete connected object.
- Try to fit a line (or maybe a quadratic polynomial).
- Check feature-by-feature if it's worth a connection or not.
The implementation is not straightforward since the decision-making part where vertices need to be connected is tricky.
No comments:
Post a Comment