关于MATLAB的翻译求助
Copyright1993-2002TheMathWorks,Inc.%$Revision:1.10$$Date:2002/03/1515:27:47$%Algorith...
Copyright 1993-2002 The MathWorks, Inc.
% $Revision: 1.10 $ $Date: 2002/03/15 15:27:47 $
% Algorithm reference: P. Soille, Morphological Image Analysis:
% Principles and Applications, Springer, 1999, pp. 164-165.
% Input-output specs
% ------------------
% IM: N-D, real, full matrix
% any numeric or logical nonsparse type
% if islogical(IM), treated as binary
% empty ok
% Infs ok
% if logical, NaNs are ok and treated as 0s, otherwise
% not allowed.
%
% CONN: connectivity
%
% IM2: Same class and size as IM
[im,conn] = parse_inputs(varargin{:});
conn = conn2array(conn);
marker = im;
% Now figure out which elements of the marker image are connected to the
% outside, according to the connectivity definition.
im2 = true(size(marker));
im2 = padarray(im2, ones(1,ndims(im2)), 0, 'both');
im2 = imerode(im2,conn);
idx = cell(1,ndims(im2));
for k = 1:ndims(im2)
idx{k} = 2:(size(im2,k) - 1);
end
im2 = im2(idx{:});
% Set all elements of the marker image that are not connected to the
% outside to the lowest possible value.
if islogical(marker)
marker(im2) = false;
else
marker(im2) = -Inf;
end
im2 = imreconstruct(marker, im, conn);
if islogical(im2)
im2 = im & ~im2;
else
im2 = imsubtract(im,im2);
end
%%%
%%% parse_inputs
%%%
function [im,conn] = parse_inputs(varargin)
checknargin(1,2,nargin,mfilename);
im = varargin{1};
checkinput(im, {'numeric' 'logical'}, {'nonsparse' 'real'}, ...
mfilename, 'IM', 1);
if nargin < 2
conn = conndef(ndims(im),'maximal');
else
conn = varargin{2};
checkconn(conn,mfilename,'CONN',2);
end
% Skip NaN check here; it will be done by imreconstruct if input
% is double.
今天中午就要交的试卷,交不了,就悲剧了啊·
麻烦大大们帮帮忙啊! 展开
% $Revision: 1.10 $ $Date: 2002/03/15 15:27:47 $
% Algorithm reference: P. Soille, Morphological Image Analysis:
% Principles and Applications, Springer, 1999, pp. 164-165.
% Input-output specs
% ------------------
% IM: N-D, real, full matrix
% any numeric or logical nonsparse type
% if islogical(IM), treated as binary
% empty ok
% Infs ok
% if logical, NaNs are ok and treated as 0s, otherwise
% not allowed.
%
% CONN: connectivity
%
% IM2: Same class and size as IM
[im,conn] = parse_inputs(varargin{:});
conn = conn2array(conn);
marker = im;
% Now figure out which elements of the marker image are connected to the
% outside, according to the connectivity definition.
im2 = true(size(marker));
im2 = padarray(im2, ones(1,ndims(im2)), 0, 'both');
im2 = imerode(im2,conn);
idx = cell(1,ndims(im2));
for k = 1:ndims(im2)
idx{k} = 2:(size(im2,k) - 1);
end
im2 = im2(idx{:});
% Set all elements of the marker image that are not connected to the
% outside to the lowest possible value.
if islogical(marker)
marker(im2) = false;
else
marker(im2) = -Inf;
end
im2 = imreconstruct(marker, im, conn);
if islogical(im2)
im2 = im & ~im2;
else
im2 = imsubtract(im,im2);
end
%%%
%%% parse_inputs
%%%
function [im,conn] = parse_inputs(varargin)
checknargin(1,2,nargin,mfilename);
im = varargin{1};
checkinput(im, {'numeric' 'logical'}, {'nonsparse' 'real'}, ...
mfilename, 'IM', 1);
if nargin < 2
conn = conndef(ndims(im),'maximal');
else
conn = varargin{2};
checkconn(conn,mfilename,'CONN',2);
end
% Skip NaN check here; it will be done by imreconstruct if input
% is double.
今天中午就要交的试卷,交不了,就悲剧了啊·
麻烦大大们帮帮忙啊! 展开
展开全部
Copyright 1993-2002 The MathWorks, Inc.
美国迈斯沃克公司 1993-2002 版权所有。
% $Revision: 1.10 $ $Date: 2002/03/15 15:27:47 $
版本 1.10 日期:2002/03/15 15:27:47
% Algorithm reference: P. Soille, Morphological Image Analysis:
算法参考:P. Soille 形态学图像分析
% Principles and Applications, Springer, 1999, pp. 164-165.
原理与应用原书名 Springer, 1999, pp. 164-165.
% Input-output specs
输入输出 规则
% ------------------
% IM: N-D, real, full matrix
N-D实数全矩阵
% any numeric or logical nonsparse type
任何数字的 或者逻辑非系数 类型
% if islogical(IM), treated as binary
若是逻辑数则为真,以二进制对待。
% empty ok
空集 确定
% Infs ok
Infs确定
% if logical, NaNs are ok and treated as 0s, otherwise
如果合乎逻辑的,通知书是确定并视为0 ,否则
% not allowed.
% ,不允许。
%
% CONN: connectivity
连接器 连通
%
% IM2: Same class and size as IM
IM2 :同一等级,与IM相同的规模
[im,conn] = parse_inputs(varargin{:});
赋值
conn = conn2array(conn); 赋值
marker = im;
标记:im;
% Now figure out which elements of the marker image are connected to the
% outside, according to the connectivity definition.
现在,根据连接定义,指出标记图像的哪个单元 连接外部,
im2 = true(size(marker)); 赋值
im2 = padarray(im2, ones(1,ndims(im2)), 0, 'both'); 赋值
im2 = imerode(im2,conn); 赋值
idx = cell(1,ndims(im2)); 赋值
for k = 1:ndims(im2) 循环
idx{k} = 2:(size(im2,k) - 1);
end
im2 = im2(idx{:});
% Set all elements of the marker image that are not connected to the
% outside to the lowest possible value.
将标记图像 中所有 未连接到外部的 单元 设置为 可行的最小值
if islogical(marker) 如果为真
marker(im2) = false;
else
marker(im2) = -Inf;
end
im2 = imreconstruct(marker, im, conn);
if islogical(im2)
im2 = im & ~im2;
else
im2 = imsubtract(im,im2);
end
%%%
%%% parse_inputs
%%%
function [im,conn] = parse_inputs(varargin)
checknargin(1,2,nargin,mfilename);
im = varargin{1};
checkinput(im, {'numeric' 'logical'}, {'nonsparse' 'real'}, ...
mfilename, 'IM', 1);
if nargin < 2
conn = conndef(ndims(im),'maximal');
else
conn = varargin{2};
checkconn(conn,mfilename,'CONN',2);
end
% Skip NaN check here; it will be done by imreconstruct if input
这里跳过NaN检查 如果是双输入,则imreconstruct 函数可以解决。
% is double.
美国迈斯沃克公司 1993-2002 版权所有。
% $Revision: 1.10 $ $Date: 2002/03/15 15:27:47 $
版本 1.10 日期:2002/03/15 15:27:47
% Algorithm reference: P. Soille, Morphological Image Analysis:
算法参考:P. Soille 形态学图像分析
% Principles and Applications, Springer, 1999, pp. 164-165.
原理与应用原书名 Springer, 1999, pp. 164-165.
% Input-output specs
输入输出 规则
% ------------------
% IM: N-D, real, full matrix
N-D实数全矩阵
% any numeric or logical nonsparse type
任何数字的 或者逻辑非系数 类型
% if islogical(IM), treated as binary
若是逻辑数则为真,以二进制对待。
% empty ok
空集 确定
% Infs ok
Infs确定
% if logical, NaNs are ok and treated as 0s, otherwise
如果合乎逻辑的,通知书是确定并视为0 ,否则
% not allowed.
% ,不允许。
%
% CONN: connectivity
连接器 连通
%
% IM2: Same class and size as IM
IM2 :同一等级,与IM相同的规模
[im,conn] = parse_inputs(varargin{:});
赋值
conn = conn2array(conn); 赋值
marker = im;
标记:im;
% Now figure out which elements of the marker image are connected to the
% outside, according to the connectivity definition.
现在,根据连接定义,指出标记图像的哪个单元 连接外部,
im2 = true(size(marker)); 赋值
im2 = padarray(im2, ones(1,ndims(im2)), 0, 'both'); 赋值
im2 = imerode(im2,conn); 赋值
idx = cell(1,ndims(im2)); 赋值
for k = 1:ndims(im2) 循环
idx{k} = 2:(size(im2,k) - 1);
end
im2 = im2(idx{:});
% Set all elements of the marker image that are not connected to the
% outside to the lowest possible value.
将标记图像 中所有 未连接到外部的 单元 设置为 可行的最小值
if islogical(marker) 如果为真
marker(im2) = false;
else
marker(im2) = -Inf;
end
im2 = imreconstruct(marker, im, conn);
if islogical(im2)
im2 = im & ~im2;
else
im2 = imsubtract(im,im2);
end
%%%
%%% parse_inputs
%%%
function [im,conn] = parse_inputs(varargin)
checknargin(1,2,nargin,mfilename);
im = varargin{1};
checkinput(im, {'numeric' 'logical'}, {'nonsparse' 'real'}, ...
mfilename, 'IM', 1);
if nargin < 2
conn = conndef(ndims(im),'maximal');
else
conn = varargin{2};
checkconn(conn,mfilename,'CONN',2);
end
% Skip NaN check here; it will be done by imreconstruct if input
这里跳过NaN检查 如果是双输入,则imreconstruct 函数可以解决。
% is double.
意法半导体(中国)投资有限公司
2023-06-12 广告
2023-06-12 广告
单片机,即单片微控制器,也称为单片微型计算机,是将中央处理器(CPU)、存储器(ROM,RAM)、输入/输出接口和其他功能部件集成在一块 在一个小块的集成电路上,从而实现对整个电路或系统的数字式控制。单片机不是完成某一个逻辑功能的芯片,而是...
点击进入详情页
本回答由意法半导体(中国)投资有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询