Hi Jeff,
I mentioned this before, but since you do not care about individual regions, there is no reason to burden yourself with the overhead of the regionprops function.
Try this modified function:
```
def barycenter_skimage2(image,minx,miny,maxx,maxy,thresh,border,White_Mark):
"""
skimage computation of the barycenter (moment 1 of image) on ZOI using regionprops
"""
bw=image[minx:maxx+1,miny:maxy+1]>thresh
if(White_Mark==False):
bw=1-bw
Onex,Oney=np.where(bw==1)
minx_=Onex.min()
maxx_=Onex.max()
miny_=Oney.min()
maxy_=Oney.max()
M = measure.moments(bw.astype(np.double), order=1)
Px=M[0, 1]/M[0, 0]
Py=M[1, 0]/M[0, 0]
Px+=minx
Py+=miny
# Determination of the new bounding box using global coordinates and the margin
minx=minx-border+minx_
miny=miny-border+miny_
maxx=minx+border+maxx_
maxy=miny+border+maxy_
return Px,Py,minx,miny,maxx,maxy
```
We could add a templated version of the moments functions for uint8 to make this a fairer comparison. The regionprops function would also gain from this, since the `double` version is only used for the weighted moments.
Best, Johannes
> <UnitTestExtenso.py>