Adjust the coordinates to the base octave
mmkorb opened this issue · 2 comments
mmkorb commented
The points are being drawn correctly, however in CSV the correction was missing.
In file sift.c, replace the lines 3120 to 3130 with:
// Write the keypoints
for (i = 0; i < num_rows; i++) {
const Keypoint *const key = kp->buf + i;
const Mat_rm *const R = &key->R;
// Adjust the coordinates to the base octave
const double coord_factor = pow(2.0, key->o);
// Write the coordinates
SIFT3D_MAT_RM_GET(&mat, i, kp_x, double) = coord_factor * key->xd +1;
SIFT3D_MAT_RM_GET(&mat, i, kp_y, double) = coord_factor * key->yd +1;
SIFT3D_MAT_RM_GET(&mat, i, kp_z, double) = coord_factor * key->zd +1;
SIFT3D_MAT_RM_GET(&mat, i, kp_s, double) = key->sd;
bbrister commented
Thanks for the catch! I'll work this in to the next release. The only minor issue is that I won't add 1 to each coordinate, since the program uses 0-indexed coordinates, where the first voxel in the image is (0,0,0).
bbrister commented
Fixed in version 1.4.5. To be consistent with the Matlab interface, I decided to add the octave index to the output, rather than scale the coordinates.