On Sunday 08 March 2009 01:24:05 Stefan Krastanov wrote: > OK guys, I was serious when I said different background so to be sure I did > not mess up (patch & co. are new tool for me) I will write every command I > used: > > #patch micron.c 0001-Fix-set_exposure-for-mt9v111-and-mt9v011.patch //it > worked - I checked it - sorry if sounding silly :-) > #make > #sudo rmmod sn9c20x > #insmod ./snc20x.ko > #LD_PRELOAD=/usr/lib/libv4l/v4l2convert.so mplayer tv:// -tv > driver=v4l2:width=640:height=480:fps=25:device=/dev/video0 -vo x11 -zoom > > No good. > > I illuminated my face with a lamp and the oscillation started again. > > I have build the docs and found dev_sn9c20x_perform_soft_ae and as far as I > understand you have yavg which must be between min_yavg and max_yavg and > that new yavg is computed as linear function of the old yavg.(I have > absolutely no idea where yavg comes from, but it seems I don't need to know > that) > > OK. I believe that the oscilation can be stoped if instead of only using > old_yavg we use old_yavg and older_yavg(the second generation old_yavg) and > creating something analogues to "pendulum with attenuation" - "a second > order recurrent series with negative real coefficient". I'm sorry if I am > using funy words, it's just that I am a physics student and that's the way > I'm accustomed to. > > OK. I will try to do it tomorrow(it's quite late hour here), but please > stop me if am doing senseless stuff. > > Best regards > Stefan Krastanov
Well, actually it's a little bit more complicated that just a linear function :) Let's call it "linear function with calibration" :) When yavg (average luminance) value is out of range (min_yavg; max_yavg) , algorithm tries to get it into (min_stable_yavg; max_stable_yavg) range with linear function, but with some correction. Here's example: Initially it assumes that yavg depends on exposure value linearly. Lets assume that yavg is too low, it calculates new exposure value based on following formula: min_stable_yavg / current_yavg = min_stable_exposure / current exposure. On next iteration it checks if exposure is OK, and if it's too high, it calculates correction coefficient (calibration), and tries to use it in next iterations. Btw, if it is not very clear to you - just look through dev_sn9c20x_perform_soft_ae() function in sn9c20x-dev.c Regards Vasily
signature.asc
Description: This is a digitally signed message part.
