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 - Jordan Pierce

Pages: [1] 2
1
For future reference, if someone is looking for orthomosaic resolution calculated automatically, you can read it from the report: it's calculated and written there. You just need to scrape the resolution value using a PDF scraper  :o

2
General / Re: Georeferenced planar orthomosaic (fasade)
« on: March 28, 2023, 12:43:59 AM »
Heelo flogs,

Thanks for the explanation, now I  better understand your needs .. Yes a script could be developped so that for each 2 markers set at base of a building façade, a vertical planar projection is done with the local y set to absolute Z amsl so that each side willl have same height reference... in example a building is shown and for 2 façades (defined each by 2 markers( a relevant planar vertical projection is built. Note each planar ortho has same Z reference as seen by picking top of house and getting Z aMSL (Local Y in ortho CS) equal to 656.4 m...The model is not great so excuse he imperfections, but I think it gives you an idea,

So if you need more explanatio, please PM me,

Yes, that's it. Very common surveying task. I don't need more explation. I know what I want. And now you know what I want. :) The only question remains if it is worth for me to go for python script or maybe there can be some utilization of the software as Alexey sort of suggested (if I felt it right). I will PM you not to bother others here. Thanks very much!

UPDATE: Paulo suggested to create a paid script for this. I am not interested in that. I originally looked for an already existing solution in Metashape. It seems the software has not any right now. So I continue with tweaking it differently or I will find time to solve it myself. Thanks.

In short, for everyone who wants what I want. You have to remove markers projections and edit coordinates of 3 markers in order to create an orthomosaic. Horizontal markers has to be strictly horizontal and verical markers strictly vertical (strictly right angle between markers not required). Aftewards it works pretty well. And then in CAD you have to move the picture to desired absolute height. Not so complicated but maybe still not easy to figure out rigth away for most surveyors.

Hi Flogs, were you able to create a script for generating an orthomosaic that is georeferenced, but in a planar view?

Jordan

3
Python and Java API / Overloading PointClass to have custom values
« on: February 17, 2023, 09:56:05 PM »
@Alexey and @paulo is there a way to add custom classes to Metashape.PointClass though the Python API? Is there a definition of these classes in a Python script somewhere within the Metashape applications folder?

4
Python and Java API / Re: Algorithm of pickPoint Function
« on: February 01, 2023, 01:12:36 AM »
Would also be interested in this.

5
How could one import a dense cloud as a .ply (or other file format) into metashape using the python api with confidence values included? Essentially a custom dense cloud is being made and I would like to tack on "confidence values" so they can be filtered using the Metashape GUI.

Jordan

6
General / Re: Confused about local to geographic conversion
« on: January 09, 2023, 07:47:53 PM »
Hello SFL_Beda,

The internal system of the chunk has arbitrary orientation and scale, you cannot predict, how it will be related to the ECEF or geographic/projected coordinate system before the alignment is completed.

Almost all assets related to the chunk's contents are defined in that internal system:
camera.transform, region.center, region.rot, region.size, marker.position, chunk.model.vertices[N].coord, chunk.point_cloud.points[N].coord and etc.

Hi Alexey,

Similar question: what is the relationship of the coordinate system of the DEM (elevation), Dense Cloud, and Mesh of a project that is not georeferenced? For example, I'm trying to find the connection between indices in an orthomosaic and the dense point cloud, using the elevation of a DEM (where orthomosaic and elevation have the same resolution / dimensions, and are made from the same source: mesh). Because they are both made from the mesh, their connection to is clearer, but if I wanted to project indices of an orthomosaic into 3D such that they match the coordinate system of the dense cloud, is there an additional transformation that needs to be performed?

Thanks,

Jordan

7
Python and Java API / Changing the Python Interpreter
« on: January 06, 2023, 01:08:42 AM »
Hello,

Is it possible to change the python interpreter being used in the Metashape GUI to a custom one (i.e., anaconda)? I have some scripts running from the Metashape GUI that require additional dependencies, and I would rather not install them on the same python interpreter that Metashape uses by default, and instead switch to another one, but still have everything run within the Metashape GUI.

Jordan

8
Python and Java API / Re: List of points within dense point cloud
« on: December 20, 2022, 07:39:26 PM »
Hello Jordan,

Dense point cloud points are not accessible via API now. The workaround is to export the dense cloud, apply modification externally and import it back.

Thanks Alexey,

Following this path, is there a way to use selectbycolor using conditional logical to select multiple sets of point clouds based on their color? Using the GUI I can use the tool to select one set of point clouds at a time, however, I'd like to select multiple sets, and export just those sets (as opposed to the whole thing), make edits on those sets, and then import them back to the project to overwrite the existing points.

Jordan

9
Python and Java API / List of points within dense point cloud
« on: December 19, 2022, 08:55:53 PM »
How can one obtain a list (or np array) of points within the dense point cloud using the Metashape API? I can see that points within the sparse point cloud can be accessed, as well as the vertices of the mesh. From the dense point cloud you can get the point count, and select using a filter, but how would you get access to the points to change an attribute like the color?

Jordan

10
Hello Jordan,

I think that the problem is caused by the fact, that the custom projection matrix is not saved to the exported orthomosaic raster file, so when the import is performed, Metashape doesn't have any information regarding the projection plane.

It might be possible to create custom scripts for export and import of the planar orthomosaic, that will store the projection matrix used for the orthomosaic generation and will consider it for the orthomosaic import.
Do you perform any editing to the exported orthomosaic or what is the purposes or importing it back?

Hi Alexey, that makes sense; does that mean that if the scene is georeferenced using images with GPS information then this problem should no longer occur?

I'm looking to transfer information (modified pixel colors) made on the orthomosaic (after being exported) on to the dense cloud and mesh. Previously I was transferring that information by:

Orthomosaic -> Images -> Dense -> Mesh

But after seeing that Metashape already has an option to colorize the dense and mesh directly via the orthomosaic I've decided to try this route (the latter is also much faster than my previous method, which relies on depth maps and pickPoint). Because these methods do not use a GPU they were a bit slow, but they worked. I have a couple of follow up questions if you don't mind:

- Are there existing functions within MS API that will assist in exporting an orthomosaic with the local coordinate system transformation matrix? If not, I can also look at importing the modified orthomosaic and using the transformation matrix of the original orthomosaic or DEM still within the project (same thing, just different order of operations). Essentially, I need to transfer the transformation matrix from the original orthomosaic or DEM to the modified orthomosaic so I can use the Tasks ColorizeDense and ColorizeVertices...

- If the above doesn't work out, is there a way to modify a point's color within the dense point cloud given the coordinates of the point? I don't recall any functions that give access to the dense point cloud points... If not, I guess I can always export and read it in as a numpy array?

@robotguy16 this post may be of use to you:

https://www.agisoft.com/forum/index.php?topic=14565.msg64050#msg64050

11
Getting close to solving the issue: I oriented the model using the method you mentioned in another post by rotating the model from top, front and then side views.

Now when I try to colorize the mesh using the previously exported orthomosaic it's "more correct", but there's still a translation issue (see below). It doesn't look bad from the top view, but rotating it you can clearly see that it's not right.

Progress...

If I merge the two orthomosaics together (original, and the original exported and then re-imported) I can see that translation that exists.

Looks like a similar issue these folks were dealing with:

https://www.agisoft.com/forum/index.php?topic=12021.0


12
Hello Jordan,

What option you are using for Build Orthomosaic operation? I mean, how the projection plane is selected?

Hi Alexey,

The orthomosaic is being made using an existing mesh, and the Project Plane is current view using a best attempt at looking at the scene from the actual top-down view.

Jordan

13
General / Colorizing Dense and Mesh using Export Ortho - Unexpected Results
« on: November 20, 2022, 03:39:06 AM »
Hello!

I saw that Metashape allows for colorizing the dense cloud and mesh using an orthomosaic, very handy! However, I'm running into unexpected results in specific scenarios and would like to know why. If an ortho is made and the dense cloud and mesh are colorized using said ortho, everything is fine and you can see that the mesh does indeed change (turns black) where there are no data values. However, if that ortho is exported using default parameters and re-imported (no changes to the file) and the same process is performed, the dense cloud and mesh appear to be smeared (see mesh_after_export.png).

The scene is not geo-referenced, the ortho was made using Planar (Current View). Ortho re-imported in Local Coordinates (m) with the No Data value set to 0.

Thanks!

14
If it's all pure Python code, you could use the multiprocessing module (https://docs.python.org/3/library/multiprocessing.html), which creates new python processes and passes data between the processes
Thanks for the suggestion. I remembered I tried it before but it spawned other Metashape application windows with an empty project there and the program stuck there because the data was not passed to other Metashape programs.  Is it the case? Maybe my memory is wrong.

Switch from Pool to ThreadPool and it should work without spawning a bunch of Metashape processes.

15
Python and Java API / Re: Python API Doesn't Use GPU for pickPoint
« on: November 15, 2022, 06:46:23 PM »
Finding the same thing sadly. It'd be great if pickPoint was a process ran on a GPU.

For others who are also bummed about the speed of pickPoint, I recommend using a low resolution tiled model instead of mesh or dense point cloud, as they are significantly slower.

Pages: [1] 2