问题
I've tried an open source java implementation of Canny Edge. I only need the boundary (the outline) of the image but there are extra lines in the output. Is there any way I could remove those lines after using Canny Edge (is there another algorithm)? Or are there other ways I could modify the program such that it will only detect the outline?
I've tried this one.
回答1:
If the outline you are looking for is a single "long" connected line, you could filter out "short" lines.
One way to do it would be by computing the area of those lines with a connected-component labeling algorithm and keeping only the line with the largest area (i.e. largest number of pixels).
来源:https://stackoverflow.com/questions/13190636/boundary-detection-after-canny-edge