function [time,ridge,out] = topo(im)
%
% topo: topographic analysis returns the eight surface types determined 
%       by Gaussian and Mean curvature aproximations
%       ridge returns an image where only ridge values (2) in the output image
%       are true
% 
%   on input:
% 
%     im:    2D array of heights at pixels
% 
%   on output:
% 
%     time:          total time for ridge finder 
%     out:           2D array of labeled ridge segments
%
% Call:
% 
%    [time,out] = topo(im)
%
%   Authors:     Scott Morris/Tom Henderson
%                Univ of Utah
%                8 Oct/17 Oct 1996



tic  

[k1 k2 k3 k4 k5 k6 k7 k8 k9 k10] = bicubic(im);

H = Mcurv(k1,k2,k3,k4,k5,k6,k7,k8,k9,k10);

K = Gcurv(k1,k2,k3,k4,k5,k6,k7,k8,k9,k10);

out = curlab2(H,K);

[m,n] = size(im);

temp = 2*ones(m,n);

ridge = (out == temp);

time = toc;




