Package com.agisoft.metashape
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.
- 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 Summary
Fields Modifier and Type Field Description protected booleanswigCMemOwn -
Constructor Summary
-
Method Summary
Modifier and Type Method Description CameraaddCamera()Add new camera to the chunk.CameraGroupaddCameraGroup()Add new camera group to the chunk.CameraTrackaddCameraTrack()Add new camera track to the chunk.ChunkaddFrame()Add new frame to the chunk.MarkeraddMarker()Add new marker to the chunk.MarkeraddMarker(Vector3d point, boolean visibility)Add new marker to the chunk.MarkerGroupaddMarkerGroup()Add new marker group to the chunk.voidaddPhotos(String[] paths, Progress progress)ScalebaraddScalebar(Camera first, Camera second)Add new scale bar to the chunk.ScalebaraddScalebar(Marker first, Marker second)Add new scale bar to the chunk.ScalebarGroupaddScalebarGroup()Add new scale bar group to the chunk.SensoraddSensor()Add new sensor to the chunk.static long[]cArrayUnwrap(Chunk[] arrayWrapper)static Chunk[]cArrayWrap(long[] cArray, boolean cMemoryOwn)voiddelete()Stringdump()Returns chunk contents in XML format.protected voidfinalize()CameragetCamera(int key)Camera with specified key.CoordinateSystemgetCameraCoordinateSystem()Coordinate system used for camera reference data.CameraGroupgetCameraGroup(int key)Camera group with specified key.int[]getCameraGroupKeys()List of camera group keys in the chunk.CameraGroup[]getCameraGroups()List of camera groups in the chunk.int[]getCameraKeys()List of camera keys in the chunk.Vector3dgetCameraLocationAccuracy()Expected accuracy of camera coordinates in meters.Vector3dgetCameraOrientationAccuracy()Expected accuracy of camera orientation angles in degrees.Camera[]getCameras()List of Regular and Keyframe cameras in the chunk.CameraTrackgetCameraTrack(int key)Camera track with specified key.int[]getCameraTrackKeys()List of camera track keys in the chunk.CameraTrack[]getCameraTracks()List of camera tracks in the chunk.Matrix3x3dgetCirCalibration()CIR calibration matrix.CoordinateSystemgetCoordinateSystem()Coordinate system used for reference data.static longgetCPtr(Chunk obj)DenseCloudgetDenseCloud()Default dense point cloud for the current frame.DenseCloud[]getDenseClouds()List of dense clouds for the current frame.DepthMapsgetDepthMaps()Default depth maps set for the current frame.DepthMaps[]getDepthMapsSets()List of depth maps sets for the current frame.DocumentgetDocument()Document container.ElevationgetElevation()Default elevation model for the current frame.Elevation[]getElevations()List of elevation models for the current frame.ChunkgetFrame(int key)Frame with specified key.intgetFrameKey()Frame identifier.int[]getFrameKeys()List of frame keys in the chunk.Chunk[]getFrames()List of frames in the chunk.doublegetImageBrightness()Image brightness as percentage.doublegetImageContrast()Image contrast as percentage.intgetKey()Chunk identifier.StringgetLabel()Chunk label.MarkergetMarker(int key)Marker with specified key.CoordinateSystemgetMarkerCoordinateSystem()Coordinate system used for marker reference data.MarkerGroupgetMarkerGroup(int key)Marker group with specified key.int[]getMarkerGroupKeys()List of marker group keys in the chunk.MarkerGroup[]getMarkerGroups()List of marker groups in the chunk.int[]getMarkerKeys()List of marker keys in the chunk.Vector3dgetMarkerLocationAccuracy()Expected accuracy of marker coordinates in meters.doublegetMarkerProjectionAccuracy()Expected accuracy of marker projections in pixels.Marker[]getMarkers()List of Regular, Vertex and Fiducial markers in the chunk.MetaDatagetMeta()Chunk meta data.ModelgetModel()Default model for the current frame.Model[]getModels()List of models for the current frame.OrthomosaicgetOrthomosaic()Default orthomosaic for the current frame.Orthomosaic[]getOrthomosaics()List of orthomosaics for the current frame.PointCloudgetPointCloud()Generated sparse point cloud.intgetPrimaryChannel()Primary channel index (-1 for default).RasterTransformgetRasterTransform()Raster transform or null.RegiongetRegion()Reconstruction volume selection.ScalebargetScalebar(int key)Scale bar with specified key.ScalebarGroupgetScalebarGroup(int key)Scale bar group with specified key.int[]getScalebarGroupKeys()List of scale bar group keys in the chunk.ScalebarGroup[]getScalebarGroups()List of scale bar groups in the chunk.int[]getScalebarKeys()List of scale bar keys in the chunk.Scalebar[]getScalebars()List of scale bars in the chunk.SensorgetSensor(int key)Sensor with specified key.int[]getSensorKeys()List of sensor keys in the chunk.Sensor[]getSensors()List of sensors in the chunk.ShapesgetShapes()Shapes for the current frame.doublegetTiepointProjectionAccuracy()Expected tie point accuracy in pixels.TiledModelgetTiledModel()Default tiled model for the current frame.TiledModel[]getTiledModels()List of tiled models for the current frame.TransformgetTransform()Transformation parameters specifying chunk location in the world coordinate system.booleanhasDenseCloud()booleanhasDepthMaps()booleanhasElevation()booleanhasModel()booleanhasOrthomosaic()booleanhasPointCloud()booleanhasShapes()booleanhasTiledModel()booleanhasTransform()booleanisEnabled()Enables/disables the chunk.booleanisSelected()Selects/deselects the chunk.voidload(String text)Initializes chunk contents from XML format.booleanloadReferenceExif(boolean load_rotation, boolean load_accuracy)Import camera locations from EXIF meta data.voidremoveCameraGroups(int[] keys)Remove camera groups from the chunk.voidremoveCameras(int[] keys)Remove cameras from the chunk.voidremoveCameraTracks(int[] keys)Remove camera tracks from the chunk.voidremoveDenseCloud()voidremoveDepthMaps()voidremoveElevation()voidremoveFrames(int[] keys)Remove frames from the chunk.voidremoveMarkerGroups(int[] keys)Remove marker groups from the chunk.voidremoveMarkers(int[] keys)Remove markers from the chunk.voidremoveModel()voidremoveOrthomosaic()voidremovePointCloud()voidremoveScalebarGroups(int[] keys)Remove scalebars from the chunk.voidremoveScalebars(int[] keys)Remove scalebars from the chunk.voidremoveSensors(int[] keys)Remove sensors from the chunk.voidremoveShapes()voidremoveTiledModel()ImagerenderPreview(long width, long height, Matrix4x4d transform, int point_size, Progress progress)Generate chunk preview image.voidresetRegion()Reset reconstruction volume selector to default position.voidresetTransform()voidsetCameraCoordinateSystem(CoordinateSystem crs)Coordinate system used for camera reference data.voidsetCameraLocationAccuracy(Vector3d accuracy)Expected accuracy of camera coordinates in meters.voidsetCameraOrientationAccuracy(Vector3d accuracy)Expected accuracy of camera orientation angles in degrees.voidsetCirCalibration(Matrix3x3d calibration)CIR calibration matrix.voidsetCoordinateSystem(CoordinateSystem crs)Coordinate system used for reference data.voidsetDenseCloudKey(int key)voidsetDepthMapsKey(int key)voidsetElevationKey(int key)voidsetEnabled(boolean state)Enables/disables the chunk.voidsetImageBrightness(double brightness)Image brightness as percentage.voidsetImageContrast(double contrast)Image contrast as percentage.voidsetLabel(String label)Chunk label.voidsetMarkerCoordinateSystem(CoordinateSystem crs)Coordinate system used for marker reference data.voidsetMarkerLocationAccuracy(Vector3d accuracy)Expected accuracy of marker coordinates in meters.voidsetMarkerProjectionAccuracy(double accuracy)Expected accuracy of marker projections in pixels.voidsetMeta(MetaData meta)Chunk meta data.voidsetModelKey(int key)voidsetOrthomosaicKey(int key)voidsetPrimaryChannel(int channel)Primary channel index (-1 for default).voidsetRasterTransform(RasterTransform transform)Raster transform or null.voidsetRegion(Region region)Reconstruction volume selection.voidsetSelected(boolean state)Selects/deselects the chunk.voidsetTiepointProjectionAccuracy(double accuracy)Expected tie point accuracy in pixels.voidsetTiledModelKey(int key)voidsetTransform(Transform transform)Transformation parameters specifying chunk location in the world coordinate system.voidthinPointCloud(int point_limit)Remove excessive tracks from the point cloud.voidupdateCirCalibration(Progress progress)Estimate CIR calibration matrix.voidupdateTransform()Update chunk transformation based on reference data.
-
Field Details
-
swigCMemOwn
protected transient boolean swigCMemOwn
-
-
Constructor Details
-
Chunk
public Chunk(long cPtr, boolean cMemoryOwn) -
Chunk
-
-
Method Details
-
getCPtr
-
finalize
protected void finalize() -
delete
public void delete() -
cArrayUnwrap
-
cArrayWrap
-
dump
Returns chunk contents in XML format. -
load
Initializes chunk contents from XML format. -
getKey
public int getKey()Chunk identifier. -
getFrameKey
public int getFrameKey()Frame identifier. -
getDocument
Document container. -
setLabel
Chunk label. -
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
List of frames in the chunk. -
getSensors
List of sensors in the chunk. -
getCameraGroups
List of camera groups in the chunk. -
getMarkerGroups
List of marker groups in the chunk. -
getScalebarGroups
List of scale bar groups in the chunk. -
getCameras
List of Regular and Keyframe cameras in the chunk. -
getMarkers
List of Regular, Vertex and Fiducial markers in the chunk. -
getScalebars
List of scale bars in the chunk. -
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
Frame with specified key. -
getSensor
Sensor with specified key. -
getCameraGroup
Camera group with specified key. -
getMarkerGroup
Marker group with specified key. -
getScalebarGroup
Scale bar group with specified key. -
getCamera
Camera with specified key. -
getMarker
Marker with specified key. -
getScalebar
Scale bar with specified key. -
getCameraTrack
Camera track with specified key. -
addFrame
Add new frame to the chunk. -
addSensor
Add new sensor to the chunk. -
addCameraGroup
Add new camera group to the chunk. -
addMarkerGroup
Add new marker group to the chunk. -
addScalebarGroup
Add new scale bar group to the chunk. -
addCamera
Add new camera to the chunk. -
addMarker
Add new marker to the chunk. -
addCameraTrack
Add new camera track to the chunk. -
addMarker
Add new marker to the chunk.- Parameters:
point- Point to initialize marker projections.visibility- Enables visibility check during projection assignment.- Returns:
- Created marker.
-
addScalebar
Add new scale bar to the chunk.- Parameters:
first- First endpoint.second- Second endpoint.- Returns:
- Created scale bar.
-
addScalebar
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
Coordinate system used for reference data. -
getCoordinateSystem
Coordinate system used for reference data. -
setCameraCoordinateSystem
Coordinate system used for camera reference data. -
getCameraCoordinateSystem
Coordinate system used for camera reference data. -
setMarkerCoordinateSystem
Coordinate system used for marker reference data. -
getMarkerCoordinateSystem
Coordinate system used for marker reference data. -
setTransform
Transformation parameters specifying chunk location in the world coordinate system. -
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
Reconstruction volume selection. -
getRegion
Reconstruction volume selection. -
resetRegion
public void resetRegion()Reset reconstruction volume selector to default position. -
setCirCalibration
CIR calibration matrix. -
getCirCalibration
CIR calibration matrix. -
updateCirCalibration
Estimate CIR calibration matrix. -
setRasterTransform
Raster transform or null. -
getRasterTransform
Raster transform or null. -
setCameraLocationAccuracy
Expected accuracy of camera coordinates in meters. -
getCameraLocationAccuracy
Expected accuracy of camera coordinates in meters. -
setCameraOrientationAccuracy
Expected accuracy of camera orientation angles in degrees. -
getCameraOrientationAccuracy
Expected accuracy of camera orientation angles in degrees. -
setMarkerLocationAccuracy
Expected accuracy of marker coordinates in meters. -
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
Generated sparse point cloud. -
getDenseCloud
Default dense point cloud for the current frame. -
getDepthMaps
Default depth maps set for the current frame. -
getModel
Default model for the current frame. -
getTiledModel
Default tiled model for the current frame. -
getElevation
Default elevation model for the current frame. -
getOrthomosaic
Default orthomosaic for the current frame. -
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
List of depth maps sets for the current frame. -
getDenseClouds
List of dense clouds for the current frame. -
getModels
List of models for the current frame. -
getTiledModels
List of tiled models for the current frame. -
getElevations
List of elevation models for the current frame. -
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
Chunk meta data. -
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
-
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.
-