[Met_help] [rt.rap.ucar.edu #89986] History for Definition of Centroid in MODE and MTD

John Halley Gotway via RT met_help at ucar.edu
Wed Jul 10 17:01:05 MDT 2019


----------------------------------------------------------------
  Initial Request
----------------------------------------------------------------

Hi there again,

I have a rather generic question, but it's been something I've been
wondering about for some time. Is the centroid in MODE and MTD simply the
geometric center of the objects convex hull? Or is there some consideration
for the object's center of mass? I noticed in the MET tutorial this
statement, but it doesn't directly address how the centroid is computed in
MET: "For example, the centroid is a kind of geometric center of an object,
and can be calculated from first moments"

This wouldn't matter for isotropic objects, but frequently with
precipitation, an object can be large but within it is a small area of
large intensity offset from the center.

Thanks and have a great day.

Mike

-- 
Michael J. Erickson

Research Scientist
Cooperative Institute for Research in Environmental Sciences (CIRES)
NOAA/NWS/NCEP/Weather Prediction Center
Phone:  301-683-1546


----------------------------------------------------------------
  Complete Ticket History
----------------------------------------------------------------

Subject: Definition of Centroid in MODE and MTD
From: Randy Bullock
Time: Tue Apr 30 11:19:33 2019

Hello Michael -

First off: the convex hull of an object plays no role in the
computation of the centroid.  The x coordinate of an object's centroid
(for example), is just the average value of the x coordinate over the
object.  It is calculated from the mask field, which is a gridded
collection of ones and zeroes.  Grid points that have a value of one
in the mask field are part of an object, while points that have a
value of zero are not part of any object.  The connected components of
the grid where the mask value is one define the objects.

You also asked about the object's "center of mass".  This is basically
the idea of intensity-weighted attributes, which we have considered
adding to MODE or MTD on several occasions in the past.  These would
be quite useful in matching and merging (IMHO), but the funding
situation has always prevented the implementation of this idea.

Incidentally, it's not only the centroid that would be affected by
this intensity-weighting.  I've attached an image to this email
illustrating the point. (BTW, I'm responding not via email, but
through the RT ticketing system web interface, which I'm not real
familiar with, so I hope the image gets attached.)  On the left side
in the image we see the centroid and axis as MODE and MTD currently
calculate them.  On the right I've indicated intensity inside the
object with a colormap, and the effect on the centroid and axis can be
seen to be quite large.

Hope this helps.

Randy

------------------------------------------------
Subject: Definition of Centroid in MODE and MTD
From: Michael Erickson - NOAA Affiliate
Time: Tue Apr 30 11:54:24 2019

Hi Randy,

Thank you for your quick and detailed reply! Everything makes sense
and
I've never thought about how intensity weighing can affect major axis
angle. Very interesting!

One additional question, let's say there were two separate objects
that
were merged together by MODE. Is the centroid of the merged object
computed
by averaging the centroids of the two un-merged objects?

Thanks,

Mike

On Tue, Apr 30, 2019 at 1:19 PM Randy Bullock via RT
<met_help at ucar.edu>
wrote:

> Hello Michael -
>
> First off: the convex hull of an object plays no role in the
computation
> of the centroid.  The x coordinate of an object's centroid (for
example),
> is just the average value of the x coordinate over the object.  It
is
> calculated from the mask field, which is a gridded collection of
ones and
> zeroes.  Grid points that have a value of one in the mask field are
part of
> an object, while points that have a value of zero are not part of
any
> object.  The connected components of the grid where the mask value
is one
> define the objects.
>
> You also asked about the object's "center of mass".  This is
basically the
> idea of intensity-weighted attributes, which we have considered
adding to
> MODE or MTD on several occasions in the past.  These would be quite
useful
> in matching and merging (IMHO), but the funding situation has always
> prevented the implementation of this idea.
>
> Incidentally, it's not only the centroid that would be affected by
this
> intensity-weighting.  I've attached an image to this email
illustrating the
> point. (BTW, I'm responding not via email, but through the RT
ticketing
> system web interface, which I'm not real familiar with, so I hope
the image
> gets attached.)  On the left side in the image we see the centroid
and axis
> as MODE and MTD currently calculate them.  On the right I've
indicated
> intensity inside the object with a colormap, and the effect on the
centroid
> and axis can be seen to be quite large.
>
> Hope this helps.
>
> Randy
>


--
Michael J. Erickson

Research Scientist
Cooperative Institute for Research in Environmental Sciences (CIRES)
NOAA/NWS/NCEP/Weather Prediction Center
Phone:  301-683-1546

------------------------------------------------
Subject: Definition of Centroid in MODE and MTD
From: Randy Bullock
Time: Tue Apr 30 16:44:44 2019

Hi again, Mike -

No, the averaging the centroid coordinates would not work.  Instead
the
(compound, or merged) object(s) are handed off just as usual the to
the
code that calculates the centroid.   There is nothing in the centroid
algorithm that requires the object to be in one connected piece.

There is a way to calculate centroids for whole objects given the
centroids
of the object parts, however.  In addition to the centroids of the
parts,
you'd also need to know the areas of the parts.  Then you can take a
kind
of "area-weighted" average of the centroids of the parts to get the
centroid of the whole.

If you're interested in MODE internals (eg, algorithms for centroid,
axis,
etc.),  a while back I wrote an NCAR Tech Note on MODE's workings
"under
the hood", so to speak.  You can download it here
<https://opensky.ucar.edu/islandora/object/technotes%3A546>, if you'd
like.  (BTW, the image I sent you earlier came from another tech note
I'm
writing on MTD.)  Be warned, however: parts of the document get pretty
heavily into some math.

Take care.

Randy

On Tue, Apr 30, 2019 at 11:54 AM Michael Erickson - NOAA Affiliate via
RT <
met_help at ucar.edu> wrote:

>
> <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=89986 >
>
> Hi Randy,
>
> Thank you for your quick and detailed reply! Everything makes sense
and
> I've never thought about how intensity weighing can affect major
axis
> angle. Very interesting!
>
> One additional question, let's say there were two separate objects
that
> were merged together by MODE. Is the centroid of the merged object
computed
> by averaging the centroids of the two un-merged objects?
>
> Thanks,
>
> Mike
>
> On Tue, Apr 30, 2019 at 1:19 PM Randy Bullock via RT
<met_help at ucar.edu>
> wrote:
>
> > Hello Michael -
> >
> > First off: the convex hull of an object plays no role in the
computation
> > of the centroid.  The x coordinate of an object's centroid (for
example),
> > is just the average value of the x coordinate over the object.  It
is
> > calculated from the mask field, which is a gridded collection of
ones and
> > zeroes.  Grid points that have a value of one in the mask field
are part
> of
> > an object, while points that have a value of zero are not part of
any
> > object.  The connected components of the grid where the mask value
is one
> > define the objects.
> >
> > You also asked about the object's "center of mass".  This is
basically
> the
> > idea of intensity-weighted attributes, which we have considered
adding to
> > MODE or MTD on several occasions in the past.  These would be
quite
> useful
> > in matching and merging (IMHO), but the funding situation has
always
> > prevented the implementation of this idea.
> >
> > Incidentally, it's not only the centroid that would be affected by
this
> > intensity-weighting.  I've attached an image to this email
illustrating
> the
> > point. (BTW, I'm responding not via email, but through the RT
ticketing
> > system web interface, which I'm not real familiar with, so I hope
the
> image
> > gets attached.)  On the left side in the image we see the centroid
and
> axis
> > as MODE and MTD currently calculate them.  On the right I've
indicated
> > intensity inside the object with a colormap, and the effect on the
> centroid
> > and axis can be seen to be quite large.
> >
> > Hope this helps.
> >
> > Randy
> >
>
>
> --
> Michael J. Erickson
>
> Research Scientist
> Cooperative Institute for Research in Environmental Sciences (CIRES)
> NOAA/NWS/NCEP/Weather Prediction Center
> Phone:  301-683-1546
>
>

------------------------------------------------
Subject: Definition of Centroid in MODE and MTD
From: Michael Erickson - NOAA Affiliate
Time: Wed May 01 05:24:10 2019

Thank you Randy for the additional information. That makes sense.

Have a great day!

Mike

On Tue, Apr 30, 2019 at 6:44 PM Randy Bullock via RT
<met_help at ucar.edu>
wrote:

> Hi again, Mike -
>
> No, the averaging the centroid coordinates would not work.  Instead
the
> (compound, or merged) object(s) are handed off just as usual the to
the
> code that calculates the centroid.   There is nothing in the
centroid
> algorithm that requires the object to be in one connected piece.
>
> There is a way to calculate centroids for whole objects given the
centroids
> of the object parts, however.  In addition to the centroids of the
parts,
> you'd also need to know the areas of the parts.  Then you can take a
kind
> of "area-weighted" average of the centroids of the parts to get the
> centroid of the whole.
>
> If you're interested in MODE internals (eg, algorithms for centroid,
axis,
> etc.),  a while back I wrote an NCAR Tech Note on MODE's workings
"under
> the hood", so to speak.  You can download it here
> <https://opensky.ucar.edu/islandora/object/technotes%3A546>, if
you'd
> like.  (BTW, the image I sent you earlier came from another tech
note I'm
> writing on MTD.)  Be warned, however: parts of the document get
pretty
> heavily into some math.
>
> Take care.
>
> Randy
>
> On Tue, Apr 30, 2019 at 11:54 AM Michael Erickson - NOAA Affiliate
via RT <
> met_help at ucar.edu> wrote:
>
> >
> > <URL: https://rt.rap.ucar.edu/rt/Ticket/Display.html?id=89986 >
> >
> > Hi Randy,
> >
> > Thank you for your quick and detailed reply! Everything makes
sense and
> > I've never thought about how intensity weighing can affect major
axis
> > angle. Very interesting!
> >
> > One additional question, let's say there were two separate objects
that
> > were merged together by MODE. Is the centroid of the merged object
> computed
> > by averaging the centroids of the two un-merged objects?
> >
> > Thanks,
> >
> > Mike
> >
> > On Tue, Apr 30, 2019 at 1:19 PM Randy Bullock via RT
<met_help at ucar.edu>
> > wrote:
> >
> > > Hello Michael -
> > >
> > > First off: the convex hull of an object plays no role in the
> computation
> > > of the centroid.  The x coordinate of an object's centroid (for
> example),
> > > is just the average value of the x coordinate over the object.
It is
> > > calculated from the mask field, which is a gridded collection of
ones
> and
> > > zeroes.  Grid points that have a value of one in the mask field
are
> part
> > of
> > > an object, while points that have a value of zero are not part
of any
> > > object.  The connected components of the grid where the mask
value is
> one
> > > define the objects.
> > >
> > > You also asked about the object's "center of mass".  This is
basically
> > the
> > > idea of intensity-weighted attributes, which we have considered
adding
> to
> > > MODE or MTD on several occasions in the past.  These would be
quite
> > useful
> > > in matching and merging (IMHO), but the funding situation has
always
> > > prevented the implementation of this idea.
> > >
> > > Incidentally, it's not only the centroid that would be affected
by this
> > > intensity-weighting.  I've attached an image to this email
illustrating
> > the
> > > point. (BTW, I'm responding not via email, but through the RT
ticketing
> > > system web interface, which I'm not real familiar with, so I
hope the
> > image
> > > gets attached.)  On the left side in the image we see the
centroid and
> > axis
> > > as MODE and MTD currently calculate them.  On the right I've
indicated
> > > intensity inside the object with a colormap, and the effect on
the
> > centroid
> > > and axis can be seen to be quite large.
> > >
> > > Hope this helps.
> > >
> > > Randy
> > >
> >
> >
> > --
> > Michael J. Erickson
> >
> > Research Scientist
> > Cooperative Institute for Research in Environmental Sciences
(CIRES)
> > NOAA/NWS/NCEP/Weather Prediction Center
> > Phone:  301-683-1546
> >
> >
>
>

--
Michael J. Erickson

Research Scientist
Cooperative Institute for Research in Environmental Sciences (CIRES)
NOAA/NWS/NCEP/Weather Prediction Center
Phone:  301-683-1546

------------------------------------------------


More information about the Met_help mailing list