user62753
user62753

Reputation: 35

"Blending out" noise in images?

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

Answers (1)

Timothy Shields
Timothy Shields

Reputation: 79621

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

Related Questions