Doc-Pi

Tell us about your projects. Update us regularly.
User avatar
seaton
Master Maker
Posts: 222
Joined: Tue Jun 24, 2014 11:41 am
Location: Bunbury, WA
Contact:

Re: Doc-Pi

Post by seaton » Mon Nov 30, 2015 8:22 am

Nice one! Great to see it progressing. I haven't even had a chance to progress my projects for next RoboFaire as have been off sick last week and this week has been mission impossible - "Cleanup the geek area" as Courts coming home on the 10thand I need some space lol

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Doc-Pi

Post by parkview » Mon Jan 25, 2016 11:11 pm

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-picamera

As 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
2016-01-25_222119.jpg (14.42 KiB) Viewed 5894 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
2016-01-25_222119_adjusted.jpg (28.83 KiB) Viewed 5894 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. :)

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Doc-Pi

Post by parkview » Tue Jan 26, 2016 9:57 pm

Well today I got fed up with the official 7" RPi Display being propped up and the electronics board just lying around, so I designed up a set of height adjustable legs for the display and a RPi Hat adaptor plate so I could mount the electronics board onto the back of the RPi/display. Both worked out really well:

display_stand-adaptor_plate.jpg
display_stand-adaptor_plate.jpg (56.11 KiB) Viewed 5893 times


I also quickly designed up and printed out some M2.5 x 16mm PLA standoffs, for the adaptor plate:

M2.5 x 16mm - PLA standoffs.jpg
M2.5 x 16mm - PLA standoffs.jpg (36.06 KiB) Viewed 5893 times


Now I just have to wait for the next Aliexpress bolt shipment to arrive, so I can bolt it all together. Note: to mount a RPi Display to a printed stand, you will need four M3 x 6mm bolts. Aliexpress sells assorted M2 & M3 bolt kits for around US$6, and they include 30 x M3 6mm bolts.

I was surprised how clean and exact they printed out. I don't think I will need to purchase any other stand off again.

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Doc-Pi

Post by parkview » Wed Jan 27, 2016 10:22 pm

Well, thanks to Stephen for the offer of four M2.5 x 25mm bolts. I have been able to assemble adaptor board on to the RPi Display:

adaptor_mounted.jpg
adaptor_mounted.jpg (74.57 KiB) Viewed 5893 times


and then mount the electronics board, to make a triple decker:

mounted_electronics_board.jpg
mounted_electronics_board.jpg (59.31 KiB) Viewed 5893 times


Final, it's all up and running with light blaring away in full glory:

doc-pi_running.jpg
doc-pi_running.jpg (59.75 KiB) Viewed 5893 times


Well, there's nothing left to do hardware wise, I suppose I am just going to knuckle down to work on the software side of things.

User avatar
BeJay
Maker
Posts: 139
Joined: Mon Jun 23, 2014 6:31 pm
Location: Perth
Contact:

Re: Doc-Pi

Post by BeJay » Fri Jan 29, 2016 9:27 pm

Very nice as usual Paul! Those prints are looking good :)

What are the brick regulators you are using? Isolated?

parkview
Guru Maker
Posts: 603
Joined: Tue Jun 24, 2014 8:25 pm
Location: Busselton
Contact:

Re: Doc-Pi

Post by parkview » Sat Jan 30, 2016 6:57 pm

Hi BeJay,

yes, the prints are near perfect. Very happy with the Felix printer.

I have listed the 5V switch regulators part number on the circuit diagram above. they are meant to be 90+% efficient. Maybe around $14 or so from Element14, and Adafruit sell them too. I keep a stock of them, as they are so handy.

Post Reply