Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Template matching returns values outside [-1, 1] #845

Closed
stefanv opened this issue Dec 8, 2013 · 1 comment · Fixed by #847
Closed

Template matching returns values outside [-1, 1] #845

stefanv opened this issue Dec 8, 2013 · 1 comment · Fixed by #847

Comments

@stefanv
Copy link
Member

stefanv commented Dec 8, 2013

from skimage import data, color
from skimage.feature import match_template

import numpy as np

haystack = color.rgb2gray(data.chelsea())
needle = haystack[:10, :10]

corr = match_template(haystack, needle)

print "Maximum correlation:", corr.max()
print "Location:", np.unravel_index(corr.argmax(), corr.shape)

Result:

Maximum correlation: 5.97078
Location: (244, 61)
@stefanv
Copy link
Member Author

stefanv commented Jan 14, 2014

Closed by #847

@stefanv stefanv closed this as completed Jan 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant