Hi(adsbygoogle = window.adsbygoogle || []).push({});

For a control systems project this semester, my friends and I are working on a closed feedback image focusing system. Using a webcam, an image of a black and white checkerboard is acquired by a computer program. Then, the amount of defocus (blur) in the image is measured and quantified in terms of a scalar, which is sent (via a parallel port interface) to a stepper motor controller which actuates a stepper motor that rotates the focusing knob of the webcam thus changing the focal length until the image captured is properly focused.

So far, we have made the parallel port interface, the stepper motor controller and a fairly decent mounting arrangement. We have also theoretically analyzed the images captured by the camera. However, we are not able to get a very good estimator of the blur or defocus in the image.

The first approach we used was to convert all the images to grayscale and use a Sobel Edge detection filter on them. Then, we generate a scalar [itex]x_{i}[/itex] for each image [itex]i = 1,\ldots,n[/itex], given by

[tex]x_{i} = \sum_{j = 1}^{j_{max}}|E_{ij}|^2[/tex]

where [itex]E_{ij}[/itex] is the vector of edges of image [itex]i[/itex] returned by the edge detector (in MATLAB).

We assume that the scalar is a good estimator of the sharpness of the image. If the scalar has a large value, then possibly the blur is low and vice versa.

This approach worked for a bunch of images, and we were able to plot the values to confirm that the scalar attained its maximum for the best focused image. But for another bunch of images, the scalar peaked at an image that was clearly not the best focused image.

The other approach we thought of was to inject Gaussian Blur into the images and then do a correlation analysis of the images to determine what values of mean and variance for the Gaussian estimate the "actual" blur nicely. Then we would generate a scalar based on these parameters to actuate the motor suitably.

While our hardware work is mostly completed, we're struggling to come up with a simple solution to the algorithm. Any suggestions and advice would be greatly appreciated! We have less than a week for our presentation :-(

Thanks in advance!

**Physics Forums - The Fusion of Science and Community**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Autofocusing system for Control Systems Project determining defocus

Loading...

Similar Threads - Autofocusing system Control | Date |
---|---|

Mathematics behind Signal and Systems | Mar 14, 2018 |

Energy Systems and Optimal Control -- combining energy storage systems like flywheels and batteries | Mar 6, 2018 |

Load Flow Order of Jacobian Matrix Power System | Dec 29, 2017 |

What does ZPB mean in power system? | Dec 25, 2017 |

Autofocus/image stabilizaion extension | Aug 13, 2007 |

**Physics Forums - The Fusion of Science and Community**