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

Pages: [1]
1
Python and Java API / Re: Deleting empty camera groups
« on: June 21, 2022, 02:55:29 PM »
Hello Alexey,

Thank you for your help, this method works perfectly.

I would like to put a corrected version where I replaced the list a by empty, otherwise it does not work  ;)

Code: [Select]
chunk = Metashape.app.document.chunk
empty = list(chunk.camera_groups)
for camera in chunk.cameras:
    if camera.group in empty:
        empty.remove(camera.group)
chunk.remove(empty)

--
Michel

2
Python and Java API / Deleting empty camera groups
« on: June 21, 2022, 01:39:00 PM »
Hello everyone,

I am looking for a method to delete empty camera groups automatically. From a practical point of view, I know that we need to create a list of group we want to remove, then use the chunk.remove() function. However, the Metashape.CameraGroup class doesn't have a function to know if the group is empty or not. Do you have any idea how to do this?

Thank you,
--
Michel

3
Python and Java API / Re: Delete duplicate photos?
« on: June 17, 2022, 11:53:06 AM »
Hello Vance,

I'm taking the liberty of reviving this old post, because I was faced with the same problem as you for a project with over 50,000 images. In this case, searching in a list takes time and it is better to use a dictionary which by design has a uniformity of keywords.

Here is a script of a function that allows you to disable redundant images. If you want to delete them, you have to adapt it using part of Alexey's code (creation of a list of cameras to delete).

Code: [Select]
import Metashape

app = Metashape.app
doc = Metashape.app.document
chunk = doc.chunk

def disabledDuplicate():
    b = dict()
    for camera in chunk.cameras:
        len_start = len(b)
        b[camera.label] = []
        len_end = len(b)

        if len_start == len_end:
            camera.enabled = False
        else:
            camera.enabled = True

--
Michel

4
General / Re: Creating an animation track from a polyline
« on: June 02, 2022, 07:16:40 PM »
Hello Alexey,

I would like each camera to fix a particular point in space. For example, I create a point layer with one viewpoint per camera in the track and the script automatically orients the viewpoint.

If this is not possible, I would be interested in the solution where all or some of the cameras fix the centre of a polygon so that I can more easily orientate them manually afterwards.

I would also be interested in the second solution that you propose with configurable yaw, pitch and roll angles

Thanking you in advance,
--
Michel

5
General / Re: Creating an animation track from a polyline
« on: June 02, 2022, 06:12:19 PM »
Hello Alexey,

Thank you for sharing this python script which answers my problem perfectly. I should never exceed the limitations, because I use a 3D polyline and my project is georeferenced. Nevertheless, I will come back to you if my problem evolves.

I just have a question about the orientation of the cameras. Indeed, in the track obtained, the cameras are oriented in a way that the 3D model is seen from below, whereas they are directed towards a point above (see image). Could this be due to a problem in the transformation? Is it possible to define the desired orientation within the script? For information, my model and polyline are georeferenced in the same coordinate system as the project.

--
Michel

6
General / Creating an animation track from a polyline
« on: June 02, 2022, 02:12:17 PM »
Hello everyone,

I would like to know if it is possible to create a camera track from a polyline via a Python script ?

While searching, I found the following topic (https://www.agisoft.com/forum/index.php?topic=11313.0) which gives a script allowing to create a path passing by all the cameras of a project. I imagine the basis of the script would be similar, but I'm having trouble getting from a line, to points and then keyframes.

The aim of the script would be to create n keyframes per line (by distance or % criteria) with an orientation either by default or directed to the next point. Adjustments will be made manually before rendering.

Thanks in advance for your help,

7
General / Re: marker weights
« on: March 04, 2022, 12:55:58 PM »
I should also add that you can change the accuracy of a selection of markers by selecting them and right clicking > modify > accuracy (m).

Moreover, you can give an accuracy on the X, Y coordinates different from that of Z by writing : xy_accuracy / z_accuracy  (ex : 0.02/0.04 will give an accuracy of 2 cm on planimetry and 4 cm on altimetry).

8
General / Re: Texture metadata access problem
« on: February 28, 2022, 11:13:52 AM »
Hello Alexey,

The Metashape.app.document.chunk.model.textures[0].meta command worked fine. I can now access the metadata of my texture.

Thanks a lot for your help

9
General / Re: History of the functions applied to a project
« on: February 26, 2022, 09:51:42 PM »
Hello Alexey,

Thank you for this suggestion. I will try to use it in my process to at least know which function was used.

10
General / Re: How to make a true orthophoto?
« on: February 26, 2022, 09:41:13 PM »
Hello Alexey,

Indeed, mea culpa, from this point of view Metashape is able to make true orthophotos using the mesh representing the DSM.

In my answer, I was talking about the point of view where we would only have vertical and possibly oblique aerial photos of an area, as part of an aerotriangulation campaign for example, and where the mesh we would obtain would not be precise enough to use it as a DSM and we would only have an accurate DTM at our disposal. This is why I suggested using the most vertical photos possible to avoid distortions.

11
General / Re: How to make a true orthophoto?
« on: February 26, 2022, 05:37:45 PM »
Hello depeurvince,

From my experience, I don't think that Metashape is currently able to create true orthophotos. Indeed, it is necessary to know, in addition to the ground, the contours of the buildings, the contours of the roofs with the heights, etc.
While waiting for Metashape to develop this approach, you can create true semi-orthophotos, by having a good DTM, aerial images as vertical as possible, with a very important overlap between images (>80%, even if I prefer 90%) and a perfect exposure allowing to have the least shadow possible. Moreover, the Enable ghosting filter option allows to select the images closest to the nadir, which can help to improve the rendering of the true semi-orthophoto.

12
General / History of the functions applied to a project
« on: February 26, 2022, 05:25:56 PM »
Hello everyone,

I am programming a python script to export some metadata from a project in .txt format. After studying the python API, I have managed to access the various metadata dictionaries of the Tie point cloud, dense cloud, model, etc. In order to have the most accurate history of the functions applied to a project, I wanted to know if it was possible to access to a history of the tools functions used. For example, if I have applied the "decimate mesh" function to a 3D model, can I find a log of the application of this function somewhere?

Thanks a lot in advance,
Michel

13
General / Texture metadata access problem
« on: February 26, 2022, 05:10:37 PM »
Hello everyone,

I am programming a python script to export some metadata of a project in .txt format. After studying the python API, I managed to access the different metadata dictionaries of the Tie points cloud, dense cloud, model, etc. However, when I access the 3D model metadata, none of them refer to the BuildTexture function, only BuildModel and BuildUV. Furthermore, when I select my model, the GUI shows me the parameters used for the BuildTexture function. I conclude that the texture metadatas are present, but I can't access them.

How can I access these metadata?

I specify that I did create a texture for a 3D model and that the command Metashape.app.document.chunk.model.Texture.meta returns None. Furthermore, the Metashape.app.document.chunk.model.Texture command returns something so the texture is present.

Thanks a lot in advance,
Michel

14
Feature Requests / Camera group improvement
« on: February 26, 2022, 04:50:43 PM »
Hello,

I work most of the time on projects with more than 5,000 photos and the camera group function is very useful for the management and organisation of my data. However, after using it for a while, I realised that it could be improved a little bit. Indeed, would it be possible :

  • to add the possibility to create several camera groups at the same time instead of creating them one by one by clicking on the camera tab. This could be done through a user input of the number of folders to create.
  • to have the possibility to create camera groups by clicking on the chunk tab and not on the camera tab. At present, the main "camera" folder must be created to create camera groups.

Pages: [1]