Args: img: numpy image, WxH or WxHxC sf: scale factor Return: cropped image
(img, sf)
| 27 | |
| 28 | |
| 29 | def modcrop_np(img, sf): |
| 30 | ''' |
| 31 | Args: |
| 32 | img: numpy image, WxH or WxHxC |
| 33 | sf: scale factor |
| 34 | Return: |
| 35 | cropped image |
| 36 | ''' |
| 37 | w, h = img.shape[:2] |
| 38 | im = np.copy(img) |
| 39 | return im[:w - w % sf, :h - h % sf, ...] |
| 40 | |
| 41 | |
| 42 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected