+ All Categories
Home > Documents > Defocus sensitivity optimization using the defocus Taylor expansion of the optical transfer function

Defocus sensitivity optimization using the defocus Taylor expansion of the optical transfer function

Date post: 02-Oct-2016
Category:
Upload: shane
View: 220 times
Download: 1 times
Share this document with a friend
10
Defocus sensitivity optimization using the defocus Taylor expansion of the optical transfer function Shane Barwick Rocky Mound Engineering, 116 White Pine Court, Macon, Georgia 31216, USA *[email protected] Received 16 May 2008; revised 9 September 2008; accepted 16 September 2008; posted 16 September 2008 (Doc. ID 96301); published 30 October 2008 The Taylor expansion of the incoherent optical transfer function with respect to defocus is a valuable tool in the design and analysis of computational imaging systems. It efficiently describes the behavior of the system near best focus and beyond. Formulas for computing the coefficients in this expansion are derived and shown to be amenable to efficient digital calculation. Their application to the design of phase masks for systems insensitive to defocus aberrations and for systems that estimate object range are explored. © 2008 Optical Society of America OCIS codes: 110.1758, 110.3925, 110.4850, 150.5670, 150.6910. 1. Background In the past correcting optical systems for focus and focus-related aberrations required adding elements, complexity, and cost to the system to directly capture a focus-insensitive image at the image plane. The size and cost penalties for equivalent performance were greatly reduced with the advent of wavefront coding, a process in which a focus-insensitive image is recovered after digital processing of a captured im- age encoded by a mask at the pupil. The mask usual- ly modifies either the amplitude [1,2] or phase [3] of the pupil so that the resulting point spread function (PSF) blurs the image in a manner that is insensitive to misfocus and, thus, allows identical signal proces- sing to be used to deconvolve the image from the known PSF for all values of misfocus. Increased depth of field is the result. The inverse application is depth or range estima- tion via measuring the change in the PSF due to de- focus. Sensitivity to defocus is obviously the goal here. Although depth estimation has been demon- strated with traditional lenses with clear apertures [4], an innovative improvement presented in [5] used diffractive optics to create a PSF that rotates with defocus. As in the previous case, this effect can be cre- ated with phase or amplitude masks. Such systems that engineer the pupil function to enable the achievement of some task with the aid of signal processing are known as computational imaging systems. Concise representations of how the optical transfer function (OTF) and PSF vary with misfocus are necessary for analysis and design in this new paradigm. In this regard phase-space transformations have proved invaluable. The de- scription of the OTF with varying misfocus by the ambiguity function has pointed the way to ground- breaking designs of both amplitude [1] and phase masks [3]. Likewise, the Wigner and RadonWigner distributions have provided corresponding represen- tations of the PSF [68]. The drawback of these tech- niques is that they are most easily applied to the analysis of separable systems, i.e., one-dimensional pupils. Furthermore, they are not well suited for use in nonlinear optimization algorithms. Other me- trics, such as Fisher information measures [9], have proved more useful in this arena, though they typi- cally incur significant computational costs. Castañeda et al. have previously demonstrated the utility of the Taylor expansion of the OTF with respect to (w.r.t.) misfocus at zero misfocus in the de- sign of computational imaging systems [1]. The low- est degree term in the Taylor expansion determines 0003-6935/08/315893-10$15.00/0 © 2008 Optical Society of America 1 November 2008 / Vol. 47, No. 31 / APPLIED OPTICS 5893
Transcript
Page 1: Defocus sensitivity optimization using the defocus Taylor expansion of the optical transfer function

Defocus sensitivity optimization using the defocusTaylor expansion of the optical transfer function

Shane BarwickRocky Mound Engineering, 116 White Pine Court, Macon, Georgia 31216, USA

*[email protected]

Received 16 May 2008; revised 9 September 2008; accepted 16 September 2008;posted 16 September 2008 (Doc. ID 96301); published 30 October 2008

The Taylor expansion of the incoherent optical transfer function with respect to defocus is a valuable toolin the design and analysis of computational imaging systems. It efficiently describes the behavior of thesystem near best focus and beyond. Formulas for computing the coefficients in this expansion are derivedand shown to be amenable to efficient digital calculation. Their application to the design of phase masksfor systems insensitive to defocus aberrations and for systems that estimate object range are explored.© 2008 Optical Society of AmericaOCIS codes: 110.1758, 110.3925, 110.4850, 150.5670, 150.6910.

1. Background

In the past correcting optical systems for focus andfocus-related aberrations required adding elements,complexity, and cost to the system to directly capturea focus-insensitive image at the image plane. Thesize and cost penalties for equivalent performancewere greatly reduced with the advent of wavefrontcoding, a process in which a focus-insensitive imageis recovered after digital processing of a captured im-age encoded by a mask at the pupil. The mask usual-ly modifies either the amplitude [1,2] or phase [3] ofthe pupil so that the resulting point spread function(PSF) blurs the image in a manner that is insensitiveto misfocus and, thus, allows identical signal proces-sing to be used to deconvolve the image from theknown PSF for all values of misfocus. Increaseddepth of field is the result.The inverse application is depth or range estima-

tion via measuring the change in the PSF due to de-focus. Sensitivity to defocus is obviously the goalhere. Although depth estimation has been demon-strated with traditional lenses with clear apertures[4], an innovative improvement presented in [5] useddiffractive optics to create a PSF that rotates with

defocus. As in the previous case, this effect can be cre-ated with phase or amplitude masks.

Such systems that engineer the pupil function toenable the achievement of some task with the aidof signal processing are known as computationalimaging systems. Concise representations of howthe optical transfer function (OTF) and PSF varywith misfocus are necessary for analysis and designin this new paradigm. In this regard phase-spacetransformations have proved invaluable. The de-scription of the OTF with varying misfocus by theambiguity function has pointed the way to ground-breaking designs of both amplitude [1] and phasemasks [3]. Likewise, the Wigner and Radon–Wignerdistributions have provided corresponding represen-tations of the PSF [6–8]. The drawback of these tech-niques is that they are most easily applied to theanalysis of separable systems, i.e., one-dimensionalpupils. Furthermore, they are not well suited foruse in nonlinear optimization algorithms. Other me-trics, such as Fisher information measures [9], haveproved more useful in this arena, though they typi-cally incur significant computational costs.

Castañeda et al. have previously demonstrated theutility of the Taylor expansion of the OTF withrespect to (w.r.t.) misfocus at zero misfocus in the de-sign of computational imaging systems [1]. The low-est degree term in the Taylor expansion determines

0003-6935/08/315893-10$15.00/0© 2008 Optical Society of America

1 November 2008 / Vol. 47, No. 31 / APPLIED OPTICS 5893

Page 2: Defocus sensitivity optimization using the defocus Taylor expansion of the optical transfer function

the performance of the system near best focus. Odd-power terms in the expansion disappear under cer-tain symmetries, which is advantageous for systemsinsensitive to defocus. In [1] coefficients for indivi-dual terms in the expansion were expressed as mo-ments of the autocorrelation of the pupil function.The expressions in this form are not easily calculateddigitally.In [10] the author derived a computationally effi-

cient expression for the quadratic Taylor coefficient.In Section 2 this derivation will be expanded to give,to my knowledge, novel closed-form expressions forall Taylor expansion coefficients that take the formof FTs of spatial derivatives of the coherent impulseresponse (CIR). The fast FTand the approximation ofspatial derivatives by simple differences of adjacentelements allow these expressions to be calculated ef-ficiently. Following the derivation, the possible im-pact by the even-power Taylor expansion termsbeyond the quadratic on the design of phase masksfor systems insensitive to defocus will be briefly dis-cussed. Finally, the use of the odd-power Taylor ex-pansion terms in the design of systems in whichsensitivity to defocus is desired will be explored. Adesign method for a system to estimate range basedon rotating OTFs will be presented.

2. Derivation

The generalized pupil function must first be put in anormalized form in order to derive the defocus Taylorexpansion of the OTF. Thus, let Γðx; yÞ be a general-ized pupil function that has a constant magnitude of1 (only the phase varies) over a circular support ofradius R (or half the support width for noncircularapertures). Also, let Hðf X ; f Y ; τÞ be the resultingOTF of the optical system as a function of the misfo-cus parameter τ.H is related to the autocorrelation ofΓðx; yÞ expð−jτ½x2 þ y2�=R2Þ, with τ being defined forlater convenience by the following relation [11]:

τ ¼ πR2

λ

�1f−1di

−1do

�; ð1Þ

where λ is the operating wavelength, f is the effectivefocal length of the system, di is the distance betweenthe second principal plane and the image plane, anddo is the distance between the object plane and thefirst principal plane. Finally, let Pðx; yÞ be a conveni-ent normalization of Γðx; yÞ so that P has unit powerand unit radius, or Pðx; yÞ ¼ ð1= ffiffiffiπp ÞΓðRx;RyÞ. Thederivation is equally applicable to cases wherethe magnitude of Γ varies as in amplitude apod-ization. Simply replace the factor

ffiffiffiπpwith

ðR RΓðRx;RyÞΓ�ðRx;RyÞdxdyÞ1=2in the pupil

normalization.For any function f ðx; yÞ the ambiguity function of f ,

or A f, is defined as

A f ðα; β;a; bÞ ¼Z

−∞

Z∞

−∞f

�xþ α

2; yþ β

2

× f ��x −

α2; y −

β2

�expð−j2π½axþ by�Þdxdy�; ð2Þ

where f � is the conjugate of f . In [12] it is shown thatthe defocus OTF is related to the ambiguity functionof the normalized pupil function by

Hðu; v; τÞ ¼ AP

�u; v;

uτπ ;

vτπ

�; ð3Þ

where u and v are normalized frequency coordinatesdefined as u ¼ λdif x=R and v ¼ λdif Y=R. Owing tothe unit-power normalization of P, the standardOTF normalization of unity at the spatial frequencyorigin is guaranteed for all τ in Eq. (3). Applying Par-seval’s relation to Eq. (2) results in the following al-ternate form for A f [13]:

A f ðα; β;a; bÞ ¼Z

−∞

Z∞

−∞f̂

�rþ a

2; sþ b

2

× f̂ ��r −

a2; s −

b2

�expðj2π½αrþ βs�Þdrds; ð4Þ

where f̂ is the FT of f . This expression for the ambi-guity function has the same form in the Fourier do-main as Eq. (2) except that the roles of ðα; βÞ andða; bÞ are reversed. Thus, Eq. (3) implies that the de-pendence of the OTF on τ in the alternate form ap-pears in the instantaneous autocorrelation termP̂ðrþ a=2; sþ b=2ÞP̂�ðr − a=2; s − b=2Þ and that theshift disappears when τ ¼ 0. The FT of P is theCIR for best focus at the focal plane of the system,which will be designated hðr; sÞ. The PSF for best fo-cus at the focal plane is the magnitude squared of h.Combining Eqs. (3) and (4) leads to the following ex-pression for the OTF as a function of misfocus:

Hðu; v; τÞ ¼Z

−∞

Z∞

−∞h

�rþ uτ

2π ; sþvτ2π

× h��r −

uτ2π ; sþ

vτ2π

�expðj2π½urþ vs�Þdrds: ð5Þ

The Taylor expansion of the OTF w.r.t. to misfocusat zero misfocus takes the following familiar form:

Hðu; v; τÞ ¼X∞k¼0

∂kHðu; v; 0Þ∂τk

τkk!

: ð6Þ

By taking successive derivatives of Eq. (5) w.r.t. τ andsetting τ to zero, expressions for the polynomial coef-ficients in Eq. (6) can be obtained. In fact, carryingout the derivatives reveals that

5894 APPLIED OPTICS / Vol. 47, No. 31 / 1 November 2008

Page 3: Defocus sensitivity optimization using the defocus Taylor expansion of the optical transfer function

∂kHðu; v; 0Þ∂τk

¼ 1

ð2πÞkXkm¼0

umvk−m

× F−1

�Xkl¼0

XmaxA

a¼minA

ð−1Þk−1Ck;a;l;m∂lh

∂ra∂sl−a

×∂k−lh�

∂rm−a∂sk−m−lþa

�; ð7Þ

where

Ck;a;l;m ¼ k!a!ðl − aÞ!ðm − aÞ!ðk −m − lþ aÞ! ;

minA ¼ maxð0; lþm − kÞ, maxA ¼ minðm; lÞ, andF−1fg is a two-dimensional inverse FT operation.See Appendix A for an outline of the derivation ofEq. (7) from Eq. (5). For one-dimensional pupilsEq. (7) reduces to the following expression:

∂kHðu; 0Þ∂τk

¼ uk

ð2πÞk F−1

�Xkl¼0

ð−1Þk−l k!ðk − lÞ!l!

dlh

drldk−lh�

drk−l

�:

ð8ÞThe partial derivatives of H w.r.t. defocus at zero de-focus can be efficiently arrived at by calculating thecomplex pupil function only once at zero defocus, tak-ing two fast FTs, and performing a series of sum andproduct operations. Also, note that many terms inthe braces in Eqs. (7) and (8) are complex conjugatesof one another and can be combined to reduce thenumber of operations.

3. Defocus Sensitivity Optimization

A. Increasing Depth of Field

The above expressions for the defocus Taylor expan-sion of the OTF are pertinent to incoherent imagingin general. Their mathematical implication for thedesign of defocus-insensitive systems via wavefrontcoding will now be explored. Wavefront coding is amethod that employs a phase mask of the formexpðjθðx; yÞÞ at the pupil to yield a PSF that blursthe image in a manner invariant to object distancesuch that identical postprocessing can be appliedover a large range of defocus to recover an imageof high fidelity. In [1,9] it was shown that the odd-power coefficients in Eq. (6) disappear for odd-parityphase masks θðx; yÞ that are invariant in an x↔yexchange operation and are odd under coordinate in-version, or θð−x;−yÞ ¼ −θðx; yÞ. It is obviously desir-able for focus-insensitive systems that the linearTaylor term disappear to suppress sensitivity to de-focus near best focus. Thus, these designs are char-acterized by the even-power Taylor terms with thelowest power term being quadratic.Even though the quadratic term in the Taylor ex-

pansion should dominate the sum only near zero mis-focus, optimization algorithms used in designingwavefront coding systems can produce satisfactoryresults by taking into account only this term. As de-

scribed in detail in [10,14], I presented design meth-ods using the E norm (same as the Frobenius norm)of the quadratic Taylor coefficient given by Eq. (7)with k ¼ 2 as the metric for defocus insensitivityin a cost function used to optimize imaging systems.It was noted that frequently, though not always, therelative sensitivity of phase masks at even largevalues of misfocus can be predicted well by their be-havior near best focus. One reason is that focus-insensitive designs demonstrate the favorable prop-erty that higher-order terms are small in norm andare slow to make an impact on H as τ increases. Forexample, experience indicates that the E norm of thedifference between the OTF at a misfocus of τ withthe OTF at best focus, or ∥Hðu; v; τÞ −Hðu; v; 0Þ∥E,tends to be purely quadratic up to misfocusvalues of at least 1 and sometimes larger for focus-insensitive designs.

Small norms of the Taylor coefficients of allorders are due in part to a known property of focus-insensitive systems, namely, that the CIR h tends tohave increasing support (closure set of the spatial do-main over which h is nonzero) and smoothness withdecreasing focus sensitivity [15]. The form of the ex-pressions in Eq. (7) explains this relationship. Withreference to Eq. (7) the kth-order Taylor coefficientdepends on the inverse FT of the kth-order spatialderivative expressions of h (quantity inside F−1fg)multiplied by the frequency variables u and v raisedto the combined kth power, or umvk−m. Multiplicationby umvk−m modulates the energy of the inverse FTs ofthe spatial derivative expressions of h. The energy isseverely attenuated near the normalized frequencyorigin where juj; jvj ≪ 1, increasingly so for higherpowers of u and v, and amplified at large frequencieswhere juj; jvj > 1. As long as the result of F−1fg inEq. (7) has a small support concentrated near the ori-gin, the norm of the coefficient should be small. In-creasing the support of h generally enlarges thesupport of its spatial derivatives and the spatial de-rivative expressions in Eq. (7). The result of F−1fg inEq. (7) will then have a smaller support because ofthe inverse relationship between the sizes of sup-ports in the spatial and Fourier domains. Further-more, since the spatial derivative expression inEq. (7) cannot have energy at high spatial frequen-cies owing to amplification of the inverse FT byumvk−m, h must be smooth to prevent small varia-tions from being amplified by the spatial derivatives.Thus, a smoother h with larger support tends to re-duce the norms for higher-order coefficients. Thisproperty also means that the spatial derivatives ofh in Eq. (7) are well approximated by simple numer-ical estimates of derivatives, even for high orders, forfocus-insensitive systems.

Another mitigating factor for terms beyond thequadratic is that each Taylor coefficient of aneven-power term tends to be opposite in sign tothe preceding even-power coefficient over most ofthe spatial frequency plane. The cause is that thesecoefficients ultimately depend on even-order spatial

1 November 2008 / Vol. 47, No. 31 / APPLIED OPTICS 5895

Page 4: Defocus sensitivity optimization using the defocus Taylor expansion of the optical transfer function

derivatives of h, which usually has oscillatory realand imaginary parts. An oscillatory function aroundzero, such as a sine function, tends to have a curva-ture, or second derivative, that is opposite in sign tothe value of the function. For instance, note thatd2k cosðxÞ=dx2k ¼ ð−1Þk cosðxÞ. In fact, substitutinga pure, real sinusoid for h in the spatial derivativeexpression of Eq. (8) produces a constant that alter-nates in sign for even k. In other words, let hðrÞ ¼sinðrÞ for all r, or infinite support. Then

∂2Hðu; 0Þ∂τ2 ¼ u2

ð2πÞ2 F−1f−2g; ∂

4Hðu; 0Þ∂τ4 ¼ u4

ð2πÞ4 F−1f8g:

ð9Þ

The pattern continues for all even k. Interestinglythis example also illustrates the limiting case for in-creasing the support and smoothness of h. InverseFourier transforming a constant is an impulse, whichis zero everywhere but the origin. Thus, the coeffi-cients in this case would be zero for all spatial fre-quencies except at the origin where they are theindeterminate product of �∞ and 0 raised to thekth power. In any case, as a higher-order even termbecomes nonnegligible with increasing τ, it initiallytends to dampen the preceding even term. A morepractical example follows.In Fig. 1 the actual ∥Hðu; v; τÞ −Hðu; v; 0Þ∥E calcu-

lated by aberrating the pupil by the appropriate de-focus τ is plotted for three masks that were optimizedfor defocus insensitivity by using the quadratic

Taylor coefficient metric in [10]. These plots are anapproximate indication of how rapidly the OTFsare changing with defocus. As expected, the plotsare purely parabolic for small τ up to about 3, indi-cating that the terms in Eq. (6) that are of higher or-der than the quadratic are insignificant in this range,or

∥Hðu; v; τÞ −Hðu; v; 0Þ∥E ≈ ∥∂2Hðu; v; 0Þ

∂τ2 ∥Eτ22: ð10Þ

Furthermore, the E norms of the quadratic Taylorcoefficient given in Table 1 correctly predict the rela-tive positioning of the curves. The OTF of mask 1changes most rapidly for small τ, and the OTF ofmask 3 the least. However, as τ increases to moderatevalues, the curve for mask 2 clearly suggests that itsOTF is changing more slowly than the other two ashigher-order terms become significant. One reason,as shown in Table 1, is that its quartic Taylor coeffi-cient simply has the smallest E norm. Furthermore,the quartic Taylor coefficient for mask 2 appears tobetter cancel its quadratic term, as suggested bythe change in the sign of the curvature of the mask2 plot that is not apparent in the other two plots. Thechange in curvature is due to a cancellation effectpropagating through many terms.

Figure 2 shows binary mappings that are whitewhere the real part of the quartic coefficient is oppo-site in sign to the real part of the quadratic coefficientin the spatial frequency plane for 2(a) mask 1, 2(b)mask 3, and 2(c) mask 2. A gray-scale plot of themag-nitude of the quartic Taylor coefficient for mask 2 isshown in Fig. 2(d), with white being maximum. Asexpected, the coefficients generally have oppositesigns over the majority of the spatial frequency planefor all three masks, but the sign relationship is morepronounced for mask 2. In fact, the percentage of thefrequency domains of the coefficients in which thesigns are opposite is 80.2% for mask 1, 80.6%for mask 3, and 83.8% for mask 2. Comparison ofFig. 2(c) with Fig. 2(d) indicates that the quartic coef-ficient for mask 2 generally has an opposite sign tothe quadratic coefficient where the magnitude ofthe quartic coefficient is largest, too.

The properties of the curves in Fig. 1 for large τ aresuggested by the properties of the quartic coefficientsshown in Table 1 and Fig. 2. Thus, including higher-order terms in metrics for design algorithms likethose in [10,14] promises the possibility of enhancedoptimization for a larger defocus range in future re-search. For example, the cost function to be mini-mized for design optimization could simply include

Fig. 1. ∥Hðu; v; τÞ −Hðu; v;0Þ∥E versus misfocus τ plotted forthree phase masks that have been optimized for defocus insensi-tivity by using the quadratic Taylor coefficient as a metric. Interms of the phase function defined in [10] the mask coefficientsare (mask 1) ½0:5;−33;−76; 50;−22�, (mask 2) ½−66;−87;−75;−7;−80�, and (mask 3) ½39;−10;48;35;−28�.

Table 1. Taylor Coefficient E Norms

Mask Quadratic Norm Quartic Norm

1 0.330 0.06252 0.228 0.03833 0.148 0.0449

5896 APPLIED OPTICS / Vol. 47, No. 31 / 1 November 2008

Page 5: Defocus sensitivity optimization using the defocus Taylor expansion of the optical transfer function

the E norm of the quartic coefficient. Another possi-ble metric is ∥ð∂2Hðu; v; 0Þ=∂τ2Þτ2=2þ ð∂4Hðu; v; 0Þ=∂τ4Þτ4=4!∥E calculated at a specific value of τ, say 3,where it should well approximate ∥Hðu; v; τÞ−Hðu; v; 0Þ∥E. See [10,14] for full discussions on howto incorporate defocus insensitivity metrics into de-sign optimizations to accomplish specific imagingtasks.

B. Range Estimation

The basis behind rotating PSFs is that the trans-verse distribution of coherent light composed of a lin-ear combination of certain Gauss–Laguerre (GL)modes will rotate in response to diffraction [16].The mathematical definition of these modes is de-scribed in [16]. In [5] diffractive optics were employedto create systems whose CIR could be described bythese GL modes. The rotating PSFs that werecreated have increased resolution w.r.t. range esti-mation because they have nonvanishing linear de-pendence on defocus, unlike traditional lenses withclear pupils. Therefore, optimizing on the linear coef-ficient in the defocus Taylor expansion and other oddterms should lead to enhanced systems. The odd-power coefficients are important in this applicationbecause they allow discrimination between positiveand negative defocus and, thus, the direction ofthe range estimation from the best-focus plane.Nonetheless, it should be noted that the even-powerTaylor coefficients will not disappear.The design methodology proposed in this paper be-

gins with estimating the CIR of a system with a lin-

ear combination of GL modes that satisfy therotating PSF constraint. Specifically, let the estimate~h of the exact CIR, or h, be described by

~h ¼ a1h1; 1i þ a2h5; 3i þ a3h9; 5i þ a4h13; 7iþ a5h17; 9i þ a6h21; 11i; ð11Þ

where hi; ji are the GLmodes at their beamwaist andak will be the design parameters. The generalized pu-pil function is obtained by taking the inverse FT of ~hand cropping the result by the aperture of the lens.The beam waist of the GL modes can be chosen sothat the cropping has a negligible effect on the calcu-lation. The exact h is then the FT of the pupil func-tion and is well approximated by Eq. (11). It and itsmagnitude squared, the PSF, will rotate because ofthe quadratic phase at the pupil induced by changingdefocus. Owing to the properties of the FT, the OTFrotates if the PSF rotates. Ultimately the resolutionof depth estimation by defocus depends on the rate ofchange of the PSF–OTFwith defocus. In other words,if the magnitude of the first derivative of the OTFw.r.t. defocus is larger, the resolution for depth esti-mation should improve. The kth-order coefficients ofthe defocus Taylor expansion of dHðu; v; τÞ=dτ aboutτ ¼ 0 are proportional to the (kþ 1)-order coefficientsgiven by Eq. (7). Therefore, systems with higher sen-sitivity to depth should have defocus Taylor coeffi-cients with larger norms. Optimization for thistask can be carried out by maximizing the normsof the odd-power Taylor coefficients of H.

In [5] depth estimation was calculated via measur-ing the rotation of the system PSF. To obtain the PSFfrom the image a deconvolution step must be exe-cuted, since the captured image is the magnifiedobject convolved with the system PSF [11]. The de-convolution is carried out in the spatial frequency do-main. An estimate of the object frequency responseis, therefore, a requisite. The object power spectrumused in this step must be either known beforehand orobtained from a simultaneous in-focus image. In theproposed algorithm depth estimation will be calcu-lated from the OTF rather than the PSF, which willstill require a deconvolution step.

Depth estimation by OTF offers us several advan-tages. First, spatial frequencies of the OTF are reco-verable by deconvolution only where the product ofthe OTF with the object frequency response is abovethe noise level. Thus, all other spatial frequencies areuseless for depth estimation. Basing the estimationon the OTF allows the calculation to be confined tospatial frequencies near the origin that are expectedto have higher signal-to-noise ratios for typically low-pass object spectrums. Increased robustness to noiseshould follow. If the object is known beforehand, itmay even be possible to confine the defocus-estimatecalculation to spatial frequencies of the OTF wherethe object power spectrum is flat near its maximum.In that case deconvolution may not be necessary,but that is an area of ongoing research. The second

Fig. 2. In the black-and-white mappings (a)–(c) white indicatesthat the real part of the quadratic Taylor coefficient has an oppo-site sign to the real part of the quartic Taylor coefficient for(a) mask 1, (b) mask 3, and (c) mask 2. A gray-scale plot of the mag-nitude of the quartic Taylor coefficient for mask 2 is shown in (d).All plots are versus normalized spatial frequencies u and v.

1 November 2008 / Vol. 47, No. 31 / APPLIED OPTICS 5897

Page 6: Defocus sensitivity optimization using the defocus Taylor expansion of the optical transfer function

advantage of the OTF derives from the form of theexpressions in Eq. (7). These expressions give theTaylor coefficients over the entire frequency plane.Optimization can be tailored to the spatial frequen-cies involved in the estimation algorithm.The specific method proposed for estimating range

in subsequent simulations takes advantage of the ro-tation of the OTF rather than the PSF. In particular,the projection of a narrow annulus near the origin ofthe magnitude of the estimated OTF is calculated togive a function Iðθ; τÞ of the angular polar coordinatein the frequency plane, or

Iðθ; τÞ ¼Z ρu

ρljHðρ; θ; τÞjdρ; ð12Þ

where ρ and θ are polar coordinates in the spatial fre-quency plane, and ρl and ρu are the minimum andmaximum radii bounding the annulus. The domi-nant, though not sole, effect of defocus on this projec-tion is to cause it to circularly shift. Iðθ; τÞ is a circularshift of Iðθ; 0Þ if H rotates with defocus. The actualdefocus estimate is performed by a seven-layer neur-al net. A neural net is trained by minimizing the er-ror in estimated defocus when input a training set ofnoise-free Iðθ; τÞ calculated in small increments of de-focus. Thus, no rotation is ever explicitly calculated.When the defocus parameter is estimated, the neuralnet may use other discriminators of defocus in thestructure of Iðθ; τÞ besides shifting that are not ob-vious. Thus, it can take full advantage of enhancedoptimization in the sensitivity of the OTF to defocus.For measurements of defocus the input to the neuralnet is the one-dimensional, discrete vector represen-tation of Iðθ; τoÞ for 0 < θ < 2π calculated by Eq. (12)from the estimated OTF under a defocus of τo. Theoutput of the neural net is hopefully the scalar τo.The range estimate is related to the defocus estimateby Eq. (1) with do representing the object range.The cost function employed for nonlinear optimiza-

tion in the proposed design method contains threeterms. Two terms are the E norm of the linearð∥∂Hðu; v; 0Þ=∂τ∥EÞ and cubic ð∥∂3Hðu; v; 0Þ=∂τ3∥EÞTaylor coefficients calculated over a small band ofthe frequency plane near the origin bounded by ρland ρu. Another term is added to take into accountthe transmission of the pupil. For the transmissioncalculation the pupil function calculated fromEq. (11) is normalized to have a maximum magni-tude of 1. A transmission efficiency was defined byintegrating the magnitude of the pupil functionand dividing by the corresponding integration of aclear pupil. The total cost function is the weightedsum of these three terms. It is maximized by aBroyden–Fletcher–Goldfarb–Shanno quasi Newtonmethod over the design parameters ak.The starting point for the optimization was equal

superposition (ES) of the modes, or a ¼ ½1; 1; 1; 1; 1; 1�.Manipulating the weights yielded two designs thathad interesting properties. Their coefficients are asfollows:

a1 ¼ ½−0:15; 0:419; 0:976; 1:0; 0:236;−0:029�; ð13Þ

a2 ¼ ½−0:098; 0:04; 0:496; 1:0; 0:703;−0:079�: ð14Þ

The first design, a1, had an emphasis on large normsfor the Taylor coefficients, whereas the second de-sign, a2, gave more weight to transmission efficiency.Table 2 lists the values for the metrics of the two de-signs and the ES case. The Taylor coefficient normsare given for the E norms used in the cost functioncalculated over the limited band in the frequencyplane and also for the E norms calculated over theentire frequency plane. Judging from the norm ofthe linear coefficient calculated over the entire fre-quency plane, a2 does not appear to be a significantimprovement over ES. As will be seen, however, thenorms based on the limited band in the frequencyplane correctly predict that it is a major enhance-ment when used in the proposed algorithm for esti-mating range. In addition to enhanced performance,both designs had improved transmission.

A measure of the potential of a design for rangeestimation is the Fisher information (FI) w.r.t. defo-cus. The inverse of the FI is related to the lowerbound on the variance of all unbiased estimatorsof the unknown parameter, which is defocus in ourcase. A larger FI, thus, indicates a better potentialestimator of defocus. The expression for the FI, de-noted J, is as follows [5]:

JðτÞ ¼Z Z

E

��ddτ lnðpðx;yÞ½Kðx; y; τÞ�

�2�dxdy; ð15Þ

where E½� is the statistical expectation operator, K isthe normalized PSF, and pðx;yÞ½Kðx; y; τÞ� is the prob-ability density function of K at the position ðx; yÞ inthe focal plane under defocus τ. It should be notedthat Eq. (15) perforce takes into account all spatialfrequencies and is not necessarily an ideal predictorof performance in the proposed algorithm. Figure 3shows J plotted over the defocus range of −10 < τ <10 for a1, a2, and the ES case. All PSFs in the calcula-tion of J were normalized to integrate to 1 for unitypower, and additive Gaussian noise was assumed.Note that this normalization actually underesti-mates the FI for a1 and a2 because they have highertransmission efficiencies than ES. Under the givenassumptions Eq. (15) is proportional to

JðτÞ ∝Z Z �

∂Kðx; y; τÞ∂τ

�2dxdy: ð16Þ

Table 2. Design Metric Values

DesignParameters

Linear Norm Cubic NormTransmissionEfficiencyBand All Band All

a1 3.83 8.56 0.18 33.9 29%a2 2.71 6.86 0.12 45.4 33.7%ES 1.85 6.95 .11 34.9 23.5%

5898 APPLIED OPTICS / Vol. 47, No. 31 / 1 November 2008

Page 7: Defocus sensitivity optimization using the defocus Taylor expansion of the optical transfer function

Under equal illumination higher transmission effi-ciency would correspond to higher power at the focalplane, which would have the effect of scaling K andits derivative. Since the linear Taylor coefficientcharacterizes the derivative of the OTF and, thus,the PSF at best focus, the relative values of the FIfor the systems at zero defocus are in agreement withthe norm of the linear term measured over the entirefrequency plane, as given in Table 2. Although its FIis slightly less at the origin, a2 represents an im-provement in potential over ES for almost the entirerange of defocus, and a1 is a significant enhancementin potential.As previously discussed, a measurement on the

OTF, not the PSF, is proposed to estimate depth.The variation of the OTF, or H, with defocus is moredirectly related to the proposed algorithm. Figure 4(a) plots ∥Hðu; v; τÞ −Hðu; v; 0Þ∥E with the E normcalculated over the entire frequency plane and Hnormalized to be unity at the spatial frequencyorigin, which is equivalent to the normalization ofK in the calculations for Fig. 3. Unlike the focus-insensitive systems in Fig. 1, the curves are clearlydominated by the linear Taylor term for small τ up toabout 3, or ∥Hðu; v; τÞ −Hðu; v; 0Þ∥E ≈ ∥∂Hðu; v; 0Þ=∂τ∥Eτ. In fact, like the quadratic term for defocus in-sensitivity, the linear term appears to be a good in-dicator of potential performance for a large range of τ.However, note the change in vertical scale at equiva-lent τ for the focus-insensitive designs in Fig. 1 andthe focus sensitive designs in Fig. 4(a). Not surpris-ingly, the results in Fig. 4(a) are similar to Fig. 3. Thecurves suggest that the OTFs for a2 and ES have si-milar rates of change for small τ, but the OTF of a2changes more rapidly as τ increases. This result waspredicted by the norms in Table 2 calculated over theentire frequency plane. Likewise, the OTF for a1 hasthe highest rate of change. Figure 4(b) plots the samefunction with the exception that the E norm is calcu-lated over the band in the spatial frequency plane

that was used in the design optimization, as wellas for measurement of depth estimation. The OTFfor a2 clearly looks to have a higher rate of changewith τ in the spatial frequencies of interest than thatof the ES case, as predicted by the norms in Table 2restricted to the spatial frequencies of interest.Therefore, it should not be surprising to find that tai-loring the optimization to the spatial frequencies ofinterest should result in enhanced performance.

The relative performance of the three systems wasnext tested in a simulation. Gaussian noise at vary-ing signal-to-noise ratios (SNRs) was added to theimage of coins shown in Fig. 5(a). These noisy testimages were convolved with the system PSFs for arange of defocus to create simulated images. A reg-ularized Wiener filter calculated by using the powerspectrum of the noise-free test image served as a de-convolution filter. It was used to deconvolve the sys-tem OTF from the simulated images to get noisyestimates of Hðu; v; τÞ. Iðθ; τÞ was calculated fromthe noisy estimates ofH and then input to the respec-tive neural nets trained separately for each system.The neural net output was the estimated defocus.

Fig. 3. Normalized Fisher information J versus misfocus τ isplotted for design parameters a1, a2, and ES. Plots were normalizedby a common factor so that the maximum possible FI equals 1.

Fig. 4. ∥Hðu; v; τÞ −Hðu; v;0Þ∥E versus misfocus τ plotted for thesystems with design parameters a1, a2, and ES with the E normcalculated (a) over the entire frequency plane and (b) within a re-stricted band near the spatial frequency origin.

1 November 2008 / Vol. 47, No. 31 / APPLIED OPTICS 5899

Page 8: Defocus sensitivity optimization using the defocus Taylor expansion of the optical transfer function

While keeping the SNR constant, this process was re-peated over a range of defocus values with 50 trials ofdifferent noise realizations at each value of defocus.A vector of estimated defocus values over a range ofdefocus was, thus, created for a particular SNR. Plotsof the mean square error (mse) between this vector ofvalues and the vector of actual defocus values as afunction of SNR are shown in Fig. 5. Simulationswere conducted for the following ranges of τ: ð−1; 1Þin Fig. 5(b), ð−4; 4Þ in Fig. 5(c), and ð−10; 10Þ inFig. 5(d).As predicted by the cost function tailored to the al-

gorithm, both designs generally performmuch betterthan the ES case, especially as noise increases. Theexception is a1 over the defocus range of ð−10; 10Þ inFig. 5(d). This plot is misleading, but it does repre-sent a disadvantage of this design. The large deriva-tive of the OTF w.r.t. defocus for this design followsfrom most of its energy’s being concentrated in abarbell-shaped region that spins around the originwith changing defocus. The magnitude of its OTFis shown in Fig. 6 at best focus. This concentrationof energy makes it sensitive to the support of thepower spectrum of the object. If the barbell spins intoa position where the object power spectrum has littleenergy, then a great deal of the energy in the esti-mated OTF will be below the noise level after decon-volution. The estimated Iðθ; τÞwill differ greatly fromthe noise-free Iðθ; τÞ used in training the net. This ef-fect caused a blind spot for a τ of about 7 when thebarbell was approximately aligned at �45° w.r.t.the vertical frequency axis, as shown in Fig. 7. Notein Fig. 7 that nulls of the magnitude of the OTF are

prominent along the axes where the energy in the ob-ject power spectrum due to vertical and horizontallines is frequently high. Though the errors in defocusestimate were very small throughout the vast major-ity of the defocus range, the error was very higharound τ ¼ 7, which skewed the mse. The blind spotwould limit the usable range of this system. Thehigher transmission efficiency of a2 was a result ofits energy’s being more evenly distributed through-out the spatial frequency plane. This distributionalso made it less sensitive to the distribution ofthe object power spectrum. It had a more consistentperformance throughout the defocus range, whereasthe performance of a1 oscillated between greater ex-tremes. Design a2 would be a better choice for esti-mating depth for arbitrary objects over a largemisfocus range, whereas design a1, biased at a mini-mum, would be a better choice for high depth resolu-tion over a smaller defocus range.

Fig. 5. Simulations of the three systems were run on the image ofcoins (quarters) lying on a flat surface shown in (a). The log10 of themse between the actual and the estimated defocus values areplotted versus SNR over the following ranges of misfocus:(b) −1 < τ < 1, (c) −4 < τ < 4, and (d) −10 < τ < 10.

Fig. 6. Gray-scale contour map of jHðu; v; τ ¼ 0Þj for the systemwith design parameters a1 plotted versus normalized spatial fre-quency coordinates u and v.

Fig. 7. Gray-scale contour map of jHðu; v; τ ¼ 7Þj for the systemwith design parameters a1 plotted versus normalized spatial fre-quency coordinates u and v.

5900 APPLIED OPTICS / Vol. 47, No. 31 / 1 November 2008

Page 9: Defocus sensitivity optimization using the defocus Taylor expansion of the optical transfer function

4. Conclusions

Formulas have been described for the coefficients ofthe defocus Taylor expansion of the OTF for both one-and two-dimensional pupils. These expressions areapplicable to incoherent imaging in general andcan be computed efficiently with the fast FT. Theform of these expressions elucidates many propertiesof wavefront coding systems, such as increasing sup-port size and smoothness of the PSF with decreasingsensitivity to defocus. The lowest-order terms of theexpansion are also well suited for nonlinear optimi-zation algorithms used in the design of thesesystems. Likewise, these expressions are effectivetools for the optimization of systems designed to besensitive to defocus in order to estimate range fromimages. Enhancement can be tailored to the spatialfrequencies of interest in an imaging task.

Appendix A. Outline of the Derivation of Eq. (7) fromEq. (5)

Space does not allow for a full derivation of Eq. (7).However, Eq. (7) can virtually be written down frominspection after examination of Eq. (5). The deriva-tive w.r.t. defocus at zero defocus of the right-handside of Eq. (5) can be accomplished by bringing thederivative under the integral, since the relevant op-erations are linear. Furthermore, the exponentialterm in the integrand is not a function of defocus.Therefore,

∂kHðu; v; 0Þ∂τk

¼

F−1

�dk

dτk½hð~rðτÞ;~sðτÞÞh�ð ̑rðτÞ; ̑sðτÞÞ�

����τ¼0

�; ðA1Þ

where ~r ¼ rþ ðuτÞ=ð2πÞ, ̑r ¼ r − ðuτÞ=ð2πÞ, ~s ¼ sþðvτÞ=ð2πÞ, and ̑s ¼ s − ðvτÞ=ð2πÞ. By the chain rulefor derivatives

ddτ ¼

u2π

∂~rþ v2π

∂~sor

ddτ ¼

−u2π

∂ ̑rþ−v2π

∂ ̑s ; ðA2Þ

depending upon whether the derivative of h or h�w.r.t. τ is being taken upon application of the productrule for derivatives. Since the derivative is evaluatedat τ ¼ 0, effectively ~r ¼ ̑r ¼ r and ~s ¼ ̑s ¼ s inEqs. (A1) and (A2) after the derivative is evaluated.After taking the derivative w.r.t. τ in Eq. (A1) and

evaluating it at τ ¼ 0, it can be seen that the problemis reduced to collecting sums of terms of the form

uqþγvwþη

ð2πÞk ð−1Þγþη ∂ðqþwÞh∂rq∂sw

∂ðγþηÞh�

∂rγ∂sη; ðA3Þ

where q, w, γ, and η are nonnegative integers lessthan or equal to k. Note that the sign of the termis determined by the order of the partial derivativeof h�. For the kth-order derivative qþ γ þwþ v ¼ k

because each term adds a partial derivative of h orh� w.r.t. r or s with each derivative w.r.t. τ. Letqþ γ ¼ m. Then wþ η ¼ k −m. For the kth-order de-rivative w.r.t. τ, partial derivative terms of h and h�multiplied by the factor umvk−m will be present for0 ≤ m ≤ k. Furthermore, all possible terms having atotal of m partial derivatives of h and h� w.r.t. rand and k −m partial derivatives of h and h� w.r.t.s will be present in the sum. The sums w.r.t. the in-dexes l and a in Eq. (7) merely account for all possibledifferent terms from which umvk−m can be factoredout. Since the inverse FT in Eq. (A1) is w.r.t. r ands, the common umvk−m term can be taken outsidethe inverse FT.

These above relations can be used to write downthe form of the sum expression in Eq. (7). All thatremains is determining the number of times eachterm of the form Eq. (A3) appears in Eq. (7), orCk;a;l;m. Counting theory can be employed to deter-mine this factor. The term of the form Eq. (A3)was arrived at by adding one partial derivative ofh or h� w.r.t. r or s in k steps for the kth-order partialderivative of H. The number of distinct ways this ispossible is equal to the number of times this termwillappear in the sum. The solution to C for the term inEq. (A3) is thus the multinomial coefficient for fourdistinct elements with respective multiplicities of q,w, γ, and η, or

C ¼ ðqþwþ γ þ ηÞ!q!w!γ!n! ¼ k!

q!w!γ!η! : ðA4Þ

Ck;a;l;m is of this form with appropriate substitutionsfor the multiplicities.

References1. J. O. Castañeda, L. R. B. Valdos, and E. Montes, “Ambiguity

function as a design tool for high focal depth,” Appl. Opt. 27,790–795 (1988).

2. J. O. Castañeda, R. Ramos, and A. N. Isgleas, “High focaldepth by apodization and digital restoration,” Appl. Opt.27, 2583–2586 (1988).

3. E. Dowski and W. Cathey, “Extended depth of field throughwavefront coding,” Appl. Opt. 34, 1859–1866 (1995).

4. P. Favaro and S. Soatto, “A geometric approach to shape fromdefocus” IEEE Trans. Pattern Anal. Mach. Intell. 27,406–417 (2005).

5. A. Greengard, Y. Y. Schechner, and R. Piestun, “Depth fromdiffracted rotation,” Opt. Lett. 31, 181–183 (2006).

6. J. O. Castañeda, “Bilinear optical systemsWigner distributionfunction and ambiguity function representations,” Opt. Acta1, 255–260 (1984).

7. H. M. Ozaktas, Z. Zalevsky, and M. A. Kutay, The FractionalFourier Transform with Applications in Optics and SignalProcessing (Wiley, 2001).

8. Q. Yang, L. Liu, J. Sun, Y. Zhu, and W. Lu, “Analysis of opticalsystems with extended depth of field using the Wigner distri-bution function,” Appl. Opt. 45, 8586–8595 (2006).

9. S. Prasad, T. Torgersen, V. Pauca, R. Plemmons, and J. van derGracht, “Engineering the pupil phase to improve image qual-ity,” Proc. SPIE 5108, 1–12 (2003).

1 November 2008 / Vol. 47, No. 31 / APPLIED OPTICS 5901

Page 10: Defocus sensitivity optimization using the defocus Taylor expansion of the optical transfer function

10. S. Barwick, “Efficient metric for pupil-phase engineering,”Appl. Opt. 46, 7258–7261 (2007).

11. J. W. Goodman, Introduction to Fourier Optics (McGraw-Hill, 1968).

12. K. Brenner, A. Lohmann, and J. O. Casteñeda, “The ambiguityfunction as a polar display of the OTF,” Opt. Commun. 44,323–326 (1983).

13. S. Mallat, A Wavelet Tour of Signal Processing (Academic,1998).

14. S. Barwick, “Increasing the information acquisition volumein iris recognition systems,” Appl. Opt. 47, 4684–4691(2008).

15. W. Zhang, Zi Ye, T. Zhao, Y. Chen, and F. Yu, “Point spreadfunction characteristics analysis of wavefront coding sys-tems,” Opt. Express 15, 1543–1552 (2007).

16. R. Piestun, Y. Y. Schechner, and J. Shamir, “Propagation invar-iant wave fields with finite energy,” J. Opt. Soc. Am. A 17,294–303 (2000).

5902 APPLIED OPTICS / Vol. 47, No. 31 / 1 November 2008


Recommended