diff --git a/modules/core/src/image/vpCannyEdgeDetection.cpp b/modules/core/src/image/vpCannyEdgeDetection.cpp index d93b0a636a..274ba7f6b6 100644 --- a/modules/core/src/image/vpCannyEdgeDetection.cpp +++ b/modules/core/src/image/vpCannyEdgeDetection.cpp @@ -464,8 +464,10 @@ vpCannyEdgeDetection::performEdgeTracking() if (it->second == STRONG_EDGE) { m_edgeMap[it->first.first][it->first.second] = 255; } - else if (recursiveSearchForStrongEdge(it->first)) { - m_edgeMap[it->first.first][it->first.second] = 255; + else if (it->second == WEAK_EDGE) { + if (recursiveSearchForStrongEdge(it->first)) { + m_edgeMap[it->first.first][it->first.second] = 255; + } } } }