{
  "id": 165776,
  "title": "What should be tf.image.rgb_to_yuv input range?",
  "url": "/competitions/alaska2-image-steganalysis/discussion/165776",
  "author_name": "",
  "post_date": "2020-07-11T04:51:02.699773900Z",
  "votes": 2,
  "comment_count": 3,
  "views": 0,
  "content": "<p>Has anyone used rgb_to_yuv function in tf.image?</p>\n\n<p>What should be the input RGB value range?</p>\n\n<p>The documentation is confusing. While saying\n &gt; \"Outputs a tensor of the same shape as the images tensor, containing the YUV value of the pixels. The output is only well defined if the value in images are in [0,1].\"</p>\n\n<p>The usage example gives:\n<code>\nx = [[[1.0, 2.0, 3.0],\n      [4.0, 5.0, 6.0]],\n    [[7.0, 8.0, 9.0],\n      [10.0, 11.0, 12.0]]]\ntf.image.rgb_to_yuv(x)\n</code></p>",
  "messages": [
    {
      "id": "923688",
      "postDate": "07/11/2020 04:51:02",
      "content": "<p>Has anyone used rgb_to_yuv function in tf.image?</p>\n\n<p>What should be the input RGB value range?</p>\n\n<p>The documentation is confusing. While saying\n &gt; \"Outputs a tensor of the same shape as the images tensor, containing the YUV value of the pixels. The output is only well defined if the value in images are in [0,1].\"</p>\n\n<p>The usage example gives:\n<code>\nx = [[[1.0, 2.0, 3.0],\n      [4.0, 5.0, 6.0]],\n    [[7.0, 8.0, 9.0],\n      [10.0, 11.0, 12.0]]]\ntf.image.rgb_to_yuv(x)\n</code></p>",
      "rawMarkdown": "Has anyone used rgb_to_yuv function in tf.image?\n\nWhat should be the input RGB value range?\n\nThe documentation is confusing. While saying\n &gt; \"Outputs a tensor of the same shape as the images tensor, containing the YUV value of the pixels. The output is only well defined if the value in images are in [0,1].\"\n\nThe usage example gives:\n```\nx = [[[1.0, 2.0, 3.0],\n      [4.0, 5.0, 6.0]],\n    [[7.0, 8.0, 9.0],\n      [10.0, 11.0, 12.0]]]\ntf.image.rgb_to_yuv(x)\n```",
      "votes": null
    },
    {
      "id": "924170",
      "postDate": "07/11/2020 09:46:03",
      "content": "<p>Be careful with that. YUV is not equal to YCbCr</p>",
      "rawMarkdown": "Be careful with that. YUV is not equal to YCbCr",
      "votes": null
    },
    {
      "id": "924172",
      "postDate": "07/11/2020 09:49:21",
      "content": "<p><a href=\"/demesgal\">@demesgal</a> Thanks for the reminder. What is the difference between them? I saw on wikipedia that two terms are used interchangeably.</p>",
      "rawMarkdown": "demesgal Thanks for the reminder. What is the difference between them? I saw on wikipedia that two terms are used interchangeably.",
      "votes": null
    },
    {
      "id": "924185",
      "postDate": "07/11/2020 10:02:37",
      "content": "<p>They may have different weights\nW * [r g b]'\n<a href=\"https://arxiv.org/pdf/1405.6147.pdf\">https://arxiv.org/pdf/1405.6147.pdf</a>\npage 43</p>\n\n<p>TF code for your method:\n<a href=\"https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/ops/image_ops_impl.py#L3250-L3282\">https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/ops/image_ops_impl.py#L3250-L3282</a>\n_rgb_to_yuv_kernel = [[0.299, -0.14714119, 0.61497538],\n                      [0.587, -0.28886916, -0.51496512],\n                      [0.114, 0.43601035, -0.10001026]]</p>",
      "rawMarkdown": "They may have different weights\nW * [r g b]'\nhttps://arxiv.org/pdf/1405.6147.pdf\npage 43\n\nTF code for your method:\nhttps://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/ops/image_ops_impl.py#L3250-L3282\n_rgb_to_yuv_kernel = [[0.299, -0.14714119, 0.61497538],\n                      [0.587, -0.28886916, -0.51496512],\n                      [0.114, 0.43601035, -0.10001026]]",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 924170,
      "author_name": "demesgal",
      "author_url": "",
      "post_date": "07/11/2020 09:46:03",
      "content": "<p>Be careful with that. YUV is not equal to YCbCr</p>",
      "votes": null,
      "replies": [
        {
          "id": 924172,
          "author_name": "tonychenxyz",
          "author_url": "",
          "post_date": "07/11/2020 09:49:21",
          "content": "<p><a href=\"/demesgal\">@demesgal</a> Thanks for the reminder. What is the difference between them? I saw on wikipedia that two terms are used interchangeably.</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 924185,
          "author_name": "demesgal",
          "author_url": "",
          "post_date": "07/11/2020 10:02:37",
          "content": "<p>They may have different weights\nW * [r g b]'\n<a href=\"https://arxiv.org/pdf/1405.6147.pdf\">https://arxiv.org/pdf/1405.6147.pdf</a>\npage 43</p>\n\n<p>TF code for your method:\n<a href=\"https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/ops/image_ops_impl.py#L3250-L3282\">https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/ops/image_ops_impl.py#L3250-L3282</a>\n_rgb_to_yuv_kernel = [[0.299, -0.14714119, 0.61497538],\n                      [0.587, -0.28886916, -0.51496512],\n                      [0.114, 0.43601035, -0.10001026]]</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "923688": "Has anyone used rgb_to_yuv function in tf.image?\n\nWhat should be the input RGB value range?\n\nThe documentation is confusing. While saying\n &gt; \"Outputs a tensor of the same shape as the images tensor, containing the YUV value of the pixels. The output is only well defined if the value in images are in [0,1].\"\n\nThe usage example gives:\n```\nx = [[[1.0, 2.0, 3.0],\n      [4.0, 5.0, 6.0]],\n    [[7.0, 8.0, 9.0],\n      [10.0, 11.0, 12.0]]]\ntf.image.rgb_to_yuv(x)\n```",
    "924170": "Be careful with that. YUV is not equal to YCbCr",
    "924172": "demesgal Thanks for the reminder. What is the difference between them? I saw on wikipedia that two terms are used interchangeably.",
    "924185": "They may have different weights\nW * [r g b]'\nhttps://arxiv.org/pdf/1405.6147.pdf\npage 43\n\nTF code for your method:\nhttps://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/ops/image_ops_impl.py#L3250-L3282\n_rgb_to_yuv_kernel = [[0.299, -0.14714119, 0.61497538],\n                      [0.587, -0.28886916, -0.51496512],\n                      [0.114, 0.43601035, -0.10001026]]"
  },
  "source": "meta"
}