필터 지우기
필터 지우기

how to resolve error in code generation when syntex is correct?

조회 수: 1 (최근 30일)
Hira Abid
Hira Abid 2018년 7월 20일
댓글: Walter Roberson 2023년 5월 10일
i'm using matlab coder to convert my code to C. i'm facing problem in converting some built in function of matlab as imfill, regioprops etc. following is the line of code:
outer_blob = imfill(bin,'holes');
and error is:
Expected input number 2, CONN, to be one of these types: double, logical
as, i see in imfill my syntex is correct for code genration. please help me out.
  댓글 수: 3
Hira Abid
Hira Abid 2018년 7월 20일
bin is a binary image... i'm using R2018a
Walter Roberson
Walter Roberson 2018년 7월 20일
What is class(bin) ? Telling me that it is a binary image does not tell me whether bin is logical, or is double that uses values 0.0 and 1.0, or is uint8 that uses values uint8(0) and uint8(1), or is uint8 that uses values uint8(0) and uint8(255)

댓글을 달려면 로그인하십시오.

답변 (2개)

Guillaume
Guillaume 2018년 7월 20일
Have you tried
outer_blob = imfill(bin, 4, 'holes');
in case this is a bug in matlab? (I don't have coder so can't test)
  댓글 수: 3
Guillaume
Guillaume 2018년 7월 20일
Does the same code work without being compiled?
Hira Abid
Hira Abid 2018년 7월 20일
yup, it works perfect in matlab environment. the problem arises in conversion

댓글을 달려면 로그인하십시오.


jose
jose 2023년 5월 8일
Did you figure out? I have the same issue.
  댓글 수: 1
Walter Roberson
Walter Roberson 2023년 5월 10일
Which MATLAB release are you using?
Note that according to the documentation, when you compile,
  • Input argument 'holes' is not supported, if the input is a binary image.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by