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

[Problem] Bag of Features for Object Recognition #1616

Closed
xMutzelx opened this issue Apr 25, 2016 · 10 comments
Closed

[Problem] Bag of Features for Object Recognition #1616

xMutzelx opened this issue Apr 25, 2016 · 10 comments

Comments

@xMutzelx
Copy link

xMutzelx commented Apr 25, 2016

Hello,
I am following this example: http://jsk-recognition.readthedocs.org/en/latest/jsk_perception/bof_object_recognition.html

When I type:rosrun jsk_perception create_sift_dataset.py 20150428_collected_images I get the following error:

Traceback (most recent call last):
  File "/home/marcel/jsk_ws/src/jsk_recognition/jsk_perception/scripts/create_sift_dataset.py", line 31, in <module>
    import imagesift
  File "/home/marcel/jsk_ws/devel/lib/python2.7/dist-packages/imagesift/__init__.py", line 35, in <module>
    exec(__fh.read())
  File "<string>", line 8, in <module>
ImportError: No module named siftfastpy

I succssfully installed jsk-recognition and jsk-3rdparty. I am using Ubuntu 14.04 and Ros Indigo. I installed OpenCV 2.4.11. Do you have any ideas how I can fix this?
Thank you for your help.

@wkentaro
Copy link
Member

This seems problem in libsiftfastpy. https://github.com/jsk-ros-pkg/jsk_3rdparty/tree/master/3rdparty/libsiftfast
because the siftfastpy.so should be installed and properly loaded after installed via apt.

@xMutzelx
Copy link
Author

I installed it from source and not via apt.
I can find siftfastpy.o by hand:

marcel@marcel-H67A-UD3H-B3:~/jsk_ws/build/libsiftfast/libsiftfast_svn/build/CMakeFiles/siftfastpy.dir$ ls
build.make         CXX.includecache  depend.internal  flags.make     link.txt       siftfastpy.o
cmake_clean.cmake  DependInfo.cmake  depend.make      libsiftfast.o  progress.make

@wkentaro
Copy link
Member

Ok, if so, it should be installed at:

~/jsk_ws/devel/lib/python2.7/dist-packages/siftfastpy.so

@xMutzelx
Copy link
Author

xMutzelx commented Apr 25, 2016

Here is no siftfastpy.so and I also cant find it in subfolders.

marcel@marcel-H67A-UD3H-B3:~/jsk_ws/devel/lib/python2.7/dist-packages$ ls
bayesian                  jsk_pcl_ros        jsk_recognition_msgs   opt_camera
bayesian_belief_networks  jsk_pcl_ros_utils  jsk_recognition_utils  pgm_learner
imagesift                 jsk_perception     mini_maxwell           resized_image_transport

I also found a link at: /home/marcel/jsk_ws/devel and the link goes to: /home/marcel/jsk_ws/devel/.private/libsiftfast

@wkentaro
Copy link
Member

There is a condition in build/libsiftfast/libsiftfast_svn/CMakeLists.txt as below:

if( HAVE_ALL_PYTHON_HEADERS )
      message(STATUS "python and boost-python found")
      include_directories(${PYTHON_INCLUDE_PATH} ${Boost_INCLUDE_DIRS})
      link_directories(${Boost_LIBRARY_DIRS})
      add_library(siftfastpy SHARED siftfastpy.cpp libsiftfast.cpp)
      # stdc++ has to be included before opengl libraries due to some ATI bug (http://wiki.fifengine.de/Segfault_in_cxa_allocate_exception#Workaround)
      target_link_libraries(siftfastpy ${STDC_LIBRARY} ${PYTHON_LIBRARIES} ${Boost_PYTHON_LIBRARY})

there is some missing dependencies in your environment.

@wkentaro
Copy link
Member

Please check the message on built time.

@wkentaro
Copy link
Member

I found catkin_tools 0.4.0 does not run execute_process cmake function, and it may cause the bug.

@wkentaro
Copy link
Member

Ah, it's my misunderstanding, https://github.com/jsk-ros-pkg/jsk_3rdparty/blob/master/3rdparty/libsiftfast/CMakeLists.txt#L33-L35 line fails because of changed catkin_tools api.

@wkentaro
Copy link
Member

jsk-ros-pkg/jsk_3rdparty#62 should fix the problem of wrong location of siftfastpy.so.

@xMutzelx
Copy link
Author

Your fix works fine. Thank you for your help, I really appreciate it.

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

No branches or pull requests

2 participants