(-215:Assertion failed) Mag.empty() || Angle.size == Mag.size in function ‘polarToCart’

Hello all !
I’m getting this error when I try to get x and y coordinates using cv2’s polartocart function. If someone know how to resolve this issue, kindly help me to resolve the error.

cv2.error: OpenCV(4.6.0) /io/opencv/modules/core/src/mathfuncs.cpp:580: error: (-215:Assertion failed) Mag.empty() || Angle.size == Mag.size in function ‘polarToCart’

Thanks in advance !

please present a MRE. an error message without code is not debuggable.

Hi,
Thanks for the response. I’m working on this code.

@crackwitz Facing error in line 190. Kindly help. Thanks.