0% found this document useful (0 votes)
54 views357 pages

Metashape Python API Reference Guide

The Metashape Python Reference, Release 2.2.1, provides documentation on using Python scripting within the Metashape Professional edition, which supports Python 3.8. It outlines the functionalities accessible via Python scripts, including project management, processing steps, and data export. The document also details various application modules and classes that facilitate interaction with Metashape's core processing capabilities.

Uploaded by

Dhema
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views357 pages

Metashape Python API Reference Guide

The Metashape Python Reference, Release 2.2.1, provides documentation on using Python scripting within the Metashape Professional edition, which supports Python 3.8. It outlines the functionalities accessible via Python scripts, including project management, processing steps, and data export. The document also details various application modules and classes that facilitate interaction with Metashape's core processing capabilities.

Uploaded by

Dhema
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Metashape Python Reference

Release 2.2.1

Agisoft LLC

Apr 26, 2025


CONTENTS

1 Overview 3

2 Application Modules 5

3 Python API Change Log 311

Python Module Index 353

i
ii
Metashape Python Reference, Release 2.2.1

Copyright (c) 2025 Agisoft LLC.

CONTENTS 1
Metashape Python Reference, Release 2.2.1

2 CONTENTS
CHAPTER

ONE

OVERVIEW

1.1 Introduction to Python scripting in Metashape Professional

This API is in development and will be extended in the future Metashape releases.

Note: Python scripting is supported only in Metashape Professional edition.

Metashape Professional uses Python 3.8 as a scripting engine.


Python commands and scripts can be executed in Metashape in one of the following ways:
• From Metashape “Console” pane using it as standard Python console.
• From the “Tools” menu using “Run script. . . ” command.
• From command line using “-r” argument and passing the path to the script as an argument.
The following Metashape funtionality can be accessed from Python scripts:
• Open/save/create Metashape projects.
• Add/remove chunks, cameras, markers.
• Add/modify camera calibrations, ground control data, assign geographic projections and coor-
dinates.
• Perform processing steps (align photos, build dense cloud, build mesh, texture, decimate model,
etc. . . ).
• Export processing results (models, textures, orthophotos, DEMs).
• Access data of generated models, point clouds, images.
• Start and control network processing tasks.

3
Metashape Python Reference, Release 2.2.1

4 Chapter 1. Overview
CHAPTER

TWO

APPLICATION MODULES

Metashape module provides access to the core processing functionality, including support for inspection and manipu-
lation with project data.
The main component of the module is a Document class, which represents a Metashape project. Multiple Document
instances can be created simultaneously if needed. Besides that a currently opened project in the application can be
accessed using [Link] property.
The following example performs main processing steps on existing project and saves back the results:

>>> import Metashape


>>> doc = [Link]
>>> [Link]("[Link]")
>>> chunk = [Link]
>>> [Link](downscale=1, generic_preselection=True, reference_
˓→preselection=False)

>>> [Link]()
>>> [Link](downscale=4, filter_mode=[Link])
>>> [Link](source_data=[Link], surface_type=Metashape.
˓→Arbitrary, interpolation=[Link])

>>> [Link](mapping_mode=[Link])
>>> [Link](blending_mode=[Link], texture_size=4096)
>>> [Link]()

class [Link]
GPS antenna position relative to camera.
bias
GNSS bias.
Type
[Link]
bias_acc
GNSS bias accuracy.
Type
[Link]
bias_covariance
GNSS bias covariance.
Type
[Link]

5
Metashape Python Reference, Release 2.2.1

bias_fixed
Fix GNSS bias flag.
Type
bool
bias_ref
GNSS bias reference.
Type
[Link]
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]
fixed
Fix antenna location and rotation flag.
Type
bool
location
Antenna coordinates.
Type
[Link]
location_acc
Antenna location accuracy.
Type
[Link]
location_covariance
Antenna location covariance.
Type
[Link]
location_ref
Antenna location reference.
Type
[Link]
rotation
Antenna rotation angles.
Type
[Link]
rotation_acc
Antenna rotation accuracy.
Type
[Link]

6 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

rotation_covariance
Antenna rotation covariance.
Type
[Link]
rotation_ref
Antenna rotation reference.
Type
[Link]
class [Link]
Application class provides access to several global application attributes, such as document currently loaded in
the user interface, software version and GPU device configuration. It also contains helper routines to prompt the
user to input various types of parameters, like displaying a file selection dialog or coordinate system selection
dialog among others.
An instance of Application object can be accessed using [Link] attribute, so there is usually no need to
create additional instances in the user code.
The following example prompts the user to select a new coordinate system, applies it to the ative chunk and saves
the project under the user selected file name:

>>> import Metashape


>>> doc = [Link]
>>> crs = [Link]("Select Coordinate System", [Link].
˓→crs)

>>> [Link] = crs


>>> path = [Link]("Save Project As")
>>> try:
... [Link](path)
... except RuntimeError:
... [Link]("Can't save project")

class ConsolePane
ConsolePane class provides access to the console pane
clear()
Clear console pane.
contents
Console pane contents.
Type
str
class ModelView
ModelView class provides access to the model view
class ModelViewMode
Model view mode in [ModelViewTextured, ModelViewShaded, ModelViewSolid, ModelViewWire-
frame, ModelViewElevation, ModelViewConfidence]
class PointCloudViewMode
Point cloud view mode in [PointCloudViewSolid, PointCloudViewColor, PointCloudViewClassifica-
tion, PointCloudViewIntensity, PointCloudViewElevation, PointCloudViewConfidence, PointCloud-
ViewReturnNumber, PointCloudViewScanAngle, PointCloudViewSourceId, PointCloudViewDiffer-
ence]

7
Metashape Python Reference, Release 2.2.1

class TiePointsViewMode
Tie points view mode in [TiePointsViewColor, TiePointsViewElevation, TiePointsViewImageCount,
TiePointsViewVariance]
class TiledModelViewMode
Tiled model view mode in [TiledModelViewTextured, TiledModelViewSolid, TiledModelViewWire-
frame, TiledModelViewElevation]
captureVideo(path, width, height [, frame_rate ][, transparent ][, compressed ][, hide_items ])
Capture video using camera track. Transparent capture can’t be [Link] requires gui and
inaccessible from python module. If script is passed as a program argument, –gui flag should be
specified.
Parameters
• path (str:arg width: Video width.) – Output path.
• height (int) – Video height.
• frame_rate (int) – Video frame rate.
• transparent (bool) – Sets transparent background.
• compressed (bool) – Enables video compression.
• hide_items (bool) – Hides all items.
captureView([width ][, height ][, transparent ][, hide_items ])
Capture image from model view.
Parameters
• width (int) – Image width.
• height (int) – Image height.
• transparent (bool) – Sets transparent background.
• hide_items (bool) – Hides all items.
Returns
Captured image.
Return type
[Link]
model_view_mode
Model view mode.
Type
[Link]
point_cloud_view_mode
Point cloud view mode.
Type
[Link]
show_basemap
Show or hide basemap.
Type
bool
show_cameras
Show or hide cameras.
Type
bool
show_elevation
Display digital elevation model.
Type
bool

8 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

show_laser_scans
Show or hide laser scans.
Type
bool
show_markers
Show or hide markers.
Type
bool
show_orthomosaic
Display orthomosaic.
Type
bool
show_shapes
Show or hide shapes.
Type
bool
show_trajectory
Show or hide trajectory.
Type
bool
texture_view_mode
Texture view mode.
Type
[Link]
tie_points_view_mode
Tie points view mode.
Type
[Link]
tiled_model_view_mode
Tiled model view mode.
Type
[Link]
view_mode
View mode.
Type
[Link]
viewpoint
Viewpoint in the model view.
Type
[Link]
class OrthoView
OrthoView class provides access to the ortho view
captureView([width ][, height ][, transparent ][, hide_items ])
Capture image from ortho view.
Parameters
• width (int) – Image width.

9
Metashape Python Reference, Release 2.2.1

• height (int) – Image height.


• transparent (bool) – Sets transparent background.
• hide_items (bool) – Hides all items.
Returns
Captured image.
Return type
[Link]
center
Ortho view center coordinates.
Type
[Link]
height
Ortho view window height.
Type
int
projection
Ortho view projection.
Type
[Link]
scale
Ortho view scale in px/m.
Type
float
view_mode
View mode.
Type
[Link]
width
Ortho view window width.
Type
int
class PhotoView
PhotoView class provides access to the photo view
camera
Get currently opened camera.
Type
[Link]
captureView([width ][, height ][, transparent ][, hide_items ])
Capture image from photo view.
Parameters
• width (int) – Image width.
• height (int) – Image height.
• transparent (bool) – Sets transparent background.
• hide_items (bool) – Hides all items.
Returns
Captured image.
Return type
[Link]

10 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

center
Image coordinates at photo view center.
Type
[Link]
close()
Close active photo view.
height
Photo view window height.
Type
int
open(camera, new_tab=False)
Open camera in photo view.
Parameters
• camera ([Link]) – Camera to open.
• new_tab (bool) – Open camera in new tab.
scale
Photo view scale in view px / image px
Type
float
show_markers
Show or hide markers.
Type
bool
show_shapes
Show or hide shapes.
Type
bool
width
Photo view window width.
Type
int
class PhotosPane
PhotosPane class provides access to the photos pane
resetFilter()
Reset photos pane filter.
setFilter(items)
Set photos pane filter.
Parameters
items (list[[Link] | [Link]]) – filter to apply.
class Settings
PySettings()
Application settings
language
User interface language.

11
Metashape Python Reference, Release 2.2.1

Type
str
load()
Load settings from disk.
log_enable
Enable writing log to file.
Type
bool
log_path
Log file path.
Type
str
network_enable
Network processing enabled flag.
Type
bool
network_host
Network server host name.
Type
str
network_path
Network data root path.
Type
str
network_port
Network server control port.
Type
int
project_absolute_paths
Store absolute image paths in project files.
Type
bool
project_compression
Project compression level.
Type
int
save()
Save settings on disk.
setValue(key, value)
Set settings value.
Parameters
• key (str) – Key.
• value (object) – Value.
value(key)
Return settings value.

12 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Parameters
key (str) – Key.
Returns
Settings value.
Return type
object
activated
Metashape activation status.
Type
bool
addMenuItem(label, func[, shortcut ][, icon ])
Create a new menu entry.
Parameters
• label (str) – Menu item label.
• func (function) – Function to be called.
• shortcut (str) – Keyboard shortcut.
• icon (str) – Icon.
addMenuSeparator(label)
Add menu separator.
Parameters
label (str) – Menu label.
console_pane
Console pane.
Type
[Link]
cpu_enable
Use CPU when GPU is active.
Type
bool
document
Main application document object.
Type
[Link]
enumGPUDevices()
Enumerate installed GPU devices.
Returns
A list of devices.
Return type
list
getBool(label='')
Prompt user for the boolean value.

13
Metashape Python Reference, Release 2.2.1

Parameters
label (str) – Optional text label for the dialog.
Returns
Boolean value selected by the user.
Return type
bool
getCoordinateSystem([label ][, value ])
Prompt user for coordinate system.
Parameters
• label (str) – Optional text label for the dialog.
• value ([Link]) – Default value.
Returns
Selected coordinate system. If the dialog was cancelled, None is returned.
Return type
[Link]
getExistingDirectory([hint ][, dir ])
Prompt user for the existing folder.
Parameters
• hint (str) – Optional text label for the dialog.
• dir (str) – Optional default folder.
Returns
Path to the folder selected. If the input was cancelled, empty string is returned.
Return type
str
getFloat(label='', value=0)
Prompt user for the floating point value.
Parameters
• label (str) – Optional text label for the dialog.
• value (float) – Default value.
Returns
Floating point value entered by the user.
Return type
float
getInt(label='', value=0)
Prompt user for the integer value.
Parameters
• label (str) – Optional text label for the dialog.
• value (int) – Default value.
Returns
Integer value entered by the user.

14 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Return type
int
getOpenFileName([hint ][, dir ][, filter ])
Prompt user for the existing file.
Parameters
• hint (str) – Optional text label for the dialog.
• dir (str) – Optional default folder.
• filter (str) – Optional file filter, e.g. “Text file (.txt)” or “.txt”. Multiple filters are
separated with “;;”.
Returns
Path to the file selected. If the input was cancelled, empty string is returned.
Return type
str
getOpenFileNames([hint ][, dir ][, filter ])
Prompt user for one or more existing files.
Parameters
• hint (str) – Optional text label for the dialog.
• dir (str) – Optional default folder.
• filter (str) – Optional file filter, e.g. “Text file (.txt)” or “.txt”. Multiple filters are
separated with “;;”.
Returns
List of file paths selected by the user. If the input was cancelled, empty list is returned.
Return type
list
getSaveFileName([hint ][, dir ][, filter ])
Prompt user for the file. The file does not have to exist.
Parameters
• hint (str) – Optional text label for the dialog.
• dir (str) – Optional default folder.
• filter (str) – Optional file filter, e.g. “Text file (.txt)” or “.txt”. Multiple filters are
separated with “;;”.
Returns
Path to the file selected. If the input was cancelled, empty string is returned.
Return type
str
getString(label='', value='')
Prompt user for the string value.
Parameters
• label (str) – Optional text label for the dialog.
• value (str) – Default value.

15
Metashape Python Reference, Release 2.2.1

Returns
String entered by the user.
Return type
str
gpu_mask
GPU device bit mask: 1 - use device, 0 - do not use (i.e. value 5 enables device number 0 and 2).
Type
int
messageBox(message)
Display message box to the user.
Parameters
message (str) – Text message to be displayed.
model_view
Model view.
Type
[Link]
ortho_view
Ortho view.
Type
[Link]
photo_view
Photo view.
Type
[Link]
photos_pane
Photos pane.
Type
[Link]
quit()
Exit application.
releaseFreeMemory()
Call malloc_trim on Linux (does nothing on other OS).
removeMenuItem(label)
Remove menu entry with given label (if exists). If there are multiple entries with given label - all of them
will be removed.
Parameters
label (str) – Menu item label.
settings
Application settings.
Type
[Link]

16 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

title
Application name.
Type
str
update()
Update user interface during long operations.
version
Metashape version.
Type
str
class [Link]
Attached geometry data.
GeometryCollection(geometries)
Create a GeometryCollection geometry.
Parameters
geometries (list[[Link]]) – Child geometries.
Returns
A GeometryCollection geometry.
Return type
[Link]
LineString(coordinates)
Create a LineString geometry.
Parameters
coordinates (list[int]) – List of vertex coordinates.
Returns
A LineString geometry.
Return type
[Link]
MultiLineString(geometries)
Create a MultiLineString geometry.
Parameters
geometries (list[[Link]]) – Child line strings.
Returns
A point geometry.
Return type
[Link]
MultiPoint(geometries)
Create a MultiPoint geometry.
Parameters
geometries (list[[Link]]) – Child points.
Returns
A point geometry.

17
Metashape Python Reference, Release 2.2.1

Return type
[Link]
MultiPolygon(geometries)
Create a MultiPolygon geometry.
Parameters
geometries (list[[Link]]) – Child polygons.
Returns
A point geometry.
Return type
[Link]
Point(key)
Create a Point geometry.
Parameters
key (int) – Point marker key.
Returns
A point geometry.
Return type
[Link]
Polygon(exterior_ring[, interior_rings ])
Create a Polygon geometry.
Parameters
• exterior_ring (list[int]) – Point coordinates.
• interior_rings (list[int]) – Point coordinates.
Returns
A Polygon geometry.
Return type
[Link]
coordinates
List of vertex keys.
Type
list[int]
geometries
List of child geometries.
Type
list[[Link]]
type
Geometry type.
Type
[Link]
class [Link]
Axis aligned bounding box

18 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]
max
Maximum bounding box extent.
Type
[Link]
min
Minimum bounding box extent.
Type
[Link]
size
Bounding box dimension.
Type
int
class [Link]
Blending mode in [AverageBlending, MosaicBlending, MinBlending, MaxBlending, DisabledBlending]
class [Link]
Calibration object contains camera calibration information including image size, focal length, principal point
coordinates and distortion coefficients.
b1
Affinity.
Type
float
b2
Non-orthogonality.
Type
float
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]
covariance_matrix
Covariance matrix.
Type
[Link]

19
Metashape Python Reference, Release 2.2.1

covariance_params
Covariance matrix parameters.
Type
list[str]
cx
Principal point X coordinate.
Type
float
cy
Principal point Y coordinate.
Type
float
error(point, proj)
Return projection error.
Parameters
• point ([Link]) – Coordinates of the point to be projected.
• proj ([Link]) – Pixel coordinates of the point.
Returns
2D projection error.
Return type
[Link]
f
Focal length.
Type
float
height
Image height.
Type
int
k1
Radial distortion coefficient K1.
Type
float
k2
Radial distortion coefficient K2.
Type
float
k3
Radial distortion coefficient K3.
Type
float

20 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

k4
Radial distortion coefficient K4.
Type
float
load(path, format=CalibrationFormatXML)
Loads calibration from file.
Parameters
• path (str) – path to calibration file
• format ([Link]) – Calibration format.
p1
Decentering distortion coefficient P1.
Type
float
p2
Decentering distortion coefficiant P2.
Type
float
p3
Decentering distortion coefficient P3.
Type
float
p4
Decentering distortion coefficiant P4.
Type
float
project(point)
Return projected pixel coordinates of the point.
Parameters
point ([Link]) – Coordinates of the point to be projected.
Returns
2D projected point coordinates.
Return type
[Link]
rpc
RPC model.
Type
[Link]
save(path, format=CalibrationFormatXML [, label ][, pixel_size ][, focal_length ], cx = 0, cy = 0)
Saves calibration to file.
Parameters
• path (str) – path to calibration file

21
Metashape Python Reference, Release 2.2.1

• format ([Link]) – Calibration format.


• label (str) – Calibration label used in Australis, CalibCam and CalCam formats.
• pixel_size ([Link]) – Pixel size in mm used to convert normalized cali-
bration coefficients to Australis and CalibCam coefficients.
• focal_length (float) – Focal length (Grid calibration format only).
• cx (float) – X principal point coordinate (Grid calibration format only).
• cy (float) – Y principal point coordinate (Grid calibration format only).
type
Camera model.
Type
[Link]
unproject(point)
Return direction corresponding to the image point.
Parameters
point ([Link]) – Pixel coordinates of the point.
Returns
3D vector in the camera coordinate system.
Return type
[Link]
width
Image width.
Type
int
class [Link]
Calibration format in [CalibrationFormatXML, CalibrationFormatAustralis, CalibrationFormatAustralisV7,
CalibrationFormatPhotoModeler, CalibrationFormatCalibCam, CalibrationFormatCalCam, CalibrationFormat-
Inpho, CalibrationFormatUSGS, CalibrationFormatPix4D, CalibrationFormatOpenCV, CalibrationFormatPho-
tomod, CalibrationFormatGrid, CalibrationFormatSTMap]
class [Link]
Camera instance

>>> import Metashape


>>> chunk = [Link]()
>>> [Link](["IMG_0001.jpg", "IMG_0002.jpg"])
>>> camera = [Link][0]
>>> [Link]["Exif/FocalLength"]
'18'

The following example describes how to create multispectal camera layout:

>>> import Metashape


>>> doc = [Link]
>>> chunk = [Link]
>>> rgb = ["RGB_0001.JPG", "RGB_0002.JPG", "RGB_0003.JPG"]
>>> nir = ["NIR_0001.JPG", "NIR_0002.JPG", "NIR_0003.JPG"]
(continues on next page)

22 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

(continued from previous page)


>>> images = [rgb[0], nir[0], rgb[1], nir[1], rgb[2], nir[2]]
>>> groups = [2, 2, 2]
>>> [Link](filenames=images, filegroups=groups, layout=Metashape.
˓→MultiplaneLayout)

class Reference
Camera reference data.
accuracy
Camera location accuracy.
Type
[Link]
enabled
Location enabled flag.
Type
bool
location
Camera coordinates.
Type
[Link]
location_accuracy
Camera location accuracy.
Type
[Link]
location_enabled
Location enabled flag.
Type
bool
rotation
Camera rotation angles.
Type
[Link]
rotation_accuracy
Camera rotation accuracy.
Type
[Link]
rotation_enabled
Rotation enabled flag.
Type
bool
class Type
Camera type in [Regular, Keyframe]
calibration
Adjusted camera calibration including photo-invariant parameters.
Type
[Link]

23
Metashape Python Reference, Release 2.2.1

center
Camera station coordinates for the photo in the chunk coordinate system.
Type
[Link]
chunk
Chunk the camera belongs to.
Type
[Link]
component
Camera component.
Type
[Link]
enabled
Enables/disables the photo.
Type
bool
error(point, proj)
Returns projection error.
Parameters
• point ([Link]) – Coordinates of the point to be projected.
• proj ([Link]) – Pixel coordinates of the point.
Returns
2D projection error.
Return type
[Link]
frames
Camera frames.
Type
list[[Link]]
group
Camera group.
Type
[Link]
image()
Returns image data.
Returns
Image data.
Return type
[Link]

24 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

key
Camera identifier.
Type
int
label
Camera label.
Type
str
layer_index
Camera layer index.
Type
int
location_covariance
Camera location covariance.
Type
[Link]
mask
Camera mask.
Type
[Link]
master
Master camera.
Type
[Link]
meta
Camera meta data.
Type
[Link]
open(path[, layer ])
Loads specified image file.
Parameters
• path (str) – Path to the image file to be loaded.
• layer (int) – Optional layer index in case of multipage files.
orientation
Image orientation (1 - normal, 6 - 90 degree, 3 - 180 degree, 8 - 270 degree).
Type
int
photo
Camera photo.
Type
[Link]

25
Metashape Python Reference, Release 2.2.1

planes
Camera planes.
Type
list[[Link]]
point_cloud
Laser scan for attached cameras.
Type
[Link]
project(point)
Returns coordinates of the point projection on the photo.
Parameters
point ([Link]) – Coordinates of the point to be projected.
Returns
2D point coordinates.
Return type
[Link]
reference
Camera reference data.
Type
[Link]
rotation_covariance
Camera rotation covariance.
Type
[Link]
selected
Selects/deselects the photo.
Type
bool
sensor
Camera sensor.
Type
[Link]
shutter
Camera shutter.
Type
[Link]
thumbnail
Camera thumbnail.
Type
[Link]

26 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

transform
4x4 matrix describing photo location in the chunk coordinate system.
Type
[Link]
type
Camera type.
Type
[Link]
unproject(point)
Returns coordinates of the point which will have specified projected coordinates.
Parameters
point ([Link]) – Projection coordinates.
Returns
3D point coordinates.
Return type
[Link]
vignetting
Vignetting for each band.
Type
list[[Link]]
class [Link]
CameraGroup objects define groups of multiple cameras. The grouping is established by assignment of a Cam-
eraGroup instance to the [Link] attribute of participating cameras.
The type attribute of CameraGroup instances defines the effect of such grouping on processing results and can
be set to Folder (no effect) or Station (coincident projection centers).
class Type
Camera group type in [Folder, Station]
key
Camera group identifier.
Type
int
label
Camera group label.
Type
str
selected
Current selection state.
Type
bool
type
Camera group type.

27
Metashape Python Reference, Release 2.2.1

Type
[Link]
class [Link]
Camera track.
chunk
Chunk the camera track belongs to.
Type
[Link]
duration
Animation duration.
Type
float
field_of_view
Vertical field of view in degrees.
Type
float
interpolate(time)
Get animation camera transform matrix.
Parameters
time (float) – Animation time point.
Returns
Interpolated camera transformation matrix in chunk coordinate system.
Return type
[Link]
key
Camera track identifier.
Type
int
keyframes
Camera track keyframes.
Type
list[[Link]]
label
Animation label.
Type
str
load(path[, projection ])
Load camera track from file.
Parameters
• path (str) – Path to camera track file
• projection ([Link]) – Camera track coordinate system.

28 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

loop
Loop track.
Type
bool
meta
Camera track meta data.
Type
[Link]
save(path[, file_format ][, drone_name ][, payload_name ][, payload_position ][, max_waypoints ][,
projection ])
Save camera track to file.
Parameters
• path (str) – Path to camera track file
• file_format (str) – File format. “deduce”: - Deduce from extension, “path”: Path,
“earth”: Google Earth KML, “pilot”: DJI Pilot KML, “wpml”: DJI WPML KMZ, “trin-
ity”: Asctec Trinity CSV, “autopilot”: Asctec Autopilot CSV, “litchi”: Litchi CSV
• drone_name (str) – Drone model. “M300 RTK”: - DJI Matrice 300 RTK, “M30”: - DJI
Matrice 30, “M30T”: - DJI Matrice 30T, “M3E”: - DJI Mavic 3E, “M3T”: - DJI Mavic 3T
• payload_name (str) – Payload model. “P1 24mm”: - DJI Zenmuse P1 (24 mm lens), “P1
35mm”: - DJI Zenmuse P1 (35 mm lens), “P1 50mm”: - DJI Zenmuse P1 (50 mm lens),
“H20”: - DJI Zenmuse H20, “H20T”: - DJI Zenmuse H20T, “H20N”: - DJI Zenmuse
H20N, “L1”: - DJI Zenmuse L1, “M30”: - DJI M30, “M30T”: - DJI M30T, “M3E”: - DJI
Mavic 3E Camera, “M3T”: - DJI Mavic 3T Camera
• payload_position (str) – Payload position. For M300 RTK drone: “Front left”, “Front
right”, “Top”. For other drones: “Main gimbal”
• max_waypoints (int) – Max waypoints per flight
• projection ([Link]) – Camera track coordinate system.
selected
Current selection state.
Type
bool
smooth
Smooth path.
Type
bool
class [Link]
Camera orientation format in [CamerasFormatXML, CamerasFormatCHAN, CamerasFormatBoujou, Cam-
erasFormatBundler, CamerasFormatOPK, CamerasFormatPATB, CamerasFormatBINGO, CamerasForma-
tORIMA, CamerasFormatAeroSys, CamerasFormatInpho, CamerasFormatSummit, CamerasFormatBlocksEx-
change, CamerasFormatRZML, CamerasFormatVisionMap, CamerasFormatABC, CamerasFormatFBX, Cam-
erasFormatNVM, CamerasFormatMA, CamerasFormatColmap]

29
Metashape Python Reference, Release 2.2.1

class [Link]
A Chunk object:
• provides access to all chunk components (sensors, cameras, camera groups, markers, scale bars)
• contains data inherent to individual frames (tie points, model, etc)
• implements processing methods (matchPhotos, alignCameras, buildPointCloud, buildModel, etc)
• provides access to other chunk attributes (transformation matrix, coordinate system, meta-data, etc..)
New components can be created using corresponding addXXX methods (addSensor, addCamera, addCamera-
Group, addMarker, addScalebar, addFrame). Removal of components is supported by a single remove method,
which can accept lists of various component types.
In case of multi-frame chunks the Chunk object contains an additional reference to the particular chunk frame,
initialized to the current frame by default. Various methods that work on a per frame basis (matchPhotos, build-
Model, etc) are applied to this particular frame. A frames attribute can be used to obtain a list of Chunk objects
that reference all available frames.
The following example performs image matching and alignment for the active chunk:

>>> import Metashape


>>> chunk = [Link]
>>> for frame in [Link]:
... [Link](downscale=1)
>>> [Link]()

addCamera([sensor ])
Add new camera to the chunk.
Parameters
sensor ([Link]) – Sensor to be assigned to this camera.
Returns
Created camera.
Return type
[Link]
addCameraGroup()
Add new camera group to the chunk.
Returns
Created camera group.
Return type
[Link]
addCameraTrack()
Add new camera track to the chunk.
Returns
Created camera track.
Return type
[Link]
addDepthMaps()
Add new depth maps set to the chunk.

30 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Returns
Created depth maps set.
Return type
[Link]
addElevation()
Add new elevation model to the chunk.
Returns
Created elevation model.
Return type
[Link]
addFrame()
Add new frame to the chunk.
Returns
Created frame.
Return type
[Link]
addFrames([chunk ][, frames ], copy_depth_maps=True, copy_point_cloud=True, copy_model=True,
copy_tiled_model=True, copy_elevation=True, copy_orthomosaic=True[, progress ])
Add frames from specified chunk.
Parameters
• chunk (int) – Chunk to copy frames from.
• frames (list[int]) – List of frame keys to copy.
• copy_depth_maps (bool) – Copy depth maps.
• copy_point_cloud (bool) – Copy point cloud.
• copy_model (bool) – Copy model.
• copy_tiled_model (bool) – Copy tiled model.
• copy_elevation (bool) – Copy DEM.
• copy_orthomosaic (bool) – Copy orthomosaic.
• progress (Callable[[float], None]) – Progress callback.
addMarker([point ], visibility=False)
Add new marker to the chunk.
Parameters
• point ([Link]) – Point to initialize marker projections.
• visibility (bool) – Enables visibility check during projection assignment.
Returns
Created marker.
Return type
[Link]

31
Metashape Python Reference, Release 2.2.1

addMarkerGroup()
Add new marker group to the chunk.
Returns
Created marker group.
Return type
[Link]
addModel()
Add new model to the chunk.
Returns
Created model.
Return type
[Link]
addModelGroup()
Add new model group to the chunk.
Returns
Created model group.
Return type
[Link]
addOrthomosaic()
Add new orthomosaic to the chunk.
Returns
Created orthomosaic.
Return type
[Link]
addPhotos([filenames ][, filegroups ], layout=UndefinedLayout [, group ], strip_extensions=True,
load_reference=True, load_xmp_calibration=True, load_xmp_orientation=True,
load_xmp_accuracy=False, load_xmp_antenna=True, load_rpc_txt=False[, progress ])
Add a list of photos to the chunk.
Parameters
• filenames (list[str]) – List of files to add.
• filegroups (list[int]) – List of file groups.
• layout ([Link]) – Image layout.
• group (int) – Camera group key.
• strip_extensions (bool) – Strip file extensions from camera labels.
• load_reference (bool) – Load reference coordinates.
• load_xmp_calibration (bool) – Load calibration from XMP meta data.
• load_xmp_orientation (bool) – Load orientation from XMP meta data.
• load_xmp_accuracy (bool) – Load accuracy from XMP meta data.
• load_xmp_antenna (bool) – Load GNSS/INS offset from XMP meta data.
• load_rpc_txt (bool) – Load satellite RPC data from auxiliary TXT files.

32 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• progress (Callable[[float], None]) – Progress callback.


addPointCloud()
Add new point cloud to the chunk.
Returns
Created point cloud.
Return type
[Link]
addPointCloudGroup()
Add new point cloud group to the chunk.
Returns
Created point cloud group.
Return type
[Link]
addScalebar(point1, point2)
Add new scale bar to the chunk.
Parameters
• point1 ([Link] | [Link]) – First endpoint.
• point2 ([Link] | [Link]) – Second endpoint.
Returns
Created scale bar.
Return type
[Link]
addScalebarGroup()
Add new scale bar group to the chunk.
Returns
Created scale bar group.
Return type
[Link]
addSensor([source ])
Add new sensor to the chunk.
Parameters
source ([Link]) – Sensor to copy parameters from.
Returns
Created sensor.
Return type
[Link]
addTiledModel()
Add new tiled model to the chunk.
Returns
Created tiled model.
Return type
[Link]

33
Metashape Python Reference, Release 2.2.1

addTrajectory()
Add new trajectory to the chunk.
Returns
Created trajectory.
Return type
[Link]
alignCameras([cameras ][, point_clouds ], min_image=2, adaptive_fitting=False, reset_alignment=False,
subdivide_task=True, align_laser_scans=False[, progress ])
Perform photo alignment for the chunk.
Parameters
• cameras (list[int]) – List of cameras to align.
• point_clouds (list[int]) – List of point clouds to align.
• min_image (int) – Minimum number of point projections.
• adaptive_fitting (bool) – Enable adaptive fitting of distortion coefficients.
• reset_alignment (bool) – Reset current alignment.
• subdivide_task (bool) – Enable fine-level task subdivision.
• align_laser_scans (bool) – Align laser scans using geometric features.
• progress (Callable[[float], None]) – Progress callback.
alignCamerasByReference([cameras ])
Use photo reference metadata as alignment.
Parameters
cameras (list[[Link]]) – Optional list of cameras to process.
analyzeImages([cameras ], filter_mask=False[, progress ])
Estimate image quality. Estimated value is stored in camera metadata with Image/Quality key. Cameras
with quality less than 0.5 are considered blurred and we recommend to disable them.
Parameters
• cameras (list[int]) – List of cameras to be analyzed.
• filter_mask (bool) – Constrain analyzed image region by mask.
• progress (Callable[[float], None]) – Progress callback.
buildContours(source_data=ElevationData, interval=1, min_value=-1e+10, max_value=1e+10,
prevent_intersections=True[, progress ])
Build contours for the chunk.
Parameters
• source_data ([Link]) – Source data for contour generation.
• interval (float) – Contour interval.
• min_value (float) – Minimum value of contour range.
• max_value (float) – Maximum value of contour range.
• prevent_intersections (bool) – Prevent contour intersections.
• progress (Callable[[float], None]) – Progress callback.

34 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

buildDem(source_data=PointCloudData, interpolation=EnabledInterpolation[, projection ][, region ][,


classes ], flip_x=False, flip_y=False, flip_z=False, resolution=0, subdivide_task=True,
workitem_size_tiles=10, max_workgroup_size=100, replace_asset=False[, frames ][, progress ])
Build elevation model for the chunk.
Parameters
• source_data ([Link]) – Selects between point cloud and tie points.
• interpolation ([Link]) – Interpolation mode.
• projection ([Link]) – Output projection.
• region ([Link]) – Region to be processed.
• classes (list[int]) – List of point classes to be used for surface extraction.
• flip_x (bool) – Flip X axis direction.
• flip_y (bool) – Flip Y axis direction.
• flip_z (bool) – Flip Z axis direction.
• resolution (float) – Output resolution in meters.
• subdivide_task (bool) – Enable fine-level task subdivision.
• workitem_size_tiles (int) – Number of tiles in a workitem.
• max_workgroup_size (int) – Maximum workgroup size.
• replace_asset (bool) – Replace default asset with generated DEM.
• frames (list[int]) – List of frames to process.
• progress (Callable[[float], None]) – Progress callback.
buildDepthMaps(downscale=4, filter_mode=MildFiltering[, cameras ], reuse_depth=False,
max_neighbors=16, subdivide_task=True, workitem_size_cameras=20,
max_workgroup_size=100[, progress ])
Generate depth maps for the chunk.
Parameters
• downscale (int) – Depth map quality (1 - Ultra high, 2 - High, 4 - Medium, 8 - Low, 16
- Lowest).
• filter_mode ([Link]) – Depth map filtering mode.
• cameras (list[int]) – List of cameras to process.
• reuse_depth (bool) – Enable reuse depth maps option.
• max_neighbors (int) – Maximum number of neighbor images to use for depth map gen-
eration.
• subdivide_task (bool) – Enable fine-level task subdivision.
• workitem_size_cameras (int) – Number of cameras in a workitem.
• max_workgroup_size (int) – Maximum workgroup size.
• progress (Callable[[float], None]) – Progress callback.

35
Metashape Python Reference, Release 2.2.1

buildModel(surface_type=Arbitrary, interpolation=EnabledInterpolation, face_count=HighFaceCount,


face_count_custom=200000, source_data=DepthMapsData[, classes ], vertex_colors=True,
vertex_confidence=True, volumetric_masks=False, keep_depth=True, replace_asset=False,
split_in_blocks=False[, blocks_crs ], blocks_size=250[, blocks_origin ],
clip_to_boundary=False, export_blocks=False, build_texture=True, output_folder='',
trimming_radius=10[, cameras ][, frames ], subdivide_task=True, workitem_size_cameras=20,
max_workgroup_size=100[, progress ])
Generate model for the chunk frame.
Parameters
• surface_type ([Link]) – Type of object to be reconstructed.
• interpolation ([Link]) – Interpolation mode.
• face_count ([Link]) – Target face count.
• face_count_custom (int) – Custom face count.
• source_data ([Link]) – Selects between point cloud, tie points, depth
maps and laser scans.
• classes (list[int]) – List of point classes to be used for surface extraction.
• vertex_colors (bool) – Enable vertex colors calculation.
• vertex_confidence (bool) – Enable vertex confidence calculation.
• volumetric_masks (bool) – Enable strict volumetric masking.
• keep_depth (bool) – Enable store depth maps option.
• replace_asset (bool) – Replace default asset with generated model.
• split_in_blocks (bool) – Split model in blocks.
• blocks_crs ([Link]) – Blocks grid coordinate system.
• blocks_size (float) – Blocks size in coordinate system units.
• blocks_origin ([Link]) – Blocks grid origin.
• clip_to_boundary (bool) – Clip to boundary shapes.
• export_blocks (bool) – Export completed blocks.
• build_texture (bool) – Generate preview textures.
• output_folder (str) – Path to output folder.
• trimming_radius (int) – Trimming radius (no trimming if zero).
• cameras (list[int]) – List of cameras to process.
• frames (list[int]) – List of frames to process.
• subdivide_task (bool) – Enable fine-level task subdivision.
• workitem_size_cameras (int) – Number of cameras in a workitem.
• max_workgroup_size (int) – Maximum workgroup size.
• progress (Callable[[float], None]) – Progress callback.

36 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

buildOrthomosaic(surface_data=ModelData, blending_mode=MosaicBlending, fill_holes=True,


ghosting_filter=False, cull_faces=False, refine_seamlines=False[, projection ][, region
], resolution=0, resolution_x=0, resolution_y=0, flip_x=False, flip_y=False,
flip_z=False, transfer_texture=False, subdivide_task=True, workitem_size_cameras=20,
workitem_size_tiles=10, max_workgroup_size=100, replace_asset=False[, frames ][,
progress ])
Build orthomosaic for the chunk.
Parameters
• surface_data ([Link]) – Orthorectification surface.
• blending_mode ([Link]) – Orthophoto blending mode.
• fill_holes (bool) – Enable hole filling.
• ghosting_filter (bool) – Enable ghosting filter.
• cull_faces (bool) – Enable back-face culling.
• refine_seamlines (bool) – Refine seamlines based on image content.
• projection ([Link]) – Output projection.
• region ([Link]) – Region to be processed.
• resolution (float) – Pixel size in meters.
• resolution_x (float) – Pixel size in the X dimension in projected units.
• resolution_y (float) – Pixel size in the Y dimension in projected units.
• flip_x (bool) – Flip X axis direction.
• flip_y (bool) – Flip Y axis direction.
• flip_z (bool) – Flip Z axis direction.
• transfer_texture (bool) – Transfer model texture to orthomosaic.
• subdivide_task (bool) – Enable fine-level task subdivision.
• workitem_size_cameras (int) – Number of cameras in a workitem.
• workitem_size_tiles (int) – Number of tiles in a workitem.
• max_workgroup_size (int) – Maximum workgroup size.
• replace_asset (bool) – Replace default asset with generated orthomosaic.
• frames (list[int]) – List of frames to process.
• progress (Callable[[float], None]) – Progress callback.
buildPanorama(blending_mode=MosaicBlending, ghosting_filter=False[, rotation ][, region ], width=0,
height=0[, camera_groups ][, frames ][, progress ])
Generate spherical panoramas from camera stations.
Parameters
• blending_mode ([Link]) – Panorama blending mode.
• ghosting_filter (bool) – Enable ghosting filter.
• rotation ([Link]) – Panorama 3x3 orientation matrix.
• region ([Link]) – Region to be generated.

37
Metashape Python Reference, Release 2.2.1

• width (int) – Width of output panorama.


• height (int) – Height of output panorama.
• camera_groups (list[int]) – List of camera groups to process.
• frames (list[int]) – List of frames to process.
• progress (Callable[[float], None]) – Progress callback.
buildPointCloud(source_data=DepthMapsData, point_colors=True, point_confidence=False,
keep_depth=True, max_neighbors=100, uniform_sampling=True, points_spacing=0.1[,
asset ], subdivide_task=True, workitem_size_cameras=20, max_workgroup_size=100,
replace_asset=False[, frames ][, progress ])
Generate point cloud for the chunk.
Parameters
• source_data ([Link]) – Source data to extract points from.
• point_colors (bool) – Enable point colors calculation.
• point_confidence (bool) – Enable point confidence calculation.
• keep_depth (bool) – Enable store depth maps option.
• max_neighbors (int) – Maximum number of neighbor images to use for depth map fil-
tering.
• uniform_sampling (bool) – Enable uniform point sampling.
• points_spacing (float) – Desired point spacing (m).
• asset (int) – Asset to process.
• subdivide_task (bool) – Enable fine-level task subdivision.
• workitem_size_cameras (int) – Number of cameras in a workitem.
• max_workgroup_size (int) – Maximum workgroup size.
• replace_asset (bool) – Replace default asset with generated point cloud.
• frames (list[int]) – List of frames to process.
• progress (Callable[[float], None]) – Progress callback.
buildSeamlines(epsilon=1.5[, progress ])
Generate shapes for orthomosaic seamlines.
Parameters
• epsilon (float) – Contour simplificaion threshold.
• progress (Callable[[float], None]) – Progress callback.
buildTexture(blending_mode=MosaicBlending, texture_size=8192, fill_holes=True, ghosting_filter=True[,
cameras ], texture_type=DiffuseMap, source_data=ImagesData[, source_asset ],
transfer_texture=True, workitem_size_cameras=20, max_workgroup_size=100,
anti_aliasing=1[, progress ])
Generate texture for the chunk.
Parameters
• blending_mode ([Link]) – Texture blending mode.
• texture_size (int) – Texture page size.

38 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• fill_holes (bool) – Enable hole filling.


• ghosting_filter (bool) – Enable ghosting filter.
• cameras (list[int]) – A list of cameras to be used for texturing.
• texture_type ([Link]) – Texture type.
• source_data ([Link]) – Source data to create texture from.
• source_asset (int) – Source asset.
• transfer_texture (bool) – Transfer texture.
• workitem_size_cameras (int) – Number of cameras in a workitem (block model only).
• max_workgroup_size (int) – Maximum workgroup size (block model only).
• anti_aliasing (int) – Anti-aliasing coefficient for baking
• progress (Callable[[float], None]) – Progress callback.
buildTiledModel(pixel_size=0, tile_size=256, source_data=DepthMapsData, face_count=20000,
ghosting_filter=False, transfer_texture=False, keep_depth=True, merge=False[,
operand_chunk ][, operand_frame ][, operand_asset ][, classes ], subdivide_task=True,
workitem_size_cameras=20, max_workgroup_size=100, replace_asset=False[, frames
][, progress ])
Build tiled model for the chunk.
Parameters
• pixel_size (float) – Target model resolution in meters.
• tile_size (int) – Size of tiles in pixels.
• source_data ([Link]) – Selects between point cloud and mesh.
• face_count (int) – Number of faces per megapixel of texture resolution.
• ghosting_filter (bool) – Enable ghosting filter.
• transfer_texture (bool) – Transfer source model texture to tiled model.
• keep_depth (bool) – Enable store depth maps option.
• merge (bool) – Merge tiled model flag.
• operand_chunk (int) – Operand chunk key.
• operand_frame (int) – Operand frame key.
• operand_asset (int) – Operand asset key.
• classes (list[int]) – List of point classes to be used for surface extraction.
• subdivide_task (bool) – Enable fine-level task subdivision.
• workitem_size_cameras (int) – Number of cameras in a workitem.
• max_workgroup_size (int) – Maximum workgroup size.
• replace_asset (bool) – Replace default asset with generated tiled model.
• frames (list[int]) – List of frames to process.
• progress (Callable[[float], None]) – Progress callback.

39
Metashape Python Reference, Release 2.2.1

buildUV(mapping_mode=GenericMapping, page_count=1, texture_size=8192, pixel_size=0[, camera ][,


progress ])
Generate uv mapping for the model.
Parameters
• mapping_mode ([Link]) – Texture mapping mode.
• page_count (int) – Number of texture pages to generate.
• texture_size (int) – Expected size of texture page at texture generation step.
• pixel_size (float) – Texture resolution in meters.
• camera (int) – Camera to be used for texturing in CameraMapping mode.
• progress (Callable[[float], None]) – Progress callback.
calculatePointNormals(point_neighbors=28[, point_cloud ][, progress ])
Calculate point cloud normals.
Parameters
• point_neighbors (int) – Number of point neighbors to use for normal estimation.
• point_cloud (int) – Point cloud key to process.
• progress (Callable[[float], None]) – Progress callback.
calibrateColors(source_data=ModelData, white_balance=False[, cameras ][, progress ])
Perform radiometric calibration.
Parameters
• source_data ([Link]) – Source data for calibration.
• white_balance (bool) – Calibrate white balance.
• cameras (list[int]) – List of cameras to calibrate.
• progress (Callable[[float], None]) – Progress callback.
calibrateReflectance(use_reflectance_panels=True, use_sun_sensor=False[, progress ])
Calibrate reflectance factors based on calibration panels and/or sun sensor.
Parameters
• use_reflectance_panels (bool) – Use calibrated reflectance panels.
• use_sun_sensor (bool) – Apply irradiance sensor measurements.
• progress (Callable[[float], None]) – Progress callback.
camera_crs
Coordinate system used for camera reference data.
Type
[Link]
camera_groups
List of camera groups in the chunk.
Type
list[[Link]]

40 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

camera_location_accuracy
Expected accuracy of camera coordinates in meters.
Type
[Link]
camera_rotation_accuracy
Expected accuracy of camera orientation angles in degrees.
Type
[Link]
camera_track
Camera track.
Type
[Link]
camera_tracks
List of camera tracks in the chunk.
Type
list[[Link]]
cameras
List of Regular and Keyframe cameras in the chunk.
Type
list[[Link]]
cir_transform
CIR calibration matrix.
Type
[Link]
cleanModel(criterion=ComponentSize, level=0[, model ][, progress ])
Remove model faces based on specified criterion.
Parameters
• criterion ([Link]) – Model filtering criterion.
• level (int) – Filtering threshold in percents.
• model (int) – Model to filter.
• progress (Callable[[float], None]) – Progress callback.
cleanTiePoints(criterion=ReprojectionError, threshold=0[, progress ])
Remove tie points based on specified criterion.
Parameters
• criterion ([Link]) – Tie points filtering criterion.
• threshold (float) – Filtering threshold.
• progress (Callable[[float], None]) – Progress callback.
colorizeModel(source_data=ImagesData[, model ][, progress ])
Calculate vertex colors for the model.
Parameters

41
Metashape Python Reference, Release 2.2.1

• source_data ([Link]) – Source data to extract colors from.


• model (int) – Key of model to colorize.
• progress (Callable[[float], None]) – Progress callback.
colorizePointCloud(source_data=ImagesData[, point_cloud ], replace_asset=False[, frames ],
workitem_size_cameras=20, max_workgroup_size=100, subdivide_task=True[,
progress ])
Calculate point colors for the point cloud.
Parameters
• source_data ([Link]) – Source data to extract colors from.
• point_cloud (int) – Point cloud key to colorize.
• replace_asset (bool) – Replace source point cloud with colorized one.
• frames (list[int]) – List of frames to process.
• workitem_size_cameras (int) – Number of cameras in a workitem.
• max_workgroup_size (int) – Maximum workgroup size.
• subdivide_task (bool) – Enable fine-level task subdivision.
• progress (Callable[[float], None]) – Progress callback.
component
Component.
Type
[Link]
components
List of components in the chunk.
Type
list[[Link]]
convertImages(path='{filename}.{fileext}', use_initial_calibration=False, color_correction=False,
merge_planes=False, update_gps_tags=False[, cameras ][, image_compression ][,
progress ])
Convert images.
Parameters
• path (str) – Path to output file.
• use_initial_calibration (bool) – Transform to initial calibration.
• color_correction (bool) – Apply color correction.
• merge_planes (bool) – Merge multispectral images.
• update_gps_tags (bool) – Update GPS tags.
• cameras (list[int]) – List of cameras to process.
• image_compression ([Link]) – Image compression parame-
ters.
• progress (Callable[[float], None]) – Progress callback.

42 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

copy([frames ][, items ], keypoints=True[, cameras ][, laser_scans ][, progress ])


Make a copy of the chunk.
Parameters
• frames (list[[Link]]) – Optional list of frames to be copied.
• items (list[[Link]]) – A list of items to copy.
• keypoints (bool) – Copy key points data.
• cameras (list[[Link]]) – Optional list of cameras to be copied.
• laser_scans (list[[Link]]) – Optional list of laser scans to be
copied.
• progress (Callable[[float], None]) – Progress callback.
Returns
Copy of the chunk.
Return type
[Link]
crs
Coordinate system used for reference data.
Type
[Link]
decimateModel(face_count=200000[, model ], apply_to_selection=False, replace_asset=False[, frames ][,
progress ])
Decimate the model to the specified face count.
Parameters
• face_count (int) – Target face count.
• model (int) – Model to process.
• apply_to_selection (bool) – Apply to selection.
• replace_asset (bool) – Replace source model with decimated model.
• frames (list[int]) – List of frames to process.
• progress (Callable[[float], None]) – Progress callback.
depth_maps
Default depth maps set for the current frame.
Type
[Link]
depth_maps_sets
List of depth maps sets for the current frame.
Type
list[[Link]]
detectFiducials(generate_masks=False, mask_dark_pixels=True, generic_detector=True,
right_angle_detector=False, v_shape_detector=False, frame_detector=False,
fiducials_position_corners=True, fiducials_position_sides=True[, cameras ][, frames ][,
progress ])

43
Metashape Python Reference, Release 2.2.1

Detect fiducial marks on film cameras.


Parameters
• generate_masks (bool) – Generate background masks.
• mask_dark_pixels (bool) – Mask out dark pixels near frame edge.
• generic_detector (bool) – Use generic detector.
• right_angle_detector (bool) – Use right angle detector.
• v_shape_detector (bool) – Detect V-shape fiducials.
• frame_detector (bool) – Detect frame.
• fiducials_position_corners (bool) – Search corners for fiducials.
• fiducials_position_sides (bool) – Search sides for fiducials.
• cameras (list[int]) – List of cameras to process.
• frames (list[int]) – List of frames to process.
• progress (Callable[[float], None]) – Progress callback.
detectMarkers(target_type=CircularTarget12bit, tolerance=50, filter_mask=False, inverted=False,
noparity=False, maximum_residual=5, minimum_size=0, minimum_dist=5,
merge_markers=False[, cameras ][, frames ][, progress ])
Create markers from coded targets.
Parameters
• target_type ([Link]) – Type of targets.
• tolerance (int) – Detector tolerance (0 - 100).
• filter_mask (bool) – Ignore masked image regions.
• inverted (bool) – Detect markers on black background.
• noparity (bool) – Disable parity checking.
• maximum_residual (float) – Maximum residual for non-coded targets in pixels.
• minimum_size (int) – Minimum target radius in pixels to be detected (CrossTarget type
only).
• minimum_dist (int) – Minimum distance between targets in pixels (CrossTarget type
only).
• merge_markers (bool) – Merge detected targets with existing markers.
• cameras (list[int]) – List of cameras to process.
• frames (list[int]) – List of frames to process.
• progress (Callable[[float], None]) – Progress callback.
detectPowerlines(min_altitude=1, n_points_per_line=100, max_quantization_error=0.01,
use_model=True[, progress ])
Detect powerlines for the chunk.
Parameters
• min_altitude (float) – Minimum altitude for reconstructed powerlines.

44 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• n_points_per_line (int) – Maximum number of vertices per detected line.


• max_quantization_error (float) – Maximum allowed distance between polyline and
smooth continuous curve.
• use_model (bool) – Use model for visibility checks.
• progress (Callable[[float], None]) – Progress callback.
elevation
Default elevation model for the current frame.
Type
[Link]
elevations
List of elevation models for the current frame.
Type
list[[Link]]
enabled
Enables/disables the chunk.
Type
bool
euler_angles
Euler angles triplet used for rotation reference.
Type
[Link]
exportCameras(path='', format=CamerasFormatXML [, crs ], save_points=True, save_markers=False,
save_invalid_matches=False, save_absolute_paths=False, save_images=True,
save_masks=False, use_labels=False, use_initial_calibration=False,
convert_to_pinhole=False, image_path='{filename}_{filenum}.jpg', image_orientation=0[,
image_compression ], binary=False[, cameras ], bundler_save_list=True,
bundler_path_list='[Link]', bingo_save_image=True, bingo_save_itera=True,
bingo_save_geoin=True, bingo_save_gps=False, bingo_path_itera='[Link]',
bingo_path_image='[Link]', bingo_path_geoin='[Link]',
bingo_path_gps='[Link]', chan_rotation_order=RotationOrderXYZ [, progress ])
Export point cloud and/or camera positions.
Parameters
• path (str) – Path to output file.
• format ([Link]) – Export format.
• crs ([Link]) – Output coordinate system (except AgisoftXML
format).
• save_points (bool) – Enables/disables export of automatic tie points.
• save_markers (bool) – Enables/disables export of manual matching points.
• save_invalid_matches (bool) – Enables/disables export of invalid image matches.
• save_absolute_paths (bool) – Save absolute image paths (BlocksExchange and RZML
formats only).
• save_images (bool) – Enables/disables images export (Colmap format only).

45
Metashape Python Reference, Release 2.2.1

• save_masks (bool) – Enables/disables image masks export (Colmap format only).


• use_labels (bool) – Enables/disables label based item identifiers.
• use_initial_calibration (bool) – Transform image coordinates to initial calibration.
• convert_to_pinhole (bool) – Transform images to pinhole model without distortions.
• image_path (str) – Image name template
• image_orientation (int) – Image coordinate system (0 - X right, 1 - X up, 2 - X left, 3
- X down).
• image_compression ([Link]) – Image compression parame-
ters.
• binary (bool) – Enables/disables binary encoding for selected format (Colmap and FBX
formats only).
• cameras (list[int]) – List of cameras to export (except AgisoftXML format).
• bundler_save_list (bool) – Enables/disables export of Bundler image list file.
• bundler_path_list (str) – Path to Bundler image list file.
• bingo_save_image (bool) – Enables/disables export of BINGO IMAGE COORDI-
NATE file.
• bingo_save_itera (bool) – Enables/disables export of BINGO ITERA file.
• bingo_save_geoin (bool) – Enables/disables export of BINGO GEO INPUT file.
• bingo_save_gps (bool) – Enables/disables export of BINGO GPS/IMU data.
• bingo_path_itera (str) – Path to BINGO ITERA file.
• bingo_path_image (str) – Path to BINGO IMAGE COORDINATE file.
• bingo_path_geoin (str) – Path to BINGO GEO INPUT file.
• bingo_path_gps (str) – Path to BINGO GPS/IMU file.
• chan_rotation_order ([Link]) – Rotation order (CHAN format
only).
• progress (Callable[[float], None]) – Progress callback.
exportMarkers(path='' [, crs ], binary=False[, progress ])
Export markers.
Parameters
• path (str) – Path to output file.
• crs ([Link]) – Output coordinate system.
• binary (bool) – Enables/disables binary encoding for selected format (if applicable).
• progress (Callable[[float], None]) – Progress callback.
exportModel(path='', binary=True, precision=6, texture_format=ImageFormatJPEG, save_texture=True,
save_uv=True, save_normals=True, save_colors=True, save_confidence=False,
save_cameras=True, save_markers=True, save_udim=False, save_alpha=False,
embed_texture=False, strip_extensions=False, raster_transform=RasterTransformNone,
colors_rgb_8bit=True, gltf_y_up=True, comment='', save_comment=True,
format=ModelFormatNone[, crs ][, shift ], clip_to_boundary=True, clip_to_region=False,
clip_to_block=False, block_margin=0.5, save_metadata_xml=False[, model ][, viewpoint ][,
progress ])

46 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Export generated model for the chunk.


Parameters
• path (str) – Path to output model.
• binary (bool) – Enables/disables binary encoding (if supported by format).
• precision (int) – Number of digits after the decimal point (for text formats).
• texture_format ([Link]) – Texture format.
• save_texture (bool) – Enables/disables texture export.
• save_uv (bool) – Enables/disables uv coordinates export.
• save_normals (bool) – Enables/disables export of vertex normals.
• save_colors (bool) – Enables/disables export of vertex colors.
• save_confidence (bool) – Enables/disables export of vertex confidence.
• save_cameras (bool) – Enables/disables camera export.
• save_markers (bool) – Enables/disables marker export.
• save_udim (bool) – Enables/disables UDIM texture layout.
• save_alpha (bool) – Enables/disables alpha channel export.
• embed_texture (bool) – Embeds texture inside the model file (if supported by format).
• strip_extensions (bool) – Strips camera label extensions during export.
• raster_transform ([Link]) – Raster band transforma-
tion.
• colors_rgb_8bit (bool) – Convert colors to 8 bit RGB.
• gltf_y_up (bool) – Enables/disables y-up axes notation used in glTF.
• comment (str) – Optional comment (if supported by selected format).
• save_comment (bool) – Enables/disables comment export.
• format ([Link]) – Export format.
• crs ([Link]) – Output coordinate system.
• shift ([Link]) – Optional shift to be applied to vertex coordinates.
• clip_to_boundary (bool) – Clip model to boundary shapes.
• clip_to_region (bool) – Clip model to chunk region.
• clip_to_block (bool) – Clip model to block region.
• block_margin (float) – Block margin (m).
• save_metadata_xml (bool) – Save [Link] file.
• model (int) – Model key to export.
• viewpoint ([Link]) – Default view.
• progress (Callable[[float], None]) – Progress callback.

47
Metashape Python Reference, Release 2.2.1

exportOrthophotos(path='{filename}.tif' [, cameras ], raster_transform=RasterTransformNone[, projection


][, region ], resolution=0, resolution_x=0, resolution_y=0, save_kml=False,
save_world=False, save_alpha=True[, image_compression ], white_background=True,
north_up=True[, progress ])
Export orthophotos for the chunk.
Parameters
• path (str) – Path to output orthophoto.
• cameras (list[int]) – List of cameras to process.
• raster_transform ([Link]) – Raster band transforma-
tion.
• projection ([Link]) – Output projection.
• region ([Link]) – Region to be exported.
• resolution (float) – Output resolution in meters.
• resolution_x (float) – Pixel size in the X dimension in projected units.
• resolution_y (float) – Pixel size in the Y dimension in projected units.
• save_kml (bool) – Enable kml file generation.
• save_world (bool) – Enable world file generation.
• save_alpha (bool) – Enable alpha channel generation.
• image_compression ([Link]) – Image compression parame-
ters.
• white_background (bool) – Enable white background.
• north_up (bool) – Use north-up orientation for export.
• progress (Callable[[float], None]) – Progress callback.
exportPointCloud(path='', source_data=PointCloudData[, point_clouds ], binary=True,
save_point_color=True, save_point_normal=True, save_point_intensity=True,
save_point_classification=True, save_point_confidence=True,
save_point_return_number=True, save_point_scan_angle=True,
save_point_source_id=True, save_point_timestamp=True, save_point_index=True,
raster_transform=RasterTransformNone, colors_rgb_8bit=True, comment='',
save_comment=True, format=PointCloudFormatNone,
image_format=ImageFormatJPEG[, crs ][, shift ][, region ], clip_to_boundary=True,
clip_to_region=False, block_width=1000, block_height=1000, split_in_blocks=False[,
classes ], save_images=False, compression=True, tileset_version='1.0',
screen_space_error=16, folder_depth=5[, viewpoint ], subdivide_task=True[, progress
])
Export point cloud.
Parameters
• path (str) – Path to output file.
• source_data ([Link]) – Selects between point cloud and tie points. If
not specified, uses point cloud if available.
• point_clouds (list[int]) – Point cloud keys to export.
• binary (bool) – Enables/disables binary encoding for selected format (if applicable).

48 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• save_point_color (bool) – Enables/disables export of point color.


• save_point_normal (bool) – Enables/disables export of point normal.
• save_point_intensity (bool) – Enables/disables export of point intensity.
• save_point_classification (bool) – Enables/disables export of point classification.
• save_point_confidence (bool) – Enables/disables export of point confidence.
• save_point_return_number (bool) – Enables/disables export of point return number.
• save_point_scan_angle (bool) – Enables/disables export of point scan angle.
• save_point_source_id (bool) – Enables/disables export of point source ID.
• save_point_timestamp (bool) – Enables/disables export of point timestamp.
• save_point_index (bool) – Enables/disables export of point row and column indices.
• raster_transform ([Link]) – Raster band transforma-
tion.
• colors_rgb_8bit (bool) – Convert colors to 8 bit RGB.
• comment (str) – Optional comment (if supported by selected format).
• save_comment (bool) – Enable comment export.
• format ([Link]) – Export format.
• image_format ([Link]) – Image data format.
• crs ([Link]) – Output coordinate system.
• shift ([Link]) – Optional shift to be applied to point coordinates.
• region ([Link]) – Region to be exported.
• clip_to_boundary (bool) – Clip point cloud to boundary shapes.
• clip_to_region (bool) – Clip point cloud to chunk region.
• block_width (float) – Block width in meters.
• block_height (float) – Block height in meters.
• split_in_blocks (bool) – Enable tiled export.
• classes (list[int]) – List of point classes to be exported.
• save_images (bool) – Enable image export.
• compression (bool) – Enable compression (Cesium format only).
• tileset_version (str) – Cesium 3D Tiles format version to export (1.0 or 1.1).
• screen_space_error (float) – Target screen space error (Cesium format only).
• folder_depth (int) – Tileset subdivision depth (Cesium format only).
• viewpoint ([Link]) – Default view.
• subdivide_task (bool) – Enable fine-level task subdivision.
• progress (Callable[[float], None]) – Progress callback.

49
Metashape Python Reference, Release 2.2.1

exportRaster(path='', format=RasterFormatTiles, image_format=ImageFormatNone,


raster_transform=RasterTransformNone[, projection ][, region ], resolution=0,
resolution_x=0, resolution_y=0, block_width=10000, block_height=10000,
split_in_blocks=False, width=0, height=0[, world_transform ], nodata_value=-32767,
save_kml=False, save_world=False, save_scheme=False, save_alpha=True,
image_description='' [, image_compression ], network_links=True, global_profile=False,
min_zoom_level=-1, max_zoom_level=-1, white_background=True, clip_to_boundary=True,
title='Orthomosaic', description='Generated by Agisoft Metashape',
source_data=OrthomosaicData[, asset ], north_up=True, tile_width=256, tile_height=256 [,
progress ])
Export DEM or orthomosaic to file.
Parameters
• path (str) – Path to output orthomosaic.
• format ([Link]) – Export format.
• image_format ([Link]) – Tile format.
• raster_transform ([Link]) – Raster band transforma-
tion.
• projection ([Link]) – Output projection.
• region ([Link]) – Region to be exported.
• resolution (float) – Output resolution in meters.
• resolution_x (float) – Pixel size in the X dimension in projected units.
• resolution_y (float) – Pixel size in the Y dimension in projected units.
• block_width (int) – Raster block width in pixels.
• block_height (int) – Raster block height in pixels.
• split_in_blocks (bool) – Split raster in blocks.
• width (int) – Raster width.
• height (int) – Raster height.
• world_transform ([Link]) – 2x3 raster-to-world transformation matrix.
• nodata_value (float) – No-data value (DEM export only).
• save_kml (bool) – Enable kml file generation.
• save_world (bool) – Enable world file generation.
• save_scheme (bool) – Enable tile scheme files generation.
• save_alpha (bool) – Enable alpha channel generation.
• image_description (str) – Optional description to be added to image files.
• image_compression ([Link]) – Image compression parame-
ters.
• network_links (bool) – Enable network links generation for KMZ format.
• global_profile (bool) – Use global profile (GeoPackage and TMS formats only).
• min_zoom_level (int) – Minimum zoom level (GeoPackage, Google Map Tiles,
MBTiles and World Wind Tiles formats only).

50 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• max_zoom_level (int) – Maximum zoom level (GeoPackage, Google Map Tiles,


MBTiles and World Wind Tiles formats only).
• white_background (bool) – Enable white background.
• clip_to_boundary (bool) – Clip raster to boundary shapes.
• title (str) – Export title.
• description (str) – Export description.
• source_data ([Link]) – Selects between DEM and orthomosaic.
• asset (int) – Asset key to export.
• north_up (bool) – Use north-up orientation for export.
• tile_width (int) – Tile width in pixels.
• tile_height (int) – Tile height in pixels.
• progress (Callable[[float], None]) – Progress callback.
exportReference(path='', format=ReferenceFormatNone, items=ReferenceItemsCameras, columns='',
delimiter=' ', precision=6 [, progress ])
Export reference data to the specified file.
Parameters
• path (str) – Path to the output file.
• format ([Link]) – Export format.
• items ([Link]) – Items to export in CSV format.
• columns (str) – Column order in csv format (n - label, o - enabled flag, x/y/z - coordi-
nates, X/Y/Z - coordinate accuracy, a/b/c - rotation angles, A/B/C - rotation angle accuracy,
u/v/w - estimated coordinates, U/V/W - coordinate errors, d/e/f - estimated orientation an-
gles, D/E/F - orientation errors, p/q/r - estimated coordinates variance, i/j/k - estimated ori-
entation angles variance, [] - group of multiple values, | - column separator within group).
• delimiter (str) – Column delimiter in csv format.
• precision (int) – Number of digits after the decimal point (for CSV format).
• progress (Callable[[float], None]) – Progress callback.
exportReport(path='', title='', description='', font_size=12, page_numbers=True,
include_system_info=True[, user_settings ], logo_path='' [, progress ])
Export processing report in PDF format.
Parameters
• path (str) – Path to output report.
• title (str) – Report title.
• description (str) – Report description.
• font_size (int) – Font size (pt).
• page_numbers (bool) – Enable page numbers.
• include_system_info (bool) – Include system information.
• user_settings (list[tuple[str, str]]) – A list of user defined settings to include
on the Processing Parameters page.

51
Metashape Python Reference, Release 2.2.1

• logo_path (str) – Path to company logo file.


• progress (Callable[[float], None]) – Progress callback.
exportShapes(path='', save_points=False, save_polylines=False, save_polygons=False[, groups ],
format=ShapesFormatNone[, crs ][, shift ], polygons_as_polylines=False, save_labels=True,
save_attributes=True, save_elevation=True[, progress ])
Export shapes layer to file.
Parameters
• path (str) – Path to shape file.
• save_points (bool) – Export points.
• save_polylines (bool) – Export polylines.
• save_polygons (bool) – Export polygons.
• groups (list[int]) – A list of shape groups to export.
• format ([Link]) – Export format.
• crs ([Link]) – Output coordinate system.
• shift ([Link]) – Optional shift to be applied to vertex coordinates.
• polygons_as_polylines (bool) – Save polygons as polylines.
• save_labels (bool) – Export labels.
• save_attributes (bool) – Export attributes.
• save_elevation (bool) – Export elevation values for 3D shapes.
• progress (Callable[[float], None]) – Progress callback.
exportTexture(path='', texture_type=DiffuseMap, raster_transform=RasterTransformNone,
save_alpha=False[, progress ])
Export model texture to file.
Parameters
• path (str) – Path to output file.
• texture_type ([Link]) – Texture type.
• raster_transform ([Link]) – Raster band transforma-
tion.
• save_alpha (bool) – Enable alpha channel export.
• progress (Callable[[float], None]) – Progress callback.
exportTiledModel(path='', format=TiledModelFormatNone, model_format=ModelFormatCOLLADA,
texture_format=ImageFormatJPEG, raster_transform=RasterTransformNone[,
image_compression ][, crs ], clip_to_boundary=True, clip_to_region=False[,
tiled_model ], model_compression=True, tileset_version='1.0',
use_tileset_transform=True, screen_space_error=16, folder_depth=5[, model_group ],
pixel_size=0, tile_size=256, face_count=20000[, progress ])
Export generated tiled model for the chunk.
Parameters
• path (str) – Path to output model.

52 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• format ([Link]) – Export format.


• model_format ([Link]) – Model format for zip export.
• texture_format ([Link]) – Texture format.
• raster_transform ([Link]) – Raster band transforma-
tion.
• image_compression ([Link]) – Image compression parame-
ters.
• crs ([Link]) – Output coordinate system.
• clip_to_boundary (bool) – Clip tiled model to boundary shapes.
• clip_to_region (bool) – Clip tiled model to chunk region.
• tiled_model (int) – Tiled model key to export.
• model_compression (bool) – Enable mesh compression (Cesium format only).
• tileset_version (str) – Cesium 3D Tiles format version to export (1.0 or 1.1).
• use_tileset_transform (bool) – Use tileset transform instead of individual tile trans-
forms (Cesium format only).
• screen_space_error (float) – Target screen space error (Cesium format only).
• folder_depth (int) – Tileset subdivision depth (Cesium format only).
• model_group (int) – Block model key to export.
• pixel_size (float) – Target model resolution in meters (block model export only).
• tile_size (int) – Size of tiles in pixels (block model export only).
• face_count (int) – Number of faces per megapixel of texture resolution (block model
export only).
• progress (Callable[[float], None]) – Progress callback.
filterPointCloud(point_spacing=0[, point_cloud ], clip_to_region=False, replace_asset=False[, frames
][, progress ])
Reduce point cloud points number.
Parameters
• point_spacing (float) – Desired point spacing (m).
• point_cloud (int) – Point cloud key to filter.
• clip_to_region (bool) – Clip point cloud to chunk region.
• replace_asset (bool) – Replace default asset with filtered point cloud.
• frames (list[int]) – List of frames to process.
• progress (Callable[[float], None]) – Progress callback.
findCamera(key)
Find camera by its key.
Returns
Found camera.
Return type
[Link]

53
Metashape Python Reference, Release 2.2.1

findCameraGroup(key)
Find camera group by its key.
Returns
Found camera group.
Return type
[Link]
findCameraTrack(key)
Find camera track by its key.
Returns
Found camera track.
Return type
[Link]
findDepthMaps(key)
Find depth maps by its key.
Returns
Found depth maps.
Return type
[Link]
findElevation(key)
Find elevation model by its key.
Returns
Found elevation model.
Return type
[Link]
findFrame(key)
Find frame by its key.
Returns
Found frame.
Return type
[Link]
findMarker(key)
Find marker by its key.
Returns
Found marker.
Return type
[Link]
findMarkerGroup(key)
Find marker group by its key.
Returns
Found marker group.
Return type
[Link]

54 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

findModel(key)
Find model by its key.
Returns
Found model.
Return type
[Link]
findModelGroup(key)
Find model group by its key.
Parameters
key (int) – Model group key.
Returns
Found model group.
Return type
[Link]
findOrthomosaic(key)
Find orthomosaic by its key.
Returns
Found orthomosaic.
Return type
[Link]
findPointCloud(key)
Find point cloud by its key.
Returns
Found point cloud.
Return type
[Link]
findPointCloudGroup(key)
Find point cloud group by its key.
Parameters
key (int) – Point cloud group key.
Returns
Found point cloud group.
Return type
[Link]
findScalebar(key)
Find scalebar by its key.
Returns
Found scalebar.
Return type
[Link]

55
Metashape Python Reference, Release 2.2.1

findScalebarGroup(key)
Find scalebar group by its key.
Returns
Found scalebar group.
Return type
[Link]
findSensor(key)
Find sensor by its key.
Returns
Found sensor.
Return type
[Link]
findTiledModel(key)
Find tiled model by its key.
Returns
Found tiled model.
Return type
[Link]
findTrajectory(key)
Find trajectory by its key.
Returns
Found trajectory.
Return type
[Link]
frame
Current frame index.
Type
int
frames
List of frames in the chunk.
Type
list[[Link]]
generateMasks(path='{filename}_mask.png', masking_mode=MaskingModeAlpha,
mask_operation=MaskOperationReplacement, tolerance=10[, cameras ],
replace_asset=True[, frames ], mask_defocus=False, fix_coverage=True, blur_threshold=3,
depth_threshold=3.40282e+38[, progress ])
Generate masks for multiple cameras.
Parameters
• path (str) – Mask file name template.
• masking_mode ([Link]) – Mask generation mode.
• mask_operation ([Link]) – Mask operation.
• tolerance (int) – Background masking tolerance.

56 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• cameras (list[int]) – Optional list of cameras to be processed.


• replace_asset (bool) – Update default set of masks with generated masks.
• frames (list[int]) – List of frames to process.
• mask_defocus (bool) – Mask defocus areas.
• fix_coverage (bool) – Extend masks to cover whole mesh (only if mask_defocus=True).
• blur_threshold (float) – Allowed blur radius on a photo in pix (only if
mask_defocus=True).
• depth_threshold (float) – Maximum depth of masked areas in meters (only if
mask_defocus=False).
• progress (Callable[[float], None]) – Progress callback.
generatePrescriptionMap(class_count=4, cell_size=1,
classification_method=JenksNaturalBreaksClassification[,
boundary_shape_group ][, breakpoints ][, rates ][, progress ])
Generate prescription map for orthomosaic.
Parameters
• class_count (int) – Number of classes.
• cell_size (float) – Step of prescription grid, meters.
• classification_method ([Link]) – Index values clas-
sification method.
• boundary_shape_group (int) – Boundary shape group.
• breakpoints (list[float]) – Classification breakpoints.
• rates (list[float]) – Fertilizer rate for each class.
• progress (Callable[[float], None]) – Progress callback.
image_brightness
Image brightness as percentage.
Type
float
image_contrast
Image contrast as percentage.
Type
float
importCameras(path='', format=CamerasFormatXML [, crs ], image_orientation=0, image_list='[Link]',
load_image_list=False[, progress ])
Import camera positions.
Parameters
• path (str) – Path to the file.
• format ([Link]) – File format.
• crs ([Link]) – Ground coordinate system.
• image_orientation (int) – Image coordinate system (0 - X right, 1 - X up, 2 - X left, 3
- X down).

57
Metashape Python Reference, Release 2.2.1

• image_list (str) – Path to image list file (Bundler format only).


• load_image_list (bool) – Enable Bundler image list import.
• progress (Callable[[float], None]) – Progress callback.
importDepthImages(format=PointCloudFormatNone[, filenames ][, color_filenames ], image_path='',
multiplane=False[, progress ])
Import images with depth data.
Parameters
• format ([Link]) – Point cloud format.
• filenames (list[str]) – List of files to import.
• color_filenames (list[str]) – List of corresponding color files, if present.
• image_path (str) – Path template to output files.
• multiplane (bool) – Import as a multi-camera system
• progress (Callable[[float], None]) – Progress callback.
importMarkers(path='' [, progress ])
Import markers.
Parameters
• path (str) – Path to the file.
• progress (Callable[[float], None]) – Progress callback.
importModel(path='', format=ModelFormatNone[, crs ][, shift ], decode_udim=True,
replace_asset=False[, frame_paths ][, progress ])
Import model from file.
Parameters
• path (str) – Path to model.
• format ([Link]) – Model format.
• crs ([Link]) – Model coordinate system.
• shift ([Link]) – Optional shift to be applied to vertex coordinates.
• decode_udim (bool) – Load UDIM texture layout.
• replace_asset (bool) – Replace default asset with imported model.
• frame_paths (list[str]) – List of model paths to import in each frame of a multiframe
chunk.
• progress (Callable[[float], None]) – Progress callback.
importPointCloud(path='', format=PointCloudFormatNone[, crs ][, shift ], precision=0, columns='xyz',
delimiter=' ', group_delimiters=False, skip_rows=0, is_laser_scan=False,
replace_asset=False, load_point_color=True, load_point_normal=True,
load_point_intensity=True, load_point_classification=True,
load_point_confidence=True, load_point_return_number=True,
load_point_scan_angle=True, load_point_source_id=True,
load_point_timestamp=True, load_point_index=True, load_images=True,
generate_panorama=True, calculate_normals=True, point_neighbors=28,
scanner_at_origin=False, ignore_scanner_origin=False, ignore_trajectory=False[,
trajectory ][, frame_paths ][, progress ])

58 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Import point cloud from file.


Parameters
• path (str) – Path to point cloud.
• format ([Link]) – Point cloud format.
• crs ([Link]) – Point cloud coordinate system.
• shift ([Link]) – Optional shift to be applied to point coordinates.
• precision (float) – Coordinate precision (m). For default precision use 0.
• columns (str) – Column order (x/y/z - coordinates, X/Y/Z - normal, r/g/b - color, i -
intensity, t - time, space - skip column).
• delimiter (str) – CSV delimiter.
• group_delimiters (bool) – Combine consecutive delimiters in csv format.
• skip_rows (int) – Number of rows to skip.
• is_laser_scan (bool) – Import point clouds as laser scans.
• replace_asset (bool) – Replace default asset with imported point cloud.
• load_point_color (bool) – Import point color.
• load_point_normal (bool) – Import point normal.
• load_point_intensity (bool) – Import point intensity.
• load_point_classification (bool) – Import point classification.
• load_point_confidence (bool) – Import point confidence.
• load_point_return_number (bool) – Import point return number.
• load_point_scan_angle (bool) – Import point scan angle.
• load_point_source_id (bool) – Import point source ID.
• load_point_timestamp (bool) – Import point timestamp.
• load_point_index (bool) – Import point row and column indices.
• load_images (bool) – Import images embedded in laser scan.
• generate_panorama (bool) – Generate panorama from point colors.
• calculate_normals (bool) – Calculate point normals.
• point_neighbors (int) – Number of point neighbors to use for normal estimation.
• scanner_at_origin (bool) – Use laser scan origin as scanner position for unstructured
point clouds.
• ignore_scanner_origin (bool) – Do not use laser scan origin as scanner position for
structured point clouds.
• ignore_trajectory (bool) – Do not attach trajectory to imported point cloud.
• trajectory (int) – Trajectory key to attach.
• frame_paths (list[str]) – List of point cloud paths to import in each frame of a mul-
tiframe chunk.
• progress (Callable[[float], None]) – Progress callback.

59
Metashape Python Reference, Release 2.2.1

importRaster(path='' [, crs ], raster_type=ElevationData, nodata_value=-32767, has_nodata_value=False,


replace_asset=False[, frames ][, progress ])
Import DEM or orthomosaic from file.
Parameters
• path (str) – Path to elevation model in GeoTIFF format.
• crs ([Link]) – Default coordinate system if not specified in
GeoTIFF file.
• raster_type ([Link]) – Type of raster layer to import.
• nodata_value (float) – No-data value.
• has_nodata_value (bool) – No-data value valid flag.
• replace_asset (bool) – Replace default raster with imported one.
• frames (list[int]) – List of frames to process.
• progress (Callable[[float], None]) – Progress callback.
importReference(path='', format=ReferenceFormatCSV, columns='', delimiter='', group_delimiters=False,
skip_rows=0, items=ReferenceItemsAll[, crs ], ignore_labels=False,
create_markers=False, threshold=0.1, shutter_lag=0[, progress ])
Import reference data from the specified file.
Parameters
• path (str) – Path to the file with reference data.
• format ([Link]) – File format.
• columns (str) – Column order in csv format (n - label, o - enabled flag, x/y/z - coordinates,
X/Y/Z - coordinate accuracy, a/b/c - rotation angles, A/B/C - rotation angle accuracy, [] -
group of multiple values, | - column separator within group).
• delimiter (str) – Column delimiter in csv format.
• group_delimiters (bool) – Combine consecutive delimiters in csv format.
• skip_rows (int) – Number of rows to skip in (csv format only).
• items ([Link]) – Items to load reference for (csv format only).
• crs ([Link]) – Reference data coordinate system (csv format
only).
• ignore_labels (bool) – Matches reference data based on coordinates alone (csv format
only).
• create_markers (bool) – Create markers for missing entries (csv format only).
• threshold (float) – Error threshold in meters used when ignore_labels is set (csv format
only).
• shutter_lag (float) – Shutter lag in seconds (APM format only).
• progress (Callable[[float], None]) – Progress callback.
importShapes(path='', replace=False, boundary_type=NoBoundary, format=ShapesFormatNone,
columns='nxyzd', delimiter=', ', group_delimiters=False, skip_rows=0[, crs ][, progress ])
Import shapes layer from file.
Parameters

60 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• path (str) – Path to shape file.


• replace (bool) – Replace current shapes with new data.
• boundary_type ([Link]) – Boundary type to be applied to
imported shapes.
• format ([Link]) – Shapes format.
• columns (str) – Column order in csv format (n - label, x/y/z - coordinates, d - description,
[] - group of multiple values, | - column separator within group).
• delimiter (str) – Column delimiter in csv format.
• group_delimiters (bool) – Combine consequitive delimiters in csv format.
• skip_rows (int) – Number of rows to skip in (csv format only).
• crs ([Link]) – Reference data coordinate system (csv format
only).
• progress (Callable[[float], None]) – Progress callback.
importTiledModel(path='' [, progress ])
Import tiled model from file.
Parameters
• path (str) – Path to tiled model.
• progress (Callable[[float], None]) – Progress callback.
importTrajectory(path='', format=TrajectoryFormatNone, columns='txyz', delimiter=' ',
group_delimiters=False, skip_rows=0[, crs ][, shift ], replace_asset=False[, progress
])
Import trajectory from file.
Parameters
• path (str) – Trajectory file path.
• format ([Link]) – Trajectory format.
• columns (str) – Column order in csv format (t - time, x/y/z - coordinates, a/b/c - rotation
angles, space - skip column).
• delimiter (str) – Column delimiter in csv format.
• group_delimiters (bool) – Combine consecutive delimiters in csv format.
• skip_rows (int) – Number of rows to skip in (csv format only).
• crs ([Link]) – Point cloud coordinate system.
• shift ([Link]) – Optional shift to be applied to point coordinates.
• replace_asset (bool) – Replace default asset with imported trajectory.
• progress (Callable[[float], None]) – Progress callback.
importVideo(path='', image_path='', frame_step=CustomFrameStep, custom_frame_step=1, time_start=0,
time_end=-1[, progress ])
Import video frames from file.
Parameters
• path (str) – Path to source video.

61
Metashape Python Reference, Release 2.2.1

• image_path (str) – Path to directory where to save frames with filename template. For
example: /path/to/dir/frame{filenum}.png.
• frame_step ([Link]) – Frame step type.
• custom_frame_step (int) – Every custom_frame_step’th frame will be saved. Used for
frame_step=CustomFrameStep.
• time_start (float) – The starting point for importing video, seconds.
• time_end (float) – The endpoint for importing video, seconds.
• progress (Callable[[float], None]) – Progress callback.
key
Chunk identifier.
Type
int
label
Chunk label.
Type
str
loadReferenceExif(load_rotation=False, load_accuracy=False)
Import camera locations from EXIF meta data.
Parameters
• load_rotation (bool) – Load yaw, pitch and roll orientation angles.
• load_accuracy (bool) – Load camera location accuracy.
loadReflectancePanelCalibration(path[, cameras ])
Load reflectance panel calibration from CSV file.
Parameters
• path (str) – Path to calibration file.
• cameras (list[[Link]]) – List of cameras to process.
locateReflectancePanels([progress ])
Locate reflectance panels based on QR-codes.
Parameters
progress (Callable[[float], None]) – Progress callback.
marker_crs
Coordinate system used for marker reference data.
Type
[Link]
marker_groups
List of marker groups in the chunk.
Type
list[[Link]]

62 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

marker_location_accuracy
Expected accuracy of marker coordinates in meters.
Type
[Link]
marker_projection_accuracy
Expected accuracy of marker projections in pixels.
Type
float
markers
List of Regular, Vertex and Fiducial markers in the chunk.
Type
list[[Link]]
mask_sets
List of mask sets for the current frame.
Type
list[[Link]]
masks
Image masks.
Type
[Link]
matchPhotos(downscale=1, downscale_3d=1, generic_preselection=True, reference_preselection=True,
reference_preselection_mode=ReferencePreselectionSource, filter_mask=False,
mask_tiepoints=True, filter_stationary_points=True, keypoint_limit=40000,
keypoint_limit_3d=100000, keypoint_limit_per_mpx=1000, tiepoint_limit=4000,
keep_keypoints=False[, pairs ][, cameras ], guided_matching=False, reset_matches=False,
subdivide_task=True, workitem_size_cameras=20, workitem_size_pairs=80,
max_workgroup_size=100, laser_scans_vertical_axis=0,
laser_scans_use_initial_orientation=False, match_laser_scans=False[, progress ])
Perform image matching for the chunk frame.
Parameters
• downscale (int) – Image alignment accuracy (0 - Highest, 1 - High, 2 - Medium, 4 - Low,
8 - Lowest).
• downscale_3d (int) – Laser scan alignment accuracy (1 - Highest, 2 - High, 4 - Medium,
8 - Low, 16 - Lowest).
• generic_preselection (bool) – Enable generic preselection.
• reference_preselection (bool) – Enable reference preselection.
• reference_preselection_mode ([Link]) –
Reference preselection mode.
• filter_mask (bool) – Filter points by mask.
• mask_tiepoints (bool) – Apply mask filter to tie points.
• filter_stationary_points (bool) – Exclude tie points which are stationary across
images.

63
Metashape Python Reference, Release 2.2.1

• keypoint_limit (int) – Key point limit.


• keypoint_limit_3d (int) – Key point limit for laser scans.
• keypoint_limit_per_mpx (int) – Key point limit per megapixel.
• tiepoint_limit (int) – Tie point limit.
• keep_keypoints (bool) – Store keypoints in the project.
• pairs (list[tuple[int, int]]) – User defined list of camera pairs to match.
• cameras (list[int]) – List of cameras to match.
• guided_matching (bool) – Enable guided image matching.
• reset_matches (bool) – Reset current matches.
• subdivide_task (bool) – Enable fine-level task subdivision.
• workitem_size_cameras (int) – Number of cameras in a workitem.
• workitem_size_pairs (int) – Number of image pairs in a workitem.
• max_workgroup_size (int) – Maximum workgroup size.
• laser_scans_vertical_axis (int) – Common laser scans axis.
• laser_scans_use_initial_orientation (bool) – Use initial laser scan orientation
for keypoint matching.
• match_laser_scans (bool) – Match laser scans using geometric features.
• progress (Callable[[float], None]) – Progress callback.
mergeComponents(components[, progress ])
Merge components.
Parameters
• components (list[[Link]]) – List of components to merge.
• progress (Callable[[float], None]) – Progress callback.
meta
Chunk meta data.
Type
[Link]
model
Default model for the current frame.
Type
[Link]
model_group
Default model group for the current chunk.
Type
[Link]
model_groups
List of model groups in the chunk.
Type
list[[Link]]

64 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

models
List of models for the current frame.
Type
list[[Link]]
modified
Modified flag.
Type
bool
optimizeCameras(fit_f=True, fit_cx=True, fit_cy=True, fit_b1=False, fit_b2=False, fit_k1=True,
fit_k2=True, fit_k3=True, fit_k4=False, fit_p1=True, fit_p2=True, fit_corrections=False,
adaptive_fitting=False, tiepoint_covariance=False[, progress ])
Perform optimization of tie points / camera parameters.
Parameters
• fit_f (bool) – Enable optimization of focal length coefficient.
• fit_cx (bool) – Enable optimization of X principal point coordinates.
• fit_cy (bool) – Enable optimization of Y principal point coordinates.
• fit_b1 (bool) – Enable optimization of aspect ratio.
• fit_b2 (bool) – Enable optimization of skew coefficient.
• fit_k1 (bool) – Enable optimization of k1 radial distortion coefficient.
• fit_k2 (bool) – Enable optimization of k2 radial distortion coefficient.
• fit_k3 (bool) – Enable optimization of k3 radial distortion coefficient.
• fit_k4 (bool) – Enable optimization of k3 radial distortion coefficient.
• fit_p1 (bool) – Enable optimization of p1 tangential distortion coefficient.
• fit_p2 (bool) – Enable optimization of p2 tangential distortion coefficient.
• fit_corrections (bool) – Enable optimization of additional corrections.
• adaptive_fitting (bool) – Enable adaptive fitting of distortion coefficients.
• tiepoint_covariance (bool) – Estimate tie point covariance matrices.
• progress (Callable[[float], None]) – Progress callback.
orthomosaic
Default orthomosaic for the current frame.
Type
[Link]
orthomosaics
List of orthomosaics for the current frame.
Type
list[[Link]]
pansharpenOrthomosaic([orthomosaic ], channels=0[, pan_orthomosaic ], pan_channels=0,
clip_to_pan_data=False, replace_asset=False[, frames ][, progress ])
Pansharpen orthomosaic.

65
Metashape Python Reference, Release 2.2.1

Parameters
• orthomosaic (int) – Orthomosaic to pansharpen.
• channels (int) – Orthomosaic channel mask (boolean flags, e.g. 0b0010 means only 1st
channel is used and the rest ignored).
• pan_orthomosaic (int) – Detailed orthomosaic.
• pan_channels (int) – Detailed orthomosaic channel mask (boolean flags, e.g. 0b0010
means only 1st channel is used and the rest ignored).
• clip_to_pan_data (bool) – Clip result to high resolution orthomosaic.
• replace_asset (bool) – Replace source orthomosaic with pansharpened result.
• frames (list[int]) – List of frames to process.
• progress (Callable[[float], None]) – Progress callback.
point_cloud
Default point cloud for the current frame.
Type
[Link]
point_cloud_groups
List of point cloud groups in the chunk.
Type
list[[Link]]
point_clouds
List of point clouds for the current frame.
Type
list[[Link]]
primary_channel
Primary channel index (-1 for default).
Type
int
publishData(service=ServiceSketchfab, source_data=TiePointsData,
raster_transform=RasterTransformNone, save_point_color=True, save_camera_track=True,
title='', description='', tags='', owner='', token='', username='', password='', account='',
hostname='', is_draft=False, is_private=False, is_protected=False, tile_size=256,
min_zoom_level=-1, max_zoom_level=-1[, projection ], resolution=0, project_id='',
upload_images=False[, point_classes ][, image_compression ][, progress ])
Publish generated data online.
Parameters
• service ([Link]) – Service to upload on.
• source_data ([Link]) – Asset type to upload.
• raster_transform ([Link]) – Raster band transforma-
tion.
• save_point_color (bool) – Enables/disables export of point colors.
• save_camera_track (bool) – Enables/disables export of camera track.

66 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• title (str) – Dataset title.


• description (str) – Dataset description.
• tags (str) – Dataset tags.
• owner (str) – Account owner (Cesium and Mapbox services).
• token (str) – Account token (Cesium, Mapbox, Nira (Key Secret), Picterra, Pointbox and
Sketchfab services).
• username (str) – Account username (4DMapper, Agisoft Cloud and Pointscene services).
• password (str) – Account password (4DMapper, Agisoft Cloud, Pointscene and Sketch-
fab services).
• account (str) – Account name (Nira (Key ID) service).
• hostname (str) – Service hostname (4DMapper and Nira services).
• is_draft (bool) – Mark dataset as draft (Sketchfab service).
• is_private (bool) – Set dataset access to private (Pointbox and Sketchfab services).
• is_protected (bool) – Set dataset access to protected (Pointbox service).
• tile_size (int) – Tile size in pixels.
• min_zoom_level (int) – Minimum zoom level.
• max_zoom_level (int) – Maximum zoom level.
• projection ([Link]) – Output projection.
• resolution (float) – Output resolution in meters.
• project_id (str) – Id of a target project (from Agisoft Cloud project URL).
• upload_images (bool) – Attach photos to Nira publication.
• point_classes (list[int]) – List of point classes to be exported.
• image_compression ([Link]) – Image compression parame-
ters.
• progress (Callable[[float], None]) – Progress callback.
raster_transform
Raster transform.
Type
[Link]
reduceOverlap(overlap=3, use_selection=False[, progress ])
Disable redundant cameras.
Parameters
• overlap (int) – Target number of cameras observing each point of the surface.
• use_selection (bool) – Focus on model selection.
• progress (Callable[[float], None]) – Progress callback.
refineMarkers([markers ][, progress ])
Refine markers based on images content.
Parameters

67
Metashape Python Reference, Release 2.2.1

• markers (list[int]) – Optional list of markers to be processed.


• progress (Callable[[float], None]) – Progress callback.
refineModel(downscale=4, iterations=10, smoothness=0.5[, model ], replace_asset=False[, cameras ][,
frames ][, progress ])
Refine polygonal model.
Parameters
• downscale (int) – Refinement quality (1 - Ultra high, 2 - High, 4 - Medium, 8 - Low, 16
- Lowest).
• iterations (int) – Number of refinement iterations.
• smoothness (float) – Smoothing strength. Should be in range [0, 1].
• model (int) – Model to process.
• replace_asset (bool) – Replace default asset with refined model.
• cameras (list[int]) – List of cameras to process.
• frames (list[int]) – List of frames to process.
• progress (Callable[[float], None]) – Progress callback.
region
Reconstruction volume selection.
Type
[Link]
remove(items)
Remove items from the chunk.
Parameters
items (list[[Link] | [Link] | [Link]
| [Link] | [Link] | Metashape.
ScalebarGroup | [Link] | [Link] | Metashape.
Scalebar | [Link] | [Link] | Metashape.
PointCloud | [Link] | [Link] | Metashape.
ModelGroup | [Link] | [Link] | Metashape.
Orthomosaic | [Link]]) – A list of items to be removed.
removeLighting(color_mode=False, internal_blur=1.5, mesh_noise_suppression=1,
ambient_occlusion_path='', ambient_occlusion_multiplier=1.5[, progress ])
Generate model for the chunk frame.
Parameters
• color_mode (bool) – Enable multi-color processing mode.
• internal_blur (float) – Internal blur. Should be in range [0, 4].
• mesh_noise_suppression (float) – Mesh normals noise suppression strength. Should
be in range [0, 4].
• ambient_occlusion_path (str) – Path to ambient occlusion texture atlas. Can be
empty.
• ambient_occlusion_multiplier (float) – Ambient occlusion multiplier. Should be
in range [0.25, 4].

68 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• progress (Callable[[float], None]) – Progress callback.


renderPreview(width = 2048, height = 2048[, transform ], point_size=1[, progress ])
Generate preview image for the chunk.
Parameters
• width (int) – Preview image width.
• height (int) – Preview image height.
• transform ([Link]) – 4x4 viewpoint transformation matrix.
• point_size (int) – Point size.
• progress (Callable[[float], None]) – Progress callback.
Returns
Preview image.
Return type
[Link]
resetRegion()
Reset reconstruction volume selector to default position.
scalebar_accuracy
Expected scale bar accuracy in meters.
Type
float
scalebar_groups
List of scale bar groups in the chunk.
Type
list[[Link]]
scalebars
List of scale bars in the chunk.
Type
list[[Link]]
selected
Selects/deselects the chunk.
Type
bool
sensors
List of sensors in the chunk.
Type
list[[Link]]
shapes
Shapes for the current frame.
Type
[Link]

69
Metashape Python Reference, Release 2.2.1

smoothModel(strength=3, apply_to_selection=False, fix_borders=True, preserve_edges=False[, model ],


replace_asset=False[, frames ][, progress ])
Smooth model using Laplacian smoothing algorithm.
Parameters
• strength (float) – Smoothing strength.
• apply_to_selection (bool) – Apply to selected faces.
• fix_borders (bool) – Fix borders.
• preserve_edges (bool) – Preserve edges.
• model (int) – Key of model to smooth.
• replace_asset (bool) – Replace default asset with smoothed model.
• frames (list[int]) – List of frames to process.
• progress (Callable[[float], None]) – Progress callback.
smoothPointCloud(smoothing_radius=0[, point_cloud ][, classes ], apply_to_selection=False,
clip_to_region=False, replace_asset=False[, frames ][, progress ])
Smooth point cloud.
Parameters
• smoothing_radius (float) – Desired smoothing radius (m).
• point_cloud (int) – Key of point cloud to filter.
• classes (list[int]) – List of point classes to be smoothed.
• apply_to_selection (bool) – Smooth points within selection.
• clip_to_region (bool) – Clip point cloud to chunk region.
• replace_asset (bool) – Replace default asset with smoothed point cloud.
• frames (list[int]) – List of frames to process.
• progress (Callable[[float], None]) – Progress callback.
sortCameras()
Sorts cameras by their labels.
sortMarkers()
Sorts markers by their labels.
sortScalebars()
Sorts scalebars by their labels.
splitComponents(items[, progress ])
Split components.
Parameters
• items (list[[Link] | [Link]]) – List of items to
split.
• progress (Callable[[float], None]) – Progress callback.

70 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

thinTiePoints(point_limit=1000)
Remove excessive tracks from the tie point cloud.
Parameters
point_limit (int) – Maximum number of points for each photo.
thumbnails
Image thumbnails.
Type
[Link]
tie_points
Generated tie point cloud.
Type
[Link]
tiepoint_accuracy
Expected tie point accuracy in pixels.
Type
float
tiled_model
Default tiled model for the current frame.
Type
[Link]
tiled_models
List of tiled models for the current frame.
Type
list[[Link]]
trackMarkers(first_frame=0, last_frame=0[, progress ])
Track marker projections through the frame sequence.
Parameters
• first_frame (int) – Starting frame index.
• last_frame (int) – Ending frame index.
• progress (Callable[[float], None]) – Progress callback.
trajectories
List of trajectories for the current frame.
Type
list[[Link]]
trajectory
Default trajectory for the current frame.
Type
[Link]
transform
4x4 matrix specifying chunk location in the world coordinate system.

71
Metashape Python Reference, Release 2.2.1

Type
[Link]
transformRaster(source_data=ElevationData[, asset ], subtract=False[, operand_chunk ][,
operand_frame ][, operand_asset ], width=0, height=0[, world_transform ],
resolution=0, resolution_x=0, resolution_y=0, nodata_value=-32767, north_up=True[,
region ][, projection ], clip_to_boundary=True, copy_orthophotos=True,
replace_asset=False[, frames ][, progress ])
Transform DEM or orthomosaic.
Parameters
• source_data ([Link]) – Selects between DEM and orthomosaic.
• asset (int) – Asset key to transform.
• subtract (bool) – Subtraction flag.
• operand_chunk (int) – Operand chunk key.
• operand_frame (int) – Operand frame key.
• operand_asset (int) – Operand asset key.
• width (int) – Raster width.
• height (int) – Raster height.
• world_transform ([Link]) – 2x3 raster-to-world transformation matrix.
• resolution (float) – Output resolution in meters.
• resolution_x (float) – Pixel size in the X dimension in projected units.
• resolution_y (float) – Pixel size in the Y dimension in projected units.
• nodata_value (float) – No-data value (DEM export only).
• north_up (bool) – Use north-up orientation for export.
• region ([Link]) – Region to be processed.
• projection ([Link]) – Output projection.
• clip_to_boundary (bool) – Clip raster to boundary shapes.
• copy_orthophotos (bool) – Copy orthophotos (orthomosaic asset type only).
• replace_asset (bool) – Replace default raster with transformed one.
• frames (list[int]) – List of frames to process.
• progress (Callable[[float], None]) – Progress callback.
triangulateTiePoints(max_error=10, min_image=2[, progress ])
Rebuild tie point cloud for the chunk.
Parameters
• max_error (float) – Reprojection error threshold.
• min_image (int) – Minimum number of point projections.
• progress (Callable[[float], None]) – Progress callback.
updateTransform()
Update chunk transformation based on reference data.

72 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

world_crs
Coordinate system used as world coordinate system.
Type
[Link]
class [Link]
Transformation between chunk and world coordinates systems.
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]
matrix
Transformation matrix.
Type
[Link]
rotation
Rotation component.
Type
[Link]
scale
Scale component.
Type
float
translation
Translation component.
Type
[Link]
class [Link]
CIR calibration matrix.
calibrate()
Calibrate CIR matrix based on orthomosaic histogram.
coeffs
Color matrix.
Type
[Link]
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]

73
Metashape Python Reference, Release 2.2.1

reset()
Reset CIR calibration matrix.
class [Link]
Index values classification method in [EqualIntervalsClassification, JenksNaturalBreaksClassification]
class [Link]
CloudClient class provides access to the Agisoft Cloud processing service and allows to create and manage cloud
projects.
The following example connects to the service and lists available projects:

>>> import Metashape


>>> client = [Link]()
>>> [Link] = 'user'
>>> [Link] = 'password'
>>> [Link]()

abortProcessing(document)
Cancel processing.
Parameters
document ([Link]) – Project to cancel.
client_id
Client software id (optional).
Type
str
client_secret
Client software secret (optional).
Type
str
downloadProject(document [, progress ])
Download project from the cloud.
Parameters
• document ([Link]) – Project to download.
• progress (Callable[[float], None]) – Progress callback.
getProcessingStatus(document)
Get processing status.
Parameters
document ([Link]) – Project being processed.
Returns
Processing status.
Return type
dict
getProjectList()
Get list of projects in the cloud.

74 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Returns
List of projects.
Return type
list
password
Cloud account password.
Type
str
processProject(document, tasks)
Start processing in the cloud.
Parameters
• document ([Link]) – Project to process.
• tasks (list[[Link]]) – List of processing tasks to execute.
uploadProject(document, publish=False[, progress ])
Upload project to the cloud.
Parameters
• document ([Link]) – Project to upload.
• publish (bool) – Publish project for online visualization.
• progress (Callable[[float], None]) – Progress callback.
username
Cloud account username.
Type
str
class [Link]
Component instance
chunk
Chunk the component belongs to.
Type
[Link]
key
Component identifier.
Type
int
label
Component label.
Type
str
partition
Component partition.

75
Metashape Python Reference, Release 2.2.1

Type
list
region
Reconstruction volume selection.
Type
[Link]
transform
4x4 matrix specifying chunk location in the world coordinate system.
Type
[Link]
class [Link]
Coordinate reference system (local, geographic or projected).
The following example changes chunk coordinate system to WGS 84 / UTM zone 41N and loads reference data
from file:

>>> import Metashape


>>> chunk = [Link]
>>> [Link] = [Link]("EPSG::32641")
>>> [Link]("[Link]", [Link])
>>> [Link]()

addGeoid(path)
Register geoid model.
Parameters
path (str) – Path to geoid file.
authority
Authority identifier of the coordinate system.
Type
str
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]
datumTransform(source, target)
Coordinate transformation from source to target coordinate system datum.
Parameters
• source ([Link]) – Source coordinate system.
• target ([Link]) – Target coordinate system.
Returns
4x4 transformation matrix.
Return type
[Link]

76 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

geoccs
Base geocentric coordinate system.
Type
[Link]
geogcs
Base geographic coordinate system.
Type
[Link]
geoid_height
Fixed geoid height to be used instead of interpolated values.
Type
float
init(crs)
Initialize projection based on specified WKT definition or authority identifier.
Parameters
crs (str) – WKT definition of coordinate system or authority identifier.
listBuiltinCRS()
Returns a list of builtin coordinate systems.
listGeoids()
Returns a list of loaded geoids.
localframe(point)
Returns 4x4 transformation matrix to LSE coordinates at the given point.
Parameters
point ([Link]) – Coordinates of the origin in the geocentric coordinates.
Returns
Transformation from geocentric coordinates to local coordinates.
Return type
[Link]
name
Name of the coordinate system.
Type
str
proj4
Coordinate system definition in PROJ.4 format.
Type
str
project(point)
Projects point from geocentric coordinates to projected geographic coordinate system.
Parameters
point ([Link]) – 3D point in geocentric coordinates.
Returns
3D point in projected coordinates.

77
Metashape Python Reference, Release 2.2.1

Return type
[Link]
setContext(document)
Set geoid lookup context.
Parameters
document ([Link]) – Document to use for geoid lookup.
towgs84
TOWGS84 transformation parameters (dx, dy, dz, rx, ry, rz, scale).
Type
list[float]
transform(point, source, target)
Transform point coordinates between coordinate systems.
Parameters
• point ([Link]) – 2D or 3D point coordinates.
• source ([Link]) – Source coordinate system.
• target ([Link]) – Target coordinate system.
Returns
Transformed point coordinates.
Return type
[Link]
transformationMatrix(point, source, target)
Local approximation of coordinate transformation from source to target coordinate system at the given
point.
Parameters
• point ([Link]) – 3D point coordinates.
• source ([Link]) – Source coordinate system.
• target ([Link]) – Target coordinate system.
Returns
4x4 transformation matrix.
Return type
[Link]
unproject(point)
Unprojects point from projected coordinates to geocentric coordinates.
Parameters
point ([Link]) – 3D point in projected coordinate system.
Returns
3D point in geocentric coordinates.
Return type
[Link]

78 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

wkt
Coordinate system definition in WKT format.
Type
str
wkt2
Coordinate system definition in WKT format, version 2.
Type
str
class [Link]
Data source in [TiePointsData, PointCloudData, ModelData, TiledModelData, ElevationData, OrthomosaicData,
DepthMapsData, ImagesData, TrajectoryData, LaserScansData, DepthMapsAndLaserScansData, MasksData,
BlockModelData]
class [Link]
Data type in [DataTypeUndefined, DataType8i, DataType8u, DataType16i, DataType16u, DataType16f,
DataType32i, DataType32u, DataType32f, DataType64i, DataType64u, DataType64f]
class [Link]
Depth map data.
calibration
Depth map calibration.
Type
[Link]
copy()
Returns a copy of the depth map.
Returns
Copy of the depth map.
Return type
[Link]
getCalibration(level=0)
Returns calibration data.
Parameters
level (int) – Level index.
Returns
Calibration data.
Return type
[Link]
image([level ])
Returns image data.
Parameters
level (int) – Level index.
Returns
Image data.
Return type
[Link]

79
Metashape Python Reference, Release 2.2.1

setCalibration(calibration, level=0)

Parameters
• calibration ([Link]) – Calibration data.
• level (int) – Level index.
setImage(image, level=0)

Parameters
• image ([Link]) – Image object with depth map data.
• level (int) – Level index.
class [Link]
A set of depth maps generated for a chunk frame.
clear()
Clears depth maps data.
copy()
Create a copy of the depth maps.
Returns
Copy of the depth maps.
Return type
[Link]
items()
List of items.
key
Depth maps identifier.
Type
int
keys()
List of item keys.
label
Depth maps label.
Type
str
meta
Depth maps meta data.
Type
[Link]
modified
Modified flag.
Type
bool

80 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

values()
List of item values.
class [Link]
Metashape project.
Contains list of chunks available in the project. Implements processing operations that work with multiple
chunks. Supports saving/loading project files.
The project currently opened in Metashape window can be accessed using [Link] attribute.
Additional Document objects can be created as needed.
The following example saves active chunk from the opened project in a separate project:

>>> import Metashape


>>> doc = [Link]
>>> [Link](path = "[Link]", chunks = [[Link]])

addChunk()
Add new chunk to the document.
Returns
Created chunk.
Return type
[Link]
addGeoid(path)
Add geoid to the document.
Parameters
path (str) – Path to the geoid file.
alignChunks([chunks ][, reference ], method=0, fit_scale=True, downscale=1, generic_preselection=False,
filter_mask=False, mask_tiepoints=False, keypoint_limit=40000[, markers ][, progress ])
Align specified set of chunks.
Parameters
• chunks (list[int]) – List of chunks to be aligned.
• reference (int) – Chunk to be used as a reference.
• method (int) – Alignment method (0 - point based, 1 - marker based, 2 - camera based).
• fit_scale (bool) – Fit chunk scale during alignment.
• downscale (int) – Alignment accuracy (0 - Highest, 1 - High, 2 - Medium, 4 - Low, 8 -
Lowest).
• generic_preselection (bool) – Enables image pair preselection.
• filter_mask (bool) – Filter points by mask.
• mask_tiepoints (bool) – Apply mask filter to tie points.
• keypoint_limit (int) – Maximum number of points for each photo.
• markers (list[int]) – List of markers to be used for marker based alignment.
• progress (Callable[[float], None]) – Progress callback.

81
Metashape Python Reference, Release 2.2.1

append(document [, chunks ][, progress ])


Append the specified Document object to the current document.
Parameters
• document ([Link]) – Document object to be appended.
• chunks (list[[Link]]) – List of chunks to append.
• progress (Callable[[float], None]) – Progress callback.
chunk
Active chunk.
Type
[Link]
chunks
List of chunks in the document.
Type
list[[Link]]
clear()
Clear the contents of the Document object.
copy()
Return a copy of the document.
Returns
A copy of the document.
Return type
[Link]
findChunk(key)
Find chunk by its key.
Returns
Found chunk.
Return type
[Link]
geoids
List of geoids in the document.
Type
list[[Link]]
mergeChunks(copy_laser_scans=True, copy_masks=True, copy_depth_maps=False,
copy_point_clouds=False, copy_models=False, copy_tiled_models=False,
copy_elevations=False, copy_orthomosaics=False, merge_markers=False,
merge_tiepoints=False, merge_assets=False[, chunks ][, progress ])
Merge specified set of chunks.
Parameters
• copy_laser_scans (bool) – Copy laser scans.
• copy_masks (bool) – Copy masks.
• copy_depth_maps (bool) – Copy depth maps.

82 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• copy_point_clouds (bool) – Copy point clouds.


• copy_models (bool) – Copy models.
• copy_tiled_models (bool) – Copy tiled models.
• copy_elevations (bool) – Copy DEMs.
• copy_orthomosaics (bool) – Copy orthomosaics.
• merge_markers (bool) – Merge markers.
• merge_tiepoints (bool) – Merge tie points.
• merge_assets (bool) – Merge default assets.
• chunks (list[int]) – List of chunks to process.
• progress (Callable[[float], None]) – Progress callback.
meta
Document meta data.
Type
[Link]
modified
Modified flag.
Type
bool
open(path, read_only=False, ignore_lock=False, archive=True)
Load document from the specified file.
Parameters
• path (str) – Path to the file.
• read_only (bool) – Open document in read-only mode.
• ignore_lock (bool) – Ignore lock state for project modifications.
• archive (bool) – Override project format when using non-standard file extension.
path
Path to the document file.
Type
str
read_only
Read only status.
Type
bool
remove(items)
Remove a set of items from the document.
Parameters
items (list[[Link] | [Link]]) – A list of items to be removed.

83
Metashape Python Reference, Release 2.2.1

save([path ][, chunks ][, version ], archive=True)


Save document to the specified file.
Parameters
• path (str) – Optional path to the file.
• chunks (list[[Link]]) – List of chunks to be saved.
• version (str) – Project version to save.
• archive (bool) – Override project format when using non-standard file extension.
sortChunks()
Sorts chunks by their labels.
class [Link]
Digital elevation model.
class Patch
Elevation patch.
class InterpolationType
DEM fill patch interpolation method in [Constant, Plane, IDW, NaturalNeighbour]
class Type
DEM patch type in [Fill, Breakline]
copy()
Returns a copy of the patch.
Returns
Copy of the patch.
Return type
[Link]
exclude_nested_polygons
Exclude nested polygons.
Type
bool
fill_elevation
Elevation value for Constant interpolation method.
Type
float
idw_power
Power parameter for IDW interpolation method.
Type
int
interpolation_type
Interpolation method.
Type
[Link]
sample_edges
Sample values from polygon edges (ignored for Constant interpolation method).
Type
bool

84 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

type
Patch type.
Type
[Link]
class Patches
A set of elevation patches.
items()
List of items.
keys()
List of item keys.
remove(items)
Remove patches from the elevation.
Parameters
items (list[[Link]] | [Link]) – A list of items to be re-
moved.
values()
List of item values.
altitude(point)
Return elevation value at the specified point.
Parameters
point ([Link]) – Point coordinates in the DEM coordinate system.
Returns
Elevation value.
Return type
float
altitudeSlopeAspect(point)
Return elevation, slope and aspect values at the specified point.
Parameters
point ([Link]) – Point coordinates in the DEM coordinate system.
Returns
Elevation, slope and aspect values.
Return type
tuple[float, float, float]
bottom
Y coordinate of the bottom side.
Type
float
clear()
Clears digital elevation model data.
copy()
Create a copy of the digital elevation model.
Returns
Copy of the digital elevation model.

85
Metashape Python Reference, Release 2.2.1

Return type
[Link]
coverageArea()
Calculate coverage area of the DEM in m^2. Only pixels with data are used.
Returns
Area covered by the DEM.
Return type
float
crs
Coordinate system of elevation model.
Type
[Link]
height
Elevation model height.
Type
int
key
Elevation model identifier.
Type
int
label
Elevation model label.
Type
str
left
X coordinate of the left side.
Type
float
max
Maximum elevation value.
Type
float
meta
Elevation model meta data.
Type
[Link]
min
Minimum elevation value.
Type
float

86 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

modified
Modified flag.
Type
bool
palette
Color palette.
Type
dict
palette_absolute_values
Use palette keys as absolute elevation values.
Type
bool
patches
Elevation patches.
Type
[Link]
pickPoint(origin, target)
Returns ray intersection with the DEM (point on the ray nearest to some point).
Parameters
• origin ([Link]) – Ray origin in the DEM coordinate system.
• target ([Link]) – Point on the ray in the DEM coordinate system.
Returns
Coordinates of the intersection point in the DEM coordinate system.
Return type
[Link]
projection
Projection of elevation model.
Type
[Link]
resolution
DEM resolution in meters.
Type
float
right
X coordinate of the right side.
Type
float
top
Y coordinate of the top side.
Type
float

87
Metashape Python Reference, Release 2.2.1

update([progress ])
Apply edits to elevation.
Parameters
progress (Callable[[float], None]) – Progress callback.
width
Elevation model width.
Type
int
class [Link]
Euler angles in [EulerAnglesYPR, EulerAnglesOPK, EulerAnglesPOK, EulerAnglesANK]
class [Link]
Face count in [LowFaceCount, MediumFaceCount, HighFaceCount, CustomFaceCount]
class [Link]
Depth filtering mode in [NoFiltering, MildFiltering, ModerateFiltering, AggressiveFiltering]
class [Link]
Frame step size for video import in [CustomFrameStep, SmallFrameStep, MediumFrameStep, LargeFrameStep]
class [Link]
Geoid attributes
authority
Geoid authority.
Type
str
height
Geoid height.
Type
int
horz_crs
Horizontal coordinate system.
Type
[Link]
name
Geoid name.
Type
str
path
Path to geoid file.
Type
str
vert_crs
Vertical coordinate system.

88 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
[Link]
width
Geoid width.
Type
int
class [Link]
Geometry data.
GeometryCollection(geometries)
Create a GeometryCollection geometry.
Parameters
geometries (list[[Link]]) – Child geometries.
Returns
A GeometryCollection geometry.
Return type
[Link]
LineString(coordinates)
Create a LineString geometry.
Parameters
coordinates (list[[Link]]) – List of vertex coordinates.
Returns
A LineString geometry.
Return type
[Link]
MultiLineString(geometries)
Create a MultiLineString geometry.
Parameters
geometries (list[[Link]]) – Child line strings.
Returns
A point geometry.
Return type
[Link]
MultiPoint(geometries)
Create a MultiPoint geometry.
Parameters
geometries (list[[Link]]) – Child points.
Returns
A point geometry.
Return type
[Link]

89
Metashape Python Reference, Release 2.2.1

MultiPolygon(geometries)
Create a MultiPolygon geometry.
Parameters
geometries (list[[Link]]) – Child polygons.
Returns
A point geometry.
Return type
[Link]
Point(vector)
Create a Point geometry.
Parameters
vector ([Link] | list[float]) – Point coordinates.
Returns
A point geometry.
Return type
[Link]
Polygon(exterior_ring[, interior_rings ])
Create a Polygon geometry.
Parameters
• exterior_ring (list[[Link]]) – Point coordinates.
• interior_rings (list[[Link]]) – Point coordinates.
Returns
A Polygon geometry.
Return type
[Link]
class Type
Geometry type in [PointType, LineStringType, PolygonType, MultiPointType, MultiLineStringType, Mul-
tiPolygonType, GeometryCollectionType]
coordinates
List of vertex coordinates.
Type
list[[Link]]
geometries
List of child geometries.
Type
list[[Link]]
is_3d
Is 3D flag.
Type
bool

90 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

type
Geometry type.
Type
[Link]
class [Link](width, height, channels, datatype='U8')
n-channel image
Parameters
• width (int) – image width
• height (int) – image height
• channels (str) – color channel layout, e.g. ‘RGB’, ‘RGBA’, etc.
• datatype (str) – pixel data type in [‘U8’, ‘U16’, ‘U32’, ‘F16’, ‘F32’, ‘F64’]
channels
Channel mapping for the image.
Type
str
cn
Number of color channels.
Type
int
convert(channels[, datatype ])
Convert image to specified data type and channel layout.
Parameters
• channels (str) – color channels to be loaded, e.g. ‘RGB’, ‘RGBA’, etc.
• datatype (str) – pixel data type in [‘U8’, ‘U16’, ‘U32’, ‘F16’, ‘F32’, ‘F64’]
Returns
Converted image.
Return type
[Link]
copy()
Return a copy of the image.
Returns
copy of the image
Return type
[Link]
data_type
Data type used to store pixel values.
Type
str

91
Metashape Python Reference, Release 2.2.1

fromstring(data, width, height, channels, datatype='U8')


Create image from byte array.
Parameters
• data (str) – raw image data
• width (int) – image width
• height (int) – image height
• channels (str) – color channel layout, e.g. ‘RGB’, ‘RGBA’, etc.
• datatype (str) – pixel data type in [‘U8’, ‘U16’, ‘U32’, ‘F16’, ‘F32’, ‘F64’]
Returns
Created image.
Return type
[Link]
gaussianBlur(radius)
Smooth image with a gaussian filter.
Parameters
radius (float) – smoothing radius.
Returns
Smoothed image.
Return type
[Link]
height
Image height.
Type
int
open(path, layer=0, datatype='U8' [, channels ][, x ][, y ][, w ][, h ])
Load image from file.
Parameters
• path (str) – path to the image file
• layer (int) – image layer in case of multipage file
• datatype (str) – pixel data type in [‘U8’, ‘U16’, ‘U32’, ‘F16’, ‘F32’, ‘F64’]
• channels (str) – color channels to be loaded, e.g. ‘RGB’, ‘RGBA’, etc.
• x (int) – x offset of image region.
• y (int) – y offset of image region.
• w (int) – width of image region.
• h (int) – height of image region.
Returns
Loaded image.
Return type
[Link]

92 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

resize(width, height)
Resize image to specified dimensions.
Parameters
• width (int) – new image width
• height (int) – new image height
Returns
resized image
Return type
[Link]
save(path[, compression ])
Save image to the file.
Parameters
• path (str) – path to the image file
• compression ([Link]) – compression options
tostring()
Convert image to byte array.
Returns
Raw image data.
Return type
str
undistort(calib, center_principal_point=True, square_pixels=True)
Undistort image using provided calibration.
Parameters
• calib ([Link]) – lens calibration
• center_principal_point (bool) – moves principal point to the image center
• square_pixels (bool) – create image with square pixels
Returns
undistorted image
Return type
[Link]
uniformNoise(amplitude)
Add uniform noise with specified amplitude.
Parameters
amplitude (float) – noise amplitude.
Returns
Image with added noise.
Return type
[Link]

93
Metashape Python Reference, Release 2.2.1

warp(calib0, trans0, calib1, trans1)


Warp image by rotating virtual viewpoint.
Parameters
• calib0 ([Link]) – initial calibration
• trans0 ([Link]) – initial camera orientation as 4x4 matrix
• calib1 ([Link]) – final calibration
• trans1 ([Link]) – final camera orientation as 4x4 matrix
Returns
warped image
Return type
[Link]
width
Image width.
Type
int
class [Link]
Image compression parameters.
The following example demonstrates how to export orthomosaic with custom compression parameters:

>>> import Metashape


>>> doc = [Link]
>>> chunk = [Link]
>>> compression = [Link]()
>>> compression.tiff_tiled = True
>>> compression.tiff_overviews = True
>>> compression.tiff_compression = [Link]
>>> compression.jpeg_quality = 95
>>> [Link]('[Link]', source_data=[Link], image_
˓→compression=compression)

class TiffCompression
Tiff compression in [TiffCompressionNone, TiffCompressionLZW, TiffCompressionJPEG, TiffCompres-
sionPackbits, TiffCompressionDeflate]
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]
jpeg_quality
JPEG quality.
Type
int

94 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

tiff_big
Enable BigTIFF compression for TIFF files.
Type
bool
tiff_compression
Tiff compression.
Type
int
tiff_overviews
Enable image pyramid deneration for TIFF files.
Type
bool
tiff_tiled
Export tiled TIFF.
Type
bool
class [Link]
Image format in [ImageFormatNone, ImageFormatJPEG, ImageFormatTIFF, ImageFormatPNG, ImageFor-
matBMP, ImageFormatEXR, ImageFormatPNM, ImageFormatSGI, ImageFormatCR2, ImageFormatBZ2, Im-
ageFormatSEQ, ImageFormatBIL, ImageFormatASCII, ImageFormatXYZ, ImageFormatARA, ImageFor-
matTGA, ImageFormatDDS, ImageFormatJP2, ImageFormatWebP, ImageFormatJXL, ImageFormatKTX]
class [Link]
Image layout in [UndefinedLayout, FlatLayout, MultiframeLayout, MultiplaneLayout]
class [Link]
Interpolation mode in [DisabledInterpolation, EnabledInterpolation, Extrapolated]
class [Link]
License information.
activate(license_key)
Activate software online using a license key.
Parameters
key (str) – Activation key.
activateOffline(activation_params)
Create a request for offline activation.
Parameters
activation_params (str) – The content of .actparam file.
Returns
The activation request which should be saved to .actreq file.
Return type
str
borrowLicense(seconds)
Borrow floating license for the specified number of seconds.

95
Metashape Python Reference, Release 2.2.1

Parameters
seconds (int) – Borrow duration in seconds.
borrowed
License borrowed flag.
Type
bool
deactivate()
Deactivate software online.
deactivateOffline()
Create a request for offline deactivation.
Returns
The deactivation request which should be saved to .actreq file.
Return type
str
expiration
License expiration as a Unix timestamp in seconds.
Type
int
floating
License floating flag.
Type
bool
install(activation_response)
Install license from the activation response.
Parameters
activation_response (str) – The content of .actresp file.
rehostable
License rehostable flag.
Type
bool
returnLicense()
Return borrowed license to the license server.
valid
Metashape activation status.
Type
bool
class [Link]
UV mapping mode in [GenericMapping, OrthophotoMapping, AdaptiveOrthophotoMapping, SphericalMap-
ping, CameraMapping]
class [Link]
Marker instance

96 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

class Projection
Marker data().
coord
Point coordinates in pixels.
Type
[Link]
pinned
Pinned flag.
Type
bool
valid
Valid flag.
Type
bool
class Projections
Collection of projections specified for the marker
items()
List of items.
keys()
List of item keys.
values()
List of item values.
class Reference
Marker reference data.
accuracy
Marker location accuracy.
Type
[Link]
enabled
Enabled flag.
Type
bool
location
Marker coordinates.
Type
[Link]
class Type
Marker type in [Regular, Vertex, Fiducial]
chunk
Chunk the marker belongs to.
Type
[Link]

97
Metashape Python Reference, Release 2.2.1

enabled
Enables/disables the marker.
Type
bool
frames
Marker frames.
Type
list[[Link]]
group
Marker group.
Type
[Link]
key
Marker identifier.
Type
int
label
Marker label.
Type
str
meta
Marker meta data.
Type
[Link]
position
Marker position in the current frame.
Type
[Link]
position_covariance
Marker position covariance.
Type
[Link]
projections
List of marker projections.
Type
[Link]
reference
Marker reference data.
Type
[Link]

98 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

selected
Selects/deselects the marker.
Type
bool
sensor
Fiducial mark sensor.
Type
[Link]
type
Marker type.
Type
[Link]
class [Link]
MarkerGroup objects define groups of multiple markers. The grouping is established by assignment of a Mark-
erGroup instance to the [Link] attribute of participating markers.
key
Marker group identifier.
Type
int
label
Marker group label.
Type
str
selected
Current selection state.
Type
bool
class [Link]
Mask instance
copy()
Returns a copy of the mask.
Returns
Copy of the mask.
Return type
[Link]
image()
Returns image data.
Returns
Image data.
Return type
[Link]

99
Metashape Python Reference, Release 2.2.1

invert()
Create inverted copy of the mask.
Returns
Inverted copy of the mask.
Return type
[Link]
load(path[, layer ])
Loads mask from file.
Parameters
• path (str) – Path to the image file to be loaded.
• layer (int) – Optional layer index in case of multipage files.
setImage(image)

Parameters
image ([Link]) – Image object with mask data.
class [Link]
Mask operation in [MaskOperationReplacement, MaskOperationUnion, MaskOperationIntersection, MaskOp-
erationDifference]
class [Link]
Masking mode in [MaskingModeAlpha, MaskingModeFile, MaskingModeBackground, MaskingModeModel,
MaskingModeAI]
class [Link]
A set of masks for a chunk frame.
clear()
Clears masks data.
copy()
Create a copy of the masks.
Returns
Copy of the masks.
Return type
[Link]
items()
List of items.
key
Masks identifier.
Type
int
keys()
List of item keys.
label
Masks label.

100 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
str
meta
Masks meta data.
Type
[Link]
modified
Modified flag.
Type
bool
values()
List of item values.
class [Link]
m-by-n matrix

>>> import Metashape


>>> m1 = [Link]( (1,2,3,4) )
>>> m3 = [Link]( [[1,2,3,4], [1,2,3,4], [1,2,3,4], [1,2,3,4]] )
>>> m2 = [Link]()
>>> m3 = m1 * m2
>>> x = [Link]()
>>> if x == 1:
... [Link]("Diagonal matrix dimensions: " + str([Link]))

Diag(vector)
Create a diagonal matrix.
Parameters
vector ([Link] | list[float]) – The vector of diagonal entries.
Returns
A diagonal matrix.
Return type
[Link]
Rotation(matrix)
Create a rotation matrix.
Parameters
matrix ([Link]) – The 3x3 rotation matrix.
Returns
4x4 matrix representing rotation.
Return type
[Link]
Scale(scale)
Create a scale matrix.
Parameters
scale ([Link]) – The scale vector.

101
Metashape Python Reference, Release 2.2.1

Returns
A matrix representing scale.
Return type
[Link]
Translation(vector)
Create a translation matrix.
Parameters
vector ([Link]) – The translation vector.
Returns
A matrix representing translation.
Return type
[Link]
col(index)
Returns column of the matrix.
Returns
matrix column.
Return type
[Link]
copy()
Returns a copy of this matrix.
Returns
an instance of itself
Return type
[Link]
det()
Return the determinant of a matrix.
Returns
Return a the determinant of a matrix.
Return type
float
inv()
Returns an inverted copy of the matrix.
Returns
inverted matrix.
Return type
[Link]
mulp(point)
Transforms a point in homogeneous coordinates.
Parameters
point ([Link]) – The point to be transformed.
Returns
transformed point.

102 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Return type
[Link]
mulv(vector)
Transforms vector in homogeneous coordinates.
Parameters
vector ([Link]) – The vector to be transformed.
Returns
transformed vector.
Return type
[Link]
rotation()
Returns rotation component of the 4x4 matrix.
Returns
rotation component
Return type
[Link]
row(index)
Returns row of the matrix.
Returns
matrix row.
Return type
[Link]
scale()
Returns scale component of the 4x4 matrix.
Returns
scale component
Return type
float
size
Matrix dimensions.
Type
tuple
svd()
Returns singular value decomposition of the matrix.
Returns
u, s, v tuple where a = u * diag(s) * v
Return type
tuple[[Link], [Link], [Link]]
t()
Return a new, transposed matrix.
Returns
a transposed matrix

103
Metashape Python Reference, Release 2.2.1

Return type
[Link]
translation()
Returns translation component of the 4x4 matrix.
Returns
translation component
Return type
[Link]
zero()
Set all matrix elements to zero.
class [Link](object)
Collection of object properties
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]
items()
List of items.
keys()
List of item keys.
values()
List of item values.
class [Link]
Triangular mesh model instance
class Criterion
Model filter criterion in [ComponentSize, PolygonSize, VertexConfidence]
class Face
Triangular face of the model
hidden
Face visibility flag.
Type
bool
selected
Face selection flag.
Type
bool
tex_index
Texture page index.
Type
int

104 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

tex_vertices
Texture vertex indices.
Type
tuple[int, int, int]
vertices
Vertex indices.
Type
tuple[int, int, int]
class Faces
Collection of model faces
resize(count)
Resize faces list.
Parameters
count (int) – new face count
class Statistics
Model statistics
components
Number of connected components.
Type
int
degenerate_faces
Number of degenerate faces.
Type
int
duplicate_faces
Number of duplicate faces.
Type
int
faces
Total number of faces.
Type
int
flipped_normals
Number of edges with flipped normals.
Type
int
free_vertices
Number of free vertices.
Type
int
invalid_vertices
Number of vertices with NaN coordinates.
Type
int

105
Metashape Python Reference, Release 2.2.1

multiple_edges
Number of edges connecting more than 2 faces.
Type
int
open_edges
Number of open edges.
Type
int
out_of_range_indices
Number of out of range indices.
Type
int
similar_vertices
Number of similar vertices.
Type
int
vertices
Total number of vertices.
Type
int
zero_faces
Number of zero faces.
Type
int
class TexVertex
Texture vertex of the model
coord
2D vertex coordinates.
Type
[Link]
class TexVertices
Collection of model texture vertices
resize(count)
Resize vertex list.
Parameters
count (int) – new vertex count
class Texture
Model texture.
bands
List of color bands.
Type
list[str]
data_type
Data type used to store color values.

106 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
[Link]
image(page=0)
Return texture image.
Parameters
page (int) – Texture index for multitextured models.
Returns
Texture image.
Return type
[Link]
label
Animation label.
Type
str
meta
Camera track meta data.
Type
[Link]
model
Model the texture belongs to.
Type
[Link]
setImage(image, page=0)
Initialize texture from image data.
Parameters
• image ([Link]) – Texture image.
• page (int) – Texture index for multitextured models.
type
Texture type.
Type
[Link]
class TextureType
Texture type in [DiffuseMap, NormalMap, OcclusionMap, DisplacementMap]
class Vertex
Vertex of the model
color
Vertex color.
Type
tuple of numbers
confidence
Vertex confidence.
Type
float
coord
Vertex coordinates.

107
Metashape Python Reference, Release 2.2.1

Type
[Link]
class Vertices
Collection of model vertices
resize(count)
Resize vertex list.
Parameters
count (int) – new vertex count
addTexture(type=[Link])
Add new texture to the model.
Parameters
type ([Link]) – Texture type.
Returns
Created texture.
Return type
[Link]
area()
Return area of the model surface.
Returns
Model area.
Return type
float
bands
List of color bands.
Type
list[str]
block_index
Model block index.
Type
tuple
block_region
Model block region.
Type
[Link]
cleanModel(criterion, level[, progress ])
Remove model faces based on specified criterion.
Parameters
• criterion ([Link]) – Model filtering criterion.
• level (int) – Filtering threshold in percents.
• progress (Callable[[float], None]) – Progress callback.

108 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

clear()
Clears model data.
closeHoles(level=30, apply_to_selection=False)
Fill holes in the model surface.
Parameters
• level (int) – Hole size threshold in percents.
• apply_to_selection (bool) – Close holes within selection
copy()
Create a copy of the model.
Returns
Copy of the model.
Return type
[Link]
cropSelection()
Crop selected faces and free vertices from the mesh.
crs
Reference coordinate system.
Type
[Link] | None
data_type
Data type used to store color values.
Type
[Link]
enabled
Enables/disables the model.
Type
bool
faces
Collection of model faces.
Type
[Link]
fixTopology()
Remove polygons causing topological problems.
getActiveTexture(type=[Link])
Return active texture.
Parameters
type ([Link]) – Texture type.
Returns
Texture image.
Return type
[Link]

109
Metashape Python Reference, Release 2.2.1

group
Model group.
Type
[Link]
invertSelection()
Invert selection.
key
Model identifier.
Type
int
label
Model label.
Type
str
loadTexture(path)
Load texture from the specified file.
Parameters
path (str) – Path to the image file.
meta
Model meta data.
Type
[Link]
modified
Modified flag.
Type
bool
pickPoint(origin, target, endpoints=1)
Return ray intersection with mesh.
Parameters
• origin ([Link]) – Ray origin.
• target ([Link]) – Point on the ray.
• endpoints (int) – Number of endpoints to check for (0 - line, 1 - ray, 2 - segment).
Returns
Coordinates of the intersection point.
Return type
[Link]
remove(items)
Remove textures from the model.
Parameters
items (list[[Link]]) – A list of textures to be removed.

110 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

removeComponents(size)
Remove small connected components.
Parameters
size (int) – Threshold on the polygon count of the components to be removed.
removeSelection()
Remove selected faces and free vertices from the mesh.
removeTextures()
Remove textures.
removeUV()
Remove UV mapping.
removeVertexColors()
Remove vertex colors.
removeVertexConfidence()
Remove confidence.
renderDepth(transform, calibration, cull_faces=True, add_alpha=True)
Render model depth image for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• cull_faces (bool) – Enable back-face culling.
• add_alpha (bool) – Generate image with alpha channel.
Returns
Rendered image.
Return type
[Link]
renderImage(transform, calibration, cull_faces=True, add_alpha=True,
raster_transform=RasterTransformNone, matcap_image, smooth_normals=True, color)
Render model image for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• cull_faces (bool) – Enable back-face culling.
• add_alpha (bool) – Generate image with alpha channel.
• raster_transform ([Link]) – Raster band transforma-
tion.
• matcap_image ([Link]) – Matcap image used to shade model.
• smooth_normals – Enable normals smoothing.:type smooth_normals: bool
• color (list[int]:return: Rendered image.) – Solid view color.
Return type
[Link]

111
Metashape Python Reference, Release 2.2.1

renderMask(transform, calibration, cull_faces=True)


Render model mask image for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• cull_faces (bool) – Enable back-face culling.
Returns
Rendered image.
Return type
[Link]
renderNormalMap(transform, calibration, cull_faces=True, add_alpha=True)
Render image with model normals for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• cull_faces (bool) – Enable back-face culling.
• add_alpha (bool) – Generate image with alpha channel.
• smooth_normals – Enable normals smoothing.:type smooth_normals: bool
Returns
Rendered image.
Return type
[Link]
renderPreview(width = 2048, height = 2048[, transform ][, progress ])
Generate model preview image.
Parameters
• width (int) – Preview image width.
• height (int) – Preview image height.
• transform ([Link]) – 4x4 viewpoint transformation matrix.
• progress (Callable[[float], None]) – Progress callback.
Returns
Preview image.
Return type
[Link]
saveTexture(path)
Save texture to the specified file.
Parameters
path (str) – Path to the image file.

112 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

selected
Selects/deselects the model.
Type
bool
setActiveTexture(texture, type=[Link])
Set active texture.
Parameters
• texture ([Link]) – Texture to set.
• type ([Link]) – Texture type.
setVertexColors(channels='RGB', datatype='U8')
Clear vertex colors data and set layout.
Parameters
• channels (str) – color channel layout, e.g. ‘RGB’, ‘RGBA’, etc.
• datatype (str) – pixel data type in [‘U8’, ‘U16’, ‘U32’, ‘F16’, ‘F32’, ‘F64’]
statistics([progress ])
Return model statistics.
Parameters
progress (Callable[[float], None]) – Progress callback.
Returns
Model statistics.
Return type
[Link]
tex_vertices
Collection of model texture vertices.
Type
[Link]
textures
List of model textures.
Type
list[[Link]]
transform
4x4 model transformation matrix.
Type
[Link]
transformVertices(transform)
Transform vertex coordinates.
Parameters
transform ([Link]) – 4x4 transformation matrix.

113
Metashape Python Reference, Release 2.2.1

vertices
Collection of model vertices.
Type
[Link]
volume()
Return volume of the closed model surface.
Returns
Model volume.
Return type
float
class [Link]
Model format in [ModelFormatNone, ModelFormatOBJ, ModelFormat3DS, ModelFormatVRML, Mod-
elFormatPLY, ModelFormatCOLLADA, ModelFormatU3D, ModelFormatPDF, ModelFormatDXF, ModelFor-
matFBX, ModelFormatKMZ, ModelFormatCTM, ModelFormatSTL, ModelFormatDXF_3DF, ModelFormat-
TLS, ModelFormatABC, ModelFormatOSGB, ModelFormatOSGT, ModelFormatGLTF, ModelFormatX3D,
ModelFormatLandXML]
class [Link]
ModelGroup objects define groups of multiple models. The grouping is established by assignment of a Model-
Group instance to the [Link] attribute of participating models.
key
Model group identifier.
Type
int
label
Model group label.
Type
str
meta
Model group meta data.
Type
[Link]
renderPreview(width = 2048, height = 2048[, transform ][, progress ])
Generate block model preview image.
Parameters
• width (int) – Preview image width.
• height (int) – Preview image height.
• transform ([Link]) – 4x4 viewpoint transformation matrix.
• progress (Callable[[float], None]) – Progress callback.
Returns
Preview image.
Return type
[Link]

114 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

selected
Current selection state.
Type
bool
class [Link]
NetworkClient class provides access to the network processing server and allows to create and manage tasks.
The following example connects to the server and lists active tasks:

>>> import Metashape


>>> client = [Link]()
>>> [Link]('[Link]')
>>> [Link]()

abortBatch(batch_id)
Abort batch.
Parameters
batch_id (int) – Batch id.
abortWorker(worker_id)
Abort worker.
Parameters
worker_id (int) – Worker id.
batchInfo(batch_id, revision=0)
Get batch information.
Parameters
• batch_id (int) – Batch id.
• revision (int) – First revision to get.
Returns
Batch information.
Return type
dict
batchList(revision=0)
Get list of batches.
Parameters
revision (int) – First revision to get.
Returns
List of batches.
Return type
dict
connect(host, port=5840)
Connect to the server.
Parameters
• host (str) – Server hostname.
• port (int) – Communication port.

115
Metashape Python Reference, Release 2.2.1

createBatch(path, tasks[, meta ])


Create new batch.
Parameters
• path (str) – Project path relative to root folder.
• tasks (list[[Link]]) – List of processing tasks to execute.
• meta ([Link]) – Batch metadata.
Returns
Batch id.
Return type
int
disconnect()
Disconnect from the server.
exportBatches([batch_ids ])
Export current state of batches.
Parameters
batch_ids (list[int]) – List of batch ids to export.
Returns
Batches data.
Return type
str
findBatch(path)
Get batch id based on project path.
Parameters
path (str) – Project path relative to root folder.
Returns
Batch id.
Return type
int
importBatches(data)
Import batches from exported data.
Parameters
data (str) – Batches data.
quitWorker(worker_id)
Quit worker.
Parameters
worker_id (int) – Worker id.
serverInfo(revision=0)
Get server information.
Parameters
revision (int) – First revision to get.

116 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Returns
Server information.
Return type
dict
serverVersion()
Get server version.
Returns
Server version.
Return type
dict
setBatchPaused(batch_id, paused=True)
Set batch paused state.
Parameters
• batch_id (int) – Batch id.
• paused (bool) – Paused state.
setBatchPriority(batch_id, priority)
Set batch priority.
Parameters
• batch_id (int) – Batch id.
• priority (int) – Batch priority (2 - Highest, 1 - High, 0 - Normal, -1 - Low, -2 - Lowest).
setBatchWorkerLimit(batch_id, worker_limit)
Set worker limit of the batch.
Parameters
• batch_id (int) – Batch id.
• worker_limit (int) – Worker limit of the batch (0 - unlimited).
setWorkerCapability(worker_id, capability)
Set worker capability.
Parameters
• worker_id (int) – Worker id.
• capability (int) – Worker capability (1 - CPU, 2 - GPU, 3 - Any).
setWorkerCpuEnabled(worker_id, cpu_enabled)
Set worker CPU enabled flag.
Parameters
• worker_id (int) – Worker id.
• cpu_enabled (bool) – CPU enabled flag.
setWorkerGpuMask(worker_id, gpu_mask)
Set worker GPU mask.
Parameters
• worker_id (int) – Worker id.

117
Metashape Python Reference, Release 2.2.1

• gpu_mask (int) – GPU device mask.


setWorkerPaused(worker_id, paused=True)
Set worker paused state.
Parameters
• worker_id (int) – Worker id.
• paused (bool) – Paused state.
setWorkerPriority(worker_id, priority)
Set worker priority.
Parameters
• worker_id (int) – Worker id.
• priority (int) – Worker priority (2 - Highest, 1 - High, 0 - Normal, -1 - Low, -2 - Lowest).
workerInfo(worker_id, revision=0)
Get worker information.
Parameters
• worker_id (int) – Worker id.
• revision (int) – First revision to get.
Returns
Worker information.
Return type
dict
workerList(revision=0)
Get list of workers.
Parameters
revision (int) – First revision to get.
Returns
List of workers.
Return type
dict
class [Link]
NetworkTask class contains information about network task and its parameters.
The following example creates a new processing task and submits it to the server:

>>> import Metashape


>>> doc = [Link]
>>> match_photos = [Link]()
>>> match_photos.keypoint_limit = 40000
>>> tasks = []
>>> [Link](match_photos.toNetworkTask([Link]))
>>> client = [Link]()
>>> [Link]('[Link]')
>>> batch_id = [Link]([Link], tasks)
>>> [Link](batch_id, false)

118 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

chunks
List of chunks.
Type
list
frames
List of frames.
Type
list
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
params
Task parameters.
Type
dict
class [Link]
Orthographic projection.
class Type
Projection type in [Planar, Cylindrical]
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]
crs
Base coordinate system.
Type
[Link]
matrix
Ortho transformation matrix.
Type
[Link]
radius
Cylindrical projection radius.
Type
float

119
Metashape Python Reference, Release 2.2.1

transform(point, source, target)


Transform point coordinates between coordinate systems.
Parameters
• point ([Link]) – 2D or 3D point coordinates.
• source ([Link] | [Link]) –
Source coordinate system.
• target ([Link] | [Link]) – Target
coordinate system.
Returns
Transformed point coordinates.
Return type
[Link]
type
Projection type.
Type
[Link]
class [Link]
Orthomosaic data.
The following sample assigns to the first shape in the chunk the image from the first camera for the orthomosaic
patch and updates the mosaic:

>>> import Metashape


>>> chunk = [Link]
>>> ortho = [Link]
>>> camera = [Link][0]
>>> shape = [Link][0]
>>> patch = [Link]()
>>> patch.image_keys = [[Link]]
>>> [Link][shape] = patch
>>> [Link]()

class Patch
Orthomosaic patch.
copy()
Returns a copy of the patch.
Returns
Copy of the patch.
Return type
[Link]
excluded
Excluded flag.
Type
bool
image_keys
Image keys.

120 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
list[int]
class Patches
A set of orthomosaic patches.
items()
List of items.
keys()
List of item keys.
values()
List of item values.
bands
List of color bands.
Type
list[str]
bottom
Y coordinate of the bottom side.
Type
float
camera(point)
Get camera used in orthomosaic at the specified point.
Parameters
point ([Link]) – Point coordinates in the orthomosaic coordinate system.
Returns
Camera used in orthomosaic.
Return type
[Link]
clear()
Clears orthomosaic data.
copy()
Create a copy of the orthomosaic.
Returns
Copy of the orthomosaic.
Return type
[Link]
coverageArea()
Calculate coverage area of the orthomosaic in m^2. Only pixels with data are used.
Returns
Area covered by the orthomosaic.
Return type
float

121
Metashape Python Reference, Release 2.2.1

crs
Coordinate system of orthomosaic.
Type
[Link]
data_type
Data type used to store color values.
Type
[Link]
height
Orthomosaic height.
Type
int
key
Orthomosaic identifier.
Type
int
label
Orthomosaic label.
Type
str
left
X coordinate of the left side.
Type
float
meta
Orthomosaic meta data.
Type
[Link]
modified
Modified flag.
Type
bool
patches
Orthomosaic patches.
Type
[Link]
projection
Orthomosaic projection.
Type
[Link]

122 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

removeOrthophotos()
Remove orthorectified images from orthomosaic.
renderPreview(width = 2048, height = 2048[, progress ])
Generate orthomosaic preview image.
Parameters
• width (int) – Preview image width.
• height (int) – Preview image height.
• progress (Callable[[float], None]) – Progress callback.
Returns
Preview image.
Return type
[Link]
reset([progress ])
Reset all edits to orthomosaic.
Parameters
progress (Callable[[float], None]) – Progress callback.
resolution
Orthomosaic resolution in meters.
Type
float
right
X coordinate of the right side.
Type
float
top
Y coordinate of the top side.
Type
float
update([progress ])
Apply edits to orthomosaic.
Parameters
progress (Callable[[float], None]) – Progress callback.
width
Orthomosaic width.
Type
int
class [Link]
Photo instance
alpha()
Returns alpha channel data.

123
Metashape Python Reference, Release 2.2.1

Returns
Alpha channel data.
Return type
[Link]
copy()
Returns a copy of the photo.
Returns
Copy of the photo.
Return type
[Link]
image([channels ][, datatype ])
Returns image data.
Parameters
• datatype (str) – pixel data type in [‘U8’, ‘U16’, ‘U32’, ‘F16’, ‘F32’, ‘F64’]
• channels (str) – color channels to be loaded, e.g. ‘RGB’, ‘RGBA’, etc.
Returns
Image data.
Return type
[Link]
imageMeta()
Returns image meta data.
Returns
Image meta data.
Return type
[Link]
layer
Layer index in the image file.
Type
int
meta
Frame meta data.
Type
[Link]
open(path, layer=0)
Loads specified image file.
Parameters
• path (str) – Path to the image file to be loaded.
• layer (int) – Layer index in case of multipage files.
path
Path to the image file.

124 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
str
thumbnail(width=192, height=192)
Creates new thumbnail with specified dimensions.
Returns
Thumbnail data.
Return type
[Link]
class [Link]
Point class in [Created, Unclassified, Ground, LowVegetation, MediumVegetation, HighVegetation, Building,
LowPoint, ModelKeyPoint, Water, Rail, RoadSurface, OverlapPoints, WireGuard, WireConductor, Transmis-
sionTower, WireConnector, BridgeDeck, HighNoise, Car, Manmade]
class [Link]
Point cloud data.
class Point
Point of the point cloud
classification
Point classification.
Type
int
color
Point color.
Type
tuple[int | float, . . . ]
column_index
Point column index.
Type
int
confidence
Point confidence.
Type
int
intensity
Point intensity.
Type
int
normal
Point normal.
Type
[Link]
position
Point coordinates.
Type
[Link]

125
Metashape Python Reference, Release 2.2.1

return_count
Point return count.
Type
int
return_index
Point return index.
Type
int
row_index
Point row index.
Type
int
scan_angle
Point scan angle.
Type
float
source_id
Point source id.
Type
int
timestamp
Point timestamp.
Type
float
class Points
List of point cloud points
class Reader
Point cloud reader.
column_count
Column count.
Type
int
has_point_classification
Has point classification.
Type
bool
has_point_color
Has point color.
Type
bool
has_point_confidence
Has point confidence.
Type
bool

126 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

has_point_index
Has point row and column indices.
Type
bool
has_point_intensity
Has point intensity.
Type
bool
has_point_normal
Has point normal.
Type
bool
has_point_return_number
Has point return number.
Type
bool
has_point_scan_angle
Has point scan angle.
Type
bool
has_point_source_id
Has point source id.
Type
bool
has_point_timestamp
Has point timestamp.
Type
bool
open(point_cloud)
Open point cloud for reading.
read(count)
Read specified number of points from the point cloud starting from the current position.
Parameters
count (int) – Number of points to read.
Returns
Points data.
Return type
[Link]
reset()
Reset reading position to the first point in the cloud.
row_count
Row count.
Type
int

127
Metashape Python Reference, Release 2.2.1

alignNormals(direction[, point_classes ][, progress ])


Align selected point normals with specified direction.
Parameters
• direction ([Link]) – Normal direction in the chunk coordinate system.
• point_classes ([Link] | list[[Link]]) –
Classes of points to process.
• progress (Callable[[float], None]) – Progress callback.
assignClass(target=0[, source ][, progress ])
Assign class to points.
Parameters
• target ([Link]) – Target class.
• source ([Link] | list[[Link]]) – Classes of
points to be replaced.
• progress (Callable[[float], None]) – Progress callback.
assignClassToSelection(target=0[, source ][, progress ])
Assign class to selected points.
Parameters
• target ([Link]) – Target class.
• source ([Link] | list[[Link]]) – Classes of
points to be replaced.
• progress (Callable[[float], None]) – Progress callback.
bands
List of color bands.
Type
list[str]
classifyGroundPoints(max_angle=10.0, max_distance=1.0, max_terrain_slope=10.0, cell_size=50.0,
erosion_radius=0.0[, source_class ][, return_number ], keep_existing=False[,
progress ])
Classify points into ground and non ground classes.
Parameters
• max_angle (float) – Maximum angle (degrees).
• max_distance (float) – Maximum distance (meters).
• max_terrain_slope (float) – Maximum terrain slope angle (degrees).
• cell_size (float) – Cell size (meters).
• erosion_radius (float) – Erosion radius (meters).
• source_class ([Link]) – Class of points to be re-classified.
• return_number (int) – Point return number to use (0 - any return, 1 - first return, -1 -
last return).
• keep_existing (bool) – Keep existing ground points.

128 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• progress (Callable[[float], None]) – Progress callback.


classifyOverlapPoints([progress ])
Classify overlap points.
Parameters
progress (Callable[[float], None]) – Progress callback.
classifyPoints([source ][, target ], confidence=0.0[, progress ])
Multiclass classification of points.
Parameters
• source ([Link]) – Class of points to be re-classified.
• target (list[[Link]]) – Target point classes for classification.
• confidence (float) – Required confidence level from 0.0 to 1.0.
• progress (Callable[[float], None]) – Progress callback.
clear()
Clears point cloud data.
compactPoints([progress ])
Permanently removes deleted points from point cloud.
Parameters
progress (Callable[[float], None]) – Progress callback.
component
Point cloud component.
Type
[Link]
copy()
Create a copy of the point cloud.
Returns
Copy of the point cloud.
Return type
[Link]
cropSelectedPoints([point_classes ][, progress ])
Crop selected points.
Parameters
• point_classes ([Link] | list[[Link]]) –
Classes of points to be removed.
• progress (Callable[[float], None]) – Progress callback.
crs
Reference coordinate system.
Type
[Link] | None

129
Metashape Python Reference, Release 2.2.1

data_type
Data type used to store color values.
Type
[Link]
enabled
Enables/disables the point cloud.
Type
bool
extent([transform ])
Get point cloud extent.
Parameters
transform ([Link]) – Optional transformation to apply to point coordinates.
Returns
Point cloud extent.
Return type
[Link]
generatePanorama(ignore_colors=False[, progress ])
Generate panorama for structured point cloud.
Parameters
• ignore_colors (bool) – Use intensity information instead of point colors.
• progress (Callable[[float], None]) – Progress callback.
group
Point cloud group.
Type
[Link]
invertNormals([point_classes ][, progress ])
Invert selected point normals.
Parameters
• point_classes ([Link] | list[[Link]]) –
Classes of points to process.
• progress (Callable[[float], None]) – Progress callback.
invertSelection()
Invert selection.
is_laser_scan
Use point cloud as laser scan.
Type
bool
key
Point cloud identifier.
Type
int

130 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

label
Point cloud label.
Type
str
meta
Point cloud meta data.
Type
[Link]
modified
Modified flag.
Type
bool
pickPoint(origin, target, endpoints=1)
Returns ray intersection with the point cloud (point on the ray nearest to some point).
Parameters
• origin ([Link]) – Ray origin in the chunk coordinate system.
• target ([Link]) – Point on the ray in the chunk coordinate system.
• endpoints (int) – Number of endpoints to check for (0 - line, 1 - ray, 2 - segment).
Returns
Coordinates of the intersection point.
Return type
[Link]
point_count
Number of points in point cloud.
Type
int
point_count_by_class
Number of points in each class.
Type
dict
removePoints(point_classes[, progress ])
Remove points.
Parameters
• point_classes ([Link] | list[[Link]]) –
Classes of points to be removed.
• progress (Callable[[float], None]) – Progress callback.
removeSelectedPoints([point_classes ][, progress ])
Remove selected points.
Parameters
• point_classes ([Link] | list[[Link]]) –
Classes of points to be removed.

131
Metashape Python Reference, Release 2.2.1

• progress (Callable[[float], None]) – Progress callback.


renderDepth(transform, calibration, point_size=1, resolution=1, cull_points=False, add_alpha=True)
Render point cloud depth image for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• point_size (int) – Point size.
• resolution (float) – Level of detail resolution in screen pixels.
• cull_points (bool) – Enable normal based culling.
• add_alpha (bool) – Generate image with alpha channel.
Returns
Rendered image.
Return type
[Link]
renderImage(transform, calibration, point_size=1, resolution=1, cull_points=False, add_alpha=True,
raster_transform=RasterTransformNone)
Render point cloud image for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• point_size (int) – Point size.
• resolution (float) – Level of detail resolution in screen pixels.
• cull_points (bool) – Enable normal based culling.
• add_alpha (bool) – Generate image with alpha channel.
• raster_transform ([Link]) – Raster band transforma-
tion.
Returns
Rendered image.
Return type
[Link]
renderMask(transform, calibration, point_size=1, resolution=1, cull_points=False)
Render point cloud mask image for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• point_size (int) – Point size.
• resolution (float) – Level of detail resolution in screen pixels.
• cull_points (bool) – Enable normal based culling.

132 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Returns
Rendered image.
Return type
[Link]
renderNormalMap(transform, calibration, point_size=1, resolution=1, cull_points=False, add_alpha=True)
Render image with point cloud normals for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• point_size (int) – Point size.
• resolution (float) – Level of detail resolution in screen pixels.
• cull_points (bool) – Enable normal based culling.
• add_alpha (bool) – Generate image with alpha channel.
Returns
Rendered image.
Return type
[Link]
renderPreview(width = 2048, height = 2048[, transform ], point_size=1[, progress ])
Generate point cloud preview image.
Parameters
• width (int) – Preview image width.
• height (int) – Preview image height.
• transform ([Link]) – 4x4 viewpoint transformation matrix.
• point_size (int) – Point size.
• progress (Callable[[float], None]) – Progress callback.
Returns
Preview image.
Return type
[Link]
resetFilters()
Reset filters.
restorePoints([point_classes ][, progress ])
Restore deleted points.
Parameters
• point_classes ([Link] | list[[Link]]) –
Classes of points to be restored.
• progress (Callable[[float], None]) – Progress callback.

133
Metashape Python Reference, Release 2.2.1

selectMaskedPoints(cameras, softness=4, only_visible=False[, progress ])


Select points based on image masks.
Parameters
• cameras (list[[Link]]) – A list of cameras to use for selection.
• softness (float) – Mask edge softness.
• only_visible (bool) – Select visible points only.
• progress (Callable[[float], None]) – Progress callback.
selectPointsByColor(color, tolerance=10, channels='RGB' [, progress ])
Select points based on point colors.
Parameters
• color (list[int]) – Color to select.
• tolerance (int) – Color tolerance.
• channels (str) – Combination of color channels to compare in [‘R’, ‘G’, ‘B’, ‘H’, ‘S’,
‘V’].
• progress (Callable[[float], None]) – Progress callback.
selectPointsByRegion(region)
Select points inside box region.
Parameters
region ([Link]) – Box region to select in chunk coordinates
selectPointsByShapes([shapes ][, progress ])
Select points based on shapes.
Parameters
• shapes (list[[Link]]) – A list of shapes to use for selection (selected
shapes if not specified).
• progress (Callable[[float], None]) – Progress callback.
selected
Selects/deselects the point cloud.
Type
bool
setClassesFilter(point_classes)
Set filter by point classes.
Parameters
point_classes ([Link] | list[[Link]]) – List of
point classes.
setConfidenceFilter(min_confidence, max_confidence)
Set filter by confidence.
Parameters
• min_confidence (int) – Minimum confidence value.
• max_confidence (int) – Maximum confidence value.

134 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

setPointReturnsFilter(first_return=True, middle_return=True, last_return=True, single_return=True)


Set filter by point return.
Parameters
• first_return (bool) – First return.
• middle_return (bool) – Intermediate return.
• last_return (bool) – Last return.
• single_return (bool) – Single return.
setSelectionFilter()
Set filter by selection.
transform
4x4 point cloud transformation matrix.
Type
[Link]
updateStatistics([progress ])
Update point cloud statistics.
Parameters
progress (Callable[[float], None]) – Progress callback.
class [Link]
Point cloud format in [PointCloudFormatNone, PointCloudFormatOBJ, PointCloudFormatPLY, PointCloud-
FormatXYZ, PointCloudFormatLAS, PointCloudFormatExpe, PointCloudFormatU3D, PointCloudFormatPDF,
PointCloudFormatE57, PointCloudFormatOC3, PointCloudFormatPotree, PointCloudFormatLAZ, PointCloud-
FormatCL3, PointCloudFormatPTS, PointCloudFormatPTX, PointCloudFormatDXF, PointCloudFormatCe-
sium, PointCloudFormatPCD, PointCloudFormatSLPK, PointCloudFormatCOPC, PointCloudFormatCSV]
class [Link]
PointCloudGroup objects define groups of multiple laser scans. The grouping is established by assignment of a
PointCloudGroup instance to the [Link] attribute of participating laser scans.
crs
Reference coordinate system.
Type
[Link] | None
fixed
Fix relative laser scan positions within the group.
Type
bool
key
Asset group identifier.
Type
int
label
Point cloud group label.
Type
str

135
Metashape Python Reference, Release 2.2.1

meta
Asset group meta data.
Type
[Link]
selected
Current selection state.
Type
bool
transform
4x4 asset group transformation matrix.
Type
[Link]
class [Link]
Image pair preselection in [NoPreselection, GenericPreselection, ReferencePreselection]
class [Link]
Rational polynomial model.
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]
error(point, proj)
Returns projection error.
Parameters
• point ([Link]) – Coordinates of the point to be projected.
• proj ([Link]) – Pixel coordinates of the point.
Returns
2D projection error.
Return type
[Link]
image_offset
Image coordinate offset.
Type
[Link]
image_scale
Image coordinate scale.
Type
[Link]

136 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

line_den_coeff
Line denominator.
Type
[Link]
line_num_coeff
Line numerator.
Type
[Link]
load(path[, format ])
Load RPC model from file.
Parameters
• path (str) – Path to RPC model file.
• format (str) – RPC model file format in [‘rpc’, ‘rpb’, ‘dimap’]. Tiled DIMAP files are
not supported.
object_offset
Object coordinate offset.
Type
[Link]
object_scale
Object coordinate scale.
Type
[Link]
project(point)
Returns projected pixel coordinates of the point.
Parameters
point ([Link]) – Coordinates of the point to be projected.
Returns
2D projected point coordinates.
Return type
[Link]
samp_den_coeff
Sample denominator.
Type
[Link]
samp_num_coeff
Sample numerator.
Type
[Link]
save(path[, format ])
Save RPC model to file.
Parameters

137
Metashape Python Reference, Release 2.2.1

• path (str) – Path to RPC model file.


• format (str) – RPC model file format in [‘rpc’, ‘rpb’].
unproject(point)
Returns direction corresponding to the image point.
Parameters
point ([Link]) – Pixel coordinates of the point.
Returns
3D vector in the camera coordinate system.
Return type
[Link]
class [Link]
Raster format in [RasterFormatNone, RasterFormatTiles, RasterFormatKMZ, RasterFormatXYZ, RasterFor-
matMBTiles, RasterFormatWW, RasterFormatTMS, RasterFormatGeoPackage]
class [Link]
Raster transform definition.
calibrateRange()
Auto detect range based on orthomosaic histogram.
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]
enabled
Enable flag.
Type
bool
false_color
False color channels.
Type
list
formula
Raster calculator expression.
Type
str
interpolation
Interpolation enable flag.
Type
bool

138 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

palette
Color palette.
Type
dict
range
Palette mapping range.
Type
tuple
reset()
Reset raster transform.
class [Link]
Raster transformation type in [RasterTransformNone, RasterTransformValue, RasterTransformPalette]
class [Link]
Reference format in [ReferenceFormatNone, ReferenceFormatXML, ReferenceFormatTEL, ReferenceFor-
matCSV, ReferenceFormatMavinci, ReferenceFormatBramor, ReferenceFormatAPM]
class [Link]
Reference items in [ReferenceItemsCameras, ReferenceItemsMarkers, ReferenceItemsScalebars, ReferenceIt-
emsAll]
class [Link]
Reference preselection mode in [ReferencePreselectionSource, ReferencePreselectionEstimated, ReferencePre-
selectionSequential]
class [Link]
Region parameters
center
Region center coordinates.
Type
[Link]
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]
rot
Region rotation matrix.
Type
[Link]
size
Region size.
Type
[Link]

139
Metashape Python Reference, Release 2.2.1

class [Link]
Rotation order in [RotationOrderXYZ, RotationOrderXZY, RotationOrderYXZ, RotationOrderYZX, Rota-
tionOrderZXY, RotationOrderZYX]
class [Link]
Scale bar instance
class Reference
Scale bar reference data
accuracy
Scale bar length accuracy.
Type
float
distance
Scale bar length.
Type
float
enabled
Enabled flag.
Type
bool
chunk
Chunk the scalebar belongs to.
Type
[Link]
frames
Scale bar frames.
Type
list[[Link]]
group
Scale bar group.
Type
[Link]
key
Scale bar identifier.
Type
int
label
Scale bar label.
Type
str
meta
Scale bar meta data.
Type
[Link]

140 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

point0
Start of the scale bar.
Type
[Link] | [Link]
point1
End of the scale bar.
Type
[Link] | [Link]
reference
Scale bar reference data.
Type
[Link]
selected
Selects/deselects the scale bar.
Type
bool
class [Link]
ScalebarGroup objects define groups of multiple scale bars. The grouping is established by assignment of a
ScalebarGroup instance to the [Link] attribute of participating scale bars.
key
Scale bar group identifier.
Type
int
label
Scale bar group label.
Type
str
selected
Current selection state.
Type
bool
class [Link]
Sensor instance
class Reference
Sensor reference data.
accuracy
Sensor location accuracy.
Type
[Link]
enabled
Location enabled flag.

141
Metashape Python Reference, Release 2.2.1

Type
bool
location
Sensor coordinates.
Type
[Link]
location_accuracy
Sensor location accuracy.
Type
[Link]
location_enabled
Location enabled flag.
Type
bool
rotation
Sensor rotation angles.
Type
[Link]
rotation_accuracy
Sensor rotation accuracy.
Type
[Link]
rotation_enabled
Rotation enabled flag.
Type
bool
class Type
Sensor type in [Frame, Fisheye, Spherical, Cylindrical, RPC]
antenna
GPS antenna correction.
Type
[Link]
bands
List of color bands.
Type
list[str]
black_level
Black level for each band.
Type
list[float]
calibrateFiducials(resolution=0.014)
Fit fiducial coordinates to image measurements.
Parameters
resolution (float) – Scanning resolution in mm/pix.

142 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

calibration
Adjusted calibration of the photo.
Type
[Link]
chunk
Chunk the sensor belongs to.
Type
[Link]
data_type
Data type used to store color values.
Type
[Link]
fiducials
Fiducial marks.
Type
list[[Link]]
film_camera
Film camera flag.
Type
bool
fixed
Fix calibration flag.
Type
bool
fixed_calibration
Fix calibration flag.
Type
bool
fixed_location
Fix location flag.
Type
bool
fixed_params
List of fixed calibration parameters.
Type
list[str]
fixed_rotation
Fix rotation flag.
Type
bool

143
Metashape Python Reference, Release 2.2.1

focal_length
Focal length in mm.
Type
float
height
Image height.
Type
int
key
Sensor identifier.
Type
int
label
Sensor label.
Type
str
layer_index
Sensor layer index.
Type
int
location
Sensor plane location.
Type
[Link]
location_covariance
Sensor plane location covariance.
Type
[Link]
makeMaster()
Make this sensor master in the multi-camera system.
master
Master sensor.
Type
[Link]
meta
Sensor meta data.
Type
[Link]
normalize_sensitivity
Enable sensitivity normalization.
Type
bool

144 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

normalize_to_float
Convert pixel values to floating point after normalization.
Type
bool
photo_params
List of image-variant calibration parameters.
Type
list[str]
pixel_height
Pixel height in mm.
Type
float
pixel_size
Pixel size in mm.
Type
[Link]
pixel_width
Pixel width in mm.
Type
float
planes
Sensor planes.
Type
list[[Link]]
reference
Sensor reference data.
Type
[Link]
rolling_shutter
Enable rolling shutter compensation.
Type
[Link]
rotation
Sensor plane rotation.
Type
[Link]
rotation_covariance
Sensor plane rotation covariance.
Type
[Link]

145
Metashape Python Reference, Release 2.2.1

sensitivity
Sensitivity for each band.
Type
list[float]
type
Sensor projection model.
Type
[Link]
user_calib
Custom calibration used as initial calibration during photo alignment.
Type
[Link]
vignetting
Vignetting for each band.
Type
list[[Link]]
width
Image width.
Type
int
class [Link]
Service type in [ServiceSketchfab, ServiceMapbox, Service4DMapper, ServiceAgisoftCloud, Service-
Pointscene, ServicePointbox, ServicePicterra, ServiceCesium, ServiceNira]
class [Link]
Shape data.
class BoundaryType
Shape boundary type in [NoBoundary, OuterBoundary, InnerBoundary]
class Vertices
Collection of shape vertices
area()
Return area of the shape on DEM.
Returns
Shape area.
Return type
float
areaFitted()
Return 2D area of the shape projected onto the best fitting plane.
Returns
Shape area.
Return type
float

146 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

attributes
Shape attributes.
Type
[Link]
boundary_type
Shape boundary type.
Type
[Link]
geometry
Shape geometry.
Type
[Link] | [Link]
group
Shape group.
Type
[Link]
is_attached
Attached flag.
Type
bool
key
Shape identifier.
Type
int
label
Shape label.
Type
str
perimeter2D()
Return perimeter of the shape on DEM.
Returns
Shape perimeter.
Return type
float
perimeter3D()
Return perimeter of the shape.
Returns
Shape perimeter.
Return type
float

147
Metashape Python Reference, Release 2.2.1

selected
Selects/deselects the shape.
Type
bool
volume(level='bestfit')
Return volume of the shape measured on DEM above and below best fit, mean level or custom level plane.
Parameters
level (float) – Plane level: ‘bestfit’, ‘mean’ or custom value.
Returns
Shape volumes.
Return type
dict
class [Link]
ShapeGroup objects define groups of multiple shapes. The grouping is established by assignment of a Shape-
Group instance to the [Link] attribute of participating shapes.
color
Shape group color.
Type
tuple[int, int, int, int]
enabled
Enable flag.
Type
bool
key
Shape group identifier.
Type
int
label
Shape group label.
Type
str
meta
Shape group meta data.
Type
[Link]
selected
Current selection state.
Type
bool
show_labels
Shape labels visibility flag.

148 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
bool
class [Link]
A set of shapes for a chunk frame.
addGroup()
Add new shape group to the set of shapes.
Returns
Created shape group.
Return type
[Link]
addShape()
Add new shape to the set of shapes.
Returns
Created shape.
Return type
[Link]
crs
Shapes coordinate system.
Type
[Link]
group
Default shape group.
Type
[Link]
groups
List of shape groups.
Type
list[[Link]]
items()
List of items.
meta
Shapes meta data.
Type
[Link]
modified
Modified flag.
Type
bool
projection
Shapes projection.
Type
[Link]

149
Metashape Python Reference, Release 2.2.1

remove(items)
Remove items from the shape layer.
Parameters
items (list[[Link] | [Link]]) – A list of items to be re-
moved.
shapes
List of shapes.
Type
list[[Link]]
updateAltitudes(items[, progress ])
Update altitudes for items.
Parameters
• items (list[[Link] | [Link]]) – A list of items to be
updated.
• progress (Callable[[float], None]) – Progress callback.
class [Link]
Shapes format in [ShapesFormatNone, ShapesFormatSHP, ShapesFormatKML, ShapesFormatDXF, ShapesFor-
matGeoJSON, ShapesFormatGeoPackage, ShapesFormatCSV]
class [Link]
Shutter object contains estimated parameters of the rolling shutter correction model.
class Model
Rolling shutter model in [Disabled, Regularized, Full]
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]
rotation
Rotation matrix of the rolling shutter model.
Type
[Link]
translation
Translation vector of the rolling shutter model.
Type
[Link]
class [Link]
Surface type in [Arbitrary, HeightField]
class [Link]
Target parameters

150 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

code
Target code.
Type
int
coord
Target location.
Type
[Link]
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]
radius
Target radius.
Type
float
class [Link]
Target type in [CircularTarget12bit, CircularTarget14bit, CircularTarget16bit, CircularTarget20bit, CircularTar-
get, CrossTarget, AprilTag16h5, AprilTag25h9, AprilTag36h10, AprilTag36h11, AprilTagCircle21h7, AprilT-
agStandard41h12, AprilTagStandard52h13]
class [Link]
Task classes.
class AddFrames
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
chunk
Chunk to copy frames from.
Type
int
copy_depth_maps
Copy depth maps.
Type
bool
copy_elevation
Copy DEM.

151
Metashape Python Reference, Release 2.2.1

Type
bool
copy_model
Copy model.
Type
bool
copy_orthomosaic
Copy orthomosaic.
Type
bool
copy_point_cloud
Copy point cloud.
Type
bool
copy_tiled_model
Copy tiled model.
Type
bool
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
frames
List of frame keys to copy.
Type
list[int]
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.

152 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class AddPhotos
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
filegroups
List of file groups.
Type
list[int]
filenames
List of files to add.
Type
list[str]
gpu_support
GPU support flag.
Type
bool
group
Camera group key.
Type
int
layout
Image layout.
Type
[Link]

153
Metashape Python Reference, Release 2.2.1

load_reference
Load reference coordinates.
Type
bool
load_rpc_txt
Load satellite RPC data from auxiliary TXT files.
Type
bool
load_xmp_accuracy
Load accuracy from XMP meta data.
Type
bool
load_xmp_antenna
Load GNSS/INS offset from XMP meta data.
Type
bool
load_xmp_calibration
Load calibration from XMP meta data.
Type
bool
load_xmp_orientation
Load orientation from XMP meta data.
Type
bool
name
Task name.
Type
str
strip_extensions
Strip file extensions from camera labels.
Type
bool
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int

154 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

class AlignCameras
Task class containing processing parameters.
adaptive_fitting
Enable adaptive fitting of distortion coefficients.
Type
bool
align_laser_scans
Align laser scans using geometric features.
Type
bool
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to align.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
min_image
Minimum number of point projections.
Type
int
name
Task name.
Type
str
point_clouds
List of point clouds to align.
Type
list[int]

155
Metashape Python Reference, Release 2.2.1

reset_alignment
Reset current alignment.
Type
bool
subdivide_task
Enable fine-level task subdivision.
Type
bool
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class AlignChunks
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
chunks
List of chunks to be aligned.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
downscale
Alignment accuracy (0 - Highest, 1 - High, 2 - Medium, 4 - Low, 8 - Lowest).
Type
int
encode()
Create a dictionary with task parameters.

156 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

encodeJSON()
Create a JSON string with task parameters.
filter_mask
Filter points by mask.
Type
bool
fit_scale
Fit chunk scale during alignment.
Type
bool
generic_preselection
Enables image pair preselection.
Type
bool
gpu_support
GPU support flag.
Type
bool
keypoint_limit
Maximum number of points for each photo.
Type
int
markers
List of markers to be used for marker based alignment.
Type
list[int]
mask_tiepoints
Apply mask filter to tie points.
Type
bool
method
Alignment method (0 - point based, 1 - marker based, 2 - camera based).
Type
int
name
Task name.
Type
str
reference
Chunk to be used as a reference.
Type
int
target
Task target.
Type
[Link]

157
Metashape Python Reference, Release 2.2.1

toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class AnalyzeImages
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to be analyzed.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
filter_mask
Constrain analyzed image region by mask.
Type
bool
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
target
Task target.

158 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class BuildContours
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
interval
Contour interval.
Type
float
max_value
Maximum value of contour range.
Type
float
min_value
Minimum value of contour range.
Type
float

159
Metashape Python Reference, Release 2.2.1

name
Task name.
Type
str
prevent_intersections
Prevent contour intersections.
Type
bool
source_data
Source data for contour generation.
Type
[Link]
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class BuildDem
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
classes
List of point classes to be used for surface extraction.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.

160 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

encodeJSON()
Create a JSON string with task parameters.
flip_x
Flip X axis direction.
Type
bool
flip_y
Flip Y axis direction.
Type
bool
flip_z
Flip Z axis direction.
Type
bool
frames
List of frames to process.
Type
list[int]
gpu_support
GPU support flag.
Type
bool
interpolation
Interpolation mode.
Type
[Link]
max_workgroup_size
Maximum workgroup size.
Type
int
name
Task name.
Type
str
projection
Output projection.
Type
[Link]
region
Region to be processed.
Type
[Link]
replace_asset
Replace default asset with generated DEM.
Type
bool

161
Metashape Python Reference, Release 2.2.1

resolution
Output resolution in meters.
Type
float
source_data
Selects between point cloud and tie points.
Type
[Link]
subdivide_task
Enable fine-level task subdivision.
Type
bool
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
workitem_size_tiles
Number of tiles in a workitem.
Type
int
class BuildDepthMaps
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.

162 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

decodeJSON(json)
Initialize task parameters from a JSON string.
downscale
Depth map quality (1 - Ultra high, 2 - High, 4 - Medium, 8 - Low, 16 - Lowest).
Type
int
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
filter_mode
Depth map filtering mode.
Type
[Link]
gpu_support
GPU support flag.
Type
bool
max_neighbors
Maximum number of neighbor images to use for depth map generation.
Type
int
max_workgroup_size
Maximum workgroup size.
Type
int
name
Task name.
Type
str
reuse_depth
Enable reuse depth maps option.
Type
bool
subdivide_task
Enable fine-level task subdivision.
Type
bool
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.

163
Metashape Python Reference, Release 2.2.1

Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
workitem_size_cameras
Number of cameras in a workitem.
Type
int
class BuildModel
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
blocks_crs
Blocks grid coordinate system.
Type
[Link]
blocks_origin
Blocks grid origin.
Type
[Link]
blocks_size
Blocks size in coordinate system units.
Type
float
build_texture
Generate preview textures.
Type
bool
cameras
List of cameras to process.
Type
list[int]
classes
List of point classes to be used for surface extraction.
Type
list[int]
clip_to_boundary
Clip to boundary shapes.

164 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
bool
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
export_blocks
Export completed blocks.
Type
bool
face_count
Target face count.
Type
[Link]
face_count_custom
Custom face count.
Type
int
frames
List of frames to process.
Type
list[int]
gpu_support
GPU support flag.
Type
bool
interpolation
Interpolation mode.
Type
[Link]
keep_depth
Enable store depth maps option.
Type
bool
max_workgroup_size
Maximum workgroup size.
Type
int
name
Task name.

165
Metashape Python Reference, Release 2.2.1

Type
str
output_folder
Path to output folder.
Type
str
replace_asset
Replace default asset with generated model.
Type
bool
source_data
Selects between point cloud, tie points, depth maps and laser scans.
Type
[Link]
split_in_blocks
Split model in blocks.
Type
bool
subdivide_task
Enable fine-level task subdivision.
Type
bool
surface_type
Type of object to be reconstructed.
Type
[Link]
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
trimming_radius
Trimming radius (no trimming if zero).
Type
int
vertex_colors
Enable vertex colors calculation.
Type
bool
vertex_confidence
Enable vertex confidence calculation.

166 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
bool
volumetric_masks
Enable strict volumetric masking.
Type
bool
workitem_count
Work item count.
Type
int
workitem_size_cameras
Number of cameras in a workitem.
Type
int
class BuildOrthomosaic
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
blending_mode
Orthophoto blending mode.
Type
[Link]
cull_faces
Enable back-face culling.
Type
bool
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
fill_holes
Enable hole filling.
Type
bool

167
Metashape Python Reference, Release 2.2.1

flip_x
Flip X axis direction.
Type
bool
flip_y
Flip Y axis direction.
Type
bool
flip_z
Flip Z axis direction.
Type
bool
frames
List of frames to process.
Type
list[int]
ghosting_filter
Enable ghosting filter.
Type
bool
gpu_support
GPU support flag.
Type
bool
max_workgroup_size
Maximum workgroup size.
Type
int
name
Task name.
Type
str
projection
Output projection.
Type
[Link]
refine_seamlines
Refine seamlines based on image content.
Type
bool
region
Region to be processed.
Type
[Link]

168 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

replace_asset
Replace default asset with generated orthomosaic.
Type
bool
resolution
Pixel size in meters.
Type
float
resolution_x
Pixel size in the X dimension in projected units.
Type
float
resolution_y
Pixel size in the Y dimension in projected units.
Type
float
subdivide_task
Enable fine-level task subdivision.
Type
bool
surface_data
Orthorectification surface.
Type
[Link]
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
transfer_texture
Transfer model texture to orthomosaic.
Type
bool
workitem_count
Work item count.
Type
int
workitem_size_cameras
Number of cameras in a workitem.
Type
int

169
Metashape Python Reference, Release 2.2.1

workitem_size_tiles
Number of tiles in a workitem.
Type
int
class BuildPanorama
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
blending_mode
Panorama blending mode.
Type
[Link]
camera_groups
List of camera groups to process.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
frames
List of frames to process.
Type
list[int]
ghosting_filter
Enable ghosting filter.
Type
bool
gpu_support
GPU support flag.
Type
bool
height
Height of output panorama.
Type
int

170 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

name
Task name.
Type
str
region
Region to be generated.
Type
[Link]
rotation
Panorama 3x3 orientation matrix.
Type
[Link]
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
width
Width of output panorama.
Type
int
workitem_count
Work item count.
Type
int
class BuildPointCloud
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
asset
Asset to process.
Type
int
decode(dict)
Initialize task parameters with a dictionary.

171
Metashape Python Reference, Release 2.2.1

decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
frames
List of frames to process.
Type
list[int]
gpu_support
GPU support flag.
Type
bool
keep_depth
Enable store depth maps option.
Type
bool
max_neighbors
Maximum number of neighbor images to use for depth map filtering.
Type
int
max_workgroup_size
Maximum workgroup size.
Type
int
name
Task name.
Type
str
point_colors
Enable point colors calculation.
Type
bool
point_confidence
Enable point confidence calculation.
Type
bool
points_spacing
Desired point spacing (m).
Type
float
replace_asset
Replace default asset with generated point cloud.

172 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
bool
source_data
Source data to extract points from.
Type
[Link]
subdivide_task
Enable fine-level task subdivision.
Type
bool
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
uniform_sampling
Enable uniform point sampling.
Type
bool
workitem_count
Work item count.
Type
int
workitem_size_cameras
Number of cameras in a workitem.
Type
int
class BuildSeamlines
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.

173
Metashape Python Reference, Release 2.2.1

encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
epsilon
Contour simplificaion threshold.
Type
float
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class BuildTexture
Task class containing processing parameters.
anti_aliasing
Anti-aliasing coefficient for baking
Type
int
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
blending_mode
Texture blending mode.
Type
[Link]

174 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

cameras
A list of cameras to be used for texturing.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
fill_holes
Enable hole filling.
Type
bool
ghosting_filter
Enable ghosting filter.
Type
bool
gpu_support
GPU support flag.
Type
bool
max_workgroup_size
Maximum workgroup size (block model only).
Type
int
name
Task name.
Type
str
source_asset
Source asset.
Type
int
source_data
Source data to create texture from.
Type
[Link]
target
Task target.
Type
[Link]

175
Metashape Python Reference, Release 2.2.1

texture_size
Texture page size.
Type
int
texture_type
Texture type.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
transfer_texture
Transfer texture.
Type
bool
workitem_count
Work item count.
Type
int
workitem_size_cameras
Number of cameras in a workitem (block model only).
Type
int
class BuildTiledModel
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
classes
List of point classes to be used for surface extraction.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.

176 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

encodeJSON()
Create a JSON string with task parameters.
face_count
Number of faces per megapixel of texture resolution.
Type
int
frames
List of frames to process.
Type
list[int]
ghosting_filter
Enable ghosting filter.
Type
bool
gpu_support
GPU support flag.
Type
bool
keep_depth
Enable store depth maps option.
Type
bool
max_workgroup_size
Maximum workgroup size.
Type
int
merge
Merge tiled model flag.
Type
bool
name
Task name.
Type
str
operand_asset
Operand asset key.
Type
int
operand_chunk
Operand chunk key.
Type
int
operand_frame
Operand frame key.
Type
int

177
Metashape Python Reference, Release 2.2.1

pixel_size
Target model resolution in meters.
Type
float
replace_asset
Replace default asset with generated tiled model.
Type
bool
source_data
Selects between point cloud and mesh.
Type
[Link]
subdivide_task
Enable fine-level task subdivision.
Type
bool
target
Task target.
Type
[Link]
tile_size
Size of tiles in pixels.
Type
int
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
transfer_texture
Transfer source model texture to tiled model.
Type
bool
workitem_count
Work item count.
Type
int
workitem_size_cameras
Number of cameras in a workitem.
Type
int
class BuildUV
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters

178 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• object ([Link] | [Link]) – Chunk or Document object


to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
camera
Camera to be used for texturing in CameraMapping mode.
Type
int
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
mapping_mode
Texture mapping mode.
Type
[Link]
name
Task name.
Type
str
page_count
Number of texture pages to generate.
Type
int
pixel_size
Texture resolution in meters.
Type
float
target
Task target.
Type
[Link]
texture_size
Expected size of texture page at texture generation step.
Type
int

179
Metashape Python Reference, Release 2.2.1

toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class CalculatePointNormals
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
point_cloud
Point cloud key to process.
Type
int
point_neighbors
Number of point neighbors to use for normal estimation.
Type
int
target
Task target.

180 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class CalibrateCamera
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
border
Border size to ignore.
Type
int
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
fit_b1
Enable optimization of aspect ratio.
Type
bool
fit_b2
Enable optimization of skew coefficient.
Type
bool
fit_cxcy
Enable optimization of principal point coordinates.
Type
bool

181
Metashape Python Reference, Release 2.2.1

fit_f
Enable optimization of focal length coefficient.
Type
bool
fit_k1
Enable optimization of k1 radial distortion coefficient.
Type
bool
fit_k2
Enable optimization of k2 radial distortion coefficient.
Type
bool
fit_k3
Enable optimization of k3 radial distortion coefficient.
Type
bool
fit_k4
Enable optimization of k4 radial distortion coefficient.
Type
bool
fit_p1
Enable optimization of p1 tangential distortion coefficient.
Type
bool
fit_p2
Enable optimization of p2 tangential distortion coefficient.
Type
bool
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.

182 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

workitem_count
Work item count.
Type
int
class CalibrateColors
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to calibrate.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
source_data
Source data for calibration.
Type
[Link]
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.

183
Metashape Python Reference, Release 2.2.1

Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
white_balance
Calibrate white balance.
Type
bool
workitem_count
Work item count.
Type
int
class CalibrateReflectance
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.

184 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

use_reflectance_panels
Use calibrated reflectance panels.
Type
bool
use_sun_sensor
Apply irradiance sensor measurements.
Type
bool
workitem_count
Work item count.
Type
int
class ClassifyGroundPoints
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
cell_size
Cell size (meters).
Type
float
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
erosion_radius
Erosion radius (meters).
Type
float
gpu_support
GPU support flag.
Type
bool
keep_existing
Keep existing ground points.
Type
bool

185
Metashape Python Reference, Release 2.2.1

max_angle
Maximum angle (degrees).
Type
float
max_distance
Maximum distance (meters).
Type
float
max_terrain_slope
Maximum terrain slope angle (degrees).
Type
float
name
Task name.
Type
str
point_cloud
Point cloud key to classify.
Type
int
return_number
Point return number to use (0 - any return, 1 - first return, -1 - last return).
Type
int
source_class
Class of points to be re-classified.
Type
int
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ClassifyOverlapPoints
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters

186 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• object ([Link] | [Link]) – Chunk or Document object


to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
point_cloud
Point cloud key to classify.
Type
int
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ClassifyPoints
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.

187
Metashape Python Reference, Release 2.2.1

• progress (Callable[[float], None]) – Progress callback.


confidence
Required confidence level.
Type
float
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
point_cloud
Point cloud key to classify.
Type
int
source_class
Class of points to be re-classified.
Type
int
subdivide_task
Enable fine-level task subdivision.
Type
bool
target
Task target.
Type
[Link]
target_classes
Target point classes for classification.
Type
list[int]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.

188 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class CleanModel
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
criterion
Model filtering criterion.
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
level
Filtering threshold in percents.
Type
int
model
Model to filter.
Type
int
name
Task name.
Type
str

189
Metashape Python Reference, Release 2.2.1

target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class CleanTiePoints
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
criterion
Tie points filtering criterion.
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
target
Task target.

190 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
[Link]
threshold
Filtering threshold.
Type
float
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class CloseHoles
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
apply_to_selection
Close holes within selection.
Type
bool
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
level
Hole size threshold in percents.
Type
int

191
Metashape Python Reference, Release 2.2.1

name
Task name.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ColorizeModel
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
model
Key of model to colorize.
Type
int
name
Task name.

192 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
str
source_data
Source data to extract colors from.
Type
[Link]
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ColorizePointCloud
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
frames
List of frames to process.
Type
list[int]
gpu_support
GPU support flag.
Type
bool

193
Metashape Python Reference, Release 2.2.1

max_workgroup_size
Maximum workgroup size.
Type
int
name
Task name.
Type
str
point_cloud
Point cloud key to colorize.
Type
int
replace_asset
Replace source point cloud with colorized one.
Type
bool
source_data
Source data to extract colors from.
Type
[Link]
subdivide_task
Enable fine-level task subdivision.
Type
bool
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
workitem_size_cameras
Number of cameras in a workitem.
Type
int
class CompactPointCloud
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters

194 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• object ([Link] | [Link]) – Chunk or Document object


to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
point_cloud
Point cloud key to process.
Type
int
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ConvertImages
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.

195
Metashape Python Reference, Release 2.2.1

• progress (Callable[[float], None]) – Progress callback.


cameras
List of cameras to process.
Type
list[int]
color_correction
Apply color correction.
Type
bool
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
image_compression
Image compression parameters.
Type
[Link]
merge_planes
Merge multispectral images.
Type
bool
name
Task name.
Type
str
path
Path to output file.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.

196 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
update_gps_tags
Update GPS tags.
Type
bool
use_initial_calibration
Transform to initial calibration.
Type
bool
workitem_count
Work item count.
Type
int
class DecimateModel
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
apply_to_selection
Apply to selection.
Type
bool
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
face_count
Target face count.
Type
int
frames
List of frames to process.
Type
list[int]

197
Metashape Python Reference, Release 2.2.1

gpu_support
GPU support flag.
Type
bool
model
Model to process.
Type
int
name
Task name.
Type
str
replace_asset
Replace source model with decimated model.
Type
bool
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class DetectFiducials
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.

198 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
fiducials_position_corners
Search corners for fiducials.
Type
bool
fiducials_position_sides
Search sides for fiducials.
Type
bool
frame_detector
Detect frame.
Type
bool
frames
List of frames to process.
Type
list[int]
generate_masks
Generate background masks.
Type
bool
generic_detector
Use generic detector.
Type
bool
gpu_support
GPU support flag.
Type
bool
mask_dark_pixels
Mask out dark pixels near frame edge.
Type
bool
name
Task name.
Type
str
right_angle_detector
Use right angle detector.

199
Metashape Python Reference, Release 2.2.1

Type
bool
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
v_shape_detector
Detect V-shape fiducials.
Type
bool
workitem_count
Work item count.
Type
int
class DetectMarkers
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
filter_mask
Ignore masked image regions.
Type
bool

200 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

frames
List of frames to process.
Type
list[int]
gpu_support
GPU support flag.
Type
bool
inverted
Detect markers on black background.
Type
bool
maximum_residual
Maximum residual for non-coded targets in pixels.
Type
float
merge_markers
Merge detected targets with existing markers.
Type
bool
minimum_dist
Minimum distance between targets in pixels (CrossTarget type only).
Type
int
minimum_size
Minimum target radius in pixels to be detected (CrossTarget type only).
Type
int
name
Task name.
Type
str
noparity
Disable parity checking.
Type
bool
target
Task target.
Type
[Link]
target_type
Type of targets.
Type
[Link]

201
Metashape Python Reference, Release 2.2.1

toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
tolerance
Detector tolerance (0 - 100).
Type
int
workitem_count
Work item count.
Type
int
class DetectPowerlines
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
max_quantization_error
Maximum allowed distance between polyline and smooth continuous curve.
Type
float
min_altitude
Minimum altitude for reconstructed powerlines.
Type
float
n_points_per_line
Maximum number of vertices per detected line.

202 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
int
name
Task name.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
use_model
Use model for visibility checks.
Type
bool
workitem_count
Work item count.
Type
int
class DuplicateAsset
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
asset_key
Asset key.
Type
int
asset_type
Asset type.
Type
[Link]
clip_to_boundary
Clip to boundary shapes.
Type
bool
clip_to_region
Clip to chunk region.

203
Metashape Python Reference, Release 2.2.1

Type
bool
copy_orthophotos
Copy orthophotos (orthomosaic asset type only).
Type
bool
copy_patches
Copy patches.
Type
bool
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class DuplicateChunk
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters

204 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• object ([Link] | [Link]) – Chunk or Document object


to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of camera keys to copy.
Type
list[int]
chunk
Chunk to copy.
Type
int
copy_depth_maps
Copy depth maps.
Type
bool
copy_elevations
Copy DEMs.
Type
bool
copy_keypoints
Copy keypoints.
Type
bool
copy_laser_scans
Copy laser scans.
Type
bool
copy_masks
Copy masks.
Type
bool
copy_models
Copy models.
Type
bool
copy_orthomosaics
Copy orthomosaics.
Type
bool
copy_point_clouds
Copy point clouds.
Type
bool
copy_tiled_models
Copy tiled models.

205
Metashape Python Reference, Release 2.2.1

Type
bool
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
frames
List of frame keys to copy.
Type
list[int]
gpu_support
GPU support flag.
Type
bool
label
New chunk label.
Type
str
laser_scans
List of laser scan keys to copy.
Type
list[int]
name
Task name.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int

206 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

class ExportCameras
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
binary
Enables/disables binary encoding for selected format (Colmap and FBX formats only).
Type
bool
bingo_path_geoin
Path to BINGO GEO INPUT file.
Type
str
bingo_path_gps
Path to BINGO GPS/IMU file.
Type
str
bingo_path_image
Path to BINGO IMAGE COORDINATE file.
Type
str
bingo_path_itera
Path to BINGO ITERA file.
Type
str
bingo_save_geoin
Enables/disables export of BINGO GEO INPUT file.
Type
bool
bingo_save_gps
Enables/disables export of BINGO GPS/IMU data.
Type
bool
bingo_save_image
Enables/disables export of BINGO IMAGE COORDINATE file.
Type
bool
bingo_save_itera
Enables/disables export of BINGO ITERA file.
Type
bool

207
Metashape Python Reference, Release 2.2.1

bundler_path_list
Path to Bundler image list file.
Type
str
bundler_save_list
Enables/disables export of Bundler image list file.
Type
bool
cameras
List of cameras to export (except AgisoftXML format).
Type
list[int]
chan_rotation_order
Rotation order (CHAN format only).
Type
[Link]
convert_to_pinhole
Transform images to pinhole model without distortions.
Type
bool
crs
Output coordinate system (except AgisoftXML format).
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
format
Export format.
Type
[Link]
gpu_support
GPU support flag.
Type
bool
image_compression
Image compression parameters.
Type
[Link]

208 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

image_orientation
Image coordinate system (0 - X right, 1 - X up, 2 - X left, 3 - X down).
Type
int
image_path
Image name template
Type
str
name
Task name.
Type
str
path
Path to output file.
Type
str
save_absolute_paths
Save absolute image paths (BlocksExchange and RZML formats only).
Type
bool
save_images
Enables/disables images export (Colmap format only).
Type
bool
save_invalid_matches
Enables/disables export of invalid image matches.
Type
bool
save_markers
Enables/disables export of manual matching points.
Type
bool
save_masks
Enables/disables image masks export (Colmap format only).
Type
bool
save_points
Enables/disables export of automatic tie points.
Type
bool
target
Task target.
Type
[Link]

209
Metashape Python Reference, Release 2.2.1

toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
use_initial_calibration
Transform image coordinates to initial calibration.
Type
bool
use_labels
Enables/disables label based item identifiers.
Type
bool
workitem_count
Work item count.
Type
int
class ExportMarkers
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
binary
Enables/disables binary encoding for selected format (if applicable).
Type
bool
crs
Output coordinate system.
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.

210 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
bool
name
Task name.
Type
str
path
Path to output file.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ExportMasks
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.

211
Metashape Python Reference, Release 2.2.1

gpu_support
GPU support flag.
Type
bool
masks
Masks key to export.
Type
int
name
Task name.
Type
str
path
Path to output file.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ExportModel
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
binary
Enables/disables binary encoding (if supported by format).
Type
bool
block_margin
Block margin (m).
Type
float

212 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

clip_to_block
Clip model to block region.
Type
bool
clip_to_boundary
Clip model to boundary shapes.
Type
bool
clip_to_region
Clip model to chunk region.
Type
bool
colors_rgb_8bit
Convert colors to 8 bit RGB.
Type
bool
comment
Optional comment (if supported by selected format).
Type
str
crs
Output coordinate system.
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
embed_texture
Embeds texture inside the model file (if supported by format).
Type
bool
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
format
Export format.
Type
[Link]
gltf_y_up
Enables/disables y-up axes notation used in glTF.
Type
bool

213
Metashape Python Reference, Release 2.2.1

gpu_support
GPU support flag.
Type
bool
model
Model key to export.
Type
int
name
Task name.
Type
str
path
Path to output model.
Type
str
precision
Number of digits after the decimal point (for text formats).
Type
int
raster_transform
Raster band transformation.
Type
[Link]
save_alpha
Enables/disables alpha channel export.
Type
bool
save_cameras
Enables/disables camera export.
Type
bool
save_colors
Enables/disables export of vertex colors.
Type
bool
save_comment
Enables/disables comment export.
Type
bool
save_confidence
Enables/disables export of vertex confidence.
Type
bool

214 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

save_markers
Enables/disables marker export.
Type
bool
save_metadata_xml
Save [Link] file.
Type
bool
save_normals
Enables/disables export of vertex normals.
Type
bool
save_texture
Enables/disables texture export.
Type
bool
save_udim
Enables/disables UDIM texture layout.
Type
bool
save_uv
Enables/disables uv coordinates export.
Type
bool
shift
Optional shift to be applied to vertex coordinates.
Type
[Link]
strip_extensions
Strips camera label extensions during export.
Type
bool
target
Task target.
Type
[Link]
texture_format
Texture format.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.

215
Metashape Python Reference, Release 2.2.1

viewpoint
Default view.
Type
[Link]
workitem_count
Work item count.
Type
int
class ExportOrthophotos
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
image_compression
Image compression parameters.
Type
[Link]
name
Task name.
Type
str
north_up
Use north-up orientation for export.
Type
bool

216 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

path
Path to output orthophoto.
Type
str
projection
Output projection.
Type
[Link]
raster_transform
Raster band transformation.
Type
[Link]
region
Region to be exported.
Type
[Link]
resolution
Output resolution in meters.
Type
float
resolution_x
Pixel size in the X dimension in projected units.
Type
float
resolution_y
Pixel size in the Y dimension in projected units.
Type
float
save_alpha
Enable alpha channel generation.
Type
bool
save_kml
Enable kml file generation.
Type
bool
save_world
Enable world file generation.
Type
bool
target
Task target.
Type
[Link]

217
Metashape Python Reference, Release 2.2.1

toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
white_background
Enable white background.
Type
bool
workitem_count
Work item count.
Type
int
class ExportPointCloud
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
binary
Enables/disables binary encoding for selected format (if applicable).
Type
bool
block_height
Block height in meters.
Type
float
block_width
Block width in meters.
Type
float
classes
List of point classes to be exported.
Type
list[int]
clip_to_boundary
Clip point cloud to boundary shapes.
Type
bool
clip_to_region
Clip point cloud to chunk region.
Type
bool

218 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

colors_rgb_8bit
Convert colors to 8 bit RGB.
Type
bool
comment
Optional comment (if supported by selected format).
Type
str
compression
Enable compression (Cesium format only).
Type
bool
crs
Output coordinate system.
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
folder_depth
Tileset subdivision depth (Cesium format only).
Type
int
format
Export format.
Type
[Link]
gpu_support
GPU support flag.
Type
bool
image_format
Image data format.
Type
[Link]
name
Task name.
Type
str

219
Metashape Python Reference, Release 2.2.1

path
Path to output file.
Type
str
point_clouds
Point cloud keys to export.
Type
list[int]
raster_transform
Raster band transformation.
Type
[Link]
region
Region to be exported.
Type
[Link]
save_comment
Enable comment export.
Type
bool
save_images
Enable image export.
Type
bool
save_point_classification
Enables/disables export of point classification.
Type
bool
save_point_color
Enables/disables export of point color.
Type
bool
save_point_confidence
Enables/disables export of point confidence.
Type
bool
save_point_index
Enables/disables export of point row and column indices.
Type
bool
save_point_intensity
Enables/disables export of point intensity.
Type
bool

220 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

save_point_normal
Enables/disables export of point normal.
Type
bool
save_point_return_number
Enables/disables export of point return number.
Type
bool
save_point_scan_angle
Enables/disables export of point scan angle.
Type
bool
save_point_source_id
Enables/disables export of point source ID.
Type
bool
save_point_timestamp
Enables/disables export of point timestamp.
Type
bool
screen_space_error
Target screen space error (Cesium format only).
Type
float
shift
Optional shift to be applied to point coordinates.
Type
[Link]
source_data
Selects between point cloud and tie points. If not specified, uses point cloud if available.
Type
[Link]
split_in_blocks
Enable tiled export.
Type
bool
subdivide_task
Enable fine-level task subdivision.
Type
bool
target
Task target.
Type
[Link]

221
Metashape Python Reference, Release 2.2.1

tileset_version
Cesium 3D Tiles format version to export (1.0 or 1.1).
Type
str
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
viewpoint
Default view.
Type
[Link]
workitem_count
Work item count.
Type
int
class ExportRaster
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
asset
Asset key to export.
Type
int
block_height
Raster block height in pixels.
Type
int
block_width
Raster block width in pixels.
Type
int
clip_to_boundary
Clip raster to boundary shapes.
Type
bool
decode(dict)
Initialize task parameters with a dictionary.

222 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

decodeJSON(json)
Initialize task parameters from a JSON string.
description
Export description.
Type
str
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
format
Export format.
Type
[Link]
global_profile
Use global profile (GeoPackage and TMS formats only).
Type
bool
gpu_support
GPU support flag.
Type
bool
height
Raster height.
Type
int
image_compression
Image compression parameters.
Type
[Link]
image_description
Optional description to be added to image files.
Type
str
image_format
Tile format.
Type
[Link]
max_zoom_level
Maximum zoom level (GeoPackage, Google Map Tiles, MBTiles and World Wind Tiles formats only).
Type
int
min_zoom_level
Minimum zoom level (GeoPackage, Google Map Tiles, MBTiles and World Wind Tiles formats only).

223
Metashape Python Reference, Release 2.2.1

Type
int
name
Task name.
Type
str
network_links
Enable network links generation for KMZ format.
Type
bool
nodata_value
No-data value (DEM export only).
Type
float
north_up
Use north-up orientation for export.
Type
bool
path
Path to output orthomosaic.
Type
str
projection
Output projection.
Type
[Link]
raster_transform
Raster band transformation.
Type
[Link]
region
Region to be exported.
Type
[Link]
resolution
Output resolution in meters.
Type
float
resolution_x
Pixel size in the X dimension in projected units.
Type
float
resolution_y
Pixel size in the Y dimension in projected units.
Type
float

224 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

save_alpha
Enable alpha channel generation.
Type
bool
save_kml
Enable kml file generation.
Type
bool
save_scheme
Enable tile scheme files generation.
Type
bool
save_world
Enable world file generation.
Type
bool
source_data
Selects between DEM and orthomosaic.
Type
[Link]
split_in_blocks
Split raster in blocks.
Type
bool
target
Task target.
Type
[Link]
tile_height
Tile height in pixels.
Type
int
tile_width
Tile width in pixels.
Type
int
title
Export title.
Type
str
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.

225
Metashape Python Reference, Release 2.2.1

white_background
Enable white background.
Type
bool
width
Raster width.
Type
int
workitem_count
Work item count.
Type
int
world_transform
2x3 raster-to-world transformation matrix.
Type
[Link]
class ExportReference
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
columns
Column order in csv format (n - label, o - enabled flag, x/y/z - coordinates, X/Y/Z - coordinate accu-
racy, a/b/c - rotation angles, A/B/C - rotation angle accuracy, u/v/w - estimated coordinates, U/V/W
- coordinate errors, d/e/f - estimated orientation angles, D/E/F - orientation errors, p/q/r - estimated
coordinates variance, i/j/k - estimated orientation angles variance, [] - group of multiple values, | -
column separator within group).
Type
str
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
delimiter
Column delimiter in csv format.
Type
str
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.

226 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

format
Export format.
Type
[Link]
gpu_support
GPU support flag.
Type
bool
items
Items to export in CSV format.
Type
[Link]
name
Task name.
Type
str
path
Path to the output file.
Type
str
precision
Number of digits after the decimal point (for CSV format).
Type
int
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ExportReport
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.

227
Metashape Python Reference, Release 2.2.1

decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
description
Report description.
Type
str
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
font_size
Font size (pt).
Type
int
gpu_support
GPU support flag.
Type
bool
include_system_info
Include system information.
Type
bool
logo_path
Path to company logo file.
Type
str
name
Task name.
Type
str
page_numbers
Enable page numbers.
Type
bool
path
Path to output report.
Type
str
target
Task target.
Type
[Link]

228 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

title
Report title.
Type
str
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
user_settings
A list of user defined settings to include on the Processing Parameters page.
Type
list[tuple[str, str]]
workitem_count
Work item count.
Type
int
class ExportShapes
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
crs
Output coordinate system.
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
format
Export format.
Type
[Link]
gpu_support
GPU support flag.

229
Metashape Python Reference, Release 2.2.1

Type
bool
groups
A list of shape groups to export.
Type
list[int]
name
Task name.
Type
str
path
Path to shape file.
Type
str
polygons_as_polylines
Save polygons as polylines.
Type
bool
save_attributes
Export attributes.
Type
bool
save_elevation
Export elevation values for 3D shapes.
Type
bool
save_labels
Export labels.
Type
bool
save_points
Export points.
Type
bool
save_polygons
Export polygons.
Type
bool
save_polylines
Export polylines.
Type
bool
shift
Optional shift to be applied to vertex coordinates.
Type
[Link]

230 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ExportTexture
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
path
Path to output file.
Type
str
raster_transform
Raster band transformation.

231
Metashape Python Reference, Release 2.2.1

Type
[Link]
save_alpha
Enable alpha channel export.
Type
bool
target
Task target.
Type
[Link]
texture_type
Texture type.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ExportTiledModel
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
clip_to_boundary
Clip tiled model to boundary shapes.
Type
bool
clip_to_region
Clip tiled model to chunk region.
Type
bool
crs
Output coordinate system.
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.

232 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
face_count
Number of faces per megapixel of texture resolution (block model export only).
Type
int
folder_depth
Tileset subdivision depth (Cesium format only).
Type
int
format
Export format.
Type
[Link]
gpu_support
GPU support flag.
Type
bool
image_compression
Image compression parameters.
Type
[Link]
model_compression
Enable mesh compression (Cesium format only).
Type
bool
model_format
Model format for zip export.
Type
[Link]
model_group
Block model key to export.
Type
int
name
Task name.
Type
str
path
Path to output model.

233
Metashape Python Reference, Release 2.2.1

Type
str
pixel_size
Target model resolution in meters (block model export only).
Type
float
raster_transform
Raster band transformation.
Type
[Link]
screen_space_error
Target screen space error (Cesium format only).
Type
float
target
Task target.
Type
[Link]
texture_format
Texture format.
Type
[Link]
tile_size
Size of tiles in pixels (block model export only).
Type
int
tiled_model
Tiled model key to export.
Type
int
tileset_version
Cesium 3D Tiles format version to export (1.0 or 1.1).
Type
str
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
use_tileset_transform
Use tileset transform instead of individual tile transforms (Cesium format only).
Type
bool
workitem_count
Work item count.

234 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
int
class FilterPointCloud
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
clip_to_region
Clip point cloud to chunk region.
Type
bool
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
frames
List of frames to process.
Type
list[int]
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
point_cloud
Point cloud key to filter.
Type
int
point_spacing
Desired point spacing (m).
Type
float

235
Metashape Python Reference, Release 2.2.1

replace_asset
Replace default asset with filtered point cloud.
Type
bool
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class GenerateMasks
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
blur_threshold
Allowed blur radius on a photo in pix (only if mask_defocus=True).
Type
float
cameras
Optional list of cameras to be processed.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
depth_threshold
Maximum depth of masked areas in meters (only if mask_defocus=False).
Type
float
encode()
Create a dictionary with task parameters.

236 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

encodeJSON()
Create a JSON string with task parameters.
fix_coverage
Extend masks to cover whole mesh (only if mask_defocus=True).
Type
bool
frames
List of frames to process.
Type
list[int]
gpu_support
GPU support flag.
Type
bool
mask_defocus
Mask defocus areas.
Type
bool
mask_operation
Mask operation.
Type
[Link]
masking_mode
Mask generation mode.
Type
[Link]
name
Task name.
Type
str
path
Mask file name template.
Type
str
replace_asset
Update default set of masks with generated masks.
Type
bool
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.

237
Metashape Python Reference, Release 2.2.1

Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
tolerance
Background masking tolerance.
Type
int
workitem_count
Work item count.
Type
int
class GeneratePrescriptionMap
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
boundary_shape_group
Boundary shape group.
Type
int
breakpoints
Classification breakpoints.
Type
list[float]
cell_size
Step of prescription grid, meters.
Type
float
class_count
Number of classes.
Type
int
classification_method
Index values classification method.
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.

238 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
rates
Fertilizer rate for each class.
Type
list[float]
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ImportCameras
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
crs
Ground coordinate system.
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.

239
Metashape Python Reference, Release 2.2.1

decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
format
File format.
Type
[Link]
gpu_support
GPU support flag.
Type
bool
image_list
Path to image list file (Bundler format only).
Type
str
image_orientation
Image coordinate system (0 - X right, 1 - X up, 2 - X left, 3 - X down).
Type
int
load_image_list
Enable Bundler image list import.
Type
bool
name
Task name.
Type
str
path
Path to the file.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.

240 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

workitem_count
Work item count.
Type
int
class ImportDepthImages
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
color_filenames
List of corresponding color files, if present.
Type
list[str]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
filenames
List of files to import.
Type
list[str]
format
Point cloud format.
Type
[Link]
gpu_support
GPU support flag.
Type
bool
image_path
Path template to output files.
Type
str
multiplane
Import as a multi-camera system
Type
bool

241
Metashape Python Reference, Release 2.2.1

name
Task name.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ImportMarkers
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
path
Path to the file.

242 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ImportModel
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
crs
Model coordinate system.
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
decode_udim
Load UDIM texture layout.
Type
bool
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
format
Model format.
Type
[Link]

243
Metashape Python Reference, Release 2.2.1

frame_paths
List of model paths to import in each frame of a multiframe chunk.
Type
list[str]
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
path
Path to model.
Type
str
replace_asset
Replace default asset with imported model.
Type
bool
shift
Optional shift to be applied to vertex coordinates.
Type
[Link]
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ImportPointCloud
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.

244 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

calculate_normals
Calculate point normals.
Type
bool
columns
Column order (x/y/z - coordinates, X/Y/Z - normal, r/g/b - color, i - intensity, t - time, space - skip
column).
Type
str
crs
Point cloud coordinate system.
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
delimiter
CSV delimiter.
Type
str
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
format
Point cloud format.
Type
[Link]
frame_paths
List of point cloud paths to import in each frame of a multiframe chunk.
Type
list[str]
generate_panorama
Generate panorama from point colors.
Type
bool
gpu_support
GPU support flag.
Type
bool
group_delimiters
Combine consecutive delimiters in csv format.
Type
bool

245
Metashape Python Reference, Release 2.2.1

ignore_scanner_origin
Do not use laser scan origin as scanner position for structured point clouds.
Type
bool
ignore_trajectory
Do not attach trajectory to imported point cloud.
Type
bool
is_laser_scan
Import point clouds as laser scans.
Type
bool
load_images
Import images embedded in laser scan.
Type
bool
load_point_classification
Import point classification.
Type
bool
load_point_color
Import point color.
Type
bool
load_point_confidence
Import point confidence.
Type
bool
load_point_index
Import point row and column indices.
Type
bool
load_point_intensity
Import point intensity.
Type
bool
load_point_normal
Import point normal.
Type
bool
load_point_return_number
Import point return number.
Type
bool

246 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

load_point_scan_angle
Import point scan angle.
Type
bool
load_point_source_id
Import point source ID.
Type
bool
load_point_timestamp
Import point timestamp.
Type
bool
name
Task name.
Type
str
path
Path to point cloud.
Type
str
point_neighbors
Number of point neighbors to use for normal estimation.
Type
int
precision
Coordinate precision (m). For default precision use 0.
Type
float
replace_asset
Replace default asset with imported point cloud.
Type
bool
scanner_at_origin
Use laser scan origin as scanner position for unstructured point clouds.
Type
bool
shift
Optional shift to be applied to point coordinates.
Type
[Link]
skip_rows
Number of rows to skip.
Type
int

247
Metashape Python Reference, Release 2.2.1

target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
trajectory
Trajectory key to attach.
Type
int
workitem_count
Work item count.
Type
int
class ImportRaster
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
crs
Default coordinate system if not specified in GeoTIFF file.
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
frames
List of frames to process.
Type
list[int]
gpu_support
GPU support flag.

248 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
bool
has_nodata_value
No-data value valid flag.
Type
bool
name
Task name.
Type
str
nodata_value
No-data value.
Type
float
path
Path to elevation model in GeoTIFF format.
Type
str
raster_type
Type of raster layer to import.
Type
[Link]
replace_asset
Replace default raster with imported one.
Type
bool
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ImportReference
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.

249
Metashape Python Reference, Release 2.2.1

• workitem (int) – Workitem index.


• progress (Callable[[float], None]) – Progress callback.
columns
Column order in csv format (n - label, o - enabled flag, x/y/z - coordinates, X/Y/Z - coordinate accuracy,
a/b/c - rotation angles, A/B/C - rotation angle accuracy, [] - group of multiple values, | - column
separator within group).
Type
str
create_markers
Create markers for missing entries (csv format only).
Type
bool
crs
Reference data coordinate system (csv format only).
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
delimiter
Column delimiter in csv format.
Type
str
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
format
File format.
Type
[Link]
gpu_support
GPU support flag.
Type
bool
group_delimiters
Combine consecutive delimiters in csv format.
Type
bool
ignore_labels
Matches reference data based on coordinates alone (csv format only).
Type
bool

250 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

items
Items to load reference for (csv format only).
Type
[Link]
name
Task name.
Type
str
path
Path to the file with reference data.
Type
str
shutter_lag
Shutter lag in seconds (APM format only).
Type
float
skip_rows
Number of rows to skip in (csv format only).
Type
int
target
Task target.
Type
[Link]
threshold
Error threshold in meters used when ignore_labels is set (csv format only).
Type
float
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ImportShapes
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.

251
Metashape Python Reference, Release 2.2.1

boundary_type
Boundary type to be applied to imported shapes.
Type
[Link]
columns
Column order in csv format (n - label, x/y/z - coordinates, d - description, [] - group of multiple values,
| - column separator within group).
Type
str
crs
Reference data coordinate system (csv format only).
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
delimiter
Column delimiter in csv format.
Type
str
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
format
Shapes format.
Type
[Link]
gpu_support
GPU support flag.
Type
bool
group_delimiters
Combine consequitive delimiters in csv format.
Type
bool
name
Task name.
Type
str
path
Path to shape file.
Type
str

252 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

replace
Replace current shapes with new data.
Type
bool
skip_rows
Number of rows to skip in (csv format only).
Type
int
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ImportTiledModel
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.

253
Metashape Python Reference, Release 2.2.1

Type
str
path
Path to tiled model.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ImportTrajectory
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
columns
Column order in csv format (t - time, x/y/z - coordinates, a/b/c - rotation angles, space - skip column).
Type
str
crs
Point cloud coordinate system.
Type
[Link]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
delimiter
Column delimiter in csv format.
Type
str

254 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
format
Trajectory format.
Type
[Link]
gpu_support
GPU support flag.
Type
bool
group_delimiters
Combine consecutive delimiters in csv format.
Type
bool
name
Task name.
Type
str
path
Trajectory file path.
Type
str
replace_asset
Replace default asset with imported trajectory.
Type
bool
shift
Optional shift to be applied to point coordinates.
Type
[Link]
skip_rows
Number of rows to skip in (csv format only).
Type
int
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.

255
Metashape Python Reference, Release 2.2.1

workitem_count
Work item count.
Type
int
class ImportVideo
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
custom_frame_step
Every custom_frame_step’th frame will be saved. Used for frame_step=CustomFrameStep.
Type
int
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
frame_step
Frame step type.
Type
[Link]
gpu_support
GPU support flag.
Type
bool
image_path
Path to directory where to save frames with filename template. For example:
/path/to/dir/frame{filenum}.png.
Type
str
name
Task name.
Type
str
path
Path to source video.

256 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
str
target
Task target.
Type
[Link]
time_end
The endpoint for importing video, seconds.
Type
float
time_start
The starting point for importing video, seconds.
Type
float
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class InvertMasks
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.

257
Metashape Python Reference, Release 2.2.1

gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class LoadProject
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
archive
Override project format when using non-standard file extension.
Type
bool
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.

258 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
bool
name
Task name.
Type
str
path
Path to project file.
Type
str
read_only
Open project in read only mode.
Type
bool
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class MatchPhotos
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to match.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.

259
Metashape Python Reference, Release 2.2.1

downscale
Image alignment accuracy (0 - Highest, 1 - High, 2 - Medium, 4 - Low, 8 - Lowest).
Type
int
downscale_3d
Laser scan alignment accuracy (1 - Highest, 2 - High, 4 - Medium, 8 - Low, 16 - Lowest).
Type
int
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
filter_mask
Filter points by mask.
Type
bool
filter_stationary_points
Exclude tie points which are stationary across images.
Type
bool
generic_preselection
Enable generic preselection.
Type
bool
gpu_support
GPU support flag.
Type
bool
guided_matching
Enable guided image matching.
Type
bool
keep_keypoints
Store keypoints in the project.
Type
bool
keypoint_limit
Key point limit.
Type
int
keypoint_limit_3d
Key point limit for laser scans.
Type
int

260 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

keypoint_limit_per_mpx
Key point limit per megapixel.
Type
int
laser_scans_use_initial_orientation
Use initial laser scan orientation for keypoint matching.
Type
bool
laser_scans_vertical_axis
Common laser scans axis.
Type
int
mask_tiepoints
Apply mask filter to tie points.
Type
bool
match_laser_scans
Match laser scans using geometric features.
Type
bool
max_workgroup_size
Maximum workgroup size.
Type
int
name
Task name.
Type
str
pairs
User defined list of camera pairs to match.
Type
list[tuple[int, int]]
reference_preselection
Enable reference preselection.
Type
bool
reference_preselection_mode
Reference preselection mode.
Type
[Link]
reset_matches
Reset current matches.
Type
bool

261
Metashape Python Reference, Release 2.2.1

subdivide_task
Enable fine-level task subdivision.
Type
bool
target
Task target.
Type
[Link]
tiepoint_limit
Tie point limit.
Type
int
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
workitem_size_cameras
Number of cameras in a workitem.
Type
int
workitem_size_pairs
Number of image pairs in a workitem.
Type
int
class MergeAssets
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
assets
List of assets to process.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.

262 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
source_data
Asset type.
Type
[Link]
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class MergeChunks
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
chunks
List of chunks to process.
Type
list[int]

263
Metashape Python Reference, Release 2.2.1

copy_depth_maps
Copy depth maps.
Type
bool
copy_elevations
Copy DEMs.
Type
bool
copy_laser_scans
Copy laser scans.
Type
bool
copy_masks
Copy masks.
Type
bool
copy_models
Copy models.
Type
bool
copy_orthomosaics
Copy orthomosaics.
Type
bool
copy_point_clouds
Copy point clouds.
Type
bool
copy_tiled_models
Copy tiled models.
Type
bool
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool

264 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

merge_assets
Merge default assets.
Type
bool
merge_markers
Merge markers.
Type
bool
merge_tiepoints
Merge tie points.
Type
bool
name
Task name.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class OptimizeCameras
Task class containing processing parameters.
adaptive_fitting
Enable adaptive fitting of distortion coefficients.
Type
bool
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.

265
Metashape Python Reference, Release 2.2.1

decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
fit_b1
Enable optimization of aspect ratio.
Type
bool
fit_b2
Enable optimization of skew coefficient.
Type
bool
fit_corrections
Enable optimization of additional corrections.
Type
bool
fit_cx
Enable optimization of X principal point coordinates.
Type
bool
fit_cy
Enable optimization of Y principal point coordinates.
Type
bool
fit_f
Enable optimization of focal length coefficient.
Type
bool
fit_k1
Enable optimization of k1 radial distortion coefficient.
Type
bool
fit_k2
Enable optimization of k2 radial distortion coefficient.
Type
bool
fit_k3
Enable optimization of k3 radial distortion coefficient.
Type
bool
fit_k4
Enable optimization of k3 radial distortion coefficient.

266 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
bool
fit_p1
Enable optimization of p1 tangential distortion coefficient.
Type
bool
fit_p2
Enable optimization of p2 tangential distortion coefficient.
Type
bool
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
target
Task target.
Type
[Link]
tiepoint_covariance
Estimate tie point covariance matrices.
Type
bool
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class PansharpenOrthomosaic
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.

267
Metashape Python Reference, Release 2.2.1

channels
Orthomosaic channel mask (boolean flags, e.g. 0b0010 means only 1st channel is used and the rest
ignored).
Type
int
clip_to_pan_data
Clip result to high resolution orthomosaic.
Type
bool
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
frames
List of frames to process.
Type
list[int]
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
orthomosaic
Orthomosaic to pansharpen.
Type
int
pan_channels
Detailed orthomosaic channel mask (boolean flags, e.g. 0b0010 means only 1st channel is used and
the rest ignored).
Type
int
pan_orthomosaic
Detailed orthomosaic.
Type
int
replace_asset
Replace source orthomosaic with pansharpened result.

268 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
bool
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class PlanMission
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
attach_viewpoints
Generate additional viewpoints to increase coverage.
Type
bool
capture_distance
Image capture distance (m).
Type
float
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool

269
Metashape Python Reference, Release 2.2.1

group_attached_viewpoints
Ignore minimum waypoint spacing for additional viewpoints.
Type
bool
home_point
Home point shape key.
Type
int
horizontal_zigzags
Cover surface with horizontal zigzags instead of vertical.
Type
bool
interesting_zone
Interesting zone shape layer key.
Type
int
max_pitch
Maximum camera pitch angle.
Type
int
min_altitude
Minimum altitude (m).
Type
float
min_pitch
Minimum camera pitch angle.
Type
int
min_waypoint_spacing
Minimum waypoint spacing (m).
Type
float
name
Task name.
Type
str
overlap
Overlap percent.
Type
int
powerlines
Powerlines shape layer key.
Type
int

270 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

restricted_zone
Restricted zone shape layer key.
Type
int
safety_distance
Safety distance (m).
Type
float
safety_zone
Safety zone shape layer key.
Type
int
sensor
Sensor key.
Type
int
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
use_selection
Focus on model selection.
Type
bool
workitem_count
Work item count.
Type
int
class PublishData
Task class containing processing parameters.
account
Account name (Nira (Key ID) service).
Type
str
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.

271
Metashape Python Reference, Release 2.2.1

decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
description
Dataset description.
Type
str
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
hostname
Service hostname (4DMapper and Nira services).
Type
str
image_compression
Image compression parameters.
Type
[Link]
is_draft
Mark dataset as draft (Sketchfab service).
Type
bool
is_private
Set dataset access to private (Pointbox and Sketchfab services).
Type
bool
is_protected
Set dataset access to protected (Pointbox service).
Type
bool
max_zoom_level
Maximum zoom level.
Type
int
min_zoom_level
Minimum zoom level.
Type
int

272 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

name
Task name.
Type
str
owner
Account owner (Cesium and Mapbox services).
Type
str
password
Account password (4DMapper, Agisoft Cloud, Pointscene and Sketchfab services).
Type
str
point_classes
List of point classes to be exported.
Type
list[int]
project_id
Id of a target project (from Agisoft Cloud project URL).
Type
str
projection
Output projection.
Type
[Link]
raster_transform
Raster band transformation.
Type
[Link]
resolution
Output resolution in meters.
Type
float
save_camera_track
Enables/disables export of camera track.
Type
bool
save_point_color
Enables/disables export of point colors.
Type
bool
service
Service to upload on.
Type
[Link]

273
Metashape Python Reference, Release 2.2.1

source_data
Asset type to upload.
Type
[Link]
tags
Dataset tags.
Type
str
target
Task target.
Type
[Link]
tile_size
Tile size in pixels.
Type
int
title
Dataset title.
Type
str
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
token
Account token (Cesium, Mapbox, Nira (Key Secret), Picterra, Pointbox and Sketchfab services).
Type
str
upload_images
Attach photos to Nira publication.
Type
bool
username
Account username (4DMapper, Agisoft Cloud and Pointscene services).
Type
str
workitem_count
Work item count.
Type
int
class ReduceOverlap
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters

274 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• object ([Link] | [Link]) – Chunk or Document object


to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
overlap
Target number of cameras observing each point of the surface.
Type
int
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
use_selection
Focus on model selection.
Type
bool
workitem_count
Work item count.
Type
int
class RefineModel
Task class containing processing parameters.

275
Metashape Python Reference, Release 2.2.1

apply(object [, workitem ][, progress ])


Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
downscale
Refinement quality (1 - Ultra high, 2 - High, 4 - Medium, 8 - Low, 16 - Lowest).
Type
int
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
frames
List of frames to process.
Type
list[int]
gpu_support
GPU support flag.
Type
bool
iterations
Number of refinement iterations.
Type
int
model
Model to process.
Type
int
name
Task name.
Type
str
replace_asset
Replace default asset with refined model.

276 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
bool
smoothness
Smoothing strength. Should be in range [0, 1].
Type
float
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class RemoveLighting
Task class containing processing parameters.
ambient_occlusion_multiplier
Ambient occlusion multiplier. Should be in range [0.25, 4].
Type
float
ambient_occlusion_path
Path to ambient occlusion texture atlas. Can be empty.
Type
str
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
color_mode
Enable multi-color processing mode.
Type
bool
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.

277
Metashape Python Reference, Release 2.2.1

encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
internal_blur
Internal blur. Should be in range [0, 4].
Type
float
mesh_noise_suppression
Mesh normals noise suppression strength. Should be in range [0, 4].
Type
float
name
Task name.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class RenderDepthMaps
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type
list[int]

278 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
path_depth
Path to depth map.
Type
str
path_diffuse
Path to diffuse map.
Type
str
path_normals
Path to normal map.
Type
str
save_depth
Enable export of depth map.
Type
bool
save_diffuse
Enable export of diffuse map.
Type
bool
save_normals
Enable export of normal map.
Type
bool
target
Task target.
Type
[Link]

279
Metashape Python Reference, Release 2.2.1

toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class ResetMasks
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.

280 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class RunScript
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
args
Script arguments.
Type
str
code
Script code.
Type
str
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
path
Script path.
Type
str

281
Metashape Python Reference, Release 2.2.1

target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class SaveProject
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
archive
Override project format when using non-standard file extension.
Type
bool
chunks
List of chunks to be saved.
Type
list[int]
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
name
Task name.

282 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Type
str
path
Path to project.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
version
Project version to save.
Type
str
workitem_count
Work item count.
Type
int
class SmoothModel
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
apply_to_selection
Apply to selected faces.
Type
bool
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.

283
Metashape Python Reference, Release 2.2.1

fix_borders
Fix borders.
Type
bool
frames
List of frames to process.
Type
list[int]
gpu_support
GPU support flag.
Type
bool
model
Key of model to smooth.
Type
int
name
Task name.
Type
str
preserve_edges
Preserve edges.
Type
bool
replace_asset
Replace default asset with smoothed model.
Type
bool
strength
Smoothing strength.
Type
float
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int

284 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

class SmoothPointCloud
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
apply_to_selection
Smooth points within selection.
Type
bool
classes
List of point classes to be smoothed.
Type
list[int]
clip_to_region
Clip point cloud to chunk region.
Type
bool
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
frames
List of frames to process.
Type
list[int]
gpu_support
GPU support flag.
Type
bool
name
Task name.
Type
str
point_cloud
Key of point cloud to filter.
Type
int

285
Metashape Python Reference, Release 2.2.1

replace_asset
Replace default asset with smoothed point cloud.
Type
bool
smoothing_radius
Desired smoothing radius (m).
Type
float
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class TargetType
Task target type in [DocumentTarget, ChunkTarget, FrameTarget]
class TrackMarkers
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
first_frame
Starting frame index.
Type
int

286 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

gpu_support
GPU support flag.
Type
bool
last_frame
Ending frame index.
Type
int
name
Task name.
Type
str
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
class TransformRaster
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
asset
Asset key to transform.
Type
int
clip_to_boundary
Clip raster to boundary shapes.
Type
bool
copy_orthophotos
Copy orthophotos (orthomosaic asset type only).
Type
bool

287
Metashape Python Reference, Release 2.2.1

decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
frames
List of frames to process.
Type
list[int]
gpu_support
GPU support flag.
Type
bool
height
Raster height.
Type
int
name
Task name.
Type
str
nodata_value
No-data value (DEM export only).
Type
float
north_up
Use north-up orientation for export.
Type
bool
operand_asset
Operand asset key.
Type
int
operand_chunk
Operand chunk key.
Type
int
operand_frame
Operand frame key.
Type
int

288 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

projection
Output projection.
Type
[Link]
region
Region to be processed.
Type
[Link]
replace_asset
Replace default raster with transformed one.
Type
bool
resolution
Output resolution in meters.
Type
float
resolution_x
Pixel size in the X dimension in projected units.
Type
float
resolution_y
Pixel size in the Y dimension in projected units.
Type
float
source_data
Selects between DEM and orthomosaic.
Type
[Link]
subtract
Subtraction flag.
Type
bool
target
Task target.
Type
[Link]
toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
width
Raster width.
Type
int

289
Metashape Python Reference, Release 2.2.1

workitem_count
Work item count.
Type
int
world_transform
2x3 raster-to-world transformation matrix.
Type
[Link]
class TriangulateTiePoints
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object ([Link] | [Link]) – Chunk or Document object
to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
gpu_support
GPU support flag.
Type
bool
max_error
Reprojection error threshold.
Type
float
min_image
Minimum number of point projections.
Type
int
name
Task name.
Type
str
target
Task target.
Type
[Link]

290 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

toNetworkTask([objects ])
Convert task to [Link] to be applied to specified objects.
Parameters
objects ([Link] | [Link] | list[Metashape.
Chunk]) – Objects to be processed.
workitem_count
Work item count.
Type
int
createTask(name)
Create task object by its name.
Parameters
name (str) – Task name.
Returns
Task object.
Return type
object
class [Link]
Thumbnail instance
copy()
Returns a copy of thumbnail.
Returns
Copy of thumbnail.
Return type
[Link]
image()
Returns image data.
Returns
Image data.
Return type
[Link]
load(path[, layer ])
Loads thumbnail from file.
Parameters
• path (str) – Path to the image file to be loaded.
• layer (int) – Optional layer index in case of multipage files.
setImage(image)

Parameters
image ([Link]) – Image object with thumbnail data.
class [Link]
A set of thumbnails generated for a chunk frame.

291
Metashape Python Reference, Release 2.2.1

items()
List of items.
keys()
List of item keys.
meta
Thumbnails meta data.
Type
[Link]
modified
Modified flag.
Type
bool
values()
List of item values.
class [Link]
Tie point cloud instance
class Cameras
Collection of [Link] objects indexed by corresponding cameras
class Criterion
Tie points filter criterion in [ReprojectionError, ReconstructionUncertainty, ImageCount, ProjectionAccu-
racy]
class Filter
Tie point cloud filter
The following example selects all tie points from the active chunk that have reprojection error higher than
defined threshold:

>>> chunk = [Link] # active chunk


>>> threshold = 0.5
>>> f = [Link]()
>>> [Link](chunk, criterion = [Link])
>>> [Link](threshold)

class Criterion
Point filtering criterion in [ReprojectionError, ReconstructionUncertainty, ImageCount, ProjectionAc-
curacy]
init(points, criterion, progress)
Initialize tie points filter based on specified criterion.
Parameters
• points ([Link] | [Link]) – Tie points to filter.
• criterion ([Link]) – Point filter criterion.
• progress (Callable[[float], None]) – Progress callback.
max_value
Maximum value.
Type
int | float

292 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

min_value
Minimum value.
Type
int | float
removePoints(threshold)
Remove points based on specified threshold.
Parameters
threshold (float) – Criterion threshold.
resetSelection()
Reset previously made selection.
selectPoints(threshold)
Select points based on specified threshold.
Parameters
threshold (float) – Criterion threshold.
values
List of values.
Type
list[int] | list[float]
class Point
3D point in the tie point cloud
coord
Point coordinates.
Type
[Link]
cov
Point coordinates covariance matrix.
Type
[Link]
selected
Point selection flag.
Type
bool
track_id
Track index.
Type
int
valid
Point valid flag.
Type
bool
class Points
Collection of 3D points in the tie point cloud
copy()
Returns a copy of points buffer.

293
Metashape Python Reference, Release 2.2.1

Returns
Copy of points buffer.
Return type
[Link]
resize(count)
Resize points list.
Parameters
count (int) – new point count
class Projection
Projection of the 3D point on the photo
coord
2D projection coordinates.
Type
[Link]
size
Point size.
Type
float
track_id
Track index.
Type
int
class Projections
Collection of [Link] for the camera
copy()
Returns a copy of projections buffer.
Returns
Copy of projections buffer.
Return type
[Link]
resize(count)
Resize projections list.
Parameters
count (int) – new projections count
class Track
Track in the tie point cloud
color
Track color.
Type
tuple[int | float, . . . ]
class Tracks
Collection of tracks in the tie point cloud
copy()
Returns a copy of tracks buffer.

294 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Returns
Copy of tracks buffer.
Return type
[Link]
resize(count)
Resize track list.
Parameters
count (int) – new track count
bands
List of color bands.
Type
list[str]
cleanup([progress ])
Remove points with insufficient number of projections.
Parameters
progress (Callable[[float], None]) – Progress callback.
copy(keypoints=True)
Returns a copy of the tie point cloud.
Parameters
keypoints (bool) – copy key points data.
Returns
Copy of the tie point cloud.
Return type
[Link]
cropSelectedPoints()
Crop selected points.
cropSelectedTracks()
Crop selected tie points.
data_type
Data type used to store color values.
Type
[Link]
export(path, format='obj' [, projection ])
Export tie points.
Parameters
• path (str) – Path to output file.
• format (str) – Export format in [‘obj’, ‘ply’].
• projection ([Link] | [Link]) – Sets output
projection.
invertSelection()
Invert selection.

295
Metashape Python Reference, Release 2.2.1

meta
Tie points meta data.
Type
[Link]
modified
Modified flag.
Type
bool
pickPoint(origin, target, endpoints=1)
Returns ray intersection with the tie point cloud (point on the ray nearest to some point).
Parameters
• origin ([Link]) – Ray origin.
• target ([Link]) – Point on the ray.
• endpoints (int) – Number of endpoints to check for (0 - line, 1 - ray, 2 - segment).
Returns
Coordinates of the intersection point.
Return type
[Link]
points
List of points.
Type
[Link]
projections
Point projections for each photo.
Type
[Link]
removeKeypoints()
Remove keypoints from tie point cloud.
removeSelectedPoints()
Remove selected points.
removeSelectedTracks()
Remove selected tie points.
renderDepth(transform, calibration, point_size=1, cull_points=False, add_alpha=True)
Render tie points depth image for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• point_size (int) – Point size.
• cull_points (bool) – Enable normal based culling.
• add_alpha (bool) – Generate image with alpha channel.

296 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Returns
Rendered image.
Return type
[Link]
renderImage(transform, calibration, point_size=1, cull_points=False, add_alpha=True,
raster_transform=RasterTransformNone)
Render tie points image for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• point_size (int) – Point size.
• cull_points (bool) – Enable normal based culling.
• add_alpha (bool) – Generate image with alpha channel.
• raster_transform ([Link]) – Raster band transforma-
tion.
Returns
Rendered image.
Return type
[Link]
renderMask(transform, calibration, point_size=1, cull_points=False)
Render tie points mask image for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• point_size (int) – Point size.
• cull_points (bool) – Enable normal based culling.
Returns
Rendered image.
Return type
[Link]
renderNormalMap(transform, calibration, point_size=1, cull_points=False, add_alpha=True)
Render image with tie points normals for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• point_size (int) – Point size.
• cull_points (bool) – Enable normal based culling.
• add_alpha (bool) – Generate image with alpha channel.
Returns
Rendered image.

297
Metashape Python Reference, Release 2.2.1

Return type
[Link]
renderPreview(width = 2048, height = 2048[, transform ], point_size=1[, progress ])
Generate tie points preview image.
Parameters
• width (int) – Preview image width.
• height (int) – Preview image height.
• transform ([Link]) – 4x4 viewpoint transformation matrix.
• point_size (int) – Point size.
• progress (Callable[[float], None]) – Progress callback.
Returns
Preview image.
Return type
[Link]
tracks
List of tracks.
Type
[Link]
class [Link]
Tiled model data.
class FaceCount
Tiled model face count in [LowFaceCount, MediumFaceCount, HighFaceCount]
bands
List of color bands.
Type
list[str]
clear()
Clears tiled model data.
copy()
Create a copy of the tiled model.
Returns
Copy of the tiled model.
Return type
[Link]
crs
Reference coordinate system.
Type
[Link] | None

298 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

data_type
Data type used to store color values.
Type
[Link]
key
Tiled model identifier.
Type
int
label
Tiled model label.
Type
str
meta
Tiled model meta data.
Type
[Link]
modified
Modified flag.
Type
bool
pickPoint(origin, target, endpoints=1)
Returns ray intersection with the tiled model.
Parameters
• origin ([Link]) – Ray origin.
• target ([Link]) – Point on the ray.
• endpoints (int) – Number of endpoints to check for (0 - line, 1 - ray, 2 - segment).
Returns
Coordinates of the intersection point.
Return type
[Link]
renderDepth(transform, calibration, resolution=1, cull_faces=True, add_alpha=True)
Render tiled model depth image for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• resolution (float) – Level of detail resolution in screen pixels.
• cull_faces (bool) – Enable back-face culling.
• add_alpha (bool) – Generate image with alpha channel.
Returns
Rendered image.

299
Metashape Python Reference, Release 2.2.1

Return type
[Link]
renderImage(transform, calibration, resolution=1, cull_faces=True, add_alpha=True,
raster_transform=RasterTransformNone, matcap_image, smooth_normals=True, color)
Render tiled model image for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• resolution (float) – Level of detail resolution in screen pixels.
• cull_faces (bool) – Enable back-face culling.
• add_alpha (bool) – Generate image with alpha channel.
• raster_transform ([Link]) – Raster band transforma-
tion.
• matcap_image ([Link]) – Matcap image used to shade model.
• smooth_normals – Enable normals smoothing.:type smooth_normals: bool
• color (list[int]:return: Rendered image.) – Solid view color.
Return type
[Link]
renderMask(transform, calibration, resolution=1, cull_faces=True)
Render tiled model mask image for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• resolution (float) – Level of detail resolution in screen pixels.
• cull_faces (bool) – Enable back-face culling.
Returns
Rendered image.
Return type
[Link]
renderNormalMap(transform, calibration, resolution=1, cull_faces=True, add_alpha=True)
Render image with tiled model normals for specified viewpoint.
Parameters
• transform ([Link]) – Camera location.
• calibration ([Link]) – Camera calibration.
• resolution (float) – Level of detail resolution in screen pixels.
• cull_faces (bool) – Enable back-face culling.
• add_alpha (bool) – Generate image with alpha channel.
• smooth_normals – Enable normals smoothing.:type smooth_normals: bool

300 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Returns
Rendered image.
Return type
[Link]
renderPreview(width = 2048, height = 2048[, transform ][, progress ])
Generate tiled model preview image.
Parameters
• width (int) – Preview image width.
• height (int) – Preview image height.
• transform ([Link]) – 4x4 viewpoint transformation matrix.
• progress (Callable[[float], None]) – Progress callback.
Returns
Preview image.
Return type
[Link]
resolution
Tiled model resolution in m/pix.
Type
float
transform
4x4 tiled model transformation matrix.
Type
[Link]
class [Link]
Tiled model format in [TiledModelFormatNone, TiledModelFormatTLS, TiledModelFormatLOD, TiledMod-
elFormatZIP, TiledModelFormatCesium, TiledModelFormatSLPK, TiledModelFormatOSGB, TiledModelFor-
matOSGT, TiledModelFormat3MX]
class [Link]
Trajectory data.
class Position
Trajectory position
location
Position coordinates.
Type
[Link]
masked
Position mask flag.
Type
bool
rotation
Rotation vector.

301
Metashape Python Reference, Release 2.2.1

Type
[Link]
selected
Position selection flag.
Type
bool
time
Position timestamp.
Type
double
class Positions
Collection of trajectory positions
copy()
Returns a copy of position list.
Returns
Copy of position list.
Return type
[Link]
resize(count)
Resize position list.
Parameters
count (int) – new position count
addTimeOffset(offset)
Add time offset to trajectory positions.
Parameters
offset (float) – Time offset to add, in seconds.
clear()
Clear trajectory data.
copy()
Create a copy of the trajectory.
Returns
Copy of the trajectory.
Return type
[Link]
createMask(heading_threshold=10, min_duration=5, min_distance=20, crop_with_data=False,
trim_ends=True[, progress ])
Create automatic trajectory mask.
Parameters
• heading_threshold (float) – Maximum difference of heading in segment, in degrees.
• min_duration (float) – Minimal time duration of segment, in seconds.
• min_distance (float) – Minimal distance of segment, in meters.
• crop_with_data (bool) – Enable segment cropping with corresponding point clouds.
• trim_ends (bool) – Enable segment ends trimming.

302 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• progress (Callable[[float], None]) – Progress callback.


cropMaskBySelection()
Crop trajectory mask by selection.
crs
Reference coordinate system.
Type
[Link] | None
extent
Trajectory extent in local trajectory coordinate system.
Type
[Link]
invertSelection()
Invert selection.
key
Trajectory identifier.
Type
int
label
Trajectory label.
Type
str
maskSelectedPositions()
Mask selected trajectory positions.
meta
Trajectory meta data.
Type
[Link]
modified
Modified flag.
Type
bool
position_count
Number of positions in trajectory.
Type
int
positions
List of trajectory positions.
Type
[Link]
resetMask()
Reset trajectory mask.

303
Metashape Python Reference, Release 2.2.1

selected
Selects/deselects the trajectory.
Type
bool
transform
4x4 trajectory transformation matrix.
Type
[Link]
unmaskSelectedPositions()
Unmask selected trajectory positions.
class [Link]
Trajectory format in [TrajectoryFormatNone, TrajectoryFormatCSV, TrajectoryFormatSBET, TrajectoryFormat-
SOL, TrajectoryFormatTRJ]
class [Link]
Utility functions.
createChessboardImage(calib, cell_size=150, max_tilt=30)
Synthesizes photo of a chessboard.
Parameters
• calib ([Link]) – Camera calibration.
• cell_size (float) – Chessboard cell size.
• max_tilt (float) – Maximum camera tilt in degrees.
Returns
Resulting image.
Return type
[Link]
createDifferenceMask(image, background, tolerance=10, fit_colors=True)
Creates mask from a pair of images or an image and specified color.
Parameters
• image ([Link]) – Image to be masked.
• background ([Link] | tuple[int, ...]) – Background image or color
value.
• tolerance (int) – Tolerance value.
• fit_colors (bool) – Enables white balance correction.
Returns
Resulting mask.
Return type
[Link]
createMarkers(chunk, projections)
Creates markers from a list of non coded projections.
Parameters

304 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

• chunk ([Link]) – Chunk to create markers in.


• projections (list[tuple[[Link], [Link]]]) – List of
marker projections.
detectTargets(image, type=TargetCircular12bit, tolerance=50, inverted=False, noparity=False[,
minimum_size ][, minimum_dist ])
Detect targets on the image.
Parameters
• image ([Link]) – Image to process.
• type ([Link]) – Type of targets.
• tolerance (int) – Detector tolerance (0 - 100).
• inverted (bool) – Detect markers on black background.
• noparity (bool) – Disable parity checking.
• minimum_size (int) – Minimum target radius in pixels to be detected (CrossTarget type
only).
• minimum_dist (int) – Minimum distance between targets in pixels (CrossTarget type
only).
Returns
List of detected targets.
Return type
list[[Link]]
dmat2euler(R, dR, euler_angles=EulerAnglesYPR)
Calculate tangent euler rotation vector from tangent rotation matrix.
Parameters
• R ([Link]) – Rotation matrix.
• dR ([Link]) – Tangent rotation matrix.
• euler_angles ([Link]) – Euler angles to use.
Returns
Tangent rotation angles in degrees.
Return type
[Link]
estimateImageQuality(image[, mask ])
Estimate image sharpness.
Parameters
• image ([Link]) – Image to be analyzed.
• mask ([Link]) – Mask of the analyzed image region.
Returns
Quality metric.
Return type
float

305
Metashape Python Reference, Release 2.2.1

euler2mat(rotation, euler_angles=EulerAnglesYPR)
Calculate camera to world rotation matrix from euler rotation angles.
Parameters
• rotation ([Link]) – Rotation vector.
• euler_angles ([Link]) – Euler angles to use.
Returns
Rotation matrix.
Return type
[Link]
mat2euler(R, euler_angles=EulerAnglesYPR)
Calculate euler rotation angles from camera to world rotation matrix.
Parameters
• R ([Link]) – Rotation matrix.
• euler_angles ([Link]) – Euler angles to use.
Returns
Rotation angles in degrees.
Return type
[Link]
mat2opk(R)
Calculate omega, phi, kappa from camera to world rotation matrix.
Parameters
R ([Link]) – Rotation matrix.
Returns
Omega, phi, kappa angles in degrees.
Return type
[Link]
mat2ypr(R)
Calculate yaw, pitch, roll from camera to world rotation matrix.
Parameters
R ([Link]) – Rotation matrix.
Returns
Yaw, pitch roll angles in degrees.
Return type
[Link]
opk2mat(angles)
Calculate camera to world rotation matrix from omega, phi, kappa angles.
Parameters
angles ([Link]) – Omega, phi, kappa angles in degrees.
Returns
Rotation matrix.

306 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

Return type
[Link]
ypr2mat(angles)
Calculate camera to world rotation matrix from yaw, pitch, roll angles.
Parameters
angles ([Link]) – Yaw, pitch, roll angles in degrees.
Returns
Rotation matrix.
Return type
[Link]
class [Link]
n-component vector

>>> import Metashape


>>> vect = [Link]( (1, 2, 3) )
>>> vect2 = [Link]()
>>> [Link] = 4
>>> vect2.w = 5
>>> vect2 *= -1.5
>>> [Link] = 4
>>> [Link]()
>>> [Link]("Scalar product is " + str(vect2 * vect))

copy()
Return a copy of the vector.
Returns
A copy of the vector.
Return type
[Link]
cross(a, b)
Cross product of 2 vectors.
Parameters
• a ([Link]) – First vector.
• b ([Link]) – Second vector.
Returns
Cross product.
Return type
[Link]
norm()
Return norm of the vector.
norm2()
Return squared norm of the vector.
normalize()
Normalize vector to the unit length.

307
Metashape Python Reference, Release 2.2.1

normalized()
Return a new, normalized vector.
Returns
a normalized copy of the vector
Return type
[Link]
size
Vector dimensions.
Type
int
w
Vector W component.
Type
float
x
Vector X component.
Type
float
y
Vector Y component.
Type
float
z
Vector Z component.
Type
float
zero()
Set all elements to zero.
class [Link]
Version object contains application version numbers.
build
Build number.
Type
int
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]

308 Chapter 2. Application Modules


Metashape Python Reference, Release 2.2.1

major
Major version number.
Type
int
micro
Micro version number.
Type
int
minor
Minor version number.
Type
int
class [Link](app)
Represents viewpoint in the model view
center
Camera center.
Type
[Link]
coo
Center of orbit.
Type
[Link]
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]
fov
Camera vertical field of view in degrees.
Type
float
height
OpenGL window height.
Type
int
mag
Camera magnification defined by distance to the center of rotation.
Type
float

309
Metashape Python Reference, Release 2.2.1

rot
Camera rotation matrix.
Type
[Link]
width
OpenGL window width.
Type
int
class [Link]
Vignetting polynomial
copy()
Return a copy of the object.
Returns
A copy of the object.
Return type
[Link]

310 Chapter 2. Application Modules


CHAPTER

THREE

PYTHON API CHANGE LOG

3.1 Metashape version 2.2.1

• Added CleanTiePoints and CleanModel classes


• Added [Link] and [Link] enums
• Added alignCamerasByReference(), cleanTiePoints() and cleanModel() methods to Chunk class
• Added [Link]() method
• Added [Link]() method
• Added DuplicateAsset.copy_patches attribute
• Added AlignCameras.align_laser_scans attribute
• Added align_laser_scans argument to [Link]() method
• Removed ServiceMelown from ServiceType enum

3.2 Metashape version 2.2.0

• Added Geoid class


• Added PansharpenOrthomosaic, ClassifyOverlapPoints and ImportVideo classes
• Added MasksData and BlockModelData to DataSource enum
• Added MaskingModeAI to MaskingMode enum
• Added AprilTag16h5, AprilTag25h9, AprilTag36h10, AprilTag36h11, AprilTagCircle21h7, AprilTagStan-
dard41h12 and AprilTagStandard52h13 to TargetType enum
• Added PointCloudFormatCSV to PointCloudFormat enum
• Added PointCloudViewAccuracy to [Link] enum
• Added TiePointsViewImageCount to [Link] enum
• Added [Link]() method
• Added [Link]() method
• Added clear() and copy() methods to Masks class
• Added [Link]() method
• Added listGeoids() and setContext() methods to CoordinateSystem class

311
Metashape Python Reference, Release 2.2.1

• Added [Link] attribute


• Added mask_sets attribute to Chunk class
• Added bias, bias_acc, bias_covariance, bias_fixed and bias_ref attributes to Antenna class
• Added key and label attributes to Masks class
• Added transfer_texture attribute to BuildOrthomosaic class
• Added source_data attribute to BuildTexture class
• Added replace_asset and frames attributes to ColorizePointCloud, SmoothPointCloud, SmoothModel and Re-
fineModel classes
• Added model attribute to RefineModel class
• Added copy_masks attribute to DuplicateChunk and MergeChunks classes
• Added image_path, convert_to_pinhole and save_images attributes to ExportCameras class
• Added laser_scans_use_initial_orientation attribute to MatchPhotos class
• Added [Link] attribute
• Added frames and replace_asset attributes to GenerateMasks class
• Added columns, delimiter, generate_panorama, group_delimiters, load_images, load_point_classification,
load_point_color, load_point_confidence, load_point_index, load_point_intensity, load_point_normal,
load_point_return_number, load_point_scan_angle, load_point_source_id, load_point_timestamp and
skip_rows attributes to ImportPointCloud class
• Added ExportPointCloud.point_clouds attribute
• Added transfer_texture argument to [Link]() method
• Added source_data argument to [Link]() method
• Added replace_asset and frames arguments to [Link](), [Link](),
[Link]() and [Link]() methods
• Added model argument to [Link]() method
• Added copy_masks argument to [Link]() method
• Added image_path, save_images and convert_to_pinhole arguments to [Link]() method
• Added laser_scans_use_initial_orientation argument to [Link]() method
• Added point_clouds argument to [Link]() method
• Added replace_asset and frames arguments to [Link]() method
• Added columns, delimiter, generate_panorama, group_delimiters, load_images, load_point_classification,
load_point_color, load_point_confidence, load_point_index, load_point_intensity, load_point_normal,
load_point_return_number, load_point_scan_angle, load_point_source_id, load_point_timestamp and
skip_rows arguments to [Link]() method
• Added progress argument to [Link]() method
• Added matcap_image, smooth_normals and color arguments to [Link]() method
• Added smooth_normals argument to [Link]() method
• Added matcap_image, smooth_normals and color arguments to [Link]() method
• Added smooth_normals argument to [Link]() method
• Changed units for time_start and time_end arguments to seconds in [Link]() method

312 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

• Changed default value of clip_to_region attribute to False for ExportPointCloud, FilterPointCloud and Smooth-
PointCloud classes
• Changed default value of clip_to_region argument to False in [Link](),
[Link]() and [Link]() methods
• Renamed BuildTexture.source_model attribute to source_asset
• Removed [Link]() method
• Removed [Link]() method
• Removed ExportPointCloud.point_cloud attribute
• Removed ignore_normals and import_images attributes from ImportPointCloud class
• Removed point_cloud argument from [Link]() method
• Removed ignore_normals and import_images arguments from [Link]() method

3.3 Metashape version 2.1.4

• Added [Link]() method


• Added enabled and selected attributes to Model class
• Added key and selected attributes to CameraTrack class
• Added block_margin and clip_to_block attributes to ExportModel class
• Added group_delimiters attribute to ImportTrajectory class
• Added clip_to_block and block_margin arguments to [Link]() method
• Added group_delimiters argument to [Link]() method

3.4 Metashape version 2.1.3

• Added Trajectory class


• Added [Link], [Link] and [Link] classes
• Added [Link] and [Link] classes
• Added [Link] class
• Added CamerasFormatColmap to CamerasFormat enum
• Added addModelGroup(), addTrajectory(), findModelGroup() and findTrajectory() methods to Chunk class
• Added invertSelection() method to TiePoints, PointCloud and Model classes
• Added extent() and selectPointsByRegion() methods to PointCloud class
• Added altitudeSlopeAspect(), coverageArea() and update() methods to Elevation class
• Added camera() and coverageArea() methods to Orthomosaic class
• Added trajectory and trajectories attributes to Chunk class
• Added palette_absolute_values and patches attributes to Elevation class
• Added bands and data_type attributes to [Link] class

3.3. Metashape version 2.1.4 313


Metashape Python Reference, Release 2.2.1

• Added block_index and block_region attributes to Model class


• Added point_count_by_class attribute to PointCloud class
• Added resolution attribute to TiledModel class
• Added show_basemap, show_cameras, show_elevation, show_laser_scans, show_markers, show_orthomosaic,
show_shapes and show_trajectory attributes to ModelView class
• Added center, width, height, projection and scale attributes to OrthoView class
• Added Application.photo_view attribute
• Added merge_markers attribute to DetectMarkers class
• Added copy_orthophotos attribute to DuplicateAsset class
• Added copy_laser_scans, cameras and laser_scans attributes to DuplicateChunk class
• Added cameras, image_compression and save_masks attributes to ExportCameras class
• Added logo_path attribute to ExportReport class
• Added clip_to_boundary and copy_orthophotos attributes to TransformRaster class
• Added cameras and laser_scans arguments to [Link]() method
• Added merge_markers argument to [Link]() method
• Added save_masks, image_compression, cameras and chan_rotation_order arguments to
[Link]() method
• Added logo_path argument to [Link]() method
• Added clip_to_boundary and copy_orthophotos arguments to [Link]() method

3.5 Metashape version 2.1.2

• Added ServiceNira and ServiceAgisoftCloud to ServiceType enum


• Added ReferenceItemsAll to ReferenceItems enum
• Added [Link]() method
• Added alignNormals(), invertNormals() and setPointReturnsFilter() methods to PointCloud class
• Added [Link]() method
• Added Camera.point_cloud attribute
• Added borrowed, floating and rehostable attributes to License class
• Added clip_to_region attribute to ExportModel, ExportTiledModel, ExportPointCloud, FilterPointCloud,
SmoothPointCloud and DuplicateAsset classes
• Added save_absolute_paths attribute to ExportCameras class
• Added save_elevation attribute to ExportShapes class
• Added project_id and upload_images attributes to PublishData class
• Added clip_to_region argument to [Link](), [Link](),
[Link](), [Link]() and [Link]() methods
• Added save_absolute_paths argument to [Link]() method
• Added save_elevation argument to [Link]() method

314 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

• Added project_id and upload_images arguments to [Link]() method


• Added only_visible argument to [Link]() class

3.6 Metashape version 2.1.1

• Added [Link]() method


• Added [Link]() method
• Added key attribute to CameraGroup, MarkerGroup and ScalebarGroup classes
• Added BuildTexture.anti_aliasing attribute
• Added ExportModel.gltf_y_up attribute
• Added anti_aliasing argument to [Link]() method
• Added gltf_y_up argument to [Link]() method

3.7 Metashape version 2.1.0

• Added Component and ModelGroup classes


• Added TrajectoryData, LaserScansData and DepthMapsAndLaserScansData to DataSource enum
• Added PointCloudFormatCOPC to PointCloudFormat enum
• Added ModelViewElevation to [Link] enum
• Added TiePointsViewElevation to [Link] enum
• Added TiledModelViewElevation to [Link] enum
• Added [Link]() and [Link]() methods
• Added [Link]() method
• Added [Link]() method
• Added [Link] attribute
• Added loop and smooth attributes to CameraTrack class
• Added component, components, model_group and model_groups attributes to Chunk class
• Added crs, group and transform attributes to Model class
• Added [Link] attribute
• Added replace_asset and frames attributes to BuildModel, BuildTiledModel, BuildPointCloud, BuildDem, Buil-
dOrthomosaic, DecimateModel, FilterPointCloud, ImportRaster and TransformRaster classes
• Added split_in_blocks, blocks_crs, blocks_size, blocks_origin, clip_to_boundary, export_blocks, build_texture
and output_folder attributes to BuildModel class
• Added workitem_size_cameras and max_workgroup_size attributes to BuildTexture class
• Added BuildUV.pixel_size attribute
• Added ClassifyGroundPoints.max_terrain_slope attribute
• Added ExportPointCloud.tileset_version attribute

3.6. Metashape version 2.1.1 315


Metashape Python Reference, Release 2.2.1

• Added [Link] attribute


• Added model attribute to ColorizeModel and SmoothModel classes
• Added tiled_model, tileset_version, model_group, pixel_size, tile_size and face_count attributes to ExportTiled-
Model class
• Added replace_asset and frame_paths attributes to ImportModel class
• Added match_laser_scans, downscale_3d, keypoint_limit_3d and laser_scans_vertical_axis attributes to Match-
Photos class
• Added classes and apply_to_selection attributes to SmoothPointCloud class
• Added ImportPointCloud.ignore_normals attribute
• Added replace_asset and frames arguments to [Link](), [Link](),
[Link](), [Link](), [Link](), [Link](),
[Link](), [Link]() and [Link]() methods
• Added replace_asset and frame_paths arguments to [Link]() method
• Added split_in_blocks, blocks_crs, blocks_size, blocks_origin, clip_to_boundary, export_blocks, build_texture
and output_folder arguments to [Link]() method
• Added workitem_size_cameras and max_workgroup_size arguments to [Link]() method
• Added pixel_size argument to [Link]() method
• Added max_terrain_slope argument to [Link]() method
• Added tileset_version argument to [Link]() method
• Added asset argument to [Link]() method
• Added model argument to [Link]() and [Link]() methods
• Added tiled_model, tileset_version, model_group, pixel_size, tile_size and face_count arguments to
[Link]() method
• Added match_laser_scans, downscale_3d, keypoint_limit_3d and laser_scans_vertical_axis arguments to
[Link]() method
• Added classes and apply_to_selection arguments to [Link]() method
• Added ignore_normals argument to [Link]() method
• Added publish argument to [Link]() method
• Replaced ExportTiledModel.use_rtc_center attribute with use_tileset_transform
• Replaced use_rtc_center argument in [Link]() method with use_tileset_transform
• Renamed RefineMesh class to RefineModel
• Renamed [Link]() method to refineModel()
• Renamed [Link]() method to transformVertices()
• Renamed [Link]() method to serverVersion()
• Renamed [Link]() method to serverInfo()
• Renamed [Link]() method to batchInfo()
• Renamed [Link]() method to exportBatches()
• Renamed [Link]() method to importBatches()

316 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

• Renamed [Link]() method to setBatchWorkerLimit()


• Renamed [Link]() method to workerList()
• Renamed [Link]() method to workerInfo()
• Renamed [Link]() method to quitWorker()
• Renamed [Link]() method to abortWorker()
• Renamed [Link]() method to setWorkerCpuEnabled()
• Renamed [Link]() method to setWorkerCapability()
• Renamed [Link]() method to setWorkerGpuMask()
• Renamed [Link]() method to setWorkerPaused()
• Renamed [Link]() method to setWorkerPriority()
• Renamed NetworkTask.supports_gpu attribute to gpu_support
• Renamed supports_gpu attribute to gpu_support in task classes
• Renamed [Link] attribute to model
• Renamed TransformRaster.data_source attribute to source_data
• Renamed RenderDepthMaps.export_depth, export_diffuse and export_normals attributes to save_depth,
save_diffuse and save_normals
• Renamed asset argument in [Link]() method to model
• Renamed data_source argument in [Link]() method to source_data
• Added .pyi stub file to stand-alone Python module for autocompletion in external IDEs

3.8 Metashape version 2.0.4

• Added borrowLicense() and returnLicense() methods to License class


• Added removeTextures(), removeUV(), removeVertexColors() and removeVertexConfidence() methods to Model
class
• Added [Link] attribute
• Added publish argument to [Link]() method
• Added format argument to [Link]() and [Link]() methods

3.9 Metashape version 2.0.3

• Added SmoothPointCloud class


• Added [Link]() method
• Added enabled and selected attributes to PointCloud class
• Added mask_dark_pixels and frame_detector attributes to DetectFiducials class
• Added mask_dark_pixels and frame_detector arguments to [Link]() method

3.8. Metashape version 2.0.4 317


Metashape Python Reference, Release 2.2.1

3.10 Metashape version 2.0.2

• Added PointCloudGroup class


• Added TiledModelFormat3MX to TiledModelFormat enum
• Added [Link]() and [Link]() methods
• Added Chunk.point_cloud_groups attribute
• Added [Link] and PointCloud.is_laser_scan attributes

3.11 Metashape version 2.0.1

• Added [Link]() method


• Added DetectFiducials.v_shape_detector attribute
• Added model and save_metadata_xml attributes to ExportModel task
• Added v_shape_detector argument to [Link]() method
• Added model and save_metadata_xml arguments to [Link]() method
• Replaced license_key argument with activation_params in [Link]() method

3.12 Metashape version 2.0.0

• Added TrajectoryFormat enum


• Added DisplacementMap to [Link] enum
• Added ImportTrajectory class
• Added ImportDepthImages class
• Added [Link]() method
• Added [Link]() method
• Added AlignCameras.point_clouds attribute
• Added ImportDepthImages.color_filenames attribute
• Added precision, is_laser_scan, replace_asset, import_images, scanner_at_origin, ignore_scanner_origin, ig-
nore_trajectory, trajectory and frame_paths attributes to ImportPointCloud class
• Added keep_existing, return_number and point_cloud attributes to ClassifyGroundPoints class
• Added point_cloud attribute to ClassifyPoints, ColorizePointCloud, CalculatePointNormals, CompactPoint-
Cloud and ExportPointCloud classes
• Added max_quantization_error attribute to DetectPowerlines class
• Added use_rtc_center attribute to ExportTiledModel class
• Added merge_assets, copy_laser_scans, copy_depth_maps, copy_point_clouds, copy_models,
copy_tiled_models, copy_elevations and copy_orthomosaics attributes to MergeChunks class
• Added point_clouds argument to [Link]() method
• Added color_filenames argument to [Link]() method

318 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

• Added precision, is_laser_scan, replace_asset, import_images, scanner_at_origin, ignore_scanner_origin, ig-


nore_trajectory, trajectory and frame_paths arguments to [Link]() method
• Added point_cloud argument to [Link](), [Link]() and
[Link]() methods
• Added max_quantization_error argument to [Link]() method
• Added keep_existing and return_number arguments to [Link]() method
• Added use_rtc_center argument to [Link]() method
• Added merge_assets, copy_laser_scans, copy_depth_maps, copy_point_clouds, copy_models,
copy_tiled_models, copy_elevations and copy_orthomosaics arguments to [Link]() method
• Added drone_name, payload_name and payload_position arguments to [Link]() method
• Change default source_data argument value for [Link]() and [Link]() methods to
DepthMapsData
• Renamed PointsFormat enum to PointCloudFormat
• Renamed [Link] enum to [Link]
• Renamed [Link] enum to [Link] and added Point-
CloudViewSolid, PointCloudViewIntensity, PointCloudViewElevation, PointCloudViewReturnNumber, Point-
CloudViewScanAngle, PointCloudViewSourceId enumeration values
• Renamed [Link] enum value to [Link]
• Renamed [Link] enum value to [Link]
• Renamed PointCloud class to TiePoints
• Renamed DenseCloud class to PointCloud
• Renamed AnalyzePhotos class to AnalyzeImages
• Renamed BuildDenseCloud class to BuildPointCloud
• Renamed CalibrateLens class to CalibrateCamera
• Renamed ColorizeDenseCloud class to ColorizePointCloud
• Renamed CompactDenseCloud class to CompactPointCloud
• Renamed ExportDepth class to RenderDepthMaps
• Renamed ExportPoints class to ExportPointCloud
• Renamed FilterDenseCloud class to FilterPointCloud
• Renamed ImportPoints class to ImportPointCloud
• Renamed TriangulatePoints class to TriangulateTiePoints
• Renamed [Link]() method to addPointCloud()
• Renamed [Link]() method to analyzeImages()
• Renamed [Link]() method to buildPointCloud()
• Renamed [Link]() method to colorizePointCloud()
• Renamed [Link]() method to exportPointCloud()
• Renamed [Link]() method to filterPointCloud()
• Renamed [Link]() method to findPointCloud()

3.12. Metashape version 2.0.0 319


Metashape Python Reference, Release 2.2.1

• Renamed [Link]() method to importPointCloud()


• Renamed [Link]() method to thinTiePoints()
• Renamed [Link]() method to triangulateTiePoints()
• Renamed Chunk.point_cloud attribute to tie_points
• Renamed Chunk.dense_cloud attribute to point_cloud
• Renamed Chunk.dense_clouds attribute to point_clouds
• Renamed ModelView.point_cloud_view_mode attribute to tie_points_view_mode
• Renamed ModelView.dense_cloud_view_mode attribute to point_cloud_view_mode
• Renamed AddFrames.copy_dense_cloud attribute to copy_point_cloud
• Renamed DuplicateChunk.copy_dense_clouds attribute to copy_point_clouds
• Renamed [Link] attribute to point_cloud
• Renamed PublishData.save_point_colors attribute to save_point_color
• Renamed copy_dense_cloud argument in [Link]() method to copy_point_cloud
• Renamed save_point_colors argument in [Link]() method to save_point_color
• Renamed asset argument in [Link]() method to point_cloud
• Renamed source argument in [Link]() method to source_class
• Revised parameter names for point attributes in ExportPointCloud class and [Link]() methods
• Removed ImportLaserScans class
• Removed [Link]() method
• Removed [Link]() method
• Removed use_trajectory, traj_path, traj_columns, traj_delimiter and traj_skip_rows attributes from ImportPoint-
Cloud class
• Removed use_trajectory, traj_path, traj_columns, traj_delimiter and traj_skip_rows arguments from
[Link]() method
• Removed merge_depth_maps, merge_dense_clouds, merge_models, merge_elevations and merge_orthomosaics
attributes from MergeChunks class
• Removed merge_depth_maps, merge_dense_clouds, merge_models, merge_elevations and merge_orthomosaics
arguments from [Link]() method

3.13 Metashape version 1.8.5

• Added DetectPowerlines class


• Added [Link]() method
• Added [Link]() method
• Added generic_detector, right_angle_detector, fiducials_position_corners and fiducials_position_sides attributes
to DetectFiducials class
• Added archive attribute to LoadProject and SaveProject classes

320 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

• Added generic_detector, right_angle_detector, fiducials_position_corners and fiducials_position_sides argu-


ments to [Link]() method
• Added archive argument to [Link]() and [Link]() methods

3.14 Metashape version 1.8.4

• Added [Link] enum


• Added ImageFormatBZ2, ImageFormatASCII and ImageFormatKTX to ImageFormat enum
• Added [Link]() method
• Added ExportPoints.folder_depth and ExportTiledModel.folder_depth attributes
• Added [Link] attribute
• Added folder_depth argument to [Link]() and [Link]() methods
• Added multiplane argument to [Link]() method
• Changed type of Sensor.rolling_shutter attribute to [Link]
• Fixed [Link] and [Link] attributes to return non-None values

3.15 Metashape version 1.8.3

• Added CloudClient class


• Added PublishData class
• Added CalibrationFormatSTMap to CalibrationFormat enum
• Reorganized arguments of [Link]() method

3.16 Metashape version 1.8.2

No Python API changes

3.17 Metashape version 1.8.1

• Added CamerasFormatMA to CamerasFormat enum


• Added global_profile attribute to ExportRaster class
• Added traj_columns, traj_delimiter, traj_path, traj_skip_rows and use_trajectory attributes to ImportPoints class
• Added global_profile argument to [Link]() method
• Added use_trajectory, traj_path, traj_columns, traj_delimiter and traj_skip_rows arguments to
[Link]() method
• Removed fix_pixel_aspect, fix_principal_point, and remove_distortions attributes from ConvertImages class

3.14. Metashape version 1.8.4 321


Metashape Python Reference, Release 2.2.1

3.18 Metashape version 1.8.0

• Added BuildPanorama and CalculatePointNormals classes


• Added ImageFormatJXL to ImageFormat enum
• Added Cylindrical to [Link] enum
• Added [Link](), [Link]() and [Link]() methods
• Added findCamera(), findCameraGroup(), findCameraTrack(), findDenseCloud(), findDepthMaps(), findEleva-
tion(), findMarker(), findMarkerGroup(), findModel(), findOrthomosaic(), findScalebar(), findScalebarGroup(),
findSensor() and findTiledModel() methods to Chunk class
• Added [Link]() method
• Added [Link]() and [Link]() methods
• Added Settings.project_absolute_paths and Settings.project_compression attributes
• Added CloseHoles.apply_to_selection attribute
• Added ConvertImages.merge_planes attribute
• Added ExportPoints.screen_space_error and ExportTiledModel.screen_space_error attributes
• Added ExportReport.font_size attribute
• Added ImportPoints.point_neighbors attribute
• Added home_point, interesting_zone, powerlines, restricted_zone and safety_zone attributes to PlanMission
class
• Added apply_to_selection argument to [Link]() method
• Added file_format and max_waypoints arguments to [Link]() method
• Added screen_space_error argument to [Link]() and [Link]() methods
• Added font_size argument to [Link]() method
• Added point_neighbors argument to [Link]() method
• Removed [Link] enum
• Removed ExportPanorama class
• Removed has_z, type, vertex_ids and vertices attributes from Shape class
• Removed pauseBatch(), resumeBatch(), pauseNode() and resumeNode() methods from NetworkClient class
• Removed PlanMission.max_waypoints attribute
• Removed SaveProject.absolute_paths and [Link] attributes
• Removed compression and absolute_paths arguments from [Link]() method
• Changed default value of BuildTiledModel.face_count attribute to 20000
• Changed default value of face_count argument in [Link]() method to 20000

322 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

3.19 Metashape version 1.7.6

• Added Cylindrical to [Link] enum

3.20 Metashape version 1.7.5

• Added ClassifyGroundPoints.erosion_radius attribute


• Added erosion_radius argument to [Link]() method

3.21 Metashape version 1.7.4

• Added ServiceCesium to ServiceType enum


• Added ImportLaserScans class
• Added [Link]() and [Link]() methods
• Added [Link]() and [Link]() methods
• Added breakpoints and rates attributed to GeneratePrescriptionMap class
• Added SmoothModel.preserve_edges attribute
• Added breakpoints and rates arguments to [Link]() method
• Added preserve_edges argument to [Link] method
• Renamed ClusteringMethod enum to ClassificationMethod
• Renamed cluster_count, clustering_method and boundary attributes in GeneratePrescriptionMap class
• Renamed cluster_count, clustering_method and boundary arguments in [Link]()
method
• Removed ServiceSputnik from ServiceType enum
• Removed min_value, max_value and grid_azimuth attributes from GeneratePrescriptionMap class
• Removed min_value, max_value and grid_azimuth arguments from [Link]() method

3.22 Metashape version 1.7.3

• Added ModelFormatOSGT and ModelFormatLandXML to ModelFormat enum


• Added TiledModelFormatOSGT to TiledModelFormat enum
• Added [Link]() method
• Added [Link]() method
• Added [Link]() method
• Added Utils.dmat2euler() method
• Added [Link] attribute
• Added [Link] attribute

3.19. Metashape version 1.7.6 323


Metashape Python Reference, Release 2.2.1

• Added [Link] attribute


• Added [Link] attribute
• Added ExportTiledModel.model_compression attribute
• Added ImportModel.decode_udim attribute
• Added MatchPhotos.keypoint_limit_per_mpx attribute
• Added compression argument to [Link]() method
• Added model_compression argument to [Link]() method
• Added decode_udim argument to [Link]() method
• Added keypoint_limit_per_mpx argument to [Link]() method
• Added uniform_sampling argument to [Link]() method

3.23 Metashape version 1.7.2

• Added ClusteringMethod enum


• Added PointsFormatSLPK to PointsFormat enum
• Added DuplicateAsset and GeneratePrescriptionMap classes
• Added [Link]() method
• Added merge, operand_chunk, operand_frame and operand_asset attributes to BuildTiledModel class
• Added ExportReport.include_system_info attribute
• Added GenerateMasks.depth_threshold attribute
• Added merge, operand_chunk, operand_frame and operand_asset arguments to [Link]()
method
• Added include_system_info argument to [Link]() method
• Added depth_threshold argument to [Link]() method

3.24 Metashape version 1.7.1

• Removed LegacyMapping from MappingMode enum


• Removed [Link] attribute
• Removed sensor argument from [Link]() method

324 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

3.25 Metashape version 1.7.0

• Added Geometry and AttachedGeometry classes


• Added FrameStep enum
• Added ServiceType enum
• Added [Link](), [Link]() and [Link]() methods
• Added [Link] and Shape.is_attached attributes
• Added alpha component to [Link] attribute value
• Added ImportRaster.nodata_value and ImportRaster.has_nodata_value attributes
• Added MatchPhotos.filter_stationary_points attribute
• Added BuildOrthomosaic.ghosting_filter attribute
• Added attach_viewpoints, group_attached_viewpoints and horizontal_zigzags attributes to PlanMission class
• Added [Link] attribute
• Added dir argument to [Link](), getOpenFileName(), getOpenFileNames() and get-
SaveFileName() methods
• Added nodata_value and has_nodata_value arguments to [Link]() method
• Added filter_stationary_points argument to [Link]() method
• Added ghosting_filter argument to [Link]() method
• Added sensor argument to [Link]() method
• Renamed ImportMasks class to GenerateMasks
• Renamed MaskSource enum to MaskingMode
• Renamed [Link]() method to [Link]()
• Removed ReduceOverlap.max_cameras attribute
• Removed max_cameras argument from [Link]() method

3.26 Metashape version 1.6.6

• Added [Link] class


• Added [Link] attribute
• Added toNetworkTask() method to task classes
• Added [Link]() method
• Added precision argument to [Link]() method

3.25. Metashape version 1.7.0 325


Metashape Python Reference, Release 2.2.1

3.27 Metashape version 1.6.5

• Added [Link] attribute

3.28 Metashape version 1.6.4

• Added [Link] attribute


• Added ConvertImages.use_initial_calibration attribute
• Added image_orientation, save_invalid_matches and use_initial_calibration attributes to ExportCameras class
• Added ExportModel.save_confidence attribute
• Added crs and image_orientation attributes to ImportCameras class
• Added CalibrationFormatPhotomod to CalibrationFormat enum
• Added save_invalid_matches, use_initial_calibration and image_orientation arguments to
[Link]() method
• Added save_confidence argument to [Link]() method
• Added crs and image_orientation arguments to [Link]() method
• Removed BuildUV.adaptive_resolution attribute
• Removed adaptive_resolution argument from [Link]() method

3.29 Metashape version 1.6.3

• Added renderPreview() methods to DenseCloud, Model, Orthomosaic, PointCloud and TiledModel classes
• Added BuildUV.texture_size attribute
• Added DecimateModel.apply_to_selection attribute
• Added [Link], [Link] and DetectFiducials.generate_masks attributes
• Added ExportModel.embed_texture attribute
• Added clip_to_boundary attribute to ExportPoints, ExportModel, ExportTiledModel and ExportRaster classes
• Added RasterFormatGeoPackage to RasterFormat enum
• Added ShapesFormatGeoPackage to ShapesFormat enum
• Added source argument to [Link]() method
• Added texture_size argument to [Link]() method
• Added apply_to_selection argument to [Link]() method
• Added generate_masks, cameras and frames arguments to [Link]() method
• Added embed_texture argument to [Link]() method
• Added width, height, point_size and progress arguments to [Link]() method
• Added clip_to_boundary argument to [Link](), [Link](), [Link]()
and [Link]() methods

326 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

• Added meta argument to [Link]() method


• Removed CalibrateLens.fit_p3 and CalibrateLens.fit_p4 attributes

3.30 Metashape version 1.6.2

• Added [Link] and [Link] classes


• Added [Link]() method
• Added [Link]() method
• Added [Link]() method
• Added Application.model_view and Application.ortho_view attributes
• Added BuildTexture.transfer_texture attribute
• Added PlanMission.min_pitch and PlanMission.max_pitch attributes
• Added columns, crs, delimiter, group_delimiters and skip_rows attributes to ImportShapes class
• Added CamerasFormatNVM to CamerasFormat enum
• Added PointsFormatPTX to PointsFormat enum
• Added ShapesFormatCSV to ShapesFormat enum
• Added transfer_texture argument to [Link]() method
• Added columns, crs, delimiter, group_delimiters and skip_rows arguments to [Link]() method
• Moved ModelViewMode enum to ModelView class
• Renamed [Link] attribute to console_pane
• Renamed [Link]() method to [Link]()
• Renamed [Link]() method to [Link]()
• Renamed [Link] attribute to [Link]
• Removed ReduceOverlap.capture_distance attribute
• Removed capture_distance argument from [Link]() method
• Changed default values of AlignCameras.reset_alignment and MatchPhotos.reset_matches attributes to False
• Changed default value of reset_alignment argument in [Link]() method to False
• Changed default value of reset_matches argument in [Link]() method to False

3.31 Metashape version 1.6.1

• Added [Link]() method


• Added CoordinateSystem.towgs84 attribute
• Added [Link] attribute
• Added BuildModel.subdivide_task attribute
• Added subdivide_task argument to [Link]() method
• Changed default value of keep_depth argument in [Link]() and [Link]() to True

3.30. Metashape version 1.6.2 327


Metashape Python Reference, Release 2.2.1

3.32 Metashape version 1.6.0

• Added BBox, ImageCompression, RPCModel and [Link] classes


• Added [Link] and [Link] classes
• Added CalibrationFormat and ReferencePreselectionMode enums
• Added [Link]() and [Link]() methods
• Added [Link]() and [Link]() methods
• Added [Link]() method
• Added setClassesFilter(), setConfidenceFilter(), setSelectionFilter() and resetFilters() methods to DenseCloud
class
• Added renderDepth(), renderImage(), renderMask() and renderNormalMap() methods to PointCloud, Dense-
Cloud and TiledModel classes
• Added [Link]() method
• Added Utils.euler2mat() and Utils.mat2euler() methods
• Added [Link] attribute
• Added Marker.position_covariance attribute
• Added [Link] attribute
• Added [Link] and [Link] attributes
• Added EulerAnglesPOK and EulerAnglesANK values to EulerAngles enum
• Added PointsFormatPCD to PointsFormat enum
• Added ShapesFormatGeoJSON to ShapesFormat enum
• Added RPC to [Link] enum
• Added image_compression attribute to ExportOrthophotos, ExportRaster, ExportTiledModel and UndistortPho-
tos classes
• Added AddPhotos.load_rpc_txt attribute
• Added AlignCameras.min_image attribute
• Added BuildDenseCloud.point_confidence attribute
• Added BuildModel.vertex_confidence, BuildModel.max_workgroup_size and Build-
Model.workitem_size_cameras attributes
• Added BuildTexture.source_model and BuildTexture.texture_type attributes
• Added BuildUV.adaptive_resolution attribute
• Added [Link] attribute
• Added ExportPanorama.image_compression attribute
• Added ExportPoints.save_classes and ExportPoints.save_confidence attributes
• Added ExportTexture.texture_type attribute
• Added [Link] attribute
• Added ImportCameras.image_list and ImportCameras.load_image_list attributes
• Added ImportPoints.calculate_normals attribute

328 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

• Added MatchPhotos.guided_matching and MatchPhotos.reference_preselection_mode attributes


• Added MergeChunks.merge_depth_maps, MergeChunks.merge_elevations and
MergeChunks.merge_orthomosaics attributes
• Added OptimizeCameras.fit_corrections attribute
• Added TriangulatePoints.max_error and TriangulatePoints.min_image attributes
• Added endpoints argument to [Link](), [Link](), [Link]() and Tiled-
[Link]() methods
• Added compression argument to [Link]() method
• Added cull_faces and add_alpha arguments to [Link]() method
• Added cull_faces, add_alpha and raster_transform arguments to [Link]() method
• Added cull_faces argument to [Link]() method
• Added cull_faces and add_alpha arguments to [Link]() method
• Moved TiffCompression enum to ImageCompression class
• Renamed [Link] class to [Link]
• Renamed [Link]() method to [Link]()
• Renamed [Link]() method to [Link]()
• Renamed [Link]() method to [Link]()
• Renamed [Link]() method to [Link]()
• Renamed [Link]() method to [Link]()
• Renamed network_distribute tasks attribute to subdivide_task
• Renamed AlignChunks.align_method attribute to method
• Renamed AlignChunks.match_downscale attribute to downscale
• Renamed AlignChunks.match_filter_mask attribute to filter_mask
• Renamed AlignChunks.match_mask_tiepoints attribute to mask_tiepoints
• Renamed AlignChunks.match_point_limit attribute to keypoint_limit
• Renamed AlignChunks.match_select_pairs attribute to generic_preselection
• Renamed BuildDenseCloud.store_depth attribute to keep_depth
• Renamed BuildModel.store_depth attribute to keep_depth
• Renamed BuildOrthomosaic.ortho_surface attribute to surface_data
• Renamed BuildTiledModel.store_depth attribute to keep_depth
• Renamed BuildUV.texture_count attribute to page_count
• Renamed CalibrateColors.data_source attribute to source_data
• Renamed CalibrateColors.calibrate_color_balance attribute to white_balance
• Renamed ClassifyGroundPoints.cls_from attribute to source_class
• Renamed ClassifyPoints.cls_from attribute to source_class
• Renamed ClassifyPoints.cls_to attribute to target_classes
• Renamed DecimateModel.target_face_count attribute to face_count

3.32. Metashape version 1.6.0 329


Metashape Python Reference, Release 2.2.1

• Renamed DuplicateChunk.copy_dense_cloud attribute to copy_dense_clouds


• Renamed ClassifyPoints.copy_elevation attribute to copy_elevations
• Renamed ClassifyPoints.copy_model attribute to copy_models
• Renamed ClassifyPoints.copy_orthomosaic attribute to copy_orthomosaics
• Renamed ClassifyPoints.copy_tiled_model attribute to copy_tiled_models
• Renamed ExportCameras.bingo_export_geoin attribute to bingo_save_geoin
• Renamed ExportCameras.bingo_export_gps attribute to bingo_save_gps
• Renamed ExportCameras.bingo_export_image attribute to bingo_save_image
• Renamed ExportCameras.bingo_export_itera attribute to bingo_save_itera
• Renamed ExportCameras.bundler_export_list attribute to bundler_save_list
• Renamed ExportCameras.chan_order_rotate attribute to chan_rotation_order
• Renamed [Link] attribute to crs
• Renamed ExportCameras.export_markers attribute to save_markers
• Renamed ExportCameras.export_points attribute to save_points
• Renamed [Link] attribute to crs
• Renamed [Link] attribute to crs
• Renamed ExportModel.export_alpha attribute to save_alpha
• Renamed ExportModel.export_cameras attribute to save_cameras
• Renamed ExportModel.export_colors attribute to save_colors
• Renamed ExportModel.export_comment attribute to save_comment
• Renamed ExportModel.export_markers attribute to save_markers
• Renamed ExportModel.export_normals attribute to save_normals
• Renamed ExportModel.export_texture attribute to save_texture
• Renamed ExportModel.export_udim attribute to save_udim
• Renamed ExportModel.export_uv attribute to save_uv
• Renamed ExportOrthophotos.write_alpha attribute to save_alpha
• Renamed ExportOrthophotos.write_kml attribute to save_kml
• Renamed ExportOrthophotos.write_world attribute to save_world
• Renamed [Link] attribute to crs
• Renamed ExportPoints.data_source attribute to source_data
• Renamed ExportPoints.export_colors attribute to save_colors
• Renamed ExportPoints.export_comment attribute to save_comment
• Renamed ExportPoints.export_images attribute to save_images
• Renamed ExportPoints.export_normals attribute to save_normals
• Renamed ExportPoints.tile_height attribute to block_height
• Renamed ExportPoints.tile_width attribute to block_width

330 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

• Renamed ExportPoints.write_tiles attribute to split_in_blocks


• Renamed ExportRaster.data_source attribute to source_data
• Renamed ExportRaster.kmz_section_enable attribute to network_links
• Renamed ExportRaster.tile_width attribute to block_width
• Renamed ExportRaster.tile_height attribute to block_height
• Renamed ExportRaster.write_alpha attribute to save_alpha
• Renamed ExportRaster.write_kml attribute to save_kml
• Renamed ExportRaster.write_scheme attribute to save_scheme
• Renamed ExportRaster.write_tiles attribute to split_in_blocks
• Renamed ExportRaster.write_world attribute to save_world
• Renamed ExportRaster.xyz_level_min attribute to min_zoom_level
• Renamed ExportRaster.xyz_level_max attribute to max_zoom_level
• Renamed [Link] attribute to crs
• Renamed ExportShapes.export_attributes attribute to save_attributes
• Renamed ExportShapes.export_labels attribute to save_labels
• Renamed ExportShapes.export_points attribute to save_points
• Renamed ExportShapes.export_polygons attribute to save_polygons
• Renamed ExportShapes.export_polylines attribute to save_polylines
• Renamed ExportTexture.write_alpha attribute to save_alpha
• Renamed ExportTiledModel.mesh_format attribute to model_format
• Renamed [Link] attribute to source
• Renamed [Link] attribute to crs
• Renamed [Link] attribute to crs
• Renamed [Link] attribute to crs
• Renamed MatchPhotos.preselection_generic attribute to generic_preselection
• Renamed MatchPhotos.preselection_reference attribute to reference_preselection
• Renamed MatchPhotos.store_keypoints attribute to keep_keypoints
• Renamed [Link] attribute to iterations
• Renamed SmoothModel.apply_to_selected attribute to apply_to_selection
• Renamed TrackMarkers.frame_start attribute to first_frame
• Renamed TrackMarkers.frame_end attribute to last_frame
• Renamed processing methods arguments to match task parameters names (e.g. dx/dy -> resolu-
tion_x/resolution_y, write_xxx -> save_xxx, export_xxx -> save_xxx, import_xxx -> load_xxx, prese-
lection_generic -> generic_preselection, preselection_reference -> reference_preselection, source_data ->
data_source, etc.)
• Replaced [Link]() method with [Link]() method
• Replaced [Link]() and [Link]() methods with [Link]() method

3.32. Metashape version 1.6.0 331


Metashape Python Reference, Release 2.2.1

• Removed Accuracy and Quality enums


• Removed [Link]() and [Link]() methods
• Removed [Link] attribute
• Removed OptimizeCameras.fit_p3 and OptimizeCameras.fit_p4 attributes
• Removed PlanMission.max_cameras and PlanMission.use_cameras attributes
• Removed tiff_big, tiff_tiled and tiff_overviews attributes from ExportOrthophotos and ExportRaster classes
• Removed tiff_compression attribute from ExportOrthophotos, ExportRaster and UndistortPhotos classes
• Removed jpeg_quality attribute from ExportOrthophotos, ExportRaster, ExportTiledModel and UndistortPhotos
classes

3.33 Metashape version 1.5.5

No Python API changes

3.34 Metashape version 1.5.4

• Added [Link] class


• Added [Link] enum
• Added copy() method to Antenna, Calibration, ChunkTransform, CirTransform, CoordinateSystem, Docu-
ment, MetaData, OrthoProjection, RasterTransform, Region, Shutter, Target, Version, Viewpoint and Vignetting
classes
• Added [Link]() and [Link]() methods
• Added [Link]() method
• Added location_enabled and rotation_enabled attributes to [Link] class
• Added [Link] and [Link] attributes
• Added BuildTiledModel.ghosting_filter and BuildTiledModel.transfer_texture attributes
• Added ExportPoints.network_distribute and [Link] attributes
• Added ExportTiledModel.jpeg_quality and ExportTiledModel.texture_format attributes
• Added prevent_intersections argument to [Link]() method
• Added transfer_texture argument to [Link]() method
• Added region argument to [Link]() method
• Added texture_format and jpeg_quality arguments to [Link]() method
• Added progress argument to [Link]() method
• Added ImageFormatWebP to ImageFormat enum

332 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

3.35 Metashape version 1.5.3

• Added [Link]() and [Link]() methods


• Added [Link](), [Link]() and [Link]()
methods
• Added location_enabled and rotation_enabled attributes to [Link] class
• Added keep_depth argument to [Link]() method
• Added uv argument to [Link]() method
• Added level argument to [Link]() and [Link]() methods
• Changed default value of keep_depth argument in [Link]() and [Link]() methods
to True
• Changed default value of max_neighbors argument in [Link]() method to 100

3.36 Metashape version 1.5.2

• Added CameraTrack class


• Added [Link] and [Link] classes
• Added [Link] enum
• Added [Link]() method
• Added [Link] attribute
• Added [Link] attribute
• Added Chunk.camera_track and Chunk.camera_tracks attributes
• Added BuildModel.trimming_radius attribute
• Added DetectMarkers.filter_mask attribute
• Added ImportReference.shutter_lag attribute
• Added Bundler and BINGO specific attributes to ExportCameras class
• Added supports_gpu attribute to task classes
• Added x, y, w, h arguments to [Link]() method
• Added filter_mask argument to [Link]() method
• Added image_list argument to [Link]() method
• Added shutter_lag argument to [Link]() method
• Added ImageFormatBIL, ImageFormatXYZ, ImageFormatDDS to ImageFormat enum
• Removed [Link] class
• Removed Animation class
• Removed [Link] attribute
• Removed smoothness attribute from [Link] and [Link] classes
• Removed quality and reuse_depth arguments from [Link]() method

3.35. Metashape version 1.5.3 333


Metashape Python Reference, Release 2.2.1

• Removed downscale, filter_mode, max_neighbors, max_workgroup_size, network_distribute, reuse_depth,


workitem_size_cameras from [Link] class

3.37 Metashape version 1.5.1

• Added License class


• Added [Link] class
• Added [Link] attribute
• Renamed [Link] class to [Link]

3.38 Metashape version 1.5.0

• Added [Link] class


• Added [Link] and [Link] classes
• Added DataType enum
• Added [Link] enum
• Added [Link] enum
• Added [Link]() method
• Added [Link]() method
• Added [Link]() method
• Added [Link]() method
• Added [Link](), [Link]() and [Link]() methods
• Added [Link]() method
• Added decode(), decodeJSON(), encodeJSON() methods to task classes
• Added Antenna.location_covariance and Antenna.rotation_covariance attributes
• Added [Link], Camera.location_covariance and Camera.rotation_covariance attributes
• Added Chunk.image_contrast attribute
• Added [Link] and DenseCloud.data_type attributes
• Added [Link] and Model.data_type attributes
• Added [Link] attribute
• Added [Link].tex_index attribute
• Added [Link] and Orthomosaic.data_type attributes
• Added [Link] attribute
• Added [Link] and PointCloud.data_type attributes
• Added Sensor.data_type, Sensor.film_camera, Sensor.location_covariance, [Link] and Sen-
sor.rotation_covariance attributes
• Added Sensor.fixed_params and Sensor.photo_params attributes

334 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

• Added [Link] and TiledModel.data_type attributes


• Added [Link] and AlignChunks.match_mask_tiepoints attributes
• Added BuildOrthomosaic.refine_seamlines attribute
• Added [Link] and DetectMarkers.maximum_residual attributes
• Added ExportModel.colors_rgb_8bit and ExportPoints.colors_rgb_8bit attributes
• Added ExportOrthophotos.tiff_tiled and ExportRaster.tiff_tiled attributes
• Added OptimizeCameras.tiepoint_covariance attribute
• Added [Link] and [Link] attributes
• Added target and workitem_count attributes to task classes
• Added max_workgroup_size and workitem_size_tiles attributes to [Link] class
• Added max_workgroup_size and workitem_size_cameras attributes to [Link] class
• Added max_workgroup_size and workitem_size_cameras attributes to [Link] class
• Added max_workgroup_size and workitem_size_cameras attributes to [Link] class
• Added max_workgroup_size, workitem_size_cameras and workitem_size_tiles attributes to
[Link] class
• Added max_workgroup_size, workitem_size_cameras and face_count attributes attributes to
[Link] class
• Added max_workgroup_size, workitem_size_cameras and workitem_size_pairs attributes to [Link]
class
• Added refine_seamlines argument to [Link]() method
• Added face_count argument to [Link]() method
• Added keypoints argument to [Link]() method
• Added maximum_residual and cameras arguments to [Link]() method
• Added tiff_tiled argument to [Link](), [Link]() and [Link]()
methods
• Added colors_rgb_8bit argument to [Link]() and [Link]() methods
• Added tiepoint_covariance argument to [Link]() method
• Added confidence argument to [Link]() method
• Added mask_tiepoints and markers arguments to [Link]() method
• Added ignore_lock argument to [Link]() method
• Added type argument to [Link]() and [Link]() methods
• Added workitem argument to [Link]() method
• Added ModelFormatGLTF and ModelFormatX3D to ModelFormat enum
• Added Car and Manmade to PointClass enum
• Changed default value of filter argument in [Link]() to MildFiltering
• Removed [Link].visibility_mesh attribute

3.38. Metashape version 1.5.0 335


Metashape Python Reference, Release 2.2.1

3.39 PhotoScan version 1.4.4

• Added AddPhotos.strip_extensions attribute


• Added ExportRaster.image_description attribute
• Added ExportShapes.export_attributes, ExportShapes.export_labels and ExportShapes.polygons_as_polylines
attributes
• Added image_description argument to [Link]() and [Link]() methods
• Added format, polygons_as_polylines, export_labels and export_attributes arguments to [Link]()
method
• Added format argument to [Link]() method
• Added RasterFormatTMS to RasterFormat enum

3.40 PhotoScan version 1.4.3

• Added Version class


• Added [Link] class
• Added [Link]() method
• Added [Link]() method
• Added [Link]() method
• Added [Link] attribute
• Added Sensor.normalize_to_float attribute
• Added minimum_dist attribute to [Link] class
• Added minimum_dist argument to [Link]() and [Link]() methods
• Added keypoints argument to [Link]() method
• Changed default value of adaptive_fitting argument in [Link]() to False

3.41 PhotoScan version 1.4.2

• Added [Link] class


• Added [Link]() method
• Added [Link]() method
• Added [Link]() method
• Added [Link]() method
• Added log_enable, log_path, network_enable, network_host, network_path and network_port attributes to Ap-
[Link] class
• Added covariance_matrix and covariance_params attributes to Calibration class
• Added flip_x, flip_y, flip_z attributes to [Link] and [Link] classes

336 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

• Added max_neighbors attribute to [Link], [Link] and [Link]


classes
• Added jpeg_quality, tiff_compression and update_gps_tags attributes to [Link] class
• Added copy_keypoints attribute to [Link] class
• Added width, height and world_transform attributes to [Link] class
• Added store_depth attribute to [Link] class
• Added [Link] and [Link] attributes
• Added CoordinateSystem.wkt2 attribute
• Added keep_keypoints argument to [Link]() method
• Added flip_x, flip_y, flip_z arguments to [Link]() and [Link]() methods
• Added max_neighbors argument to [Link]() and [Link]() methods
• Added cull_faces argument to [Link]() method
• Added reuse_depth and ghosting_filter arguments to [Link]() method
• Added use_reflectance_panels and use_sun_sensor arguments to [Link]() method
• Added width, height and world_transform arguments to [Link]() and [Link]()
methods
• Added filter_mask argument to [Link]() method
• Added revision argument to [Link]() method
• Added ImagesData to DataSource enum
• Added ModelFormatOSGB to ModelFormat enum
• Added TiledModelFormatOSGB to TiledModelFormat enum

3.42 PhotoScan version 1.4.1

• Added [Link] enum


• Added [Link]() method
• Added [Link]() method
• Added [Link]() and [Link]() methods
• Added [Link]() method
• Added [Link]() and [Link]() methods
• Added [Link], [Link] and [Link] attributes
• Added [Link].filter_mask attribute
• Added [Link].use_reflectance_panels and [Link].use_sun_sensor at-
tributes
• Added [Link].mask_tiepoints attribute
• Added [Link].adaptive_fitting attribute
• Added strip_extensions argument to [Link]() method

3.42. PhotoScan version 1.4.1 337


Metashape Python Reference, Release 2.2.1

• Added keep_depth argument to [Link]() method


• Added adaptive_resolution argument to [Link]() method
• Added alpha argument to [Link]() method
• Added mask_tiepoints argument to [Link]() method
• Added adaptive_fitting argument to [Link]() method
• Added mask argument to [Link]() method
• Added CamerasFormatABC and CamerasFormatFBX to CamerasFormat enum
• Added ImageFormatJP2 to ImageFormat enum
• Added LegacyMapping to MappingMode enum

3.43 PhotoScan version 1.4.0

• Added Tasks classes


• Added Animation, OrthoProjection, Target and Vignetting classes
• Added ShapesFormat enum
• Added [Link] enum
• Added [Link](), [Link]() and [Link]() methods
• Added [Link](), [Link](), [Link]() and [Link]()
methods
• Added [Link](), [Link](), [Link](), [Link](),
[Link]() and [Link]() methods
• Added [Link](), [Link]() and [Link]() methods
• Added [Link]() method
• Added [Link]() and [Link]() methods
• Added [Link]() and [Link]() methods
• Added [Link]() method
• Added [Link]() and [Link]() methods
• Added [Link]() and [Link]() methods
• Added [Link]() and [Link]() methods
• Added [Link]() method
• Added [Link]() and [Link]() methods
• Added [Link].location_accuracy and [Link].rotation_accuracy attributes
• Added Camera.layer_index, [Link] and [Link] attributes
• Added Chunk.dense_clouds, Chunk.depth_maps_sets, [Link], [Link], [Link]
and Chunk.tiled_models attributes
• Added [Link], Chunk.camera_crs, Chunk.marker_crs and Chunk.world_crs attributes
• Added [Link] and CoordinateSystem.geoid_height attributes

338 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

• Added [Link] attribute


• Added Sensor.black_level, [Link], Sensor.fixed_calibration, Sensor.fixed_location, Sen-
sor.fixed_rotation, Sensor.layer_index, [Link], [Link], Sensor.normalize_sensitivity, Sen-
sor.rolling_shutter, [Link], [Link] and [Link] attributes
• Added [Link], [Link], [Link] and [Link] attributes
• Added [Link] and [Link] attributes
• Added [Link], [Link] and [Link] attributes
• Added [Link] and [Link] attributes
• Added [Link] and [Link] attributes
• Added [Link] and [Link] attributes
• Added [Link] and [Link] attributes
• Added [Link] and [Link] attributes
• Added [Link] and [Link] attributes
• Added point_colors argument to [Link]() method
• Added ghosting_filter argument to [Link]() method
• Added minimum_size argument to [Link]() method
• Added raster_transform argument to [Link](), [Link](), [Link]()
methods
• Added tiff_overviews argument to [Link](), [Link]() and
[Link]() methods
• Added min_zoom_level and max_zoom_level arguments to [Link]() and
[Link]() methods
• Added cameras argument to [Link]() method
• Added image_format argument to [Link]() method
• Added page_numbers argument to [Link]() method
• Added items, crs, ignore_labels, threshold and progress arguments to [Link]() method
• Added create_markers argument to [Link]() method
• Added progress argument to [Link]() method
• Added quality, volumetric_masks, keep_depth and reuse_depth arguments to [Link]() method
• Added selected_faces and fix_borders arguments to [Link]() method
• Added export_points, export_markers, use_labels and progress arguments to [Link]() method
• Added channels and datatype arguments to [Link]() method
• Added CamerasFormatBlocksExchange and CamerasFormatORIMA to CamerasFormat enum
• Added ImageFormatNone to ImageFormat enum
• Added UndefinedLayout to ImageLayout enum
• Added ModelFormatNone and ModelFormatABC to ModelFormat enum
• Added PointsFormatNone and PointsFormatCesium to PointsFormat enum
• Added RasterFormatNone to RasterFormat enum

3.43. PhotoScan version 1.4.0 339


Metashape Python Reference, Release 2.2.1

• Added ReferenceFormatNone and ReferenceFormatAPM to ReferenceFormat enum


• Added TiledModelFormatNone, TiledModelFormatCesium and TiledModelFormatSLPK to TiledModelFormat
enum
• Renamed Chunk.master_channel attribute to Chunk.primary_channel
• Removed MatchesFormat enum
• Removed [Link]() method
• Removed [Link].accuracy_ypr attribute
• Removed quality, filter, cameras, keep_depth, reuse_depth arguments from [Link]() method
• Removed color_correction argument from [Link]() and [Link]() methods
• Removed fit_shutter argument from [Link]() method

3.44 PhotoScan version 1.3.5

No Python API changes

3.45 PhotoScan version 1.3.4

No Python API changes

3.46 PhotoScan version 1.3.3

• Added network_links argument to [Link]() and [Link]() methods


• Added read_only argument to [Link]() method
• Added [Link]() and [Link]() methods
• Added [Link], [Link], [Link], [Link], [Link],
[Link], [Link], [Link], [Link], [Link], Thumb-
[Link], [Link] attributes
• Added Document.read_only attribute
• Added CamerasFormatSummit to CamerasFormat enum

3.47 PhotoScan version 1.3.2

• Added vertex_colors argument to [Link]() method


• Added Shape.vertex_ids attribute

340 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

3.48 PhotoScan version 1.3.1

• Added Settings and TiledModel classes


• Added [Link]() method
• Added [Link]() method
• Added [Link](), [Link](), [Link]() and
[Link]() methods
• Added [Link]() and [Link]() methods
• Added [Link]() method
• Added [Link]() method
• Added [Link]() method
• Added [Link]() and [Link]() methods
• Added [Link]() method
• Added filter argument to [Link](), [Link]() and Applica-
[Link]() methods
• Added point and visibility arguments to [Link]() method
• Added raster_transform and write_scheme arguments to [Link]() method
• Added write_scheme and white_background arguments to [Link]() method
• Added white_background argument to [Link]() method
• Added projection argument to [Link]() method
• Added markers argument to [Link]() method
• Added pairs argument to [Link]() method
• Added columns and delimiter arguments to [Link]() method
• Added version argument to [Link]() method
• Renamed npasses argument in [Link]() method to strength and changed its type to float
• Renamed from and to arguments in [Link](), [Link](), Dense-
[Link]() and [Link]() methods to avoid collision with re-
served words
• Added [Link] attribute
• Added Chunk.tiled_model attribute
• Added [Link] and ShapeGroup.show_labels attributes
• Added ImageFormatTGA to ImageFormat enum

3.48. PhotoScan version 1.3.1 341


Metashape Python Reference, Release 2.2.1

3.49 PhotoScan version 1.3.0

• Added MarkerGroup, Masks, ScalebarGroup, Shutter and Thumbnails classes


• Added [Link] class
• Added [Link] class
• Added [Link] and [Link] classes
• Added [Link] class
• Added CamerasFormat, EulerAngles, ImageFormat, ImageLayout, MaskOperation, MaskSource, MatchesFor-
mat, ModelFormat, ModelViewMode, PointClass, PointsFormat, RasterFormat, ReferenceFormat, ReferenceIt-
ems, RotationOrder, TiffCompression, TiledModelFormat enums
• Added [Link]() method
• Added [Link]() method
• Added [Link]() class method
• Added [Link]() method
• Added [Link]() method
• Added [Link](), [Link](), [Link]() and Net-
[Link]() methods
• Added [Link]() method
• Added [Link](), Shape.perimeter2D(), Shape.perimeter3D() and [Link]() methods
• Added [Link]() method
• Added source argument to [Link]() method
• Added image_format argument to [Link]() mehod
• Added write_alpha argument to [Link]() method
• Added image_format and write_alpha arguments to [Link]() method
• Added groups, projection, shift and progress arguments to [Link]() method
• Added items and progress arguments to [Link]() method
• Added sensor argument to [Link]() method
• Added layout argument to [Link]() method
• Added jpeg_quality argument to [Link]() and [Link]() methods
• Added fill_holes argument to [Link]() method
• Added fit_shutter argument to [Link]() method
• Added settings argument to [Link]() method
• Added progress argument to various DenseCloud methods
• Added from argument to [Link]() method
• Added chunks and progress arguments to [Link]() method
• Added progress argument to [Link]() and [Link]() methods
• Added revision argument to [Link](), [Link]() methods

342 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

• Added Application.photos_pane attribute


• Added [Link] attribute
• Added [Link] and [Link] attributes
• Added Chunk.marker_groups and Chunk.scalebar_groups attributes
• Added Chunk.euler_angles and Chunk.scalebar_accuracy attributes
• Added [Link] attribute
• Added [Link] and [Link] attributes
• Added [Link] attribute
• Added RasterTransform.false_color attribute
• Added [Link] attribute
• Added [Link] attribute
• Added DepthMapsData, TiledModelData and OrthomosaicData to DataSource enum
• Added CircularTarget14bit to TargetType enum
• Renamed CameraReference class to [Link]
• Renamed ConsolePane class to [Link]
• Renamed MarkerProjection class to [Link]
• Renamed MarkerProjections class to [Link]
• Renamed MarkerReference class [Link]
• Renamed MeshFace class to [Link]
• Renamed MeshFaces class to [Link]
• Renamed MeshTexVertex class to [Link]
• Renamed MeshTexVertices class to [Link]
• Renamed MeshVertex class to [Link]
• Renamed MeshVertices class to [Link]
• Renamed PointCloudCameras class to [Link]
• Renamed PointCloudPoint class to [Link]
• Renamed PointCloudPoints class to [Link]
• Renamed PointCloudProjection class to [Link]
• Renamed PointCloudProjections class to [Link]
• Renamed PointCloudTrack class to [Link]
• Renamed PointCloudTracks class to [Link]
• Renamed ScalebarReference class to [Link]
• Renamed ShapeVertices class to [Link]
• Renamed [Link]() method to [Link]()
• Renamed [Link] attribute to Shape.boundary_type
• Renamed Chunk.accuracy_cameras to Chunk.camera_location_accuracy

3.49. PhotoScan version 1.3.0 343


Metashape Python Reference, Release 2.2.1

• Renamed Chunk.accuracy_cameras_ypr to Chunk.camera_rotation_accuracy


• Renamed Chunk.accuracy_markers to Chunk.marker_location_accuracy
• Renamed Chunk.accuracy_projections to Chunk.marker_projection_accuracy
• Renamed Chunk.accuracy_tiepoints to Chunk.tiepoint_accuracy
• Renamed method argument in [Link]() method to source and changed its type to MaskSource
• Replaced preselection argument with generic_preselection and reference_preselection arguments in
[Link]() method
• Replaced fit_cxcy argument with fit_cx and fit_cy arguments in [Link]() method
• Replaced fit_k1k2k3 argument with fit_k1, fit_k2 and fit_k3 arguments in [Link]() method
• Replaced fit_p1p2 argument with fit_p1 and fit_p2 arguments in [Link]() method
• Replaced Application.cpu_cores_inactive with Application.cpu_enable attribute
• Changed type of source_data argument in [Link]() to DataSource
• Changed type of format argument in [Link]() and [Link]() methods to Cameras-
Format
• Changed type of rotation_order argument in [Link]() to RotationOrder
• Changed type of format argument in [Link]() and [Link]() methods to Raster-
Format
• Changed type of format argument in [Link]() method to MatchesFormat
• Changed type of texture_format argument in [Link]() method to ImageFormat
• Changed type of format argument in [Link]() and [Link]() methods to ModelFormat
• Changed type of format argument in [Link]() method to PointsFormat
• Changed type of tiff_compression argument in [Link]() and [Link]()
methods to TiffCompression
• Changed type of items argument in [Link]() method to [Link]
• Changed type of format argument in [Link]() method to TiledModelFormat
• Changed type of mesh_format argument in [Link]() method to ModelFormat
• Changed type of operation argument in [Link]() method to MaskOperation
• Changed type of format argument in [Link]() and [Link]() methods to Reference-
Format
• Changed type of items argument in [Link]() method to ReferenceItems
• Removed return values from [Link](), [Link](), [Link](),
[Link](), [Link](), [Link](), [Link](),
[Link](), [Link](), [Link](), [Link](),
[Link](), [Link](), [Link](), [Link](),
[Link](), [Link](), [Link](), [Link](),
[Link](), [Link](), [Link](), [Link](),
[Link](), [Link](), [Link](), [Link](),
[Link](), [Link](), [Link](), [Link](),
[Link](), [Link](), [Link](), [Link](),
[Link](), [Link](), [Link](), [Link](),
[Link](), [Link](), [Link](), [Link](),

344 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

[Link](), [Link](), [Link](),


[Link](), [Link](), [Link](), [Link](),
[Link](), [Link](), [Link](), [Link](), [Link](),
[Link](), [Link](), [Link](), [Link](),
[Link](), [Link](), [Link](), [Link](), Network-
[Link](), [Link](), [Link](), [Link](),
[Link](), [Link](), [Link](),
[Link](), [Link](), [Link](), [Link]() methods in favor
of exceptions
• Removed [Link]() method
• Removed obsolete [Link]() and [Link]() class methods
• Removed unused focal_length argument from [Link]() method
• Modified Utils.mat2opk() and Utils.opk2mat() methods to work with camera to world rotation matrices

3.50 PhotoScan version 1.2.6

No Python API changes

3.51 PhotoScan version 1.2.5

• Added ShapeGroup and ShapeVertices classes


• Added CoordinateSystem.proj4 and [Link] attributes
• Added [Link] and [Link] attributes
• Added [Link], [Link], [Link], Shape.has_z, [Link] and [Link] attributes
• Added [Link](), [Link]() and [Link]() methods
• Added [Link]() method
• Added [Link](), [Link](), [Link]() and [Link]() class methods
• Added [Link]() and [Link]() methods
• Added [Link]() and [Link]() methods
• Added [Link]() method
• Added [Link]() method
• Added adaptive_fitting parameter to [Link]() method
• Added load_rotation and load_accuracy parameters to [Link]() method
• Added source parameter to [Link]() method
• Added fill_holes parameter to [Link]() method

3.50. PhotoScan version 1.2.6 345


Metashape Python Reference, Release 2.2.1

3.52 PhotoScan version 1.2.4

• Added NetworkClient and NetworkTask classes


• Added Calibration.f, Calibration.b1, Calibration.b2 attributes
• Added [Link]() method
• Added [Link]() method
• Added [Link]() method
• Added fit_b1 and fit_b2 parameters to [Link]() method
• Added tiff_big parameter to [Link](), [Link]() and [Link]()
methods
• Added classes parameter to [Link]() method
• Added progress parameter to processing methods
• Removed [Link], [Link], [Link] attributes

3.53 PhotoScan version 1.2.3

• Added tiff_compression parameter to [Link]() and [Link]() methods

3.54 PhotoScan version 1.2.2

• Added [Link] attribute


• Added chunks parameter to [Link]() method

3.55 PhotoScan version 1.2.1

• Added CirTransform and RasterTransform classes


• Added Chunk.cir_transform and Chunk.raster_transform attributes
• Added [Link]() method
• Added udim parameter to [Link]() method
• Renamed RasterTransform enum to RasterTransformType

346 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

3.56 PhotoScan version 1.2.0

• Added Elevation and Orthomosaic classes


• Added Shape and Shapes classes
• Added Antenna class
• Added DataSource enum
• Added [Link]() method
• Added [Link]() and [Link]() methods
• Added [Link]() and [Link]() methods
• Added [Link]() and [Link]() methods
• Added [Link]() method
• Added [Link](), [Link]() and [Link]() methods
• Added [Link]() and [Link]() methods
• Added Utils.mat2opk(), Utils.mat2ypr(), Utils.opk2mat() and Utils.ypr2mat() methods
• Added [Link], [Link] and [Link] attributes
• Added Chunk.accuracy_cameras_ypr attribute
• Added [Link], Sensor.plane_count and [Link] attributes
• Added Calibration.p3 and Calibration.p4 attributes
• Added [Link] attribute
• Added CameraReference.accuracy_ypr attribute
• Added [Link], [Link] and [Link] attributes
• Added [Link] attribute
• Added Chunk.image_brightness attribute
• Added fit_p3 and fit_p4 parameters to [Link]() method
• Added icon parameter to [Link]() method
• Added title and description parameters to [Link]() method
• Added operation parameter to [Link]() method
• Added columns, delimiter, group_delimiters, skip_rows parameters to [Link]() method
• Added items parameter to [Link]() method
• Renamed [Link]() to [Link]()
• Renamed [Link]() to [Link]()
• Removed OrthoSurface and PointsSource enums
• Removed [Link] attribute
• Removed Chunk.camera_offset attribute

3.56. PhotoScan version 1.2.0 347


Metashape Python Reference, Release 2.2.1

3.57 PhotoScan version 1.1.1

• Added [Link]() method


• Added noparity parameter to [Link]() method
• Added blockw and blockh parameters to [Link]() method

3.58 PhotoScan version 1.1.0

• Added CameraOffset and ConsolePane classes


• Added CameraGroup, CameraReference, ChunkTransform, DepthMap, DepthMaps, MarkerReference, Mark-
erProjection, Mask, PointCloudGroups, PointCloudTrack, PointCloudTracks, ScalebarReference, Thumbnail
classes
• Added [Link], [Link], [Link], [Link] and [Link] attributes
• Added [Link] attribute
• Added [Link]() method
• Added [Link]() method
• Added [Link](), [Link](), [Link](), [Link](),
[Link]() methods
• Added [Link](), [Link]() methods
• Added Chunk.master_channel and Chunk.camera_offset attributes
• Added [Link]() method
• Added [Link]() and [Link]() methods
• Added [Link](), [Link](), [Link]() methods
• Added [Link]() and [Link]() methods
• Added [Link]() method
• Added [Link] and [Link] attributes
• Added [Link], [Link] attributes
• Added [Link]() and [Link]() methods
• Added [Link] property
• Added U16 data type support in Image class
• Added classes parameter to [Link]() method
• Added crop_borders parameter to [Link]() method
• Added chunk parameter to [Link]() method
• Added format parameter to [Link]() and [Link]() methods
• Moved OpenCL settings into Application class
• Converted string constants to enum objects
• Removed Cameras, Chunks, DenseClouds, Frame, Frames, GroundControl, GroundControlLocations, Ground-
ControlLocation, Markers, MarkerPositions, Models, Scalebars, Sensors classes

348 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

3.59 PhotoScan version 1.0.0

• Added DenseCloud and DenseClouds classes


• Added [Link]() and [Link]() methods
• Added [Link]() method
• Added [Link]() and [Link]() methods
• Added [Link]() method
• Added [Link]() method
• Added [Link]() method
• Added [Link]() method
• Added [Link], [Link], [Link] and [Link] attributes
• Added Chunk.dense_cloud and Chunk.dense_clouds attributes
• Added page parameter to [Link]() and [Link]() methods
• Added shortcut parameter to [Link]() method
• Added absolute_paths parameter to [Link]() method
• Added fit_f, fit_cxcy, fit_k1k2k3 and fit_k4 parameters to [Link]() method
• Changed parameters of [Link]() and [Link]() methods
• Changed parameters of [Link]() method
• Changed parameters of [Link]() method
• Changed return value of [Link]() method
• Removed [Link]() method
• Removed [Link]() and [Link]() methods
• Removed [Link]() and [Link]() methods
• Removed Frame.depth_calib attribute

3.60 PhotoScan version 0.9.1

• Added Sensor, Scalebar and MetaData classes


• Added [Link] attribute
• Added [Link] attribute
• Added [Link], [Link] and Calibration.k4 attributes
• Added [Link]() method
• Added [Link]() and [Link]() methods
• Added [Link](), [Link]() and [Link]() methods
• Added [Link] and [Link] attributes
• Added [Link]() and [Link]() methods
• Added [Link]() method

3.59. PhotoScan version 1.0.0 349


Metashape Python Reference, Release 2.2.1

• Added [Link]() and [Link]() methods

3.61 PhotoScan version 0.9.0

• Added Camera, Frame and CoordinateSystem classes


• Added [Link]() method
• Added [Link]() and [Link]() methods
• Added [Link]() and [Link]() methods
• Added [Link]() method
• Added [Link]() and [Link]() methods
• Added [Link] property
• Added [Link]() method
• Revised [Link]() method
• Revised [Link]() method
• Revised [Link]() method
• Removed Photo class (deprecated)
• Removed GeoProjection class (deprecated)
• Removed [Link] property (deprecated)

3.62 PhotoScan version 0.8.5

• Added Chunk.fix_calibration property


• Added [Link]() method
• Added [Link]() method for dense/sparse point cloud export
• Added accuracy_cameras, accuracy_markers and accuracy_projections properties to the GroundControl class
• Added [Link]() method
• Added [Link] and [Link] properties
• Added [Link] property
• Added [Link]() method
• Moved [Link]() method to [Link]()
• Removed “fix_calibration” parameter from [Link]() method
• Removed [Link] property

350 Chapter 3. Python API Change Log


Metashape Python Reference, Release 2.2.1

3.63 PhotoScan version 0.8.4

• Added [Link]() method


• Command line scripting support removed

3.64 PhotoScan version 0.8.3

Initial version of PhotoScan Python API

3.63. PhotoScan version 0.8.4 351


Metashape Python Reference, Release 2.2.1

352 Chapter 3. Python API Change Log


PYTHON MODULE INDEX

m
Metashape, 5

353

Common questions

Powered by AI

Metashape enhances 3D photogrammetric workflows by offering robust point cloud processing capabilities that refine and manage point data. The smoothPointCloud function applies a smoothing operation to point clouds, utilizing parameters like 'smoothing_radius' to control smoothing extent and 'apply_to_selection' to target specific point selections. It permits the replacement of default assets with refined outputs using 'replace_asset'. Meanwhile, filterPointCloud allows users to selectively refine points by different classes or selection criteria, improving the overall accuracy and clarity of the photogrammetric model. These functions critically reduce noise and enhance detail, essential for producing high-quality models especially useful in complex terrain mapping or intricate architectural reconstruction .

Updating tie point accuracy parameters in Metashape directly influences the quality and precision of the photogrammetric workflow. Accurate tie points are essential for aligning images and reconstructing the geometry of the scene. By optimizing parameters such as reprojection error thresholds or the number of redundant observations required, users can significantly improve model accuracy, reducing artefacts and distortions in the final outputs. This is particularly critical in applications requiring high precision, such as in engineering surveys or heritage documentation, where any inaccuracies could lead to faulty analyses or interpretations .

Metashape's classification methods, including JenksNaturalBreaksClassification, significantly impact data analysis by organizing data into natural groupings. These methods enhance data presentation by improving the visualization of spatial data distributions, enabling clearer differentiation between classes and minimizing within-class variance while maximizing between-class variance. This can be particularly useful in applications like land use analysis or vegetation mapping, where natural breaks help in accurately categorizing and representing data sets, thus providing more meaningful insights and aiding in effective decision-making and communication of spatial data .

Network tasks in Metashape, including toNetworkTask, play a critical role in enhancing processing scalability by distributing computation across multiple processing nodes. These tasks transform local tasks into network-compatible ones, allowing large datasets to be processed more efficiently by leveraging distributed computing resources. This capability is particularly useful for extensive project tasks like generating digital elevation models or orthomosaics, where the workload can be divided amongst several computers to improve processing speed and reduce downtime, thereby enabling more rapid completion of complex photogrammetric analyses .

Calibration features like calibrateColors and calibrateReflectance within Metashape are crucial for improving photogrammetric data quality. The calibrateColors feature ensures accurate color representation by adjusting color imbalances during image processing, particularly beneficial for consistent color correction across datasets. Similarly, calibrateReflectance improves the accuracy of surface reflectance metrics, which is vital for analyses involving spectral data like vegetation health monitoring or material composition studies. These calibrations contribute to reducing errors induced by variable sensor conditions or environmental influences, ensuring that the photogrammetric products are of high fidelity and reliable for scientific and commercial use .

Metashape handles point cloud format conversion by providing support for multiple formats, facilitating interoperability and data exchange between different platforms and software environments. Formats such as LAS and PLY have distinct implications; LAS is typically used in LiDAR data processing and offers excellent data management capabilities for large point clouds, while PLY is favored for its simplicity in smaller applications like 3D scanning or for academic purposes. The choice of format affects data precision, file size, and the feasibility of subsequent processing operations, thus impacting both project execution speed and the level of detail achievable in final outputs .

Metashape's sorting functions, like sortCameras and sortMarkers, improve project organization and operational efficiency by logically arranging data models based on their labels. These functions streamline the workflow by facilitating quick access to desired elements, reducing the time needed to locate specific data in complex projects. They enhance clarity of project contents and coherence in data presentation, which is particularly beneficial in large-scale projects involving numerous elements, such as multispectral imagery analysis or archived historical site restorations .

The transformRaster function in Metashape manipulates DEM or orthomosaic data by applying transformations defined by various parameters. Critical parameters include 'source_data' for selecting between DEM and orthomosaic, 'asset' for identifying the asset key, and 'subtract' for enabling subtraction operations. The output's dimensions are set via 'width' and 'height', and the raster-to-world transformation is dictated by the 'world_transform' matrix. Resolution is further refined with 'resolution', 'resolution_x', and 'resolution_y'. Orientation and clipping are managed through 'north_up' for orientation, and 'clip_to_boundary' for boundary clipping. Additional exports and substitutions use 'copy_orthophotos' and 'replace_asset' respectively .

Metashape's sorting and filtering features for point clouds work in tandem to enhance effective data manipulation in complex projects by enabling more precise and selective operations. Sorting, such as through sortPointClasses, logically organizes point data, making it easier to manage and identify specific groups. Filtering, like setClassesFilter and setConfidenceFilter, allows for selective processing based on class or confidence levels. Together, these features simplify handling large datasets by focusing resources on relevant data subsets, reducing computational overhead, and improving the accuracy of operations such as noise reduction, data merging, and visualization .

The smoothModel function in Metashape is designed to refine 3D models through Laplacian smoothing. Its application can vary by adjusting parameters such as 'strength', which controls the intensity of smoothing, 'apply_to_selection', determining whether the smoothing only affects selected model faces, and 'fix_borders', ensuring edges and borders remain intact during the process. The function also offers options to preserve edges with 'preserve_edges', and to select specific models or lists of frames using the 'model' and 'frames' parameters. Replacement of the default asset with a smoothed version is managed by 'replace_asset' .

You might also like