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

Pages: [1] 2
1
Bug Reports / Re: RunScript() dont run over network
« on: August 26, 2024, 09:37:53 AM »
Yes I know ! I have modify it to be processed in network mode.
see attached the footprint_to_shape.py (modified) that not working
and filter_tie_point.py that work.

don't take care of JsonFile class / jsonInfo object is just a json with info for us. and it's commented for debugging.

2
Bug Reports / Re: RunScript() dont run over network
« on: August 23, 2024, 05:52:12 PM »
Hi I have exactly the same problem with 2.1.2 b18548.

I can add that if I cancel the job in Agisoft Monitor, the script executes correctly after the "#abord" but of course the rest of the jobs do not.

I support 3dlancer. Because as you can see in the screenshot the previous "Runscript" as a import only of 'Metashape and sys' and works correctly.
for me too the script run good on local machine

and just to know :
- align cameras
- filter tie_cloud
- optimizeCam
- footprints_to_shapes.py from github


can you please make it work again.

3
Hi,
you can use pyproj to do it !
below a script I make for manually convert with a command line. You can easily change it for you're need.

Run the script with cmd line :
Code: [Select]
python main.py .\Downloads\EO_EPSG-4326.txt EPSG:4326 EPSG:31468In output file (same dir as input) there is information about "pipeline" (here in make a conversion from 4326 to 31468 and use Betta2007 'proj=hgridshift grids=de_adv_BETA2007.tif')

Hope it's help.

PS: Please Agisoft ! deal with NTV2 grids for builtin convertion please 🙏

4
Python and Java API / Re: DEM palette TMS export
« on: November 25, 2022, 10:37:12 AM »
Hi,
thanks for fast reply!
both of version of Metashape have GSD95 tif geoid file in install dir and definition ok (see screenshot attached).
the geoid is used and work when I export my DEM in CRS to TIF in 3857, the value of each pixel is on ellipsoid. So the geoid is readed.



5
Python and Java API / DEM palette TMS export
« on: November 24, 2022, 05:27:32 PM »
Hi,
in version 1.8.1.13915 if I have a DEM in
Code: [Select]
COMPD_CS["NAD83 / Alberta 3TM ref merid 114 W + GSD95",PROJCS["NAD83 / Alberta 3TM ref merid 114 W",GEOGCS["NAD83",DATUM["North American Datum 1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.01745329251994328,AUTHORITY["EPSG","9102"]],AUTHORITY["EPSG","4269"]],PROJECTION["Transverse_Mercator",AUTHORITY["EPSG","9807"]],PARAMETER["latitude_of_origin",0],PARAMETER["central_meridian",-114],PARAMETER["scale_factor",0.9999],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AUTHORITY["EPSG","3776"]],VERT_CS["NAD83 (EPSG::4269) to GSD95",VERT_DATUM["NAD83 (EPSG::4269) to GSD95",2005],UNIT["metre",1,AUTHORITY["EPSG","9001"]]]]and i whant to export it to TMS palette color in global mercator style there is not problem.

but now in latest 1.8.4.14856 it told me "Error: Vertical datum out of range". We can't reproject on the fly anymore ?

my little code snippet
Code: [Select]
projectionDSM = Metashape.OrthoProjection()
projectionDSM.type = Metashape.OrthoProjection.Type.Planar
projectionDSM.crs = Metashape.CoordinateSystem('EPSG::3857')
# export DEM raster palette
if kwargs['formatOrthoTiles'] == "TMS" :
    task = Metashape.Tasks.ExportRaster()
    task.description = 'DSM'
    task.title = 'DSM'
    task.format = Metashape.RasterFormat.RasterFormatTMS
    task.image_format = Metashape.ImageFormat.ImageFormatPNG
    task.source_data = Metashape.DataSource.ElevationData
    task.raster_transform = Metashape.RasterTransformType.RasterTransformPalette
    task.projection = projectionDSM
    task.global_profile = True
    task.save_alpha = True
    task.white_background = False
    task.path = pathDemExport
    tasks.append(task)

Thanks in advance for any help

Edit: if I export in tif with 3857 it's ok.
Edit2: same problem in GUI

6
Feature Requests / Ntv2 plannimetric shift
« on: June 22, 2022, 01:25:41 AM »
It would be cool if MS could handle ntv2 planimetric coordinate conversion (Eg. like proj and epsg:4326 <-> epsg:31468 with BeTA2007 grid).

In fact for the moment i can transform cameras from dji p4rtk 4326 in 31468 With beta2007 with proj lib,  and make the photogrametric processing in 31468. But when i want to export cloud or mesh to cesium (only wgs) MS make helmert (ToWGS) and WE loose prĂ©cision.

Thanks Agisoft team if you could integrate proj lib or pyproj in metashape

7
hi everybody,
we have the same issue, we try to remove a group wich is default.
we can remove all shapes in this layer but can't remove the group.
the code is following:
Code: [Select]
for s in doc.chunk.shapes.shapes:
   if s.group.label == "Tiles":
      doc.chunk.shapes.remove(s)
for g in doc.chunk.shapes.groups:
   if g.label == "Tiles":
      doc.chunk.shapes.remove(g)

8
Python and Java API / Re: batch add in user-defined coordinate proj
« on: January 04, 2021, 10:58:07 AM »
Thanks it's working,
just a little information for others, the line is not in " User-defined section" but just near of base projection (see attach).
thanks again Alexey

9
Python and Java API / batch add in user-defined coordinate proj
« on: December 24, 2020, 05:15:54 PM »
hi,
i try to batch add to "user-defined coordinate projection" these 8 WKT lines :
Code: [Select]
'COMPD_CS["RGF93 / CC43 + NGF-IGN69 height",PROJCS["RGF93 / CC43",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",42.25],PARAMETER["standard_parallel_2",43.75],PARAMETER["latitude_of_origin",43],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",2200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3943"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'
'COMPD_CS["RGF93 / CC44 + NGF-IGN69 height",PROJCS["RGF93 / CC44",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",43.25],PARAMETER["standard_parallel_2",44.75],PARAMETER["latitude_of_origin",44],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",3200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3944"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'
'COMPD_CS["RGF93 / CC45 + NGF-IGN69 height",PROJCS["RGF93 / CC45",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",44.25],PARAMETER["standard_parallel_2",45.75],PARAMETER["latitude_of_origin",45],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",4200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3945"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'
'COMPD_CS["RGF93 / CC46 + NGF-IGN69 height",PROJCS["RGF93 / CC46",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",45.25],PARAMETER["standard_parallel_2",46.75],PARAMETER["latitude_of_origin",46],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",5200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3946"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'
'COMPD_CS["RGF93 / CC47 + NGF-IGN69 height",PROJCS["RGF93 / CC47",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",46.25],PARAMETER["standard_parallel_2",47.75],PARAMETER["latitude_of_origin",47],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",6200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3947"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'
'COMPD_CS["RGF93 / CC48 + NGF-IGN69 height",PROJCS["RGF93 / CC48",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",47.25],PARAMETER["standard_parallel_2",48.75],PARAMETER["latitude_of_origin",48],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",7200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3948"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'
'COMPD_CS["RGF93 / CC49 + NGF-IGN69 height",PROJCS["RGF93 / CC49",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",48.25],PARAMETER["standard_parallel_2",49.75],PARAMETER["latitude_of_origin",49],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",8200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3949"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'
'COMPD_CS["RGF93 / CC50 + NGF-IGN69 height",PROJCS["RGF93 / CC50",GEOGCS["RGF93",DATUM["Reseau_Geodesique_Francais_1993",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6171"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4171"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",49.25],PARAMETER["standard_parallel_2",50.75],PARAMETER["latitude_of_origin",50],PARAMETER["central_meridian",3],PARAMETER["false_easting",1700000],PARAMETER["false_northing",9200000],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","3950"]],VERT_CS["NGF-IGN69 height",VERT_DATUM["Nivellement General de la France - IGN69",2005,AUTHORITY["EPSG","5119"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],AXIS["Up",UP],AUTHORITY["EPSG","5720"]]]'

It can be saved or executed at startup of metashape it doesn't matter.
thanks in advence for help

10
Python and Java API / Re: API1.6 exportRaster DEM shaded
« on: February 06, 2020, 01:16:01 PM »
Hi,
thanks for quick reply.

see attach files.

11
Python and Java API / API1.6 exportRaster DEM shaded
« on: February 06, 2020, 12:01:00 PM »
Hi everyone,

we run a full timeline python script with :

Code: [Select]
metashape.exe -r script.py
In this script we export DEM.

In version API1.5 we do :

Code: [Select]
chunk.exportDem(DemPATH, image_format=Metashape.ImageFormatTIFF,nodata=-99999,write_world=True)
and we have a tiff DEM shaded.

we want to migrate our script to API1.6 so we run:

Code: [Select]
chunk.exportRaster(DemPATH,source_data=Metashape.ElevationData,image_format=Metashape.ImageFormatTIFF,nodata_value=-99999,save_world=True)
but we have a tiff DEM not shaded.

if we run the last same command with GUI python console the DEM is shaded and it's ok !


can you explain how to apply shaded DEM by python scripting.

thanks in andvance for your help.

benjamin

12
Python and Java API / Re: Apply patch on multiple shapes
« on: July 10, 2019, 05:22:27 PM »
Ok thanks again !  :D

13
Python and Java API / Re: Apply patch on multiple shapes
« on: July 10, 2019, 04:12:03 PM »
Thanks !!!! it's working like a charm !!!!
I understand how the script works to find the best image but can you explain me how the selection in the GUI works?

thanks again for your help

14
Python and Java API / Apply patch on multiple shapes
« on: July 08, 2019, 11:28:16 AM »
hi,

In the api python metashape, I found a really useful script for me. This script applies patch of the first picture of the list to the first shape of the list. But I have several shapes. so I made a loop that runs through all the shapes but this script always applies the same image to different shapes.
how to apply the first rank image of each shapes?
thanks in advance for help

Code: [Select]
import Metashape
chunk = Metashape.app.document.chunk
ortho = chunk.orthomosaic
camera = chunk.cameras[0]
patch = Metashape.Orthomosaic.Patch()
patch.image_keys = [camera.key]
for shape in chunk.shapes.items():
ortho.patches[shape] = patch
ortho.update()

15
General / lever arm center focal or center CCD
« on: December 13, 2018, 03:53:08 PM »
Hi everybody,
can you tell me if photoscan takes the focal center or center CCD in order to properly inform the lever arm and the reference for borsight.
thanks a lot in advance.
benjamin

Pages: [1] 2