Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > 3e60ff9d4d6f58c8fbd17208f14089fa > files > 325

octave-doc-3.2.3-3mdv2010.0.i586.rpm

<html lang="en">
<head>
<title>Plotting on top of Images - Untitled</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name="description" content="Untitled">
<meta name="generator" content="makeinfo 4.13">
<link title="Top" rel="start" href="index.html#Top">
<link rel="up" href="Image-Processing.html#Image-Processing" title="Image Processing">
<link rel="prev" href="Representing-Images.html#Representing-Images" title="Representing Images">
<link rel="next" href="Color-Conversion.html#Color-Conversion" title="Color Conversion">
<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css"><!--
  pre.display { font-family:inherit }
  pre.format  { font-family:inherit }
  pre.smalldisplay { font-family:inherit; font-size:smaller }
  pre.smallformat  { font-family:inherit; font-size:smaller }
  pre.smallexample { font-size:smaller }
  pre.smalllisp    { font-size:smaller }
  span.sc    { font-variant:small-caps }
  span.roman { font-family:serif; font-weight:normal; } 
  span.sansserif { font-family:sans-serif; font-weight:normal; } 
--></style>
</head>
<body>
<div class="node">
<a name="Plotting-on-top-of-Images"></a>
<p>
Next:&nbsp;<a rel="next" accesskey="n" href="Color-Conversion.html#Color-Conversion">Color Conversion</a>,
Previous:&nbsp;<a rel="previous" accesskey="p" href="Representing-Images.html#Representing-Images">Representing Images</a>,
Up:&nbsp;<a rel="up" accesskey="u" href="Image-Processing.html#Image-Processing">Image Processing</a>
<hr>
</div>

<h3 class="section">31.4 Plotting on top of Images</h3>

<p>If gnuplot is being used to display images it is possible to plot on
top of images.  Since an image is a matrix it is indexed by row and
column values.  The plotting system is, however, based on the
traditional (x, y) system.  To minimize the difference between
the two systems Octave places the origin of the coordinate system in
the point corresponding to the pixel at (1, 1).  So, to plot
points given by row and column values on top of an image, one should
simply call <code>plot</code> with the column values as the first argument
and the row values as the second.  As an example the following code
generates an image with random intensities between 0 and 1, and shows
the image with red circles over pixels with an intensity above
0.99.

<pre class="example">     I = rand (100, 100);
     [row, col] = find (I &gt; 0.99);
     hold ("on");
     imshow (I);
     plot (col, row, "ro");
     hold ("off");
</pre>
   </body></html>