filter_edge_canny.m

来自「实现了在MATLAB环境下进行汽车车牌识别的过程」· M 代码 · 共 42 行

M
42
字号
function varargout = filter_edge_canny(varargin)


if nargin == 0
	p1 = struct( ...
		'Name',					'Threshold', ...
		'Style',				'single', ...
		'DefaultValue',			0.5, ...
		'Max',					1, ...
		'Min',					0, ...
		'LargeStep',			1 / 10, ...
		'SmallStep',			1 / 100);
	p2 = struct( ...
		'Name',					'Automatic threshold', ...
		'Style',				'check', ...
		'DefaultValue',			0);
	p3 = struct( ...
		'Name',					'Sigma', ...
		'Style',				'single', ...
		'DefaultValue',			0.5, ...
		'Max',					1, ...
		'Min',					0.01, ...
		'LargeStep',			0.1, ...
		'SmallStep',			0.01);
	P = struct( ...
		'FilterName',			'Canny edge detection', ...
		'AvailableImageType',	[0 0 0 1 0], ...
		'Class',				'edge', ...
		'ParameterNumber',		3, ...
		'Parameters', 			{ { p1, p2, p3} });
	varargout{1} = P;
else
	CX = varargin{1};
	FUNPARA = varargin{2};
	if ~FUNPARA{2}
		threshold = FUNPARA{1};
	else
		threshold = [];
	end
	BW = edge(CX, 'canny', threshold, FUNPARA{3});
	varargout{1} = BW;
end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?