4 KiB
4 KiB
Parameter Reference
This page documents the detection parameters defined in scanslicer/params.py (AutoslicerParams.SPECS).
Notes
- All values are integer-backed.
- Some parameters are context-sensitive and only apply to specific detection modes.
- Internal safeguards:
aspect_ratio_maxis clamped to be>= aspect_ratio_mincanny_highis clamped to be>= canny_low
Choice Parameters
detect_pipeline0: Threshold pipeline1: Canny pipeline
bw_method(threshold pipeline only)0: Simple threshold1: Adaptive Gaussian threshold2: Otsu threshold
invert_mode0: Auto (try normal polarity, then inverted fallback)1: Off (normal polarity only)2: On (force inverted polarity)
morph_op0: None1: Dilate2: Erode3: Open4: Close
Full Table
| Parameter | Default | Range | Step | Used In | Effect |
|---|---|---|---|---|---|
detect_pipeline |
0 |
0..1 |
1 |
global | Select threshold or Canny detection pipeline. |
clahe_clip |
0 |
0..40 |
1 |
preprocessing | CLAHE contrast boost (0 disables). Effective clip limit is value/10. |
gaussian |
0 |
0..100 |
1 |
preprocessing | Gaussian blur kernel size (0 disables). Even values are bumped to odd. |
bw_method |
0 |
0..2 |
1 |
threshold pipeline | Selects Simple, Adaptive Gaussian, or Otsu thresholding. |
bw_thresh |
210 |
0..255 |
5 |
threshold+simple | Binary threshold cutoff. |
bw_gauss |
64 |
0..1000 |
2 |
threshold+adaptive | Adaptive block size basis. Converted to odd and at least 3. |
bw_adaptive_c |
2 |
-20..20 |
1 |
threshold+adaptive | Adaptive threshold subtraction constant. |
canny_low |
50 |
0..255 |
5 |
Canny pipeline | Lower Canny hysteresis threshold. |
canny_high |
150 |
0..255 |
5 |
Canny pipeline | Upper Canny hysteresis threshold. |
invert_mode |
0 |
0..2 |
1 |
global | Controls polarity inversion behavior before contour extraction. |
morph_op |
1 |
0..4 |
1 |
global | Morphological operation on mask/edges. |
contour_approx_pct |
0 |
0..50 |
1 |
contour extraction | Polygon approximation epsilon percentage (value/1000). |
bbox_min_size |
2 |
0..100 |
1 |
contour filtering | Minimum candidate area as % of full image area. |
bbox_max_size |
90 |
1..100 |
1 |
contour filtering | Maximum candidate area as % of full image area. |
bbox_fill_thresh |
10 |
0..100 |
1 |
contour filtering | Minimum contour fill ratio within min-area box (%). |
expected_count |
0 |
0..20 |
1 |
scoring/autotune | Expected number of photos (0 means auto/unbounded heuristics). |
aspect_ratio_min |
100 |
100..1000 |
5 |
contour filtering | Minimum long/short aspect ratio, scaled by x100. |
aspect_ratio_max |
400 |
100..1000 |
5 |
contour filtering | Maximum long/short aspect ratio, scaled by x100. |
border_ignore |
0 |
0..20 |
1 |
contour filtering | Ignore candidates touching image edges within this margin (%). |
iou_merge_thresh |
30 |
0..100 |
1 |
contour dedup | Merge overlap threshold as IoU percentage. |
dilate_kernel |
30 |
0..500 |
1 |
morphology | Morph kernel size for selected morph operation (0 disables morphology). |
Advanced Parameters in UI
The UI can hide/show advanced controls. Advanced set:
detect_pipelineclahe_clipgaussianbw_adaptive_cinvert_modecontour_approx_pctbbox_max_sizeaspect_ratio_minaspect_ratio_maxborder_ignoreiou_merge_thresh
Practical Tuning Guidance
- Too many tiny false positives:
- Increase
bbox_min_size - Increase
bbox_fill_thresh - Increase
iou_merge_thresh
- Increase
- Missed photos:
- Lower
bbox_min_size - Broaden
aspect_ratio_min/max - Try
detect_pipeline=1(Canny) - Try
invert_mode=2
- Lower
- Border/frame artifacts:
- Increase
border_ignore - Switch morphology operation/kernel
- Increase
- Uneven illumination:
- Use adaptive mode (
bw_method=1) - Enable modest
clahe_clip
- Use adaptive mode (