{
  "id": 100371,
  "title": "How to calculate Xmin Ymin Xmax Ymax of the box after scaling the image?",
  "url": "/competitions/open-images-2019-object-detection/discussion/100371",
  "author_name": "",
  "post_date": "2019-07-18T07:05:13.593225900Z",
  "votes": null,
  "comment_count": 2,
  "views": 0,
  "content": "<p>Suppose the image size in the training data set is 1024*1000, and the Xmin Ymin Xmax Ymax of one box is 0.25, 0.25, 0.75, 0.75 respectively\nCalculate the pixel position of the actual object\n1024 * 0.25 = 256\n1000 * 0.25 = 250\n1024 * 0.75 = 768\n1000 * 0.75 = 750\nSo the box is between (256,250) and (76,750)\nIf the scale is equal to 512*500, the box's Xmin Ymin Xmax Ymax should stay the same.(equal scale length and width)\nCalculate the pixel position of the actual object\n512 * 0.25 = 128\n500 * 0.25 = 125\n512 * 0.75 = 384\n500 * 0.75 = 375\nSo the box is scaled from (128,125) to (384,375)\nBut what happens to box Xmin Ymin Xmax Ymax if you scale it to 512 by 512 square?\nHow does Xmin Ymin Xmax Ymax change?\nHow to calculate the actual pixel position of the object?\nThe position of box after zooming is (?,?)To (?,?)This rectangle period\nHow do you calculate the Numbers in parentheses?</p>",
  "messages": [
    {
      "id": "578809",
      "postDate": "07/18/2019 07:05:13",
      "content": "<p>Suppose the image size in the training data set is 1024*1000, and the Xmin Ymin Xmax Ymax of one box is 0.25, 0.25, 0.75, 0.75 respectively\nCalculate the pixel position of the actual object\n1024 * 0.25 = 256\n1000 * 0.25 = 250\n1024 * 0.75 = 768\n1000 * 0.75 = 750\nSo the box is between (256,250) and (76,750)\nIf the scale is equal to 512*500, the box's Xmin Ymin Xmax Ymax should stay the same.(equal scale length and width)\nCalculate the pixel position of the actual object\n512 * 0.25 = 128\n500 * 0.25 = 125\n512 * 0.75 = 384\n500 * 0.75 = 375\nSo the box is scaled from (128,125) to (384,375)\nBut what happens to box Xmin Ymin Xmax Ymax if you scale it to 512 by 512 square?\nHow does Xmin Ymin Xmax Ymax change?\nHow to calculate the actual pixel position of the object?\nThe position of box after zooming is (?,?)To (?,?)This rectangle period\nHow do you calculate the Numbers in parentheses?</p>",
      "rawMarkdown": "Suppose the image size in the training data set is 1024*1000, and the Xmin Ymin Xmax Ymax of one box is 0.25, 0.25, 0.75, 0.75 respectively\nCalculate the pixel position of the actual object\n1024 * 0.25 = 256\n1000 * 0.25 = 250\n1024 * 0.75 = 768\n1000 * 0.75 = 750\nSo the box is between (256,250) and (76,750)\nIf the scale is equal to 512*500, the box's Xmin Ymin Xmax Ymax should stay the same.(equal scale length and width)\nCalculate the pixel position of the actual object\n512 * 0.25 = 128\n500 * 0.25 = 125\n512 * 0.75 = 384\n500 * 0.75 = 375\nSo the box is scaled from (128,125) to (384,375)\nBut what happens to box Xmin Ymin Xmax Ymax if you scale it to 512 by 512 square?\nHow does Xmin Ymin Xmax Ymax change?\nHow to calculate the actual pixel position of the object?\nThe position of box after zooming is (?,?)To (?,?)This rectangle period\nHow do you calculate the Numbers in parentheses?",
      "votes": null
    },
    {
      "id": "578982",
      "postDate": "07/18/2019 11:35:55",
      "content": "<p>If I ihave understood your problem correctly, here's the solution. \nThe position of the box object has been given in the scale of [0,1] and so if you scale up the image or even scale down, the given xmin, ymin, xmax, ymax needs to be scaled to the appropriate dimension. Where <em>x coordinates</em> needs to be multiplied by the width and the <em>y coordinates</em> needs to be multiplied by the height.  So your coordinates will be as follows:</p>\n\n<p>Image size (1024, 1000) -&gt; Annotations(256,200,768,750)\nImage size (512, 500) -&gt; Annotations(128,125,384,375)\nImage size (512, 512) -&gt; Annotations(128,128,384,384)</p>\n\n<p>The Annotations are in the following order (Xmin, Ymin, Xmax, Ymax)</p>",
      "rawMarkdown": "If I ihave understood your problem correctly, here's the solution. \nThe position of the box object has been given in the scale of [0,1] and so if you scale up the image or even scale down, the given xmin, ymin, xmax, ymax needs to be scaled to the appropriate dimension. Where _x coordinates_ needs to be multiplied by the width and the _y coordinates_ needs to be multiplied by the height.  So your coordinates will be as follows:\n\nImage size (1024, 1000) -&gt; Annotations(256,200,768,750)\nImage size (512, 500) -&gt; Annotations(128,125,384,375)\nImage size (512, 512) -&gt; Annotations(128,128,384,384)\n\nThe Annotations are in the following order (Xmin, Ymin, Xmax, Ymax)",
      "votes": null
    },
    {
      "id": "578990",
      "postDate": "07/18/2019 11:44:57",
      "content": "<p>thanks,I understand .\nwhen scale image size ,Xmin Ymin Xmax Ymax of one box is still 0.25, 0.25, 0.75, 0.75,not change.</p>",
      "rawMarkdown": "thanks,I understand .\nwhen scale image size ,Xmin Ymin Xmax Ymax of one box is still 0.25, 0.25, 0.75, 0.75,not change.",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 578982,
      "author_name": "thanatoz",
      "author_url": "",
      "post_date": "07/18/2019 11:35:55",
      "content": "<p>If I ihave understood your problem correctly, here's the solution. \nThe position of the box object has been given in the scale of [0,1] and so if you scale up the image or even scale down, the given xmin, ymin, xmax, ymax needs to be scaled to the appropriate dimension. Where <em>x coordinates</em> needs to be multiplied by the width and the <em>y coordinates</em> needs to be multiplied by the height.  So your coordinates will be as follows:</p>\n\n<p>Image size (1024, 1000) -&gt; Annotations(256,200,768,750)\nImage size (512, 500) -&gt; Annotations(128,125,384,375)\nImage size (512, 512) -&gt; Annotations(128,128,384,384)</p>\n\n<p>The Annotations are in the following order (Xmin, Ymin, Xmax, Ymax)</p>",
      "votes": null,
      "replies": [
        {
          "id": 578990,
          "author_name": "hsykaggle",
          "author_url": "",
          "post_date": "07/18/2019 11:44:57",
          "content": "<p>thanks,I understand .\nwhen scale image size ,Xmin Ymin Xmax Ymax of one box is still 0.25, 0.25, 0.75, 0.75,not change.</p>",
          "votes": null,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "578809": "Suppose the image size in the training data set is 1024*1000, and the Xmin Ymin Xmax Ymax of one box is 0.25, 0.25, 0.75, 0.75 respectively\nCalculate the pixel position of the actual object\n1024 * 0.25 = 256\n1000 * 0.25 = 250\n1024 * 0.75 = 768\n1000 * 0.75 = 750\nSo the box is between (256,250) and (76,750)\nIf the scale is equal to 512*500, the box's Xmin Ymin Xmax Ymax should stay the same.(equal scale length and width)\nCalculate the pixel position of the actual object\n512 * 0.25 = 128\n500 * 0.25 = 125\n512 * 0.75 = 384\n500 * 0.75 = 375\nSo the box is scaled from (128,125) to (384,375)\nBut what happens to box Xmin Ymin Xmax Ymax if you scale it to 512 by 512 square?\nHow does Xmin Ymin Xmax Ymax change?\nHow to calculate the actual pixel position of the object?\nThe position of box after zooming is (?,?)To (?,?)This rectangle period\nHow do you calculate the Numbers in parentheses?",
    "578982": "If I ihave understood your problem correctly, here's the solution. \nThe position of the box object has been given in the scale of [0,1] and so if you scale up the image or even scale down, the given xmin, ymin, xmax, ymax needs to be scaled to the appropriate dimension. Where _x coordinates_ needs to be multiplied by the width and the _y coordinates_ needs to be multiplied by the height.  So your coordinates will be as follows:\n\nImage size (1024, 1000) -&gt; Annotations(256,200,768,750)\nImage size (512, 500) -&gt; Annotations(128,125,384,375)\nImage size (512, 512) -&gt; Annotations(128,128,384,384)\n\nThe Annotations are in the following order (Xmin, Ymin, Xmax, Ymax)",
    "578990": "thanks,I understand .\nwhen scale image size ,Xmin Ymin Xmax Ymax of one box is still 0.25, 0.25, 0.75, 0.75,not change."
  },
  "source": "meta"
}