Change _template.match_template variables to float.

Template and image in test are converted to float32 before passing to `match_template`. This change is temporary: `match_template` should convert these variables internally.
This commit is contained in:
Tony S Yu
2012-05-08 21:32:06 -04:00
parent e8461e22dd
commit 2a00e24b12
2 changed files with 18 additions and 16 deletions
+2 -1
View File
@@ -5,8 +5,9 @@ from numpy.random import randn
def test_template():
size = 100
image = np.zeros((400, 400))
image = np.zeros((400, 400), dtype=np.float32)
target = np.tri(size) + np.tri(size)[::-1]
target = target.astype(np.float32)
target_positions = [(50, 50), (200, 200)]
for x, y in target_positions:
image[x:x + size, y:y + size] = target