Page 32 of 36

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

Posted: 02 Mar 2011, 15:45
by Anonymous1
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++.

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

Posted: 02 Mar 2011, 22:37
by atarkri
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

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

Posted: 02 Mar 2011, 23:43
by daniel_reetz
focus your lasers d00d

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

Posted: 06 Mar 2011, 00:05
by andigit
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.

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

Posted: 06 Mar 2011, 00:09
by daniel_reetz
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

Posted: 06 Mar 2011, 01:43
by andigit
That might be a good idea. I can definitely test some stuff out and optimize my process.

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

Posted: 06 Mar 2011, 17:20
by steve1066d
Ummm..

What happened to Blender? References to the Blender 3D system have changed to "anonymous"

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

Posted: 06 Mar 2011, 19:32
by daniel_reetz
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.

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

Posted: 07 Mar 2011, 05:26
by vitorio
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

Posted: 10 Mar 2011, 11:00
by andigit
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.