如何在图像中查找经纬度坐标,如果我们有经纬度为4个角

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

在下图中,我知道所有4个角的纬度/经度(红点)。我想找到蓝点的纬度/经度。我知道此图像中蓝点的像素坐标。假设是左200px,底233px(从顶部)。

如何在图像中查找经纬度坐标,如果我们有经纬度为4个角

ziqi_wangshuai 回答:如何在图像中查找经纬度坐标,如果我们有经纬度为4个角

我得到了答案:这是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)
,

看看geodesyintermediatePointTo函数。 Here 解释。 它使用 JavaScript,但您可以轻松地将其转换为 Python。

本文链接:https://www.f2er.com/3168579.html

大家都在问