From bfaf72cd9ab54703f80d8ea32d6190057cee7e81 Mon Sep 17 00:00:00 2001 From: Carien Mol Date: Wed, 13 Sep 2023 12:19:02 +0200 Subject: [PATCH] roi and nroi can be applied together --- birdwatcher/frames.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/birdwatcher/frames.py b/birdwatcher/frames.py index c59ef88..79113c1 100644 --- a/birdwatcher/frames.py +++ b/birdwatcher/frames.py @@ -565,10 +565,9 @@ def apply_backgroundsegmenter(self, bgs, fgmask=None, learningRate=-1.0, firstframe = self.peek_frame() completeframe = np.zeros((firstframe.shape[0], firstframe.shape[1]), dtype=np.uint8) - h1,h2,w1,w2 = roi - for frame in self._frames: if roi is not None: + h1,h2,w1,w2 = roi frame = frame[h1:h2, w1:w2] mask = bgs.apply(frame=frame, fgmask=fgmask, learningRate=learningRate)