Commit 03c6e2c03f037540b7d234a9b28a746cbca361b6
1 parent
c65e1074
Change ut.X and ut.Y to int32_t for BBs outside the image
Showing
3 changed files
with
10 additions
and
9 deletions
openbr/plugins/gallery/binary.cpp
| ... | ... | @@ -247,7 +247,8 @@ class utGallery : public BinaryGallery |
| 247 | 247 | const int32_t algorithmID = (t.isEmpty() || t.file.fte) ? 0 : t.file.get<int32_t>("AlgorithmID"); |
| 248 | 248 | const QByteArray url = t.file.get<QString>("URL", t.file.name).toLatin1(); |
| 249 | 249 | |
| 250 | - uint32_t x = 0, y = 0, width = 0, height = 0; | |
| 250 | + int32_t x = 0, y = 0; | |
| 251 | + uint32_t width = 0, height = 0; | |
| 251 | 252 | QByteArray header; |
| 252 | 253 | if ((algorithmID <= -1) && (algorithmID >= -3)) { |
| 253 | 254 | const QRectF frontalFace = t.file.get<QRectF>("FrontalFace"); |
| ... | ... | @@ -268,8 +269,8 @@ class utGallery : public BinaryGallery |
| 268 | 269 | header.append((const char*)&leftEyeX , sizeof(uint32_t)); |
| 269 | 270 | header.append((const char*)&leftEyeY , sizeof(uint32_t)); |
| 270 | 271 | } else { |
| 271 | - x = t.file.get<uint32_t>("X", 0); | |
| 272 | - y = t.file.get<uint32_t>("Y", 0); | |
| 272 | + x = t.file.get<int32_t>("X", 0); | |
| 273 | + y = t.file.get<int32_t>("Y", 0); | |
| 273 | 274 | width = t.file.get<uint32_t>("Width", 0); |
| 274 | 275 | height = t.file.get<uint32_t>("Height", 0); |
| 275 | 276 | } |
| ... | ... | @@ -277,8 +278,8 @@ class utGallery : public BinaryGallery |
| 277 | 278 | |
| 278 | 279 | gallery.write(imageID); |
| 279 | 280 | gallery.write((const char*) &algorithmID, sizeof(int32_t)); |
| 280 | - gallery.write((const char*) &x , sizeof(uint32_t)); | |
| 281 | - gallery.write((const char*) &y , sizeof(uint32_t)); | |
| 281 | + gallery.write((const char*) &x , sizeof(int32_t)); | |
| 282 | + gallery.write((const char*) &y , sizeof(int32_t)); | |
| 282 | 283 | gallery.write((const char*) &width , sizeof(uint32_t)); |
| 283 | 284 | gallery.write((const char*) &height , sizeof(uint32_t)); |
| 284 | 285 | gallery.write((const char*) &label , sizeof(uint32_t)); | ... | ... |
openbr/universal_template.cpp
| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | |
| 9 | 9 | #include "universal_template.h" |
| 10 | 10 | |
| 11 | -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) | |
| 11 | +br_utemplate br_new_utemplate(const char *imageID, int32_t algorithmID, int32_t x, int32_t y, uint32_t width, uint32_t height, uint32_t label, const char *url, const char *fv, uint32_t fvSize) | |
| 12 | 12 | { |
| 13 | 13 | const uint32_t urlSize = strlen(url) + 1; |
| 14 | 14 | br_utemplate utemplate = (br_utemplate) malloc(sizeof(br_universal_template) + urlSize + fvSize); | ... | ... |
openbr/universal_template.h
| ... | ... | @@ -37,8 +37,8 @@ struct br_universal_template |
| 37 | 37 | { |
| 38 | 38 | unsigned char imageID[16]; /*!< MD5 hash of the undecoded origin file. */ |
| 39 | 39 | int32_t algorithmID; /*!< interpretation of _data_ after _urlSize_. */ |
| 40 | - uint32_t x; /*!< region of interest horizontal offset (pixels). */ | |
| 41 | - uint32_t y; /*!< region of interest vertical offset (pixels). */ | |
| 40 | + int32_t x; /*!< region of interest horizontal offset (pixels). */ | |
| 41 | + int32_t y; /*!< region of interest vertical offset (pixels). */ | |
| 42 | 42 | uint32_t width; /*!< region of interest horizontal size (pixels). */ |
| 43 | 43 | uint32_t height; /*!< region of interest vertical size (pixels). */ |
| 44 | 44 | uint32_t label; /*!< supervised training class or manually annotated ground truth. */ |
| ... | ... | @@ -57,7 +57,7 @@ typedef const struct br_universal_template *br_const_utemplate; |
| 57 | 57 | * \brief br_universal_template constructor. |
| 58 | 58 | * \see br_free_utemplate |
| 59 | 59 | */ |
| 60 | -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); | |
| 60 | +BR_EXPORT br_utemplate br_new_utemplate(const char *imageID, int32_t algorithmID, int32_t x, int32_t y, uint32_t width, uint32_t height, uint32_t label, const char *url, const char *fv, uint32_t fvSize); | |
| 61 | 61 | |
| 62 | 62 | /*! |
| 63 | 63 | * \brief br_universal_template destructor. | ... | ... |