MCPcopy Create free account
hub / github.com/VCIP-RGBD/DFormer / random_rotation

Function random_rotation

utils/transforms.py:147–154  ·  view source on GitHub ↗
(img, gt)

Source from the content-addressed store, hash-verified

145
146
147def random_rotation(img, gt):
148 angle = random.random() * 20 - 10
149 h, w = img.shape[:2]
150 rotation_matrix = cv2.getRotationMatrix2D((w / 2, h / 2), angle, 1)
151 img = cv2.warpAffine(img, rotation_matrix, (w, h), flags=cv2.INTER_LINEAR)
152 gt = cv2.warpAffine(gt, rotation_matrix, (w, h), flags=cv2.INTER_NEAREST)
153
154 return img, gt
155
156
157def random_gaussian_blur(img):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected