Class Chunk

java.lang.Object
com.agisoft.metashape.Chunk

public class Chunk
extends Object
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)
- provides access to other chunk attributes (transformation matrix, coordinate system, meta-data, etc..)

New components can be created using corresponding addXXX methods (addSensor, addCamera, addCameraGroup, addMarker, addScalebar, addFrame).
Removal of components is performed using corresponding removeXXX methods.
  • Field Details

    • swigCMemOwn

      protected transient boolean swigCMemOwn
  • Constructor Details

    • Chunk

      public Chunk​(long cPtr, boolean cMemoryOwn)
    • Chunk

      public Chunk​(Chunk chunk)
  • Method Details

    • getCPtr

      public static long getCPtr​(Chunk obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class Object
    • delete

      public void delete()
    • cArrayUnwrap

      public static long[] cArrayUnwrap​(Chunk[] arrayWrapper)
    • cArrayWrap

      public static Chunk[] cArrayWrap​(long[] cArray, boolean cMemoryOwn)
    • dump

      public String dump()
      Returns chunk contents in XML format.
    • load

      public void load​(String text)
      Initializes chunk contents from XML format.
    • getKey

      public int getKey()
      Chunk identifier.
    • getFrameKey

      public int getFrameKey()
      Frame identifier.
    • getDocument

      public Document getDocument()
      Document container.
    • setLabel

      public void setLabel​(String label)
      Chunk label.
    • getLabel

      public String getLabel()
      Chunk label.
    • setEnabled

      public void setEnabled​(boolean state)
      Enables/disables the chunk.
    • isEnabled

      public boolean isEnabled()
      Enables/disables the chunk.
    • setSelected

      public void setSelected​(boolean state)
      Selects/deselects the chunk.
    • isSelected

      public boolean isSelected()
      Selects/deselects the chunk.
    • getFrames

      public Chunk[] getFrames()
      List of frames in the chunk.
    • getSensors

      public Sensor[] getSensors()
      List of sensors in the chunk.
    • getCameraGroups

      public CameraGroup[] getCameraGroups()
      List of camera groups in the chunk.
    • getMarkerGroups

      public MarkerGroup[] getMarkerGroups()
      List of marker groups in the chunk.
    • getScalebarGroups

      public ScalebarGroup[] getScalebarGroups()
      List of scale bar groups in the chunk.
    • getCameras

      public Camera[] getCameras()
      List of Regular and Keyframe cameras in the chunk.
    • getMarkers

      public Marker[] getMarkers()
      List of Regular, Vertex and Fiducial markers in the chunk.
    • getScalebars

      public Scalebar[] getScalebars()
      List of scale bars in the chunk.
    • getCameraTracks

      public CameraTrack[] getCameraTracks()
      List of camera tracks in the chunk.
    • getFrameKeys

      public int[] getFrameKeys()
      List of frame keys in the chunk.
    • getSensorKeys

      public int[] getSensorKeys()
      List of sensor keys in the chunk.
    • getCameraGroupKeys

      public int[] getCameraGroupKeys()
      List of camera group keys in the chunk.
    • getMarkerGroupKeys

      public int[] getMarkerGroupKeys()
      List of marker group keys in the chunk.
    • getScalebarGroupKeys

      public int[] getScalebarGroupKeys()
      List of scale bar group keys in the chunk.
    • getCameraKeys

      public int[] getCameraKeys()
      List of camera keys in the chunk.
    • getMarkerKeys

      public int[] getMarkerKeys()
      List of marker keys in the chunk.
    • getScalebarKeys

      public int[] getScalebarKeys()
      List of scale bar keys in the chunk.
    • getCameraTrackKeys

      public int[] getCameraTrackKeys()
      List of camera track keys in the chunk.
    • getFrame

      public Chunk getFrame​(int key)
      Frame with specified key.
    • getSensor

      public Sensor getSensor​(int key)
      Sensor with specified key.
    • getCameraGroup

      public CameraGroup getCameraGroup​(int key)
      Camera group with specified key.
    • getMarkerGroup

      public MarkerGroup getMarkerGroup​(int key)
      Marker group with specified key.
    • getScalebarGroup

      public ScalebarGroup getScalebarGroup​(int key)
      Scale bar group with specified key.
    • getCamera

      public Camera getCamera​(int key)
      Camera with specified key.
    • getMarker

      public Marker getMarker​(int key)
      Marker with specified key.
    • getScalebar

      public Scalebar getScalebar​(int key)
      Scale bar with specified key.
    • getCameraTrack

      public CameraTrack getCameraTrack​(int key)
      Camera track with specified key.
    • addFrame

      public Chunk addFrame()
      Add new frame to the chunk.
    • addSensor

      public Sensor addSensor()
      Add new sensor to the chunk.
    • addCameraGroup

      public CameraGroup addCameraGroup()
      Add new camera group to the chunk.
    • addMarkerGroup

      public MarkerGroup addMarkerGroup()
      Add new marker group to the chunk.
    • addScalebarGroup

      public ScalebarGroup addScalebarGroup()
      Add new scale bar group to the chunk.
    • addCamera

      public Camera addCamera()
      Add new camera to the chunk.
    • addMarker

      public Marker addMarker()
      Add new marker to the chunk.
    • addCameraTrack

      public CameraTrack addCameraTrack()
      Add new camera track to the chunk.
    • addMarker

      public Marker addMarker​(Vector3d point, boolean visibility)
      Add new marker to the chunk.
      Parameters:
      point - Point to initialize marker projections.
      visibility - Enables visibility check during projection assignment.
      Returns:
      Created marker.
    • addScalebar

      public Scalebar addScalebar​(Camera first, Camera second)
      Add new scale bar to the chunk.
      Parameters:
      first - First endpoint.
      second - Second endpoint.
      Returns:
      Created scale bar.
    • addScalebar

      public Scalebar addScalebar​(Marker first, Marker second)
      Add new scale bar to the chunk.
      Parameters:
      first - First endpoint.
      second - Second endpoint.
      Returns:
      Created scale bar.
    • removeFrames

      public void removeFrames​(int[] keys)
      Remove frames from the chunk.
      Parameters:
      keys - List of frame keys to remove.
    • removeSensors

      public void removeSensors​(int[] keys)
      Remove sensors from the chunk.
      Parameters:
      keys - List of sensor keys to remove.
    • removeCameraGroups

      public void removeCameraGroups​(int[] keys)
      Remove camera groups from the chunk.
      Parameters:
      keys - List of camera group keys to remove.
    • removeMarkerGroups

      public void removeMarkerGroups​(int[] keys)
      Remove marker groups from the chunk.
      Parameters:
      keys - List of marker group keys to remove.
    • removeScalebarGroups

      public void removeScalebarGroups​(int[] keys)
      Remove scalebars from the chunk.
      Parameters:
      keys - List of scalebar group keys to remove.
    • removeCameras

      public void removeCameras​(int[] keys)
      Remove cameras from the chunk.
      Parameters:
      keys - List of camera keys to remove.
    • removeMarkers

      public void removeMarkers​(int[] keys)
      Remove markers from the chunk.
      Parameters:
      keys - List of marker keys to remove.
    • removeScalebars

      public void removeScalebars​(int[] keys)
      Remove scalebars from the chunk.
      Parameters:
      keys - List of scalebar keys to remove.
    • removeCameraTracks

      public void removeCameraTracks​(int[] keys)
      Remove camera tracks from the chunk.
      Parameters:
      keys - List of camera track keys to remove.
    • setCoordinateSystem

      public void setCoordinateSystem​(CoordinateSystem crs)
      Coordinate system used for reference data.
    • getCoordinateSystem

      public CoordinateSystem getCoordinateSystem()
      Coordinate system used for reference data.
    • setCameraCoordinateSystem

      public void setCameraCoordinateSystem​(CoordinateSystem crs)
      Coordinate system used for camera reference data.
    • getCameraCoordinateSystem

      public CoordinateSystem getCameraCoordinateSystem()
      Coordinate system used for camera reference data.
    • setMarkerCoordinateSystem

      public void setMarkerCoordinateSystem​(CoordinateSystem crs)
      Coordinate system used for marker reference data.
    • getMarkerCoordinateSystem

      public CoordinateSystem getMarkerCoordinateSystem()
      Coordinate system used for marker reference data.
    • setTransform

      public void setTransform​(Transform transform)
      Transformation parameters specifying chunk location in the world coordinate system.
    • getTransform

      public Transform getTransform()
      Transformation parameters specifying chunk location in the world coordinate system.
    • resetTransform

      public void resetTransform()
    • hasTransform

      public boolean hasTransform()
    • updateTransform

      public void updateTransform()
      Update chunk transformation based on reference data.
    • setRegion

      public void setRegion​(Region region)
      Reconstruction volume selection.
    • getRegion

      public Region getRegion()
      Reconstruction volume selection.
    • resetRegion

      public void resetRegion()
      Reset reconstruction volume selector to default position.
    • setCirCalibration

      public void setCirCalibration​(Matrix3x3d calibration)
      CIR calibration matrix.
    • getCirCalibration

      public Matrix3x3d getCirCalibration()
      CIR calibration matrix.
    • updateCirCalibration

      public void updateCirCalibration​(Progress progress)
      Estimate CIR calibration matrix.
    • setRasterTransform

      public void setRasterTransform​(RasterTransform transform)
      Raster transform or null.
    • getRasterTransform

      public RasterTransform getRasterTransform()
      Raster transform or null.
    • setCameraLocationAccuracy

      public void setCameraLocationAccuracy​(Vector3d accuracy)
      Expected accuracy of camera coordinates in meters.
    • getCameraLocationAccuracy

      public Vector3d getCameraLocationAccuracy()
      Expected accuracy of camera coordinates in meters.
    • setCameraOrientationAccuracy

      public void setCameraOrientationAccuracy​(Vector3d accuracy)
      Expected accuracy of camera orientation angles in degrees.
    • getCameraOrientationAccuracy

      public Vector3d getCameraOrientationAccuracy()
      Expected accuracy of camera orientation angles in degrees.
    • setMarkerLocationAccuracy

      public void setMarkerLocationAccuracy​(Vector3d accuracy)
      Expected accuracy of marker coordinates in meters.
    • getMarkerLocationAccuracy

      public Vector3d getMarkerLocationAccuracy()
      Expected accuracy of marker coordinates in meters.
    • setMarkerProjectionAccuracy

      public void setMarkerProjectionAccuracy​(double accuracy)
      Expected accuracy of marker projections in pixels.
    • getMarkerProjectionAccuracy

      public double getMarkerProjectionAccuracy()
      Expected accuracy of marker projections in pixels.
    • setTiepointProjectionAccuracy

      public void setTiepointProjectionAccuracy​(double accuracy)
      Expected tie point accuracy in pixels.
    • getTiepointProjectionAccuracy

      public double getTiepointProjectionAccuracy()
      Expected tie point accuracy in pixels.
    • setPrimaryChannel

      public void setPrimaryChannel​(int channel)
      Primary channel index (-1 for default).
    • getPrimaryChannel

      public int getPrimaryChannel()
      Primary channel index (-1 for default).
    • setImageBrightness

      public void setImageBrightness​(double brightness)
      Image brightness as percentage.
    • getImageBrightness

      public double getImageBrightness()
      Image brightness as percentage.
    • setImageContrast

      public void setImageContrast​(double contrast)
      Image contrast as percentage.
    • getImageContrast

      public double getImageContrast()
      Image contrast as percentage.
    • hasPointCloud

      public boolean hasPointCloud()
    • hasDenseCloud

      public boolean hasDenseCloud()
    • hasDepthMaps

      public boolean hasDepthMaps()
    • hasModel

      public boolean hasModel()
    • hasTiledModel

      public boolean hasTiledModel()
    • hasElevation

      public boolean hasElevation()
    • hasOrthomosaic

      public boolean hasOrthomosaic()
    • hasShapes

      public boolean hasShapes()
    • getPointCloud

      public PointCloud getPointCloud()
      Generated sparse point cloud.
    • getDenseCloud

      public DenseCloud getDenseCloud()
      Default dense point cloud for the current frame.
    • getDepthMaps

      public DepthMaps getDepthMaps()
      Default depth maps set for the current frame.
    • getModel

      public Model getModel()
      Default model for the current frame.
    • getTiledModel

      public TiledModel getTiledModel()
      Default tiled model for the current frame.
    • getElevation

      public Elevation getElevation()
      Default elevation model for the current frame.
    • getOrthomosaic

      public Orthomosaic getOrthomosaic()
      Default orthomosaic for the current frame.
    • getShapes

      public Shapes getShapes()
      Shapes for the current frame.
    • removePointCloud

      public void removePointCloud()
    • removeDenseCloud

      public void removeDenseCloud()
    • removeDepthMaps

      public void removeDepthMaps()
    • removeModel

      public void removeModel()
    • removeTiledModel

      public void removeTiledModel()
    • removeElevation

      public void removeElevation()
    • removeOrthomosaic

      public void removeOrthomosaic()
    • removeShapes

      public void removeShapes()
    • getDepthMapsSets

      public DepthMaps[] getDepthMapsSets()
      List of depth maps sets for the current frame.
    • getDenseClouds

      public DenseCloud[] getDenseClouds()
      List of dense clouds for the current frame.
    • getModels

      public Model[] getModels()
      List of models for the current frame.
    • getTiledModels

      public TiledModel[] getTiledModels()
      List of tiled models for the current frame.
    • getElevations

      public Elevation[] getElevations()
      List of elevation models for the current frame.
    • getOrthomosaics

      public Orthomosaic[] getOrthomosaics()
      List of orthomosaics for the current frame.
    • setDepthMapsKey

      public void setDepthMapsKey​(int key)
    • setDenseCloudKey

      public void setDenseCloudKey​(int key)
    • setModelKey

      public void setModelKey​(int key)
    • setTiledModelKey

      public void setTiledModelKey​(int key)
    • setElevationKey

      public void setElevationKey​(int key)
    • setOrthomosaicKey

      public void setOrthomosaicKey​(int key)
    • setMeta

      public void setMeta​(MetaData meta)
      Chunk meta data.
    • getMeta

      public MetaData getMeta()
      Chunk meta data.
    • loadReferenceExif

      public boolean loadReferenceExif​(boolean load_rotation, boolean load_accuracy)
      Import camera locations from EXIF meta data.
      Parameters:
      load_rotation - Load yaw, pitch and roll orientation angles.
      load_accuracy - Load camera location accuracy.
    • addPhotos

      public void addPhotos​(String[] paths, Progress progress)
    • thinPointCloud

      public void thinPointCloud​(int point_limit)
      Remove excessive tracks from the point cloud.
      Parameters:
      point_limit - Maximum number of points for each photo.
    • renderPreview

      public Image renderPreview​(long width, long height, Matrix4x4d transform, int point_size, Progress progress)
      Generate chunk preview image.
      Parameters:
      width - Preview image width.
      height - Preview image height.
      transform - 4x4 viewpoint transformation matrix.
      point_size - Point size.
      Returns:
      Preview image.