The following table lists the Image Processing Toolbox™ functions
that have been enabled for code generation. You must have the MATLAB^{®} Coder™ software
installed to generate C code from MATLAB for these functions.

Image Processing Toolbox provides three types of code generation support:

Functions that generate C code.

Functions that generate C code that depends on a platform-specific shared library (

`.dll`

,`.so`

, or`.dylib`

). Use of a shared library preserves performance optimizations in these functions, but this limits the target platforms for which you can generate code. For more information, see Code Generation for Image Processing.Functions that generate C code or C code that depends on a shared library, depending on which target platform you specify in MATLAB Coder. If you specify the generic

`MATLAB Host Computer`

target platform, these functions generate C code that depends on a shared library. If you specify any other target platform, these functions generate C code.

In generated code, each supported toolbox function has the same name, arguments, and functionality as its Image Processing Toolbox counterpart. However, some functions have limitations. The following table includes information about code generation limitations that might exist for each function. In the following table, all the functions generate C code. The table identifies those functions that generate C code that depends on a shared library, and those functions that can do both, depending on which target platform you choose.

Function | Remarks/Limitations |
---|---|

`adaptthresh` | The If you choose the generic MATLAB Function Block support: Yes.
The |

`affine2d` | When generating code, you can only specify single objects—arrays of objects are not supported. MATLAB Function Block support: Yes. |

`boundarymask` | The If you choose the generic MATLAB Function Block support: Yes. |

`bwareaopen` |
MATLAB Function Block support: No. |

`bwboundaries` | The If you choose
the generic MATLAB Function Block support: No. |

`bwconncomp` | The input image must be 2-D. The The MATLAB Function Block support: No. |

`bwdist` | The Generated code for this function uses a precompiled, platform-specific shared library. MATLAB Function Block support: Yes. |

MATLAB Function Block support: Yes. | |

When generating code, the parameter MATLAB Function Block support: No. | |

For best results, specify an input image of class
MATLAB Function Block support: Yes. | |

The character vector specifying the operation must be
a constant and, for best results, specify an input image of class
MATLAB Function Block support: No. | |

`bwpack` | Generated code for this function uses a precompiled platform-specific shared library. MATLAB Function Block support: Yes. |

Supports only 2-D images. Does not support any
no-output-argument syntaxes. The connectivity
matrix input argument,
MATLAB Function Block support: Yes. | |

`bwselect` | Supports only the 3 and 4 input argument syntaxes:
MATLAB Function Block support: Yes. |

`bwtraceboundary` | The MATLAB Function Block support: No. |

`bwunpack` | Generated code for this function uses a precompiled platform-specific shared library. MATLAB Function Block support: Yes.
The input argument |

Input arguments must be compile-time constants. MATLAB Function Block support: Yes. | |

`demosaic` | The MATLAB Function Block support: Yes. |

`edge` | The
MATLAB Function Block support: Yes.
The input arguments |

`fitgeotrans` | The MATLAB Function Block support: Yes. |

Inputs must be compile-time constants. Expressions or variables are allowed if their values do not change. MATLAB Function
Block support: Yes. The input arguments | |

`getrangefromclass` | MATLAB Function Block support: Yes. |

`grayconnected` | If you choose the generic `MATLAB Host Computer` target
platform, generated code uses a precompiled, platform-specific shared
library.MATLAB Function Block support: Yes. |

`histeq` | All the syntaxes that
include indexed images are not supported. This includes all
syntaxes that accept
MATLAB Function Block support: Yes.
The input argument |

`hough` | The optional parameter names MATLAB Function Block support:
Yes. The input argument |

`houghlines` | The optional parameter names MATLAB Function Block support: No. |

`houghpeaks` | The optional parameter names MATLAB Function Block support: Yes. |

`im2int16` |
MATLAB Function Block support: Yes. |

`im2uint8` |
MATLAB Function Block support: Yes. |

`im2uint16` | If you choose the generic `MATLAB Host Computer` target
platform, generated code uses a precompiled, platform-specific shared
library.MATLAB Function Block support: Yes. |

`im2single` | MATLAB Function Block support: Yes. |

`im2double` | MATLAB Function Block support: Yes. |

`imabsdiff` | MATLAB Function Block support: Yes. |

`imadjust` | Does not support syntaxes that include indexed images.
This includes all syntaxes that accept
MATLAB Function Block support: Yes. |

`imbinarize` | Character vector input arguments must be compile-time constants.
MATLAB Function Block support: Yes. |

`imbothat` | The input image
MATLAB Function Block support: Yes. |

`imboxfilt` | MATLAB Function Block support: Yes. |

`imclearborder` | The optional second input argument,
MATLAB Function Block support: Yes. |

`imclose` | The input image
MATLAB Function Block support: Yes. |

Does not support MATLAB Function Block support: Yes. | |

`imcrop` | The interactive syntaxes, such as `I2 = imcrop` ,
are not supported. Indexed images are not supported, including the
noninteractive syntax `X2 = imcrop(X,map,rect);` .MATLAB Function Block support: Yes. |

`imdilate` | The input image
MATLAB Function Block support: Yes. |

`imerode` | The input image
MATLAB Function Block support: Yes. |

`imextendedmax` | The optional third input argument,
MATLAB Function Block support: Yes. |

`imextendedmin` | The optional third input argument,
MATLAB Function Block support: Yes. |

The optional input connectivity, Supports only up to 3-D inputs. The
interactive mode to select points,
MATLAB Function Block support: Yes. | |

`imfilter` | The input image can be either 2-D or 3-D. The value of
the input argument,
MATLAB Function Block support: Yes. |

`imfindcircles` | All character vector input arguments and values must be compile-time constants.
MATLAB Function Block support: No. |

`imgaborfilt` | The The filter bank syntax is not supported. MATLAB Function Block support: Yes. |

`imgaussfilt` | Character vector input arguments must be compile-time constants. When MATLAB Function Block support: Yes. |

`imgradient3` | Character vector input arguments must be compile-time constants. MATLAB Function Block support: Yes. |

`imgradientxyz` | Character vector input arguments must be compile-time constants. MATLAB Function Block support: Yes. |

`imhist` | The optional second input argument,
MATLAB Function Block support: Yes.
The input argument |

The optional third input argument,
MATLAB Function Block support: Yes. | |

The optional third input argument,
MATLAB Function Block support: Yes. | |

`imlincomb` | The
MATLAB Function Block support: Yes. |

`immse` | MATLAB Function Block support: Yes. |

`imopen` | The input image
MATLAB Function Block support: Yes. |

`imoverlay` | If you specify the MATLAB Function Block support: Yes. |

`impyramid` | The MATLAB Function Block support: Yes. The input argument direction must be a compile-time constant. |

`imquantize` | MATLAB Function Block support: Yes. |

`imread` | Supports reading of 8-bit JPEG images only. The file name input argument must be a valid absolute path or relative path. This function generates code that uses a precompiled, platform-specific shared library. MATLAB Function Block support: Yes. The file name input argument must be a compile-time constant. |

The optional third input argument,
MATLAB Function Block support: Yes. | |

`imref2d` | The MATLAB Function Block support: Yes. |

`imref3d` | The MATLAB Function Block support: Yes. |

The optional second input argument,
MATLAB Function Block support: Yes. | |

The optional second input argument,
MATLAB Function Block support: Yes. | |

`imresize` | Does not support indexed images or custom interpolation kernels. All parameter-value pair input arguments must be compile-time constants. MATLAB Function Block support: Yes. The
input arguments |

`imrotate` | The
MATLAB Function Block support: Yes.
The input argument |

`imtophat` |
MATLAB Function Block support: Yes. |

`imtranslate` | The supports only 2-D translation vectors. 3-D translations are not supported
MATLAB Function Block support: Yes.
The input argument |

`imwarp` | The geometric transformation object input,
MATLAB Function Block support: Yes.
The input argument |

`integralBoxFilter` | The MATLAB Function
Block support: Yes. The input argument |

`intlut` |
MATLAB Function Block support: Yes. |

Input arguments must be compile-time constants. MATLAB Function Block support: Yes. | |

`iptcheckmap` | MATLAB Function Block support: Yes. |

`lab2rgb` | Character vector input arguments must be compile-time constants. MATLAB Function Block support: Yes. |

`label2idx` | MATLAB Function Block support: No. |

Referring to the standard syntax: RGB = label2rgb(L, map, zerocolor, order) Submit at least two input arguments: the label matrix, `L` , and the colormap matrix,`map` .`map` must be an`n-by-3` ,`double` , colormap matrix. You cannot use a character vector containing the name of a MATLAB colormap function or a function handle of a colormap function.If you set the boundary color `zerocolor` to the same color as one of the regions,`label2rgb` will not issue a warning.If you supply a value for `order` , it must be`'noshuffle'` .
MATLAB Function Block support: Yes. | |

`mean2` | MATLAB Function Block support: Yes. |

`medfilt2` | The
MATLAB Function Block support: Yes. The neighborhood size input argument must be a compile-time constant. |

`multithresh` |
MATLAB Function Block support: Yes.
The input argument |

`offsetstrel` | The MATLAB Function Block support: Yes. |

`ordfilt2` | The
MATLAB Function Block support: Yes. |

`otsuthresh` | MATLAB Function Block support: Yes. |

`padarray` | Support only up to 3-D inputs. Input arguments, MATLAB Function
Block support: Yes. The input argument |

`projective2d` | When generating code, you can only specify single objects—arrays of objects are not supported. MATLAB Function Block support: Yes. |

`psnr` | MATLAB Function Block support: Yes. |

Supports only 2-D images. Does not support the table
output type. Does not accept cell arrays as input—use a comma-separated
list instead. Does not support the properties
MATLAB Function Block support: No. | |

`rgb2gray` | MATLAB Function Block support: Yes. |

`rgb2lab` | Character vector input arguments must be compile-time constants. MATLAB Function Block support: Yes. |

`rgb2ycbcr` |
MATLAB Function Block support: Yes. |

`strel` | All of the input arguments must be compile-time constants. None of the methods are supported for code generation. When generating code, you can only specify single objects—arrays of objects are not supported. MATLAB Function Block support: Yes. |

`stretchlim` |
MATLAB Function Block support: Yes. |

`superpixels` | Character vector input arguments must be compile-time
constants. The value of MATLAB Function Block support: No. |

Supports only 2-D images. Supports only 4- or 8-connectivity.
Supports only up to 65,535 regions. The output type is always
MATLAB Function Block support: No. | |

`ycbcr2rgb` |
MATLAB Function Block support: Yes. |

Was this topic helpful?