|
49 | 49 |
|
50 | 50 | BLACK = QColor(Qt.GlobalColor.black) |
51 | 51 |
|
| 52 | +SHIPWRECK_BOW_LENGTH_CM = 30 + 16.6 |
| 53 | + |
52 | 54 |
|
53 | 55 | class Eye(IntEnum): |
54 | 56 | LEFT = 0 |
@@ -102,6 +104,10 @@ def has_all_points( |
102 | 104 | ) |
103 | 105 |
|
104 | 106 |
|
| 107 | +def format_length(length: float) -> str: |
| 108 | + return f'{length}, {length + SHIPWRECK_BOW_LENGTH_CM}' |
| 109 | + |
| 110 | + |
105 | 111 | class ShipwreckTab(QWidget): |
106 | 112 | click_left_signal = pyqtSignal(QMouseEvent) |
107 | 113 | click_right_signal = pyqtSignal(QMouseEvent) |
@@ -453,7 +459,7 @@ def calc_world_points(self) -> None: |
453 | 459 | self.world_points_label.setText( |
454 | 460 | f'3D (mm): {"\t".join([str(point) for point in world_points])}' |
455 | 461 | ) |
456 | | - self.length_label.setText(f'Length (mm): {length}') |
| 462 | + self.length_label.setText(f'Length (mm): {format_length(length)}') |
457 | 463 |
|
458 | 464 | ds: dict[Eye, list[float]] = {Eye.LEFT: [], Eye.RIGHT: []} |
459 | 465 | thetas: dict[Eye, list[float]] = {Eye.LEFT: [], Eye.RIGHT: []} |
@@ -481,9 +487,11 @@ def calc_world_points(self) -> None: |
481 | 487 | self.underwater_world_points_label.setText( |
482 | 488 | f'3D (mm): {"\t".join([str(point) for point in uw_world_points])}' |
483 | 489 | ) |
484 | | - self.underwater_length_label.setText(f'Length (mm): {uw_length}') |
| 490 | + self.underwater_length_label.setText(f'Length (mm): {format_length(uw_length)}') |
485 | 491 |
|
486 | | - self.scaled_length_label.setText(f'Length (mm): {uw_length * LENGTH_SCALE_FACTOR}') |
| 492 | + self.scaled_length_label.setText( |
| 493 | + 'Length (mm): ' + format_length(uw_length * LENGTH_SCALE_FACTOR) |
| 494 | + ) |
487 | 495 |
|
488 | 496 | @staticmethod |
489 | 497 | def solve_stereo_projection( |
|
0 commit comments