英语翻译Copyright 1993-2002 The MathWorks,Inc.% $Revision:1.10 $

学习 时间:2026-04-08 07:57:58 阅读:7786
英语翻译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);endim2 = 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;elsemarker(im2) = -Inf;endim2 = imreconstruct(marker,im,conn);if islogical(im2)im2 = im & im2;elseim2 = 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 < 2conn = conndef(ndims(im),'maximal');elseconn = varargin{2};checkconn(conn,mfilename,'CONN',2);end% Skip NaN check here; it will be done by imreconstruct if input% is double.今天中午就要交的试卷,交不了,就悲剧了啊·

最佳回答

花痴的啤酒

腼腆的绿茶

2026-04-08 07:57:58

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 matrixN-D实数全矩阵% any numeric or logical nonsparse type任何数字的 或者逻辑非系数 类型% if islogical(IM),treated as binary若是逻辑数则为真,以二进制对待。% empty ok空集 确定 % Infs okInfs确定% if logical,NaNs are ok and treated as 0s,otherwise如果合乎逻辑的,通知书是确定并视为0 ,否则% not allowed。% ,不允许。%% CONN:connectivity连接器 连通%% IM2:Same class and size as IMIM2 :同一等级,与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);endim2 = 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;elsemarker(im2) = -Inf;endim2 = imreconstruct(marker,im,conn); if islogical(im2)im2 = im & im2;elseim2 = 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 < 2conn = conndef(ndims(im),'maximal');elseconn = varargin{2};checkconn(conn,mfilename,'CONN',2);end% Skip NaN check here; it will be done by imreconstruct if input这里跳过NaN检查 如果是双输入,则imreconstruct 函数可以解决。% is double。

最新回答共有2条回答

  • 追寻的大侠
    回复
    2026-04-08 07:57:58

    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 matrixN-D实数全矩阵% any numeric or logical nonsparse type任何数字的 或者逻辑非系数 类型% if islogical(IM),treated as binary若是逻辑数则为真,以二进制对待。% empty ok空集 确定 % Infs okInfs确定% if logical,NaNs are ok and treated as 0s,otherwise如果合乎逻辑的,通知书是确定并视为0 ,否则% not allowed。% ,不允许。%% CONN:connectivity连接器 连通%% IM2:Same class and size as IMIM2 :同一等级,与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);endim2 = 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;elsemarker(im2) = -Inf;endim2 = imreconstruct(marker,im,conn); if islogical(im2)im2 = im & im2;elseim2 = 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 < 2conn = conndef(ndims(im),'maximal');elseconn = varargin{2};checkconn(conn,mfilename,'CONN',2);end% Skip NaN check here; it will be done by imreconstruct if input这里跳过NaN检查 如果是双输入,则imreconstruct 函数可以解决。% is double。

上一篇 whty do you want go to the US for further study

下一篇 40g氢气和氧气的混合气体完全点燃生成36g水,则氢气与氧气的质量比可能是