{
  "id": 118014,
  "title": "Camera Intrinsic Parameters",
  "url": "/competitions/pku-autonomous-driving/discussion/118014",
  "author_name": "",
  "post_date": "2019-11-19T07:30:15.869825Z",
  "votes": 9,
  "comment_count": 4,
  "views": 0,
  "content": "<p>I was trying to understand why a Camera Intrinsic Parameter is important in this competition .  Here is what I found in original opencv documentation here . \n<a href=\"https://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html\">https://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html</a>\nMy understanding is that what we see in the camera is not the exact values of the parameters . \nSee the below image from the documentation . Thats how lenses work anyway :) . \n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2234817%2F7c7f3291727352fb3d68614748c8bb43%2Fpinhole_camera_model.png?generation=1574148148314731&amp;alt=media\" alt=\"\"></p>\n\n<p>The formula is given as \n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2234817%2Fe432aecf0e2aba036f4f67925f8068b7%2Fformula.png?generation=1574148449328842&amp;alt=media\" alt=\"\"></p>\n\n<p>where:</p>\n\n<p>(X, Y, Z) are the coordinates of a 3D point in the world coordinate space\n(u, v) are the coordinates of the projection point in pixels\nA is a camera matrix, or a matrix of intrinsic parameters\n(cx, cy) is a principal point that is usually at the image center\nfx, fy are the focal lengths expressed in pixel units.</p>\n\n<p>I think that formula is translated in the public kernel as </p>\n\n<p><code>\n    P = np.array(list(zip(xs, ys, zs))).T\n    img_p = np.dot(camera_matrix, P).T\n</code></p>\n\n<p>Note : I am just trying to read and understand the concepts . I might be totally wrong . Any good samaritan , can correct me . I will be very very happy to learn.</p>",
  "messages": [
    {
      "id": "676443",
      "postDate": "11/19/2019 07:30:15",
      "content": "<p>I was trying to understand why a Camera Intrinsic Parameter is important in this competition .  Here is what I found in original opencv documentation here . \n<a href=\"https://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html\">https://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html</a>\nMy understanding is that what we see in the camera is not the exact values of the parameters . \nSee the below image from the documentation . Thats how lenses work anyway :) . \n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2234817%2F7c7f3291727352fb3d68614748c8bb43%2Fpinhole_camera_model.png?generation=1574148148314731&amp;alt=media\" alt=\"\"></p>\n\n<p>The formula is given as \n<img src=\"https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2234817%2Fe432aecf0e2aba036f4f67925f8068b7%2Fformula.png?generation=1574148449328842&amp;alt=media\" alt=\"\"></p>\n\n<p>where:</p>\n\n<p>(X, Y, Z) are the coordinates of a 3D point in the world coordinate space\n(u, v) are the coordinates of the projection point in pixels\nA is a camera matrix, or a matrix of intrinsic parameters\n(cx, cy) is a principal point that is usually at the image center\nfx, fy are the focal lengths expressed in pixel units.</p>\n\n<p>I think that formula is translated in the public kernel as </p>\n\n<p><code>\n    P = np.array(list(zip(xs, ys, zs))).T\n    img_p = np.dot(camera_matrix, P).T\n</code></p>\n\n<p>Note : I am just trying to read and understand the concepts . I might be totally wrong . Any good samaritan , can correct me . I will be very very happy to learn.</p>",
      "rawMarkdown": "I was trying to understand why a Camera Intrinsic Parameter is important in this competition .  Here is what I found in original opencv documentation here . \nhttps://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html\nMy understanding is that what we see in the camera is not the exact values of the parameters . \nSee the below image from the documentation . Thats how lenses work anyway :) . \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2234817%2F7c7f3291727352fb3d68614748c8bb43%2Fpinhole_camera_model.png?generation=1574148148314731&amp;alt=media)\n\nThe formula is given as \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2234817%2Fe432aecf0e2aba036f4f67925f8068b7%2Fformula.png?generation=1574148449328842&amp;alt=media)\n\nwhere:\n\n(X, Y, Z) are the coordinates of a 3D point in the world coordinate space\n(u, v) are the coordinates of the projection point in pixels\nA is a camera matrix, or a matrix of intrinsic parameters\n(cx, cy) is a principal point that is usually at the image center\nfx, fy are the focal lengths expressed in pixel units.\n\nI think that formula is translated in the public kernel as \n\n```\n    P = np.array(list(zip(xs, ys, zs))).T\n    img_p = np.dot(camera_matrix, P).T\n```\n\nNote : I am just trying to read and understand the concepts . I might be totally wrong . Any good samaritan , can correct me . I will be very very happy to learn.",
      "votes": null
    },
    {
      "id": "676665",
      "postDate": "11/19/2019 12:05:43",
      "content": "<p>Thank for sharing，I am new for the issue.I am learning camera intrinsic parameters，euler angles,etc.</p>",
      "rawMarkdown": "Thank for sharing，I am new for the issue.I am learning camera intrinsic parameters，euler angles,etc.",
      "votes": null
    },
    {
      "id": "676667",
      "postDate": "11/19/2019 12:07:13",
      "content": "<p>Same here , friend .</p>",
      "rawMarkdown": "Same here , friend .",
      "votes": null
    },
    {
      "id": "686776",
      "postDate": "12/03/2019 14:09:45",
      "content": "<p>Good job, I just want to write something about it, then I find you have done.😂 </p>",
      "rawMarkdown": "Good job, I just want to write something about it, then I find you have done.😂",
      "votes": null
    },
    {
      "id": "686782",
      "postDate": "12/03/2019 14:25:57",
      "content": "<p>There are acutally four coordinates, in this competition the world coordinate (Xw, Yw, Zw) is same with camera coordinate (Xc, Yc, Zc).</p>\n\n<p>The other two coordinate are image coordinates (x, y) and pixel coordinates (u, v).</p>\n\n<p>Actually, <strong>np.dot(camera_matrix, P).T == np.array([u * Zc, v * Zc])</strong></p>\n\n<p>That's why <strong>uv = img_p / Zc</strong></p>\n\n<p><a href=\"https://www.kaggle.com/c/pku-autonomous-driving/discussion/120083\">https://www.kaggle.com/c/pku-autonomous-driving/discussion/120083</a></p>",
      "rawMarkdown": "There are acutally four coordinates, in this competition the world coordinate (Xw, Yw, Zw) is same with camera coordinate (Xc, Yc, Zc).\n\nThe other two coordinate are image coordinates (x, y) and pixel coordinates (u, v).\n\nActually, **np.dot(camera_matrix, P).T == np.array([u * Zc, v * Zc])**\n\nThat's why **uv = img_p / Zc**\n\nhttps://www.kaggle.com/c/pku-autonomous-driving/discussion/120083",
      "votes": null
    }
  ],
  "comments": [
    {
      "id": 676665,
      "author_name": "ynhuhu",
      "author_url": "",
      "post_date": "11/19/2019 12:05:43",
      "content": "<p>Thank for sharing，I am new for the issue.I am learning camera intrinsic parameters，euler angles,etc.</p>",
      "votes": null,
      "replies": [
        {
          "id": 676667,
          "author_name": "phoenix9032",
          "author_url": "",
          "post_date": "11/19/2019 12:07:13",
          "content": "<p>Same here , friend .</p>",
          "votes": null,
          "replies": []
        }
      ]
    },
    {
      "id": 686776,
      "author_name": "diegojohnson",
      "author_url": "",
      "post_date": "12/03/2019 14:09:45",
      "content": "<p>Good job, I just want to write something about it, then I find you have done.😂 </p>",
      "votes": null,
      "replies": []
    },
    {
      "id": 686782,
      "author_name": "diegojohnson",
      "author_url": "",
      "post_date": "12/03/2019 14:25:57",
      "content": "<p>There are acutally four coordinates, in this competition the world coordinate (Xw, Yw, Zw) is same with camera coordinate (Xc, Yc, Zc).</p>\n\n<p>The other two coordinate are image coordinates (x, y) and pixel coordinates (u, v).</p>\n\n<p>Actually, <strong>np.dot(camera_matrix, P).T == np.array([u * Zc, v * Zc])</strong></p>\n\n<p>That's why <strong>uv = img_p / Zc</strong></p>\n\n<p><a href=\"https://www.kaggle.com/c/pku-autonomous-driving/discussion/120083\">https://www.kaggle.com/c/pku-autonomous-driving/discussion/120083</a></p>",
      "votes": null,
      "replies": []
    }
  ],
  "raw_markdown_by_id": {
    "676443": "I was trying to understand why a Camera Intrinsic Parameter is important in this competition .  Here is what I found in original opencv documentation here . \nhttps://docs.opencv.org/2.4/modules/calib3d/doc/camera_calibration_and_3d_reconstruction.html\nMy understanding is that what we see in the camera is not the exact values of the parameters . \nSee the below image from the documentation . Thats how lenses work anyway :) . \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2234817%2F7c7f3291727352fb3d68614748c8bb43%2Fpinhole_camera_model.png?generation=1574148148314731&amp;alt=media)\n\nThe formula is given as \n![](https://www.googleapis.com/download/storage/v1/b/kaggle-user-content/o/inbox%2F2234817%2Fe432aecf0e2aba036f4f67925f8068b7%2Fformula.png?generation=1574148449328842&amp;alt=media)\n\nwhere:\n\n(X, Y, Z) are the coordinates of a 3D point in the world coordinate space\n(u, v) are the coordinates of the projection point in pixels\nA is a camera matrix, or a matrix of intrinsic parameters\n(cx, cy) is a principal point that is usually at the image center\nfx, fy are the focal lengths expressed in pixel units.\n\nI think that formula is translated in the public kernel as \n\n```\n    P = np.array(list(zip(xs, ys, zs))).T\n    img_p = np.dot(camera_matrix, P).T\n```\n\nNote : I am just trying to read and understand the concepts . I might be totally wrong . Any good samaritan , can correct me . I will be very very happy to learn.",
    "676665": "Thank for sharing，I am new for the issue.I am learning camera intrinsic parameters，euler angles,etc.",
    "676667": "Same here , friend .",
    "686776": "Good job, I just want to write something about it, then I find you have done.😂",
    "686782": "There are acutally four coordinates, in this competition the world coordinate (Xw, Yw, Zw) is same with camera coordinate (Xc, Yc, Zc).\n\nThe other two coordinate are image coordinates (x, y) and pixel coordinates (u, v).\n\nActually, **np.dot(camera_matrix, P).T == np.array([u * Zc, v * Zc])**\n\nThat's why **uv = img_p / Zc**\n\nhttps://www.kaggle.com/c/pku-autonomous-driving/discussion/120083"
  },
  "source": "meta"
}