float32
uint8
<matplotlib.image.AxesImage at 0x2119fc4e668>
# Marker labelling
ret, markers = cv2.connectedComponents(sure_fg)print(markers.shape)# Add one to all labels so that sure background is not 0, but 1
markers = markers+1# Now, mark the region of unknown with zero
markers[unknown==255]=0
plt.imshow(sure_fg)
(312, 252)
<matplotlib.image.AxesImage at 0x2119fc95f98>