You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: imVesselness2d.m
    path of file: ./repos/matImage/matImage/imFilters
    
    the code of the file until where you have to start completion: function [V, B, S] = imVesselness2d(img, varargin)
%IMVESSELNESS2D Vesselness of cuvilinear structures from Frangi paper
%
%   V = imVesselness2d(IMG)
%   Apply vesselness filter to grayscale or intensity image IMG. 
%
%   [V, B, S] = imVesselness2d(IMG)
%   Also return the "Blobness" and "Structureness" arrays, as defined by
%   Frangi.
%
%   ... = imVesselness2d(IMG, SIGMA)

    
function [V, B, S] = imVesselness2d(img, varargin)
%IMVESSELNESS2D Vesselness of cuvilinear structures from Frangi paper
%
%   V = imVesselness2d(IMG)
%   Apply vesselness filter to grayscale or intensity image IMG. 
%
%   [V, B, S] = imVesselness2d(IMG)
%   Also return the "Blobness" and "Structureness" arrays, as defined by
%   Frangi.
%
%   ... = imVesselness2d(IMG, SIGMA)
%   Specifies the scale of the curvilinear structures to enhance. If SIMGA
%   is an array, returns an array of images with dimensions M-by-N-by-P,
%   where M and N are size of image, and P is size of SIGMA array.
%
%   Example
%     img = imread('coins.png');
%     bnd = imdilate(img, ones(3,3)) - imerode(img, ones(3,3));
%     V = imVesselness2d(bnd);
%     figure;
%     subplot(1, 2, 1); imshow(bnd);
%     subplot(1, 2, 2); imshow(V);
%
%
%   See also
%     imHessian, imEigenValues, imGradientFilter
 
% ------
% Author: David Legland
% e-mail: david.legland@inra.fr
% Created: 2014-08-18,    using Matlab 8.3.0.532 (R2014a)
% Copyright 2014 INRA - Cepia Software Platform.

% some default values
sigma = 1;
beta = .5;
c = 5;

% parse input arguments
if ~isempty(varargin)
    sigma = varargin{1};
    varargin(1) = [];
end