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
Arguably this could be an issue with np.rot90(). However, since other cv2 functions works like normal my initial guess was to start here. For instance, image can be displayed, saved and loaded.
This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
I'm using the latest version of opencv-python
The text was updated successfully, but these errors were encountered:
np.rot90() returns View object, not array according to Numpy docs: https://numpy.org/doc/stable/reference/generated/numpy.rot90.html
cv2.line img is InputOutputArray parameter.
So print("converter: ", cv2.utils.dumpInputArray(img_rot)) returns converter: InputArray: empty()=false kind=0x00010000 flags=0x01010000 total(-1)=100 dims(-1)=2 size(-1)=10x10 type(-1)=CV_8UC1
View is read-only and cannot be used as output. It triggers the exception. The read-only status is not obvious here. I'll take a look if we can improve error message.
Expected behaviour
cv2.line() should work on what np.rot90() returns (np arrays with np.uint8 dtype).
Actual behaviour
After rotating images with np.rot90() cv2.line() raises an error, claiming the array is not compatible.
Steps to reproduce
I tested some other cv2 drawing functions and get the same result (for example cv2.circle())
I also tested numpy 1.26.1 and got the same result.
I have double checked cv2.rot90() doesn't change the dtype of the array
Arguably this could be an issue with np.rot90(). However, since other cv2 functions works like normal my initial guess was to start here. For instance, image can be displayed, saved and loaded.
Lastly, I've noted that if the image is saved and loaded, it works as expected.
Issue submission checklist
opencv-python
The text was updated successfully, but these errors were encountered: