There are many ways to accomplish this task ranging from the tried-and-true xTF to new and novel deep learning techniques. Here is a simple and accessible way to evaluate focus. This technique is best used when imaging mono-planar content-rich subjects. Scanned negatives definitely meet the former criteria and I recommend setting focus with a negative frame which matches the latter criteria.
Here is how to do it. First setup.
- Download and install ImageJ. Note that IJ is a standaone executable (unzip and run) but it does require Java. You have the choice of downloading just the platform independent or packaged with your OS' Java. Note that if you use windows and UAC is enabled, it is best to put IJ's folder elsewhere than the "programs" folders. Also note that in most cases ImageJ will not be added to your start menu; you will need to find and double click the .exe file.
- Download and install the Find Focused Slices plugin. Install instructions are on the linked page. You could also download and extract the file then choose Plugins>>Install.
- Make sure all of your images are the same size. This is easier in software with built in batch processing than it is in ImageJ
The process to find the best focus:
- Launch ImageJ
- Open all images to compare (and only images to compare) by dragging them into ImageJ
- Once all images are open go to Image>>Stacks>>Images to Stack
- With all images now in one stack go to Plugins>>Find focused slices
- Check the box for "Edge filter?" and click OK
Check the list (highest number is best) or the selected slice to see the indicated best focus.
If you do not get a clear indication of the best focused image, try one of the following:
- Disable Edge Filter
- Add a Variance Threshold
- adjust (or disable) the maximum variance
- Try the Stack Focuser plugin instead
As I said there are many different ways to perform this task. IJ is an excellent platform to experiment where you could try Difference of Gaussians or MTF