How to Produce Photo-Realistic Output Images

How to Produce Photo-Realistic Output Images
This article describes how to take high-resolution .BMP or .JPG images and ray-trace them
through a sequential optical system. The resulting high resolution, photo-realistic images
provide compelling evidence of final system performance, and can help to communicate that
performance to non-optics specialists.
Authored By: Mark Nicholson
Published On: July 31, 2006
Introduction
ZDC thanks Eddie Judd of Davin Optronics for many useful discussions, and Robin Hull, also
of Davin Optronics, for permission to use his test image in this article.
Imagine you were tasked with designing some imaging optics for a customer who was not
an optics specialist. You may produce three designs: a singlet, a doublet, and a 5-element
eyepiece. Each design has its own price/performance point.
Now, your customer understands price very well: but how do you communicate things like
vignetting, field curvature, astigmatism etc to a non-optics specialist? The Geometric Bitmap
Image Analysis (GBIA) feature in Zemax is extremely helpful in showing customers what
images will look like when you "look-through" the built lens. It communicates far more
directly than ray-fan plots and the like.
A note on Versions: the GBIA feature has been in Zemax for many years. However, the
August 2006 and subsequent versions benefit from a greatly improved sampling algorithm
that gives results with better signal/noise ratio for fewer rays traced. This article was written
with the August 2006 release. Users of earlier versions will be able to get the same results,
but will require substantially longer time to do so.
Unless you require to evaluate the image on an intermediate surface away from the final
image, the Image Simulation feature provides better signal/noise ratio in much less time
than the GBIA feature and is generally superior to it.
Overview of Geometric Bitmap Image Analysis
When a sequential optical design is being optimized or toleranced, we normally test system
performance by using several analysis features that test the response of the system to an
infinitesimal point on the object surface. Such features include ray fans, OPD plots, MTF,
PSF and many more. The Geometric Bitmap Image Analysis feature lets you place a high
How to Produce Photo-Realistic Output Images
resolution object scene on the object surface, and to trace rays from this scene correctly
weighted by wavelength, field, apodization and source brightness. A schematic is shown
below.
{Note that this image was produced by the non-sequential mode of Zemax: see the last
page of this article for full details.}
The object scene is represented by a source bitmap, which can be a .BMP or .JPG file. Rays
are traced using the defined object aperture and field towards the pupil of the optical
system, and on through to the image plane (or other specified surface). In the detection
surface we place a pixellated detector which receives the rays and builds up an image of the
source bitmap as seen through the lens. This image includes the effects of all aberrations,
vignetting at apertures and optionally of thin-film coatings and glass absorption too.
In additional to all the normal editor data, there are two pieces of information that Zemax
must be given. The first is information on the size and resolution of the source scene. In the
example we will use in this article, the source is a color LCD screen of specified dimensions
and 640x480 (VGA) resolution. We will image this scene through three different optical
systems, onto a detector which is also VGA resolution. Here is the source scene we will use:
How to Produce Photo-Realistic Output Images
and here is the settings dialog for the geometric Bitmap Image Analysis (GBIA) feature:
How to Produce Photo-Realistic Output Images
For full details of how to use the settings, see the User's Guide. Here is a brief description of
the most important parts:
•
Field Y Size defines the y-height of the source bitmap in whatever units the field is
measured in. In our examples the field is object height in mm, and so the full width of
the bitmap on the object plane is 13.8 mm. The x-width is then determined from the
aspect ratio of the bitmap
•
Parity allows us to account for systems that invert. This will re-invert the image so that
we see it right-side-up, if we wish to.
•
Input defines the source bitmap or .jpg scene that is to be used. This file must be
located in the {Zemaxroot}/imafiles folder
•
Rays/Pixel determines how many rays should be traced from each pixel. This directly
affects the signal/noise ratio, at the expense of calculation time. 1 ray/pixel is usually
fine for setting the feature up correctly, 10 gives quick results, 100 gives very good
images and 1000 or more gives photo-realistic images
•
X-Pixels, Y-Pixels, X Pixel Size, Y pixel size allows you to define the size and resolution
of the detector
•
Show Source Bitmap lets you choose to render the input scene, and was used to
produce the top graphic
•
Output writes the resulting GBIA results to a .jpg or .BMP file. This is important
because what you see via the Analysis window is viewed "through" your monitor's
resolution, and so may be significantly downsampled or demonstrate Moiré. It also
prevents you from losing data if you accidentally close the window before saving the
results!
Examples
In the attached zip file (which can be downloaded from the last page of this article) are
three lens file: a singlet, doublet and 5-element eyepiece design. These lenses are not
intended to be the best possible design: in fact the first two are deliberately poor lenses just
to demonstrate this feature!
Here is the source bitmap imaged through the singlet lens:
How to Produce Photo-Realistic Output Images
This image was produced using 10 rays/pixel, and ran in 5 seconds on a Pentium-M 1.6 GHz
laptop. Increasing the number of rays to 100/pixel gave the following result in about 40
seconds:
You can see clearly the distortion at the edges of the image and the vignetting which causes
the image to darken at the edges. Field curvature and astigmatism cause the focal quality to
drop off very quickly as we move away from the center of the image. Moving to the doublet
lens, and tracing 100 rays/pixel gives us the following, also in about 40 seconds:
How to Produce Photo-Realistic Output Images
Some of the detail in the center is better resolved, but the design is clearly still dominated
by distortion and field curvature. It would be hard to convince a customer that the extra
cost of the doublet was justified by the improved performance!
Moving to the five-element eyepiece, which is significantly better optimized, we get:
This is a clearly better result. The distortion is gone (some higher order distortion can still
be seen on the higher-resolution images shown later), and the field curvature is gone. The
lady in the bottom right hand corner can be clearly seen instead of just being a smudge.
This lens uses 5 elements and requires ray-aiming turned on, and so this took around
5 minutes to trace on the same laptop as the previous scenes. So, moving to my 2-CPU
workstation (which has two real Pentium 4 processors plus hyperthreading, so it looks like a
4-CPU machine), I set the GBIA to 1000 rays/pixel and obtained this in about 20 minutes:
How to Produce Photo-Realistic Output Images
Remember that Zemax is very well multi-threaded, which means that it can trace one group
of rays on one processor, and another group on another. This makes great use of today's
multiple-CPU and multiple-core machines. See this article for more details.
This image is virtually indistinguishable from the original image. However, this is a 640x480
pixel image displayed in a much smaller window. Here is the full jpg file saved automatically
by the GBIA feature:
Remember that this is a ray-tracing result and is not the original image! If this is printed out
on good quality photo-paper it gives a photo-realistic impression of the real system
performance. In fact, the differences between it and the original bitmap are due to the
detector resolution more than the optics themselves, so this output really does represent
what this detector sees.
Other Uses and Considerations
How to Produce Photo-Realistic Output Images
The designers of digital cameras (cameras with CCD detectors) have a significant advantage
over the designers of film-based cameras. Lenses for film-based cameras must produce a
high-quality image directly on the film plane, and there is no possibility for post-processing.
When the detector is a CCD chip, and the camera has an on-board computer, there is
significant scope for electronic post-processing of the image to remove aberrations.
The simplest example is distortion correction. Because distortion only affects the location of
the image, and does not affect the quality, it is possible to un-distort the image
electronically. This relieves the lens designer of the need to minimize a significant
aberration. Much work is also being done on compensating other aberrations, given a
knowledge of the OTF of the lens. Using the GBIA feature allows such image correction
algorithms to be tested prior to building expensive prototype optics, and the work we have
done recently on improving the speed of this feature means that this work can be done in
almost real time.
Note that diffraction is not considered by the GBIA: if diffraction effects are important, look
at the Diffraction Image Analysis and Extended Diffraction Image Analysis features instead.
Finally, the same calculation can be performed non-sequentially if desired, especially if
monochromatic images are required. The non-sequential SLIDE object can be used to place
a .bmp or .jpg graphic in an optical system. It can also be used in hybrid-mode, so that you
can place a slide object at any location in a sequential optical system too.
The advantages of performing these calculations in non-sequential mode include:
•
More realistic modeling of sources is possible in non-sequential mode, including the use
of measured source data like Radiant Sources. See this article for more information on
source modelling.
•
The effects of ghost pupils and images on the final image can be seen
•
The effects of opto-mechanical stray light, in which light reflects from the mechanical
components of the system can be included
This disadvantage is mainly speed: non-sequential ray-tracing is inherently slower than
sequential, and ray-tracing CAD objects is slower than tracing parametric optical objects.
The other disadvantage is that the NSC detector must be traced one wavelength at a time,
the data exported, and the recombined to produce the full color image (this is not necessary
if the image is monochromatic). Therefore the sequential analysis should be performed first.
If the sequential system gives inadequate performance, then nothing that is considered by
the non-sequential ray-trace will improve things: the effects considered by the
How to Produce Photo-Realistic Output Images
non-sequential trace generally only degrade performance.
Radiant Zemax
http://kb-en.radiantzemax.com/Knowledgebase/How-to-Produce-Photo-Realistic-Output-Images