Extract data of 3D graph rendered in 2D












1














I have a 2D pdf of some 3D graphs from which I would like to extract the data (I have the authors permission, original data has since been lost). The graphs in question look like:



enter image description here



Focusing in on the bottom left graph, I can find the lines defining the axes like:



enter image description here



It seems like it would be quite simple to find a transformation which, when applied to a graph, would "straighten" it out so that the $x$ and $y$-axes correspond to vertical and horizontal positions on my screen. However I am really struggling to figure out what this transformation is. I guess I have a couple of questions




  1. Do the blue lines in my second image provide enough information to define a transformation that will allow me view the graph "head-on"? (I feel like this is likely no?)

  2. How would I go about finding such a transformation? What information would be needed?
    a. I've been reading about the Perspective-n-Point Method but am
    hoping there's an easier way before going further down that rabbit hole (I
    know next to nothing about computer vision).

    b. I followed the thread here How do I reverse-project 2D points into 3D? and was able to use a Monte-Carlo method to find a projection matrix - but that doesn't seem to help as it is a transformation from 3D to 2D instead of the reverse and it also seems like overkill.


Any help is highly appreciated, thanks!



UPDATE



This is the perspective issue I was trying to refer to in my comment below, thanks! enter image description here










share|cite|improve this question





























    1














    I have a 2D pdf of some 3D graphs from which I would like to extract the data (I have the authors permission, original data has since been lost). The graphs in question look like:



    enter image description here



    Focusing in on the bottom left graph, I can find the lines defining the axes like:



    enter image description here



    It seems like it would be quite simple to find a transformation which, when applied to a graph, would "straighten" it out so that the $x$ and $y$-axes correspond to vertical and horizontal positions on my screen. However I am really struggling to figure out what this transformation is. I guess I have a couple of questions




    1. Do the blue lines in my second image provide enough information to define a transformation that will allow me view the graph "head-on"? (I feel like this is likely no?)

    2. How would I go about finding such a transformation? What information would be needed?
      a. I've been reading about the Perspective-n-Point Method but am
      hoping there's an easier way before going further down that rabbit hole (I
      know next to nothing about computer vision).

      b. I followed the thread here How do I reverse-project 2D points into 3D? and was able to use a Monte-Carlo method to find a projection matrix - but that doesn't seem to help as it is a transformation from 3D to 2D instead of the reverse and it also seems like overkill.


    Any help is highly appreciated, thanks!



    UPDATE



    This is the perspective issue I was trying to refer to in my comment below, thanks! enter image description here










    share|cite|improve this question



























      1












      1








      1


      0





      I have a 2D pdf of some 3D graphs from which I would like to extract the data (I have the authors permission, original data has since been lost). The graphs in question look like:



      enter image description here



      Focusing in on the bottom left graph, I can find the lines defining the axes like:



      enter image description here



      It seems like it would be quite simple to find a transformation which, when applied to a graph, would "straighten" it out so that the $x$ and $y$-axes correspond to vertical and horizontal positions on my screen. However I am really struggling to figure out what this transformation is. I guess I have a couple of questions




      1. Do the blue lines in my second image provide enough information to define a transformation that will allow me view the graph "head-on"? (I feel like this is likely no?)

      2. How would I go about finding such a transformation? What information would be needed?
        a. I've been reading about the Perspective-n-Point Method but am
        hoping there's an easier way before going further down that rabbit hole (I
        know next to nothing about computer vision).

        b. I followed the thread here How do I reverse-project 2D points into 3D? and was able to use a Monte-Carlo method to find a projection matrix - but that doesn't seem to help as it is a transformation from 3D to 2D instead of the reverse and it also seems like overkill.


      Any help is highly appreciated, thanks!



      UPDATE



      This is the perspective issue I was trying to refer to in my comment below, thanks! enter image description here










      share|cite|improve this question















      I have a 2D pdf of some 3D graphs from which I would like to extract the data (I have the authors permission, original data has since been lost). The graphs in question look like:



      enter image description here



      Focusing in on the bottom left graph, I can find the lines defining the axes like:



      enter image description here



      It seems like it would be quite simple to find a transformation which, when applied to a graph, would "straighten" it out so that the $x$ and $y$-axes correspond to vertical and horizontal positions on my screen. However I am really struggling to figure out what this transformation is. I guess I have a couple of questions




      1. Do the blue lines in my second image provide enough information to define a transformation that will allow me view the graph "head-on"? (I feel like this is likely no?)

      2. How would I go about finding such a transformation? What information would be needed?
        a. I've been reading about the Perspective-n-Point Method but am
        hoping there's an easier way before going further down that rabbit hole (I
        know next to nothing about computer vision).

        b. I followed the thread here How do I reverse-project 2D points into 3D? and was able to use a Monte-Carlo method to find a projection matrix - but that doesn't seem to help as it is a transformation from 3D to 2D instead of the reverse and it also seems like overkill.


      Any help is highly appreciated, thanks!



      UPDATE



      This is the perspective issue I was trying to refer to in my comment below, thanks! enter image description here







      linear-algebra matrices linear-transformations transformation






      share|cite|improve this question















      share|cite|improve this question













      share|cite|improve this question




      share|cite|improve this question








      edited Dec 29 '18 at 4:38







      bRost03

















      asked Dec 27 '18 at 3:54









      bRost03bRost03

      36019




      36019






















          3 Answers
          3






          active

          oldest

          votes


















          1














          [Too long for a comment, so adding this as an answer to supplement yours.]



          Once you’ve gotten the bounding “cube” for a graph set, I think you can save yourself quite a bit of work by computing a rectifying homography for each slice instead of painstakingly working out intersections and cross-ratios. For each slice, find the corners—the points at which the plane of the slice intersects the bounding cube—and then compute the mapping from this quadrilateral to an appropriately-sized rectangle using the method in this answer. For each graph, the $B$ matrix for this construction is constant. E.g., for the bottom left graph, the destination rectangle is $[-8,4]times[0,0.2]$, which yields $$B = begin{bmatrix}8&-8&4\0&0.2&0\-1&1&1end{bmatrix}.$$ For the front slice of this graph (making my own guess at where the 0.1 point on the A axis lies), the homography matrix works out to be $$left[
          begin{array}{ccc}
          0.0119905 & 0.000455823 & -10.0139 \
          0.0000677027 & 0.000210969 & -0.0960643 \
          0.000150268 & 0.000123509 & 0.70175 \
          end{array}
          right].$$
          Applying this matrix to points on the image of the front graph slice and dehomogenizing will recover their original coordinates. To illustrate, applying this transformation, combined with some scaling to make the destination rectangle a square, to the image of the graph produces the following rectified image:



          enter image description here



          For the other slices, you would need to compute the corresponding quadrilateral corners and homography.



          To take a somewhat different approach, each graph contains enough known/measurable point pairs for you to recover the camera matrix $P$. (Indeed, it appears that they all basically use the same projection, so you could combine data from all of the graphs to sharpen up the estimate.) You can find methods for doing this in any standard reference on computer vision such as Hartley and Zisserman’s Multiple View Geometry In Computer Vision. Since you’ve computed/estimated the world axis vanishing points, you can use them as additional constraints on $P$: its first three columns are these image points. The last column of $P$ is the image of the world origin, which unfortunately can’t be measured directly in these graphs. So, $P$ will be of the form $$begin{bmatrix}lambda mathbf v_X & mu mathbf v_Y & tau mathbf v_Z & mathbf oend{bmatrix}.$$ The last coordinate of $mathbf o$ can be fixed at $1$, so there are 5 unknowns to be determined from known world-image point pairs.



          Decomposing $P$ as $[Mmidmathbf p_4]$, a point $mathbf x$ in the image back-projects to the ray (in inhomogeneous Cartesian coordinates) $tilde{mathbf X}(mu) = M^{-1}(mumathbf x-mathbf p_4)$. Rectifying each graph slice is then just a matter of intersecting this ray with the plane that represents the slice. These planes are all parallel to a coordinate plane, so the required computation is particularly simple.






          share|cite|improve this answer































            1














            The trick is to do 2D transforms instead. I will explain for the last figure, but everything else is the same.




            1. You digitize each curve separately.

            2. You find the corresponding $k_x$ value by looking at the ratio of distances from the bottom corner to the points on that axis. It should be obvious that they increase by $0.1$. For example, you can get the bottom corner as $(x_B,y_B)$ and the right corner as $(x_R,y_R)$, and the last point for second curve is at $(x_{2R},y_{2R})$. Then you have $$frac{x_{2R}-x_B}{x_R-x_B}=frac{y_{2R}-y_B}{y_R-y_B}=frac{k_x-0.3}{1-0.3}$$
              To minimize errors, choose to find $k_x$ from the equation with the largest denominator. The way I see the figure, it looks like $y$ axis. That way uncertainties in reading $y_{2R}$ value will be divided by a bigger number.

            3. Translate the vertical axis to one point of the curve, say to $(x_{2L},y_{2L})$. I am interested in the top point of the vertical axis. If the original was $(x_A,y_A)$, the translated point will be $(x_A',y_A')=(x_A+x_{2L}-x_L,y_A+y_{2L}-y_L)$
              Then the transformation is given by $$begin{pmatrix}t+8\Aend{pmatrix}=Mbegin{pmatrix}x-x_{2L}\y-y_{2L}end{pmatrix}$$
              Here $M$ is a $2times2$ matrix. To get the coefficients of the matrix, you know that you transform $(x_{2R},y_{2R}$ into $(4+8,0)$, and you transform $(x_A',y_A')$ into $(-8+8,0.2)$

            4. Use the rest of the points in the digitized curve and the above transformation to get the "original" data.

            5. Repeat for all curves


            The procedure is not that difficult, but the trick is to consider each curve separately.






            share|cite|improve this answer





















            • This is a good suggestion, but ultimately I don't believe it is correct. I cannot simply translate the vertical axis as you suggest because the graphs are drawn from some perspective (see updated prompt). Notice how in the graph above the two blue lines representing the x-axes are not parallel to each other. I think this issue of perspective is enough that just translating the vertical axis as you suggest may introduce unacceptably large errors into the extraction, unless I'm mistaken about the whole thing. Thanks again for your time!
              – bRost03
              Dec 29 '18 at 4:14





















            1














            Andrei was correct about needing to do each curve separately, but the transformation he gave was slightly too simple so I am writing this answer share what I eventually ended up doing for those who come across this in the future.



            As shown in the update, the graphs are drawn with perspective. Turns out they are drawn with three point perspective which means the three vanishing points must be reconstructed. Two of the vanishing points are trivially defined by the axes:



            enter image description here



            We'll call them $vp_t$ and $vp_k$ from left to right.



            For the last vanishing point, $vp_A$, we only have a single $A$-axis so we need more information. Luckily projective geometry tells us that the cross ratio of four collinear points is invariant under projection. Along the $A$-axis we have 4 collinear points namely $p_0,p_{0.1},p_{0.2},$ and $vp_A$. Using the fact that the vanishing point is infinitely far away in "real space", this gives us the relation
            $$
            frac{|p_{0.2}-p_0||vp_A-p_{0.1}|}{|p_{0.1}-p_0||vp_A-p_{0.2}|}=frac{0.2}{0.1}=2
            $$

            This expression combined with the equation for the line defining the $A$-axis uniquely determines the last vanishing point. With this third vanishing point, we can reconstruct the full cube containing our plots in projected space (2D) by finding the intersections of the relevant lines.



            enter image description here



            Armed with this box and the vanishing points the 3D data can be recovered by constructing the proper $A$-axis using $vp_A$ and $t$-axis using $vp_t$ then finding the intersection of these axes with the lines connecting the data point with the vanishing points. The data is finally extracted using the invariant cross-ratio above.



            enter image description here






            share|cite|improve this answer





















            • Nice use of vanishing points and cross-ratios.
              – amd
              Jan 6 at 20:22











            Your Answer





            StackExchange.ifUsing("editor", function () {
            return StackExchange.using("mathjaxEditing", function () {
            StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
            StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
            });
            });
            }, "mathjax-editing");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "69"
            };
            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',
            autoActivateHeartbeat: false,
            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
            },
            noCode: true, onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3053577%2fextract-data-of-3d-graph-rendered-in-2d%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            3 Answers
            3






            active

            oldest

            votes








            3 Answers
            3






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            [Too long for a comment, so adding this as an answer to supplement yours.]



            Once you’ve gotten the bounding “cube” for a graph set, I think you can save yourself quite a bit of work by computing a rectifying homography for each slice instead of painstakingly working out intersections and cross-ratios. For each slice, find the corners—the points at which the plane of the slice intersects the bounding cube—and then compute the mapping from this quadrilateral to an appropriately-sized rectangle using the method in this answer. For each graph, the $B$ matrix for this construction is constant. E.g., for the bottom left graph, the destination rectangle is $[-8,4]times[0,0.2]$, which yields $$B = begin{bmatrix}8&-8&4\0&0.2&0\-1&1&1end{bmatrix}.$$ For the front slice of this graph (making my own guess at where the 0.1 point on the A axis lies), the homography matrix works out to be $$left[
            begin{array}{ccc}
            0.0119905 & 0.000455823 & -10.0139 \
            0.0000677027 & 0.000210969 & -0.0960643 \
            0.000150268 & 0.000123509 & 0.70175 \
            end{array}
            right].$$
            Applying this matrix to points on the image of the front graph slice and dehomogenizing will recover their original coordinates. To illustrate, applying this transformation, combined with some scaling to make the destination rectangle a square, to the image of the graph produces the following rectified image:



            enter image description here



            For the other slices, you would need to compute the corresponding quadrilateral corners and homography.



            To take a somewhat different approach, each graph contains enough known/measurable point pairs for you to recover the camera matrix $P$. (Indeed, it appears that they all basically use the same projection, so you could combine data from all of the graphs to sharpen up the estimate.) You can find methods for doing this in any standard reference on computer vision such as Hartley and Zisserman’s Multiple View Geometry In Computer Vision. Since you’ve computed/estimated the world axis vanishing points, you can use them as additional constraints on $P$: its first three columns are these image points. The last column of $P$ is the image of the world origin, which unfortunately can’t be measured directly in these graphs. So, $P$ will be of the form $$begin{bmatrix}lambda mathbf v_X & mu mathbf v_Y & tau mathbf v_Z & mathbf oend{bmatrix}.$$ The last coordinate of $mathbf o$ can be fixed at $1$, so there are 5 unknowns to be determined from known world-image point pairs.



            Decomposing $P$ as $[Mmidmathbf p_4]$, a point $mathbf x$ in the image back-projects to the ray (in inhomogeneous Cartesian coordinates) $tilde{mathbf X}(mu) = M^{-1}(mumathbf x-mathbf p_4)$. Rectifying each graph slice is then just a matter of intersecting this ray with the plane that represents the slice. These planes are all parallel to a coordinate plane, so the required computation is particularly simple.






            share|cite|improve this answer




























              1














              [Too long for a comment, so adding this as an answer to supplement yours.]



              Once you’ve gotten the bounding “cube” for a graph set, I think you can save yourself quite a bit of work by computing a rectifying homography for each slice instead of painstakingly working out intersections and cross-ratios. For each slice, find the corners—the points at which the plane of the slice intersects the bounding cube—and then compute the mapping from this quadrilateral to an appropriately-sized rectangle using the method in this answer. For each graph, the $B$ matrix for this construction is constant. E.g., for the bottom left graph, the destination rectangle is $[-8,4]times[0,0.2]$, which yields $$B = begin{bmatrix}8&-8&4\0&0.2&0\-1&1&1end{bmatrix}.$$ For the front slice of this graph (making my own guess at where the 0.1 point on the A axis lies), the homography matrix works out to be $$left[
              begin{array}{ccc}
              0.0119905 & 0.000455823 & -10.0139 \
              0.0000677027 & 0.000210969 & -0.0960643 \
              0.000150268 & 0.000123509 & 0.70175 \
              end{array}
              right].$$
              Applying this matrix to points on the image of the front graph slice and dehomogenizing will recover their original coordinates. To illustrate, applying this transformation, combined with some scaling to make the destination rectangle a square, to the image of the graph produces the following rectified image:



              enter image description here



              For the other slices, you would need to compute the corresponding quadrilateral corners and homography.



              To take a somewhat different approach, each graph contains enough known/measurable point pairs for you to recover the camera matrix $P$. (Indeed, it appears that they all basically use the same projection, so you could combine data from all of the graphs to sharpen up the estimate.) You can find methods for doing this in any standard reference on computer vision such as Hartley and Zisserman’s Multiple View Geometry In Computer Vision. Since you’ve computed/estimated the world axis vanishing points, you can use them as additional constraints on $P$: its first three columns are these image points. The last column of $P$ is the image of the world origin, which unfortunately can’t be measured directly in these graphs. So, $P$ will be of the form $$begin{bmatrix}lambda mathbf v_X & mu mathbf v_Y & tau mathbf v_Z & mathbf oend{bmatrix}.$$ The last coordinate of $mathbf o$ can be fixed at $1$, so there are 5 unknowns to be determined from known world-image point pairs.



              Decomposing $P$ as $[Mmidmathbf p_4]$, a point $mathbf x$ in the image back-projects to the ray (in inhomogeneous Cartesian coordinates) $tilde{mathbf X}(mu) = M^{-1}(mumathbf x-mathbf p_4)$. Rectifying each graph slice is then just a matter of intersecting this ray with the plane that represents the slice. These planes are all parallel to a coordinate plane, so the required computation is particularly simple.






              share|cite|improve this answer


























                1












                1








                1






                [Too long for a comment, so adding this as an answer to supplement yours.]



                Once you’ve gotten the bounding “cube” for a graph set, I think you can save yourself quite a bit of work by computing a rectifying homography for each slice instead of painstakingly working out intersections and cross-ratios. For each slice, find the corners—the points at which the plane of the slice intersects the bounding cube—and then compute the mapping from this quadrilateral to an appropriately-sized rectangle using the method in this answer. For each graph, the $B$ matrix for this construction is constant. E.g., for the bottom left graph, the destination rectangle is $[-8,4]times[0,0.2]$, which yields $$B = begin{bmatrix}8&-8&4\0&0.2&0\-1&1&1end{bmatrix}.$$ For the front slice of this graph (making my own guess at where the 0.1 point on the A axis lies), the homography matrix works out to be $$left[
                begin{array}{ccc}
                0.0119905 & 0.000455823 & -10.0139 \
                0.0000677027 & 0.000210969 & -0.0960643 \
                0.000150268 & 0.000123509 & 0.70175 \
                end{array}
                right].$$
                Applying this matrix to points on the image of the front graph slice and dehomogenizing will recover their original coordinates. To illustrate, applying this transformation, combined with some scaling to make the destination rectangle a square, to the image of the graph produces the following rectified image:



                enter image description here



                For the other slices, you would need to compute the corresponding quadrilateral corners and homography.



                To take a somewhat different approach, each graph contains enough known/measurable point pairs for you to recover the camera matrix $P$. (Indeed, it appears that they all basically use the same projection, so you could combine data from all of the graphs to sharpen up the estimate.) You can find methods for doing this in any standard reference on computer vision such as Hartley and Zisserman’s Multiple View Geometry In Computer Vision. Since you’ve computed/estimated the world axis vanishing points, you can use them as additional constraints on $P$: its first three columns are these image points. The last column of $P$ is the image of the world origin, which unfortunately can’t be measured directly in these graphs. So, $P$ will be of the form $$begin{bmatrix}lambda mathbf v_X & mu mathbf v_Y & tau mathbf v_Z & mathbf oend{bmatrix}.$$ The last coordinate of $mathbf o$ can be fixed at $1$, so there are 5 unknowns to be determined from known world-image point pairs.



                Decomposing $P$ as $[Mmidmathbf p_4]$, a point $mathbf x$ in the image back-projects to the ray (in inhomogeneous Cartesian coordinates) $tilde{mathbf X}(mu) = M^{-1}(mumathbf x-mathbf p_4)$. Rectifying each graph slice is then just a matter of intersecting this ray with the plane that represents the slice. These planes are all parallel to a coordinate plane, so the required computation is particularly simple.






                share|cite|improve this answer














                [Too long for a comment, so adding this as an answer to supplement yours.]



                Once you’ve gotten the bounding “cube” for a graph set, I think you can save yourself quite a bit of work by computing a rectifying homography for each slice instead of painstakingly working out intersections and cross-ratios. For each slice, find the corners—the points at which the plane of the slice intersects the bounding cube—and then compute the mapping from this quadrilateral to an appropriately-sized rectangle using the method in this answer. For each graph, the $B$ matrix for this construction is constant. E.g., for the bottom left graph, the destination rectangle is $[-8,4]times[0,0.2]$, which yields $$B = begin{bmatrix}8&-8&4\0&0.2&0\-1&1&1end{bmatrix}.$$ For the front slice of this graph (making my own guess at where the 0.1 point on the A axis lies), the homography matrix works out to be $$left[
                begin{array}{ccc}
                0.0119905 & 0.000455823 & -10.0139 \
                0.0000677027 & 0.000210969 & -0.0960643 \
                0.000150268 & 0.000123509 & 0.70175 \
                end{array}
                right].$$
                Applying this matrix to points on the image of the front graph slice and dehomogenizing will recover their original coordinates. To illustrate, applying this transformation, combined with some scaling to make the destination rectangle a square, to the image of the graph produces the following rectified image:



                enter image description here



                For the other slices, you would need to compute the corresponding quadrilateral corners and homography.



                To take a somewhat different approach, each graph contains enough known/measurable point pairs for you to recover the camera matrix $P$. (Indeed, it appears that they all basically use the same projection, so you could combine data from all of the graphs to sharpen up the estimate.) You can find methods for doing this in any standard reference on computer vision such as Hartley and Zisserman’s Multiple View Geometry In Computer Vision. Since you’ve computed/estimated the world axis vanishing points, you can use them as additional constraints on $P$: its first three columns are these image points. The last column of $P$ is the image of the world origin, which unfortunately can’t be measured directly in these graphs. So, $P$ will be of the form $$begin{bmatrix}lambda mathbf v_X & mu mathbf v_Y & tau mathbf v_Z & mathbf oend{bmatrix}.$$ The last coordinate of $mathbf o$ can be fixed at $1$, so there are 5 unknowns to be determined from known world-image point pairs.



                Decomposing $P$ as $[Mmidmathbf p_4]$, a point $mathbf x$ in the image back-projects to the ray (in inhomogeneous Cartesian coordinates) $tilde{mathbf X}(mu) = M^{-1}(mumathbf x-mathbf p_4)$. Rectifying each graph slice is then just a matter of intersecting this ray with the plane that represents the slice. These planes are all parallel to a coordinate plane, so the required computation is particularly simple.







                share|cite|improve this answer














                share|cite|improve this answer



                share|cite|improve this answer








                edited Jan 6 at 20:16

























                answered Jan 6 at 10:14









                amdamd

                29.4k21050




                29.4k21050























                    1














                    The trick is to do 2D transforms instead. I will explain for the last figure, but everything else is the same.




                    1. You digitize each curve separately.

                    2. You find the corresponding $k_x$ value by looking at the ratio of distances from the bottom corner to the points on that axis. It should be obvious that they increase by $0.1$. For example, you can get the bottom corner as $(x_B,y_B)$ and the right corner as $(x_R,y_R)$, and the last point for second curve is at $(x_{2R},y_{2R})$. Then you have $$frac{x_{2R}-x_B}{x_R-x_B}=frac{y_{2R}-y_B}{y_R-y_B}=frac{k_x-0.3}{1-0.3}$$
                      To minimize errors, choose to find $k_x$ from the equation with the largest denominator. The way I see the figure, it looks like $y$ axis. That way uncertainties in reading $y_{2R}$ value will be divided by a bigger number.

                    3. Translate the vertical axis to one point of the curve, say to $(x_{2L},y_{2L})$. I am interested in the top point of the vertical axis. If the original was $(x_A,y_A)$, the translated point will be $(x_A',y_A')=(x_A+x_{2L}-x_L,y_A+y_{2L}-y_L)$
                      Then the transformation is given by $$begin{pmatrix}t+8\Aend{pmatrix}=Mbegin{pmatrix}x-x_{2L}\y-y_{2L}end{pmatrix}$$
                      Here $M$ is a $2times2$ matrix. To get the coefficients of the matrix, you know that you transform $(x_{2R},y_{2R}$ into $(4+8,0)$, and you transform $(x_A',y_A')$ into $(-8+8,0.2)$

                    4. Use the rest of the points in the digitized curve and the above transformation to get the "original" data.

                    5. Repeat for all curves


                    The procedure is not that difficult, but the trick is to consider each curve separately.






                    share|cite|improve this answer





















                    • This is a good suggestion, but ultimately I don't believe it is correct. I cannot simply translate the vertical axis as you suggest because the graphs are drawn from some perspective (see updated prompt). Notice how in the graph above the two blue lines representing the x-axes are not parallel to each other. I think this issue of perspective is enough that just translating the vertical axis as you suggest may introduce unacceptably large errors into the extraction, unless I'm mistaken about the whole thing. Thanks again for your time!
                      – bRost03
                      Dec 29 '18 at 4:14


















                    1














                    The trick is to do 2D transforms instead. I will explain for the last figure, but everything else is the same.




                    1. You digitize each curve separately.

                    2. You find the corresponding $k_x$ value by looking at the ratio of distances from the bottom corner to the points on that axis. It should be obvious that they increase by $0.1$. For example, you can get the bottom corner as $(x_B,y_B)$ and the right corner as $(x_R,y_R)$, and the last point for second curve is at $(x_{2R},y_{2R})$. Then you have $$frac{x_{2R}-x_B}{x_R-x_B}=frac{y_{2R}-y_B}{y_R-y_B}=frac{k_x-0.3}{1-0.3}$$
                      To minimize errors, choose to find $k_x$ from the equation with the largest denominator. The way I see the figure, it looks like $y$ axis. That way uncertainties in reading $y_{2R}$ value will be divided by a bigger number.

                    3. Translate the vertical axis to one point of the curve, say to $(x_{2L},y_{2L})$. I am interested in the top point of the vertical axis. If the original was $(x_A,y_A)$, the translated point will be $(x_A',y_A')=(x_A+x_{2L}-x_L,y_A+y_{2L}-y_L)$
                      Then the transformation is given by $$begin{pmatrix}t+8\Aend{pmatrix}=Mbegin{pmatrix}x-x_{2L}\y-y_{2L}end{pmatrix}$$
                      Here $M$ is a $2times2$ matrix. To get the coefficients of the matrix, you know that you transform $(x_{2R},y_{2R}$ into $(4+8,0)$, and you transform $(x_A',y_A')$ into $(-8+8,0.2)$

                    4. Use the rest of the points in the digitized curve and the above transformation to get the "original" data.

                    5. Repeat for all curves


                    The procedure is not that difficult, but the trick is to consider each curve separately.






                    share|cite|improve this answer





















                    • This is a good suggestion, but ultimately I don't believe it is correct. I cannot simply translate the vertical axis as you suggest because the graphs are drawn from some perspective (see updated prompt). Notice how in the graph above the two blue lines representing the x-axes are not parallel to each other. I think this issue of perspective is enough that just translating the vertical axis as you suggest may introduce unacceptably large errors into the extraction, unless I'm mistaken about the whole thing. Thanks again for your time!
                      – bRost03
                      Dec 29 '18 at 4:14
















                    1












                    1








                    1






                    The trick is to do 2D transforms instead. I will explain for the last figure, but everything else is the same.




                    1. You digitize each curve separately.

                    2. You find the corresponding $k_x$ value by looking at the ratio of distances from the bottom corner to the points on that axis. It should be obvious that they increase by $0.1$. For example, you can get the bottom corner as $(x_B,y_B)$ and the right corner as $(x_R,y_R)$, and the last point for second curve is at $(x_{2R},y_{2R})$. Then you have $$frac{x_{2R}-x_B}{x_R-x_B}=frac{y_{2R}-y_B}{y_R-y_B}=frac{k_x-0.3}{1-0.3}$$
                      To minimize errors, choose to find $k_x$ from the equation with the largest denominator. The way I see the figure, it looks like $y$ axis. That way uncertainties in reading $y_{2R}$ value will be divided by a bigger number.

                    3. Translate the vertical axis to one point of the curve, say to $(x_{2L},y_{2L})$. I am interested in the top point of the vertical axis. If the original was $(x_A,y_A)$, the translated point will be $(x_A',y_A')=(x_A+x_{2L}-x_L,y_A+y_{2L}-y_L)$
                      Then the transformation is given by $$begin{pmatrix}t+8\Aend{pmatrix}=Mbegin{pmatrix}x-x_{2L}\y-y_{2L}end{pmatrix}$$
                      Here $M$ is a $2times2$ matrix. To get the coefficients of the matrix, you know that you transform $(x_{2R},y_{2R}$ into $(4+8,0)$, and you transform $(x_A',y_A')$ into $(-8+8,0.2)$

                    4. Use the rest of the points in the digitized curve and the above transformation to get the "original" data.

                    5. Repeat for all curves


                    The procedure is not that difficult, but the trick is to consider each curve separately.






                    share|cite|improve this answer












                    The trick is to do 2D transforms instead. I will explain for the last figure, but everything else is the same.




                    1. You digitize each curve separately.

                    2. You find the corresponding $k_x$ value by looking at the ratio of distances from the bottom corner to the points on that axis. It should be obvious that they increase by $0.1$. For example, you can get the bottom corner as $(x_B,y_B)$ and the right corner as $(x_R,y_R)$, and the last point for second curve is at $(x_{2R},y_{2R})$. Then you have $$frac{x_{2R}-x_B}{x_R-x_B}=frac{y_{2R}-y_B}{y_R-y_B}=frac{k_x-0.3}{1-0.3}$$
                      To minimize errors, choose to find $k_x$ from the equation with the largest denominator. The way I see the figure, it looks like $y$ axis. That way uncertainties in reading $y_{2R}$ value will be divided by a bigger number.

                    3. Translate the vertical axis to one point of the curve, say to $(x_{2L},y_{2L})$. I am interested in the top point of the vertical axis. If the original was $(x_A,y_A)$, the translated point will be $(x_A',y_A')=(x_A+x_{2L}-x_L,y_A+y_{2L}-y_L)$
                      Then the transformation is given by $$begin{pmatrix}t+8\Aend{pmatrix}=Mbegin{pmatrix}x-x_{2L}\y-y_{2L}end{pmatrix}$$
                      Here $M$ is a $2times2$ matrix. To get the coefficients of the matrix, you know that you transform $(x_{2R},y_{2R}$ into $(4+8,0)$, and you transform $(x_A',y_A')$ into $(-8+8,0.2)$

                    4. Use the rest of the points in the digitized curve and the above transformation to get the "original" data.

                    5. Repeat for all curves


                    The procedure is not that difficult, but the trick is to consider each curve separately.







                    share|cite|improve this answer












                    share|cite|improve this answer



                    share|cite|improve this answer










                    answered Dec 27 '18 at 4:55









                    AndreiAndrei

                    11.5k21026




                    11.5k21026












                    • This is a good suggestion, but ultimately I don't believe it is correct. I cannot simply translate the vertical axis as you suggest because the graphs are drawn from some perspective (see updated prompt). Notice how in the graph above the two blue lines representing the x-axes are not parallel to each other. I think this issue of perspective is enough that just translating the vertical axis as you suggest may introduce unacceptably large errors into the extraction, unless I'm mistaken about the whole thing. Thanks again for your time!
                      – bRost03
                      Dec 29 '18 at 4:14




















                    • This is a good suggestion, but ultimately I don't believe it is correct. I cannot simply translate the vertical axis as you suggest because the graphs are drawn from some perspective (see updated prompt). Notice how in the graph above the two blue lines representing the x-axes are not parallel to each other. I think this issue of perspective is enough that just translating the vertical axis as you suggest may introduce unacceptably large errors into the extraction, unless I'm mistaken about the whole thing. Thanks again for your time!
                      – bRost03
                      Dec 29 '18 at 4:14


















                    This is a good suggestion, but ultimately I don't believe it is correct. I cannot simply translate the vertical axis as you suggest because the graphs are drawn from some perspective (see updated prompt). Notice how in the graph above the two blue lines representing the x-axes are not parallel to each other. I think this issue of perspective is enough that just translating the vertical axis as you suggest may introduce unacceptably large errors into the extraction, unless I'm mistaken about the whole thing. Thanks again for your time!
                    – bRost03
                    Dec 29 '18 at 4:14






                    This is a good suggestion, but ultimately I don't believe it is correct. I cannot simply translate the vertical axis as you suggest because the graphs are drawn from some perspective (see updated prompt). Notice how in the graph above the two blue lines representing the x-axes are not parallel to each other. I think this issue of perspective is enough that just translating the vertical axis as you suggest may introduce unacceptably large errors into the extraction, unless I'm mistaken about the whole thing. Thanks again for your time!
                    – bRost03
                    Dec 29 '18 at 4:14













                    1














                    Andrei was correct about needing to do each curve separately, but the transformation he gave was slightly too simple so I am writing this answer share what I eventually ended up doing for those who come across this in the future.



                    As shown in the update, the graphs are drawn with perspective. Turns out they are drawn with three point perspective which means the three vanishing points must be reconstructed. Two of the vanishing points are trivially defined by the axes:



                    enter image description here



                    We'll call them $vp_t$ and $vp_k$ from left to right.



                    For the last vanishing point, $vp_A$, we only have a single $A$-axis so we need more information. Luckily projective geometry tells us that the cross ratio of four collinear points is invariant under projection. Along the $A$-axis we have 4 collinear points namely $p_0,p_{0.1},p_{0.2},$ and $vp_A$. Using the fact that the vanishing point is infinitely far away in "real space", this gives us the relation
                    $$
                    frac{|p_{0.2}-p_0||vp_A-p_{0.1}|}{|p_{0.1}-p_0||vp_A-p_{0.2}|}=frac{0.2}{0.1}=2
                    $$

                    This expression combined with the equation for the line defining the $A$-axis uniquely determines the last vanishing point. With this third vanishing point, we can reconstruct the full cube containing our plots in projected space (2D) by finding the intersections of the relevant lines.



                    enter image description here



                    Armed with this box and the vanishing points the 3D data can be recovered by constructing the proper $A$-axis using $vp_A$ and $t$-axis using $vp_t$ then finding the intersection of these axes with the lines connecting the data point with the vanishing points. The data is finally extracted using the invariant cross-ratio above.



                    enter image description here






                    share|cite|improve this answer





















                    • Nice use of vanishing points and cross-ratios.
                      – amd
                      Jan 6 at 20:22
















                    1














                    Andrei was correct about needing to do each curve separately, but the transformation he gave was slightly too simple so I am writing this answer share what I eventually ended up doing for those who come across this in the future.



                    As shown in the update, the graphs are drawn with perspective. Turns out they are drawn with three point perspective which means the three vanishing points must be reconstructed. Two of the vanishing points are trivially defined by the axes:



                    enter image description here



                    We'll call them $vp_t$ and $vp_k$ from left to right.



                    For the last vanishing point, $vp_A$, we only have a single $A$-axis so we need more information. Luckily projective geometry tells us that the cross ratio of four collinear points is invariant under projection. Along the $A$-axis we have 4 collinear points namely $p_0,p_{0.1},p_{0.2},$ and $vp_A$. Using the fact that the vanishing point is infinitely far away in "real space", this gives us the relation
                    $$
                    frac{|p_{0.2}-p_0||vp_A-p_{0.1}|}{|p_{0.1}-p_0||vp_A-p_{0.2}|}=frac{0.2}{0.1}=2
                    $$

                    This expression combined with the equation for the line defining the $A$-axis uniquely determines the last vanishing point. With this third vanishing point, we can reconstruct the full cube containing our plots in projected space (2D) by finding the intersections of the relevant lines.



                    enter image description here



                    Armed with this box and the vanishing points the 3D data can be recovered by constructing the proper $A$-axis using $vp_A$ and $t$-axis using $vp_t$ then finding the intersection of these axes with the lines connecting the data point with the vanishing points. The data is finally extracted using the invariant cross-ratio above.



                    enter image description here






                    share|cite|improve this answer





















                    • Nice use of vanishing points and cross-ratios.
                      – amd
                      Jan 6 at 20:22














                    1












                    1








                    1






                    Andrei was correct about needing to do each curve separately, but the transformation he gave was slightly too simple so I am writing this answer share what I eventually ended up doing for those who come across this in the future.



                    As shown in the update, the graphs are drawn with perspective. Turns out they are drawn with three point perspective which means the three vanishing points must be reconstructed. Two of the vanishing points are trivially defined by the axes:



                    enter image description here



                    We'll call them $vp_t$ and $vp_k$ from left to right.



                    For the last vanishing point, $vp_A$, we only have a single $A$-axis so we need more information. Luckily projective geometry tells us that the cross ratio of four collinear points is invariant under projection. Along the $A$-axis we have 4 collinear points namely $p_0,p_{0.1},p_{0.2},$ and $vp_A$. Using the fact that the vanishing point is infinitely far away in "real space", this gives us the relation
                    $$
                    frac{|p_{0.2}-p_0||vp_A-p_{0.1}|}{|p_{0.1}-p_0||vp_A-p_{0.2}|}=frac{0.2}{0.1}=2
                    $$

                    This expression combined with the equation for the line defining the $A$-axis uniquely determines the last vanishing point. With this third vanishing point, we can reconstruct the full cube containing our plots in projected space (2D) by finding the intersections of the relevant lines.



                    enter image description here



                    Armed with this box and the vanishing points the 3D data can be recovered by constructing the proper $A$-axis using $vp_A$ and $t$-axis using $vp_t$ then finding the intersection of these axes with the lines connecting the data point with the vanishing points. The data is finally extracted using the invariant cross-ratio above.



                    enter image description here






                    share|cite|improve this answer












                    Andrei was correct about needing to do each curve separately, but the transformation he gave was slightly too simple so I am writing this answer share what I eventually ended up doing for those who come across this in the future.



                    As shown in the update, the graphs are drawn with perspective. Turns out they are drawn with three point perspective which means the three vanishing points must be reconstructed. Two of the vanishing points are trivially defined by the axes:



                    enter image description here



                    We'll call them $vp_t$ and $vp_k$ from left to right.



                    For the last vanishing point, $vp_A$, we only have a single $A$-axis so we need more information. Luckily projective geometry tells us that the cross ratio of four collinear points is invariant under projection. Along the $A$-axis we have 4 collinear points namely $p_0,p_{0.1},p_{0.2},$ and $vp_A$. Using the fact that the vanishing point is infinitely far away in "real space", this gives us the relation
                    $$
                    frac{|p_{0.2}-p_0||vp_A-p_{0.1}|}{|p_{0.1}-p_0||vp_A-p_{0.2}|}=frac{0.2}{0.1}=2
                    $$

                    This expression combined with the equation for the line defining the $A$-axis uniquely determines the last vanishing point. With this third vanishing point, we can reconstruct the full cube containing our plots in projected space (2D) by finding the intersections of the relevant lines.



                    enter image description here



                    Armed with this box and the vanishing points the 3D data can be recovered by constructing the proper $A$-axis using $vp_A$ and $t$-axis using $vp_t$ then finding the intersection of these axes with the lines connecting the data point with the vanishing points. The data is finally extracted using the invariant cross-ratio above.



                    enter image description here







                    share|cite|improve this answer












                    share|cite|improve this answer



                    share|cite|improve this answer










                    answered Jan 2 at 19:12









                    bRost03bRost03

                    36019




                    36019












                    • Nice use of vanishing points and cross-ratios.
                      – amd
                      Jan 6 at 20:22


















                    • Nice use of vanishing points and cross-ratios.
                      – amd
                      Jan 6 at 20:22
















                    Nice use of vanishing points and cross-ratios.
                    – amd
                    Jan 6 at 20:22




                    Nice use of vanishing points and cross-ratios.
                    – amd
                    Jan 6 at 20:22


















                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Mathematics Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    Use MathJax to format equations. MathJax reference.


                    To learn more, see our tips on writing great answers.





                    Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                    Please pay close attention to the following guidance:


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3053577%2fextract-data-of-3d-graph-rendered-in-2d%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

                    Mario Kart Wii

                    Partial Derivative Guidance.

                    Understanding the size os this class of aleatory events