cnr-isti-vclab / PyMeshLab

The open source mesh processing python library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

When calling compute_texcoord_parametrization_and_texture_from_registered_rasters, I get "Aborted (core dumped)"

edin45 opened this issue · comments

Hey there! As the title says, when I call compute_texcoord_parametrization_and_texture_from_registered_rasters, I get "Aborted (core dumped)", It does take some time until I get it though - so it doesn't happen immediately.

Also, I am on Linux (Arch to be exact), using Python 3.11.6, and pymeshlab 2022.2.post4, and this is the line of code that causes the issue:

ms.compute_texcoord_parametrization_and_texture_from_registered_rasters(texturesize=10240,colorcorrection=True,colorcorrectionfiltersize=1,usedistanceweight=True,useimgborderweight=True,usealphaweight=False,cleanisolatedtriangles=True,stretchingallowed=False,texturegutter=4)

I did already try to reduce the texture size 1024, but It still happens.

Am doing anything wrong, or is this a bug? Thanks in advance!

PS. Thank you so much for this amazing tool - I'm using it as a part of my opensource photogrammetry software, and without it, I think I would have gone crazy :-)

So, I've done some more digging, and the latest version that the error does not happen on is 2021.10 (I had to downgrade to python 3.9.18 to install 2021.10 - but If I use pymeshlab 2022.2.post4 on that python version the error happens as well) - Oh and the error also happens with the latest 2023.12. Is there anything I can do to fix this?

This issue has been automatically marked as stale because it has not had recent activity. The resources of the VCLab team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the last release of PyMeshLab, please reply with all of the information you have about it in order to keep the issue open. If this is a feature request, and you feel that it is still relevant and valuable, please tell us why. This issue will automatically be closed in the near future if no further activity occurs. Thank you for all your contributions.

Sorry for the late reply.
Could you please help me reproduce the issue? Could you share the input meshes/rasters and the script you run?
The filter you are using requires an opengl context to be executed, therefore the problem could be caused by the system setup... Although it is strange that it was working as expected on an old pymeshlab version.

Hey there - It's no problem, thank you for replying! - yeah sure so the script I am running is this one:

import os
import pymeshlab
import optparse

parser = optparse.OptionParser()
parser.add_option("-m","--mesh",action="store",help="To be textured mesh")
parser.add_option("-p","--project",action="store",help="Project")
parser.add_option("-o","--output_folder",action="store",help="Folder where Results are stored")

options, args = parser.parse_args()

output_folder = options.output_folder
project = options.project
mesh = options.mesh

ms = pymeshlab.MeshSet()
print("opening project...")
ms.load_project(project)
print('reading...')
ms.load_new_mesh(mesh)
print('repair non manifold...')
ms.meshing_repair_non_manifold_edges()
print('texturing...')
ms.compute_texcoord_parametrization_and_texture_from_registered_rasters(texturesize=10240,colorcorrection=True,colorcorrectionfiltersize=1,usedistanceweight=True,useimgborderweight=True,usealphaweight=False,cleanisolatedtriangles=True,stretchingallowed=False,texturegutter=4)
print('saving')
ms.save_current_mesh(os.path.join(output_folder,"textured.obj"))

and the mesh, images and project file I will send in a bit

So I ran the script like this (with the working folder being in the image folder):
/path/python/venv/bin/python /path/to/script/textureMesh/textureMesh.py -m '/drive/path/3dscanning/SmallPlastic/out/temp/model_surface.ply' -p '/drive/path/3dscanning/SmallPlastic/Images/project.nvm' -o '/drive/path/3dscanning/SmallPlastic/out'
(I just used the test set from reality capture)

and the image, project file, and mesh I uploaded here: https://mega.nz/file/5msHQTiD#qdKIrE0ED4AkqRHudU72VtHh5MwlpJ3PTuDgF1AqEB8

I met the same case, waiting for a solution

This problem occurs to me too.

I think that in my case the issue is that I am running the compute_texcoord_parametrization_and_texture_from_registered_rasters function on a system that does not have a monitor (offscreen mode). The system is Ubuntu but I think it doesn't matter.

pymeshlab 2022.2

Trying to deal with the problem of running a python script via

xvfb-run -a python3 my_awesome_pymeshalb_script.py - did not help.
Maybe someone have solution? @edin45 @seekever @alemuntoni Thanks alot of any information how to fix this!