hi i divided image into 4 equal halves and i need to save a block which contain maximum edge pixels,i attached code,but its not working .so please correct my code.

1 次查看(过去 30 天)
i1 = cc(1:96,1:96);
i2 = cc(1:96,97:192);
i3 = cc(97:192,1:96);
i4 = cc(97:192,97:192);
y = {i1, i2, i3, i4};
o=[];
for i=1:length(y)
ui=edge(i,'canny');
count=length(find(ui(:)==1));
o=find(max(count));
end

采纳的回答

Walter Roberson
Walter Roberson 2015-8-24
for i=1:length(y)
ui = edge(y{i},'canny');
count(i) = length(find(ui(:)==1));
end
[~, o] = max(count);
  2 个评论
kaavya subramani
kaavya subramani 2015-8-24
Hai sir,i saw "latest activity edited by Azi...." for my question,but no suggestions provided by him.thatsy i commented like that.
Walter Roberson
Walter Roberson 2015-8-24
Azzi specializes in control systems. He edits Questions of all sorts to make them readable as a service to others, but he would not typically answer this kind of question.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by