通信人家园

 找回密码
 注册

只需一步,快速开始

短信验证,便捷登录

搜索

军衔等级:

  下士

注册:2008-12-15
跳转到指定楼层
1#
发表于 2010-4-25 22:51:38 |只看该作者 |倒序浏览
已定位出错误出现在如下程序段:
[height,width] =size(IM3); % height求出是612,width为816
for i =2:width-1
    for j =2:height-1
        ary =IM3(i-1,j)+IM3(i+1,j)+IM3(i,j-1)+IM3(i,j+1); % IM3为二值图像
        if((IM3(i,j) ==0) &(ary>=2))
            IM3(i,j) =1;
            continue;
        end
        if(IM3(i,j) ==1 &ary ==0)
            IM3(i,j) =0;
        end
    end
end
figure
imshow(IM3);title('候选区矩形化');
该程序要实现的功能是将连通区域矩形化,但运行到这里就出现报警:Index exceeds matrix dimensions.
为什么会这样?求助!!!!!

举报本楼

本帖有 3 个回帖,您需要登录后才能浏览 登录 | 注册
您需要登录后才可以回帖 登录 | 注册 |

版规|手机版|C114 ( 沪ICP备12002291号-1 )|联系我们 |网站地图  

GMT+8, 2025-7-17 06:08 , Processed in 0.129921 second(s), 19 queries , Gzip On.

Copyright © 1999-2025 C114 All Rights Reserved

Discuz Licensed

回顶部