Skip to content

Instantly share code, notes, and snippets.

@willprice
willprice / README.md
Last active February 8, 2023 21:27
Install OpenCV 4.1.2 for Raspberry Pi 3 or 4 (Raspbian Buster)

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
@garybradski
garybradski / connected_components.py
Created December 9, 2017 00:17
Connected Components in Python
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 = []
@LeoHuckvale
LeoHuckvale / gist:89683dc242f871c8e69b
Created February 2, 2015 16:53
matplotlib - Add subplots dynamically