-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
matchTemplate assertion error in 'arithm_op' #19599
Copy link
Copy link
Closed
Labels
Milestone
Description
I get the following error when running matchTemplate.
I run:
x = np.ones((3,3),dtype=np.uint8)
print(cv.matchTemplate(x, x, cv.TM_CCOEFF_NORMED, mask=x))
I get:
cv2.error: OpenCV(4.4.0) ../modules/core/src/arithm.cpp:671: error: (-215:Assertion failed) type2 == CV_64F && (sz2.height == 1 || sz2.height == 4) in function 'arithm_op'
Expected output: 1
When the mask is all 1s, it should have no effect on the score, ie the two should be equal:
cv.matchTemplate(x, x, cv.TM_CCOEFF_NORMED, mask=x)
cv.matchTemplate(x, x, cv.TM_CCOEFF_NORMED, mask=None)
System information (version)
- OpenCV = 4.4.0 (conda-forge)
- Operating System / Platform => OSX 10.15.7
- Python = 3.8.5
Reactions are currently unavailable