灰度柔性形态学腐蚀算子的MATLAB程序,求高手帮忙看看,写出数学表达式并把注释翻译成中文。高分奉上,谢

clear all ;
F1 = imread(’test256. bmp’) ;
F = double (F1) ;
[ a ,b ] = size (F) ;
SE = [1 1 1 1 1 ;1 1 1 1 1 ;1 1 1 1 1 ] 3 180
[ c ,d ] = size (SE) ;
e = (c + 1) / 2 ;
f = (d + 1) / 2 ;
hardcore = [1 3 ;2 1 ;2 2 ;2 3 ;2 4 ;2 5 ;3 3 ] ;
k = 2 ;
R = zeros (a ,b) ;
for x = 1 :a
for y = 1 :b
sort number = 0 ;
sort numberh = 0 ;
for i = 1 :c
m = i - e ;
for j = 1 :d
n = j - f ;
if (x + m) > = 1 & (x + m) < = a & (y
+ n) > = 1 &(y + n) < = b
sort number = sort number + 1 ;
D(sort number) = F ( (x + m) , (y + n) ) + SE(i ,
j) ;
if all ( [ i ,j ] = = hardcore (1 , :) ) | all ( [ i ,j ] = =
hardcore (2 , :) )
sort numberh = sort numberh + 1 ;
H(sort numberh) = D(sort number) ;
end
end
end % now the difference set is completed
end
number calculation = max(size (D) ) ;
number k = max(size (H) ) ;
T = zeros (1 ,number calculation + (k - 1) 3 num2
ber k) ;
for repeat number = 1 :k - 1
T( (repeat number - 1) 3 number k + 1 :repeat
number 3 number k) = H;
end
T( (k - 1) 3 number k + 1 :max ( size (T) ) ) =
D ;
T = sort (T) ; %sort the difference set
R (x ,y) = T(max ( size ( T) ) - k + 1) ; %the
kth smallest number
if R(x ,y) > 255
R(x ,y) = 255 ;
end
D = 0 ; %2003. 6. 2
H = 0 ;
end
end

第1个回答  2011-03-25
那找C语言专业专家黄欣阳(南华大学&&), xyhuang969@tom.com。 他很和蔼的,很乐于帮忙的。
第2个回答  2011-03-28
黄欣阳(南华大学&&), xyhuang969@tom.com。支持!

参考资料:楼上

第3个回答  2011-04-10
T = sort (T) ; %sort the difference set本回答被提问者采纳
第4个回答  2011-03-30
sscdkjkjhkhkhjhgcjsdcdsfoliopui

Warning: Invalid argument supplied for foreach() in /www/wwwroot/www.t2y.org3v3b34/skin/templets/default/contents.html on line 47
相似回答
大家正在搜