After some more digging and thinking I've found there are two reasons the approach I outlined in my question won't work.
- The math is wrong. (but can be corrected)
- The phones are wrong. (but cannot be corrected)
#2 is the more serious blocker which makes #1 kind of irrelevant. It just really looks like the angular field of view provided by the code does not match what is observed experimentally. It's also only provided by iOS - Android has stopped providing a value in the newest versions.
For completeness, I'll describe the math more but it's pointless anyway. The problem with the math is the lack of trigonometry. A diagram is probably the best way to show the situation:
(CORRECTION: I used tan
wrong above. It should be tan(theta/2)=t/2d
and tan(phi/2)=p/2d
)
Because my answer is ultimately that this problem cannot be solved because of the uncooperative devices, I won't go through solving the equations. However, from that diagram you can solve for the things you need in order to do the cropping, but again, it will fail because the angular field of view given by the phones is either wrong or is simply not provided.