This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Code Generation

Generate C code and MEX functions for toolbox functions

MATLAB® Coder™ generates standalone C code from Image Processing Toolbox™ functions that have been enabled to support code generation. Using the toolbox with MATLAB Coder, you can generate ANSI-compliant C code or MEX functions.


imread Read image from graphics file
hsv2rgb Convert HSV colormap to RGB colormap
im2double Convert image to double precision
im2int16 Convert image to 16-bit signed integers
im2single Convert image to single precision
im2uint16 Convert image to 16-bit unsigned integers
im2uint8 Convert image to 8-bit unsigned integers
lab2rgb Convert CIE 1976 L*a*b* to RGB
rgb2gray Convert RGB image or colormap to grayscale
rgb2hsv Convert RGB colormap to HSV colormap
rgb2lab Convert RGB to CIE 1976 L*a*b*
rgb2ycbcr Convert RGB color values to YCbCr color space
ycbcr2rgb Convert YCbCr color values to RGB color space
imbinarize Binarize image by thresholding
imquantize Quantize image using specified quantization levels and output values
multithresh Multilevel image thresholds using Otsu's method
otsuthresh Global histogram threshold using Otsu's method
demosaic Convert Bayer pattern encoded image to truecolor image
getrangefromclass Default display range of image based on its class
label2rgb Convert label matrix into RGB image
iptcheckmap Check validity of colormap
fitgeotrans Fit geometric transformation to control point pairs
imcrop Crop image
imresize Resize image
imrotate Rotate image
imtranslate Translate image
imwarp Apply geometric transformation to image
impyramid Image pyramid reduction and expansion
histeq Enhance contrast using histogram equalization
imadjust Adjust image intensity values or colormap
imabsdiff Absolute difference of two images
imlincomb Linear combination of images
imcomplement Complement image
imoverlay Burn binary mask into 2-D image
intlut Convert integer values using lookup table
stretchlim Find limits to contrast stretch image
bwareaopen Remove small objects from binary image
bwlookup Nonlinear filtering using lookup tables
bwmorph Morphological operations on binary images
imbothat Bottom-hat filtering
imclearborder Suppress light structures connected to image border
imclose Morphologically close image
imdilate Dilate image
imerode Erode image
imextendedmax Extended-maxima transform
imextendedmin Extended-minima transform
imfill Fill image regions and holes
imhmax H-maxima transform
imhmin H-minima transform
imopen Morphologically open image
imreconstruct Morphological reconstruction
imregionalmax Regional maxima
imregionalmin Regional minima
imtophat Top-hat filtering
watershed Watershed transform
conndef Create connectivity array
iptcheckconn Check validity of connectivity argument
boundarymask Find region boundaries of segmentation
bwboundaries Trace region boundaries in binary image
bwconncomp Find connected components in binary image
bwdist Distance transform of binary image
bweuler Euler number of binary image
bwlabel Label connected components in 2-D binary image
bwtraceboundary Trace object in binary image
bwpack Pack binary image
bwunpack Unpack binary image
bwperim Find perimeter of objects in binary image
bwselect Select objects in binary image
edge Find edges in intensity image
grayconnected Select contiguous image region with similar gray values
imgradient3 Find 3-D gradient magnitude and direction of images
imgradientxyz Find the directional gradients of a 3-D image
hough Hough transform
houghlines Extract line segments based on Hough transform
houghpeaks Identify peaks in Hough transform
getrangefromclass Default display range of image based on its class
grayconnected Select contiguous image region with similar gray values
imfindcircles Find circles using circular Hough transform
immse Mean-squared error
imoverlay Burn binary mask into 2-D image
label2idx Convert label matrix to cell array of linear indices
mean2 Average or mean of matrix elements
psnr Peak Signal-to-Noise Ratio (PSNR)
regionprops Measure properties of image regions
superpixels 2-D superpixel oversegmentation of images
superpixels3 3-D superpixel oversegmentation of 3-D image
imfilter N-D filtering of multidimensional images
imboxfilt 2-D box filtering of images
imgaborfilt Apply Gabor filter or set of filters to 2-D image
imgaussfilt 2-D Gaussian filtering of images
fspecial Create predefined 2-D filter
integralBoxFilter 2-D box filtering of integral images
integralImage Calculate integral image
medfilt2 2-D median filtering
ordfilt2 2-D order-statistic filtering
padarray Pad array


imref2d Reference 2-D image to world coordinates
imref3d Reference 3-D image to world coordinates
affine2d 2-D affine geometric transformation
projective2d 2-D projective geometric transformation
strel Morphological structuring element
offsetstrel Morphological offset structuring element


Code Generation for Image Processing

Certain Image Processing Toolbox functions are enabled to generate C code using MATLAB Coder.

Understanding Code Generation with Image Processing Toolbox

The Image Processing Toolbox includes functions that generate either standalone C code or code that depends on a shared library.

Generate Code from Application Containing Image Processing Functions

This example shows how to generate C code using MATLAB Coder from MATLAB applications that use Image Processing Toolbox functions.

List of Supported Functions with Usage Notes

This list describes the functions that support code generation using MATLAB Coder.

Was this topic helpful?