(image, angle, center=None, scale=1.0)
| 23 | return shifted |
| 24 | |
| 25 | def rotate(image, angle, center=None, scale=1.0): |
| 26 | # grab the dimensions of the image |
| 27 | (h, w) = image.shape[:2] |
| 28 | |
| 29 | # if the center is None, initialize it as the center of |
| 30 | # the image |
| 31 | if center is None: |
| 32 | center = (w // 2, h // 2) |
| 33 | |
| 34 | # perform the rotation |
| 35 | M = cv2.getRotationMatrix2D(center, angle, scale) |
| 36 | rotated = cv2.warpAffine(image, M, (w, h)) |
| 37 | |
| 38 | # return the rotated image |
| 39 | return rotated |
| 40 | |
| 41 | def rotate_bound(image, angle): |
| 42 | # grab the dimensions of the image and then determine the |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…