This PR modifies the image_keypoints implementation in sift.py module, while preserving its API (to the exception of the extra_params option which had to be removed).
It now reads the roi with rasterio into a numpy array, pass it to the keypoints_from_nparray, which will call the actual C++ sift code with ctypes and return the sift points and descriptors in another numpy array. This array is then written to the txt file using numpy io.
I had to fix a bunch of bugs in the sift test itself. I also autopep8 the sift.py file which explains minor diff outside of methods cited above.
the libsift4ctypes.so shared library is installed in s2p/lib. Relative path is hardcoded in sift.py, which allow the whole thing to work without updating LD_LIBRARY_PATH. However a cleaner solution would be to manage the LD_LIBRARY_PATH in a config script (out of the scope of this PR).
This PR modifies the
image_keypoints
implementation insift.py
module, while preserving its API (to the exception of theextra_params
option which had to be removed).It now reads the roi with
rasterio
into anumpy
array, pass it to thekeypoints_from_nparray
, which will call the actual C++ sift code withctypes
and return the sift points and descriptors in anothernumpy
array. This array is then written to the txt file usingnumpy
io.I had to fix a bunch of bugs in the sift test itself. I also
autopep8
thesift.py
file which explains minor diff outside of methods cited above.the
libsift4ctypes.so
shared library is installed ins2p/lib
. Relative path is hardcoded insift.py
, which allow the whole thing to work without updatingLD_LIBRARY_PATH
. However a cleaner solution would be to manage theLD_LIBRARY_PATH
in a config script (out of the scope of this PR).