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

Pages: [1] 2
1
 Hi,

I’m visualizing a file in Cesium ION, which was exported from Agisoft Metashape and subsequently uploaded to Cesium ION. The three-dimensional model uploaded appears to be levitating above the basemap in one instance (Mean Sea Level), while appearing to be submerged in another basemap (Cesium World Terrain).[Attached images below]

I am curious as to why this is occurring. What coordinate reference system (CRS) should I export the file from Metashape in order to align with the appropriate level? I would prefer to avoid having to manually adjust the location of each tileset I upload.

Are there any other settings that need to be made while exporting or processing the 3D mesh from the Metashape? Does metashape have any ground clamping options?

I have seen other similar posts in this community but they have not been answered yet.

2
General / Need Assistance for Agisoft Processing Hardware
« on: December 29, 2021, 12:59:45 PM »
I need to assemble CPU parts for building a desktop PC to process Agisoft Images.

System Requirements (https://www.agisoft.com/downloads/system-requirements/)

In the above page, it says for Advanced Configuration I need:

Quote
up to 128 GB RAM

CPU: 6 - 24 core Intel or AMD processor, 3.0+ GHz

RAM: 32 - 128 GB

GPU: 1 - 2 NVIDIA or AMD GPUs with 1920+ CUDA cores / shader processor units
(For example: GeForce RTX 2080 Ti or Radeon VII)

I need to process several datasets with an image count ranging from 100 to 4000 (5000 sometimes).

For the same, I was thinking 128 GB RAM and a CPU with 24+ or 32 cores (Intel or AMD anything is fine) processor.

But which company RAM and model of CPU will be suitable (and compatible)?

I am not sure about GPU either.

Also, I am not sure which Motherboard will be compatible with all these so that there are no performance and bottleneck issues.

Please guide me with any information that you can that can help me purchase these items.

3
Python and Java API / Re: Extract the tie point positions (u and v)
« on: July 03, 2021, 04:59:34 PM »
Hi Alexey,

Yes, that is exactly what I am looking for. Currently, it just prints the 2D coordinates on one of the images. But I need it for user-defined pair of cameras OR whatever images have been matched by the Agisoft. (Those that get aligned in the Align Photos and Match photos steps)

Regards,
Ayush

4
Python and Java API / Re: Extract the tie point positions (u and v)
« on: July 02, 2021, 03:25:28 PM »
Hi Alexey,

On the same lines, is it possible to find from and to of those track_id(s)? Like from which camera is the track started, and on which camera it ended, a particular track started and which camera(image) the track ended, the positions(x  and y coordinates) on the source and destination cameras(images). Just like how we are able to visualize on view matches. Attached image of the same.

Is there a code to get that?

Thanks,
Ayush


5
Bug Reports / Re: Using Photoscan remotely using a VNC client
« on: May 24, 2021, 01:33:53 PM »
Hi Alexey,

Any updates on using GUI of Metashape in Amazon Linux EC2 instance with CENTOS 7 installed.
I have a GUI using tigerVNC, but I get the above-mentioned error messages.

6
Bug Reports / Re: Using Photoscan remotely using a VNC client
« on: May 21, 2021, 08:03:28 AM »
Hi Alexey,

As I have told you earlier, I am running the Metashape on an Amazon Linux EC2 instance with CentOS 7, with no GUI by default, for which I installed the tigervnc (https://tigervnc.org/) to get the GUI, and I only have yum and rpm, not apt.

Also, I was able to install the libxcb-icccm4 using rpm, but now there is a new dependency libxcb-image.so.0, that in turn has lots of other pre-requisites(that need to be installed before installing the former dependency). While I have libgc package installed from amazon-linux-extras(something similar to yum but native to amazon linux instance), it conflicts with the missing dependency packages(those not from amazon-linux-extras) that I install on the machine. So, my question is that, does it have anything to do with QT5? Or any other way around it to run the GUI on the machine.

 The output for the requested command is:

Code: [Select]
QFactoryLoader::QFactoryLoader() checking directory path "/home/ec2-user/metashape-pro/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/home/ec2-user/metashape-pro/plugins/platforms/libqoffscreen.so"
Found metadata in lib /home/ec2-user/metashape-pro/plugins/platforms/libqoffscreen.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "offscreen"
        ]
    },
    "archreq": 0,
    "className": "QOffscreenIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() looking at "/home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so"
Found metadata in lib /home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "xcb"
        ]
    },
    "archreq": 0,
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/home/ec2-user/metashape-pro/platforms" ...
Cannot load library /home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so: (libxcb-image.so.0: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so" : "Cannot load library /home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so: (libxcb-image.so.0: cannot open shared object file: No such file or directory)"
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: offscreen, xcb.

./metashape.sh: line 19:  8760 Aborted                 "$dirname/$appname" "$@"


7
Bug Reports / Re: Using Photoscan remotely using a VNC client
« on: May 20, 2021, 09:08:17 AM »
Hi Alexey,

I am running Metashape 1.7.2 on Amazon Linux EC2 machine with VNC(TigerVNC to be exact). I followed your last reply steps. This is the response that I got after running 'cat /etc/X11/xorg.conf'

Code: [Select]
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 450.119.03

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "Files"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from data in "/etc/sysconfig/keyboard"
    Identifier     "Keyboard0"
    Driver         "kbd"
    Option         "XkbLayout" "us"
    Option         "XkbModel" "pc105"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "Tesla T4"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "UseDisplayDevice" "None"
    SubSection     "Display"
        Virtual     1280 1024
        Depth       24
    EndSubSection
EndSection


I am unable to open Metashape GUI in the system.
When I run below command, I get the following output

Code: [Select]
[ec2-user@ip-x.x.x.x metashape-pro]$ QT_DEBUG_PLUGINS=1 ./metashape.sh
QFactoryLoader::QFactoryLoader() checking directory path "/home/ec2-user/metashape-pro/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/home/ec2-user/metashape-pro/plugins/platforms/libqoffscreen.so"
Found metadata in lib /home/ec2-user/metashape-pro/plugins/platforms/libqoffscreen.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "offscreen"
        ]
    },
    "archreq": 0,
    "className": "QOffscreenIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() looking at "/home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so"
Found metadata in lib /home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so, metadata=
{
    "IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
    "MetaData": {
        "Keys": [
            "xcb"
        ]
    },
    "archreq": 0,
    "className": "QXcbIntegrationPlugin",
    "debug": false,
    "version": 331520
}


Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/home/ec2-user/metashape-pro/platforms" ...
Cannot load library /home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so: (libxcb-icccm.so.4: cannot open shared object file: No such file or directory)
QLibraryPrivate::loadPlugin failed on "/home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so" : "Cannot load library /home/ec2-user/metashape-pro/plugins/platforms/libqxcb.so: (libxcb-icccm.so.4: cannot open shared object file: No such file or directory)"
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: offscreen, xcb.

./metashape.sh: line 19:  2432 Aborted                 "$dirname/$appname" "$@"


Can you tell how do I install missing packages, if any?
I can only use RPM and yum to install the packages.

8
Hi Alexey,
Firstly, Thanks for the quick replies.

When I open the psx file in agisoft UI, it shows something like this

(image1.png) https://drive.google.com/file/d/1osAxn-shuCa9WuJnAJXnLT5fB-jLmaX-/view

I just know that it represents a RGB image with Elevation data(ignore the contours).

Now when I simply export this using the below scripts, it exports and looks like this((image2.png) https://drive.google.com/file/d/128SxTGwC1qVOuAyHY_4X2oL4AO4ASuA2/view?usp=sharing) in QGIS.

Script:
Code: [Select]
chunk.exportRaster(
                path=export_path + 'dsm.tif',
                format=Metashape.RasterFormatTiles,
                image_format=Metashape.ImageFormat.ImageFormatTIFF,
                projection=projection,
                save_world=True,
                save_alpha=True,
                image_description='DSM',
                white_background=True,
                save_kml=True,
                source_data=Metashape.DataSource.ElevationData
            )

As per your reply,

Hello darkl1ght,

32-bit TIFF with the elevation data is a single-channel raster where each pixel contains a floating point corresponding to the elevation. It is not a grayscale image, the visual color representation should be adjusted in the application that you are using to view the file.



Then why it is not RGB and is in two colors as can be seen from QGIS screenshot(image2.png)

Now, when I export it using raster transform, by applying palette transform,

I get below image which is RGB, but does not contain elevation information as evident from screenshot (image3.png)https://drive.google.com/file/d/1qtVeAnQ8NOLbamBHJqqykG2lDsAbOmQN/view?usp=sharing

For images 2 and 3, I have just opened them in QGIS, no modifications made whatsoever.

Image 2 is 32-bit Float.

Image 3 is 8-bit RGB image


Hello darkl1ght,

Do you mean that you need to export DEM as four channel TIFF file with RGB channels and elevation data in the fourth channel?
-->  I dont know if that is possible or not, but it can be seen in Image1, Agisoft UI has RGB + elevation data.

Do you have any example of data in such representation? Unless I am mistaken, TIFF format doesn't allow to have different data types for the channels in the same file, therefore all four bands in such case should be either 8-bit or 32-bit. And I have some doubts that 8-bit float would allow to save the elevation values with proper grade of accuracy.
-->I am not that expert in image processing, so I don't know if I can answer that. Its okay if TIFF does not allow that to happen, but is there any other way to export the DEM that allows it?



Also, if nothing works out here, I need an output from Agisoft that can give me elevation data of DEM model, that can be successfully uploaded to MAPBOX to access elevation data. Would appreciate any help/guidance in that direction as well.

Thanks,
darkl1ght

9
HI Alexey,

This does not answer my main question. Can I get an exported TIFF file that is 8-bit and a different color palette along with elevation data?

10
Hi Alexey,

I was trying to export a DEM file using the script below

Code: [Select]
chunk.exportRaster(
                path=export_path + 'dsm.tif',
                format=Metashape.RasterFormatTiles,
                image_format=Metashape.ImageFormat.ImageFormatTIFF,
                projection=projection,
                save_world=True,
                save_alpha=True,
                image_description='DSM',
                white_background=True,
                save_kml=True,
                source_data=Metashape.DataSource.ElevationData
            )

This gives me a tiff file with 32 bit floating type, and good thing is it gives me elevation data(verified from the QGIS). But It cant be uploaded to MAPBOX since MAPBOX supports a 8-bit GeoTIFF file. Also, why has it been grayscale?(It looks bad)

So I tried to raster transform it using palette raster transform using below script:

Code: [Select]
chunk.exportRaster(
                path=export_path + 'dsm.tif',
                raster_transform=Metashape.RasterTransformType.RasterTransformPalette,  #modification here
                format=Metashape.RasterFormatTiles,
                image_format=Metashape.ImageFormat.ImageFormatTIFF,
                projection=projection,
                save_world=True,
                save_alpha=True,
                image_description='DSM',
                white_background=True,
                save_kml=True,
                source_data=Metashape.DataSource.ElevationData
            )

This gives me a raster file with 8-bit unsigned integer data type with a color palette exactly similar to Agisoft GUI, but it does not contain any elevation data(verified from the QGIS).

Is there a way I can get a 8-bit GeoTIFF file with elevation data and the default color palette of Agisoft GUI, not grayscale?

Thanks,
darkl1ght

11
Hi Alexey,

Thanks for your reply. It is the solution for my issue.

Regards,
darkl1ght

12
Hi,

The error that I get when I perform directly step5, step4, step3, step2 respectively without performing the prev steps(eg for step5, directly perform step5 ie without performing steps 1,2,3,4) in the current execution are as follows:

Code: [Select]
2020-11-04T22:12:04.586 +0530 INFO  [init_doc.py: 82] ****************************************************************************************************
2020-11-04T22:12:04.586 +0530 INFO  [init_doc.py: 83] logger initiated
2020-11-04T22:12:04.586 +0530 INFO  [init_doc.py:436] Options: {'projectName': 'attur', 'geoProjection': 'EPSG::32643', 'exportRaster': 'true',[b] 'lastStep': '5'[/b]}
2020-11-04T22:12:04.586 +0530 INFO  [init_doc.py:437] Processing started
2020-11-04T22:12:04.587 +0530 INFO  [init_doc.py:462] Opening existing file: /home/mapboxuser/projects/attur/attur/main_file.psx
2020-11-04T22:12:04.787 +0530 INFO  [init_doc.py: 89] Retrieve/Add Chunk
2020-11-04T22:12:04.843 +0530 INFO  [init_doc.py:100] Adding Chunk Completed
2020-11-04T22:12:04.844 +0530 INFO  [init_doc.py:396] Raster Extraction Started
2020-11-04T22:12:05.045 +0530 ERROR [init_doc.py:413] Error while exporting Orthomosaic. Error: Null orthomosaic
2020-11-04T22:12:19.580 +0530 INFO  [init_doc.py: 82] ****************************************************************************************************
2020-11-04T22:12:19.580 +0530 INFO  [init_doc.py: 83] logger initiated
2020-11-04T22:12:19.580 +0530 INFO  [init_doc.py:436] Options: {'projectName': 'attur', 'geoProjection': 'EPSG::32643', [b]'lastStep': '4'[/b], 'exportRaster': 'true'}
2020-11-04T22:12:19.580 +0530 INFO  [init_doc.py:437] Processing started
2020-11-04T22:12:19.581 +0530 INFO  [init_doc.py:462] Opening existing file: /home/mapboxuser/projects/attur/attur/main_file.psx
2020-11-04T22:12:19.781 +0530 INFO  [init_doc.py: 89] Retrieve/Add Chunk
2020-11-04T22:12:19.835 +0530 INFO  [init_doc.py:100] Adding Chunk Completed
2020-11-04T22:12:19.836 +0530 INFO  [init_doc.py:358] step5 started
2020-11-04T22:12:19.836 +0530 INFO  [init_doc.py:360] building orthomosaic started
2020-11-04T22:12:20.037 +0530 ERROR [init_doc.py:368] Error in Build Depth Maps Step Null elevation
Traceback (most recent call last):
  File "init_doc.py", line 364, in begin_image_processing
    projection=projection
Exception: Null elevation
2020-11-04T22:12:24.085 +0530 INFO  [init_doc.py: 82] ****************************************************************************************************
2020-11-04T22:12:24.085 +0530 INFO  [init_doc.py: 83] logger initiated
2020-11-04T22:12:24.086 +0530 INFO  [init_doc.py:436] Options: {'exportRaster': 'true', 'geoProjection': 'EPSG::32643', 'projectName': 'attur', [b]'lastStep': '3'[/b]}
2020-11-04T22:12:24.086 +0530 INFO  [init_doc.py:437] Processing started
2020-11-04T22:12:24.086 +0530 INFO  [init_doc.py:462] Opening existing file: /home/mapboxuser/projects/attur/attur/main_file.psx
2020-11-04T22:12:24.286 +0530 INFO  [init_doc.py: 89] Retrieve/Add Chunk
2020-11-04T22:12:24.340 +0530 INFO  [init_doc.py:100] Adding Chunk Completed
2020-11-04T22:12:24.341 +0530 INFO  [init_doc.py:339] step4 started
2020-11-04T22:12:24.341 +0530 INFO  [init_doc.py:341] building DEM started
2020-11-04T22:12:24.542 +0530 ERROR [init_doc.py:348] Error in Build DEM Step Null dense cloud
Traceback (most recent call last):
  File "init_doc.py", line 344, in begin_image_processing
    projection=projection
Exception: Null dense cloud
2020-11-04T22:12:28.030 +0530 INFO  [init_doc.py: 82] ****************************************************************************************************
2020-11-04T22:12:28.030 +0530 INFO  [init_doc.py: 83] logger initiated
2020-11-04T22:12:28.030 +0530 INFO  [init_doc.py:436] Options: {[b]'lastStep': '2'[/b], 'geoProjection': 'EPSG::32643', 'projectName': 'attur', 'exportRaster': 'true'}
2020-11-04T22:12:28.030 +0530 INFO  [init_doc.py:437] Processing started
2020-11-04T22:12:28.030 +0530 INFO  [init_doc.py:462] Opening existing file: /home/mapboxuser/projects/attur/attur/main_file.psx
2020-11-04T22:12:28.231 +0530 INFO  [init_doc.py: 89] Retrieve/Add Chunk
2020-11-04T22:12:28.285 +0530 INFO  [init_doc.py:100] Adding Chunk Completed
2020-11-04T22:12:28.286 +0530 INFO  [init_doc.py:308] step3 started
2020-11-04T22:12:28.286 +0530 INFO  [init_doc.py:310] building depthmaps started
2020-11-04T22:12:28.487 +0530 ERROR [init_doc.py:318] Error in Build Depth Maps Step Empty region
Traceback (most recent call last):
  File "init_doc.py", line 314, in begin_image_processing
    reuse_depth=reuse_depth
Exception: Empty region


In the above logs, that are logged in a file by python logger, I have provided script parameters like this

Code: [Select]
/home/mapboxuser/Downloads/metashape-pro/metashape.sh -r init_doc.py --projectName attur --geoProjection EPSG::32643 --exportRaster true [b]--lastStep 2[/b]
The --lastStep parameter decides from which step should this process run. the previous steps are skipped. They are skipped because they have already been run and I want to run from next step, from last run step in previous process.

Why am I getting each of these errors? Is there a way to avoid these errors?

Thanks in advance

13
Hi,

I am writing scripts to complete the work flow (from building several elements like alignment(step1), matching(step2), building DEM(step3), Dense Cloud(step4), Orthomosaic(step5) and finally Tiled Model(step6), and then exporting the Raster File from saved file). I am using Python API version 1.6.5.

My goal is to implement it in such a way, that if for example it fails in step3, then on the next run of the script, since step1 and step2 is already completed, and I am using the previous chunk in the next run, it should start directly from step3 again. This I am trying to implement(still in progress). Any suggestions or points to be taken care of during this?

Now, the main issue that I am facing is,

When I have completed all the steps,I am trying to export Raster File(earlier Orthomosaic), from a pre-saved .psx extension file. I am running a script just to open the file in Metashape Python API and export the Raster File, without performing any other step of processing(that have been already performed and saved in main_file.psx file).

I have tried exporting in the below testing_argument.py file , but it gives error:

Code: [Select]
#!/usr/bin/python3
import sys
import Metashape
import os
from pathlib import Path

current_path = os.getcwd()
parent_path = str(Path(current_path).parent)
save_path = ''
project_name = ''


def main():

    project_folder_name = 'project2'
    # save path
    save_path = parent_path + '/projects/' \
        + project_folder_name + '/' \
        + project_folder_name
    # + '_' \
    # + start_time

    # creating save directory
    os.makedirs(name=save_path, exist_ok=True)

    global project_name
    project_name = 'main_file.psx'

    # creating document
    doc = Metashape.Document()

    # epsg_code
    epsg_code = 'EPSG::32643'

    doc.open(path=save_path + '/' + project_name)

    # adding chunk
    chunk = Metashape.Chunk
    chunk = doc.chunk

    # adding co-ordinate reference system
    # chunk.crs = Metashape.CoordinateSystem(epsg_code)
    raster_compression = Metashape.ImageCompression()
    raster_compression.tiff_compression = Metashape. \
        ImageCompression.TiffCompressionJPEG
    raster_compression.jpeg_quality = 90
    raster_compression.tiff_big = True

    # projection
    projection = Metashape.OrthoProjection()
    projection.crs = Metashape.CoordinateSystem(epsg_code)

    chunk.exportRaster(
        path=parent_path + '/projects/'
        + project_folder_name + '/' + 'export/' + 'orthophoto.tif',
        format=Metashape.RasterFormatTiles,
        image_format=Metashape.ImageFormat.ImageFormatTIFF,
        projection=projection,
        save_world=True,
        save_alpha=True,
        image_description='Orthophoto',
        image_compression=raster_compression,
        white_background=True,
        save_kml=False,
    )

    doc.save(path=save_path + '/' + project_name, chunks=[chunk])

    return


main()

Error:

Code: [Select]
LoadProject: path = /home/xxxx/projects/project2/project2/main_file.psx
loaded project in 0.000677 sec
Traceback (most recent call last):
  File "testing_arguments.py", line 74, in <module>
    main()
  File "testing_arguments.py", line 55, in main
    chunk.exportRaster(
AttributeError: 'NoneType' object has no attribute 'exportRaster'

What am I doing wrong? Or what I am doing is not possible, since this same thing can be done in UI, wherein we can load the project into the Metashape UI application and then export any data we want from the
chunk>(Right click)> Export xyz option


Please let me know if any more information is needed from my end. Waiting for the response.

Thanks,
Ayush

14
Python and Java API / Re: Python scripts stopped working in 1.6
« on: November 02, 2020, 11:44:29 AM »
Hi Alexey,

Where can we get the reference for this downscale values for similar other parameters?

It's not present there in the python API documentation(version 1.6.x).

Thanks

15
General / Re: Blending Modes for generating orthomosaics
« on: November 02, 2020, 09:59:47 AM »
Hi,

Any updates on this?

Pages: [1] 2