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
I1 is all messed up but I2 works as expected. I's dtype is already np.uint8 so I don't know what the magic is with the asytpe() converting it to the same datatype.
Any idea what I might be doing incorrectly?
The text was updated successfully, but these errors were encountered:
When you do A = cv2.imread("path/to/hbl.png")A will be a (200, 200, 3) image.
when you do I=cv2.imread("path/to/hbl.png")[:,:,0]I will be a view of shape (200, 200) over the same underlaying memory as A. You can see that doing A.strides and I.strides, I1.strides, I2.strides.
What I3 = I.astype(np.uint8) is doing is creating a new (200, 200) buffer and copying the I data. Hence now the I3 memory is continuous and has the same strides as I2.
The bug lies at the function from_array doing the assumption that the array memory is continous.
Attached is an image that is acting very strange...
I1 is all messed up but I2 works as expected. I's
dtype
is alreadynp.uint8
so I don't know what the magic is with theasytpe()
converting it to the same datatype.Any idea what I might be doing incorrectly?
The text was updated successfully, but these errors were encountered: