Difference between revisions of "Team:USTC-Software/Collaborations"

Line 1: Line 1:
 
{{USTC-Software}}
 
{{USTC-Software}}
 
<html>
 
<html>
 +
<img src="/wiki/images/3/3b/USTC-Software-Collaborationhead.jpeg">
 
<h2><a id="project_description">Project Description</a></h2>
 
<h2><a id="project_description">Project Description</a></h2>
 
  <div class="underline"></div>
 
  <div class="underline"></div>

Revision as of 19:12, 18 September 2015

Project Description

In Software Track’s requirements of Gold Medal, we noticed that we should address a problem that we would like to co-develop with a wet-lab team. That’s to say, this should be a collaboration where the wet-lab team posts a problem they are having and we should address the issue by creating an online software solution.

This year, 2015 USTC team selected Hardware Track. And in their project, they try to send their knights composed of CACCI, SPRING and ROSE to detect those molecules which mean many antibiotic substances emitted directly into environment and endangered in human being’s health. (You could get more information about their project from here.) In detail, SPRING, as a partner of CACCI, is responsible for taking photos by Michelson Interferometer and analyzing the data from the photos, especially getting the physical quantity from the fringes produced by the interferometer.

Achievement

When the wet-lab team provides a picture took by CCD based on Michelson Interferometer, we could analyze fringes number and distance between two points selected by user, in the meanwhile, we also could assure the fringe series of the initial point.

Website for our software tool:fringe.herokuapp.com. How to: is in here.

Techniques

Image Processing

Denoise the grayscale:

  • Choose an appropriate Gauss radius, and use Gauss filter to remove high-frequency noise.
  • Strengthen the fringes. Pixels of fringes are black, other pixels are white.
  • Remove more noise by the connectivity of pixels. We examine the 8 pixels surrounding a pixel, and we change this pixel into black if 4 or more of 8 are black. In this way, we can reduce black noise and avoid errors in calculation.

Fringe Counting

  • Get the line’s function by the coordinates of starting pixel and ending pixel.
  • List all pixels that the line crosses.
  • Set fringe threshold and non-fringe threshold and read the coordinates of pixels in 2.We regard it as a fringe if the number of continuous black pixels is larger than threshold and not a fringe if else. Each change from black to white represents a fringe.

Hence, we get the fringe number.

Fringe Spacing

  • Store the fringes as undirected graph: By travelling all elements in the matrix, we add a edge in the graph for all fringe (represented as 0)

    For example, a matrix like this:

    $$
    \begin{pmatrix}
    0 & 0 & 0 & 0 & 1 \\
    0 & 0 & 1 & 1 & 1 \\
    1 & 0 & 0 & 0 & 0 \\
    1 & 0 & 0 & 0 & 0 \\
    1 & 1 & 0 & 0 & 0 \\
    \end{pmatrix}
    $$

    We can obtain the table of edges:

    $$
    \begin{bmatrix}
    ((4,0),(4,1)) \\
    ((2,1),(3,1)) \\
    ((3,1),(4,1)) \\
    ((0,2),(0,3)) \\
    ((0,3),(0,4)) \\
    ((0,4),(1,4)) \\
    \end{bmatrix}
    $$

  • Do the depth-first-search for the users’ input ending pixel: We obtain the DFS spanning tree, which records the fringe the ending pixel is in.
  • Calculate the distance of consecutive pixels in the fringe that users choose by the starting and ending pixels to obtain the fringe order: Users choose a pixel, and we find the corresponding fringe, then calculate the distance of these pixels. We set the minimum distance as the fringe spacing.

Fringe Order

We suppose the fringes are concentric circles by the theory in optics(Team USTC used Michelson Interferometer in the SPRING hardware).Meanwhile, the relationship of fringe order and fringe radius is as follows:

$$r=\alpha\sqrt{n}$$

$r$ is the fringe radius, $n$ is the fringe order, and $\alpha$ is a constant set by users.By this equation, we can get the fringe order from the fringe radius.In the experiment of Team USTC, the relationship is $\alpha=\sqrt{\frac{\lambda r^2}{2h}}$,where $\lambda$ is the wavelength of laser, $r$ is half the thickness of thin-film, and $h$ is the distance from film moved by bacterium to the film’s original place.

Now, we derive uncertainty formula: supposed that the first point's fringe series which users select is $n$, the fringe radius is $r_n$, the second point's fringe series which users select is $m$, the fringe radius is $r_m$. Besides, we notate $c=\alpha^2$. So, we get this:

$$
\begin{align}
r^2_n &=cn \\
r^2_m&=cm \\
m-n&=\delta_n \\
r_m-r_n &=\delta_d
\end{align}
$$

Solve the equation group:

$$r_n=\frac{c\delta_n-(\delta d)^2}{2\delta_d}$$

So, we get n is:

\begin{aligned}
n & =\frac{r_n^2}{c} \\
& = \frac{1}{c}\cdot\frac{[c\delta_n-(\delta_d)^2]^2}{4(\delta_d)^2} \\
& = \frac{c}{4}(\frac{\delta_n}{\delta_d})^2+\frac{1}{4c}(\delta_d)^2-\frac{\delta_n}{2}
\end{aligned}

with uncertainty transfer formula, we would get:

\begin{aligned}
U_n & =\frac{c}{4}[2\frac{\delta_n}{\delta_d}\cdot\frac{1}{\delta_d}U_{\delta_n}+2\frac{\delta_n}{\delta_d}\cdot\delta_n\cdot(-\frac{1}{\delta^2_d})\cdot U_{\delta_d}] \\
& = \frac{c}{2}\cdot\frac{\delta_n}{\delta_d}(\frac{U_{\delta_n}}{\delta_d}-\frac{\delta_n\cdot U_{\delta_d}}{\delta^2_d})+\frac{1}{2c}\cdot\delta_d\cdot U_{\delta_d}-\frac{1}{2}U_{\delta_n} \\
& = \frac{1}{2}(\frac{c\delta_n}{\delta^2_d}-1)U_{\delta_n}+(\frac{\delta_d}{2c}-\frac{c}{2}\cdot\frac{\delta^2_n}{\delta^3_d})U_{\delta_d}
\end{aligned}

Furthermore, we display a more graceful style:

$$
\begin{align}
\frac{U_n}{n}=\frac{2c\delta_n}{c\delta_n-\delta^2_d}\cdot\frac{U_{\delta_n}}{\delta_n}+\frac{2(c\delta_n+\delta_d^2)}{c\delta_n-\delta_d^2}\cdot\frac{U_{\delta_d}}{\delta_d}
\end{align}
$$

For more derivation, we suppose that the distance between any fringes is a constant because the density of fringes is enough. So, we would get:

$$\delta_d\approx\Delta d\cdot\delta_n$$

In the formula, $\Delta d$is the distance between fringes. Continuly, we would get:

$$
\begin{align}
\delta_d^2 & =(\Delta d\cdot\delta_n)^2 \\
& = c\delta^2_n\cdot(\sqrt{n+1}-\sqrt{n})^2 \\
\end{align}
$$

Because the density of fringes is enough, the value of $n$ would be large. As a result, we could get $\sqrt{n+1}\approx\sqrt{n}$, so, the $(7)$ means:

$$\delta_d^2\lt\lt c\delta_n$$

So, we could simpilfy the $(5)$ and we could get:

$$\frac{U_n}{n}=2\cdot\frac{U_{\delta_n}}{\delta_n}+2\cdot\frac{U_{\delta_d}}{\delta_d}$$

Based on The Most Uncertainty and The Average of Principle of Uncertainty, if we want to $\frac{U_n}{n}\le 5\%$, we would assure that $2\cdot\frac{U_{\delta_n}}{\delta_n}\le 2.5\%$ and $2\cdot\frac{U_{\delta_d}}{\delta_d}\le 2.5\%$, that's to say:

$$
\begin{align}
U_{\delta_n}\le 2\cdot2.5\%\delta_n \\
U_{\delta_d}\le 2\cdot2.5\%\delta_d \\
\end{align}
$$

In terms of our testing picture, the value of $\delta_n$ is $50$, so the value of $U_{\delta_n}$ is $0.625$, and the error of our program is $0\%$. The value of $\delta_d$ is $791$ pixels, and the value of $U_{\delta_d}$ is $20$ pixels, and the error of our program is $4$ pixels. (You could check the example in here.)

University of Science and Technology of China
No.96, Jinzhai Road, Hefei, Anhui, P.R.China
USTC-Software 2015

University of Science and Technology of China

We are here for you

Sponsered by