Main Content

Use Custom Image Filter Algorithms as Reusable Blocks in Simulink

This example shows how to incorporate image filter algorithms written in C code into a model using C Caller blocks in a reusable Simulink® library.

In this example, three image filter blocks are C Caller blocks in a library model. Their dependent C code is specified in the library model custom code settings.

The image filter C functions are implemented using row-major array layout. The library custom code settings specify the default function array layout as row-major.

These library image filter blocks can be reused by adding them to models.

mdl = 'slexCCallerExampleImageFilter';
open_system(mdl);

Image filter model that uses C caller block

As the simulation runs, the MATLAB Function block displays the filtered images.

sim(mdl);

See Also

Related Topics