I have an optical system that forms an image at various distances (25cm range) as shown in the figure here:
What kind of optics is required to project this image onto a CCD camera but without having to adjust the focus?
I have an optical system that forms an image at various distances (25cm range) as shown in the figure here:
What kind of optics is required to project this image onto a CCD camera but without having to adjust the focus?
I believe you are asking about the relationship between the focal length of the lens, and the distances of the object and image.
It is most common to use the thin lens formula as a good approximation for this relationship:
You need a focus rail.
In your diagram all three conditions exist simultaneously. If you consider the second line as being in focus at the image plane (red line); then the top condition exists as being front focused, and the bottom condition exists as being back focused (for three different objects w/in the scene).
If the middle condition is the fixed focus, then you need a mechanism to move the image plane and optics nearer to (top condition) or farther away from (bottom condition) the object you want in focus... this is typically called a focus rail.
Otherwise, the optics required to correct for the front focus condition are entirely different from (opposite to) the optics required to correct for the back focus condition.
(Note: Sounds like you're into physics or other non-aesthetic imaging? Maybe people at physics.stackexchange.com can be of more help.)
I don't know about any optical setups that are in focus at more than just one infinitely thin plane. So I'll offer four workarounds:
Option 1 is pretty self-explanatory so I won't dwell on it. Option 4 is just a variation on one of the chosen options 2 or 3 so not much to say about that either.
Options 2 and 3 require you to have a lens in front of your sensor. In other words, you're just taking photographs, but not of the object directly -- instead, you're photographing the image that your main optical system generates.
If at all possible, I'd recommend just a normal camera, with normal camera lens, instead of building your own lens assembly. Surely the people manufacturing lens for a living can produce a better result than you can.
In both options 2 and 3, you play around with the DOF until it's large enough to cover your 25 cm of range. The DOF is the range of distances which are within acceptable focus. How blurry is still acceptably focused is determined by you, using either option 2 or 3.
Option 2 is stricter: you want images to look as sharp as possible, so that you basically can't tell the difference between perfect focus and the edge of your DOF. Unfortunately, this may be unachievable in practice because it may require extremely small apertures or magnifications.
Option 3 is pragmatic: you accept the fact that perfect focus doesn't exist and instead define how much detail you need to see on your object. You define this detail in terms of object dimensions, which is easier to reason about. (For instance, on my job, if I need to see a scratch of width 0.1 mm, I may define my maximum blur diameter to be 0.05 mm.)
You modify the DOF by tweaking the two main parameters: optical magnification and aperture diameter (which is focal distance divided by f-number). Both are trade-offs. Increasing aperture size will give you more light (faster exposure), but less DOF. Increasing magnification gives you more resolution, obviously, but also decreases DOF and FOV (field of view).
If you can choose your sensor, large DOF is usually easier to achieve with smaller pixels. They require less magnification to achieve the same resolution, which increases DOF. Less magnification means smaller focal distance, which in turn requires a smaller aperture for the same f-number and light-gathering speed, which also increases DOF.
The downside of small pixels is that they can't gather as much light (this limits their best achievable signal-to-noise ratio, but doesn't matter at all unless you have enough light to fully saturate them). Also, they require better quality lens (with more resolving power) to achieve the same image quality. If pixels are small enough, a lens which creates a sharp image at pixel level doesn't even exist.
Unfortunately, this topic is a bit too involved to explain here without knowing your exact goals and which parameters are at your disposal.
I recommend the analysis and formulas from the freely available book Depth of Field in Depth by Jeff Conrad. For option 2, use the standard DOF formulas. For option 3, use "relative blur".
To speed things up with option 3, I have some Excel spreadsheets I use in my day-to-day life. I don't have them for option 2 because I never use it.
The spreadsheets are organized by column so I can explore multiple options next to each other. I use "distances calculation.xlsx" to choose working distance, lens' focal distance and magnification at the perfectly focused plane. Then I use "depth of field calculation.xlsx" to choose the actual lens model and the required f-number for the numbers from step 1. If it doesn't work out, I go back, tweak and repeat.
If you're photographing from up-close, a simplified DOF calculation is available as a different spreadsheet tab.
If needed, ask for help in the comments.
o,i, and the square represent? What do you mean by "project this image onto a CCD camera"? Do you already have the camera? – xiota Nov 22 '21 at 23:56