forked from jkbstepien/rustoscope
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Summary
Provide an algorithm that automatically estimates a background/offset level and computes a threshold to remove background pixels. A simple and robust approach is to sample pixel strips near the image borders (or configurable regions), estimate a background value (median, mode, or robust mean), and set the threshold as background + k * sigma (or user-adjustable factor). This helps users remove background noise without manual threshold tuning.
User story
As a user, I want the app to automatically compute a reasonable threshold for masking or zeroing low-intensity background pixels so I can quickly focus on signal features without manually guessing threshold values.
Algorithm ideas
- Edge-strips sampling (default): sample N rows/cols from each border (top, bottom, left, right) and aggregate samples to estimate background distribution.
- Histogram-based: compute histogram, find the dominant low-intensity peak (mode) and set threshold at mode + k * sigma.
- Adaptive local: compute local background per tile and combine (more complex, optional).
UI
- "Auto threshold" option in algorithms menu or new button that computes and previews threshold.
- Allow user to accept or fine-tune the computed threshold.
Edge cases
- Images with signal near edges: allow specifying sampling regions or excluding specific edges (optionally, as target images have valuable data centered).
- 16-bit images: scale computations to appropriate range.
- Very small images: fallback to global histogram method.
Acceptance criteria
- The auto computed threshold removes most of the background in representative test images.
- UI allows previewing and adjusting before applying.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels