"Fossies" - the Fresh Open Source Software Archive

Member "sip-0.12.1/macros/getangle.sci" (31 Aug 2011, 1575 Bytes) of package /linux/privat/sip-0.12.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Scilab source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "getangle.sci": 0.5.6_vs_0.12.1.

    1 function [theta]=getangle(Deltax,Deltay);
    2 //
    3 // Obtains the gradient direction "theta"
    4 // from result images yielded by convolution with gradient masks
    5 // in direction x and y (Deltax and Deltay, respectively)
    6 // 
    7 // AUTHOR
    8 //    Ricardo Fabbri  <rfabbri@(not this part) gmail d0t com>
    9 //    Cybernetic Vision Research Group
   10 //    Luciano da Fontoura Costa, supervisor.
   11 //    http://siptoolbox.sf.net
   12 //
   13 // $Revision: 1.2 $ $Date: 2009-03-29 21:34:48 $
   14 
   15 if argn(2) <> 2 then
   16    error('Invalid number of arguments.');
   17 end
   18 
   19 theta=ones(Deltax)*%pi/2;
   20 k=find(Deltax<>0)
   21 theta(k)=atan(Deltay(k),Deltax(k));
   22 endfunction 
   23 //
   24 // -------------------------------------------------------------------------
   25 // SIP - Scilab Image Processing toolbox
   26 // Copyright (C) 2002-2009  Ricardo Fabbri
   27 //
   28 // This program is free software; you can redistribute it and/or modify
   29 // it under the terms of the GNU General Public License as published by
   30 // the Free Software Foundation; either version 2 of the License, or
   31 // (at your option) any later version.
   32 //
   33 // This program is distributed in the hope that it will be useful,
   34 // but WITHOUT ANY WARRANTY; without even the implied warranty of
   35 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   36 // GNU General Public License for more details.
   37 //
   38 // You should have received a copy of the GNU General Public License
   39 // along with this program; if not, write to the Free Software
   40 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   41 // -------------------------------------------------------------------------
   42 //