Methods To Sense The 3D Surface/Structure Of A Book
Moderator: peterZ
Re: Methods To Sense The 3D Surface/Structure Of A Book
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.
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.
-
- 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
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.
BookScanWizard, a flexible book post-processor.
Re: Methods To Sense The 3D Surface/Structure Of A Book
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?
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?
-
- 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
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.
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.
BookScanWizard, a flexible book post-processor.
-
- Posts: 1
- Joined: 04 Mar 2014, 00:53
Re: Methods To Sense The 3D Surface/Structure Of A Book
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
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
Re: Methods To Sense The 3D Surface/Structure Of A Book
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?
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?
-
- 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
That's the order I'm using.. It seems to work the best.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.
Steve Devore
BookScanWizard, a flexible book post-processor.
BookScanWizard, a flexible book post-processor.
-
- 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
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.
BookScanWizard, a flexible book post-processor.
- 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: Methods To Sense The 3D Surface/Structure Of A Book
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.
-
- 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
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.
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.
BookScanWizard, a flexible book post-processor.