andrewssobral / bgslibrary

A C++ Background Subtraction Library with wrappers for Python, MATLAB, Java and GUI on QT
MIT License
2.21k stars 743 forks source link

Pip install pybgs doesn't work on MacOS #203

Open corlangerak opened 3 years ago

corlangerak commented 3 years ago

Hi I am trying to install the bgslibrary but the pip install gives the following ERROR Message:

ERROR: Command errored out with exit status 1:
   command: /Users/corlangerak/mypython/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/setup.py'"'"'; __file__='"'"'/private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-wheel-17yi7z5n
       cwd: /private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/
  Complete output (113 lines):
  running bdist_wheel
  running build
  running build_ext
  Preparing the build environment
  Configuring cmake project
  cmake -H/private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881 -Bbuild/temp.macosx-10.9-x86_64-3.7 -DPYTHON_EXECUTABLE=/Users/corlangerak/mypython/bin/python -DBGS_CORE_STATIC=ON -DBGS_PYTHON_SUPPORT=ON -DBGS_PYTHON_ONLY=ON -DBGS_PYTHON_VERSION=3.7
  -- The C compiler identification is AppleClang 11.0.3.11030032
  -- The CXX compiler identification is AppleClang 11.0.3.11030032
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  --
  -- BGS_PYTHON_SUPPORT: ON
  -- BGS_PYTHON_ONLY:    ON
  -- BGS_CORE_STATIC:    ON
  -- PYTHON VERSION: 3.7
  -- Found OpenCV: /usr/local/Cellar/opencv/4.5.1_2 (found version "4.5.1")
  --
  -- OpenCV library status:
  --     version: 4.5.1
  --     libraries: opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_gapi;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_stitching;opencv_video;opencv_videoio;opencv_alphamat;opencv_aruco;opencv_bgsegm;opencv_bioinspired;opencv_ccalib;opencv_datasets;opencv_dnn_objdetect;opencv_dnn_superres;opencv_dpm;opencv_face;opencv_freetype;opencv_fuzzy;opencv_hfs;opencv_img_hash;opencv_intensity_transform;opencv_line_descriptor;opencv_mcc;opencv_optflow;opencv_phase_unwrapping;opencv_plot;opencv_quality;opencv_rapid;opencv_reg;opencv_rgbd;opencv_saliency;opencv_sfm;opencv_shape;opencv_stereo;opencv_structured_light;opencv_superres;opencv_surface_matching;opencv_text;opencv_tracking;opencv_videostab;opencv_viz;opencv_xfeatures2d;opencv_ximgproc;opencv_xobjdetect;opencv_xphoto
  --     include path: /usr/local/Cellar/opencv/4.5.1_2/include/opencv4

  -- Found PythonInterp: /Users/corlangerak/mypython/bin/python (found suitable version "3.7.9", minimum required is "3.7")
  -- Found PythonLibs: /Library/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7m.dylib
  -- pybind11 v2.3.dev1
  --
  -- Python library status:
  --     executable: /Users/corlangerak/mypython/bin/python
  --     library: /Library/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7m.dylib
  --     include path: /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m
  -- NUMPY_INCLUDE_DIR: /Users/corlangerak/mypython/lib/python3.7/site-packages/numpy/core/include

  -- Bulding bgslibrary_core STATIC
  --
  -- The bgslibrary python package will be installed at: lib/python3.7/site-packages

  -- Configuring done
  -- Generating done
  -- Build files have been written to: /private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/build/temp.macosx-10.9-x86_64-3.7
  Building binaries
  cmake --build build/temp.macosx-10.9-x86_64-3.7 --config Release -- -j8
  Scanning dependencies of target bgslibrary_core
  [  2%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/AdaptiveSelectiveBackgroundLearning.cpp.o
  [  5%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPAdaptiveMedian.cpp.o
  [  5%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/CodeBook.cpp.o
  [  6%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/AdaptiveBackgroundLearning.cpp.o
  [  6%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPEigenbackground.cpp.o
  [  6%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPGrimsonGMM.cpp.o
  [  7%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPMean.cpp.o
  [  8%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPPratiMediod.cpp.o
  [  9%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPTexture.cpp.o
  [ 12%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPWrenGA.cpp.o
  [ 12%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/FrameDifference.cpp.o
  [ 12%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPZivkovicAGMM.cpp.o
  [ 13%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/FuzzyChoquetIntegral.cpp.o
  [ 14%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/FuzzySugenoIntegral.cpp.o
  [ 15%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/GMG.cpp.o
  [ 16%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/IMBS/IMBS.cpp.o
  [ 17%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/IndependentMultimodal.cpp.o
  /private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/src/algorithms/IMBS/IMBS.cpp:316:67: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
          if (std::abs(currentPixel[2] - bgBins[p].binValues[s][2]) <= associationThreshold &&
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~
  /private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/src/algorithms/IMBS/IMBS.cpp:317:65: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
            std::abs(currentPixel[1] - bgBins[p].binValues[s][1]) <= associationThreshold &&
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~
  /private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/src/algorithms/IMBS/IMBS.cpp:318:65: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
            std::abs(currentPixel[0] - bgBins[p].binValues[s][0]) <= associationThreshold)
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~
  3 warnings generated.
  [ 18%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/KDE.cpp.o
  [ 19%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/KDE/KernelTable.cpp.o
  [ 20%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/KDE/NPBGSubtractor.cpp.o
  [ 21%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/KDE/NPBGmodel.cpp.o
  [ 22%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/KNN.cpp.o
  [ 23%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBAdaptiveSOM.cpp.o
  [ 24%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBFuzzyAdaptiveSOM.cpp.o
  [ 25%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBFuzzyGaussian.cpp.o
  [ 26%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBMixtureOfGaussians.cpp.o
  [ 27%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF.cpp.o
  [ 28%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF/MEDefs.cpp.o
  [ 29%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF/MEHistogram.cpp.o
  [ 30%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF/MEImage.cpp.o
  [ 31%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF/MotionDetection.cpp.o
  [ 32%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF/graph.cpp.o
  [ 33%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF/maxflow.cpp.o
  [ 34%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBSP/BackgroundSubtractorLBSP.cpp.o
  [ 35%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBSP/BackgroundSubtractorLBSP_.cpp.o
  [ 36%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBSP/BackgroundSubtractorLOBSTER.cpp.o
  [ 37%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBSP/BackgroundSubtractorPAWCS.cpp.o
  [ 38%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBSP/BackgroundSubtractorSuBSENSE.cpp.o
  [ 39%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBSP/LBSP.cpp.o
  /private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/src/algorithms/LBP_MRF/MEImage.cpp:1287:13: error: no matching function for call to 'cvLine'
              cvLine(ME_CAST_TO_IPLIMAGE(cvImg), Point1, Point2, CV_RGB(255, 255, 255), 1, 8);
              ^~~~~~
  /usr/local/Cellar/opencv/4.5.1_2/include/opencv4/opencv2/imgproc/imgproc_c.h:959:14: note: candidate function not viable: no known conversion from 'cv::Scalar' (aka 'Scalar_<double>') to 'CvScalar' for 4th argument
  CVAPI(void)  cvLine( CvArr* img, CvPoint pt1, CvPoint pt2,
               ^
  [ 41%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBSimpleGaussian.cpp.o
  [ 41%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBSP/LBSP_.cpp.o
  1 error generated.
  make[2]: *** [CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF/MEImage.cpp.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  make[1]: *** [CMakeFiles/bgslibrary_core.dir/all] Error 2
  make: *** [all] Error 2
  error: command 'cmake' failed with exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for pybgs
  Running setup.py clean for pybgs
Failed to build pybgs
Installing collected packages: pybgs
    Running setup.py install for pybgs ... error
    ERROR: Command errored out with exit status 1:
     command: /Users/corlangerak/mypython/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/setup.py'"'"'; __file__='"'"'/private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-record-5lh6dish/install-record.txt --single-version-externally-managed --compile --install-headers /Users/corlangerak/mypython/include/site/python3.7/pybgs
         cwd: /private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/
    Complete output (112 lines):
    running install
    running build
    running build_ext
    Preparing the build environment
    Configuring cmake project
    cmake -H/private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881 -Bbuild/temp.macosx-10.9-x86_64-3.7 -DPYTHON_EXECUTABLE=/Users/corlangerak/mypython/bin/python -DBGS_CORE_STATIC=ON -DBGS_PYTHON_SUPPORT=ON -DBGS_PYTHON_ONLY=ON -DBGS_PYTHON_VERSION=3.7
    -- The C compiler identification is AppleClang 11.0.3.11030032
    -- The CXX compiler identification is AppleClang 11.0.3.11030032
    -- Detecting C compiler ABI info
    -- Detecting C compiler ABI info - done
    -- Check for working C compiler: /Library/Developer/CommandLineTools/usr/bin/cc - skipped
    -- Detecting C compile features
    -- Detecting C compile features - done
    -- Detecting CXX compiler ABI info
    -- Detecting CXX compiler ABI info - done
    -- Check for working CXX compiler: /Library/Developer/CommandLineTools/usr/bin/c++ - skipped
    -- Detecting CXX compile features
    -- Detecting CXX compile features - done
    --
    -- BGS_PYTHON_SUPPORT: ON
    -- BGS_PYTHON_ONLY:    ON
    -- BGS_CORE_STATIC:    ON
    -- PYTHON VERSION: 3.7
    -- Found OpenCV: /usr/local/Cellar/opencv/4.5.1_2 (found version "4.5.1")
    --
    -- OpenCV library status:
    --     version: 4.5.1
    --     libraries: opencv_calib3d;opencv_core;opencv_dnn;opencv_features2d;opencv_flann;opencv_gapi;opencv_highgui;opencv_imgcodecs;opencv_imgproc;opencv_ml;opencv_objdetect;opencv_photo;opencv_stitching;opencv_video;opencv_videoio;opencv_alphamat;opencv_aruco;opencv_bgsegm;opencv_bioinspired;opencv_ccalib;opencv_datasets;opencv_dnn_objdetect;opencv_dnn_superres;opencv_dpm;opencv_face;opencv_freetype;opencv_fuzzy;opencv_hfs;opencv_img_hash;opencv_intensity_transform;opencv_line_descriptor;opencv_mcc;opencv_optflow;opencv_phase_unwrapping;opencv_plot;opencv_quality;opencv_rapid;opencv_reg;opencv_rgbd;opencv_saliency;opencv_sfm;opencv_shape;opencv_stereo;opencv_structured_light;opencv_superres;opencv_surface_matching;opencv_text;opencv_tracking;opencv_videostab;opencv_viz;opencv_xfeatures2d;opencv_ximgproc;opencv_xobjdetect;opencv_xphoto
    --     include path: /usr/local/Cellar/opencv/4.5.1_2/include/opencv4

    -- Found PythonInterp: /Users/corlangerak/mypython/bin/python (found suitable version "3.7.9", minimum required is "3.7")
    -- Found PythonLibs: /Library/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7m.dylib
    -- pybind11 v2.3.dev1
    --
    -- Python library status:
    --     executable: /Users/corlangerak/mypython/bin/python
    --     library: /Library/Frameworks/Python.framework/Versions/3.7/lib/libpython3.7m.dylib
    --     include path: /Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m
    -- NUMPY_INCLUDE_DIR: /Users/corlangerak/mypython/lib/python3.7/site-packages/numpy/core/include

    -- Bulding bgslibrary_core STATIC
    --
    -- The bgslibrary python package will be installed at: lib/python3.7/site-packages

    -- Configuring done
    -- Generating done
    -- Build files have been written to: /private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/build/temp.macosx-10.9-x86_64-3.7
    Building binaries
    cmake --build build/temp.macosx-10.9-x86_64-3.7 --config Release -- -j8
    Scanning dependencies of target bgslibrary_core
    [  3%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/AdaptiveBackgroundLearning.cpp.o
    [  3%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/AdaptiveSelectiveBackgroundLearning.cpp.o
    [  3%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/CodeBook.cpp.o
    [  5%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPAdaptiveMedian.cpp.o
    [  5%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPEigenbackground.cpp.o
    [  7%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPMean.cpp.o
    [  7%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPGrimsonGMM.cpp.o
    [  8%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPPratiMediod.cpp.o
    [  9%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPTexture.cpp.o
    [ 13%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPWrenGA.cpp.o
    [ 13%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/FrameDifference.cpp.o
    [ 13%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/DPZivkovicAGMM.cpp.o
    [ 13%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/FuzzyChoquetIntegral.cpp.o
    [ 14%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/FuzzySugenoIntegral.cpp.o
    [ 15%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/GMG.cpp.o
    [ 16%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/IMBS/IMBS.cpp.o
    [ 17%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/IndependentMultimodal.cpp.o
    /private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/src/algorithms/IMBS/IMBS.cpp:316:67: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
            if (std::abs(currentPixel[2] - bgBins[p].binValues[s][2]) <= associationThreshold &&
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~
    /private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/src/algorithms/IMBS/IMBS.cpp:317:65: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
              std::abs(currentPixel[1] - bgBins[p].binValues[s][1]) <= associationThreshold &&
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~
    /private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/src/algorithms/IMBS/IMBS.cpp:318:65: warning: comparison of integers of different signs: 'int' and 'unsigned int' [-Wsign-compare]
              std::abs(currentPixel[0] - bgBins[p].binValues[s][0]) <= associationThreshold)
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~
    3 warnings generated.
    [ 18%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/KDE.cpp.o
    [ 19%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/KDE/KernelTable.cpp.o
    [ 20%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/KDE/NPBGSubtractor.cpp.o
    [ 21%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/KDE/NPBGmodel.cpp.o
    [ 22%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/KNN.cpp.o
    [ 23%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBAdaptiveSOM.cpp.o
    [ 24%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBFuzzyAdaptiveSOM.cpp.o
    [ 25%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBFuzzyGaussian.cpp.o
    [ 26%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBMixtureOfGaussians.cpp.o
    [ 27%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF.cpp.o
    [ 28%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF/MEDefs.cpp.o
    [ 29%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF/MEHistogram.cpp.o
    [ 30%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF/MEImage.cpp.o
    [ 31%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF/MotionDetection.cpp.o
    [ 32%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF/graph.cpp.o
    [ 33%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF/maxflow.cpp.o
    [ 34%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBSP/BackgroundSubtractorLBSP.cpp.o
    [ 35%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBSP/BackgroundSubtractorLBSP_.cpp.o
    [ 36%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBSP/BackgroundSubtractorLOBSTER.cpp.o
    [ 37%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBSP/BackgroundSubtractorPAWCS.cpp.o
    [ 38%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBSP/BackgroundSubtractorSuBSENSE.cpp.o
    [ 39%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBSP/LBSP.cpp.o
    /private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/src/algorithms/LBP_MRF/MEImage.cpp:1287:13: error: no matching function for call to 'cvLine'
                cvLine(ME_CAST_TO_IPLIMAGE(cvImg), Point1, Point2, CV_RGB(255, 255, 255), 1, 8);
                ^~~~~~
    /usr/local/Cellar/opencv/4.5.1_2/include/opencv4/opencv2/imgproc/imgproc_c.h:959:14: note: candidate function not viable: no known conversion from 'cv::Scalar' (aka 'Scalar_<double>') to 'CvScalar' for 4th argument
    CVAPI(void)  cvLine( CvArr* img, CvPoint pt1, CvPoint pt2,
                 ^
    1 error generated.
    make[2]: *** [CMakeFiles/bgslibrary_core.dir/src/algorithms/LBP_MRF/MEImage.cpp.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    [ 40%] Building CXX object CMakeFiles/bgslibrary_core.dir/src/algorithms/LBSP/LBSP_.cpp.o
    make[1]: *** [CMakeFiles/bgslibrary_core.dir/all] Error 2
    make: *** [all] Error 2
    error: command 'cmake' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/corlangerak/mypython/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/setup.py'"'"'; __file__='"'"'/private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-install-4w3j0xsv/pybgs_15551573f01d467681450e616e64f881/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/77/7sxp8g395yd2p540jz52h_rm0000gn/T/pip-record-5lh6dish/install-record.txt --single-version-externally-managed --compile --install-headers /Users/corlangerak/mypython/include/site/python3.7/pybgs Check the logs for full command output.

I tried building it from source but the same thing happend.... Not sure what to do? Maybe I am missing something or is this an unknown errror? All help would be greatly appreciated.

jnissin commented 3 years ago

It looks like this is related to the OpenCV version. This has been discussed in issue #178 . Downgrading OpenCV to version 3.4.7 should fix the issue.

andrewssobral commented 2 years ago

Hi @corlangerak @jnissin , sorry for my delayed feedback. I just released a new version of the BGSLibrary, now v3.1.0. I tested it on Windows, Mac and Linux, both compiling the C++ library on OpenCV 3.4.7, 3.4.16 and 4.6.0. I also tested its respective Python wrapper and GT user interface. Everything is working for me, could you please check in your side if this new version fix your issues? Thanks in advance, Andrews

KhanMechAI commented 1 year ago

Confirmed, I am able to install it on an M1 Mac:

❯ pip list
Package       Version
------------- -----------
certifi       2022.12.7
numpy         1.24.2
opencv-python 4.6.0.66
pip           22.3.1
pybgs         3.2.0.post1
setuptools    65.6.3
wheel         0.37.1

Just make sure to install opencv-python first - i.e. pip install opencv-python==4.6.0.66 pybgs wont cut it.

KhanMechAI commented 1 year ago

Actually I should add that even though I'm able to install it I'm not able to use it. Importing gives SIGSEGV

andrewssobral commented 1 year ago

Hi @KhanMechAI ,

I'm sorry to inform you that pybgs does not work with the opencv-python package as it was specifically designed for Python-only projects. If you want to use pybgs, you will need to install OpenCV from scratch because pybgs requires the compilation of some C++ modules.

Let me know if you have any questions or need help with the installation process.