Module: transform — skimage v0.19.0 docs
scikit-image.org › api › skimageimport numpy as np import matplotlib.pyplot as plt from skimage.transform import hough_line from skimage.draw import line img = np. zeros ((100, 150), dtype = bool) img [30,:] = 1 img [:, 65] = 1 img [35: 45, 35: 50] = 1 rr, cc = line (60, 130, 80, 10) img [rr, cc] = 1 rng = np. random. default_rng img += rng. random (img. shape) > 0.95 out, angles, d = hough_line (img) fix, axes = plt. subplots (1, 2, figsize = (7, 4)) axes [0]. imshow (img, cmap = plt. cm. gray) axes [0]. set_title ('Input ...
Rescale, resize, and downscale — skimage v0.19.0 docs
scikit-image.org › transform › plot_rescaleimport matplotlib.pyplot as plt from skimage import data, color from skimage.transform import rescale, resize, downscale_local_mean image = color. rgb2gray (data. astronaut ()) image_rescaled = rescale (image, 0.25, anti_aliasing = False) image_resized = resize (image, (image. shape [0] // 4, image. shape [1] // 4), anti_aliasing = True) image_downscaled = downscale_local_mean (image, (4, 3)) fig, axes = plt. subplots (nrows = 2, ncols = 2) ax = axes. ravel ax [0]. imshow (image, cmap ...
图像处理库Skimage安装与使用 - 简书
https://www.jianshu.com/p/be7af337ffcd22.04.2019 · 方法二:skimage.viewer.ImageViewer()显示图像. from skimage import io, data from skimage.viewer import ImageViewer img = data.coffee() viewer = ImageViewer(img) viewer.show() skimage程序自带了一些示例图片,如果我们不想从外部读取图片,就可以直接使用skimage.data的示例图片。 3、图像像素访问
Radon transform — skimage v0.19.0 docs
scikit-image.org › plot_radon_transformfrom skimage.transform import iradon_sart reconstruction_sart = iradon_sart (sinogram, theta = theta) error = reconstruction_sart-image print (f 'SART (1 iteration) rms reconstruction error: ' f ' {np. sqrt (np. mean (error ** 2)):.3g} ') fig, axes = plt. subplots (2, 2, figsize = (8, 8.5), sharex = True, sharey = True) ax = axes. ravel ax [0]. set_title ("Reconstruction SART") ax [0]. imshow (reconstruction_sart, cmap = plt. cm.