Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
display centre of an image

Subject: display centre of an image

From: ramya

Date: 3 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: display centre of an image

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

Date: 3 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: display centre of an image

From: Vihang Patil

Date: 3 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

No tags are associated with this thread.

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.

Contact us