Re: Setting up white balance on a t613 camera

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 27 Jan 2010 15:17:53 -0200
Nicolau Werneck <nwerneck@xxxxxxxxx> 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/
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux