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 - sergio

Pages: [1] 2
1
Python and Java API / Get the document a chunk belongs to
« on: August 24, 2023, 12:47:27 PM »

I know this will sound a bit silly, but I'd like to know the document a certain chunk belongs to. I know that to get a chunk I must have got it but in my code, the document is actually not exposed in my scope.
I'm doing something like:

Code: [Select]

chunk = get_chunk_from_file(filename, chunk_type)

...
do some other stuff
...

It turns out that now I actually need a reference fo the Docuoment.

Any clues on this?

2
Python and Java API / Black texture when texturing imported model
« on: February 08, 2023, 05:05:31 AM »
Hi,

We are trying to texture an imported model in Metashape.

We import a PLY model using
Code: [Select]
chunk.importModel(transformed_filename, Metashape.ModelFormat.ModelFormatPLY)
We texture it using

Code: [Select]
chunk.buildUV(mapping_mode=Metashape.GenericMapping, page_count=1, texture_size = config.DEFAULT_TEX_SIZE*2)
chunk.buildTexture(blending_mode=Metashape.MosaicBlending, texture_size = config.DEFAULT_TEX_SIZE*2)

But the result is a dark gray color (there doesn't seem to be any error from Metashape's output)

Here, the DEFAULT_TEX_SIZE is 4096
The model has 56148 vertices and 112360 faces.

The model is correctly positioned in space it doesn't seem to be a positioning problem. Any clue on what's the problem here?

3
General / Re: Agisoft Metashape 2.0.0 pre-release
« on: January 12, 2023, 02:38:00 PM »
Please add links to older versions!!

We installed 2.0 and it broke our workflow scripts. There are no link to older installers (we use both 1.8.4 API and GUI).

4
General / [Urgent] Older installer
« on: January 12, 2023, 02:21:55 PM »

I've noticed that Metashape 2.0 is out. It breaks our workflow scripts (which are based in MS 1.8 python API). I was surprised to see that there is no link to older installers. Please provide them! People have systems based on older versions!

In our case, the new function names (exportPoints -> exportPointClouds, etc... ) break our functionality. We run scripts in several workstations and we cannot update right now.

I currently need a MacOS 1.8.4 installer, but we run machines on Linux and Windows, so we'd like installers to be available for other platforms too.

We use both the GUI and Python API

Please!!!

5
Thank you.

In our workflow we have 2 chunks
Your questions allowed me to understand where the problem was. In our workflow we make 2 alignments (with 2 chunks). We use the first one to compute camera parameters. We then undistort the images and compute a second alignment forcing a pinhole model. Therefore, in this chunk the camera parameters are fixed (I attach the screenshot).

I assume that if these parameters are zero and they are fixed, Metashape will not export them in the calibration or camera files?

This is the output xml calibration data:
Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<calibration>
  <projection>frame</projection>
  <width>2160</width>
  <height>3840</height>
  <f>2801.295081040385</f>
  <date>2022-12-15T02:18:21Z</date>
</calibration>

I am using Metashape 1.8.4 GUI and python API

6
Hi,

When I use
Code: [Select]
chunk.exportCameras I notice only the focal length is exported under the sensor element of the xml file  How to get the rest of the calibration parameters? (e.g. cx, cy, k1, etc...)
The same applies when I use
Code: [Select]
calibration.save().

I noticed that when I export from the GUI, all the parameters are written....

Best,

Sergio

7
General / Re: Get best matching photos
« on: December 05, 2022, 12:26:49 PM »
Thank you for you answer. I forgot to clarify that I'm looking for a solution using the Python API. Most of the time the GUI has the same functionality on python so I checked what you suggested. Unfortunately, for each image, the number of valid and invalid tiepoints is displayed, but what I need is the best image pairs...

8
General / Get best matching photos
« on: December 05, 2022, 03:02:36 AM »
As I understand, in the "AlignPhotos" step Metashape finds the best matching camera pairs (probably the ones the share the most SIFT points). Is it possible to get a list of these? e.g. For a given photo I'd like to have it's 10 best camera pairs (= the 10 photos that share the most SIFT points with that photo).

Is something similar to that possible in Metashape?


9
Python and Java API / Export .pts pointcloud with more decimals
« on: July 29, 2022, 10:47:24 AM »
Hi,

I'm exporting my sparse pointcloud (tie-points) with

Code: [Select]
chunk.exportPoints("/workspace/test_datasets/test_trainopts/project_files/points_dense.pts", source_data = ms.DataSource.PointCloudData)
My output file is

Code: [Select]
32610       
-0.210 0.224 -2.620 33 77 12 29
-0.240 0.193 -2.628 101 133 86 99
-0.086 0.246 -2.872 30 86 5 16
-0.178 0.210 -3.530 42 128 0 33
-0.597 0.087 -3.608 191 212 189 146
-0.514 0.079 -3.618 188 209 186 143
...

I'd like to have more decimal places in output file, but there is no option for that in the exportPoints function.
How would I go for that?

Best,

Sergio

10
Python and Java API / Re: Depthmaps are null after BuildDepthmaps
« on: July 12, 2022, 05:57:29 AM »
My mistake. I modified the poses, but not other objects (tie points, etc). Solution was to set the chunk's transform.

11
Python and Java API / Depthmaps are null after BuildDepthmaps
« on: July 11, 2022, 02:44:18 PM »

In our application we copy a chunk into another chunk, modify its poses, and then build the model on both. However, on the second chunk depthmaps appear to be null (but the model is built correctly on the original chunk). Why does this happen?

Code: [Select]

if chunk.depth_maps is None:
        print("Chunk has no depthmaps, computing with default values downscale=2, filter_mode=Metashape.AggressiveFiltering ")
        chunk.buildDepthMaps(downscale=2, filter_mode=Metashape.AggressiveFiltering)
        doc.save()

    chunk.buildModel(surface_type=Metashape.Arbitrary, source_data=Metashape.DepthMapsData, interpolation=Metashape.EnabledInterpolation)
   



12
Hi,

We use Docker containers as a core part of our workflow. We often deactivate an MS license on a container, and then reactivate on another container. But, what would happen if we activate a license on a container, and then remove it without deactivating the license first? Are we doomed? This would be a very complicated issue for our product.

Best,

Sergio

13
Hi,

In our application we are running Metashape tasks in a docker container.
I noticed that every time I stop and start the docker, I get a license error (wrong host for license), so I have to deactivate and reactivate it again. This is not a problem for testing, but it will be a problem when deploying our app. What's the best way of running a containerized application? Should I activate the license in the docker before running the application and then deactivate it after the application is done? I would prefer not to include the license number in the code. Also, if we use this option, we will not be able to run our tasks in parallel (license will be limited to one docker instance).

Any advice on this?

14
And this one is from the GUI
Code: [Select]
2021-07-15 11:04:47 LoadProject: path = /Users/sergiobromberg/Documents/RECON/Research/Data/Gray/ms_images_dense.psz
2021-07-15 11:04:47 Loading project...
2021-07-15 11:04:47 loaded project in 0.174483 sec
2021-07-15 11:04:47 Finished processing in 0.175545 sec (exit code 1)
2021-07-15 11:06:14 Finished processing in 0.012221 sec (exit code 1)
2021-07-15 11:06:56 Finished processing in 0.01292 sec (exit code 1)
2021-07-15 11:07:08 BuildModel: quality = Ultra high, depth filtering = Mild, PM version, source data = Dense cloud, surface type = Arbitrary, face count = Low, interpolation = Disabled, vertex colors = 0
2021-07-15 11:07:08 Generating mesh...
2021-07-15 11:07:08 grid size: 768x768x768
2021-07-15 11:07:08 block size: 256x256x256
2021-07-15 11:07:08 resolution: 0.0104193
2021-07-15 11:07:08 point count: 568172
2021-07-15 11:07:08 initializing... done in 0.168525 sec
2021-07-15 11:07:08 generating surface... done in 5.29774 sec
2021-07-15 11:07:13 generated 0 vertices, 0 faces
2021-07-15 11:07:13 Finished processing in 5.52177 sec (exit code 0)
2021-07-15 11:07:13 Error: Empty surface

15
Hello Alexei, this is my output when trying from the API:

Code: [Select]
ImportPoints: path = /workspace/data/Gray/ms_images_replaced_filtered_all.ply, format = PointsFormatPLY
Working in temporary directory /tmp/import_points.tmp.Zxj9b8
Importing point cloud in memory. Save project in .psx format for big file import.
Analyzing points...
processing 1715416 points...
Importing points...
processing 1715416 points...
Peak memory used: 74.77 MB at 2021-07-15 01:54:43
SaveProject: path = /workspace/data/Gray/ms_images_dense.psz
saved project in 0.700668 sec
BuildModel: source data = Dense cloud, surface type = Arbitrary, face count = High, interpolation = Enabled, vertex colors = 1
Grid size: 1148 x 1148 x 1148
Tree depth: 11
Tree set in 2.42821s (0 points)
Leaves/Nodes: 32768/37449
Traceback (most recent call last):
  File "/workspace/aseeo-research/depth_debug/metashape_build_from_pointcloud.py", line 63, in <module>
    chunk.buildModel(surface_type=Metashape.Arbitrary, source_data=Metashape.DenseCloudData, interpolation=Metashape.EnabledInterpolation)
Exception: Empty surface

Pages: [1] 2