필터 지우기
필터 지우기

calculation of mean , standard deviation and average for each pixel in an image M*N?

조회 수: 2 (최근 30일)
if i have an image M*N
if i want to making each pixel in the center of window with 31*31 size , and then compute the average and standard deviation and the mean based on pixel 's nighborhoods ? how this can be done?
i dont mean computing the mean , standard deviation , and average for the whole image?
i wait any help

답변 (2개)

Teja Muppirala
Teja Muppirala 2012년 1월 23일
If you have the Image Processing Toolbox, the functions
IMFILTER (can be used to do mean filtering on a neighborhood),
STDFILT (standard deviation on a neighborhood),
or the more general NLFILTER (arbitrary function on a neighborhood),
are there to do these types of operations quite easily.

David Young
David Young 2012년 1월 22일
To get the means, you can do
means = conv2(Image, ones(31)/(31*31), 'valid');
Note that means(1,1) is the mean for the window centred on Image(16,16), and so on.
I'm not sure how the average is different from the mean.
To get the SDs, just extend the technique above in the obvious way, using the standard formula for the SD.
  댓글 수: 10
David Young
David Young 2012년 1월 22일
It's true that I haven't told you how to compute the neighbourhood SDs, but once you understand how the neighbourhood means are computed I am sure you'll be able to see how to get the SDs - you just need to apply the same technique to the pointwise square of the image and look up the formula for the SD.
David Young
David Young 2012년 1월 25일
... or, as Teja Muppirala points out, there's also stdfilt.

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

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by