cv.StructuredEdgeDetection/StructuredEdgeDetection - MATLAB File Help |
The only constructor
obj = cv.StructuredEdgeDetection(model)
obj = cv.StructuredEdgeDetection(model, howToGetFeatures)
The following is an example of a custom feature extractor MATLAB function:
% This function extracts feature channels from src. The
% StructureEdgeDetection uses this feature space to detect
% edges.
function features = myRFFeatureGetter(src, opts)
% src: source image to extract features
% features: output n-channel floating-point feature matrix
% opts: struct of options
gnrmRad = opts.normRad; % gradientNormalizationRadius
gsmthRad = opts.grdSmooth; % gradientSmoothingRadius
shrink = opts.shrink; % shrinkNumber
outNum = opts.nChns; % numberOfOutputChannels
gradNum = opts.nOrients; % numberOfGradientOrientations
nsize = [size(src,1) size(src,2)] ./ shrink;
features = zeros([nsize outNum], 'single');
% ... here your feature extraction code
end
TODO: Custom extractor is not internally used in the current cv.StructuredEdgeDetection implementation. See this tutorial for more information about training your own structured forest (it uses an external MATLAB toolbox for the training part).