Commit 5077e2d6c946322ea2495f4b39fcd664bbf27493

Authored by Josh Klontz
1 parent 88b0f7c5

explictly calculate the feature vector size

Showing 1 changed file with 3 additions and 3 deletions
openbr/plugins/gallery.cpp
@@ -331,13 +331,13 @@ class utGallery : public BinaryGallery @@ -331,13 +331,13 @@ class utGallery : public BinaryGallery
331 const uint32_t urlSize = url.size() + 1; 331 const uint32_t urlSize = url.size() + 1;
332 gallery.write((const char*) &urlSize, sizeof(uint32_t)); 332 gallery.write((const char*) &urlSize, sizeof(uint32_t));
333 333
334 - const uint32_t size = urlSize + header.size() + (algorithmID == 0 ? 0 : t.m().rows * t.m().cols * t.m().elemSize()); 334 + const uint32_t fvSize = t.m().rows * t.m().cols * t.m().elemSize();
  335 + const uint32_t size = urlSize + header.size() + (algorithmID == 0 ? 0 : fvSize);
335 gallery.write((const char*) &size, sizeof(uint32_t)); 336 gallery.write((const char*) &size, sizeof(uint32_t));
336 -  
337 gallery.write((const char*) url.data(), urlSize); 337 gallery.write((const char*) url.data(), urlSize);
338 gallery.write(header); 338 gallery.write(header);
339 if (algorithmID != 0) 339 if (algorithmID != 0)
340 - gallery.write((const char*) t.m().data, t.m().rows * t.m().cols * t.m().elemSize()); 340 + gallery.write((const char*) t.m().data, fvSize);
341 } 341 }
342 }; 342 };
343 343