apps/autoexposure/aexp_corr.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void initAexpCorr (void)
int aexpCorr (int color, int frame, int target_frame)
 P_AUTOEXP_OVEREXP_MAX - temporary.


Function Documentation

int aexpCorr ( int  color,
int  frame,
int  target_frame 
)

P_AUTOEXP_OVEREXP_MAX - temporary.

TODO: if there were no new histograms - just skip to the next frame TODO: Add errors until they are above threshold (simplified logariphm)? TODO: Add non-linear function to expand near-saturation area (and then experiment with such a function) TODO: Don't correct colors when large exposure changes were made TODO: fix exposure when the green is not the highest. Or is it a problem with white balance, not the AE? AE - when gain as above ~0x430/0x400 TODO: Maybe switch autoexposure to "color mode" if green is not highest?

lower byte

next byte

don't try to synchronize to availble histograms

autoexposure is turned off

too early to bother

======= 0 here

get (approximate if not updated) percentile for dim (1 scanline exposure) image -to use as a zero point exposure

measure

sets global hist_index, gamma_index

histogram is too old - try again

will request histogram for this frame

repeat up to 8 times trying to get a fresh histogram

sets global hist_index, gamma_index

histogram is too old - try again

will request histogram for this frame

calculate sensor level from gamma_level using gamma table whisth hash32 saved at hist_index

getPercentile() failed

overexposure recovery

global counter

NOTE: Maybe just dividing exposure by 2 /counter is enough?

no overexposition

get_imageParamsThatValid() failed

wrong/obsolete dim level - ignore it to avoid negatives)

*** more aggressive

Add some protection from autoexposure going crazy

for now treat as number of lines TODO: change to usec?

temporary limit

How many frames the exposure correction has to be the same sign before it will be applied (<128)

======= 1 here

try again next frame (extend in HDR)

too little error - no change in exposure

reset error accumulator

Now apply that new exposure ANd request

Definition at line 56 of file aexp_corr.c.

References aex_recover_cntr, DEFAULT_AE_PERIOD_CHANGE, DEFAULT_AE_PERIOD_NOCHANGE, fd_fparmsall, framePars, FRAMEPARS_SETFRAME, G_AE_INTEGERR, G_HIST_DIM_01, G_HIST_DIM_23, G_NEXT_AE_FRAME, gammaReverse(), get_imageParamsThatValid(), getPercentile(), GLOBALPARS, hist_index, histogram_cache, level, LSEEK_FRAME_WAIT_ABS, MDF1, MDF3, P_AE_PERIOD, P_AE_THRESH, P_AEXP_FRACPIX, P_AEXP_LEVEL, P_AUTOEXP_EXP_MAX, P_AUTOEXP_ON, P_VEXPOS, framepars_t::pars, PARS_FRAMES_MASK, poorLog(), SEEK_END, stderr, this_frame, and write.

Referenced by main().

void initAexpCorr ( void   ) 

*************************************************************************** ! FILE NAME : aexp_corr.c ! DESCRIPTION: Autoexposure part of the autoexposure/white balance/hdr daemon ! Copyright (C) 2008 Elphel, Inc. ! -----------------------------------------------------------------------------** ! This program is free software: you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation, either version 3 of the License, or ! (at your option) any later version. ! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. ! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see <http://www.gnu.org/licenses/>. ! -----------------------------------------------------------------------------** ! !

Log
aexp_corr.c,v
! Revision 1.1.1.1 2008/11/27 20:04:01 elphel ! ! ! Revision 1.2 2008/11/18 19:30:16 elphel ! Added initialization of the "next" frame - otherwise it wait _very_ long if the camera frame number is reset ! ! Revision 1.1 2008/11/15 23:08:24 elphel ! 8.0.alpha17 - split autoexposure source file ! !

NOTE - autoexposure was stuck for a hours when I tried resetting frame number...

Definition at line 34 of file aexp_corr.c.

References G_NEXT_AE_FRAME, and GLOBALPARS.

Referenced by initParams().


Generated on Fri Nov 28 00:06:40 2008 for elphel by  doxygen 1.5.1