Wednesday, June 17, 2009

Activity 1 - Digital Scanning

Objective: To reproduce a scanned plot using ratio and proportion of pixel values and its corresponding physical values

Softwares: OpenOffice.org Calc, Paint and Nero Photoshop

Procedure:
  1. We looked for a one-plot graph in the library, photocopied it and scanned it.
  2. We opened the image using paint and check if the axes of the graph are in a perpendicular position with respect to the image itself. If not, we used Nero Photoshop to rotate the graph in such a way that the axes are in a right angle position.
  3. After that, we obtained the pixel location of the origin. From my image, it is at (2465, 1637) with the corresponding physical value of (0, 15).
  4. Next is to obtain how many pixels correspond to a physical value both in the x and y tick marks. To do this, I obtained several data and get the average of the pixel values both in x and y axes. On the average, I obtained a 91.7 pixel values for 60 x-physical values and 69.83 pixel values for 5 y-physical values.
  5. Then, we collected pixel locations of points along the graph and tabulated them in Spreadsheet. Pixel locations are seen at the lower right part of the Paint window. There are at least 20 data points collected.
  6. We compute the x and y-factor multipliers using (physical value/pixel value) or (60/91.17) for x and (5/69.83) for y. This will be used in the conversion process.
  7. Conversion of the obtained pixel locations involves shifting and flipping of graph. For the x-axis, we use the equation:
x_new = ((x-xorigin) * xfactor) + xphysorigin
while for the y-axis, we follow:
y_new = (((-1 * y) + yorigin) * yfactor) + yphysorigin
where
x and y - pixel points along the graph
xorigin and yorigin - x and y pixel location of origin (2465, 1637)
xfactor and y factor - pre-computed from above ((60/91.17), (5/69.83))
xphsyorigin and yphysorigin - x and y physical values of origin (0,15).

From there, we can now reproduce the scanned plot by plotting the x_new and y_new. We want also to check if we got a good new plot so we compare it with the original. We overlay the original graph on the plot chart. We do the following steps:
  1. Crop only the chart area of the original graph excluding tick mark labels and titles. Only the x and y axes box should be included. Save it as another image. This will be used to overlay in the plot area.
  2. Insert any image in the Spreadsheet, right click it and select Area-Bitmaps-Import. Import the image that should be overlayed on the graph. Save the current bitmap file and overwrite the existing file. Close the spreadsheet application and try filling the chart (reconstructed plot) with the saved bitmap image. It should now then appear on the list of bitmaps.
  3. Uncheck the tile button and check autofit. That should do the overlaying of image on the graph.
The graph above is the superimposed plots of the reconstructed (green) and the original plot (black). It can be seen that the reconstructed plot is very similar with the scanned graph. I give myself 10 points.

1 comments:

  1. There seem to be an increasing error along the x-axis.

    ReplyDelete

Followers