Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

cv2 remove black borders on images

def remove_black_borders(image):
    y_nonzero, x_nonzero, _ = np.nonzero(image)
    return image[np.min(y_nonzero):np.max(y_nonzero), np.min(x_nonzero):np.max(x_nonzero)]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #black #borders #images
ADD COMMENT
Topic
Name
7+5 =