transform.py 1.61 KB
Newer Older
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
#######################################
    LSPyIV --TRANSFORMATION MODULE
#######################################
Python LSPIV tools

Contains all definitions/functions that deals with 
transformations between coordinate systems (image/world)

"""
import numpy as np

class GRP:
    """Groud Reference Points class"""
    def __init__(self):
        # World coordinates
        self.X     = -99.99 
        self.Y     = -99.99
        self.Z     = -99.99
        # Image coordinates
        self.i     = -99
        self.j     = -99
        
class imgRef:
    """Image References for transformations"""
    def __init__(self):
        self.xyMin  = (-99.99,-99.99)
        self.xyMax  = (-99.99,-99.99)
        self.res    = -99.99
        self.ninj   = (-99,-99)# Size of ORIGINAL image
        
class camera:
    """Camera class. contains many informations that could also be used for other purposes"""
    def __init__(self):
        self.position       = []    # usually 3-D vector (numpy array)
        self.angles         = []    # usually 3D vector (numpy array)
        self.intrinsic      = {}    # dict containing intrinsic parameters 
        self.scale          = -99   # used for orthophotographic camera (equals to zoom factor)
        self.fps            = -99 
        self.resolution     = -99   # resolution of the camera (usually in m/pix or pix/m)
        self.resolutionInfo = ""    # enter here the unit of resolution to avoid confusions
        self.imagesize      = ()    # size of image (tuple)