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
Next revisionBoth sides next revision
isp:sample_awb_implementation_in_c [2018/06/15 01:09] – [Constructor AWB::AWB] Igor Yefmovisp:sample_awb_implementation_in_c [2018/06/16 03:41] – [AWB::_correctGains()] Igor Yefmov
Line 194: Line 194:
 <code c++>void AWB::_resetRed() <code c++>void AWB::_resetRed()
 { {
-    const int gainG = m_ov[Val::GAIN_G]; +    const int gainG = m_ov[Val::gain_g]; 
-    const int gainR = m_ov[Val::GAIN_R];+    const int gainR = m_ov[Val::gain_r];
     if(gainR > gainG){     if(gainR > gainG){
         const auto diff = (gainG - gainR) * 5 / 8;  // 62.5% closer to green gain value         const auto diff = (gainG - gainR) * 5 / 8;  // 62.5% closer to green gain value
-        m_ov[Val::GAIN_R] = gainR + diff;+        m_ov[Val::gain_r] = gainR + diff;
     }     }
 }</code> }</code>
Line 212: Line 212:
     assert(m_vars.op == Action::correctGains);     assert(m_vars.op == Action::correctGains);
  
-    const auto limit = m_ov.getLimit(Val::GAIN_G); // assume the same limit for all 3 channels+    const auto limit = m_ov.getLimit(Val::gain_g); // assume the same limit for all 3 channels
     const double precision = 0.1;     const double precision = 0.1;
  
Line 220: Line 220:
         //m_vars.avgB /= blueAdj;         //m_vars.avgB /= blueAdj;
         const auto gb = m_vars.avgB == 0 ? 0 : m_vars.avgG / m_vars.avgB;         const auto gb = m_vars.avgB == 0 ? 0 : m_vars.avgG / m_vars.avgB;
-        const int gainB = _box(m_ov[Val::GAIN_B] * gb, 10, limit); +        const int gainB = _box(m_ov[Val::gain_b] * gb, 10, limit); 
-        m_ov[Val::GAIN_B] = gainB;+        m_ov[Val::gain_b] = gainB;
     }     }
  
     if(abs(m_vars.avgV) > precision){     if(abs(m_vars.avgV) > precision){
         const auto gr = m_vars.avgR == 0 ? 0 : m_vars.avgG / m_vars.avgR;         const auto gr = m_vars.avgR == 0 ? 0 : m_vars.avgG / m_vars.avgR;
-        const int gainR = _box(m_ov[Val::GAIN_R] * gr, 10, limit); +        const int gainR = _box(m_ov[Val::gain_r] * gr, 10, limit); 
-        m_ov[Val::GAIN_R] = gainR;+        m_ov[Val::gain_r] = gainR;
     }     }
 } }

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