Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

image orientation is not correct #19

Open
dubing-bit opened this issue Jul 20, 2023 · 2 comments
Open

image orientation is not correct #19

dubing-bit opened this issue Jul 20, 2023 · 2 comments

Comments

@dubing-bit
Copy link

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

@hwiyoung
Copy link
Owner

hwiyoung commented Jul 20, 2023

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

@dubing-bit
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants