I believe I got it now. And yes - my first idea is senseless. But still I
don't understand that correction - it's like if there is older correction
done, you are changing the formula to (min_stable_yavg / current_yavg)^2 =
min_stable_exposure / current
exposure. Why the square? And why are you aiming at min_stable_yavg or
max_stable_yavg instead at the value exactly in between.

And I see one int i, that I think is not used anywhere, but that's not
important.

I propose to take exposure=a+b*yavg. The only difference is that "a" there.
But "a" will probably be near zero (zero luminosity - zero exposure) so
maybe a better Idea is exposure=a+b*yavg+c*yavg^2. I will try both of them
but I would like to know what are those a,b,c calculated so if I use
UDIA_INFO will I get few of them on dmesg (I'm just copying from the switch
few lines up.) or will I crash something.

Regards
Stefan Krastanov

2009/3/8 Vasily Khoruzhick <[email protected]>

> 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
>

--~--~---------~--~----~------------~-------~--~----~
Lets make microdia webcams plug'n play, (currently plug'n pray)
To post to this group, send email to [email protected]
Visit us online https://groups.google.com/group/microdia
-~----------~----~----~----~------~----~------~--~---

Reply via email to