2
« on: May 05, 2016, 02:31:03 AM »
Thanks !
right know im using this code ,but at the end the calibration camera is 0 . And there is no message error
import os
import PhotoScan
global doc
doc = PhotoScan.app.document
#Especificar el directorio donde se encentran las imágenes
print("Especificar el nombre del archivo donde se encuentran las fotos:")
PhotoScan.app.messageBox("Especificar el nombre de la carpeta donde se encuentran las fotos:")
path_photos = PhotoScan.app.getExistingDirectory("Especificar el nombre del archivo donde se encuentran las fotos:")
#Creación de nuevo set de imágenes o chunk
doc.addChunk()
chunk = doc.chunks[-1]
chunk.label = "Grupo de Cámaras"
print("Escribir el nombre del archivo y la dirección donde guardar el proyecto:")
PhotoScan.app.messageBox("Escribir el nombre del archivo y la dirección \n donde guardar el proyecto:")
project_path = PhotoScan.app.getSaveFileName("Especificar el nombre del archivo para guardar el proyecto:")
if not project_path:
print("Abortado por el usuario")
if project_path[-4:].lower() != ".psz":
project_path += ".psz"
#Cargar imágenes
image_list = os.listdir(path_photos)
photo_list = list()
for photo in image_list:
if (".jpg" or ".jpeg" or ".tiff" or ".TIF") in photo.lower():
photo_list.append(path_photos + "\\" + photo)
chunk.addPhotos(photo_list)
doc.save(project_path)
PhotoScan.app.update()
print("Carga de imágenes finalizada")
PhotoScan.app.messageBox("Especificar la ruta del archivo XML:")
photo_list =PhotoScan.app.getOpenFileName("Specify XML location:")
calib_path = PhotoScan.Calibration(photo_list)
calib_path.load(photo_list)