Login  Register

Re: dummy question about "median"

Posted by nicola76b@libero.it on Dec 15, 2006; 7:27am
URL: http://imagej.273.s1.nabble.com/dummy-question-about-median-tp3700824p3700825.html

thanks a lot!!
I thought this but of I was not sure..

 -Nicola B.

---------- Initial Header -----------

From      : "ImageJ Interest Group" [hidden email]
To          : [hidden email]
Cc          :
Date      : Thu, 14 Dec 2006 13:10:54 -0500
Subject : Re: dummy question about "median"







> The ImagePlus.getStatistics() method does not calculate the median
> unless you pass it the Measurements.MEDIAN flag. The mean and standard
> deviation are always calculated so you do not have to pass
> Measurements.MEAN and Measurements.STD_DEV. With RGB images, the
> statistics are calculated using luminance values [(R+G+B)/3].
>
>    ImageStatistics stats = imp.getStatistics(Measurements.MEDIAN);
>    IJ.log(
>       "Stnd.Dev1:" + stats.stdDev+", " +
>       "Media1:" + stats.mean + ", " +
>       "Median1:" + stats.median);
>    stats = ImageStatistics.getStatistics(imp.getProcessor(),
> Measurements.MEDIAN, null);
>    IJ.log(
>       "Stnd.Dev2:" + stats.stdDev + ", " +
>       "Media2:" + stats.mean + ", " +
>       "Median2:" + stats.median);
>
> -wayne
>
>
> On Dec 14, 2006, at 4:46 AM, [hidden email] wrote:
>
> > Hi all,
> > I've a little doubt about median of an rgb image.
> > Could anybody explain me why in next fragment of code "median1" is
> > different from "median2", while "stnd.Dev1" and "mean1" are respective
> > the same of "stnd.Dev2" and "mean2"?
> >
> > Suppose imp in an ImagePlus Object is an RGB image.
> >
> >
> > --------------
> > System.out.println(
> >    "Stnd.Dev1:" + imp.getStatistics().stdDev+", " +
> >    "Media1:" + imp.getStatistics().mean + ", " +
> >    "Median1:" + imp.getStatistics().median);
> >
> > ImageStatistics stats = ImageStatistics.getStatistics(
> >    imp.getProcessor(),
> >    Measurements.MEAN+Measurements.MEDIAN+Measurements.STD_DEV,
> >    null);
> >
> > System.out.println(
> >    "Stnd.Dev2:" + stats.stdDev + ", " +
> >    "Media2:" + stats.mean + ", " +
> >    "Median2:" + stats.median);
> > ----------------------
> >
> > Thanks All,
> > by
> >
> >   Nicola B.
> >
> >
> >
> >
> >
> > ------------------------------------------------------
> > Passa a Infostrada. ADSL e Telefono senza limiti e senza canone Telecom
> > http://click.libero.it/infostrada14dic06
> >
>