Wednesday, August 19, 2009

A13 – Correcting Geometric Distortions

Two forms of distortion commonly encountered in image processing :

1.Barrel effect

This effect gives the image an inflated or blown up appearance .


2. Pincushion Effect

This effect gives the opposite of barrel distortion wherein the image suffers from deflated appearance.



PROCEDURE:
To correct for distortion we need to capture a reference image with a regularly occuring pattern so that we can visualize the distortion across the image frame.


The correction will be done on two image properties:
1. pixel coordinates and
2. graylevel values

1. From the most undistorted part of the image the ideal grid vertex points were located and the reference image for the corrected constructed.
2.For each rectangle compute c1 to c8 using pairs of equations (x's,y's) from
the four corner points. Per pixel in the ideal rectangle, the location of that point in the
distorted image was determined. If the computed distorted location is integer-valued, the grayscale value from the distorted image onto the blank pixel was used. If the location was not integer-valued, the interpolated grayscale value was computed instead using the equations in the manula provided in the source.

SOURCE: A13 Correcting Geometric Distortions Manual

Figure 1 . Distorted image



Figure 2. Reference image for the distorted image in figure1. pixel distances from a square in fig1.


Since it was really difficult to correct the distortion in Figure 1 at once, I just tried to correct the distortion in 1/2 the image.
So far


Figure 3. a. Half portion of image 1, (b) Corrected image distortion using linear approximation and (c) using bilinear interpolation. The crooked lines in b and c are partly due to the error in the location of the corner points in locate(and the sobrang grabeng distortion).
The quality of the corrected image using linear approximation was not as good as that of the bilinear interpolation since the image for the linear approximation using only the nearest neighbors resulted to more jagged corners for each square in the grid.


ASSESSMENT: 9/10, because I didn't get the complete distortion correction of the image though I was able to implement the distortion correction in Scilab. The main problem and the hardest part was the location of the distorted points xi and yi. Eventhough I used locate I still couldn't get the exact endpoint for each square. I should have limited myself in either barrel or pincushion distortion. :)

GRATITUDE:I would like to thank Mandee and Alva for teaching me how to do this activity :)

No comments:

Post a Comment