1
Feature Requests / Re: ability to filter tie points by variance
« on: March 18, 2023, 12:48:50 AM »
Hi if there´s any way to do it please help
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
enabled_cameras = []
for camera in chunk.cameras:
if camera.enabled:
enabled_cameras.append(camera)
chunk.matchPhotos(cameras=enabled_cameras, downscale=1, generic_preselection=True, keypoint_limit=50000, tiepoint_limit=15000)
chunk.alignCameras()
the first pair is working but when i disable the 1 and enable the 3 the ouput isenabled_cameras = []
for camera in chunk.cameras:
if camera.enabled:
enabled_cameras.append(camera)
chunk.matchPhotos(cameras=enabled_cameras, downscale=1, generic_preselection=True, keypoint_limit=50000, tiepoint_limit=15000)
chunk.alignCameras()
the first pair is working but when i disable the 1 and enable the 3 the ouput is import Metashape
import os
doc = Metashape.app.document
chunk = doc.chunk
def find_files(folder, types):
files = []
for root, dirs, filenames in os.walk(folder):
for filename in filenames:
if os.path.splitext(filename)[1].lower() in types:
files.append(os.path.join(root, filename))
return files
def import_subfolders(folder):
# Crear un nuevo proyecto en Metashape
doc = Metashape.app.document
for root, dirs, files in os.walk(folder):
for dir in dirs:
# Crear un nuevo grupo para cada subdirectorio
group=chunk.addCameraGroup()
group.label = dir
# Encontrar todas las fotos en el subdirectorio
photos = find_files(os.path.join(root, dir), [".jpg", ".jpeg", ".tif", ".tiff"])
# Añadir las fotos al chunk
chunk.addPhotos(photos,group=group.label)
# Guardar el proyecto
# Usa la funcion anterior para importar todos los subdirectorios en una carpeta dada
image_folder = Metashape.app.getExistingDirectory("Selecciona la carpeta de imagenes:")
import_subfolders(image_folder)