2

我有这个问题,我可能在我的脑海中过于复杂。我已经做了很长时间了,如果有人能给我一些指导,我将不胜感激。

所以我正在尝试做的是从天空拍摄的图像上的地图坐标,到地面上平坦表面上的坐标。这从一个点的正上方很好,我可以通过使用基本三角法计算的某个因子来缩放我的坐标。

问题是相机是否倾斜。

http://i61.tinypic.com/359wsok.png [注意,这里的高度是Z轴]

我希望我的图表有意义。中心线(终止于 (x2,y2) 的那条线将另外两条线一分为二,即每条外线都与中心线相距 (1/2)a 度。我知道这可能会变得非常复杂。越水平相机指向, 更多的表面将在图像的视野中. 显然这意味着图像最远部分的 2 个像素之间的距离大于在图像中“放大”的更近的像素之间的距离有道理。如果我能在与垂直方向仅 40 度角的情况下处理相当不错的工作,那就太好了。

我的第一次尝试是获取视图中表面的大小,然后使用它来缩放我的坐标。但是,我不相信这行得通。(x2,y2) 可能不在捕获表面的中心,并且由于捕获的表面不在正下方,因此需要将某种偏移添加到坐标中。

我希望这一切都清楚了。如果您需要更多信息,请告诉我。我只是绕圈子。

谢谢

4

1 回答 1

1

我将尝试概述用于解决此类问题的算法。首先,我们需要了解相机的物理特性,即它所拍摄图像的焦距和实际尺寸,以及以像素为单位的尺寸。如果我说的是图像的“真实”尺寸,它实际上是指图像的尺寸或者,更容易想象,经典胶片相机的底片尺寸)。用于航空测绘的典型中画幅相机的示例值为 50 毫米焦距、9000*6800 像素、6 微米像素大小,图像大小约为 40x54 毫米。

计算地面上一个像素位置的算法是(适用于使用 LSR 系统,也可以使用地理坐标进行计算):

public void ImageToGround(Camera sensor, double posx, double posy, double posz, 
    double dDeltaX, double dDeltaY, 
    Matrix4D rotationMatrixItg, 
    double groundheight, out double resultx, out double resultx)
    {
        // The rotation matrix is right-handed, with x pointing in flight direction, y to the right and z down.
        // The image cs is increasing x to the right and y to the bottom (y = 0 is front in flight direction)
        Vector3D imagePointRelativeToFocalPoint = new Vector3D(
             dDeltaX,
             dDeltaY,
             -sensor.MetricFocalLength);

         // Transform from img to camera coord system and rotate.
         // The rotation Matrix contains the transformation from image coordinate system to camera
         // coordinate system. 
         Vector3D imagePointRotated = rotationMatrixItg * imagePointRelativeToFocalPoint;

         double dir, dist;

         // Create a horizontal plane at groundheight, pointing upwards. (Z still points down)
         Plane plane = new Plane(new Vector3D(0, 0, -1), new Vector3D(0, 0, -groundheight));

         // And a ray, starting at the given image point (including the real height of the image position).
         // Direction is opposite to the vector given above (from image to focal point). 
         Ray start = new Ray(new Vector3D(imagePointRotated.X, imagePointRotated.Y, imagePointRotated.Z - evHASL), 
    -(new Vector3D(imagePointRotated.X, imagePointRotated.Y, imagePointRotated.Z)));

         // Find the point where the ray intersects the plane (this is on the opposite side of the
         // x and y axes, because the ray goes trough the origin). 
         IntersectionPair p = start.Intersects(plane);
         if (p.NumIntersections < 1)
         {
             resultx = 0;
             resulty = 0;
             return;
         }

         resultx = p.Intersection1.x;
         resulty = p.Intersection1.y;

   }

with posx, posy, posz:图像中心的位置;dDeltaX, dDeltaY:像素在焦平面上的位置(以米为单位);rotationMatrixItg:图像到地面的旋转矩阵,由图像的偏航、俯仰、滚动创建;groundheight:地面的高程;resultx, resulty:地面上的结果位置。我已经简化了算法,因此您可能需要对其进行调整以满足您的需求。

当地形不平坦时,问题会变得更加复杂。如果需要将整个图像投影到地面上,通常会采用相反的方式,因为这样更容易插值并且可以并行完成。

我不完全知道您所说的“虚拟”图像是什么意思,因为它们也是由投影创建的,因此存在一些可以使用的理论图像参数。

于 2014-03-23T11:13:35.603 回答