subsense icon indicating copy to clipboard operation
subsense copied to clipboard

Library not found

Open ARUNSOORAJPS opened this issue 8 years ago • 15 comments
trafficstars

'libSubsense' is not found inside the python folder. Should I do anything to create the library file?

File "C:/Users/ics02517.AD001/Documents/Python Scripts/Object Tracking/subsense-master/Python/Subsense.py", line 28, in init self.lib_subsense = np.ctypeslib.load_library(LIB_NAME, LIB_PATH)

File "C:\Anaconda\lib\site-packages\numpy\ctypeslib.py", line 128, in load_library raise OSError("no file with expected extension")

OSError: no file with expected extension

ARUNSOORAJPS avatar Apr 26 '17 13:04 ARUNSOORAJPS

I have a same problem here... What should I do? I tried to cmake in the subsense root directory but libSunsesce doesn't created.

tiahflorens avatar Jun 26 '17 10:06 tiahflorens

So... There is someone has solved this problem ?

ewanlee avatar Sep 17 '17 11:09 ewanlee

I had a lot of problems too... Finally It compiled in this way:

1. Add the find_package command in My CmakeList.txt basically I only added a find_package instruction, you can delete some lines there if you want.


SET(PROJECT_NAME Subsense) PROJECT(${PROJECT_NAME}) CMAKE_MINIMUM_REQUIRED (VERSION 2.8.3)

find_package( OpenCV REQUIRED )

set(EXTRA_INC_DIRS /usr/local/include )

LIST(APPEND LINK_LIBS opencv_core opencv_video opencv_features2d opencv_imgproc )

set(SS_DIR ${CMAKE_CURRENT_SOURCE_DIR})

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Ofast")

if(APPLE) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib) set(CMAKE_MACOSX_RPATH ON) set(CMAKE_SKIP_BUILD_RPATH FALSE) set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib") set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) endif()

file(GLOB LIB_SRC_FILES ${SS_DIR}/Subsense/*.cpp) include_directories(${SS_DIR} ${EXTRA_INC_DIRS})

add_library(Subsense SHARED ${LIB_SRC_FILES}) target_link_libraries(Subsense ${LINK_LIBS})

2. Comment the lines 39-41 in the BackgroundSubtractorLBSP.cpp file as follows: //cv::AlgorithmInfo* BackgroundSubtractorLBSP::info() const { //return nullptr; //}

3. Comment the line 29 in BackgroundSubtractorLBSP.h file: //virtual cv::AlgorithmInfo* info() const;

**4. Locate the compiled libSubsense.so file together with the python script. That's all.

marcoruizrueda avatar Oct 09 '17 14:10 marcoruizrueda

@marcoruizrueda No brow... Getting the error even after trying out the above solutin

yashwantram avatar Oct 31 '19 07:10 yashwantram

@marcoruizrueda No brow... Getting the error even after trying out the above solutin

Do not forget to locate the libSubsense.so file in the same folder as the python script. I tried on Ubuntu 16.04 and CMake 2.8. Good luck.

marcoruizrueda avatar Oct 31 '19 10:10 marcoruizrueda

@marcoruizrueda where is the file called libSubsense.so file, i can find it. And you want out to put that file inside the Python folder

And i am using Ubuntu 18.04 and Cmake 3.10. It will great full if you help me

yashwantram avatar Oct 31 '19 10:10 yashwantram

libSubsense.so

From compilation with cmake, you are going to get the compiled file (libSubsense.so) that you have to put together with the python script. Please follow my 4 instructions faithfully and comment the results.

marcoruizrueda avatar Oct 31 '19 11:10 marcoruizrueda

@marcoruizrueda Sorry i can't locate the libSubsense.so file in my system... So what should i do now?

yashwantram avatar Oct 31 '19 11:10 yashwantram

@marcoruizrueda Sorry i can't locate the libSubsense.so file in my system... So what should i do now?

yashwantram avatar Oct 31 '19 11:10 yashwantram

@marcoruizrueda Sorry i can't locate the libSubsense.so file in my system... So what should i do now?

yashwantram avatar Oct 31 '19 11:10 yashwantram

@marcoruizrueda Sorry i can't locate the libSubsense.so file in my system... So what should i do now?

So, set the file path in variable "LIB_PAT" in the python script, with the location of your compiled libSubsense.so file. It can be a remote location. So, that is the core problem, the file is not being found.

marcoruizrueda avatar Oct 31 '19 11:10 marcoruizrueda

@marcoruizrueda I searched completely there is no file called libSubsense.so . Should i compile something to generate that file. And the variable name is LIB_PATH right?

yashwantram avatar Nov 01 '19 04:11 yashwantram

@marcoruizrueda The fault was i dint make the Cmakelist.txt . After that process its working super fine. Thank you

yashwantram avatar Nov 01 '19 05:11 yashwantram

@marcoruizrueda The fault was i dint make the Cmakelist.txt . After that process its working super fine. Thank you

Your welcome brow. Good luck.

marcoruizrueda avatar Nov 01 '19 14:11 marcoruizrueda

The system could not find the specified file: Subsense. dll. What should I do in this case?

CaoZhonglei avatar Jun 06 '24 07:06 CaoZhonglei