Skip to content

Commit

Permalink
fix for compute_mean_level method (#58)
Browse files Browse the repository at this point in the history
added code to convert float to int from the return value of min and max method
  • Loading branch information
eggytronixx authored and rhsimplex committed Feb 1, 2017
1 parent 3657d66 commit f94ecc3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions image_match/goldberg.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,11 @@ def compute_mean_level(image, x_coords, y_coords, P=None):
avg_grey = np.zeros((x_coords.shape[0], y_coords.shape[0]))

for i, x in enumerate(x_coords): # not the fastest implementation
lower_x_lim = max([x - P/2, 0])
upper_x_lim = min([lower_x_lim + P, image.shape[0]])
lower_x_lim = int(max([x - P/2, 0]))
upper_x_lim = int(min([lower_x_lim + P, image.shape[0]]))
for j, y in enumerate(y_coords):
lower_y_lim = max([y - P/2, 0])
upper_y_lim = min([lower_y_lim + P, image.shape[1]])
lower_y_lim = int(max([y - P/2, 0]))
upper_y_lim = int(min([lower_y_lim + P, image.shape[1]]))

avg_grey[i, j] = np.mean(image[lower_x_lim:upper_x_lim,
lower_y_lim:upper_y_lim]) # no smoothing here as in the paper
Expand Down

0 comments on commit f94ecc3

Please sign in to comment.