Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 9 additions & 0 deletions S3MP/utils/image_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def __init__(
focal_length: float | None = None,
altitude: float | None = None,
distortion_params: DistortionParams | None = None,
dewarp_flag: bool = False,
):
"""Initialize ImageMetadata object.

Expand All @@ -37,6 +38,7 @@ def __init__(
focal_length: Focal length in pixels if available
altitude: Altitude in meters if available
distortion_params: Distortion parameters if available
dewarp_flag: Flag indicating if image should be dewarped based on metadata
"""
self.mirror_path = mirror_path
self.name = self.mirror_path.local_path.stem
Expand All @@ -63,6 +65,7 @@ def __init__(
self.focal_length = focal_length
self.altitude = altitude
self.distortion_params = distortion_params
self.dewarp_flag = dewarp_flag

@classmethod
def parse_metadata(cls, mirror_path: MirrorPath) -> ImageMetadata:
Expand All @@ -84,6 +87,11 @@ def parse_metadata(cls, mirror_path: MirrorPath) -> ImageMetadata:
except Exception:
distortion_params = None

try:
dewarp_flag = parser.dewarp_flag()
except KeyError:
dewarp_flag = False

return cls(
mirror_path,
parser.dimensions(),
Expand All @@ -94,6 +102,7 @@ def parse_metadata(cls, mirror_path: MirrorPath) -> ImageMetadata:
parser.focal_length_pixels(),
parser.relative_altitude(),
distortion_params,
dewarp_flag,
)

@property
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "S3MP"
version = "0.8.0"
version = "0.8.1"
description = ""
authors = [
{name = "Joshua Dean", email = "joshua.dean@sentera.com"},
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.