def show_image_in_region(region):
minr, minc, maxr, maxc = region.bbox
plt.imshow(binary_imag[minr:maxr,minc:maxc])
for i in range(0,5):
show_image_in_region(image_blocks[i])
I have multiple output images which I want to save and display using skimage.
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.