Skip to content

Instantly share code, notes, and snippets.

@eLtronicsVilla
Created July 14, 2019 08:32
Show Gist options
  • Save eLtronicsVilla/92c864f3bd02d385e95b49afbf1695ca to your computer and use it in GitHub Desktop.
Save eLtronicsVilla/92c864f3bd02d385e95b49afbf1695ca to your computer and use it in GitHub Desktop.
import numpy as np
import cv2
img = cv2.imread('test.jpg')
imgray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
ret,thresh = cv2.threshold(imgray,127,255,0)
im2, contours, hierarchy = cv2.findContours(thresh,cv2.RETR_TREE,cv2.CHAIN_APPROX_SIMPLE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment