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

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 comentarios

What is class(bin) ?
Which MATLAB release are you using?
bin is a binary image... i'm using R2018a
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)

Iniciar sesión para comentar.

Respuestas (2)

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 comentarios

if i do so, as :
outer_blob = imfill(bin, 4, 'holes');
it gives following error:
Invalid input syntax.
i don't know where the problem is?
Does the same code work without being compiled?
yup, it works perfect in matlab environment. the problem arises in conversion

Iniciar sesión para comentar.

jose
jose el 8 de Mayo de 2023
Did you figure out? I have the same issue.

1 comentario

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.

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB Coder en Centro de ayuda y File Exchange.

Preguntada:

el 20 de Jul. de 2018

Comentada:

el 10 de Mayo de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by