+ All Categories
Home > Documents > arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an...

arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an...

Date post: 29-Oct-2020
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
17
arXiv:1102.0048v2 [math.OC] 18 Apr 2011 Noname manuscript No. (will be inserted by the editor) Smart depth of field optimization applied to a robotised view camera St´ ephane Mottelet · Luc de Saint Germain · Olivier Mondin the date of receipt and acceptance should be inserted later Abstract The great flexibility of a view camera allows the acquisition of high quality images that would not be possible any other way. Bringing a given object into focus is however a long and tedious task, although the underlying optical laws are known. A fundamental parameter is the aperture of the lens entrance pupil because it directly affects the depth of field. The smaller the aperture, the larger the depth of field. However a too small aperture destroys the sharpness of the image because of diffraction on the pupil edges. Hence, the desired optimal configuration of the camera is such that the object has the sharpest image with the greatest possible lens aperture. In this paper, we show that when the object is a convex polyhedron, an elegant solution to this problem can be found. The problem takes the form of a constrained op- timization problem, for which theoretical and numerical re- sults are given. Keywords Large format photography · Computational photography · Scheimpflug principle 1 Introduction Since the registration of Theodor Scheimpflug’s patent in 1904 (see [6]), and the book of Larmore in 1965 where a proof of the so-called Scheimpflug principle can be found (see [3, p. 171-173]), very little has been written about the S. Mottelet Laboratoire de Math´ ematiques Appliqu´ ees Universit´ e de Technologie de Compi` egne 60205 Compi` egne France E-mail: [email protected] L. de Saint Germain, O. Mondin Luxilon 21, rue du Calvaire 92210 Saint-Cloud France E-mail: [email protected] (a) (b) Fig. 1 The Sinar e (a) and its metering back (b). mathematical concepts used in modern view cameras, until the development of the Sinar e in 1988 (see Figure 1). A short description of this camera is given in [7, p. 23]: The Sinar e features an integrated electronic computer, and in the studio offers a maximum of convenience and opti- mum computerized image setting. The user-friendly software guides the photographer through the shot without technical confusion. The photographer selects the perspective (cam- era viewpoint) and the lens, and chooses the areas in the subject that are to be shown sharp with a probe. From these
Transcript
Page 1: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

arX

iv:1

102.

0048

v2 [

mat

h.O

C]

18 A

pr 2

011

Noname manuscript No.(will be inserted by the editor)

Smart depth of field optimization applied to a robotised viewcamera

Stephane Mottelet · Luc de Saint Germain · Olivier Mondin

the date of receipt and acceptance should be inserted later

Abstract The great flexibility of a view camera allows theacquisition of high quality images that would not be possibleany other way. Bringing a given object into focus is howevera long and tedious task, although the underlying optical lawsare known. A fundamental parameter is the aperture of thelens entrance pupil because it directly affects the depth offield. The smaller the aperture, the larger the depth of field.However a too small aperture destroys the sharpness of theimage because of diffraction on the pupil edges. Hence, thedesired optimal configuration of the camera is such that theobject has the sharpest image with the greatest possible lensaperture. In this paper, we show that when the object is aconvex polyhedron, an elegant solution to this problem canbe found. The problem takes the form of a constrained op-timization problem, for which theoretical and numerical re-sults are given.

Keywords Large format photography· Computationalphotography· Scheimpflug principle

1 Introduction

Since the registration of Theodor Scheimpflug’s patent in1904 (see [6]), and the book of Larmore in 1965 where aproof of the so-calledScheimpflug principlecan be found(see [3, p. 171-173]), very little has been written about the

S. MotteletLaboratoire de Mathematiques AppliqueesUniversite de Technologie de Compiegne60205 Compiegne FranceE-mail: [email protected]

L. de Saint Germain, O. MondinLuxilon21, rue du Calvaire92210 Saint-Cloud FranceE-mail: [email protected]

(a)

(b)

Fig. 1 The Sinar e (a) and its metering back (b).

mathematical concepts used in modern view cameras, untilthe development of the Sinar e in 1988 (see Figure 1). Ashort description of this camera is given in [7, p. 23]:

TheSinar efeatures an integrated electronic computer,and in the studio offers a maximum of convenience and opti-mum computerized image setting. The user-friendly softwareguides the photographer through the shot without technicalconfusion. The photographer selects the perspective (cam-era viewpoint) and the lens, and chooses the areas in thesubject that are to be shown sharp with a probe. From these

Page 2: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

2 Stephane Mottelet et al.

scattered points the Sinar e calculates the optimum positionof the plane of focus, the working aperture needed, and in-forms the photographer of the settings needed

Sinar sold a few models of this camera and discontinuedits development in the early nineties. Surprisingly, therehasbeen very little published user feedback about the cameraitself. However many authors started to study (in fact, re-discover) the underlying mathematics (see e.g. [4] and thereferences therein). The most crucial aspect is the consider-ation of depth of field and the mathematical aspects of thisprecise point are now well understood. When the geomet-rical configuration of the view camera is precisely known,then the depth of field region (the region of space where ob-jects have a sharp image) can be determined by using thelaws of geometric optics. Unfortunately, these laws can onlybe used as a rule of thumb when operating by hand on aclassical view camera. Moreover, the photographer is ratherinterested in the inverse problem: given an object which hasto be rendered sharply, what is the optimal configuration ofthe view camera? A fundamental parameter of this config-uration is the aperture of the camera lens. Decreasing thelens aperture diameter increases the depth of field but alsoincreases the diffraction of light by the lens entrance pupil.Since diffraction decreases the sharpness of the image, theoptimal configuration should be such that the object fits thedepth of field region with the greatest aperture.

This paper presents the mathematical tools used in thesoftware of a computer controlled view camera solving thisproblem. Thanks to the high precision machining of its com-ponents, and to the known optical parameters of the lens anddigital sensor, a reliable mathematical model of the viewcamera has been developed. This model allows the acqui-sition of 3D coordinates of the object to be photographed, asexplained in Section 2. In Section 3 we study the depth offield optimization problem from a theoretical and numericalpoint of view. We conclude and briefly describe the archi-tecture of the software in Section 4.

2 Basic mathematical modeling

2.1 Geometrical model of the View Camera

We consider the robotised view camera depicted in Figure2(a) and its geometrical model in Figure 2(b). We use aglobal Euclidean coordinate system(O,X1,X2,X3) attachedto the camera’s tripod. The front standard, symbolized by itsframe with centerL of global coordinatesL = (L1,L2,L3)

⊤,can rotate along its tilt and swing axes with anglesθL andφL. Most camera lenses are in fact thick lenses and nodalpointsH ′ andH have to be considered (see [5] p. 43-46).The rear nodal plane, which is parallel and rigidly fixed tothe front standard, passes through the rear nodal pointH ′.

(a)

(b)

Fig. 2 Geometrical model (a) and robotised view camera (b).

SinceL andH ′ do not necessarily coincide, the translation

between these two points is denotedtL . The vector−−→HH ′ is

supposed to be orthogonal to the rear nodal plane.

The rear standard is symbolized by its frame with centerS, whose global coordinates are given byS= (S1,S2,S3)

⊤.It can rotate along its tilt and swing axes with anglesθS and

Page 3: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

Smart depth of field optimization applied to a robotised viewcamera 3

φS. The sensor plane is parallel and rigidly fixed to the rearstandard. The eventual translation betweenSand the centerof the sensor is denoted bytS.

The rear standard centerS can move in the threeX1,X2

and X3 directions but the front standard centerL is fixed.The rotation matrices associated with the front and rear stan-dard alt-azimuth mounts are respectively given byRL =

R(θL,φL) andRS = R(θS,φS) where

R(θ ,φ) =

cosφ −sinφ sinθ −sinφ cosθ0 cosθ −sinθ

−sinφ cosφ sinθ cosφ cosθ

.

The intrinsic parameters of the camera (focal lengthf , po-sitions of the nodal pointsH, H ′, translationstS, tL , imagesensor characteristics) are given by their respective manu-facturers data-sheets. The extrinsic parameters of the cam-era areS, L , the global coordinate vectors ofS andL, andthe four rotation anglesθS, φS, θL, φL. The precise knowl-edge of the extrinsic parameters is possible thanks to thecomputer-aided design model used for manufacturing thecamera components. In addition, translations and rotationsof the rear and front standards are controlled by stepper mo-tors whose positions can be precisely known. In the follow-ing, we will see that this precise geometrical model of theview camera allows one to solve various photographic prob-lems. The first problem is the determination of coordinatesof selected points of the object to be photographed.

In the sequel, for sake of simplicity, we will give all al-gebraic details of the computations for a thin lens, i.e. whenthe two nodal pointsH, H ′ coincide. In this case, the nodalplanes are coincident in a so-calledlens plane. We will alsoconsider thattL = (0,0,0)⊤ so thatL is the optical center ofthe lens. Finally, we also consider thattS= (0,0,0)⊤ so thatScoincides with the center of the sensor.

2.2 Acquisition of object points coordinates

Let us consider a pointX with global coordinates given byX = (X1,X2,X3)

⊤. The geometrical construction of the im-ageA of X through the lens is depicted in Figure 3. We haveconsidered a local optical coordinate system attached to thelens plane with originL. The local coordinates ofX are givenby x = (RL )−1(X−L) and the focal pointF has local coor-dinates(0,0, f )⊤. Elementary geometrical optics (see [5] p.35-42) allows one to conclude that if the local coordinates ofA are given bya= (a1,a2,a3)

⊤, thena3, x3 and f are linkedby the thin lens equation given in its Gaussian form by

−1a3

+1x3

=1f.

SinceA lies on the(XL) line, the other coordinates are ob-tained by straightforward computations and we have the con-

Fig. 3 Graphical construction of the imageA of an object pointX inthe optical coordinate system. Green rays and blue rays respectively liein the(L,x3,x2) and(L,x3,x1) planes andF is the focal point.

Fig. 4 Image formation when considering a lens with a pupil.

jugate formulas

a=f

f − x3x, (1)

x =f

f +a3a. (2)

Bringing an object into focus is one of the main tasks of aphotographer but it can also be used to calculate the coordi-nates of an object point. It is important to remember that alllight rays emanating fromX converge toA but pass througha pupil (or diaphragm) assumed to be circular, as depicted inFigure 4. Since all rays lie within the oblique circular coneof vertexA and whose base is the pupil, the image ofX onthe sensor will be in focus only if the sensor plane passes

Page 4: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

4 Stephane Mottelet et al.

throughA, otherwise its extended image will be a blur spot.By using the full aperture of the lens, the image will rapidlygo out of focus if the sensor plane is not correctly placed,e.g. by translatingS into thex3 direction. This is why auto-focus systems on classical cameras only work at near fullaperture: the distance to an object is better determined whenthe depth of field is minimal.

The uncertainty on the position ofSgiving the best focusis related to the diameter of the so-called “circle of confu-sion”, i.e. the maximum diameter of a blur spot that is in-distinguishable from a point. Hence, everything depends onthe size of photosites on the sensor and on the precision ofthe focusing system (either manual or automatic). This un-certainty is acceptable and should be negligible compared tothe uncertainty of intrinsic and extrinsic camera parameters.

The previous analysis shows that the global coordinatesof X can be computed, given the position(u,v)⊤ of its imageA on the sensor plane. This idea has been already used on theSinar e, where the acquisition of(u,v)⊤ was done by usinga mechanical metering unit (see Figure 1 (b)). In the systemwe have developed, a mouse click in the live video windowof the sensor is enough to indicate these coordinates. Once(u,v)⊤ is known, the coordinates ofA in the global coordi-nate system are given by

A = S+RS

uv0

,

and its coordinates in the optical system by

a= (RL )−1(A −L).

Then the local coordinate vectorx of the reciprocal imageis computed with (2) and the global coordinate vectorX isobtained by

X = L +RLx.

By iteratively focusing on different parts of the object, thephotographer can obtain a set of pointsX = {X1, . . . ,Xn},with n≥ 3, which can be used to determine the best configu-ration of the view camera, i.e. the positions of front and rearstandards and their two rotations, in order to satisfy focusrequirements.

3 Focus and depth of field optimization

In classical digital single-lens reflex (DLSR) cameras, thesensor plane is always parallel to the lens plane and to theplane of focus. For example, bringing into focus a long andflat object which is not parallel to the sensor needs to de-crease the aperture of the lens in order to extend the depthof field. On the contrary, view cameras with tilts and swings(or DLSR with a tilt/shift lens) allow to skew away the planeof focus from the parallel in any direction. Hence, bringing

into focus the same long and flat object with a view cameracan be done at full aperture. This focusing process is unfor-tunately very tedious. However, if a geometric model of thecamera and the object are available, the adequate rotationscan be estimated precisely. In the next sections, we will ex-plain how to compute the rear standard position and the tiltand swing angles of both standards to solve two differentproblems:

1. when the focus zone is roughly flat, and depth of fieldis not a critical issue, then the object plane is computedfrom the set of object pointsX . If n= 3 and the pointsare not aligned then this plane is uniquely defined. Ifn> 3 and at least 3 points are not aligned, we computethe best fitting plane minimizing the sum of squared or-thogonal distances to points ofX . Then, we are able tobring this plane into sharp focus by acting on:(a) the anglesθL andφL of the front standard and the

position of the rear standard, for arbitrary rotationanglesθS, φS.

(b) the anglesθS, φS and position of the rear standard,for arbitrary rotation anglesθL, φL (in this case thereis a perspective distortion).

2. when the focus zone is not flat, then the tridimensionalshape of the object has to be taken into account.

The computations in case 1a are detailed in Section 3.1.In Section 3.3 a general algorithm is described that allowsthe computation of anglesθL andφL of the front standardand the position of the rear standard such that all the objectpoints are in the depth of field region with a maximum aper-ture. We give a theoretical result showing that the determi-nation of the solution amounts to enumerate a finite numberof configurations.

3.1 Placement of the plane of sharp focus by using tilt andswing angles

In this section we study the problem of computing the tiltand swing angles of front standard and the position of therear standard for a given sharp focus plane. Although theunderlying laws are well-known and are widely described(see [4,8,2]), the detail of the computations is always donefor the particular case where only the tilt angleθ is consid-ered. Since we aim to consider the more general case wheretilt and swing angles are used, we will describe the variousobjects (lines, planes) and the associated computations byusing linear algebra tools.

3.1.1 The Scheimpflug and the Hinge rules

In order to explain the Scheimpflug rule, we will refer tothe diagram depicted in Figure 5. The Plane of sharp focus(abbreviated SFP) is determined by a normal vectornSF and

Page 5: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

Smart depth of field optimization applied to a robotised viewcamera 5

Fig. 5 Illustration of the Scheimpflug rule.

Fig. 6 Illustration of the Hinge rule.

a pointY. The position of the optical centerL and a vectornS normal to the sensor plane (abbreviated SP) are known.The unknowns are the position of the sensor centerSand avectornL normal to the lens plane (abbreviated LP).

The Scheimplug rule stipulates that if SFP is into focus,then SP, LP and SFP necessarily intersect on a common linecalled the ”Scheimpflug Line” (abbreviated SL). The dia-

gram of Figure 5a should help the reader to see that this ruleis not sufficient to uniquely determinenL and SP, as thisplane can be translated towardnS if nL is changed accord-ingly.

The missing constraints are provided by the Hinge rule,which is illustrated in Figure 6. This rule considers two com-plimentary planes: the front focal plane (abbreviated FFP),which is parallel to LP and passes through the focal pointF, and the parallel to sensor lens plane (abbreviated PSLP),which is parallel to SP and passes through the optical centerL. The Hinge Rule stipulates that FFP, PSLP and SFP mustintersect along a common line called the Hinge Line (abbre-viated HL). Since HL is uniquely determined as the intersec-tion of SFP and PSLP, this allows one to determinenL , orequivalently the tilt and swing angles, such that FFP passesthrough HL andF . Then SL is uniquely defined as the in-tersection of LP and SFP by the Scheimpflug rule (note thatSL and HL are parallel by construction). SincenS is alreadyknown, any point belonging to SL is sufficient to uniquelydefine SP. Hence, the determination of tilt and swing anglesand position of the rear standard can be summarized as fol-lows:

1. determination of HL, intersection of FFP and SFP,2. determination of tilt and swing angles such that HL be-

longs to FFP,3. determination of SL, intersection of LP and SFP,4. translation ofSsuch that SL belongs to SP.

3.1.2 Algebraic details of the computations

In this section the origin of the coordinate system is the op-tical centerL and the inner product of two vectorsX andYis expressed by using the matrix notationX⊤Y. All planesare defined by a unit normal vector and a point in the planeas follows:

SP={

X ∈ R3, (X −S)⊤nS = 0

}

PSLP={

X ∈ R3, X⊤nS = 0

},

LP={

X ∈ R3, X⊤nL = 0

},

FFP={

X ∈ R3, X⊤nL − f = 0

},

SFP={

X ∈ R3, (X −Y)⊤nSF = 0

},

where the equation of FFP takes this particular form becausethe distance betweenL andF is equal to the focal lengthf and we have imposed thatnL

3 > 0. The computations aredetailed in the following algorithm:

Algorithm 1

Step 1: compute the Hinge Line by considering its para-metric equation

HL ={

X ∈R3, ∃ t ∈ R, X = W + tV

},

Page 6: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

6 Stephane Mottelet et al.

whereV is a direction vector andW is the coordinatevector of an arbitrary point of HL. Since this line is theintersection of PSLP and SFP,V is orthogonal tonL andnSF. Hence, we can takeV as the cross product

V = nSF×nS

andW as a particular solution (e.g. the solution of mini-mum norm) of the overdetermined system of equations

W⊤nS = 0,

W⊤nSF = Y⊤nSF.

Step 2: since HL belongs to FFP we have

(W + tV)⊤nL − f = 0, ∀ t ∈ R,

hencenL verifies the overdetermined system of equa-tions

W⊤nL = f , (3)

V⊤nL = 0. (4)

with the constraint‖nL‖2 = 1. The computation ofnL

can be done by the following two steps:

1. computeW = V ×W andV the minimum norm so-lution of system (3)-(4), which gives a parametriza-tion

nL = V+ tW,

of all its solutions, wheret is an arbitrary real.2. determination oft such that‖nL‖2 = 1: this is done

by taking the solutiont of the second degree equa-tion

W⊤Wt2+2W⊤Vt + V⊤V−1= 0,

such thatnL3 > 0. The tilt and swing angles are then

obtained as

θL =−arcsinnL2, φL =−arcsin

nL1

cosθL.

Step 3: since SL is the intersection of LP and SFP, thecoordinate vectorU of a particular pointU on SL is ob-tained as the minimum norm solution of the system

U⊤nL = 0,

U⊤nSF = W⊤nSF,

where we have used the fact thatW ∈ SFP.Step 4: the translation ofS can be computed such thatU belongs to SP, i.e.

(U−S)⊤nS = 0.

If we only act on the third coordinate ofSand leave thetwo others unchanged, thenS3 can be computed as

S3 =U⊤nS−S1nS

1−S2nS2

nS3

.

Fig. 7 Position of planes SFP1 and SFP2 delimiting the depth of fieldregion.

Remark 1When we consider a true camera lens, the nodalpointsH,H ′ and the front standard centerL do not coincide.Hence, the tilt and swing rotations of the front standard mod-ify the actual position of the PSLP plane. In this case, we usethe following iterative fixed point scheme:

1. The anglesφL andθL are initialized with starting valuesφ0

L andθ 0L .

2. At iterationk,(a) the position of PSLP is computed consideringφk

L andθ k

L ,(b) the resulting Hinge Line is computed, then the posi-

tion of FFP and the new valuesφk+1L andθ k+1

L arecomputed.

Point 2 is repeated until convergence ofφkL andθ k

L up to agiven tolerance. Generally 3 iterations are sufficient to reachthe machine precision.

3.2 Characterization of the depth of field region

As in the previous section, we consider thatL and the nodalpointsH andH ′ coincide. Moreover,L will be the origin ofthe global coordinates system.

We consider the configuration depicted in Figure 7 wherethe sharp focus plane SFP, the lens plane LP and the sensorplane SP are tied by the Scheimpflug and the Hinge rule.The depth of field can be defined as follows:

Definition 1 Let X be a 3D point andA its image throughthe lens. LetC be the disk in LP of centerL and diameter

Page 7: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

Smart depth of field optimization applied to a robotised viewcamera 7

f/N, whereN is called thef-number. Let K be the cone ofbaseC and vertexA. The pointX is said to lie in the depth offield region if the diameter of the intersection of SP andK islower thatc, the diameter of the so-calledcircle of confusion.

The common values ofc, which depend on the magnificationfrom the sensor image to the final image and on its viewingconditions, lie typically between 0.2 mm and 0.01 mm. Inthe following the value ofc is not a degree of freedom but agiven input.

If the ellipticity of extended images is neglected, thedepth of field region can be shown to be equal to the un-bounded wedge delimited by SFP1 and SFP2 intersecting atHL, where the corresponding sensor planes SP1 and SP2 aretied to SFP1 and SFP2 by the Scheimpflug rule. By mentallyrotating SFP around HL, it is easy to see that SP is translatedthroughnS and spans the region between SP1 and SP2. Theposition of SP1 and SP2, the f-numberN and the diameterof the circle of confusionc are related by the formula

Ncf

=p1− p2

p1+ p2, (5)

wherep1, respectivelyp2, are the distances between the op-tical centerL and SP1, respectively SP2, both measured or-thogonally to the optical plane. The distancep between SPand L can be shown to be equal to

p=2p1p2

p1+ p2, (6)

the harmonic mean ofp1 and p2. This approximate defini-tion of the depth of field region has been proposed by vari-ous authors (see [8,1]) but when the ellipticity of images istaken into account a complete study can be found in [2]. Forsake of completeness, we give the justification of formulas(5) and (6) in Appendix A.1. In most practical situations thenecessary angle between SP and LP is small (less that 10degrees), so that this approximation is correct.

Remark 2The analysis in Appendix A.1 shows that the ra-tio Nc

f in equation (5) does not depend on the direction usedfor measuring the distance between SP, SP1, SP2 andL. Theonly condition, in order to take into account the case whereSP and LP are parallel, is that this direction is not orthog-onal tonS. Hence, by taking the direction given bynS, wecan obtain an equivalent formula to (5). To compute the dis-tances, we need the coordinate vector of two pointsU1 andU2 on SP1 and SP2 respectively. To this purpose we considerStep 3 of Algorithm 1 in section 3.1: ifW is the coordinatevector of any pointW of HL, each vectorUi can be obtainedas a particular solution of the system

Ui⊤nL = 0,

Ui⊤ni = W⊤ni .

Since SPi can be defined as

SPi ={

X ∈ R3, (X −Ui)

⊤nS = 0

},

and‖nS‖= 1, the signed distance fromL to SPi is equal to

d(L,SPi) = Ui⊤nS.

So the equivalent formula giving the ratioNcf is given by

Ncf

=

∣∣∣∣d(L,SP1)−d(L,SP2)

d(L,SP1)+d(L,SP2)

∣∣∣∣ ,

=

∣∣∣∣∣(U1−U2)

⊤nS

(U1+U2)⊤nS

∣∣∣∣∣ . (7)

The above considerations show that for a given orienta-tion of the rear standard given bynS, if the depth of fieldwedge is given, then the needed f-number, the tilt and swingangles of the front standard and the translation of the sen-sor plane, can be determined. The related question that willbe addressed in the following is the question: given a setof pointsX = {X1, . . . ,Xn}, how can we minimize the f-number such that all points ofX lie in the depth of fieldregion?

3.3 Depth of field optimization with respect to tilt angle

We first study the depth of field optimization in two dimen-sions, because in this particular case all computations canbecarried explicitly and a closed form expression is obtained,giving the f-number as a function of front standard tilt angleand of the slope of limiting planes. First, notice thatN has anatural upper bound, since (5) implies that

N ≤fc.

3.3.1 Computation of f-number with respect to tilt angleand limiting planes

Without loss of generality, we consider that the sensor planehas the normalnS = (0,0,1)⊤. Let us denote byθ the tiltangle of the front standard and consider that the swing angleφ is zero. The lens plane is given by

LP={

X ∈ R3, X⊤nL = 0

},

wherenL = (0,−sinθ ,cosθ )⊤,

and any collinear vector tonL ×nS is a direction vector ofthe Hinge Line. Hence we can take, independently ofθ ,

V = (1,0,0)⊤

Page 8: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

8 Stephane Mottelet et al.

Fig. 8 The depth of field region when only a tilt angleθ is used.

and a parametric equation of HL is thus given by

HL ={

X ∈ R3, ∃ t ∈ R, X = W(θ )+ tV

},

whereW(θ ) is the coordinate vector of a particular pointW(θ ) on HL, obtained as the minimum norm solution of

W(θ )⊤nS = 0,

W(θ )⊤nL = f .

Straightforward computations show that forθ 6= 0

W(θ ) =

0− f

sinθ0

.

Consider, as depicted in Figure 8, the two sharp focusplanes SFP1 and SFP2 passing through HL, with normalsn1 = (0,−1,a1)

⊤ andn2 = (0,−1,a2)⊤,

SFP1 ={

X ∈R3, (X −W(θ ))⊤n1 = 0

},

SFP2 ={

X ∈R3, (X −W(θ ))⊤n2 = 0

}.

The two corresponding sensor planes SPi are given by fol-lowing Steps 3-4 in Algorithm 1 by

SFPi ={

X ∈ R3, X3 = ti

}, i = 1,2,

where

ti =f

ai sinθ − cosθ, i = 1,2.

Using equation (7) the corresponding f-number is equal to

N(θ ,a) =∣∣∣∣t1− t2t1+ t2

∣∣∣∣(

fc

), (8)

where we have used the notationa = (a1,a2). Finally wehave, forθ 6= 0

N(θ ,a) = signθ(a1−a2)sinθ

2cosθ − (a1+a2)sinθ

(fc

). (9)

Remark 3Whenθ = 0, then SFP does not intersect PSLPand the depth of field region is included between two parallelplanes SFPi given by

SFPi ={

X ∈ R3, X3 = zi

}, i = 1,2,

wherez1 andz2 depend on the f-number and on the positionof SFP. One can show by using the thin lens equation andequation (5) that the corresponding f-number is equal to

N0(z1,z2) =

∣∣∣ 1z2− 1

z1

∣∣∣1z1+ 1

z2− 2

f

(fc

). (10)

3.3.2 Theoretical results for the optimization problem

Without loss of generality, we will consider a set of onlythree non-aligned pointsX = {X1,X2,X3}, which have tobe within the depth of field region with minimal f-numberand we denote byX1,X2,X3 their respective coordinate vec-tors.

The corresponding optimization problem can be statedas follows: find

(θ ∗,a∗) = arg minθ ∈ R

a∈ A (θ )

N(θ ,a), (11)

where for a givenθ the setA (θ ) is defined by the inequal-ities

(X i −W(θ ))⊤n1 ≥ 0, i = 1,2,3, (12)

(X i −W(θ ))⊤n2 ≤ 0, i = 1,2,3, (13)

meaning thatX1,X2,X3 are respectively under SFP1 andabove SFP2, and by the inequalities

−(X i −W(θ ))⊤nL + f ≤ 0, i = 1,2,3, (14)

meaning thatX1,X2,X3 are in front of FFP.

Page 9: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

Smart depth of field optimization applied to a robotised viewcamera 9

Remark 4Points behind the focal plane cannot be in focus,and the constraints (14) are just expressing this practicalim-possibility. However, we have to notice that when one ofthese constraints is active, we can show thata1 = cotθ ora2 = cotθ so thatN(a,θ ) reaches its upper boundfc . More-over, we have to eliminate the degenerate case where thepointsXi are such that there exists two active constraints in(14): in this case, there exists a unique admissible pair(a,θ )and the problem has no practical interest. To this purpose,we can suppose thatXi

3 > f for i = 1,2,3.

For θ 6= 0 the gradient ofN(a,θ ) is equal to

∇(a,θ ) =2signθ

(2cotθ − (a1+a2))2

cotθ −a2

−cotθ +a1a1−a2sin2θ

and cannot vanish sincea1 = a2 is not possible because itwould mean thatX1,X2,X3 are aligned. This implies thatalies on the boundary ofA (θ ) and we have the followingintuitive result (the proof is given in Appendix A.2):

Proposition 1 Suppose that Xi3 > f , for i = 1,2,3. Thenwhen N(a,θ ) reaches its minimum, there exists i1, i2 withi1 6= i2 such that

(X i1 −W(θ ))⊤n1 = 0,

(X i2 −W(θ ))⊤n2 = 0.

Remark 5The above result shows that at least two pointstouch the depth of field limiting planes SFP1 and SFP2 whenthe f-number is minimal. In the following, we will show thatthe three pointsX1,X2 andX3 are necessarily in contact withone of the limiting planes (the proof is given in AppendixA.3):

Proposition 2 Suppose that the vertices{Xi}i=1...3 verifythe condition

‖X i ×X j‖

‖X i −X j‖> f , i 6= j. (15)

Then N(a,θ ) reaches its minimum when all vertices are incontact with the limiting planes.

Remark 6If θ is small, thenN(θ ,a) in (9) can be approxi-mated by

N(θ ,a) = signθ (a1−a2)sinθ(

f2c

), (16)

and the proof of Proposition 2 is considerably simplified: thesame result holds with the weaker condition

‖X i ×X j‖> 0. (17)

In fact, an approximate way of specifying the depth of fieldregion using thehyperfocal distance, proposed in [4], leadsto the same approximation ofN(θ ,a), under thea priorihypothesis of smallθ and distant objects, i.e.Xi

3 ≫ f . Thisremark is clarified in Appendix A.4.

We will illustrate the theoretical result by considering setsof 3 points. For a set with more than 3 vertices (but beingequal to the vertices of the convex hull ofX ), the determi-nation of the optimal solution is purely combinatorial, sinceit is enough to enumerate all admissible situations where twopoints are in contact with one plane, and a third one with theother. The valueθ = 0 also has to be considered because itcan be a critical value if the object has a vertical edge. Wewill also give an Example which violates condition (15) andwhereN(a,θ ) reaches its minimum when only two verticesare in contact with the limiting planes.

3.3.3 Numerical results

In this section, we will consider the following function, de-fined forθ 6= 0

n(θ ) = mina∈A (θ)

N(a,θ ).

Finding the minimum of this function allows one to solve theoriginal constrained optimization problem, but consideringthe results of the previous section,n(θ ) is non-differentiable.In fact, the values ofθ for which n(θ ) is not differentiablecorrespond to the situations where 3 points are in contactwith the limiting planes. We extendn(θ ) by continuity forθ = 0 by defining

n(0) =1z2− 1

z11z1+ 1

z2− 2

f

(fc

),

where

z1 = maxi=1,2,3

Xi3, z2 = min

i=1,2,3Xi

3.

This formula can be directly obtained by using conjugationformulas or by takingθ = 0 in equation (24).

Example 1 We consider a lens with focal lengthf = 5.10−2mand a confusion circlec = 3.10−5m (commonly used valuefor 24x36 cameras). The vertices have coordinates

X1 =

0−1

1

, X2 =

031

, X3 =

00

1.5

.

Figure 9 shows the desired depth of field region (dashedzone) and the three candidates hinge lines corresponding tocontactsEi jVk:

– E12V3, obtained when the edge[X1,X2] is in contact withSFP1 and vertexX3 with SFP2.

– E13V2, obtained when the edge[X1,X3] is in contact withSFP2 and vertexX2 with SFP1.

– E23V1, obtained when the edge[X2,X3] is in contact withSFP1 and vertexX1 with SFP2.

Page 10: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

10 Stephane Mottelet et al.

Fig. 9 Enumeration of the 3 candidates configurations for Example 1.

Contact θ n(θ )E12V3 0.0166674 9.52E13V2 0.025002 7.16E23V1 0.0500209 28.28

Table 1 Value ofθ for each possible optimal contact and correspond-ing f-numbern(θ ) for Example 1.

The associated values ofθ andn(θ ) are given in Table 1,which shows that contactE13V2 seems to give the minimumf-number. Condition (15) is verified, since

‖X1×X2‖

‖X1−X2‖= 1,

‖X1×X3‖

‖X1−X3‖= 1.34,

‖X2×X3‖

‖X2−X3‖= 1.48.

Hence, the derivative ofn(θ ) cannot vanish and the mini-mum f-number is necessarily reached forθ ∗ = 0.025002.

We can confirm this by considering the graph ofn(θ )depicted on Figure 10. In the zone of interest, the functionn(θ ) is almost piecewise affine. For each point in the interiorof curved segments of the graph, the value ofθ is such thatthe contact ofX with the limiting planes is of typeViVj .Clearly, the derivative ofn(θ ) does not vanish. The possibleoptimal values ofθ , corresponding to contacts of typeEi jVk,are the abscissa of angular points of the graph, marked with

(a)

(b)

Fig. 10 Example 1 graph ofn(θ ) for θ ∈ [−0.6,0.6] (a) andθ ∈[0,0.06] (b). Labels give the different types of contact.

Contact θ n(θ )E12V3 0.185269 29.49E23V1 0.100419 83.67E13V2 0.235825 47.04

Table 2 Value ofθ for each possible optimal contact and correspond-ing f-numbern(θ ) for Example 2.

red dots. The graph confirms that the minimal value ofn(θ )is reached for contactE12V3.

The minimal f-number is equal ton(θ ∗)= 7.16. By com-parison, the f-number without tilt optimization isn(0) =28.74. This example highlights the important gain in termsof f-number reduction with the optimized tilt angle.

Example 2 We consider the same lens and confusion cir-cle as in Example 1 (f = 5.10−2m, c = 3.10−5m) but thevertices have coordinates

X1 =

0−0.10.12

, X2 =

00

0.19

, X3 =

0−0.0525

0.17

.

The object is almost ten times smaller than the object of theprevious example (it has the size of a small pen), but it is

Page 11: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

Smart depth of field optimization applied to a robotised viewcamera 11

(a)

(b)

Fig. 11 Example 2 graph ofn(θ ) for θ ∈ [−0.6,0.6] (a) andθ ∈ [0,0.3](b). Labels give the different types of contact.

also ten times closer: this is a typical close up configuration.The values ofθ andn(θ ) associated to contacts of typeEi jVk

are given in Table 2 which shows that contactE13V2 seemsto give the minimum f-number. We have

‖X1×X2‖

‖X1−X2‖= 0.16,

‖X1×X3‖

‖X1−X3‖= 0.16,

‖X2×X3‖

‖X2−X3‖= 0.1775527,

showing that condition (15) is still verified, even if the val-ues are smaller than the values of Example 1. Hence, thederivative ofn(θ ) cannot vanish and the minimum f-numberis reached forθ ∗ = 0.185269.

We can confirm this by considering the graph ofn(θ )depicted on Figure 11. As in Example 1, the derivative ofn(θ ) does not vanish and the graph confirms that the mini-mal value ofn(θ ) is reached for contactE12V3.

The minimal f-number is equal ton(θ ∗) = 29.49. Bycomparison, the f-number without tilt optimization isn(0)=193.79. Such a large value gives an aperture of diameter0.26mm, almost equivalent to a pin hole ! Since the max-imum f-number of view camera lenses is never larger than64, the object cannot be in focus without using tilt.

(a)

(b)

Fig. 12 Example 3 graphs ofn(θ ) for θ ∈ [−1,1].

This example also shows that Proposition 2 is still valideven if the object is close to the lens and the obtained opti-mal tilt angle 0.185269 (10.61 degrees) is large.

Example 3 In this example we consider an extremely flattriangle which is almost aligned with the optical center. Fromthe photographer’s point of view, this is an unrealistic case.We consider the same optical parameters as before and con-sider the following vertices

X1 =

001

, X2 =

0h

1.5

, X3 =

0−h

2

,

for h= 0.01 and we have

‖X1×X2‖

‖X1−X2‖= 0.02,

‖X1×X3‖

‖X1−X3‖= 0.01,

‖X2×X3‖

‖X2−X3‖= 0.07,

hence condition (15) is violated in configurationsV1V2 andV1V3. Since this condition is sufficient, the minimum valueof n(θ ) could still occur for a contact of typeEi jVk. How-ever, we can see in Figure 12a thatn(θ ) has a minimum at adifferentiable point in configurationV1V3.

Page 12: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

12 Stephane Mottelet et al.

Remark 7Condition (15) is not necessary: in the proof ofProposition 2 (given in Appendix A.3), it can be seen that(15) is a condition ensuring that the polynomialp(θ ) de-fined by equation (25) has no root in[−π/2,π/2]. However,the relevant interval is smaller becauseXi1 andXi2 do notstay in contact with the limiting planes for all values ofθ in[−π/2,π/2], and because all vertices must be in front of thefocal plane. Anyway, it is always possible to construct ab-solutely unrealistic configurations. For example, when weconsider the above vertices withh= 0.005, then no edge isin contact with the limiting planes and verticesX1 andX3

stay in contact with the limiting planes for all admissiblevalues ofθ . The corresponding graph ofn(θ ) is given inFigure 12b.

3.4 Depth of field optimization with respect to tilt andswing angles

As in the previous section, we consider the case of a thinlens and where the optical and sensor centers coincide re-spectively with the front and rear standard rotation centers.Without loss of generality, we consider that the sensor planehas the normalnS = (0,0,1)⊤. The lens plane is given by

LP={

X ∈ R3, X⊤nL = 0

},

where

nL = (−sinφ cosθ ,−sinθ ,cosφ cosθ )⊤.

A parametric equation of HL is given by

HL ={

X ∈R3, ∃ t ∈ R, X = W(θ ,φ)+ tV(θ ,φ)

},

where the direction vector is given by

V(θ ,φ) = nL ×nS = (−sinθ ,sinφ cosθ ,0)⊤,

andW(θ ,φ) is the coordinate vector of a particular pointW(θ ,φ) on HL, obtained as the minimum norm solution of

W(θ )⊤nS = 0,

W(θ )⊤nL = f .

Consider, as depicted in Figure 7, the two planes of sharpfocus SFP1 and SFP2 intersecting at HL, with normalsn1

andn1 respectively. The pointW(θ ,φ) belongs to SFP1 andSFP2 and any direction vector of SFP1∩SFP2 is collinear toV(θ ,φ). Hence, we have

SFP1 ={

X ∈ R3, (X −W(θ ,φ))⊤n1 = 0

},

SFP2 ={

X ∈ R3, (X −W(θ ,φ))⊤n2 = 0

},

and(n1×n2)×V(θ ,φ) = 0. (18)

Fig. 13 Position of the hinge line when both tilt and swing are usedandnS = (0,0,1)⊤. The LP and FFP planes have not been representedfor reasons of readability.

Using equation (7) the f-number is equal to

N(θ ,φ ,n1,n2) =fc

∣∣∣∣∣(U1−U2)

⊤nS

(U1+U2)⊤nS

∣∣∣∣∣ , (19)

where each coordinate vectorUi of pointU i, for i = 1,2, isobtained as a particular solution of the following system:

Ui⊤nL = 0,

Ui⊤ni = W(θ ,φ)⊤ni .

Remark 8 When nS = (0,0,1)⊤ the intersections of HLwith the (L,X1) and the(L,X2) axes can be determined, asdepicted in Figure 13. In this case, it is easy to show that thecoordinates of the minimum normW(θ ,φ) are given by

W(θ ,φ) =−f

sin2 φ cos2 θ + sin2 θ(sinφ cosθ ,sinθ ,0)⊤.

We note that up to a rotation of axis(0,0,1)⊤ and angleα,we recover a configuration where only a tilt angleψ is used,where these two angles are respectively defined by

sinψ = signθ√

sin2 φ cos2 θ + sin2 θ ,

sinα =sinφ cosθ

sinψ.

Page 13: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

Smart depth of field optimization applied to a robotised viewcamera 13

3.4.1 Optimization problem

Consider a set 4 non coplanar pointsX = {Xi}i=1...4, whichhave to be within the depth of field region with minimal f-number and denote by{X i}i=1...4 their respective coordinatevectors. The optimization problem can be stated as follows:find

(θ ∗,φ∗,n1∗,n2∗) = arg minθ ,φ ,n1,n2

N(θ ,φ ,n1,n2), (20)

where the minimum is taken forθ ,φ ,n1 andn2 such thatequation (18) is verified and such that the points{Xi}i=1...4

lie between SFP1 and SFP2. This last set of constraints canbe expressed in a way similar to equations (12)-(13).

3.4.2 Analysis of configurations

Consider the functionn(θ ,φ) defined by

n(θ ,φ) = minn1,n2

N(θ ,φ ,n1,n2), (21)

wheren1 andn2 are constrained as in the previous section.Consider the two limiting planes SFP1 and SFP2 with nor-malsn1 andn2 satisfying the minimum in equation (21). Us-ing the rotation argument of Remark 8 we can easily showthat SFP1 and SFP2 are necessary in contact with at leasttwo vertices. However, for each value of the pair(θ ,φ), wehave three types of possible contact between the tetrahedronformed by points{Xi}i=1...4 and the limiting planes: vertex-vertex, edge-vertex, edge-edge or face-vertex. These config-urations can be analyzed as follows: let us consider a pair(θ0,φ0) and the corresponding type of contact:

– Vertex-vertex: each limiting plane is in contact withonly one vertex, respectivelyVi andVj . In this case,n(θ ,φ)is differentiable at(θ0,φ0) and there exists a curveγvv

defined by

γvv(t) = (θ (t),φ(t)), γvv(0) = (θ0,φ0),

such thatddt n(θ (t),φ(t)) exists and does not vanish for

t = 0. This can be proved using again the rotation argu-ment of Remark 8. Hence,n(θ0,φ0) cannot be minimal.

– Edge-vertex: one of the two planes is in contact withedgeEi j and the other one is in contact with vertexVk.In this case there is still a degree of freedom since theplane in contact withEi j can rotate around this edge ineither directions while keeping the other plane in contactwith Vk only. If the plane in contact withEi j is SFP1, itsnormaln1 can be parameterized by using a single scalarparametert and we obtain a family of planes defined by

SFP1(t) ={

X ∈R3, n1(t)

⊤(X −X i) = 0

}.

Contact θ φ n(θ ,φ )E12E34 0.021430 -0.028582 12.35E23E14 0.150568 -0.203694 90.75E13E24 0.030005 -0.020010 8.64F123V4 0 0.100167 88.18F243V1 0.075070 -0.050162 42.91F134V2 0.033340 -0.033358 9.64F124V3 0.018751 -0.012503 10.76

Table 3 Value ofθ andφ for each possible optimal contact and corre-sponding f-numbern(θ ,φ ).

For each value oft, the intersection of SFP1(t)with PSLPdefines a Hinge Line and thus a pair(θ (t),φ(t)) of tiltand swing angles. Hence, there exists a parametric curve

γev(t) = (θ (t),φ(t)), γev(0) = (θ0,φ0), (22)

along whichn(θ ,φ) is differentiable. As we will see inthe numerical results, the curveγev(t) is almost a straightline whenθ andφ are small, andd

dt n(θ ,φ(t)) does notvanish fort = 0.

– Edge-edge: the limiting planes are respectively in con-tact with edgesEi j , Ekl connecting, respectively, verticesVi ,Vj and verticesVk,Vl . There is no degree of freedomleft since these edges cannot be parallel (otherwise allpoints would be coplanar). Hence,n(θ ,φ) is not differ-entiable at (θ0,φ0).

– Face-vertex: the limiting planes are respectively in con-tact with vertexVl and with the faceFi jk connecting ver-ticesVi,Vj ,Vk. As in the previous case, there is no de-gree of freedom left andn(θ ,φ) is not differentiable at(θ0,φ0).

We can already speculate that the first two configura-tions are necessary suboptimal. Consequently we just haveto compute the f-number associated with each one of the 7possible configurations of type edge-edge of face-vertex.

3.4.3 Numerical results

We have considered the flat object of Example 1, translatedin planeX1 = −0.5, and a complimentary point in order toform a tetrahedron. The vertices have coordinates

X1 =

−0.5−1

1

, X2 =

−0.531

,

X3 =

−0.50

1.5

,X4 =

11

1.5

.

All configurations of type edge-edge and face-vertex havebeen considered and the corresponding values ofθ ,φ andn(θ ,φ) are given in Table 3. TheE13E24 contact seems togive the minimum f-number. Figure 14 gives the graph of

Page 14: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

14 Stephane Mottelet et al.

Fig. 14 Graph of n(θ ,φ ) for (θ ,φ ) ∈ [−0.175,0.225] ×[−0.3225,0.2775].

Fig. 15 Level curves ofn(θ ,φ ) and types of contact for(θ ,φ ) ∈[−0.175,0.225]× [−0.3225,0.2775].

Fig. 16 Level curves and types of ofn(θ ,φ ) contact for (θ ,φ ) ∈[−0.015,0.035]× [−0.0375,−0.0075].

n(θ ,φ) and its level curves in the vicinity of the minimumare depicted in Figures 15 and 16. In the interior of each dif-ferent shaded region, the(θ ,φ) pair is such that the contactof X with the limiting planes is of typeViVj . The possi-ble optimal(θ ,φ) pairs, corresponding to contacts of typeEi j Ekl of Fi jkVl , are marked with red dots. Notice that thegraph ofn(θ ,φ) is almost polyhedral, i.e. in the interior ofregions of typeViVj , the gradient is almost constant and doesnot vanish, as seen on the level curves. If confirms that theminimum cannot occur in these regions, as announced inSection 3.4.2.

The frontiers between regions of typeViVj are curvescorresponding to contacts of typeEi jVk and defined by Equa-tion (22). The extremities of these curves are(θ ,φ) pairscorresponding to contacts of typeEi j Ekl or Fi jkVl . For ex-ample, in Figure 16, the(θ ,φ) pairs on the curve separatingV2V3 andV3V4 regions correspond to theE24V3 contact. Theextremities of this curve are the two(θ ,φ) pairs correspond-ing to contactsF124V3 andE13E24. Along this curve,n(θ ,φ)is strictly monotone as shown by its level curves.

Finally, the convergence of its level curves in Figure 16confirms that the minimum ofn(θ ,φ) is reached for theE13E24 contact. Hence, the optimal angles are(θ ∗,φ∗) =(0.030005,−0.020010) and the minimal f-number is equalto n(θ ∗,φ∗) = 8.64. By comparison, the f-number withouttilt and swing optimization isn(0,0) = 28.74. This exam-ple highlights again the important gain in terms of f-numberreduction with the optimized tilt and swing angles. In our ex-perience, the optimal configuration for general polyhedronscan be of type edge-edge or face-vertex.

4 Trends and conclusion

In this paper, we have given the optimal solution of the mostchallenging issue in view camera photography: bring an ob-ject of arbitrary shape into focus and at the same time mini-mize the f-number. This problem takes the form of a contin-uous optimization problem where the objective function (thef-number) and the constraints are non-linear with respect tothe design variables. When the object is a convex polyhe-dron, we have shown that this optimization problem doesnot need to be solved by classical methods. Under realis-tic hypotheses, the optimal solution always occurs when themaximum number of constraints are saturated. Such a situa-tion corresponds to a small number of configurations (sevenwhen the object is a tetrahedron). Hence, the exact solutionis found by comparing the value of the f-number for eachconfiguration.

The linear algebra framework allowed us to efficientlyimplement the algorithms in a numerical computer algebrasoftware. The camera software is able to interact with a robo-tised view camera prototype, which is actually used by ourpartner photographer. With the robotised camera, the time

Page 15: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

Smart depth of field optimization applied to a robotised viewcamera 15

Fig. 17 Construction of four approximate intersections of cones withSP

elapsed in the focusing process is often orders of magnitudesmaller than the systematic trial and error technique.

The client/server architecture of the software allows usto rapidly develop new problem solvers by validating themfirst on a virtual camera before implementing them on theprototype. We are currently working on the fine calibrationof some extrinsic parameters of the camera, in order to im-prove the precision of the acquisition of 3D points of theobject.

Acknowledgements This work has been partly funded by the Innova-tion and Technological Transfer Center of Region Ile de France.

A Appendix

A.1 Computation of the depth of field region

In order to explain the kind of approximation used, we have repre-sented in Figure 17 the geometric construction of the image space lim-its corresponding to the depth of field region. Let us consider the coneswhose base is the pupil and having an intersection with SP of diameterc. The image space limits are the locus of the vertex of such cones.The key point, suggested in [1] and [2], is the way the diameter of theintersection is measured.

For a given lineD passing throughL and a circleC of centerL inLP let us callK (C ,D) the set of cones with directrixD and baseC .For a given directrixD let us callA its intersection withSP, as depictedin Figure 18a. Instead of considering the intersection of cones of direc-trix D with SP, we consider their intersections with the plane passingthroughA and parallel to LP. By construction, all intersections are cir-

(a)

(b)

Fig. 18 (a) close-up of a particular intersection exhibiting the verticesof cones for a given directrixD . (b) geometrical construction allowingto derive the depth of field formula.

Page 16: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

16 Stephane Mottelet et al.

cles, and there exists only two conesK1 andK2 in K (C ,D) such thatthis intersection has a diameter equal toc, with their respective verticesA1,A2 on each side of SP, respectively marked in Figure 18a by a redand a green spot. Moreover, for all cones inK (C ,D) only those witha vertex lying on the segment[A1,A2] have an ”approximate” intersec-tion of diameter less thatc.

The classical laws of homothety show that for any directrixD , thelocus of the vertices of conesK1 andK2 will be on two parallel planeslocated in front of and behind SP, as illustrated by a red and agreenframe in Figure 17a. Hence, the depth of field region in the object spaceis the reciprocal image of the region between parallel planes SP1 andSP2 as depicted in Figure 7.

Formulas (5) and (6) are obtained by considering the directrix thatis orthogonal to LP, as depicted in Figure 18b. If we notep = AL,p1 = A1L, p2 = A2L, by considering similar triangles, we have

p1− pp1

=p− p2

p2=

Ncf, (23)

which gives immediately

p=2p1p2

p1+ p2,

and by substitutingp in (23), we obtain

p1− p2

p1+ p2=

Ncf,

which allows to obtain (5).

A.2 Proof of Proposition 1

Without loss of generality, we consider that the optimalθ is positive.Suppose now that only one constraint is active in (12). Then there exists

i1 such that(X i1 −W)⊤n1 = 0 and the first order optimality condition

is verified: if we define

g(a,θ ) =−(X i −W(θ ))⊤n1 = Xi12 −a1Xi1

3 +f

sinθ,

there existsλ1 ≥ 0 such that the Kuhn and Tucker condition

∇N(a,θ )+λ1∇g(a,θ ) = 0,

is verified. Hence, we have

2(2cotθ − (a1+a2))2

cotθ −a2−cotθ +a1

a1−a2sin2 θ

+λ1

−Xi13

0− cosθ

sin2 θ

,

and necessarily,a1 = cotθ so thatN(a,θ ) reaches its upper bound andthus is not minimal. We obtain the same contradiction when only aconstraint in (13) is active, or only two constraints in (12), or only twoconstraints in (13). ⊓⊔

A.3 Proof of Proposition 2

Without loss of generality we suppose thatθ ≥ 0. Suppose that theminimum ofN(a,θ ) is reached with only verticesi1 andi2 respectivelyin contact with limiting planes SFP1 and SFP2. The values ofa1 anda2 can be determined as the following functions ofθ

a1(θ ) =Xi1

2 + fsinθ

Xi13

, a1(θ ) =Xi2

2 + fsinθ

Xi23

,

and straightforward computations give

N(a(θ ),θ ) =

(X

i12

Xi13

−X

i22

Xi23

)sinθ +

(f

Xi13

− f

Xi23

)

2cosθ −

(X

i12

Xi13

+X

i22

Xi23

)sinθ −

(f

Xi13

+ f

Xi23

)(

fc

).

(24)In order to prove the result, we just have to check that the derivativeof N(a(θ ),θ ) with respect toθ cannot vanish forθ ∈ [0, π

2 ]. The totalderivative ofN(a(θ ),θ )) with respect toθ is given by

ddθ

N(a(θ ),θ ) =

2

(X

i12

Xi13

−X

i22

Xi23

)− f

(X

i12 −X

i22

Xi13 X

i23

)cosθ +

(f

Xi13

− f

Xi23

)sinθ

(2cosθ −

(X

i12

Xi13

+X

i22

Xi23

)sinθ −

(f

Xi13

+ f

Xi23

))2

(fc

)

and its numerator is proportional to the trigonometrical polynomial

p(θ ) = b0+b1 cosθ +b2 sinθ , (25)

whereb0 = Xi12 Xi2

3 −Xi22 Xi1

3 , b1 =− f(

Xi22 −Xi1

2

), b2 = f (Xi2

3 −Xi13 ).

It can be easily shown by using the Schwartz inequality thatp(θ ) doesnot vanish provided that

b20 > b2

1+b22. (26)

SinceXi21 =Xi1

1 = 0, whe haveb20 = ‖Xi1

1 ×Xi11 ‖2 andb2

1+b22 = f 2‖Xi1

1 −

Xi11 ‖2. Hence (26) is equivalent to condition (15), this ends the proof.

⊓⊔

A.4 Depth of field region approximation used by A.Merklinger

In his book ([4], Chapter 7) A. Merklinger has proposed the followingapproximation based on the assumption of distant objects and small tiltangles: ifh is the distance from SFP1 to SFP2, measured in a directionparallel to the sensor plane at distancez from the lens plane, as depictedin Figure 19, we have

h2z

≈f

H sinθ, (27)

whereH is the hyperfocal distance(for a definition see [5] p. 221),related to the f-numberN by the formula

H =f 2

Nc,

and c is the diameter of the circle of confusion. Using (27), the f-numberN can be approximated by

N = sinθh2z

fc.

Since the slopes of SFP1 and SFP2 are respectively given bya1 anda2,we have

hz= a1−a2,

and we obtain immediately

N = (a1−a2)sinθ(

f2c

),

which is the same as (16).

Page 17: arXiv:1102.0048v2 [math.OC] 18 Apr 2011 · Fig. 3 Graphical construction of the image A of an object point X in the optical coordinate system. Green rays and blue rays respectively

Smart depth of field optimization applied to a robotised viewcamera 17

Fig. 19 Depth of field region approximation using the hyperfocal.

References

1. E. Bigler. Depth of field and Scheimpflugrule : a minimalist geometrical approach.http://www.galerie-photo.com/profondeur-de-champ-scheimpflug-english.html,2002.

2. L. Evens. View camera geometry.http://www.math.northwestern.edu/~len/photos/pages/vc.pdf ,2008.

3. L. Larmore. Introduction to Photographic Principles. Dover Pub-lication Inc., New York, 1965.

4. A. Merklinger. Focusing the view camera. Bedford, Nova Scotia,1996.http://www.trenholm.org/hmmerk/FVC161.pdf.

5. S. F. Ray.Applied Photographic Optics. Focal Press, 2002. thirdedition.

6. T. Scheimpflug. Improved Method and Apparatus for the Sys-tematic Alteration or Distortion of Plane Pictures and Images byMeans of Lenses and Mirrors for Photography and for other pur-poses. GB Patent No. 1196, 1904.

7. U. Tillmans. Creative Large Format: Basics and Applications.Sinar AG. Feuerthalen, Switzerland, 1997.

8. R. Wheeler. Notes on view camera geometry, 2003.http://www.bobwheeler.com/photo/ViewCam.pdf .


Recommended