Skip to content

Commit

Permalink
Fix mypy complaining about cv2 (#702)
Browse files Browse the repository at this point in the history
  • Loading branch information
zigaLuksic authored Jul 3, 2023
1 parent f3282e8 commit c7d05df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions coregistration/eolearn/coregistration/coregistration.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ def get_gradient(src: np.ndarray) -> np.ndarray:
"""
# Calculate the x and y gradients using Sobel operator
src = src.astype(np.float32)
grad_x = cv2.Sobel(src, cv2.CV_32F, 1, 0, ksize=3)
grad_y = cv2.Sobel(src, cv2.CV_32F, 0, 1, ksize=3)
grad_x = cv2.Sobel(src, cv2.CV_32F, 1, 0, ksize=3) # type: ignore[attr-defined]
grad_y = cv2.Sobel(src, cv2.CV_32F, 0, 1, ksize=3) # type: ignore[attr-defined]

# Combine and return the two gradients
return cv2.addWeighted(np.absolute(grad_x), 0.5, np.absolute(grad_y), 0.5, 0)

0 comments on commit c7d05df

Please sign in to comment.