Professional Documents
Culture Documents
Photoscan Python Api 1 4 0 PDF
Photoscan Python Api 1 4 0 PDF
Release 1.4.0
Agisoft LLC
1 Overview 3
2 Application Modules 5
i
ii
PhotoScan Python Reference, Release 1.4.0
CONTENTS 1
PhotoScan Python Reference, Release 1.4.0
2 CONTENTS
CHAPTER
ONE
OVERVIEW
This API is in development and will be extended in the future PhotoScan releases.
3
PhotoScan Python Reference, Release 1.4.0
4 Chapter 1. Overview
CHAPTER
TWO
APPLICATION MODULES
PhotoScan 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 PhotoScan project. Multiple Document
instances can be created simultaneously if needed. Besides that a currently opened project in the application can be
accessed using PhotoScan.app.document property.
The following example performs main processing steps on existing project and saves back the results:
>>> chunk.alignCameras()
>>> chunk.buildDepthMaps(quality=PhotoScan.MediumQuality, filter=PhotoScan.
˓→AggressiveFiltering)
>>> chunk.buildDenseCloud()
>>> chunk.buildModel(surface=PhotoScan.Arbitrary, interpolation=PhotoScan.
˓→EnabledInterpolation)
>>> chunk.buildUV(mapping=PhotoScan.GenericMapping)
>>> chunk.buildTexture(blending=PhotoScan.MosaicBlending, size=4096)
>>> doc.save()
class PhotoScan.Accuracy
Alignment accuracy in [HighestAccuracy, HighAccuracy, MediumAccuracy, LowAccuracy, LowestAccuracy]
class PhotoScan.Animation
Camera animation.
class Point
Camera orientation at specified time moment
location
Camera position vector.
Type Vector
rotation
Camera rotation quaternion.
Type Vector
time
Time.
Type float
5
PhotoScan Python Reference, Release 1.4.0
class Animation.Track
Camera animation track
Animation.field_of_view
Vertical field of view in degrees.
Type float
Animation.label
Animation label.
Type string
Animation.speed
Animation speedup factor.
Type float
Animation.track
Camera track.
Type Animation.Track
class PhotoScan.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
location_ref
Antenna location reference.
Type Vector
rotation
Antenna rotation angles.
Type Vector
rotation_acc
Antenna rotation accuracy.
Type Vector
rotation_ref
Antenna rotation reference.
Type Vector
class PhotoScan.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 PhotoScan.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.
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
PhotoScan activation status.
Type bool
Application.addMenuItem(label, func[, shortcut ][, icon ])
Create a new menu entry.
Parameters
7
PhotoScan Python Reference, Release 1.4.0
Application.enumGPUDevices()
Enumerate installed GPU devices.
Returns A list of devices.
Return type list
Application.getBool(label=’‘)
Prompt user for the boolean value.
Parameters label (string) – Optional text label for the dialog.
Returns Boolean value selected by the user.
Return type bool
Application.getCoordinateSystem([label ][, value ])
Prompt user for coordinate system.
Parameters
• label (string) – Optional text label for the dialog.
• value (CoordinateSystem) – Default value.
Returns Selected coordinate system. If the dialog was cancelled, None is returned.
Return type CoordinateSystem
Application.getExistingDirectory([hint ])
Prompt user for the existing folder.
Parameters hint (string) – Optional text label for the dialog.
Returns Path to the folder selected. If the input was cancelled, empty string is returned.
Return type string
Application.getFloat(label=’‘, value=0)
Prompt user for the floating point value.
Parameters
• label (string) – Optional text label for the dialog.
• value (float) – Default value.
Returns Floating point value entered by the user.
Return type float
Application.getInt(label=’‘, value=0)
Prompt user for the integer value.
Parameters
• label (string) – Optional text label for the dialog.
• value (int) – Default value.
Returns Integer value entered by the user.
Return type int
Application.getOpenFileName([hint ][, filter ])
Prompt user for the existing file.
Parameters
9
PhotoScan Python Reference, Release 1.4.0
Application.settings
Application settings.
Type Settings
Application.update()
Update user interface during long operations.
Application.version
PhotoScan version.
Type string
Application.viewpoint
Viewpoint in the model view.
Type Viewpoint
class PhotoScan.BlendingMode
Blending mode in [AverageBlending, MosaicBlending, MinBlending, MaxBlending, DisabledBlending]
class PhotoScan.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
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.
Return type Vector
f
Focal length.
Type float
height
Image height.
Type int
11
PhotoScan Python Reference, Release 1.4.0
k1
Radial distortion coefficient K1.
Type float
k2
Radial distortion coefficient K2.
Type float
k3
Radial distortion coefficient K3.
Type float
k4
Radial distortion coefficient K4.
Type float
load(path, format=’xml’)
Loads calibration from file.
Parameters
• path (string) – path to calibration file
• format (string) – Calibration format in [’xml’, ‘australis’, ‘photomodeler’, ‘calib-
cam’, ‘calcam’, ‘inpho’, ‘usgs’].
Returns success of operation
Return type bool
p1
Tangential distortion coefficient P1.
Type float
p2
Tangential distortion coefficiant P2.
Type float
p3
Tangential distortion coefficient P3.
Type float
p4
Tangential distortion coefficiant P4.
Type float
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
class Reference
Camera reference data.
accuracy
Camera location accuracy.
Type Vector
enabled
Enabled flag.
Type bool
13
PhotoScan Python Reference, Release 1.4.0
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
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.
Return type Vector
Camera.frames
Camera frames.
Type list of Camera
Camera.group
Camera group.
Type CameraGroup
Camera.key
Camera identifier.
Type int
Camera.label
Camera label.
Type string
Camera.layer_index
Camera layer index.
Type int
Camera.mask
Camera mask.
Type Mask
Camera.master
Master camera.
Type Camera
Camera.meta
Camera meta data.
Type MetaData
Camera.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.
Camera.orientation
Image orientation (1 - normal, 6 - 90 degree, 3 - 180 degree, 8 - 270 degree).
Type int
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.selected
Selects/deselects the photo.
Type bool
Camera.sensor
Camera sensor.
Type Sensor
Camera.shutter
Camera shutter.
15
PhotoScan Python Reference, Release 1.4.0
Type Shutter
Camera.thumbnail
Camera thumbnail.
Type Thumbnail
Camera.transform
4x4 matrix describing photo location in the chunk coordinate system.
Type Matrix
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 PhotoScan.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 PhotoScan.CamerasFormat
Camera orientation format in [CamerasFormatXML, CamerasFormatCHAN, CamerasFormatBoujou, Cam-
erasFormatBundler, CamerasFormatOPK, CamerasFormatPATB, CamerasFormatBINGO, CamerasForma-
tORIMA, CamerasFormatAeroSys, CamerasFormatInpho, CamerasFormatSummit, CamerasFormatBlocksEx-
change, CamerasFormatRZML, CamerasFormatVisionMap]
class PhotoScan.Chunk
A Chunk object:
•provides access to all chunk components (sensors, cameras, camera groups, markers, scale bars)
•contains data inherent to individual frames (point cloud, model, etc)
•implements processing methods (matchPhotos, alignCameras, buildDenseCloud, buildModel, etc)
•provides access to other chunk attributes (transformation matrix, coordinate system, meta-data, etc..)
New components can be created using corresponding addXXX methods (addSensor, addCamera, addCamera-
Group, addMarker, addScalebar, addFrame). Removal of components is supported by a single remove method,
which can accept lists of various component types.
In case of multi-frame chunks the Chunk object contains an additional reference to the particular chunk frame,
initialized to the current frame by default. Various methods that work on a per frame basis (matchPhotos,
buildModel, etc) are applied to this particular frame. A frames attribute can be used to obtain a list of Chunk
objects that reference all available frames.
The following example performs image matching and alignment for the active chunk:
addCamera([sensor ])
Add new camera to the chunk.
Parameters sensor (Sensor) – Sensor to be assigned to this camera.
Returns Created camera.
Return type Camera
addCameraGroup()
Add new camera group to the chunk.
Returns Created camera group.
Return type CameraGroup
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.
17
PhotoScan Python Reference, Release 1.4.0
Parameters
• chunk (PhotoScan.Chunk) – Chunk to copy frames from.
• frames (list of Frame) – Optional list of frames to be copied.
• items (list of PhotoScan.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 (PhotoScan.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 ][, progress ])
Add a list of photos to the chunk.
Parameters
• filenames (list of string) – A list of file paths.
• layout (PhotoScan.ImageLayout) – Image layout in the chunk.
• progress (Callable[[float], None]) – Progress callback.
addScalebar(point1, point2)
Add new scale bar to the chunk.
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=True[, 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.
animation
Camera animation.
Type Animation
buildContours(source_data=ElevationData, interval=1[, min_value ][, max_value ][, progress ])
Build contours for the chunk.
Parameters
• source_data (PhotoScan.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 ][, progress ])
Build elevation model for the chunk.
Parameters
• source (PhotoScan.DataSource) – Selects between dense point cloud and sparse
point cloud. If not specified, uses dense cloud if available.
• interpolation (PhotoScan.Interpolation) – Interpolation mode.
• projection (Matrix or CoordinateSystem) – Sets output projection.
• region (tuple of 4 floats) – Region to be exported in the (x0, y0, x1, y1) for-
mat.
19
PhotoScan Python Reference, Release 1.4.0
21
PhotoScan Python Reference, Release 1.4.0
23
PhotoScan Python Reference, Release 1.4.0
elevations
List of elevation models for the current frame.
Type list of Elevation
enabled
Enables/disables the chunk.
Type bool
estimateImageQuality([cameras ][, progress ])
Estimate image quality.
Parameters
• cameras (list of Camera) – Optional list of cameras to be processed.
• 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 (PhotoScan.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 (PhotoScan.RotationOrder) – Rotation order (CHAN for-
mat only)
• progress (Callable[[float], None]) – Progress callback.
exportDem(path[, format ][, image_format ], raster_transform=RasterTransformNone[, projection
][, region ][, dx ][, dy ][, blockw ][, blockh ], nodata=-32767, write_kml=False,
write_world=False, write_scheme=False, tiff_big=False, 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 (PhotoScan.RasterFormat) – Export format.
• image_format (PhotoScan.ImageFormat) – Tile format.
• raster_transform (PhotoScan.RasterTransformType) – Raster transfor-
mation. Can be RasterTransformNone or RasterTransformPalette.
• projection (CoordinateSystem) – Output coordinate system.
• region (tuple of 4 floats) – Region to be exported in the (x0, y0, x1, y1) for-
mat.
• dx (float) – Pixel size in the X dimension in projected units.
• dy (float) – Pixel size in the Y dimension in projected units.
• blockw (int) – Specifies block width of the DEM mosaic in pixels.
• blockh (int) – Specifies block height of the DEM mosaic in pixels.
• nodata (float) – No-data value.
• write_kml (bool) – Enables/disables kml file generation.
• write_world (bool) – Enables/disables world file generation.
• write_scheme (bool) – Enables/disables tile scheme files generation.
• tiff_big (bool) – Enables/disables BigTIFF compression for TIFF files.
• tiff_overviews (bool) – Enables/disables image pyramid deneration for TIFF files.
• network_links (bool) – Enables/disables network links generation for KMZ format.
• min_zoom_level (int) – Minimum zoom level (Google Map Tiles, MBTiles and
World Wind Tiles formats only).
• max_zoom_level (int) – Maximum zoom level (Google Map Tiles, MBTiles and
World Wind Tiles formats only).
• progress (Callable[[float], None]) – Progress callback.
exportMarkers(path[, projection ])
Export markers.
Parameters
• path (string) – Path to output file.
• projection (CoordinateSystem) – Output coordinate system.
exportModel(path, binary=True, precision=6, texture_format=ImageFormatJPEG, texture=True,
normals=True, colors=True, cameras=True, markers=True, udim=False,
strip_extensions=False, raster_transform=RasterTransformNone[, comment ][,
format ][, projection ][, shift ][, progress ])
Export generated model for the chunk.
Parameters
• path (string) – Path to output model.
• binary (bool) – Enables/disables binary encoding (if supported by format).
• precision (int) – Number of digits after the decimal point (for text formats).
• texture_format (PhotoScan.ImageFormat) – Texture format.
• texture (bool) – Enables/disables texture export.
• normals (bool) – Enables/disables export of vertex normals.
• colors (bool) – Enables/disables export of vertex colors.
• cameras (bool) – Enables/disables camera export.
• markers (bool) – Enables/disables marker export.
• udim (bool) – Enables/disables UDIM texture layout.
25
PhotoScan Python Reference, Release 1.4.0
• max_zoom_level (int) – Maximum zoom level (Google Map Tiles, MBTiles and
World Wind Tiles formats only).
• white_background (bool) – Enables/disables white background.
• progress (Callable[[float], None]) – Progress callback.
exportOrthophotos(path, cameras, raster_transform=RasterTransformNone[, projection ][, re-
gion ][, dx ][, dy ], write_kml=False, write_world=False, write_alpha=True,
tiff_compression=TiffCompressionLZW, tiff_big=False, tiff_overviews=True,
jpeg_quality=90, white_background=True[, progress ])
Export orthophoto for the chunk.
Parameters
• path (string) – Path to output orthophoto.
• cameras (list of Camera) – A list of cameras. If not specified or empty, all enabled
cameras will be used.
• raster_transform (PhotoScan.RasterTransformType) – Raster band
transformation.
• projection (CoordinateSystem) – Output coordinate system.
• region (tuple of 4 floats) – Region to be exported in the (x0, y0, x1, y1) for-
mat.
• dx (float) – Pixel size in the X dimension in projected units.
• dy (float) – Pixel size in the Y dimension in projected units.
• write_kml (bool) – Enables/disables kml file generation.
• write_world (bool) – Enables/disables world file generation.
• write_alpha (bool) – Enables/disables alpha channel generation.
• tiff_compression (PhotoScan.TiffCompression) – Tiff compression.
• tiff_big (bool) – Enables/disables BigTIFF compression for TIFF files.
• tiff_overviews (bool) – Enables/disables image pyramid deneration for TIFF files.
• jpeg_quality (int) – JPEG quality.
• white_background (bool) – Enables/disables white background.
• progress (Callable[[float], None]) – Progress callback.
exportPoints(path[, source ], binary=True, precision=6, normals=True, colors=True,
raster_transform=RasterTransformNone[, comment ][, format ][, image_format
][, projection ][, shift ][, blockw ][, blockh ][, classes ][, progress ])
Export point cloud.
Parameters
• path (string) – Path to output file.
• source (PhotoScan.DataSource) – Selects between dense point cloud and sparse
point cloud. If not specified, uses dense cloud if available.
• binary (bool) – Enables/disables binary encoding for selected format (if applicable).
• precision (int) – Number of digits after the decimal point (for text formats).
• normals (bool) – Enables/disables export of point normals.
27
PhotoScan Python Reference, Release 1.4.0
29
PhotoScan Python Reference, Release 1.4.0
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.
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
31
PhotoScan Python Reference, Release 1.4.0
matchPhotos(accuracy=HighAccuracy, preselection=ReferencePreselection,
generic_preselection=True, reference_preselection=True, filter_mask=False, key-
point_limit=40000, tiepoint_limit=4000[, pairs ][, progress ])
Perform image matching for the chunk frame.
Parameters
• accuracy (PhotoScan.Accuracy) – Alignment accuracy.
• preselection (PhotoScan.Preselection) – Image pair preselection method
(obsolete).
• generic_preselection (bool) – Enables generic image pair preselection.
• reference_preselection (bool) – Enables reference image pair preselection.
• filter_mask (bool) – Filter points by mask.
• keypoint_limit (int) – Maximum number of key points to look for in each photo.
• tiepoint_limit (int) – Maximum number of tie points to generate for each photo.
• pairs (list of PhotoScan.Camera tuples) – User defined list of camera pairs to
match.
• progress (Callable[[float], None]) – Progress callback.
meta
Chunk meta data.
Type MetaData
model
Default model for the current frame.
Type Model
models
List of models for the current frame.
Type list of Model
modified
Modified flag.
Type bool
optimizeCameras(fit_f=True, fit_cx=True, fit_cy=True, fit_b1=True, fit_b2=True, fit_k1=True,
fit_k2=True, fit_k3=True, fit_k4=False, fit_p1=True, fit_p2=True, fit_p3=False,
fit_p4=False[, progress ])
Perform optimization of point cloud / camera parameters.
Parameters
• fit_f (bool) – Enables optimization of focal length coefficient.
• fit_cx (bool) – Enables optimization of X principal point coordinates.
• fit_cy (bool) – Enables optimization of Y principal point coordinates.
• fit_b1 (bool) – Enables optimization of aspect ratio.
• fit_b2 (bool) – Enables optimization of skew coefficient.
• fit_k1 (bool) – Enables optimization of k1 radial distortion coefficient.
• fit_k2 (bool) – Enables optimization of k2 radial distortion coefficient.
33
PhotoScan Python Reference, Release 1.4.0
selected
Selects/deselects the chunk.
Type bool
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
35
PhotoScan Python Reference, Release 1.4.0
authority
Authority identifier of the coordinate system.
Type string
geoccs
Base geocentric coordinate system.
Type CoordinateSystem
geogcs
Base geographic coordinate system.
Type CoordinateSystem
geoid_height
Fixed geoid height to be used instead of interpolated values.
Type float
init(crs)
Initialize projection based on specified WKT definition or authority identifier.
Parameters crs (string) – WKT definition of coordinate system or authority identifier.
listBuiltinCRS()
Returns a list of builtin coordinate systems.
localframe(point)
Returns 4x4 transformation matrix to LSE coordinates at the given point.
Parameters point (Vector) – Coordinates of the origin in the geocentric coordinates.
Returns Transformation from geocentric coordinates to local coordinates.
Return type Matrix
name
Name of the coordinate system.
Type string
proj4
Coordinate system definition in PROJ.4 format.
Type string
project(point)
Projects point from geocentric coordinates to projected geographic coordinate system.
Parameters point (Vector) – 3D point in geocentric coordinates.
Returns 3D point in projected coordinates.
Return type Vector
transform(point, source, target)
Transform point coordinates between coordinate systems.
Parameters
• point (2 or 3 component Vector) – Point coordinates.
37
PhotoScan Python Reference, Release 1.4.0
clear()
Clears dense cloud data.
compactPoints([progress ])
Permanently removes deleted points from dense cloud.
Parameters progress (Callable[[float], None]) – Progress callback.
copy()
Create a copy of the dense cloud.
Returns Copy of the dense cloud.
Return type DenseCloud
cropSelectedPoints([point_classes ][, progress ])
Crop selected points.
Parameters
• point_classes (PhotoScan.PointClass or list of
PhotoScan.PointClass) – Classes of points to be removed.
• progress (Callable[[float], None]) – Progress callback.
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 (PhotoScan.Vector) – Ray origin.
• target (PhotoScan.Vector) – Point on the ray.
Returns Coordinates of the intersection point.
Return type PhotoScan.Vector
point_count
Number of points in dense cloud.
Type int
removePoints(point_classes[, progress ])
Remove points.
Parameters
39
PhotoScan Python Reference, Release 1.4.0
41
PhotoScan Python Reference, Release 1.4.0
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, point_limit=40000[, progress ])
Align specified set of chunks.
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 (PhotoScan.Accuracy) – Alignment accuracy.
• preselection (bool) – Enables image pair preselection.
• filter_mask (bool) – Filter points by mask.
• point_limit (int) – Maximum number of points for each photo.
• 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.
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.
43
PhotoScan Python Reference, Release 1.4.0
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 PhotoScan.EulerAngles
Euler angles in [EulerAnglesYPR, EulerAnglesOPK]
class PhotoScan.FaceCount
Face count in [LowFaceCount, MediumFaceCount, HighFaceCount]
class PhotoScan.FilterMode
Depth filtering mode in [NoFiltering, MildFiltering, ModerateFiltering, AggressiveFiltering]
class PhotoScan.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.
45
PhotoScan Python Reference, Release 1.4.0
47
PhotoScan Python Reference, Release 1.4.0
class PhotoScan.Interpolation
Interpolation mode in [DisabledInterpolation, EnabledInterpolation, Extrapolated]
class PhotoScan.MappingMode
UV mapping mode in [GenericMapping, OrthophotoMapping, AdaptiveOrthophotoMapping, SphericalMap-
ping, CameraMapping]
class PhotoScan.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.
49
PhotoScan Python Reference, Release 1.4.0
class PhotoScan.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 PhotoScan.MaskOperation
Mask operation in [MaskOperationReplacement, MaskOperationUnion, MaskOperationIntersection, MaskOp-
erationDifference]
class PhotoScan.MaskSource
Mask source in [MaskSourceAlpha, MaskSourceFile, MaskSourceBackground, MaskSourceModel]
class PhotoScan.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 PhotoScan.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.
Returns 4x4 matrix representing rotation.
Return type Matrix
Scale(scale)
Create a scale matrix.
Parameters scale (Vector) – The scale vector.
Returns A matrix representing scale.
Return type Matrix
Translation(vector)
Create a translation matrix.
Parameters vector (Vector) – The translation vector.
Returns A matrix representing translation.
Return type Matrix
col(index)
Returns column of the matrix.
Returns matrix column.
Return type Vector
copy()
Returns a copy of this matrix.
Returns an instance of itself
Return type Matrix
det()
Return the determinant of a matrix.
Returns Return a the determinant of a matrix.
51
PhotoScan Python Reference, Release 1.4.0
translation()
Returns translation component of the 4x4 matrix.
Returns translation component
Return type Vector
zero()
Set all matrix elements to zero.
class PhotoScan.MetaData(object)
Collection of object properties
items()
List of items.
keys()
List of item keys.
values()
List of item values.
class PhotoScan.Model
Triangular mesh model instance
class Face
Triangular face of the model
hidden
Face visibility flag.
Type bool
selected
Face selection flag.
Type bool
tex_vertices
Texture vertex indices.
Type tuple of 3 int
vertices
Vertex indices.
Type tuple of 3 int
class Model.Faces
Collection of model faces
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
53
PhotoScan Python Reference, Release 1.4.0
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
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
Model.area()
Return area of the model surface.
55
PhotoScan Python Reference, Release 1.4.0
Model.removeComponents(size)
Remove small connected components.
Parameters size (int) – Threshold on the polygon count of the components to be removed.
Model.removeSelection()
Remove selected faces and free vertices from the mesh.
Model.renderDepth(transform, calibration)
Render model depth image for specified viewpoint.
Parameters
• transform (Matrix) – Camera location.
• calibration (Calibration) – Camera calibration.
Returns Rendered image.
Return type Image
Model.renderImage(transform, calibration)
Render model image for specified viewpoint.
Parameters
• transform (Matrix) – Camera location.
• calibration (Calibration) – Camera calibration.
Returns Rendered image.
Return type Image
Model.renderMask(transform, calibration)
Render model mask image for specified viewpoint.
Parameters
• transform (Matrix) – Camera location.
• calibration (Calibration) – Camera calibration.
Returns Rendered image.
Return type Image
Model.renderNormalMap(transform, calibration)
Render image with model normals for specified viewpoint.
Parameters
• transform (Matrix) – Camera location.
• calibration (Calibration) – Camera calibration.
Returns Rendered image.
Return type Image
Model.saveTexture(path)
Save texture to the specified file.
Parameters path (string) – Path to the image file.
Model.setTexture(image, page=0)
Initialize texture from image data.
Parameters
abortBatch(batch_id)
Abort batch.
Parameters batch_id (int) – Batch id.
abortNode(node_id)
Abort node.
57
PhotoScan Python Reference, Release 1.4.0
59
PhotoScan Python Reference, Release 1.4.0
setNodeGPUMask(node_id, gpu_mask)
Set node GPU mask.
Parameters
• node_id (int) – Node id.
• gpu_mask (int) – GPU device mask.
setNodePriority(node_id, priority)
Set node priority.
Parameters
• node_id (int) – Node id.
• priority (int) – Node priority (2 - Highest, 1 - High, 0 - Normal, -1 - Low, -2 -
Lowest).
class PhotoScan.NetworkTask
NetworkTask class contains information about network task and its parameters.
The following example creates a new processing task and submits it to the server:
chunks
List of chunks.
Type list
encode()
Create a dictionary with task parameters.
frames
List of frames.
Type list
name
Task name.
Type string
params
Task parameters.
Type dict
class PhotoScan.OrthoProjection
Orthographic projection.
crs
Base coordinate system.
Type CoordinateSystem
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.bottom
Y coordinate of the bottom side.
Type float
61
PhotoScan Python Reference, Release 1.4.0
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.height
Orthomosaic height.
Type int
Orthomosaic.key
Orthomosaic identifier.
Type int
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 PhotoScan.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
63
PhotoScan Python Reference, Release 1.4.0
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 PhotoScan.PointClass
Point class in [Created, Unclassified, Ground, LowVegetation, MediumVegetation, HighVegetation, Building,
LowPoint, ModelKeyPoint, Water, Rail, RoadSurface, OverlapPoints, WireGuard, WireConductor, Transmis-
sionTower, WireConnector, BridgeDeck, HighNoise]
class PhotoScan.PointCloud
Sparse point cloud instance
class Cameras
Collection of PointCloud.Projections objects indexed by corresponding cameras
class PointCloud.Filter
Sparse point cloud filter
The following example selects all points of the sparse cloud from the active chunk that have reprojection
error higher than defined threshold:
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
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
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
class PointCloud.Track
Track in the point cloud
65
PhotoScan Python Reference, Release 1.4.0
color
Track color.
Type tuple of 3 int
class PointCloud.Tracks
Collection of tracks in the point cloud
PointCloud.copy()
Returns a copy of the point cloud.
Returns Copy of the point cloud.
Return type PointCloud
PointCloud.cropSelectedPoints()
Crop selected points.
PointCloud.cropSelectedTracks()
Crop selected tie points.
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 (PhotoScan.Vector) – Ray origin.
• target (PhotoScan.Vector) – Point on the ray.
Returns Coordinates of the intersection point.
Return type PhotoScan.Vector
PointCloud.points
List of points.
Type PointCloudPoints
PointCloud.projections
Point projections for each photo.
Type PointCloudProjections
PointCloud.removeSelectedPoints()
Remove selected points.
PointCloud.removeSelectedTracks()
Remove selected tie points.
PointCloud.tracks
List of tracks.
Type PointCloudTracks
class PhotoScan.PointsFormat
Point cloud format in [PointsFormatNone, PointsFormatOBJ, PointsFormatPLY, PointsFormatXYZ, Points-
FormatLAS, PointsFormatExpe, PointsFormatU3D, PointsFormatPDF, PointsFormatE57, PointsFormatOC3,
PointsFormatPotree, PointsFormatLAZ, PointsFormatCL3, PointsFormatPTS, PointsFormatDXF, PointsFor-
matCesium]
class PhotoScan.Preselection
Image pair preselection in [NoPreselection, GenericPreselection, ReferencePreselection]
class PhotoScan.Quality
Dense point cloud quality in [UltraQuality, HighQuality, MediumQuality, LowQuality, LowestQuality]
class PhotoScan.RasterFormat
Raster format in [RasterFormatNone, RasterFormatTiles, RasterFormatKMZ, RasterFormatXYZ, RasterFor-
matMBTiles, RasterFormatWW]
class PhotoScan.RasterTransform
Raster transform definition.
calibrateRange()
Auto detect range based on orthomosaic histogram.
enabled
Enable flag.
Type bool
false_color
False color channels.
Type list
formula
Raster calculator expression.
Type string
interpolation
Interpolation enable flag.
Type bool
palette
Color palette.
Type dict
range
Palette mapping range.
Type tuple
reset()
Reset raster transform.
class PhotoScan.RasterTransformType
Raster transformation type in [RasterTransformNone, RasterTransformValue, RasterTransformPalette]
67
PhotoScan Python Reference, Release 1.4.0
class PhotoScan.ReferenceFormat
Reference format in [ReferenceFormatNone, ReferenceFormatXML, ReferenceFormatTEL, ReferenceFor-
matCSV, ReferenceFormatMavinci, ReferenceFormatBramor, ReferenceFormatAPM]
class PhotoScan.ReferenceItems
Reference items in [ReferenceItemsCameras, ReferenceItemsMarkers, ReferenceItemsScalebars]
class PhotoScan.Region
Region parameters
center
Region center coordinates.
Type Vector
rot
Region rotation matrix.
Type Matrix
size
Region size.
Type Vector
class PhotoScan.RotationOrder
Rotation order in [RotationOrderXYZ, RotationOrderXZY, RotationOrderYXZ, RotationOrderYZX, Rota-
tionOrderZXY, RotationOrderZYX]
class PhotoScan.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 PhotoScan.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.
Type bool
class PhotoScan.Sensor
Sensor instance
class Type
Sensor type in [Frame, Fisheye, Spherical]
Sensor.antenna
GPS antenna correction.
Type Antenna
Sensor.bands
List of image bands.
Type list of string
Sensor.black_level
Black level for each band.
Type list of float
69
PhotoScan Python Reference, Release 1.4.0
Sensor.calibration
Refined calibration of the photo.
Type Calibration
Sensor.chunk
Chunk the sensor belongs to.
Type Chunk
Sensor.fiducials
Fiducial marks.
Type list of Marker
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_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.
Type Vector
Sensor.master
Master sensor.
Type Sensor
Sensor.normalize_sensitivity
Enable sensitivity normalization.
Type bool
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.rolling_shutter
Enable rolling shutter compensation.
Type bool
Sensor.rotation
Sensor plane rotation.
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 PhotoScan.Shape
Shape data.
class BoundaryType
Shape boundary type in [NoBoundary, OuterBoundary, InnerBoundary]
71
PhotoScan Python Reference, Release 1.4.0
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.
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 PhotoScan.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 PhotoScan.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.
73
PhotoScan Python Reference, Release 1.4.0
coord
Target location.
Type Vector
radius
Target radius.
Type float
class PhotoScan.TargetType
Target type in [CircularTarget12bit, CircularTarget14bit, CircularTarget16bit, CircularTarget20bit, CircularTar-
get, CrossTarget]
class PhotoScan.Tasks
Task classes.
class AddFrames
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
chunk
Chunk to copy frames from.
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_model
Copy model.
Type bool
copy_orthomosaic
Copy orthomosaic.
Type bool
copy_tiled_model
Copy tiled model.
Type bool
encode()
Create a dictionary with task parameters.
frames
List of frame keys to copy.
Type list of int
75
PhotoScan Python Reference, Release 1.4.0
name
Task name.
Type string
class Tasks.AddPhotos
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
encode()
Create a dictionary 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 PhotoScan.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
class Tasks.AlignCameras
Task class containing processing parameters.
adaptive_fitting
Enable adaptive fitting of distortion coefficients.
Type bool
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to align.
Type list of int
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
network_distribute
Enable distributed processing.
Type bool
reset_alignment
Reset current alignment.
Type bool
class Tasks.AlignChunks
Task class containing processing parameters.
align_method
Alignment method.
Type int
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
chunks
List of chunks to be aligned.
Type list of int
encode()
Create a dictionary with task parameters.
fit_scale
Fit chunk scale during alignment.
Type bool
match_downscale
Alignment accuracy.
Type int
match_filter_mask
Filter points by mask.
77
PhotoScan Python Reference, Release 1.4.0
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
class Tasks.AnalyzePhotos
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to be analyzed.
Type list of int
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
class Tasks.BuildContours
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
encode()
Create a dictionary 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 PhotoScan.DataSource
class Tasks.BuildDem
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
classes
List of dense point classes to be used for surface extraction.
Type list of int
encode()
Create a dictionary with task parameters.
interpolation
Interpolation mode.
Type PhotoScan.Interpolation
name
Task name.
Type string
network_distribute
Enable distributed processing.
Type bool
projection
Output projection.
Type PhotoScan.OrthoProjection
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 PhotoScan.DataSource
79
PhotoScan Python Reference, Release 1.4.0
class Tasks.BuildDenseCloud
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
encode()
Create a dictionary with task parameters.
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
class Tasks.BuildDepthMaps
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type list of int
downscale
Depth map quality.
Type int
encode()
Create a dictionary with task parameters.
filter_mode
Depth map filtering mode.
Type PhotoScan.FilterMode
name
Task name.
Type string
network_distribute
Enable distributed processing.
Type bool
reuse_depth
Enable reuse depth maps option.
Type bool
class Tasks.BuildModel
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• 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
downscale
Depth map quality.
Type int
encode()
Create a dictionary with task parameters.
face_count
Target face count.
Type PhotoScan.FaceCount
face_count_custom
Custom face count.
Type int
filter_mode
Depth map filtering mode.
Type PhotoScan.FilterMode
interpolation
Interpolation mode.
Type PhotoScan.Interpolation
name
Task name.
Type string
network_distribute
Enable distributed processing.
Type bool
reuse_depth
Enable reuse depth maps option.
Type bool
source_data
Selects between dense point cloud, sparse point cloud and depth maps.
Type PhotoScan.DataSource
81
PhotoScan Python Reference, Release 1.4.0
store_depth
Enable store depth maps option.
Type bool
surface_type
Type of object to be reconstructed.
Type PhotoScan.SurfaceType
vertex_colors
Enable vertex colors calculation.
Type bool
visibility_mesh
Enable visibility consistent mesh generation method.
Type bool
volumetric_masks
Enable strict volumetric masking.
Type bool
class Tasks.BuildOrthomosaic
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
blending_mode
Orthophoto blending mode.
Type PhotoScan.BlendingMode
cull_faces
Enable back-face culling.
Type bool
encode()
Create a dictionary with task parameters.
fill_holes
Enable hole filling.
Type bool
name
Task name.
Type string
network_distribute
Enable distributed processing.
Type bool
ortho_surface
Orthorectification surface.
Type PhotoScan.DataSource
projection
Output projection.
Type PhotoScan.OrthoProjection
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
class Tasks.BuildSeamlines
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
encode()
Create a dictionary with task parameters.
epsilon
Contour simplificaion threshold.
Type float
name
Task name.
Type string
class Tasks.BuildTexture
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
blending_mode
Texture blending mode.
Type PhotoScan.BlendingMode
cameras
A list of cameras to be used for texturing.
Type list of int
encode()
Create a dictionary with task parameters.
fill_holes
Enable hole filling.
Type bool
83
PhotoScan Python Reference, Release 1.4.0
ghosting_filter
Enable ghosting filter.
Type bool
name
Task name.
Type string
texture_size
Texture size.
Type int
class Tasks.BuildTiledModel
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
classes
List of dense point classes to be used for surface extraction.
Type list of int
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
network_distribute
Enable distributed processing.
Type bool
pixel_size
Target model resolution in meters.
Type float
source_data
Selects between dense point cloud and mesh.
Type PhotoScan.DataSource
tile_size
Size of tiles in pixels.
Type int
class Tasks.BuildUV
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
camera
Camera to be used for texturing in MappingCamera mode.
Type int
encode()
Create a dictionary with task parameters.
mapping_mode
Texture mapping mode.
Type PhotoScan.MappingMode
name
Task name.
Type string
texture_count
Texture count.
Type int
class Tasks.CalibrateColors
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• 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 PhotoScan.DataSource
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
class Tasks.CalibrateLens
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
border
Border size to ignore.
Type int
85
PhotoScan Python Reference, Release 1.4.0
encode()
Create a dictionary 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
class Tasks.CalibrateReflectance
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
87
PhotoScan Python Reference, Release 1.4.0
name
Task name.
Type string
class Tasks.CompactDenseCloud
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
class Tasks.DecimateModel
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
target_face_count
Target face count.
Type int
class Tasks.DetectMarkers
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
encode()
Create a dictionary with task parameters.
frames
List of frames to process.
Type list of int
inverted
Detect markers on black background.
Type bool
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
target_type
Type of targets.
Type PhotoScan.TargetType
tolerance
Detector tolerance (0 - 100).
Type int
class Tasks.DuplicateChunk
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• 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_model
Copy model.
Type bool
copy_orthomosaic
Copy orthomosaic.
Type bool
copy_tiled_model
Copy tiled model.
Type bool
89
PhotoScan Python Reference, Release 1.4.0
encode()
Create a dictionary 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
class Tasks.ExportCameras
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
binary
Enables/disables binary encoding for selected format (if applicable).
Type bool
chan_order_rotate
Rotation order (CHAN format only).
Type PhotoScan.RotationOrder
coordinates
Output coordinate system.
Type CoordinateSystem
encode()
Create a dictionary 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 PhotoScan.CamerasFormat
name
Task name.
Type string
path
Path to output file.
Type string
use_labels
Enables/disables label based item identifiers.
Type bool
class Tasks.ExportDepth
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type list of int
encode()
Create a dictionary 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
class Tasks.ExportMarkers
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
binary
Enables/disables binary encoding for selected format (if applicable).
91
PhotoScan Python Reference, Release 1.4.0
Type bool
coordinates
Output coordinate system.
Type CoordinateSystem
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
path
Path to output file.
Type string
class Tasks.ExportMasks
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type list of int
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
path
Path to output file.
Type string
class Tasks.ExportModel
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
binary
Enables/disables binary encoding (if supported by format).
Type bool
comment
Optional comment (if supported by selected format).
Type string
coordinates
Output coordinate system.
Type CoordinateSystem
encode()
Create a dictionary 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 PhotoScan.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.
93
PhotoScan Python Reference, Release 1.4.0
Type PhotoScan.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
texture_format
Texture format.
Type PhotoScan.ImageFormat
viewpoint
Default view.
Type Viewpoint
class Tasks.ExportOrthophotos
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type list of int
encode()
Create a dictionary 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 PhotoScan.OrthoProjection
raster_transform
Raster band transformation.
Type PhotoScan.RasterTransformType
region
Region to be exported in the (x0, y0, x1, y1) format.
95
PhotoScan Python Reference, Release 1.4.0
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 PhotoScan.Matrix
width
Width of output panorama.
Type int
class Tasks.ExportPoints
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• 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
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 PhotoScan.DataSource
encode()
Create a dictionary 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.
Type bool
format
Export format.
Type PhotoScan.PointsFormat
image_format
Image data format.
Type PhotoScan.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 PhotoScan.RasterTransformType
shift
Optional shift to be applied to vertex coordinates.
Type 3-element vector
tile_height
Tile height in meters.
Type float
tile_width
Tile width in meters.
Type float
viewpoint
Default view.
Type Viewpoint
write_tiles
Enable tiled export.
Type bool
class Tasks.ExportRaster
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
97
PhotoScan Python Reference, Release 1.4.0
data_source
Selects between DEM and orthomosaic.
Type PhotoScan.DataSource
description
Export description.
Type string
encode()
Create a dictionary with task parameters.
format
Export format.
Type PhotoScan.RasterFormat
image_format
Tile format.
Type PhotoScan.ImageFormat
jpeg_quality
JPEG quality.
Type int
kmz_section_enable
Enable network links generation for KMZ format.
Type bool
name
Task name.
Type string
nodata_value
No-data value (DEM export only).
Type float
north_up
Use north-up orientation for export.
Type bool
path
Path to output orthomosaic.
Type string
projection
Output projection.
Type PhotoScan.OrthoProjection
raster_transform
Raster band transformation.
Type PhotoScan.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
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
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
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
99
PhotoScan Python Reference, Release 1.4.0
class Tasks.ExportReference
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• 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,
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
delimiter
Column delimiter in csv format.
Type string
encode()
Create a dictionary with task parameters.
format
Export format.
Type PhotoScan.ReferenceFormat
items
Items to export in CSV format.
Type PhotoScan.ReferenceItems
name
Task name.
Type string
path
Path to the output file.
Type string
class Tasks.ExportReport
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
description
Report description.
Type string
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
page_numbers
Enable page numbers.
Type bool
path
Path to output report.
Type string
title
Report title.
Type string
class Tasks.ExportShapes
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
coordinates
Output coordinate system.
Type CoordinateSystem
encode()
Create a dictionary with task parameters.
export_points
Export points.
Type bool
export_polygons
Export polygons.
Type bool
export_polylines
Export polylines.
Type bool
format
Export format.
Type PhotoScan.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
shift
Optional shift to be applied to vertex coordinates.
Type 3-element vector
101
PhotoScan Python Reference, Release 1.4.0
class Tasks.ExportTexture
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
path
Path to output file.
Type string
write_alpha
Enable alpha channel export.
Type bool
class Tasks.ExportTiledModel
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
encode()
Create a dictionary with task parameters.
format
Export format.
Type PhotoScan.TiledModelFormat
mesh_format
Mesh format for zip export.
Type PhotoScan.ModelFormat
name
Task name.
Type string
path
Path to output model.
Type string
raster_transform
Raster band transformation.
Type PhotoScan.RasterTransformType
class Tasks.ImportCameras
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
encode()
Create a dictionary with task parameters.
format
File format.
Type PhotoScan.CamerasFormat
name
Task name.
Type string
path
Path to the file.
Type string
class Tasks.ImportDem
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
coordinates
Default coordinate system if not specified in GeoTIFF file.
Type CoordinateSystem
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
path
Path to elevation model in GeoTIFF format.
Type string
class Tasks.ImportMarkers
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
encode()
Create a dictionary with task parameters.
103
PhotoScan Python Reference, Release 1.4.0
name
Task name.
Type string
path
Path to the file.
Type string
class Tasks.ImportMasks
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
cameras
Optional list of cameras to be processed.
Type list of int
encode()
Create a dictionary with task parameters.
method
Mask source.
Type PhotoScan.MaskSource
name
Task name.
Type string
operation
Mask operation.
Type PhotoScan.MaskOperation
path
Mask file name template.
Type string
tolerance
Background masking tolerance.
Type int
class Tasks.ImportModel
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
coordinates
Model coordinate system.
Type CoordinateSystem
encode()
Create a dictionary with task parameters.
format
Model format.
Type PhotoScan.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
class Tasks.ImportPoints
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
coordinates
Point cloud coordinate system.
Type CoordinateSystem
encode()
Create a dictionary with task parameters.
format
Point cloud format.
Type PhotoScan.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
class Tasks.ImportReference
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• 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
105
PhotoScan Python Reference, Release 1.4.0
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
delimiter
Column delimiter in csv format.
Type string
encode()
Create a dictionary with task parameters.
format
File format.
Type PhotoScan.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 PhotoScan.ReferenceItems
name
Task name.
Type string
path
Path to the file with reference data.
Type string
skip_rows
Number of rows to skip in (csv format only).
Type int
threshold
Error threshold in meters used when ignore_labels is set (csv format only).
Type float
class Tasks.ImportShapes
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
boundary_type
Boundary type to be applied to imported shapes.
Type Shape.BoundaryType
encode()
Create a dictionary with task parameters.
format
Shapes format.
Type PhotoScan.ShapesFormat
name
Task name.
Type string
path
Path to shape file.
Type string
replace
Replace current shapes with new data.
Type bool
class Tasks.InvertMasks
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type list of int
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
class Tasks.LoadProject
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
107
PhotoScan Python Reference, Release 1.4.0
path
Path to project file.
Type string
read_only
Open project in read only mode.
Type bool
class Tasks.MatchPhotos
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to match.
Type list of int
downscale
Image alignment accuracy.
Type int
encode()
Create a dictionary with task parameters.
filter_mask
Enable key point filtering by mask.
Type bool
keypoint_limit
Key point limit.
Type int
name
Task name.
Type string
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
tiepoint_limit
Tie point limit.
Type int
class Tasks.MergeChunks
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
chunks
List of chunks to process.
Type list of int
encode()
Create a dictionary with task parameters.
merge_dense_clouds
Merge dense clouds.
Type bool
merge_markers
Merge markers.
Type bool
merge_models
Merge models.
Type bool
merge_tiepoints
Merge tie points.
Type bool
name
Task name.
Type string
class Tasks.OptimizeCameras
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
encode()
Create a dictionary with task parameters.
fit_b1
Enable optimization of aspect ratio.
Type bool
109
PhotoScan Python Reference, Release 1.4.0
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
class Tasks.RefineMesh
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type list of int
downscale
Refinement quality.
Type int
encode()
Create a dictionary 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
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[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
color_mode
Enable multi-color processing mode.
Type bool
encode()
Create a dictionary 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
111
PhotoScan Python Reference, Release 1.4.0
class Tasks.ResetMasks
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type list of int
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
class Tasks.RunScript
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
args
Script arguments.
Type string
code
Script code.
Type string
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
path
Script path.
Type string
class Tasks.SaveProject
Task class containing processing parameters.
absolute_paths
Store absolute image paths.
Type bool
apply(object[, progress ])
Apply task to specified object.
Parameters
113
PhotoScan Python Reference, Release 1.4.0
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
encode()
Create a dictionary with task parameters.
frame_end
Ending frame index.
Type int
frame_start
Starting frame index.
Type int
name
Task name.
Type string
class Tasks.TriangulatePoints
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
encode()
Create a dictionary with task parameters.
name
Task name.
Type string
class Tasks.UndistortPhotos
Task class containing processing parameters.
apply(object[, progress ])
Apply task to specified object.
Parameters
• object (PhotoScan.Chunk or PhotoScan.Document) – Chunk or Document
object to be processed.
• progress (Callable[[float], None]) – Progress callback.
cameras
List of cameras to process.
Type list of int
color_correction
Apply color correction.
Type bool
encode()
Create a dictionary with task parameters.
fix_pixel_aspect
Fix pixel aspect.
Type bool
fix_principal_point
Fix principal point.
Type bool
name
Task name.
Type string
path
Path to output file.
Type string
remove_distortions
Remove distortions.
Type bool
class PhotoScan.Thumbnail
Thumbnail instance
copy()
Returns a copy of thumbnail.
Returns Copy of thumbnail.
Return type Thumbnail
image()
Returns image data.
Returns Image data.
Return type Image
load(path[, layer ])
Loads thumbnail from file.
Parameters
• path (string) – Path to the image file to be loaded.
• layer (int) – Optional layer index in case of multipage files.
setImage(image)
Parameters image (Image) – Image object with thumbnail data.
class PhotoScan.Thumbnails
A set of thumbnails generated for a chunk frame.
items()
List of items.
keys()
List of item keys.
meta
Thumbnails meta data.
Type MetaData
modified
Modified flag.
Type bool
115
PhotoScan Python Reference, Release 1.4.0
values()
List of item values.
class PhotoScan.TiffCompression
Tiff compression in [TiffCompressionNone, TiffCompressionLZW, TiffCompressionJPEG, TiffCompression-
Packbits, TiffCompressionDeflate]
class PhotoScan.TiledModel
Tiled model data.
clear()
Clears tiled model data.
copy()
Create a copy of the tiled model.
Returns Copy of the tiled model.
Return type TiledModel
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 (PhotoScan.Vector) – Ray origin.
• target (PhotoScan.Vector) – Point on the ray.
Returns Coordinates of the intersection point.
Return type PhotoScan.Vector
class PhotoScan.TiledModelFormat
Tiled model format in [TiledModelFormatNone, TiledModelFormatTLS, TiledModelFormatLOD, TiledMod-
elFormatZIP, TiledModelFormatCesium, TiledModelFormatSLPK]
class PhotoScan.Utils
Utility functions.
createChessboardImage(calib, cell_size=150, max_tilt=30)
Synthesizes photo of a chessboard.
Parameters
• calib (Calibration) – Camera calibration.
117
PhotoScan Python Reference, Release 1.4.0
copy()
Return a copy of the vector.
Returns A copy of the vector.
Return type Vector
norm()
Return norm of the vector.
norm2()
Return squared norm of the vector.
normalize()
Normalize vector to the unit length.
normalized()
Return a new, normalized vector.
Returns a normalized copy of the vector
Return type Vector
size
Vector dimensions.
Type int
w
Vector W component.
Type float
x
Vector X component.
Type float
y
Vector Y component.
Type float
z
Vector Z component.
Type float
zero()
Set all elements to zero.
class PhotoScan.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
119
PhotoScan Python Reference, Release 1.4.0
class PhotoScan.Vignetting
Vignetting polynomial
THREE
121
PhotoScan Python Reference, Release 1.4.0
p
PhotoScan, 5
135