Difference between revisions of "Team:Cambridge-JIC/Autofocus"
KaterinaMN (Talk | contribs) |
KaterinaMN (Talk | contribs) |
||
Line 50: | Line 50: | ||
<div style="width: 100%; padding: 0% 10%; margin: 30px 0px;color:#000"> | <div style="width: 100%; padding: 0% 10%; margin: 30px 0px;color:#000"> | ||
<h3>The Solution</h3> | <h3>The Solution</h3> | ||
− | |||
<p>The strategy of the autofocus algorithm is to calculate the <b>focus score</b> for each frame imaged while gradually changing the sample-objective distance, until the score is maximized. This corresponds to the most sharply focused image. The physics behind the process is very simple: image of an object, viewed through a lens, is produced at a particular distance from the lens; at any shorter/longer distance the light rays from a single point on the object do not converge into a point, and therefore the image is blurred. The focus score can therefore be simply regarded as a mathematical function with a single maximum. However, multiple methods exist for calculating the focus score. The challenge was to find the most robust one. Here is what we tried: | <p>The strategy of the autofocus algorithm is to calculate the <b>focus score</b> for each frame imaged while gradually changing the sample-objective distance, until the score is maximized. This corresponds to the most sharply focused image. The physics behind the process is very simple: image of an object, viewed through a lens, is produced at a particular distance from the lens; at any shorter/longer distance the light rays from a single point on the object do not converge into a point, and therefore the image is blurred. The focus score can therefore be simply regarded as a mathematical function with a single maximum. However, multiple methods exist for calculating the focus score. The challenge was to find the most robust one. Here is what we tried: | ||
<ul> | <ul> | ||
Line 62: | Line 61: | ||
</ul> | </ul> | ||
<p><i>Gradient search, which is a simple technique for convergence to local extrema, was also attempted, but did not give satisfactory results, as the learning rate of the algorithm is slow. Also, noise from images drastically disrupts the calculations. This was a significant problem even when the gradient was calculated by taking multiple pictures around the point of interest. Another algorithm that we found was unsuccessful is the golden section interval algorithm.</i> </p> | <p><i>Gradient search, which is a simple technique for convergence to local extrema, was also attempted, but did not give satisfactory results, as the learning rate of the algorithm is slow. Also, noise from images drastically disrupts the calculations. This was a significant problem even when the gradient was calculated by taking multiple pictures around the point of interest. Another algorithm that we found was unsuccessful is the golden section interval algorithm.</i> </p> | ||
+ | <center><img src="//2015.igem.org/wiki/images/d/da/CamJIC-Software-Autofocus-Example.jpg" style="width:40%;margin:10px"><img src="//2015.igem.org/wiki/images/b/b1/CamJIC-Software-Autofocus-Graph.png" style="width:40%;margin:10px"><p><i>Autofocus algorithm in action: the plot shows the increase of the variance (i.e. the focus score) of the image with each iteration.</i></p></center> | ||
<p>The performance of the final autofocus algorithm varies, depending on the starting point of the search. A typical processing time is around 40s, which allows for autofocus during live-stream imaging through the <a href="" class="blue">Webshell</a>.</p> | <p>The performance of the final autofocus algorithm varies, depending on the starting point of the search. A typical processing time is around 40s, which allows for autofocus during live-stream imaging through the <a href="" class="blue">Webshell</a>.</p> | ||
<p>The autofocus algorithm we have developed is open for further improvements and performance enhancement. Ideas for future development include a threshold value to indicate the event of reaching max focus, and hence to stop the search.</p> | <p>The autofocus algorithm we have developed is open for further improvements and performance enhancement. Ideas for future development include a threshold value to indicate the event of reaching max focus, and hence to stop the search.</p> |
Revision as of 23:11, 17 September 2015