Methods To Sense The 3D Surface/Structure Of A Book
Moderator: peterZ
Re: Methods To Sense The 3D Surface/Structure Of A Book
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++.
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++.
Re: Methods To Sense The 3D Surface/Structure Of A Book
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: And last, a "normal" picture with uniform warping:
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: And last, a "normal" picture with uniform warping:
Last edited by atarkri on 03 Mar 2011, 13:48, edited 1 time in total.
- 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
focus your lasers d00d
Re: Methods To Sense The 3D Surface/Structure Of A Book
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.
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.
- 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
I'm going to have an extra laser system in a week or two. Do you want it, andigit?
Re: Methods To Sense The 3D Surface/Structure Of A Book
That might be a good idea. I can definitely test some stuff out and optimize my process.
-
- 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
Last edited by steve1066d on 07 Mar 2011, 12:16, edited 1 time in total.
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
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.
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.
-
- 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
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/
Re: Methods To Sense The 3D Surface/Structure Of A Book
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.
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.