Hello
I am trying to align the turn table pictures. I place a marker (12bit circular targets),
chunk.detectMarkers(Metashape.TargetType.CircularTarget12bit, 50)
this code is detecting the markers.
When scalebars between markers hard code. My 360 image alignments are coming as expected.
scalebars = chunk.addScalebar(chunk.markers[0], chunk.markers[1])
scalebars.reference.accuracy = accuracy
scalebars.reference.distance = 0.1765
scalebars = chunk.addScalebar(chunk.markers[1], chunk.markers[2])
scalebars.reference.accuracy = accuracy
scalebars.reference.distance = 0.1765
scalebars = chunk.addScalebar(chunk.markers[2], chunk.markers[3])
scalebars.reference.accuracy = accuracy
scalebars.reference.distance = 0.1765
Instate of hard coding i try to make this addition bit dynamic like below. My image aligments if going every where. Not sure why this is happening. Or what I am doing wrong.
accuracy = 0.0001
pairings = ['1_2','2_3','3_4']
scale_values = {
'1_2': 0.1765, '2_3': 0.1765, '3_4': 0.1765}
markers_name = {}
for marker in chunk.markers:
markers_name.update({marker.label.replace('target ',''): marker})
print(markers_name)
for pair in pairings:
a, b = pair.split('_')
if (a in markers_name.keys()) and b in markers_name.keys():
scalebars = chunk.addScalebar(chunk.markers[int(a)-1],chunk.markers[int(b)-1])
scalebars.reference.accuracy = accuracy
scalebars.reference.distance = scale_values[pair]
Thanks