tf.image.adjust_hue
Stay organized with collections
Save and categorize content based on your preferences.
Adjust hue of RGB images.
tf.image.adjust_hue(
image, delta, name=None
)
This is a convenience method that converts an RGB image to float
representation, converts it to HSV, add an offset to the hue channel, converts
back to RGB and then back to the original data type. If several adjustments
are chained it is advisable to minimize the number of redundant conversions.
image
is an RGB image. The image hue is adjusted by converting the
image(s) to HSV and rotating the hue channel (H) by
delta
. The image is then converted back to RGB.
delta
must be in the interval [-1, 1]
.
Args |
image
|
RGB image or images. Size of the last dimension must be 3.
|
delta
|
float. How much to add to the hue channel.
|
name
|
A name for this operation (optional).
|
Returns |
Adjusted image(s), same shape and DType as image .
|
Usage Example:
>> import tensorflow as tf
>> x = tf.random.normal(shape=(256, 256, 3))
>> tf.image.adjust_hue(x, 0.2)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.image.adjust_hue\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 2 version](/api_docs/python/tf/image/adjust_hue) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/ops/image_ops_impl.py#L1913-L1954) |\n\nAdjust hue of RGB images.\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.adjust_hue`](/api_docs/python/tf/image/adjust_hue), \\`tf.compat.v2.image.adjust_hue\\`\n\n\u003cbr /\u003e\n\n tf.image.adjust_hue(\n image, delta, name=None\n )\n\nThis is a convenience method that converts an RGB image to float\nrepresentation, converts it to HSV, add an offset to the hue channel, converts\nback to RGB and then back to the original data type. If several adjustments\nare chained it is advisable to minimize the number of redundant conversions.\n\n`image` is an RGB image. The image hue is adjusted by converting the\nimage(s) to HSV and rotating the hue channel (H) by\n`delta`. The image is then converted back to RGB.\n\n`delta` must be in the interval `[-1, 1]`.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|---------|------------------------------------------------------------|\n| `image` | RGB image or images. Size of the last dimension must be 3. |\n| `delta` | float. How much to add to the hue channel. |\n| `name` | A name for this operation (optional). |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| Adjusted image(s), same shape and DType as `image`. ||\n\n\u003cbr /\u003e\n\n#### Usage Example:\n\n \u003e\u003e import tensorflow as tf\n \u003e\u003e x = tf.random.normal(shape=(256, 256, 3))\n \u003e\u003e tf.image.adjust_hue(x, 0.2)"]]