Breakthrough / DVR-Scan

:vhs: Tool for extracting scenes with motion from videos (e.g. security camera or DVR footage). Written in Python, uses OpenCV.
http://www.dvr-scan.com/
Other
362 stars 47 forks source link

cv2 package got renamed to opencv-python and is now at 4.8.0.76 #140

Closed mmokrejs closed 8 months ago

mmokrejs commented 10 months ago

Hi, please update the Documentation explaining how to instal cv2 package. Seems it got renamed to opencv-python. Quoting from https://pypi.org/project/opencv-python/ :

Q: Why the package and import are different (opencv-python vs. cv2)?

A: It's easier for users to understand opencv-python than cv2 and it makes it easier to find the package with search engines. cv2 (old interface in old OpenCV versions was named as cv) is the name that OpenCV developers chose when they created the binding generators. This is kept as the import name to be consistent with different kind of tutorials around the internet. Changing the import name or behaviour would be also confusing to experienced users who are accustomed to the import cv2.

Still, dvr-scan bails on me with:

[DVR-Scan] Method CNT is not available. To enable it, install a version of the OpenCV package cv2 that includes support for it.

Probably it tries to import the library under the old name?

$ pip list
Package           Version
----------------- --------
appdirs           1.4.4
click             8.1.3
cv2-tools         2.4.0
dvr-scan          1.5.1
ImageHash         4.3.1
numpy             1.24.3
opencv-python     4.8.0.76
Pillow            10.0.0
pip               23.2.1
platformdirs      3.5.3
python-constraint 1.4.0
PyWavelets        1.4.1
scenedetect       0.6.1
scipy             1.11.2
screeninfo        0.8.1
setuptools        67.7.2
tqdm              4.65.0
$

Is it compatible with 4.8.0.76 anyway? Thank you.

Breakthrough commented 10 months ago

Hello @mmokrejs ; Thanks for pointing this out, that is useful to include I agree.

To use CNT, I think you may also need the opencv-contrib-python as well. Can you install that and see if it works?

Thank you!

mmokrejs commented 10 months ago

Hi @Breakthrough , right, pip install opencv-contrib-python did the trick.