Skip to content

Commit

Permalink
derivation
Browse files Browse the repository at this point in the history
  • Loading branch information
scottshambaugh committed Dec 24, 2023
1 parent c8a1485 commit c86dfc0
Show file tree
Hide file tree
Showing 4 changed files with 443 additions and 2 deletions.
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
- Add on more known 2D plotting functions
- Flesh out testing of 3D plotting
- 3D take into account roll angle
- Document derivation of offsets
- GH release publish to pypi
- zlim handling and consistent depth
- Check AxesAnaglyph.imshow_stereo() non-gray coloring, and non-named coloring
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,16 @@ These are not [*auto*stereograms](https://en.wikipedia.org/wiki/Autostereogram),
By default, the stereograms are set up for "parallel" viewing method as described above. For "cross-eyed" viewing, initialize with a negative `ipd` parameter. An ipd (Inter-Pupilary Distance) of 65 millimeters is the default, so call `AxesStereo2D(ipd=-65)` for the default cross-eyed viewing.

### Derivation of Geometry
TODO
Two eyes with separation `IPD` are looking at a point a distance `z` offset from a focal plane at distance `d`, resulting in view angle `θ`. If this point were projected back to the focal plane, it would be offset by `δ` from where it visually appears on that plane. This offset `δ` is used to displace each point in the stereogram for each eye based on its `z` value to achieve the stereoscopic effect. The `eye_balance` parameter reallocates the total displacement of `` between the two eyes.

```
θ = arctan((d - z) / (IPD / 2))
D / d = (IPD / 2) / (d - z)
δ = D - IPD / 2
= IPD / 2 * (d / (d - z) - 1)
= IPD / 2 * z / (d - z)
```

<p float="left" align="center">
<img width="500" height="600" src="https://raw.githubusercontent.com/scottshambaugh/mpl_stereo/main/docs/geometry.png">
</p>
Binary file added docs/geometry.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c86dfc0

Please sign in to comment.