フィルターのクリア

why imerode and imdilate make matlab stopped every time ?

1 回表示 (過去 30 日間)
alaa adel
alaa adel 2015 年 12 月 8 日
コメント済み: Walter Roberson 2015 年 12 月 10 日
after write imerode function
i=imread('\cameraman.jpg');
B=im2bw(1,0.3);
K3=ones(3);
K5=ones(5);
K7=ones(7);
K9=ones(9);
B3=imerode(B,K3);
B5=imerode(B,K5);
B7=imerode(B,K7);
B9=imerode(B,K9);
imshow(B)
figure, imshow(B3), title('by 3');
figure, imshow(B5), title('by 5');
figure, imshow(B7), title('by 7');
figure, imshow(B9), title('by 9');
matlab stop and popup msg with matlab must be debug ?
what can i do ?
function imdilate show msg matlab has encountered an internal problem and need to close .
so how solve this problem ?
  2 件のコメント
Walter Roberson
Walter Roberson 2015 年 12 月 8 日
Does your MATLAB also stop working as soon as you draw any graphics? For example, does plot(3,5) cause problems?
Amith Kamath
Amith Kamath 2015 年 12 月 8 日
FYI: The crash can be observed by doing this:
imerode(true, ones(3,3));
There is no crash observed for other strel sizes.

サインインしてコメントする。

採用された回答

Amith Kamath
Amith Kamath 2015 年 12 月 8 日
Alaa:
You've probably found a bug in imerode. However, I believe you really meant to do this instead:
B = im2bw(i, 0.3); % in this case, B is indeed the 256x256 matrix.
rather than
B = im2bw(1,0.3); % in this case, B is a scalar logical value of 1.
Doing so will not make MATLAB crash, but provide you the results you were originally looking for.
Hope this helps!
  2 件のコメント
alaa adel
alaa adel 2015 年 12 月 9 日
編集済み: Walter Roberson 2015 年 12 月 10 日
thank you for your help
this
B= im2bw(i);
solve my problem as not make MATLAB crash
but i don't know the reason
Walter Roberson
Walter Roberson 2015 年 12 月 10 日
This is one of the reasons to avoid using i as a variable name.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by