mirror of
https://github.com/wassname/scikit-image.git
synced 2026-07-09 15:20:38 +08:00
Addition of examples in the harris and peak local max function
This commit is contained in:
@@ -19,14 +19,11 @@ from skimage.feature import harris
|
||||
def plot_harris_points(image, filtered_coords):
|
||||
""" plots corners found in image"""
|
||||
|
||||
plt.plot()
|
||||
plt.imshow(image)
|
||||
plt.plot([p[1] for p in filtered_coords],
|
||||
[p[0] for p in filtered_coords],
|
||||
'b.')
|
||||
y, x = np.transpose(filtered_coords)
|
||||
plt.plot(x, y, 'b.')
|
||||
plt.axis('off')
|
||||
plt.show()
|
||||
|
||||
|
||||
# display results
|
||||
plt.figure(figsize=(9, 3))
|
||||
im_lena = img_as_float(data.lena())
|
||||
@@ -41,3 +38,5 @@ filtered_coords = harris(im_text, min_distance=4)
|
||||
|
||||
plt.axes([0.2, 0, 0.77, 1])
|
||||
plot_harris_points(im_text, filtered_coords)
|
||||
|
||||
plt.show()
|
||||
@@ -41,10 +41,8 @@ plt.title('Maximum filter')
|
||||
|
||||
plt.subplot(133)
|
||||
plt.imshow(im, cmap=plt.cm.gray)
|
||||
a, b = im.shape
|
||||
plt.autoscale(False)
|
||||
plt.plot([p[1] for p in coordinates], [p[0] for p in coordinates], 'r.')
|
||||
plt.xlim(0, b)
|
||||
plt.ylim(a, 0)
|
||||
plt.axis('off')
|
||||
plt.title('Peak local max')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user