[sane-devel] Reflecta ProScan 7200

Michael Rickmann mrickma at gwdg.de
Tue Apr 19 07:12:14 UTC 2011


Hi Jan,

Am 11.04.2011 21:45, schrieb Vleeshouwers, J.M.:
> Hi Michael,
>
> Nice, looks as if a basic device driver which merely copies the windows-driver is not so very far away. Two quick remarks from scanning your source. It should not be very difficult to implement the polling process with PIE_READ_STATUS. There is a device-ready bit in the returned status which is helpful.
Yes, I discovered that one. Mostly, I am still using the error handling 
of the pie backend which is not very elaborate. It mainly consists of 
writing the error to the log and try again.

> Secondly: the PIE_IMAGE_CLOSE command is sent to the scanner after all data processing is done. Sometimes it may take a couple of repeats before the scanner accepts is, but the command also occurs after a (possibly very long) communication break at large dpis. Cyberview takes a long time processing, and then communication only resumes after PIE_IMAGE_CLOSE is sent.
>
I wonder whether I can send the PIE_IMAGE_CLOSE blindly, i.e. 
disregarding a busy state. Cyberview does that when a scan is canceled. 
For me the PIE_IMAGE_CLOSE returns busy as long as the scanner has not 
yet returned to its parking position.
> I'll proceed with the settings analysis (auto exposure, auto gamma, noise reduction, ICE, ...). After that, the calibration process may need a closer look. I would be surprised if there would be no way of sending calibration data to the scanner. Do you know how other scanners do this, or how calibration works in general?
>
Not really, I had a look how SANE's genesys backend does it. In 
principle, there has to be an analog to digital element in the scanner 
which needs to be set with offsets and gains for R, G and B. The genesys 
backend scans a few lines and calculates the 6 values. How this is 
implemented depends on the AD frontend used and the test area from which 
the calibration lines are obtained. The AD calibration can be stored. On 
top of that the genesys backend does shading correction before each 
scan. As this is done for each of the CCD or CIS elements a moderately 
large amount of data has to be sent back to the scanner.
When comparing the genesys and pie backends, the pie only does the 
shading correction which it calls calibration. For the Reflecta scanners 
about 5340 values should be sent to the scanner. I never observed 
something like that in my snoops, did you? Moreover, my scanner does not 
accept the SEND_CAL_DATA command. All I can see is that we have to 
squeeze calibration data into the 23 bytes sent by the custom-0xdc command.
> Finally: it would be nice to have a kind of experimentation backend and frontend, which allows easy modification of bits and bytes without having to recompile before every experiment. I suppose that has been done before in SANE?
I guess a general provision for all backends is too complicated. I wrote 
a tiny routine which reads a text file with hexadecimal numbers in it. I 
have used it to find out something about the data sent via custom-0xdc. 
The last 5 bytes seem to be a copy of the last 5 bytes of the preceeding 
custom-0xd7 read. An example of the remaining 18 bytes: 0x79 0x0e 0xff 
0x0b 0x6c 0x0c 0x0f 0x08 0x0c 0x00 0x00 0x00  0x3f 0x3d 0x39 0x07 0x03 0x00
The first six bytes contain three 12-bit values for R, G and B. Changing 
them leeds to slight but noticable changes in the colors of a scanned 
image. I think that they are the values which we should change for 
calibration (shading). For the next six bytes I could not detect any 
effect. They seem to be copies of bytes 9 through 14 of the preceeding 
custom-0xd7 read. The next 3 bytes (3f 3d 39) stand for RGB again, are 
6-bit values and produce gross color changes. They remind me of some 
gain values. The last three bytes seem to contain a 24-bit value, lowest 
byte first. The value controls the speed, 0 fastest (black image), 0x00 
0x00 0x01 slow (about Silverfast sound).

> With respect to getting SANE built: I'll let you know when I'm ready for that, your help is appreciated. I work with Ubuntu 10.04.
>
> Yours,
>
> Jan
My latest stuff is in 
http://wwwuser.gwdg.de/~mrickma/sane-proscan-7200/status-190411/flles.tar.gz
Regards
Michael




More information about the sane-devel mailing list