[OTHER] Exposure Bracket Function
See original GitHub issuehey guys. thank you for your dedication towards developing picamera2 further
[Exposure Bracketing]
from picamera2 import *
from time import sleep
from fractions import Fraction
# This script captures exposures with varying shutter time.
# The frame rate needs to be longer than the exposure or it won't work.
# The capture takes as long as the frame rate, so reducing the frame rate saves time for quick exposures.
with picamera2.Picamera2() as camera:
camera.resolution = (4056,3040)
#camera.framerate = Fraction(1, 2)
camera.iso = 100
camera.exposure_mode = 'off'
camera.awb_mode = 'off'
camera.awb_gains = (1.8,1.8)
config = camera.create_still_configuration()
camera.configure(config)
camera.set_controls({"ExposureTime": 114, "AnalogueGain": 1})
camera.start()
camera.capture_file('0.jpg')
print(camera.capture_metadata())
camera.stop()
camera.set_controls({"ExposureTime": 300, "AnalogueGain": 0.5})
camera.start()
camera.capture_file('1.jpg')
print(camera.capture_metadata())
camera.stop()
camera.set_controls({"ExposureTime": 500, "AnalogueGain": 0.5})
camera.start()
camera.capture_file('2.jpg')
print(camera.capture_metadata())
camera.stop()
camera.close()
Any suggestions for improving my python code in terms of smartness. All setting should remain constant expect for exposure time/shutter speed. For example FocusFoM, ColourGains, Colourcorrectionsmatrix, Lux seems to change in my series.
The idea is to generate a HDR Image via multi exposure fusion algorthmn. Use case for solar power prediction.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:16
Top Results From Across the Web
Exposure Bracketing Photography [COMPLETE GUIDE]
HDR stands for high dynamic range. The goal of an HDR photography is to increase the normal dynamic range of your camera, giving...
Read more >What Is Bracketing? Definition, Examples & How To Use ...
Photographers bracket their shots by taking a series of photographs at different exposures. This is done to capture more detail in the shadows...
Read more >How to Use Bracketing to Create Perfect Photos - MasterClass
5. Exposure bracketing: Bracket exposures offer variation in either aperture, shutter speed, or ISO, thus granting a photographer more post- ...
Read more >Bracketing - Wikipedia
For other uses, see Bracketing (disambiguation). ... In photography, bracketing is the general technique of taking several shots of the same subject using ......
Read more >Bracketing in Photography: The Ultimate Guide
The great thing about bracketing is it allows you to experiment with different exposure settings the the press of one button instead of...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, just a few things to comment on:
camera.iso = 100
is an idiom from PiCamera, not Picamera2. You need to set these values using (for example)camera.set_controls(...)
. In fact there is no ISO control in libcamera, you just set the (analogue) gain directly.awb_gains
, that’s a PiCamera thing, in Picamera2 it’scamera.set_controls({"ColourGains": (1.8, 1.8)})
."AnalogueGain": 1.0
instead?I’m not quite sure what’s going wrong for you. I took your script, deleted all the stuff after the captures (which I can’t run anyway), and rolled them up into a loop, just so that I was editing less code. Here’s what I ended up with:
For me this code works perfectly. It completes in just over 7s with no errors. I also tried running the
exposure_bracket
function using themultiprocessing
module, and that too seems to work fine.Are you able to try this?
I’ll also lock this thread so that the discussion can continue on the issue that’s still open, if that’s OK. Thanks!