This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

imsplit

Split multichannel image into its individual channels

Syntax

[c1,c2,c3,...,ck] = imsplit(I)

Description

example

[c1,c2,c3,...,ck] = imsplit(I) returns a set of k images representing the individual channels in the k-channel image I.

Examples

collapse all

Read an RGB image into the workspace and then split the image into its component channels.

I = imread('peppers.png');
[r,g,b] = imsplit(I);
montage({r,g,b})

Read an RGB image into the workspace.

rgbImage = imread('peppers.png');

Convert the RGB image to the HSV colorspace.

hsvImage = rgb2hsv(rgbImage);

Split the HSV image into three images, each representing one of its component channels. Display a montage of all the channels.

[h,s,v] = imsplit(hsvImage);
montage({h,s,v})

Input Arguments

collapse all

Input image, specified as an m-by-n-by-k numeric array.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | logical

Output Arguments

collapse all

Output images, returned as k individual numeric matrices, where k is the number of channels in the input image. The output images are the same class as the input image.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2018b