Add DAISY visualization + example plot.

This commit is contained in:
Anders Boesen Lindbo Larsen
2012-12-15 18:44:23 +01:00
parent 2849cbf858
commit 6c19cf0693
4 changed files with 103 additions and 8 deletions
+28
View File
@@ -0,0 +1,28 @@
"""
===============================
Dense DAISY feature description
===============================
The DAISY local image descriptor is based on gradient orientation histograms
similar to the SIFT descriptor. It is formulated in a way that allows for fast
dense extraction which is useful for e.g. bag-of-features image
representations.
In this example a limited number of DAISY descriptors are extracted at a large
scale for illustrative purposes.
"""
from skimage.feature import daisy
from skimage import data
import matplotlib.pyplot as plt
img = data.camera()
descs, descs_img = daisy(img, step=180, radius=58, rings=2, histograms=6,
orientations=8, visualize=True)
plt.axis('off')
plt.imshow(descs_img)
descs_num = descs.shape[0] * descs.shape[1]
plt.title('%i DAISY descriptors extracted:' % descs_num)
plt.show()
+6 -2
View File
@@ -13,7 +13,7 @@ This example shows how to fill several different shapes:
import matplotlib.pyplot as plt
from skimage.draw import line, polygon, circle, ellipse
from skimage.draw import line, polygon, circle, circle_perimeter, ellipse
import numpy as np
@@ -42,5 +42,9 @@ img[rr,cc,:] = (255, 255, 0)
rr, cc = ellipse(300, 300, 100, 200, img.shape)
img[rr,cc,2] = 255
# circle
rr, cc = circle_perimeter(120, 400, 50)
img[rr, cc, :] = (255, 0, 255)
plt.imshow(img)
plt.show()
plt.show()