问题
I want to get pictures from:
fnumber=6.3;
iso_list=[100,200,300,400,500,600,700,800];
shutterspeed_list=[1,1/2,1/3,1/4,1/5,1/6];
Choose the best pair iso
and shutterspeed
to get picture with appropriate brightness (the brightness=150.0) based on the exposure value.
I think i can solve like this:
- Set the
desired_brightness=150.0
,get thecurrent_brightness
based on the picture - Get the current
iso
andshutterspeed
,calculate thecurrent_ev
brightness_ratio=log2(desired_brightness)/log2(current_brightness)
desired_ev=current_ev*brightness_ratio
- Get the
shutterspeed
andiso
based on thetarget_ev
Here is the code:
def get_target_ev(self,cur_bright,tar_bright,shutterspeed,iso):
f=6.3
bright_ratio=math.log(tar_bright,2)/math.log(cur_bright,2)
cur_ev=math.log(f*f*shutterspeed,2)+math.log(iso/100.0,2)
target_ev=cur_ev*bright_ratio
return target_ev
Does it make sense?
来源:https://stackoverflow.com/questions/54802678/designed-auto-exposure-algorithm-to-get-a-proper-camera-param-dose-it-make-sense