python.packages._pix4dUtils Namespace Reference

collection of utility functions helping to convert the output of Pix4DMapper into opalsStripAdjust inputs. More...

Functions

def initPix4dUtils (p4DPjFile, imgDir, tsFile)
 Initialization function setting globla variables Pix4D project file, image file path and time stamp file Args: p4DPjFile: Pix4dMapper project file imgDir: path to file folder containing images tsFile: timestamp file (ASCII file containing file name/time stamp records in separate lines) Return: p4dPrjFile = '' imgPath = '' timestampFile = ''. More...
 
def getNumGcpId (idStr)
 
def getProjectNameAndParsDir ()
 
def convertTiePointsObs ()
 
def convertImageEORs ()
 
def readCalibCamParsEntry (file)
 Read a single image file entry in calibrated camera parameters file. More...
 
def getImgListAndCamPars ()
 This function parses the Pix4D calibrated_camera_parameters.txt file containing the list of all image files and their inner and outer orientation parameters. More...
 
def getStripIndexForImages (imgEosAndTimeStamps, stripIdAndTimeRange, imgCamIDs)
 This function takes a dictionary containing the eos and time stamps for each image, a second dictionary containing the strip indices and corresponding begin/end GPS Time, and a dictionary with file names and camera IDs and returns a dictionary with image filename/camID/stripID records for each image. More...
 
def convert3dTiePoints (tpFile, tpIds)
 

Variables

 dirDelim = os.path.sep
 
string p4dPrjFile = ''
 
string imgPath = ''
 
string timestampFile = ''
 
 gcpIds = dict()
 

Detailed Description

collection of utility functions helping to convert the output of Pix4DMapper into opalsStripAdjust inputs.

Author: GM

See also
Python script _pix4dUtils

Function Documentation

◆ convert3dTiePoints()

def python.packages._pix4dUtils.convert3dTiePoints (   tpFile,
  tpIds 
)
 Args:
     tpFile: name of file receiving 3d coordinates of tie points including
     tie point id. The points are read from Pix4D's  tie poin file
     [project]\1_initial\project_data\result_tracks2_full_1.las and converted
     to ASCII format (pointID,X,Y,Z)
     tpIds: set of tie point ids

 Returns:

References python.packages._pix4dUtils.getProjectNameAndParsDir().

◆ convertImageEORs()

def python.packages._pix4dUtils.convertImageEORs ( )
 Reads the image EORs contained in a Pix4D project and converts the content to opalsStripAdjust format
 Used global variables:
     p4rjFile: Pix4DMapper project file
     timestampFile: file containing image file names and corresponding time stamps (can be empty --> uncoupled images)
     imgPath: path receiving opalsStripAdjust conform orientation file

 Returns:
     eoFn : name of orientation file
     imgEos: dictionary containing the EORs and time stamps for each image (image=key of dict)

References python.packages._pix4dUtils.getProjectNameAndParsDir().

◆ convertTiePointsObs()

def python.packages._pix4dUtils.convertTiePointsObs ( )
 Converts Pix4D tie point image (pixel) coordinates observations to opalsStripAdjust format. For each image of a
          Pix44DMapper project (prjFile), a separate *obs.txt' file is written in outPath.
 Used global variables:
     p4dPrjFile: Pix4DMapper project file
     imgPath: path receiving opalsStripAdjust conform orientation file
 Returns:
     obFile: list containing *obs.txt file names
     tpIds: set of tie point ids

References python.packages._pix4dUtils.getProjectNameAndParsDir().

◆ getImgListAndCamPars()

def python.packages._pix4dUtils.getImgListAndCamPars ( )

This function parses the Pix4D calibrated_camera_parameters.txt file containing the list of all image files and their inner and outer orientation parameters.

Used global variables: Pix4d project file path to image files Return: camImg: Dictionary containing camara IOR tuples (c,x0,y0,rows,cols) as key and the list of assosiated images as values. imgCamIDs: image dictionary [key=file name, values: [imageId, cameraID]) logMsg: Log string is returned indicating if all images have been found on disk

References python.packages._pix4dUtils.getProjectNameAndParsDir(), and python.packages._pix4dUtils.readCalibCamParsEntry().

◆ getProjectNameAndParsDir()

def python.packages._pix4dUtils.getProjectNameAndParsDir ( )
     returns name of project parameter directory, and (project) data directory  

 Returns:
     prj: project name
     prjParsDir: project parameter directory
     prjDataDir:  project data directory

Referenced by python.packages._pix4dUtils.convert3dTiePoints(), python.packages._pix4dUtils.convertImageEORs(), python.packages._pix4dUtils.convertTiePointsObs(), and python.packages._pix4dUtils.getImgListAndCamPars().

◆ getStripIndexForImages()

def python.packages._pix4dUtils.getStripIndexForImages (   imgEosAndTimeStamps,
  stripIdAndTimeRange,
  imgCamIDs 
)

This function takes a dictionary containing the eos and time stamps for each image, a second dictionary containing the strip indices and corresponding begin/end GPS Time, and a dictionary with file names and camera IDs and returns a dictionary with image filename/camID/stripID records for each image.

Args: imgEosAndTimeStamps: dictionary (key: image id/name, value: timestamp+eo) stripIdAndTimeRange: list: (strip id, begin time, end time) imgCamIDs: image dictionary [key=file name, values: [imageId, cameraID])

Return: imgCamStripIDs (dictionary: key=image file, value=[imgID, camID, stripID)

◆ initPix4dUtils()

def python.packages._pix4dUtils.initPix4dUtils (   p4DPjFile,
  imgDir,
  tsFile 
)

Initialization function setting globla variables Pix4D project file, image file path and time stamp file Args: p4DPjFile: Pix4dMapper project file imgDir: path to file folder containing images tsFile: timestamp file (ASCII file containing file name/time stamp records in separate lines) Return: p4dPrjFile = '' imgPath = '' timestampFile = ''.

◆ readCalibCamParsEntry()

def python.packages._pix4dUtils.readCalibCamParsEntry (   file)

Read a single image file entry in calibrated camera parameters file.

Used global variables: imgPath: file path containing image files Args: file: content of calibrated_camera_paraemters file as a list of strings (i.e. lines of file)

Return: img: image name, camPars: tuple describing IOR+dimension of camera (c,x0,y0,cols,rows) errMsg: error string (empty string = success eof indicator

Referenced by python.packages._pix4dUtils.getImgListAndCamPars().