Created
October 5, 2015 01:31
-
-
Save partofthething/bb27d99d85b5d0c6d58d to your computer and use it in GitHub Desktop.
Getting pixel intensity vs. time for reading a Crookes radiometer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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