Sunday, May 29, 2011

Photographic Distortion: A Complication

Using a camera to record the projected images of the Sun poses some problems. Pixel coordinates need to be converted into horizontal positions to accurately measure the Sun's altitude and azimuth. But, as the image below demonstrates, the results can be skewed by perspective.


A photograph of a sheet of graph paper can be used to determine the coordinates of a point on a horizontal plane. One can plot the pixel coordinates of points separated by unit distances in order to measure the amount of distortion present. In the example below the intersections of the bolder horizontal and vertical lines on the graph paper were plotted to produce a grid pattern. MS Paint proved to be a useful tool for obtaining the pixel coordinates. I chose west-east as the horizontal λ-axis and south-north as the vertical μ-axis. The graph paper was a sheet from TOPS Engineer's Computation Pad which has an inch as the unit of measure with five subdivisions.

The pixel points were used to fit horizontal and vertical quadratic curves through them which were used in turn used to find a quadratic function to represent the distorted plane in the image. The formula is given below.


Pixel coordinates, (x,y), are measured from the top left of an image which is (0,0). The first coordinate, x, is the number of pixels to the right and the second, y, is the number down. The columns of the matrix, P, are the coefficients of the quadratic function. In this case they happen to be vectors. The upper number corresponds to the pixel x-axis and the lower to the pixel y-axis. The fit isn't perfect. The pixel numbers introduce round off errors and the pictures themselves are stored in a compressed format which adds an additional complication for reading positions. And the fit was only quadratic.

The lower left corner of the grid was arbitrarily chosen to correspond to λ = 0 and μ = 0.


You can compare the pixel coordinates from the fit with those from the image using Paint. One needs to activate the selection tool and position the cursor over a pixel in the image. The coordinates can be read at the bottom of the screen. To see an image in this blog in its original size just click on it and the image should open on a new web page. You can then download the original image for the comparison.

Edit (30 May 2011): I rotated the image while doing the fit to make λ horizontal and as a result the pixel x,y values ended up being transposed.

No comments: