Focus Stacking Apps
I have have created an app to aid in setting up the acquisition of focus stacks with various lenses using the Panasonic S1R camera, the Nikon Z7 camera, or functionally similar cameras in the same family. Each lens is different, so there is a dropdown list to select the lens. The app is an html file that execute on most browsers. The same app can run on a computer, Mac or Windows, or on a cell phone or tablet, Apple and Android. An app has a window for inputing data specifying the nature of the stack. The app returns two numbers that are entered in the camera menu to specify the resolution and number of images in the photo stack created. A typical app window is shown below.
Distances in the apps are expressed in meters (m) or millionths of a meter (um). There are two modes of operation supported by an app. In the regular mode the user specifies f-number, distance to target where the stack starts, and the circle of confusion (Suggested 6 or 12. This is further explained in the overview page.) The length of the desired sharp zone is specified by its width. The app returns "step" that is inserted in the camera menu and regulates the overall sharpness of the photo stack. The app returns "image count" or the number of photos in the stack. In the alternate mode of operation (landscape mode) the only inputs used by the app are the f-number and the circle of confusion. In landscape mode (also in the regular mode) the user is expected to focus the camera on the point where the stack starts and then enable stack acquisition. (On the S1R the lens must be in autofocus mode, but manual mode must be set on the camera control so that focus is not disturbed when using the shutter release to start the stack acquisition.) The camera will take photos until focus reaches infinity. Some of the lenses for which apps are anticipated are shown in the table below. Distances in the table are in mm or um. (1000 um = 1 mm)
To allow for error, particularly in manually focusing the camera at the start of the stack, an additional 20% is added to the distance to the end of the stack. These adjustments help avoid error and minimize the number of photos in a stack. A very narrow sharp zone at a long distances is not realistic, since taking a single photo could often accomplish the required width of the sharp zone, without using photo stacking. Of course the user is free to increase the image count, possibly a wise precaution as excess images can be removed in processing, but too few image cannot be corrected after the fact.
Manual determination of the proper step to enter in the camera menu
If one does not have access to one of my apps, it is possible to get a rough setting for the menu step by making some measurements. The method is to set the f-number to be used and see how many steps it takes to go from a focus point equal to 10x the focal length to infinity with menu step equal to 10. This is done by setting the image count in the stacking mode to a large number (the maximum is 999 for the S1R and 300 for the Z7).The camera will stop taking images shortly after infinity is reached. If the data card is erased first, then number of images is shown on the view screen when viewing images. If the maximum count of 300 on the Z7 is not enough, another stack can be acquired which will extend the first. The total movement on the sensor side of the lens will be one tenth of the focal length, or 5mm for a 50mm lens. Divide that by be number of images to get the size of the physical step in mm. For example, if 100 images are taken with a 50mm lens, then the physical step on the sensor side is 5/100 = .050 mm or 50 um. The diameter of the additional circle of confusion is given by 2*physical step/f-num, or, in this case, if the f-number is 4:
additional circle of confusion - 2* 50 / 4 = 25 um.
If the smaller circle of confusion is desired, the step in the menu can be made smaller. If the menu step is set to 5, instead of 10, then the additional circle of confusion will be 5/10 times as great, or 12.5 um. There is error in this measurement, as focal length may vary and the camera may take some images beyond infinity, but the error should be reasonable, say less than 10%, For some lenses the relation between circle of confusion and menu step may be nearly the same for any f-number, but it can be highly variable on other lenses. If you determine that the step size is proportional to f-number for a particular lens, then the relation between menu step and additional circle of confusion is the same for every f-number.
The number of images that need to be taken is approximately:
[(1/FL-1/d1)^-1 -(1/FL-1/d2)^-1]/(physical step) -where FL-focal length, d1 distance to start of sharp zone, d2 distance to end of sharp zone.
This rough count can be narrowed down by trial and error. In the case of the Z7 focus is left at the final point, but with the S1R focus returns to the starting point after the last image is taken. For the S1R the last image can be examined in conjunction with previous photos to see if the last image is before or beyond the end of the sharp zone. If before, the image count must be larger. If d2 is infinity, then just use a large number, knowing that the camera will stop at infinity.
These computations have errors as a simple lens approximation is used and the center of the lens is hard to identify.
If one does not have access to one of my apps, it is possible to get a rough setting for the menu step by making some measurements. The method is to set the f-number to be used and see how many steps it takes to go from a focus point equal to 10x the focal length to infinity with menu step equal to 10. This is done by setting the image count in the stacking mode to a large number (the maximum is 999 for the S1R and 300 for the Z7).The camera will stop taking images shortly after infinity is reached. If the data card is erased first, then number of images is shown on the view screen when viewing images. If the maximum count of 300 on the Z7 is not enough, another stack can be acquired which will extend the first. The total movement on the sensor side of the lens will be one tenth of the focal length, or 5mm for a 50mm lens. Divide that by be number of images to get the size of the physical step in mm. For example, if 100 images are taken with a 50mm lens, then the physical step on the sensor side is 5/100 = .050 mm or 50 um. The diameter of the additional circle of confusion is given by 2*physical step/f-num, or, in this case, if the f-number is 4:
additional circle of confusion - 2* 50 / 4 = 25 um.
If the smaller circle of confusion is desired, the step in the menu can be made smaller. If the menu step is set to 5, instead of 10, then the additional circle of confusion will be 5/10 times as great, or 12.5 um. There is error in this measurement, as focal length may vary and the camera may take some images beyond infinity, but the error should be reasonable, say less than 10%, For some lenses the relation between circle of confusion and menu step may be nearly the same for any f-number, but it can be highly variable on other lenses. If you determine that the step size is proportional to f-number for a particular lens, then the relation between menu step and additional circle of confusion is the same for every f-number.
The number of images that need to be taken is approximately:
[(1/FL-1/d1)^-1 -(1/FL-1/d2)^-1]/(physical step) -where FL-focal length, d1 distance to start of sharp zone, d2 distance to end of sharp zone.
This rough count can be narrowed down by trial and error. In the case of the Z7 focus is left at the final point, but with the S1R focus returns to the starting point after the last image is taken. For the S1R the last image can be examined in conjunction with previous photos to see if the last image is before or beyond the end of the sharp zone. If before, the image count must be larger. If d2 is infinity, then just use a large number, knowing that the camera will stop at infinity.
These computations have errors as a simple lens approximation is used and the center of the lens is hard to identify.