econsystems / opencv

Easy way to communicate with the camera using this OpenCV patch in c++
38 stars 18 forks source link

Prebuilt Binaries Don't Work on v1.0.4: 'cv2.VideoCapture' object has no attribute 'getDevices' #8

Closed flolu closed 2 years ago

flolu commented 2 years ago

Since I wasn't able to build v1.0.4 manually (#7), I'm trying to use the prebuilt binaries. But running the following command

sudo PYTHONPATH="./cv2/" LD_LIBRARY_PATH="./lib/" python3 ~/Downloads/opencv-1.0.4/Source/PythonScript/main.py

inside the ~/Downloads/opencv-1.0.4/Binary/Opencv_4.5.5/Linux/18.04_x64 directory throws the following error:

******************************** E-con's OpenCV Python Application *********************************
                                 OpenCV Python App Version = 1.0.4                                  
Running in Linux Platform
Traceback (most recent call last):
  File "/home/flolu/Downloads/opencv-1.0.4/Source/PythonScript/main.py", line 172, in <module>
    main = MainClass()
  File "/home/flolu/Downloads/opencv-1.0.4/Source/PythonScript/main.py", line 43, in __init__
    self.main_menu_init()
  File "/home/flolu/Downloads/opencv-1.0.4/Source/PythonScript/main.py", line 57, in main_menu_init
    device_info = Device.list_devices(self.cap)
  File "/home/flolu/Downloads/opencv-1.0.4/Source/PythonScript/device.py", line 22, in list_devices
    ret, device_count = cap.getDevices()
AttributeError: 'cv2.VideoCapture' object has no attribute 'getDevices'
flolu commented 2 years ago

I made it work by using Ubuntu 20.04 LTS and running

sudo PYTHONPATH="./cv2/" LD_LIBRARY_PATH="./lib/" python3 ~/Downloads/opencv-1.0.4/Source/PythonScript/main.py

inside

~/Downloads/opencv-1.0.4/Binary/Opencv_4.5.5/Linux/20.04_x64