Skip to content

Commit 5666e9e

Browse files
committed
Harris corner example.
1 parent bb80f82 commit 5666e9e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

examples/ch2_harris_corners.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from pylab import *
2+
from numpy import *
3+
from PIL import Image
4+
5+
from PCV.localdescriptors import harris
6+
7+
"""
8+
Example of detecting Harris corner points (Figure 2-1 in the book).
9+
"""
10+
11+
# open image
12+
im = array(Image.open('../data/empire.jpg').convert('L'))
13+
14+
# detect corners and plot
15+
harrisim = harris.compute_harris_response(im)
16+
filtered_coords = harris.get_harris_points(harrisim, 10, threshold=0.01)
17+
harris.plot_harris_points(im, filtered_coords)
18+
19+
# plot only 200 strongest
20+
harris.plot_harris_points(im, filtered_coords[:200])

0 commit comments

Comments
 (0)