From: Jean-Francois Moine <moinejf@free.fr>
To: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: Setting up white balance on a t613 camera
Date: Wed, 27 Jan 2010 19:37:28 +0100 [thread overview]
Message-ID: <20100127193728.0a75ba1e@tele> (raw)
In-Reply-To: <20100127171753.GA10865@pathfinder.pcs.usp.br>
On Wed, 27 Jan 2010 15:17:53 -0200
Nicolau Werneck <nwerneck@gmail.com> wrote:
> Answering my own question, and also a question in the t613 source
> code...
>
> Yes, the need for the "reg_w(gspca_dev, 0x2087);", 0x2088 and 0x2089
> commands are definitely tied to the white balance. These three set up
> the default values I found out. And (X << 8 + 87) sets up the red
> channel parameter in general, and 88 is for green and 89 for blue.
>
> That means I can already just play with them and see what happens. My
> personal problem is that I bought this new lens, and the image is way
> too bright, and changing that seems to help. But I would like to offer
> these as parameters the user can set using v4l2 programs. I can try
> making that big change myself, but help from a more experienced
> developer would be certainly much appreciated!...
Hello Nicolau,
The white balance is set in setwhitebalance(). Four registers are
changed: 87, 88, 89 and 80.
Looking at the traces I have, these 4 registers are loaded together only
one time in an exchange at startup time. Then, the white balance
control adjusts only blue and red values while reloading the same value
for the green register (that's what is done for other webcams), and the
register 80 is not touched. In the different traces, the register 80
may be initialized to various values as 3c, ac or 38 and it is not
touched later. I do not know what it is used for.
I may also notice that the green value in the white balance exchanges
may have an other value than the default 20. I do not know which is the
associated control in the ms-win driver. If it is exposure, you are
done. So, one trivial patch is:
- add the exposure control with min: 0x10, max: 0x40, def: 0x20.
- modify the whitebalance control with min: -16, max +16, def:0.
- there is no function setexposure() because the exposure is the value
of green register. Both controls exposure and white balance call the
function setwhitebalance().
- in the function setwhitebalance(), set the green value to the
exposure, the red value to (exposure + whitebalance) and blue value
to (exposure - whitebalance) and load only the registers 87, 88 and
89.
An other way could be to implement the blue and red balances in the
same scheme, and to remove the whitebalance.
Cheers.
--
Ken ar c'hentañ | ** Breizh ha Linux atav! **
Jef | http://moinejf.free.fr/
next prev parent reply other threads:[~2010-01-27 18:35 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-26 17:00 Setting up the exposure time of a webcam Nicolau Werneck
2010-01-26 18:18 ` Theodore Kilgore
2010-01-26 18:11 ` Nicolau Werneck
2010-01-26 18:37 ` Jean-Francois Moine
2010-01-27 13:14 ` leandro Costantino
2010-01-27 16:37 ` Setting up white balance on a t613 camera Nicolau Werneck
2010-01-27 17:17 ` Nicolau Werneck
2010-01-27 18:37 ` Jean-Francois Moine [this message]
2010-01-27 19:03 ` leandro Costantino
2010-01-28 12:09 ` Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100127193728.0a75ba1e@tele \
--to=moinejf@free.fr \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox