I have a numpy array and would like to get the values from the array where
groups of values are the same.
Select the groups of 0 where group is > 3 and change 0 to 5
This
[3, 2, 1, 0, 0],
[1, 0, 3, 0, 0],
[2, 0, 1, 3, 0],
[0, 2, 3, 3, 0]
to this
[3, 2, 1, 5, 5],
[1, 0, 3, 5, 5],
[2, 0, 1, 3, 5]
I've been downsampling RGB images using pil, but know I would like to
exclude black 0,0,0 values from the resize calculations. I was hoping that
applying a alapha mask to black areas and creating RGBA image then
performing the resample would fix the issue but no such luck.
any ideas?
--
http://