diff --git a/openbr/plugins/gallery.cpp b/openbr/plugins/gallery.cpp index 08e3a65..02b0061 100644 --- a/openbr/plugins/gallery.cpp +++ b/openbr/plugins/gallery.cpp @@ -313,15 +313,15 @@ class utGallery : public BinaryGallery width = t.file.get("Width", 0); height = t.file.get("Height", 0); } - const double label = t.file.get("Label", 0); + const uint32_t label = t.file.get("Label", 0); gallery.write(imageID); - gallery.write((const char*) &algorithmID, sizeof(uint32_t)); + gallery.write((const char*) &algorithmID, sizeof(int32_t)); gallery.write((const char*) &x , sizeof(uint32_t)); gallery.write((const char*) &y , sizeof(uint32_t)); gallery.write((const char*) &width , sizeof(uint32_t)); gallery.write((const char*) &height , sizeof(uint32_t)); - gallery.write((const char*) &label , sizeof(double)); + gallery.write((const char*) &label , sizeof(uint32_t)); const uint32_t urlSize = url.size() + 1; gallery.write((const char*) &urlSize, sizeof(uint32_t)); diff --git a/openbr/universal_template.cpp b/openbr/universal_template.cpp index 7b141db..79731ac 100644 --- a/openbr/universal_template.cpp +++ b/openbr/universal_template.cpp @@ -8,7 +8,7 @@ #include "universal_template.h" -br_utemplate br_new_utemplate(const int8_t *imageID, int32_t algorithmID, size_t x, size_t y, size_t width, size_t height, double label, const char *url, const char *fv, uint32_t fvSize) +br_utemplate br_new_utemplate(const char *imageID, int32_t algorithmID, uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t label, const char *url, const char *fv, uint32_t fvSize) { const uint32_t urlSize = strlen(url) + 1; br_utemplate utemplate = (br_utemplate) malloc(sizeof(br_universal_template) + urlSize + fvSize); diff --git a/openbr/universal_template.h b/openbr/universal_template.h index 173d153..979871d 100644 --- a/openbr/universal_template.h +++ b/openbr/universal_template.h @@ -41,8 +41,7 @@ struct br_universal_template uint32_t y; /*!< region of interest vertical offset (pixels). */ uint32_t width; /*!< region of interest horizontal size (pixels). */ uint32_t height; /*!< region of interest vertical size (pixels). */ - double label; /*!< classification/regression supervised training class, - or manually annotated ground truth. */ + uint32_t label; /*!< supervised training class or manually annotated ground truth. */ uint32_t urlSize; /*!< length of null-terminated URL at the beginning of _data_, including the null-terminator character. */ uint32_t fvSize; /*!< length of the feature vector after the URL in _data_. */ @@ -58,7 +57,7 @@ typedef const struct br_universal_template *br_const_utemplate; * \brief br_universal_template constructor. * \see br_free_utemplate */ -BR_EXPORT br_utemplate br_new_utemplate(const int8_t *imageID, int32_t algorithmID, size_t x, size_t y, size_t width, size_t height, double label, const char *url, const char *fv, uint32_t fvSize); +BR_EXPORT br_utemplate br_new_utemplate(const char *imageID, int32_t algorithmID, uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t label, const char *url, const char *fv, uint32_t fvSize); /*! * \brief br_universal_template destructor.