It turns out that before calculating the convex hull of a ROI object the bounding box is surrounded by a margin of size 1px (hard coded value). All center positions of "clumps" are in coordinates of this enlarged bbox, while the center of the ROI object itself is not.
The hard coded margin (borderSize(1)) can be removed safely. It is unclear why the enlarged bounding box is useful.
It turns out that before calculating the convex hull of a ROI object the bounding box is surrounded by a margin of size 1px (hard coded value). All center positions of "clumps" are in coordinates of this enlarged bbox, while the center of the ROI object itself is not.
The hard coded margin (
borderSize(1)
) can be removed safely. It is unclear why the enlarged bounding box is useful.