Skip to content

gen_canonical_variates_transgen_canonical_variates_transGenCanonicalVariatesTransGenCanonicalVariatesTransgen_canonical_variates_transT_gen_canonical_variates_trans🔗

Short description🔗

gen_canonical_variates_transgen_canonical_variates_transGenCanonicalVariatesTransGenCanonicalVariatesTransgen_canonical_variates_transT_gen_canonical_variates_trans — Compute the transformation matrix of a multichannel image using the canonical variates analysis.

Signature🔗

gen_canonical_variates_trans( dict TrainingSamples, integer NumComponents, out real TransMat )gen_canonical_variates_trans( : : TrainingSamples, NumComponents : TransMat )void GenCanonicalVariatesTrans( const HTuple& TrainingSamples, const HTuple& NumComponents, HTuple* TransMat )static void HOperatorSet.GenCanonicalVariatesTrans( HTuple trainingSamples, HTuple numComponents, out HTuple transMat )def gen_canonical_variates_trans( training_samples: Sequence[HHandle], num_components: int ) -> Sequence[float]

Herror T_gen_canonical_variates_trans( const Htuple TrainingSamples, const Htuple NumComponents, Htuple* TransMat )

static HTuple HImage::GenCanonicalVariatesTrans( const HDictArray& TrainingSamples, Hlong NumComponents )

static HTuple HImage.GenCanonicalVariatesTrans( HDict[] trainingSamples, int numComponents )

Description🔗

gen_canonical_variates_transGenCanonicalVariatesTrans computes the affine transformation matrix of a multichannel image into an image with a different number of channels using class-specific canonical variates analysis. This can be used to reduce the number of channels of an image while at the same time keeping the classes separable as good as possible.

One or more multichannel images are passed in TrainingSamplestrainingSamplestraining_samples. If multiple images are passed, all must have the same number of channels. An array of regions is passed in TrainingSamplestrainingSamplestraining_samples, describing which pixel of the input image TrainingSamplestrainingSamplestraining_samples belongs to which class. The number of objects in TrainingSamplestrainingSamplestraining_samples must be equal to the number of images times the number of classes. If a class contains no pixels of a particulate image, the corresponding entry in TrainingSamplestrainingSamplestraining_samples must be set to the empty region.

The number of channels in the transformed image are passed in NumComponentsnumComponentsnum_components. Note that NumComponentsnumComponentsnum_components can be at most one less than the number of classes.

The affine transformation is returned in TransMattransMattrans_mat. This transformation can be used with, for example, linear_trans_colorLinearTransColor to transform an image.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

Parameters🔗

TrainingSamplestrainingSamplestraining_samples (input_control) dict-array → (handle)(handle)HTuple (HHandle)HDict, HTuple (IntPtr)Sequence[HHandle]Htuple (handle)

Training samples.

NumComponentsnumComponentsnum_components (input_control) integer → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Number of target components.

Default: 33

TransMattransMattrans_mat (output_control) real-array → (real)(real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Transformation matrix for transforming the input image.

Result🔗

The operator gen_canonical_variates_transGenCanonicalVariatesTrans returns the value 2 (H_MSG_TRUE) if the parameters are correct. Otherwise an exception is raised.

Combinations with other operators🔗

Combinations

Possible successors

linear_trans_colorLinearTransColor

Alternatives

principal_compPrincipalComp, gen_principal_comp_transGenPrincipalCompTrans

Module🔗

Foundation