Skip to content

principal_compPrincipalCompPrincipalCompprincipal_compT_principal_comp🔗

Short description🔗

principal_compPrincipalCompPrincipalCompprincipal_compT_principal_comp — Compute the principal components of multichannel images.

Signature🔗

principal_comp( image MultichannelImage, out image PCAImage, out real InfoPerComp )void PrincipalComp( const HObject& MultichannelImage, HObject* PCAImage, HTuple* InfoPerComp )static void HOperatorSet.PrincipalComp( HObject multichannelImage, out HObject PCAImage, out HTuple infoPerComp )def principal_comp( multichannel_image: HObject ) -> Tuple[HObject, Sequence[float]]

Herror T_principal_comp( const Hobject MultichannelImage, Hobject* PCAImage, Htuple* InfoPerComp )

HImage HImage::PrincipalComp( HTuple* InfoPerComp ) const

HImage HImage.PrincipalComp( out HTuple infoPerComp )

Description🔗

principal_compPrincipalComp does 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 principal_compPrincipalComp takes a (multichannel) image MultichannelImagemultichannelImagemultichannel_image and transforms it to the output image PCAImagePCAImagepcaimage, which contains the same number of channels, using the principal components analysis. The parameter InfoPerCompinfoPerCompinfo_per_comp contains the relative information content of each output channel.

Attention🔗

principal_compPrincipalComp can be executed on OpenCL devices if image consists of eight channels or less. Since the calculations are done in single precision floating point, the results may differ from those calculated by the CPU.

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
  • Supports OpenCL 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🔗

MultichannelImagemultichannelImagemultichannel_image (input_object) (multichannel-)image → 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*) *allowed for compute devices

Multichannel input image.

PCAImagePCAImagepcaimage (output_object) multichannel-image → object (real)HObject (real)HImage (real)HObject (real)Hobject * (real)

Multichannel output image.

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

Information content of each output channel.

Result🔗

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

Combinations with other operators🔗

Combinations

Alternatives

gen_principal_comp_transGenPrincipalCompTrans

See also

linear_trans_colorLinearTransColor

Module🔗

Foundation