Commit 3906dc333aa9ddf5a6d58b61f5cc631b67920fe6
1 parent
7c529d2d
added missing AlgorithmID=-1 metadata
Showing
1 changed file
with
23 additions
and
0 deletions
openbr/plugins/gallery.cpp
| @@ -240,6 +240,29 @@ class utGallery : public BinaryGallery | @@ -240,6 +240,29 @@ class utGallery : public BinaryGallery | ||
| 240 | stream << t; | 240 | stream << t; |
| 241 | } else { | 241 | } else { |
| 242 | data = QByteArray((const char*) t.m().data, t.m().rows * t.m().cols * t.m().elemSize()); | 242 | data = QByteArray((const char*) t.m().data, t.m().rows * t.m().cols * t.m().elemSize()); |
| 243 | + | ||
| 244 | + if (algorithmID == -1) { | ||
| 245 | + const QRectF frontalFace = t.file.get<QRectF>("FrontalFace"); | ||
| 246 | + const QPointF firstEye = t.file.get<QPointF>("First_Eye"); | ||
| 247 | + const QPointF secondEye = t.file.get<QPointF>("Second_Eye"); | ||
| 248 | + const float x = frontalFace.x(); | ||
| 249 | + const float y = frontalFace.y(); | ||
| 250 | + const float width = frontalFace.width(); | ||
| 251 | + const float height = frontalFace.height(); | ||
| 252 | + const float rightEyeX = firstEye.x(); | ||
| 253 | + const float rightEyeY = firstEye.y(); | ||
| 254 | + const float leftEyeX = secondEye.x(); | ||
| 255 | + const float leftEyeY = secondEye.y(); | ||
| 256 | + | ||
| 257 | + data.append((const char*)&x , sizeof(float)); | ||
| 258 | + data.append((const char*)&y , sizeof(float)); | ||
| 259 | + data.append((const char*)&width , sizeof(float)); | ||
| 260 | + data.append((const char*)&height , sizeof(float)); | ||
| 261 | + data.append((const char*)&rightEyeX, sizeof(float)); | ||
| 262 | + data.append((const char*)&rightEyeY, sizeof(float)); | ||
| 263 | + data.append((const char*)&leftEyeX , sizeof(float)); | ||
| 264 | + data.append((const char*)&leftEyeY , sizeof(float)); | ||
| 265 | + } | ||
| 243 | } | 266 | } |
| 244 | const QByteArray templateID = QCryptographicHash::hash(data, QCryptographicHash::Md5); | 267 | const QByteArray templateID = QCryptographicHash::hash(data, QCryptographicHash::Md5); |
| 245 | const uint32_t size = data.size(); | 268 | const uint32_t size = data.size(); |