calculate distance in meters between two bounding box coordinates











up vote
0
down vote

favorite












The images that I have in my dataset have been taken from at different zoom levels. So, it's kind of a bird-eye view of a place where I need to detect humans on the ground.



I need to calculate distance between two bounding box in actual length (meters).
The data that I have is camera focal length, which I got using CV2 Camera Calibration method. So, I have a camera matrix as shown here https://docs.opencv.org/3.4.3/dc/dbb/tutorial_py_calibration.html.



For each zoom level, I have two xml files - intrinsic and extrinsic.



But, I am not sure how do I proceed further to use them in calculating the distance.



<opencv_storage><M type_id="opencv-matrix"><rows>3</rows><cols>3</cols><dt>d</dt><data>
2.7571971911817068e+03 0. 3.2541419672795934e+02 0.
3.4383231216135928e+03 2.0362852071392774e+02 0. 0. 1.</data></M><D type_id="opencv-matrix"><rows>1</rows><cols>8</cols><dt>d</dt><data>
-2.8636067603781758e+01 -2.1605516406937022e+03
-2.8115159951341410e-03 -6.4403584422980525e-02
1.1047392183552937e+05 -2.3525871276310724e+01
-2.8771858140924023e+03 1.3726582186567629e+05</data></D></opencv_storage>


This is one of the intrinsics.xml content.










share|improve this question


























    up vote
    0
    down vote

    favorite












    The images that I have in my dataset have been taken from at different zoom levels. So, it's kind of a bird-eye view of a place where I need to detect humans on the ground.



    I need to calculate distance between two bounding box in actual length (meters).
    The data that I have is camera focal length, which I got using CV2 Camera Calibration method. So, I have a camera matrix as shown here https://docs.opencv.org/3.4.3/dc/dbb/tutorial_py_calibration.html.



    For each zoom level, I have two xml files - intrinsic and extrinsic.



    But, I am not sure how do I proceed further to use them in calculating the distance.



    <opencv_storage><M type_id="opencv-matrix"><rows>3</rows><cols>3</cols><dt>d</dt><data>
    2.7571971911817068e+03 0. 3.2541419672795934e+02 0.
    3.4383231216135928e+03 2.0362852071392774e+02 0. 0. 1.</data></M><D type_id="opencv-matrix"><rows>1</rows><cols>8</cols><dt>d</dt><data>
    -2.8636067603781758e+01 -2.1605516406937022e+03
    -2.8115159951341410e-03 -6.4403584422980525e-02
    1.1047392183552937e+05 -2.3525871276310724e+01
    -2.8771858140924023e+03 1.3726582186567629e+05</data></D></opencv_storage>


    This is one of the intrinsics.xml content.










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      The images that I have in my dataset have been taken from at different zoom levels. So, it's kind of a bird-eye view of a place where I need to detect humans on the ground.



      I need to calculate distance between two bounding box in actual length (meters).
      The data that I have is camera focal length, which I got using CV2 Camera Calibration method. So, I have a camera matrix as shown here https://docs.opencv.org/3.4.3/dc/dbb/tutorial_py_calibration.html.



      For each zoom level, I have two xml files - intrinsic and extrinsic.



      But, I am not sure how do I proceed further to use them in calculating the distance.



      <opencv_storage><M type_id="opencv-matrix"><rows>3</rows><cols>3</cols><dt>d</dt><data>
      2.7571971911817068e+03 0. 3.2541419672795934e+02 0.
      3.4383231216135928e+03 2.0362852071392774e+02 0. 0. 1.</data></M><D type_id="opencv-matrix"><rows>1</rows><cols>8</cols><dt>d</dt><data>
      -2.8636067603781758e+01 -2.1605516406937022e+03
      -2.8115159951341410e-03 -6.4403584422980525e-02
      1.1047392183552937e+05 -2.3525871276310724e+01
      -2.8771858140924023e+03 1.3726582186567629e+05</data></D></opencv_storage>


      This is one of the intrinsics.xml content.










      share|improve this question













      The images that I have in my dataset have been taken from at different zoom levels. So, it's kind of a bird-eye view of a place where I need to detect humans on the ground.



      I need to calculate distance between two bounding box in actual length (meters).
      The data that I have is camera focal length, which I got using CV2 Camera Calibration method. So, I have a camera matrix as shown here https://docs.opencv.org/3.4.3/dc/dbb/tutorial_py_calibration.html.



      For each zoom level, I have two xml files - intrinsic and extrinsic.



      But, I am not sure how do I proceed further to use them in calculating the distance.



      <opencv_storage><M type_id="opencv-matrix"><rows>3</rows><cols>3</cols><dt>d</dt><data>
      2.7571971911817068e+03 0. 3.2541419672795934e+02 0.
      3.4383231216135928e+03 2.0362852071392774e+02 0. 0. 1.</data></M><D type_id="opencv-matrix"><rows>1</rows><cols>8</cols><dt>d</dt><data>
      -2.8636067603781758e+01 -2.1605516406937022e+03
      -2.8115159951341410e-03 -6.4403584422980525e-02
      1.1047392183552937e+05 -2.3525871276310724e+01
      -2.8771858140924023e+03 1.3726582186567629e+05</data></D></opencv_storage>


      This is one of the intrinsics.xml content.







      python object-detection cv2






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 19 at 11:51









      nirvair

      98011638




      98011638





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53374061%2fcalculate-distance-in-meters-between-two-bounding-box-coordinates%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown






























          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53374061%2fcalculate-distance-in-meters-between-two-bounding-box-coordinates%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          To store a contact into the json file from server.js file using a class in NodeJS

          Redirect URL with Chrome Remote Debugging Android Devices

          Dieringhausen