In cases where numerical values are to be obtained from printed images or hand-drawn graphs, basic application of ratio and
proportion is the key. To demonstrate, I shall reproduce Figure 1.
Figure 1. A scanned hand-drawn graph. (Image source: http://tinyurl.com/knn59tj)
Starting off, I opened the image in GIMP 2 and enabled the Show Grid option. The grid served as a guide in order to see if the image was distorted in some way. I noticed that Fig. 1 was a bit tilted since the horizontal axis in the image wasnt perfectly parallel to the grids horizontal. To fix this, I rotated the image so that the horizontals were perfectly aligned. However, the vertical axis appeared to be misaligned as well. I tried to use Skew tool to fix it so that any further adjustments on the image wont affect the already aligned horizontals. After several attempts, the grids vertical line and the images vertical axis was aligned close enough.
Assured that the axes are well aligned with the grid, I derived the important points on the graph in terms of their pixel coordinates. The important points are: origin, maxima of the axes, and points on the curve. Since the line width of the plot is relatively larger than the dimension of the images pixel, choosing which pixel to get was quite problematic. For consistency, I decided to take the outermost black pixel of the corresponding thick line rather than the gray ones at the edges. For example, the plots origin was composed of several pixels so I took the black pixel at the corner of the intersection instead. Aligned with this origin, I took the coordinates of the black pixels at the tip of vertical and horizontal axes as the maxima. On one hand, I made use of the image-grid alignment when I selected the points on the curve. By choosing only the points that coincided with the intersections in the grid, it was much easier to select the points since the intersections are just as small as the pixels. Below are the pixel coordinates of the important points.
Figure 2. Important points from the plot.
Figure 3. Points on the curve with their corresponding pixel coordinates.
In order to reproduce Figure 1, the pixels gathered in Figure 2 and 3 should scaled with their true value, that is, from what they really represent based from the plot in Figure 1. To do this, a scaling factor for xaxis and y-axis have to be determined. Using this equation,
the scaling factor for the x-axis and y-axis was found to be 0.04202 and 0.08621, respectively. From Fig. 1, the true value of 1 unit in the x-axis is 5 while for y-axis, its 10. I obtained the number of pixels per unit as well by measuring the distance from the origin to the first tick mark along the respective axes. The Measure tool gives the distance between two points in the image and for my purpose, I set it to be in terms of pixels. Tabulating the necessary pixel coordinates and the scaling factors in Microsoft Excel, Figure 1 can now be reproduced. Starting off, the absolute distance of the points in Figure 3 from the origin were calculated and labeled as new coordinates. These points were then scaled by multiplying them to the scaling factor to get the coordinates labelled as scaled coordinates. The plot of the scaled coordinates is in Figure 5. For a better illustration, Figure 6 shows an overlay of the scaled plot to the cropped version of Figure 1. The maxima of the axes were also scaled to determine the appropriate maxima of the scaled plot and then be used as a guide for the overlay. How close the scaled plot is to the original plot depends on how correct my scaling factors were and from Figure 6, I can say that I scaled them fairly satisfactory.