Skip to content

gen_principal_comp_transGenPrincipalCompTransGenPrincipalCompTransgen_principal_comp_transT_gen_principal_comp_trans🔗

Short description🔗

gen_principal_comp_transGenPrincipalCompTransGenPrincipalCompTransgen_principal_comp_transT_gen_principal_comp_trans — Compute the transformation matrix of the principal component analysis of multichannel images.

Signature🔗

gen_principal_comp_trans( image MultichannelImage, out real Trans, out real TransInv, out real Mean, out real Cov, out real InfoPerComp )void GenPrincipalCompTrans( const HObject& MultichannelImage, HTuple* Trans, HTuple* TransInv, HTuple* Mean, HTuple* Cov, HTuple* InfoPerComp )static void HOperatorSet.GenPrincipalCompTrans( HObject multichannelImage, out HTuple trans, out HTuple transInv, out HTuple mean, out HTuple cov, out HTuple infoPerComp )def gen_principal_comp_trans( multichannel_image: HObject ) -> Tuple[Sequence[float], Sequence[float], Sequence[float], Sequence[float], Sequence[float]]

Herror T_gen_principal_comp_trans( const Hobject MultichannelImage, Htuple* Trans, Htuple* TransInv, Htuple* Mean, Htuple* Cov, Htuple* InfoPerComp )

HTuple HImage::GenPrincipalCompTrans( HTuple* TransInv, HTuple* Mean, HTuple* Cov, HTuple* InfoPerComp ) const

HTuple HImage.GenPrincipalCompTrans( out HTuple transInv, out HTuple mean, out HTuple cov, out HTuple infoPerComp )

Description🔗

gen_principal_comp_transGenPrincipalCompTrans computes the transformation matrix of a principal components analysis of multichannel images. This is useful for images obtained, e.g., with the thematic mapper of the Landsat satellite. Because the spectral bands are highly correlated, it is desirable to transform them to uncorrelated images. This can be used to save storage, since the bands containing little information can be discarded, and with respect to a later classification step.

The operator gen_principal_comp_transGenPrincipalCompTrans takes one or more multichannel images MultichannelImagemultichannelImagemultichannel_image and computes the transformation matrix Transtranstrans for the principal components analysis, as well as its inverse TransInvtransInvtrans_inv. All input images must have the same number of channels. The principal components analysis is performed based on the collection of data of all images. Hence, gen_principal_comp_transGenPrincipalCompTrans facilitates using the statistics of multiple images.

If \(n\) is the number of channels, Transtranstrans and TransInvtransInvtrans_inv are matrices of dimension n × (n+1), which describe an affine transformation of the multichannel gray values. They can be used to transform a multichannel image with linear_trans_colorLinearTransColor. For information purposes, the mean gray value of the channels and the n × n covariance matrix of the channels are returned in Meanmeanmean and Covcovcov, respectively. The parameter InfoPerCompinfoPerCompinfo_per_comp contains the relative information content of each output channel.

Attention🔗

Note that filter operators may return unexpected results if an image with a reduced domain is used as input. Please refer to the chapter Filters.

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🔗

MultichannelImagemultichannelImagemultichannel_image (input_object) (multichannel-)image(-array) → object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)HImage (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)HObject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)Hobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real)

Multichannel input image.

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

Transformation matrix for the computation of the PCA.

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

Transformation matrix for the computation of the inverse PCA.

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

Mean gray value of the channels.

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

Covariance matrix of the channels.

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

Information content of the transformed channels.

Result🔗

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

Module🔗

Foundation