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

Pages: [1]
1
General / Re: How to project feature pixel-annotation to orthomosaic
« on: January 19, 2021, 04:12:31 PM »
Hi,
nope i think it is not possible with Metashape. However mathematically speaking it should be possible.

For the calculation you will need the estimated pose of the camera and the DEM that was used for orthomosaic creation.  Then for each pixel-feature you need to perform the inverse operation of orthorectification. That will involve raycasting from the pixels of the image you want to project to the DEM and based on that select pixel-features on the orthomosaic.

As an approximation you could use gdalwarp which just does reprojection no raycasting if you have flat terrain.


2
Ok, thanks again!

3
Hello Alexey,
thanks you pointed the right direction!

The DEM was not set as Default therefore not active when the project is opened although it is the only DEM in the project. For that project i managed fix the issue by opening the GUI and selecting the DEM as Default in the Context Menu.

Is there an option to do this programatically?

4
Python and Java API / exportRaster DEM Export fails with NullException
« on: January 13, 2021, 02:55:50 PM »
Hello folks,
i'm using a script to export DEM from a number of projects. It worked flawlessly for a few projects and in one project it produces an Exception. I'm running Metashape on 1.7.0 11736.
What could be the problem? Export works from the GUI.

Code: [Select]

utm_NRW = Metashape.CoordinateSystem("EPSG::25832")
projection = Metashape.OrthoProjection()
projection.crs = utm_NRW

chunk.exportRaster(
        source_data=Metashape.ElevationData,
        path="G:/THS-data/data-processing/1-6/out/data/dsm.tif",
        projection=projection,
        image_format=Metashape.ImageFormatTIFF,
        resolution_x=0.01,
        resolution_y=0.01,
        white_background=False,
        clip_to_boundary=False,
        save_alpha=False,
        save_scheme=True)


Log:

ExportRaster: clip_to_boundary = off, image_format = TIFF, path = G:/THS-data/data-processing/1-6/out/data/dsm.tif, projection = ETRS89 / UTM zone 32N, resolution_x = 0.01, resolution_y = 0.01, save_alpha =
off, save_scheme = on, source_data = Elevation, white_background = off
Traceback (most recent call last):
  File "export-data.py", line 95, in <module>
    exportDataFromProject(project_file.as_posix())
  File "export-data.py", line 86, in exportDataFromProject
    exportDataRaster(chunk, export_location,
  File "export-data.py", line 48, in exportDataRaster
    chunk.exportRaster(
Exception: Null elevation


DEM Details
Size   14,475 x 18,681
Coordinate system   WGS 84 (EPSG::4326)
Reconstruction parameters   
Source data   Dense cloud
Interpolation   Enabled
Processing time   1 minutes 50 seconds
Memory usage   365.99 MB
Software version   1.6.1.10009
File size   381.68 MB

5
Python and Java API / Re: Red Text in Console
« on: January 13, 2021, 02:39:58 PM »

6
Yes, JamesPatrick is right. The pixel-wise annotations consist of a second image with the same dimensions. The pixel values are used to encode information e.g. which type of land is this pixel? building, water, road,...

I'm working on the classification of areas in grasslands.

One use case i can think of is the validation of annotations on orthomosaic. The shape of the annotated area is what i want to validate. I would be able to annotate images taken on the ground align the images and project them on the orthoplan. Then i can layer the ground image annotation with the annotation from the orthomosaic to see where errors were made.

7
General / How to project feature pixel-annotation to orthomosaic
« on: June 22, 2020, 07:11:12 PM »
Hi,
the raw images that were input to Metashape have corresponding pixel-wise feature annotations to classify regions of the image. The raw images were processed to orthophotos.

Is it somehow possible to project the annotations using the same projection as the original images use such that the pixels align?

Furthermore, is it possible to do it the other way around i.e. the orthophoto is annotated and then project to the original image?

Pages: [1]