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

Pages: [1]
General / Alignment issue
« on: August 12, 2021, 10:19:49 PM »
My data set consists of images of a straight lane of earth taken from a rover. The images are not geo-referenced. The alignment is all over the place and understandably so. In order to improve the alignment, I added 'fake' GPS data to the images. That is, starting with a gps coordinate, the successive frames were given GPS coordinates such that all the frames are in a single line. When I open the modified data set in Agisoft Metashape, the software recognizes this and shows that the images are perfectly in line (see attachment 1). But when I hit align cameras, the alignment is still very bad (see attachment 2).

Is there any way to tell agisoft software that the frames are roughly in a single lane, or is there any way to align properly based on the GPS data that I have given it?


Thank you very much Paulo. Your support helped me get the task done!
Appreciate it very much.

Thank you Paulo,
Your edited code works. The problem is that we need to place the markers carefully and manually. But in my use case, I need to do this rotation completely in Python without manually interfering with it. So, instead of placing the markers manually, I was thinking of just extracting the coordinates of the 3 vertices out of the 8 in the Bounding Box (as shown in the picture). Using these three points as our markers (m1, m2, m3) we can use your script to perform the rotation.

I was able to extract the coordinates of the 8 vertices of the BBox, but I am not sure in what order they are as there is no information about that in the user manual. Could you please tell me how I can extract the coordinates of just these 3 points in Python? I just need the coordinates of the points in the same order as shown in the picture.

I hope you got why I am extracting these coordinates of the BBox, I want them to act as the m1, m2, m3 markers as per your previous solution because I want to automate this process.

Thank you very much for your help in this.

Thank you Paulo,
The transformation is running well but the result is that the recreated surface just flips and orients in a weird angle. Alternatively, I just found out that I can create DEM by using markers. I was able to place three markers and then create the DEM on the Metashape application by clicking on BuildDEM >> planar >> projection plane >>markers. That gives me the result that I want. But I want to do this in code, can you please tell me how I can achieve the following through Python script?:

I want to do this in python : build DEM with the following parameters: 1) Projection planar, projection plane: markers, vertical axis: point 1 -> point 2, source data: depth maps.

In the python manual, it does not specify where I can change the projection source and projection plane and even specify the vertical axis. So could you please tell me how I can use the buildDem() function with the parameters (listed above) written with the correct syntax?

Really appreciate your help. Thank you in advance!

Python and Java API / Align recreated surface with horizontal plane
« on: July 14, 2021, 12:50:46 AM »
Hello everyone,

I want to align the recreated surface with the horizontal plane so that I can create a DEM with 'Current view' (being the TOP VIEW). I can do this manually in the UI by simply rotating it and approximately setting the top view and the create DEM with current view. The challenge I am facing is to do this with the Python code so that I can automate it. I am very new to this, can somebody please tell me how I can align the recreated surface to a TOP VIEW through Python? So that I can then do chunk.buildDem() over that next.
My picture data is not geo referenced FYI.
Any help will be greatly appreciated.

Thank you in advance!

Python and Java API / Rotation of recreated surface
« on: July 13, 2021, 01:39:49 AM »

I am trying to produce an orthomosaic image from my data set using the Python API. But before that, I would first like to rotate the model so that it is aligned with the XY plane before I build the orthomosaic. Can someone please tell me how to do this with Python?

Thank you.

Python and Java API / Re: Converting coordinates
« on: July 09, 2021, 09:09:45 PM »
This is what I was looking for. Thank you Paulo, thank you very much!

Python and Java API / Converting coordinates
« on: July 08, 2021, 06:18:55 PM »

Given a 2D pixel coordinate on the orthomosaic, I want to do the following tasks:
- Convert it to world 2D coordinate
- project on DEM/model to gather Z coordinate
- reproject 3D point to source image
- get reprojection pixel coordinate on the source image (2D coordinates)

Could anyone please tell me how I can do these things with the Python API? My images are NOT geo referenced. I am doing this because I need a Python method to get the corresponding pixel coordinate on the source image given the coordinate on the ortho. I believe the above mentioned workflow is the way to do it.

Any help will be greatly appreciated.

Thank you.


Thank you very much for your help. I am new to this and still figuring out the Python API. Could you please point me to the exact function calls I will need to use for the workflow you suggested? Or if there is a snippet of code which gets this done, could you please share that?

Your help will be greatly appreciated.


I have the final orthomosaic image. I want to do the following task:
- Given a pixel coordinate in the orthomosaic image, I want to find the corresponding pixel coordinate in the original raw image.
The images in my chunk are not georeferenced.

Any help will be greatly appreciated.

Thank you,

Pages: [1]