I need to load an image, convert it into a np.array and then delete all rows that contains all zeros. For load the image I use:
image = Image.open(path).convert(mode='L')
image = (np.array(image,dtype=int))
The image is a B/W image where the black is 0 and the white is 1. The image is like:
0000000000100000000001000000
0000000000000000010000000000
0000000000000000000000000000
0000000000000000000000000000
0000000000000000000000000000
0000000000000000000000000000
0000010011000000001110000000
And I need to delete all zeros row to get something like:
0000000000100000000001000000
0000000000000000010000000000
0000010011000000001110000000
Is there a numpy function to do this? Am I doing it in the right way? Thank you so much.