Spaces:
Sleeping
Sleeping
| """ | |
| Created By: ishwor subedi | |
| Date: 2024-07-12 | |
| """ | |
| import cv2 | |
| def add_pixel(image, top: bool = False, left: bool = False, right: bool = False, bottom: bool = False, | |
| ): | |
| value = [255, 255, 255] | |
| if top: | |
| image = cv2.copyMakeBorder(image, 200, 0, 0, 0, cv2.BORDER_CONSTANT, value=value) | |
| if left: | |
| image = cv2.copyMakeBorder(image, 0, 0, 200, 0, cv2.BORDER_CONSTANT, value=value) | |
| if right: | |
| image = cv2.copyMakeBorder(image, 0, 0, 0, 200, cv2.BORDER_CONSTANT, value=value) | |
| if bottom: | |
| image = cv2.copyMakeBorder(image, 0, 200, 0, 0, cv2.BORDER_CONSTANT, value=value) | |
| return image | |