Also available in English, 日本語
本文介绍了如何使用图像仿真分析工具生成逼真的物体场景图像,包括衍射、像差、失真、相对照明、图像方向和偏振的影响。
作者 Mark Nicholson
简介
OpticStudio支持图像仿真功能,可以快速准确地预测任何场景的外观,就像通过光学系统成像一样。该方法的工作原理是将源位图文件与点扩展函数数组进行卷积。考虑的影响包括衍射、像差、失真、相对照度、图像方向和偏振。这个功能非常快,完全可以在您的计算机上以多线程操作所有cpu,并在最终的图像中提供优良的信噪比。
图像仿真介绍
我们将通过从Zemax示例文件文件夹中打开OpticStudio提供的一个示例文件来开始我们关于图像仿真的讨论。请打开文件{Zemax}\Samples\Sequential\Image Simulation/Example 1, a singlet eyepiece.zmx。在图像仿真2窗口中,打开设置。

图像仿真要求用户指定一个源文件,可以是BMP、JPG、IMA或BIM。这个文件被读入OpticStudio,它的图像高度必须用视场单位中的视场高度设置定义。注意,因为这个特性引用了系统的视场单位,所以通常最好将系统转换为使用视场类型:物方高度。在本例中,视场高度为13.8 mm。输入场景也可以根据需要进行旋转、翻转、重采样,然后以任意点为中心。

当我们运行图像仿真时,它将计算输入场景中的点扩散函数 (PSF) 网格。 网格跨越整个视场并描述视场中选定点的像差,如位图和视场大小设置所定义。 PSF网格还包括偏振和相对照明的影响。您可以在示例文件的Image Simulation 1窗口中看到此 PSF 网格。 在这种情况下,中央PSF形成得非常好,但是当我们远离轴向场时,PSF产生比较严重的畸变。我们可以很容易地看到出现在PSF网格角落的彗差。

为了重建整个模拟图像,OpticStudio对修改后的源位图中的每个像素使用内插PSF网格。也就是说,对于每个像素,在网格中最近的PSF点之间插入一个有效的PSF。 然后将该PSF与修改后的源位图卷积以确定畸变位图图像。然后对生成的图像进行缩放和拉伸,以考虑检测到的图像像素大小、几何失真和横向色差。

设置图像仿真
在大多数情况下,OpticStudio选择的默认设置无需用户干预即可提供可用结果。然而,真正了解计算在做什么总是最好的!在本节中,我们将逐步完成图像模拟计算。在我们开始之前,打开一个新的图像仿真窗口。
- 首先,您必须选择输入场景。在图像模拟设置中,选择输入文件:Demo picture - 640 x 480.bmp。
- 然后,我们将通过透镜系统定义和传播单个轴上PSF。 这将使PSF网格成为单个delta函数。 任何与delta函数卷积的函数都会产生初始函数,因此生成的模拟图像将与输入场景完全相同,只是它会遭受光学系统的失真。 在卷积网格设置下,选择像差:无并将PSF-X Points和PSF-Y Points分别设置为1。
- 然后我们可以查看扭曲的图像。设置显示为:模拟图像。确保Pixel Size、X-Pixels和Y-Pixels都设置为默认值零。使用默认值。 这样做会将检测器中的像素数设置为与源位图中的像素数相等,并将检测器像素的大小设置为源位图中中心像素的大小(通过光学系统放大)。这应该会产生一个有用的“基线”系统。使用参考设置,您可以将检测器设置为以主光线或表面顶点为中心。这将移动检测器位置,使其在输入场景围绕视场移动时自动移动,或分别保持固定到图像表面顶点。现在花点时间按照您希望的方式设置检测器,然后再继续。
- Once the detector is set up correctly, it is time to set up the PSF grid. Set Show As: PSF Grid, and set Aberrations: Geometric. If the RMS Spot Radius is much larger than the Airy disc everywhere in the field of view, use Geometric. If the spot radius is close to (or less than) the Airy radius, select Diffraction. Use the Diffraction setting also if the lens is diffraction limited over some part of the field of view but not diffraction limited elsewhere; doing this will allow OpticStudio to automatically switch to use Geometric at those points in the grid where the PSF is more than 20 times the diffraction limit.
- Next, we must set the appropriate number of PSF-X Points and PSF-Y Points for the grid. As with any sampling control, the number of PSF-X Points and PSF-Y Points is correct when there is little change between results when adjusting the values. Take some time to play with the number of points and see how the Simulated Image changes. In the end, set PSF-X Points: 7 and PSF-Y Points: 7. Remember that OpticStudio interpolates the PSF between the measured points, and the PSF Grid has the same size and resolution of the source bitmap. If a PSF grid point appears to only span one pixel, then the point spread function is small compared to the source bitmap pixel size. In this case, the source bitmap could be oversampled, and you should reduce the sampling or source bitmap height in order to make the PSF grid large compared to the pixel size (i.e. it spans multiple pixels).

Generally, if diffraction effects are important then the source bitmap pixels (after any oversampling, if necessary) should be comparable in size to the PSF. The PSF grid should be several pixels wide if diffraction or aberration effects are important. - Once the PSF Grid is satisfactory, set Show As: Simulated Image to see the results of the convolution and the final simulated image!
Sample file use cases
OpticStudio ships with several sample files demonstrating the utility of Image Simulation. We recommend that you investigate these sample files prior to using the feature to familiarize yourself with its various applications. The supplied examples are located in the Zemax Samples folder, located at {Zemax}\Samples\Sequential\Image Simulation. The specific file names and descriptions of their contents are listed below.
Example 1: A singlet eyepiece
This is a classic example of the use of this feature. This lens is an eyepiece, but the system is not afocal. Rather, it is focal with a virtual image formed -1000 mm away (giving one diopter of accommodation). The aberrations are so large that the relative illumination contribution cannot be computed. In this case, the relative illumination is set to be uniform everywhere.

Note the statement in the text below the Simulated Image. Also note that the PSF grid may look as if some points are missing.

This is simply the result of sub-sampling on the monitor's screen. The input scene is 640 x 480 pixels, as is the PSF grid. However, the PSF grid is being displayed as a smaller window. In this case the whole analysis window is only 550x460 pixels, and the PSF grid is within approximately two-thirds of this, meaning the PSF grid is sub-sampled. If the window is maximized (or at least set larger than the 640x480 pixels needed by the PSF grid) the whole grid can be seen.
Example 2: Double Gauss experimental arrangement
OpticStudio allows four definitions of the field of view: Field Angles, Object Height, and Real or Paraxial Image Height. All four are valid ways of defining the field of view, but for the purposes of this feature--simulating the image of a bitmap input scene--Object Height is the preferred field definition.
This Double Gauss was originally optimized with the object at infinity, and with angles as the field definition. However, if the bitmap image is used with field in degrees, then each pixel corresponds to some angular range: which is probably not what the experimental or test arrangement is. Worse, angular pixels are inherently anamorphic. An x-width of one degree, for example, is a different subtended angle if the y-angle is 80 degrees versus 10 degrees. If field angles are being used and the field of view is fairly wide (more than about 40 degrees in any direction) then great care should be taken in interpreting the results for an extended object.
This file shows the Double Gauss in a configuration similar to realistic testing conditions.

Here, an auxiliary collimating lens is used to image the test scene to infinity, and the infinity-focused Double Gauss forms the image of the test scene. In this case, a paraxial lens is used to represent the auxiliary collimating lens but could be replaced with a real lens design if required. The most important setting is that the test pattern has a defined spatial extent, so that each pixel represents the same patch of illuminating area as any other.
Similarly, Real Image Height should not be used as the field definition when evaluating image performance with Image Simulation, or when computing any kind of distortion. When using Real Image Height, OpticStudio iterates each chief ray trace to find the exact object space angle to hit the desired image coordinate. Because the desired image coordinate is always reached, the image height is linear with respect to the field coordinate. In other words, the iteration is implicitly removing the distortion. Instead, OpticStudio automatically changes the field type from Real Image Height to Paraxial Image Height for the purposes of Image Simulation and issues a message to that effect.
However, even Paraxial Image Height is not ideal, as any anamorphic magnification of the lens (if present) will be ignored. Remember that if fields are defined by image height, then the Field Type control determines the size of the object in image space, not object space. The Field Type is always in whatever units the fields are defined in! Object Height is the most natural field definition to use with Image Simulation (or Geometric Bitmap Image Analysis), as it defines the size of the input source bitmap unambiguously.
Example 3: A blue notch filter
OpticStudio can also account for the polarization properties of the optical system on image formation. In this case a source scene consisting of overlapped red, green and blue circles is imaged by a lens that contains a blue notch filter that rejects the blue light. The resulting image is formed without any blue component. Shown below are the Source Bitmap image, and the result of the Image Simulation Analysis.

Example 4: A diffraction limited system
In this example, a low-resolution scene is imaged through a diffraction limited system (the Hubble Space Telescope). To ensure that the input pixels are of the order of the PSF, the input scene is oversampled 16x to produce this PSF grid.

In this design the field of view is in angles, but the angular field of view is so small (0.001°) that the anamorphic issues discussed above are not relevant.
Example 5: Spatially varying resolution
The same Double Gauss experimental arrangement is used as in Example 2, but in this case the test pattern consists of grid lines of varying spatial frequencies and orientations. The input scene is shifted around in the field of view by changing the field number, and the detector is always located relative to the chief ray from the viewed reference point. The effect of the different contrast (MTF) in the sagittal and tangential directions can be easily seen, as can lateral color. Again, the windows should be maximized or at least be larger than the pixel resolution of the input scene (201 x 201 pixels).

Example 6: Tilted image plane
In this case the object and image planes are tilted to induce keystone distortion and focal plane blurring. In Configuration 1 there is no tilt, and the PSF grid is diffraction limited over the field of view. In Configuration 2 (use Ctrl+A to switch configurations) the tilt results in the system being well away from diffraction limited at the top and bottom of the field of view.

This results in the image being diffraction limited in the central x-scan but out of focus at the top and bottom.

Note that the PSF grid automatically switches to geometric for any field point where the PSF is more than 20x the diffraction limit, so that Image Simulation uses diffraction effects wherever they can be computed, and switches to a geometric calculation as and when needed.
Other image analysis features
OpticStudio also supports several other image analysis features under Extended Scene Analysis. A summary of these features is provided tonight.

- Geometric Image Analysis: This analysis is limited to geometric (hence no diffraction) computations of relatively low-resolution IMA and BIM bitmaps. However, it can be calculated on any surface. Conversely, the convolution-based Image Simulation can only be computed on the Image surface. Also, as Geometric Image Analysis is ray-tracing based, it can be used to compute system efficiency and also multi-mode fiber coupling. The IMAE operand allows the system efficiency to be used as a target in the merit function.
- Geometric Bitmap Image Analysis: This analysis is very similar to Image Simulation in that BMP or JPG source bitmaps can be imaged through an optical system. Generally speaking, Image Simulation will give much higher signal-to-noise ratio images more quickly than Geometric Bitmap Image Analysis. With the latter, the signal/noise is proportional to SQRT(n), where n is the number of rays traced per pixel. Detecting under sampling in the PSF grid of Image Simulation is trickier. Badly sampled PSF grids almost always look like delta functions, which means that the convolution-based method may predict performance that is better than is achievable in reality if the PSF grid is not set up adequately. Geometric Bitmap Image Analysis provides a useful double-check on the predicted performance. It can also be computed on any surface, including surfaces far from focus.
- Partially Coherent Image Analysis: If the incoherent imaging of a bitmap through a diffraction limited system is needed, Image Simulation is generally superior to this method. However Partially Coherent Image Analysis allows the coherence of the source illumination to be included. This is an important effect in photolithography systems in particular.
- Extended Diffraction Image Analysis: This analysis allows for coherent imaging of extended source scenes, and also allows each pixel in the source bitmap to represent a delta function. This is useful for checking the imaging of extended scenes that consist of point sources like stars. For incoherent source scenes, Image Simulation should be used instead.
References
KA-01359