mirror of
https://github.com/wassname/scikit-image.git
synced 2026-09-09 11:33:41 +08:00
Minor cleanups
* PEP8 clean ups (space after commas, docstring spacing, prefer parentheses over line continuation) * Simplify creation of test images. * Use `plt.subplots` instead of state machine * Minor wording modifications
This commit is contained in:
@@ -1,23 +1,20 @@
|
||||
import matplotlib
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
from skimage.data import camera
|
||||
from skimage.filter import roberts,sobel
|
||||
from skimage.filter import roberts, sobel
|
||||
|
||||
image = camera()
|
||||
edge_roberts = roberts(image)
|
||||
edge_sobel = sobel(image)
|
||||
|
||||
plt.figure(figsize=(8, 2.5))
|
||||
plt.subplot(1, 2, 1)
|
||||
plt.imshow(edge_roberts, cmap=plt.cm.gray)
|
||||
plt.title('Roberts Edge Detection')
|
||||
plt.axis('off')
|
||||
fig, (ax0, ax1) = plt.subplots(ncols=2)
|
||||
|
||||
plt.subplot(1, 2, 2)
|
||||
plt.imshow(edge_sobel, cmap=plt.cm.gray)
|
||||
plt.title('Sobel Edge Detection')
|
||||
plt.axis('off')
|
||||
ax0.imshow(edge_roberts, cmap=plt.cm.gray)
|
||||
ax0.set_title('Roberts Edge Detection')
|
||||
ax0.axis('off')
|
||||
|
||||
ax1.imshow(edge_sobel, cmap=plt.cm.gray)
|
||||
ax1.set_title('Sobel Edge Detection')
|
||||
ax1.axis('off')
|
||||
|
||||
plt.show()
|
||||
|
||||
Reference in New Issue
Block a user