I am using version 2019a. I am using bwboundaries to find the contour of an object, but it has recently been causing crashes. However, the crashes only occur with certain images and I am not sure what the differences are. Attached are img1.m and img2.m which contain the images. Running the following leads to a crash with an error message reading "Illegal instruction detected at [Time]"
B=bwboundaries(img1);
However running everything the same on img2 gives me the proper readout
B=bwboundaries(img2);
The only obvious difference I can see is that img1 only has one object and img2 has five objects (confirmed by running regionprops on both images). Adding in objects into img1 did not solve the issue.

 채택된 답변

Image Analyst
Image Analyst 2021년 7월 5일

0 개 추천

I don't have that particular version but it works fine with r2021a:
s1 = load('img1.mat')
bw1 = s1.img1;
subplot(1, 2, 1);
imshow(bw1);
s2 = load('img2.mat')
bw2 = s2.img2;
subplot(1, 2, 2);
imshow(bw2);
axis on image
b1 = bwboundaries(bw1)
b2 = bwboundaries(bw2)
s1 =
struct with fields:
img1: [490×490 logical]
s2 =
struct with fields:
img2: [529×529 logical]
b1 =
1×1 cell array
{59×2 double}
b2 =
5×1 cell array
{ 3×2 double}
{22×2 double}
{ 3×2 double}
{72×2 double}
{ 3×2 double}

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Convert Image Type에 대해 자세히 알아보기

제품

릴리스

R2019a

질문:

2021년 7월 5일

답변:

2021년 7월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by