Deleting consecutive RGB values from a numpy array
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I initially created a subarray from the initial array for a greyscale image from this: Deleting consecutive numbers from a numpy array and Remove following duplicates in a numpy array But now I want to do the same for a coloured image and I'm really confused. I've been working on it for days and simply cannot make sense of how I can approach it. The problem is the squares are different sizes and I want a pixel for each square represented with the same colour. Coloured image: Coloured image My code for greyscale image: from PIL import Image