This function assumes that img1 and img2 are image batches, i.e. the last
three dimensions are [height, width, channels].
Original paper: Wang, Zhou, Eero P. Simoncelli, and Alan C. Bovik. "Multiscale
structural similarity for image quality assessment." Signals, Systems and
Computers, 2004.
Args
img1
First image batch with only Positive Pixel Values.
img2
Second image batch with only Positive Pixel Values. Must have the
same rank as img1.
max_val
The dynamic range of the images (i.e., the difference between the
maximum the and minimum allowed values).
power_factors
Iterable of weights for each of the scales. The number of
scales used is the length of the list. Index 0 is the unscaled
resolution's weight and each increasing scale corresponds to the image
being downsampled by 2. Defaults to (0.0448, 0.2856, 0.3001, 0.2363,
0.1333), which are the values obtained in the original paper.
filter_size
Default value 11 (size of gaussian filter).
filter_sigma
Default value 1.5 (width of gaussian filter).
k1
Default value 0.01
k2
Default value 0.03 (SSIM is less sensitivity to K2 for lower values, so
it would be better if we took the values in the range of 0 < K2 < 0.4).
Returns
A tensor containing an MS-SSIM value for each image in batch. The values
are in range [0, 1]. Returns a tensor with shape:
broadcast(img1.shape[:-3], img2.shape[:-3]).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-04-26 UTC."],[],[],null,["# tf.image.ssim_multiscale\n\n\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.16.1/tensorflow/python/ops/image_ops_impl.py#L4483-L4609) |\n\nComputes the MS-SSIM between img1 and img2.\n\n#### View aliases\n\n\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.image.ssim_multiscale`](https://www.tensorflow.org/api_docs/python/tf/image/ssim_multiscale)\n\n\u003cbr /\u003e\n\n tf.image.ssim_multiscale(\n img1,\n img2,\n max_val,\n power_factors=_MSSSIM_WEIGHTS,\n filter_size=11,\n filter_sigma=1.5,\n k1=0.01,\n k2=0.03\n )\n\nThis function assumes that `img1` and `img2` are image batches, i.e. the last\nthree dimensions are \\[height, width, channels\\].\n| **Note:** The true SSIM is only defined on grayscale. This function does not perform any colorspace transform. (If the input is already YUV, then it will compute YUV SSIM average.)\n\nOriginal paper: Wang, Zhou, Eero P. Simoncelli, and Alan C. Bovik. \"Multiscale\nstructural similarity for image quality assessment.\" Signals, Systems and\nComputers, 2004.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `img1` | First image batch with only Positive Pixel Values. |\n| `img2` | Second image batch with only Positive Pixel Values. Must have the same rank as img1. |\n| `max_val` | The dynamic range of the images (i.e., the difference between the maximum the and minimum allowed values). |\n| `power_factors` | Iterable of weights for each of the scales. The number of scales used is the length of the list. Index 0 is the unscaled resolution's weight and each increasing scale corresponds to the image being downsampled by 2. Defaults to (0.0448, 0.2856, 0.3001, 0.2363, 0.1333), which are the values obtained in the original paper. |\n| `filter_size` | Default value 11 (size of gaussian filter). |\n| `filter_sigma` | Default value 1.5 (width of gaussian filter). |\n| `k1` | Default value 0.01 |\n| `k2` | Default value 0.03 (SSIM is less sensitivity to K2 for lower values, so it would be better if we took the values in the range of 0 \\\u003c K2 \\\u003c 0.4). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A tensor containing an MS-SSIM value for each image in batch. The values are in range \\[0, 1\\]. Returns a tensor with shape: broadcast(img1.shape\\[:-3\\], img2.shape\\[:-3\\]). ||\n\n\u003cbr /\u003e"]]