Skip to content

Instantly share code, notes, and snippets.

@eWizardII
Created September 29, 2013 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eWizardII/6756689 to your computer and use it in GitHub Desktop.
Save eWizardII/6756689 to your computer and use it in GitHub Desktop.
Snippet
try:
print "Initial Image ..."
time = datetime.datetime.now()
filename = "image_"
subprocess.call(
"raspistill -t 1000 -ex night -awb auto -w 720 -h 480 -o %s" % filename + '1.jpg',
shell=True)
prev = filename + '1.jpg'
i = 1
summ = smasumm = 0.0
period = n = 10
values = deque([0.0] * period)
while True:
time = datetime.datetime.now()
filename = "image_" + str(i) + ".jpg"
subprocess.call(
"raspistill -t 1000 -ex night -awb auto -w 720 -h 480 -o %s" % filename,
shell=True)
#print time
i += 1
curr = filename
#thread.start_new_thread(image_entropy, (prev, curr,i, ))
sma = image_entropy(prev, curr, smasumm, values)
values.append(sma)
summ += sma - values.popleft()
smasumm = summ / n
prev = curr
print(datetime.datetime.now() - time)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment