Metashape Python Api 1 5 2
Metashape Python Api 1 5 2
Release 1.5.2
Agisoft LLC
1 Overview 3
2 Application Modules 5
i
ii
Metashape Python Reference, Release 1.5.2
CONTENTS 1
Metashape Python Reference, Release 1.5.2
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.5.2
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(quality=Metashape.MediumQuality, filter=Metashape.
˓→AggressiveFiltering)
>>> chunk.buildDenseCloud()
>>> chunk.buildModel(surface=Metashape.Arbitrary, interpolation=Metashape.
˓→EnabledInterpolation)
>>> chunk.buildUV(mapping=Metashape.GenericMapping)
>>> chunk.buildTexture(blending=Metashape.MosaicBlending, size=4096)
>>> doc.save()
class Metashape.Accuracy
Alignment accuracy in [HighestAccuracy, HighAccuracy, MediumAccuracy, LowAccuracy, LowestAccuracy]
class Metashape.Antenna
GPS antenna position relative to camera.
fixed
Fix antenna flag.
Type bool
location
Antenna coordinates.
Type Vector
location_acc
Antenna location accuracy.
Type Vector
5
Metashape Python Reference, Release 1.5.2
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 Application.PhotosPane
PhotosPane class provides access to the photos pane
resetFilter()
Reset photos pane filter.
setFilter(items)
Set photos pane filter.
Parameters items (list of Camera or Marker) – filter to apply.
class Application.Settings
PySettings()
Application settings
load()
Load settings from disk.
log_enable
Enable writing log to file.
Type bool
log_path
Log file path.
Type string
network_enable
Network processing enabled flag.
Type bool
network_host
Network server host name.
Type string
network_path
Network data root path.
Type string
network_port
Network server control port.
Type int
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
Application.activated
Metashape activation status.
Type bool
Application.addMenuItem(label, func[, shortcut ][, icon ])
Create a new menu entry.
Parameters
• label (string) – Menu item label.
• func (function) – Function to be called.
7
Metashape Python Reference, Release 1.5.2
9
Metashape Python Reference, Release 1.5.2
• filter (string) – Optional file filter, e.g. “Text file (.txt)” or “.txt”. Multiple filters
are separated with ”;;”.
Returns Path to the file selected. If the input was cancelled, empty string is returned.
Return type string
Application.getOpenFileNames([hint ][, filter ])
Prompt user for one or more existing files.
Parameters
• hint (string) – Optional text label for the dialog.
• filter (string) – Optional file filter, e.g. “Text file (.txt)” or “.txt”. Multiple filters
are separated with ”;;”.
Returns List of file paths selected by the user. If the input was cancelled, empty list is returned.
Return type list
Application.getSaveFileName([hint ][, filter ])
Prompt user for the file. The file does not have to exist.
Parameters
• hint (string) – Optional text label for the dialog.
• filter (string) – Optional file filter, e.g. “Text file (.txt)” or “.txt”. Multiple filters
are separated with ”;;”.
Returns Path to the file selected. If the input was cancelled, empty string is returned.
Return type string
Application.getString(label=’‘, value=’‘)
Prompt user for the string value.
Parameters
• label (string) – Optional text label for the dialog.
• value (string) – Default value.
Returns String entered by the user.
Return type string
Application.gpu_mask
GPU device bit mask: 1 - use device, 0 - do not use (i.e. value 5 enables device number 0 and 2).
Type int
Application.messageBox(message)
Display message box to the user.
Parameters message (string) – Text message to be displayed.
Application.photos_pane
Photos pane.
Type PhotosPane
Application.quit()
Exit application.
Application.settings
Application settings.
Type Settings
Application.title
Application name.
Type string
Application.update()
Update user interface during long operations.
Application.version
Metashape version.
Type string
Application.viewpoint
Viewpoint in the model view.
Type Viewpoint
class Metashape.BlendingMode
Blending mode in [AverageBlending, MosaicBlending, MinBlending, MaxBlending, DisabledBlending]
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
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)
Returns projection error.
Parameters
• point (Vector) – Coordinates of the point to be projected.
• proj (Vector) – Pixel coordinates of the point.
Returns 2D projection error.
11
Metashape Python Reference, Release 1.5.2
project(point)
Returns projected pixel coordinates of the point.
Parameters point (Vector) – Coordinates of the point to be projected.
Returns 2D projected point coordinates.
Return type Vector
save(path, format=’xml’[, pixel_size ][, label ])
Saves calibration to file.
Parameters
• path (string) – path to calibration file
• format (string) – Calibration format in [’xml’, ‘australis’, ‘photomodeler’, ‘calib-
cam’, ‘calcam’, ‘inpho’, ‘usgs’, ‘opencv’].
• pixel_size (Vector) – Pixel size in mm used to convert normalized calibration co-
efficients to Australis and CalibCam coefficients.
• label (string) – Calibration label used in Australis, CalibCam and CalCam formats.
Returns success of operation
Return type bool
type
Camera model.
Type Sensor.Type
unproject(point)
Returns 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.Camera
Camera instance
13
Metashape Python Reference, Release 1.5.2
class Reference
Camera reference data.
accuracy
Camera location accuracy.
Type Vector
enabled
Enabled flag.
Type bool
location
Camera coordinates.
Type Vector
location_accuracy
Camera location accuracy.
Type Vector
rotation
Camera rotation angles.
Type Vector
rotation_accuracy
Camera rotation accuracy.
Type Vector
class Camera.Type
Camera type in [Regular, Keyframe]
Camera.calibration
Adjusted camera calibration including photo-invariant parameters.
Type Calibration
Camera.center
Camera station coordinates for the photo in the chunk coordinate system.
Type Vector
Camera.chunk
Chunk the camera belongs to.
Type Chunk
Camera.enabled
Enables/disables the photo.
Type bool
Camera.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.
15
Metashape Python Reference, Release 1.5.2
Camera.photo
Camera photo.
Type Photo
Camera.planes
Camera planes.
Type list of Camera
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
Camera.reference
Camera reference data.
Type CameraReference
Camera.rotation_covariance
Camera rotation covariance.
Type Matrix
Camera.selected
Selects/deselects the photo.
Type bool
Camera.sensor
Camera sensor.
Type Sensor
Camera.shutter
Camera shutter.
Type Shutter
Camera.thumbnail
Camera thumbnail.
Type Thumbnail
Camera.transform
4x4 matrix describing photo location in the chunk coordinate system.
Type Matrix
Camera.type
Camera type.
Type Camera.Type
Camera.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
Camera.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]
CameraGroup.label
Camera group label.
Type string
CameraGroup.selected
Current selection state.
Type bool
CameraGroup.type
Camera group type.
Type CameraGroup.Type
class Metashape.CameraTrack
Camera track.
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
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]
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)
17
Metashape Python Reference, Release 1.5.2
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
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 ][, items ][, progress ])
Add frames from specified chunk.
Parameters
• chunk (Chunk) – Chunk to copy frames from.
• frames (list of Frame) – Optional list of frames to be copied.
• items (list of DataSource) – A list of items to copy.
• 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.
Return type Marker
addMarkerGroup()
Add new marker group to the chunk.
Returns Created marker group.
Return type MarkerGroup
addModel()
Add new model to the chunk.
Returns Created model.
Return type Model
addOrthomosaic()
Add new orthomosaic to the chunk.
Returns Created orthomosaic.
Return type Orthomosaic
addPhotos(filenames[, layout ], strip_extensions=True[, progress ])
Add a list of photos to the chunk.
Parameters
• filenames (list of string) – A list of file paths.
• layout (ImageLayout) – Image layout in the chunk.
• strip_extensions (bool) – Strip file extensions from camera labels.
• progress (Callable[[float], None]) – Progress callback.
addScalebar(point1, point2)
Add new scale bar to the chunk.
19
Metashape Python Reference, Release 1.5.2
Parameters
• point1 (Marker or Camera) – First endpoint.
• point1 – Second endpoint.
Returns Created scale bar.
Return type Scalebar
addScalebarGroup()
Add new scale bar group to the chunk.
Returns Created scale bar group.
Return type ScalebarGroup
addSensor()
Add new sensor to the chunk.
Returns Created sensor.
Return type Sensor
addTiledModel()
Add new tiled model to the chunk.
Returns Created tiled model.
Return type TiledModel
alignCameras([cameras ][, min_image ], adaptive_fitting=False[, progress ])
Perform photo alignment for the chunk.
Parameters
• cameras (list of Camera) – A list of cameras to be aligned to the existing cameras.
• min_image (int) – Minimum number of point projections.
• adaptive_fitting (bool) – Enables adaptive fitting of distortion coefficients.
• progress (Callable[[float], None]) – Progress callback.
buildContours(source_data=ElevationData, interval=1[, min_value ][, max_value ][, progress ])
Build contours for the chunk.
Parameters
• source_data (DataSource) – Source data for contour generation.
• interval (float) – Contour interval.
• min_value (float) – Minimum value of contour range.
• max_value (float) – Maximum value of contour range.
• progress (Callable[[float], None]) – Progress callback.
buildDem(source=DenseCloudData, interpolation=EnabledInterpolation[, projection ][, region ][,
classes ], flip_x=False, flip_y=False, flip_z=False[, progress ])
Build elevation model for the chunk.
Parameters
• source (DataSource) – Selects between dense point cloud and sparse point cloud. If
not specified, uses dense cloud if available.
• interpolation (Interpolation) – Interpolation mode.
21
Metashape Python Reference, Release 1.5.2
23
Metashape Python Reference, Release 1.5.2
decimateModel(face_count[, progress ])
Decimate the model to the specified face count.
Parameters
• face_count (int) – Target face count.
• progress (Callable[[float], None]) – Progress callback.
dense_cloud
Default dense point cloud for the current frame.
Type DenseCloud
dense_clouds
List of dense clouds for the current frame.
Type list of DenseCloud
depth_maps
Default depth maps set for the current frame.
Type DepthMaps
depth_maps_sets
List of depth maps sets for the current frame.
Type list of DepthMaps
detectFiducials([progress ])
Detect fiducial marks on film cameras.
Parameters progress (Callable[[float], None]) – Progress callback.
detectMarkers(type=TargetCircular12bit, tolerance=50, filter_mask=False, inverted=False, nopar-
ity=False, maximum_residual=5[, minimum_size ][, minimum_dist ][, cameras ][,
progress ])
Create markers from coded targets.
Parameters
• type (TargetType) – Type of targets.
• tolerance (int) – Detector tolerance (0 - 100).
• filter_mask (bool) – Ignore masked image regions.
• inverted (bool) – Detect markers on black background.
• noparity (bool) – Disable parity checking.
• maximum_residual (float) – Maximum residual for non-coded targets in pixels..
• minimum_size (int) – Minimum target radius in pixels to be detected (CrossTarget
type only).
• minimum_dist (int) – Minimum distance between targets in pixels (CrossTarget type
only).
• cameras (list of Camera) – Optional list of cameras to be processed.
• progress (Callable[[float], None]) – Progress callback.
elevation
Default elevation model for the current frame.
Type Elevation
25
Metashape Python Reference, Release 1.5.2
elevations
List of elevation models for the current frame.
Type list of Elevation
enabled
Enables/disables the chunk.
Type bool
estimateImageQuality([cameras ], filter_mask=False[, progress ])
Estimate image quality.
Parameters
• cameras (list of Camera) – Optional list of cameras to be processed.
• filter_mask (bool) – Constrain analyzed image region by mask.
• progress (Callable[[float], None]) – Progress callback.
euler_angles
Euler angles triplet used for rotation reference.
Type EulerAngles
exportCameras(path, format=CamerasFormatXML[, projection ], export_points=True, ex-
port_markers=False, use_labels=False, rotation_order=RotationOrderXYZ [,
progress ])
Export point cloud and/or camera positions.
Parameters
• path (string) – Path to output file.
• format (CamerasFormat) – Export format.
• projection (CoordinateSystem) – Output coordinate system.
• export_points (bool) – Enables/disables export of automatic tie points.
• export_markers (bool) – Enables/disables export of manual matching points.
• use_labels (bool) – Enables/disables label based item identifiers.
• rotation_order (RotationOrder) – Rotation order (CHAN format only)
• progress (Callable[[float], None]) – Progress callback.
exportDem(path[, format ][, image_format ], raster_transform=RasterTransformNone[, projection
][, region ][, dx ][, dy ][, blockw ][, blockh ][, width ][, height ][, world_transform
], nodata=-32767, write_kml=False, write_world=False, write_scheme=False[,
image_description ], tiff_big=False, tiff_tiled=True, tiff_overviews=True, net-
work_links=True[, min_zoom_level ][, max_zoom_level ][, progress ])
Export digital elevation model.
Parameters
• path (string) – Path to output DEM.
• format (RasterFormat) – Export format.
• image_format (ImageFormat) – Tile format.
• raster_transform (RasterTransformType) – Raster transformation. Can be
RasterTransformNone or RasterTransformPalette.
27
Metashape Python Reference, Release 1.5.2
29
Metashape Python Reference, Release 1.5.2
exportShapes(path, items=Shape.Polygon[, groups ][, format ][, projection ][, shift ], poly-
gons_as_polylines=False, export_labels=True, export_attributes=True[, progress ])
Export shapes layer to file.
Parameters
• path (string) – Path to shape file.
• items (Shape.Type) – Items to export.
• groups (list of ShapeGroup) – A list of shape groups to export.
• format (ShapesFormat) – Export format.
• projection (CoordinateSystem) – Output coordinate system.
• shift (3-element vector) – Optional shift to be applied to vertex coordinates.
• polygons_as_polylines (bool) – Save polygons as polylines.
• export_labels (bool) – Export labels.
• export_attributes (bool) – Export attributes.
• progress (Callable[[float], None]) – Progress callback.
exportTiledModel(path, format=TiledModelFormatTLS, mesh_format=ModelFormatCOLLADA,
raster_transform=RasterTransformNone[, progress ])
Export generated tiled model for the chunk.
Parameters
• path (string) – Path to output model.
• format (TiledModelFormat) – Export format.
• mesh_format (ModelFormat) – Mesh format for zip export.
• raster_transform (RasterTransformType) – Raster band transformation.
• progress (Callable[[float], None]) – Progress callback.
findFrame(key)
Find frame by its key.
Returns Found frame.
Return type Chunk
frame
Current frame index.
Type int
frames
List of frames in the chunk.
Type list of Frame
image_brightness
Image brightness as percentage.
Type float
image_contrast
Image contrast as percentage.
Type float
31
Metashape Python Reference, Release 1.5.2
33
Metashape Python Reference, Release 1.5.2
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 markers in the chunk.
Type list of Marker
masks
Image masks.
Type Masks
matchPhotos(accuracy=HighAccuracy, preselection=ReferencePreselection,
generic_preselection=True, reference_preselection=True, filter_mask=False,
mask_tiepoints=False, keypoint_limit=40000, tiepoint_limit=4000,
keep_keypoints=True[, pairs ][, progress ])
Perform image matching for the chunk frame.
Parameters
• accuracy (Accuracy) – Alignment accuracy.
35
Metashape Python Reference, Release 1.5.2
37
Metashape Python Reference, Release 1.5.2
sensors
List of sensors in the chunk.
Type list of Sensor
shapes
Shapes for the current frame.
Type Shapes
smoothModel(strength = 3, selected_faces = False, fix_borders = True[, progress ])
Smooth mesh using Laplacian smoothing algorithm.
Parameters
• strength (float) – Smoothing strength.
• selected_faces (bool) – Smooth only selected faces.
• fix_borders (bool) – Fix vertices on borders.
• 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([start ][, end ][, progress ])
Track marker projections through the frame sequence.
Parameters
• start (int) – Starting frame index.
• end (int) – Ending frame index.
• progress (Callable[[float], None]) – Progress callback.
transform
4x4 matrix specifying chunk location in the world coordinate system.
Type ChunkTransform
updateTransform()
Update chunk transformation based on reference data.
world_crs
Coordinate system used as world coordinate system.
Type CoordinateSystem
class Metashape.ChunkTransform
Transformation between chunk and world coordinates systems.
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
reset()
Reset CIR calibration matrix.
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:
addGeoid(path)
Register geoid model.
39
Metashape Python Reference, Release 1.5.2
41
Metashape Python Reference, Release 1.5.2
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)
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.
Returns Coordinates of the intersection point.
Return type Vector
point_count
Number of points in dense cloud.
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.
restorePoints([point_classes ][, progress ])
Restore deleted points.
Parameters
43
Metashape Python Reference, Release 1.5.2
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
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=’points’, fix_scale=False, accuracy=HighAccuracy, prese-
lection=False, filter_mask=False, mask_tiepoints=False, point_limit=40000[, markers
][, progress ])
Align specified set of chunks.
45
Metashape Python Reference, Release 1.5.2
Parameters
• chunks (list) – List of chunks to be aligned.
• reference (Chunk) – Chunk to be used as a reference.
• method (string) – Alignment method in [’points’, ‘markers’, ‘cameras’].
• fix_scale (bool) – Fixes chunk scale during alignment.
• accuracy (Accuracy) – Alignment accuracy.
• preselection (bool) – Enables image pair preselection.
• filter_mask (bool) – Filter points by mask.
• mask_tiepoints (bool) – Apply mask filter to tie points.
• point_limit (int) – Maximum number of points for each photo.
• markers (list of Marker) – 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
• document (Document) – Document object to be appended.
• chunks (list of Chunk) – List of chunks to append.
• progress (Callable[[float], None]) – Progress callback.
chunk
Active chunk.
Type Chunk
chunks
List of chunks in the document.
Type Chunks
clear()
Clear the contents of the Document object.
findChunk(key)
Find chunk by its key.
Returns Found chunk.
Return type Chunk
mergeChunks(chunks, merge_dense_clouds=False, merge_models=False, merge_markers=False[,
progress ])
Merge specified set of chunks.
Parameters
• chunks (list) – List of chunks to be merged.
• merge_dense_clouds (bool) – Enables/disables merging of dense clouds.
• merge_models (bool) – Enables/disables merging of polygonal models.
• merge_markers (bool) – Enables/disables merging of corresponding marker across
the chunks.
47
Metashape Python Reference, Release 1.5.2
Type float
clear()
Clears elevation model data.
copy()
Create a copy of the elevation model.
Returns Copy of the elevation model.
Return type Elevation
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.
Type float
width
Elevation model width.
Type int
class Metashape.EulerAngles
Euler angles in [EulerAnglesYPR, EulerAnglesOPK]
class Metashape.FaceCount
Face count in [LowFaceCount, MediumFaceCount, HighFaceCount, CustomFaceCount]
class Metashape.FilterMode
Depth filtering mode in [NoFiltering, MildFiltering, ModerateFiltering, AggressiveFiltering]
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
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.
49
Metashape Python Reference, Release 1.5.2
Parameters
• width (int) – new image width
• height (int) – new image height
Returns resized image
Return type Image
save(path)
Save image to the file.
Parameters path (string) – path to the image file
tostring()
Convert image to byte array.
Returns Raw image data.
Return type string
undistort(calib, center_principal_point = True, square_pixels = True)
Undistort image using provided calibration.
Parameters
• calib (Calibration) – lens calibration
• center_principal_point (bool) – moves principal point to the image center
• square_pixels (bool) – create image with square pixels
Returns undistorted image
Return type Image
uniformNoise(amplitude)
Add uniform noise with specified amplitude.
Parameters amplitude (float) – noise amplitude.
Returns Image with added noise.
Return type Image
warp(calib0, trans0, calib1, trans1)
Warp image by rotating virtual viewpoint.
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
51
Metashape Python Reference, Release 1.5.2
class Metashape.ImageFormat
Image format in [ImageFormatNone, ImageFormatJPEG, ImageFormatTIFF, ImageFormatPNG, ImageFor-
matBMP, ImageFormatEXR, ImageFormatPNM, ImageFormatSGI, ImageFormatCR2, ImageFormatSEQ,
ImageFormatBIL, ImageFormatXYZ, ImageFormatARA, ImageFormatTGA, ImageFormatDDS, ImageFor-
matJP2]
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 [LegacyMapping, GenericMapping, OrthophotoMapping, AdaptiveOrthophotoMapping,
SphericalMapping, 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 Marker.Projections
Collection of projections specified for the marker
items()
List of items.
keys()
List of item keys.
values()
List of item values.
class Marker.Reference
Marker reference data.
accuracy
Marker location accuracy.
Type Vector
enabled
Enabled flag.
Type bool
location
Marker coordinates.
Type Vector
class Marker.Type
Marker type in [Regular, Vertex, Fiducial]
Marker.chunk
Chunk the marker belongs to.
Type Chunk
Marker.frames
Marker frames.
Type list of Marker
Marker.group
Marker group.
Type MarkerGroup
Marker.key
Marker identifier.
Type int
Marker.label
Marker label.
Type string
Marker.meta
Marker meta data.
Type MetaData
Marker.position
Marker position in the current frame.
53
Metashape Python Reference, Release 1.5.2
Type Vector
Marker.projections
List of marker projections.
Type MarkerProjections
Marker.reference
Marker reference data.
Type MarkerReference
Marker.selected
Selects/deselects the marker.
Type bool
Marker.sensor
Fiducial mark sensor.
Type Sensor
Marker.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
• path (string) – Path to the image file to be loaded.
• layer (int) – Optional layer index in case of multipage files.
setImage(image)
Parameters image (Image) – Image object with mask data.
class Metashape.MaskOperation
Mask operation in [MaskOperationReplacement, MaskOperationUnion, MaskOperationIntersection, MaskOp-
erationDifference]
class Metashape.MaskSource
Mask source in [MaskSourceAlpha, MaskSourceFile, MaskSourceBackground, MaskSourceModel]
class Metashape.Masks
A set of masks for a chunk frame.
items()
List of items.
keys()
List of item keys.
meta
Thumbnails meta data.
Type MetaData
modified
Modified flag.
Type bool
values()
List of item values.
class Metashape.Matrix
m-by-n matrix
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.
55
Metashape Python Reference, Release 1.5.2
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
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
57
Metashape Python Reference, Release 1.5.2
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 Model.Faces
Collection of model faces
resize(count)
Resize faces list.
Parameters count (int) – new face count
class Model.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
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 Model.TexVertex
Texture vertex of the model
coord
Vertex coordinates.
Type tuple of 2 float
class Model.TexVertices
Collection of model texture vertices
resize(count)
Resize vertex list.
Parameters count (int) – new vertex count
class Model.TextureType
Texture type in [DiffuseMap, NormalMap, OcclusionMap]
class Model.Vertex
Vertex of the model
color
Vertex color.
Type tuple of 3 int
coord
Vertex coordinates.
Type Vector
class Model.Vertices
Collection of model vertices
resize(count)
Resize vertex list.
Parameters count (int) – new vertex count
Model.area()
Return area of the model surface.
Returns Model area.
Return type float
Model.bands
List of color bands.
Type list of string
59
Metashape Python Reference, Release 1.5.2
Model.clear()
Clears model data.
Model.closeHoles(level = 30)
Fill holes in the model surface.
Parameters level (int) – Hole size threshold in percents.
Model.copy()
Create a copy of the model.
Returns Copy of the model.
Return type Model
Model.cropSelection()
Crop selected faces and free vertices from the mesh.
Model.data_type
Data type used to store color values.
Type DataType
Model.faces
Collection of mesh faces.
Type MeshFaces
Model.fixTopology()
Remove polygons causing topological problems.
Model.key
Model identifier.
Type int
Model.label
Model label.
Type string
Model.loadTexture(path)
Load texture from the specified file.
Parameters path (string) – Path to the image file.
Model.meta
Model meta data.
Type MetaData
Model.modified
Modified flag.
Type bool
Model.pickPoint(origin, target)
Return ray intersection with mesh.
Parameters
• origin (Vector) – Ray origin.
• target (Vector) – Point on the ray.
Returns Coordinates of the intersection point.
61
Metashape Python Reference, Release 1.5.2
Parameters
• image (Image) – Texture image.
• page (int) – Texture index for multitextured models.
• type (Model.TextureType) – Texture type.
Model.statistics([progress ])
Return mesh statistics.
Parameters progress (Callable[[float], None]) – Progress callback.
Returns Mesh statistics.
Return type Model.Statistics
Model.tex_vertices
Collection of mesh texture vertices.
Type MeshTexVertices
Model.texture(page=0, type=Model.DiffuseMap)
Return texture image.
Parameters
• page (int) – Texture index for multitextured models.
• type (Model.TextureType) – Texture type.
Returns Texture image.
Return type Image
Model.vertices
Collection of mesh vertices.
Type MeshVertices
Model.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, ModelFormatGLTF, ModelFormatX3D]
class Metashape.ModelViewMode
Model view mode in [ShadedModelView, SolidModelView, WireframeModelView, TexturedModelView]
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.
createBatch(path, tasks)
Create new batch.
Parameters
• path (string) – Project path relative to root folder.
• tasks (list of NetworkTask) – Project path relative to root folder.
Returns Batch id.
Return type int
disconnect()
Disconnect from the server.
findBatch(path)
Get batch id based on project path.
Parameters path (string) – Project path relative to root folder.
Returns Batch id.
Return type int
nodeList(revision=0)
Get list of nodes.
63
Metashape Python Reference, Release 1.5.2
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
65
Metashape Python Reference, Release 1.5.2
supports_gpu
GPU support flag.
Type bool
class Metashape.OrthoProjection
Orthographic projection.
class Type
Projection type in [Planar, Cylindrical]
OrthoProjection.crs
Base coordinate system.
Type CoordinateSystem
OrthoProjection.matrix
Ortho transformation matrix.
Type Matrix
OrthoProjection.radius
Cylindrical projection radius.
Type float
OrthoProjection.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
OrthoProjection.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.
Return type Orthomosaic.Patch
excluded
Excluded flag.
Type bool
image_keys
Image keys.
Type list of int
class Orthomosaic.Patches
A set of orthomosaic patches.
items()
List of items.
keys()
List of item keys.
values()
List of item values.
Orthomosaic.bands
List of color bands.
Type list of string
Orthomosaic.bottom
Y coordinate of the bottom side.
Type float
Orthomosaic.clear()
Clears orthomosaic data.
Orthomosaic.copy()
Create a copy of the orthomosaic.
Returns Copy of the orthomosaic.
Return type Orthomosaic
Orthomosaic.crs
Coordinate system of orthomosaic.
Type CoordinateSystem
Orthomosaic.data_type
Data type used to store color values.
Type DataType
Orthomosaic.height
Orthomosaic height.
Type int
Orthomosaic.key
Orthomosaic identifier.
Type int
67
Metashape Python Reference, Release 1.5.2
Orthomosaic.label
Orthomosaic label.
Type string
Orthomosaic.left
X coordinate of the left side.
Type float
Orthomosaic.meta
Orthomosaic meta data.
Type MetaData
Orthomosaic.modified
Modified flag.
Type bool
Orthomosaic.patches
Orthomosaic patches.
Type Orthomosaic.Patches
Orthomosaic.projection
Orthomosaic projection.
Type OrthoProjection
Orthomosaic.removeOrthophotos()
Remove orthorectified images from orthomosaic.
Orthomosaic.reset([progress ])
Reset all edits to orthomosaic.
Parameters progress (Callable[[float], None]) – Progress callback.
Orthomosaic.resolution
Orthomosaic resolution in meters.
Type float
Orthomosaic.right
X coordinate of the right side.
Type float
Orthomosaic.top
Y coordinate of the top side.
Type float
Orthomosaic.update([progress ])
Apply edits to orthomosaic.
Parameters progress (Callable[[float], None]) – Progress callback.
Orthomosaic.width
Orthomosaic width.
Type int
class Metashape.Photo
Photo instance
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 ])
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.
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,
69
Metashape Python Reference, Release 1.5.2
class Criterion
Point filtering criterion in [ReprojectionError, ReconstructionUncertainty, ImageCount, ProjectionAc-
curacy]
PointCloud.Filter.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.
PointCloud.Filter.max_value
Maximum value.
Type int or double
PointCloud.Filter.min_value
Minimum value.
Type int or double
PointCloud.Filter.removePoints(threshold)
Remove points based on specified threshold.
Parameters threshold (float) – Criterion threshold.
PointCloud.Filter.resetSelection()
Reset previously made selection.
PointCloud.Filter.selectPoints(threshold)
Select points based on specified threshold.
Parameters threshold (float) – Criterion threshold.
PointCloud.Filter.values
List of values.
Type list of int or list of double
class PointCloud.Point
3D point in the point cloud
coord
Point coordinates.
Type Vector
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 PointCloud.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 PointCloud.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 PointCloud.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 PointCloud.Track
Track in the point cloud
color
Track color.
Type tuple of 3 int
71
Metashape Python Reference, Release 1.5.2
class PointCloud.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
PointCloud.bands
List of color bands.
Type list of string
PointCloud.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
PointCloud.cropSelectedPoints()
Crop selected points.
PointCloud.cropSelectedTracks()
Crop selected tie points.
PointCloud.data_type
Data type used to store color values.
Type DataType
PointCloud.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.
PointCloud.meta
Point cloud meta data.
Type MetaData
PointCloud.modified
Modified flag.
Type bool
PointCloud.pickPoint(origin, target)
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.
73
Metashape Python Reference, Release 1.5.2
interpolation
Interpolation enable flag.
Type bool
palette
Color palette.
Type dict
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.Region
Region parameters
center
Region center coordinates.
Type Vector
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
Scalebar.chunk
Chunk the scalebar belongs to.
Type Chunk
Scalebar.frames
Scale bar frames.
Type list of Scalebar
Scalebar.group
Scale bar group.
Type ScalebarGroup
Scalebar.key
Scale bar identifier.
Type int
Scalebar.label
Scale bar label.
Type string
Scalebar.meta
Scale bar meta data.
Type MetaData
Scalebar.point0
Start of the scale bar.
Type Marker
Scalebar.point1
End of the scale bar.
Type Marker
Scalebar.reference
Scale bar reference data.
Type ScalebarReference
Scalebar.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.
75
Metashape Python Reference, Release 1.5.2
Type bool
class Metashape.Sensor
Sensor instance
class Reference
Sensor reference data.
accuracy
Sensor location accuracy.
Type Vector
enabled
Enabled flag.
Type bool
location
Sensor coordinates.
Type Vector
location_accuracy
Sensor location accuracy.
Type Vector
rotation
Sensor rotation angles.
Type Vector
rotation_accuracy
Sensor rotation accuracy.
Type Vector
class Sensor.Type
Sensor type in [Frame, Fisheye, Spherical]
Sensor.antenna
GPS antenna correction.
Type Antenna
Sensor.bands
List of color bands.
Type list of string
Sensor.black_level
Black level for each band.
Type list of float
Sensor.calibrateFiducials(resolution=0.014)
Fit fiducial coordinates to image measurements.
Parameters resolution (float) – Scanning resolution in mm/pix.
Sensor.calibration
Adjusted calibration of the photo.
Type Calibration
Sensor.chunk
Chunk the sensor belongs to.
Type Chunk
Sensor.data_type
Data type used to store color values.
Type DataType
Sensor.fiducials
Fiducial marks.
Type list of Marker
Sensor.film_camera
Film camera flag.
Type bool
Sensor.fixed
Fix calibration flag.
Type bool
Sensor.fixed_calibration
Fix calibration flag.
Type bool
Sensor.fixed_location
Fix location flag.
Type bool
Sensor.fixed_params
List of fixed calibration parameters.
Type list of string
Sensor.fixed_rotation
Fix rotation flag.
Type bool
Sensor.focal_length
Focal length in mm.
Type float
Sensor.height
Image height.
Type int
Sensor.key
Sensor identifier.
Type int
Sensor.label
Sensor label.
Type string
Sensor.layer_index
Sensor layer index.
Type int
Sensor.location
Sensor plane location.
77
Metashape Python Reference, Release 1.5.2
Type Vector
Sensor.location_covariance
Sensor plane location covariance.
Type Matrix
Sensor.master
Master sensor.
Type Sensor
Sensor.normalize_sensitivity
Enable sensitivity normalization.
Type bool
Sensor.normalize_to_float
Convert pixel values to floating point after normalization.
Type bool
Sensor.photo_params
List of photo-invariant calibration parameters.
Type list of string
Sensor.pixel_height
Pixel height in mm.
Type float
Sensor.pixel_size
Pixel size in mm.
Type Vector
Sensor.pixel_width
Pixel width in mm.
Type float
Sensor.planes
Sensor planes.
Type list of Sensor
Sensor.reference
Sensor reference data.
Type SensorReference
Sensor.rolling_shutter
Enable rolling shutter compensation.
Type bool
Sensor.rotation
Sensor plane rotation.
Type Matrix
Sensor.rotation_covariance
Sensor plane rotation covariance.
Type Matrix
Sensor.sensitivity
Sensitivity for each band.
Type list of float
Sensor.type
Sensor projection model.
Type Sensor.Type
Sensor.user_calib
Custom calibration used as initial calibration during photo alignment.
Type Calibration
Sensor.vignetting
Vignetting for each band.
Type list of Vignetting
Sensor.width
Image width.
Type int
class Metashape.Shape
Shape data.
class BoundaryType
Shape boundary type in [NoBoundary, OuterBoundary, InnerBoundary]
class Shape.Type
Shape type in [Point, Polyline, Polygon]
class Shape.Vertices
Collection of shape vertices
Shape.area()
Return area of the shape on DEM.
Returns Shape area.
Return type float
Shape.attributes
Shape attributes.
Type MetaData
Shape.boundary_type
Shape boundary type.
Type Shape.BoundaryType
Shape.group
Shape group.
Type ShapeGroup
Shape.has_z
Z enable flag.
Type bool
Shape.key
Shape identifier.
79
Metashape Python Reference, Release 1.5.2
Type int
Shape.label
Shape label.
Type string
Shape.perimeter2D()
Return perimeter of the shape on DEM.
Returns Shape perimeter.
Return type float
Shape.perimeter3D()
Return perimeter of the shape.
Returns Shape perimeter.
Return type float
Shape.selected
Selects/deselects the shape.
Type bool
Shape.type
Shape type.
Type Shape.Type
Shape.vertex_ids
List of shape vertex ids.
Type ShapeVertices
Shape.vertices
List of shape vertices.
Type ShapeVertices
Shape.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 3 int
enabled
Enable flag.
Type bool
key
Shape group identifier.
Type int
label
Shape group label.
Type string
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.
Returns Created shape.
Return type Shape
crs
Shapes coordinate system.
Type CoordinateSystem
groups
List of shape groups.
Type list of ShapeGroup
items()
List of items.
meta
Shapes meta data.
Type MetaData
modified
Modified flag.
Type bool
projection
Shapes projection.
Type OrthoProjection
remove(items)
Remove items from the shape layer.
Parameters items (list of Shape or ShapeGroup) – A list of items to be removed.
81
Metashape Python Reference, Release 1.5.2
shapes
List of shapes.
Type list of Shape
updateAltitudes(items[, progress ])
Update altitudes for items.
Parameters
• items (list of Shape or ShapeGroup) – A list of items to be updated.
• progress (Callable[[float], None]) – Progress callback.
class Metashape.ShapesFormat
Shapes format in [ShapesFormatNone, ShapesFormatSHP, ShapesFormatKML, ShapesFormatDXF]
class Metashape.Shutter
Shutter object contains estimated parameters of the rolling shutter correction model.
rotation
Rotation matrix of the rolling shutter model.
Type Matrix
translation
Translation vector of the rolling shutter model.
Type Vector
class Metashape.SurfaceType
Surface type in [Arbitrary, HeightField]
class Metashape.Target
Target parameters
code
Target code.
Type int
coord
Target location.
Type Vector
radius
Target radius.
Type float
class Metashape.TargetType
Target type in [CircularTarget12bit, CircularTarget14bit, CircularTarget16bit, CircularTarget20bit, CircularTar-
get, CrossTarget]
class Metashape.Tasks
Task classes.
class AddFrames
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.
83
Metashape Python Reference, Release 1.5.2
class Tasks.AddPhotos
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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
filegroups
List of file groups.
Type list of int
filenames
List of files to add.
Type list of string
group
Camera group key.
Type int
layout
Image layout.
Type ImageLayout
load_reference
Load reference coordinates.
Type bool
load_xmp_accuracy
Load accuracy from XMP meta data.
Type bool
load_xmp_antenna
Load GPS/INS offset from XMP meta data.
Type bool
load_xmp_calibration
Load calibration from XMP meta data.
Type bool
load_xmp_orientation
Load orientation from XMP meta data.
Type bool
name
Task name.
Type string
strip_extensions
Strip file extensions from camera labels.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
network_distribute
Enable distributed processing.
Type bool
reset_alignment
Reset current alignment.
Type bool
supports_gpu
GPU support flag.
Type bool
85
Metashape Python Reference, Release 1.5.2
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
class Tasks.AlignChunks
Task class containing processing parameters.
align_method
Alignment method.
Type int
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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
fit_scale
Fit chunk scale during alignment.
Type bool
markers
List of markers to be used for marker based alignment.
Type list of int
match_downscale
Alignment accuracy.
Type int
match_filter_mask
Filter points by mask.
Type bool
match_mask_tiepoints
Apply mask filter to tie points.
Type bool
match_point_limit
Maximum number of points for each photo.
Type int
match_select_pairs
Enables image pair preselection.
Type bool
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
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
87
Metashape Python Reference, Release 1.5.2
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
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
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
network_distribute
Enable distributed processing.
Type bool
projection
Output projection.
Type OrthoProjection
89
Metashape Python Reference, Release 1.5.2
region
Region to be exported in the (x0, y0, x1, y1) format.
Type list of 4 floats
resolution
Output resolution in meters.
Type float
source_data
Selects between dense point cloud and sparse point cloud.
Type DataSource
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
workitem_size_tiles
Number of tiles in a workitem.
Type int
class Tasks.BuildDenseCloud
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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
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
network_distribute
Enable distributed processing.
Type bool
point_colors
Enable point colors calculation.
Type bool
store_depth
Enable store depth maps option.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
workitem_size_cameras
Number of cameras in a workitem.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
91
Metashape Python Reference, Release 1.5.2
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
network_distribute
Enable distributed processing.
Type bool
reuse_depth
Enable reuse depth maps option.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
workitem_size_cameras
Number of cameras in a workitem.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
name
Task name.
Type string
source_data
Selects between dense point cloud, sparse point cloud and depth maps.
Type DataSource
store_depth
Enable store depth maps option.
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
trimming_radius
Trimming radius (no trimming if zero).
Type int
vertex_colors
Enable vertex colors calculation.
Type bool
volumetric_masks
Enable strict volumetric masking.
Type bool
workitem_count
Work item count.
Type int
class Tasks.BuildOrthomosaic
Task class containing processing parameters.
93
Metashape Python Reference, Release 1.5.2
Type OrthoProjection
refine_seamlines
Refine seamlines based on image content.
Type bool
region
Region to be exported in the (x0, y0, x1, y1) format.
Type list of 4 floats
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
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
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 Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
95
Metashape Python Reference, Release 1.5.2
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
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
texture_size
Texture size.
Type int
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
max_workgroup_size
Maximum workgroup size.
Type int
name
Task name.
Type string
network_distribute
Enable distributed processing.
Type bool
97
Metashape Python Reference, Release 1.5.2
pixel_size
Target model resolution in meters.
Type float
source_data
Selects between dense point cloud and mesh.
Type DataSource
store_depth
Enable store depth maps option.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
tile_size
Size of tiles in pixels.
Type int
workitem_count
Work item count.
Type int
workitem_size_cameras
Number of cameras in a workitem.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
texture_count
Texture count.
Type int
workitem_count
Work item count.
Type int
class Tasks.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.
calibrate_color_balance
Turn on color balance compensation.
Type bool
cameras
List of cameras to process.
Type list of int
data_source
Source data for calibration.
Type DataSource
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
99
Metashape Python Reference, Release 1.5.2
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
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
fit_p3
Enable optimization of p3 tangential distortion coefficient.
Type bool
fit_p4
Enable optimization of p4 tangential distortion coefficient.
Type bool
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
101
Metashape Python Reference, Release 1.5.2
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
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 Tasks.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
cls_from
Class of points to be re-classified.
Type int
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
class Tasks.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.
cls_from
Class of points to be re-classified.
Type int
cls_to
Target point classes for classification.
Type list of int
confidence
Required confidence level
Type float
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
network_distribute
Enable distributed processing.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
103
Metashape Python Reference, Release 1.5.2
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
workitem_count
Work item count.
105
Metashape Python Reference, Release 1.5.2
Type int
class Tasks.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.
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
target_face_count
Target face count.
Type int
workitem_count
Work item count.
Type int
class Tasks.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.
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
107
Metashape Python Reference, Release 1.5.2
minimum_dist
Minimum distance between targets in pixels (CrossTarget type only).
Type int
minimum_size
Minimum target radius in pixels to be detected (CrossTarget type only).
Type int
name
Task name.
Type 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
tolerance
Detector tolerance (0 - 100).
Type int
workitem_count
Work item count.
Type int
class Tasks.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_cloud
Copy dense cloud.
Type bool
copy_depth_maps
Copy depth maps.
Type bool
copy_elevation
Copy DEM.
Type bool
copy_keypoints
Copy keypoints.
Type bool
copy_model
Copy model.
Type bool
copy_orthomosaic
Copy orthomosaic.
Type bool
copy_tiled_model
Copy tiled model.
Type bool
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
workitem_count
Work item count.
Type int
class Tasks.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.
109
Metashape Python Reference, Release 1.5.2
binary
Enables/disables binary encoding for selected format (if applicable).
Type bool
bingo_export_geoin
Enables/disables export of BINGO GEO INPUT file.
Type bool
bingo_export_gps
Enables/disables export of BINGO GPS/IMU data.
Type bool
bingo_export_image
Enables/disables export of BINGO IMAGE COORDINATE file.
Type bool
bingo_export_itera
Enables/disables export of BINGO ITERA file.
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
bundler_export_list
Enables/disables export of Bundler image list file.
Type bool
bundler_path_list
Path to Bundler image list file.
Type string
chan_order_rotate
Rotation order (CHAN format only).
Type RotationOrder
coordinates
Output coordinate system.
Type CoordinateSystem
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
export_markers
Enables/disables export of manual matching points.
Type bool
export_points
Enables/disables export of automatic tie points.
Type bool
format
Export format.
Type CamerasFormat
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
use_labels
Enables/disables label based item identifiers.
Type bool
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
111
Metashape Python Reference, Release 1.5.2
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
workitem_count
Work item count.
Type int
class Tasks.ExportMarkers
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
coordinates
Output coordinate system.
Type CoordinateSystem
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
workitem_count
Work item count.
Type int
class Tasks.ExportMasks
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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
113
Metashape Python Reference, Release 1.5.2
path
Path to output file.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
class Tasks.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
colors_rgb_8bit
Convert colors to 8 bit RGB.
Type bool
comment
Optional comment (if supported by selected format).
Type string
coordinates
Output coordinate system.
Type CoordinateSystem
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
export_alpha
Enables/disables alpha channel export.
Type bool
export_cameras
Enables/disables camera export.
Type bool
export_colors
Enables/disables export of vertex colors.
Type bool
export_comment
Enables/disables comment export.
Type bool
export_markers
Enables/disables marker export.
Type bool
export_normals
Enables/disables export of vertex normals.
Type bool
export_texture
Enables/disables texture export.
Type bool
export_udim
Enables/disables UDIM texture layout.
Type bool
export_uv
Enables/disables uv coordinates export.
Type bool
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
shift
Optional shift to be applied to vertex coordinates.
Type 3-element vector
strip_camera_ext
Strips camera label extensions during export.
Type bool
supports_gpu
GPU support flag.
Type bool
115
Metashape Python Reference, Release 1.5.2
target
Task target.
Type Tasks.TargetType
texture_format
Texture format.
Type ImageFormat
viewpoint
Default view.
Type Viewpoint
workitem_count
Work item count.
Type int
class Tasks.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.
cameras
List of cameras to process.
Type list of int
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
jpeg_quality
JPEG quality.
Type int
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 in the (x0, y0, x1, y1) format.
Type list of 4 floats
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
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
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
workitem_count
Work item count.
Type int
write_alpha
Enable alpha channel generation.
Type bool
write_kml
Enable kml file generation.
Type bool
write_world
Enable world file generation.
Type bool
117
Metashape Python Reference, Release 1.5.2
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
name
Task name.
Type string
path
Path to output file.
Type string
region
Region to be exported in the (x0, y0, x1, y1) format.
Type list of 4 floats
rotation
Panorama 3x3 orientation matrix.
Type Matrix
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
width
Width of output panorama.
Type int
workitem_count
Work item count.
Type int
class Tasks.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
classes
List of dense point classes to be exported.
Type list of int
colors_rgb_8bit
Convert colors to 8 bit RGB.
Type bool
comment
Optional comment (if supported by selected format).
Type string
coordinates
Output coordinate system.
Type CoordinateSystem
data_source
Selects between dense point cloud and sparse point cloud. If not specified, uses dense cloud if avail-
able.
Type DataSource
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
export_colors
Enables/disables export of point colors.
Type bool
export_comment
Enable comment export.
Type bool
export_images
Enable image export.
Type bool
export_normals
Enables/disables export of point normals.
119
Metashape Python Reference, Release 1.5.2
Type bool
format
Export format.
Type PointsFormat
image_format
Image data format.
Type ImageFormat
name
Task name.
Type string
path
Path to output file.
Type string
precision
Number of digits after the decimal point (for text formats).
Type int
raster_transform
Raster band transformation.
Type RasterTransformType
shift
Optional shift to be applied to vertex coordinates.
Type 3-element vector
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
tile_height
Tile height in meters.
Type float
tile_width
Tile width in meters.
Type float
viewpoint
Default view.
Type Viewpoint
workitem_count
Work item count.
Type int
write_tiles
Enable tiled export.
Type bool
class Tasks.ExportRaster
Task class containing processing parameters.
121
Metashape Python Reference, Release 1.5.2
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 in the (x0, y0, x1, y1) format.
Type list of 4 floats
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
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
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
tile_height
Specifies block height of the orthomosaic in pixels.
Type int
tile_width
Specifies block width of the orthomosaic in pixels.
Type int
title
Export title.
Type string
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
write_alpha
Enable alpha channel generation.
Type bool
write_kml
Enable kml file generation.
Type bool
write_scheme
Enable tile scheme files generation.
Type bool
write_tiles
Enable tiled export.
Type bool
write_world
Enable world file generation.
Type bool
xyz_level_max
Maximum zoom level (Google Map Tiles, MBTiles and World Wind Tiles formats only).
Type int
xyz_level_min
Minimum zoom level (Google Map Tiles, MBTiles and World Wind Tiles formats only).
Type int
class Tasks.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
accuracy, a/b/c - rotation angles, A/B/C - rotation angle accuracy, u/v/w - estimated coordinates,
123
Metashape Python Reference, Release 1.5.2
U/V/W - coordinate errors, d/e/f - estimated orientation angles, D/E/F - orientation errors, [] - group
of multiple values, | - column separator within group).
Type string
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
class Tasks.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.
• progress (Callable[[float], None]) – Progress callback.
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
description
Report description.
Type string
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
name
Task name.
Type string
page_numbers
Enable page numbers.
Type bool
path
Path to output report.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
title
Report title.
Type string
workitem_count
Work item count.
Type int
class Tasks.ExportShapes
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.
coordinates
Output coordinate system.
Type CoordinateSystem
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
125
Metashape Python Reference, Release 1.5.2
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
export_attributes
Export attributes.
Type bool
export_labels
Export labels.
Type bool
export_points
Export points.
Type bool
export_polygons
Export polygons.
Type bool
export_polylines
Export polylines.
Type bool
format
Export format.
Type ShapesFormat
groups
A list of shape groups to export.
Type list of int
name
Task name.
Type string
path
Path to shape file.
Type string
polygons_as_polylines
Save polygons as polylines.
Type bool
shift
Optional shift to be applied to vertex coordinates.
Type 3-element vector
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
workitem_count
Work item count.
Type int
write_alpha
Enable alpha channel export.
Type bool
class Tasks.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.
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
127
Metashape Python Reference, Release 1.5.2
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
format
Export format.
Type TiledModelFormat
mesh_format
Mesh 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
workitem_count
Work item count.
Type int
class Tasks.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.
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
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
workitem_count
Work item count.
Type int
class Tasks.ImportDem
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.
coordinates
Default coordinate system if not specified in GeoTIFF file.
Type CoordinateSystem
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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 elevation model in GeoTIFF format.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
129
Metashape Python Reference, Release 1.5.2
Type Tasks.TargetType
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
workitem_count
Work item count.
Type int
class Tasks.ImportMasks
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
Optional list of cameras to be processed.
Type list of int
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
method
Mask source.
Type MaskSource
name
Task name.
Type string
operation
Mask operation.
Type MaskOperation
path
Mask file name template.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
tolerance
Background masking tolerance.
Type int
workitem_count
Work item count.
Type int
class Tasks.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.
coordinates
Model coordinate system.
Type CoordinateSystem
decode(dict)
Initializaes task parameters with a dictionary.
131
Metashape Python Reference, Release 1.5.2
decodeJSON(json)
Initializaes task parameters from a JSON string.
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
shift
Optional shift to be applied to vertex coordinates.
Type 3-element vector
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
class Tasks.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.
coordinates
Point cloud coordinate system.
Type CoordinateSystem
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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 3-element vector
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
class Tasks.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
coordinates
Reference data coordinate system (csv format only).
Type CoordinateSystem
create_markers
Create markers for missing entries (csv format only).
Type bool
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
delimiter
Column delimiter in csv format.
Type string
133
Metashape Python Reference, Release 1.5.2
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
workitem_count
Work item count.
Type int
class Tasks.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.
135
Metashape Python Reference, Release 1.5.2
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
workitem_count
Work item count.
Type int
class Tasks.LoadProject
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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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 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
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
keypoint_limit
Key point limit.
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
137
Metashape Python Reference, Release 1.5.2
network_distribute
Enable distributed processing.
Type bool
pairs
User defined list of camera pairs to match.
Type list of int
preselection_generic
Enable generic preselection.
Type bool
preselection_reference
Enable reference preselection.
Type bool
reset_matches
Reset current matches.
Type bool
store_keypoints
Store keypoints in the project.
Type bool
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
tiepoint_limit
Tie point limit.
Type int
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 Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
139
Metashape Python Reference, Release 1.5.2
merge_markers
Merge markers.
Type bool
merge_models
Merge models.
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
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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_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
fit_p3
Enable optimization of p3 tangential distortion coefficient.
Type bool
fit_p4
Enable optimization of p4 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
141
Metashape Python Reference, Release 1.5.2
workitem_count
Work item count.
Type int
class Tasks.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.
capture_distance
Image capture distance (m).
Type float
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
max_cameras
Maximum cameras to use.
Type int
max_waypoints
Maximum waypoints per flight.
Type int
min_altitude
Minimum altitude (m).
Type float
min_waypoint_spacing
Minimum waypoint spacing (m).
Type float
name
Task name.
Type string
overlap
Overlap level.
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
use_cameras
Complete current survey.
Type bool
use_selection
Focus on model selection.
Type bool
workitem_count
Work item count.
Type int
class Tasks.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.
capture_distance
Image capture distance (m).
Type float
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
max_cameras
Maximum cameras to use.
Type int
name
Task name.
Type string
overlap
Overlap level.
Type int
supports_gpu
GPU support flag.
Type bool
143
Metashape Python Reference, Release 1.5.2
target
Task target.
Type Tasks.TargetType
use_selection
Focus on model selection.
Type bool
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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.
name
Task name.
Type string
niterations
Number of refinement iterations.
Type int
smoothness
Smoothing strength. Should be in range [0, 1].
Type float
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
workitem_count
Work item count.
Type int
145
Metashape Python Reference, Release 1.5.2
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
workitem_count
Work item count.
Type int
class Tasks.SaveProject
Task class containing processing parameters.
absolute_paths
Store absolute image paths.
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.
chunks
List of chunks to be saved.
Type list of int
compression
Project compression level.
Type int
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
147
Metashape Python Reference, Release 1.5.2
encodeJSON()
Create a JSON string with task parameters.
name
Task name.
Type string
path
Path to project.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
version
Project version to save.
Type string
workitem_count
Work item count.
Type int
class Tasks.SmoothModel
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_selected
Apply to selected faces.
Type bool
decode(dict)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
fix_borders
Fix borders.
Type bool
name
Task name.
Type string
strength
Smoothing strength.
Type float
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
workitem_count
Work item count.
Type int
class Tasks.TargetType
Task target type in [DocumentTarget, ChunkTarget, FrameTarget]
class Tasks.TrackMarkers
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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes task parameters from a JSON string.
encode()
Create a dictionary with task parameters.
encodeJSON()
Create a JSON string with task parameters.
frame_end
Ending frame index.
Type int
frame_start
Starting frame index.
Type int
name
Task name.
Type string
supports_gpu
GPU support flag.
Type bool
target
Task target.
Type Tasks.TargetType
149
Metashape Python Reference, Release 1.5.2
workitem_count
Work item count.
Type int
class Tasks.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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
workitem_count
Work item count.
Type int
class Tasks.UndistortPhotos
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)
Initializaes task parameters with a dictionary.
decodeJSON(json)
Initializaes 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
jpeg_quality
JPEG quality.
Type int
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
tiff_compression
Tiff compression.
Type int
update_gps_tags
Update GPS tags.
Type bool
workitem_count
Work item count.
Type int
Tasks.createTask(name)
Create task object by its name.
Parameters name (string) – Task name.
Returns Task object.
151
Metashape Python Reference, Release 1.5.2
clear()
Clears tiled model data.
copy()
Create a copy of the tiled model.
Returns Copy of the tiled model.
Return type TiledModel
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)
Returns ray intersection with the tiled model.
Parameters
• origin (Vector) – Ray origin.
• target (Vector) – Point on the ray.
Returns Coordinates of the intersection point.
Return type Vector
class Metashape.TiledModelFormat
Tiled model format in [TiledModelFormatNone, TiledModelFormatTLS, TiledModelFormatLOD, TiledMod-
elFormatZIP, TiledModelFormatCesium, TiledModelFormatSLPK, TiledModelFormatOSGB]
class Metashape.Utils
Utility functions.
createChessboardImage(calib, cell_size=150, max_tilt=30)
Synthesizes photo of a chessboard.
Parameters
• calib (Calibration) – Camera calibration.
• cell_size (float) – Chessboard cell size.
• max_tilt (float) – Maximum camera tilt in degrees.
Returns Resulting image.
153
Metashape Python Reference, Release 1.5.2
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
155
Metashape Python Reference, Release 1.5.2
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
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
fov
Camera vertical field of view in degrees.
Type float
height
OpenGL window height.
Type int
mag
Camera magnification defined by distance to the center of rotation.
Type float
rot
Camera rotation matrix.
Type Matrix
width
OpenGL window width.
Type int
class Metashape.Vignetting
Vignetting polynomial
157
Metashape Python Reference, Release 1.5.2
THREE
159
Metashape Python Reference, Release 1.5.2
m
Metashape, 5
177