How to apply a median filter on a coloured image?

조회 수: 1 (최근 30일)
Salad Box
Salad Box 2019년 10월 30일
댓글: Walter Roberson 2019년 10월 30일
Hi,
I'm not exactly sure how 'median filter' works on a coloured image.
I can understand how the median filter work on a black and white image. Because instead of the image being m by n by 3, the image is m by n by 1. So there is only 1 number contained in each pixel. With a 3 by 3 median block, you can easily sort those 9 numbers and take the median number.
However, if it is a colored image, there will be 3 numbers (R, G, B) representing each pixel. In a 3 by 3 block, how to get the median? Do I have to apply the median filter on each channel separately?
Would that also have the risk of generating some artificial pixel values? I mean for instance, the median of R channel is 5, G channel is 20, B channel is 180. Does that mean the median of this block will be [5, 20, 180]. If I'm using [5, 20 180], is it likely that [5, 20, 180] does not belong to any of the 9 pixels in the 3 by 3 block?
  댓글 수: 1
Walter Roberson
Walter Roberson 2019년 10월 30일
You are exactly right, if you process per channel then you do risk creating artificial colors. And that can happen even if you drop into other color spaces such as HSV.
You certainly get into definitional problems of what it means to take a median color.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Computer Vision with Simulink에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by