Python:纠正Google地图上积分的偏移(由于卫星图像倾斜)
我正在使用Google Maps静态API获取我具有表面坐标(LOD1 / LOD2)对象的顶部视图卫星图像。
这些要点总是有点关闭,我认为这是由于卫星图像本身的倾斜很小(这是正确的假设吗?)。
例如,在此图像我有构建形状,但点略有关闭。 是否有一种方法可以为所有对象纠正这一点吗?
红色标记是标准的Google-Maps API指针,原始图像的中心(此处是裁剪)是建筑物的中心,并且白线是对象形状的cv2. -polyline实现。
仅通过N像素移动将无济于事,因为偏移取决于卫星和物体之间的角度以及该物体的形状。 我正在使用 pyproj库转换坐标,然后将坐标转换为像素值(通过将中心点设置为中心像素值,并在坐标空间中具有差异,也可以计算边缘点像素值)。
I'm using the google maps static api to get top view satellite images of objects of which I have the surface coordinates (LoD1 / LoD2).
the points are always slightly off, I think this is due to a small tilt in the satellite image itself (is it a correct assumption?).
For example in this image I have the building shape, but the points are slightly off. Is there a way to correct this for all objects?
The red markers are the standard google-maps api pointers, the center of the original image (here it is cropped) is the center of the building, and the white line is a cv2.polyline implementation of the object shape.
Just shifting by n pixels will not help since the offset depends on the angle between the satellite and object and the shape of that object.
I am using the pyproj library to transform the coordinates, and then convert the coordinates to pixel values (by setting the center point as the center pixel value, and having the difference in the coordinate space, one can calculate the edge-points pixel values too).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此 - 好消息是,无需为所有对象“纠正”此目标,因为不使用3D模型&纹理。
Google(或大多数此事务的地图平台)实际上并未使用卫星图像,而是使用飞机图像。飞机不会直接飞过每个建筑物的顶部(想象一下,如果他们这样做的话,他们的飞行道路将有多紧!)。
取而代之的是,平面将从某种角度拍摄图像,然后通过摄影测量处理的奇观,均得到校正和正截止。
在2D图像中不能(也不应该)纠正的是地面高度以上对象的位置。喜欢图像中的屋顶。以更极端的例子,只要看看摩天大楼,您就会意识到自己永远无法在地面上正确的像素:
https://goo.gl/maps/4tls/4tls/4tlsrd7yxqywzpty77
So - the good news is that there is no need to "correct" this for all objects, because there is no way to do that without using 3d models & textures.
Google (or most map platforms for that matter) don't actually use satellite images, they use aeroplane images. The planes don't fly directly over the top of every building (imagine how tight/redundant their flight path would be if they did!).
Instead, the plane will take an image from some kind of angle, and then, through the wonders of photogrammetric processing, the images are all corrected and ortho-rectified so the ground surface is in the right place everywhere.
What can't (and shouldn't) be corrected in a 2d image is the location of objects above ground height. Like the roof in your image. For a more extreme example, just look at a skyscraper, and you'll realise you can't ever get the pixels correct above the ground:
https://goo.gl/maps/4tLSrd7yXQYWZPTy7