ethereon / subsense

A tweaked version of the SuBSENSE background subtraction library.
52 stars 19 forks source link

Library not found #1

Open ARUNSOORAJPS opened 7 years ago

ARUNSOORAJPS commented 7 years ago

'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

tiahflorens commented 7 years ago

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

ewanlee commented 7 years ago

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

marcoruizrueda commented 7 years ago

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 findpackage 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.

yashwantram commented 4 years ago

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

marcoruizrueda commented 4 years ago

@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.

yashwantram commented 4 years ago

@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

marcoruizrueda commented 4 years ago

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.

yashwantram commented 4 years ago

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

yashwantram commented 4 years ago

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

yashwantram commented 4 years ago

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

marcoruizrueda commented 4 years ago

@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.

yashwantram commented 4 years ago

@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 commented 4 years ago

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

marcoruizrueda commented 4 years ago

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

Your welcome brow. Good luck.

CaoZhonglei commented 4 months ago

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