Commit a0e864ec3fa60b448fc9c86e64fc7565e0b02cd3
1 parent
ca4e68e3
Points/rects are properly written to sigsets
Showing
1 changed file
with
12 additions
and
2 deletions
openbr/core/bee.cpp
| @@ -97,11 +97,21 @@ void BEE::writeSigset(const QString &sigset, const br::FileList &files, bool ign | @@ -97,11 +97,21 @@ void BEE::writeSigset(const QString &sigset, const br::FileList &files, bool ign | ||
| 97 | lines.append("<biometric-signature-set>"); | 97 | lines.append("<biometric-signature-set>"); |
| 98 | foreach (const File &file, files) { | 98 | foreach (const File &file, files) { |
| 99 | QStringList metadata; | 99 | QStringList metadata; |
| 100 | - if (!ignoreMetadata) | 100 | + if (!ignoreMetadata) { |
| 101 | foreach (const QString &key, file.localKeys()) { | 101 | foreach (const QString &key, file.localKeys()) { |
| 102 | - if ((key == "Index") || (key == "Label")) continue; | 102 | + if ((key == "Index") || (key == "Label") || (key == "Points") || (key == "Rects")) continue; |
| 103 | metadata.append(key+"=\""+QtUtils::toString(file.value(key))+"\""); | 103 | metadata.append(key+"=\""+QtUtils::toString(file.value(key))+"\""); |
| 104 | } | 104 | } |
| 105 | + QStringList landmarks; | ||
| 106 | + if (!file.points().isEmpty()) { | ||
| 107 | + foreach (const QPointF &point, file.points()) landmarks.append(QtUtils::toString(point)); | ||
| 108 | + metadata.append("Points=\"["+landmarks.join(",")+"]\""); landmarks.clear(); | ||
| 109 | + } | ||
| 110 | + if (!file.rects().isEmpty()) { | ||
| 111 | + foreach (const QRectF &rect, file.rects()) landmarks.append(QtUtils::toString(rect)); | ||
| 112 | + metadata.append("Rects=\"["+landmarks.join(",")+"]\""); | ||
| 113 | + } | ||
| 114 | + } | ||
| 105 | lines.append("\t<biometric-signature name=\"" + file.get<QString>("Label",file.fileName()) +"\">"); | 115 | lines.append("\t<biometric-signature name=\"" + file.get<QString>("Label",file.fileName()) +"\">"); |
| 106 | lines.append("\t\t<presentation file-name=\"" + file.name + "\" " + metadata.join(" ") + "/>"); | 116 | lines.append("\t\t<presentation file-name=\"" + file.name + "\" " + metadata.join(" ") + "/>"); |
| 107 | lines.append("\t</biometric-signature>"); | 117 | lines.append("\t</biometric-signature>"); |