So I need to undistort a bunch of images, and I need some general strategy advice...
I have a series of images (like this one), that I need to undistort (de-fisheye in this instance). An image like this is what I'm after.
I started by playing with ImageMagick and Fred's Defisheye Script, which did the trick, but took waaaayyy too long for my needs (about 2-3 minutes per image). I realized that there was a lot of overhead in the script, since it seems to assume that each image stands alone. I have thousands and thousands of images that I would like to do this to, and they all will have a similar (or the same) position of the circle in the image, and I will use the same maps to undistort them. I would like to try to do the undistort en masse to see if I can get any speedup. I am using OpenCV and Python 2.7, but I am open to other solutions.
My current plan is to get the four points (shown here), from which I can compute the radius and center of the circle (using parallel chords of a circle), crop and paste the image onto a square of 2r x 2r pixels, then use the math in this resource to actually do the undistort. I've been having issues all along the way; cv2.HoughCircles() doesn't find the image (since it is cut off, I think), and thresholding is finding light where I did not expect any, making it difficult to find the points I need.
Am I heading in the right direction here? Does anyone have any general strategy recommendations (i.e., don't bother with finding the points, just use cv2.thisMagicFunction) or tricks I can use to move forward here? I'm also a little baffled by the mapping; any pointers there would be greatly appreciated.
Posted May 26, 2014, 10:19 PM UTC