Hello Johannes,
thanks for the advise, but it did not work. When I set the background=0, the script counted one object when there were two. According to the one object coordinate, with centroid prop=(214.59826983468628, 505.59264087219293), it missed the small dot in the bottom of the image.

Trying to understand what is the algorithm dose, I tested the following code:
a=np.array(np.matrix('0 1 0 0 1;0 1 0 0 0; 0 0 0 0 0;0 0 0 0 1'))
print(a)
import numpy as np
from skimage import filters, morphology, measure
img=measure.label(a, background=0)
propsa = measure.regionprops(img)
length = len(propsa)
print ('length='+str(length))
for label in propsa:
print (label.centroid)
returns
0 1 0 0 1]
[0 1 0 0 0]
[0 0 0 0 0]
[0 0 0 0 1]]
length=2
(0.0, 4.0)
(3.0, 4.0)
When trying
a=np.array(np.matrix('0 1 0 0 1;0 1 0 0 0; 0 0 0 0 0;0 0 0 0 1'))
print(a)
import numpy as np
from skimage import filters, morphology, measure
img=measure.label(a)
propsa = measure.regionprops(img)
length = len(propsa)
print ('length='+str(length))
for label in propsa:
print (label.centroid)
returns
[[0 1 0 0 1]
[0 1 0 0 0]
[0 0 0 0 0]
[0 0 0 0 1]]
length=3
(0.5, 1.0)
(0.0, 4.0)
(3.0, 4.0)
I do not understand why when background=0 the program counts two objects, and three object when background is default.
Thanks for the help