Does simulink have a model that realized the function like imfill

Does simulink have a model that realized the function like imfill ,Nowadays,I'm woking on simulink to build a model that can detect the edge of a cell from the source avi file,an m file implement it mainly used the API called imfill(I,'holes'),First ,I used the Embedded Function to call this API,but I failed ,because it doesn't support this function,How can I realize this funtion?

回答 (2 件)

Kaustubha Govind
Kaustubha Govind 2011 年 5 月 24 日

0 投票

If you do not plan to generate code from your model, you can use the eml.extrinsic (coder.extrinsic starting in R2011a) directive to declare imfill as an extrinsic function call to be dispatched to MATLAB.

2 件のコメント

Bit ??
Bit ?? 2011 年 5 月 25 日
Thanks for your answer.I will use the embedded Function to generate Embedded code for TIDSP,How can I do ,Should I generate a model by myself or build the function in use of the basic simulink models?
Kaustubha Govind
Kaustubha Govind 2011 年 5 月 25 日
I don't have much experience with the Image Processing Blockset, so I don't know if there is a block equivalent of imfill. If there isn't, then you could indeed implement the function yourself using basic Simulink blocks, or even the Embedded MATLAB functions.

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

Javier  Chauvin
Javier Chauvin 2011 年 11 月 1 日

0 投票

Hi
Im looking for the same thing, a block that applies imfill to a video.
in a function block
function y = fcn(I)
coder.extrinsic('imfill');
y = imfill(I,'holes');
"I" is my video that i want to fill, but get this error
"Function output 'y' cannot be of MATLAB type.
Function 'Filtraje y cuadros/Programing/Lenado' (#55.0.71), line 1, column 1: "function y = fcn(I)"
i'm a beginner in simulink and image processing. What can i do?

2 件のコメント

Kaustubha Govind
Kaustubha Govind 2011 年 11 月 1 日
You need to pre-declare 'y' so that the block knows what type it should expect, since it can't figure out what type coder.extrinsic functions return.
function y = fcn(I)
coder.extrinsic('imfill');
y = coder.nullcopy(I); %y is the same type as I
y = imfill(I,'holes');
Also, in the future, please create a new question.
Will
Will 2018 年 3 月 13 日
@Kaustubha Govind
Thank you for your answer!

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

カテゴリ

ヘルプ センター および File ExchangeSimulink Coder についてさらに検索

質問済み:

2011 年 5 月 24 日

コメント済み:

2018 年 3 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by