Hello alexey, i was wondering and trying to solve this problem, and i noticed that the scale bars will be created in merged chunks.
And it is not that i want, i want to create the scale bars before this step.
For example.
I have 80 Photos, and my script will create 40 chunks with 2 photos each in it.
And is in this step, after create the chunk with 2 photos , that the script will create the scale bars, all with the same lenght. And, in the end i will have 40 scale bars.
So, i put the scale bars line in my script, to you understand where the script will create hah
TY
import os, PhotoScan
doc = PhotoScan.app.document
path_photos = PhotoScan.app.getExistingDirectory("C:\\Users\lma\Documents\Fotos.jpg")
image_list = os.listdir(path_photos)
photo_list = list()
for photo in image_list:
if photo.rsplit(".",1)[1].lower() in ["jpg", "jpeg", "tif", "tiff"]:
photo_list.append("/".join([path_photos, photo]))
start = 0
while (start +1 < len(photo_list)):
chunk = PhotoScan.app.document.chunk
chunk = doc.addChunk()
chunk.addPhotos(photo_list[start:start+2])
chunk.detectMarkers(type=PhotoScan.CircularTarget12bit)
[color=red][b] chunk.addScalebar(chunk.cameras[1],chunk.cameras[2]) [/b][/color]
start += 2
PhotoScan.app.document.chunks[-1]
PhotoScan.app.document.mergeChunks()
merged_chunk = PhotoScan.app.document.chunks[-1]
merged_chunk.matchPhotos(accuracy=PhotoScan.HighAccuracy)
merged_chunk.alignCameras(adaptive_fitting=True)
merged_chunk.buildDepthMaps(quality=PhotoScan.UltraQuality, filter=PhotoScan.AggressiveFiltering)
merged_chunk.buildDenseCloud(point_colors=True)