Skip to content

Commit

Permalink
increase starting threshold to 0.5 quantile
Browse files Browse the repository at this point in the history
  • Loading branch information
Laurence Jackson committed Feb 27, 2023
1 parent 6a25640 commit 5566bc4
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

0 comments on commit 5566bc4

Please sign in to comment.