WorksPhysics and Astronomy
A complete forward projection algorithm through cylindrical and spherical refractive windows
Abstract
Cylindrical or spherical windows often appear in experiments and real applications. Measuring through those windows requires projecting 3D points to pixels, which is different to compute due to refraction. A point may have multiple projected images but cannot be efficiently determine with the existing projection algorithms. Using the ray's conserved momenta, we reduce this projection to closed-form equations with a concave structure. As a result, we can successfully determine whether a 3D point has a single projection or multiple and compute those locations. In simulations, with one single search, we can recover images that iterative methods miss even with many restarts. A wand calibration based on it can reach the precision limit set by image noise, enabling accurate 3D particle tracking in a swirling flow through cylinder windows. This algorithm shows how to predict visibility and multiple images through curved windows, shedding light for 3D pipe flow measurements, accurate underwater reconstruction, and many real applications.
Introduction
Many optical measurements need to look through a curved transparent wall or interface. Flow velocimetry is performed inside pipes [1, 2, 3], cylindrical tanks [4, 5], Taylor–Couette cells [6], and even in droplets [7]. People also track fish in cylindrical aquaculture tanks to study schooling [8]. In combustion, flames are reconstructed inside the glass cylinders [9], and optical engines [10, 11]. Sometimes the window is made curved to sustain high pressure: underwater cameras usually sit in pressure housings or dome port [12, 13], which has spherical windows [13, 14, 15].
Refraction through a curved wall bends the lines of sight, which distorts the images of objects inside a cylinder, and some can be hidden or seen more than once [1, 5]. As shown in Figure 1(a) and (b), the simulated dot plate image is stretched horizontally after putting into a water-filled acrylic cylinder. The outmost columns disappear through the refraction, while the next columns have two projected images. To avoid such refraction effects, matching refraction index of the fluid is often used [2, 5]. However, constrains the fluid is practically impossible in gases [5], or in a large scale cylindrical fish tank [8]. Therefore, we need to develop a complete forward projection algorithms of any 3-D point through the curved wall. Only with that, camera calibration [16, 17], and the stereo matching between cameras [18, 19] are possible.
Figure 1. Simulated projection of a 27 × 5 dot target through the reference cylindrical window: air–acrylic–water with indices (1, 1.49, 1.33) and outer/inner radii (100, 94) mm. The pinhole and target plane lie 350 mm and 65 mm from the axis on opposite sides; dots are spaced 5 mm laterally and 10 mm axially. (a)–(b) Simulated camera images of the target, held by a rod, in air and inside the water-filled cylinder, rendered by tracing each pixel’s ray with vector Snell’s law. (c) Top view at : hatched and dotted regions are reached by zero and two rays, respectively; solid and dashed rays connect the marked dot to the pinhole. (d) Target dots classified by image count: 10 have no image, 105 have one, and 20 have two. (e) Computed image in normalised coordinates: arcs link paired images, vertical lines mark the cylinder edges, and circles identify the two images of . Every computed ray was confirmed by vector-Snell tracing.
Forward projection through flat interfaces is well understood, where all interfaces share one normal and the projection can be reduced to closed-form equations. For one window, Agrawal et al. expressed forward projection as a fourth- or twelfth-degree polynomial equation [20]. Later, Gu et al. reduced multilayer projection to one monotone equation [21], by using the property that the shared normal also keeps the ray’s tangential momentum constant across layers. In addition to these closed-form algorithms, virtual-camera models offer another representation of flat window imaging [22, 23].
However, curved interfaces is much harder because their normals vary along the interfaces and the symmetric properties of flat-window cannot transfer directly. For outward-looking underwater dome cameras, Kunz and Singh modeled projection numerically [12], while She et al. derived a {sup}th-degree equation for a thin dome and used iterative projection for a thick dome [14].
In planar-wall and cylindrical-tank calibration, Belden alternated forward and backward ray traces [4]. Paolillo and Astarita used iterative dewarping for complex geometries, including a cylindrical tank [5]. A polynomial equation can yield several roots, some of which may not describe rays that can pass through the interfaces. By contrast, an iteration started from one guess returns at most one candidate ray.
The differences in output matter when a point is reached by no ray or by several. Paolillo and Astarita showed numerically that both cases occur for a water-filled PMMA cylinder viewed from air [5]. A search started from one guess may find only one of several rays, while a failed search cannot guarantee that no ray exists. To the best of our knowledge, prior work has neither characterised visibility and image count nor provided a search for every image through the inward-looking multilayer cylinders and spheres considered here.
The illustration of the visible regions, single and multi image regions of a dot target is shown in Figure 1. Figure 1(c) shows a top view of the cylindrical window. The hatched regions cannot be reached by a ray, while the dotted blue regions can be reached by two rays. To demostrate the effects of different regions, we simulate a 135-dot target as shown in Figure 1(d). The cross symbol means no image, the filled circle means one image, and the triangle means two images. In the projected pattern shown in Figure 1(e), the outermost columns therefore disappear, while the doubly imaged dots produce additional images near the cylinder edges. A solver that returns only one ray misses these additional images, while failed convergence alone cannot guarantee the invisible dots. This distinction matters when matching detections to 3D points or selecting observations for calibration.
In this paper, we consider cameras outside coaxial cylindrical or concentric spherical windows, looking at points inside. A ray keeps two quantities as it crosses the windows: its angular momentum about the axis and its momentum along the axis, and only one angular momentum is needed for spherical windows due to symmetry [24]. These conserved quantities are classical and also used for optical fibres and seismic rays [25, 26]. With them, a ray can be described by two numbers instead of guessing a full path by iterations. Based on them, closed form equations can be derived by constraints of how far it turns around the axis and advances along the axis [27]. The main contributions of this paper are:
Complete solution to forward projection. We derive closed-form ray equations for multilayer cylinders and spheres, and develop a forward projection algorithm. This algorithm can return the complete list of a point’s images, including an empty if it is invisible. It is implemented in
C++for OpenLPT library [19, 28], and the code is available at https://github.com/clockj/pyOpenLPT-refraction.
visibility region maps. Based on the forward projection algorithm, we can find the region maps for empty, single and multi images like Figure 1(c). So people can focus on the single image region for calibration.
Calibration and tracking methods. A wand calibration method is developed without the need of dot plates, enabling the calibration in complicated experimental setup. We also show the ability for Lagrangian particle tracking through a cylinder wall for swirling flow.
The structure of the paper is listed as follows. Sections 2 and 3 explain the geometry and flat-window reference. Then Sections 4 and 5 show the derivation of the curved-window equations and near-branch solver. Section 6 analyzes visibility and image count, followed by the summary of algorithm in Section 7. The special case of spherical windows is discussed in Section 8. Finally, Section 9 presents a wand calibration built on the projection and validates both through synthetic tests and one real experiment, and Section 10 shows the conclusion.
Geometry and conserved quantities
Setup and notation
Suppose we want to measure the flow inside a transparent pipe or to calibrate a camera behind a dome window. As shown in Figure 2, a point in the field of view, , can be projected through coaxial circular-cylindrical or concentric spherical interfaces onto the camera focal plane through the pinhole point, .
Figure 2. Ray geometry for three media separated by interfaces : medium 1 contains the pinhole , medium 2 is the wall, and medium 3 contains the object point . (a) Coaxial cylinders. The interface normal is radial, while and are tangential directions. The skew ray conserves and , where . (b) Concentric spheres. The conserved vector is normal to the ray plane ; is the central angle between and .
Here, medium 1 contains the pinhole , medium contains the object point , and medium with refractive index has range ( is the radial distance to the central axis of cylinder or center of sphere). are the interface radii, and and are the radial coordinates of and (Figure A1 in Appendix § 12). Table 1 collects the recurring notation; quantities used only in individual steps are defined where they arise. Unless stated otherwise, numerical examples use a reference window: a water-filled acrylic cylinder viewed from air, with interface radii mm, refractive indices , and pinhole distance mm from the axis. The object radius varies between examples.
| Symbol | Meaning |
| pinhole and object point | |
| number of media, medium index, and refractive index of medium | |
| radial, azimuthal, and axial coordinates; radius bounding medium () | |
| radial coordinates of the pinhole and object point | |
| azimuthal separation and axial offset from to | |
| unit ray direction and its azimuthal and axial components | |
| conserved angular and axial momenta for a cylinder | |
| effective transverse index and impact parameter in medium | |
| azimuthal sweep, transverse chord length, and axial travel in medium | |
| limiting angular momentum and the medium setting that limit | |
| total azimuthal sweep on the near and far branches | |
| total axial travel on the near and far branches | |
| sweep and axial travel of whichever branch is being solved | |
| branch functions whose negative gradients give | |
| Jacobian of with respect to | |
| object radius at which the limiting medium changes, at fixed | |
| radial-ray axial travel, maximum feasible tilt, and onset tilt for sweeps beyond | |
| angle to the normal, normal thickness, lateral travel in medium , and total lateral offset (flat window only) |
Table 1. Principal notation. Unless stated, ray quantities refer to the cylindrical geometry.
Figure A1. Index convention, drawn for the same four-medium stack in all three geometries. (a) Flat plates: medium has thickness along the normal, and and are measured from the pinhole and the object point to the nearest interface. (b) Coaxial cylinders and (c) concentric spheres: medium lies between the radii and . Solid lines are physical interfaces; dashed lines are not. In (b) and (c) the dashed circles carry and , which enter the formulas exactly like interface radii but are only where the ray starts and ends. With media there are interfaces and solid walls, yet five radii appear in the sums.
Conserved quantities
Forward projection is equivalently solving which ray direction from reaches after refraction. The ray direction has two angular degrees of freedom, but the interface geometry may fix the plane of the ray and leave only one unknown. For the remaining freedom(s), we can use conserved quantities as parameters.
At an interface with unit normal , vector Snell’s law states that the tangential part of is continuous:
where and label the media on either side and are the corresponding unit ray directions. Equivalently,
so refraction changes only in the normal direction. Along a straight segment in a homogeneous medium, both and are constant.
For parallel flat interfaces, the normal has the same direction everywhere, so the tangential part of is conserved as a vector. It points along the known lateral displacement from to . The only unknown is its magnitude , where is the angle to the normal direction. This is therefore the single unknown used in Section 3.
For coaxial cylinders, the normal is radial, with as the azimuth angle. The axial direction is tangent to every interface, so (1) conserves . The azimuthal direction also lies in the tangent plane, but changes with . Thus, the quantity conserved along the whole ray is instead the component of , where is any point on the ray (in cylindrical coordinates). The reason is that when crossing an interface, is radial, so its cross product with has no component. In summary, the two conserved scalars are
named as the axial momentum and the angular momentum about the axis. The scalar is the component along the local azimuthal direction drawn in Figure 2(a), where . Since a cylindrical ray can advance both around and along the axis, projection must solve for both and to match the axial and azimuthal offsets of .
For concentric spheres, two unknowns in the cylinders’ case are reduced to one because the rays stay in a fixed plane. At each spherical interface, the normal is parallel to . The entire vector is conserved based on Eq. (2), which is normal to the plane that , and lie in. Therefore, we only need to solve for the magnitude , where is the angle between and . This is also known as the Bouguer’s invariant [24].
In summary, forward projection requires one scalar for a flat window, two for a cylinder, and one for a sphere. The conserved momenta themselves are classical results of Hamiltonian optics [24]. They also describe skew rays in circular optical fibres [25] and rays in a spherically layered Earth [26]. Our contribution is the forward projection algorithm and visibility analysis built from them.
Flat windows in invariant form
To the best of our knowledge, there are two papers deriving the closed-form equations for the forward projection through refractive flat windows. The first paper, from Agrawal et al. [20], showed that the forward projection through a flat window is a root of a polynomial, of degree 12 for a thick window between air and water. Then, Gu et al. replaced the polynomial by a single equation with one unknown, which can be solved by Newton’s method in only 4–5 iterations [21]. Here we restate their equation in terms of the invariant of Section 2.2.
Suppose there are media, as shown in Figure A1(a), and is the thickness of medium () along the normal direction, the lateral travel in medium is . Note that and are the distances from the pinhole or the object point to the nearest interface. With as the major variable, the forward projection solves
where is the lateral offset between the pinhole and the point. By replacing and , the above equation is the same as the equation showed in [21]. As Gu et al. noted, the root to this equation must exist and be unique. The reason is that: each term of increases with , due to ; , and as , so every is reached by exactly one ray.
To extend the flat-window uniqueness argument to the two unknowns of a cylindrical window, we first express the projection equation as a derivative of one scalar, , defined as
Each term of is the layer thickness multiplied by the normal component of the ray momentum. Since , its strict concavity is the monotonicity that made the flat-window solution unique.
For a cylindrical window, each trial pair predicts how far the ray turns around the axis and advances along it. Forward projection solves for the pairs that match the offsets from to . Changing or can also change the axial advance or the azimuthal sweep. It means that knowing the properties of or along do not guarantee a unique solution. However, strict concavity of on the convex domain of momentum pairs that can reach the object’s radius ensures that two different pairs cannot produce the same offsets. As shown in § 5, a near-branch ray is therefore unique whenever it exists. In the following, we first derive the cylindrical projection equations and show how both offsets follow from the corresponding scalar function in § 4, and then use the concavity of to establish near-branch uniqueness in § 5. Finally, we check the properties of the far branch, where multiple rays can occur, in § 6.
Closed-form projection equations
In this section, we derive the projection equations for coaxial cylinders. § 8 simplifies them to spheres. The derivation is based on the invariants of Eq. (3) and elementary geometry, and it ends up with two closed-form equations for .
Propagation through one medium
In medium , the axial component of is , so the transverse part of has length , with
which requires . If we project the ray onto a plane , the ray in medium is still a straight line, and we can define the distance between the central axis and the ray as . For example, in Figure 3(a), is the distance between the ray in medium 2 and the axis point . , named as the impact parameter in medium , can be derived as
Figure 3. Transverse geometry of a cylindrical ray (schematic). (a) In medium 2, the chord from to has impact parameter , where is its angle to the inward radius at . Its length and azimuthal sweep are and . (b) At fixed , the ray meets the object circle at on its inward leg and at after closest approach (dotted circle, radius ). The corresponding sweeps from are and .
where is the radial distance of a point on the ray within medium , and is the angle between the transverse direction and the inward radial direction.
As shown in Figure 3(a), the ray travelling in medium 2 changes its azimuth angle as . For a general azimuth angle change in medium , travelling from to , we have
, and the axial change is calculated as
where is the transverse chord length in medium .
Admissible domain for
In this part, we want to discuss the requirements for a ray that can cross the interface between media and . The first requirement is that its transverse radial distance must be smaller than , otherwise the ray cannot reach the interface. It means , i.e. . By applying this to every medium, we can get the following requirement
where and is the medium that reaches the minimum.
The second requirement is that the ray must not be total reflected. It means that , where is the incident angle onto the tangent plane of the cylindrical interface. Then, we can get
Note that Eq. (11) already satisfies the total reflection criterion, since . In summary, reaching the next radius sets the admissible domain of , and the total reflection imposes no additional restriction. This differs from the flat window, where total reflection is the main constraint (§ 3).
Two branches
When the ray travelling through the media, its transverse radial distance monotonically decreases (), except in the last medium where lies in. In the last medium , it may pass its closest point to the axis, at , and meet the circle a second time on its way out, as shown in Figure 3(b). We name the two cases as: (1) the near branch, where the ray reaches before its closest point; (2) the far branch, where the ray reaches afterwards.
By summing Eq. (8) over the media, we can get the expression of the total azimuth sweep, from to , for each branch as
with and . Summing Eq. (10) gives the axial offset on the near branch. On the far branch, the ray travels from to its closest approach and back, adding an axial offset in medium :
In the projection equations below, denotes or for the branch being solved. Projecting means solving
on each branch, where is the azimuth angle between the projections of and on the transverse plane. The restriction to assumes that no ray sweeps more than before it reaches , but that could still happen and the method to handle that scenario will be discussed in § 6.3.
Scalar function representation
On each branch, the azimuthal sweep and axial offset can be represented as derivatives of one scalar function. For the near branch, we can define
whose integrand is the radial component of the ray momentum. It is the analogue of Eq. (5), by replacing each layer thickness with an integral over the radial extent of medium . For the far branch, the ray passes the turning point and returns to . Since the extra radial interval is traversed twice, it gives
The negative derivatives of these functions then give the ray’s azimuthal sweep and axial offset on each branch:
Because both ray offsets come from the same branch-specific function, their responses to the two momenta are linked. The sensitivity of the azimuthal sweep to equals the sensitivity of the axial offset to , so the Jacobian is symmetric:
where . The above equation will also be used in § 6.2 to determine how the axial offset changes with tilt at a fixed azimuth.
Map from to pixel
Once is found, Eq. (3) gives two components of the ray direction at the pinhole:
where is chosen with a negative sign, because we want to select a ray that initially travels inward from . The full direction of the ray through is therefore . The regular pinhole model then maps the direction to a pixel, where the camera intrinsic and extrinsic parameters are needed.
The near-branch solver
In Section 4, we reduce the cylindrical projection problem to solving for . In this section, we focus on the near-branch projection. First, we will prove that the solution is unique whenever it exists, and then describe how to solve for it within the admissible domain.
Uniqueness of near-branch projection
Each point on the surface in Figure 4 represents a ray launched from the pinhole: sets its azimuthal component and its axial component. By Eq. (21), the negatives of the surface slopes along and equal the ray’s total azimuthal sweep and axial offset. The target offsets therefore specify the slopes of a tangent plane. Because the near-branch surface bends downward in every direction, at most one momentum pair can have those slopes. Two properties, as shown below, make this argument precise: the momentum pairs of near-branch rays form a convex domain, and the surface bends downward everywhere in that domain.
Figure 4. Near-branch action for the reference cylindrical window at mm. The pale plane is tangent at the marked momentum pair. Its slopes are along and along ; for a ray reaching the target, these equal and . Strict concavity permits at most one tangent point with the target’s slopes. and are in millimetres; is dimensionless.
First, we show that the admissible domain is convex. From Section 4.2, a ray can reach the radius only if . Since , the admissible domain for momentum pairs of near-branch rays can be defined as
with . Each of the conditions describes the inside of an ellipse in the plane. Therefore, is convex: a straight segment between two points inside an ellipse stays inside it, so a segment between two points of stays inside all ellipses.
Second, we show that bends downward everywhere (concavity) in . At a fixed radius in medium , the integrand of Eq. (19) is the radial component of the ray momentum, , where and . Its Hessian with respect to , , is negative definite, because is positive definite and , since throughout medium . Integrating over the radial extent of each medium and summing over the media keeps the Hessian negative definite, so is strictly concave everywhere in , as shown in Figure 4.
Together, these two properties give the uniqueness: along the straight segment joining two different pairs in , the slope of strictly decreases, so the two pairs cannot have the same slopes, i.e. cannot reach the same target as defined by Eq. (21). These properties also make the Jacobian of , , positive definite on . Thus, increases with and , which is used in § 5.2 and § 6.
Newton’s method
Section 5.1 shows that a near-branch solution is unique if it exists. Uniqueness alone does not establish visibility: a Newton iteration started from an arbitrary pair may fail because the target is invisible or because the starting pair is poor. The reach and axial-offset tests in § 6.2 and § 7 determine whether a ray exists and provide a starting pair . Newton’s method then refines both momenta together. Let and define the two projection errors and their Jacobian as
At each iteration, e.g. at iteration , solve for the correction and update both momenta:
In order to keep stay in the admissible domain with , we first try and shorten the step if needed. The Jacobian is positive definite on (Section 5.1), so the Newton correction is well defined there.
Convergence is determined based on the projection errors. To compare the axial error, which has units of length, with the angular error, we divide it by a scale close to . The implementation uses rather than itself. Because division by the power of two introduces no rounding in binary floating point, which matters near grazing incidence where the ray sweep is especially sensitive to small changes in momentum. The residual is then defined as
which will trigger stopping when it falls below the chosen tolerance.
Visibility and multiple images
Section 5 shows that the near-branch equations have at most one solution for a prescribed angular sweep and axial offset. But it does not determine whether that solution exists or whether the far branch provides additional images. In this section, we first find the near branch’s limiting angular sweep and the radius at which the two branches separate, for a fixed tilt . Then we compare the angular ranges of the near and far branches to see which azimuths none of them reach, and which both reach. The folds of the far-branch sweep, where two far-branch rays can reach the same azimuth offset, are also located. Finally, we impose the target’s axial offset and account for rays sweeping beyond to determine visibility and image count in three dimensions.
Angular reach and far-branch folds
In this subsection, we focus on how to determine the reachable target azimuths and how many images (solutions) each target azimuth would have. In order to reach the target azimuth, a ray must first pass every cylindrical interface. At fixed tilt , this requirement limits its angular momentum . Thus, we use that limit to compare the near- and far-branch sweeps, and then account for the target’s axial offset in § 6.2.
As shown in Section 4.2, a ray reaches radius only if , i.e. (). At fixed , the interface radii are fixed while the object radius varies with the target. The limiting value of switches from the object circle to an earlier interface at the critical radius
When , the object circle alone limits with . The near and far sweeps will meet as because the extra far-branch sweep in Eq. (15) vanishes. When , an earlier interface limits , so the two sweeps remain separate at .
For the reference window of § 2.1, Eq. (28) gives mm for rays in the transverse plane ().
Figure 5 shows the comparison between objects at radius mm (inside ) and 85 mm (outside ). In panel (a), the curves of near and far branches meet at the grazing limit. In panel (b), there is an angular range without visible ray, because the outer interface limits and cannot reach . Besides the angular gap, we can also find that the dashed far-branch curve bends back after , which means a horizontal line can cross it twice, i.e. multiple projected images for could coexist.
Figure 5. Azimuthal sweep versus for the reference window at ( mm). Solid and dashed curves denote near and far branches; intersections with a target level give rays to a point in the pinhole plane. (a) At mm , the object circle limits ; the branches meet at grazing and together cover once. (b) At mm , the outer interface limits . The hatched band between the near-branch limit and far-branch minimum is unreachable. The dotted band, between that minimum at and the far-branch endpoint, has two far-branch rays.
To quantify the gap seen in Figure 5(b), we compare the full angular ranges of the two branches. As shown in § 5.1, the near-branch sweep increases with , so its largest value is . When , the far-branch sweep can instead decrease and then increase, reaching its minimum before . If that minimum exceeds , no ray with reaches a target azimuth in the interval
If , the branch ranges meet or overlap, and the angular gap will not appear (Supplement 1, Section S6).
To locate the far-branch minimum in Eq. (29), we examine how each sweep changes with . Differentiation at fixed gives
where
The sum collects the changes in slope at the interfaces. Each bracket is positive when the ray enters a denser medium and vanishes when the refractive indices match. The other terms come from the object and pinhole. If changes from negative to positive, the far-branch sweep reaches a minimum. Rays on either side of that minimum can then reach the same azimuth. As the target radius varies, the minima trace a caustic.
For the example case introduced above, the far-branch sweep decreases throughout its domain when , so the two branches cover once. At mm, the far branch instead has the minimum shown in Figure 5(b). Figure 6 further illustrates the meaning of these sweep limits. In panel (a), near-branch rays grazing the outer wall bound one side of the invisible regions. The minima of the far-branch sweep trace the caustic along their other side. Between the caustic and the outbound grazing rays, two far-branch rays reach the same point in the dotted regions. Panel (b) shows the same boundaries in the plane.
Figure 6. Visibility in the pinhole plane of the reference window (). (a) Transverse view: thin lines are sample rays from , located to the right of the panel; thick lines graze the outer wall at . The dash-dotted caustic separates the hatched no-image lobes from adjacent dotted two-image bands; the dashed circle marks . (b) The same regions in : the near-branch grazing limit (solid) and caustic min (dash-dotted) bound the no-image band; the far-branch grazing limit (dashed) closes the two-image band. At , their azimuthal ranges are – and –, respectively.
Such shadow and multiple-image zones are also observed by Paolillo and Astarita numerically in a PMMA cylinder, with similar air–acrylic–water interfaces [5]. But they did not provide a complete analysis on when and why those regions appear. In the following, we will provide a complete algorithm that can determine different regions.
The behavior in Figure 6 is not determined by alone. Although means that an interface limits , it does not guarantee a fold in or an angular gap: the far branch may remain monotone, and the angular ranges of the two branches may overlap (Supplement 1, Sections S2 and S6). Conversely, a multilayer cylinder can have far-branch folds even when . In such case, two folds might give three far-branch rays to the same point in the pinhole plane (Supplement 1, Section S6). We therefore examine the full far-branch sweep to count the rays reaching each azimuth. Supplement 1, Section S2 gives sufficient conditions for a monotone far branch and bounds for locating all its folds.
Visibility across ray tilts
The above analysis shows the reachable azimuths for a ray at fixed tilt . A 3-D target also has an axial offset , so a ray even with the correct azimuth may still pass above or below it.
Therefore, we must vary and match both offsets. This changes and hence the allowed range of and the angular reach.
For each tilt that reaches the target azimuth, let denote the solution to . When , we can calculate the total derivative of on as
where is the Jacobian of with respect to . Eq. (33) basically means how will the change of affect the axial reach with a given azimuth reach. We will use this total derivative to guide the searching for to satisfy both requirements set by Eq. (18).
On the near branch, we know from § 5.1 that and . Thus, as increases, the axial travel of the ray (already satisfies the azimuth criterion) also increases. Once a continuous range of tilts that reaches is known, we check whether the corresponding axial offsets include . If so, will be found by 1D bisection. To find all such tilts, we test whether the near branch’s grazing-limit sweep satisfies . As varies, the medium that limits may also change. A change is possible only when ( and are indices of distinct media, $1 \le j < k \le N$). Solving this equality gives the candidate switch tilts
The candidate tilts within the physical range divide the search into intervals where the same medium limits . Within each interval, we bound the angular reach and subdivide as needed to identify the tilts that can reach (Supplement 1, Section S3).
The bisection search only works for near branch, because it relies on one value of for each reachable tilt and an axial offset that increases with . For far branch, a fold may exist, which can give multiple values of at the same tilt and target azimuth. Thus, following only one curve could therefore miss some rays. To find every far-branch image, the algorithm in Section 7 searches the two-dimensional domain for pairs that match both target offsets.
Long-way-round rays and image count
The analysis above tests whether a ray can match the target’s azimuthal separation and axial offset . However, a ray may also reach the same point after traveling around the other side of the cylinder. In the transverse view of Figure 7, the far-branch ray sweeps , while marks the shorter angle to the target in the opposite sense of rotation. Other windows can even admit a ray that makes a further full turn, sweeping (Supplement 1, Section S5). We therefore need to decide when to search these additional angular targets.

Figure 7. Long-way-round far-branch ray through the reference window, shown in transverse projection. The solid ray from to sweeps ; the dashed arc marks the shorter target separation in the opposite azimuthal direction, not a second ray. Here and m. Supplement 1, Section S5 shows the full illustration and another example.
The axial offset provides a simple test for long-way-round rays. At fixed tilt, is fixed, and the inward chord in medium grows with its impact parameter . Differentiating Eq. (9) gives
On the far branch, the final chord passes the closest approach before reaching , hence the above inequality is still satisfied:
According to Eq. (10), we can get the range of axial offset magnitude as
Here is the axial travel of the inward radial ray at tilt magnitude , and increases with . To decide whether additional angular targets are needed, we compare the largest sweep of each branch with at the object’s radius . At each tilt, the near branch’s largest sweep is its limit as , while the far branch’s largest sweep may occur at an endpoint or an interior turning point. If neither branch can exceed at any tilt, only needs to be searched.
Otherwise, suppose is the onset tilt for sweeps beyond . The sweep analysis in Supplement 1, Section S5 rules out long-way-round rays at every , so any such ray must have . Eq. (37) then gives , equivalently, the condition
rules out a long-way-round image.
After all relevant angles have been tested, each distinct ray matching both offsets gives one image. The near branch contributes at most one ray per angular target. But the far branch may contribute multiple images due to the fold of , or long-way-round rays when . Different cases of the multiple images are discussed in details in Supplement 1, Section S6. To summarize different scenario mentioned above, the resulting image count maps are plotted in Figure 8. At the same transverse plane as , both invisible and two-image regions exist. When going farther along the cylinder, three-image region also appears and one side of one-image region is due to the long way round rays.
Figure 8. Image count inside the reference window in transverse sections at , 0.4, . . . , 2.0 m from the pinhole plane. Hatching marks no-image regions; the labeled bands have one, two, or three images. Red dashed boundaries mark the onset of long-way-round images. Each section is symmetric about its dotted diameter, the trace of the pinhole–axis plane. Section shapes are to scale, but axial spacing is compressed: 0.4 m is drawn as . Counts include both branches and wrapped angular targets, evaluated on a mm azimuth–radius grid.
These regions show that a point may produce no image or several images. Therefore, the algorithm shown in Section 7 will search for every ray reaching the point and returns the corresponding pixels, or an empty list when no ray exists.
Projection algorithm
In § 6, we show that projecting a point requires finding every ray that matches its angular and axial offsets. The complete solution should include rays on both branches and rays travelling the long way round if exist. In this section, we are going to introduce our closed-form forward projection algorithm, which will provide complete solutions with efficiency.
Our algorithm first bounds the possible pairs, and then use the near branch’s monotonicity or a bounded search on the far branch to locate solutions. Finally, each solution is refined and mapped to a pixel, as outlined in Figure 9.
Figure 9. Forward projection. The solid near-branch lane brackets feasible tilts and bisects the axial offset; the dashed far-branch lane bounds in boxes. Each candidate is refined by Newton’s method, then its signed momenta determine the pinhole direction and pixel. If the wrap test (38) does not exclude longer sweeps, both lanes are repeated for each additional angular target, replacing in the near lane.
In step (1), we express by its radius , azimuthal separation and axial offset from the pinhole. Two cases are handled before the general search. If , the target lies on the cylinder axis, so its azimuth is undefined and any ray reaching it has . If , one possible far-branch ray passes through the cylinder axis in the transverse plane, so and at any tilt. Only its axial travel remains to be matched: we solve the monotone equation for (Supplement 1, Section S4). We add this ray directly to the candidate list because it lies on the boundary of the far-branch search.
Step (2) bounds the momenta before the ray search. At each tilt , Eq. (11) limits to . The medium that sets this limit is , and in Eq. (28) indicates whether the target circle or an earlier interface is limiting. The second bound is set by the target’s axial offset. Let’s first define that satisfies
where is from Eq. (37). Since and increases with tilt, any ray with has , which will miss the target axially. We therefore search only .
Step (2) also selects the azimuthal sweeps to test. A ray may reach the same transverse point through , in the opposite sense through , or after an additional full turn through , , and so on. The list is finite because the sweep on either branch is less than (Supplement 1, Section S5); only targets below need to be considered. To further shorten the list, we can apply the wrap test: if , i.e. (Eq. (38)), no ray within the allowed tilt range sweeps beyond , so only remains. Otherwise, step (3) will check the additional targets against both the angular and axial offsets.
Step (3) searches for rays at each angular target selected in step (2). On the near branch, we first find the tilts that can attain that sweep. In Figure 10(a), the upper plot shows , the largest near-branch sweep at each tilt, where the horizontal dashed line marks the target . The azimuth equation can be satisfied only when the solid curve meets or exceeds the dashed line, yielding the shaded tilt interval. To construct that interval, we first cut the full tilt range at the switch tilts of Eq. (34). As shown in Figure 10(a), the dash-dotted vertical line marks the single cut in this example. On each side of the cut, the endpoint values bound the total angular reach, as proved in Supplement 1, Section S3. Then we remove a subinterval if its upper bound is below , or keep it if its lower bound is at least , or repeatedly halve it until finding the correct interval. Finally, adjacent kept subintervals are merged, and the two shaded regions in Figure 10(a) therefore become one feasible interval across the switch. At each interior tilt in an interval, determines a unique . Then its corresponding axial offset is shown in the bottom plot of Figure 10(a), where the dashed line marks the target . Since this offset increases with based on Eq. (33), the bisection finally finds the solution marked by the filled circle.
Figure 10. Classification in step (3) for the reference cylindrical window. (a) Near branch, mm, , mm: the upper solid curve gives the grazing-limit sweep ; the lower gives after matching the target sweep. Dashed horizontal lines mark the target offsets. The dash-dotted switch tilt separates two shaded feasible portions, which merge into one interval; the filled circle marks the ray. (b) Far branch, mm, , mm: gray boxes fail the bounds or Krawczyk test. The dashed angular and solid axial level curves intersect at two rays (open circles); their small boxes supply candidates for refinement.
On the far branch, a fold can give several values at the same tilt and angular target, so there is no single curve to follow. The axial offset along a far-branch angular level curve can also turn back with (Supplement 1, Section S3), so the near-branch bisection no longer applies. Step (3) therefore searches both momenta together. We set , which maps the admissible domain between successive switch tilts to a rectangle in (Supplement 1, Section S4). Figure 10(b) illustrates the two constraints: the dashed curve satisfies , the solid curve satisfies , and their intersections (open circles) are the two rays. The search does not trace these curves, but instead subdivides the rectangle into boxes of the form . For each box, we bound the sweep and axial contribution from every medium using the box endpoints, then sum these bounds to enclose all values of and throughout the box (Supplement 1, Section S4). If the box cannot cover both targets, it is then discarded. Krawczyk’s interval-Newton test can then exclude further boxes (gray) or isolate one ray in a black-outlined box [29, 30]. If the bounds and Krawczyk test leave a box unresolved, we subdivide it and repeat the checks. Any box still unresolved at the numerical resolution limit is kept for refinement in step (4).
Step (4) refines each candidate by Newton’s method for Eq. (18), using the angular target selected in step (2). Each update is ensured to stay in the admissible near-branch domain (§ 5.2), or within the far-branch candidate box. The search solves for the magnitude , and then assigns its sign according to the ray’s azimuthal direction, since (Eq. (3)). For nonnegative integers , targets with have the same azimuthal direction as the path, so will keep positive. But targets with have the opposite direction, leading to a negative sign on . Step (5) uses the calculated to reconstruct the direction at the pinhole through Eq. (24), and maps the ray to a pixel. As a result, the steps return a list of images, with recorded branch, signed momenta and pixel coordinates.
Spherical windows and axial rings
Section 7 summarizes our forward projection algorithm for the cylindrical windows. In this section, we will discuss about how to generalize the algorithm to the spherical windows. For a spherical window, symmetry fixes the ray plane through the centre , pinhole and target (§ 2.2). In that plane, the interfaces are simple concentric circles, so the cylindrical equations can be simplified to
Then, the forward projection reduces to solving for the scalar equation
where is the selected angular targets based on . The selection algorithm is shown in § 7. A spherical window therefore retains the cylinder’s near and far branches, bounded angular reach and shadow criterion. The near-branch root is unique by the argument of § 5.1 with , and Newton refinement still requires a clamp near grazing incidence.
However, the ray plane is no longer unique on the symmetry axis: a nonradial ray can be rotated about without changing its target. For a target beyond the centre (), gives the central ray. If also has a root , that root describes a ray in every plane through the axis. These rays together form a cone of directions, which appears as a ring around the central image when the camera faces the centre [31]. For a single sphere (), § 6.1 and Supplement 1, Section S7 give the condition for this second root:
As shown in Supplement 1, Section S7, a single sphere can produce at most one ring, whereas a multilayer spherical shell can produce more than one.
After considering the axial rings, we now examine how the number of images varies throughout a spherical window. For an off-axis target, , and define a unique ray plane. By rotational symmetry, all points with the same have the same image count, so the two-dimensional map determines the image counts throughout the window. In Figure 11(a), the spherical version of the reference window has one image at every angle below . Beyond , a shadow opens next to a two-image band, with the caustic between them. Figure 11(b) shows the additional effect of a far-branch sweep beyond , where long-way-round rays reach part of the far-side shadow and produce a three-image cap. The thick axial segment marks points that also have a ring.
Figure 11. Image count inside spherical windows versus and . Rotating either map about gives the three-dimensional field. The labeled regions have zero, two or three images; the remainder has one. The dashed boundary marks points reached the long way round, and the thick segment at marks axial points with a ring. (a) Spherical counterpart of the reference window. (b) Glass ball with , mm and pinhole 500 mm from the centre. Counts use all angular targets reached by and on a 1440 470 grid.
Calibration and validation
In this section, we are going to validate our forward projection algorithm for both synthetic and real experiments with cylindrical windows. In § 9.1, we will first introduce a wand calibration method, which does not require using a calibration board at different depth. Then, the calibration on simulated wand recordings, and the projection against brute-force ray tracing and iterative projection, are tested in § 10. Finally, we discuss the results from our real experiment in § 10.3.
Wand calibration through a cylindrical window
In order to calibrate the cameras outside the cylindrical windows, the wand calibration is applied here [32]. In this method, we use a wand that has two spherical markers with a fixed distance apart, moved through the measurement volume while the cameras record their images. The inputs are the marker centers, the measured wand length, and the window’s interface radii and refractive indices. The benefit is that there is no need for a fixed calibration board inside the cylinder, enabling the calibration in complex experimental conditions.
Figure 12 illustrates how the wand calibration works. Panel (a) shows the known-length wand and the rays to three cameras. The shaded region denotes points with no image or multiple images in the plane. Therefore, we need to keep the recorded wand inside the central volume without touching the shaded region. Panel (b) shows the unequal magnification through the cylindrical window: as the wand turns, its image extends farther along the horizontal direction than along the axial direction. The overall procedure is then summarized in Figure 13. It shows two stages of calibration. In the first stage, steps 1–3 use the detected marker centers to obtain approximate camera and wand positions. In the second stage, steps 4–6 refine these estimates by fitting the predicted images to the detections.
Figure 12. Simulated wand geometry for a water-filled acrylic cylinder (radii 100.8 and 97.6 mm) and three cameras 1.09 m from its axis at azimuths 0°, 45° and 90°. (a) Top view in the pinhole plane . The wand is drawn 60 mm long for legibility; the synthetic calibration uses a 10 mm wand. Its ends, midpoint, direction and six rays are shown. Camera 1 lies on the axis by the gauge convention; , and mark the final ray segment from the cylinder to a wand end. Shading gives the image count in this slice only: the light region is single-image for all cameras, and the dashed circle marks at zero tilt. (b) The normalized image of the drawn wand turning about the axis. Its ends trace an ellipse 1.33 times as wide and 1.02 times as tall as without the cylinder (dashed).
Figure 13. The steps of the wand calibration. Steps 1–3 find starting values from the detections alone. Steps 4 and 5 fit the cameras and wand positions, repeating until the observations in use and the estimated noise levels settle; step 6 computes uncertainties for the final fit. The wand remains in the central single-image volume throughout the recording.
In the first stage, step 1 approximates each camera’s projection over the small wand volume by an affine map. A factorization of the marker detections shared by the cameras gives a provisional 3D reconstruction [17]. The measured wand length corrects the possible stretch and gives this provisional reconstruction a physical scale, but leaves two mirror-related reconstructions. Step 2 estimates the cylinder-axis direction from the direction of least magnification in each view. For each mirror reconstruction, it tries several feasible axis positions relative to the wand, producing several candidate camera configurations. At each position, the magnifications across and along the axis give initial estimates of each camera’s distance from the axis and focal length. Then, step 3 refines each candidate by minimizing the triangulation errors for the wand ends, then carries the candidates with the smallest coarse-fit errors into the second stage.
In the second stage, each candidate retained after step 3, drawn from either mirror reconstruction, independently undergoes steps 4–6. We use the cylindrical coordinates as shown in Figure 12(a), with its axis as , and hold the measured window radii and refractive indices fixed. For each camera , the fit estimates its orientation , pinhole and focal length , while keeping the principal point at the sensor center. For each wand position , the wand locations are determined through a midpoint and unit direction , with and . We also set the pinhole of camera 1 at on the positive axis, to avoid multiple solutions from the symmetry. Then, the physical scale will be set by the known window radii, and the wand length will also be fitted and compared with its measured value as a check of the window parameters (Supplement 1, Section S8). With the geometry and unknowns defined, steps 4–6 fit the predicted marker images to the detections, update the noise levels and accepted observations, and estimate parameter uncertainty.
Step 4 adjusts these parameters to minimize the weighted reprojection error,
where is camera ’s detection of end in wand position , is the projected image location based on § 7, is that camera’s detection-noise level, and is the current set of observations. With a fixed and known Gaussian noise levels, this objective gives the maximum-likelihood estimate, and it is optimized with the Levenberg–Marquardt algorithm (Supplement 1, Section S10).
After fitting in step 4, step 5 estimates each camera’s noise level from its residuals and checks for outliers. When deciding whether a projection error is unexpectedly large, we account for camera noise and how accurately the detections determine that wand position (Supplement 1, Section S10). For each camera, step 5 estimates a typical noise-adjusted error from the median of its accepted detections (Supplement 1, Section S10). Detections exceeding five times this camera-specific value are removed. To prevent the accepted set from oscillating, a removed detection returns only if its error later falls below four times the same value. Steps 4 and 5 repeat until the accepted detections and noise levels stabilize.
Step 6 estimates each camera parameter’s uncertainty from the final weighted fit, accounting for uncertainty in the fitted wand positions (Supplement 1, Section S10), which is used for the final selection of the fits from the two mirror candidates. In the output stage, we select the fit that retains the most detections, which is calculated by the likelihood of its residuals under the estimated noise levels. This prevents a fit that has high accuracy by simply ignoring many detections. Finally, the selected cameras are saved as OpenLPT camera files.
Synthetic validation
In this part, we focus on synthetic tests against a known truth, where all tests are implemented with OpenLPT, an open-source particle-tracking framework [19, 28]. First, we test the accuracy and correctness of the forward projection, i.e., whether it returns accurate rays and the correct number of images, in § 10.1. Then, we check whether the wand calibration of § 9.1 can recover the camera parameters (§ 10.2). Note that the projection tests use the reference window of § 2.1, while the calibration tests use the cylinder of the physical experiment.
Projection accuracy and visibility
The forward projection is evaluated by two criteria. The first criterion is accuracy: how close the reconstructed line of sight is to the given point. To test that, a given point is projected onto the camera, and then the line of sight from each image point is traced through the window by Snell’s law, Eq. (1). Because the image point fixes the incident ray, this trace needs no search. The distance between the traced line of sight and the point measures the accuracy, and a ray counts as correct when this distance is below . The second criterion is correctness: whether the projection returns every image of the point, including an empty list where no ray reaches the point. For this, the images of every test point were found by a search that uses only the ray tracer: rays launched from the pinhole on a grid of directions were traced through the window and adjusted by Newton’s method until they passed through the point (Supplement 1, Section S8). Each method’s answer is then scored as every image, one of two images, no answer, or a false image.
We compared our forward projection algorithm on both criteria with two published iterative projection methods, where the second one is solved in two ways:
Alternating forward ray tracing (AFRT) [4]. This method iterates on the point where the ray enters the window. From a guess of this entry point, it traces one ray from the pinhole through the entry point into the water, and a second ray backward from the point, antiparallel to the first in the water, out to the outer surface. The entry point then moves to the midpoint of the two rays’ crossings of the outer surface, until the two rays cross both surfaces within of each other.
Dewarping method [5]. Unlike AFRT, this method moves a dewarped point within a fixed plane, which is through the point and normal to the line from the axis to the pinhole. A ray from the pinhole toward , refracted at every interface it crosses, meets this plane at some point. is updated until the crossing point is the point. Three equations are derived for the two coordinates of , which is optimized by Gauss–Newton or Levenberg–Marquardt method. Paolillo and Astarita found that Gauss–Newton could
converge faster, but recommended Levenberg–Marquardt for robustness. Here, we compare both ways, denoted as GN and LM dewarping.
In the original papers, each of these methods starts from one trial ray and refines it iteratively, so a run returns at most one image. We test them first for the accuracy and correctness. In the end, we also try to restart those methods multiple times in the admissible region based on our analysis in Section 4.2, to compare the efficiency to find the complete solutions.
The test points include 2000 points sampled uniformly in the water, and four additional sets of 500 difficult points: next to the edges of the shadow, in the two-image band, at steep ray tilts and near the axis. To show where each method fails, we also map their results on the plane as shown in Figure 14(b)–(Figure 14e). All methods are implemented in C++ and run on one thread of Intel Core i9-13900K cpu, for fair comparison of efficiency (Supplement 1, Section S8).
Figure 14. Forward-projection accuracy and correctness in the reference cylindrical window. Method symbols: circle, our search; square, alternating forward ray tracing (AFRT); downward/upward triangles, Gauss–Newton/Levenberg–Marquardt dewarping. (a) Single-start ray-to-target distance across all five point sets, with each histogram scaled to its peak. The vertical dashed line marks the acceptance threshold; the right edge denotes rays that do not reach the water. (b)–(e) Single-start outcomes on a grid at , plotted against target azimuth and radius . White denotes a complete image list (including a correct empty list at an unseen point for our search), dots one of two images, diagonal hatching no answer, and black a false image. Solid, dashed, and dotted curves mark inbound grazing, the caustic, and outbound grazing, respectively. The first two bound the shadow; the last two bound the two-image band. (f) Outcome fractions for uniform, shadow-edge, two-image, steep-tilt, and near-axis sets. (g) Fraction of image recovery versus median time per point. Iterative methods use 1–256 starts with independent trace validation; our search uses one call. Open symbols denote the uniform set, and filled symbols denote fraction from all difficult sets.
The results on accuracy is shown in Figure 14(a), which shows the error distribution for each method. Our method will return the most accurate solutions by default, so it gives the lowest error near machine precision. But the iterative methods stop at the given threshold, so AFRT and dewarping GN have highest error as m. However, dewarping LM method sometimes even stops at a higher error, which might be due to its slow convergence rate or vanishing update step. In summary, both our method and the previous iterative methods can return rays that pass the accuracy test. But a small error does not mean a method can find every image or correctly identified a point in shadow, which will be tested in the next criterion.
The correctness test, in Figure 14(b)–(Figure 14f), separates the methods in the two-image and shadow regions, as already mentioned by Paolillo and Astarita [5]. A single start returns at most one ray, so none of the iterative methods recovered both images in the two-image set. At unseen points, dewarping LM can report a ray that misses the point. AFRT and GN dewarping usually return no ray there, but also return no ray at some visible points. An empty answer from these methods therefore cannot truly determine whether a point lies in shadow. Our search returned the correct image list at 3999 of the 4000 test points, including the empty list at every unseen point. Its only miss was a ray extremely close to grazing, where rounding affects image recovery, as examined below.
One way to improve the iterative methods is to restart each one from many rays and keep only the rays that tracing confirms. We restart each iterative method from up to 256 rays per point: the straight line first, then rays drawn uniformly over the admissible domain of derived in Section 4.2. A ray is kept when its trace reaches the point within m, so a restarted method can return several images and never a false one. Multiple restarts will increase the total computation cost, and the benefits it brings also depends on the point is, as shown in Figure 14(g). For points sampled uniformly in the water, most of which have a single image, a few restarts work well. The open symbols show that the iterative methods can find almost every image in less time than our method. However, for points in the difficult sets, the iterative methods cannot work well even with 256 restarts. With more restarts, both dewarping methods gradually increase their correctness, while AFRT cannot improve at all. For these difficult points, the iterative methods cost much more than our method and still cannot guarantee to be fully correct. These failures matter in dense particle tracking [18, 19], where a missed or false image can lose or identify a wrong particle, and multiple restarts increase the cost of each projection. In short, restarts can make iterative projection complete at most points, but it cannot guarantee the complete image list.
Compared to the iterative methods, our method can instead find the complete image list in a single call, as shown in § 7. It can only lose a ray near the grazing limit due to the machine precision, where is below about . Furthermore, the cost of our search is nearly the same at the difficult points as elsewhere, while the iterative methods with multiple restarts take an order of magnitude longer and still miss images. Therefore, our method provides accuracy and full correctness for calibration and particle tracking at a predictable cost.
Wand calibration
We test the calibration of § 9.1 on synthetic wand recordings, and compare with the true camera parameters. To match the experiment of § 10.3, the recordings are made through the water-filled acrylic cylinder with the same size. We simulate 500 frames of a 10 mm wand moving within the single-image domain using OpenLPT’s projection, and then add Gaussian noise.
Table 2 summarizes calibration accuracy on the three-camera setup of Figure 12(a). With 0.1 px of detection noise, the focal-length error and the wand length error are below 0.1%. At points not used for calibration, the projection error is below 0.01 px, and the triangulated 3D shape agrees with the truth to below 1 μm.
| quantity | realized | predicted |
| focal length error | 0.063% | 0.063% |
| wand length error | 0.024% | 0.023% |
| projection error on unseen points | 0.0079 px | 0.0077 px |
| 3D shape error on unseen points | 0.76 m | – |
Table 2. Calibration errors on the reference rig at 0.1 px of detection noise
The precision limit of the calibration can be estimated from the image noise and camera location based on the Cramér–Rao bound. As shown in Table 2, the calibration error match very well with the predicted one. We also plot how the focal-length error grows with detection noise in Figure 15, and it also matches with the predicted error. Thus, the calibration method will approache to the precision limit and provides useful error bars.
Figure 15. Accuracy of the synthetic wand calibration through the cylinder of the experiment: root-mean-square error of the focal length against the detection noise on the reference rig of Figure 12, realized over 40 data sets per noise level (circles) and predicted by the Cramér–Rao bound (line), each the root mean square over the three cameras.
Realized: root-mean-square error over 40 noisy data sets for and the 3D error, 20 for projection error, and two data sets in five-fold holdout for wand length. Predicted: the Cramér–Rao bound at the true parameters; –: not computed. Unseen points: a grid over the wand’s mm volume. Projection error is the reprojection residual after triangulating their noise-free images with the fitted cameras. For the 3D shape error, the entire reconstructed grid is shifted and rotated to match the true grid before computing the root-mean-square point error.
The above analysis shows that the calibration works well in the synthetic tests, and we will show a real experiment on camera calibration and particle tracking with two camera in the following.
Experiment
In this part, we apply the wand calibration of § 9.1 and the forward projection algorithm in § 7 to a real experiment. As mentioned in § 10.2, we use a water-filled acrylic cylinder with an outer diameter of 201.6 mm and a 3.175 mm wall. Three high-speed cameras (two Phantom VEO 710L with 1280 800 pixels of 20 m and a Phantom v2640 with 2048 1952 pixels of 13.5 m, all with 180 mm macro lenses) view the water through the wall with backlighting. Camera 2 is 42° from camera 1 around the axis, and camera 3 sits almost directly below camera 1, which is about 0.3 m higher than the other two and looks down at 23°.
In the experiment, we first perform wand calibration, and then apply Lagrangian particle tracking with OpenLPT for a swirl.
Figure 16(a) and (b) show the experimental setup: three cameras look at the cylinder from one side with backlit from two LED panels. The calibrated system is illustrated in Figure 16(c) and (d). The fitted pinholes are 0.79, 0.93 and 0.87 m from the axis, and the wall bends their fields of view, which overlap near the axis where the wand moves. Figure 16(e)–(g) show one frame of the wand recording. In each frame a wand with 3 and 4 mm balls with 10 mm central distance moves around in the central single-image domain, which is recorded at 100 Hz for 130 s. Through the cylinder, each ball images as an ellipse about 1.2 to 1.3 times wider across the axis than along it, which is the unequal magnification, as illustrated in Figure 12(b). Thus, the balls are identified by ellipse fitting and only 7212 frames are kept, because both balls need to be identified clearly in at least two cameras. The used centers are marked as blue dots in Figure 16(e)–(g).
Figure 16. The experimental setup and the wand calibration of its three cameras through the water-filled cylinder. (a)–(b) Images of real experimental setup. (c) The calibrated rig to scale, in an oblique view: the cylinder (gray), the cameras, the lines of sight through the corners of each camera’s image to the cylinder and through its center to the wand, and the wand-end positions of the calibration (dots); dotted lines run from the axis to each camera’s foot on the plane of the wand’s mean height and up to the camera. (d) The rig seen along the cylinder’s axis: the wall (gray), the field of view of each camera in its central image row, traced through the wall (shaded; edges solid for camera 1, dashed for camera 2, dash-dotted for camera 3), and the wand-end positions (dots). (e)–(g) One frame of the wand recording in cameras 1 to 3, with the ellipses fitted to the balls and their centers (orange), and the centers of all ball images that the calibration used (blue dots); camera 3’s frame is cropped to 1280 of its 1952 rows. (h) The wand length triangulated independently in each of 7175 frames of the fit, minus its known 10 mm.
As shown in Table 3, the reprojection errors of the three cameras are 0.5 to 0.8 px, which is larger than the synthetic cases due to the noise of object identification. But this is still good enough for 3D particle tracking with subpixel accuracy. The relative error for 3D wand length reconstruction is only 0.61%, and its distribution is close to a Gaussian centered at zero, as shown in Figure 16(h).
| quantity | value |
| wand calibration, 7212 frames | |
| reprojection error (camera 1/2/3) | 0.74 / 0.53 / 0.78 px |
| wand length error | 61 (0.61%) |
| tracking, 250 frames | |
| particles detected per frame, camera 1 / 2 / 3 | 459 / 959 / 3387 |
| particles tracked per frame | 343 |
| number of tracks (positions) | 425 (69 846) |
| track length median (90th percentile) | 184 (250) |
| number of long tracks ( frames) | 320 |
| tracked particle reprojection error | 0.27–0.84 px |
| velocity range | 113–252 mm/s |
Table 3. Calibration and tracking quality in the experiment
Next, we perform Lagrangian particle tracking with OpenLPT [18, 19], for a swirling flow inside the cylinder. 60 polyamide particles are used as tracer particles, and the video is recorded at 4000 Hz for 0.25 s, of which we track the first 250 frames. Since the cylinder window will stretch the dimension across its axis, each particle therefore images as a short horizontal or vertical line rather than a round spot in cameras 1 and 2, as shown in Figure 17(a) and (b). The orientation and length of the pattern depend on the particle’s depth along the line of sight. Camera 3, whose images are less blurred, records most particles as compact dots (see Figure 17(c)). We detect the particles as line segments, use their shapes to enhance the stereo match, and require every particle to be matched in all three cameras.
Figure 17. Particle tracking through the cylinder with three cameras. (a)–(c) A px crop of one frame in cameras 1 to 3, with the particles dark against the backlight; the boxes outline the particle images identified in the frame. (d) All 411 tracks long enough to smooth (at least 19 frames), smoothed with a Gaussian filter of width 3 steps, viewed along the cylinder’s axis (+) and shaded by speed, in the frame of Figure 16(d): points towards camera 1. (e) The median azimuthal, axial and radial velocities of the smoothed tracks against the distance from the axis, in 3 mm bins; the shading spans the interquartile range of the azimuthal velocity.
The tracking quality is summarized in Table 3. In the 250 tracked frames, about 340 particles are tracked in each frame, 48 tracks persist from the beginning till the end, and the total number of tracks is 425 with a median track length of 184 frames. The reprojection error of the tracked particles is less than 1 px in every camera. Since every particle must be seen by all three cameras, few tracks are ghosts: a control run in which no match can be real builds at most 6% as many long
tracks as the real one (Supplement 1, Section S8). The tracks are shown in Figure 17(d) without any selection. The trajectories of particles clearly show a swirling flow pattern as expected. And their velocity statistics are plotted in Figure 17(e). It shows that the azimuthal velocity rises steeply away from the axis and levels off at about 250 mm/s beyond 20 mm, while the radial velocity stays close to zero and the axial velocity, a slow drift along the axis, stays below 45 mm/s, which validates against the real scenario.
In summary, these results show that our forward projection algorithm together with the wand calibration works well through cylinder windows, which can be used for high-quality particle tracking with three cameras. It provides a robust and easy way to calibrate multi-camera system without the need of calibration target, which is very useful for many experiments or applications that has limited space.
Conclusion
In this paper, we develop a complete forward-projection algorithm for multilayer coaxial cylindrical or concentric spherical systems. First, closed-form expressions are derived to describe the ray travelling throught the curved windows. They are based on the conserved ray momenta (, ), which reduce the complex projection to a search in one or two variables. Then, we can divide the projection into the near-branch and far-branch problems, where the near-branch problem can only have one solution at most. For the far branch, we also propose an algorithm that can find all possible solutions. Following the algorithm in § 7, we are able to find the complete solution with theoretical guarantee, which can hardly be achieved with traditional iterative method [5].
The validation results also show that our forward projection is accurate and robust. Our C++ implementation returned the full correct image list, except for one missing ray due to floating-point rounding limit. In contrast, none of the single-start iterative methods is able to find both images in the multi-image domain, and multiple restarts can still miss images at difficult points. With our robust projection algorithm, the simple wand calibration works well in both synthetic tests and the real experiment, which has only 0.61% error on wand-length reconstruction. It is also successfully tested for three-camera tracking of a swirling flow with OpenLPT [19, 28], which sheds light for 3D pipe flow measurements, accurate underwater reconstruction, and many real applications.
Index convention
Figure A1 draws the index convention of § 2.1 and § 3 for the same four-medium stack in all three geometries. In each, medium 1 holds the pinhole and medium the object point, and the number of media, not of surfaces, sets the size of the problem.
Funding. TBD.
Acknowledgment. TBD.
Disclosures. The authors declare no conflicts of interest.
Data availability. The Python reference implementation, the verification scripts, the scripts that print every number, table and figure of this paper, and the data behind Figs. 14 and 15 will be available in a public repository (TBD). The C++ implementation of the projection and of the wand calibration is available at https://github.com/clockj/pyOpenLPT-refraction, which will be merged into the main repository of
OpenLPT [19], https://github.com/JHU-NI-LAB/OpenLPT_GUI. Supplement 1, Section S8 names the script behind each table and figure.
Supplemental document. See Supplement 1 for supporting content.
References
- [1]M. L. Lowe and P. H. Kutt, “Refraction through cylindrical tubes,” Exp. Fluids 13, 315–320 (1992).DOI
- [2]B. Bäuerlein and K. Avila, “Pulsatile pipe flow experiment to study particle–fluid interactions using Lagrangian flow measurements,” Rev. Sci. Instruments 96, 075204 (2025).DOI
- [3]Y.-P. Liu, P.-Y. Wang, J. Wang, and Z.-H. Du, “Investigation of Taylor bubble wake structure in liquid nitrogen by PIV technique,” Cryogenics 55–56, 20–29 (2013).DOI
- [4]J. Belden, “Calibration of multi-camera systems with refractive interfaces,” Exp. Fluids 54, 1463 (2013).DOI
- [5]G. Paolillo and T. Astarita, “Perspective camera model with refraction correction for optical velocimetry measurements in complex geometries,” IEEE Trans. on Pattern Anal. Mach. Intell. 44, 3185–3196 (2022).
- [6]S. G. Huisman, D. P. M. van Gils, and C. Sun, “Applying laser Doppler anemometry inside a Taylor–Couette geometry using a ray-tracer to correct for curvature effects,” Eur. J. Mech. - B/Fluids 36, 115–119 (2012).DOI
- [7]K. H. Kang, S. J. Lee, C. M. Lee, and I. S. Kang, “Quantitative visualization of flow inside an evaporating droplet using the ray tracing method,” Meas. Sci. Technol. 15, 1104–1112 (2004).
- [8]K. Abe, S. Kuroda, and H. Habe, “A multiple video camera system for 3D tracking of farmed fry in an aquaculture tank,” Sensors Mater. 32, 3581–3594 (2020).DOI
- [9]H. Liu, G. Paolillo, T. Astarita, et al., “Computed tomography of chemiluminescence for the measurements of flames confined within a cylindrical glass,” Opt. Lett. 44, 4793–4796 (2019).
- [10]K. Zha, S. Busch, C. Park, and P. C. Miles, “A new method for correction of temporally- and spatially-variant optical distortion in planar particle image velocimetry,” Meas. Sci. Technol. 27, 085201 (2016).DOI
- [11]Y. Gao, C. Ling, Y. Wu, et al., “Volumetric flame reconstructions in an optical engine cylinder involving refraction and blockage,” Meas. Sci. Technol. 34, 074007 (2023).DOI
- [12]C. Kunz and H. Singh, “Hemispherical refraction and camera calibration in underwater vision,” in OCEANS 2008, (IEEE, 2008), pp. 1–7.DOI
- [13]E. Nocerino, F. Menna, F. Fassi, and F. Remondino, “Underwater calibration of dome port pressure housings,” The Int. Arch. Photogramm. Remote. Sens. Spatial Inf. Sci. XL-3/W4, 127–134 (2016).DOI
- [14]M. She, D. Nakath, Y. Song, and K. Köser, “Refractive geometry for underwater domes,” ISPRS J. Photogramm. Remote. Sens. 183, 525–540 (2022).DOI
- [15]F. Menna, E. Nocerino, F. Fassi, and F. Remondino, “Geometric and optic characterization of a hemispherical dome port for underwater photogrammetry,” Sensors 16, 48 (2016).DOI
- [16]Z. Zhang, “A flexible new technique for camera calibration,” IEEE Trans. on Pattern Anal. Mach. Intell. 22, 1330–1334 (2000).DOI
- [17]R. Hartley and A. Zisserman, Multiple View Geometry in Computer Vision (Cambridge University Press, 2004), 2nd ed.DOI
- [18]D. Schanz, S. Gesemann, and A. Schröder, “Shake-The-Box: Lagrangian particle tracking at high particle image densities,” Exp. Fluids 57, 70 (2016).DOI
- [19]S. Tan, A. Salibindla, A. U. M. Masuk, and R. Ni, “Introducing OpenLPT: new method of removing ghost particles and high-concentration particle shadow tracking,” Exp. Fluids 61, 47 (2020).DOI
- [20]A. Agrawal, S. Ramalingam, Y. Taguchi, and V. Chari, “A theory of multi-layer flat refractive geometry,” in 2012 IEEE Conference on Computer Vision and Pattern Recognition, (IEEE, 2012), pp. 3346–3353.
- [21]L. Gu, W. Chen, X. Hu, et al., “Refraction correction for deep-water three-dimensional visual measurement based on multi-objective optimization,” Opt. Express 31, 31383–31396 (2023).DOI
- [22]T. Treibitz, Y. Schechner, C. Kunz, and H. Singh, “Flat refractive geometry,” IEEE Trans. on Pattern Anal. Mach. Intell. 34, 51–65 (2012).
- [23]R. Kawahara, S. Nobuhara, and T. Matsuyama, “A pixel-wise varifocal camera model for efficient forward projection and linear extrinsic calibration of underwater cameras with flat housings,” in 2013 IEEE International Conference on Computer Vision Workshops, (IEEE, 2013), pp. 819–824.DOI
- [24]M. Born and E. Wolf, Principles of Optics (Cambridge University Press, 1999), 7th ed.DOI
- [25]A. W. Snyder and J. D. Love, Optical Waveguide Theory (Chapman and Hall, 1983).DOI
- [26]K. Aki and P. G. Richards, Quantitative Seismology (University Science Books, 2002), 2nd ed.
- [27]R. Buland and C. H. Chapman, “The computation of seismic travel times,” Bull. Seismol. Soc. Am. 73, 1271–1302 (1983).DOI
- [28]S. Tan, S. Zhong, and R. Ni, “3d lagrangian tracking of polydispersed bubbles at high image densities,” Exp. Fluids 64, 85 (2023).DOI
- [29]R. Krawczyk, “Newton-Algorithmen zur Bestimmung von Nullstellen mit Fehlerschranken,” Computing 4, 187–201 (1969).DOI
- [30]R. E. Moore, R. B. Kearfott, and M. J. Cloud, Introduction to Interval Analysis (Society for Industrial and Applied Mathematics, 2009).DOI
- [31]J. F. Nye, Natural Focusing and Fine Structure of Light (Institute of Physics Publishing, 1999).
- [32]D. H. Theriault, N. W. Fuller, B. E. Jackson, et al., “A protocol and calibration method for accurate multi-camera field videography,” J. Exp. Biol. 217, 1843–1848 (2014).DOI
















