Thursday, August 25, 2016

Activity 2 - Digital Scanning



In an effort to use ratio and proportion to digitally reconstruct printed plots, I chanced upon a printed copy of the proceedings of the 1987 SPP. As I browsed through the articles, I recognized several names, one of which especially brought torturous memories of the hardships endured while taking Physics 131 and 132. Eventually, Minella C. Alarcon's  paper entitled "An Optical Remote Sensing System By Near-Infared Molecular Absorption Spectroscopy" led me to take a look at this graph.

   
Figure 1. Scanned graph from [1]

Though as interesting as the article may have been, I focused my attention on digitally recreating this graph. The first step was ensuring that I had scanned the page well enough to ensure that minimal distortions in the image would occur. If part of the scanned document was "lifted up" from the flatbed even the slightest bit, then parts of the graph could have been shrunken or stretched.

After several attempts, I finally obtained the image in Figure 1. I had noticed that despite all efforts in trying to straighten the scanned image obtained (so that the x and y axes are perfectly horizontal and vertical respectively), both axes could not be simultaneously aligned with digital grid on the computer. This could be caused by distortions caused during the scanning process, but after SEVERAL re-attempts at scanning, I have come to the conclusion that the x and y axes of the plot itself aren't perfectly perpendicular. This, in the long run, caused slight deviations in the digital reconstruction as will be seen later.

To start, I opened the scanned image in MS Paint and obtained the (x,y) pixel positions of the x and y tick marks. Dividing the difference in magnitudes indicated by adjacent tick marks (done for both the x and y aces) by the difference in pixel values of the same tick marks, a corresponding mag/pixel ratio was obtained. This was done for all pairs of adjacent tick marks and the ratios obtained were averaged. This resulted in ratios of 0.002883 mag/pixel and 0.01695 mag/pixel for the x and y directions, respectively . I employed this methodology of averaging the results for all possible intervals rather than just taking one interval in order to account for inconsistencies in the distances between tick marks that may have been caused by errors in the plotting of the actual graph.

I then took representative pixel points, making sure to take more points on the curve where the curve's slope was changing fast. This is needed due to the fact that the interpolation process employed by Microsoft Excel roughly connects the data points with straight lines. Thus, for a fast changing curve to be accurately represented, many points have to be taken.

After adjusting for the pixel position of the coordinates axes origin and the pixel coordinates axes origin (because the pixel measurements were measured with respect to an origin in the upper left corner of the image), I then multiplied these x and y pixel values of the representative points to obtained the blue plot in Figure 2.


Figure 2. Overlayed Excel digitally reconstructed plot with original scanned plot

As shown in Figure 2, the reconstruction is very similar to the original image. This not only validates the use of ratio and proportion in digitally reconstructing the plot, but also reveals some information on the quality of the construction of the original plot. Looked at the overlayed image, the y axes of both the reconstructed and original plots are aligned while the x axes are not. The slight deviation between x axes while having aligned y axes tells us that the x and y axes of the original plot itself aren't perfectly perpendicular. Following both reconstructed and original curves, we see that they separate towards higher x values. This can again be attributed to the fact that the original axes were not perpendicular to begin with. 

Looking at the tick marks, we see that most but not all the tick marks of both the reconstructed and original plots coincide. This is to expected given the fact that the ratio used was the averaged value obtained from all intervals used. Moreoever, the small differences reflect the inconsistencies in the lengths of the intervals in the original scanned plot itself. These could be due to an error in the scanning process and/or errors in the construction of the plot itself.

Taking all these into consideration, I would rate the reconstruction a value of 10. Although the slight deviation exists near the "end' of the curve, this is readily attributable an error in the construction of the original plot itself and not in the reconstruction procedure. 




References:
[1]  Alarcon, M. C. (1987). An Optical Remote Sensing System By Near-Infared Molecular Absorption Spectroscopy, Progress of Theoretical and Experimental Physics (1987): Proceedings of the Sixth National Physics Congress, U.P. Baguio May 22-24, 1987 (pp. 72-73).

1 comment: