Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use popsift as API? #152

Open
kundu03 opened this issue Jan 30, 2024 · 3 comments
Open

How to use popsift as API? #152

kundu03 opened this issue Jan 30, 2024 · 3 comments

Comments

@kundu03
Copy link

kundu03 commented Jan 30, 2024

Hello @simogasp ,
I have downloaded and build popsift in ubuntu 22.04 and it working fine when i am using popsift-demo to find features but i am unable to use it as an API. Could you please suggest the proper way of using popsift as API.
Thank you.

@simogasp
Copy link
Member

You have just to adapt the popsift-demo code inside your project.
You can also check how for example popsift is used inside alicevision, embedded in a class that performs the feature detection https://github.com/alicevision/AliceVision/blob/develop/src/aliceVision/feature/sift/ImageDescriber_SIFT_popSIFT.hpp

If you need to add popsift to your cmake project you can just check the documentation
https://popsift.readthedocs.io/en/latest/install/install.html#popsift-as-third-party

@kundu03
Copy link
Author

kundu03 commented Feb 7, 2024

Hello @simogasp
I am trying to use popsift as third party in my local file (main.cpp) with the following details :

CMakeLists.txt file is :

cmake_minimum_required(VERSION 3.0)

project(PopSift)

set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# Find the package from the PopSiftConfig.cmake
# in <prefix>/lib/cmake/PopSift/. Under the namespace PopSift::
# it exposes the target popsift that allows you to compile
# and link with the library
find_package(PopSift CONFIG REQUIRED)

# suppose you want to try it out in a executable
add_executable(poptest main.cpp)
# add link to the library
target_link_libraries(poptest PUBLIC PopSift::popsift)

and while configuring using command : cmake .. -DPopSift_DIR=/home/surveyaan/sagar/popsift/build/src/generated/

I am getting the following error :

CMake Error at CMakeLists.txt:15 (add_executable):
  Target "poptest" links to target "PopSift::popsift" but the target was not
  found.  Perhaps a find_package() call is missing for an IMPORTED target, or
  an ALIAS target is missing?


-- Generating done
CMake Generate step failed.  Build files cannot be regenerated correctly.

@simogasp
Copy link
Member

and while configuring using command : cmake .. -DPopSift_DIR=/home/surveyaan/sagar/popsift/build/src/generated/

You should avoid using intree build. First install popsift in a directory of your preference (NOT a system one like /usr/local) and then make PopSift_DIR point to that location.
E.g.

# in popsift build directory do
cmake .. -DCMAKE_INSTALL_PREFIX=`pwd`/install
make install

# then in your sample application do
cmake  .. -DPopSift_DIR=/home/surveyaan/sagar/popsift/build/install

Also note that if you are using a CUDA > 8 then the c++ standard used by popsift is 14.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants