FIND_CENTER
Name
FIND_CENTER
Purpose
This function will look at a cluster of pixels in a
binary image and determine the mean coodinate of
that cluster. It is assumed that there is only ONE
cluster of pixels in the provided image. If there
are more, then the mean coordinate of ALL cluster
pixels will be returned, which is probably an
undesirable result.
Category
Image Processing.
Calling Sequence
Result = $
FIND_CENTER( clusterImage )
Return Value
This function will return a 2-element vector containing the
centroid coordinate for the provided cluster of pixels or a
scalar value of -1 if a single point or fewer was provided.
Inputs
clusterImage:
A binary image containing a cluster of pixels for
which the mean coordinate (centroid) is to be
computed.
Keyword Parameters
None
Side Effects
None
Requires
None
Reference
Gonzalez, R.C. and R.E. Woods, Digital Image Processing,
Third Edition, Prentice Hall, Upper Saddle River, New Jersey,
2007 (ISBN: 0131687288X / ISBN-13: 978-0131687288)
Modification History
Written by: Philip Salvaggio
June, 2008 Original code
September, 2008 Converted to a general-purpose routine (Carl Salvaggio)