0

我有几条同一路线的视频轨道,全年在不同场合拍摄。所有视频轨道都带有 1Hz GPS 的 GPS 标记,所以我有所有镜头的逐秒 GPS 点。

我想要完成的是将所有这些视频轨道放入例如 After Effects 中,并通过 GPS 位置重新映射时间。我无法按时间同步轨道,因为路线包括红绿灯和其他障碍物。

我已经开始创建两张表格:一张称为summer,它是主要的视频轨道,一张称为shot,它包含所有其他表格。

夏季餐桌是这样的:

      Column   |          Type          |                             Modifiers                              | Storage | Description 
-----------+------------------------+--------------------------------------------------------------------+---------+-------------
 id        | integer                | not null default nextval('summer_id_seq'::regclass) | plain   | 
 timecode  | time without time zone | not null                                                           | plain   | 
 spring_id | integer                |                                                                    | plain   | 
 autumn_id | integer                |                                                                    | plain   | 
 winter_id | integer                |                                                                    | plain   | 
 point     | geometry(Point,4326)   | not null                                                           | main    | 

Indexes:
    "summer_pkey" PRIMARY KEY, btree (id)
    "summer_autumn_id" btree (autumn_id)
    "summer_point_id" gist (point)
    "summer_spring_id" btree (spring_id)
    "summer_winter_id" btree (winter_id)
Foreign-key constraints:
    "summer_autumn_id_fkey" FOREIGN KEY (autumn_id) REFERENCES shot(id) DEFERRABLE INITIALLY DEFERRED
    "summer_spring_id_fkey" FOREIGN KEY (spring_id) REFERENCES shot(id) DEFERRABLE INITIALLY DEFERRED
    "summer_winter_id_fkey" FOREIGN KEY (winter_id) REFERENCES shot(id) DEFERRABLE INITIALLY DEFERRED
Has OIDs: no

虽然镜头表看起来像这样:

  Column  |          Type          |                             Modifiers                             | Storage  | Description 
----------+------------------------+-------------------------------------------------------------------+----------+-------------
 id       | integer                | not null default nextval('shot_id_seq'::regclass) | plain    | 
 season   | character varying(255) | not null                                                          | extended | 
 timecode | time without time zone | not null                                                          | plain    | 
 point    | geometry(Point,4326)   | not null                                                          | main     | 

Indexes:
    "shot_pkey" PRIMARY KEY, btree (id)
    "shot_point_id" gist (point)
Referenced by:
    TABLE "summer" CONSTRAINT "summer_autumn_id_fkey" FOREIGN KEY (autumn_id) REFERENCES shot(id) DEFERRABLE INITIALLY DEFERRED
    TABLE "summer" CONSTRAINT "summer_spring_id_fkey" FOREIGN KEY (spring_id) REFERENCES shot(id) DEFERRABLE INITIALLY DEFERRED
    TABLE "summer" CONSTRAINT "summer_winter_id_fkey" FOREIGN KEY (winter_id) REFERENCES shot(id) DEFERRABLE INITIALLY DEFERRED
Has OIDs: no

所以,基本上我想要做的是遍历夏季表中的所有行,为每个不同的拍摄找到最接近每一行的点,并使用此信息更新夏季表。

我整理了一个我个人不明白为什么不起作用的查询,但是输出很奇怪,并且在 After Effects 中进行时间重新映射时根本不起作用:

SELECT DISTINCT ON (summer.id)
   summer.id AS summer_id, shot.id AS autumn_id,
   ST_Distance_Sphere(summer.point, shot.point) AS distance
FROM shot.summer summer
   LEFT JOIN shot.shot.track
     ON ST_DFullyWithin (summer.point, shot.point, 0.001)
     AND shot.season='autumn'
ORDER BY summer.id ASC;

有人可以指出我正确的方向吗?

谢谢!

4

1 回答 1

1

只是我的猜测(也许您可以详细说明“输出很奇怪”?)

您使用的是地理坐标,那么 0.001 的半径是一个相当大的距离(南北约 100 m,东西方向较小,取决于您向北的距离)然后您可能会在两者中获得很多匹配的命中表。据我了解,每个“秋点”都需要一个“夏点”——你只需要选择最近的点。此外,我会将数据重新投影到具有相同 x 和 y 分辨率的投影中(例如 utm,除非您覆盖的东西距离太大)如果我在北纬 60 度左右,使用地理投影,a ~ 110米的南北距离产生 0.001 度的数值差异,而约 55 米的东西距离产生相同的数值差异。即对于计算,向东 55 米的误差与向北的 110 米误差相同......

希望这为您指明了正确的方向。

于 2012-10-23T08:14:17.067 回答