Write/read keypoint angle when saving/loading descriptors
@@ -678,6 +678,12 @@ int orb_save_descriptor(FIL *fp, array_t *kpts)
goto error;
}
+ // Write Angle
+ res = f_write(fp, &kp->angle, sizeof(kp->angle), &bytes);
+ if (res != FR_OK || bytes != sizeof(kp->angle)) {
+ goto error;
+ }
+
// Write descriptor
res = f_write(fp, kp->desc, KDESC_SIZE, &bytes);
if (res != FR_OK || bytes != KDESC_SIZE) {
@@ -730,6 +736,12 @@ int orb_load_descriptor(FIL *fp, array_t *kpts)
goto error;
}
+ // Read Angle
+ res = f_read(fp, &kp->angle, sizeof(kp->angle), &bytes);
+ if (res != FR_OK || bytes != sizeof(kp->angle)) {
+ goto error;
+ }
+
// Read descriptor
res = f_read(fp, kp->desc, KDESC_SIZE, &bytes);
if (res != FR_OK || bytes != KDESC_SIZE) {
