Tuesday, 11 June 2013

Activity 2 - Digital Scanning

Today we were tasked with bringing a digital copy of any hand drawn plot from any journal from the nearby CS library. I took a graph from Effect of Laser-induced collisions on chemical reactions by Sister Kathleen Duffy, but the scanning process left the right-edge of the page blurred and distorted. It wasn't much of a bother until the activity tasks were given for the day.

We were to reproduce the graph using any spreadsheet by extracting pixel coordinates based from the tick marks. Since the graph I had were blurred, this would cause error during initial measurements. It was just my luck that the girl scout next door and my classmate, Abigail Jayin, had a spare graph about Electron density profiles.


Figure 1. Scanned copy of the Electron density profile [1]


The first step was to calculate the conversion equation between pixel coordinates and the graph's x- and y- coordinates. In order to obtain the pixel-to-physical value ratio, paint was used, as shown in Figures 2 and 3. The crop tool in GIMP was also utilized in order to isolate and align the graph, removing the need for reference points and allowing direct extraction of values. 



Figure 2. Using paint to measure x-axis pixel location conversion




Figure 3. Using paint to measure x-axis pixel location conversion


The x-axis conversion was easily acquired; 127 pixels/cm. The y-axis conversion proved to be more troublesome as it arranged its physical values in logarithmic space. What had to be done initially was the same for the x-axis. Direct conversion shows that for every 792 pixels corresponds to 1 unit in the logarithmic space. In order to perform this, the pixel coordinate has to be flipped since the origin in an image starts at the upper left. The y-pixel coordinates are then to be converted into logarithmic coordinates and the results used as exponents with a base of 10. Final results are then to be multiplied by 10 of the ninth power, shifting the results into the range of graph. Thus the determined proper pixel to physical value conversion equation are as follow:

  • x = xp/65
  • y = 10^((1589-yp)/792)*(10^9))

Where x and y are the physical variable value and xp and yp are the pixel location. In order to acquire pixel coordinates along the graph more accurately, grids were introduced unto the digital graph to use as a guide. Taking in 20 pixel coordinates from the lower graph, they were converted using the two equations mentioned and plotted atop the original graph for comparison. As can be seen in Figure 4. Results show that the points were plotted accurately as the points overlaps with the original points.

 It is noticeable that some of the plotted coordinates strays from the original by some marginal value. This could have been brought about by improper measurement of pixel location. Another probable cause would have been the graph itself. Recall that the graph is hand drawn and is subjected to human error. Analyzing the graph it can be seen that it is not entirely perpendicular with respect to the image borders in Figure 1. The cropped image of the graph was already straightened using gimp in order to untilt the graph or at least minimize tilting. This, however, seemed unavoidable as can be seen in Figure 4. Although unnoticeable with a white background, close up the edge of the plot is not perpendicular to the base of the image. With the grid lines for the experimental graph present though, the misalignment of the graph is more prominent. The implementation of how the page was scanned could have also contributed to the skewed edges, as parts of the pages could have been more elevated during the scan. Returning to Figure 4, the left part of the graph is tilted while the right edge is aligned with the edge of the image. Yet overall, the resulting plot is satisfactory enough with a relatively small deviation.

Figure 4. Pixel-coordinate conversion plot. The y-axis was also represented in logarithmic scale.


I would like to give myself a grade of 11 overall as it seems that I met all of the requirements or may have even exceeded it with the added difficulty for the logarithmic conversion. I would also like to acknowledge Abigail Jayin who is the generous source of my graph, Chester Balingit for scanning the graph, and Alix Santos for guiding me.

Sources:
[1] Effect of Laser-induced collisions on chemical reactions, Sister Kathleen Duffy, Proceedings of the 4th National Physics Congress, 1985

No comments:

Post a Comment