Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multilens cameras #2914

Merged
merged 36 commits into from
Feb 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
8833d92
Implement multi-lens camera
Jul 9, 2021
dd6219d
Change spawn_ray return type from void to bool
Jul 9, 2021
abad431
Add folder containing lens description files
Jul 9, 2021
c0132ee
Move focal length extraction from perspective camera to child classes
Jul 16, 2021
b39763f
Change lens file format
Jul 16, 2021
0a08d30
Update lens files to reflect previous changes
Jul 16, 2021
8edd3b3
Add test scenes for the multi-lens camera
Jul 29, 2021
a026041
Increase lens diameter in description files
Jul 29, 2021
b172a83
Optimize and clean up
Jul 29, 2021
2be89f1
Optimize custom aperture shape logic and clean up unused code
Aug 11, 2021
79bc6df
Update bokeh test scenes
Aug 13, 2021
71bbd9f
Update exit pupil calculation to better reflect literature
Aug 22, 2021
8c1ee95
Fix connect_vertex implementation
Oct 29, 2021
f123f3b
Improve comment consistency and optimize variables and function names
Nov 14, 2021
209c818
Make iterators constant where possible
Nov 14, 2021
59b8e1d
Simplify cosine similarity computation
Nov 14, 2021
a0c3175
Change C-style cast to static_cast and improve readability of lens sc…
Nov 14, 2021
6561bc8
Introduce LensCamera class
LZaw Jan 27, 2022
895f173
Make lens path relative in test scenes
Feb 1, 2022
72e6f28
Add line to lens files that indicates the number of elements
Feb 1, 2022
f8632f6
Improve lens file reading logic
Feb 1, 2022
0e85099
Rename and rearrange class variables and functions
Feb 1, 2022
e6e75b7
Improve compute_sample_pupil method signature
Feb 5, 2022
38d68bf
Add hardcoded default lens as fallback when lens file handling fails
Feb 7, 2022
551fa4c
Remove redundant method implementation
Feb 17, 2022
c194785
Poison variables to prevent compiler warnings
Feb 17, 2022
f3a1202
Improve lens file read logic
Feb 17, 2022
efad7bd
Add always_poison against compiler warnings
LZaw Feb 18, 2022
ea1af89
Quicken test scenes and adapt ref format
LZaw Feb 18, 2022
a24c6b0
Change from adaptive to uniform sampling
LZaw Feb 18, 2022
1036c5f
Decrease film size
LZaw Feb 18, 2022
e77e309
Fix transparency issue
LZaw Feb 21, 2022
5f4ed67
Quicken Multilens Tests even more
LZaw Feb 21, 2022
9a0c246
Fix transparency issue in test scenes
Feb 21, 2022
3392092
Moved lens files to separate folder
Feb 21, 2022
956808f
Update refs
LZaw Feb 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions sandbox/lenses/biconvex-50.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# single bi-convex lens, Ø1", N-BK7, FL 50mm
# https://www.thorlabs.com/newgrouppage9.cfm?objectgroup_id=4847
3 # lens size
0 3 0 25.4
50.6 5.2 1.517 25.4
-50.6 48.2 1 25.4
10 changes: 10 additions & 0 deletions sandbox/lenses/brendel-tessar.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Brendel Tessar, USP 2854889, 100mm F/2.8
8 # lens size
42.97 9.8 1.6910 38.4
-115.33 2.1 1.5486 38.4
306.84 4.16 1 38.4
0 4.0 0 30.0
-59.06 1.87 1.6398 34.6
40.93 10.64 1 34.6
183.92 7.05 1.6910 33.0
-48.91 79.831 1 33.0
37 changes: 37 additions & 0 deletions sandbox/lenses/canon-zoom-135.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# CANON, US Patent 5537259, F/2.8, 70-200mm (135)
# Variable: FL 72.10/135.00/194.01
34 # lens size
311.919 2.80 1.7495 76.0
118.63 0.42 1 76.0
128.135 8.68 1.497 76.0
-263.46 0.1 1 76.0
79.501 5.72 1.497 70.0
203.191 26.15 1 70.0
54.391 2.2 1.847 56.0
45.859 1.13 1 56.0
51.927 8.55 1.487 56.0
5099.30 12.89 1 56.0
-488.6 1.4 1.804 36.0
35.390 5.88 1 36.0
-78.125 1.4 1.487 36.0
38.137 4.97 1.847 36.0
417.478 2.65 1 36.0
-66.802 1.4 1.729 36.0
-3363.0 15.72 1 36.0
247.12 3.49 1.697 38.0
-99.902 0.15 1 38.0
-189.99 4.77 1.497 38.0
-40.553 1.45 1.834 38.0
-76.277 0.69 1 38.0
58.421 3.53 1.804 42.0
133.262 3 1 42.0
0 0.24 0 42.0
34.132 6.35 1.497 42.0
2256.763 3.72 1.620 42.0
31.519 28.17 1 42.0
132.947 5.9 1.517 42.0
-77.546 13.94 1 42.0
-39.485 1.8 1.834 42.0
-95.683 0.15 1 42.0
147.644 3.62 1.743 42.0
-205.76 54.5 1 42.0
37 changes: 37 additions & 0 deletions sandbox/lenses/canon-zoom-200.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# CANON, US Patent 5537259, F/2.8, 70-200mm (200)
# Variable: FL 72.10/135.00/194.01
34 # lens size
311.919 2.80 1.7495 76.0
118.63 0.42 1 76.0
128.135 8.68 1.497 76.0
-263.46 0.1 1 76.0
79.501 5.72 1.497 70.0
203.191 32.85 1 70.0
54.391 2.2 1.847 56.0
45.859 1.13 1 56.0
51.927 8.55 1.487 56.0
5099.30 17.23 1 56.0
-488.6 1.4 1.804 36.0
35.390 5.88 1 36.0
-78.125 1.4 1.487 36.0
38.137 4.97 1.847 36.0
417.478 2.65 1 36.0
-66.802 1.4 1.729 36.0
-3363.0 1.32 1 36.0
247.12 3.49 1.697 38.0
-99.902 0.15 1 38.0
-189.99 4.77 1.497 38.0
-40.553 1.45 1.834 38.0
-76.277 4.05 1 38.0
58.421 3.53 1.804 42.0
133.262 3 1 42.0
0 0.24 0 42.0
34.132 6.35 1.497 42.0
2256.763 3.72 1.620 42.0
31.519 28.17 1 42.0
132.947 5.9 1.517 42.0
-77.546 13.94 1 42.0
-39.485 1.8 1.834 42.0
-95.683 0.15 1 42.0
147.644 3.62 1.743 42.0
-205.76 54.5 1 42.0
37 changes: 37 additions & 0 deletions sandbox/lenses/canon-zoom-70.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# CANON, US Patent 5537259, F/2.8, 70-200mm (70)
# Variable: FL 72.10/135.00/194.01
34 # lens size
311.919 2.80 1.7495 76.0
118.63 0.42 1 76.0
128.135 8.68 1.497 76.0
-263.46 0.1 1 76.0
79.501 5.72 1.497 70.0
203.191 8.78 1 70.0
54.391 2.2 1.847 56.0
45.859 1.13 1 56.0
51.927 8.55 1.487 56.0
5099.30 1.64 1 56.0
-488.6 1.4 1.804 36.0
35.390 5.88 1 36.0
-78.125 1.4 1.487 36.0
38.137 4.97 1.847 36.0
417.478 2.65 1 36.0
-66.802 1.4 1.729 36.0
-3363.0 30.32 1 36.0
247.12 3.49 1.697 38.0
-99.902 0.15 1 38.0
-189.99 4.77 1.497 38.0
-40.553 1.45 1.834 38.0
-76.277 14.7 1 38.0
58.421 3.53 1.804 42.0
133.262 3 1 42.0
0 0.24 0 42.0
34.132 6.35 1.497 42.0
2256.763 3.72 1.620 42.0
31.519 28.17 1 42.0
132.947 5.9 1.517 42.0
-77.546 13.94 1 42.0
-39.485 1.8 1.834 42.0
-95.683 0.15 1 42.0
147.644 3.62 1.743 42.0
-205.76 54.5 1 42.0
18 changes: 18 additions & 0 deletions sandbox/lenses/double-gauss-angenieux.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Angenieux, US Patent 2701982; f/1.1, 100mm
# scaling it by .5 to give a 50mm with nice vignetting/swirley bokeh
15 # lens size
164.12 10.99 1.673 108.0
559.28 0.23 1 108.0
100.12 11.45 1.67 102.0
213.54 0.23 1 102.0
58.04 22.95 1.691 82.0
2551 2.58 1.673 82.0
32.39 15.66 1 54.0
0 15.00 0 51.0
-40.42 2.74 1.699 50.0
192.98 27.92 1.62 72.0
-55.53 0.23 1 72.0
192.98 7.98 1.691 70.0
-225.28 0.23 1 70.0
175.1 8.48 1.691 70.0
-203.54 55.742 1 70.0
12 changes: 12 additions & 0 deletions sandbox/lenses/double-gauss-hudson.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# US patent 3376090
10 # lens size
33.14 7.43 1.62 40.0
83.45 0.14 1 40.0
29.71 6.29 1.7506 30.0
20.74 12.03 1 30.0
0 12.03 0 24.0
-22.06 1.43 1.7200 30.0
72.28 9.06 1.7200 30.0
-30.86 0.14 1 30.0
-331.43 6.03 1.7506 40.0
-59.45 71.0 1 40.0
13 changes: 13 additions & 0 deletions sandbox/lenses/double-gauss-laikin.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# double gauss f/2.5, Lens Design, Milton Laikin, 1992, Page 75
11 # lens size
84.01558 10.668 1.6204 81.28
351.08642 0.5842 1 81.28
49.8475 15.367 1.6204 65.024
-562.42204 7.1882 1.5814 65.024
32.47898 9.652 1 38.1
0 12.4714 0 32.004
-43.91914 5.1054 1.5814 40.64
69.19722 17.0688 1.6177 59.944
-58.3057 7.2644 1 59.944
166.9542 10.0076 1.6204 76.2
-225.93554 70.6628 1 76.2
13 changes: 13 additions & 0 deletions sandbox/lenses/double-gauss-tronnier.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# double gauss, Modern Lens Design, Warren J. Smith, 1992, Page 312
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe unify your comments. Some start with //, others with # and yet again others with // #.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in f123f3b

11 # lens size
58.95 7.52 1.67 100.8
169.66 0.24 1 100.8
38.55 8.05 1.67 92.0
81.54 6.55 1.699 92.0
25.5 11.41 1 72.0
0 9 0 68.4
-28.99 2.36 1.603 68.0
81.54 12.13 1.658 80.0
-40.77 0.38 1 80.0
874.13 6.44 1.717 80.0
-79.46 72.228 1 80.0
26 changes: 26 additions & 0 deletions sandbox/lenses/fisheye.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# fisheye 220 degree (shimizu)
24 # lens size
143.47 7.0 1.51680 213.0
52.5 28.0 1 104.6
76.4 3.8 1.51680 100.0
31.521 21.8 1 61.0
150.0 3.0 1.51680 54.0
17.1 16.5 1 33.0
-60.0 7.0 1.62041 33.0
22.625 0.6 1 33.0
23.9 12.6 1.72825 33.0
78.988 22.7 1 33.0
10000 1.8 1.51823 33.0
10000 5.1 1 33.0
278.333 3.0 1.64831 33.0
-185.42 0.1 1 33.0
52.030 7.0 1.53375 33.0
-28.5 2.0 1.77250 33.0
-77.0 3.0 1 33.0
0 10.0 0 33.0
45.0 8.0 1.51823 20.0
-14.4 0.6 1.79631 20.0
-34.5 0.1 1 20.0
-110.0 1.0 1.71736 20.0
35.0 3.5 1.51680 20.0
-25.763 39.8 1 20.0
21 changes: 21 additions & 0 deletions sandbox/lenses/itoh-zoom-100.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# wide angle zoom lens, Inventor: Takayuki Itoh, US Patent 4196968, 100-145mm
19 # lens size
296.140 14.220 1.589 164.0
914.140 0.410 1 164.0
187.780 4.880 1.806 150.0
64.230 30.880 1 104.0
717.900 5.280 1.678 101.0
120.230 18.810 1 101.0
113.650 12.190 1.805 84.0
223.460 59.24 1 84.0
0 4.880 0 53.8
171.170 28.320 1.806 70.0
-565.340 9.260 1 70.0
83.770 10.160 1.808 66.0
262.120 9.130 1 66.0
-218.780 15.930 1.847 64.0
85.250 7.310 1 64.0
-839.850 9.140 1.516 64.0
-94.280 0.410 1 64.0
-3422.750 9.430 1.516 65.6
-115.670 149.674 1 65.6
21 changes: 21 additions & 0 deletions sandbox/lenses/itoh-zoom-123.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# wide angle zoom lens, Inventor: Takayuki Itoh, US Patent 4196968, 100-145mm
19 # lens size
296.140 14.220 1.589 164.0
914.140 0.410 1 164.0
187.780 4.880 1.806 150.0
64.230 30.880 1 104.0
717.900 5.280 1.678 101.0
120.230 18.810 1 101.0
113.650 12.190 1.805 84.0
223.460 33.205 1 84.0
0 4.880 0 53.8
171.170 28.320 1.806 70.0
-565.340 9.260 1 70.0
83.770 10.160 1.808 66.0
262.120 9.130 1 66.0
-218.780 15.930 1.847 64.0
85.250 7.310 1 64.0
-839.850 9.140 1.516 64.0
-94.280 0.410 1 64.0
-3422.750 9.430 1.516 65.6
-115.670 149.674 1 65.6
21 changes: 21 additions & 0 deletions sandbox/lenses/itoh-zoom-145.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# wide angle zoom lens, Inventor: Takayuki Itoh, US Patent 4196968, 100-145mm
19 # lens size
296.140 14.220 1.589 164.0
914.140 0.410 1 164.0
187.780 4.880 1.806 150.0
64.230 30.880 1 104.0
717.900 5.280 1.678 101.0
120.230 18.810 1 101.0
113.650 12.190 1.805 84.0
223.460 7.21 1 84.0
0 4.880 0 53.8
171.170 28.320 1.806 70.0
-565.340 9.260 1 70.0
83.770 10.160 1.808 66.0
262.120 9.130 1 66.0
-218.780 15.930 1.847 64.0
85.250 7.310 1 64.0
-839.850 9.140 1.516 64.0
-94.280 0.410 1 64.0
-3422.750 9.430 1.516 65.6
-115.670 149.674 1 65.6
6 changes: 6 additions & 0 deletions sandbox/lenses/lensbaby.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# achromatic double crown/flint (#NT32-921) edmund optics archomat, ~129mm
4 # lens size
65.22 9.60 1.5 48.0
-62.03 4.20 1.5 48.0
-1240.67 5.00 1 48.0
0 105.00 0 40.0
25 changes: 25 additions & 0 deletions sandbox/lenses/nikon-zoom-140.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Nikon, PAT S.53-131852, F/2.8, 80-200mm (140)
# Modern Lens Design 2nd Ed.: p. 527-528; Figure 20.3
22 # lens size
148.570 5.0 1.564 64.4
-479.279 0.357 1 64.4
192.855 6.286 1.589 62.0
-134.999 2.214 1.805 62.0
-874.852 25.27 1 61.0
-285.712 3.893 1.755 38.0
-44.764 1.036 1.517 38.0
59.357 5.357 1 38.0
-45.071 1.250 1.589 32.0
166.174 19.23 1 32.0
164.284 5.000 1.658 30.0
-33.928 1.036 1.795 30.0
-85.047 10.84 1 30.0
30.464 5.357 1.670 33.4
162.202 3.071 1 32.6
-374.997 1.786 1.805 30.4
259.105 17.857 1 29.0
0 18.000 0 18.8
-17.214 1.714 1.713 21.0
-30.230 0.286 1 23.0
62.857 3.071 1.773 25.2
-466.815 40.08 1 25.2
25 changes: 25 additions & 0 deletions sandbox/lenses/nikon-zoom-200.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Nikon, PAT S.53-131852, F/2.8, 80-200mm (200)
# Modern Lens Design 2nd Ed.: p. 527-528; Figure 20.3
22 # lens size
148.570 5.0 1.564 64.4
-479.279 0.357 1 64.4
192.855 6.286 1.589 62.0
-134.999 2.214 1.805 62.0
-874.852 48.678 1 61.0
-285.712 3.893 1.755 38.0
-44.764 1.036 1.517 38.0
59.357 5.357 1 38.0
-45.071 1.250 1.589 32.0
166.174 1.536 1 32.0
164.284 5.000 1.658 30.0
-33.928 1.036 1.795 30.0
-85.047 5.133 1 30.0
30.464 5.357 1.670 33.4
162.202 3.071 1 32.6
-374.997 1.786 1.805 30.4
259.105 17.857 1 29.0
0 18.000 0 18.8
-17.214 1.714 1.713 21.0
-30.230 0.286 1 23.0
62.857 3.071 1.773 25.2
-466.815 40.08 1 25.2
25 changes: 25 additions & 0 deletions sandbox/lenses/nikon-zoom-80.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Nikon, PAT S.53-131852, F/2.8, 80-200mm (80)
# Modern Lens Design 2nd Ed.: p. 527-528; Figure 20.3
22 # lens size
148.570 5.0 1.564 64.4
-479.279 0.357 1 64.4
192.855 6.286 1.589 62.0
-134.999 2.214 1.805 62.0
-874.852 1.86 1 61.0
-285.712 3.893 1.755 38.0
-44.764 1.036 1.517 38.0
59.357 5.357 1 38.0
-45.071 1.250 1.589 32.0
166.174 36.928 1 32.0
164.284 5.000 1.658 30.0
-33.928 1.036 1.795 30.0
-85.047 16.55 1 30.0
30.464 5.357 1.670 33.4
162.202 3.071 1 32.6
-374.997 1.786 1.805 30.4
259.105 17.857 1 29.0
0 18.000 0 18.8
-17.214 1.714 1.713 21.0
-30.230 0.286 1 23.0
62.857 3.071 1.773 25.2
-466.815 40.08 1 25.2
3 changes: 3 additions & 0 deletions sandbox/lenses/none.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# no lens element, only aperture
1 # lens size
0 50 0 0.01
10 changes: 10 additions & 0 deletions sandbox/lenses/petzval-kodak.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# petzval-type photographic objective US2500046A (1948), scale 50%
8 # lens size
70.97 15.0 1.523 46.0
-56.79 4.5 1.617 46.0
0 24.0 1 46.0
0 25.3 0 36.0
119.91 3.8 1.649 30.0
40.87 0.9 1 30.0
46.87 7.4 1.697 30.0
-282.05 56.5 1 30.0
Loading