MCPcopy
hub / github.com/PiLiDAR/PiLiDAR / hugin_modify

Function hugin_modify

lib/pano_utils.py:25–47  ·  view source on GitHub ↗
(pto_path, new_project_path, width=6800)

Source from the content-addressed store, hash-verified

23
24
25def hugin_modify(pto_path, new_project_path, width=6800):
26 # Load the project file(pto_path)
27 with open(pto_path, 'r') as file:
28 lines = file.readlines()
29
30 # search for first line that starts with 'p ' -> 'p f2 w6000 h3000 v360 ...'
31 for i, line in enumerate(lines):
32
33 if line.startswith("p "):
34 # replace w and h arguments
35 words = line.split(" ")
36 for j, word in enumerate(words):
37 if word.startswith("w"):
38 words[j] = f"w{width}"
39 elif word.startswith("h"):
40 words[j] = f"h{width//2}"
41
42 lines[i] = " ".join(words)
43 break
44
45 # Save the project file at new_project_path
46 with open(new_project_path, 'w') as file:
47 file.writelines(lines)
48
49
50def hugin_stitch(config, nice=19):

Callers 2

hugin_stitchFunction · 0.85
hugin_refineFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected