tvaLib
Public Member Functions | Public Attributes | List of all members
lib.scene.CameraType Class Reference
Inheritance diagram for lib.scene.CameraType:

Public Member Functions

def __init__ (self, camera, config)
 
def getID (self)
 
def getName (self)
 
def getResY (self)
 
def getResX (self)
 
def getFrameRate (self)
 
def getFOV (self)
 
def getFreeScalingParam (self)
 
def getImageScalingFactor (self)
 
def getCamMatrix (self)
 
def getDistCoeffs (self)
 
def getCamMatrixAsFile (self)
 
def getDistCoeffsAsFile (self)
 
def getUndistortCmdStack (self)
 

Public Attributes

 config
 
 idx
 
 name
 
 resX
 
 resY
 
 frameRate
 
 camera_matrix
 Create and link abstract objects from data. More...
 
 dist_coeffs
 
 FOV
 
 freeScalingParameter
 
 imageScalingFactor
 

Detailed Description

Definition at line 835 of file scene.py.

Constructor & Destructor Documentation

◆ __init__()

def lib.scene.CameraType.__init__ (   self,
  camera,
  config 
)

Definition at line 836 of file scene.py.

836  def __init__(self, camera, config):
837  self.config = config
838  self.idx = camera.idx
839  self.name = camera.name
840  self.resX = camera.resX
841  self.resY = camera.resY
842  self.frameRate = camera.frameRate
843  self.camera_matrix = camera.camera_matrix
844  self.dist_coeffs = camera.dist_coeffs
845  self.FOV = camera.FOV
846  self.freeScalingParameter = camera.freeScalingParameter
847  self.imageScalingFactor = camera.imageScalingFactor
848 
849 
850  self.camera_matrix = tvaLib.Constructors.SuperListParse(self.camera_matrix, dimension=2, datatype='other')
851  self.dist_coeffs = tvaLib.Constructors.SuperListParse(self.dist_coeffs, dimension=1, datatype='other')
852  return
853 

Member Function Documentation

◆ getCamMatrix()

def lib.scene.CameraType.getCamMatrix (   self)

Definition at line 862 of file scene.py.

862  def getCamMatrix(self): return self.camera_matrix

◆ getCamMatrixAsFile()

def lib.scene.CameraType.getCamMatrixAsFile (   self)

Definition at line 864 of file scene.py.

864  def getCamMatrixAsFile(self):
865  with open(os.path.join(self.config.temp_dir, tvaLib.Parse.clean_file_name('camera_matrix-'+str(self.config.dbn)[:-7]+'-'+str(self.idx)+'-'+str(self.name)+'.txt')), 'wb') as f:
866  for line in self.camera_matrix.data:
867  f.write(' '.join([str(x) for x in line])+'\n')
868  return os.path.join(self.config.temp_dir, tvaLib.Parse.clean_file_name('camera_matrix-'+str(self.config.dbn)[:-7]+'-'+str(self.idx)+'-'+str(self.name)+'.txt'))
def join(obj1, obj2, postSmoothing=True)
Definition: tools_obj.py:816

◆ getDistCoeffs()

def lib.scene.CameraType.getDistCoeffs (   self)

Definition at line 863 of file scene.py.

863  def getDistCoeffs(self): return self.dist_coeffs

◆ getDistCoeffsAsFile()

def lib.scene.CameraType.getDistCoeffsAsFile (   self)

Definition at line 869 of file scene.py.

869  def getDistCoeffsAsFile(self):
870  with open(os.path.join(self.config.temp_dir, tvaLib.Parse.clean_file_name('dist_coeffs-'+str(self.config.dbn)[:-7]+'-'+str(self.idx)+'-'+str(self.name)+'.txt')), 'wb') as f:
871  f.write(' '.join([str(x) for x in self.dist_coeffs.data]))
872  return os.path.join(self.config.temp_dir, tvaLib.Parse.clean_file_name('dist_coeffs-'+str(self.config.dbn)[:-7]+'-'+str(self.idx)+'-'+str(self.name)+'.txt'))
873 
def join(obj1, obj2, postSmoothing=True)
Definition: tools_obj.py:816

◆ getFOV()

def lib.scene.CameraType.getFOV (   self)

Definition at line 859 of file scene.py.

859  def getFOV(self): return self.FOV

◆ getFrameRate()

def lib.scene.CameraType.getFrameRate (   self)

Definition at line 858 of file scene.py.

858  def getFrameRate(self): return self.frameRate

◆ getFreeScalingParam()

def lib.scene.CameraType.getFreeScalingParam (   self)

Definition at line 860 of file scene.py.

860  def getFreeScalingParam(self): return self.freeScalingParameter

◆ getID()

def lib.scene.CameraType.getID (   self)

Definition at line 854 of file scene.py.

854  def getID(self): return self.idx

◆ getImageScalingFactor()

def lib.scene.CameraType.getImageScalingFactor (   self)

Definition at line 861 of file scene.py.

861  def getImageScalingFactor(self): return self.imageScalingFactor

◆ getName()

def lib.scene.CameraType.getName (   self)

Definition at line 855 of file scene.py.

855  def getName(self): return self.name

◆ getResX()

def lib.scene.CameraType.getResX (   self)

Definition at line 857 of file scene.py.

857  def getResX(self): return self.resY

◆ getResY()

def lib.scene.CameraType.getResY (   self)

Definition at line 856 of file scene.py.

856  def getResY(self): return self.resX

◆ getUndistortCmdStack()

def lib.scene.CameraType.getUndistortCmdStack (   self)

Definition at line 874 of file scene.py.

874  def getUndistortCmdStack(self):
875  if(self.camera_matrix.data and self.dist_coeffs.data):
876  return ['--undistort','1',
877  '--intrinsic-camera-filename', self.getCamMatrixAsFile(),
878  '--distortion-coefficients', str(self.dist_coeffs.data[0]),
879  '--distortion-coefficients', str(self.dist_coeffs.data[1]),
880  '--distortion-coefficients', str(self.dist_coeffs.data[2]),
881  '--distortion-coefficients', str(self.dist_coeffs.data[3]),
882  '--distortion-coefficients', str(self.dist_coeffs.data[4])]
883  return []
884 

Member Data Documentation

◆ camera_matrix

lib.scene.CameraType.camera_matrix

Create and link abstract objects from data.

Definition at line 843 of file scene.py.

◆ config

lib.scene.CameraType.config

Definition at line 837 of file scene.py.

◆ dist_coeffs

lib.scene.CameraType.dist_coeffs

Definition at line 844 of file scene.py.

◆ FOV

lib.scene.CameraType.FOV

Definition at line 845 of file scene.py.

◆ frameRate

lib.scene.CameraType.frameRate

Definition at line 842 of file scene.py.

◆ freeScalingParameter

lib.scene.CameraType.freeScalingParameter

Definition at line 846 of file scene.py.

◆ idx

lib.scene.CameraType.idx

Definition at line 838 of file scene.py.

◆ imageScalingFactor

lib.scene.CameraType.imageScalingFactor

Definition at line 847 of file scene.py.

◆ name

lib.scene.CameraType.name

Definition at line 839 of file scene.py.

◆ resX

lib.scene.CameraType.resX

Definition at line 840 of file scene.py.

◆ resY

lib.scene.CameraType.resY

Definition at line 841 of file scene.py.


The documentation for this class was generated from the following file: