Boost logo

Boost :

Subject: Re: Hysteresis step in Canny edge detection
From: Mateusz Loskot (mateusz_at_[hidden])
Date: 2019-03-15 16:13:13

On Tue, 12 Mar 2019 at 15:32, Olzhas Zhumabek
<anonymous.from.applecity_at_[hidden]> wrote:
> I'm trying to implement Canny edge detection for the coding competency test
> of Boost GSOC. So far I managed to apply Gaussian Blur, apply Sobel filters
> in both directions, and performing non-maximum suppression (it didn't
> eliminate thick edges though). I'm unsure how to perform hysteresis.
> My initial idea is as following:
> 1. Perform first pass and label definitely edge pixels and definitely not
> edge pixels.
> 2. Imagine the picture is a graph, and only certainly edge and uncertainly
> edge can be walked over through adjacent pixels.
> 3. Gather each pixels into corresponding connected components by performing
> BFS over all non-visited pixels
> 4. For each connected component, try to find at least one definitely edge.
> 5. If outcome of 4 is true, set max intensity for all pixels in the
> connected component, set zero otherwise.
> Is there a better algorithm? I couldn't find any while searching the web,
> and my knowledge of graph theory allowed me to come up only with the
> algorithm above.

FYI, someone has just proposed the Canny edge detector,
have a look at the proposed implementation at

Best regards,

Mateusz Loskot,

Boost list run by Boost-Gil-Owners