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

I'm using some undocumented deep firmware commands in CHDK to directly position the focussing motor.
That way i can reliably and very precisely set the focus.

While trying to find out the best settings i noticed that the focal plane does not appear to be parallel to the imaging plane.
I aligned to camera perpendicular to the platen by aiming it directly at the reflection of the lens in the platen.
An image of a gridded paper seems to agree that the alignment is spot on.

See the two attached images. Notice how in one image the top is sharp and the buttom is blurry and vice versa?

If the focal plane was parallel to the imaging plane i imagine thered be one setting where everything was in focus with evenly decreasing sharpness towards the edges.

In any case - did anyone here experience this as well, and found a solution? Are my cameras defective?

What works reasonably well for me is taking 3 consecutive images with different focal points and then using a focus stacking software to create an evenly sharp image.
Unfortunately that slows everything down by orders of magnitudes, having to wait for 3 images to be taken, and then processing them in a focus stacker.

You've hit one of the fundamental limitations in the possible quality provided by cheap point and shoot cameras. The focus on every camera is based on the distance of the target from the lens. On a properly aligned book page, the distance between the center of the page and the lens will always be less than the distance between the corner of the page and the lens.

There are several possible ways to deal with this. You have hit upon one of them.

(1) Accept that the corners will always be slightly blurrier (lost quality at corners)
(2) Focus Stacking might yield the best quality, but as you see it takes more time per photo.
(3) If you zoom out, the 'blurrier corners' will no longer be page material and are cropped out. The cost of this method is lower DPI. But in many cases this is a good trade-off. For medium-sized books, you can capture them at 300 DPI and still have plenty of border to crop.
(4) Buy a higher end camera. DSLRs and mirrorless cameras have an aperture setting which among other things changes the depth of field (minimum and maximum distance where things are still in focus). So this gives you a knob you can use to have sharp corners and a sharp center even though they are different distances from the lens.

There may be some other clever solution or workaround that I don't know about. But your cameras aren't defective. It is just the limits of point and shoot cameras in general.

I'm aware that sharpness decreases towards the Edges. I know what curved field and flat field lenses are. Thats not whats happening here.

It behaves as if the page is angled towards the camera significantly. When i move the focus from infinity towards the camera, first the bottom of the image gets in focus while the top is still out of focus. Moving the focus closer to the camera, the area of sharpness moves across the page until the top is in focus and the bottom is out of focus again.
Well, i attached two annotated pictures of an actual bookpage. Maybe that'll make it clearer what i mean:

I'd expect for an equally increasing and decreasing sharpness across the page when stepping through the focus positions, with the sharpest areas in the center of the frame. Not ... this.

But the optics on that camera model appear to be somewhat off kilter anyways, as it does not look like the optical axis is actually in the center of the frame, but slightly offset to the bottom right. At least comparing pictures at zero zoom and full zoom reveals that the full zoom is not a crop of the dead center of the image. However that works is a mystery to me.

I have not seen this pattern with the focal plane before. I have seen the slight offset of the center when zooming in/out but that seemed innocuous.

So it seems like there are two possibilities. One is that your camera has an unusual defect. The other is that your camera isn't actually aligned with the platen.

The alignment option is certainly the cheaper of the two to fix. So I'd recommend double-checking that first. It could be either that the camera was bumped out of alignment after you had carefully aligned it. Or that it wasn't aligned as well as it seemed.

When I do alignment, I use a small mirror with a painted crosshair on its face. The mirror is taped to the center of the platen. It is on top of the platen to hopefully avoid any distortions that might be induced by the glass.

You should enable a crosshairs overlay on the camera itself, line those crosshairs with the ones on the mirror, and then ensure that both sets of crosshairs are centered on the reflected image of the lens.

But if you already followed the above procedure and find that it is properly aligned, then it may just be a quirk in the camera itself and you will need a replacement.

This may not have anything to do with your problem, but I had a problem with my Elph 160 not focusing properly when I had it zoomed in with the camera too close to the platen. For various zoom ratios there is a minimum distance that the camera has to be from the platen for it to focus properly. The tighter the zoom the further away from the platen you have to be. You might try checking on that.

A = Numerical value from 0 to 1840. This is the focus setting; 0 is infinitiy, 1840 is the nearest focus setting.

B = Speed of the focus motor from 1 to 7400, where 1 is slowest and 7400 is fastest.

Values outside these bounds will make the camera crash instantly but dont cause any other apparent harm.
Too low of a speed value will make the camera crash after some time; possibly a timeout.
I found 2500 to 5000 is a good value.

Using this method is the finest possible focus control you can get.
An added bonus is that the minimum focus distance decreases significantly. I assume Canon limited the minimum focus distance to shorten the time the autofocus takes. Its slow as it is.

I did some more testing. I dont think it is the alignment. All the lines in a picture are (almost) perfectly parallel.
I could probably mount the camera in a way to maximize the area thats in focus, but then the pages would be skewed.

What i did was take a series of pictures of millimeter paper at different focal points, ran it through imagemagick edge detection and turned it into a gif.

Looks like this:

You can see how the area of sharpness moves across the image diagonally...

I'm guessing that eye-like pattern is due to imperfections in the lenses, the piece of paper is pressed against the platen by a 10kg weight. Its flat.

My second camera shows a similar effect and pattern:

Interesting how there are areas that are never really sharp in the middle of the frame.

I didnt go with focus stacking afterall. I did multiple exposures for noise reduction instead.
It doesnt really matter if the page is perfectly in focus or not, as long as theres some sort of smooth edge to the letters. They are going to be turned into black and white anyways.

First i dewarped the frames. This does not make a lot of sense, i could have quartered the processing time here if i dewarped the images after averaging. Oh well.

Unbenannt.gif (1.01 MiB) Viewed 411 times

I used this tutorial: http://hugin.sourceforge.net/tutorials/ ... n/en.shtml
Instead of taking a picture of a string in my backyard i drew some straight lines on a piece of paper and took a picture of that in the bookscanner at the zoom level i used for scanning the book.

Finally i assembled it into a PDF with Omnipage. The OCR engine is awesome, everything else about that software is a piece of garbage. 32-bit only. No multi-threading. Wonky memory management.
Had to process a 1000 page book in sets of 50 pages because it would act up, hang, crash, or not even allow me to save the project with too many files.

Now i dont know if that noise reduction by image averaging was necessary. It slowed the whole process down considerably.
In my case, that didnt matter, since i am not planning to scan books all too often.

The result i got is very clean, easily readable and with virtually perfect OCR results as well.