Showing posts with label activity. Show all posts
Showing posts with label activity. Show all posts

Thursday, July 14, 2011

A5 - Enhancement by Histogram Manipulation

This is the image I chose for this activity.

This the grayscale of the image.This is the CDF of the image and the desired CDFThis is the histogram plot of the image.This is the histogram plot of the grayscale image and also the normalized histogram plot.This is the normalized grayscale image.After the backproject, this is the enhanced(?) image.
Using a gaussian CDF, this is the modified image that I got.
This is the histogram plot of the modified image. Note that it looks like a gaussian distribution function (more or less).
This is the CDF of the modified image.
For this activity, I'd give myself an 8/10. Same reason as the previous post. Check check check. :|

Estimation is Green - A4

All through out our education life, we have encountered 'area' quite a lot of time. But if you were asked to define 'area', how would you explain it? Maybe right now you're coming up blank as to its definition. From wiki, Area is a quantity that expresses the extent of a two-dimensional surface or shape in the plane. Area can be understood as the amount of material with a given thickness that would be necessary to fashion a model of the shape, or the amount of paint necessary to cover the surface with a single coat. It is the two-dimensional analog of the length of a curve (a one-dimensional concept) or the volume of a solid (a three-dimensional concept).

We were sometimes tasked to take the area of various objects. Area of a box, a circle, a paper, a triangle, any object and the list goes on and on. As we grow older, we also encounter 'area'.

The black and white regular geometric shape I chose. Using paint, I made this 150 by 80 pixel size white rectangle. This rectangle has an area of 12,000 pixels. Using Green's Theorem and Scilab, i got the value of 11,544 pixels as the area of the rectangle. This is quite close with the real value.















Next, we had to choose a location of our interest. I chose the Quezon City Circle. From Google Maps, I saved an image of the QC Circle.










In paint, I delineated the area of interest from the rest and the result is shown below:


















Using the same procedure and calculating the area of the image, I got the area of 50,549.5 pixels. To convert this to square meters, I used the techniques learned in Activity 1. From the QC circle image above, we can see the scale bar on the lower left corner of the image. Then 87 pixels = 200m in lengthwise. So converting/dividing, we can compute that 1 pixel in lengthwise = 2.299 meters and 1 pixel square = 5.28 sq. meters. Converting 50, 549.5 pixels, we have 267, 139.65 sq. meters.

For this activity, I'd give myself an 8/10. Although I did complete the activity I posted late because for some reason, my blog wasn't posted(it was only saved and needs to be edited yet). And since I didn't check if my blog was indeed posted, I deserve a deduction.

Thursday, June 16, 2011

The Middle and the End(?)

The first activity in our AP 186 class is Digital Scanning. We had to find an old journal and look for an obviously hand-drawn graph. I found my hand-drawn graph in the graduate thesis manuscript entitled “Relaxation Times and the Initial Conditions of the One-Dimensional Fokker-Planck Equation” by Mr. Josefino Z. Villanueva dated September 1973.

The activity's objective was to use ratio and proportion to find the numerical values of a digitally scanned hand-drawn plot. I used paint and excel/spreadsheet for this activity.

First, I needed to scan a photocopy of the hand-drawn plot (figure 1). Using paint, I had to get the equivalent pixel values of the tick marks of the x- and y-axes. Then use ratio and proportion to get the equivalent “real” values of the pixel values. The graph's origin (0,0) has pixel values of 395,1673. Below are the pixel values of the tick marks of the X-axis (table 1) and Y-axis (table 2).

Figure 1. Scanned picture of the hand-drawn plot.

Table 1. Equivalent pixel values of the X-axis of the graph

Table 2. Equivalent pixel values of the Y-axis of the graph

Next, I moved my mouse over points in the graph to take down the pixel values of the points. Listed in table 3 are the data points that I have chosen.

Table 3. Pixel values of data points chosen from the graph.

Using the data in table 1, I plot the physical values of the tick marks of the x-axis versus the equivalent x-axis pixel values. This is shown in figure 2.

Figure 2. tick mark versus pixel values for x-axis

And also using the data in table 2, I plot the physical values of the tick marks of the x-axis versus the equivalent x-axis pixel values. This is shown in figure 3. This is for me to be able to get the best-fit line.
Figure 3. tick mark versus pixel values for Y-axis

After all of that, using the equations in the best-fit line for the x and the y, I just input the pixel value(f(x)), so that I'll get the true physical value of the points(x). I then plot the values that I have calculated and plot them with the original figure superimposed (Figure 4)

Figure 4. Plot of the calculated physical values superimposed with the scanned figure.

Before I used the best-fit line (as per suggestion of Ma'am Jing), I originally used the average for the ratio and proportion part. The values that I obtained were plotted and is shown in figure 5.

Figure 5. Plot of the calculated values w/ scanned figure superimposed (using average pixel values)


Comparing figure 4 and 5, you can see that figure 4 (using the best fit line) has a higher R-squared than that of figure 5 (using the average pixel values). And so Ma'am Jing was right.

From my results, I think I would have done a better job. Maybe taking more data points would have made the new figure have a higher R-squared.

And so, for this activity, I'd grade myself an 8/10. As much as I want to say that I did the work on my own, that's not entirely true. Krista helped me understand what I should be doing, because I was kind of lost from the start. And (I don't know why) I didn't quite understand the instructions. Anyway, after asking help form Krista, I finally understood the activity and was able to finish it.

This is my first time using paint as a source of gathering data. Never thought it could be used that way. I only use it to copy pictures, etc. It only shows how much I need to learn. And so, I'm looking forward to learning more new stuff. :)