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 - Alexey Pasumansky

Pages: [1] 2 3 ... 703
1
Python Scripting / Re: Exporting TPs with RMS error in xyz
« on: August 18, 2019, 07:55:45 PM »
Hello Paul,

The following script should save XYZ coordinates for the tie points, variance vector length and it's XYZ components:
Code: [Select]
import Metashape, math

path = Metashape.app.getSaveFileName("Specify the export file path:", filter = "Text file (*.txt);;All formats (*.*)")
file = open(path, "wt")
file.write("Id\tX\tY\tZ\tvar\tcov_x\tcov_y\tcov_z\n")

chunk = Metashape.app.document.chunk
T = chunk.transform.matrix
if chunk.transform.translation and chunk.transform.rotation and chunk.transform.scale:
T = chunk.crs.localframe(T.mulp(chunk.region.center)) * T
R = T.rotation() * T.scale()

for point in chunk.point_cloud.points:
if not point.valid:
continue
cov = point.cov
coord = point.coord

coord = T * coord
cov = R * cov * R.t()
u, s, v = cov.svd()
var = math.sqrt(sum(s)) #variance vector length
vect = (u.col(0) * var)

file.write(str(point.track_id))
file.write("\t{:.6f}\t{:.6f}\t{:.6f}\t{:.6f}".format(coord[0], coord[1], coord[2], var))
file.write("\t{:.6f}\t{:.6f}\t{:.6f}".format(vect.x, vect.y, vect.z))
file.write("\n")

file.close()

2
General / Re: Import of pointcloud data
« on: August 18, 2019, 07:05:54 PM »
Hello all,

The point cloud can be imported to Metashape via File Menu -> Import -> Import Points command.

If you want to merge the imported data with the cloud generated from the images in Metashape, then it's recommend to import the point cloud to already processed chunk without replacing the photogrammetric cloud. Then select both dense clouds in the Workspace pane and select Merge command from the context menu.

3
Python Scripting / Re: Reading Mesh UV Stats from Python
« on: August 16, 2019, 09:55:39 PM »
Hello wojtek,

By current means of Python API I can only suggest to access model.texture() as an image and check the fourth component in the color tuple (related to Alpha - transparency, value). If the value is 255 - the texture pixel is used, if 0 - then it is unused. Ratio of 255-values to the image dimensions should give you the fill ratio (probably with numpy you can access this statistics faster).

4
General / Re: unwanted vertices inside the mesh
« on: August 16, 2019, 09:42:14 PM »
Hello Mak,

Do you have any non-default tweaks set up in version 1.5.4? Like mesh_trimming_radius or mesh_visibility_trimming_radius, for example? If so, then what are the assigned values for them?

I have generated the model from the Doll.psz project in the release 1.5.4 version without any tweaks applied using High quality depth maps and Mild filtering (no volumetric masks applied) and got the following result, then rebuilt the mesh from the same depth maps with mesh_trimming_radius set to 30.


5
General / Re: moving shapes with referenced models
« on: August 16, 2019, 08:27:42 PM »
Hello Abe Whaanga,

Have you tried to use shapes with the markers attached to their vertices? (Right-click on the selected shape and use Attach Markers option from the context menu).

6
Python Scripting / Re: Problem with rotation angles
« on: August 16, 2019, 06:25:21 PM »
Hello guicanarin,

Have you tried the approach from this post:
https://www.agisoft.com/forum/index.php?topic=11120.msg50047#msg50047

7
Python Scripting / Re: Script to increase region by 2x
« on: August 16, 2019, 06:21:26 PM »
Hello bolegna,

Try this one:

Code: [Select]
import Metashape
chunk = Metashape.app.document.chunk
chunk.region.size = 2 * chunk.region.size

8
In the version 1.6 we are planning to update API and unify the parameter names for functions and Tasks.

9
General / Re: Merging two pointclouds not working
« on: August 15, 2019, 05:13:09 PM »
Hello Reservoirdog,

It would be helpful, if you could share the sample dense clouds that we can use to reproduce the problem and the report file exported from the project.

10
Python Scripting / Re: Marker Coordinate System Transformation
« on: August 14, 2019, 09:44:46 PM »
Hello Miles_WADNR,

addMarker function expects the coordinates of the 3d location in the internal coordinate system, not in geographic/projected system.

You should adapt you code in the following way, providing that the chunk is georeferenced:

Code: [Select]
new_vector = Metashape.Vector([-122.271735905, 45.805843149900014, 420.87088799965164])
point = chunk.transform.matrix.inv().mulp(chunk.crs.unproject(new_vector))
current_chunk.addMarker(point)
It transforms the geographic/projected coordinates to geocentric at first (using unproject call) and then to internal chunk's coordinate system with the help of chunk transform matrix.

11
Bug Reports / Re: imort E57
« on: August 14, 2019, 09:37:14 PM »
Hello Dieter,

Thank you for sharing the problematic data. We were able to observe the problem on import and will try to fix it as soon as possible.

12
Python Scripting / Re: captureModelView
« on: August 14, 2019, 06:57:30 PM »
Может быть, неверная привязка для модели или она вообще отсутствует? Для других проектов этот подход корректно работает?

Подразумевалось, что проект корректно привязан в географической/спроецированной СК.

13
General / Re: Turntable Photos Not Aligning(?)
« on: August 14, 2019, 06:21:11 PM »
Hello Jordan,

Can you share the source dataset and the project file with us (support@agisoft.com)?

14
Python Scripting / Re: captureModelView
« on: August 14, 2019, 05:55:48 PM »
Попробуйте для примера следующий скрипт:

Code: [Select]
import Metashape

chunk = Metashape.app.document.chunk
T = chunk.crs.localframe(chunk.transform.translation) * chunk.transform.matrix

location = chunk.region.center + chunk.region.rot * chunk.region.size
direction = (chunk.region.center - location).normalized()
vertical = T.inv().mulv(Metashape.Vector([0, 0, 1]))
horizontal = Metashape.Vector.cross(direction, vertical).normalized()
vertical = Metashape.Vector.cross(direction, horizontal).normalized()
R = Metashape.Matrix([horizontal, vertical, direction])

cameraT = Metashape.Matrix().Translation(location) * Metashape.Matrix().Rotation(R.t())

image = chunk.model.renderImage(cameraT, chunk.sensors[0].calibration)
image.save("D:/render.jpg")

Позиция синтетической камеры находится на векторе, идущем из центра рабочей области через её угол.

15
Python Scripting / Re: python script to Invert selection
« on: August 14, 2019, 03:45:35 PM »
Hello jgillan,

If you have selected the points that you would like to keep and remove all the others, probably you should try chunk.dense_cloud.cropSelectedPoints() method.

Pages: [1] 2 3 ... 703