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

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

About error "undefined symbol: __gmpz_limbs_write":

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

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

About Java API:

3) Basically there are everything the same, you can see that in there are 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 - ( was renamed to - 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/'

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 - (but "How to install" requires some efforts)

You can try to mask a newspaper (to align all photos in single chunk) with just a couple of masks like shown here -

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 -

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).

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

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.

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)

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)

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 -

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

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).

Python and Java API / Re: align model to 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.

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]
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()
del chunk.depth_maps[camera]
chunk.depth_maps[camera] = depth_map

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

But and 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