Skip to content

Instantly share code, notes, and snippets.

@partofthething
Created October 5, 2015 01:31
Show Gist options
  • Save partofthething/bb27d99d85b5d0c6d58d to your computer and use it in GitHub Desktop.
Save partofthething/bb27d99d85b5d0c6d58d to your computer and use it in GitHub Desktop.
Getting pixel intensity vs. time for reading a Crookes radiometer
import cv2
def measureIntensities(videoFileName, pointOfInterest):
"""
Find the intensity of a point of interest for each frame
"""
video = cv2.VideoCapture(videoFileName)
intensities = []
while video.isOpened():
_returnCode, frame = video.read()
if frame is None:
break
pixelValues = frame[pointOfInterest]
intensities.append(pixelValues.sum())
video.release()
return intensities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment