Tenrec-Builders / pi-scan

Pi Scan is a simple, robust capture appliance for book scanners. It runs on a Raspberry Pi 2.
BSD 2-Clause "Simplified" License
264 stars 37 forks source link

White balance setting doesn't match camera settings #4

Closed meelash closed 7 years ago

meelash commented 7 years ago

In spreads, white balance automatically matches whatever the camera is set to, so for custom white balance with the IXUS 160 I just have to set it up manually before starting to use spreads and everything goes as planned.

It seems, with pi-scan, there is a hard-coded white balance that is imposed on the cameras? In spite of having manual white balance on and the correction set using a white card, the scans are coming out with some other white balance. I've attached an example in which the page should be white and the wood in the background should be black. Short-term work arounds would be appreciated if possible.

meelash commented 7 years ago

0000

duerig commented 7 years ago

When I wrote Pi Scan, I assumed that users would be using the LED lights recommended on the Archivist design guide page:

https://www.diybookscanner.org/archivist/?page_id=278

Given that you are using a different light source and need to hand-calibrate it, the easiest workaround would be to quit to console, login as username 'pi', password 'raspberry', and edit pi-scan/camera.py (use cd pi-scan; nano camera.py) and comment out line 99: https://github.com/Tenrec-Builders/pi-scan/blob/master/src/camera.py#L99

Once you have done that, us sh run-pi-scan.sh to try Pi Scan. At that point, Pi Scan will not modify the manual white balance options you have set in the camera. Check to see whether this works or not.

If it does work, then you will want to make this change permanent. Normally, Pi Scan will wipe out all changes every time the Raspberry Pi reboots. To make a permanent change that lasts between reboots, you will need to do the following and again comment out line 99 in camera.py:

sudo mount -o remount,rw /
cd /home_org/pi/pi-scan
nano camera.py
sudo reboot

At that point, the workaround will be permanent on your image. When I get time to work more on Pi Scan, I'll look at adding a toggle box or some other interface option that controls whether Pi Scan tries to set the white balance or just leave that setting alone.

-D

meelash commented 7 years ago

Thanks a lot for the workaround. I found the line 99 pretty easily but you saved me a lot of time figuring out how to make the change permanent!