Skip to content

Commit

Permalink
Set default epsilon value to 2.0 for polygon approximation, enhancing…
Browse files Browse the repository at this point in the history
… accuracy for smaller shapes such as flies.
  • Loading branch information
healthonrails committed Mar 1, 2024
1 parent 688f33c commit b7ca663
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion annolid/gui/shape.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def paint(self, painter):
if qimage is not None:
painter.drawImage(QtCore.QPoint(0, 0), qimage)

def toPolygons(self, epsilon=4.7):
def toPolygons(self, epsilon=2.0):
# Fill the holes inside the mask
filled_mask = cv2.morphologyEx((self.mask*255).astype(
np.uint8), cv2.MORPH_CLOSE, cv2.getStructuringElement(cv2.MORPH_ELLIPSE, (5, 5)))
Expand Down

0 comments on commit b7ca663

Please sign in to comment.