Commit 4640912b370b924ee6658f1ecc5ef60e179ce268
1 parent
4c9533be
JSONTransform bug fixes
Showing
1 changed file
with
2 additions
and
2 deletions
openbr/plugins/template.cpp
| @@ -107,9 +107,9 @@ class JSONTransform : public UntrainableMetaTransform | @@ -107,9 +107,9 @@ class JSONTransform : public UntrainableMetaTransform | ||
| 107 | void project(const Template &src, Template &dst) const | 107 | void project(const Template &src, Template &dst) const |
| 108 | { | 108 | { |
| 109 | dst.file = src.file; | 109 | dst.file = src.file; |
| 110 | - const QByteArray json = QJsonDocument(QJsonObject::fromVariantMap(src.file.localMetadata())).toJson(); | ||
| 111 | - dst += cv::Mat(1, json.size(), CV_8UC1, (void*) json.data()); | ||
| 112 | dst.file.set("AlgorithmID", 2); | 110 | dst.file.set("AlgorithmID", 2); |
| 111 | + const QByteArray json = QJsonDocument(QJsonObject::fromVariantMap(dst.file.localMetadata())).toJson(); | ||
| 112 | + dst += cv::Mat(1, json.size()+1 /*include null terminator*/, CV_8UC1, (void*) json.data()).clone(); | ||
| 113 | } | 113 | } |
| 114 | }; | 114 | }; |
| 115 | 115 |