ImageContainer.features_texture#
- ImageContainer.features_texture(layer, library_id=None, feature_name='texture', channels=None, props=('contrast', 'dissimilarity', 'homogeneity', 'correlation', 'ASM'), distances=(1,), angles=(0, 0.7853981633974483, 1.5707963267948966, 2.356194490192345))#
Calculate texture features.
A gray level co-occurrence matrix (GLCM) is computed for different combinations of distance and angle.
The distance defines the pixel difference of co-occurrence. The angle define the direction along which we check for co-occurrence. The GLCM includes the number of times that gray-level occurs at a distance and at an angle theta from gray-level .
- Parameters:
- layer
str Image layer in
imgthat should be processed. IfNoneand only 1 layer is present, it will be selected.- library_id
str|None(default:None) Name of the Z-dimension that this function should be applied to.
- feature_name
str(default:'texture') Base name of feature in resulting feature values
dict.- channels
int|Sequence[int] |None(default:None) Channels for this feature is computed. If
None, use all channels.- props
Sequence[str] (default:('contrast', 'dissimilarity', 'homogeneity', 'correlation', 'ASM')) Texture features that are calculated, see the
propargument inskimage.feature.graycoprops().- distances
Sequence[int] (default:(1,)) The
distancesargument inskimage.feature.graycomatrix().- angles
Sequence[float] (default:(0, 0.7853981633974483, 1.5707963267948966, 2.356194490192345)) The
anglesargument inskimage.feature.graycomatrix().
- layer
- Returns:
dict[str,Any] – Returns features with the following keys for each channelcinchannels:'{feature_name}_ch-{c}_{p}_dist-{dist}_angle-{a}'- the GLCM properties, for eachpinprops,dindistancesandainangles.
Notes
If the image is not of type
numpy.uint8, it will be converted.