How to get 2D array from 3D array of an image by removing black pixels, i.e. [0,0,0], in python
问题 I have a picture of the facial skin with black pixels around it. The picture is an 3d array made up of pixels (RGB) picture's array = width * height * RGB The problem is that in the picture there are so many black pixels that do not belong to the skin. The black pixels represent as an array of zero. [0,0,0] I want to get 2d array with non-black pixels as [[218,195,182]. ... [229,0, 133]] -with only the pixels of facial skin color I try to eject the black pixels by finding all the pixels whose