diff --git a/pyproject.toml b/pyproject.toml index b08029d..9bcd870 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,13 +4,13 @@ build-backend = "setuptools.build_meta" [project] name = "pyptv" -version = "0.2.5" +version = "0.2.6" description = "Python GUI for the OpenPTV library `liboptv`" authors = [ { name = "Alex Liberzon", email = "alex.liberzon@gmail.com" } ] readme = "README.md" -requires-python = ">=3.6" +requires-python = ">=3.8" keywords = ["pyptv"] classifiers = [ "Programming Language :: Python :: 3" diff --git a/pyptv/calibration_gui.py b/pyptv/calibration_gui.py index b60664b..d207635 100644 --- a/pyptv/calibration_gui.py +++ b/pyptv/calibration_gui.py @@ -287,7 +287,7 @@ def handle_mapper(self): coord_y1, ) - def plot_num_overlay(self, x, y, txt): + def plot_num_overlay(self, x, y, txt, text_color="white", border_color="red"): for i in range(len(x)): coord_x, coord_y = self._plot.map_screen([(x[i], y[i])])[0] ovlay = TextBoxOverlay( @@ -295,8 +295,8 @@ def plot_num_overlay(self, x, y, txt): text=str(txt[i]), alternate_position=(coord_x, coord_y), real_position=(x[i], y[i]), - text_color="white", - border_color="red", + text_color=text_color, + border_color=border_color, ) self._plot.overlays.append(ovlay) @@ -708,7 +708,7 @@ def _button_init_guess_fired(self): self._project_cal_points(i_cam) def _project_cal_points(self, i_cam, color="orange"): - x, y = [], [] + x, y, pnr = [], [], [] for row in self.cal_points: projected = image_coordinates( np.atleast_2d(row["pos"]), @@ -719,10 +719,13 @@ def _project_cal_points(self, i_cam, color="orange"): x.append(pos[0][0]) y.append(pos[0][1]) + pnr.append(row["id"]) # x.append(x1) # y.append(y1) self.drawcross("init_x", "init_y", x, y, color, 3, i_cam=i_cam) + self.camera[i_cam].plot_num_overlay(x, y, pnr) + self.status_text = "Initial guess finished." def _button_sort_grid_fired(self): @@ -1368,8 +1371,7 @@ def _read_cal_points(self): import sys if len(sys.argv) == 1: - # active_path = Path("../test_cavity/parametersRun1") - active_path = Path("/home/user/Documents/repos/multiplane_example_2/parametersmultiplane") + active_path = Path("../test_cavity/parametersRun1") else: active_path = Path(sys.argv[0]) diff --git a/pyptv/detection_gui.py b/pyptv/detection_gui.py index f7496c8..5051b32 100644 --- a/pyptv/detection_gui.py +++ b/pyptv/detection_gui.py @@ -250,14 +250,14 @@ def handle_mapper(self): self._plot.overlays[i].alternate_position = ( coord_x1, coord_y1) - def plot_num_overlay(self, x, y, txt): + def plot_num_overlay(self, x, y, txt, text_color="white", border_color="red"): for i in range(0, len(x)): coord_x, coord_y = self._plot.map_screen([(x[i], y[i])])[0] ovlay = TextBoxOverlay(component=self._plot, text=str(txt[i]), alternate_position=(coord_x, coord_y), real_position=(x[i], y[i]), - text_color="white", - border_color="red" + text_color=text_color, + border_color=border_color, ) self._plot.overlays.append(ovlay)