User Tools

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
isp:automatic_exposure [2018/06/05 06:03] – [Global Gain] Vanda Khachatrianisp:automatic_exposure [2022/04/04 23:32] (current) – external edit 127.0.0.1
Line 70: Line 70:
 Once we have the above two factors figured out the decision tree looks as follows: Once we have the above two factors figured out the decision tree looks as follows:
 <code cpp> <code cpp>
-enum class ExpCorrAction{STAYINCDEC};+enum class ExpCorrAction{stayincdec};
 ExpCorrAction _needExpCorrection(int _right, double _adjY){ ExpCorrAction _needExpCorrection(int _right, double _adjY){
-    if(_right > 60 && _adjY < 0.97){ +    if(_right > 60 && _adjY < 1){ 
-        return ExpCorrAction::DEC;  // there are pixels at level 100+ and we were asked to dim the image+        return ExpCorrAction::dec;  // there are pixels at level 100+ and we were asked to dim the image
     }     }
     if(_right >= 250 && _adjY <= 1){     if(_right >= 250 && _adjY <= 1){
-        return ExpCorrAction::DEC;  // there are more overexposed pixels than the threshold and dimming the image+        return ExpCorrAction::dec;  // there are more overexposed pixels than the threshold and dimming the image
     }     }
-    if(_right < 240 && _adjY > 1.2){ +    if(_right < 240 && _adjY > 1){ 
-        return ExpCorrAction::INC;  // there's room to grow and asked to increase brightness+        return ExpCorrAction::inc;  // there's room to grow and asked to increase brightness
     }     }
-    return ExpCorrAction::STAY;+    return ExpCorrAction::stay;
 } }
 </code> </code>
Line 89: Line 89:
   - If we have not reached the limit on Exposure setting - increase it by multiplying by the target/real brightness ratio   - If we have not reached the limit on Exposure setting - increase it by multiplying by the target/real brightness ratio
   - Else, if we have not hit the Global Gain limit - increase it by multiplying by the target/real brightness ratio   - Else, if we have not hit the Global Gain limit - increase it by multiplying by the target/real brightness ratio
-  - Else (special case!) **only** if the auto-white balance is currently turned **on** and if the brightness adjustment is very high (above ''4'') and if the Red and Blue channel'Gains are not maxed out then **carefully** increase the Green Gain. By "carefully" I mean the following:+  - Else (special case!) **only** if the auto-white balance is currently turned **on** and if the brightness adjustment is very high (above ''4'') and if the Red and Blue channels' Gains are not maxed outthen **carefully** increase the Green Gain. By "carefully" I mean the following:
     - Never increase the Green Gain beyond ''1180''     - Never increase the Green Gain beyond ''1180''
     - Only increase the Green Gain as much as to not cause the overflow for the Gains in Red or Blue channels (take a conservative guess and then lower it by another ''5%'')     - Only increase the Green Gain as much as to not cause the overflow for the Gains in Red or Blue channels (take a conservative guess and then lower it by another ''5%'')
Line 106: Line 106:
 In order to automate this process one could think of Black Level as the counterpart to the overexposure. The goal is to have the Black Level set at such value as to ensure that there are no more than specified overexposure pixel count that are pitch black. In order to automate this process one could think of Black Level as the counterpart to the overexposure. The goal is to have the Black Level set at such value as to ensure that there are no more than specified overexposure pixel count that are pitch black.
  
-====== Further improvements ======+===== Sample implementation in C++ =====
  
 +[[Sample AE implementation in C++]] shows one possible implementation of the approach described above. It does use (without much explanation) some of the external structures, but those should not be hard to comprehend from their usage

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also, you acknowledge that you have read and understand our Privacy Policy. If you do not agree, please leave the website.

More information