# Re: Phantom 636cx and microtek2

Bernd Schroeder (bernd@aquila.muc.de)
Fri, 31 Dec 1999 12:47:23 +0100

- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
- Next message: Bernd Schroeder: "Re: Microtek SlimScan C3"
- Previous message: Paulo Abreu: "Mustek SE12000P: patching musteka4s2 and mustek..."
- In reply to: =?iso-8859-1?Q?Levente_NOV=C1K: "Phantom 636cx and microtek2"

Hi,

On Thu, Dec 23, 1999 at 08:06:03PM +0000, =?iso-8859-1?Q?Levente_NOV=C1K_ wrote:
>
>
> Finally I'm back home again and could test the microtek2 0.8 backend with my
> Phantom 636cx.
> When backend calibration is off, almost everything is OK, excepted the fine
> vertical stripes and the luminosity/colour unevenness of the background.
> When backen calibration is on, the scanner seems to do its calibration, the
> head moves to the scan area, then xsane hangs with a segfault. The only led on the
> scanner turns off, the lamp stays lit, and the scanner needs to be power cycled
> with the power plug.
> Here is the backtrace:
>
> --- snip

--- also snip

> [readcontrolbits]
> 28009000000000028700
> [readcontrolbitsresult]
> !
> 110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110044110040100000000000000
>
> Twice or three times, I was able to get the scanner working even with
> background calibration set to on. Then there was less parasite background colour gradient
> in the image, but the scanned text had some kind of "colour aberration", like
> seen through a prism, with a reddish halo at one side and bluish at the other.

Basically, what the backend does, when backend calibration is enabled, is to
read some lines of image data at maximum resolution from a white stripe that
is located ahead of the actual scan area. It reads these lines twice, the
first time with the lamp turned on, and a second time with the lamp turned
off. The result are 2 x 5100 colour values, which - simply said - represent
what the device's impression of white resp. black is for each pixel in a
line.

If you count the number of bits in the response block of 'read control bits',
that are 1's, you will see that there are as many 1's as the image has
pixels per line. What is necessary is to apply a shading correction
function to each pixel of the scanned image, and the 1's in 'read
control bits' serve as an index into the shading data. For example, if the
the first 1 is at bit position 27, the 27th byte in the shading data must
be combined with the first pixel of image data, if the second 1 is at
position 42 the 42th byte of shading data must be combined with the
second byte of image data, etc.

At present there are some problems:

- The 'read control bits' is not documented in the documentation that I have,
but from what I have heard about this command the first 1 in 'read control
bits' could possibly start at position 1, and if a scan at maximum
resolution is performed I would expect 5100 consecutive 1's starting
at the beginning of the output of 'read control bits'. However, this
is not the case, the first two bytes are always zero. Actually the
latest version of the backend skips the first two bytes.

- The 1's are not consecutive. Again if you are scanning at maximum
resolution the output of 'read control bits' starts with 0000ffcfffff..
and ends similar to ...ffff3f000000 (IIRC). These small gaps with
non-consecutive 1's cause the backend to read beyond position 5100
of the shading data, which is probably the reason why the application
crashes, but at the moment I don't know how to handle these gaps.

- I don't know how exactly the shading correction function looks. The
documentation defines quite a bunch of them, but the function needed
for the 636cx is none of them.

Bernd

    --
    Bernd Schroeder
    Email: mailto:bernd@aquila.muc.de
    PGP public key available: mailto:pgp@aquila.muc.de | Subject: send key

    --
    Source code, list archive, and docs: http://www.mostang.com/sane/
    To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com

     Next message: Bernd Schroeder: "Re: Microtek SlimScan C3"
     Previous message: Paulo Abreu: "Mustek SE12000P: patching musteka4s2 and mustek..."
     In reply to: =?iso-8859-1?Q?Levente_NOV=C1K: "Phantom 636cx and microtek2"