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

**URL:** https://forum.opencv.org/t/215-assertion-failed-mag-empty-angle-size-mag-size-in-function-polartocart/10493
**Category:** Python
**Created:** [October 9, 2022, 6:47am UTC](https://forum.opencv.org/t/215-assertion-failed-mag-empty-angle-size-mag-size-in-function-polartocart/10493 "2022-10-09T06:47:59Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![zeus](https://avatars.discourse-cdn.com/v4/letter/z/a4c791/32.png) [@zeus](https://forum.opencv.org/u/zeus)
#### Post date: [October 9, 2022, 6:47am UTC](https://forum.opencv.org/t/215-assertion-failed-mag-empty-angle-size-mag-size-in-function-polartocart/10493/1 "2022-10-09T06:47:59Z")

</div>

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 !

---

<div class="post-metadata">

### Author: ![crackwitz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.opencv.org/crackwitz/32/14_2.png) [@crackwitz](https://forum.opencv.org/u/crackwitz)
#### Post date: [October 9, 2022, 1:36pm UTC](https://forum.opencv.org/t/215-assertion-failed-mag-empty-angle-size-mag-size-in-function-polartocart/10493/2 "2022-10-09T13:36:32Z")

</div>

please present a [MRE](https://stackoverflow.com/help/minimal-reproducible-example). an error message without code is not debuggable.

---

<div class="post-metadata">

### Author: ![zeus](https://avatars.discourse-cdn.com/v4/letter/z/a4c791/32.png) [@zeus](https://forum.opencv.org/u/zeus)
#### Post date: [October 10, 2022, 1:52am UTC](https://forum.opencv.org/t/215-assertion-failed-mag-empty-angle-size-mag-size-in-function-polartocart/10493/3 "2022-10-10T01:52:43Z")

</div>

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

> <https://github.com/aldoteran/oculus_detection/blob/main/src/image_to_pointcloud.py>

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