Permalink
Browse files

Allow rotation of images

  • Loading branch information...
hulmgulm committed Mar 25, 2017
1 parent f9cc07a commit f8c58aa6f38e444621a57d316b5bdc3084e8ef11
Showing with 13 additions and 0 deletions.
  1. +6 −0 README.md
  2. +3 −0 example.config.yml
  3. +4 −0 timelapse.py
View
@@ -98,6 +98,12 @@ White balance values on the Raspberry Pi camera are set by adjusting the red and
Note: These values will be updated over time as I find more time to calibrate my Pi camera against a few DSLRs and other devices which are much more accurate! Please file an issue if you can help make these mappings better, or find a nicer way to adjust calibrations rather than a `red_gain` and `blue_gain` value.
### Rotation
Depending on the placement of your camera, the picture taken could be upside down. To correct this, the
camera offers a possibility to rotate the images by `90`, `180` or `270` degrees. Use `0` to not rotate
the images.
## License
MIT License.
View
@@ -34,3 +34,6 @@ shutter_speed: 0
white_balance: { }
# red_gain: 1.3
# blue_gain: 1.75
# Rotate the images taken by the camera. Possible value are 0, 90, 180 or 270
rotation: 0
View
@@ -38,6 +38,10 @@ def create_timestamped_dir(dir):
camera.awb_mode = 'off'
camera.awb_gains = (config['white_balance']['red_gain'], config['white_balance']['blue_gain'])
# Set camera rotation
if config['rotation']:
camera.rotation = config['rotation']
# Capture images in series.
for i in range(config['total_images']):
camera.capture(dir + '/image{0:05d}.jpg'.format(i))

0 comments on commit f8c58aa

Please sign in to comment.