# 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 - Yoann Courtois

Pages: [1] 2 3 ... 18
1
##### Python Scripting / Re: Coordinates system influence on chunk rotation matrix
« on: May 15, 2019, 10:19:41 AM »
Notice that since last week, I found a work-around by setting back the whole project in "Local coordinates", then calculating my box, and finally reprojecting the whole project in my projected coordinates system

But, besides I don't know if the double reprojection is really good, I would prefer find how to correct the region rotation conversion...

2
##### Python Scripting / Re: Coordinates system influence on chunk rotation matrix
« on: May 15, 2019, 10:12:15 AM »
Hello Alexey,

My pseudo_region is calculated in georeferenced coordinates, so previously in "Local coordinates" but now in a projected coordinate system.

Then, I apply some transformation to set the chunk.region in his chunk coordinate system :
- To reproject the region center :
Code: [Select]
`chunk.transform.matrix.inv().mulp(chunk.crs.unproject(__pseudo_region.center))`
- To scale the region size :
Code: [Select]
`chunk.region.size = (__pseudo_region_long / chunk.transform.scale,                     __pseudo_region_larg / chunk.transform.scale,                     __pseudo_region_haut / chunk.transform.scale)`
- To convert the region rotation :
Code: [Select]
`chunk.region.rot = chunk.transform.matrix.rotation().inv() * __pseudo_region.rot`
Everything works fine for the center and the size, but not for the rotation...

3
##### Python Scripting / Coordinates system influence on chunk rotation matrix
« on: May 07, 2019, 04:26:02 PM »
Hi everyone,

Within my automated pipeline, I've developed a method that calculate and set the smallest bounding box which included a "project contour" polygon.
The calculation has been separated in 3 steps :
- Set the bounding box center
- Set the bounding box size
- Set the bounding box orientation

Everything works very fine until today ... when I decided to include coordinates system in my pipeline.
Indeed, in "Local Coordinates" ('LOCAL_CS["Local Coordinates",LOCAL_DATUM["Local Datum",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]]]'), everything is OK,
but when I use projected coordinates system (For exemple EPSG::3946 in France), the box orientation doesn't work anymore (Center and size are OK !)...

Here is the following code for bounding box orientation setting (Where vertex_a / vertex_b / vertex_c are the corners of my minimum rotated rectangle that include my polygon) :
Code: [Select]
`    cos_teta = (vertex_c.x - vertex_a.x) / vertex_a.distance(vertex_c)    sin_teta = (vertex_c.y - vertex_a.y) / vertex_a.distance(vertex_c)    __pseudo_region.rot = [[sin_teta, -cos_teta, 0],                           [cos_teta, sin_teta, 0],                           [0, 0, 1]]    chunk.region.rot = chunk.transform.matrix.rotation().inv() * __pseudo_region.rot`
After some investigation, my pseudo_region hasn't changed, so the problem is coming from the chunk rotation matrix (chunk.transform.matrix.rotation()).
I cannot understand how chunk.crs has inlfuenced the chunk.transform matrix... and have no idea how to fix the problem...

Regards

4
##### General / Bigger mask while reusing depth maps
« on: February 14, 2019, 11:35:28 AM »
Dear all,

I noticed during my last process that if I cancel the dense cloud generation (launch from GUI) after all depth maps are built , those one are not deleted anymore and can be used again.

As a reminder, dense cloud generation (launch from GUI) is composed of two processing steps :
- Depth maps building
- Dense cloud building

My question is, if then I modify the image mask (in order to mask a bigger part of images), is this new mask used when dense cloud generation is relaunched while reusing depth maps ?
With other words, is the mask used only during depth maps building or is it also taken into account during dense cloud building ?

Regards

5
##### Python Scripting / Re: Model faces not linked with model vertices
« on: February 01, 2019, 01:52:38 PM »
Okey ! Thank you, now I see !

It might be great to update the API documentation, and explain that chunk.model.faces
• .vertices is indeed a tuple of integer, but those integers are the location of the 3 vertices in the chunk.model.vertices list !

Regards

6
##### Python Scripting / Re: Model faces not linked with model vertices
« on: January 31, 2019, 02:10:39 PM »
Hello Alexey,

After some investigations, I still don't understand how it could work like that.

At first : "checkFaceTask" is called :
Code: [Select]
`def checkFaceTask(face):    global vertices    face_vertices = [vertices[v] for v in face.vertices]    checkFace(face, face_vertices)`
But face.vertices is just a tuple of 3 integers.
So then, "checkFace" take as parameters "face", which is a model.face, and "face_vertices", which is a list of 3 integers:
Code: [Select]
`def checkFace(face, face_vertices):    global region    R = region.rot  # Bounding box rotation matrix    C = region.center  # Bounding box center vector    size = region.size    remove_vertices = 0    for vertex in face_vertices:        v = vertex.coord        v.size = 3        v_c = v - C        v_r = R.t() * v_c        if abs(v_r.x) > abs(size.x / 2.):            remove_vertices += 1        elif abs(v_r.y) > abs(size.y / 2.):            remove_vertices += 1        elif abs(v_r.z) > abs(size.z / 2.):            remove_vertices += 1        else:            continue    if remove_vertices == 3:        face.selected = True`
Then how it's possible to call vertex.coord for vertex in face_vertices, because vertex become an integer, so no .coord exist

After some test in Metashape console, I got the same fail.

Regards

7
##### Python Scripting / Model faces not linked with model vertices
« on: January 30, 2019, 06:23:25 PM »
Hi !

I'm currently trying to selected 3D model faces using their vertex coordinates, but I'm not able to find any link between faces (Metashape.Model.Face) and vertices (Metashape.Model.Vertex).
Indeed, the first one is included ".vertices", but it's only a tuple of three numbers (which looks to be vertices number or key) and no coordinates.
The second one is included ".coord", but no number (key ?).

Then, model vertices have coordinates but no link with faces, and so faces have no positioning informations.

Could someone help ?

Regards

8
##### Bug Reports / Re: Classification looks broken
« on: December 27, 2018, 01:22:22 PM »
Thanks a lot.
May you tell me when next version update will be done ?

Regards

9
##### Bug Reports / Re: Classification looks broken
« on: December 26, 2018, 11:02:45 AM »
Hello Alexey,

Even though the coordinates used for GCPs are in RGF93/CC46 system (EPSG 3946), every thing was calculated in local system. Then, no correction from projection system but il doesn't affect such small survey.

Indeed you are right. I've processed this dataset a lot of time and this one has an incorrect aligned bloc of several pictures. Nevertheless, it doesn't affect the rest of the survey either.

Even I used this example for reporting classification vagueness, I only started this topic after several experiences, using different datasets (which have been now deleted)

Regards

10
##### Python Scripting / Re: Script for filtering mesh via gradual selection, connected component size option
« on: December 21, 2018, 04:42:14 PM »
Hi !

Is there nothing more now ?
Indeed, with GUI, I remove all connected component size but the main one (threshold = 99%)
But, as my model can contain 10 000 or 10 millon faces, it's quite difficult to define a threshold as a number of faces for python scripting

Regards

11
##### Bug Reports / Re: Classification looks broken
« on: December 21, 2018, 11:43:17 AM »
Classification done with 1.5.0 build 7204, I'll send you the point cloud used.

Gonna try again with the very last one.

12
##### Bug Reports / Classification looks broken
« on: December 20, 2018, 06:20:41 PM »
Ground point classification gives really bad results in Metashape (but also in PhotoScan 1.4), whereas it was really better before.
Is this normal ?

Here is a screen shot from a standard survey where we can see really random result.

Regards

13
##### Python Scripting / Re: Setting maximum dimension of exported orthomosaic
« on: November 29, 2018, 12:03:50 PM »
Hi John !

Here is the solution :

Hello mikeb,

You can use the following methods related to orthomosaic to calculate the require export resolution:
chunk.orthomosaic.width
chunk.orthomosaic.height
chunk.orthomosaic.resolution

So if you need to export the orthomosaic using max-dimension = X, then I think you can use the following:

Code: [Select]
`dx = dy = max(chunk.orthomosaic.width, chunk.orthomosaic.height) * chunk.orthomosaic.resolution / X`

14
##### Python Scripting / Re: Getting projection error of markers
« on: November 06, 2018, 04:44:38 PM »
Perfect !
Thanks

15
##### Python Scripting / Re: Getting projection error of markers
« on: November 06, 2018, 01:18:01 PM »
This reprojection error could be add to such process to export "all in one" about markers

Hello ARF__,

You can try the following for the active chunk (if projected coordinate system is used):

Code: [Select]
`import PhotoScanchunk = PhotoScan.app.document.chunkfor marker in chunk.markers:      source = marker.reference.location      estim = chunk.crs.project(chunk.transform.matrix.mulp(marker.position))      error = estim - source      total = error.norm()      print(marker.label, error.x, error.y, error.z, total)`

Pages: [1] 2 3 ... 18