Install OpenCV 4.1.2 on Raspbian Buster
$ chmod +x *.sh
$ ./download-opencv.sh
$ ./install-deps.sh
$ ./build-opencv.sh
$ cd ~/opencv/opencv-4.1.2/build
$ sudo make install
Install OpenCV 4.1.2 on Raspbian Buster
$ chmod +x *.sh
$ ./download-opencv.sh
$ ./install-deps.sh
$ ./build-opencv.sh
$ cd ~/opencv/opencv-4.1.2/build
$ sudo make install
import cv2 | |
import numpy as np | |
def connected_components(thresh_img): | |
thresh_img = mog_mask.copy() | |
contours, hierarchy = cv2.findContours(thresh_img, cv2.RETR_TREE, | |
cv2.CHAIN_APPROX_SIMPLE) | |
fg_mask = np.zeros(frame.shape[:2], np.uint8) | |
i = 0 | |
cs = [] |
Useful tip from the late creator of matplotlib, John Hunter.
http://matplotlib.1069221.n5.nabble.com/dynamically-add-subplots-to-figure-td23571.html
import matplotlib.pyplot as plt
# start with one
fig = plt.figure()
ax = fig.add_subplot(111)