关于Matlab中的函数定义

时间:2019-07-15 10:52:30

标签: matlab signal-processing

enter image description here

我在代码的开头写了函数定义。但是报告了一个错误。请给我一些有关该错误的提示。预先感谢

function [I_diff, I_filtered]= img()
% Load images and c o n v e r t t o gra y image
Ag=rgb2gray(imread(surv_01.png));
Bg=rgb2gray(imread(surv_02.png));

% Get differenceimage
D = Ag-Bg ;
% Homegeneous a re a s bl a c k , d i f f e r e n c e s w h i t e
D=abs(Ag-Bg) ;
% Get minimum and maximum v al u e ( b o t h d imens ions ! )
d_min = min(min(D)) ;
d_max = max(max(D)) ;
% Use i n t e r v a l 00 1
D=D-dmin;
D=D/(d_max - d_min) ;
% Return r e s u l t
I_diff=D;
I_filtered = Idiff ;
I_filtered(Idiff<=0.5) = 0 ;

0 个答案:

没有答案