Skip to content

Instantly share code, notes, and snippets.

@burrussmp
Created April 26, 2020 20:01
Show Gist options
  • Save burrussmp/1af4d7194539d7f0de1cf3a59f3a14b3 to your computer and use it in GitHub Desktop.
Save burrussmp/1af4d7194539d7f0de1cf3a59f3a14b3 to your computer and use it in GitHub Desktop.
import cv2
import numpy as np
def calculate_hull(img,sensitivity=0.25):
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
gray = np.float32(gray)
corners = cv2.goodFeaturesToTrack(gray, 100, sensitivity, 10)
corners = np.int0(corners)
hull = cv2.convexHull(corners)
return hull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment