Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: geometry center
Date: Mon, 5 Jan 2009 17:35:03 +0000 (UTC)
Organization: Xoran Technologies
Lines: 19
Message-ID: <gjtgc7$8es$1@fred.mathworks.com>
References: <fumrl7$4ck$1@fred.mathworks.com> <gjtdi5$avk$1@fred.mathworks.com> <gjtelq$nga$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1231176903 8668 172.30.248.35 (5 Jan 2009 17:35:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 5 Jan 2009 17:35:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:509872


"Adam" <not.real@email.com> wrote in message <gjtelq$nga$1@fred.mathworks.com>...
> "chandni magoo" <chandnimalh@gmail.com> wrote in message <gjtdi5$avk$1@fred.mathworks.com>...
> > hi
> > i wanted to know the method of finding geometric center of an image
> 
> 
> [nRow nCol] = size(theImage);
> xCenter = nCol/2;
> yCenter = nRow/2;
> 
> ~Adam

Actually, because MATLAB uses 1-based indexing, you will probably want


 [nRow nCol] = size(theImage);
 xCenter = (nCol+1)/2;
yCenter = (nRow+1)/2;