Orthophoto_Maps icon indicating copy to clipboard operation
Orthophoto_Maps copied to clipboard

image orientation is not correct

Open dubing-bit opened this issue 1 year ago • 2 comments

It's better when I use it with the test dataset, but it doesn't seem to be quite right when I use another dataset (https://dronemapper.com/software/4thAve.zip). I get an incorrect image, the image orientation is not correct. image image

dubing-bit avatar Jul 20 '23 06:07 dubing-bit

Hi

As you know, input parameters about a camera and a coordinate system are crucial in generating orthophotos

In this case, a sensor width and an epsg code affect the result I generated individual orthphotos from 0025 to 0029, here is the overlay

image

I modified a sensor width(13.2 -> 6.17) and an EPSG code(5185 -> 32613) Sensor width: https://github.com/hwiyoung/Orthophoto_Maps/blob/master/main_dg.py#L15 EPSG code: https://github.com/hwiyoung/Orthophoto_Maps/blob/master/main_dg.py#L18 The reason is as follows:

  • I assumed that a camera is Phantom 4 RTK, you used Phantom 3 Pro
  • The coordinate system of sample data is EPSG:5186(TM Korea Central), one of yours is EPSG:32613(UTM 13N)

I think you can also same a result if you change the parameters And I have to change an way to set parameters to alleviate the misleading

hwiyoung avatar Jul 20 '23 14:07 hwiyoung

Thanks, I changed the sensor size but overlooked the projected coordinate system.I tried to automatically generate a projected coordinate system from latitude and longitude, and the following code might work and help the process. **``` from pyproj import CRS from pyproj.aoi import AreaOfInterest from pyproj.database import query_utm_crs_info

def generation_utmcrs(lat,lon): utm_crs_list = query_utm_crs_info( datum_name="WGS 84", area_of_interest=AreaOfInterest( west_lon_degree=lat, south_lat_degree=lon, east_lon_degree=lat, north_lat_degree=lon, ), ) utm_crs = CRS.from_epsg(utm_crs_list[0].code) return utm_crs

dubing-bit avatar Jul 21 '23 11:07 dubing-bit