diff options
| -rw-r--r-- | rpc/img_ops.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/rpc/img_ops.py b/rpc/img_ops.py index 244f8eb..3dc52bc 100644 --- a/rpc/img_ops.py +++ b/rpc/img_ops.py @@ -19,6 +19,11 @@ def process_image(opt, data_opt, im): if data_opt.process_frac == 0: return img + if data_opt.transform != False: + (h, w) = img.shape[:2] + center = (w / 2, h / 2) + M = cv2.getRotationMatrix2D(center, data_opt.rotate, data_opt.scale) + img = cv2.warpAffine(img, M, (w, h)) if data_opt.hsl is True: processed = True hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV) |
