Well Doc-Pi has been busy scanning in piles of document. One issue I have with it is that the photo colour varies quite a lot due to the RPi Cameras Auto White Balance (AWB) trying to figure out the best balance.
This evening I sat down and did a bit of Internet research and found this basic script:
http://raspberrypi.stackexchange.com/questions/22975/custom-white-balancing-with-picameraAs I use the python based picamera module, here are the relevant lines of code:
Code: Select all
rg = 1.9 # set to match my
bg = 1.4 # LED floodlights
camera = picamera.PiCamera()
camera.led = False
camera.resolution = (2592, 1944)
camera.awb_mode = 'off' # has to be off before you can manually override the Red/Blue gain
camera.awb_gains = (rg, bg)
camera.capture(filename)
With my LED flood lights turned on and with a blank sheet of Reflex white paper in, running it gave me two different values to try:
1) Rg = 1.8, Bg = 1.3
2) Rg = 1.9, Bg = 1.4
Now these are pretty close, yet there was a slight blue or orange tint between the two photos. Mind you I haven't tested my LCD monitor, so maybe its all perhaps just a poke in the dark. Maybe my brain will take it all in differently tomorrow morning?
Here is a sample photo:
- 2016-01-25_222119.jpg (14.42 KiB) Viewed 6009 times
and just to highlight some other issues, here is the same photo, with the Contrast, Gamma and Saturation all stretched horrendously:
- 2016-01-25_222119_adjusted.jpg (28.83 KiB) Viewed 6009 times
Hmm, there are some issues here:
1) reflection of the overhead camera X shaped gantry (and camera cable). Could be fixed with the installation of a black paper dome lodged under the gantry and a hole cut out for the camera. If nothing else, I could at least print the gantry out in a matt black.
2) the glass lid handle is visible at the front. I could design and print a new one that curves away from the glass plate.
3) even with two bright 15W LEDs running the full length of the A4 sized platen, the brightness varies a lot. I will need to play around with this some more. I might be able to fix some of it in software, otherwise, maybe place some diffusers over the LEDs.
4) there is quite a range of colours on what is meant to be a white sheet of paper.
5) there is some lens barrel distortion going on. I knew that would happen, however it's less than I thought it might be. I could fix it with a post processing script.
Really though, I am just happy that the major colour variation issue is at least fixed to one pattern, and it's not changing photo to photo.