Skip to content

Commit

Permalink
cropobject.scale() method: safer interpolation option
Browse files Browse the repository at this point in the history
  • Loading branch information
hajicj committed Oct 9, 2018
1 parent a8242a3 commit 3b95bd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions muscima/cropobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -1088,8 +1088,8 @@ def scale(self, zoom=1.0):
"""Re-compute the CropObject with the given scaling factor."""
mask = self.mask * 1
import cv2
new_mask = cv2.resize(mask.astype('float32'), dsize=None, fx=zoom, fy=zoom,
interpolation=cv2.INTER_AREA)
new_mask = cv2.resize(mask.astype('float32'), dsize=None, fx=zoom, fy=zoom)
# interpolation=cv2.INTER_AREA)
new_mask[new_mask >= 0.5] = 1
new_mask[new_mask < 0.5] = 0

Expand Down

0 comments on commit 3b95bd1

Please sign in to comment.