agisoft-llc / metashape-scripts

Python scripts for Metashape (former PhotoScan)
MIT License
367 stars 203 forks source link

Error del script footprints_to_shapes.py #21

Closed germanwilches closed 4 years ago

germanwilches commented 4 years ago

Hola, he intentado usar el script footprints_to_shapes.py con buenos resultados con pocas fotos, pero cuando intento hacerlo en un proyecto con 15000 imágenes el programa no responde y se cuelga.

germanwilches commented 4 years ago

Captura

PolarNick239 commented 4 years ago

¡Hola! Lamentablemente, footprints_to_shapes es bastante lento en caso de una gran cantidad de puntos de unión e imágenes. Metashape no cuelga, está ejecutando el script durante mucho tiempo. Verifiqué cuánto tiempo se tarda en estimar las huellas con un número similar de puntos de unión (47 millones en mi caso): tomó alrededor de 1 segundo por imagen. Entonces, para 15000 imágenes, puede esperar que se ejecute en 15000 segundos ~ en cuatro horas.

¿Quizás no necesite estimar las huellas de todas las imágenes? Si es así, puede deshabilitar otras imágenes y hacer un cambio simple en el script para que ignore las imágenes deshabilitadas, solo edite esta línea: https://github.com/agisoft-llc/metashape-scripts/blob/67f8fd0c1da96d078403569c36c12fc5fbd8e0e4/src/footprints_to_shapes.py#L43 con la adición de or not camera.enabled:

        if camera.type != Metashape.Camera.Type.Regular or not camera.transform or not camera.enabled:
In English. Hi! Sadly footprints_to_shapes is quite slow in case of a big number of tie points and images. Metashape does not hang up - it is executing the script for a long time. I checked how long does it take to estimate footprints with similar number of tie points (47 million in my case) - it took around 1 second per image. So for 15000 images you can expect that it will be executed in 15000 seconds ~ in four hours. Maybe you don't need to estimate footprints for all images? If so - you can disable other images and make a simple change in the script so that it will ignore disabled images - just edit this line: https://github.com/agisoft-llc/metashape-scripts/blob/67f8fd0c1da96d078403569c36c12fc5fbd8e0e4/src/footprints_to_shapes.py#L43 with adding ```or not camera.enabled```: ```python if camera.type != Metashape.Camera.Type.Regular or not camera.transform or not camera.enabled: ```
germanwilches commented 4 years ago

Hola gracias por tu pronta respuesta. intente con la solución y tampoco funciono deje el equipo trabajando toda una noche y el programa metachape nunca respondió.

PolarNick239 commented 4 years ago

¿Es cierto que el proyecto no tiene un modelo poligonal 3D ni una nube de puntos densa?

Si es así, ¿puede editar la línea 43 como se describe anteriormente (agregando or not camera.enabled: al final de la línea), luego deshabilite todas las fotos excepto solo 10 fotos, luego ejecute el script y verifique cuántos segundos durará su ejecución ¿tomar? (vea Script started... and Script finished! en la consola de Metashape).

In English. Is it true that the project has neither a 3D polygonal model nor a dense points cloud? If so - can you please edit line 43 as described above (adding ```or not camera.enabled:``` to the end of the line), then disable all photos except only 10 photos, then run the script and check how many seconds its execution will take? (see ```Script started...``` and ```Script finished!``` lines' timestamp in the Metashape's console).
PolarNick239 commented 4 years ago

Feel free to reopen the issue if needed.