Forum

Show Posts

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.


Messages - Paulov

Pages: [1] 2 3
1
Feature Requests / Import point cloud without normals compute
« on: December 14, 2023, 01:15:03 PM »
Hi.

Ocasionally I need to recolor a mesh using the point cloud that was used originally, but this time the point cloud has received some color corrections in Cloud Compare.

The import process takes very long in big data files of several GB. For a color transfer I believe normals would not be needed so my request would be to add the option checkbox to import a point cloud without computing the normals to have a quick loading instead fo 20-30 minute wait.

2
Feature Requests / Re: Gaussian Splatting
« on: October 09, 2023, 03:14:57 PM »
Hi! You can use script to export camera images and camera alignment and after that use them in gaussian splatting.

Thanks a lot!!

My main issue is to align images, I guess uses Colmap under the hood, an my datasets seem to particularly not owrk nicely in there. I've 3-4 weeks of intense work in other topics but definitelly will try the script!

3
Feature Requests / Gaussian Splatting
« on: September 23, 2023, 05:50:46 PM »
Hello,

Do you plan to introduce hability to generate Gaussian Splatting?

4
Feature Requests / Re: Export model autonaming
« on: May 25, 2023, 11:49:18 AM »
I did not know that, tx, but still the chunk name, when you load a point cloud does not change I would love to have the mesh exported with the same exact thame the mesh has inside the chunk, which is the correct name derived from the source .las point cloud.

5
Bug Reports / Re: Cancel fbx model export--> freeze
« on: May 25, 2023, 11:38:46 AM »
I'll check like when I've a dead time like going to lunch be the time I killed the program the cancel attemp had been running like for 25minutes.

6
Bug Reports / Cancel fbx model export--> freeze
« on: May 24, 2023, 05:56:23 PM »
Hi,

If I accidentally export a very high face count model, like 23M into FBX and I cancel the save, it does not cancel the save it keeps going, not sure if it keeps saving or just stalls but it won´t cancel.


7
Feature Requests / Export model autonaming
« on: May 24, 2023, 05:54:59 PM »
Hi,

It would be very convenient if when exporting the mesh instead of blank name it had the same exact name that the mesh has inside the chunk.

Keep int mind that some of us are meshing point cloud scans that are already named so having the name already in place would be very convenient.

8
Hello,

I think there may be a bug since I'm trying to get the count of points in a .las file and I'm getting this error.

    points = point_cloud.points #collection of points
AttributeError: 'Metashape.Metashape.PointCloud' object has no attribute 'points'

that is what It is printed,

and poitn cloud is defined as 

point_cloud = chunk.point_cloud #current cloud

and is properly read since I get the logs on screen.

I checked the forums and the code seems corrrect, I checked python reference just in case this had changed, yet seems correct

"class PointCloud.Points
Collection of 3D points in the point cloud"

Could you please check?

version 2.01 build 16069

9
Bug Reports / Re: Build mesh face count stimations totally off
« on: May 11, 2023, 10:19:17 PM »
Hello,

It happens only to the generated mesh. The number of points is the same as the source file, see attached image.

I can upload a .las file for you to test. I tested with aerial and ground scanner just in case it was something specific of a dataset.

10
Texture De-Lighter / Re: tutorial where
« on: May 09, 2023, 03:51:21 PM »
Thanks!

11
Bug Reports / Build mesh face count stimations totally off
« on: May 09, 2023, 10:42:31 AM »
Hi,

When meshing a point cloud, the preset low, med, high, by the name have a face count stimate when building a mesh out of a point cloud (.las import).

This stimation is completelly off.

Lets say in low stimates are 2.5M, the outcome is 28M. And so on.

Also I've noticed this has worsen from 2.0 beta. Where medium would output a 10,5M and medium now outputs 56M mesh.

Also noticed that for same face count, input manually via "custom"  face count, the latest version seems a bit noisier than in beta, yet I've to say it captures better hard edges.

12
Hi.
I managed to do this using the UI, the ressults are fine, and operation is fast. Yet I was trying to automate such task but I'm having a hard time procesing a folder.

My idea is , I've low resolution meshes in one folder, hi res meshes in another folder. I manage to load the meshes but it seems like the hi res mesh is not loaded, yet I can read the vertex and face count of both in the log, may be not in the same chunk? I found no python reference like chunk.moveTo or similar.

Here is the code at the point I gave up.

Code: [Select]
import os
import Metashape

# Set the paths to the folders containing the low and high resolution meshes
low_res_folder = r'E:/LIDAR_JAPAN/MMS8_Prototype_3/MMS/03_RoadMesh/04_Texturing/01_DATA_SOURCE_POINT_CLOUDS/00_a_mesh_real_coords'
high_res_folder = r'E:/LIDAR_JAPAN/MMS8_Prototype_3/MMS/03_RoadMesh/04_Texturing/01_DATA_SOURCE_POINT_CLOUDS/03_Normals'

# Set the output folder for the normal map texture
output_folder = r'E:/LIDAR_JAPAN/MMS8_Prototype_3/MMS/03_RoadMesh/04_Texturing/02_Texture_Outputs/04_NORMAL'

# Get a list of all the files in the low resolution mesh folder
file_list = os.listdir(low_res_folder)

# Create a new document and chunk
doc = Metashape.Document()
chunk = doc.addChunk()

# loop through low res meshes
for file_name in file_list:
    # Import low res model
    low_res_file = os.path.join(low_res_folder, file_name)
    print("low_res_file path:", low_res_file)
    low_res_model = chunk.importModel(low_res_file)

    chunk.resetRegion()

    # Import high res model
    high_res_file = os.path.join(high_res_folder, file_name)
    print("high_res_file path:", high_res_file)
    high_res_model = chunk.importModel(high_res_file)

    if high_res_model is not None:
        high_res_model.move(chunk.model)

        chunk.resetRegion()

        chunk.addReference(high_res_model)

        # Generate the normal map texture
        chunk.buildTexture(texture_size=4096, texture_type=Metashape.Model.NormalMap)

        # Save the texture to the specified output folder
        texture_file = os.path.join(output_folder, os.path.splitext(file_name)[0] + "_normal_map.jpg")
        chunk.exportTexture(texture_file)

        # Print the type of the high res model after it's defined
        print(type(high_res_model))

        doc.remove(chunk)
        print("normal map bake for file = " + file_name)

    else:
        print("No high resolution mesh found for file:", file_name)

13
NEVERMIND...

I realized that python is only available in pro edition....

May be I can at least enable a 30 day trial and process the folder I was attemping to process.

14
Keeps happening, I slightly modified the script thinking that may be it was a output path issue but seems like not:


ExportModel: path = E:/LIDAR_JAPAN/MMS8_Prototype_3/MMS/03_RoadMesh/04_Texturing/01_DATA_SOURCE_POINT_CLOUDS/03_Normals/08OE2725.fbx, save_texture = off, save_colors = off, save_cameras = off, format = ModelFormatFBX, clip_to_boundary = off
Traceback (most recent call last):
  File "E:\LIDAR_JAPAN\MMS8_Prototype_3\zz_Batch_commands\MMS\04_e_NormalTexture_Mesh_Metashape.py", line 43, in <module>
    chunk.exportModel(mesh_file_path, format=Metashape.ModelFormatFBX, save_colors=False, save_texture=False, save_normals=True, save_confidence=False, save_cameras=False, clip_to_boundary=False, binary=True)
OSError: No license found

I've a quired a node locked license for the standard edition, rebooted yet same error.


Here slightly modifed script with export path on top, for convenience:

Code: [Select]
import Metashape, os

# Set the folder path containing the point clouds
point_cloud_folder_path = "E:/LIDAR_JAPAN/MMS8_Prototype_3/MMS/03_RoadMesh/04_Texturing/01_DATA_SOURCE_POINT_CLOUDS/00_color"

# Set the output folder for the exported meshes
export_folder_path = "E:/LIDAR_JAPAN/MMS8_Prototype_3/MMS/03_RoadMesh/04_Texturing/01_DATA_SOURCE_POINT_CLOUDS/03_Normals/"

# Create a new Metashape document
doc = Metashape.Document()

# Loop over each file in the folder
for file_name in os.listdir(point_cloud_folder_path):

    # Check if the file is a .ply file
    if file_name.lower().endswith(".ply"):

        print(" **********************************************  Processing " + file_name)

        # Create a new chunk for the current file
        chunk = doc.addChunk()

        # import all point clouds in the folder
        import_points = Metashape.Tasks.ImportPointCloud()
        import_points.path = point_cloud_folder_path + "/" + file_name
        import_points.format = Metashape.PointCloudFormatPLY
        import_points.apply(chunk)

        chunk.resetRegion()

        build_model = Metashape.Tasks.BuildModel()
        build_model.source_data = Metashape.DataSource.PointCloudData
        build_model.surface_type = Metashape.SurfaceType.Arbitrary
        build_model.face_count = Metashape.FaceCount.MediumFaceCount
        build_model.vertex_colors = False
        build_model.vertex_confidence = False
        build_model.interpolation = Metashape.Interpolation.Extrapolated
        build_model.apply(chunk)

        # Export the mesh as a .FBX file
        mesh_file_name = os.path.splitext(file_name)[0] + ".fbx"
        mesh_file_path = os.path.join(export_folder_path, mesh_file_name)
        chunk.exportModel(mesh_file_path, format=Metashape.ModelFormatFBX, save_colors=False, save_texture=False, save_normals=True, save_confidence=False, save_cameras=False, clip_to_boundary=False, binary=True)


        doc.remove(chunk)
        print("Processed " + file_name)

print("Script finished")




I0ve attached a very small .ply to make fast iterations, I had no luck tho, had to come here for help :\

https://drive.google.com/file/d/1w_c4h0UL_vH7B8D_FBvR2YePI9vx1gc4/view?usp=share_link

15
Hello Paulov,

I have modified your script, hopefully it works now.

Code: [Select]
import Metashape, os
clip_to_boundary=True

# Set the folder path containing the point clouds
point_cloud_folder_path = "E:/LIDAR_JAPAN/MMS8_Prototype_3/MMS/03_RoadMesh/04_Texturing/01_DATA_SOURCE_POINT_CLOUDS/00_color"

# Create a new Metashape document
doc = Metashape.Document()

# Loop over each file in the folder
for file_name in os.listdir(point_cloud_folder_path):

# Check if the file is a .ply file
if file_name.lower().endswith(".ply"):

# Create a new chunk for the current file
chunk = doc.addChunk()

# import all point clouds in the folder
import_points = Metashape.Tasks.ImportPointCloud()
import_points.path = point_cloud_folder_path + "/" + file_name
import_points.format = Metashape.PointCloudFormatPLY
import_points.apply(chunk)

chunk.resetRegion()

build_model = Metashape.Tasks.BuildModel()
build_model.source_data = Metashape.DataSource.PointCloudData
build_model.surface_type = Metashape.SurfaceType.Arbitrary
build_model.face_count = Metashape.FaceCount.MediumFaceCount
build_model.vertex_colors = False
build_model.vertex_confidence = False
build_model.interpolation = Metashape.Interpolation.Extrapolated
build_model.apply(chunk)

# Export the mesh as a .ply file
mesh_file_name = os.path.splitext(file_name)[0] + ".fbx"
chunk.exportModel(os.path.join(point_cloud_folder_path, mesh_file_name), format = Metashape.ModelFormatFBX, save_colors = False, save_texture = False, save_normals = True, save_confidence = False, save_cameras = False, clip_to_boundary = False, binary = True)

doc.remove(chunk)
print("Processed " + file_name)

print("Script finished")

If there's any error, let me know, what output is shown by the script.


After finishes processing the first file, it seems like it saves it but there is no .fbx file in the printed path, also, the loop does not work, only first file is procesed.

Also again "OSError: no license found " --> may be in trial mode can no be used command line?

done in 33.826 sec
mesh finalized in 196.98 s (4% input + 47% merge + 0% back merge + 1% other + 23% decimating):
41705561 input vertices (615076 ~ 1% merged), 82707672 faces -> decimated 82322626 faces  = final ratio x1.00468 (3755 divergent faces)
Peak memory used: 9.86 GB at 2023-05-05 18:58:41
deleting all temporary files...
done in 8.949 s
ExportModel: path = E:/LIDAR_JAPAN/MMS8_Prototype_3/MMS/03_RoadMesh/04_Texturing/01_DATA_SOURCE_POINT_CLOUDS/00_color\08OE2649.fbx, save_texture = off, save_colors = off, save_cameras = off, format = ModelFormatFBX, clip_to_boundary = off
Traceback (most recent call last):
  File "E:\LIDAR_JAPAN\MMS8_Prototype_3\zz_Batch_commands\MMS\04_e_NormalTexture_Mesh_Metashape.py", line 38, in <module>
    build_model.apply(chunk)
OSError: No license found

Pages: [1] 2 3