{
  "id": 99018,
  "title": "How to de-normalize bbox value?",
  "url": "/competitions/open-images-2019-object-detection/discussion/99018",
  "author_name": "",
  "post_date": "2019-07-08T09:41:28.670387100Z",
  "votes": null,
  "comment_count": 5,
  "views": 0,
  "content": "<p>The image size is (768, 1024) and x_min , x_max , y_min , y_max = 0.330833, 0.675833, 0.904375, 0.999375. </p>\n\n<p>How to de-normalize and extract the bbox pixel coordinates ?  </p>\n\n<p>&gt; XMin, XMax, YMin, YMax: coordinates of the box, in normalized image coordinates. XMin is in [0,1], where 0 is the leftmost pixel, and 1 is the rightmost pixel in the image. Y coordinates go from the top pixel (0) to the bottom pixel (1) </p>",
  "messages": [
    {
      "id": "570435",
      "postDate": "07/08/2019 09:41:28",
      "content": "<p>The image size is (768, 1024) and x_min , x_max , y_min , y_max = 0.330833, 0.675833, 0.904375, 0.999375. </p>\n\n<p>How to de-normalize and extract the bbox pixel coordinates ?  </p>\n\n<p>&gt; XMin, XMax, YMin, YMax: coordinates of the box, in normalized image coordinates. XMin is in [0,1], where 0 is the leftmost pixel, and 1 is the rightmost pixel in the image. Y coordinates go from the top pixel (0) to the bottom pixel (1) </p>",
      "rawMarkdown": "The image size is (768, 1024) and x_min , x_max , y_min , y_max = 0.330833, 0.675833, 0.904375, 0.999375. \n\nHow to de-normalize and extract the bbox pixel coordinates ?  \n\n&gt; XMin, XMax, YMin, YMax: coordinates of the box, in normalized image coordinates. XMin is in [0,1], where 0 is the leftmost pixel, and 1 is the rightmost pixel in the image. Y coordinates go from the top pixel (0) to the bottom pixel (1)",
      "votes": null
    },
    {
      "id": "570471",
      "postDate": "07/08/2019 10:45:46",
      "content": "<p>I believe it is scaled based on image size. Where 0 is either the leftmost or topmost pixel and 1 is the rightmost or bottom pixel.\nThe description of the bbox for OpenImages is found here:\n<a href=\"https://storage.googleapis.com/openimages/web/download.html#attributes\">https://storage.googleapis.com/openimages/web/download.html#attributes</a></p>\n\n<p>&gt; XMin, XMax, YMin, YMax: coordinates of the box, in normalized image coordinates. XMin is in [0,1], where 0 is the leftmost pixel, and 1 is the rightmost pixel in the image. Y coordinates go from the top pixel (0) to the bottom pixel (1).</p>\n\n<p>Also NOTE: the OpenImages specifies the order of the bbox values to be XMin, XMax, YMin, YMax, whereas the Kaggle submission requires that they be in a different order: XMin YMin XMax YMax.</p>",
      "rawMarkdown": "I believe it is scaled based on image size. Where 0 is either the leftmost or topmost pixel and 1 is the rightmost or bottom pixel.\nThe description of the bbox for OpenImages is found here:\nhttps://storage.googleapis.com/openimages/web/download.html#attributes\n\n&gt; XMin, XMax, YMin, YMax: coordinates of the box, in normalized image coordinates. XMin is in [0,1], where 0 is the leftmost pixel, and 1 is the rightmost pixel in the image. Y coordinates go from the top pixel (0) to the bottom pixel (1).\n\nAlso NOTE: the OpenImages specifies the order of the bbox values to be XMin, XMax, YMin, YMax, whereas the Kaggle submission requires that they be in a different order: XMin YMin XMax YMax.",
      "votes": null
    },
    {
      "id": "570485",
      "postDate": "07/08/2019 11:04:36",
      "content": "<p>How do I de-normalize the bbox value? If I get the scaled factor, I can convert it back to bbox pixel coordinates. </p>",
      "rawMarkdown": "How do I de-normalize the bbox value? If I get the scaled factor, I can convert it back to bbox pixel coordinates.",
      "votes": null
    },
    {
      "id": "570513",
      "postDate": "07/08/2019 11:58:02",
      "content": "<p>You just need to multiply the scaled value by the image dimensions and then round the result to the nearest integer.\neg if you had an image with height 100 and width 120, and a scaled x coord of 0.4 and y coord of 0.5, then the X pixel will be 0.4 * 120 = 48 and the Y pixel will be 0.5 * 100 = 50</p>",
      "rawMarkdown": "You just need to multiply the scaled value by the image dimensions and then round the result to the nearest integer.\neg if you had an image with height 100 and width 120, and a scaled x coord of 0.4 and y coord of 0.5, then the X pixel will be 0.4 * 120 = 48 and the Y pixel will be 0.5 * 100 = 50",
      "votes": null
    },
    {
      "id": "570518",
      "postDate": "07/08/2019 12:03:44",
      "content": "<p>More specifically to answer your example:</p>\n\n<p>xmin = 0.330833 * 1024 = 338.772992 = 339\nxmax = 0.675833 * 1024 = 692.052992‬ = 692\nymin = 0.904375 * 768 = 694.56 = 695\nymax = 0.999375 * 768 = 767.52 = 768</p>",
      "rawMarkdown": "More specifically to answer your example:\n\nxmin = 0.330833 * 1024 = 338.772992 = 339\nxmax = 0.675833 * 1024 = 692.052992‬ = 692\nymin = 0.904375 * 768 = 694.56 = 695\nymax = 0.999375 * 768 = 767.52 = 768",
      "votes": null
    },
    {
      "id": "570569",
      "postDate": "07/08/2019 13:28:32",
      "content": "<p>Thanks <a href=\"/cherring\">@cherring</a> </p>",
      "rawMarkdown": "Thanks @cherring",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 570471,
      "author_name": "cherring",
      "author_url": "",
      "post_date": "07/08/2019 10:45:46",
      "content": "<p>I believe it is scaled based on image size. Where 0 is either the leftmost or topmost pixel and 1 is the rightmost or bottom pixel.\nThe description of the bbox for OpenImages is found here:\n<a href=\"https://storage.googleapis.com/openimages/web/download.html#attributes\">https://storage.googleapis.com/openimages/web/download.html#attributes</a></p>\n\n<p>&gt; XMin, XMax, YMin, YMax: coordinates of the box, in normalized image coordinates. XMin is in [0,1], where 0 is the leftmost pixel, and 1 is the rightmost pixel in the image. Y coordinates go from the top pixel (0) to the bottom pixel (1).</p>\n\n<p>Also NOTE: the OpenImages specifies the order of the bbox values to be XMin, XMax, YMin, YMax, whereas the Kaggle submission requires that they be in a different order: XMin YMin XMax YMax.</p>",
      "votes": null,
      "replies": [
        {
          "id": 570485,
          "author_name": "",
          "author_url": "",
          "post_date": "07/08/2019 11:04:36",
          "content": "<p>How do I de-normalize the bbox value? If I get the scaled factor, I can convert it back to bbox pixel coordinates. </p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 570513,
          "author_name": "cherring",
          "author_url": "",
          "post_date": "07/08/2019 11:58:02",
          "content": "<p>You just need to multiply the scaled value by the image dimensions and then round the result to the nearest integer.\neg if you had an image with height 100 and width 120, and a scaled x coord of 0.4 and y coord of 0.5, then the X pixel will be 0.4 * 120 = 48 and the Y pixel will be 0.5 * 100 = 50</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 570518,
          "author_name": "cherring",
          "author_url": "",
          "post_date": "07/08/2019 12:03:44",
          "content": "<p>More specifically to answer your example:</p>\n\n<p>xmin = 0.330833 * 1024 = 338.772992 = 339\nxmax = 0.675833 * 1024 = 692.052992‬ = 692\nymin = 0.904375 * 768 = 694.56 = 695\nymax = 0.999375 * 768 = 767.52 = 768</p>",
          "votes": null,
          "replies": []
        },
        {
          "id": 570569,
          "author_name": "",
          "author_url": "",
          "post_date": "07/08/2019 13:28:32",
          "content": "<p>Thanks <a href=\"/cherring\">@cherring</a> </p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "570435": "The image size is (768, 1024) and x_min , x_max , y_min , y_max = 0.330833, 0.675833, 0.904375, 0.999375. \n\nHow to de-normalize and extract the bbox pixel coordinates ?  \n\n&gt; XMin, XMax, YMin, YMax: coordinates of the box, in normalized image coordinates. XMin is in [0,1], where 0 is the leftmost pixel, and 1 is the rightmost pixel in the image. Y coordinates go from the top pixel (0) to the bottom pixel (1)",
    "570471": "I believe it is scaled based on image size. Where 0 is either the leftmost or topmost pixel and 1 is the rightmost or bottom pixel.\nThe description of the bbox for OpenImages is found here:\nhttps://storage.googleapis.com/openimages/web/download.html#attributes\n\n&gt; XMin, XMax, YMin, YMax: coordinates of the box, in normalized image coordinates. XMin is in [0,1], where 0 is the leftmost pixel, and 1 is the rightmost pixel in the image. Y coordinates go from the top pixel (0) to the bottom pixel (1).\n\nAlso NOTE: the OpenImages specifies the order of the bbox values to be XMin, XMax, YMin, YMax, whereas the Kaggle submission requires that they be in a different order: XMin YMin XMax YMax.",
    "570485": "How do I de-normalize the bbox value? If I get the scaled factor, I can convert it back to bbox pixel coordinates.",
    "570513": "You just need to multiply the scaled value by the image dimensions and then round the result to the nearest integer.\neg if you had an image with height 100 and width 120, and a scaled x coord of 0.4 and y coord of 0.5, then the X pixel will be 0.4 * 120 = 48 and the Y pixel will be 0.5 * 100 = 50",
    "570518": "More specifically to answer your example:\n\nxmin = 0.330833 * 1024 = 338.772992 = 339\nxmax = 0.675833 * 1024 = 692.052992‬ = 692\nymin = 0.904375 * 768 = 694.56 = 695\nymax = 0.999375 * 768 = 767.52 = 768",
    "570569": "Thanks @cherring"
  },
  "source": "meta"
}