Friday, March 26, 2010

3D from Structured Light

posting some progress...

grade (0-10): 6 na:)






Stereometry

posting progress...
grade so far (0-10): 4 haay naku:)





High Dynamic Range Imaging

posting some results (need to complete later on)
grade so far (0-10): 8.5, malapit na!:)


This is a Plasma Image seen thru a viewing Window:
These are Plasma Images taken with the same camera but with different exposure times per picture:


For each image, 5 pixel locations were chosen within the viewing window,(row, col) =
800,600
600,900
1000,900
1000,370
600,370

these locations were chosen so that we have some locations which are dark and some which are bright to capture a wide range of possible pixel values.

and for each of these pixel locations, we have varying pixel values as we change from different images(i.e. varying exposure times)



But, for each exposure time, we can get the log of delta T (T=exposure time), and plot the pixel values (same mark = same pixel location) as we change exposure times as shown below:

These points can actually make up the new "transfer function" to increase the dynamic range of our camera by calculating a best fit for the group of points above and combining all "sub_groups" into one smooth function that "extends" both ranges of the pixel values and the exposure times.

Camera Calibration

just posting the outputs first...
self-grade so far (0 - 10) : 8, wait lang:)











Sunday, March 7, 2010

A Freeman's Silhouette




The Freeman Code has garnered a number of applications in image processing. Some Malaysians (http://paper.ijcsns.org/07_book/200911/20091132.pdf) have used the Freeman Chain Code for car plate number recognition. Filipinos (http://people.ee.duke.edu/~qh/classes/spring2007/ece635/index_files/papers/curve_spread.pdf) have used the Freeman Vector Code for Silhouette Processing for use in frontal human gait recognition (apparently, we can also recognize people just by the way they walk:) <-- how true in my HS barkada!)

Sample Freeman Transformation / Encoding

The Freeman Code is a shape representation of a boundary of connected pixels(4-connected or 8-connected) where each pixel is numbered according to it's relative position. This representation scheme is very powerful since (1) it preserves the information of interest(the outline/edge), (2) it permits compact storage(just an array of numbers!!), and (3) facilitates processing.

So for the Gait Silhouette, the Freeman Code looks like:

From this Freeman-coded representation, we can even get concavities just by applying a simple gradient running average onto the freeman code array which results in some + / - or 0 values that is indicative of whether there is a convex or concave curve or none at all:)

Now, for this activity, I chose to look at race tracks.:) Why?? well, i was studying some mobile robot tracks and google earth images at this time(with some roads) :) I guess this is what came first into my mind then when I heard: edge + curve + image. hehehe

and so here are some race tracks, clean, ideal, made from paint!

I chose to process the 2nd one. The one with a thinner outline so that i do not have to do any edge detection anymore.



I used the freeman transformation shown above(Sample Freeman Encoding) which Soriano et al also used in their Curve Spread work.

Now, let's see if we can also get the curvature information:)



Notice how the values swing from + to - to zero. The signs indicate whether the curve is convex or concave, and zero means straight.



Grade for this Activity: 1.25 ... or from 0-10, 9.5 i think i could have done this sooner and without being so messy:)

Hough Tough on my Laf-tof


This image is a picture of Eden Nature Park's Greenhouse Hydroponic Vegetable Garden:) Where else can you find such a wonderful agricultural wonder but in Davao City, Philippines:)

We were asked to choose an images with lines to use the Hough Transform with, I chose the image above:)

The Hough Transform is a useful tool for shape identification in images. Commonly used to identify basic shapes, such as lines, the Hough transform can be invoked for a variety of applications: road mapping, surveying, structure analysis, etc.. Hough operates on binary images (white/'1'-valued and black/'0'-valued), where black = background, so before using the technique, make sure that the image has been pre-processed so that the pixels of interest are white.:)



The image below is a B&W version of a cropped section of the Eden Pic.
The way I understand Hough is not that it ain't that tough.:) For me, it's a mere transformation /"transposition" into the polar coordinate system("circular" system as opposed to the Cartesian "flat" system). By this, I mean that we can represent an image in terms of each pixel having a specific radius and angle from a fixed point. So, instead of saying (x,y), we have (r, theta), gets?:)

(refer more to this for a review of polar coordinates: http://csdt.rpi.edu/na/shoban/polar/polar.html)


The advantage of having to represent our image in (r,theta), as what the Hough transform does, is that we can then identify which pixels actually lie on the same line!:) How??

(Warning: geeky part here...) [Reference: http://www.cogs.susx.ac.uk/users/davidy/teachvision/vision4.html ]

Representing each pixel as (r, theta) enables us to plot the image in an r-theta graph which gives us some cyclic patterns (since we are traversing the image not from left to right, top to down, but rather from -90 to +90 degrees). In this graph, each "sinusoidal strand" represents one cycle and in each cycle, we mark out only those where pixels are present (valued '1' / colored white).
Hence, when we are able to represent the whole image in terms of these sinusoidal strands, we find that there are more intense points which correspond to pixels lying on the same line!:) (remember the equation of a line: y=mx+b; theta will be related to slope; and since one line=1 slope, you'll get the same theta values for pixels on the same line)


I tried the Hough Transform in scilab using this original image:

and came out with this "polar" graph:

I really didn't know what to do after that but i decided to shift to Matlab (hehehehe) since i know this tool better:)


Shown below is a figure with 2 subplots. The top plot is the Original cropped Truss image and the bottom plot is the r-theta graph produced by the hough transform.
Notice how this Hough transform is in "Hot" colormap with the most intense pixels being yellow, or bright orange or white. The x axis is theta and the y axis is r. we limit theta to -90 to 90 but the r can go negative of positive which then tells us simply that the span of this hough space covers the entire 360-degree possibility for the allowed radius, r of the image.

Shown below is the same Hough Transform plot in r-theta but without the colormap. This image was generated using the houghpeaks function in Matlab. Marked in white squares are the top 20 most intense locations. The r-theta information of these locations are potential lines.:)
Using the houghlines function in Matlab, the figure below is generated. This shows the overlay of the potential lines as investigated through the houghpeaks function and we see the possible lines with the blue line as the longest line detected using the hough transform.

Notice that the lines detected were those that were thin (edges) not the broad ones:)

Grade I give for this activity: 1.25, or from 0-10, 9.5 - i could have done this faster...