Skip to content

Commit 46377aa

Browse files
committed
adds listing QR positions as OpenDroneMap GCP_list.txt
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.
1 parent ac26476 commit 46377aa

File tree

4 files changed

+26
-6
lines changed

4 files changed

+26
-6
lines changed

gcp_list.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

main.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import zxing
44
from pathlib import Path
5+
import utm
56

67
import gcposm.utils
78

@@ -34,7 +35,9 @@ def get_qr_codes(file):
3435
def main(filename):
3536

3637
# preparation
37-
gcp_list = load_your_gcp_list("gcp_list.txt")
38+
gcp_list = load_your_gcp_list("my_gcp_list.txt")
39+
f = open("gcp_list.txt", "w")
40+
odm_gcp_header = 0
3841

3942

4043
# now working time
@@ -59,13 +62,29 @@ def main(filename):
5962
#do stuff now...
6063
for item in gcp_list:
6164
if parsed == item[0]:
62-
print("\t found a known gcp (", item[1] ,"/", item[2] ,") from your list")
65+
print("\t found a known gcp (", item[1] ,"/", item[2] ,"/", item[3] ,") from your list")
66+
location_utm = utm.from_latlon(float(item[1]), float(item[2]))
67+
68+
69+
# OpenDroneMap GCP
70+
## header
71+
if odm_gcp_header == 0:
72+
# this is still to understood, why ODM just allows one utm zone and that is in the header!
73+
f.write("WGS84 UTM " + str(location_utm[2]) + str(location_utm[3]) + "\n")
74+
odm_gcp_header = 1
75+
76+
## line by line saving the coordinates
77+
f.write((str(location_utm[0]) + " " + str(location_utm[1]) + " " + item[3] + " "
78+
+ str(points[1][0]) + " " + str(points[1][1]) + " " + file.split(os.sep)[-1]) + "\n")
6379

6480

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

6884

85+
f.close()
86+
87+
6988
def getArgs():
7089
"""
7190
defining the input parameters by the arguments.

my_gcp_list.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
5;50.0;10.0;0.0*
2+
23;51.1;11.1;111.1*
3+
42;52.2;12.2;222.2*

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
zxing
1+
zxing
2+
utm

0 commit comments

Comments
 (0)