Search before asking
Description
OpenCV errors out with an uninformative error when the dtype of the mask is wrong.
Would be good to add catch if dtype != np.int32 and raise an Exception.
Use case
I was trying to create a mask in CVAT, the exported segmentation had decimal places, np.array(coords) did not convert to np.int32, and I was confused by the bad error message.
This is likely to happen to other users too .
Additional
Happy to submit PR
Are you willing to submit a PR?
Search before asking
Description
OpenCV errors out with an uninformative error when the dtype of the mask is wrong.
Would be good to add catch if dtype != np.int32 and raise an Exception.
Use case
I was trying to create a mask in CVAT, the exported segmentation had decimal places, np.array(coords) did not convert to np.int32, and I was confused by the bad error message.
This is likely to happen to other users too .
Additional
Happy to submit PR
Are you willing to submit a PR?