如何创建任意共面3d曲线的2d图 [英] How to create 2d plot of arbitrary, coplanar 3d curve

查看:94
本文介绍了如何创建任意共面3d曲线的2d图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组点,这些点组成(理论上)共面曲线.我的问题是飞机是任意的,并且每次我收集数据时都可以移动(这些点是从相机收集的).我想知道你们是否可以帮助我弄清楚如何:

  1. 找到最接近这些点共面的平面
  2. 以这样的方式将这些点投影到该平面上,使我获得二维曲线

我相信我知道该怎么做的第二点,实际上我主要是在努力的第一点,但是我也不会介意在第二点上提供帮助.

一吨!

解决方案

  1. 在数据中找到3个点A,B,C

    它们不得位于同一行上,并且应尽可能地彼此隔开以提高准确性.

  2. 构造U,V基向量

    U = B-A
    V = C-A
    

    规范化

    U /= |U|
    V /= |U|
    

    使U,V垂直

    W = cross(U,V) // this will be near zero if A,B,C are on single line
    U = cross(V,W)
    

  3. 将您的数据转换为U,V平面

    仅针对数据计算中的任意点P=(x,y,z):

    x' = dot(U,P)
    y' = dot(V,P)
    

    如果您还需要反向转换:

    P = x'*U + y'*V
    

    如果您要/有一个原点A,则转换为:

    x' = dot(U,P-A)
    y' = dot(V,P-A)
    P = A + x'*U + y'*V
    

    这将在您的2D坐标中将A映射到(0,0).

如果您不知道向量数学,请看这里:

在底部,您将找到矢量运算的方程式.希望对您有帮助...

I have a set of points which comprise a (in theory) co-planar curve. My problem is that the plane is arbitrary and can move between each time I collect the data (these points are being collected from a camera). I was wondering if you guys could help me figure out how to:

  1. find the plane which is closest to the one which these points are co-planar on
  2. project the points on this plane in such a way that gives me a 2-d curve

I believe that I know how to do point 2, it is really mainly point 1 that i'm struggling with, but I wouldn't mind help on the second point as well.

Thanks a ton!

解决方案

  1. find 3 points A,B,C in your data

    They must not be on single line and should be as far from each other as possible to improve accuracy.

  2. construct U,V basis vectors

    U = B-A
    V = C-A
    

    normalize

    U /= |U|
    V /= |U|
    

    make U,V perpendicular

    W = cross(U,V) // this will be near zero if A,B,C are on single line
    U = cross(V,W)
    

  3. convert your data to U,V plane

    simply for any point P=(x,y,z) in your data compute:

    x' = dot(U,P)
    y' = dot(V,P)
    

    in case you need also the reverse conversion:

    P = x'*U + y'*V
    

    In case you want/have an origin point A the conversions would be:

    x' = dot(U,P-A)
    y' = dot(V,P-A)
    P = A + x'*U + y'*V
    

    That will map A to (0,0) in your 2D coordinates.

In case you do not know your vector math look here:

at the bottom you will find the equation for vector operations. Hope that helps ...

这篇关于如何创建任意共面3d曲线的2d图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆