imsplit
Split multichannel image into its individual channels
Description
[
returns a set of k images representing the individual channels in the
k-channel image c1,c2,c3,...,ck
] = imsplit(I
)I
.
Examples
Split RGB Image into Its Component Channels
Read an RGB image into the workspace and display the image.
I = imread('peppers.png');
imshow(I)
Split the image into its component red, green, and blue channels.
[r,g,b] = imsplit(I);
Display the three color channels as a montage. Red peppers have a signal predominantly in the red channel. Yellow and green peppers have a signal in both the red and green channels. White objects, such as the garlic in the foreground, have a strong signal in all three channels.
montage({r,g,b},'Size',[1 3])
Split Image in HSV Colorspace into Its Component Channels
Read an RGB image into the workspace and display the image.
rgbImage = imread('peppers.png');
imshow(rgbImage)
Convert the RGB image to the HSV colorspace by using the rgb2hsv
function.
hsvImage = rgb2hsv(rgbImage);
Split the HSV image into its component hue, saturation, and value channels.
[h,s,v] = imsplit(hsvImage);
Display the three channels as a montage.
montage({h,s,v},'Size',[1 3])
Input Arguments
I
— Input image
m-by-n-by-k array
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
c1,c2,c3,...,ck
— Output images
numeric matrix for each channel
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™.
imsplit
supports the generation of C
code (requires MATLAB®
Coder™). For more information, see Code Generation for Image Processing.
Thread-Based Environment
Run code in the background using MATLAB® backgroundPool
or accelerate code with Parallel Computing Toolbox™ ThreadPool
.
This function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
Version History
Introduced in R2018bR2021b: Support for thread-based environments
imsplit
now supports thread-based
environments.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)