Re: Image statistics via moving window [message #67799] |
Fri, 28 August 2009 16:20 |
Jeremy Bailin
Messages: 618 Registered: April 2008
|
Senior Member |
|
|
On Aug 27, 9:34 am, pitris <pe.lu...@gmail.com> wrote:
> Hello,
>
> I want to obtain a basic statistics values within a fixed areas of a
> image (let's say 30x30px) - mean and standart deviations. I'm thinking
> about some type of moving window (2D matrix-30r x30l) for which these
> values will be calculated and stored into a new image file, where
> every pixel value will represent a mean of a 30x30 pxiels from a
> source image. Do you have some ideas how to do that? I'm using a
> CONVOL function for a classic per-pixel convolution, but in this case,
> window should be moving not per-pixel but rather per-specified-area.
>
> Thanks,
> Peter
You can do this using SMOOTH... I know there have been discussions
about it before, but the Google Groups search seems to be on the
fritz, so I can't find them. SMOOTH on its own will give you the mean,
and to get the standard deviation, you can do something like
sdevimage = smooth(image^2, 30) - smooth(image, 30)^2
(with possible factors of 30^2 or 30^4 missing)
-Jeremy.
|
|
|