From dc0245af05f43a966108f666f928aece6deb717c Mon Sep 17 00:00:00 2001 From: Davis King Date: Fri, 27 Oct 2017 19:29:52 -0400 Subject: [PATCH] Changed graph construction for chinese_whispers() so that each face is always included in the edge graph. If it isn't then the output labels from chinese_whispers would be missing faces in this degenerate case. --- examples/dnn_face_recognition_ex.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/dnn_face_recognition_ex.cpp b/examples/dnn_face_recognition_ex.cpp index 051ac13cf..4c0a2a02b 100644 --- a/examples/dnn_face_recognition_ex.cpp +++ b/examples/dnn_face_recognition_ex.cpp @@ -142,7 +142,7 @@ int main(int argc, char** argv) try std::vector edges; for (size_t i = 0; i < face_descriptors.size(); ++i) { - for (size_t j = i+1; j < face_descriptors.size(); ++j) + for (size_t j = i; j < face_descriptors.size(); ++j) { // Faces are connected in the graph if they are close enough. Here we check if // the distance between two face descriptors is less than 0.6, which is the