I am working on Identification using iris images and want to detect best image among 100 images(frames) to extract features. I need to measure focus in each image to select best image. can anyone help please?
The question isn't as simple as that - you need to think about the depth of field of your imaging system. In macro photography in particular the DoF is very limited, so part of the image will be in focus but other parts will not. So the definition of 'in focus' then becomes more complex. I think one approach would simply be to examine your image (or a region of interest of the image) in the frequency domain - if it is in focus, you should have plenty of energy present in the high-frequency part of the spectrum, while if it is out of focus, it will be effectively low-pass filtered. You probably need to build up a collection of test images and compare the spectra to get a good sense as to how well this will work.
Some sort of higher-level AI strategy for pattern classification will probably be helpful. For example, an interesting Masters thesis by Oscar Beijbom discusses using a support vector machine approach for focus classification. This may be applicable to your problem; the link is attached.
The question isn't as simple as that - you need to think about the depth of field of your imaging system. In macro photography in particular the DoF is very limited, so part of the image will be in focus but other parts will not. So the definition of 'in focus' then becomes more complex. I think one approach would simply be to examine your image (or a region of interest of the image) in the frequency domain - if it is in focus, you should have plenty of energy present in the high-frequency part of the spectrum, while if it is out of focus, it will be effectively low-pass filtered. You probably need to build up a collection of test images and compare the spectra to get a good sense as to how well this will work.
Some sort of higher-level AI strategy for pattern classification will probably be helpful. For example, an interesting Masters thesis by Oscar Beijbom discusses using a support vector machine approach for focus classification. This may be applicable to your problem; the link is attached.
Try that - calculate the derivatives of the images (in both directions) and sum the result for each image. The highest sum will likely be for the most focused image.