Repository navigation
Commit 4fd2f1b
committed
Fix index swap, component off-by-one, and QE infinity in pipeline
helpers.py:
- _clip_region: fix image[rx,ry] → image[ry,rx] in the threshold
check so it is consistent with the stats computation; previously
stats were computed on image[ry,rx] (y,x) but the mask was applied
to image[rx,ry] (x,y), clipping the wrong pixels
- grad_clip_fill_bkg: fix component size filter to cover all labeled
regions 1..n_objects; previous [:n_objects] slice excluded the last
real component and included the background (label 0), allowing the
final artifact to bypass size filtering
tessreduce.py:
- _calc_qe: replace zero-only guard with np.isfinite check so
infinities produced by division by zero background are also
converted to NaN before sigma-clipping; suppress the runtime warning
with np.errstate1 parent 0587f29 commit 4fd2f1b
2 files changed
Lines changed: 10 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1116 | 1116 | | |
1117 | 1117 | | |
1118 | 1118 | | |
1119 | | - | |
| 1119 | + | |
1120 | 1120 | | |
1121 | 1121 | | |
1122 | 1122 | | |
| |||
1221 | 1221 | | |
1222 | 1222 | | |
1223 | 1223 | | |
1224 | | - | |
1225 | | - | |
1226 | | - | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
1227 | 1227 | | |
1228 | | - | |
1229 | | - | |
| 1228 | + | |
| 1229 | + | |
1230 | 1230 | | |
1231 | 1231 | | |
1232 | 1232 | | |
1233 | | - | |
| 1233 | + | |
1234 | 1234 | | |
1235 | 1235 | | |
1236 | 1236 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
671 | 671 | | |
672 | 672 | | |
673 | 673 | | |
674 | | - | |
675 | | - | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
676 | 677 | | |
677 | 678 | | |
678 | 679 | | |
| |||
0 commit comments