AttributeError: module 'cv2.cv2' has no attribute 'bgsegm' code example
Example 1: module 'cv2.cv2' has no attribute 'imWrite'
pip install opencv-contrib-python
Example 2: module 'cv2.cv2' has no attribute 'videowriter'
#for opencv3 do this
cv2.VideoWriter_fourcc(*'MJPG')