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

Pages: [1] 2 3 ... 5
1
Python and Java API / Re: JAVA API compared to GUI
« on: Today at 01:10:24 PM »
Hi, how do you measure processing timings for Java API?

Maybe 23 seconds - including JVM initialization + library classes loading + metashape native libraries (.so) loading?

If you will do the same processing but ten times in for-loop, what time will it take? 23*10 seconds or 23+3*9 seconds?

2
General / Re: Metashape Java API running on UBUNTU
« on: September 07, 2022, 12:06:32 PM »
Hi,

About libgmp.10.so error "undefined symbol: __gmpz_limbs_write":

1) It can be fixed like you described with deletion of libgmp.10.so, in fact in Metashape 1.8.4 it is so by default - this file was renamed to libgmp.10.so.compat, so that it is ignored (but can be manually renamed back to libgmp.10.so to be used again - it is useful on old Linux distributions with old system libgmp.10.so)

2) Alternatively it can be fixed with forced pre-loading of system libgmp.10.so before Metashape launch - then Metashape will ignore its bundled libgmp.10.so even if it is presented with such name in metashape/lib. You can do it with LD_PRELOAD='/usr/lib/x86_64-linux-gnu/libgmp.so.10' /path/to/metashape.sh

About Java API:

3) Basically there are everything the same, you can see that in metashape-java-api-1.8.4.zip there are libgmp.so.10.compat in metashape-java-api-1.8.4/jniLibs/linux64/, so if you use official Java API library - everything should work

4) It seems that this change was properly adapted by maven artifact mantainer - https://github.com/jseinturier/metashape-java-maven/commit/d114ea49bf3c09efdc4be1a71e9226d7b11946b2#diff-9f4fb1e1e4ca8b6aa4584334671cb5b949abfc96114847d57383e2c04f0502a6 (libgmp.10.so was renamed to libgmp.10.so.compat) - so may be you use old artifact?

5) Also you can workaround this problem for older versions by launching your java application (for GUI version it works too) with environment variable that will force loading of system libgmp: LD_PRELOAD='/usr/lib/x86_64-linux-gnu/libgmp.so.10'

3
General / Re: when using mesh from depth maps deleted areas reappear
« on: August 12, 2022, 04:59:06 PM »
Also if you are using Metashape Pro - you can try to use this AI-driven script - https://github.com/agisoft-llc/metashape-scripts/blob/master/src/automatic_masking.py (but "How to install" requires some efforts)

4
You can try to mask a newspaper (to align all photos in single chunk) with just a couple of masks like shown here - https://agisoft.freshdesk.com/support/solutions/articles/31000158967-aligning-photos-with-background-suppression-from-single-mask

Or in two passes - generate target model in each of two chunks - delete background triangles (a newspaper) - generate masks from model. After that you will have good masks for all images that will make possible processing of all photos in a single chunk - https://agisoft.freshdesk.com/support/solutions/articles/31000163388-automatic-masking-from-the-model

5
General / Re: when using mesh from depth maps deleted areas reappear
« on: August 12, 2022, 11:34:41 AM »
Also you can try to delete unwanted triangles from built model directly (using Free-Form Selection for example).

6
Python and Java API / Re: Error Window 'matching'
« on: August 11, 2022, 12:15:40 PM »
Have you checked console output?

7
General / Re: HDD vs SSD - data processing time
« on: August 05, 2022, 10:39:08 AM »
First of all - it is not important where Metashape itself is installed.

It is important where photos and projects files are located. So photos importing was faster thanks to photos located on SSD - Metashape was able to read them one by one much faster than from HDD. And yes, SSD for data storage should lead to faster processing.

8
General / Re: Problems aligning big Dataset in one aligment
« on: August 05, 2022, 10:31:36 AM »
What parameters did you use for alignment in one processing? (you can just click on Tie Points of that attempt and make a screenshot - parameters of alignment will be shown in bottom left corner)

9
General / Re: mesh generation extremely low cpu and gpu usage
« on: August 04, 2022, 11:54:55 AM »
Hi, like you said - it seems to be Input/Ouput-bound (i.e. IO is slow - see also 98% IO in logs). Can you transfer your project from external drive (WB My Book) to local internal disk for processing? (to SSD ideally)

10
General / Re: multi camera system approach for RGB + thermal sensor
« on: July 08, 2022, 12:21:27 PM »
You can't just replace images with images of another resolution (even of the same aspect ratio) because camera alignment includes camera internal parameters calibration and they are dependent on image resolution (and camera FOV, camera distortions and so on).

But I agree with Paulo that you can still reuse camera position and orientation (it will not be very accurate, but probably ok) if cameras were close to each other + were looking in the same direction + both cameras were taken photos at the same time. This script seems to do what you want - https://github.com/agisoft-llc/metashape-scripts/blob/master/src/transfer_orientation.py

11
Python and Java API / Re: align model to model.py without GUI
« on: May 17, 2022, 05:27:11 PM »
Yes, looks like the simplest way.

12
General / Re: Export Cameras Parameters like Colmap
« on: May 17, 2022, 04:49:51 PM »
I think you can follow this script - it parses Agisoft's xml file to pass cameras calibrations into NVIDIA's instant-ngp (NERF) which originally was using Colmap calibrations as input (so its purpose is very close to your request).

13
Python and Java API / Re: align model to model.py without GUI
« on: May 17, 2022, 12:55:59 PM »
Hi, these asserts check that input point clouds (arguments for align_two_point_clouds function) are numpy arrays. You called that function with chunk.models[-1] - which is not a numpy array.

In original script conversion from Metashape's project model representation to numpy array type is implemented via export to ply file and reading it as numpy array.

14
Python and Java API / Re: DepthMap setImage not working
« on: April 13, 2022, 06:05:12 PM »
Hi, removing depth map and then setting it worked for me:

Code: [Select]
ddata = numpy array of depth values in local CS as float32
DM = Metashape.Image.fromstring(ddata.tostring(), ddata.shape[1], ddata.shape[0], ' ', 'F32')
depth_map = chunk.depth_maps[camera]
depth_map.setImage(DM)
del chunk.depth_maps[camera]
chunk.depth_maps[camera] = depth_map

P.S. also please note that setImage has a level argument which is equal to zero by default, but there can be multiple levels (typically three), so maybe it is better to create a fresh one:

Code: [Select]
ddata = numpy array of depth values in local CS as float32
DM = Metashape.Image.fromstring(ddata.tostring(), ddata.shape[1], ddata.shape[0], ' ', 'F32')
depth_map = Metashape.DepthMap()
depth_map.setCalibration(chunk.depth_maps[camera].getCalibration())
depth_map.setImage(DM)
del chunk.depth_maps[camera]
chunk.depth_maps[camera] = depth_map

15
Hi, Python has GIL - Global Interpreter Lock, so python code itself always run on a single core at a time.

But footprints_to_shapes.py and automatic_masking.py runs faster because while their python-part code is still runs on a single CPU core at a time - C++-part of code takes major part of their execution time and can be executed on multiple CPU cores.

For example inside of these calls of project/pickPoint and inside of these calls of image processing operations inside of scipy (they are also written in C++) executions moves from Python-part of code to C++-part of code. And so these calls release Python's GIL at their start and makes multi-core execution possible. They still fallbacks to single-core execution after that, because when they returns to Python-part of code - it is required to acquire GIL back again.

Pages: [1] 2 3 ... 5