Skip to content

Instantly share code, notes, and snippets.

@aravindpai
Created March 30, 2020 13:39
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save aravindpai/e028f8441681677bfae1c4fd5934788d to your computer and use it in GitHub Desktop.
nonzero=[]
for i in range((len(images)-1)):
mask = cv2.absdiff(images[i],images[i+1])
_ , mask = cv2.threshold(mask, 50, 255, cv2.THRESH_BINARY)
num = np.count_nonzero((mask.ravel()))
nonzero.append(num)
x = np.arange(0,len(images)-1)
y = nonzero
plt.figure(figsize=(20,4))
plt.scatter(x,y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment