Re: [sane-devel] ScanJet 3670c calibration
On 06/28/2014 11:48 PM, Stef wrote: Hello, I have eventually found how to fix the coarse gain calibration bug on the HP3670c. You can pull the latest SANE's git version to use it. You, Sir, are a real boss! Your commit works beautifully! I have tried three scans so far with great results and will continue scanning many pending pieces of paper and see if something pops up. Quality looks great at least on 150 dpi at 8 bits of color depth. Many, many thanks! -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org
Re: [sane-devel] HP Scanjet 3670 bad colors
On 05/24/2014 08:25 AM, Octavio Alvarez wrote: On 05/23/2014 10:58 PM, Stef wrote: target_code is giving the desired target value for white. Once this value is correct : not too low, and not too high to avoid solarization, you should turn to tuning gamma values. They are defined in genesys_devices.c for the CCD_HP3670. Currently it is 1.0 for each color channels, and this need to be adjusted. This will improve the histogram. For some reason I haven't been able to find out yet, changing gamma values on genesys_devices.c:350 doesn't seem to change anything, no matter if I set them to 1.5, 2, 3, 10 or 0.5, 0.2, etc. Changing target_code makes a difference (just to make sure my compilation environment is correct). Hello again. Considering I wasn't able to play with gamma values in code, I took sample scan images with a calibration sheet for all combinations of: target_code = { 0x, 0x1000, 0x2000, ..., 0xe000, 0xf000 } in descending order resolution = { 75, 100, 150, 300 } I uploaded the images to the following URL: http://blog.alvarezp.org/files/scan-hp3670/calibration/ The 300 dpi scans are bigger, of course, but I found different scan results for different dpi. I wonder if this is just a cheap scanner. Anyway, I find 0x4000 to have the best value to have no solarization but the higher the dpi, the darker the images. While trying to fix the images in Gimp with the Levels and Curves tool I find that green is more sensible to low light so its 0 point should be moved to about 15/255 to prevent the shadows to come out greenish. Also it needs a gamma of about 1.20 to balance the midtones out. Blue needs a gamma of about 0.80. Red is ok. Hope this helps. -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org
Re: [sane-devel] HP Scanjet 3670 bad colors
On 05/23/2014 10:58 PM, Stef wrote: target_code is giving the desired target value for white. Once this value is correct : not too low, and not too high to avoid solarization, you should turn to tuning gamma values. They are defined in genesys_devices.c for the CCD_HP3670. Currently it is 1.0 for each color channels, and this need to be adjusted. This will improve the histogram. For some reason I haven't been able to find out yet, changing gamma values on genesys_devices.c:350 doesn't seem to change anything, no matter if I set them to 1.5, 2, 3, 10 or 0.5, 0.2, etc. Changing target_code makes a difference (just to make sure my compilation environment is correct). Best regards. -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org
Re: [sane-devel] HP Scanjet 3670 bad colors
On 05/19/2014 09:51 PM, Octavio Alvarez wrote: I made sure I used the most recent commit isolated from the install from my system. I used xscanimage under ~/sane-install/bin. I'd like to correct myself. Please take my previous message with a grain of salt (or disregard it altogether). I'm noticing that xscanimage is behaving differently than scanimage, regardless of whether I recompile both sane-backends and sane-frontends or just sane-backends. I noticed this because xscanimage is not affected when target_code is changed (and after a make make install), but scanimage is. I need to find some ground on this. Apparently scanimage *is* regenerated when sane-backends are recompiled. So far, I have repeated some of the tests with scanimage only and target_code seems to be too high for my taste. 0x8000 seems like a lot better value. I'm still testing though. Thanks. -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org
Re: [sane-devel] HP Scanjet 3670 bad colors
On 05/20/2014 12:27 AM, Octavio Alvarez wrote: So far, I have repeated some of the tests with scanimage only and target_code seems to be too high for my taste. 0x8000 seems like a lot better value. I'm still testing though. Hi, Stef. I have made some tests using scanimage only. I, effectively, don't get the artifacts anymore. Thanks a lot! However, you were right, the image quality has problems. Using target_code = 0xe000, the currently coded value, I get a bluish and saturated image. I tried lowering target_code across multiple values down to 0x4000. The lower the value, the better the quality but the darker the image. At 0xb000, the horizontal extremes of the image are white balanced but it is still noticeably bluish towards the center. This is, two small vertical correctly white-balanced sections are noticed at the left and right extremes. For example, at 0x8000, the image is not saturated anymore, and the image is way better white-balanced overall. However, the image is noticeably darker image (75% of the histogram with typical white at 55% luminosity). There is still a noticeably vertical stripe towards the blue, a bit off the center towards the right. At 0x4000, I don't get bluish stripes and perfect white-balance, but it results in only half of the histogram. I tried tweaking the o value (offset?) but I didn't seem to find any kind of pattern, except that if I set it too high I get badly colored stripes, so I just left them at their original values. Thanks again. -- sane-devel mailing list: sane-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel Unsubscribe: Send mail with subject unsubscribe your_password to sane-devel-requ...@lists.alioth.debian.org
[sane-devel] HP Scanjet 3670 bad colors
On 03/04/14 12:20, Stef wrote: On 01/04/2014 05:42, Octavio Alvarez wrote: On 03/31/2014 08:37 PM, Stef wrote: thanks for all the data. It'll take me a couple of days to analyze them and compare with the results of my hp3670. If you also have one and works then we may have different versions of the 3670. Mine has regulatory model GRLYB-0306. Hello, I have reproduced the bug with my scanner. The calibration needs to be tuned or reworked. I'll have a fixed version in a few days. Great to know! Thanks in advance. Octavio.
[sane-devel] HP Scanjet 3670 bad colors
Hi. I'm trying to get my HP Scanjet 3670 under Linux. The scanner works (it scans and all) but the scan has some color distortion. I confirmed the scanner works: here is a comparison of a section of a scanned image in both, Windows and Linux: http://blog.alvarezp.org/files/scan-hp3670/scan-hp3670-win7.jpg http://blog.alvarezp.org/files/scan-hp3670/scan-hp3670-linux.png The scan is a black and white section of a creased document. Even the problem itself is very unstable. Sometimes the whole page is distorted, sometimes only gray shades are. *Once* in my 40-like attempts the output was acceptable but I could not reproduce this success case. I noticed, though that solid strong colors are usually not distorted. I wanted to find out if this was an introduced bug, but I could only compile as back as 1.0.22 + 2 commits and it failed too. Before that, there is a V4L compilation blocker that prevented me from going further back. I tried looking at the code but I realized I understand very little (near to nothing) about how a scanner works. Is this a SANE bug? What can be done to make it properly work? Thanks.
[sane-devel] HP Scanjet 3670 bad colors
On 03/31/2014 07:34 AM, Stef wrote: the problem is coming from incorrect calibration by the backend. Gain is too high. Could you please run SANE 1.0.24 backend version with traces enabled, and send me log file and *.pnm files created during calibration ? In a command shell type: export SANE_DEBUG_GENESYS=255 export SANE_DEBUG_GENESYS_LOW=255 export SANE_DEBUG_GENESYS_GL646=255 export SANE_DEBUG_GENESYS_GL841=255 scanimage -d genesys --resolution 75 --preview --mode Color 2preview.log preview.pnm I took some samples, even one with --resolution 150 and uploaded them here: http://blog.alvarezp.org/files/scan-hp3670/hp-sj3670-samples-1.tar.gz Some of those came out ok, some didn't. Only --resolution 150 threw out a full set of pnm calibration files. --resolution 175 only threw out warmup*.pnm files.
[sane-devel] HP Scanjet 3670 bad colors
On 03/31/2014 08:37 PM, Stef wrote: thanks for all the data. It'll take me a couple of days to analyze them and compare with the results of my hp3670. If you also have one and works then we may have different versions of the 3670. Mine has regulatory model GRLYB-0306.