Page 2 of 3

Re: Want to help me with an algorithm?

Posted: 04 Oct 2009, 13:42
by rob
So I chose a 128x128 box around the center, and did an autocorrelation on the blurred image. Here's the result:
autocorr.png
autocorr.png (2.12 KiB) Viewed 10936 times
There's a bright white blob at the origin, because the image is by definition correlated perfectly with itself at a shift of dx=0, dy=0. The next major correlation along a rough diagonal is at dx=42, dy=36. Since dx*dx + dy*dy = 2s*s, where s is the side of each square, we have s = 39.1 pixels per side. Since we know a square is 0.2 inches, this translates to 195.5 dpi, which is pretty much what I calculated by eye and by hand.

So, using this information, I can find a dot, move 42,36 from there, and look around +/- a pixel or two to find another intersection.

Now I just need to get the algorithm running quite a bit faster!

--Rob

Re: Want to help me with an algorithm?

Posted: 05 Oct 2009, 14:32
by rob
Here is an autocorrelation on a sample in the center of the binarized checkerboard (as opposed to the intersection image):
autocorr2.png
autocorr2.png (5.93 KiB) Viewed 10925 times
Here, the image is self-similar at dx=43, dy=36, which compares favorably with the autocorrelation found using the intersection image. It also takes somewhat less time to compute, since we don't have to do a blur.

Re: Want to help me with an algorithm?

Posted: 19 Oct 2009, 17:46
by bkrpr
rob wrote:
As you can see, the correction worked perfectly, except that the corrected image shows barrel distortion. That could be due to the lens, but an easy fix is to correct based on more tiles (I chose a single tile, the entire checkerboard).

Here's what I need: an algorithm that will pick out the coordinates of the corners of each square in the checkerboard image, or an algorithm that will pick out the coordinates of the centers of the dots in the dot image. Yes, I did Google for checkerboard corner detection, and there are lots of papers... hidden behind paywalls. So I'm throwing this out to the group: can anyone find a suitable algorithm? I'm not looking for ideas on constructing such an algorithm, but an algorithm that already works.

Thanks!

--Rob
It might not be quite what you're asking for, but there is an algorithm specifically for correcting barrel distortion:
http://wiki.panotools.org/Lens_correcti ... parameters

With a linux cmd line program for applying it to images: http://wiki.panotools.org/Fulla using a database of various commercial camera lens characteristics (the PTLens database) [since closed]. There is a new database though called the lensfun database: http://lensfun.berlios.de/manual/index.html

Also, I have some university connections in NY, so if there are some papers Daniel can't get for you, I'm happy to give it a try.

All of which is by way of saying that this looks amazing, please keep up the good work.

-Ian

Re: Want to help me with an algorithm?

Posted: 21 Oct 2009, 18:37
by rob
I think I may abandon this effort also, since it looks like my dewarping work on Scan Tailor is working very well. :)

Re: Want to help me with an algorithm?

Posted: 28 Oct 2009, 16:59
by bkrpr
rob wrote:I think I may abandon this effort also, since it looks like my dewarping work on Scan Tailor is working very well. :)
Well, modular work is always great, especially since the software to do all of these tasks is still really fluid, but getting this algorithm into any workflow is a great gain and it's good to know that scantailor development is still going. Is your scantailor work available anywhere?

Re: Want to help me with an algorithm?

Posted: 30 Nov 2009, 17:18
by bkrpr
you might also want to check out this piece of work going on at the decapod project: http://decapod.googlegroups.com/web/rec ... gobneSjMyE

Re: Want to help me with an algorithm?

Posted: 30 Nov 2009, 18:07
by daniel_reetz
Do you have a sense of why they are using the classic multiple-view lens distortion estimation process instead of the various other methods available? And in particular, why the demo only shows calibration occurring in the center of the lens, where distortion is least problematic?

I know they're trying to integrate everything very tightly, which probably explains it, but it makes me wonder why they aren't using something that doesn't require a special target, like the panoramic lens parameter estimation used by the panotools/hugin group.

Re: Want to help me with an algorithm?

Posted: 04 Dec 2010, 12:52
by o3h1p
Hey Rob,

If it still matters, and if you give me links to those papers I have access through a lot of paywalls (if we are talking academic).

jack

Re: Want to help me with an algorithm?

Posted: 07 Dec 2010, 19:43
by forza
Hi!

I think OpenCV could be used for camera calibration and undistortion. Here is an example I found in C code, but there is also bindings for other languges.

Re: Want to help me with an algorithm?

Posted: 08 Dec 2010, 11:44
by rob
Yes, the OReilly book Learning OpenCV has some great examples of using OpenCV for calibration. I may try this for stereo calibration if the Kinect effort doesn't work out...