Skip to content

Feature/elen thresholding #152

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

abdullahelen
Copy link

Summary

This pull request adds a new global thresholding function, elen(), based on the method proposed by Elen & Dönmez (2024). It is implemented in thresholding.py and designed to align with Mahotas' thresholding interface.


Changes Made

  • ✅ Added elen() function to thresholding.py
  • ✅ Included unit test in test_thresholding.py
  • ✅ Updated __all__ list to expose the new method

Method Description

The method works by:

  • Computing the global mean and standard deviation of the image histogram
  • Defining an α-region: [mean − std, mean + std]
  • Computing average intensities of α and β (peripheral) regions
  • Setting the threshold as the mean of the α and β regional averages

Example Usage

import mahotas
t = mahotas.elen(image)
binary = (image > t)

Add elen thresholding method based on Elen & Donmez (2024)
Add unit test for elen thresholding method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant