python.packages.metaShape2stripAdjust Namespace Reference

Classes

class  ChunkTransform
 
class  HelpFormatter
 

Functions

def intLargerEqual (thresh)
 
def positiveFloat (string)
 
def parseArgs (typing.Union[typing.List[str], None] args=None)
 
def readPly (typing.BinaryIO fileLike, typing.List neededProperties)
 
def getDOM (Path zipFn)
 
def getChunkFrame (Path pszFn, chunkId)
 
def getGeoc2Proj (ElementTree.Element chunkDOM)
 
np.ndarray getIor (Sensor s)
 
typing.Dict[int, Sensor] getSensors (ElementTree.Element chunkDOM, ElementTree.Element frameDOM)
 
def getCameras (ElementTree.Element chunkDOM, ElementTree.Element frameDOM, Path frameFn, typing.Dict[int, Sensor] sensors)
 
def getMarkers (ElementTree.Element chunkDOM)
 
np.ndarray omfika (np.ndarray arg)
 
np.ndarray projected (Sensor sensor, np.ndarray camPt)
 
def metaShape2stripAdjust (Path project, typing.Union[int, None] chunk, typing.Union[float, None] maxReprojectionError, int minMultiplicity, int warnIfLessImagePointsThan, Path outDir)
 
def main (argparse.Namespace args)
 

Variables

 Sensor = namedtuple('Sensor', 'width height f cx cy b1 b2 k1 k2 k3 k4 p1 p2 p3 p4 make model')
 
 Camera = namedtuple('Camera', 'sensorId path transform')
 

Detailed Description

Transform a MetaShape/PhotoScan project into input for opalsStripAdjust. Generates the following files:

  • 'eors.txt' containing exterior image orientations. Use as -images.all.oriFile, together with -.iFormat=ImageOrientation.xml
  • '*_obs.txt' for each photo containing image point observations. Use as -images[?].obsFile;
  • 'tp.txt' containing tie object points. Use as -groundTiePoints.inFile, together with -.iFormat=controlPoints.xml;
  • 'gcp.txt' containing control object points. Use as -groundControlPoints.inFile, together with -.iFormat=controlPoints.xml

contact: wilfr.nosp@m.ied..nosp@m.karel.nosp@m.@geo.nosp@m..tuwi.nosp@m.en.a.nosp@m.c.at

See also
metaShape2stripAdjust

Function Documentation

◆ metaShape2stripAdjust()

def python.packages.metaShape2stripAdjust.metaShape2stripAdjust ( Path  project,
typing.Union[int, None]  chunk,
typing.Union[float, None]  maxReprojectionError,
int  minMultiplicity,
int  warnIfLessImagePointsThan,
Path  outDir 
)
PhotoScan manual, appendix C:
A camera model specifies the transformation from point coordinates in the local camera coordinate system
to the pixel coordinates in the image frame.
The local camera coordinate system has origin at the camera projection center. The Z axis points towards
the viewing direction, X axis points to the right, Y axis points down.
The image coordinate system has origin at the top left image pixel, with the center of the top left pixel
having coordinates (0.5, 0.5). The X axis in the image coordinate system points to the right, Y axis points
down. Image coordinates are measured in pixels.

http://www.agisoft.com/forum/index.php?topic=1557.msg8152#msg8152
The transformation matrices that are produced by using the Tools/"Export Cameras..." option will transform from camera local space to model global space.
Doing a matrix multiply of the transformation matrix times the origin vector [0,0,0,1] results in the camera's location in model global space.

References python.packages.metaShape2stripAdjust.projected().

◆ projected()

np.ndarray python.packages.metaShape2stripAdjust.projected ( Sensor  sensor,
np.ndarray  camPt 
)
 From the manual of Agisoft MetaShape 1.5.1:

 Appendix C. Camera models
 Agisoft Metashape supports several parametric lens distortion models. Specific model which approximates best a real distortion field must be selected before processing. All models assume a central projection camera. Non-linear distortions are modeled using Brown's distortion model.

 A camera model specifies the transformation from point coordinates in the local camera coordinate system to the pixel coordinates in the image frame.

 The local camera coordinate system has origin at the camera projection center. The Z axis points towards the viewing direction, X axis points to the right, Y axis points down.

 The image coordinate system has origin at the top left image pixel, with the center of the top left pixel having coordinates (0.5, 0.5). The X axis in the image coordinate system points to the right, Y axis points down. Image coordinates are measured in pixels.

 Equations used to project a points in the local camera coordinate system to the image plane are provided below for each supported camera model.

 The following definitions are used in the equations:

 (X, Y, Z) - point coordinates in the local camera coordinate system,

 (u, v) - projected point coordinates in the image coordinate system (in pixels),

 f - focal length,

 cx, cy - principal point offset,

 K1, K2, K3, K4 - radial distortion coefficients,

 P1, P2, P3, P4 - tangential distortion coefficients,

 B1, B2 - affinity and non-orthogonality (skew) coefficients,

 w, h - image width and height in pixels.

 Frame cameras
 x = X / Z

 y = Y / Z

 r = sqrt(x^2 + y^2)

 x' = x(1 + K1 r^2 + K2 r^4 + K3 r^6 + K4 r^8) + (P1(r^2 + 2 x^2) + 2 P2 x y)(1 + P3 r^2 + P4 r^4)

 y' = y(1 + K1 r^2 + K2 r^4 + K3 r^6 + K4 r^8) + (P2(r^2 + 2 y^2) + 2 P1 x y)(1 + P3 r^2 + P4 r^4)

 u = w * 0.5 + cx + x' f + x' B1 + y' B2

 v = h * 0.5 + cy + y' f

Referenced by python.packages.metaShape2stripAdjust.metaShape2stripAdjust().