naver / kapture

kapture is a file format as well as a set of tools for manipulating datasets, and in particular Visual Localization and Structure from Motion data.
BSD 3-Clause "New" or "Revised" License
466 stars 66 forks source link

Fix bug in the kapture_import_bundler.py #11

Closed ducha-aiki closed 3 years ago

ducha-aiki commented 3 years ago

Fix the data precision. Otherwise the np.array generates np.float64 array by default, which leads to completely wrongly read data.

An example:

keypoints of "IMG_9614.MOV_frame000100.png" as numpy array of float32 and shape (5304, 2):

[[ 0.00000000e+00 4.25390625e+00] [-1.07374184e+08 4.08701134e+00] [ 0.00000000e+00 4.62646484e+00] ... [ 0.00000000e+00 3.49609375e+00] [ 0.00000000e+00 4.24218750e+00] [ 0.00000000e+00 3.73046875e+00]]

After modification:

array([1102., 117., 1213., ..., 720., 1195., 710.], dtype=float32)

yocabon commented 3 years ago

I see, keypoints are manually initialized as kapture.Keypoints('sift', np.float32, 2), but they were being written as float64 as you noted. Thank you, I found the same error in import_nvm, I'll fix that.