Commit 005e4bad authored by Andy Regensky's avatar Andy Regensky
Browse files

New feature: Customizable perspective viewports.

For more information on viewport-adaptive motion compensation, see:
A. Regensky, C. Herglotz and A. Kaup, "A Novel Viewport-Adaptive Motion
Compensation Technique for Fisheye Video," ICASSP 2021 - 2021 IEEE
International Conference on Acoustics, Speech and Signal Processing
(ICASSP), 2021, pp. 1565-1569, doi: 10.1109/ICASSP39728.2021.9413576.
parent c8fbf6ec
......@@ -98,6 +98,7 @@ class BlockComparisonViewModel(QObject):
self.mainViewModel.center,
self.mainViewModel.control_point_motion_vectors,
self.mainViewModel.motion_model,
None,
interpolation
)
worker.signals.didFinish.connect(self.tmcBlockInterpolationDidFinish)
......@@ -114,6 +115,7 @@ class BlockComparisonViewModel(QObject):
self.mainViewModel.center,
self.mainViewModel.control_point_motion_vectors,
self.mainViewModel.motion_model,
self.mainViewModel.viewport,
interpolation
)
worker.signals.didFinish.connect(self.ptmcBlockInterpolationDidFinish)
......
......@@ -34,7 +34,7 @@ from PySide2.QtCore import QObject, Signal, QThreadPool, Slot
import numpy as np
from fishui import projections
from fishui.workers import BlockProjectionWorker, InterpolationWorker
from fishui.model import motion_models
from fishui.model import motion_models, viewports
class MainViewModel(QObject):
......@@ -71,7 +71,7 @@ class MainViewModel(QObject):
self.origin = (512, 512)
self.blocksize = (64, 64)
self.viewport = 'front_back'
self.viewport = next(iter(viewports.keys())) # First viewport in dict
self.motion_model = next(iter(motion_models.keys())) # First motion model in dict
self.control_point_motion_vectors = np.zeros((3, 2), dtype=int)
......@@ -93,7 +93,7 @@ class MainViewModel(QObject):
self.block_ctr_pym = None
self.block_yfm_tmc = None
self.block_xfm_tmc = None
self.uwc_sign = None
self.vip = None
self.updateBlockProjection()
# Background images
......@@ -119,23 +119,23 @@ class MainViewModel(QObject):
@property
def focal_length_px(self):
return projections.Projection.to_focal_length_px(self.focal_length_mm,
self.sensor_size_mm,
self.sensor_size_px)
return (self.sensor_size_px[0]/self.sensor_size_mm[0]) * self.focal_length_mm
@property
def projection(self):
if self.projection_key == 'calibrated':
px_per_mm = self.sensor_size_px[0] / self.sensor_size_mm[0]
calib_coeffs = self.calibration_coeffs * px_per_mm
projection = projections.CalibratedProjection(calib_coeffs, self.focal_length_px)
calib_coeffs = self.calibration_coeffs
projection = projections.CalibratedProjection(calib_coeffs,
self.sensor_size_mm, self.sensor_size_px,
self.focal_length_mm,
self.center)
else:
projection = self.projections[self.projection_key](self.focal_length_px)
projection = self.projections[self.projection_key](self.focal_length_px, self.center)
return projection
@property
def perspective(self):
return projections.PerspectiveProjection(self.focal_length_px)
return projections.PerspectiveProjection(self.focal_length_px, self.center)
@property
def fov_180_radius(self):
......@@ -190,6 +190,12 @@ class MainViewModel(QObject):
self.propertiesDidChange.emit()
self.updateBlockProjection()
def setViewport(self, viewport):
self.viewport = viewport
self.propertiesDidChange.emit()
self.updateBlockProjection()
self.updatePerspectiveImages()
def setMotionModel(self, motion_model):
self.motion_model = motion_model
self.propertiesDidChange.emit()
......@@ -216,7 +222,8 @@ class MainViewModel(QObject):
self.blocksize,
self.center,
self.control_point_motion_vectors,
self.motion_model)
self.motion_model,
self.viewport)
worker.signals.didFinish.connect(self.blockProjectionDidFinish)
self.bp_threadpool.start(worker)
......@@ -236,6 +243,7 @@ class MainViewModel(QObject):
self.block_ctr_pxm = result.block_ctr_pxm
self.block_yfm_tmc = result.block_yfm_tmc
self.block_xfm_tmc = result.block_xfm_tmc
self.vip = result.vip
self.blockProjectionsDidChange.emit()
def setFisheyeImages(self, images):
......@@ -277,7 +285,8 @@ class MainViewModel(QObject):
self.imagesDidChange.emit()
for image_file in self._fisheye_images:
for scale in range(1, 11):
worker = InterpolationWorker(image_file, scale, self.perspective, self.projection, self.center)
worker = InterpolationWorker(image_file, scale, self.perspective, self.projection, self.center,
self.viewport)
worker.signals.didFinish.connect(self.interpolationDidFinish)
self.ip_threadpool.start(worker)
......
# Copyright (c) 2020-2021 Chair of Multimedia Communications and Signal Processing (LMS),
# Friedrich-Alexander-University Erlangen-Nürnberg (FAU).
# All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
......@@ -33,16 +32,45 @@ import numpy as np
from typing import Union, Tuple
def cartesian_to_polar(y: Union[float, np.ndarray], x: Union[float, np.ndarray]) -> Tuple[Union[float, np.ndarray], Union[float, np.ndarray]]:
def cartesian_to_polar(
y: Union[float, np.ndarray],
x: Union[float, np.ndarray]
) -> Tuple[Union[float, np.ndarray], Union[float, np.ndarray]]:
"""Convert cartesian coordinates [y, x] to polar coordinates [r, phi]."""
r = np.sqrt(np.square(y) + np.square(x))
phi = np.arctan2(y, x)
return r, phi
def polar_to_cartesian(r: Union[float, np.ndarray], phi: Union[float, np.ndarray]) -> Tuple[Union[float, np.ndarray], Union[float, np.ndarray]]:
def polar_to_cartesian(
r: Union[float, np.ndarray],
phi: Union[float, np.ndarray]
) -> Tuple[Union[float, np.ndarray], Union[float, np.ndarray]]:
"""Convert polar coordinates [r, phi] to cartesian coordinates [y, x]."""
y = r * np.sin(phi)
x = r * np.cos(phi)
return y, x
def cartesian_to_spherical(
x: Union[float, np.ndarray],
y: Union[float, np.ndarray],
z: Union[float, np.ndarray]
) -> Tuple[Union[float, np.ndarray], Union[float, np.ndarray], Union[float, np.ndarray]]:
"""Convert cartesian coordinates [x, y, z] to spherical coordinates [r, theta, phi]."""
r = np.sqrt(np.square(x) + np.square(y) + np.square(z))
theta = np.arccos(z / r)
phi = np.arctan2(y, x)
return r, theta, phi
def spherical_to_cartesian(
r: Union[float, np.ndarray],
theta: Union[float, np.ndarray],
phi: Union[float, np.ndarray]
) -> Tuple[Union[float, np.ndarray], Union[float, np.ndarray], Union[float, np.ndarray]]:
"""Convert spherical coordinates [r, theta, phi] to cartesian coordinates [x, y, z]."""
x = r * np.sin(theta) * np.cos(phi)
y = r * np.sin(theta) * np.sin(phi)
z = r * np.cos(theta)
return x, y, z
# Copyright (c) 2020-2021 Chair of Multimedia Communications and Signal Processing (LMS),
# Friedrich-Alexander-University Erlangen-Nürnberg (FAU).
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
import numpy as np
from scipy.spatial.transform import Rotation as R
class Viewport:
def __init__(self, rotvec):
self.rotvec = rotvec
def to_viewport(self, xs, ys, zs):
rot = R.from_rotvec(self.rotvec)
v = np.stack((xs, ys, zs), axis=-1).reshape((-1, 3))
vr = rot.apply(v, inverse=True)
vr = vr.reshape(np.append(xs.shape, 3))
xs = vr[..., 0]
ys = vr[..., 1]
zs = vr[..., 2]
return xs, ys, zs
def from_viewport(self, xs, ys, zs):
rot = R.from_rotvec(self.rotvec)
vr = np.stack((xs, ys, zs), axis=-1).reshape((-1, 3))
v = rot.apply(vr)
v = v.reshape(np.append(xs.shape, 3))
xs = v[..., 0]
ys = v[..., 1]
zs = v[..., 2]
return xs, ys, zs
viewports = {
'front': Viewport(np.deg2rad(0) * np.array([0, 0, 0])),
'back': Viewport(np.deg2rad(180) * np.array([0, 0, 1])),
'left': Viewport(np.deg2rad(90) * np.array([0, 0, 1])),
'right': Viewport(np.deg2rad(-90) * np.array([0, 0, 1])),
'bottom': Viewport(np.deg2rad(-90) * np.array([0, 1, 0])),
'top': Viewport(np.deg2rad(90) * np.array([0, 1, 0]))
}
......@@ -28,3 +28,4 @@
# THE POSSIBILITY OF SUCH DAMAGE.
from .MotionModel import motion_models
from .Viewport import viewports
# Copyright (c) 2020-2021 Chair of Multimedia Communications and Signal Processing (LMS),
# Friedrich-Alexander-University Erlangen-Nürnberg (FAU).
# All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
......@@ -32,33 +31,45 @@
from typing import Union, Tuple
import warnings
import numpy as np
from .Projection import Projection
from .Projection import RadialProjection
class CalibratedProjection(Projection):
class CalibratedProjection(RadialProjection):
"""
Defines a calibrated projection model.
"""
# Note: We override __init__ despite advising against it in Projection.py
def __init__(self,
polynom_coeffs: Union[np.ndarray, Tuple],
focal_length_px: float):
sensor_size_mm: Tuple[float, float],
sensor_size_px: Tuple[int, int],
focal_length_mm: float,
optical_center: Tuple[float, float] = None):
"""
Initialize a new calibrated projection.
Initialize a new calibrated projection (up to 200 degrees FOV).
WE OVERRIDE INIT DESPITE ADVISING AGAINST IT IN Projection.py
:param polynom_coeffs: coefficients in decreasing powers of the
polynomial relating incident angle to sensor radius in px
:param focal_length_px: focal length in px
polynomial relating incident angle to sensor radius in mm
:param sensor_size_mm: sensor size in mm
:param sensor_size_px: sensor size in pixels
:param focal_length_mm: focal length in mm
"""
super().__init__(focal_length_px)
if not np.isclose(sensor_size_px[0]/sensor_size_mm[0], sensor_size_px[1]/sensor_size_mm[1]):
raise Exception("Pixel shape must be square.")
self._px_per_mm = sensor_size_px[0]/sensor_size_mm[0]
focal_length_px = self._px_per_mm * focal_length_mm
if optical_center is None:
optical_center = ((sensor_size_px[0] - 1) / 2, (sensor_size_px[1] - 1) / 2)
super().__init__(focal_length_px, optical_center)
# Get forward polynomial directly from calibrated coefficients.
self._forward_poly = np.poly1d(polynom_coeffs)
# Get backward polynomial by matching a polynomial inversely to the
# results of the forward polynomial.
theta_help = np.linspace(0, np.deg2rad(180), 10000)
theta_help = np.linspace(0, np.deg2rad(100), 10000)
radius_help = self._forward_poly(theta_help)
warnings.filterwarnings("ignore", category=np.RankWarning) # Filter rank warnings.
backward_coeffs = np.polyfit(radius_help, theta_help, (len(polynom_coeffs) - 1) * 2)
......@@ -66,7 +77,7 @@ class CalibratedProjection(Projection):
self._backward_poly = np.poly1d(backward_coeffs)
def radius(self, theta: Union[float, np.ndarray]) -> Union[float, np.ndarray]:
return self._forward_poly(theta)
return self._px_per_mm * self._forward_poly(theta)
def theta(self, radius: Union[float, np.ndarray]) -> Union[float, np.ndarray]:
return self._backward_poly(radius)
return self._backward_poly(radius / self._px_per_mm)
# Copyright (c) 2020-2021 Chair of Multimedia Communications and Signal Processing (LMS),
# Friedrich-Alexander-University Erlangen-Nürnberg (FAU).
# All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
......@@ -29,16 +28,31 @@
# THE POSSIBILITY OF SUCH DAMAGE.
from .Projection import Projection
from .Projection import RadialProjection
from typing import Union, Tuple
import numpy as np
class EquidistantProjection(Projection):
class EquidistantProjection(RadialProjection):
"""
Defines the equidistant projection model.
"""
@classmethod
def init_with(cls, sensor_size_mm: Tuple[float, float], sensor_size_px: Tuple[int, int], focal_length_mm: float):
"""
Specify new equidistant projection model with
:param sensor_size_mm: sensor size in mm [height, width]
:param sensor_size_px: sensor size in pixels [height, width]
:param focal_length_mm: focal length in mm
"""
if sensor_size_px[0]/sensor_size_mm[0] != sensor_size_px[1]/sensor_size_mm[1]:
raise Exception("Pixel shape must be square.")
focal_length_px = sensor_size_px[0]/sensor_size_mm[0] * focal_length_mm
optical_center = ((sensor_size_px[0] - 1) / 2, (sensor_size_px[1] - 1) / 2)
return cls(focal_length_px, optical_center)
def radius(self, theta: Union[float, np.ndarray]) -> Union[float, np.ndarray]:
return self.focal_length_px * theta
......
# Copyright (c) 2020-2021 Chair of Multimedia Communications and Signal Processing (LMS),
# Friedrich-Alexander-University Erlangen-Nürnberg (FAU).
# All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
......@@ -29,16 +28,31 @@
# THE POSSIBILITY OF SUCH DAMAGE.
from .Projection import Projection
from .Projection import RadialProjection
from typing import Union, Tuple
import numpy as np
class EquisolidProjection(Projection):
class EquisolidProjection(RadialProjection):
"""
Defines the equisolid projection model.
"""
@classmethod
def init_with(cls, sensor_size_mm: Tuple[float, float], sensor_size_px: Tuple[int, int], focal_length_mm: float):
"""
Specify new equisolid projection model with
:param sensor_size_mm: sensor size in mm [height, width]
:param sensor_size_px: sensor size in pixels [height, width]
:param focal_length_mm: focal length in mm
"""
if sensor_size_px[0]/sensor_size_mm[0] != sensor_size_px[1]/sensor_size_mm[1]:
raise Exception("Pixel shape must be square.")
focal_length_px = sensor_size_px[0]/sensor_size_mm[0] * focal_length_mm
optical_center = ((sensor_size_px[0] - 1) / 2, (sensor_size_px[1] - 1) / 2)
return cls(focal_length_px, optical_center)
def radius(self, theta: Union[float, np.ndarray]) -> Union[float, np.ndarray]:
return 2 * self.focal_length_px * np.sin(theta / 2)
......
# Copyright (c) 2020-2021 Chair of Multimedia Communications and Signal Processing (LMS),
# Friedrich-Alexander-University Erlangen-Nürnberg (FAU).
# All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
......@@ -29,16 +28,35 @@
# THE POSSIBILITY OF SUCH DAMAGE.
from .Projection import Projection
from .Projection import RadialProjection
from typing import Union, Tuple
import numpy as np
class OrthographicProjection(Projection):
class OrthographicProjection(RadialProjection):
"""
Defines the orthographic projection model.
"""
@classmethod
def init_with(cls, sensor_size_mm: Tuple[float, float], sensor_size_px: Tuple[int, int], focal_length_mm: float):
"""
Specify new orthographic projection model with
:param sensor_size_mm: sensor size in mm [height, width]
:param sensor_size_px: sensor size in pixels [height, width]
:param focal_length_mm: focal length in mm
"""
if sensor_size_px[0]/sensor_size_mm[0] != sensor_size_px[1]/sensor_size_mm[1]:
raise Exception("Pixel shape must be square.")
focal_length_px = sensor_size_px[0]/sensor_size_mm[0] * focal_length_mm
optical_center = ((sensor_size_px[0] - 1) / 2, (sensor_size_px[1] - 1) / 2)
return cls(focal_length_px, optical_center)
@property
def max_theta(self):
return 90
def radius(self, theta: Union[float, np.ndarray]) -> Union[float, np.ndarray]:
return self.focal_length_px * np.sin(theta)
......
# Copyright (c) 2020-2021 Chair of Multimedia Communications and Signal Processing (LMS),
# Friedrich-Alexander-University Erlangen-Nürnberg (FAU).
# All rights reserved.
#
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
#
# 3. Neither the name of the copyright holder nor the names of its contributors
# may be used to endorse or promote products derived from this software without
# specific prior written permission.
#
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
......@@ -29,18 +28,67 @@
# THE POSSIBILITY OF SUCH DAMAGE.
from .Projection import Projection
from typing import Union, Tuple
from .Projection import RadialProjection
from typing import Optional, Union, Tuple
import numpy as np
from .. import coordinate_conversion
class PerspectiveProjection(Projection):
class PerspectiveProjection(RadialProjection):
"""
Defines the perspective projection model.
"""
@classmethod
def init_with(cls, sensor_size_mm: Tuple[float, float], sensor_size_px: Tuple[int, int], focal_length_mm: float):
"""
Specify new perspective projection model with
:param sensor_size_mm: sensor size in mm [height, width]
:param sensor_size_px: sensor size in pixels [height, width]
:param focal_length_mm: focal length in mm
"""
if sensor_size_px[0]/sensor_size_mm[0] != sensor_size_px[1]/sensor_size_mm[1]:
raise Exception("Pixel shape must be square.")
focal_length_px = sensor_size_px[0]/sensor_size_mm[0] * focal_length_mm
optical_center = ((sensor_size_px[0] - 1) / 2, (sensor_size_px[1] - 1) / 2)
return cls(focal_length_px, optical_center)
@property
def optical_center(self):
return self._optical_center
def radius(self, theta: Union[float, np.ndarray]) -> Union[float, np.ndarray]: