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

Dewraping with focus stacking

DIY Book Scanner Skunk Works. Share your crazy ideas and novel approaches. Home of the "3D structure of a book" thread.
spamsickle
Posts: 596
Joined: 06 Jun 2009, 23:57

Re: Dewraping with focus stacking

Post by spamsickle » 17 Nov 2010, 11:06

One other thing which CHDK makes possible is shooting RAW rather than JPEG images. If the JPEG compression artifacts are causing a problem, and you're able to process RAW images, we might try again with those.

I'm not sure what your "images have to be aligned" comment means. I laid the book on the floor, and shot the whole series with a tripod, so there shouldn't have been any misalignment.

User avatar
Gerard
Posts: 154
Joined: 17 Oct 2010, 07:15
Number of books owned: 0
Location: Berlin (Germany)

Re: Dewraping with focus stacking

Post by Gerard » 17 Nov 2010, 11:49

thanks for your data and support,

i think raw images will be later needed, for now i will play with this jpegs (i am able to open raw images)

i've read that the misalignment is coursed by the lenses and the focus change, so this problem can't be avoided,

sorry i didn't said it in a clear way
Attachments
align.gif
align.gif (28.05 KiB) Viewed 4941 times

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

Re: Dewraping with focus stacking

Post by spamsickle » 17 Nov 2010, 12:27

Ah, I see. I'm told that Lightroom 3 does lens distortion correction, but I haven't really looked into it. Do you think something like that might help get things aligned properly, or have you already managed to handle it yourself?

User avatar
Gerard
Posts: 154
Joined: 17 Oct 2010, 07:15
Number of books owned: 0
Location: Berlin (Germany)

Re: Dewraping with focus stacking

Post by Gerard » 17 Nov 2010, 12:38

yes http://bigwww.epfl.ch/thevenaz/stackreg/ is working great

i just don't have enough ram to do this for the full stack an ounce

User avatar
daniel_reetz
Posts: 2797
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: Dewraping with focus stacking

Post by daniel_reetz » 17 Nov 2010, 21:28

spamsickle wrote:Makes me doubly annoyed at those autofocus pictures that come out unreadable when there isn't enough text in the center where it's focusing -- I think the camera must just be focusing at infinity when that happens.
Great observation. I sorta knew this, but not so concretely. I have a Casio camera (EX-F100) that does that in normal mode, but then in macro mode will focus as close as possible if it can't find an AF point. Nice.

User avatar
Gerard
Posts: 154
Joined: 17 Oct 2010, 07:15
Number of books owned: 0
Location: Berlin (Germany)

Re: Dewraping with focus stacking

Post by Gerard » 18 Nov 2010, 18:08

one thing i can say for sure, even if it work it will take some time to calculate, alignment, averaging and so on
this will hardly be a solution for every page

i hope i will see the first prof of concept tomorrow

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

Re: Dewraping with focus stacking

Post by spamsickle » 18 Nov 2010, 20:40

For me, the fact that it took 10 minutes to shoot the images kind of scratched it off the "things you'd be willing to do for every page" list. I'm just curious to see whether it can be done at all. It seems clever and almost magical; I hope the answer is "yes."

User avatar
Gerard
Posts: 154
Joined: 17 Oct 2010, 07:15
Number of books owned: 0
Location: Berlin (Germany)

Re: Dewraping with focus stacking

Post by Gerard » 20 Nov 2010, 08:28

hi, i think we need the raw data and the intensity is also changing, so maybe 3 picutues of one focus distance could help to average this also

should i give you an ftp server to upload the data?

i croped the data to this


and this are some result with variance filter (variance can measure how strong a function is changing compared to the mean of the function, variance filter measures in an area this value and replaces the middle pixel with this value),
this seam work for areas with text, but after averaging some images i could see the structure from the paper, so this is maybe enough but not in an jpeg format

i can't wait until my A490 will get chdk
Attachments
croped.jpg
croped.jpg (35.14 KiB) Viewed 4884 times
plot.png
plot.png (3.03 KiB) Viewed 4884 times

User avatar
Gerard
Posts: 154
Joined: 17 Oct 2010, 07:15
Number of books owned: 0
Location: Berlin (Germany)

Re: Dewraping with focus stacking

Post by Gerard » 20 Nov 2010, 12:32

Hi,

It woud be nice to have a picure form the side, a profile to know if the results a showing simular curves

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

Re: Dewraping with focus stacking

Post by spamsickle » 20 Nov 2010, 17:49

Sure, an FTP server would probably be a good idea. I shot "RAW" one time by mistake, and it filled up my puny 2GB chips pretty quickly. I don't remember how big the images were, but I've read that they can be 10 or 15 times as big as the JPEGs I usually shoot. If you're also going to want three images at each focus level, maybe we should go for bigger steps between focus levels. I can include a shot from the side too. Let me know what you'd like, and I'll try to get it this weekend.

Post Reply