count_channelsCountChannelsCountChannelscount_channelscount_channels
Short description
count_channelsCountChannelsCountChannelscount_channelscount_channels — Count channels of image.
Signature
count_channels( image MultiChannelImage, out integer Channels )void CountChannels( const HObject& MultiChannelImage, HTuple* Channels )static void HOperatorSet.CountChannels( HObject multiChannelImage, out HTuple channels )def count_channels( multi_channel_image: HObject ) -> Sequence[int]
def count_channels_s( multi_channel_image: HObject ) -> intHerror count_channels( const Hobject MultiChannelImage, Hlong* Channels )
Herror T_count_channels( const Hobject MultiChannelImage, Htuple* Channels )
HTuple HImage::CountChannels( ) const
HTuple HImage.CountChannels( )
Description
The operator count_channelsCountChannels counts the number of
channels of all input images.
Execution information
-
Supports objects on compute devices.
-
Multithreading type: reentrant (runs in parallel with non-exclusive operators).
-
Multithreading scope: global (may be called from any thread).
-
Processed without parallelization.
Parameters
MultiChannelImagemultiChannelImagemulti_channel_image (input_object) (multichannel-)image(-array) → object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)Hobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)
One- or multi-channel image.
Channelschannelschannels (output_control) integer(-array) → (integer)HTuple (Hlong)HTuple (int / long)Sequence[int]Htuple (Hlong)
Number of channels.
Example
(C)
read_image(&Color,"patras")\;
count_channels(Color,&num_channels)\;
for (i=1\; i<=num_channels\; i++)
{
access_channel(Color,&Channel,i)\;
disp_image(Channel,WindowHandle)\;
clear_obj(Channel)\;
}
Combinations with other operators
Combinations
Possible successors
access_channelAccessChannel, append_channelAppendChannel, disp_imageDispImage
See also
append_channelAppendChannel, access_channelAccessChannel
Module
Foundation