1
Python and Java API / Re: How export the Date & time
« on: July 23, 2019, 05:15:16 PM »
Thank you !
It's Perfect
It's Perfect
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.
import Metashape, math
FILEPATH1 = 'C:/Alexandre/PFE/7.Couloir/Les_scène_refait/PYTHON/Export_donnée/Coordo_marker.txt'#lien fichier export
#Export des Markers
doc = Metashape.app.document
chunk = doc.chunk
T = chunk.transform.matrix
f = open(FILEPATH1, 'w')
for item in chunk.markers:
if item.position == None:
continue
v = item.position
v.size = 4
v.w = 1
if not chunk.transform:
chunk.transform.matrix = Metashape.Matrix.Diag( (1,1,1,1) )
T = chunk.transform.matrix
v_t = T * v
v_t.size = 3
proj = chunk.crs
v_out = proj.project(v_t)
f.write(item.label + ',' + str(v_out[0]) + ',' + str(v_out[1]) + ',' + str(v_out[2]) + '\n')
f.close()
# exports all markers in activeChunk to csv.
import Metashape, math
FILEPATH = 'C:/Alexandre/PFE/Python/Resultat_export/marker_export.txt'
doc = Metashape.app.document
chunk = doc.chunk
T = chunk.transform.matrix
f = open(FILEPATH, 'w')
for item in chunk.markers:
if item.position == None:
continue
v = item.position
v.size = 4
v.w = 1
if not chunk.transform:
chunk.transform.matrix = Metashape.Matrix.Diag( (1,1,1,1) )
T = chunk.transform.matrix
v_t = T * v
v_t.size = 3
proj = chunk.crs
v_out = proj.project(v_t)
f.write(item.label + ',' + str(v_out[0]) + ',' + str(v_out[1]) + ',' + str(v_out[2]) + '\n')
f.close()
import Metashape
print(">>> Changement Taille_pixel <<<")
Metashape.Sensor.pixel_height=0.0043169
Metashape.Sensor.pixel_width=0.0043169