Skip to content

Commit e5ddfd2

Browse files
committed
[panorama] small corrections
1 parent b6ed074 commit e5ddfd2

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ dependencies = [
2222
"toml ~= 0.10.2",
2323
"PyYAML ~= 6.0.2",
2424
"numpy ~= 2.0",
25+
"pillow ~= 11.0",
2526
"cloup ~= 3.0.7",
2627
"click-extra ~= 5.0.2"
2728
]

src/instrumentman/panorama/process.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Callable
44

55
from PIL import Image, ImageDraw, ImageFont
6-
from geocompy.data import Coordinate, Angle, Vector
6+
from geocompy.data import Coordinate, Angle
77

88

99
def read_points(
@@ -34,8 +34,8 @@ def read_points(
3434

3535
def read_metadata(
3636
path: Path
37-
) -> dict[str, tuple[Angle, Angle, Coordinate, Vector]]:
38-
pictures: dict[str, tuple[Angle, Angle, Coordinate, Vector]] = {}
37+
) -> dict[str, tuple[Angle, Angle, Coordinate, Coordinate]]:
38+
pictures: dict[str, tuple[Angle, Angle, Coordinate, Coordinate]] = {}
3939
with path.open("rt", encoding="utf8") as file:
4040
next(file)
4141
for line in file:
@@ -59,7 +59,7 @@ def read_metadata(
5959
float(pos_y),
6060
float(pos_z)
6161
),
62-
Vector(
62+
Coordinate(
6363
float(dir_x),
6464
float(dir_y),
6565
float(dir_z)
@@ -123,7 +123,7 @@ def draw_marker_cross(
123123

124124
def annotate_image(
125125
imgpath: Path,
126-
info: tuple[Angle, Angle, Coordinate, Vector],
126+
info: tuple[Angle, Angle, Coordinate, Coordinate],
127127
points: list[tuple[str, Coordinate]],
128128
markerdrawer: Callable[[ImageDraw.ImageDraw, float, float, str], None]
129129
) -> None:
@@ -135,7 +135,7 @@ def annotate_image(
135135
half_fov_hz = fov_hz / 2
136136
half_fov_v = fov_v / 2
137137

138-
img_hz, img_v, _ = (Coordinate.from_vector(vec) - pos).to_polar()
138+
img_hz, img_v, _ = (vec - pos).to_polar()
139139

140140
for pt, coord in points:
141141
pt_hz, pt_v, _ = (coord - pos).to_polar()
@@ -157,7 +157,7 @@ def annotate_image(
157157

158158

159159
def run_annotate(
160-
meta: dict[str, tuple[Angle, Angle, Coordinate, Vector]],
160+
meta: dict[str, tuple[Angle, Angle, Coordinate, Coordinate]],
161161
images: tuple[Path],
162162
points: list[tuple[str, Coordinate]],
163163
rgb: tuple[int, int, int] = (0, 0, 0),

0 commit comments

Comments
 (0)