Created
March 4, 2010 18:40
-
-
Save pklaus/322004 to your computer and use it in GitHub Desktop.
Time-lapse Photography Using Python S60
This file contains hidden or 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
obexftp.exe -b 00:14:5d:5b:53:fc -B 11 --chdir /E:/Python/ --put ./time_lapse.py |
This file contains hidden or 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
#!/usr/bin/env python | |
# -*- encoding: UTF8 -*- | |
# Python s60 3rd Edition -- Time lapse Photography for Nokia N80 | |
# Code by Anteater -- http://blog.foozia.com | |
# originally from adam on <http://blog.umlungu.co.uk/blog/2007/jan/21/python-s60-time-lapse-photography-using-nokia-n80/> | |
# modified by Raut <http://blog.umlungu.co.uk/blog/2007/jan/21/python-s60-time-lapse-photography-using-nokia-n80/#c120> | |
import appuifw, e32 | |
import time | |
import camera | |
import os | |
import graphics | |
imageSizesDisplay = [u'1280,960',u'800,600',u'640,480'] | |
imageSizes = [(1280,960),(800,600),(640,480)] | |
flashModes = [u'auto', u'none', u'red_eye_reduce', u'forced'] | |
exposureModes = [u'auto',u'center',u'backlight',u'night'] | |
whiteBalance = [u'daylight',u'fluorescent',u'tungsten',u'auto',u'cloudy'] | |
imageSizeSelect = appuifw.selection_list(choices=imageSizesDisplay) | |
flashModeSelect = appuifw.selection_list(choices=flashModes) | |
exposureModeSelect = appuifw.selection_list(choices=exposureModes) | |
whiteBalanceSelect = appuifw.selection_list(choices=whiteBalance) | |
i=0 | |
starttime=time.time() | |
os.mkdir('E:\Images\%f'%(starttime)) | |
appuifw.app.screen='full' | |
appuifw.app.body=canvas=appuifw.Canvas() | |
while True: | |
phototime=time.time() | |
##Images are captured with 640x480 resolution..If you change it, make sure your camera supports it. Night mode etc is not used. | |
Img=camera.take_photo(size=imageSizes[imageSizeSelect],flash=flashModes[flashModeSelect],exposure=exposureModes[exposureModeSelect],white_balance=whiteBalance[whiteBalanceSelect]) | |
canvas.blit(Img.resize(canvas.size)) | |
## print "captured %d"%(i) | |
Img.save("E:\Images\%f\%s.jpg"%(starttime,str(i).zfill(6))) | |
## print "saved %d"%(i) | |
savetime=time.time() | |
timediff=savetime-phototime | |
## print sleepcount-timediff | |
## change this to change the time between each pic | |
time.sleep(30) | |
i=i+1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment