Tuesday, June 11, 2013

Digital Scanning

For the second activity in Applied Physics 186, we practiced digitizing hand-drawn graphs. As an overview, the flowchart below was followed.


Figure 1. Flowchart for the activity

From the MS Physics thesis entitled “Computer simulation of the focusing properties of selected solar concentrators”, submitted by Zenaida B. Domingo in April 1980, the following graph was scanned using a Canon CanoScan LiDE 100 scanner:


Figure 2. Scanned image from Figure 4.12 (Profile of energy distribution along the y-axis) of the thesis entitled “Computer simulation of the focusing properties of selected solar concentrators” (Domingo, 1980). The x-values of the plot correspond to distance while the y-values correspond to relative intensity values.

To know a bit about the context of the graph, the abstract of the thesis is as follows:
"An analytical procedure is derived for determining the distribution of energy at the focal plane of solar concentrating collectors, specifically mirror collectors. This is based on Paul Mazur’s exact double integral which gives the relative intensity distribution as a function of the emitting surface and collecting surface configurations. This double integral is then solved by computer simulation using numerical methods, i.e., Simpson’s Rule for double integration with automatic halving of interval. 
Two solar concentrating collectors are selected – the parabolic mirror collector and the hemispherical bowl collector. From the computer output, the most effective absorber shape, size and location are then deduced. The accuracy of the results is tested by comparing with existing facts on said collectors based on ray-tracing techniques and actual performance."
The scanned image has a size of 1.99MB with dimensions of 3397 x 4304 pixels (width x height). The horizontal and vertical resolutions were both 400 dpi.

However, there was something funny about the scanned graph. As you can see, the intervals on the y axis were 0.25, 0.25, and 0.50. The third interval was weird because its value is twice that of the previous intervals but the separation of the tick marks on the y axis did not change. To be safe, I assumed that the third bar/ tick mark on the said axis has a value of (0.75, 0.0).

The tick marks on the axes of the scanned graph were located and the corresponding pixel coordinates on the image was obtained. Using Paint, the pointer was dragged to the tick marks and the pixel coordinates were recorded. As an example, the figure below shows how Paint outputs the pixel coordinates. The point (0.0, 3.0), as pointed by the yellow arrow has a corresponding pixel coordinates of (x,y) = (1121,3535). 
Figure 3. Determining the pixel coordinates of the tick mark of value (0.0, 3.0) indicated by the yellow arrow and black circle. The yellow box at the lower left contains the pixel coordinate when the pointer was hovered above the said tick mark.

For the tick marks on the x-axis, the distance values were plotted against the x values of the pixel coordinates and a linear fit was made. The values for the relative intensities were plotted against the y values of the pixel coordinates for the tick marks on the y-axis and again a linear fit was performed. Note that I have performed a change of readings in the y values of the pixel coordinates. That is, instead of having a value of 0 through 4304 from the top to bottom, I have subtracted the y values from 4304 to have a reading from bottom to top. This makes it easier to visualize the points on the graph with reference to the origin of the graph (increasing relative intensity values from bottom to top). The following figures show the equations of the fitting and their corresponding $R^2$ values.
Figure 4. Plot of the value of the tick marks in the distance axis (from the scanned graph) against the x values of the pixel coordinates
Figure 5. Plot of the value of the tick marks in the relative intensity axis (from the scanned graph) against the y values of the pixel coordinates


With these fitting functions, we now have scaling functions for both x and y pixel values. The pixel coordinates of the curve on the scanned graph were obtained using the same method. The y values of the pixel coordinates were also subtracted from the 4304 value. The two fitting functions were used to retrieve the corresponding relative intensity value and distance value of each point on the curve.
Figure 6. Reconstructed plot from the scaled values, based on the pixel coordinates and fitting functions

To compare with the scanned graph, I cropped the area of the entire plot (enclosed by the axes) from the scanned graph, and performed the following procedure:
1. Copy the cropped area

2. Click over the reconstructed plot, then click “Format Plot Area”

3. Under the “Fill” section, select “Picture or texture fill” and insert from “Clipboard”.

Final output:
Figure 7. Superposition of the reconstructed graph and the scanned graph. The blue diamond marks indicate the computed pairs of distance and relative intensity values for each pixel coordinate obtained from the curve of the scanned graph.

Boom! We now see a superposition of the scanned graph and the reconstructed graph. As you might have observed, the original graph (scanned) does not indicate the highest value or the boundary of relative intensity. What I did was determine the pixel coordinates of the top of the cropped area and solved for the maximum relative intensity. In this manner, I was able to set the maximum value of the reconstructed plot to correspond to the highest value of the cropped area on the hand-drawn graph.

There are some discrepancies in the superposition, which can be attributed to the uncertainties in the fitting function. Obtaining these uncertainties are quite tedious since the method that I learned from Physics 192 involves a lot of steps. Maybe in the future I’ll incorporate this method. In addition, the curve itself has an appreciable amount of thickness, thus there is no single value of pixel coordinate for each point on the curve. We can also add this uncertainty in the future.

I was able to finish this activity smoothly in around 2 hours, so I think I deserve to have a 5/5 on the correctness of the implementation of the steps. I had fun in making this first report and included visual guides in every step so I'll give myself a 5/5 on the quality of presentation. Overall, I did well and deserve to get a grade of 10 out of 10 for this activity.

I would like to thank Dr Maricor Soriano for her helpful suggestions. And also to my classmates Wynn Improso, Abby Jayin, and Chester Balingit for helping in the acquisition of the scanned image.

That's all for now, see you next time!



References
1. Soriano, M. Applied Physics 186 A2 - Digital Scanning activity handout
2. Domingo, Z. (1980) Computer simulation of the focusing properties of selected solar concentrators. Master of Science (Physics) Thesis, submitted to the College of Arts and Sciences, University of the Philippines Diliman.

No comments :

Post a Comment