Daniel Reetz, the founder of the DIY Book Scanner community, has recently started making videos of prototyping and shop tips. If you are tinkering with a book scanner (or any other project) in your home shop, these tips will come in handy. https://www.youtube.com/channel/UCn0gq8 ... g_8K1nfInQ

The highest aperture is not always the best

Everything camera related. Includes triggers, batteries, power supplies, flatbeds and sheet-feeding scanners, too.
fbonomi
Posts: 59
Joined: 04 Mar 2014, 00:52

The highest aperture is not always the best

Post by fbonomi » 13 Aug 2009, 02:28

Hi all,

Some photographic rantings...

in Daniel's instructable (step 33), you find these instructions:
In a perfect world, we would use a very small aperture (from f6 to f11) to keep things very sharp.
Especially on cheap cameras like ours, this is far from true.

There are quite complex reasons of optical nature that make the resulting images more and more blurry with high F-numbers.

If you really want some theory, read about it here:
http://www.luminous-landscape.com/tutor ... tion.shtml

Some more discussion in the CHDK forum, where we were trying to understand if all these megapixels are useful at all in our cameras: http://chdk.setepontos.com/index.php/to ... l#msg27013

To put it short, there are theoretical factors that limit the resolution of a lens when you have small apertures and (even more important) small sensor in our small cameras.

Every F stop halves the number of megapixel you can effectively get from an image, and you have to understand when the number of "theoretical" Mpixels becomes too much lower than the "practical" MPixels of your sensor, i.e. when your sensor has more megapixels than the image (the sensor "outresolves" the image"

For example my A570 is a 7Mpixel camera.

But if I start closing the aperture, the image becomes more and more fuzzy, and at F8 it's about like if I had a 1MP camera. Even if my lens was a perfect lens, and my sensor was a perfect sensor, the nature of light itself would blur the image.


Some tests. For each aperture, I post a 100% crop and a 300% zoom

F2.8
Image Image

F4.0
Image Image

F5.6
Image Image

F8
Image Image

You can easily notice two things:
1) at F8 the intrinsic blur is far stronger than the JPEG artifacts
2) at F2.8 the image is again a bit blurred, i guess it's because we start having problems with depth of field
So, in this case I should stick at F4 or F5.6

So, all I want to say is that it's worth while experimenting with the best aperture settings, as the results might be FAR different than you expect.... These kind of "blurriness" can strongly degrade the OCR quality.

(Generally speaking, the situation is better with cameras that have large sensors, such as DSLRs)

btw, daniel, maybe the forum might need a "photography" section, in addition to "hardware" and "software"?

spamsickle
Posts: 596
Joined: 06 Jun 2009, 23:57

Re: The highest aperture is not always the best

Post by spamsickle » 13 Aug 2009, 08:06

I had noticed the fuzziness at F11, but didn't realize what was causing it. I thought I'd just missed the focus somehow (this was when I was depending on the LCD display to do the focusing, before I got CHDK).

I settled on F4 after I got CHDK and was able to set the focus numerically based on known distance from camera to page, but it was just a fluke that F4 worked out. I appreciate learning more about why I was seeing the fuzziness earlier.

User avatar
daniel_reetz
Posts: 2785
Joined: 03 Jun 2009, 13:56
E-book readers owned: Used to have a PRS-500
Number of books owned: 600
Country: United States
Contact:

Re: The highest aperture is not always the best

Post by daniel_reetz » 13 Aug 2009, 08:58

Nice. Thanks for the detailed discussion. I'm familiar with MTF measurements -- I do a lot of camera calibration for work, but that's only with DSLRs, which is where my original aperture recommendations came from. It's cool to see hard evidence for a larger aperture value, and that it matches up well with Spamsickle's experience.

I'm not totally sold on all the Luminous Landscape resolution discussion with respect to these small cameras -- because there is so much complex interaction in the camera DSP, it's hard to say if your example output pixels support their point or reflect some other variables. I'm not asking you to reshoot or redo anything, but generally RAW stuff would tell us more about the camera, sensor, and its interactions with the natural properties of light than the camera JPG output will, considering there's a lot of noise reduction, sharpening, and other voodoo happening. I'll see if I can find some test charts to shoot, because that would tell us more about absolute resolution than just looking at stuff.

This is a good time for me to say that as far as the Instructable goes, it's far from perfect or canonical. Almost everybody here has made some improvement on it and/or called me on something I got wrong, and I'm quite pleased to see the design improved. I think what we need now is a Wiki or some kind of collaborative system to draft up the next book scanner plans and post definitive info.

User avatar
daniel_reetz
Posts: 2785
Joined: 03 Jun 2009, 13:56
E-book readers owned: Used to have a PRS-500
Number of books owned: 600
Country: United States
Contact:

Re: The highest aperture is not always the best

Post by daniel_reetz » 13 Aug 2009, 09:25

I just updated step 33 to link to this thread. I plan to keep updating that Instructable, if only to lead more people here.

fbonomi
Posts: 59
Joined: 04 Mar 2014, 00:52

Re: The highest aperture is not always the best

Post by fbonomi » 13 Aug 2009, 09:46

daniel_reetz wrote:but that's only with DSLRs, which is where my original aperture recommendations came from
Yes, with A DSLR the sistuation would be quite different
daniel_reetz wrote:but generally RAW stuff would tell us more about the camera, sensor, and its interactions with the natural properties of light
That's sure... Image quality is an issue I value very much: my previously scanned books (all made with scanners, not cameras) are all stored for archival as lossless TIFFs at 600 or 300 DPI, you never know what you will need in the the future.

So, seeing those JPEG artifacts really makes me cringe, and want to try and work with RAW to see the difference.

The thing is, everyone is using these images in different ways, so probably what is important for someone won't be that important for someone else....

User avatar
daniel_reetz
Posts: 2785
Joined: 03 Jun 2009, 13:56
E-book readers owned: Used to have a PRS-500
Number of books owned: 600
Country: United States
Contact:

Re: The highest aperture is not always the best

Post by daniel_reetz » 13 Aug 2009, 10:05

So, seeing those JPEG artifacts really makes me cringe, and want to try and work with RAW to see the difference.
I totally agree. Also so far, we've all been using JPG because that was the easiest thing. In other words, for our purposes, the image evidence you presented is good enough.

Is RAW saving still pretty slow with CHDK?

fbonomi
Posts: 59
Joined: 04 Mar 2014, 00:52

A small test with RAW images

Post by fbonomi » 14 Aug 2009, 12:59

I wanted to do a small test shooting in RAW format.

A few notes:
- I tried to keep everything to the defaults, as little processing as possible (just shoot, convert to B&W and auto-levels)
- I then fed the images to Finreader (again, all default settings)
- The RAWs were converted from .CRW to .DNG using dng4ps2, then from DNG to lossless TIFF with Photoshop
- the JPG version is slightly more contrasted, due to different lifecycle...
- the JPG version is slightly sharper, probably because of different default sharpening in the RAW conversion as made by the camera and by Photoshop. Perhaps the JPEG artifacts help giving a sharper look, as they add some light patches surrounding the dark letters....
- the RAW version is indeed smoother and has a much much cleaner look.

Anyway, judge for yourself: these are the results (100% crop and 300% zoom)
JPG
Image Image

RAW
Image Image

Now, the surprising part.

After feeding 3 scanned pages through Finereader, and thoroughly checking the text, we have the following results
- 12 errors common to RAW and JPG
- 8 errors only found in RAW
- 7 errors only found in JPG

The conclusion is that OCR quality shows no significant difference if done on JPG images or RAW images, at least within the very limited scope of this test.

I am surprised, but I must say that considering the additional steps in workflow, the increased filesize, the increased number of variables that the user must manage I don't think that shooting in RAW is worth the effort!!!

And to Answer Daniel's question, saving in RAW is a bit slower but it all depends from your card's speed. I have a good one, and it only adds a second or two. It's noticeable when you shoot normally, but in the scanner setup it would not bother you, as you are busy turning pages.

User avatar
daniel_reetz
Posts: 2785
Joined: 03 Jun 2009, 13:56
E-book readers owned: Used to have a PRS-500
Number of books owned: 600
Country: United States
Contact:

There is no aperture

Post by daniel_reetz » 17 Aug 2009, 07:57

First off, love the tests you've done and the way you've gone about them. I really need to get a Wiki going so we can solidify some of this knowledge. Perhaps later this week.

I've been pondering this whole aperture issue for a couple days now. The more I thought about this aperture problem, the more I thought that the best way to understand the phenomenon would be to look at it. So I disassembled a Powershot A530 that was broken. Unfortunately, my beloved 8GB memory card ate all my disassembly photos. There were hundreds of them. But I did make a couple videos showing the construction and operation of the lens assembly.

What I learned:
0. There is no aperture. (well, to be most accurate, no adjustable aperture as I am usually familiar with)
1. What Canon calls an aperture is probably just an ND filter and amp gain or shutterspeed adjustment.
2. These lens mechanisms are extremely complex and very easy to break. ;)
3. There are 4 opto-interrupter sensors in each lens.
4. The shutter could be used as an adjustable aperture by holding it partially open, I guess, but it seems unlikely because it is latching.

The aperture mechanism:
http://www.youtube.com/watch?v=CkThik21Gbo

Lens assembly overview:
http://www.youtube.com/watch?v=l6P2oz0cV2c

fbonomi
Posts: 59
Joined: 04 Mar 2014, 00:52

Re: There is no aperture

Post by fbonomi » 17 Aug 2009, 08:28

daniel_reetz wrote: 0. There is no aperture.
Actually, it depends from the Powershot model you are using....

Some (older/cheaper/smaller) cameras have an ND filter that switches in when there's too much light, and indeed it's like you say, Canon says you are shooting at F8 while you are just shooting at maximum aperture with most of the light filtered out.

Other cameras have a real Iris, and aperture is a real aperture

Cameras with an Iris
G7
a540 a570 (EDIT: a590)
a610 a620 a630 a640 a650
a700 a710 a720
s2 s3 s5
tx1
sx100

Cameras without an Iris
a450 a460
a530 a550 a560
sd300(ixus40) sd400(ixus50) sd450(ixus55) sd600(ixus60) sd630(ixus65)
sd1000(ixus70) sd1100(ixus80) sd500(ixus700) sd550(ixus750) sd700(ixus800)
sd800(ixus850) sd870(ixus860) sd850(ixus950) sd950(ixus960)

(info from the CHDK source, include\camera.h)

EDIT:
I went to the C source because the info listed here: http://chdk.wikia.com/wiki/CameraFeatures is a bit misleading ...

Also, we should consider that when zooming in the aperture decreases....
Last edited by Anonymous on 17 Aug 2009, 08:55, edited 1 time in total.

User avatar
daniel_reetz
Posts: 2785
Joined: 03 Jun 2009, 13:56
E-book readers owned: Used to have a PRS-500
Number of books owned: 600
Country: United States
Contact:

Re: The highest aperture is not always the best

Post by daniel_reetz » 17 Aug 2009, 08:33

Since many of us are using an A590, it would be interesting to know if it has an iris or not.

Post Reply