Skip to content

Commit

Permalink
chore(vars): remove redundant variable declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
hahnec committed Nov 4, 2021
1 parent 552010d commit b7282f3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions color_matcher/mvgd_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,8 @@ def w2_img_dist(self, img_a: np.ndarray, img_b:np.ndarray):
:rtype: float
"""

img_src, img_ref = img_a, img_b
mu_a, mu_b = np.mean(img_src, axis=(0, 1)), np.mean(img_ref, axis=(0, 1))
cov_a, cov_b = np.cov(img_src.reshape(-1, 3).T), np.cov(img_ref.reshape(-1, 3).T)
mu_a, mu_b = np.mean(img_a, axis=(0, 1)), np.mean(img_b, axis=(0, 1))
cov_a, cov_b = np.cov(img_a.reshape(-1, 3).T), np.cov(img_b.reshape(-1, 3).T)
w2_img_dist = self.w2_dist(mu_a, mu_b, cov_a, cov_b)

return w2_img_dist
Expand Down

0 comments on commit b7282f3

Please sign in to comment.