Metashape Python Api 1 7 4
Metashape Python Api 1 7 4
Metashape Python Api 1 7 4
Release 1.7.4
Agisoft LLC
1 Overview 3
2 Application Modules 5
i
ii
Metashape Python Reference, Release 1.7.4
CONTENTS 1
Metashape Python Reference, Release 1.7.4
2 CONTENTS
CHAPTER
ONE
OVERVIEW
This API is in development and will be extended in the future Metashape releases.
3
Metashape Python Reference, Release 1.7.4
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 Metashape.app.document property.
The following example performs main processing steps on existing project and saves back the results:
>>> chunk.alignCameras()
>>> chunk.buildDepthMaps(downscale=4, filter_mode=Metashape.AggressiveFiltering)
>>> chunk.buildDenseCloud()
>>> chunk.buildModel(surface_type=Metashape.Arbitrary, interpolation=Metashape.
˓→EnabledInterpolation)
>>> chunk.buildUV(mapping_mode=Metashape.GenericMapping)
>>> chunk.buildTexture(blending_mode=Metashape.MosaicBlending, texture_size=4096)
>>> doc.save()
class Metashape.Antenna
GPS antenna position relative to camera.
copy()
Return a copy of the object.
Returns A copy of the object.
Return type Antenna
fixed
Fix antenna flag.
Type bool
location
Antenna coordinates.
Type Vector
location_acc
Antenna location accuracy.
5
Metashape Python Reference, Release 1.7.4
Type Vector
location_covariance
Antenna location covariance.
Type Matrix
location_ref
Antenna location reference.
Type Vector
rotation
Antenna rotation angles.
Type Vector
rotation_acc
Antenna rotation accuracy.
Type Vector
rotation_covariance
Antenna rotation covariance.
Type Matrix
rotation_ref
Antenna rotation reference.
Type Vector
class Metashape.Application
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 Metashape.app 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:
class ConsolePane
ConsolePane class provides access to the console pane
clear()
Clear console pane.
contents
Console pane contents.
Type string
class ModelView
ModelView class provides access to the model view
class DenseCloudViewMode
Dense cloud view mode in [DenseCloudViewColor, DenseCloudViewClasses, DenseCloudViewCon-
fidence]
class ModelViewMode
Model view mode in [ModelViewShaded, ModelViewSolid, ModelViewWireframe, ModelViewCon-
fidence, ModelViewTextured]
class PointCloudViewMode
Point cloud view mode in [PointCloudViewColor, PointCloudViewVariance]
class TiledModelViewMode
Tiled model view mode in [TiledModelViewTextured, TiledModelViewSolid, TiledModelViewWire-
frame]
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 Image
dense_cloud_view_mode
Dense cloud view mode.
Type DenseCloudViewMode
model_view_mode
Model view mode.
Type ModelViewMode
point_cloud_view_mode
Point cloud view mode.
Type PointCloudViewMode
texture_view_mode
Texture view mode.
Type TextureViewMode
tiled_model_view_mode
Tiled model view mode.
Type TiledModelViewMode
view_mode
View mode.
Type DataSource
viewpoint
Viewpoint in the model view.
Type Viewpoint
class OrthoView
OrthoView class provides access to the ortho view
7
Metashape Python Reference, Release 1.7.4
save()
Save settings on disk.
setValue(key, value)
Set settings value. :arg key: Key. :type key: string :arg value: Value. :type value: object
value(key)
Return settings value. :arg key: Key. :type key: string :return: Settings value. :rtype: object
activated
Metashape activation status.
Type bool
addMenuItem(label, func[, shortcut ][, icon ])
Create a new menu entry.
Parameters
• label (string) – Menu item label.
• func (function) – Function to be called.
• shortcut (string) – Keyboard shortcut.
• icon (string) – Icon.
addMenuSeparator(label)
Add menu separator.
Parameters label (string) – Menu label.
console_pane
Console pane.
Type ConsolePane
cpu_enable
Use CPU when GPU is active.
Type bool
document
Main application document object.
Type Document
enumGPUDevices()
Enumerate installed GPU devices.
Returns A list of devices.
Return type list
getBool(label='')
Prompt user for the boolean value.
Parameters label (string) – 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
9
Metashape Python Reference, Release 1.7.4
11
Metashape Python Reference, Release 1.7.4
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 (string) – Menu item label.
settings
Application settings.
Type Settings
title
Application name.
Type string
update()
Update user interface during long operations.
version
Metashape version.
Type string
class Metashape.AttachedGeometry
Attached geometry data.
GeometryCollection(geometries)
Create a GeometryCollection geometry.
Parameters geometries (list of Geometry) – Child geometries.
Returns A GeometryCollection geometry.
Return type Geometry
LineString(coordinates)
Create a LineString geometry.
Parameters coordinates (list of Vector) – List of vertex coordinates.
Returns A LineString geometry.
Return type Geometry
MultiLineString(geometries)
Create a MultiLineString geometry.
Parameters geometries (list of Geometry) – Child line strings.
Returns A point geometry.
Return type Geometry
MultiPoint(geometries)
Create a MultiPoint geometry.
Parameters geometries (list of Geometry) – Child points.
Returns A point geometry.
Return type Geometry
MultiPolygon(geometries)
Create a MultiPolygon geometry.
Parameters geometries (list of Geometry) – Child polygons.
13
Metashape Python Reference, Release 1.7.4
class Metashape.Calibration
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 Calibration
covariance_matrix
Covariance matrix.
Type Matrix
covariance_params
Covariance matrix parameters.
Type list of string
cx
Principal point X coordinate.
Type float
cy
Principal point Y coordinate.
Type float
error(point, proj)
Return projection error.
Parameters
• point (Vector) – Coordinates of the point to be projected.
• proj (Vector) – Pixel coordinates of the point.
Returns 2D projection error.
Return type Vector
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
k4
Radial distortion coefficient K4.
Type float
load(path, format=CalibrationFormatXML)
Loads calibration from file.
Parameters
• path (string) – path to calibration file
• format (CalibrationFormat) – 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 (Vector) – Coordinates of the point to be projected.
Returns 2D projected point coordinates.
Return type Vector
rpc
RPC model.
Type RPCModel
save(path, format=CalibrationFormatXML [, label ][, pixel_size ][, focal_length ], cx = 0, cy = 0)
Saves calibration to file.
Parameters
• path (string) – path to calibration file
• format (CalibrationFormat) – Calibration format.
15
Metashape Python Reference, Release 1.7.4
• label (string) – Calibration label used in Australis, CalibCam and CalCam formats.
• pixel_size (Vector) – Pixel size in mm used to convert normalized calibration coeffi-
cients 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 Sensor.Type
unproject(point)
Return direction corresponding to the image point.
Parameters point (Vector) – Pixel coordinates of the point.
Returns 3D vector in the camera coordinate system.
Return type Vector
width
Image width.
Type int
class Metashape.CalibrationFormat
Calibration format in [CalibrationFormatXML, CalibrationFormatAustralis, CalibrationFormatAustralisV7,
CalibrationFormatPhotoModeler, CalibrationFormatCalibCam, CalibrationFormatCalCam, CalibrationFormat-
Inpho, CalibrationFormatUSGS, CalibrationFormatPix4D, CalibrationFormatOpenCV, CalibrationFormatPho-
tomod, CalibrationFormatGrid]
class Metashape.Camera
Camera instance
class Reference
Camera reference data.
accuracy
Camera location accuracy.
Type Vector
enabled
Location enabled flag.
Type bool
location
Camera coordinates.
Type Vector
location_accuracy
Camera location accuracy.
Type Vector
location_enabled
Location enabled flag.
Type bool
rotation
Camera rotation angles.
Type Vector
rotation_accuracy
Camera rotation accuracy.
Type Vector
rotation_enabled
Rotation enabled flag.
Type bool
class Type
Camera type in [Regular, Keyframe]
calibration
Adjusted camera calibration including photo-invariant parameters.
Type Calibration
center
Camera station coordinates for the photo in the chunk coordinate system.
Type Vector
chunk
Chunk the camera belongs to.
Type Chunk
enabled
Enables/disables the photo.
Type bool
error(point, proj)
Returns projection error.
Parameters
• point (Vector) – Coordinates of the point to be projected.
• proj (Vector) – Pixel coordinates of the point.
Returns 2D projection error.
Return type Vector
17
Metashape Python Reference, Release 1.7.4
frames
Camera frames.
Type list of Camera
group
Camera group.
Type CameraGroup
image()
Returns image data.
Returns Image data.
Return type Image
key
Camera identifier.
Type int
label
Camera label.
Type string
layer_index
Camera layer index.
Type int
location_covariance
Camera location covariance.
Type Matrix
mask
Camera mask.
Type Mask
master
Master camera.
Type Camera
meta
Camera meta data.
Type MetaData
open(path[, layer ])
Loads specified image file.
Parameters
• path (string) – 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 Photo
planes
Camera planes.
Type list of Camera
project(point)
Returns coordinates of the point projection on the photo.
Parameters point (Vector) – Coordinates of the point to be projected.
Returns 2D point coordinates.
Return type Vector
reference
Camera reference data.
Type CameraReference
rotation_covariance
Camera rotation covariance.
Type Matrix
selected
Selects/deselects the photo.
Type bool
sensor
Camera sensor.
Type Sensor
shutter
Camera shutter.
Type Shutter
thumbnail
Camera thumbnail.
Type Thumbnail
transform
4x4 matrix describing photo location in the chunk coordinate system.
Type Matrix
type
Camera type.
Type Camera.Type
unproject(point)
Returns coordinates of the point which will have specified projected coordinates.
Parameters point (Vector) – Projection coordinates.
Returns 3D point coordinates.
Return type Vector
19
Metashape Python Reference, Release 1.7.4
vignetting
Vignetting for each band.
Type list of Vignetting
class Metashape.CameraGroup
CameraGroup objects define groups of multiple cameras. The grouping is established by assignment of a Cam-
eraGroup instance to the Camera.group 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]
label
Camera group label.
Type string
selected
Current selection state.
Type bool
type
Camera group type.
Type CameraGroup.Type
class Metashape.CameraTrack
Camera track.
chunk
Chunk the camera track belongs to.
Type Chunk
duration
Animation duration.
Type float
field_of_view
Vertical field of view in degrees.
Type float
keyframes
Camera track keyframes.
Type list of Camera
label
Animation label.
Type string
load(path[, projection ])
Load camera track from file.
Parameters
• path (string) – Path to camera track file
• projection (CoordinateSystem) – Camera track coordinate system.
meta
Camera track meta data.
Type MetaData
save(path[, projection ])
Save camera track to file.
Parameters
• path (string) – Path to camera track file
• projection (CoordinateSystem) – Camera track coordinate system.
class Metashape.CamerasFormat
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]
class Metashape.Chunk
A Chunk object:
• provides access to all chunk components (sensors, cameras, camera groups, markers, scale bars)
• contains data inherent to individual frames (point cloud, model, etc)
• implements processing methods (matchPhotos, alignCameras, buildDenseCloud, 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:
addCamera([sensor ])
Add new camera to the chunk.
Parameters sensor (Sensor) – Sensor to be assigned to this camera.
Returns Created camera.
Return type Camera
addCameraGroup()
Add new camera group to the chunk.
Returns Created camera group.
Return type CameraGroup
21
Metashape Python Reference, Release 1.7.4
addCameraTrack()
Add new camera track to the chunk.
Returns Created camera track.
Return type CameraTrack
addDenseCloud()
Add new dense cloud to the chunk.
Returns Created dense cloud.
Return type DenseCloud
addDepthMaps()
Add new depth maps set to the chunk.
Returns Created depth maps set.
Return type DepthMaps
addElevation()
Add new elevation model to the chunk.
Returns Created elevation model.
Return type Elevation
addFrame()
Add new frame to the chunk.
Returns Created frame.
Return type Frame
addFrames([chunk ][, frames ], copy_depth_maps=True, copy_dense_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 of int) – List of frame keys to copy.
• copy_depth_maps (bool) – Copy depth maps.
• copy_dense_cloud (bool) – Copy dense 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 (Vector) – Point to initialize marker projections.
• visibility (bool) – Enables visibility check during projection assignment.
Returns Created marker.
23
Metashape Python Reference, Release 1.7.4
25
Metashape Python Reference, Release 1.7.4
27
Metashape Python Reference, Release 1.7.4
29
Metashape Python Reference, Release 1.7.4
31
Metashape Python Reference, Release 1.7.4
• precision (int) – Number of digits after the decimal point (for text formats).
• texture_format (ImageFormat) – 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 (RasterTransformType) – Raster band transformation.
• colors_rgb_8bit (bool) – Convert colors to 8 bit RGB.
• comment (string) – Optional comment (if supported by selected format).
• save_comment (bool) – Enables/disables comment export.
• format (ModelFormat) – Export format.
• crs (CoordinateSystem) – Output coordinate system.
• shift (Vector) – Optional shift to be applied to vertex coordinates.
• clip_to_boundary (bool) – Clip model to boundary shapes.
• viewpoint (Viewpoint) – Default view.
• progress (Callable[[float], None]) – Progress callback.
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 (string) – Path to output orthophoto.
• cameras (list of int) – List of cameras to process.
• raster_transform (RasterTransformType) – Raster band transformation.
• projection (OrthoProjection) – Output projection.
• region (BBox) – 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.
33
Metashape Python Reference, Release 1.7.4
35
Metashape Python Reference, Release 1.7.4
• min_zoom_level (int) – Minimum zoom level (Google Map Tiles, MBTiles and World
Wind Tiles formats only).
• max_zoom_level (int) – Maximum zoom level (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 (string) – Export title.
• description (string) – Export description.
• source_data (DataSource) – Selects between DEM and orthomosaic.
• 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 (string) – Path to the output file.
• format (ReferenceFormat) – Export format.
• items (ReferenceItems) – Items to export in CSV format.
• columns (string) – 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 (string) – 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='', page_numbers=True, include_system_info=True[,
user_settings ][, progress ])
Export processing report in PDF format.
Parameters
• path (string) – Path to output report.
• title (string) – Report title.
• description (string) – Report description.
• page_numbers (bool) – Enable page numbers.
• include_system_info (bool) – Include system information.
• user_settings (list of (string, string) tuples) – A list of user defined set-
tings to include on the Processing Parameters page.
• progress (Callable[[float], None]) – Progress callback.
37
Metashape Python Reference, Release 1.7.4
39
Metashape Python Reference, Release 1.7.4
• 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
• path (string) – Path to shape file.
• replace (bool) – Replace current shapes with new data.
• boundary_type (Shape.BoundaryType) – Boundary type to be applied to imported
shapes.
• format (ShapesFormat) – Shapes format.
• columns (string) – Column order in csv format (n - label, x/y/z - coordinates, d - de-
scription, [] - group of multiple values, | - column separator within group).
• delimiter (string) – 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 (CoordinateSystem) – Reference data coordinate system (csv format only).
• progress (Callable[[float], None]) – Progress callback.
importTiledModel(path='' [, progress ])
Import tiled model from file.
Parameters
• path (string) – Path to tiled model.
• progress (Callable[[float], None]) – Progress callback.
importVideo(path, image_path, frame_step=CustomFrameStep, custom_frame_step=1, time_start=0,
time_end=- 1)
Imports video to active chunk.
Parameters
• path (string) – Path to source video.
• image_path (string) – Path to directory where to save frames with filename template.
For example: /path/to/dir/frame{filenum}.png.
• frame_step (FrameStep) – Frame step type.
• custom_frame_step (int) – Every custom_frame_step’th frame will be saved. Used for
frame_step=CustomFrameStep.
• time_start (int) – The starting point for importing video, in milliseconds.
• time_end (int) – The endpoint for importing video, in milliseconds.
key
Chunk identifier.
Type int
41
Metashape Python Reference, Release 1.7.4
label
Chunk label.
Type string
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 (string) – Path to calibration file.
• cameras (list of Camera) – 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 CoordinateSystem
marker_groups
List of marker groups in the chunk.
Type list of MarkerGroup
marker_location_accuracy
Expected accuracy of marker coordinates in meters.
Type Vector
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 of Marker
masks
Image masks.
Type Masks
matchPhotos(downscale=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_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[, progress
])
Perform image matching for the chunk frame.
Parameters
• downscale (int) – Image alignment accuracy.
• generic_preselection (bool) – Enable generic preselection.
• reference_preselection (bool) – Enable reference preselection.
• reference_preselection_mode (ReferencePreselectionMode) – Reference prese-
lection 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.
• keypoint_limit (int) – Key point limit.
• 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 of (int, int) tuples) – User defined list of camera pairs to match.
• cameras (list of 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.
• progress (Callable[[float], None]) – Progress callback.
meta
Chunk meta data.
Type MetaData
model
Default model for the current frame.
Type Model
models
List of models for the current frame.
Type list of Model
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 point cloud / camera parameters.
43
Metashape Python Reference, Release 1.7.4
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 Orthomosaic
orthomosaics
List of orthomosaics for the current frame.
Type list of Orthomosaic
point_cloud
Generated sparse point cloud.
Type PointCloud
primary_channel
Primary channel index (-1 for default).
Type int
publishData(service, source, export_point_colors=False, with_camera_track=False[, title ][, description
][, token ], is_draft=False, is_private=False[, password ])
Publish generated data online.
Parameters
• service (ServiceType) – Service to upload on.
• source (DataSource) – Item to upload.
• with_camera_track (bool) – If model should be uploaded with camera track. Can be
used only with DataSource.ModelData.
• export_point_colors (bool) – If Point Cloud should be uploaded with point colors.
• title (string) – Title of uploading model.
45
Metashape Python Reference, Release 1.7.4
Type bool
sensors
List of sensors in the chunk.
Type list of Sensor
shapes
Shapes for the current frame.
Type Shapes
smoothModel(strength=3, apply_to_selection=False, fix_borders=True, preserve_edges=False[, progress ])
Smooth mesh 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.
• progress (Callable[[float], None]) – Progress callback.
sortCameras()
Sorts cameras by their labels.
sortMarkers()
Sorts markers by their labels.
sortScalebars()
Sorts scalebars by their labels.
thinPointCloud(point_limit=1000)
Remove excessive tracks from the point cloud.
Parameters point_limit (int) – Maximum number of points for each photo.
thumbnails
Image thumbnails.
Type Thumbnails
tiepoint_accuracy
Expected tie point accuracy in pixels.
Type float
tiled_model
Default tiled model for the current frame.
Type TiledModel
tiled_models
List of tiled models for the current frame.
Type list of TiledModel
trackMarkers(first_frame=0, last_frame=0[, progress ])
Track marker projections through the frame sequence.
Parameters
• first_frame (int) – Starting frame index.
47
Metashape Python Reference, Release 1.7.4
class Metashape.ChunkTransform
Transformation between chunk and world coordinates systems.
copy()
Return a copy of the object.
Returns A copy of the object.
Return type ChunkTransform
matrix
Transformation matrix.
Type Matrix
rotation
Rotation component.
Type Matrix
scale
Scale component.
Type float
translation
Translation component.
Type Vector
class Metashape.CirTransform
CIR calibration matrix.
calibrate()
Calibrate CIR matrix based on orthomosaic histogram.
coeffs
Color matrix.
Type Matrix
copy()
Return a copy of the object.
Returns A copy of the object.
Return type CirTransform
reset()
Reset CIR calibration matrix.
class Metashape.ClassificationMethod
Index values classification method in [EqualIntervalsClassification, JenksNaturalBreaksClassification]
class Metashape.CoordinateSystem
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:
49
Metashape Python Reference, Release 1.7.4
addGeoid(path)
Register geoid model.
Parameters path (string) – Path to geoid file.
authority
Authority identifier of the coordinate system.
Type string
copy()
Return a copy of the object.
Returns A copy of the object.
Return type CoordinateSystem
datumTransform(source, target)
Coordinate transformation from source to target coordinate system datum.
Parameters
• source (CoordinateSystem) – Source coordinate system.
• target (CoordinateSystem) – Target coordinate system.
Returns 4x4 transformation matrix.
Return type Matrix
geoccs
Base geocentric coordinate system.
Type CoordinateSystem
geogcs
Base geographic coordinate system.
Type CoordinateSystem
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 (string) – WKT definition of coordinate system or authority identifier.
listBuiltinCRS()
Returns a list of builtin coordinate systems.
localframe(point)
Returns 4x4 transformation matrix to LSE coordinates at the given point.
Parameters point (Vector) – Coordinates of the origin in the geocentric coordinates.
Returns Transformation from geocentric coordinates to local coordinates.
Return type Matrix
name
Name of the coordinate system.
Type string
proj4
Coordinate system definition in PROJ.4 format.
Type string
project(point)
Projects point from geocentric coordinates to projected geographic coordinate system.
Parameters point (Vector) – 3D point in geocentric coordinates.
Returns 3D point in projected coordinates.
Return type Vector
towgs84
TOWGS84 transformation parameters (dx, dy, dz, rx, ry, rz, scale).
Type list of float
transform(point, source, target)
Transform point coordinates between coordinate systems.
Parameters
• point (2 or 3 component Vector) – Point coordinates.
• source (CoordinateSystem) – Source coordinate system.
• target (CoordinateSystem) – Target coordinate system.
Returns Transformed point coordinates.
Return type Vector
transformationMatrix(point, source, target)
Local approximation of coordinate transformation from source to target coordinate system at the given
point.
Parameters
• point (3 component Vector) – Point coordinates.
• source (CoordinateSystem) – Source coordinate system.
• target (CoordinateSystem) – Target coordinate system.
Returns 4x4 transformation matrix.
Return type Matrix
unproject(point)
Unprojects point from projected coordinates to geocentric coordinates.
Parameters point (Vector) – 3D point in projected coordinate system.
Returns 3D point in geocentric coordinates.
Return type Vector
wkt
Coordinate system definition in WKT format.
Type string
wkt2
Coordinate system definition in WKT format, version 2.
Type string
51
Metashape Python Reference, Release 1.7.4
class Metashape.DataSource
Data source in [PointCloudData, DenseCloudData, DepthMapsData, ModelData, TiledModelData, Elevation-
Data, OrthomosaicData, ImagesData]
class Metashape.DataType
Data type in [DataTypeUndefined, DataType8i, DataType8u, DataType16i, DataType16u, DataType16f,
DataType32i, DataType32u, DataType32f, DataType64i, DataType64u, DataType64f]
class Metashape.DenseCloud
Dense point cloud data.
assignClass(target=0[, source ][, progress ])
Assign class to points.
Parameters
• target (PointClass) – Target class.
• source (PointClass or list of PointClass) – Classes of points to be replaced.
• progress (Callable[[float], None]) – Progress callback.
assignClassToSelection(target=0[, source ][, progress ])
Assign class to selected points.
Parameters
• target (PointClass) – Target class.
• source (PointClass or list of PointClass) – Classes of points to be replaced.
• progress (Callable[[float], None]) – Progress callback.
bands
List of color bands.
Type list of string
classifyGroundPoints(max_angle=15.0, max_distance=1.0, cell_size=50.0[, source ][, progress ])
Classify points into ground and non ground classes.
Parameters
• max_angle (float) – Maximum angle (degrees).
• max_distance (float) – Maximum distance (meters).
• cell_size (float) – Cell size (meters).
• source (PointClass) – Class of points to be re-classified.
• progress (Callable[[float], None]) – Progress callback.
classifyPoints([source ][, target ], confidence=0.0[, progress ])
Multiclass classification of points.
Parameters
• source (PointClass) – Class of points to be re-classified.
• target (list of PointClass) – Target point classes for classification.
• confidence (float) – Required confidence level from 0.0 to 1.0.
• progress (Callable[[float], None]) – Progress callback.
clear()
Clears dense cloud data.
compactPoints([progress ])
Permanently removes deleted points from dense cloud.
Parameters progress (Callable[[float], None]) – Progress callback.
copy()
Create a copy of the dense cloud.
Returns Copy of the dense cloud.
Return type DenseCloud
cropSelectedPoints([point_classes ][, progress ])
Crop selected points.
Parameters
• point_classes (PointClass or list of PointClass) – Classes of points to be removed.
• progress (Callable[[float], None]) – Progress callback.
crs
Reference coordinate system.
Type CoordinateSystem or None
data_type
Data type used to store color values.
Type DataType
key
Dense cloud identifier.
Type int
label
Dense cloud label.
Type string
meta
Dense cloud meta data.
Type MetaData
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 (Vector) – Ray origin.
• target (Vector) – 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 Vector
point_count
Number of points in dense cloud.
53
Metashape Python Reference, Release 1.7.4
Type int
removePoints(point_classes[, progress ])
Remove points.
Parameters
• point_classes (PointClass or list of PointClass) – Classes of points to be removed.
• progress (Callable[[float], None]) – Progress callback.
removeSelectedPoints([point_classes ][, progress ])
Remove selected points.
Parameters
• point_classes (PointClass or list of PointClass) – Classes of points to be removed.
• progress (Callable[[float], None]) – Progress callback.
renderDepth(transform, calibration, point_size=1, resolution=1, cull_points=False, add_alpha=True)
Render dense cloud depth image for specified viewpoint.
Parameters
• transform (Matrix) – Camera location.
• calibration (Calibration) – 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 Image
renderImage(transform, calibration, point_size=1, resolution=1, cull_points=False, add_alpha=True,
raster_transform=RasterTransformNone)
Render dense cloud image for specified viewpoint.
Parameters
• transform (Matrix) – Camera location.
• calibration (Calibration) – 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 (RasterTransformType) – Raster band transformation.
Returns Rendered image.
Return type Image
renderMask(transform, calibration, point_size=1, resolution=1, cull_points=False)
Render dense cloud mask image for specified viewpoint.
Parameters
55
Metashape Python Reference, Release 1.7.4
Parameters
• calibration (Calibration) – Calibration data.
• level (int) – Level index.
setImage(image, level=0)
Parameters
• image (Image) – Image object with depth map data.
• level (int) – Level index.
class Metashape.DepthMaps
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 DepthMaps
items()
List of items.
key
Depth maps identifier.
Type int
keys()
List of item keys.
label
Depth maps label.
Type string
57
Metashape Python Reference, Release 1.7.4
meta
Depth maps meta data.
Type MetaData
modified
Modified flag.
Type bool
values()
List of item values.
class Metashape.Document
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 Metashape.app.document attribute.
Additional Document objects can be created as needed.
The following example saves active chunk from the opened project in a separate project:
addChunk()
Add new chunk to the document.
Returns Created chunk.
Return type Chunk
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 of 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.
• 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 of int) – List of markers to be used for marker based alignment.
• progress (Callable[[float], None]) – Progress callback.
append(document [, chunks ][, progress ])
Append the specified Document object to the current document.
Parameters
59
Metashape Python Reference, Release 1.7.4
crs
Coordinate system of elevation model.
Type CoordinateSystem
height
Elevation model height.
Type int
key
Elevation model identifier.
Type int
label
Elevation model label.
Type string
left
X coordinate of the left side.
Type float
max
Maximum elevation value.
Type float
meta
Elevation model meta data.
Type MetaData
min
Minimum elevation value.
Type float
modified
Modified flag.
Type bool
palette
Color palette.
Type dict
projection
Projection of elevation model.
Type OrthoProjection
resolution
DEM resolution in meters.
Type float
right
X coordinate of the right side.
Type float
top
Y coordinate of the top side.
61
Metashape Python Reference, Release 1.7.4
Type float
width
Elevation model width.
Type int
class Metashape.EulerAngles
Euler angles in [EulerAnglesYPR, EulerAnglesOPK, EulerAnglesPOK, EulerAnglesANK]
class Metashape.FaceCount
Face count in [LowFaceCount, MediumFaceCount, HighFaceCount, CustomFaceCount]
class Metashape.FilterMode
Depth filtering mode in [NoFiltering, MildFiltering, ModerateFiltering, AggressiveFiltering]
class Metashape.FrameStep
Frame step size for video import in [CustomFrameStep, SmallFrameStep, MediumFrameStep, LargeFrameStep]
class Metashape.Geometry
Geometry data.
GeometryCollection(geometries)
Create a GeometryCollection geometry.
Parameters geometries (list of Geometry) – Child geometries.
Returns A GeometryCollection geometry.
Return type Geometry
LineString(coordinates)
Create a LineString geometry.
Parameters coordinates (list of Vector) – List of vertex coordinates.
Returns A LineString geometry.
Return type Geometry
MultiLineString(geometries)
Create a MultiLineString geometry.
Parameters geometries (list of Geometry) – Child line strings.
Returns A point geometry.
Return type Geometry
MultiPoint(geometries)
Create a MultiPoint geometry.
Parameters geometries (list of Geometry) – Child points.
Returns A point geometry.
Return type Geometry
MultiPolygon(geometries)
Create a MultiPolygon geometry.
Parameters geometries (list of Geometry) – Child polygons.
Returns A point geometry.
Return type Geometry
Point(vector)
Create a Point geometry.
Parameters vector (Vector or list of floats) – Point coordinates.
Returns A point geometry.
Return type Geometry
Polygon(exterior_ring[, interior_rings ])
Create a Polygon geometry.
Parameters
• exterior_ring (list of Vector) – Point coordinates.
• interior_rings (list of Vector) – Point coordinates.
Returns A Polygon geometry.
Return type Geometry
class Type
Geometry type in [PointType, LineStringType, PolygonType, MultiPointType, MultiLineStringType, Mul-
tiPolygonType, GeometryCollectionType]
coordinates
List of vertex coordinates.
Type Vector
geometries
List of child geometries.
Type Geometry
is_3d
Is 3D flag.
Type bool
type
Geometry type.
Type Geometry.Type
class Metashape.Image(width, height, channels, datatype='U8')
n-channel image
Parameters
• width (int) – image width
• height (int) – image height
• channels (string) – color channel layout, e.g. ‘RGB’, ‘RGBA’, etc.
• datatype (string) – pixel data type in [‘U8’, ‘U16’, ‘U32’, ‘F16’, ‘F32’, ‘F64’]
channels
Channel mapping for the image.
Type string
cn
Number of color channels.
Type int
63
Metashape Python Reference, Release 1.7.4
convert(channels[, datatype ])
Convert image to specified data type and channel layout.
Parameters
• channels (string) – color channels to be loaded, e.g. ‘RGB’, ‘RGBA’, etc.
• datatype (string) – pixel data type in [‘U8’, ‘U16’, ‘U32’, ‘F16’, ‘F32’, ‘F64’]
Returns Converted image.
Return type Image
copy()
Return a copy of the image.
Returns copy of the image
Return type Image
data_type
Data type used to store pixel values.
Type string
fromstring(data, width, height, channels, datatype='U8')
Create image from byte array.
Parameters
• data (string) – raw image data
• width (int) – image width
• height (int) – image height
• channels (string) – color channel layout, e.g. ‘RGB’, ‘RGBA’, etc.
• datatype (string) – pixel data type in [‘U8’, ‘U16’, ‘U32’, ‘F16’, ‘F32’, ‘F64’]
Returns Created image.
Return type Image
gaussianBlur(radius)
Smooth image with a gaussian filter.
Parameters radius (float) – smoothing radius.
Returns Smoothed image.
Return type Image
height
Image height.
Type int
open(path, layer=0, datatype='U8' [, channels ][, x ][, y ][, w ][, h ])
Load image from file.
Parameters
• path (string) – path to the image file
• layer (int) – image layer in case of multipage file
• datatype (string) – pixel data type in [‘U8’, ‘U16’, ‘U32’, ‘F16’, ‘F32’, ‘F64’]
65
Metashape Python Reference, Release 1.7.4
Parameters
• calib0 (Calibration) – initial calibration
• trans0 (Matrix) – initial camera orientation as 4x4 matrix
• calib1 (Calibration) – final calibration
• trans1 (Matrix) – final camera orientation as 4x4 matrix
Returns warped image
Return type Image
width
Image width.
Type int
class Metashape.ImageCompression
Image compression parameters
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 Viewpoint
jpeg_quality
JPEG quality.
Type int
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 Metashape.ImageFormat
Image format in [ImageFormatNone, ImageFormatJPEG, ImageFormatTIFF, ImageFormatPNG, ImageFor-
matBMP, ImageFormatEXR, ImageFormatPNM, ImageFormatSGI, ImageFormatCR2, ImageFormatSEQ,
ImageFormatBIL, ImageFormatXYZ, ImageFormatARA, ImageFormatTGA, ImageFormatDDS, ImageFor-
matJP2, ImageFormatWebP]
class Metashape.ImageLayout
Image layout in [UndefinedLayout, FlatLayout, MultiframeLayout, MultiplaneLayout]
class Metashape.Interpolation
Interpolation mode in [DisabledInterpolation, EnabledInterpolation, Extrapolated]
class Metashape.License
License information.
activate(license_key)
Activate software online using a license key.
Parameters key (string) – Activation key.
activateOffline(license_key)
Create a request for offline activation.
Parameters key (string) – Activation key.
Returns Activation request.
Return type string
deactivate()
Deactivate software online.
deactivateOffline()
Create a request for offline deactivation.
Returns Deactivation request.
Return type string
valid
Metashape activation status.
Type bool
class Metashape.MappingMode
UV mapping mode in [GenericMapping, OrthophotoMapping, AdaptiveOrthophotoMapping, SphericalMap-
ping, CameraMapping]
class Metashape.Marker
Marker instance
class Projection
Marker data().
coord
Point coordinates in pixels.
Type Vector
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.
67
Metashape Python Reference, Release 1.7.4
values()
List of item values.
class Reference
Marker reference data.
accuracy
Marker location accuracy.
Type Vector
enabled
Enabled flag.
Type bool
location
Marker coordinates.
Type Vector
class Type
Marker type in [Regular, Vertex, Fiducial]
chunk
Chunk the marker belongs to.
Type Chunk
enabled
Enables/disables the marker.
Type bool
frames
Marker frames.
Type list of Marker
group
Marker group.
Type MarkerGroup
key
Marker identifier.
Type int
label
Marker label.
Type string
meta
Marker meta data.
Type MetaData
position
Marker position in the current frame.
Type Vector
position_covariance
Marker position covariance.
Type Matrix
projections
List of marker projections.
Type MarkerProjections
reference
Marker reference data.
Type MarkerReference
selected
Selects/deselects the marker.
Type bool
sensor
Fiducial mark sensor.
Type Sensor
type
Marker type.
Type Marker.Type
class Metashape.MarkerGroup
MarkerGroup objects define groups of multiple markers. The grouping is established by assignment of a Mark-
erGroup instance to the Marker.group attribute of participating markers.
label
Marker group label.
Type string
selected
Current selection state.
Type bool
class Metashape.Mask
Mask instance
copy()
Returns a copy of the mask.
Returns Copy of the mask.
Return type Mask
image()
Returns image data.
Returns Image data.
Return type Image
invert()
Create inverted copy of the mask.
Returns Inverted copy of the mask.
Return type Mask
load(path[, layer ])
Loads mask from file.
Parameters
69
Metashape Python Reference, Release 1.7.4
Diag(vector)
Create a diagonal matrix.
Parameters vector (Vector or list of floats) – The vector of diagonal entries.
Returns A diagonal matrix.
Return type Matrix
Rotation(matrix)
Create a rotation matrix.
Parameters matrix (Matrix) – The 3x3 rotation matrix.
71
Metashape Python Reference, Release 1.7.4
rotation()
Returns rotation component of the 4x4 matrix.
Returns rotation component
Return type Matrix
row(index)
Returns row of the matrix.
Returns matrix row.
Return type Vector
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 Matrix Vector Matrix tuple
t()
Return a new, transposed matrix.
Returns a transposed matrix
Return type Matrix
translation()
Returns translation component of the 4x4 matrix.
Returns translation component
Return type Vector
zero()
Set all matrix elements to zero.
class Metashape.MetaData(object)
Collection of object properties
copy()
Return a copy of the object.
Returns A copy of the object.
Return type MetaData
items()
List of items.
keys()
List of item keys.
values()
List of item values.
class Metashape.Model
Triangular mesh model instance
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
tex_vertices
Texture vertex indices.
Type tuple of 3 int
vertices
Vertex indices.
Type tuple of 3 int
class Faces
Collection of model faces
resize(count)
Resize faces list.
Parameters count (int) – new face count
class Statistics
Mesh 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
73
Metashape Python Reference, Release 1.7.4
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
Vertex coordinates.
Type tuple of 2 float
class TexVertices
Collection of model texture vertices
resize(count)
Resize vertex list.
Parameters count (int) – new vertex count
class Texture
Model texture.
image(page=0)
Return texture image.
Parameters page (int) – Texture index for multitextured models.
Returns Texture image.
Return type Image
label
Animation label.
Type string
meta
Camera track meta data.
Type MetaData
model
Model the texture belongs to.
Type Model
setImage(image, page=0)
Initialize texture from image data.
Parameters
• image (Image) – Texture image.
• page (int) – Texture index for multitextured models.
type
Texture type.
Type Model.TextureType
class TextureType
Texture type in [DiffuseMap, NormalMap, OcclusionMap]
class Vertex
Vertex of the model
color
Vertex color.
Type tuple of 3 int
confidence
Vertex confidence.
Type float
coord
Vertex coordinates.
Type Vector
class Vertices
Collection of model vertices
resize(count)
Resize vertex list.
Parameters count (int) – new vertex count
addTexture(type=Model.DiffuseMap)
Add new texture to the model.
Parameters type (Model.TextureType) – Texture type.
Returns Created texture.
Return type Model.Texture
area()
Return area of the model surface.
Returns Model area.
Return type float
bands
List of color bands.
Type list of string
clear()
Clears model data.
closeHoles(level=30)
Fill holes in the model surface.
Parameters level (int) – Hole size threshold in percents.
copy()
Create a copy of the model.
75
Metashape Python Reference, Release 1.7.4
remove(items)
Remove textures from the model.
Parameters items (list of Model.Texture) – A list of textures to be removed.
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.
renderDepth(transform, calibration, cull_faces=True, add_alpha=True)
Render model depth image for specified viewpoint.
Parameters
• transform (Matrix) – Camera location.
• calibration (Calibration) – Camera calibration.
• cull_faces (bool) – Enable back-face culling.
• add_alpha (bool) – Generate image with alpha channel.
Returns Rendered image.
Return type Image
renderImage(transform, calibration, cull_faces=True, add_alpha=True,
raster_transform=RasterTransformNone)
Render model image for specified viewpoint.
Parameters
• transform (Matrix) – Camera location.
• calibration (Calibration) – Camera calibration.
• cull_faces (bool) – Enable back-face culling.
• add_alpha (bool) – Generate image with alpha channel.
• raster_transform (RasterTransformType) – Raster band transformation.
Returns Rendered image.
Return type Image
renderMask(transform, calibration, cull_faces=True)
Render model mask image for specified viewpoint.
Parameters
• transform (Matrix) – Camera location.
• calibration (Calibration) – Camera calibration.
• cull_faces (bool) – Enable back-face culling.
Returns Rendered image.
Return type Image
renderNormalMap(transform, calibration, cull_faces=True, add_alpha=True)
Render image with model normals for specified viewpoint.
Parameters
77
Metashape Python Reference, Release 1.7.4
Type MeshVertices
volume()
Return volume of the closed model surface.
Returns Model volume.
Return type float
class Metashape.ModelFormat
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 Metashape.NetworkClient
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:
abortBatch(batch_id)
Abort batch.
Parameters batch_id (int) – Batch id.
abortNode(node_id)
Abort node.
Parameters node_id (int) – Node id.
batchList(revision=0)
Get list of batches.
Parameters revision (int) – First revision to get.
Returns List of batches.
Return type dict
batchStatus(batch_id, revision=0)
Get batch status.
Parameters
• batch_id (int) – Batch id.
• revision (int) – First revision to get.
Returns Batch status.
Return type dict
connect(host, port=5840)
Connect to the server.
Parameters
• host (string) – Server hostname.
• port (int) – Communication port.
79
Metashape Python Reference, Release 1.7.4
pauseNode(node_id)
Pause node.
Parameters node_id (int) – Node id.
quitNode(node_id)
Quit node.
Parameters node_id (int) – Node id.
resumeBatch(batch_id)
Resume batch.
Parameters batch_id (int) – Batch id.
resumeNode(node_id)
Resume node.
Parameters node_id (int) – Node id.
serverInfo()
Get server information.
Returns Server information.
Return type dict
setBatchNodeLimit(batch_id, node_limit)
Set node limit of the batch.
Parameters
• batch_id (int) – Batch id.
• node_limit (int) – Node limit of the batch (0 - unlimited).
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).
setMasterServer([host ])
Set or reset master server.
Parameters host (string) – Master server hostname.
setNodeCPUEnable(node_id, cpu_enable)
Set node CPU enable flag.
Parameters
• node_id (int) – Node id.
• cpu_enable (bool) – CPU enable flag.
setNodeCapability(node_id, capability)
Set node capability.
Parameters
• node_id (int) – Node id.
• capability (int) – Node capability (1 - CPU, 2 - GPU, 3 - Any).
81
Metashape Python Reference, Release 1.7.4
setNodeGPUMask(node_id, gpu_mask)
Set node GPU mask.
Parameters
• node_id (int) – Node id.
• gpu_mask (int) – GPU device mask.
setNodePriority(node_id, priority)
Set node priority.
Parameters
• node_id (int) – Node id.
• priority (int) – Node priority (2 - Highest, 1 - High, 0 - Normal, -1 - Low, -2 - Lowest).
class Metashape.NetworkTask
NetworkTask class contains information about network task and its parameters.
The following example creates a new processing task and submits it to the server:
chunks
List of chunks.
Type list
encode()
Create a dictionary with task parameters.
frames
List of frames.
Type list
name
Task name.
Type string
params
Task parameters.
Type dict
supports_gpu
GPU support flag.
Type bool
class Metashape.OrthoProjection
Orthographic projection.
class Type
Projection type in [Planar, Cylindrical]
copy()
Return a copy of the object.
Returns A copy of the object.
Return type OrthoProjection
crs
Base coordinate system.
Type CoordinateSystem
matrix
Ortho transformation matrix.
Type Matrix
radius
Cylindrical projection radius.
Type float
transform(point, source, target)
Transform point coordinates between coordinate systems.
Parameters
• point (2 or 3 component Vector) – Point coordinates.
• source (OrthoProjection) – Source coordinate system.
• target (OrthoProjection) – Target coordinate system.
Returns Transformed point coordinates.
Return type Vector
type
Projection type.
Type OrthoProjection.Type
class Metashape.Orthomosaic
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:
class Patch
Orthomosaic patch.
copy()
Returns a copy of the patch.
Returns Copy of the patch.
83
Metashape Python Reference, Release 1.7.4
left
X coordinate of the left side.
Type float
meta
Orthomosaic meta data.
Type MetaData
modified
Modified flag.
Type bool
patches
Orthomosaic patches.
Type Orthomosaic.Patches
projection
Orthomosaic projection.
Type OrthoProjection
removeOrthophotos()
Remove orthorectified images from orthomosaic.
renderPreview(width = 2048, height = 2048[, progress ])
Generate orthomosaic preview image. :arg width: Preview image width. :type width: int :arg height:
Preview image height. :type height: int :arg progress: Progress callback. :type progress: Callable[[float],
None] :return: Preview image. :rtype: Image
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 Metashape.Photo
Photo instance
85
Metashape Python Reference, Release 1.7.4
alpha()
Returns alpha channel data.
Returns Alpha channel data.
Return type Image
copy()
Returns a copy of the photo.
Returns Copy of the photo.
Return type Photo
image([channels ][, datatype ])
Returns image data.
Parameters
• datatype (string) – pixel data type in [‘U8’, ‘U16’, ‘U32’, ‘F16’, ‘F32’, ‘F64’]
• channels (string) – color channels to be loaded, e.g. ‘RGB’, ‘RGBA’, etc.
Returns Image data.
Return type Image
imageMeta()
Returns image meta data.
Returns Image meta data.
Return type MetaData
layer
Layer index in the image file.
Type int
meta
Frame meta data.
Type MetaData
open(path, layer=0)
Loads specified image file.
Parameters
• path (string) – Path to the image file to be loaded.
• layer (int) – Layer index in case of multipage files.
path
Path to the image file.
Type string
thumbnail(width=192, height=192)
Creates new thumbnail with specified dimensions.
Returns Thumbnail data.
Return type Thumbnail
class Metashape.PointClass
Point class in [Created, Unclassified, Ground, LowVegetation, MediumVegetation, HighVegetation, Building,
class Criterion
Point filtering criterion in [ReprojectionError, ReconstructionUncertainty, ImageCount, ProjectionAc-
curacy]
init(points, criterion, progress)
Initialize point cloud filter based on specified criterion.
Parameters
• points (PointCloud or Chunk) – Point cloud to filter.
• criterion (PointCloud.Filter.Criterion) – Point filter criterion.
• progress (Callable[[float], None]) – Progress callback.
max_value
Maximum value.
Type int or double
min_value
Minimum value.
Type int or double
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 of int or list of double
class Point
3D point in the point cloud
coord
Point coordinates.
Type Vector
87
Metashape Python Reference, Release 1.7.4
cov
Point coordinates covariance matrix.
Type Matrix
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 point cloud
copy()
Returns a copy of points buffer.
Returns Copy of points buffer.
Return type PointCloud.Points
resize(count)
Resize points list.
Parameters count (int) – new point count
class Projection
Projection of the 3D point on the photo
coord
Projection coordinates.
Type tuple of 2 float
size
Point size.
Type float
track_id
Track index.
Type int
class Projections
Collection of PointCloud.Projection for the camera
copy()
Returns a copy of projections buffer.
Returns Copy of projections buffer.
Return type PointCloud.Projections
resize(count)
Resize projections list.
Parameters count (int) – new projections count
class Track
Track in the point cloud
color
Track color.
Type tuple of 3 int
class Tracks
Collection of tracks in the point cloud
copy()
Returns a copy of tracks buffer.
Returns Copy of tracks buffer.
Return type PointCloud.Tracks
resize(count)
Resize track list.
Parameters count (int) – new track count
bands
List of color bands.
Type list of string
cleanup([progress ])
Remove points with insufficient number of projections.
Parameters progress (Callable[[float], None]) – Progress callback.
copy(keypoints=True)
Returns a copy of the point cloud.
Parameters keypoints (bool) – copy key points data.
Returns Copy of the point cloud.
Return type PointCloud
cropSelectedPoints()
Crop selected points.
cropSelectedTracks()
Crop selected tie points.
data_type
Data type used to store color values.
Type DataType
export(path, format='obj' [, projection ])
Export point cloud.
Parameters
• path (string) – Path to output file.
• format (string) – Export format in [‘obj’, ‘ply’].
• projection (Matrix or CoordinateSystem) – Sets output projection.
meta
Point cloud meta data.
Type MetaData
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).
89
Metashape Python Reference, Release 1.7.4
Parameters
• origin (Vector) – Ray origin.
• target (Vector) – 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 Vector
points
List of points.
Type PointCloud.Points
projections
Point projections for each photo.
Type PointCloud.Projections
removeKeypoints()
Remove keypoints from point cloud.
removeSelectedPoints()
Remove selected points.
removeSelectedTracks()
Remove selected tie points.
renderDepth(transform, calibration, point_size=1, cull_points=False, add_alpha=True)
Render point cloud depth image for specified viewpoint.
Parameters
• transform (Matrix) – Camera location.
• calibration (Calibration) – 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.
Return type Image
renderImage(transform, calibration, point_size=1, cull_points=False, add_alpha=True,
raster_transform=RasterTransformNone)
Render point cloud image for specified viewpoint.
Parameters
• transform (Matrix) – Camera location.
• calibration (Calibration) – Camera calibration.
• point_size (int) – Point size.
• cull_points (bool) – Enable normal based culling.
• add_alpha (bool) – Generate image with alpha channel.
• raster_transform (RasterTransformType) – Raster band transformation.
Returns Rendered image.
91
Metashape Python Reference, Release 1.7.4
class Metashape.Preselection
Image pair preselection in [NoPreselection, GenericPreselection, ReferencePreselection]
class Metashape.RPCModel
Rational polynomial model.
copy()
Return a copy of the object.
Returns A copy of the object.
Return type RPCModel
error(point, proj)
Returns projection error.
Parameters
• point (Vector) – Coordinates of the point to be projected.
• proj (Vector) – Pixel coordinates of the point.
Returns 2D projection error.
Return type Vector
image_offset
Image coordinate offset.
Type Vector
image_scale
Image coordinate scale.
Type Vector
line_den_coeff
Line denominator.
Type Vector
line_num_coeff
Line numerator.
Type Vector
load(path)
Load RPC model from file.
Parameters path (string) – path to RPC model file
object_offset
Object coordinate offset.
Type Vector
object_scale
Object coordinate scale.
Type Vector
project(point)
Returns projected pixel coordinates of the point.
Parameters point (Vector) – Coordinates of the point to be projected.
Returns 2D projected point coordinates.
93
Metashape Python Reference, Release 1.7.4
range
Palette mapping range.
Type tuple
reset()
Reset raster transform.
class Metashape.RasterTransformType
Raster transformation type in [RasterTransformNone, RasterTransformValue, RasterTransformPalette]
class Metashape.ReferenceFormat
Reference format in [ReferenceFormatNone, ReferenceFormatXML, ReferenceFormatTEL, ReferenceFor-
matCSV, ReferenceFormatMavinci, ReferenceFormatBramor, ReferenceFormatAPM]
class Metashape.ReferenceItems
Reference items in [ReferenceItemsCameras, ReferenceItemsMarkers, ReferenceItemsScalebars]
class Metashape.ReferencePreselectionMode
Reference preselection mode in [ReferencePreselectionSource, ReferencePreselectionEstimated, ReferencePre-
selectionSequential]
class Metashape.Region
Region parameters
center
Region center coordinates.
Type Vector
copy()
Return a copy of the object.
Returns A copy of the object.
Return type Region
rot
Region rotation matrix.
Type Matrix
size
Region size.
Type Vector
class Metashape.RotationOrder
Rotation order in [RotationOrderXYZ, RotationOrderXZY, RotationOrderYXZ, RotationOrderYZX, Rota-
tionOrderZXY, RotationOrderZYX]
class Metashape.Scalebar
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 Chunk
frames
Scale bar frames.
Type list of Scalebar
group
Scale bar group.
Type ScalebarGroup
key
Scale bar identifier.
Type int
label
Scale bar label.
Type string
meta
Scale bar meta data.
Type MetaData
point0
Start of the scale bar.
Type Marker
point1
End of the scale bar.
Type Marker
reference
Scale bar reference data.
Type ScalebarReference
selected
Selects/deselects the scale bar.
Type bool
class Metashape.ScalebarGroup
ScalebarGroup objects define groups of multiple scale bars. The grouping is established by assignment of a
ScalebarGroup instance to the Scalebar.group attribute of participating scale bars.
label
Scale bar group label.
Type string
selected
Current selection state.
95
Metashape Python Reference, Release 1.7.4
Type bool
class Metashape.Sensor
Sensor instance
class Reference
Sensor reference data.
accuracy
Sensor location accuracy.
Type Vector
enabled
Location enabled flag.
Type bool
location
Sensor coordinates.
Type Vector
location_accuracy
Sensor location accuracy.
Type Vector
location_enabled
Location enabled flag.
Type bool
rotation
Sensor rotation angles.
Type Vector
rotation_accuracy
Sensor rotation accuracy.
Type Vector
rotation_enabled
Rotation enabled flag.
Type bool
class Type
Sensor type in [Frame, Fisheye, Spherical, RPC]
antenna
GPS antenna correction.
Type Antenna
bands
List of color bands.
Type list of string
black_level
Black level for each band.
Type list of float
calibrateFiducials(resolution=0.014)
Fit fiducial coordinates to image measurements.
Parameters resolution (float) – Scanning resolution in mm/pix.
calibration
Adjusted calibration of the photo.
Type Calibration
chunk
Chunk the sensor belongs to.
Type Chunk
data_type
Data type used to store color values.
Type DataType
fiducials
Fiducial marks.
Type list of Marker
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 of string
fixed_rotation
Fix rotation flag.
Type bool
focal_length
Focal length in mm.
Type float
height
Image height.
Type int
key
Sensor identifier.
Type int
label
Sensor label.
97
Metashape Python Reference, Release 1.7.4
Type string
layer_index
Sensor layer index.
Type int
location
Sensor plane location.
Type Vector
location_covariance
Sensor plane location covariance.
Type Matrix
makeMaster()
Make this sensor master in the multi-camera system.
master
Master sensor.
Type Sensor
meta
Sensor meta data.
Type MetaData
normalize_sensitivity
Enable sensitivity normalization.
Type bool
normalize_to_float
Convert pixel values to floating point after normalization.
Type bool
photo_params
List of image-variant calibration parameters.
Type list of string
pixel_height
Pixel height in mm.
Type float
pixel_size
Pixel size in mm.
Type Vector
pixel_width
Pixel width in mm.
Type float
planes
Sensor planes.
Type list of Sensor
reference
Sensor reference data.
Type SensorReference
rolling_shutter
Enable rolling shutter compensation.
Type bool
rotation
Sensor plane rotation.
Type Matrix
rotation_covariance
Sensor plane rotation covariance.
Type Matrix
sensitivity
Sensitivity for each band.
Type list of float
type
Sensor projection model.
Type Sensor.Type
user_calib
Custom calibration used as initial calibration during photo alignment.
Type Calibration
vignetting
Vignetting for each band.
Type list of Vignetting
width
Image width.
Type int
class Metashape.ServiceType
Service type in [ServiceSketchfab, ServiceMapbox, Service4DMapper, ServicePointscene, ServiceMelown, Ser-
vicePointbox, ServicePicterra, ServiceCesium]
class Metashape.Shape
Shape data.
class BoundaryType
Shape boundary type in [NoBoundary, OuterBoundary, InnerBoundary]
class Type
Shape type (deprecated) in [Point, Polyline, Polygon]
class Vertices
Collection of shape vertices
area()
Return area of the shape on DEM.
Returns Shape area.
Return type float
99
Metashape Python Reference, Release 1.7.4
attributes
Shape attributes.
Type MetaData
boundary_type
Shape boundary type.
Type Shape.BoundaryType
geometry
Shape geometry.
Type Geometry or AttachedGeometry
group
Shape group.
Type ShapeGroup
has_z
Z enable flag (deprecated).
Type bool
is_attached
Attached flag.
Type bool
key
Shape identifier.
Type int
label
Shape label.
Type string
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
selected
Selects/deselects the shape.
Type bool
type
Shape type (deprecated).
Type Shape.Type
vertex_ids
List of shape vertex ids (deprecated).
Type ShapeVertices
vertices
List of shape vertices (deprecated).
Type ShapeVertices
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 Metashape.ShapeGroup
ShapeGroup objects define groups of multiple shapes. The grouping is established by assignment of a Shape-
Group instance to the Shape.group attribute of participating shapes.
color
Shape group color.
Type tuple of 4 int
enabled
Enable flag.
Type bool
key
Shape group identifier.
Type int
label
Shape group label.
Type string
meta
Shape group meta data.
Type MetaData
selected
Current selection state.
Type bool
show_labels
Shape labels visibility flag.
Type bool
class Metashape.Shapes
A set of shapes for a chunk frame.
addGroup()
Add new shape group to the set of shapes.
Returns Created shape group.
Return type ShapeGroup
addShape()
Add new shape to the set of shapes.
101
Metashape Python Reference, Release 1.7.4
103
Metashape Python Reference, Release 1.7.4
copy_depth_maps
Copy depth maps.
Type bool
copy_elevation
Copy DEM.
Type bool
copy_model
Copy model.
Type bool
copy_orthomosaic
Copy orthomosaic.
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 of int
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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
105
Metashape Python Reference, Release 1.7.4
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
workitem_count
Work item count.
Type int
class AlignCameras
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 (Chunk or Document) – 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 of 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.
min_image
Minimum number of point projections.
Type int
name
Task name.
Type string
reset_alignment
Reset current alignment.
Type bool
subdivide_task
Enable fine-level task subdivision.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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 of int
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
downscale
Alignment accuracy.
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
fit_scale
Fit chunk scale during alignment.
Type bool
generic_preselection
Enables image pair preselection.
Type bool
keypoint_limit
Maximum number of points for each photo.
107
Metashape Python Reference, Release 1.7.4
Type int
markers
List of markers to be used for marker based alignment.
Type list of 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 string
reference
Chunk to be used as a reference.
Type int
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
workitem_count
Work item count.
Type int
class AnalyzePhotos
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – 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 of 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
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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.
interval
Contour interval.
Type float
max_value
Maximum value of contour range.
Type float
min_value
Minimum value of contour range.
Type float
109
Metashape Python Reference, Release 1.7.4
name
Task name.
Type string
prevent_intersections
Prevent contour intersections.
Type bool
source_data
Source data for contour generation.
Type DataSource
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – Chunk or Document object to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
classes
List of dense point classes to be used for surface extraction.
Type list of 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.
flip_x
Flip X axis direction.
Type bool
flip_y
Flip Y axis direction.
Type bool
flip_z
Flip Z axis direction.
Type bool
interpolation
Interpolation mode.
Type Interpolation
max_workgroup_size
Maximum workgroup size.
Type int
name
Task name.
Type string
projection
Output projection.
Type OrthoProjection
region
Region to be processed.
Type BBox
resolution
Output resolution in meters.
Type float
source_data
Selects between dense point cloud and sparse point cloud.
Type DataSource
subdivide_task
Enable fine-level task subdivision.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
workitem_count
Work item count.
Type int
workitem_size_tiles
Number of tiles in a workitem.
Type int
class BuildDenseCloud
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
111
Metashape Python Reference, Release 1.7.4
Parameters
• object (Chunk or Document) – 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.
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 string
point_colors
Enable point colors calculation.
Type bool
point_confidence
Enable point confidence calculation.
Type bool
subdivide_task
Enable fine-level task subdivision.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
workitem_count
Work item count.
Type int
workitem_size_cameras
Number of cameras in a workitem.
Type int
class BuildDepthMaps
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – 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 of int
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
downscale
Depth map quality.
Type int
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
filter_mode
Depth map filtering mode.
Type FilterMode
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 string
reuse_depth
Enable reuse depth maps option.
Type bool
subdivide_task
Enable fine-level task subdivision.
Type bool
supports_gpu
GPU support flag.
Type bool
113
Metashape Python Reference, Release 1.7.4
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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 of int
classes
List of dense point classes to be used for surface extraction.
Type list of 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.
face_count
Target face count.
Type FaceCount
face_count_custom
Custom face count.
Type int
interpolation
Interpolation mode.
Type Interpolation
keep_depth
Enable store depth maps option.
Type bool
max_workgroup_size
Maximum workgroup size.
Type int
name
Task name.
Type string
source_data
Selects between dense point cloud, sparse point cloud and depth maps.
Type DataSource
subdivide_task
Enable fine-level task subdivision.
Type bool
supports_gpu
GPU support flag.
Type bool
surface_type
Type of object to be reconstructed.
Type SurfaceType
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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.
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.
115
Metashape Python Reference, Release 1.7.4
Parameters
• object (Chunk or Document) – Chunk or Document object to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
blending_mode
Orthophoto blending mode.
Type BlendingMode
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
flip_x
Flip X axis direction.
Type bool
flip_y
Flip Y axis direction.
Type bool
flip_z
Flip Z axis direction.
Type bool
ghosting_filter
Enable ghosting filter.
Type bool
max_workgroup_size
Maximum workgroup size.
Type int
name
Task name.
Type string
projection
Output projection.
Type OrthoProjection
refine_seamlines
Refine seamlines based on image content.
Type bool
region
Region to be processed.
Type BBox
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
supports_gpu
GPU support flag.
Type bool
surface_data
Orthorectification surface.
Type DataSource
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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_tiles
Number of tiles in a workitem.
Type int
class BuildSeamlines
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – 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.
117
Metashape Python Reference, Release 1.7.4
decodeJSON(json)
Initialize task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
epsilon
Contour simplificaion threshold.
Type float
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
workitem_count
Work item count.
Type int
class BuildTexture
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – Chunk or Document object to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
blending_mode
Texture blending mode.
Type BlendingMode
cameras
A list of cameras to be used for texturing.
Type list of 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
name
Task name.
Type string
source_model
Source model.
Type int
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
texture_size
Texture page size.
Type int
texture_type
Texture type.
Type Model.TextureType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
transfer_texture
Transfer texture.
Type bool
workitem_count
Work item count.
Type int
class BuildTiledModel
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – Chunk or Document object to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
classes
List of dense point classes to be used for surface extraction.
Type list of int
decode(dict)
Initialize task parameters with a dictionary.
119
Metashape Python Reference, Release 1.7.4
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.
Type int
ghosting_filter
Enable ghosting filter.
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 string
operand_asset
Operand asset key.
Type int
operand_chunk
Operand chunk key.
Type int
operand_frame
Operand frame key.
Type int
pixel_size
Target model resolution in meters.
Type float
source_data
Selects between dense point cloud and mesh.
Type DataSource
subdivide_task
Enable fine-level task subdivision.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
tile_size
Size of tiles in pixels.
Type int
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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
• object (Chunk or Document) – 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 MappingCamera 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.
mapping_mode
Texture mapping mode.
Type MappingMode
name
Task name.
Type string
page_count
Number of texture pages to generate.
Type int
121
Metashape Python Reference, Release 1.7.4
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
texture_size
Expected size of texture page at texture generation step.
Type int
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
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 (Chunk or Document) – 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 of 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.
name
Task name.
Type string
source_data
Source data for calibration.
Type DataSource
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
white_balance
Calibrate white balance.
Type bool
workitem_count
Work item count.
Type int
class CalibrateLens
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – 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
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
123
Metashape Python Reference, Release 1.7.4
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
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
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 (Chunk or Document) – 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.
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
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 (Chunk or Document) – 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.
max_angle
Maximum angle (degrees).
Type float
max_distance
Maximum distance (meters).
Type float
name
Task name.
Type string
125
Metashape Python Reference, Release 1.7.4
source_class
Class of points to be re-classified.
Type int
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – Chunk or Document object to be processed.
• workitem (int) – Workitem index.
• 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.
name
Task name.
Type string
source_class
Class of points to be re-classified.
Type int
subdivide_task
Enable fine-level task subdivision.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
target_classes
Target point classes for classification.
Type list of int
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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.
level
Hole size threshold in percents.
Type int
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
workitem_count
Work item count.
Type int
127
Metashape Python Reference, Release 1.7.4
class ColorizeDenseCloud
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – 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.
name
Task name.
Type string
source_data
Source data to extract colors from.
Type DataSource
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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.
name
Task name.
Type string
source_data
Source data to extract colors from.
Type DataSource
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
workitem_count
Work item count.
Type int
class CompactDenseCloud
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – 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.
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
129
Metashape Python Reference, Release 1.7.4
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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 of 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.
fix_pixel_aspect
Fix pixel aspect.
Type bool
fix_principal_point
Fix principal point.
Type bool
image_compression
Image compression parameters.
Type ImageCompression
name
Task name.
Type string
path
Path to output file.
Type string
remove_distortions
Remove distortions.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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
asset
Model to process.
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.
face_count
Target face count.
Type int
name
Task name.
131
Metashape Python Reference, Release 1.7.4
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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 of 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 of int
generate_masks
Generate background masks.
Type bool
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
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 (Chunk or Document) – 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 of 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
frames
List of frames to process.
Type list of int
inverted
Detect markers on black background.
Type bool
maximum_residual
Maximum residual for non-coded targets in pixels.
Type float
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.
133
Metashape Python Reference, Release 1.7.4
Type string
noparity
Disable parity checking.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
target_type
Type of targets.
Type TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
tolerance
Detector tolerance (0 - 100).
Type int
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 (Chunk or Document) – 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 DataSource
clip_to_boundary
Clip to boundary shapes.
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.
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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
• object (Chunk or Document) – Chunk or Document object to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
chunk
Chunk to copy.
Type int
copy_dense_clouds
Copy dense clouds.
Type bool
copy_depth_maps
Copy depth maps.
Type bool
copy_elevations
Copy DEMs.
Type bool
copy_keypoints
Copy keypoints.
Type bool
copy_models
Copy models.
Type bool
copy_orthomosaics
Copy orthomosaics.
Type bool
135
Metashape Python Reference, Release 1.7.4
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.
frames
List of frame keys to copy.
Type list of int
label
New chunk label.
Type string
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
workitem_count
Work item count.
Type int
class ExportCameras
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – 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
bingo_path_geoin
Path to BINGO GEO INPUT file.
Type string
bingo_path_gps
Path to BINGO GPS/IMU file.
Type string
bingo_path_image
Path to BINGO IMAGE COORDINATE file.
Type string
bingo_path_itera
Path to BINGO ITERA file.
Type string
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
bundler_path_list
Path to Bundler image list file.
Type string
bundler_save_list
Enables/disables export of Bundler image list file.
Type bool
chan_rotation_order
Rotation order (CHAN format only).
Type RotationOrder
crs
Output coordinate system.
Type CoordinateSystem
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 CamerasFormat
image_orientation
Image coordinate system (0 - X right, 1 - X up, 2 - X left, 3 - X down).
137
Metashape Python Reference, Release 1.7.4
Type int
name
Task name.
Type string
path
Path to output file.
Type string
save_invalid_matches
Enables/disables export of invalid image matches.
Type bool
save_markers
Enables/disables export of manual matching points.
Type bool
save_points
Enables/disables export of automatic tie points.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 ExportDepth
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – 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 of 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.
export_depth
Enable export of depth map.
Type bool
export_diffuse
Enable export of diffuse map.
Type bool
export_normals
Enable export of normal map.
Type bool
name
Task name.
Type string
path_depth
Path to depth map.
Type string
path_diffuse
Path to diffuse map.
Type string
path_normals
Path to normal map.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
workitem_count
Work item count.
Type int
class ExportMarkers
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
139
Metashape Python Reference, Release 1.7.4
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.
name
Task name.
Type string
path
Path to output file.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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
clip_to_boundary
Clip model to boundary shapes.
Type bool
colors_rgb_8bit
Convert colors to 8 bit RGB.
Type bool
comment
Optional comment (if supported by selected format).
Type string
141
Metashape Python Reference, Release 1.7.4
crs
Output coordinate system.
Type CoordinateSystem
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 ModelFormat
name
Task name.
Type string
path
Path to output model.
Type string
precision
Number of digits after the decimal point (for text formats).
Type int
raster_transform
Raster band transformation.
Type RasterTransformType
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
save_markers
Enables/disables marker export.
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 Vector
strip_extensions
Strips camera label extensions during export.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
texture_format
Texture format.
Type ImageFormat
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
viewpoint
Default view.
Type Viewpoint
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 (Chunk or Document) – Chunk or Document object to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
143
Metashape Python Reference, Release 1.7.4
cameras
List of cameras to process.
Type list of 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.
image_compression
Image compression parameters.
Type ImageCompression
name
Task name.
Type string
north_up
Use north-up orientation for export.
Type bool
path
Path to output orthophoto.
Type string
projection
Output projection.
Type OrthoProjection
raster_transform
Raster band transformation.
Type RasterTransformType
region
Region to be exported.
Type BBox
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
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
white_background
Enable white background.
Type bool
workitem_count
Work item count.
Type int
class ExportPanorama
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – Chunk or Document object to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
camera_groups
List of camera groups to process.
Type list of 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.
height
Height of output panorama.
Type int
image_compression
Image compression parameters.
Type ImageCompression
name
Task name.
145
Metashape Python Reference, Release 1.7.4
Type string
path
Path to output file.
Type string
region
Region to be exported.
Type BBox
rotation
Panorama 3x3 orientation matrix.
Type Matrix
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
width
Width of output panorama.
Type int
workitem_count
Work item count.
Type int
class ExportPoints
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – 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 dense point classes to be exported.
Type list of int
clip_to_boundary
Clip point cloud to boundary shapes.
Type bool
colors_rgb_8bit
Convert colors to 8 bit RGB.
Type bool
comment
Optional comment (if supported by selected format).
Type string
compression
Enable compression (Cesium format only).
Type bool
crs
Output coordinate system.
Type CoordinateSystem
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 PointsFormat
image_format
Image data format.
Type ImageFormat
name
Task name.
Type string
path
Path to output file.
Type string
raster_transform
Raster band transformation.
Type RasterTransformType
region
Region to be exported.
Type BBox
save_classes
Enables/disables export of point classes.
Type bool
save_colors
Enables/disables export of point colors.
147
Metashape Python Reference, Release 1.7.4
Type bool
save_comment
Enable comment export.
Type bool
save_confidence
Enables/disables export of point confidence.
Type bool
save_images
Enable image export.
Type bool
save_normals
Enables/disables export of point normals.
Type bool
shift
Optional shift to be applied to point coordinates.
Type Vector
source_data
Selects between dense point cloud and sparse point cloud. If not specified, uses dense cloud if available.
Type DataSource
split_in_blocks
Enable tiled export.
Type bool
subdivide_task
Enable fine-level task subdivision.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
viewpoint
Default view.
Type Viewpoint
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 (Chunk or Document) – Chunk or Document object to be processed.
149
Metashape Python Reference, Release 1.7.4
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 string
projection
Output projection.
Type OrthoProjection
raster_transform
Raster band transformation.
Type RasterTransformType
region
Region to be exported.
Type BBox
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_scheme
Enable tile scheme files generation.
Type bool
save_world
Enable world file generation.
Type bool
source_data
Selects between DEM and orthomosaic.
Type DataSource
split_in_blocks
Split raster in blocks.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
tile_height
Tile height in pixels.
Type int
tile_width
Tile width in pixels.
Type int
title
Export title.
Type string
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
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 Matrix
class ExportReference
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – 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).
151
Metashape Python Reference, Release 1.7.4
Type string
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
delimiter
Column delimiter in csv format.
Type string
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
format
Export format.
Type ReferenceFormat
items
Items to export in CSV format.
Type ReferenceItems
name
Task name.
Type string
path
Path to the output file.
Type string
precision
Number of digits after the decimal point (for CSV format).
Type int
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – Chunk or Document object to be processed.
• workitem (int) – Workitem index.
153
Metashape Python Reference, Release 1.7.4
Type bool
shift
Optional shift to be applied to vertex coordinates.
Type Vector
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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.
name
Task name.
Type string
path
Path to output file.
Type string
save_alpha
Enable alpha channel export.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
155
Metashape Python Reference, Release 1.7.4
Type Tasks.TargetType
texture_type
Texture type.
Type Model.TextureType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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
crs
Output coordinate system.
Type CoordinateSystem
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 TiledModelFormat
image_compression
Image compression parameters.
Type ImageCompression
model_compression
Enable mesh compression (Cesium format only).
Type bool
model_format
Model format for zip export.
Type ModelFormat
name
Task name.
Type string
path
Path to output model.
Type string
raster_transform
Raster band transformation.
Type RasterTransformType
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
texture_format
Texture format.
Type ImageFormat
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
workitem_count
Work item count.
Type int
class FilterDenseCloud
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – Chunk or Document object to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
asset
Dense cloud key to filter.
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.
name
Task name.
Type string
point_spacing
Desired point spacing (m).
157
Metashape Python Reference, Release 1.7.4
Type float
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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 of 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.
encodeJSON()
Create a JSON string with task parameters.
fix_coverage
Extend masks to cover whole mesh (only if mask_defocus=True).
Type bool
mask_defocus
Mask defocus areas.
Type bool
mask_operation
Mask operation.
Type MaskOperation
masking_mode
Mask generation mode.
Type MaskingMode
name
Task name.
Type string
path
Mask file name template.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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 of float
cell_size
Step of prescription grid, meters.
Type float
class_count
Number of classes.
Type int
159
Metashape Python Reference, Release 1.7.4
classification_method
Index values classification method.
Type ClassificationMethod
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.
name
Task name.
Type string
rates
Fertilizer rate for each class.
Type list of float
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – Chunk or Document object to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
crs
Ground coordinate system.
Type CoordinateSystem
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
File format.
Type CamerasFormat
image_list
Path to image list file (Bundler format only).
Type string
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 string
path
Path to the file.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
workitem_count
Work item count.
Type int
class ImportLaserScans
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – 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.
161
Metashape Python Reference, Release 1.7.4
encodeJSON()
Create a JSON string with task parameters.
filenames
List of files to import.
Type list of string
format
Point cloud format.
Type PointsFormat
image_path
Path template to output files.
Type string
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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.
name
Task name.
Type string
path
Path to the file.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – Chunk or Document object to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
crs
Model coordinate system.
Type CoordinateSystem
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 ModelFormat
name
Task name.
Type string
path
Path to model.
Type string
163
Metashape Python Reference, Release 1.7.4
shift
Optional shift to be applied to vertex coordinates.
Type Vector
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
workitem_count
Work item count.
Type int
class ImportPoints
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – Chunk or Document object to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
calculate_normals
Calculate point normals.
Type bool
crs
Point cloud coordinate system.
Type CoordinateSystem
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
Point cloud format.
Type PointsFormat
name
Task name.
Type string
path
Path to point cloud.
Type string
shift
Optional shift to be applied to point coordinates.
Type Vector
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
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 (Chunk or Document) – 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 CoordinateSystem
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.
has_nodata_value
No-data value valid flag.
Type bool
name
Task name.
Type string
nodata_value
No-data value.
Type float
path
Path to elevation model in GeoTIFF format.
Type string
165
Metashape Python Reference, Release 1.7.4
raster_type
Type of raster layer to import.
Type DataSource
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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 accuracy,
a/b/c - rotation angles, A/B/C - rotation angle accuracy, [] - group of multiple values, | - column
separator within group).
Type string
create_markers
Create markers for missing entries (csv format only).
Type bool
crs
Reference data coordinate system (csv format only).
Type CoordinateSystem
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
delimiter
Column delimiter in csv format.
Type string
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
format
File format.
Type ReferenceFormat
group_delimiters
Combine consequitive delimiters in csv format.
Type bool
ignore_labels
Matches reference data based on coordinates alone (csv format only).
Type bool
items
List of items to load reference for (csv format only).
Type ReferenceItems
name
Task name.
Type string
path
Path to the file with reference data.
Type string
shutter_lag
Shutter lag in seconds (APM format only).
Type float
skip_rows
Number of rows to skip in (csv format only).
Type int
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
threshold
Error threshold in meters used when ignore_labels is set (csv format only).
Type float
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – Chunk or Document object to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
167
Metashape Python Reference, Release 1.7.4
boundary_type
Boundary type to be applied to imported shapes.
Type Shape.BoundaryType
columns
Column order in csv format (n - label, x/y/z - coordinates, d - description, [] - group of multiple values,
| - column separator within group).
Type string
crs
Reference data coordinate system (csv format only).
Type CoordinateSystem
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
delimiter
Column delimiter in csv format.
Type string
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
format
Shapes format.
Type ShapesFormat
group_delimiters
Combine consequitive delimiters in csv format.
Type bool
name
Task name.
Type string
path
Path to shape file.
Type string
replace
Replace current shapes with new data.
Type bool
skip_rows
Number of rows to skip in (csv format only).
Type int
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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.
name
Task name.
Type string
path
Path to tiled model.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – Chunk or Document object to be processed.
169
Metashape Python Reference, Release 1.7.4
name
Task name.
Type string
path
Path to project file.
Type string
read_only
Open project in read only mode.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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 of int
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
downscale
Image alignment accuracy.
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
171
Metashape Python Reference, Release 1.7.4
filter_stationary_points
Exclude tie points which are stationary across images.
Type bool
generic_preselection
Enable generic preselection.
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_per_mpx
Key point limit per megapixel.
Type int
mask_tiepoints
Apply mask filter to tie points.
Type bool
max_workgroup_size
Maximum workgroup size.
Type int
name
Task name.
Type string
pairs
User defined list of camera pairs to match.
Type list of (int, int) tuples
reference_preselection
Enable reference preselection.
Type bool
reference_preselection_mode
Reference preselection mode.
Type ReferencePreselectionMode
reset_matches
Reset current matches.
Type bool
subdivide_task
Enable fine-level task subdivision.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
tiepoint_limit
Tie point limit.
Type int
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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 of 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.
name
Task name.
Type string
source_data
Asset type.
Type DataSource
supports_gpu
GPU support flag.
Type bool
173
Metashape Python Reference, Release 1.7.4
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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 of 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.
merge_dense_clouds
Merge dense clouds.
Type bool
merge_depth_maps
Merge depth maps.
Type bool
merge_elevations
Merge DEMs.
Type bool
merge_markers
Merge markers.
Type bool
merge_models
Merge models.
Type bool
merge_orthomosaics
Merge orthomosaics.
Type bool
merge_tiepoints
Merge tie points.
Type bool
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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.
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
175
Metashape Python Reference, Release 1.7.4
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.
Type bool
fit_p1
Enable optimization of p1 tangential distortion coefficient.
Type bool
fit_p2
Enable optimization of p2 tangential distortion coefficient.
Type bool
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
tiepoint_covariance
Estimate tie point covariance matrices.
Type bool
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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.
group_attached_viewpoints
Ignore minimum waypoint spacing for additional viewpoints.
Type bool
horizontal_zigzags
Cover surface with horizontal zigzags instead of vertical.
Type bool
max_pitch
Maximum camera pitch angle.
Type int
max_waypoints
Maximum waypoints per flight.
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 string
177
Metashape Python Reference, Release 1.7.4
overlap
Overlap percent.
Type int
safety_distance
Safety distance (m).
Type float
sensor
Sensor key.
Type int
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
use_selection
Focus on model selection.
Type bool
workitem_count
Work item count.
Type int
class ReduceOverlap
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – 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.
name
Task name.
Type string
overlap
Target number of cameras observing each point of the surface.
Type int
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
use_selection
Focus on model selection.
Type bool
workitem_count
Work item count.
Type int
class RefineMesh
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – 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 of int
decode(dict)
Initialize task parameters with a dictionary.
decodeJSON(json)
Initialize task parameters from a JSON string.
downscale
Refinement quality.
Type int
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
iterations
Number of refinement iterations.
Type int
name
Task name.
Type string
smoothness
Smoothing strength. Should be in range [0, 1].
Type float
179
Metashape Python Reference, Release 1.7.4
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 string
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – 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.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
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 string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of 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 (Chunk or Document) – 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 of 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.
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
workitem_count
Work item count.
Type int
181
Metashape Python Reference, Release 1.7.4
class RunScript
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – Chunk or Document object to be processed.
• workitem (int) – Workitem index.
• progress (Callable[[float], None]) – Progress callback.
args
Script arguments.
Type string
code
Script code.
Type string
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.
name
Task name.
Type string
path
Script path.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
workitem_count
Work item count.
Type int
class SaveProject
Task class containing processing parameters.
absolute_paths
Store absolute image paths.
Type bool
183
Metashape Python Reference, Release 1.7.4
185
Metashape Python Reference, Release 1.7.4
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.
height
Raster height.
Type int
name
Task name.
Type string
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
projection
Output projection.
Type OrthoProjection
region
Region to be processed.
Type BBox
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
subtract
Subtraction flag.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
width
Raster width.
Type int
workitem_count
Work item count.
Type int
world_transform
2x3 raster-to-world transformation matrix.
Type Matrix
class TriangulatePoints
Task class containing processing parameters.
apply(object [, workitem ][, progress ])
Apply task to specified object.
Parameters
• object (Chunk or Document) – 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.
max_error
Reprojection error threshold.
Type float
min_image
Minimum number of point projections.
Type int
name
Task name.
Type string
supports_gpu
GPU support flag.
187
Metashape Python Reference, Release 1.7.4
Type bool
target
Task target.
Type Tasks.TargetType
toNetworkTask([objects ])
Convert task to NetworkTask to be applied to specified objects.
Parameters objects (Document, Chunk or list of Chunk) – Objects to be processed.
workitem_count
Work item count.
Type int
createTask(name)
Create task object by its name.
Parameters name (string) – Task name.
Returns Task object.
Return type object
class Metashape.Thumbnail
Thumbnail instance
copy()
Returns a copy of thumbnail.
Returns Copy of thumbnail.
Return type Thumbnail
image()
Returns image data.
Returns Image data.
Return type Image
load(path[, layer ])
Loads thumbnail from file.
Parameters
• path (string) – Path to the image file to be loaded.
• layer (int) – Optional layer index in case of multipage files.
setImage(image)
Type MetaData
modified
Modified flag.
Type bool
values()
List of item values.
class Metashape.TiledModel
Tiled model data.
class FaceCount
Tiled model face count in [LowFaceCount, MediumFaceCount, HighFaceCount]
bands
List of color bands.
Type list of string
clear()
Clears tiled model data.
copy()
Create a copy of the tiled model.
Returns Copy of the tiled model.
Return type TiledModel
crs
Reference coordinate system.
Type CoordinateSystem or None
data_type
Data type used to store color values.
Type DataType
key
Tiled model identifier.
Type int
label
Tiled model label.
Type string
meta
Tiled model meta data.
Type MetaData
modified
Modified flag.
Type bool
pickPoint(origin, target, endpoints=1)
Returns ray intersection with the tiled model.
Parameters
• origin (Vector) – Ray origin.
189
Metashape Python Reference, Release 1.7.4
191
Metashape Python Reference, Release 1.7.4
euler2mat(rotation, euler_angles=EulerAnglesYPR)
Calculate camera to world rotation matrix from euler rotation angles.
Parameters
• rotation (Vector) – Rotation vector.
• euler_angles (EulerAngles) – Euler angles to use.
Returns Rotation matrix.
Return type Matrix
mat2euler(R, euler_angles=EulerAnglesYPR)
Calculate euler rotation angles from camera to world rotation matrix.
Parameters
• R (Matrix) – Rotation matrix.
• euler_angles (EulerAngles) – Euler angles to use.
Returns Rotation angles in degrees.
Return type Vector
mat2opk(R)
Calculate omega, phi, kappa from camera to world rotation matrix.
Parameters R (Matrix) – Rotation matrix.
Returns Omega, phi, kappa angles in degrees.
Return type Vector
mat2ypr(R)
Calculate yaw, pitch, roll from camera to world rotation matrix.
Parameters R (Matrix) – Rotation matrix.
Returns Yaw, pitch roll angles in degrees.
Return type Vector
opk2mat(angles)
Calculate camera to world rotation matrix from omega, phi, kappa angles.
Parameters angles (Vector) – Omega, phi, kappa angles in degrees.
Returns Rotation matrix.
Return type Matrix
ypr2mat(angles)
Calculate camera to world rotation matrix from yaw, pitch, roll angles.
Parameters angles (Vector) – Yaw, pitch, roll angles in degrees.
Returns Rotation matrix.
Return type Matrix
class Metashape.Vector
n-component vector
193
Metashape Python Reference, Release 1.7.4
copy()
Return a copy of the vector.
Returns A copy of the vector.
Return type Vector
cross(a, b)
Cross product of 2 vectors.
Parameters
• a (Vector) – First vector.
• b (Vector) – Second vector.
Returns Cross product.
Return type Vector
norm()
Return norm of the vector.
norm2()
Return squared norm of the vector.
normalize()
Normalize vector to the unit length.
normalized()
Return a new, normalized vector.
Returns a normalized copy of the vector
Return type Vector
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 Metashape.Version
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 Version
major
Major version number.
Type int
micro
Micro version number.
Type int
minor
Minor version number.
Type int
class Metashape.Viewpoint(app)
Represents viewpoint in the model view
center
Camera center.
Type Vector
coo
Center of orbit.
Type Vector
copy()
Return a copy of the object.
Returns A copy of the object.
Return type Viewpoint
fov
Camera vertical field of view in degrees.
Type float
height
OpenGL window height.
195
Metashape Python Reference, Release 1.7.4
Type int
mag
Camera magnification defined by distance to the center of rotation.
Type float
rot
Camera rotation matrix.
Type Matrix
width
OpenGL window width.
Type int
class Metashape.Vignetting
Vignetting polynomial
copy()
Return a copy of the object.
Returns A copy of the object.
Return type Vignetting
THREE
197
Metashape Python Reference, Release 1.7.4
• Added renderPreview() methods to DenseCloud, Model, Orthomosaic, PointCloud and TiledModel classes
• Added BuildUV.texture_size attribute
• Added DecimateModel.apply_to_selection attribute
• Added DetectFiducials.cameras, DetectFiducials.frames 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 Chunk.addSensor() method
• Added texture_size argument to Chunk.buildUV() method
• Added apply_to_selection argument to Chunk.decimateModel() method
• Added generate_masks, cameras and frames arguments to Chunk.detectFiducials() method
• Added embed_texture argument to Chunk.exportModel() method
• Added width, height, point_size and progress arguments to Chunk.renderPreview() method
• Added clip_to_boundary argument to Chunk.exportPoints(), Chunk.exportModel(), Chunk.exportTiledModel()
and Chunk.exportRaster() methods
m
Metashape, 5
227