Simplify _template.pyx using integral_image from transform subpackage.

Remove `integral_images` and `integral_image_sqr` from _template.pyx in favor of calls to `skimage.transform.integral_image`.

This change required `match_template` arguments ("image" and "template") to be changed from float to double.

After this change, the template test runs about 25% slower.
This commit is contained in:
Tony S Yu
2012-05-08 21:28:50 -04:00
parent 2b368aecb1
commit 6272c312c4
3 changed files with 9 additions and 85 deletions
+1 -2
View File
@@ -20,7 +20,6 @@ import matplotlib.pyplot as plt
# We first construct a simple image target:
size = 100
target = np.tri(size) + np.tri(size)[::-1]
target = target.astype(np.float32)
plt.gray()
plt.imshow(target)
@@ -28,7 +27,7 @@ plt.title("Target image")
plt.axis('off')
# place target in an image at two positions, and add noise.
image = np.zeros((400, 400), dtype=np.float32)
image = np.zeros((400, 400))
target_positions = [(50, 50), (200, 200)]
for x, y in target_positions:
image[x:x+size, y:y+size] = target