Here is how you can use the scipy.ndimage module to rotate your patches:
import numpy as np
import cv2
from random import randrange
from scipy import ndimage
def patch_img(img, patch, amt=5):
h, w, _ = img.shape
for _ in range(amt):
p = ndimage.rotate(patch, randrange(360))
p_h, p_w, _ = p.shape
x = randrange(w - p_w)
y = randrange(h - p_h)
seg = img[y: y + p_h, x: x + p_w]
seg[:] = cv2.bitwise_xor(seg, p)
patch = cv2.imread('imagersult.png')
img = np.zeros((2048, 2048, 3), dtype="uint8")
patch_img(img, patch)
cv2.imshow("Image", img)
cv2.waitKey(0)
Outputs for multiple runs:



For grayscale and variation in size of the patches:
import numpy as np
import cv2
from random import randrange, uniform
from scipy import ndimage
def patch_img(img, patch, amt=5):
h, w = img.shape
min_scale = 0.5
max_scale = 2
for _ in range(amt):
patch_h, patch_w = patch.shape
scale = uniform(min_scale, max_scale)
p = ndimage.rotate(cv2.resize(patch, (int(patch_w * scale), int(patch_h * scale))), randrange(360))
p_h, p_w = p.shape
x = randrange(w - p_w)
y = randrange(h - p_h)
seg = img[y: y + p_h, x: x + p_w]
seg[:] = cv2.bitwise_xor(seg, p)
patch = cv2.imread('imagersult.png', 0)
img = np.zeros((2048, 2048), dtype="uint8")
patch_img(img, patch)
cv2.imshow("Image", img)
cv2.imwrite("result.png", img)
cv2.waitKey(0)
Sample output:
