You can use the skimage.io.imsave
function to save. It looks like the images will already plot, so can I suggest editing your function to return the region of interest in the image:
from skimage.io import imsave
def show_image_in_region(region):
minr, minc, maxr, maxc = region.bbox
plt.imshow(binary_imag[minr:maxr,minc:maxc])
return binary_imag[minr:maxr,minc:maxc]
and then in your loop:
for i in range(0,5):
im = show_image_in_region(image_blocks[i])
imsave('image{}.png'.format(i), im)
which will save a .png file called "image0.png" and so on. Other image files can also be saved using the imsave
function.