Methods To Sense The 3D Surface/Structure Of A Book

DIY Book Scanner Skunk Works. Share your crazy ideas and novel approaches. Home of the "3D structure of a book" thread.

Re: Methods To Sense The 3D Surface/Structure Of A Book

Postby daniel_reetz » 18 Feb 2011, 12:11

L0gicm0del, that's a great find. Is it the part of the protractor you are shining through cylindrical, or half-cylindrical in shape?

Anonymous: gotcha, and can-do. 3.5mm male connector it is.
User avatar
daniel_reetz
 
Posts: 2490
Joined: 03 Jun 2009, 13:56

Re: Methods To Sense The 3D Surface/Structure Of A Book

Postby Anonymous1 » 18 Feb 2011, 15:08

Wow Dan, thanks once more. Now I don't have to connect four converters together to make it upsize and downsize twice ;)

And about the lasers, I've seen it done with laboratory stirring sticks. Those clear glass cylinders? But the beam isn't very pretty, and it is uneven.

And for dewarping progress, I think I've got it! I can't push my code to git yet, and I can't post an image, but I've successfully mapped the shape of the book from the laser lines.

I think this process would greatly be simplified if the laser lines were actually aimed vertically at the top and bottom edges of the book, because this is exactly what Steve and I are doing in the end. My 3D projection maps the 2D laser lines onto a 3D mesh, projects it onto a plane, and then scales it by sqrt(2) due to the perspective distortion, crops one column of pixels at a time (according to the projected book height at those points), and then just scales it to fit into a rectangle.

When I drew the data points onto the image of the book, they (almost exactly) traced the top and bottom of the book. I think if the top and bottom were to be highlighted with lasers (as close as possible), then the dewarping would be faster and more accurate, as the less scaling and projection, the better.

But once I get home I'll post the code and a picture of what I mean (and some almost-legit dewarping output).
Anonymous1
 

Re: Methods To Sense The 3D Surface/Structure Of A Book

Postby steve1066d » 18 Feb 2011, 15:34

I think this process would greatly be simplified if the laser lines were actually aimed vertically at the top and bottom of the book, because this is exactly what Steve and I are doing in the end. My 3D projection maps the 2D laser lines onto a 3D mesh, projects it onto a plane, and then scales it by sqrt(2) due to the perspective distortion.

When I drew the data points onto the image of the book, they (almost exactly) traced the top and bottom of the book. I think if the top and bottom were to be highlighted with lasers (as close as possible), then the dewarping would be faster and more accurate.


I'm not sure if I follow what you mean... as it is now the laser pretty much goes across the entire image, from the center to near the top and bottom (at least if it is in the cradle). If you are referring to the images without the cradle, I can see your point. We need to extrapolate the height from far away, so that if things are a little off, the problem is magnified.

Did you solve the barrel distortion? I think it is because the center of the book is actually closer to the camera than the edges, and not really a lens distortion. So if instead of calculating the image distance to the camera as cameraDistance - image height, it is more accurate to also account from the distance of the center of the image to the point.

I'm looking forward to seeing what you came up with.
Steve Devore
BookScanWizard, a flexible book post-processor.
steve1066d
 
Posts: 236
Joined: 27 Nov 2010, 02:26
Location: Minneapolis, MN

Re: Methods To Sense The 3D Surface/Structure Of A Book

Postby Anonymous1 » 18 Feb 2011, 16:21

I was referring to just highlighting the top and bottom edges of the book with a completely vertical laser. I think this is what Snapter attempts to do, and this is basically what we're doing. Since dewarping is a pretty sensitive operation, you'd want to be as pixel-perfect as possible, and to do that, you'd want to minimize the error when extracting the laser values. But in the end, aren't we just tracing the edges of the book and then scaling vertical columns of pixels so that they become square in the end?

When I said "lens distortion", I was meaning all of the distortions put together, which is what OpenCV attempts to calculate and correct with enough training images. I have yet to work with the distortion (I'm translating my Python code into almost pure OpenCV so that it will be easier to port into C++ and other languages).

Once I finally force myself to print off a dang checkerboard, I'll see how well it works. (It's quite ironic though that at my school, when you try and print a paper with no money on your account, the printer actually prints out a piece of paper saying that you don't have enough money on your account to print.)
Last edited by Anonymous1 on 19 Feb 2011, 00:02, edited 1 time in total.
Anonymous1
 

Re: Methods To Sense The 3D Surface/Structure Of A Book

Postby Anonymous1 » 18 Feb 2011, 17:23

And an image:
Screenshot-Test.png
Anonymous1
 

Re: Methods To Sense The 3D Surface/Structure Of A Book

Postby steve1066d » 18 Feb 2011, 17:47

I don't think having vertical lines like that would let you correct for the distortion due to the angle of the page to the camera. You could use it to correct for perspective distortion, however.
Steve Devore
BookScanWizard, a flexible book post-processor.
steve1066d
 
Posts: 236
Joined: 27 Nov 2010, 02:26
Location: Minneapolis, MN

Re: Methods To Sense The 3D Surface/Structure Of A Book

Postby Anonymous1 » 18 Feb 2011, 17:54

These are the lines my script is making, not me.

I use them to segment the image into vertical strips and then scale the strips to a fixed size. Do you think the radial distortion is causing the lines to split off of the book's edges?
Anonymous1
 

Re: Methods To Sense The 3D Surface/Structure Of A Book

Postby steve1066d » 18 Feb 2011, 18:02

I guess I'll need to look at your code. For my efforts i didn't care where the top and bottom edges of the page were, but the dewarping itself straitened them up.
Steve Devore
BookScanWizard, a flexible book post-processor.
steve1066d
 
Posts: 236
Joined: 27 Nov 2010, 02:26
Location: Minneapolis, MN

Re: Methods To Sense The 3D Surface/Structure Of A Book

Postby L0g1cM0del » 19 Feb 2011, 01:24

daniel_reetz wrote:L0gicm0del, that's a great find. Is it the part of the protractor you are shining through cylindrical, or half-cylindrical in shape?


It is a half-cylindrical shape. I'm not sure I could get a clear enough picture that is close enough, but I will try to post another picture tomorrow showing the lines it makes. I have it taped to the laser and it seems to be pretty decent once it's at the right position.
L0g1cM0del
 
Posts: 17
Joined: 06 Feb 2011, 18:06

Re: Methods To Sense The 3D Surface/Structure Of A Book

Postby daniel_reetz » 19 Feb 2011, 11:07

- gonna finish and ship these today.
User avatar
daniel_reetz
 
Posts: 2490
Joined: 03 Jun 2009, 13:56

PreviousNext

Return to R&D and New Technologies

Who is online

Users browsing this forum: No registered users and 1 guest