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

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

Post by andigit » 28 Feb 2011, 10:28

Not sure why it took a long time to load, possibly my 3D calculation that pre-calculates height information for all pixel. Technically I should be loading the image in another thread so the ui event doesn't get blocked. I'll eventually get around to it.

The line detection is kind of messy. I'm almost doing a HSV/HSI checking manually. I started implementing hsv but did not finish implementing it. My plan was to use both and merge the result to gather.
https://tanoshi-apps.sourcerepo.com/red ... Runner.cpp

This code deals with the detection. There's a function at the bottom that detects the color and later finds the brightest green point.

Also everything in my code is threaded. Each scanline is handled by a thread, so it should be pretty fast at what its doing. The only thing that isn't multithreaded is the 3D calculation. I will eventually multithread this thing as well.

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 » 28 Feb 2011, 19:44

Well, I got part of it today.. Unfortunately, just the two uprights. Hopefully the real goodies are coming tomorrow.
Steve Devore
BookScanWizard, a flexible book post-processor.

Anonymous1

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

Post by Anonymous1 » 28 Feb 2011, 19:58

I've been playing with it, and the red lasers are really easy to work with. The bean's center is almost pure white, so all I had to do to extract the lasers was to threshold the red channel of the image.

As for the dewarping, I am going to redo a lot of the code. I want it to work only with a set of three images, and no user-defined values: a calibration image, an input laser image, and a laser-less image.

How's your dewarping going, Steve?

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 » 28 Feb 2011, 20:48

I'm pretty happy with where I'm at with my code.. Over the weekend I tidied it up so I'm pretty much ready to try it out with the lasers.

The approach I"m going to use is take a few calibration images, using QR codes. The first one will be on the base, the second one probably on a section of 2x4, and a final one with stacked 2x4 (so more like a 4x4). Then I'll use those images to determine the camera height, laser angle, image rotation, etc.

Then I'll probably scan a full book, with a laser image taken every 10 pages or so and see how well it works.
Steve Devore
BookScanWizard, a flexible book post-processor.

anonymous1
Posts: 1
Joined: 04 Mar 2014, 00:53

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

Post by anonymous1 » 28 Feb 2011, 22:51

I'm in the process of using OpenCV's image mapping functions to create my dewarping grid. PIL is just way too slow, and it can't interpolate. Here's a quick test I did for radial dewarping:
Python's Imaging Library takes > 20 seconds to radially dewarp an image (without interpolation).
OpenCV's camera calibration: a fluid animation of dewarping the image, starting from k=0 to 1, with a step size of 0.00001.

I'm hoping to get almost realtime dewarping ;)

andigit

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

Post by andigit » 01 Mar 2011, 03:59

20 sec per image? thats pretty slow. I tried the c++ implementation I have with a 8 mega pixel camera and its about .5 ~ 1 sec to correct image with bicubic interpolation. Although my bicubic algorithm seems to be broken at the moment... I'm getting weird artifacts some times.

Anyway I've been thinking what order to apply the image correction...
lens distortion -> key stone correction -> rotate/move image respect to laser -> book flattening.

Does this order makes since?

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 » 01 Mar 2011, 09:02

Anyway I've been thinking what order to apply the image correction...
lens distortion -> key stone correction -> rotate/move image respect to laser -> book flattening.
That's the order I'm using.. It seems to work the best.
Steve Devore
BookScanWizard, a flexible book post-processor.

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 » 01 Mar 2011, 19:16

Well I'm bummed.. no lasers today either. I got the package with the uprights yesterday but the main package is MIA.
Steve Devore
BookScanWizard, a flexible book post-processor.

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

Post by daniel_reetz » 01 Mar 2011, 20:15

That's really shitty. I built myself a copy of the system. If you don't get yours in a day or two, I'll have my neighbor overnight that one to you. Glad at least one has arrived.

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 » 01 Mar 2011, 20:32

Yeah, hopefully it will show up in the next couple of days.

Atarkri, or Anonymous, if you do some scans with your setup, I'd appreciate a copy to tide me over in the meantime.
Steve Devore
BookScanWizard, a flexible book post-processor.

Post Reply