ROTHWELLEDGE - Subpixel edge detector.

Contents

Description

Implementation of the edge detector proposed by Rothwell et al. [RMHN95].

Syntax

   edgemap = rothwelledge(I);
   edgemap = rothwelledge(I,sigma);
   edgemap = rothwelledge(gx,gy);
   [edgemap,mag,orient] = ...
               rothwelledge(I, sigma, 'low', low, 'a', alpha);
   [edgemap,mag,orient] =  ...
               rothwelledge(gx, gy, 'low', low, 'a', alpha);

Inputs

I : input image or partial derivative in X-direction, depending on the subsequent option passed.

V : optional parameter storing:

default: V=1 as the standard deviation (an image is assumed to be passed).

Property [propertyname propertyvalues]

'low' : unique threshold value used by the Rothwell technique; typical range of values is [3,18]; default: low=5.

'a' : typical range of values is [0.8,0.95]; default: a=0.8.

'samp' : to perform (* samp) interpolation of the input image to avoid aliasing; default: samp=1.

'reduce' : logical value or string defining the way the different channels of a multispectral image are combined into the output edge map (see ROTHWELLEDGE_BASE); it can be either:

in true case, it is set to 'sum'; default: reduce=false, ie. no 'combination' is used, a multichannel map is output; this parameter is naturally ignored when I is a scalar image.

Outputs

edgemap : a binary edge map.

mag, orient : optional output images for the gradient magnitude and the gradient orientation resp.

Acknowledgment

This function uses the C function developped Heath et al. for the comparative study in [HSSB97]; the mex file in ROTHWELL_MEX calls directly the code made available by the authors in the page: ftp://figment.csee.usf.edu/pub/Edge_Comparison/source_code/rothwell.src

References

[RMHN95] C. Rothwell, J. Mundy, B. Hoffman and V.-D. Nguyen: "Driving Vision by Topology", Proc. International Symposium on Computer Vision, pp. 395-400 - Techn. report 2444, INRIA, 1995. http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=477034&tag=1

[HSSB97] M. Heath, S. Sarkar, T. Sanocki, T. and K.W. Bowyer: "A robust visual method for assessing the relative performance of edge-detection algorithms", IEEE Trans. on Pattern Analysis and Machine Intelligence, 19(12):1338-1359, 1997. http://ieeexplore.ieee.org/xpls/abs_all.jsp?arnumber=643893

See also

Ressembles: EDGECORNER, CANNYEDGE, CANNYEDGEPROD, CANNYEDGEMAP, SDGDEDGE, CONGRUENCYEDGE, COMPASSEDGE, ANISOEDGE, ELDERZUCKEREDGE, KOETHEDGE, PETROUEDGE. Requires: ROTHWELLEDGE_BASE.

Function implementation

function [edgemap,varargout] = rothwelledge(I, varargin)

check if possible

if ~exist('rothwelledge_mex','file')
    error('mex file rothwell_mex not found');
end

error(nargchk(1, 18, nargin, 'struct'));
error(nargoutchk(1, 3, nargout, 'struct'));

if ~isnumeric(I)
    error('rothwelledge:inputparameter','a matrix is required in input');
end

parsing parameters

p = createParser('ROTHWELLEDGE');
p.addOptional('V', 1., @(x)isnumeric(x) || (isscalar(x) && x>=0.05));
p.addParamValue('low', 5, @(x)isscalar(x) && x>=0 && x<=20);
p.addParamValue('a', 0.8, @(x)isscalar(x) && x>=0 && x<=1);
p.addParamValue('samp', 1, @(x)isscalar(x) && round(x)==x && x>=1 && x<=5);
p.addParamValue('reduce', false, @(x)islogical(x) || ...
    (ischar(x) && any(strcmpi(x,{'igray','imax','isum','gmax','eor'}))));

% parse and validate all input arguments
p.parse(varargin{:});
p = getvarParser(p);

call the mex file

[edgemap,or,mag] = rothwelledge_base(I, p.V, p.low, p.a, p.samp, p.reduce);

if nargout>=2
    varargout{1} = mag;
    if nargout==3
        varargout{2} = or;
    end
end

if p.disp
    figure, imagesc(edgemap), axis image off, title('Rothwell edge map');
    if size(edgemap,3) == 1, colormap gray;  end;
end
end % end of rothwelledge