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.

Moderator: peterZ

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

Re: Dewraping with focus stacking

Post by spamsickle »

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 »

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 9576 times
spamsickle
Posts: 596
Joined: 06 Jun 2009, 23:57

Re: Dewraping with focus stacking

Post by spamsickle »

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 »

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: 2812
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 »

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 »

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 »

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 »

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 9519 times
plot.png
plot.png (3.03 KiB) Viewed 9519 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 »

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 »

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