klessm1 Posted May 17, 2009 Report Share Posted May 17, 2009 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. Quote Link to comment
crelf Posted May 17, 2009 Report Share Posted May 17, 2009 A common method to measure (relative) focus is to look at the spatial contrast of an image - look at how quickly the intensity of the image changes in the area of interest. If it's a gradual change you image is less ofcussed than a fast (or tight) change. Quote Link to comment
klessm1 Posted May 17, 2009 Author Report Share Posted May 17, 2009 Thanks. I used the edge detection followed by the histogram and the mean and stdev follows the focus very well. The better the focus the more edges and the higher the mean and stdev. Especially with the star and zone charts that I am using. Quote Link to comment
ShaunR Posted May 17, 2009 Report Share Posted May 17, 2009 Another method which is very effective is to look at a line of pixels (line profile) and look at the rate of change at edges. If you are in-focus and looking at series of lines and spaces you will get sharp peaks which become much flatter and rounded as you go out of focus. A simple d/dx will give you the rate of change. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.