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

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.
Anonymous1

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

Post by Anonymous1 » 02 Mar 2011, 15:45

I'm re-writing my whole thing from scratch. This time, I'm 100% sure I'll get good results.

Before, I was scaling pixel columns. This was okay, but didn't account for horizontal stretch. Now, I plan on calculating a pixel-shift map by moving each pixel "vertically" based on my height map and seeing where this moves each pixel. OpenCV has a mapping function like this, and the best part is, it can interpolate!

Code/images coming soon (today/tomorrow).

EDIT

I'm still waiting for the script to finish computing (10 minutes...), so I think it's about time I had a go with C++.

atarkri
Posts: 14
Joined: 08 Jan 2011, 13:29

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

Post by atarkri » 02 Mar 2011, 22:37

EDIT: Added more images, with focused laser lines.

My rig came in the mail yesterday, had just enough time to do make an image test set today.

I haven't set up the chdk camera yet, images may have moved slightly. Haven't done anything myself with the images, but I thought I'd make a difficult-to-correct image by having the camera far-ish away as well as giving the page a non-uniform warp.

I think it's important that any such system we make can handle specular highlights interrupting the laser lines, or laser lines that aren't super thin; so I've provided some images that have such qualities, in addition to non-uniform page warping. The can be downloaded at: http://www.mattikariluoma.com/files/Boo ... 011.tar.gz

Following is a preview of the dataset, the full set can be downloaded above:
100_3227.JPG
Non-uniform book page curl with thick red laser lines
100_3238.JPG
Non-uniform book page curl with thin red laser lines and a nasty specular highlight
And last, a "normal" picture with uniform warping:
100_3231.JPG
Uniform book page curl with thin red laser lines
Last edited by atarkri on 03 Mar 2011, 13:48, edited 1 time in total.

User avatar
daniel_reetz
Posts: 2779
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: Methods To Sense The 3D Surface/Structure Of A Book

Post by daniel_reetz » 02 Mar 2011, 23:43

focus your lasers d00d

andigit

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

Post by andigit » 06 Mar 2011, 00:05

Haven't had too much time to work on my code but I fixed my speed issue. I can load up a image 3504 × 2336 (from my 20D) and gaussian blur + laser line finding in few sec. I should be able to speed this up if I change how the gaussian blur is applied to the image (slowest part). Kernel matrix method is really slow so if I have some time I'll update this.

I started adding some code to rotate + keystone correct the image... my method is more manual but you should only have to do it once.

Also fixed my bicubic interpolation. Had some clamping issue and some of the color was overflowing.

My head is about to blow up but I think I finally figured out my rotation algorithm for making the book flat. Just need to implement it in code.

User avatar
daniel_reetz
Posts: 2779
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: Methods To Sense The 3D Surface/Structure Of A Book

Post by daniel_reetz » 06 Mar 2011, 00:09

I'm going to have an extra laser system in a week or two. Do you want it, andigit?

andigit

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

Post by andigit » 06 Mar 2011, 01:43

That might be a good idea. I can definitely test some stuff out and optimize my process.

steve1066d
Posts: 296
Joined: 27 Nov 2010, 02:26
E-book readers owned: PRS-505
Number of books owned: 1250
Location: Minneapolis, MN
Contact:

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

Post by steve1066d » 06 Mar 2011, 17:20

Ummm..

What happened to Blender? References to the Blender 3D system have changed to "anonymous"
Last edited by steve1066d on 07 Mar 2011, 12:16, edited 1 time in total.
Steve Devore
BookScanWizard, a flexible book post-processor.

User avatar
daniel_reetz
Posts: 2779
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: Methods To Sense The 3D Surface/Structure Of A Book

Post by daniel_reetz » 06 Mar 2011, 19:32

The Member Formerly Known As Blender contacted me and asked me to anonymize his/her work here and disable the account. This was purely for personal reasons, which are unfortunately not mine to share, but trust me, it had to be done (I'll fix the problem references). We may see TMFKAB back someday in the not-too-distant future.

Edit: the reason that the blender3d stuff was changed to Anonymous is because I (stupidly and naiively) did a search-and-replace with the DB when I should have probably hand-edited stuff. I am sorry for the consequences of that and if people want more moderator transparency in that regard, feel free to contact me, privately or publicly. I'm certainly not for anonymizing users, editing posts, or changing *anything* around here unless absolutely necessary, and in fact, I think it is probably time to draft up some policy on all that.

vitorio
Posts: 138
Joined: 30 Oct 2010, 23:56
Number of books owned: 0
Location: Austin, Texas, USA
Contact:

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

Post by vitorio » 07 Mar 2011, 05:26

Just a heads up to those working with OpenCV, O'Reilly's "Learning OpenCV" ebook edition (PDF + all mobile, Kindle, etc. formats) is on sale for $20 (50% off) with code DDNCV: http://oreilly.com/catalog/9780596516130/

andigit

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

Post by andigit » 10 Mar 2011, 11:00

I've been working on rotation and keystone correction... Well, turns out I've been waisting time because my whole process works in 3D coordinate. So, rotating and keystone correcting a image actually causes problem with the final calculation.

What I need to do is calculate this rotation offset back into my laser coordinate in 3D space. My keystone offset calculated into my camera image/look normal. This will allow me to have the camera in any orientation and looking at the book at any angle. Wasted a little time but I guess I'm doing this for the challenge and to learn new things.

Post Reply