05-15-2009 09:04 PM
I am using 8.6.1 with the vision 8.6.4 Vision toolkit. I am grabbing images from the 1422 frame grabber from a CCD sensor and need to generate a test to detect how focused the lens for the sensor is. The user will manually focus the lens using a test pattern and then I need to display a level of how in focus the image is (beyond the human eye detection).
I am very new to testing video and images and have not used the Vision toolkit before. I would like to know if anyone knows how to go about using the vision toolkit to detect levels of focus.
Right now we are using standard star charts and zone charts to detect focus, but I don't know if these will work well for automation with the vision toolkit. Do I need to make a custom chart with objects that are close together and use the object detection algorithm? Like I said, I am very green in the vision arena. Any help would be greatly appreciated.
Thanks.
Solved! Go to Solution.
05-15-2009 10:20 PM
Search the forum for auto focus. There have been several previous discussions about it that might help you.
The simplest way to measure focus is to use edge detection then quantify the resulting image. The mean value follows the focus pretty well, and the standard deviation follows it pretty well also.
You can't really use this method to provide an absolute measurement of focus quality, though. You never know what the maximum value is going to be, but you can watch it go up or down as you adjust the focus. It works really well for automated focusing.
Bruce
05-16-2009 12:57 AM
The other posts didn't help much, but you just did. I used the edge detection and then the histogram to get the mean and stdev and those numbers follow the focus very well with the test charts I am using.
Thanks!
05-16-2009 11:21 PM
I probably should have told you to search for measure focus, not auto focus. It comes up with two other discussions where I gave very similar answers.
In any case, glad it works for you. You should probably mark it as a solution so everybody knows your problem is solved.
Bruce