diff --git a/openbr/plugins/imgproc/synthesizekeypoints.cpp b/openbr/plugins/imgproc/synthesizekeypoints.cpp index c11cfcc..9ff68b8 100644 --- a/openbr/plugins/imgproc/synthesizekeypoints.cpp +++ b/openbr/plugins/imgproc/synthesizekeypoints.cpp @@ -155,10 +155,10 @@ class SynthesizePointsTransform : public MetadataTransform // Because not all triangulations are the same, we have to decide on a canonical set of triangles at training time. QHash counts; foreach (const Template &datum, data) { - const QList points = datum.file.points(); - if (points.size() == 0) - continue; + if (points.size() <= 4) + continue; + const QList< QList > triangulation = getTriangulation(points, getBounds(points, 10)); if (triangulation.empty()) continue; @@ -167,6 +167,9 @@ class SynthesizePointsTransform : public MetadataTransform counts[TriangleIndicies(indicies)]++; } + if (counts.empty()) + return; + triangles.clear(); QHash::const_iterator i = counts.constBegin(); while (i != counts.constEnd()) {