Designed auto exposure algorithm to get a proper camera param,dose it make sense

你离开我真会死。 提交于 2019-12-24 20:54:49

问题


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:

  1. Set the desired_brightness=150.0,get the current_brightness based on the picture
  2. Get the current iso and shutterspeed,calculate the current_ev
  3. brightness_ratio=log2(desired_brightness)/log2(current_brightness)
  4. desired_ev=current_ev*brightness_ratio
  5. Get the shutterspeed and iso based on the target_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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!