Skip to content

Commit

Permalink
basic working tests
Browse files Browse the repository at this point in the history
  • Loading branch information
afolarin committed Jan 7, 2020
0 parents commit 8b00788
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
Empty file added README.md
Empty file.
14 changes: 14 additions & 0 deletions capture-seq/camera-test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from picamera import PiCamera;
from time import sleep

camera = PiCamera()

#camera upside down so flip
camera.rotation = 180
#camera.exposure_mode = 'nightpreview'

camera.start_preview()
for i in range(20):
sleep(3)
camera.capture('/home/pi/Desktop/raspi-cam/dad-test/cat-spy_%s.jpg' % i)
camera.stop_preview()
29 changes: 29 additions & 0 deletions composite-img/pil-composite.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
from PIL import Image
dir = "/home/pi/Desktop/raspi-cam/dad-test/"
fname="cat-spy_"
nimages = range(1,20,1)
compositeImage = Image.open(dir+fname+"%s.jpg" % 0) #image 0 is base
compositeImage.putalpha(1)
blendedImage = Image.open(dir+fname+"%s.jpg" % 0) #image 0 is base
blendedImage.putalpha(1)



for i in nimages:
#bufImage = Image.open("fname%s.jpg" % i)
currImage = Image.open(dir+fname+"%s.jpg" % i)
currImage.putalpha(1)
#alpha composite
compositeImage = Image.alpha_composite(compositeImage, currImage)

#blended image
blendedImage = Image.blend(blendedImage, currImage, .1)

#save
compositeImage.save(dir+"composite-test.jpg")
blendedImage.save(dir+"blended-test.jpg")


#show composites
compositeImage.show()
blendedImage.show()
7 changes: 7 additions & 0 deletions timelapse/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#using avconv to create a timelapse with non-zero prefixed input image numbering
#i.e. 1,2,3...300 rather than 0001,0002,...300.respectively image%00d.jpg rather than obased image%03d.jpg)
avconv -r 10 -i cat-spy_%00d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 timelapse.mp4

if using a padded numbering system then use e.g. for 3 prefix padded zeros:
avconv -r 10 -i cat-spy_%04d.jpg -r 10 -vcodec libx264 -crf 20 -g 15 timelapse.mp4

0 comments on commit 8b00788

Please sign in to comment.