[sane-devel] any drivers do software calibration?

m. allan noah anoah@pfeiffer.edu
Thu, 5 Jun 2003 17:27:50 -0400 (EDT)

On Thu, 5 Jun 2003, Henning Meier-Geinitz wrote:

> Hi,
> On Thu, Jun 05, 2003 at 02:59:04PM -0400, m. allan noah wrote:
> > with the adf fujitsu scanners, in grayscale or color, we get fine, lightly 
> > colored lines as a part of the scanned image,
> Vertical lines?

yes, as if some small portion of the diode array always reads, even when 
there is just white paper. leads to occasional pink or cyan lines, etc.

> > and the 'background' behind the document when the scan window
> > exceeeds the size of the paper looks mottled gray, as reported on
> > this list.
> That may be the result of the selected gamma, brightness and contrast.

seems to be no way to mess with gamma/brightness/contrast in the hardware, 
there is only an 8bit or 10bit single-color LUT.

> > i can find no way in the interface manual to prevent this in hardware, 
> > though it has been reported that the same scanners under twain do not 
> > display these problems.
> > 
> > hence, i assume that this can be corrected in software. are any of the 
> > existing sane backends doing this internally? i would like to do something 
> > similar as an option in the fujitsu backend...
> The gt68xx backend does calibration completely in software. I think
> mustek_usb does this also, other backends of the more low-level
> scanner may use the same scheme.  All scanners supported by the gt68xx
> backend have a white calibration strip at the top of the scanning
> area. It's visible if you open these scanners.

this scanner is adf only, but the backer behind each read array is very 
bright white plastic. i could use that, if i could figure out how to get 
the scanner to send me data when there is no document in the scanner

i may have to hook it up to a windows box (ack!) and usb snoop on it.

thanks for the data below, i will look at these drivers and see if i can 
see this being done...


> Calibration works about like this:
> a) Coarse calibration: The scan bar moves to the calibration strip.
>    The gain and offset values of the analog frontend are setup so the
>    brightest white of the calibration strip is defined as white (255)
>    and the darkest black is 0. You get black by either turning offf
>    the lamp or by scanning a small black mark on the strip.
> b) Fine calibration: The scan bar scans some milimeters of the white
>    strip in full width. Once with the lamp turned on and once with the
>    lamp turned off. So you get two values per pixel per color, one for
>    max white and one for min black.
> If you do a real scan you can calculate the resulting pixel color like
> this (from my memory, untested):
> real_color = 255 * (scanned_color - min_black) / (max_white - min_black)
> Bye,
>   Henning
> _______________________________________________
> Sane-devel mailing list
> Sane-devel@www.mostang.com
> http://www.mostang.com/mailman/listinfo/sane-devel

"so don't tell us it can't be done, putting down what you don't know.
money isn't our god, integrity will free our souls" - Max Cavalera