Crop borders of images Args: img_list (list [Numpy]): HWC crop_border (int): crop border for each end of height and weight Returns: (list [Numpy]): cropped image list
(img_list, crop_border)
| 95 | # image convert |
| 96 | #################### |
| 97 | def crop_border(img_list, crop_border): |
| 98 | """Crop borders of images |
| 99 | Args: |
| 100 | img_list (list [Numpy]): HWC |
| 101 | crop_border (int): crop border for each end of height and weight |
| 102 | |
| 103 | Returns: |
| 104 | (list [Numpy]): cropped image list |
| 105 | """ |
| 106 | if crop_border == 0: |
| 107 | return img_list |
| 108 | else: |
| 109 | return [v[crop_border:-crop_border, crop_border:-crop_border] for v in img_list] |
| 110 | |
| 111 | |
| 112 | def tensor2img(tensor, out_type=np.uint8, min_max=(0, 1)): |
nothing calls this directly
no outgoing calls
no test coverage detected