Skip to content

Commit

Permalink
Merge pull request #323 from GSTT-CSC/322-li-threhsold-too-low
Browse files Browse the repository at this point in the history
Increase starting threshold to 0.5 quantile
  • Loading branch information
laurencejackson authored Feb 27, 2023
2 parents 6a25640 + 5566bc4 commit ffe6e04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hazenlib/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def find_contours(self):
# convert the resized image to grayscale, blur it slightly, and threshold it
self.blurred = cv.GaussianBlur(self.arr.copy(), (5, 5), 0) # magic numbers

optimal_threshold = filters.threshold_li(self.blurred, initial_guess=np.quantile(self.blurred, 0.25))
optimal_threshold = filters.threshold_li(self.blurred, initial_guess=np.quantile(self.blurred, 0.50))
self.thresh = np.where(self.blurred > optimal_threshold, 255, 0).astype(np.uint8)

# have to convert type for find contours
Expand Down

2 comments on commit ffe6e04

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.