When trying to rotate a landscape image to portrait, after applying the rotation, I cannot draw on the image.
img1 = cv2.imread('a.jpg')
cv2.circle(img1, tuple([10,10]),radius = 3, color = (255,0,0))
works fine.
Then I try:
img2 = np.rot90(img1,3)
cv2.circle(img2, tuple([10,10]),radius = 3, color = (255,0,0))
and I get the error:
TypeError: Layout of the output array img is incompatible with cv::Mat (step[ndims-1] != elemsize or step[1] != elemsize*nchannels)
Looking at type(img2) and img2.dtype it seems identical to img1.
the dimensions also seem fine (the first two dimensions are flipped, the third stays "3")
BTW: this seems to work. (why?):
img2 = np.rot90(img1,3)
img3 = img2.copy()
cv2.circle(img3, tuple([10,10]),radius = 3, color = (255,0,0))