Skip to content

Commit

Permalink
adds listing QR positions as OpenDroneMap GCP_list.txt
Browse files Browse the repository at this point in the history
converting the positon (lat,long) as the UTM format of WGS84.
also adding altitutde to the my_gcp_list, which was renamed from gcp_list to my_gcp_list to distinguish it from the output for ODM.
  • Loading branch information
hornig committed Jun 15, 2019
1 parent ac26476 commit 46377aa
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
3 changes: 0 additions & 3 deletions gcp_list.txt

This file was deleted.

23 changes: 21 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import zxing
from pathlib import Path
import utm

import gcposm.utils

Expand Down Expand Up @@ -34,7 +35,9 @@ def get_qr_codes(file):
def main(filename):

# preparation
gcp_list = load_your_gcp_list("gcp_list.txt")
gcp_list = load_your_gcp_list("my_gcp_list.txt")
f = open("gcp_list.txt", "w")
odm_gcp_header = 0


# now working time
Expand All @@ -59,13 +62,29 @@ def main(filename):
#do stuff now...
for item in gcp_list:
if parsed == item[0]:
print("\t found a known gcp (", item[1] ,"/", item[2] ,") from your list")
print("\t found a known gcp (", item[1] ,"/", item[2] ,"/", item[3] ,") from your list")
location_utm = utm.from_latlon(float(item[1]), float(item[2]))


# OpenDroneMap GCP
## header
if odm_gcp_header == 0:
# this is still to understood, why ODM just allows one utm zone and that is in the header!
f.write("WGS84 UTM " + str(location_utm[2]) + str(location_utm[3]) + "\n")
odm_gcp_header = 1

## line by line saving the coordinates
f.write((str(location_utm[0]) + " " + str(location_utm[1]) + " " + item[3] + " "
+ str(points[1][0]) + " " + str(points[1][1]) + " " + file.split(os.sep)[-1]) + "\n")


else:
print("qr not found in", file)


f.close()


def getArgs():
"""
defining the input parameters by the arguments.
Expand Down
3 changes: 3 additions & 0 deletions my_gcp_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
5;50.0;10.0;0.0*
23;51.1;11.1;111.1*
42;52.2;12.2;222.2*
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
zxing
zxing
utm

0 comments on commit 46377aa

Please sign in to comment.