-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8b00788
Showing
4 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
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
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() |
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
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() |
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
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 | ||
|