gpt4 book ai didi

python - 如何在图像中找到纬度/经度坐标,如果我们有 4 个角的纬度/经度

转载 作者:行者123 更新时间:2023-12-05 06:23:02 24 4
gpt4 key购买 nike

我有一张图片。我知道所有 4 个角的纬度和经度。我想找到特定点的纬度和经度。

在下图中,我知道所有 4 个角(红点)的纬度/经度。我想找到蓝点的纬度/经度。我知道这张图片中蓝点的像素坐标。比方说,它是 200px 左边和 233px 底部(从顶部)。

enter image description here

最佳答案

我得到了答案:这是 Python 代码

def GetLatandLong(top_Left_Lat, top_Left_Long, bottom_Right_Lat, bottom_Right_Long,img_Width,img_Height, target_Top, target_Left):
diff_Between_Top_Bottom_Lat = bottom_Right_Lat - top_Left_Lat
percentage_Of_Total_Lat_In_Picture = diff_Between_Top_Bottom_Lat/90*100
image_Size_Height_Required_To_Cover_Entire_Earth = img_Height/percentage_Of_Total_Lat_In_Picture*100
top_Left_Percentage_Of_Lat = top_Left_Lat/90*100
top_Left_Pixel_In_Image = image_Size_Height_Required_To_Cover_Entire_Earth*top_Left_Percentage_Of_Lat/100
target_Pixel_In_Whole_Earth_Image = top_Left_Pixel_In_Image + target_Top
percentage_Of_Target_In_Image = target_Pixel_In_Whole_Earth_Image/image_Size_Height_Required_To_Cover_Entire_Earth*100
target_Lat = percentage_Of_Target_In_Image*90/100


diff_Between_Top_Bottom_Long = bottom_Right_Long - top_Left_Long
percentage_Of_Total_Long_In_Picture = diff_Between_Top_Bottom_Long/180*100
image_Size_Width_Required_To_Cover_Entire_Earth = img_Width/percentage_Of_Total_Long_In_Picture*100
top_Left_Percentage_Of_Long = top_Left_Long/180*100
top_Left_Pixel_In_Image = image_Size_Width_Required_To_Cover_Entire_Earth*top_Left_Percentage_Of_Long/100
target_Pixel_In_Whole_Earth_Image = top_Left_Pixel_In_Image + target_Left
percentage_Of_Target_In_Image = target_Pixel_In_Whole_Earth_Image/image_Size_Width_Required_To_Cover_Entire_Earth*100
target_Long = percentage_Of_Target_In_Image*180/100






return target_Lat,target_Long


target_Lat,target_Long = GetLatandLong(52.871983, 8.642317, 52.869069, 8.659905,1200,218, 180, 650)

print(target_Lat,target_Long)

关于python - 如何在图像中找到纬度/经度坐标,如果我们有 4 个角的纬度/经度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58688630/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com