Problem with these is that the hole is small. Darkening toward the fringe on a a pinhole camera, 'cause off-axis the hole becomes a thinning ellipse. Solve all these problems by using a lens. Ideally, rays thru lens converge on a point in space. Ends up really being integrating over the lens.
Real camera have lots of lenses, interreflection, anti- refl coatings.
If you view the behavior of thin lens as a basis, and compare to real camera lens, they're really close. Any light that goes thru center at any angle is unperturbed. All light originating from the same point, thru any point on the lens, converges at exactly the same point. So if you know the convergence point, you know where any ray goes. If you know d0, d1, p0, then you know p1.