1
Python and Java API / Detecting Markers and creating Scalebars in Agisoft 1.1.5
« on: April 16, 2015, 10:02:12 PM »
Hi,
Does anyone know what how to do the input for creating a scalebar?
I have been attempting this and having looked on the forums and in the literature I haven't be able to find a suitable example to help, I know the command 'chunk.addScalebar(scalebar=?)', I have successfully detected the markers through the script but it gets stuck at creating the scalebar as I don't know the form to call the markers with.
Here's my piece of script for this:
I would also like to check that for 4 markers in a diamond shape around the origin/centre(0,0,0) that the reference locations are correct as I have not been able to test this part due to the script not reaching it yet.
Any help would be fantastic!
Sam
Does anyone know what how to do the input for creating a scalebar?
I have been attempting this and having looked on the forums and in the literature I haven't be able to find a suitable example to help, I know the command 'chunk.addScalebar(scalebar=?)', I have successfully detected the markers through the script but it gets stuck at creating the scalebar as I don't know the form to call the markers with.
Here's my piece of script for this:
Code: [Select]
#Marker Detection
#Detect Markers
print("---Detecting Markers---")
chunk.detectMarkers(PhotoScan.TargetType.CircularTarget12bit, 50)
ab = chunk.addScalebar(scalebar= chunk.Markers[1], chunk.Markers[9])
ab.reference.distance = 0.4243
bc = chunk.addScalebar(scalebar= chunk.Markers[9], chunk.markers[4])
bc.reference.distance = 0.4243
cd = chunk.addScalebar(scalebar= chunk.Markers[4], chunk.markers[8])
cd.reference.distance = 0.4243
da = chunk.addScalebar(scalebar= chunk.Markers[8], chunk.markers[1])
da.reference.distance = 0.4243
ac = chunk.addScalebar(scalebar= chunk.Markers[1], chunk.markers[4])
ac.reference.distance = 0.60
bd = chunk.addScalebar(scalebar= chunk.Markers[9], chunk.markers[8])
bd.reference.distance = 0.60
chunk.markers[1].reference.location = PhotoScan.Vector((0,0,0.3))
chunk.markers[9].reference.location = PhotoScan.Vector((0.3,0,0))
chunk.markers[4].reference.location = PhotoScan.Vector((0,0,-0.3))
chunk.markers[8].reference.location = PhotoScan.Vector((-0.3,0,0))
I would also like to check that for 4 markers in a diamond shape around the origin/centre(0,0,0) that the reference locations are correct as I have not been able to test this part due to the script not reaching it yet.
Any help would be fantastic!
Sam