From fc3ca8cbe7d97a960fab7f93c0babe557be6be60 Mon Sep 17 00:00:00 2001 From: Julian Stirling Date: Sun, 28 Dec 2025 21:40:26 +0000 Subject: [PATCH] Slightly increase glyph shape so that blob cannot touch edge --- .../things/camera/simulation.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/openflexure_microscope_server/things/camera/simulation.py b/src/openflexure_microscope_server/things/camera/simulation.py index 9f43a940..c5ebea90 100644 --- a/src/openflexure_microscope_server/things/camera/simulation.py +++ b/src/openflexure_microscope_server/things/camera/simulation.py @@ -124,7 +124,7 @@ class SimulatedCamera(BaseCamera): super().__init__(thing_server_interface) self.shape = shape self.ds_shape = _downsample_shape(shape) - self.glyph_size = 101 // DOWNSAMPLE + self.glyph_size = 105 // DOWNSAMPLE self.canvas_shape = _downsample_shape(canvas_shape) self.frame_interval = frame_interval @@ -202,7 +202,14 @@ class SimulatedCamera(BaseCamera): sprite_pil = sprite_pil.resize( (self.glyph_size, self.glyph_size), Image.BILINEAR ) - self.sprites.append(np.array(sprite_pil)) + # Concert back and ensure all edges are zero as these are repeated at sample + # edge + sprite = np.array(sprite_pil) + sprite[0, :] = 0 + sprite[-1, :] = 0 + sprite[:, 0] = 0 + sprite[:, -1] = 0 + self.sprites.append(sprite) def generate_blobs(self, n_blobs: int = 1000) -> None: """Generate coordinates of blobs and their sizes, centered around (0,0).