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 ... 876
1
Hello ivan-zd,

Does it help, if you use crs argument in the export line:
Code: [Select]
chunk.exportPoints(output_fpath, format=PointsFormatLAZ, crs = chunk.crs)
The default coordinate system for ExportPoints and ExportModel tasks is "Local Coordinates".

2
Python and Java API / Re: place markers in corners of bounding box
« on: October 26, 2021, 08:21:13 PM »
Hello Stephan,

I have updated the script, so that it creates now a cube mesh around each corner of the bounding box (size of the cube is currently defined in the script body in meters). The cubes are parallel to the bounding box sides.
Separate mesh models are created for each corner and in the end the merged mesh is created.

Code: [Select]
import Metashape, tempfile

def fake_obj(s):
output ="v {:.5f} -{:.5f} -{:.5f}\nv {:.5f} -{:.5f} {:.5f}\nv {:.5f} {:.5f} -{:.5f}\nv {:.5f} {:.5f} {:.5f}\nv -{:.5f} -{:.5f} -{:.5f}\nv -{:.5f} -{:.5f} {:.5f}\nv -{:.5f} {:.5f} -{:.5f}\nv -{:.5f} {:.5f} {:.5f}\nf 2 6 5\nf 7 8 4\nf 3 4 2\nf 4 8 6\nf 6 8 7\nf 1 5 7\nf 1 2 5\nf 3 7 4\nf 1 3 2\nf 2 4 6\nf 5 6 7\nf 3 1 7\n".format(s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s, s)
return output

def create_cube(chunk, center, side):
s = side / chunk.transform.scale
temp_obj = tempfile.NamedTemporaryFile(delete=False)
output = fake_obj(s)
temp_obj.write(output.encode("utf-8"))
temp_obj.close()
if chunk.model:
chunk.model = None
chunk.importModel(path = temp_obj.name, format = Metashape.ModelFormatOBJ, crs = Metashape.CoordinateSystem('LOCAL_CS["Local Coordinates (m)",LOCAL_DATUM["Local Datum",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]]]'))
for i in range(8):
vertex = chunk.model.vertices[i]
vertex.coord = chunk.region.rot * Metashape.Vector([s * ((i & 1) - 0.5), 0.5 * s * ((i & 2) - 1), 0.25 * s * ((i & 4) - 2)])  + center
return 1

chunk = Metashape.app.document.chunk
region = chunk.region
SIDE = 10 #meters in georeferenced coordinate system
models = []

for i in range(8):   #finding bounding box corners
pos = Metashape.Vector([region.size.x * ((i & 1) - 0.5), 0.5 * region.size.y * ((i & 2) - 1), 0.25 * region.size.z * ((i & 4) - 2)])
pos = region.center + region.rot * pos  #coordinates in the internal coordinates
corner = chunk.addMarker()
corner.label = "corner " + str(i+1)
corner.reference.location = chunk.crs.project(chunk.transform.matrix.mulp(pos)) #coordinates in geographic/projected coordinates according to chunk.crs
corner.reference.enabled = True
create_cube(chunk, pos, SIDE)
chunk.model.label = corner.label
models.append(chunk.model)
chunk.model = None
task = Metashape.Tasks.MergeAssets()
task.source_data = Metashape.ModelData
task.assets = models
task.apply(chunk)
chunk.model.label = "Merged cubes"
print("Script finished")

3
General / Re: Agisoft Metashape 1.8.0 pre-release
« on: October 26, 2021, 03:04:04 PM »
Hello noodle,

The issue will be fixed in the next 1.8.0 pre-release update, thank you for reporting and sharing the problematic dataset.

4
Python and Java API / Re: How can I install numpy in Agisoft ?
« on: October 26, 2021, 12:24:22 PM »
Hello lyhour,

Can you please try to run the same command using administrator privileges?

5
Hello Garfields_Lasagna,

Do you have single or multiple projections for each marker (I mean it's 2D location on the original images)?

6
Python and Java API / Re: How can I install numpy in Agisoft ?
« on: October 25, 2021, 03:53:03 PM »
Hello lyhour,

Please check the following article, which describes, how to install the external module to Metashape Python:
https://agisoft.freshdesk.com/support/solutions/articles/31000136860-how-to-install-external-python-module-to-metashape-professional-package

7
Bug Reports / Re: zero tie points
« on: October 25, 2021, 02:26:25 PM »
Hello José,

If you observe the same issue in 1.7.5, please save a copy of problematic project and share to our support e-mail address, so that we could analyze it.

8
Hello MichalDV,

The fix is included to 1.7.6 pre-release version update (build 13315), please let me know, if you manage to process the original data (drone photos + TLS scans) together now:

http://download.agisoft.com/metashape-pro_1_7_6_x64.msi                            Windows
http://download.agisoft.com/metashape-pro_1_7_6.dmg                                   macOS
http://download.agisoft.com/metashape-pro_1_7_6_amd64.tar.gz                   Linux

9
General / Re: Depth Map scripts doesn't work anymore! :(
« on: October 25, 2021, 12:28:41 AM »
Hello 3D_Scan_Fan,

Can you please provide the processing log from the beginning of the task up to the moment the moment, when the processing gets stuck?

Also specify the GPUs that are enabled in GPU Preferences tab and the related driver version.

10
Python and Java API / Re: place markers in corners of bounding box
« on: October 23, 2021, 02:35:25 PM »
Hello Stephan,

You can import a cube of any size and then modify the coordinates of its vertices, so that every vertex has an offset from the desired marker of half cube's side in each direction. But you should recalculate the coordinates from geographic to internal chunk's system in order to calculate mesh vertex coordinates properly.

11
Python and Java API / Re: place markers in corners of bounding box
« on: October 22, 2021, 09:19:46 PM »
Hello Stephan,

If the project is georeferenced you can use the following code to calculate the coordinates of the bounding box corners and place markers there:
Code: [Select]
chunk = Metashape.app.document.chunk
region = chunk.region
for i in range(8):   #finding bounding box corners
pos = Metashape.Vector([region.size.x * ((i & 1) - 0.5), 0.5 * region.size.y * ((i & 2) - 1), 0.25 * region.size.z * ((i & 4) - 2)])
pos = region.center + region.rot * pos  #coordinates in the internal coordinates
corner = chunk.addMarker()
corner.label = "corner " + str(i+1)
corner.reference.location = chunk.crs.project(chunk.transform.matrix.mulp(pos)) #coordinates in geographic/projected coordinates according to chunk.crs
corner.reference.enabled = True

12
Hello 2bForgotten,

Looks like you are observing the similar problem as reported before:
https://www.agisoft.com/forum/index.php?topic=13591.0

The identical CUDA cards cause the problem for Refine Mesh operation. As a current workaround you can switch to OpenCL implementation by setting main/gpu_enable_cuda tweak to False value.

13
Hello Andy,

Which GPU models do you have installed, what driver version is used and which OS you are working on?

14
General / Re: memory consumption of BuildOrthomosaic.buildPartition stage
« on: October 22, 2021, 05:46:26 PM »
Hello MichalDV,

OK, thank you for additional information, we'll analyze the reported behavior on similar projects.

15
Python and Java API / Re: Colorize Vertices via Python
« on: October 22, 2021, 05:38:21 PM »
Hello wojtek,

As a workaround - at first use chunk.colorizeModel(), then modify the colors as you need.

Pages: [1] 2 3 ... 876