You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In case if the numpy array was created by external package write access to RO array may case segmentation fault. Please see details in related OpenCV-Python issue.
Thx for the pointers, I missed them. I am totally ok with the new behavior, it is a fix.
I had to go through https://docs.opencv.org/4.8.0/da/d49/tutorial_py_bindings_basics.html to get that Header parser can understand the input and output arguments from keywords like InputArray, OutputArray etc.. Maybe a little bit of text could be added for users (not sure if that is the right page, as it is a bit technical). Something like: The InputArray, OutputArray, InputOutputArray semantics are kept in Python: anything that is modified in C++ will be modified in Python. In addition, Python bindings also output anything that is an OutputArray, InputOutputArray or marked as CV_OUT.
System Information
OpenCV 4.x HEAD, Linux, Python 3.11
Detailed description
When some functions (e.g.
cv::rectangle
,cv::circle
) are called on a readonly argument in OpenCV 4.8.0, they do modify it. It is unclear with the doc if the input should also be modified or not as the function returns an image, cf https://docs.opencv.org/4.8.0/d6/d6e/group__imgproc__draw.html#ga07d2f74cadcf8e305e810ce8eed13bc9.Still, In OpenCV HEAD in 4.x, we get the following error:
I guess the correct behavior is to always make a copy of the image before calling
cv::rectangle
and return it?Steps to reproduce
Issue submission checklist
The text was updated successfully, but these errors were encountered: