<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 04/06/2014 12:22, Myroslav Kavatsyuk
wrote:<br>
</div>
<blockquote
cite="mid:1401877344.98724.YahooMailNeo@web140704.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff;
font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
Lucida Grande, sans-serif;font-size:12pt">
<div style="" class=""><span style="" class=""><br style="">
Dear Stef,</span></div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;"><br style="" class="">
<span style="" class=""></span></div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;"><span style="" class="">thanks a lot for your
suggestions and scripts. The more I dig into the source
code, the more</span></div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;"><span style="" class="">questions I have. Here they
are:</span></div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;"><span style="" class=""><br style="" class="">
</span></div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;"><span style="" class="">1) file genesys_devices.c,
definition of Genesys_Model canon_8400f_model (line 1691).
I realized that the dpi list does not correspond to the
model (CS8400F has maximum resolution of 3200dpi).</span></div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;"><span style="" class="">- Shell I change the array
with values available in the windows driver of the scanner?
Is the length of the array fixed?<br style="" class="">
</span></div>
</div>
</blockquote>
You may do such. But be aware that the resolution advertised by
the windows driver GUI are usually different from the DPI used to do
the scan. It is safer to work with resolution you find in USB log,
or resolution derived for other working ones. Try to do USB log of
resolution matching physical hardware, or divided by a round factor.
<br>
The length is fixed, and has a MAX_RESOLUTIONS size.<br>
<br>
<blockquote
cite="mid:1401877344.98724.YahooMailNeo@web140704.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff;
font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
Lucida Grande, sans-serif;font-size:12pt">
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;"><span style="" class="">- Are the other values
extracted from some logs, or shell I disassemble unit to
measure all constants (position of white strip)?</span></div>
</div>
</blockquote>
Tune scanarea geometry only when you have made scan working. No
need to dismantle your scanner, change all offsets to be zero (in
genesys_device.c), and it will scan itself where you cannot see.<br>
<br>
<blockquote
cite="mid:1401877344.98724.YahooMailNeo@web140704.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff;
font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
Lucida Grande, sans-serif;font-size:12pt">
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;"><span style="" class="">- I have performed test scan
with resolution of 100dpi of size 10x10 cm (specified with
-x -y option). The resulting image had proper number of
lines/rows (393), proper aspect ratio. However, the scan are
was about 15x15 cm. I assume this has something to do with
wrong array with dpi setting...</span></div>
</div>
</blockquote>
BTW, you can find GL843 datasheet on internet, it will help you
understand what all the registers are for. Real dpi is a combination
of sensor DPISET, deletion factor and exposure.<br>
<br>
<blockquote
cite="mid:1401877344.98724.YahooMailNeo@web140704.mail.bf1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff;
font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial,
Lucida Grande, sans-serif;font-size:12pt">
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;"><br style="" class="">
<span style="" class=""></span></div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;"><span style="" class="">2) genesys_gl843.h, There is
definition of the Sensor_Profile sensors. For the CS8400F
there is defined array (line 666). I logged several scans
with different dpi settings using usbsnoop. After processing
logs with your script I found that there are different
possible values reported for the sensor_profile and
motor_profile. This profiles do not coincide with the one in
the </span><span style="" class="">genesys_gl843.h. Here
are ones, extracted from the logs:</span></div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;"><br style="" class="">
<span style="" class=""></span></div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;">sensor_profile { sensor_id, dpi, 7200, 0xe3f, 0x0,
0x1b6db, 5168, 0,0xffffffffffffffff,<br style="" class="">
0xfffffffffffffeff, 0xfffffffffffffeff, 0xfffffffffffffeff,
0xffffffffffffffff, 0x01, 0x02, 0xffffffffffffffff,
0xffffffffffffffff,<br style="" class="">
{0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff,
0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff,
0x33, 0x0c, 0x13, 0xffffffffffffffff, 0x30,
0xffffffffffffffff, 0x00, 0x84, },<br style="" class="">
{0x0d,0x10,0x01,0x04,0x07,0x0a,0x6b,0xffffffffffffffff,0x40,0x00,0x00,0xffffffffffffffff,0x85,},<br
style="" class="">
}</div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;">sensor_profile { sensor_id, dpi, 7200, 0xe3f, 0x0,
0x1b6db, 5168, 0,0xffffffffffffffff,<br style="" class="">
0xfffffffffffffeff, 0xfffffffffffffeff, 0xfffffffffffffeff,
0xffffffffffffffff, 0x01, 0x02, 0xffffffffffffffff,
0xffffffffffffffff,<br style="" class="">
{0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff,
0xffffffffffffffff, 0xffffffffffffffff, 0xffffffffffffffff,
0x33, 0x0c, 0x13, 0xffffffffffffffff, 0x30,
0xffffffffffffffff, 0x00, 0x84, },<br style="" class="">
{0x0d,0x10,0x01,0x04,0x07,0x0a,0x6b,0xffffffffffffffff,0x40,0x00,0x00,0xffffffffffffffff,0x88,},<br
style="" class="">
},</div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;">sensor_profile { sensor_id, dpi, 22000, 0x0, 0xff,
0x0, 5168, 0,0x2a,<br style="" class="">
0x 0, 0x 0, 0x 0, 0xffffffffffffffff, 0x07, 0x08,
0xffffffffffffffff, 0xffffffffffffffff,<br style="" class="">
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x0c, 0x10, 0x2a,
0x30, 0x00, 0x00, 0x9a, },<br style="" class="">
{0x01,0x04,0x07,0x0a,0x0d,0x10,0x1b,0x00,0x40,0x00,0x00,0xffffffffffffffff,0x88,},<br
style="" class="">
},<br style="" class="">
sensor_profile { sensor_id, dpi, 10800, 0xe3f, 0x0, 0x1b6db,
5168, 0,0x2a,<br style="" class="">
0x 0, 0x 0, 0x 0, 0xffffffffffffffff, 0x01, 0x02,
0xffffffffffffffff, 0xffffffffffffffff,<br style="" class="">
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x0c, 0x13, 0x2a,
0x30, 0x00, 0x00, 0x84, },<br style="" class="">
{0x0d,0x10,0x01,0x04,0x07,0x0a,0x6b,0x00,0x40,0x00,0x00,0xffffffffffffffff,0x88,},<br
style="" class="">
},<br style="" class="">
sensor_profile { sensor_id, dpi, 14400, 0x1ff, 0x0, 0x24924,
5168, 0,0x2a,<br style="" class="">
0x 0, 0x 0, 0x 0, 0xffffffffffffffff, 0x00, 0x01,
0xffffffffffffffff, 0xffffffffffffffff,<br style="" class="">
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x0c, 0x11, 0x2a,
0x30, 0x00, 0x00, 0x84, },<br style="" class="">
{0x0b,0x0e,0x11,0x02,0x05,0x08,0x63,0x00,0x40,0x00,0x00,0xffffffffffffffff,0x88,},<br
style="" class="">
},<br style="" class="">
sensor_profile { sensor_id, dpi, 7200, 0xe3f, 0x0, 0x1b6db,
5168, 0,0x2a,<br style="" class="">
0x 0, 0x 0, 0x 0, 0xffffffffffffffff, 0x01, 0x02,
0xffffffffffffffff, 0xffffffffffffffff,<br style="" class="">
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x0c, 0x13, 0x2a,
0x30, 0x00, 0x00, 0x84, },<br style="" class="">
{0x0d,0x10,0x01,0x04,0x07,0x0a,0x6b,0x00,0x40,0x00,0x00,0xffffffffffffffff,0x85,},<br
style="" class="">
}</div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;"><br style="" class="">
</div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;">They are all different. Do you have any suggestions
what to do with this? For each sensor_profile there is a
motor_profile. They have the following structure:</div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;">motor_profile={id,7200,2, {0, 0, ......} all skipped
numbers are zeros (in contrast to one in the <span style=""
class="">genesys_gl843.h, line 677</span>). The second
number coincides with the first number reported in the
sensor_profile.</div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;"><br>
</div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;">I would appreciate you suggestions for further
implementation.</div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;">Thank you in advance,</div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;">Best regards,</div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;">Myroslav<br style="" class="">
<span style="" class=""></span></div>
<div class="" style="color: rgb(0, 0, 0); font-size: 16px;
font-family: serif; background-color: transparent; font-style:
normal;"><span style="" class=""><br style="" class="">
</span></div>
</div>
</blockquote>
Scan a ruler (either in inches or centimeters), and extract
image data from log to find the real 'dpi' value in the *_profile.
These profiles are only a database for a given motor or sensor (the
id) for a given exposure. 0xffffffffffffffff is -1 and means
register has never been set in logs. You can put whatever value you
want in this case, but 0 looks better. But having all o them 0 looks
strange to me. Be sure you have the full log, from boot to end of
scan.<br>
I usually choose few settings that let me derived several scan
resolution, and more precisely one from final scan. What you see is
that for a given scan, the scanner goes through several other scans
in other resolution to calibrates himself. You can recognize the
final scan by the pixel width and line number and the amount of
data.<br>
<br>
Regards,<br>
Stef<br>
</body>
</html>