From 5077e2d6c946322ea2495f4b39fcd664bbf27493 Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Sat, 1 Nov 2014 12:15:05 -0400 Subject: [PATCH] explictly calculate the feature vector size --- openbr/plugins/gallery.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openbr/plugins/gallery.cpp b/openbr/plugins/gallery.cpp index de74376..ba7ddf3 100644 --- a/openbr/plugins/gallery.cpp +++ b/openbr/plugins/gallery.cpp @@ -331,13 +331,13 @@ class utGallery : public BinaryGallery const uint32_t urlSize = url.size() + 1; gallery.write((const char*) &urlSize, sizeof(uint32_t)); - const uint32_t size = urlSize + header.size() + (algorithmID == 0 ? 0 : t.m().rows * t.m().cols * t.m().elemSize()); + const uint32_t fvSize = t.m().rows * t.m().cols * t.m().elemSize(); + const uint32_t size = urlSize + header.size() + (algorithmID == 0 ? 0 : fvSize); gallery.write((const char*) &size, sizeof(uint32_t)); - gallery.write((const char*) url.data(), urlSize); gallery.write(header); if (algorithmID != 0) - gallery.write((const char*) t.m().data, t.m().rows * t.m().cols * t.m().elemSize()); + gallery.write((const char*) t.m().data, fvSize); } }; -- libgit2 0.21.4