Skip to Main Content Skip to Search
Login
File Exchange
MATLAB Newsgroup
Link Exchange
  Blogs  
 Contest 
MathWorks.com

Thread Subject: display centre of an image

Subject: display centre of an image

From: ramya

Date: 03 Feb, 2008 08:44:01

Message: 1 of 3

can someone tell me how to display the centre of an
image.. plzzzz...i need to display the image with a red
mark in the centre.. how do i do that???

Subject: Re: display centre of an image

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 03 Feb, 2008 11:59:01

Message: 2 of 3

In article <fo3ush$qg$1@fred.mathworks.com>,
ramya <tulips2000@gmail.com> wrote:
>can someone tell me how to display the centre of an
>image.. plzzzz...i need to display the image with a red
>mark in the centre.. how do i do that???

get() the Parent of the image. It will be an axis.
get() the XLim of the axis. This will be a vector of length 2.
get() the YLim of the axis. This will be a vector of length 2.
Average the two elements of the XLim.
Average the two elements of the YLim.
The two averages are the X and Y coordinates of the centre.
plot() at that location with an appropriate color and marker
specification.
--
   "History is a pile of debris" -- Laurie Anderson

Subject: Re: display centre of an image

From: Vihang Patil

Date: 03 Feb, 2008 13:16:02

Message: 3 of 3

"ramya " <tulips2000@gmail.com> wrote in message
<fo3ush$qg$1@fred.mathworks.com>...
> can someone tell me how to display the centre of an
> image.. plzzzz...i need to display the image with a red
> mark in the centre.. how do i do that???

load clown
imshow(X,map);
hold on;
plot(size(X,2)/2,size(X,1)/2,'ro','LineWidth',2);
%doc plot

HTH
Vihang


Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

envelope graphic E-mail this page to a colleague

Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.
Related Topics