Summary
sigima/tools/image/detection.py::__blobs_to_coords returns scikit-image's sigma as if it were a blob radius:
def __blobs_to_coords(blobs: np.ndarray) -> np.ndarray:
cy, cx, radii = blobs.T
coords = np.vstack([cx, cy, radii]).T
return coords
The third column produced by skimage.feature.blob_log, blob_dog and blob_doh is the scale σ at which the blob was detected, not its radius:
- for
blob_log and blob_dog, the blob radius is approximately √2 · σ;
- for
blob_doh, the blob radius is approximately σ.
The conversion factor therefore differs per method, and none is currently applied. The docstrings of find_blobs_log / find_blobs_dog / find_blobs_doh add to the confusion by describing the min_sigma / max_sigma parameters as "the minimum/maximum blob radius in pixels".
Why this is tracked separately
Applying the correct conversion changes user-visible results: the radius of the circles drawn over detected blobs, and the size of the ROIs auto-generated around them via create_image_roi_around_points. It is therefore a behaviour change, not a documentation fix.
The documentation-only part is handled in the "assorted minor issues" issue.
Scope
Summary
sigima/tools/image/detection.py::__blobs_to_coordsreturns scikit-image's sigma as if it were a blob radius:The third column produced by
skimage.feature.blob_log,blob_dogandblob_dohis the scale σ at which the blob was detected, not its radius:blob_logandblob_dog, the blob radius is approximately√2 · σ;blob_doh, the blob radius is approximatelyσ.The conversion factor therefore differs per method, and none is currently applied. The docstrings of
find_blobs_log/find_blobs_dog/find_blobs_dohadd to the confusion by describing themin_sigma/max_sigmaparameters as "the minimum/maximum blob radius in pixels".Why this is tracked separately
Applying the correct conversion changes user-visible results: the radius of the circles drawn over detected blobs, and the size of the ROIs auto-generated around them via
create_image_roi_around_points. It is therefore a behaviour change, not a documentation fix.The documentation-only part is handled in the "assorted minor issues" issue.
Scope
__blobs_to_coordsor in eachfind_blobs_*wrappersigima/tests/image/blobs*_unit_test.pyand any ROI-size assertions