Forum

Author Topic: build dense cloud and build mesh running One after a nother auto  (Read 7324 times)

Gal

  • Newbie
  • *
  • Posts: 4
    • View Profile
Hey

How i can to make  the function  - build dense cloud and build mesh running One after a one automatic

Thanks

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: build dense cloud and build mesh running One after a nother auto
« Reply #1 on: January 13, 2016, 12:52:25 PM »
Hello Gal,

here's an example of processing steps that include dense cloud and mesh generation. Parameters are included as arguments:
Code: [Select]
chunk = PhotoScan.app.document.chunk #active chunk
chunk.buildDenseCloud(quality = PhotoScan.MediumQuality, filter = PhotoScan.AggressiveFiltering)
chunk.buildModel(surface = PhotoScan.Arbitrary, interpolation = PhotoScan.EnabledInterpolation, face_count = 1000000, source = PhotoScan.DataSource.DenseCloudData)
Best regards,
Alexey Pasumansky,
Agisoft LLC

Gal

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: build dense cloud and build mesh running One after a nother auto
« Reply #2 on: January 14, 2016, 10:35:13 AM »
Ok, thanks
and how i can use with this script code?

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: build dense cloud and build mesh running One after a nother auto
« Reply #3 on: January 14, 2016, 01:00:03 PM »
Hello Gal,

If you have an existing script, you should put those lines in the desired position, when you are going to build the dense cloud and mesh.
In case you need it as a separate script, save it to the text file using .py extension, put the line
Code: [Select]
import PhotoScanto the beginning of this file and then execute using Run Script option in Tools menu.

But if you are not familiar with the scripting, probably using Batch Process will be sufficient.
Best regards,
Alexey Pasumansky,
Agisoft LLC

eliasberra

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: build dense cloud and build mesh running One after a nother auto
« Reply #4 on: January 17, 2016, 06:03:00 PM »
Thanks for this code Alexey.
Going a bit further with this script, how one could create and export an orthomosaic?
Let`s say that the following parameters are of interest:
1)   Build Orthomosaic:
-Surface: Mesh
-Blending Mode= Disabled
The remaining options remain default.

2)   Export Orthomosaic:
-Projection: Change projection to “EPSG::32630”;
-Pixel size: Change pixel size to 0.05 m;
-Setup boundaries: x1= 50000, x2 = 500300, y1= 6111600, y2 = 6111700;
-Write World file;
-Tiff compression= None;
- Path to be saved = F:\Example;

Thanks

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: build dense cloud and build mesh running One after a nother auto
« Reply #5 on: January 18, 2016, 12:56:16 PM »
Hello eliasberra,

Code: [Select]
#build
chunk.buildOrthomosaic(surface = PhotoScan.DataSource.ModelData, blending = PhotoScan.BlendingMode.DisabledBlending)

#export
crs = PhotoScan.CoordinateSystem("EPSG::32630")
chunk.exportOrthomosaic(path = " F:\\Example\\example.tif", format = "tif', projection = crs, region = (50000, 500300, 111600, 6111700), dx = 0.05, dy = 0.05, write_world = True)
Best regards,
Alexey Pasumansky,
Agisoft LLC

eliasberra

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: build dense cloud and build mesh running One after a nother auto
« Reply #6 on: January 19, 2016, 03:52:49 PM »
Is it possible to set Tiff compression = None into the function chunk.exportOrthomosaic?
Otherwise it assumes LZW compression.

Thank you

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: build dense cloud and build mesh running One after a nother auto
« Reply #7 on: January 19, 2016, 03:54:42 PM »
Hello eliasberra,

The compression argument will be included in the version 1.2.3 that is about to be released later this week. Currently exports from Python utilize LZW compression.

Upd: Version has been just released, so you can add tiff_compression='none' as an argument to exportOrthomosaic() function.
« Last Edit: January 19, 2016, 07:32:29 PM by Alexey Pasumansky »
Best regards,
Alexey Pasumansky,
Agisoft LLC

mcstieg

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Re: build dense cloud and build mesh running One after a nother auto
« Reply #8 on: November 07, 2019, 11:34:43 PM »
Dear Alexey,

can you please tell me how Metashape calculates the boundaries (x1, x2, y1, y2) when I click "Estimate" in the Build Orthomosaic window?
I'd like to change the output size of orthomosaic and need to calculate the pixel size (m) for planar projection.
But I haven't been able to figure out, where to find or calculate the boundaries ...

Thank you very much! 
 

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 14813
    • View Profile
Re: build dense cloud and build mesh running One after a nother auto
« Reply #9 on: November 08, 2019, 06:08:11 PM »
Hello mcsteig,

You should be able to get the boundaries of the orthomosaic with the following methods:
chunk.orthomosaic.left
chunk.orthomosaic.right
chunk.orthomosaic.top
chunk.orthomosaic.bottom
Best regards,
Alexey Pasumansky,
Agisoft LLC

mcstieg

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Re: build dense cloud and build mesh running One after a nother auto
« Reply #10 on: November 08, 2019, 08:41:40 PM »
Hello Alexey,

thank you for that, but I was looking for something else:
I try to buildOrthomosaic and want to use "Max dimension (pix)" for the creation.

When I click Workflow, Build Orthomosaic the pixel size (° or m) is shown.
I already know how to calculate this. But für the buildOrthomosaic function I need to calculate a different resolution to maximize the ortho (like "Max. dimension (pix)").

In addition, it would be perfect to have the correct way to calc the projection for with markers. But thats not most important right now.

Thank you very much!