The objective of this work is to study camera distortion using images of checkboard targets.
Download MATLAB source: source.zip and test images: images.zip
The images are shown in img_array
.
One approach is to use connected-components analysis to find the interior of checkers, and then sort them to a 2D grid of neighbors.
See finder1
and finder2
for examples of this approach. Some parameters must be adjusted for this method to work correctly.
Another approach is to use a "butterfly corner" detection filter to find the corners of the checker squares. We try to calculate the centermost square by looking for the four nearest neighbors to the centroid. This does not always work perfectly and guidance may be required to find this square. Next we extend the grid in all directions (left, right, up, and down). Where there is distortion you can easily see the difference between the grid and the actual corner location.
See positions
for an example of this approach. The script
drawgrid
is used to draw the grid. The function
filters2
defines the filters.
Maintained by John Loomis, last updated 20 June 2012