Operator Reference

count_channelscount_channelsCountChannelsCountChannelscount_channels (Operator)

count_channelscount_channelsCountChannelsCountChannelscount_channels — Count channels of image.

Signature

count_channels(MultiChannelImage : : : Channels)

Herror count_channels(const Hobject MultiChannelImage, Hlong* Channels)

Herror T_count_channels(const Hobject MultiChannelImage, Htuple* Channels)

void CountChannels(const HObject& MultiChannelImage, HTuple* Channels)

HTuple HImage::CountChannels() const

static void HOperatorSet.CountChannels(HObject multiChannelImage, out HTuple channels)

HTuple HImage.CountChannels()

def count_channels(multi_channel_image: HObject) -> Sequence[int]

def count_channels_s(multi_channel_image: HObject) -> int

Description

The operator count_channelscount_channelsCountChannelsCountChannelscount_channels 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

MultiChannelImageMultiChannelImageMultiChannelImagemultiChannelImagemulti_channel_image (input_object)  (multichannel-)image(-array) objectHImageHObjectHObjectHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)

One- or multi-channel image.

ChannelsChannelsChannelschannelschannels (output_control)  integer(-array) HTupleSequence[int]HTupleHtuple (integer) (int / long) (Hlong) (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);
}

Possible Successors

access_channelaccess_channelAccessChannelAccessChannelaccess_channel, append_channelappend_channelAppendChannelAppendChannelappend_channel, disp_imagedisp_imageDispImageDispImagedisp_image

See also

append_channelappend_channelAppendChannelAppendChannelappend_channel, access_channelaccess_channelAccessChannelAccessChannelaccess_channel

Module

Foundation