⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 snake2d.html

📁 Snakuscule是一种新型概念的snake。基于区域的
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_16) on Fri Oct 17 10:33:06 CEST 2008 --><TITLE>Snake2D</TITLE><META NAME="keywords" CONTENT="snake2D.Snake2D interface"><LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="Snake2D";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../snake2D/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;PREV CLASS&nbsp;&nbsp;<A HREF="../snake2D/Snake2DKeeper.html" title="class in snake2D"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../index.html?snake2D/Snake2D.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Snake2D.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">snake2D</FONT><BR>Interface Snake2D</H2><HR><DL><DT><PRE>public interface <B>Snake2D</B></DL></PRE><P>This abstract class encapsulates the number-crunching aspect of snakes.<P><P><DL><DT><B>See Also:</B><DD><A HREF="../snake2D/Snake2DKeeper.html" title="class in snake2D"><CODE>Snake2DKeeper</CODE></A>, <A HREF="../snake2D/Snake2DNode.html" title="class in snake2D"><CODE>Snake2DNode</CODE></A></DL><HR><P><!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>Method Summary</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;double</CODE></FONT></TD><TD><CODE><B><A HREF="../snake2D/Snake2D.html#energy()">energy</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The purpose of this method is to compute the energy of the snake.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;java.awt.geom.Point2D.Double[]</CODE></FONT></TD><TD><CODE><B><A HREF="../snake2D/Snake2D.html#getEnergyGradient()">getEnergyGradient</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The purpose of this method is to compute the gradient of the snake energy with respect to the snake-defining nodes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../snake2D/Snake2DNode.html" title="class in snake2D">Snake2DNode</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../snake2D/Snake2D.html#getNodes()">getNodes</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method provides an accessor to the snake-defining nodes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../snake2D/Snake2DScale.html" title="class in snake2D">Snake2DScale</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../snake2D/Snake2D.html#getScales()">getScales</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The purpose of this method is to detemine what to draw on screen, given the current configuration of nodes.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="../snake2D/Snake2D.html#setNodes(snake2D.Snake2DNode[])">setNodes</A></B>(<A HREF="../snake2D/Snake2DNode.html" title="class in snake2D">Snake2DNode</A>[]&nbsp;node)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This method provides a mutator to the snake-defining nodes.</TD></TR></TABLE>&nbsp;<P><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="energy()"><!-- --></A><H3>energy</H3><PRE>double <B>energy</B>()</PRE><DL><DD>The purpose of this method is to compute the energy of the snake. This energy is usually made of three additive terms: 1) the image energy, which gives the driving force associated to the data; 2) the internal energy, which favors smoothness of the snake; and 3) the constraint energy, which incorporates a priori knowledge. This method is called repeatedly during the optimization of the snake. It is <b>imperative</b> that this function be <b>everywhere differentiable</b> with respect to the snake-defining nodes.<P><DD><DL><DT><B>Returns:</B><DD>Return a number that should attain a minimal value when the snake is optimal. Negative values are admissible.</DL></DD></DL><HR><A NAME="getEnergyGradient()"><!-- --></A><H3>getEnergyGradient</H3><PRE>java.awt.geom.Point2D.Double[] <B>getEnergyGradient</B>()</PRE><DL><DD>The purpose of this method is to compute the gradient of the snake energy with respect to the snake-defining nodes. This method is called repeatedly during the optimization of the snake. The optimization takes place under the control of the method <code>Snake2DKeeper.interactAndOtimize()</code>.<P><DD><DL><DT><B>Returns:</B><DD>Return an array that contains the gradient values associated to each node. They predict the variation of the energy for a horizontal or vertical displacement of one pixel. The ordering of the nodes must follow that of <code>getNodes()</code>. If <code>null</code> is returned, the optimizer within the class <code>Snake2DKeeper</code> will attempt to estimate the gradient by a finite-difference approach.<DT><B>See Also:</B><DD><A HREF="../snake2D/Snake2D.html#getNodes()"><CODE>getNodes()</CODE></A></DL></DD></DL><HR><A NAME="getNodes()"><!-- --></A><H3>getNodes</H3><PRE><A HREF="../snake2D/Snake2DNode.html" title="class in snake2D">Snake2DNode</A>[] <B>getNodes</B>()</PRE><DL><DD>This method provides an accessor to the snake-defining nodes.<P><DD><DL><DT><B>Returns:</B><DD>Return an array of subpixel node locations. It is expected that the ordering of the nodes and the number of nodes does not change during the lifetime of the snake.<DT><B>See Also:</B><DD><A HREF="../snake2D/Snake2D.html#setNodes(snake2D.Snake2DNode[])"><CODE>setNodes(snake2D.Snake2DNode[])</CODE></A></DL></DD></DL><HR><A NAME="getScales()"><!-- --></A><H3>getScales</H3><PRE><A HREF="../snake2D/Snake2DScale.html" title="class in snake2D">Snake2DScale</A>[] <B>getScales</B>()</PRE><DL><DD>The purpose of this method is to detemine what to draw on screen, given the current configuration of nodes. This method is called repeatedly during the user interaction provided by the method <code>Snake2DKeeper.interactAndOptimize()</code>. The origin of coordinates lies at the top-left corner of the <code>display</code> parameter. Collectively, the array of scales forms the skin of the snake.<P><DD><DL><DT><B>Returns:</B><DD>Return an array of <code>Snake2DScale</code> objects. Straight lines will be drawn between the apices of each polygon, in the specified color. It is not necessary to maintain a constant number of polygons in the array, or a constant number of apices in a given polygon.<DT><B>See Also:</B><DD><A HREF="../snake2D/Snake2DScale.html" title="class in snake2D"><CODE>Snake2DScale</CODE></A></DL></DD></DL><HR><A NAME="setNodes(snake2D.Snake2DNode[])"><!-- --></A><H3>setNodes</H3><PRE>void <B>setNodes</B>(<A HREF="../snake2D/Snake2DNode.html" title="class in snake2D">Snake2DNode</A>[]&nbsp;node)</PRE><DL><DD>This method provides a mutator to the snake-defining nodes. It will be called repeatedly by the method <code>Snake2DKeeper.interactAndOptimize()</code>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>node</CODE> - Array of subpixel node locations.<DT><B>See Also:</B><DD><A HREF="../snake2D/Snake2D.html#getNodes()"><CODE>getNodes()</CODE></A></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../snake2D/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;PREV CLASS&nbsp;&nbsp;<A HREF="../snake2D/Snake2DKeeper.html" title="class in snake2D"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../index.html?snake2D/Snake2D.html" target="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="Snake2D.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../allclasses-noframe.html"><B>All Classes</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL:&nbsp;FIELD&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -