skimage 0.17.2

NotesOther ParametersParametersReturnsBackRef
structural_similarity(im1, im2, *, win_size=None, gradient=False, data_range=None, multichannel=False, gaussian_weights=False, full=False, **kwargs)

Notes

To match the implementation of Wang et. al. , set :None:None:`gaussian_weights` to True, :None:None:`sigma` to 1.5, and :None:None:`use_sample_covariance` to False.

versionchanged

This function was renamed from skimage.measure.compare_ssim to skimage.metrics.structural_similarity .

Other Parameters

use_sample_covariance : bool

If True, normalize covariances by N-1 rather than, N where N is the number of pixels within the sliding window.

K1 : float

Algorithm parameter, K1 (small constant, see ).

K2 : float

Algorithm parameter, K2 (small constant, see ).

sigma : float

Standard deviation for the Gaussian when :None:None:`gaussian_weights` is True.

Parameters

im1, im2 : ndarray

Images. Any dimensionality with same shape.

win_size : int or None, optional

The side-length of the sliding window used in comparison. Must be an odd value. If :None:None:`gaussian_weights` is True, this is ignored and the window size will depend on :None:None:`sigma`.

gradient : bool, optional

If True, also return the gradient with respect to im2.

data_range : float, optional

The data range of the input image (distance between minimum and maximum possible values). By default, this is estimated from the image data-type.

multichannel : bool, optional

If True, treat the last dimension of the array as channels. Similarity calculations are done independently for each channel then averaged.

gaussian_weights : bool, optional

If True, each patch has its mean and variance spatially weighted by a normalized Gaussian kernel of width sigma=1.5.

full : bool, optional

If True, also return the full structural similarity image.

Returns

mssim : float

The mean structural similarity index over the image.

grad : ndarray

The gradient of the structural similarity between im1 and im2 . This is only returned if gradient is set to True.

S : ndarray

The full SSIM image. This is only returned if :None:None:`full` is set to True.

Compute the mean structural similarity index between two images.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

skimage.measure._structural_similarity.compare_ssim

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /skimage/metrics/_structural_similarity.py#12
type: <class 'function'>
Commit: