Skip to content

Commit 0fbaace

Browse files
committed
Adds missing distortionOverscanMax. Update image to SVG and make suggested changes to OpenLensIO
1 parent 499ec60 commit 0fbaace

File tree

7 files changed

+776
-2
lines changed

7 files changed

+776
-2
lines changed

src/main/python/camdkit/examples.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def get_complete_static_example():
3131
clip.duration = Fraction(1,25)
3232
clip.fdl_link = uuid.uuid4().urn
3333
clip.iso = 4000
34+
clip.lens_distortion_overscan_max = 1.2
3435
clip.lens_make = "LensMaker"
3536
clip.lens_model = "Model15"
3637
clip.lens_nominal_focal_length = 14

src/main/python/camdkit/model.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,6 +1041,14 @@ class DistortionOverscan(NonNegativeRealParameter):
10411041
canonical_name = "distortionOverscan"
10421042
section = "lens"
10431043
units = None
1044+
1045+
class DistortionOverscanMaximum(NonNegativeRealParameter):
1046+
"""Static maximum overscan factor on lens distortion"""
1047+
1048+
sampling = Sampling.STATIC
1049+
canonical_name = "distortionOverscanMax"
1050+
section = "lens"
1051+
units = None
10441052

10451053
class LensExposureFalloff(Parameter):
10461054
"""Coefficients for calculating the exposure fall-off (vignetting) of
@@ -1297,6 +1305,7 @@ class Clip(ParameterContainer):
12971305
duration: typing.Optional[numbers.Rational] = Duration()
12981306
fdl_link: typing.Optional[str] = FDLLink()
12991307
iso: typing.Optional[numbers.Integral] = ISO()
1308+
lens_distortion_overscan_max: typing.Optional[numbers.Real] = DistortionOverscanMaximum()
13001309
lens_firmware: typing.Optional[str] = LensFirmware()
13011310
lens_make: typing.Optional[str] = LensMake()
13021311
lens_model: typing.Optional[str] = LensModel()
@@ -1311,7 +1320,7 @@ class Clip(ParameterContainer):
13111320
global_stage: typing.Optional[typing.Tuple[GlobalPosition]] = GlobalStagePosition()
13121321
lens_custom: typing.Optional[typing.Tuple[tuple]] = LensCustom()
13131322
lens_distortion: typing.Optional[typing.Tuple[Distortion]] = LensDistortion()
1314-
lens_distortion_overscan: typing.Optional[typing.Tuple[Orientations]] = DistortionOverscan()
1323+
lens_distortion_overscan: typing.Optional[typing.Tuple[numbers.Real]] = DistortionOverscan()
13151324
lens_distortion_shift: typing.Optional[typing.Tuple[DistortionShift]] = LensDistortionShift()
13161325
lens_encoders: typing.Optional[typing.Tuple[LensEncoders]] = LensEncoders()
13171326
lens_entrance_pupil_offset: typing.Optional[typing.Tuple[numbers.Real]] = EntrancePupilOffset()
-23.4 KB
Binary file not shown.

src/main/resources/img/Coordinate_System.svg

Lines changed: 748 additions & 0 deletions
Loading
15.2 KB
Binary file not shown.

src/test/python/test_model.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def test_serialize(self):
4444
clip.tracker_serial_number = "1234567890A"
4545
clip.fdl_link = "urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6"
4646
clip.iso = 13
47+
clip.lens_distortion_overscan_max = 1.2
4748
clip.lens_make = "ABC"
4849
clip.lens_model = "FGH"
4950
clip.lens_firmware = "1-dev.1"
@@ -128,6 +129,7 @@ def test_serialize(self):
128129
self.assertEqual(d["static"]["camera"]["serialNumber"], "132456")
129130
self.assertEqual(d["static"]["camera"]["firmwareVersion"], "7.1")
130131
self.assertEqual(d["static"]["camera"]["label"], "A")
132+
self.assertEqual(d["static"]["lens"]["distortionOverscanMax"], 1.2)
131133
self.assertEqual(d["static"]["lens"]["make"], "ABC")
132134
self.assertEqual(d["static"]["lens"]["model"], "FGH")
133135
self.assertEqual(d["static"]["lens"]["serialNumber"], "123456789")
@@ -865,6 +867,20 @@ def test_lens_distortion_overscan(self):
865867
clip.lens_distortion_overscan = value
866868
self.assertTupleEqual(clip.lens_distortion_overscan, value)
867869

870+
def test_lens_distortion_overscan_max(self):
871+
clip = Clip()
872+
873+
self.assertIsNone(clip.lens_distortion_overscan_max)
874+
875+
with self.assertRaises(ValueError):
876+
clip.lens_distortion_overscan_max = ""
877+
with self.assertRaises(ValueError):
878+
clip.lens_distortion_overscan_max = -1.0
879+
880+
value = 1.2
881+
clip.lens_distortion_overscan_max = value
882+
self.assertEqual(clip.lens_distortion_overscan_max, value)
883+
868884
def test_lens_exposure_falloff(self):
869885
clip = Clip()
870886

src/tools/python/templates/OpenTrackIO.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ <h2>OpenTrackIO protocol</h2>
4141
<p>All the fields described should be considered optional by the consumer (although for high-quality tracking for Virtual Production see the recommended set in the samples <a href="#recommended">below</a>).</p>
4242
<p>OpenTrackIO transforms employs a right-handed coordinate system where the Z axis points upwards and positive rotations are clockwise around the axis. Y points in the forward camera direction (when pan, tilt and roll are zero). For example in an LED volume Y would point towards the centre of the LED wall and so X would point to camera-right.</p>
4343
<p>OpenTrackIO employs the <a href="res/OpenLensIO_v0_9_0.pdf" target="_blank">OpenLensIO mathematical lens model</a> for the practical application of spherical lens distortion in Virtual Production.</p>
44-
<img class="img-inline" src="img/Coordinate_System.png" /><img class="img-inline" src="img/Axis_Rotation.svg" /></span>
44+
<img class="img-inline" src="img/Coordinate_System.svg" /><img class="img-inline" src="img/Axis_Rotation.svg" /></span>
4545

4646
<h2>Software resources</h2>
4747
<p>OpenTrackIO's parameters are defined by <a href="https://github.com/SMPTE/ris-osvp-metadata-camdkit" target="_blank">CamDKit</a>. This repository includes examples for <a href="https://github.com/SMPTE/ris-osvp-metadata-camdkit/tree/main/src/main/python/camdkit/mosys" target="_blank">generating</a> and parsing data in <a href="https://github.com/SMPTE/ris-osvp-metadata-camdkit/tree/main/src/test/python/parser" target="_blank">python</a> and <a href="https://github.com/SMPTE/ris-osvp-metadata-camdkit/tree/main/src/test/cpp/opentrackio-parser" target="_blank">C++</a>.</p>

0 commit comments

Comments
 (0)