Reputation: 35
I don't know if there is an official name for this.
I am trying to do some color analysis on a picture using Python on the pixel-level, but the problem is that sometimes there are little bits of pixels here and there that might have wildly different colors and mess up the analysis.
Is there a way to "smooth the picture out" so these little irregularities go away and the colors are more uniformly distributed within their respective regions?
Upvotes: 0
Views: 55
Reputation: 79611
Check out MedianFilter
in the ImageFilter
module.
corrected_image = original_image.filter(ImageFilter.MedianFilter(7))
You'll probably want to adjust the filter size. (I've set it to 7
here.)
Upvotes: 1